diff --git a/dist/cupertino-pane.esm.js b/dist/cupertino-pane.esm.js index 9f2262cf..a55494c9 100644 --- a/dist/cupertino-pane.esm.js +++ b/dist/cupertino-pane.esm.js @@ -1,5 +1,5 @@ /** - * Cupertino Pane 1.2.7 + * Cupertino Pane 1.2.8 * Multi-functional panes and boards for next generation progressive applications * https://github.com/roman-rr/cupertino-pane/ * diff --git a/dist/cupertino-pane.esm.min.js b/dist/cupertino-pane.esm.min.js new file mode 100644 index 00000000..0a2930ee --- /dev/null +++ b/dist/cupertino-pane.esm.min.js @@ -0,0 +1,28 @@ +/** + * Cupertino Pane 1.2.8 + * Multi-functional panes and boards for next generation progressive applications + * https://github.com/roman-rr/cupertino-pane/ + * + * Copyright 2019-2021 Roman Antonov (roman-rr) + * + * Released under the MIT License + * + * Released on: December 7, 2021 + */ + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +function __awaiter(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{h(i.next(t))}catch(t){r(t)}}function a(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}class Support{static get touch(){return window.Modernizr&&!0===window.Modernizr.touch||!!(window.navigator.maxTouchPoints>0||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)}static get observer(){return"MutationObserver"in window||"WebkitMutationObserver"in window}static get backdropFilter(){return CSS.supports("backdrop-filter","blur(0px)")||CSS.supports("-webkit-backdrop-filter","blur(0px)")}static get passiveListener(){let t=!1;try{const e=Object.defineProperty({},"passive",{get(){t=!0}});window.addEventListener("testPassiveListener",null,e)}catch(t){}return t}static get gestures(){return"ongesturestart"in window}static get pointerEvents(){return!!window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0}}class Device{constructor(){this.ios=!1,this.android=!1,this.androidChrome=!1,this.desktop=!1,this.iphone=!1,this.ipod=!1,this.ipad=!1,this.edge=!1,this.ie=!1,this.firefox=!1,this.macos=!1,this.windows=!1,this.cordova=!(!window.cordova&&!window.phonegap),this.phonegap=!(!window.cordova&&!window.phonegap),this.electron=!1,this.ionic=!!document.querySelector("ion-app");const t=window.navigator.platform,e=window.navigator.userAgent,s=window.screen.width,i=window.screen.height;let n=e.match(/(Android);?[\s\/]+([\d.]+)?/),r=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),a=!this.ipad&&e.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h=e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0,l=e.indexOf("Edge/")>=0,p=e.indexOf("Gecko/")>=0&&e.indexOf("Firefox/")>=0,c="Win32"===t,d=e.toLowerCase().indexOf("electron")>=0,u="MacIntel"===t;!r&&u&&Support.touch&&(1024===s&&1366===i||834===s&&1194===i||834===s&&1112===i||768===s&&1024===i)&&(r=e.match(/(Version)\/([\d.]+)/),u=!1),this.ie=h,this.edge=l,this.firefox=p,n&&!c&&(this.os="android",this.osVersion=n[2],this.android=!0,this.androidChrome=e.toLowerCase().indexOf("chrome")>=0),(r||a||o)&&(this.os="ios",this.ios=!0),a&&!o&&(this.osVersion=a[2].replace(/_/g,"."),this.iphone=!0),r&&(this.osVersion=r[2].replace(/_/g,"."),this.ipad=!0),o&&(this.osVersion=o[3]?o[3].replace(/_/g,"."):null,this.ipod=!0),this.ios&&this.osVersion&&e.indexOf("Version/")>=0&&"10"===this.osVersion.split(".")[0]&&(this.osVersion=e.toLowerCase().split("version/")[1].split(" ")[0]),this.webView=!(!(a||r||o)||!e.match(/.*AppleWebKit(?!.*Safari)/i)&&!window.navigator.standalone)||window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,this.webview=this.webView,this.standalone=this.webView,this.desktop=!(this.ios||this.android)||d,this.desktop&&(this.electron=d,this.macos=u,this.windows=c,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class Events{constructor(t,e,s,i,n){this.instance=t,this.settings=e,this.device=s,this.breakpoints=i,this.transitions=n,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBluredbyMove=!1,this.keyboardVisible=!1,this.isScrolling=!1,this.touchEvents=(()=>{const t=["touchstart","touchmove","touchend","touchcancel"];let e=["mousedown","mousemove","mouseup"];Support.pointerEvents&&(e=["pointerdown","pointermove","pointerup"]);const s={start:t[0],move:t[1],end:t[2],cancel:t[3]},i={start:e[0],move:e[1],end:e[2]};return Support.touch||!this.settings.simulateTouch?s:i})(),this.touchStartCb=t=>this.touchStart(t),this.touchMoveBackdropCb=t=>this.touchMoveBackdrop(t),this.touchMoveCb=t=>this.touchMove(t),this.touchEndCb=t=>this.touchEnd(t),this.onScrollCb=t=>this.onScroll(t),this.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardWillHideCb=t=>this.onKeyboardWillHide(t),this.onWindowResizeCb=t=>this.onWindowResize(t)}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach((t=>{const e=document.querySelector(t);e&&this.eventListeners("addEventListener",e)})):this.eventListeners("addEventListener",this.instance.paneEl),this.settings.topperOverflow&&this.instance.overflowEl.addEventListener("scroll",this.onScrollCb),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.onKeyboardWillHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",(()=>{this.instance.parentEl.scrollTop=0,this.instance.parentEl.parentElement&&(this.instance.parentEl.parentElement.scrollTop=0,this.instance.parentEl.parentElement.parentElement&&(this.instance.parentEl.parentElement.parentElement.scrollTop=0))})),window.addEventListener("resize",this.onWindowResizeCb)}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach((t=>{const e=document.querySelector(t);e&&this.eventListeners("removeEventListener",e)})):this.eventListeners("removeEventListener",this.instance.paneEl),this.settings.topperOverflow&&this.instance.overflowEl.removeEventListener("scroll",this.onScrollCb),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.onKeyboardWillHideCb)),window.removeEventListener("resize",this.onWindowResizeCb)}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}eventListeners(t,e){var s,i,n;if(!Support.touch&&Support.pointerEvents)e[t](this.touchEvents.start,this.touchStartCb,!1),e[t](this.touchEvents.move,this.touchMoveCb,!1),e[t](this.touchEvents.end,this.touchEndCb,!1),null===(s=this.instance.backdropEl)||void 0===s||s[t](this.touchEvents.move,this.touchMoveBackdropCb,!1);else{if(Support.touch){const s=!("touchstart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};e[t](this.touchEvents.start,this.touchStartCb,s),e[t](this.touchEvents.move,this.touchMoveCb,!!Support.passiveListener&&{passive:!1,capture:!1}),e[t](this.touchEvents.end,this.touchEndCb,s),null===(i=this.instance.backdropEl)||void 0===i||i[t](this.touchEvents.move,this.touchMoveBackdropCb,!!Support.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&e[t](this.touchEvents.cancel,this.touchEndCb,s)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(e[t]("mousedown",this.touchStartCb,!1),e[t]("mousemove",this.touchMoveCb,!1),e[t]("mouseup",this.touchEndCb,!1),null===(n=this.instance.backdropEl)||void 0===n||n[t]("mousemove",this.touchMoveBackdropCb,!1))}this.settings.preventClicks&&e[t]("click",this.onClickCb,!0)}touchStart(t){if(this.settings.onDragStart(t),this.allowClick=!0,this.instance.disableDragEvents)return;this.disableDragAngle=!1,this.isScrolling=!1,this.instance.preventedDismiss=!1;const{clientY:e,clientX:s}=this.getEvetClientYX(t,"touchstart");this.startY=e,this.startX=s,"mousedown"===t.type&&(this.pointerDown=!0),this.contentScrollTop&&this.willScrolled(t)&&(this.startY+=this.contentScrollTop),this.steps.push({posY:this.startY,time:Date.now()})}touchMoveBackdrop(t){this.settings.touchMoveStopPropagation&&t.stopPropagation()}touchMove(t){var e;const{clientY:s,clientX:i,velocityY:n}=this.getEvetClientYX(t,"touchmove");if(t.delta=(null===(e=this.steps[0])||void 0===e?void 0:e.posY)-s,this.settings.onDrag(t),this.allowClick=!1,this.isFormElement(t.target)&&this.isElementScrollable(t.target))return;if(this.instance.disableDragEvents)return void(this.steps=[]);if(this.disableDragAngle)return;if(this.instance.preventedDismiss)return;if(this.settings.touchMoveStopPropagation&&t.stopPropagation(),"mousemove"===t.type&&!this.pointerDown)return;const r=s-this.steps[this.steps.length-1].posY;if(!Math.abs(r))return;let o=this.instance.getPanelTransformY()+r;if(this.steps.length<2){n<1&&(o=this.instance.getPanelTransformY()+r*n);let t=new WebKitCSSMatrix(window.getComputedStyle(this.instance.paneEl).transform).m42-this.instance.getPanelTransformY();Math.abs(t)&&(o+=t)}if(this.steps.length>2&&this.isFormElement(document.activeElement)&&!this.isFormElement(t.target)&&(document.activeElement.blur(),this.inputBluredbyMove=!0),this.settings.touchAngle&&!this.isScrolling){let t;const e=i-this.startX,n=s-this.startY;if(t=180*Math.atan2(Math.abs(n),Math.abs(e))/Math.PI,e*e+n*n>=25&&90-t>this.settings.touchAngle&&1===this.steps.length)return void(this.disableDragAngle=!0)}if("auto"===this.instance.overflowEl.style.overflowY){if(this.settings.inverse&&this.willScrolled(t))return void(this.contentScrollTop=0);if(!this.settings.inverse&&this.contentScrollTop>0)return}let a=this.handleTopperLowerPositions({clientX:i,clientY:s,newVal:o,diffY:r});if(a&&(o=a),this.instance.getPanelTransformY()!==o){if(!this.instance.preventedDismiss&&this.instance.preventDismissEvent&&this.settings.bottomClose){let t=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.topper/-8;if(o=this.instance.getPanelTransformY()+r*(.5-t),-1*(s-220-this.instance.screen_height)<=this.instance.screen_height-this.breakpoints.bottomer)return this.instance.preventedDismiss=!0,this.settings.onWillDismiss({prevented:!0}),void this.instance.moveToBreak(this.breakpoints.prevBreakpoint)}this.instance.checkOpacityAttr(o),this.instance.checkOverflowAttr(o),this.transitions.doTransition({type:"move",translateY:o}),this.steps.push({posY:s,time:Date.now()})}}touchEnd(t){var e,s;if(this.instance.disableDragEvents)return;"mouseup"===t.type&&(this.pointerDown=!1);let i=this.breakpoints.getClosestBreakY();const n=(null===(e=this.steps[this.steps.length-1])||void 0===e?void 0:e.posY)-(null===(s=this.steps[this.steps.length-2])||void 0===s?void 0:s.posY),r=window.hasOwnProperty("cordova")?this.settings.fastSwipeSensivity+2:this.settings.fastSwipeSensivity;if(Math.abs(n)>=r&&(i=this.instance.swipeNextPoint(n,r,i),this.settings.fastSwipeClose&&this.breakpoints.currentBreakpointthis.fixAndroidResize()),20),this.breakpoints.prevBreakpoint=Object.entries(this.breakpoints.breaks).find((t=>t[1]===this.instance.getPanelTransformY()))[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;window.matchMedia("(orientation: landscape)").matches&&(e=this.instance.screen_height),e>this.instance.screen_height-80&&(e=this.instance.screen_height-80),e-50>=this.settings.breaks[this.instance.currentBreak()].height&&this.instance.moveToHeight(e)}onKeyboardWillHide(t){this.isOnViewport()&&(this.device.android&&this.fixAndroidResize(),this.inputBluredbyMove?this.inputBluredbyMove=!1:this.instance.isHidden()||this.instance.moveToBreak(this.breakpoints.prevBreakpoint))}onWindowResize(t){return __awaiter(this,void 0,void 0,(function*(){this.isFormElement(document.activeElement)||(this.isFormElement(document.activeElement)||!this.keyboardVisible?(yield new Promise((t=>setTimeout((()=>t(!0)),150))),this.instance.updateScreenHeights(),this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints))):this.keyboardVisible=!1)}))}handleTopperLowerPositions(t){if(!this.settings.inverse){if(!this.settings.upperThanTop&&t.newVal<=this.breakpoints.topper)return this.breakpoints.topper;if(this.settings.upperThanTop&&(t.newVal<=this.breakpoints.topper||this.startPointOverTop)){this.startPointOverTop||(this.startPointOverTop=t.clientY),this.startPointOverTop=this.breakpoints.bottomer)return this.breakpoints.bottomer}if(this.settings.inverse){if(this.settings.upperThanTop&&(t.newVal>=this.breakpoints.topper||this.startPointOverTop)){this.startPointOverTop||(this.startPointOverTop=t.clientY),this.startPointOverTop>t.clientY&&delete this.startPointOverTop;const e=this.instance.screen_height-this.instance.screenHeightOffset,s=(e-this.instance.getPanelTransformY())/(e-this.breakpoints.topper)/8;return this.instance.getPanelTransformY()+t.diffY*s}if(!this.settings.upperThanTop&&t.newVal>=this.breakpoints.topper)return this.breakpoints.topper}}getEvetClientYX(t,e){var s,i;const n=t.type===e&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),r=t.type===e?n.clientY:t.clientY,o=t.type===e?n.clientX:t.clientX,a=Date.now()-((null===(s=this.steps[this.steps.length-1])||void 0===s?void 0:s.time)||0);return{clientY:r,clientX:o,velocityY:Math.abs(r-((null===(i=this.steps[this.steps.length-1])||void 0===i?void 0:i.posY)||0))/a}}fixAndroidResize(){this.instance.paneEl&&(document.querySelector("ion-app"),window.requestAnimationFrame((()=>{this.instance.wrapperEl.style.width="100%",this.instance.paneEl.style.position="absolute",window.requestAnimationFrame((()=>{this.instance.wrapperEl.style.width="unset",this.instance.paneEl.style.position="fixed"}))})))}willScrolled(t){return!(!this.isElementScrollable(this.instance.overflowEl)||"hidden"===this.instance.overflowEl.style.overflow)}isPaneDescendant(t){if(!t)return!1;let e=t.parentNode;for(;null!=e;){if(e==this.instance.paneEl)return!0;e=e.parentNode}return!1}isFormElement(t){return!!(t&&t.tagName&&["input","select","option","textarea","button","label"].includes(t.tagName.toLowerCase()))}isElementScrollable(t){return t.scrollHeight>t.clientHeight}isOnViewport(){return!this.instance.paneEl||0!==this.instance.paneEl.offsetWidth||0!==this.instance.paneEl.offsetHeight}}class Settings{constructor(){this.instance={initialBreak:"middle",inverse:!1,parentElement:null,followerElement:null,cssClass:null,fitHeight:!1,maxFitHeight:null,fitScreenHeight:!0,backdrop:!1,backdropOpacity:.4,animationType:"ease",animationDuration:300,dragBy:null,bottomOffset:0,bottomClose:!1,fastSwipeClose:!1,fastSwipeSensivity:3,freeMode:!1,buttonDestroy:!0,buttonClose:!0,topperOverflow:!0,topperOverflowOffset:0,lowerThanBottom:!0,upperThanTop:!1,showDraggable:!0,draggableOver:!1,clickBottomOpen:!0,preventClicks:!0,handleKeyboard:!0,simulateTouch:!0,passiveListeners:!0,touchMoveStopPropagation:!1,touchAngle:45,breaks:{},zStack:null,onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class Breakpoints{constructor(t,e){this.instance=t,this.settings=e,this.breaks={},this.calcHeightInProcess=!1,this.brs=[],this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}}}buildBreakpoints(t,e=0){var s,i,n,r,o;return __awaiter(this,void 0,void 0,(function*(){if(this.settings.bottomOffset=e||this.settings.bottomOffset,this.breaks={top:this.instance.screenHeightOffset,middle:this.instance.screenHeightOffset,bottom:this.instance.screenHeightOffset},this.settings.fitHeight){this.settings.fitScreenHeight=!1,this.settings.initialBreak="top",this.settings.topperOverflow=!1;let e=yield this.getPaneFitHeight();this.settings.maxFitHeight&&e>this.settings.maxFitHeight&&(e=this.settings.maxFitHeight,this.settings.topperOverflow=!0),(t={top:{enabled:!0,height:e},middle:{enabled:!1}}).top.bounce=null===(i=null===(s=this.settings.breaks)||void 0===s?void 0:s.top)||void 0===i?void 0:i.bounce,t.bottom=(null===(n=this.settings.breaks)||void 0===n?void 0:n.bottom)||{enabled:!0,height:0}}if(["top","middle","bottom"].forEach((e=>{var s;this.breaks[e]-=this.settings.bottomOffset,this.settings.breaks[e]||(this.settings.breaks[e]=this.defaultBreaksConf[e]),t&&t[e]&&(this.settings.breaks[e]=t[e]),this.settings.fitScreenHeight&&((null===(s=this.settings.breaks[e])||void 0===s?void 0:s.height)>this.instance.screen_height&&(this.settings.breaks[e].height=this.instance.screen_height-this.settings.bottomOffset),this.settings.breaks.top&&this.settings.breaks.middle&&this.settings.breaks.top.height-50<=this.settings.breaks.middle.height&&(this.settings.breaks.middle.enabled=!1,this.settings.initialBreak="top")),this.settings.fitHeight&&"top"===e&&(this.settings.breaks[e].height>this.instance.screen_height?(this.settings.breaks[e].height=this.instance.screen_height-2*this.settings.bottomOffset,this.settings.topperOverflow=!0):this.instance.overflowEl&&!this.settings.maxFitHeight&&(this.settings.topperOverflow=!1,this.instance.overflowEl.style.overflowY="hidden")),this.settings.breaks[e]&&this.settings.breaks[e].enabled&&this.settings.breaks[e].height&&(this.settings.inverse?this.breaks[e]=this.settings.breaks[e].height+this.settings.bottomOffset:this.breaks[e]-=this.settings.breaks[e].height)})),this.lockedBreakpoints||(this.lockedBreakpoints=JSON.stringify(this.settings.breaks)),this.instance.isPanePresented()||this.settings.breaks[this.settings.initialBreak].enabled||console.warn("Cupertino Pane: Please set initialBreak for enabled breakpoint"),this.settings.breaks.middle.height>=this.settings.breaks.top.height&&console.warn("Cupertino Pane: Please set middle height lower than top height"),this.settings.breaks.middle.height<=this.settings.breaks.bottom.height&&console.warn("Cupertino Pane: Please set bottom height lower than middle height"),this.brs=[],["top","middle","bottom"].forEach((t=>{this.settings.breaks[t].enabled&&this.brs.push(this.breaks[t])})),this.topper=this.brs.reduce(((t,e)=>eMath.abs(e)>Math.abs(t)?e:t)),this.settings.inverse&&(this.topper=this.bottomer),this.instance.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak],!this.settings.inverse||this.settings.breaks.bottom.enabled||this.settings.breaks.middle.enabled||(this.settings.topperOverflow=!1)),this.instance.isPanePresented()){if((null===(r=this.settings.breaks[this.prevBreakpoint])||void 0===r?void 0:r.enabled)&&(this.instance.isHidden()||this.instance.moveToBreak(this.prevBreakpoint,this.settings.inverse&&"move")),!(null===(o=this.settings.breaks[this.prevBreakpoint])||void 0===o?void 0:o.enabled)&&!this.instance.isHidden()){let t=this.instance.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find((e=>e[1]===t));this.instance.moveToBreak(e[0])}this.instance.paneEl.style.top=this.settings.inverse?`-${this.bottomer-this.settings.bottomOffset}px`:"unset",this.instance.paneEl.style.height=`${this.instance.getPaneHeight()}px`,this.instance.scrollElementInit(),this.instance.checkOpacityAttr(this.currentBreakpoint),this.instance.checkOverflowAttr(this.currentBreakpoint)}}))}getCurrentBreakName(){return this.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null}getPaneFitHeight(){return __awaiter(this,void 0,void 0,(function*(){this.calcHeightInProcess=!0;let t,e=this.instance.el.querySelectorAll("img");this.instance.el.style.height="unset",this.instance.rendered||(this.instance.el.style.visibility="hidden",this.instance.el.style.pointerEvents="none",this.instance.el.style.display="block",this.instance.wrapperEl.style.visibility="hidden",this.instance.wrapperEl.style.pointerEvents="none",this.instance.wrapperEl.style.display="block");let s=[];e.length&&(s=Array.from(e).map((t=>new Promise((e=>{t.complete&&t.naturalHeight?e(!0):t.onload=()=>e(!0)}))))),s.push(new Promise((t=>setTimeout((()=>t(!0)),this.instance.rendered?0:150)))),yield Promise.all(s);let i=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("height")),n=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-bottom")),r=parseInt(document.defaultView.getComputedStyle(this.instance.el.parentElement,"").getPropertyValue("padding-bottom"));return t=i+n,t+=this.instance.el.offsetTop,t+=r,this.instance.rendered||(this.instance.el.style.visibility="unset",this.instance.el.style.pointerEvents="unset",this.instance.el.style.display="none",this.instance.wrapperEl.style.visibility="unset",this.instance.wrapperEl.style.pointerEvents="unset",this.instance.wrapperEl.style.display="none"),this.calcHeightInProcess=!1,t}))}getClosestBreakY(){return this.brs.reduce(((t,e)=>Math.abs(e-this.instance.getPanelTransformY())__awaiter(this,void 0,void 0,(function*(){var s;if("move"===t.type)return this.instance.paneEl.style.transition="all 0ms linear 0ms",this.instance.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.instance.followerEl&&(this.instance.followerEl.style.transition="all 0ms linear 0ms",this.instance.followerEl.style.transform=`translateY(${t.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`),this.settings.zStack&&this.settings.zStack.pushElements.forEach((t=>this.zStack.pushTransition(document.querySelector(t),this.instance.getPanelTransformY(),"all 0ms linear 0ms"))),e(!0);const i=()=>("destroy"===t.type&&this.instance.destroyResets(),this.instance.paneEl.style.transition="initial",this.instance.followerEl&&(this.instance.followerEl.style.transition="initial"),this.settings.backdrop&&("destroy"!==t.type&&"hide"!==t.type||(this.instance.backdropEl.style.transition="initial",this.instance.backdropEl.style.display="none")),"present"===t.type&&this.settings.onDidPresent(),"destroy"===t.type&&this.settings.onDidDismiss({destroyButton:t.destroyButton}),this.settings.onTransitionEnd({target:document.body.contains(this.instance.paneEl)?this.instance.paneEl:null}),this.instance.paneEl.removeEventListener("transitionend",i),e(!0));if("breakpoint"===t.type||"end"===t.type||"present"===t.type||"hide"===t.type||"destroy"===t.type){if(this.settings.backdrop&&(this.instance.isHidden()||"hide"===t.type||"destroy"===t.type||"present"===t.type)&&(this.instance.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",this.instance.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,"hide"!==t.type&&"destroy"!==t.type&&(this.instance.backdropEl.style.display="block",setTimeout((()=>{this.instance.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`}),50))),"end"===t.type&&this.settings.freeMode)return e(!0);const n=Object.entries(this.breakpoints.breaks).find((e=>e[1]===t.translateY));let r=n&&(null===(s=this.settings.breaks[n[0]])||void 0===s?void 0:s.bounce);this.instance.paneEl.style.transition=this.buildTransitionValue(r),this.instance.followerEl&&(this.instance.followerEl.style.transition=this.buildTransitionValue(r)),this.settings.zStack&&setTimeout((()=>{this.settings.zStack.pushElements.forEach((e=>this.zStack.pushTransition(document.querySelector(e),t.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)))}),this.settings.zStack.cardYOffset&&"present"===t.type?100:0),this.settings.onTransitionStart({translateY:{new:t.translateY}}),this.instance.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.instance.followerEl&&(this.instance.followerEl.style.transform=`translateY(${t.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`);let o=Object.entries(this.breakpoints.breaks).find((e=>e[1]===t.translateY));o&&(this.breakpoints.prevBreakpoint=o[0]),this.instance.paneEl.addEventListener("transitionend",i)}}))))}buildTransitionValue(t){return t?"all 300ms cubic-bezier(.155,1.105,.295,1.12)":`all ${this.settings.animationDuration}ms ${this.settings.animationType}`}}class ZStack{constructor(t,e,s){this.instance=t,this.settings=e,this.breakpoints=s,this.zStackDefaults={pushElements:null,minPushHeight:null,cardYOffset:0,cardZScale:.93,cardContrast:.85,stackZAngle:160}}pushTransition(t,e,s){let i=this.settings.zStack.pushElements;t.style.transition=s,e=this.instance.screenHeightOffset-e;const n=this.settings.zStack.minPushHeight?this.settings.zStack.minPushHeight:this.instance.screenHeightOffset-this.breakpoints.bottomer,r=this.instance.screenHeightOffset-this.breakpoints.topper;let o=this.getPushMulitplicator(t),a=Math.pow(this.settings.zStack.cardZScale,o),h=Math.pow(this.settings.zStack.cardZScale,o-1),l=6+this.settings.zStack.cardYOffset,p=l*o*-1,c=p+l,d=Math.pow(this.settings.zStack.cardContrast,o),u=Math.pow(this.settings.zStack.cardContrast,o-1);const g=(s,n,r,o)=>{let a=Math.pow(s,this.settings.zStack.stackZAngle/100);t.style.transform=`translateY(${n*(a/s)}px) scale(${s})`,t.style.borderRadius=`${o}px`,t.style.filter=`contrast(${r})`;let h=document.querySelector(i[i.length-1]);e||t.className!==h.className||this.clearPushMultiplicators()};if(e<=n)return void g(h,c,u,0);const b=(t,s)=>{let i=-1*(r*s-n*t);return i-=(t-s)*e,i/=n-r,i>s&&(i=s),i{let e=document.querySelector(t),s=this.getPushMulitplicator(e);s=s?s+1:1,e.style.setProperty("--push-multiplicator",`${s}`)}))}getPushMulitplicator(t){let e=t.style.getPropertyValue("--push-multiplicator");return parseInt(e)}clearPushMultiplicators(){for(let t=0;t{let i={},n={};if(this.settings.inverse?(i.top=this.breakpoints.breaks.bottom,i.middle=this.breakpoints.breaks.middle,i.bottom=this.breakpoints.breaks.top,n.top=Object.assign({},this.settings.breaks.bottom),n.middle=Object.assign({},this.settings.breaks.middle),n.bottom=Object.assign({},this.settings.breaks.top)):(i=Object.assign({},this.breakpoints.breaks),n=Object.assign({},this.settings.breaks)),this.breakpoints.currentBreakpoint===i.top){if(t>e){if(n.middle.enabled)return i.middle;if(n.bottom.enabled)return i.middlee&&n.bottom.enabled?i.bottom:i.middle;if(this.breakpoints.currentBreakpoint===i.bottom){if(t<-e){if(n.middle.enabled)return i.middle>s?s:i.middle;if(n.top.enabled)return i.top}return i.bottom}return s},t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.error("Cupertino Pane: specified selector or DOM element already in use",this.selector):(this.el=this.selector,this.el.style.display="none",this.settings=Object.assign(Object.assign({},this.settings),e),this.settings.parentElement?this.settings.parentElement=document.querySelector(this.settings.parentElement):this.settings.parentElement=this.el.parentElement,this.breakpoints=new Breakpoints(this,this.settings),this.zStack=new ZStack(this,this.settings,this.breakpoints),this.transitions=new Transitions(this,this.settings,this.breakpoints,this.zStack),this.events=new Events(this,this.settings,this.device,this.breakpoints,this.transitions)):console.warn("Cupertino Pane: wrong selector or DOM element specified",this.selector)}drawBaseElements(){this.parentEl=this.settings.parentElement,this.wrapperEl=document.createElement("div"),this.wrapperEl.classList.add("cupertino-pane-wrapper"),this.settings.inverse&&this.wrapperEl.classList.add("inverse"),this.settings.cssClass&&(this.wrapperEl.className+=` ${this.settings.cssClass}`);let t="";t+="\n .cupertino-pane-wrapper {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n }\n ",this.paneEl=document.createElement("div"),this.paneEl.style.transform=`translateY(${this.screenHeightOffset}px) translateZ(0px)`,this.paneEl.classList.add("pane"),t+="\n .cupertino-pane-wrapper .pane {\n position: fixed;\n z-index: 11;\n width: 100%;\n max-width: 500px;\n left: 0px;\n right: 0px;\n margin-left: auto;\n margin-right: auto;\n background: var(--cupertino-pane-background, #ffffff);\n color: var(--cupertino-pane-color, #333333);\n box-shadow: var(--cupertino-pane-shadow, 0 4px 16px rgba(0,0,0,.12));\n will-change: transform;\n padding-top: 15px; \n border-radius: var(--cupertino-pane-border-radius, 20px) \n var(--cupertino-pane-border-radius, 20px) \n 0 0;\n }\n .cupertino-pane-wrapper.inverse .pane {\n padding-bottom: 15px; \n border-radius: 0 0 20px 20px;\n border-radius: 0 0\n var(--cupertino-pane-border-radius, 20px) \n var(--cupertino-pane-border-radius, 20px);\n }\n ",this.draggableEl=document.createElement("div"),this.draggableEl.classList.add("draggable"),this.settings.draggableOver&&this.draggableEl.classList.add("over"),t+="\n .cupertino-pane-wrapper .draggable {\n padding: 5px;\n position: absolute;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n height: 30px;\n z-index: -1;\n top: 0;\n bottom: initial;\n }\n .cupertino-pane-wrapper .draggable.over {\n top: -30px;\n padding: 15px;\n }\n .cupertino-pane-wrapper.inverse .draggable {\n bottom: 0;\n top: initial;\n }\n .cupertino-pane-wrapper.inverse .draggable.over {\n bottom: -30px;\n top: initial;\n }\n ",this.moveEl=document.createElement("div"),this.moveEl.classList.add("move"),t+=`\n .cupertino-pane-wrapper .move {\n margin: 0 auto;\n height: 5px;\n background: var(--cupertino-pane-move-background, #c0c0c0);\n width: 36px;\n border-radius: 4px;\n }\n .cupertino-pane-wrapper .draggable.over .move {\n width: 70px; \n background: var(--cupertino-pane-move-background, rgba(225, 225, 225, 0.6));\n ${Support.backdropFilter?"\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n ":""}\n }\n .cupertino-pane-wrapper.inverse .move {\n margin-top: 15px;\n }\n .cupertino-pane-wrapper.inverse .draggable.over .move {\n margin-top: -5px;\n }\n `,this.destroyButtonEl=document.createElement("div"),this.destroyButtonEl.classList.add("destroy-button"),t+="\n .cupertino-pane-wrapper .destroy-button {\n width: 26px;\n height: 26px;\n position: absolute;\n background: var(--cupertino-pane-destroy-button-background, #ebebeb);\n fill: var(--cupertino-pane-icon-close-color, #7a7a7e);\n right: 20px;\n z-index: 14;\n border-radius: 100%;\n top: 16px;\n }\n ",this.contentEl=this.el,this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",t+="\n .cupertino-pane-wrapper .backdrop {\n overflow: hidden;\n position: fixed;\n width: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n display: none;\n z-index: 10;\n }\n ",this.addStyle(t),this.parentEl.appendChild(this.wrapperEl),this.wrapperEl.appendChild(this.paneEl),this.paneEl.appendChild(this.contentEl),this.settings.showDraggable&&(this.paneEl.appendChild(this.draggableEl),this.draggableEl.appendChild(this.moveEl))}present(t={animate:!1}){var e;return __awaiter(this,void 0,void 0,(function*(){if(this.el&&document.body.contains(this.el))if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else{if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.updateScreenHeights(),this.drawBaseElements(),yield this.setBreakpoints(),this.paneEl.style.height=`${this.getPaneHeight()}px`,this.settings.inverse&&(this.paneEl.style.top=`-${this.breakpoints.bottomer-this.settings.bottomOffset}px`),this.wrapperEl.style.display="block",yield new Promise((t=>setTimeout(t,100))),this.contentEl.style.display="block",this.wrapperEl.classList.add("rendered"),this.rendered=!0,this.settings.followerElement){if(!document.querySelector(this.settings.followerElement))return void console.warn("Cupertino Pane: wrong follower element selector specified",this.settings.followerElement);this.followerEl=document.querySelector(this.settings.followerElement),this.followerEl.style.willChange="transform, border-radius",this.followerEl.style.transform="translateY(0px) translateZ(0px)",this.followerEl.style.transition=this.transitions.buildTransitionValue(null===(e=this.settings.breaks[this.currentBreak()])||void 0===e?void 0:e.bounce)}return this.settings.zStack&&(this.setZstackConfig(this.settings.zStack),this.zStack.setPushMultiplicators()),this.settings.buttonClose&&this.settings.buttonDestroy&&!this.settings.inverse&&(this.paneEl.appendChild(this.destroyButtonEl),this.destroyButtonEl.addEventListener("click",(t=>this.destroy({animate:!0,destroyButton:!0}))),this.destroyButtonEl.innerHTML='\n \n '),this.settings.bottomClose&&(this.settings.breaks.bottom.enabled=!0),this.settings.freeMode&&(this.settings.lowerThanBottom=!1),this.settings.backdrop&&this.renderBackdrop(),this.checkOpacityAttr(this.breakpoints.currentBreakpoint),this.device.android&&(document.body.style.overscrollBehaviorY="none"),t.animate?yield this.transitions.doTransition({type:"present",translateY:this.breakpoints.breaks[this.settings.initialBreak]}):(this.breakpoints.prevBreakpoint=this.settings.initialBreak,this.paneEl.style.transform=`translateY(${this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.backdrop&&(this.backdropEl.style.display="block"),this.settings.zStack&&this.settings.zStack.pushElements.forEach((t=>this.zStack.pushTransition(document.querySelector(t),this.breakpoints.breaks[this.settings.initialBreak],"unset"))),this.settings.onDidPresent()),yield new Promise((t=>setTimeout((()=>t(!0)),150))),this.scrollElementInit(),this.checkOverflowAttr(this.breakpoints.currentBreakpoint),this.events.attachAllEvents(),this}console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}else console.warn("Cupertino Pane: specified DOM element must be attached to the DOM")}))}getPaneHeight(){return this.settings.inverse?this.breakpoints.bottomer-this.settings.bottomOffset:this.screen_height-this.breakpoints.topper-this.settings.bottomOffset}updateScreenHeights(){this.settings.inverse?(this.screen_height=window.innerHeight,this.screenHeightOffset=0):(this.screen_height=window.innerHeight,this.screenHeightOffset=window.innerHeight)}scrollElementInit(){let t=this.el.querySelectorAll("[overflow-y]");!t.length||t.length>1?this.overflowEl=this.contentEl:(this.overflowEl=t[0],this.overflowEl.style.overflowX="hidden"),this.settings.topperOverflow&&(this.settings.upperThanTop&&console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'),this.setOverflowHeight())}setOverflowHeight(t=0){this.settings.inverse?this.overflowEl.style.height=this.getPaneHeight()-30-this.settings.topperOverflowOffset-this.overflowEl.offsetTop+"px":this.overflowEl.style.height=this.getPaneHeight()-this.settings.topperOverflowOffset-this.overflowEl.offsetTop-t+"px"}checkOpacityAttr(t){let e=this.el.querySelectorAll("[hide-on-bottom]");e.length&&(this.settings.inverse||e.forEach((e=>{e.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,e.style.opacity=t>=this.breakpoints.breaks.bottom?"0":"1"})))}checkOverflowAttr(t){this.settings.topperOverflow&&this.overflowEl&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.breakpoints.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.breakpoints.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper.rendered"));return!!t.length&&!!t.find((t=>t.contains(this.selector)))}isBackdropPresented(){return!!document.querySelector(".cupertino-pane-wrapper .backdrop")}renderBackdrop(){this.backdropEl=document.createElement("div"),this.backdropEl.classList.add("backdrop"),this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`,this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.addEventListener("click",(t=>this.settings.onBackdropTap()))}addStyle(t){if(document.querySelector("#cupertino-panes-internal"))return;const e=document.createElement("style");e.id="cupertino-panes-internal",t=t.replace(/\s\s+/g," "),e.textContent=t,document.head.prepend(e)}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||(this.renderBackdrop(),this.events.resetEvents());const e=()=>{this.backdropEl.style.transition="initial",this.backdropEl.style.display="none",this.backdropEl.removeEventListener("transitionend",e)};if(this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",t.show)this.backdropEl.style.display="block",setTimeout((()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`}),50);else{if("none"===this.backdropEl.style.display)return;this.backdropEl.addEventListener("transitionend",e)}}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}setZstackConfig(t){this.settings.zStack=t?Object.assign(Object.assign({},this.zStack.zStackDefaults),t):null}preventDismiss(t=!1){this.preventDismissEvent=t}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setBreakpoints(t,e){return __awaiter(this,void 0,void 0,(function*(){!this.isPanePresented()||t?yield this.breakpoints.buildBreakpoints(t,e):console.warn("Cupertino Pane: Provide any breaks configuration")}))}calcFitHeight(){return __awaiter(this,void 0,void 0,(function*(){return this.wrapperEl&&this.el?this.breakpoints.calcHeightInProcess?(console.warn("Cupertino Pane: calcFitHeight() already in process"),null):void(yield this.breakpoints.buildBreakpoints(this.breakpoints.lockedBreakpoints)):null}))}moveToBreak(t,e="breakpoint"){return __awaiter(this,void 0,void 0,(function*(){return this.isPanePresented()?this.settings.breaks[t].enabled?(this.checkOpacityAttr(this.breakpoints.breaks[t]),this.checkOverflowAttr(this.breakpoints.breaks[t]),yield this.transitions.doTransition({type:e,translateY:this.breakpoints.breaks[t]}),this.breakpoints.currentBreakpoint=this.breakpoints.breaks[t],Promise.resolve(!0)):void console.warn("Cupertino Pane: %s breakpoint disabled",t):(console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null)}))}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToHeight()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.transitions.doTransition({type:"breakpoint",translateY:e})}hide(){return this.isPanePresented()?this.isHidden()?(console.warn("Cupertino Pane: Pane already hidden"),null):void this.transitions.doTransition({type:"hide",translateY:this.screenHeightOffset}):(console.warn("Cupertino Pane: Present pane before call hide()"),null)}isHidden(){return this.isPanePresented()?this.paneEl.style.transform===`translateY(${this.screenHeightOffset}px) translateZ(0px)`:(console.warn("Cupertino Pane: Present pane before call isHidden()"),null)}currentBreak(){return this.isPanePresented()?this.breakpoints.getCurrentBreakName():(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroy(t={animate:!1,destroyButton:!1}){return __awaiter(this,void 0,void 0,(function*(){if(!this.rendered)return console.warn("Cupertino Pane: Present pane before call destroy()"),null;this.preventDismissEvent?this.preventedDismiss||(this.settings.onWillDismiss({prevented:!0}),this.moveToBreak(this.breakpoints.prevBreakpoint)):(this.settings.onWillDismiss(),t.animate?yield this.transitions.doTransition({type:"destroy",translateY:this.screenHeightOffset,destroyButton:t.destroyButton}):(this.destroyResets(),this.settings.onDidDismiss({destroyButton:t.destroyButton})))}))}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.events.detachAllEvents(),this.settings.zStack,delete this.rendered,delete this.breakpoints.prevBreakpoint,this.contentEl.style.display="none"}}export{CupertinoPane}; +//# sourceMappingURL=cupertino-pane.esm.min.js.map \ No newline at end of file diff --git a/dist/cupertino-pane.esm.min.js.map b/dist/cupertino-pane.esm.min.js.map new file mode 100644 index 00000000..be34e950 --- /dev/null +++ b/dist/cupertino-pane.esm.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["0"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","Support","touch","window","navigator","maxTouchPoints","document","observer","backdropFilter","CSS","supports","passiveListener","supportsPassive","opts","Object","defineProperty","get","addEventListener","gestures","pointerEvents","Device","constructor","this","ios","android","androidChrome","desktop","iphone","ipod","ipad","edge","ie","firefox","macos","windows","cordova","phonegap","electron","ionic","querySelector","platform","ua","userAgent","screenWidth","screen","width","screenHeight","height","match","indexOf","toLowerCase","os","osVersion","replace","split","webView","matchMedia","matches","webview","standalone","pixelRatio","devicePixelRatio","Events","instance","settings","device","breakpoints","transitions","allowClick","disableDragAngle","pointerDown","contentScrollTop","steps","inputBluredbyMove","keyboardVisible","isScrolling","touchEvents","touchEventsTouch","start","move","end","cancel","touchEventsDesktop","simulateTouch","touchStartCb","t","touchStart","touchMoveBackdropCb","touchMoveBackdrop","touchMoveCb","touchMove","touchEndCb","touchEnd","onScrollCb","onScroll","onClickCb","onClick","onKeyboardShowCb","onKeyboardShow","onKeyboardWillHideCb","onKeyboardWillHide","onWindowResizeCb","onWindowResize","attachAllEvents","dragBy","forEach","selector","el","eventListeners","paneEl","topperOverflow","overflowEl","handleKeyboard","parentEl","scrollTop","parentElement","detachAllEvents","removeEventListener","resetEvents","type","_a","_b","_c","backdropEl","passiveListeners","passive","capture","preventClicks","onDragStart","disableDragEvents","preventedDismiss","clientY","clientX","getEvetClientYX","startY","startX","willScrolled","push","posY","time","Date","now","touchMoveStopPropagation","stopPropagation","velocityY","delta","onDrag","isFormElement","target","isElementScrollable","diffY","length","Math","abs","newVal","getPanelTransformY","transitionYDiff","WebKitCSSMatrix","getComputedStyle","transform","m42","activeElement","blur","touchAngle","diffX","atan2","PI","style","overflowY","inverse","forceNewVal","handleTopperLowerPositions","preventDismissEvent","bottomClose","differKoef","topper","screen_height","bottomer","onWillDismiss","prevented","moveToBreak","prevBreakpoint","checkOpacityAttr","checkOverflowAttr","doTransition","translateY","closest","getClosestBreakY","diff","swipeNextSensivity","hasOwnProperty","fastSwipeSensivity","swipeNextPoint","fastSwipeClose","currentBreakpoint","destroy","animate","blurTapEvent","onDragEnd","breaks","onTransitionEnd","clickBottomOpen","enabled","preventDefault","stopImmediatePropagation","isPaneDescendant","isOnViewport","setTimeout","fixAndroidResize","entries","find","val","newHeight","currentBreak","keyboardHeight","moveToHeight","isHidden","updateScreenHeights","buildBreakpoints","JSON","parse","lockedBreakpoints","coords","upperThanTop","startPointOverTop","screenDelta","screenHeightOffset","lowerThanBottom","ev","name","targetTouch","targetTouches","changedTouches","timeDiff","requestAnimationFrame","wrapperEl","position","overflow","node","parentNode","tagName","includes","scrollHeight","clientHeight","offsetWidth","offsetHeight","Settings","initialBreak","followerElement","cssClass","fitHeight","maxFitHeight","fitScreenHeight","backdrop","backdropOpacity","animationType","animationDuration","bottomOffset","freeMode","buttonDestroy","buttonClose","topperOverflowOffset","showDraggable","draggableOver","zStack","onDidDismiss","onDidPresent","onWillPresent","onBackdropTap","onTransitionStart","Breakpoints","calcHeightInProcess","brs","defaultBreaksConf","top","innerHeight","middle","bottom","conf","_d","_e","getPaneFitHeight","bounce","stringify","isPanePresented","console","warn","reduce","prev","curr","nextY","nextBreak","getPaneHeight","scrollElementInit","getCurrentBreakName","images","querySelectorAll","rendered","visibility","display","promises","Array","from","map","image","complete","naturalHeight","onload","all","elmHeight","parseInt","defaultView","getPropertyValue","elmMargin","panePaddingBottom","offsetTop","Transitions","params","transition","followerEl","pushElements","item","pushTransition","transitionEnd","destroyResets","destroyButton","body","contains","backgroundColor","buildTransitionValue","cardYOffset","new","getNextBreakpoint","ZStack","zStackDefaults","minPushHeight","cardZScale","cardContrast","stackZAngle","pushElement","newPaneY","topHeight","minHeight","multiplicator","getPushMulitplicator","scaleNew","pow","scaleNormal","pushY","yNew","yNormal","contrastNew","contrastNormal","setStyles","scale","y","contrast","border","exponentAngle","borderRadius","filter","lastPushed","className","clearPushMultiplicators","getXbyY","min","max","setPushMultiplicators","setProperty","i","removeProperty","CupertinoPane","maxDiff","settingsBreaks","assign","HTMLElement","error","events","drawBaseElements","createElement","classList","add","internalStyles","draggableEl","moveEl","destroyButtonEl","contentEl","overflowX","addStyle","appendChild","present","setBreakpoints","willChange","setZstackConfig","innerHTML","renderBackdrop","attrElements","setOverflowHeight","offset","opacity","wrappers","isBackdropPresented","styleString","id","textContent","head","prepend","show","parseFloat","exec","preventDismiss","disableDrag","enableDrag","calcFitHeight","hide","remove"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAASA,UAAUC,EAASC,EAAYC,EAAGC,GAEvC,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,IACvF,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,G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AEjE,KAAM,OAAQkE,WAAYnK,KAAK4M,sBAP3D2D,QAAQC,KAAK,mDACN,MAQftE,WACI,OAAKlM,KAAKsQ,kBAIHtQ,KAAKuF,OAAO0D,MAAMR,YAAc,cAAczI,KAAK4M,yCAHtD2D,QAAQC,KAAK,uDACN,MAIfzE,eACI,OAAK/L,KAAKsQ,kBAIHtQ,KAAK4C,YAAYoO,uBAHpBT,QAAQC,KAAK,2DACN,MAKf3F,QAAQmF,EAAO,CACXlF,SAAS,EACTiI,eAAe,IAEf,OAAOtV,UAAUuC,UAAM,OAAQ,GAAQ,YAGnC,IAAKA,KAAKmR,SAEN,OADAZ,QAAQC,KAAK,sDACN,KAGPxQ,KAAKsJ,oBAEAtJ,KAAK4G,mBACN5G,KAAK0C,SAASkH,cAAc,CAAEC,WAAW,IACzC7J,KAAK8J,YAAY9J,KAAK4C,YAAYmH,kBAK1C/J,KAAK0C,SAASkH,gBAEVoG,EAAKlF,cACC9K,KAAK6C,YAAYqH,aAAa,CAAEjE,KAAM,UAAWkE,WAAYnK,KAAK4M,mBAAoBmG,cAAe/C,EAAK+C,iBAGhH/S,KAAK8S,gBAEL9S,KAAK0C,SAASyM,aAAa,CAAE4D,cAAe/C,EAAK+C,qBAI7DD,gBACI9S,KAAK2F,SAASoR,YAAY/W,KAAK4W,WAC/B5W,KAAKqN,UAAUoL,SAEfzY,KAAKmW,OAAOrQ,kBAER9F,KAAK0C,SAASwM,cAEXlP,KAAKmR,gBACLnR,KAAK4C,YAAYmH,eAExB/J,KAAK4W,UAAU3N,MAAMoI,QAAU,eAI9BwE"} \ No newline at end of file diff --git a/dist/cupertino-pane.js b/dist/cupertino-pane.js index 58a42724..6e1de27a 100644 --- a/dist/cupertino-pane.js +++ b/dist/cupertino-pane.js @@ -1,5 +1,5 @@ /** - * Cupertino Pane 1.2.7 + * Cupertino Pane 1.2.8 * Multi-functional panes and boards for next generation progressive applications * https://github.com/roman-rr/cupertino-pane/ * @@ -1959,3 +1959,4 @@ return CupertinoPane; })); +//# sourceMappingURL=cupertino-pane.js.map diff --git a/dist/cupertino-pane.js.map b/dist/cupertino-pane.js.map new file mode 100644 index 00000000..8130205b --- /dev/null +++ b/dist/cupertino-pane.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cupertino-pane.js.map","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/cupertino-pane.min.js b/dist/cupertino-pane.min.js new file mode 100644 index 00000000..e9fb3749 --- /dev/null +++ b/dist/cupertino-pane.min.js @@ -0,0 +1,28 @@ +/** + * Cupertino Pane 1.2.8 + * Multi-functional panes and boards for next generation progressive applications + * https://github.com/roman-rr/cupertino-pane/ + * + * Copyright 2019-2021 Roman Antonov (roman-rr) + * + * Released under the MIT License + * + * Released on: December 7, 2021 + */ + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).CupertinoPane=e()}(this,(function(){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */function t(t,e,s,i){return new(s||(s=Promise))((function(n,r){function o(t){try{h(i.next(t))}catch(t){r(t)}}function a(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,a)}h((i=i.apply(t,e||[])).next())}))}class e{static get touch(){return window.Modernizr&&!0===window.Modernizr.touch||!!(window.navigator.maxTouchPoints>0||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)}static get observer(){return"MutationObserver"in window||"WebkitMutationObserver"in window}static get backdropFilter(){return CSS.supports("backdrop-filter","blur(0px)")||CSS.supports("-webkit-backdrop-filter","blur(0px)")}static get passiveListener(){let t=!1;try{const e=Object.defineProperty({},"passive",{get(){t=!0}});window.addEventListener("testPassiveListener",null,e)}catch(t){}return t}static get gestures(){return"ongesturestart"in window}static get pointerEvents(){return!!window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>0}}class s{constructor(){this.ios=!1,this.android=!1,this.androidChrome=!1,this.desktop=!1,this.iphone=!1,this.ipod=!1,this.ipad=!1,this.edge=!1,this.ie=!1,this.firefox=!1,this.macos=!1,this.windows=!1,this.cordova=!(!window.cordova&&!window.phonegap),this.phonegap=!(!window.cordova&&!window.phonegap),this.electron=!1,this.ionic=!!document.querySelector("ion-app");const t=window.navigator.platform,s=window.navigator.userAgent,i=window.screen.width,n=window.screen.height;let r=s.match(/(Android);?[\s\/]+([\d.]+)?/),o=s.match(/(iPad).*OS\s([\d_]+)/),a=s.match(/(iPod)(.*OS\s([\d_]+))?/),h=!this.ipad&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),l=s.indexOf("MSIE ")>=0||s.indexOf("Trident/")>=0,c=s.indexOf("Edge/")>=0,p=s.indexOf("Gecko/")>=0&&s.indexOf("Firefox/")>=0,d="Win32"===t,u=s.toLowerCase().indexOf("electron")>=0,g="MacIntel"===t;!o&&g&&e.touch&&(1024===i&&1366===n||834===i&&1194===n||834===i&&1112===n||768===i&&1024===n)&&(o=s.match(/(Version)\/([\d.]+)/),g=!1),this.ie=l,this.edge=c,this.firefox=p,r&&!d&&(this.os="android",this.osVersion=r[2],this.android=!0,this.androidChrome=s.toLowerCase().indexOf("chrome")>=0),(o||h||a)&&(this.os="ios",this.ios=!0),h&&!a&&(this.osVersion=h[2].replace(/_/g,"."),this.iphone=!0),o&&(this.osVersion=o[2].replace(/_/g,"."),this.ipad=!0),a&&(this.osVersion=a[3]?a[3].replace(/_/g,"."):null,this.ipod=!0),this.ios&&this.osVersion&&s.indexOf("Version/")>=0&&"10"===this.osVersion.split(".")[0]&&(this.osVersion=s.toLowerCase().split("version/")[1].split(" ")[0]),this.webView=!(!(h||o||a)||!s.match(/.*AppleWebKit(?!.*Safari)/i)&&!window.navigator.standalone)||window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches,this.webview=this.webView,this.standalone=this.webView,this.desktop=!(this.ios||this.android)||u,this.desktop&&(this.electron=u,this.macos=g,this.windows=d,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class i{constructor(t,s,i,n,r){this.instance=t,this.settings=s,this.device=i,this.breakpoints=n,this.transitions=r,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBluredbyMove=!1,this.keyboardVisible=!1,this.isScrolling=!1,this.touchEvents=(()=>{const t=["touchstart","touchmove","touchend","touchcancel"];let s=["mousedown","mousemove","mouseup"];e.pointerEvents&&(s=["pointerdown","pointermove","pointerup"]);const i={start:t[0],move:t[1],end:t[2],cancel:t[3]},n={start:s[0],move:s[1],end:s[2]};return e.touch||!this.settings.simulateTouch?i:n})(),this.touchStartCb=t=>this.touchStart(t),this.touchMoveBackdropCb=t=>this.touchMoveBackdrop(t),this.touchMoveCb=t=>this.touchMove(t),this.touchEndCb=t=>this.touchEnd(t),this.onScrollCb=t=>this.onScroll(t),this.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardWillHideCb=t=>this.onKeyboardWillHide(t),this.onWindowResizeCb=t=>this.onWindowResize(t)}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach((t=>{const e=document.querySelector(t);e&&this.eventListeners("addEventListener",e)})):this.eventListeners("addEventListener",this.instance.paneEl),this.settings.topperOverflow&&this.instance.overflowEl.addEventListener("scroll",this.onScrollCb),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.onKeyboardWillHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",(()=>{this.instance.parentEl.scrollTop=0,this.instance.parentEl.parentElement&&(this.instance.parentEl.parentElement.scrollTop=0,this.instance.parentEl.parentElement.parentElement&&(this.instance.parentEl.parentElement.parentElement.scrollTop=0))})),window.addEventListener("resize",this.onWindowResizeCb)}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach((t=>{const e=document.querySelector(t);e&&this.eventListeners("removeEventListener",e)})):this.eventListeners("removeEventListener",this.instance.paneEl),this.settings.topperOverflow&&this.instance.overflowEl.removeEventListener("scroll",this.onScrollCb),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.onKeyboardWillHideCb)),window.removeEventListener("resize",this.onWindowResizeCb)}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}eventListeners(t,s){var i,n,r;if(!e.touch&&e.pointerEvents)s[t](this.touchEvents.start,this.touchStartCb,!1),s[t](this.touchEvents.move,this.touchMoveCb,!1),s[t](this.touchEvents.end,this.touchEndCb,!1),null===(i=this.instance.backdropEl)||void 0===i||i[t](this.touchEvents.move,this.touchMoveBackdropCb,!1);else{if(e.touch){const i=!("touchstart"!==this.touchEvents.start||!e.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};s[t](this.touchEvents.start,this.touchStartCb,i),s[t](this.touchEvents.move,this.touchMoveCb,!!e.passiveListener&&{passive:!1,capture:!1}),s[t](this.touchEvents.end,this.touchEndCb,i),null===(n=this.instance.backdropEl)||void 0===n||n[t](this.touchEvents.move,this.touchMoveBackdropCb,!!e.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&s[t](this.touchEvents.cancel,this.touchEndCb,i)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!e.touch&&this.device.ios)&&(s[t]("mousedown",this.touchStartCb,!1),s[t]("mousemove",this.touchMoveCb,!1),s[t]("mouseup",this.touchEndCb,!1),null===(r=this.instance.backdropEl)||void 0===r||r[t]("mousemove",this.touchMoveBackdropCb,!1))}this.settings.preventClicks&&s[t]("click",this.onClickCb,!0)}touchStart(t){if(this.settings.onDragStart(t),this.allowClick=!0,this.instance.disableDragEvents)return;this.disableDragAngle=!1,this.isScrolling=!1,this.instance.preventedDismiss=!1;const{clientY:e,clientX:s}=this.getEvetClientYX(t,"touchstart");this.startY=e,this.startX=s,"mousedown"===t.type&&(this.pointerDown=!0),this.contentScrollTop&&this.willScrolled(t)&&(this.startY+=this.contentScrollTop),this.steps.push({posY:this.startY,time:Date.now()})}touchMoveBackdrop(t){this.settings.touchMoveStopPropagation&&t.stopPropagation()}touchMove(t){var e;const{clientY:s,clientX:i,velocityY:n}=this.getEvetClientYX(t,"touchmove");if(t.delta=(null===(e=this.steps[0])||void 0===e?void 0:e.posY)-s,this.settings.onDrag(t),this.allowClick=!1,this.isFormElement(t.target)&&this.isElementScrollable(t.target))return;if(this.instance.disableDragEvents)return void(this.steps=[]);if(this.disableDragAngle)return;if(this.instance.preventedDismiss)return;if(this.settings.touchMoveStopPropagation&&t.stopPropagation(),"mousemove"===t.type&&!this.pointerDown)return;const r=s-this.steps[this.steps.length-1].posY;if(!Math.abs(r))return;let o=this.instance.getPanelTransformY()+r;if(this.steps.length<2){n<1&&(o=this.instance.getPanelTransformY()+r*n);let t=new WebKitCSSMatrix(window.getComputedStyle(this.instance.paneEl).transform).m42-this.instance.getPanelTransformY();Math.abs(t)&&(o+=t)}if(this.steps.length>2&&this.isFormElement(document.activeElement)&&!this.isFormElement(t.target)&&(document.activeElement.blur(),this.inputBluredbyMove=!0),this.settings.touchAngle&&!this.isScrolling){let t;const e=i-this.startX,n=s-this.startY;if(t=180*Math.atan2(Math.abs(n),Math.abs(e))/Math.PI,e*e+n*n>=25&&90-t>this.settings.touchAngle&&1===this.steps.length)return void(this.disableDragAngle=!0)}if("auto"===this.instance.overflowEl.style.overflowY){if(this.settings.inverse&&this.willScrolled(t))return void(this.contentScrollTop=0);if(!this.settings.inverse&&this.contentScrollTop>0)return}let a=this.handleTopperLowerPositions({clientX:i,clientY:s,newVal:o,diffY:r});if(a&&(o=a),this.instance.getPanelTransformY()!==o){if(!this.instance.preventedDismiss&&this.instance.preventDismissEvent&&this.settings.bottomClose){let t=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.topper/-8;if(o=this.instance.getPanelTransformY()+r*(.5-t),-1*(s-220-this.instance.screen_height)<=this.instance.screen_height-this.breakpoints.bottomer)return this.instance.preventedDismiss=!0,this.settings.onWillDismiss({prevented:!0}),void this.instance.moveToBreak(this.breakpoints.prevBreakpoint)}this.instance.checkOpacityAttr(o),this.instance.checkOverflowAttr(o),this.transitions.doTransition({type:"move",translateY:o}),this.steps.push({posY:s,time:Date.now()})}}touchEnd(t){var e,s;if(this.instance.disableDragEvents)return;"mouseup"===t.type&&(this.pointerDown=!1);let i=this.breakpoints.getClosestBreakY();const n=(null===(e=this.steps[this.steps.length-1])||void 0===e?void 0:e.posY)-(null===(s=this.steps[this.steps.length-2])||void 0===s?void 0:s.posY),r=window.hasOwnProperty("cordova")?this.settings.fastSwipeSensivity+2:this.settings.fastSwipeSensivity;if(Math.abs(n)>=r&&(i=this.instance.swipeNextPoint(n,r,i),this.settings.fastSwipeClose&&this.breakpoints.currentBreakpointthis.fixAndroidResize()),20),this.breakpoints.prevBreakpoint=Object.entries(this.breakpoints.breaks).find((t=>t[1]===this.instance.getPanelTransformY()))[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;window.matchMedia("(orientation: landscape)").matches&&(e=this.instance.screen_height),e>this.instance.screen_height-80&&(e=this.instance.screen_height-80),e-50>=this.settings.breaks[this.instance.currentBreak()].height&&this.instance.moveToHeight(e)}onKeyboardWillHide(t){this.isOnViewport()&&(this.device.android&&this.fixAndroidResize(),this.inputBluredbyMove?this.inputBluredbyMove=!1:this.instance.isHidden()||this.instance.moveToBreak(this.breakpoints.prevBreakpoint))}onWindowResize(e){return t(this,void 0,void 0,(function*(){this.isFormElement(document.activeElement)||(this.isFormElement(document.activeElement)||!this.keyboardVisible?(yield new Promise((t=>setTimeout((()=>t(!0)),150))),this.instance.updateScreenHeights(),this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints))):this.keyboardVisible=!1)}))}handleTopperLowerPositions(t){if(!this.settings.inverse){if(!this.settings.upperThanTop&&t.newVal<=this.breakpoints.topper)return this.breakpoints.topper;if(this.settings.upperThanTop&&(t.newVal<=this.breakpoints.topper||this.startPointOverTop)){this.startPointOverTop||(this.startPointOverTop=t.clientY),this.startPointOverTop=this.breakpoints.bottomer)return this.breakpoints.bottomer}if(this.settings.inverse){if(this.settings.upperThanTop&&(t.newVal>=this.breakpoints.topper||this.startPointOverTop)){this.startPointOverTop||(this.startPointOverTop=t.clientY),this.startPointOverTop>t.clientY&&delete this.startPointOverTop;const e=this.instance.screen_height-this.instance.screenHeightOffset,s=(e-this.instance.getPanelTransformY())/(e-this.breakpoints.topper)/8;return this.instance.getPanelTransformY()+t.diffY*s}if(!this.settings.upperThanTop&&t.newVal>=this.breakpoints.topper)return this.breakpoints.topper}}getEvetClientYX(t,e){var s,i;const n=t.type===e&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),r=t.type===e?n.clientY:t.clientY,o=t.type===e?n.clientX:t.clientX,a=Date.now()-((null===(s=this.steps[this.steps.length-1])||void 0===s?void 0:s.time)||0);return{clientY:r,clientX:o,velocityY:Math.abs(r-((null===(i=this.steps[this.steps.length-1])||void 0===i?void 0:i.posY)||0))/a}}fixAndroidResize(){this.instance.paneEl&&(document.querySelector("ion-app"),window.requestAnimationFrame((()=>{this.instance.wrapperEl.style.width="100%",this.instance.paneEl.style.position="absolute",window.requestAnimationFrame((()=>{this.instance.wrapperEl.style.width="unset",this.instance.paneEl.style.position="fixed"}))})))}willScrolled(t){return!(!this.isElementScrollable(this.instance.overflowEl)||"hidden"===this.instance.overflowEl.style.overflow)}isPaneDescendant(t){if(!t)return!1;let e=t.parentNode;for(;null!=e;){if(e==this.instance.paneEl)return!0;e=e.parentNode}return!1}isFormElement(t){return!!(t&&t.tagName&&["input","select","option","textarea","button","label"].includes(t.tagName.toLowerCase()))}isElementScrollable(t){return t.scrollHeight>t.clientHeight}isOnViewport(){return!this.instance.paneEl||0!==this.instance.paneEl.offsetWidth||0!==this.instance.paneEl.offsetHeight}}class n{constructor(){this.instance={initialBreak:"middle",inverse:!1,parentElement:null,followerElement:null,cssClass:null,fitHeight:!1,maxFitHeight:null,fitScreenHeight:!0,backdrop:!1,backdropOpacity:.4,animationType:"ease",animationDuration:300,dragBy:null,bottomOffset:0,bottomClose:!1,fastSwipeClose:!1,fastSwipeSensivity:3,freeMode:!1,buttonDestroy:!0,buttonClose:!0,topperOverflow:!0,topperOverflowOffset:0,lowerThanBottom:!0,upperThanTop:!1,showDraggable:!0,draggableOver:!1,clickBottomOpen:!0,preventClicks:!0,handleKeyboard:!0,simulateTouch:!0,passiveListeners:!0,touchMoveStopPropagation:!1,touchAngle:45,breaks:{},zStack:null,onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class r{constructor(t,e){this.instance=t,this.settings=e,this.breaks={},this.calcHeightInProcess=!1,this.brs=[],this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}}}buildBreakpoints(e,s=0){var i,n,r,o,a;return t(this,void 0,void 0,(function*(){if(this.settings.bottomOffset=s||this.settings.bottomOffset,this.breaks={top:this.instance.screenHeightOffset,middle:this.instance.screenHeightOffset,bottom:this.instance.screenHeightOffset},this.settings.fitHeight){this.settings.fitScreenHeight=!1,this.settings.initialBreak="top",this.settings.topperOverflow=!1;let t=yield this.getPaneFitHeight();this.settings.maxFitHeight&&t>this.settings.maxFitHeight&&(t=this.settings.maxFitHeight,this.settings.topperOverflow=!0),(e={top:{enabled:!0,height:t},middle:{enabled:!1}}).top.bounce=null===(n=null===(i=this.settings.breaks)||void 0===i?void 0:i.top)||void 0===n?void 0:n.bounce,e.bottom=(null===(r=this.settings.breaks)||void 0===r?void 0:r.bottom)||{enabled:!0,height:0}}if(["top","middle","bottom"].forEach((t=>{var s;this.breaks[t]-=this.settings.bottomOffset,this.settings.breaks[t]||(this.settings.breaks[t]=this.defaultBreaksConf[t]),e&&e[t]&&(this.settings.breaks[t]=e[t]),this.settings.fitScreenHeight&&((null===(s=this.settings.breaks[t])||void 0===s?void 0:s.height)>this.instance.screen_height&&(this.settings.breaks[t].height=this.instance.screen_height-this.settings.bottomOffset),this.settings.breaks.top&&this.settings.breaks.middle&&this.settings.breaks.top.height-50<=this.settings.breaks.middle.height&&(this.settings.breaks.middle.enabled=!1,this.settings.initialBreak="top")),this.settings.fitHeight&&"top"===t&&(this.settings.breaks[t].height>this.instance.screen_height?(this.settings.breaks[t].height=this.instance.screen_height-2*this.settings.bottomOffset,this.settings.topperOverflow=!0):this.instance.overflowEl&&!this.settings.maxFitHeight&&(this.settings.topperOverflow=!1,this.instance.overflowEl.style.overflowY="hidden")),this.settings.breaks[t]&&this.settings.breaks[t].enabled&&this.settings.breaks[t].height&&(this.settings.inverse?this.breaks[t]=this.settings.breaks[t].height+this.settings.bottomOffset:this.breaks[t]-=this.settings.breaks[t].height)})),this.lockedBreakpoints||(this.lockedBreakpoints=JSON.stringify(this.settings.breaks)),this.instance.isPanePresented()||this.settings.breaks[this.settings.initialBreak].enabled||console.warn("Cupertino Pane: Please set initialBreak for enabled breakpoint"),this.settings.breaks.middle.height>=this.settings.breaks.top.height&&console.warn("Cupertino Pane: Please set middle height lower than top height"),this.settings.breaks.middle.height<=this.settings.breaks.bottom.height&&console.warn("Cupertino Pane: Please set bottom height lower than middle height"),this.brs=[],["top","middle","bottom"].forEach((t=>{this.settings.breaks[t].enabled&&this.brs.push(this.breaks[t])})),this.topper=this.brs.reduce(((t,e)=>eMath.abs(e)>Math.abs(t)?e:t)),this.settings.inverse&&(this.topper=this.bottomer),this.instance.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak],!this.settings.inverse||this.settings.breaks.bottom.enabled||this.settings.breaks.middle.enabled||(this.settings.topperOverflow=!1)),this.instance.isPanePresented()){if((null===(o=this.settings.breaks[this.prevBreakpoint])||void 0===o?void 0:o.enabled)&&(this.instance.isHidden()||this.instance.moveToBreak(this.prevBreakpoint,this.settings.inverse&&"move")),!(null===(a=this.settings.breaks[this.prevBreakpoint])||void 0===a?void 0:a.enabled)&&!this.instance.isHidden()){let t=this.instance.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find((e=>e[1]===t));this.instance.moveToBreak(e[0])}this.instance.paneEl.style.top=this.settings.inverse?`-${this.bottomer-this.settings.bottomOffset}px`:"unset",this.instance.paneEl.style.height=`${this.instance.getPaneHeight()}px`,this.instance.scrollElementInit(),this.instance.checkOpacityAttr(this.currentBreakpoint),this.instance.checkOverflowAttr(this.currentBreakpoint)}}))}getCurrentBreakName(){return this.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null}getPaneFitHeight(){return t(this,void 0,void 0,(function*(){this.calcHeightInProcess=!0;let t,e=this.instance.el.querySelectorAll("img");this.instance.el.style.height="unset",this.instance.rendered||(this.instance.el.style.visibility="hidden",this.instance.el.style.pointerEvents="none",this.instance.el.style.display="block",this.instance.wrapperEl.style.visibility="hidden",this.instance.wrapperEl.style.pointerEvents="none",this.instance.wrapperEl.style.display="block");let s=[];e.length&&(s=Array.from(e).map((t=>new Promise((e=>{t.complete&&t.naturalHeight?e(!0):t.onload=()=>e(!0)}))))),s.push(new Promise((t=>setTimeout((()=>t(!0)),this.instance.rendered?0:150)))),yield Promise.all(s);let i=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("height")),n=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-bottom")),r=parseInt(document.defaultView.getComputedStyle(this.instance.el.parentElement,"").getPropertyValue("padding-bottom"));return t=i+n,t+=this.instance.el.offsetTop,t+=r,this.instance.rendered||(this.instance.el.style.visibility="unset",this.instance.el.style.pointerEvents="unset",this.instance.el.style.display="none",this.instance.wrapperEl.style.visibility="unset",this.instance.wrapperEl.style.pointerEvents="unset",this.instance.wrapperEl.style.display="none"),this.calcHeightInProcess=!1,t}))}getClosestBreakY(){return this.brs.reduce(((t,e)=>Math.abs(e-this.instance.getPanelTransformY())t(this,void 0,void 0,(function*(){var t;if("move"===e.type)return this.instance.paneEl.style.transition="all 0ms linear 0ms",this.instance.paneEl.style.transform=`translateY(${e.translateY}px) translateZ(0px)`,this.instance.followerEl&&(this.instance.followerEl.style.transition="all 0ms linear 0ms",this.instance.followerEl.style.transform=`translateY(${e.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`),this.settings.zStack&&this.settings.zStack.pushElements.forEach((t=>this.zStack.pushTransition(document.querySelector(t),this.instance.getPanelTransformY(),"all 0ms linear 0ms"))),s(!0);const i=()=>("destroy"===e.type&&this.instance.destroyResets(),this.instance.paneEl.style.transition="initial",this.instance.followerEl&&(this.instance.followerEl.style.transition="initial"),this.settings.backdrop&&("destroy"!==e.type&&"hide"!==e.type||(this.instance.backdropEl.style.transition="initial",this.instance.backdropEl.style.display="none")),"present"===e.type&&this.settings.onDidPresent(),"destroy"===e.type&&this.settings.onDidDismiss({destroyButton:e.destroyButton}),this.settings.onTransitionEnd({target:document.body.contains(this.instance.paneEl)?this.instance.paneEl:null}),this.instance.paneEl.removeEventListener("transitionend",i),s(!0));if("breakpoint"===e.type||"end"===e.type||"present"===e.type||"hide"===e.type||"destroy"===e.type){if(this.settings.backdrop&&(this.instance.isHidden()||"hide"===e.type||"destroy"===e.type||"present"===e.type)&&(this.instance.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",this.instance.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,"hide"!==e.type&&"destroy"!==e.type&&(this.instance.backdropEl.style.display="block",setTimeout((()=>{this.instance.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`}),50))),"end"===e.type&&this.settings.freeMode)return s(!0);const n=Object.entries(this.breakpoints.breaks).find((t=>t[1]===e.translateY));let r=n&&(null===(t=this.settings.breaks[n[0]])||void 0===t?void 0:t.bounce);this.instance.paneEl.style.transition=this.buildTransitionValue(r),this.instance.followerEl&&(this.instance.followerEl.style.transition=this.buildTransitionValue(r)),this.settings.zStack&&setTimeout((()=>{this.settings.zStack.pushElements.forEach((t=>this.zStack.pushTransition(document.querySelector(t),e.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)))}),this.settings.zStack.cardYOffset&&"present"===e.type?100:0),this.settings.onTransitionStart({translateY:{new:e.translateY}}),this.instance.paneEl.style.transform=`translateY(${e.translateY}px) translateZ(0px)`,this.instance.followerEl&&(this.instance.followerEl.style.transform=`translateY(${e.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`);let o=Object.entries(this.breakpoints.breaks).find((t=>t[1]===e.translateY));o&&(this.breakpoints.prevBreakpoint=o[0]),this.instance.paneEl.addEventListener("transitionend",i)}}))))}buildTransitionValue(t){return t?"all 300ms cubic-bezier(.155,1.105,.295,1.12)":`all ${this.settings.animationDuration}ms ${this.settings.animationType}`}}class a{constructor(t,e,s){this.instance=t,this.settings=e,this.breakpoints=s,this.zStackDefaults={pushElements:null,minPushHeight:null,cardYOffset:0,cardZScale:.93,cardContrast:.85,stackZAngle:160}}pushTransition(t,e,s){let i=this.settings.zStack.pushElements;t.style.transition=s,e=this.instance.screenHeightOffset-e;const n=this.settings.zStack.minPushHeight?this.settings.zStack.minPushHeight:this.instance.screenHeightOffset-this.breakpoints.bottomer,r=this.instance.screenHeightOffset-this.breakpoints.topper;let o=this.getPushMulitplicator(t),a=Math.pow(this.settings.zStack.cardZScale,o),h=Math.pow(this.settings.zStack.cardZScale,o-1),l=6+this.settings.zStack.cardYOffset,c=l*o*-1,p=c+l,d=Math.pow(this.settings.zStack.cardContrast,o),u=Math.pow(this.settings.zStack.cardContrast,o-1);const g=(s,n,r,o)=>{let a=Math.pow(s,this.settings.zStack.stackZAngle/100);t.style.transform=`translateY(${n*(a/s)}px) scale(${s})`,t.style.borderRadius=`${o}px`,t.style.filter=`contrast(${r})`;let h=document.querySelector(i[i.length-1]);e||t.className!==h.className||this.clearPushMultiplicators()};if(e<=n)return void g(h,p,u,0);const b=(t,s)=>{let i=-1*(r*s-n*t);return i-=(t-s)*e,i/=n-r,i>s&&(i=s),i{let e=document.querySelector(t),s=this.getPushMulitplicator(e);s=s?s+1:1,e.style.setProperty("--push-multiplicator",`${s}`)}))}getPushMulitplicator(t){let e=t.style.getPropertyValue("--push-multiplicator");return parseInt(e)}clearPushMultiplicators(){for(let t=0;t{let i={},n={};if(this.settings.inverse?(i.top=this.breakpoints.breaks.bottom,i.middle=this.breakpoints.breaks.middle,i.bottom=this.breakpoints.breaks.top,n.top=Object.assign({},this.settings.breaks.bottom),n.middle=Object.assign({},this.settings.breaks.middle),n.bottom=Object.assign({},this.settings.breaks.top)):(i=Object.assign({},this.breakpoints.breaks),n=Object.assign({},this.settings.breaks)),this.breakpoints.currentBreakpoint===i.top){if(t>e){if(n.middle.enabled)return i.middle;if(n.bottom.enabled)return i.middlee&&n.bottom.enabled?i.bottom:i.middle;if(this.breakpoints.currentBreakpoint===i.bottom){if(t<-e){if(n.middle.enabled)return i.middle>s?s:i.middle;if(n.top.enabled)return i.top}return i.bottom}return s},t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.error("Cupertino Pane: specified selector or DOM element already in use",this.selector):(this.el=this.selector,this.el.style.display="none",this.settings=Object.assign(Object.assign({},this.settings),e),this.settings.parentElement?this.settings.parentElement=document.querySelector(this.settings.parentElement):this.settings.parentElement=this.el.parentElement,this.breakpoints=new r(this,this.settings),this.zStack=new a(this,this.settings,this.breakpoints),this.transitions=new o(this,this.settings,this.breakpoints,this.zStack),this.events=new i(this,this.settings,this.device,this.breakpoints,this.transitions)):console.warn("Cupertino Pane: wrong selector or DOM element specified",this.selector)}drawBaseElements(){this.parentEl=this.settings.parentElement,this.wrapperEl=document.createElement("div"),this.wrapperEl.classList.add("cupertino-pane-wrapper"),this.settings.inverse&&this.wrapperEl.classList.add("inverse"),this.settings.cssClass&&(this.wrapperEl.className+=` ${this.settings.cssClass}`);let t="";t+="\n .cupertino-pane-wrapper {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n }\n ",this.paneEl=document.createElement("div"),this.paneEl.style.transform=`translateY(${this.screenHeightOffset}px) translateZ(0px)`,this.paneEl.classList.add("pane"),t+="\n .cupertino-pane-wrapper .pane {\n position: fixed;\n z-index: 11;\n width: 100%;\n max-width: 500px;\n left: 0px;\n right: 0px;\n margin-left: auto;\n margin-right: auto;\n background: var(--cupertino-pane-background, #ffffff);\n color: var(--cupertino-pane-color, #333333);\n box-shadow: var(--cupertino-pane-shadow, 0 4px 16px rgba(0,0,0,.12));\n will-change: transform;\n padding-top: 15px; \n border-radius: var(--cupertino-pane-border-radius, 20px) \n var(--cupertino-pane-border-radius, 20px) \n 0 0;\n }\n .cupertino-pane-wrapper.inverse .pane {\n padding-bottom: 15px; \n border-radius: 0 0 20px 20px;\n border-radius: 0 0\n var(--cupertino-pane-border-radius, 20px) \n var(--cupertino-pane-border-radius, 20px);\n }\n ",this.draggableEl=document.createElement("div"),this.draggableEl.classList.add("draggable"),this.settings.draggableOver&&this.draggableEl.classList.add("over"),t+="\n .cupertino-pane-wrapper .draggable {\n padding: 5px;\n position: absolute;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n height: 30px;\n z-index: -1;\n top: 0;\n bottom: initial;\n }\n .cupertino-pane-wrapper .draggable.over {\n top: -30px;\n padding: 15px;\n }\n .cupertino-pane-wrapper.inverse .draggable {\n bottom: 0;\n top: initial;\n }\n .cupertino-pane-wrapper.inverse .draggable.over {\n bottom: -30px;\n top: initial;\n }\n ",this.moveEl=document.createElement("div"),this.moveEl.classList.add("move"),t+=`\n .cupertino-pane-wrapper .move {\n margin: 0 auto;\n height: 5px;\n background: var(--cupertino-pane-move-background, #c0c0c0);\n width: 36px;\n border-radius: 4px;\n }\n .cupertino-pane-wrapper .draggable.over .move {\n width: 70px; \n background: var(--cupertino-pane-move-background, rgba(225, 225, 225, 0.6));\n ${e.backdropFilter?"\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n ":""}\n }\n .cupertino-pane-wrapper.inverse .move {\n margin-top: 15px;\n }\n .cupertino-pane-wrapper.inverse .draggable.over .move {\n margin-top: -5px;\n }\n `,this.destroyButtonEl=document.createElement("div"),this.destroyButtonEl.classList.add("destroy-button"),t+="\n .cupertino-pane-wrapper .destroy-button {\n width: 26px;\n height: 26px;\n position: absolute;\n background: var(--cupertino-pane-destroy-button-background, #ebebeb);\n fill: var(--cupertino-pane-icon-close-color, #7a7a7e);\n right: 20px;\n z-index: 14;\n border-radius: 100%;\n top: 16px;\n }\n ",this.contentEl=this.el,this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",t+="\n .cupertino-pane-wrapper .backdrop {\n overflow: hidden;\n position: fixed;\n width: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n display: none;\n z-index: 10;\n }\n ",this.addStyle(t),this.parentEl.appendChild(this.wrapperEl),this.wrapperEl.appendChild(this.paneEl),this.paneEl.appendChild(this.contentEl),this.settings.showDraggable&&(this.paneEl.appendChild(this.draggableEl),this.draggableEl.appendChild(this.moveEl))}present(e={animate:!1}){var s;return t(this,void 0,void 0,(function*(){if(this.el&&document.body.contains(this.el))if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else{if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.updateScreenHeights(),this.drawBaseElements(),yield this.setBreakpoints(),this.paneEl.style.height=`${this.getPaneHeight()}px`,this.settings.inverse&&(this.paneEl.style.top=`-${this.breakpoints.bottomer-this.settings.bottomOffset}px`),this.wrapperEl.style.display="block",yield new Promise((t=>setTimeout(t,100))),this.contentEl.style.display="block",this.wrapperEl.classList.add("rendered"),this.rendered=!0,this.settings.followerElement){if(!document.querySelector(this.settings.followerElement))return void console.warn("Cupertino Pane: wrong follower element selector specified",this.settings.followerElement);this.followerEl=document.querySelector(this.settings.followerElement),this.followerEl.style.willChange="transform, border-radius",this.followerEl.style.transform="translateY(0px) translateZ(0px)",this.followerEl.style.transition=this.transitions.buildTransitionValue(null===(s=this.settings.breaks[this.currentBreak()])||void 0===s?void 0:s.bounce)}return this.settings.zStack&&(this.setZstackConfig(this.settings.zStack),this.zStack.setPushMultiplicators()),this.settings.buttonClose&&this.settings.buttonDestroy&&!this.settings.inverse&&(this.paneEl.appendChild(this.destroyButtonEl),this.destroyButtonEl.addEventListener("click",(t=>this.destroy({animate:!0,destroyButton:!0}))),this.destroyButtonEl.innerHTML='\n \n '),this.settings.bottomClose&&(this.settings.breaks.bottom.enabled=!0),this.settings.freeMode&&(this.settings.lowerThanBottom=!1),this.settings.backdrop&&this.renderBackdrop(),this.checkOpacityAttr(this.breakpoints.currentBreakpoint),this.device.android&&(document.body.style.overscrollBehaviorY="none"),e.animate?yield this.transitions.doTransition({type:"present",translateY:this.breakpoints.breaks[this.settings.initialBreak]}):(this.breakpoints.prevBreakpoint=this.settings.initialBreak,this.paneEl.style.transform=`translateY(${this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.backdrop&&(this.backdropEl.style.display="block"),this.settings.zStack&&this.settings.zStack.pushElements.forEach((t=>this.zStack.pushTransition(document.querySelector(t),this.breakpoints.breaks[this.settings.initialBreak],"unset"))),this.settings.onDidPresent()),yield new Promise((t=>setTimeout((()=>t(!0)),150))),this.scrollElementInit(),this.checkOverflowAttr(this.breakpoints.currentBreakpoint),this.events.attachAllEvents(),this}console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}else console.warn("Cupertino Pane: specified DOM element must be attached to the DOM")}))}getPaneHeight(){return this.settings.inverse?this.breakpoints.bottomer-this.settings.bottomOffset:this.screen_height-this.breakpoints.topper-this.settings.bottomOffset}updateScreenHeights(){this.settings.inverse?(this.screen_height=window.innerHeight,this.screenHeightOffset=0):(this.screen_height=window.innerHeight,this.screenHeightOffset=window.innerHeight)}scrollElementInit(){let t=this.el.querySelectorAll("[overflow-y]");!t.length||t.length>1?this.overflowEl=this.contentEl:(this.overflowEl=t[0],this.overflowEl.style.overflowX="hidden"),this.settings.topperOverflow&&(this.settings.upperThanTop&&console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'),this.setOverflowHeight())}setOverflowHeight(t=0){this.settings.inverse?this.overflowEl.style.height=this.getPaneHeight()-30-this.settings.topperOverflowOffset-this.overflowEl.offsetTop+"px":this.overflowEl.style.height=this.getPaneHeight()-this.settings.topperOverflowOffset-this.overflowEl.offsetTop-t+"px"}checkOpacityAttr(t){let e=this.el.querySelectorAll("[hide-on-bottom]");e.length&&(this.settings.inverse||e.forEach((e=>{e.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,e.style.opacity=t>=this.breakpoints.breaks.bottom?"0":"1"})))}checkOverflowAttr(t){this.settings.topperOverflow&&this.overflowEl&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.breakpoints.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.breakpoints.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper.rendered"));return!!t.length&&!!t.find((t=>t.contains(this.selector)))}isBackdropPresented(){return!!document.querySelector(".cupertino-pane-wrapper .backdrop")}renderBackdrop(){this.backdropEl=document.createElement("div"),this.backdropEl.classList.add("backdrop"),this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`,this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.addEventListener("click",(t=>this.settings.onBackdropTap()))}addStyle(t){if(document.querySelector("#cupertino-panes-internal"))return;const e=document.createElement("style");e.id="cupertino-panes-internal",t=t.replace(/\s\s+/g," "),e.textContent=t,document.head.prepend(e)}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||(this.renderBackdrop(),this.events.resetEvents());const e=()=>{this.backdropEl.style.transition="initial",this.backdropEl.style.display="none",this.backdropEl.removeEventListener("transitionend",e)};if(this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",t.show)this.backdropEl.style.display="block",setTimeout((()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`}),50);else{if("none"===this.backdropEl.style.display)return;this.backdropEl.addEventListener("transitionend",e)}}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}setZstackConfig(t){this.settings.zStack=t?Object.assign(Object.assign({},this.zStack.zStackDefaults),t):null}preventDismiss(t=!1){this.preventDismissEvent=t}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setBreakpoints(e,s){return t(this,void 0,void 0,(function*(){!this.isPanePresented()||e?yield this.breakpoints.buildBreakpoints(e,s):console.warn("Cupertino Pane: Provide any breaks configuration")}))}calcFitHeight(){return t(this,void 0,void 0,(function*(){return this.wrapperEl&&this.el?this.breakpoints.calcHeightInProcess?(console.warn("Cupertino Pane: calcFitHeight() already in process"),null):void(yield this.breakpoints.buildBreakpoints(this.breakpoints.lockedBreakpoints)):null}))}moveToBreak(e,s="breakpoint"){return t(this,void 0,void 0,(function*(){return this.isPanePresented()?this.settings.breaks[e].enabled?(this.checkOpacityAttr(this.breakpoints.breaks[e]),this.checkOverflowAttr(this.breakpoints.breaks[e]),yield this.transitions.doTransition({type:s,translateY:this.breakpoints.breaks[e]}),this.breakpoints.currentBreakpoint=this.breakpoints.breaks[e],Promise.resolve(!0)):void console.warn("Cupertino Pane: %s breakpoint disabled",e):(console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null)}))}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToHeight()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.transitions.doTransition({type:"breakpoint",translateY:e})}hide(){return this.isPanePresented()?this.isHidden()?(console.warn("Cupertino Pane: Pane already hidden"),null):void this.transitions.doTransition({type:"hide",translateY:this.screenHeightOffset}):(console.warn("Cupertino Pane: Present pane before call hide()"),null)}isHidden(){return this.isPanePresented()?this.paneEl.style.transform===`translateY(${this.screenHeightOffset}px) translateZ(0px)`:(console.warn("Cupertino Pane: Present pane before call isHidden()"),null)}currentBreak(){return this.isPanePresented()?this.breakpoints.getCurrentBreakName():(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroy(e={animate:!1,destroyButton:!1}){return t(this,void 0,void 0,(function*(){if(!this.rendered)return console.warn("Cupertino Pane: Present pane before call destroy()"),null;this.preventDismissEvent?this.preventedDismiss||(this.settings.onWillDismiss({prevented:!0}),this.moveToBreak(this.breakpoints.prevBreakpoint)):(this.settings.onWillDismiss(),e.animate?yield this.transitions.doTransition({type:"destroy",translateY:this.screenHeightOffset,destroyButton:e.destroyButton}):(this.destroyResets(),this.settings.onDidDismiss({destroyButton:e.destroyButton})))}))}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.events.detachAllEvents(),this.settings.zStack,delete this.rendered,delete this.breakpoints.prevBreakpoint,this.contentEl.style.display="none"}}})); +//# sourceMappingURL=cupertino-pane.min.js.map \ No newline at end of file diff --git a/dist/cupertino-pane.min.js.map b/dist/cupertino-pane.min.js.map new file mode 100644 index 00000000..5d1ea7b6 --- /dev/null +++ b/dist/cupertino-pane.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":[],"names":[],"mappings":"","file":"cupertino-pane.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 564b40dc..2e588a22 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cupertino-pane", "description": "Multi-functional panes and boards for next generation progressive applications", - "version": "1.2.7", + "version": "1.2.8", "author": "Roman Antonov (roman-rr)", "homepage": "https://github.com/roman-rr/cupertino-pane/", "repository": "roman-rr/cupertino-pane",