From 76d821afc0f52f1a3158790488223c13712d9b06 Mon Sep 17 00:00:00 2001 From: roman-rr Date: Tue, 15 Dec 2020 01:44:12 +0700 Subject: [PATCH] Prevent dismiss gesture issue #87 + release 1.2.0 --- CHANGELOG.md | 20 ++++++++++ README.md | 15 +++++--- dist/cupertino-pane.d.ts | 5 ++- dist/cupertino-pane.esm.bundle.js | 53 +++++++++++++++++++-------- dist/cupertino-pane.esm.bundle.js.map | 2 +- dist/cupertino-pane.js | 53 +++++++++++++++++++-------- dist/cupertino-pane.js.map | 2 +- dist/cupertino-pane.min.js | 4 +- dist/cupertino-pane.min.js.map | 2 +- package.json | 2 +- src/cupertino-pane.ts | 21 +++++++---- src/events.ts | 21 +++++++++++ 12 files changed, 149 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c89bb0e..ece75ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,32 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### BREAKING CHANGES +- Improved `.preventDismiss()` method and gesture [#87](https://github.com/roman-rr/cupertino-pane/issues/87) +```javascript +const settings = { + ... + onWillDismiss: (e) => { + if (e) { + console.log(e.prevented); + } + } +} + +const myPane = new CupertinoPane('.cupertino-pane', settings); +myPane.present({animate: true}); +myPane.preventDismiss(true); +``` + ### Bug Fixes - Fixed `setBreakpoints()` method for inversed pane [#92](https://github.com/roman-rr/cupertino-pane/issues/92) - Fixed `textarea` overflow scroll. Pane disallowed from drag if scroll available and target element is textarea [#88](https://github.com/roman-rr/cupertino-pane/issues/88) - Fixed horizontal scroll inside pane [#102](https://github.com/roman-rr/cupertino-pane/issues/102) - Fixed keyboard issues on Android devices with cordova webview - Fixed drag event and stops laggy on drag pane with touchAngle option [#102](https://github.com/roman-rr/cupertino-pane/issues/102) +- Fixed `onTransitionEnd` callback with top position [#105](https://github.com/roman-rr/cupertino-pane/issues/105) +- Fixed `currentBreak()` detection for `onDragEnd` callbac [#106](https://github.com/roman-rr/cupertino-pane/pull/106) +- Fixed height calculation for overflow element [#104](https://github.com/roman-rr/cupertino-pane/issues/104) ## [1.1.94] - 2020-11-15 diff --git a/README.md b/README.md index f3f88786..a5994b49 100644 --- a/README.md +++ b/README.md @@ -296,19 +296,24 @@ myPane.setBreakpoints({ bottom: { ... } }); ``` -### preventDismiss() -Using in pair with `onWillDismiss()` callback to prevent pane from destroy on custom conditions +### preventDismiss(**boolean = false**) +Use this method to prevent dismiss events. Use `onWillDismiss()` callback to listen if dismiss event prevented. ```javascript const settings = { ... - onWillDismiss: () => { - if (disallowDismiss) { - drawer.preventDismiss(); + onWillDismiss: (e) => { + if (e) { + console.log(e.prevented); } } } + +const myPane = new CupertinoPane('.cupertino-pane', settings); +myPane.present({animate: true}); +myPane.preventDismiss(true); ``` + ## Attributes ### hide-on-bottom Set for element to automaticaly hide on reach bottom breakpoint. diff --git a/dist/cupertino-pane.d.ts b/dist/cupertino-pane.d.ts index dcb40b66..f2b3d867 100644 --- a/dist/cupertino-pane.d.ts +++ b/dist/cupertino-pane.d.ts @@ -12,7 +12,8 @@ export declare class CupertinoPane { screen_height: number; private screenHeightOffset; private rendered; - private preventDismissEvent; + preventDismissEvent: boolean; + preventedDismiss: boolean; private iconCloseColor; private brs; wrapperEl: HTMLDivElement; @@ -71,7 +72,7 @@ export declare class CupertinoPane { /** * Prevent dismiss event */ - preventDismiss(): void; + preventDismiss(val?: boolean): void; /** * Disable pane drag events */ diff --git a/dist/cupertino-pane.esm.bundle.js b/dist/cupertino-pane.esm.bundle.js index 4268bf36..9174cc37 100644 --- a/dist/cupertino-pane.esm.bundle.js +++ b/dist/cupertino-pane.esm.bundle.js @@ -7,7 +7,7 @@ * * Released under the MIT License * - * Released on: December 14, 2020 + * Released on: December 15, 2020 */ class Support { @@ -207,6 +207,8 @@ class Events { this.allowClick = true; // Allow touch angle by default, disallow no move with condition this.disableDragAngle = false; + // Allow pereventDismiss by default + this.instance.preventedDismiss = false; const targetTouch = t.type === 'touchstart' && t.targetTouches && (t.targetTouches[0] || t.changedTouches[0]); const screenY = t.type === 'touchstart' ? targetTouch.clientY : t.clientY; const screenX = t.type === 'touchstart' ? targetTouch.clientX : t.clientX; @@ -233,6 +235,8 @@ class Events { return; if (this.disableDragAngle) return; + if (this.instance.preventedDismiss) + return; if (this.settings.touchMoveStopPropagation) { t.stopPropagation(); } @@ -308,6 +312,20 @@ class Events { this.instance.checkOpacityAttr(newVal); return; } + // Prevent Dismiss gesture + if (!this.instance.preventedDismiss + && this.instance.preventDismissEvent && this.settings.bottomClose) { + let differKoef = ((-this.instance.topper + this.instance.topper - this.instance.getPanelTransformY()) / this.instance.topper) / -8; + newVal = this.instance.getPanelTransformY() + (diffY * (0.5 - differKoef)); + let mousePointY = (t.touches[0].screenY - 220 - this.instance.screen_height) * -1; + if (mousePointY <= this.instance.screen_height - this.instance.bottomer) { + this.instance.preventedDismiss = true; + // Emit event with prevent dismiss + this.settings.onWillDismiss({ prevented: true }); + this.instance.moveToBreak(this.instance.prevBreakpoint); + return; + } + } // Disallow accidentaly clicks while slide gestures this.allowClick = false; this.instance.checkOpacityAttr(newVal); @@ -535,6 +553,7 @@ class CupertinoPane { this.screenHeightOffset = this.screen_height; this.rendered = false; this.preventDismissEvent = false; + this.preventedDismiss = false; this.iconCloseColor = '#7a7a7e'; this.brs = []; this.settings = (new Settings()).instance; @@ -801,8 +820,8 @@ class CupertinoPane { if (this.settings.buttonClose && !this.settings.inverse) { this.paneEl.appendChild(this.closeEl); this.closeEl.addEventListener('click', (t) => this.destroy({ animate: true })); - this.closeEl.innerHTML = ` - + this.closeEl.innerHTML = ` + `; } if (this.settings.bottomClose) { @@ -909,22 +928,22 @@ class CupertinoPane { console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'); } // Good to get rid of timeout - // but render dom take a time + // but render dom take a time if (!this.rendered) { // Timeout, this.overflowEl.offsetTop get time to render setTimeout(() => this.setOverflowHeight(), 150); } else { + // overflowEl is not visible - ignoring execution + if (this.overflowEl.offsetHeight === 0 + && this.overflowEl.offsetWidth === 0) { + return; + } this.setOverflowHeight(); } } } setOverflowHeight(offset = 0) { - const isHidden = this.overflowEl.offsetHeight === 0 && this.overflowEl.offsetWidth === 0; - if (isHidden) { - console.debug("setOverflowHeight(): overflowEl is not visible - ignoring execution"); - return; - } if (!this.settings.inverse) { this.overflowEl.style.height = `${this.getPaneHeight() - this.settings.topperOverflowOffset @@ -1106,8 +1125,8 @@ class CupertinoPane { /** * Prevent dismiss event */ - preventDismiss() { - this.preventDismissEvent = true; + preventDismiss(val = false) { + this.preventDismissEvent = val; } /** * Disable pane drag events @@ -1298,13 +1317,17 @@ class CupertinoPane { console.warn(`Cupertino Pane: Present pane before call destroy()`); return null; } - // Emit event - this.settings.onWillDismiss(); + // Prevent dismiss if (this.preventDismissEvent) { - this.moveToBreak(this.prevBreakpoint); - this.preventDismissEvent = false; + // Emit event with prevent dismiss if not already sent from drag event + if (!this.preventedDismiss) { + this.settings.onWillDismiss({ prevented: true }); + this.moveToBreak(this.prevBreakpoint); + } return; } + // Emit event + this.settings.onWillDismiss(); /****** Animation & Transition ******/ if (conf.animate) { this.doTransition({ type: 'destroy', translateY: this.screenHeightOffset }); diff --git a/dist/cupertino-pane.esm.bundle.js.map b/dist/cupertino-pane.esm.bundle.js.map index 78d6bfb7..aa76d818 100644 --- a/dist/cupertino-pane.esm.bundle.js.map +++ b/dist/cupertino-pane.esm.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"cupertino-pane.esm.bundle.js.map","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/cupertino-pane.js b/dist/cupertino-pane.js index 9fb642e4..a348b37a 100644 --- a/dist/cupertino-pane.js +++ b/dist/cupertino-pane.js @@ -7,7 +7,7 @@ * * Released under the MIT License * - * Released on: December 14, 2020 + * Released on: December 15, 2020 */ @@ -213,6 +213,8 @@ class Events { this.allowClick = true; // Allow touch angle by default, disallow no move with condition this.disableDragAngle = false; + // Allow pereventDismiss by default + this.instance.preventedDismiss = false; const targetTouch = t.type === 'touchstart' && t.targetTouches && (t.targetTouches[0] || t.changedTouches[0]); const screenY = t.type === 'touchstart' ? targetTouch.clientY : t.clientY; const screenX = t.type === 'touchstart' ? targetTouch.clientX : t.clientX; @@ -239,6 +241,8 @@ class Events { return; if (this.disableDragAngle) return; + if (this.instance.preventedDismiss) + return; if (this.settings.touchMoveStopPropagation) { t.stopPropagation(); } @@ -314,6 +318,20 @@ class Events { this.instance.checkOpacityAttr(newVal); return; } + // Prevent Dismiss gesture + if (!this.instance.preventedDismiss + && this.instance.preventDismissEvent && this.settings.bottomClose) { + let differKoef = ((-this.instance.topper + this.instance.topper - this.instance.getPanelTransformY()) / this.instance.topper) / -8; + newVal = this.instance.getPanelTransformY() + (diffY * (0.5 - differKoef)); + let mousePointY = (t.touches[0].screenY - 220 - this.instance.screen_height) * -1; + if (mousePointY <= this.instance.screen_height - this.instance.bottomer) { + this.instance.preventedDismiss = true; + // Emit event with prevent dismiss + this.settings.onWillDismiss({ prevented: true }); + this.instance.moveToBreak(this.instance.prevBreakpoint); + return; + } + } // Disallow accidentaly clicks while slide gestures this.allowClick = false; this.instance.checkOpacityAttr(newVal); @@ -541,6 +559,7 @@ class CupertinoPane { this.screenHeightOffset = this.screen_height; this.rendered = false; this.preventDismissEvent = false; + this.preventedDismiss = false; this.iconCloseColor = '#7a7a7e'; this.brs = []; this.settings = (new Settings()).instance; @@ -807,8 +826,8 @@ class CupertinoPane { if (this.settings.buttonClose && !this.settings.inverse) { this.paneEl.appendChild(this.closeEl); this.closeEl.addEventListener('click', (t) => this.destroy({ animate: true })); - this.closeEl.innerHTML = ` - + this.closeEl.innerHTML = ` + `; } if (this.settings.bottomClose) { @@ -915,22 +934,22 @@ class CupertinoPane { console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'); } // Good to get rid of timeout - // but render dom take a time + // but render dom take a time if (!this.rendered) { // Timeout, this.overflowEl.offsetTop get time to render setTimeout(() => this.setOverflowHeight(), 150); } else { + // overflowEl is not visible - ignoring execution + if (this.overflowEl.offsetHeight === 0 + && this.overflowEl.offsetWidth === 0) { + return; + } this.setOverflowHeight(); } } } setOverflowHeight(offset = 0) { - const isHidden = this.overflowEl.offsetHeight === 0 && this.overflowEl.offsetWidth === 0; - if (isHidden) { - console.debug("setOverflowHeight(): overflowEl is not visible - ignoring execution"); - return; - } if (!this.settings.inverse) { this.overflowEl.style.height = `${this.getPaneHeight() - this.settings.topperOverflowOffset @@ -1112,8 +1131,8 @@ class CupertinoPane { /** * Prevent dismiss event */ - preventDismiss() { - this.preventDismissEvent = true; + preventDismiss(val = false) { + this.preventDismissEvent = val; } /** * Disable pane drag events @@ -1304,13 +1323,17 @@ class CupertinoPane { console.warn(`Cupertino Pane: Present pane before call destroy()`); return null; } - // Emit event - this.settings.onWillDismiss(); + // Prevent dismiss if (this.preventDismissEvent) { - this.moveToBreak(this.prevBreakpoint); - this.preventDismissEvent = false; + // Emit event with prevent dismiss if not already sent from drag event + if (!this.preventedDismiss) { + this.settings.onWillDismiss({ prevented: true }); + this.moveToBreak(this.prevBreakpoint); + } return; } + // Emit event + this.settings.onWillDismiss(); /****** Animation & Transition ******/ if (conf.animate) { this.doTransition({ type: 'destroy', translateY: this.screenHeightOffset }); diff --git a/dist/cupertino-pane.js.map b/dist/cupertino-pane.js.map index 27de167f..32b5f4e6 100644 --- a/dist/cupertino-pane.js.map +++ b/dist/cupertino-pane.js.map @@ -1 +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 index 20520b93..5e5c003a 100644 --- a/dist/cupertino-pane.min.js +++ b/dist/cupertino-pane.min.js @@ -7,8 +7,8 @@ * * Released under the MIT License * - * Released on: December 14, 2020 + * Released on: December 15, 2020 */ -if(!exports)var exports={__esModule:!0};Object.defineProperty(exports,"__esModule",{value:!0});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.]+)?/),o=e.match(/(iPad).*OS\s([\d_]+)/),r=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,c=e.indexOf("Gecko/")>=0&&e.indexOf("Firefox/")>=0,d="Win32"===t,p=e.toLowerCase().indexOf("electron")>=0,u="MacIntel"===t;!o&&u&&Support.touch&&(1024===s&&1366===i||834===s&&1194===i||834===s&&1112===i||768===s&&1024===i)&&(o=e.match(/(Version)\/([\d.]+)/),u=!1),this.ie=h,this.edge=l,this.firefox=c,n&&!d&&(this.os="android",this.osVersion=n[2],this.android=!0,this.androidChrome=e.toLowerCase().indexOf("chrome")>=0),(o||a||r)&&(this.os="ios",this.ios=!0),a&&!r&&(this.osVersion=a[2].replace(/_/g,"."),this.iphone=!0),o&&(this.osVersion=o[2].replace(/_/g,"."),this.ipad=!0),r&&(this.osVersion=r[3]?r[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||o||r)||!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)||p,this.desktop&&(this.electron=p,this.macos=u,this.windows=d,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class Events{constructor(t,e,s){this.instance=t,this.settings=e,this.device=s,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBlured=!1,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.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardHideCb=t=>this.onKeyboardHide(t)}touchStart(t){if(this.settings.onDragStart(t),this.instance.disableDragEvents)return;this.allowClick=!0,this.disableDragAngle=!1;const e="touchstart"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),s="touchstart"===t.type?e.clientY:t.clientY,i="touchstart"===t.type?e.clientX:t.clientX;"mousedown"===t.type&&(this.pointerDown=!0),this.startY=s,this.startX=i,this.isDragScrollabe(t.path||t.composedPath())&&(this.startY+=this.contentScrollTop),this.steps.push(this.startY)}touchMoveBackdrop(t){this.settings.touchMoveStopPropagation&&t.stopPropagation()}touchMove(t){if(this.settings.onDrag(t),this.instance.disableDragEvents)return;if(this.disableDragAngle)return;this.settings.touchMoveStopPropagation&&t.stopPropagation();const e="touchmove"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),s="touchmove"===t.type?e.clientY:t.clientY,i="touchmove"===t.type?e.clientX:t.clientX;if("mousemove"===t.type&&!this.pointerDown)return;let n=s,o=i;const r=n-this.steps[this.steps.length-1];let a=this.instance.getPanelTransformY()+r;if(!this.isFormElement(t.target)||!this.isElementScrollable(t.target)){if(this.steps.length>2&&this.isFormElement(document.activeElement)&&!this.isFormElement(t.target)&&(document.activeElement.blur(),this.inputBlured=!0),this.settings.touchAngle){let t;const e=o-this.startX,s=n-this.startY;if(t=180*Math.atan2(Math.abs(s),Math.abs(e))/Math.PI,e*e+s*s>=25&&90-t>this.settings.touchAngle&&1===this.steps.length)return void(this.disableDragAngle=!0)}if(this.isDragScrollabe(t.path||t.composedPath())&&"auto"===this.instance.overflowEl.style.overflowY){if(this.instance.overflowEl.addEventListener("scroll",t=>{this.contentScrollTop=t.target.scrollTop}),this.settings.inverse&&this.willScrolled(t))return void(this.contentScrollTop=0);if(a>this.instance.topper&&this.contentScrollTop>0||a<=this.instance.topper)return}if(!this.settings.inverse&&!this.settings.upperThanTop&&a<=this.instance.topper)this.instance.paneEl.style.transform=`translateY(${this.instance.topper}px) translateZ(0px)`;else{if(a<=this.instance.topper&&this.settings.upperThanTop){const t=(-this.instance.topper+this.instance.topper-this.instance.getPanelTransformY())/this.instance.topper/-8;a=this.instance.getPanelTransformY()+r*t}if((!this.settings.lowerThanBottom||this.settings.inverse)&&a>=this.instance.bottomer)return this.instance.paneEl.style.transform=`translateY(${this.instance.bottomer}px) translateZ(0px)`,void this.instance.checkOpacityAttr(a);this.allowClick=!1,this.instance.checkOpacityAttr(a),this.instance.checkOverflowAttr(a),this.instance.doTransition({type:"move",translateY:a}),this.steps.push(n)}}}touchEnd(t){if(this.instance.disableDragEvents)return;const e="touchmove"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]);"touchmove"===t.type?e.clientY:t.clientY;"mouseup"===t.type&&(this.pointerDown=!1);let s=this.instance.getClosestBreakY();const i=this.steps[this.steps.length-1]-this.steps[this.steps.length-2],n=window.hasOwnProperty("cordova")?this.settings.fastSwipeSensivity+1:this.settings.fastSwipeSensivity;if(Math.abs(i)>=n&&(s=this.instance.swipeNextPoint(i,n,s),this.settings.fastSwipeClose&&this.instance.currentBreakpointthis.fixAndroidResize(),20),this.instance.prevBreakpoint=Object.entries(this.instance.breaks).find(t=>t[1]===this.instance.getPanelTransformY())[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;if(this.instance.screen_heightthis.instance.overflowEl.scrollTop=document.activeElement.offsetTop)}onKeyboardHide(t){this.device.android&&this.fixAndroidResize(),this.inputBlured?this.inputBlured=!1:this.instance.moveToBreak(this.instance.prevBreakpoint),setTimeout(()=>this.instance.setOverflowHeight())}fixAndroidResize(){if(!this.instance.paneEl)return;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"})})}isDragScrollabe(t){return!!t.find(t=>t===this.instance.overflowEl)}willScrolled(t){return!(!this.isElementScrollable(this.instance.overflowEl)||"hidden"===this.instance.overflowEl.style.overflow||!this.isDragScrollabe(t.path||t.composedPath()))}isFormElement(t){return!!(t&&t.tagName&&["input","select","option","textarea","button","label"].includes(t.tagName.toLowerCase()))}isElementScrollable(t){return t.scrollHeight>t.clientHeight}}class Settings{constructor(){this.instance={initialBreak:"middle",inverse:!1,parentElement:null,followerElement:null,pushElement:null,pushMinHeight:null,pushYOffset:0,backdrop:!1,backdropOpacity:.4,animationType:"ease",animationDuration:300,dragBy:null,bottomOffset:0,darkMode:!1,bottomClose:!1,fastSwipeClose:!1,fastSwipeSensivity:3,freeMode:!1,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:null,breaks:{},onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class CupertinoPane{constructor(t,e={}){this.selector=t,this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}},this.disableDragEvents=!1,this.breaks={},this.screen_height=window.innerHeight,this.screenHeightOffset=this.screen_height,this.rendered=!1,this.preventDismissEvent=!1,this.iconCloseColor="#7a7a7e",this.brs=[],this.settings=(new Settings).instance,this.device=new Device,this.swipeNextPoint=(t,e,s)=>{let i={},n={};if(this.settings.inverse?(i.top=this.breaks.bottom,i.middle=this.breaks.middle,i.bottom=this.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.breaks),n=Object.assign({},this.settings.breaks)),this.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.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},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})(),t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.warn("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.events=new Events(this,this.settings,this.device)):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.className="cupertino-pane-wrapper "+this.el.className,this.wrapperEl.style.position="absolute",this.wrapperEl.style.top="0",this.wrapperEl.style.left="0",this.paneEl=document.createElement("div"),this.paneEl.className="pane",this.paneEl.style.position="fixed",this.paneEl.style.zIndex="11",this.paneEl.style.width="100%",this.paneEl.style.maxWidth="500px",this.paneEl.style.left="0px",this.paneEl.style.right="0px",this.paneEl.style.marginLeft="auto",this.paneEl.style.marginRight="auto",this.paneEl.style.height=this.getPaneHeight()+"px",this.paneEl.style.background="#ffffff",this.paneEl.style.boxShadow="0 4px 16px rgba(0,0,0,.12)",this.paneEl.style.overflow="hidden",this.paneEl.style.willChange="transform",this.paneEl.style.transform=`translateY(${this.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.inverse?(this.paneEl.style.borderBottomLeftRadius="20px",this.paneEl.style.borderBottomRightRadius="20px",this.paneEl.style.paddingBottom="15px",this.paneEl.style.top=`-${this.bottomer}px`):(this.paneEl.style.borderTopLeftRadius="20px",this.paneEl.style.borderTopRightRadius="20px",this.paneEl.style.paddingTop="15px"),this.draggableEl=document.createElement("div"),this.draggableEl.className="draggable",this.draggableEl.style.padding="5px",this.draggableEl.style.position="absolute",this.draggableEl.style.left="0",this.draggableEl.style.right="0",this.draggableEl.style.marginLeft="auto",this.draggableEl.style.marginRight="auto",this.draggableEl.style.height="30px",this.draggableEl.style.zIndex="12",this.settings.inverse?this.draggableEl.style.bottom="0":this.draggableEl.style.top="0",this.moveEl=document.createElement("div"),this.moveEl.className="move",this.moveEl.style.margin="0 auto",this.moveEl.style.height="5px",this.moveEl.style.background="#c0c0c0",this.moveEl.style.width="36px",this.moveEl.style.borderRadius="4px",this.settings.inverse&&(this.moveEl.style.marginTop="15px"),this.contentEl=this.el,this.contentEl.style.display="block",this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",this.closeEl=document.createElement("div"),this.settings.inverse||(this.closeEl.className="close-button",this.closeEl.style.width="26px",this.closeEl.style.height="26px",this.closeEl.style.position="absolute",this.closeEl.style.background="#ebebeb",this.closeEl.style.right="20px",this.closeEl.style.zIndex="14",this.closeEl.style.borderRadius="100%",this.closeEl.style.top="16px"),this.parentEl.appendChild(this.wrapperEl),this.wrapperEl.appendChild(this.paneEl),this.paneEl.appendChild(this.draggableEl),this.paneEl.appendChild(this.contentEl),this.draggableEl.appendChild(this.moveEl)}present(t={animate:!1}){if(this.el)if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.settings.inverse&&(this.screenHeightOffset=0),this.setBreakpoints(),this.drawBaseElements(),this.scrollElementInit(),this.checkOpacityAttr(this.currentBreakpoint),this.checkOverflowAttr(this.currentBreakpoint),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=`all ${this.settings.animationDuration}ms ${this.getTimingFunction(this.settings.breaks[this.currentBreak()].bounce)} 0s`}this.settings.pushElement&&(this.pushElement=document.querySelector(this.settings.pushElement)),this.settings.showDraggable||(this.draggableEl.style.opacity="0"),this.settings.draggableOver&&(this.paneEl.style.background="transparent",this.paneEl.style.boxShadow="none",this.paneEl.style.paddingTop="30px",this.contentEl.style.background="#ffffff",this.contentEl.style.display="block",this.contentEl.style.borderTopLeftRadius="20px",this.contentEl.style.borderTopRightRadius="20px",this.contentEl.style.boxShadow="0 4px 16px rgba(0,0,0,.12)",this.closeEl.style.top="45px",this.draggableEl.style.padding="15px",this.moveEl.style.width="45px",this.moveEl.style.background="rgba(225, 225, 225, 0.6)",Support.backdropFilter&&(this.moveEl.style.backdropFilter="saturate(180%) blur(20px)",this.moveEl.style.webkitBackdropFilter="saturate(180%) blur(20px)")),this.settings.darkMode&&this.setDarkMode({enable:!0}),this.settings.buttonClose&&!this.settings.inverse&&(this.paneEl.appendChild(this.closeEl),this.closeEl.addEventListener("click",t=>this.destroy({animate:!0})),this.closeEl.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.device.android&&(document.body.style.overscrollBehaviorY="none"),this.attachAllEvents(),t.animate?this.doTransition({type:"present",translateY:this.breaks[this.settings.initialBreak]}):(this.settings.pushElement&&this.pushTransition(this.breaks[this.settings.initialBreak],"unset"),this.settings.onDidPresent())}else console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}getPaneHeight(){return this.settings.inverse?this.bottomer+this.settings.bottomOffset:this.screen_height-this.topper-this.settings.bottomOffset}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.attachEvents(e)}):this.attachEvents(this.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.events.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.events.onKeyboardHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",()=>{this.parentEl.scrollTop=0,this.parentEl.parentElement.scrollTop=0,this.parentEl.parentElement.parentElement.scrollTop=0})}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.detachEvents(e)}):this.detachEvents(this.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.events.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.events.onKeyboardHideCb))}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}getClosestBreakY(){return this.brs.reduce((t,e)=>Math.abs(e-this.getPanelTransformY())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.rendered?this.setOverflowHeight():setTimeout(()=>this.setOverflowHeight(),150))}setOverflowHeight(t=0){0===this.overflowEl.offsetHeight&&0===this.overflowEl.offsetWidth?console.debug("setOverflowHeight(): overflowEl is not visible - ignoring execution"):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"}getTimingFunction(t){return t?"cubic-bezier(0.175, 0.885, 0.370, 1.120)":this.settings.animationType}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.breaks.bottom?"0":"1"}))}checkOverflowAttr(t){this.settings.topperOverflow&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper"));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.className="backdrop",this.backdropEl.style.overflow="hidden",this.backdropEl.style.position="fixed",this.backdropEl.style.width="100%",this.backdropEl.style.bottom="0",this.backdropEl.style.right="0",this.backdropEl.style.left="0",this.backdropEl.style.top="0",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.backdropEl.style.display="none",this.backdropEl.style.zIndex="10",this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.style.display="block",this.backdropEl.addEventListener("click",t=>this.settings.onBackdropTap()),this.resetEvents()}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||this.renderBackdrop();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)}}attachEvents(t){var e,s,i;if(!Support.touch&&Support.pointerEvents)t.addEventListener(this.touchEvents.start,this.events.touchStartCb,!1),t.addEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.addEventListener(this.touchEvents.end,this.events.touchEndCb,!1),null===(e=this.backdropEl)||void 0===e||e.addEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1);else{if(Support.touch){const e=!("touchstart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};t.addEventListener(this.touchEvents.start,this.events.touchStartCb,e),t.addEventListener(this.touchEvents.move,this.events.touchMoveCb,!!Support.passiveListener&&{passive:!1,capture:!1}),t.addEventListener(this.touchEvents.end,this.events.touchEndCb,e),null===(s=this.backdropEl)||void 0===s||s.addEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!!Support.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&t.addEventListener(this.touchEvents.cancel,this.events.touchEndCb,e)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(t.addEventListener("mousedown",this.events.touchStartCb,!1),t.addEventListener("mousemove",this.events.touchMoveCb,!1),t.addEventListener("mouseup",this.events.touchEndCb,!1),null===(i=this.backdropEl)||void 0===i||i.addEventListener("mousemove",this.events.touchMoveBackdropCb,!1))}this.settings.preventClicks&&t.addEventListener("click",this.events.onClickCb,!0)}detachEvents(t){var e,s,i;if(!Support.touch&&Support.pointerEvents)t.removeEventListener(this.touchEvents.start,this.events.touchStartCb,!1),t.removeEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.removeEventListener(this.touchEvents.end,this.events.touchEndCb,!1),null===(e=this.backdropEl)||void 0===e||e.removeEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1);else{if(Support.touch){const e=!("onTouchStart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};t.removeEventListener(this.touchEvents.start,this.events.touchStartCb,e),t.removeEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.removeEventListener(this.touchEvents.end,this.events.touchEndCb,e),null===(s=this.backdropEl)||void 0===s||s.removeEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1),this.touchEvents.cancel&&t.removeEventListener(this.touchEvents.cancel,this.events.touchEndCb,e)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(t.removeEventListener("mousedown",this.events.touchStartCb,!1),t.removeEventListener("mousemove",this.events.touchMoveCb,!1),t.removeEventListener("mouseup",this.events.touchEndCb,!1),null===(i=this.backdropEl)||void 0===i||i.removeEventListener("mousemove",this.events.touchMoveBackdropCb,!1))}this.settings.preventClicks&&t.removeEventListener("click",this.events.onClickCb,!0)}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}preventDismiss(){this.preventDismissEvent=!0}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setDarkMode(t={enable:!0}){t.enable?(this.paneEl.style.background="#1c1c1d",this.paneEl.style.color="#ffffff",this.moveEl.style.background="#5a5a5e",this.settings.buttonClose&&(this.closeEl.style.background="#424246",this.iconCloseColor="#a8a7ae")):(this.paneEl.style.background="#ffffff",this.paneEl.style.color="unset",this.moveEl.style.background="#c0c0c0",this.settings.buttonClose&&(this.closeEl.style.background="#ebebeb",this.iconCloseColor="#7a7a7e"))}setBreakpoints(t){if(!this.isPanePresented()||t){if(this.breaks={top:this.screenHeightOffset,middle:this.screenHeightOffset,bottom:this.screenHeightOffset},["top","middle","bottom"].forEach(e=>{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.breaks[e]&&this.settings.breaks[e].enabled&&this.settings.breaks[e].height&&(this.settings.inverse?this.breaks[e]=this.settings.breaks[e].height:this.breaks[e]-=this.settings.breaks[e].height)}),this.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)=>Math.abs(e)Math.abs(e)>Math.abs(t)?e:t),this.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak]),this.isPanePresented()){if(this.settings.breaks[this.prevBreakpoint].enabled&&this.moveToBreak(this.prevBreakpoint),!this.settings.breaks[this.prevBreakpoint].enabled){let t=this.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find(e=>e[1]===t);this.moveToBreak(e[0])}this.paneEl.style.top=this.settings.inverse?`-${this.bottomer}px`:"unset",this.paneEl.style.height=this.getPaneHeight()+"px",this.scrollElementInit(),this.checkOpacityAttr(this.currentBreakpoint),this.checkOverflowAttr(this.currentBreakpoint)}}else console.warn("Cupertino Pane: Provide any breaks configuration")}moveToBreak(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;this.settings.breaks[t].enabled?(this.checkOpacityAttr(this.breaks[t]),this.checkOverflowAttr(this.breaks[t]),this.doTransition({type:"breakpoint",translateY:this.breaks[t]}),this.currentBreakpoint=this.breaks[t]):console.warn("Cupertino Pane: %s breakpoint disabled",t)}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.doTransition({type:"breakpoint",translateY:e})}hide(){return this.isPanePresented()?this.isHidden()?(console.warn("Cupertino Pane: Pane already hidden"),null):void this.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.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null:(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.detachAllEvents(),delete this.rendered,delete this.prevBreakpoint,this.contentEl.style.display="none"}destroy(t={animate:!1}){return this.isPanePresented()?(this.settings.onWillDismiss(),this.preventDismissEvent?(this.moveToBreak(this.prevBreakpoint),void(this.preventDismissEvent=!1)):void(t.animate?this.doTransition({type:"destroy",translateY:this.screenHeightOffset}):(this.destroyResets(),this.settings.onDidDismiss()))):(console.warn("Cupertino Pane: Present pane before call destroy()"),null)}pushTransition(t,e){t=this.screenHeightOffset-t;const s=this.settings.pushMinHeight?this.settings.pushMinHeight:this.screenHeightOffset-this.bottomer,i=this.screenHeightOffset-this.topper;this.pushElement.style.transition=e;const n=(t,e,s,i)=>{this.pushElement.style.transform=`translateY(${e}px) scale(${t})`,this.pushElement.style.borderRadius=s+"px",this.pushElement.style.filter=`contrast(${i})`};if(t<=s)return void n(1,0,0,1);const o=(e,n)=>{let o=-1*(i*n-s*e);return o-=(e-n)*t,o/=s-i,o>n&&(o=n),o{"destroy"===t.type&&this.destroyResets(),this.paneEl.style.transition="initial",this.followerEl&&(this.followerEl.style.transition="initial"),this.settings.backdrop&&("destroy"!==t.type&&"hide"!==t.type||(this.backdropEl.style.transition="initial",this.backdropEl.style.display="none")),"present"===t.type&&this.settings.onDidPresent(),"destroy"===t.type&&this.settings.onDidDismiss(),this.settings.onTransitionEnd({target:document.body.contains(this.paneEl)?this.paneEl:null}),this.paneEl.removeEventListener("transitionend",e)};if("breakpoint"===t.type||"end"===t.type||"present"===t.type||"hide"===t.type||"destroy"===t.type){if(this.settings.backdrop&&(this.isHidden()||"hide"===t.type||"destroy"===t.type||"present"===t.type)&&(this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,"hide"!==t.type&&"destroy"!==t.type&&(this.backdropEl.style.display="block",setTimeout(()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`},50))),"end"===t.type&&this.settings.freeMode)return;const s=Object.entries(this.settings.breaks).find(e=>e[1].height===this.screenHeightOffset-t.translateY),i=this.getTimingFunction(!(!s||!s[1].bounce));this.paneEl.style.transition=`transform ${this.settings.animationDuration}ms ${i} 0s`,this.followerEl&&(this.followerEl.style.transition=`transform ${this.settings.animationDuration}ms ${i} 0s`),this.settings.pushElement&&setTimeout(()=>{this.pushTransition(t.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)},this.settings.pushYOffset?50:0),"present"===t.type?(this.paneEl.style.transform=`translateY(${this.screenHeightOffset}px) translateZ(0px)`,setTimeout(()=>{this.settings.onTransitionStart({translateY:{new:t.translateY}}),this.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.followerEl&&(this.followerEl.style.transform="translateY(0px) translateZ(0px)")},50)):(this.settings.onTransitionStart({translateY:{new:t.translateY}}),this.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.followerEl&&(this.followerEl.style.transform=`translateY(${t.translateY-this.breaks[this.settings.initialBreak]}px) translateZ(0px)`));let n=Object.entries(this.breaks).find(e=>e[1]===t.translateY);return n&&(this.prevBreakpoint=n[0]),void this.paneEl.addEventListener("transitionend",e)}}}exports.CupertinoPane=CupertinoPane; +if(!exports)var exports={__esModule:!0};Object.defineProperty(exports,"__esModule",{value:!0});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.]+)?/),o=e.match(/(iPad).*OS\s([\d_]+)/),r=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,c=e.indexOf("Gecko/")>=0&&e.indexOf("Firefox/")>=0,p="Win32"===t,d=e.toLowerCase().indexOf("electron")>=0,u="MacIntel"===t;!o&&u&&Support.touch&&(1024===s&&1366===i||834===s&&1194===i||834===s&&1112===i||768===s&&1024===i)&&(o=e.match(/(Version)\/([\d.]+)/),u=!1),this.ie=h,this.edge=l,this.firefox=c,n&&!p&&(this.os="android",this.osVersion=n[2],this.android=!0,this.androidChrome=e.toLowerCase().indexOf("chrome")>=0),(o||a||r)&&(this.os="ios",this.ios=!0),a&&!r&&(this.osVersion=a[2].replace(/_/g,"."),this.iphone=!0),o&&(this.osVersion=o[2].replace(/_/g,"."),this.ipad=!0),r&&(this.osVersion=r[3]?r[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||o||r)||!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=p,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class Events{constructor(t,e,s){this.instance=t,this.settings=e,this.device=s,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBlured=!1,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.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardHideCb=t=>this.onKeyboardHide(t)}touchStart(t){if(this.settings.onDragStart(t),this.instance.disableDragEvents)return;this.allowClick=!0,this.disableDragAngle=!1,this.instance.preventedDismiss=!1;const e="touchstart"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),s="touchstart"===t.type?e.clientY:t.clientY,i="touchstart"===t.type?e.clientX:t.clientX;"mousedown"===t.type&&(this.pointerDown=!0),this.startY=s,this.startX=i,this.isDragScrollabe(t.path||t.composedPath())&&(this.startY+=this.contentScrollTop),this.steps.push(this.startY)}touchMoveBackdrop(t){this.settings.touchMoveStopPropagation&&t.stopPropagation()}touchMove(t){if(this.settings.onDrag(t),this.instance.disableDragEvents)return;if(this.disableDragAngle)return;if(this.instance.preventedDismiss)return;this.settings.touchMoveStopPropagation&&t.stopPropagation();const e="touchmove"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]),s="touchmove"===t.type?e.clientY:t.clientY,i="touchmove"===t.type?e.clientX:t.clientX;if("mousemove"===t.type&&!this.pointerDown)return;let n=s,o=i;const r=n-this.steps[this.steps.length-1];let a=this.instance.getPanelTransformY()+r;if(!this.isFormElement(t.target)||!this.isElementScrollable(t.target)){if(this.steps.length>2&&this.isFormElement(document.activeElement)&&!this.isFormElement(t.target)&&(document.activeElement.blur(),this.inputBlured=!0),this.settings.touchAngle){let t;const e=o-this.startX,s=n-this.startY;if(t=180*Math.atan2(Math.abs(s),Math.abs(e))/Math.PI,e*e+s*s>=25&&90-t>this.settings.touchAngle&&1===this.steps.length)return void(this.disableDragAngle=!0)}if(this.isDragScrollabe(t.path||t.composedPath())&&"auto"===this.instance.overflowEl.style.overflowY){if(this.instance.overflowEl.addEventListener("scroll",t=>{this.contentScrollTop=t.target.scrollTop}),this.settings.inverse&&this.willScrolled(t))return void(this.contentScrollTop=0);if(a>this.instance.topper&&this.contentScrollTop>0||a<=this.instance.topper)return}if(!this.settings.inverse&&!this.settings.upperThanTop&&a<=this.instance.topper)this.instance.paneEl.style.transform=`translateY(${this.instance.topper}px) translateZ(0px)`;else{if(a<=this.instance.topper&&this.settings.upperThanTop){const t=(-this.instance.topper+this.instance.topper-this.instance.getPanelTransformY())/this.instance.topper/-8;a=this.instance.getPanelTransformY()+r*t}if((!this.settings.lowerThanBottom||this.settings.inverse)&&a>=this.instance.bottomer)return this.instance.paneEl.style.transform=`translateY(${this.instance.bottomer}px) translateZ(0px)`,void this.instance.checkOpacityAttr(a);if(!this.instance.preventedDismiss&&this.instance.preventDismissEvent&&this.settings.bottomClose){let e=(-this.instance.topper+this.instance.topper-this.instance.getPanelTransformY())/this.instance.topper/-8;if(a=this.instance.getPanelTransformY()+r*(.5-e),-1*(t.touches[0].screenY-220-this.instance.screen_height)<=this.instance.screen_height-this.instance.bottomer)return this.instance.preventedDismiss=!0,this.settings.onWillDismiss({prevented:!0}),void this.instance.moveToBreak(this.instance.prevBreakpoint)}this.allowClick=!1,this.instance.checkOpacityAttr(a),this.instance.checkOverflowAttr(a),this.instance.doTransition({type:"move",translateY:a}),this.steps.push(n)}}}touchEnd(t){if(this.instance.disableDragEvents)return;const e="touchmove"===t.type&&t.targetTouches&&(t.targetTouches[0]||t.changedTouches[0]);"touchmove"===t.type?e.clientY:t.clientY;"mouseup"===t.type&&(this.pointerDown=!1);let s=this.instance.getClosestBreakY();const i=this.steps[this.steps.length-1]-this.steps[this.steps.length-2],n=window.hasOwnProperty("cordova")?this.settings.fastSwipeSensivity+1:this.settings.fastSwipeSensivity;if(Math.abs(i)>=n&&(s=this.instance.swipeNextPoint(i,n,s),this.settings.fastSwipeClose&&this.instance.currentBreakpointthis.fixAndroidResize(),20),this.instance.prevBreakpoint=Object.entries(this.instance.breaks).find(t=>t[1]===this.instance.getPanelTransformY())[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;if(this.instance.screen_heightthis.instance.overflowEl.scrollTop=document.activeElement.offsetTop)}onKeyboardHide(t){this.device.android&&this.fixAndroidResize(),this.inputBlured?this.inputBlured=!1:this.instance.moveToBreak(this.instance.prevBreakpoint),setTimeout(()=>this.instance.setOverflowHeight())}fixAndroidResize(){if(!this.instance.paneEl)return;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"})})}isDragScrollabe(t){return!!t.find(t=>t===this.instance.overflowEl)}willScrolled(t){return!(!this.isElementScrollable(this.instance.overflowEl)||"hidden"===this.instance.overflowEl.style.overflow||!this.isDragScrollabe(t.path||t.composedPath()))}isFormElement(t){return!!(t&&t.tagName&&["input","select","option","textarea","button","label"].includes(t.tagName.toLowerCase()))}isElementScrollable(t){return t.scrollHeight>t.clientHeight}}class Settings{constructor(){this.instance={initialBreak:"middle",inverse:!1,parentElement:null,followerElement:null,pushElement:null,pushMinHeight:null,pushYOffset:0,backdrop:!1,backdropOpacity:.4,animationType:"ease",animationDuration:300,dragBy:null,bottomOffset:0,darkMode:!1,bottomClose:!1,fastSwipeClose:!1,fastSwipeSensivity:3,freeMode:!1,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:null,breaks:{},onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class CupertinoPane{constructor(t,e={}){this.selector=t,this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}},this.disableDragEvents=!1,this.breaks={},this.screen_height=window.innerHeight,this.screenHeightOffset=this.screen_height,this.rendered=!1,this.preventDismissEvent=!1,this.preventedDismiss=!1,this.iconCloseColor="#7a7a7e",this.brs=[],this.settings=(new Settings).instance,this.device=new Device,this.swipeNextPoint=(t,e,s)=>{let i={},n={};if(this.settings.inverse?(i.top=this.breaks.bottom,i.middle=this.breaks.middle,i.bottom=this.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.breaks),n=Object.assign({},this.settings.breaks)),this.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.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},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})(),t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.warn("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.events=new Events(this,this.settings,this.device)):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.className="cupertino-pane-wrapper "+this.el.className,this.wrapperEl.style.position="absolute",this.wrapperEl.style.top="0",this.wrapperEl.style.left="0",this.paneEl=document.createElement("div"),this.paneEl.className="pane",this.paneEl.style.position="fixed",this.paneEl.style.zIndex="11",this.paneEl.style.width="100%",this.paneEl.style.maxWidth="500px",this.paneEl.style.left="0px",this.paneEl.style.right="0px",this.paneEl.style.marginLeft="auto",this.paneEl.style.marginRight="auto",this.paneEl.style.height=this.getPaneHeight()+"px",this.paneEl.style.background="#ffffff",this.paneEl.style.boxShadow="0 4px 16px rgba(0,0,0,.12)",this.paneEl.style.overflow="hidden",this.paneEl.style.willChange="transform",this.paneEl.style.transform=`translateY(${this.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.inverse?(this.paneEl.style.borderBottomLeftRadius="20px",this.paneEl.style.borderBottomRightRadius="20px",this.paneEl.style.paddingBottom="15px",this.paneEl.style.top=`-${this.bottomer}px`):(this.paneEl.style.borderTopLeftRadius="20px",this.paneEl.style.borderTopRightRadius="20px",this.paneEl.style.paddingTop="15px"),this.draggableEl=document.createElement("div"),this.draggableEl.className="draggable",this.draggableEl.style.padding="5px",this.draggableEl.style.position="absolute",this.draggableEl.style.left="0",this.draggableEl.style.right="0",this.draggableEl.style.marginLeft="auto",this.draggableEl.style.marginRight="auto",this.draggableEl.style.height="30px",this.draggableEl.style.zIndex="12",this.settings.inverse?this.draggableEl.style.bottom="0":this.draggableEl.style.top="0",this.moveEl=document.createElement("div"),this.moveEl.className="move",this.moveEl.style.margin="0 auto",this.moveEl.style.height="5px",this.moveEl.style.background="#c0c0c0",this.moveEl.style.width="36px",this.moveEl.style.borderRadius="4px",this.settings.inverse&&(this.moveEl.style.marginTop="15px"),this.contentEl=this.el,this.contentEl.style.display="block",this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",this.closeEl=document.createElement("div"),this.settings.inverse||(this.closeEl.className="close-button",this.closeEl.style.width="26px",this.closeEl.style.height="26px",this.closeEl.style.position="absolute",this.closeEl.style.background="#ebebeb",this.closeEl.style.right="20px",this.closeEl.style.zIndex="14",this.closeEl.style.borderRadius="100%",this.closeEl.style.top="16px"),this.parentEl.appendChild(this.wrapperEl),this.wrapperEl.appendChild(this.paneEl),this.paneEl.appendChild(this.draggableEl),this.paneEl.appendChild(this.contentEl),this.draggableEl.appendChild(this.moveEl)}present(t={animate:!1}){if(this.el)if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.settings.inverse&&(this.screenHeightOffset=0),this.setBreakpoints(),this.drawBaseElements(),this.scrollElementInit(),this.checkOpacityAttr(this.currentBreakpoint),this.checkOverflowAttr(this.currentBreakpoint),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=`all ${this.settings.animationDuration}ms ${this.getTimingFunction(this.settings.breaks[this.currentBreak()].bounce)} 0s`}this.settings.pushElement&&(this.pushElement=document.querySelector(this.settings.pushElement)),this.settings.showDraggable||(this.draggableEl.style.opacity="0"),this.settings.draggableOver&&(this.paneEl.style.background="transparent",this.paneEl.style.boxShadow="none",this.paneEl.style.paddingTop="30px",this.contentEl.style.background="#ffffff",this.contentEl.style.display="block",this.contentEl.style.borderTopLeftRadius="20px",this.contentEl.style.borderTopRightRadius="20px",this.contentEl.style.boxShadow="0 4px 16px rgba(0,0,0,.12)",this.closeEl.style.top="45px",this.draggableEl.style.padding="15px",this.moveEl.style.width="45px",this.moveEl.style.background="rgba(225, 225, 225, 0.6)",Support.backdropFilter&&(this.moveEl.style.backdropFilter="saturate(180%) blur(20px)",this.moveEl.style.webkitBackdropFilter="saturate(180%) blur(20px)")),this.settings.darkMode&&this.setDarkMode({enable:!0}),this.settings.buttonClose&&!this.settings.inverse&&(this.paneEl.appendChild(this.closeEl),this.closeEl.addEventListener("click",t=>this.destroy({animate:!0})),this.closeEl.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.device.android&&(document.body.style.overscrollBehaviorY="none"),this.attachAllEvents(),t.animate?this.doTransition({type:"present",translateY:this.breaks[this.settings.initialBreak]}):(this.settings.pushElement&&this.pushTransition(this.breaks[this.settings.initialBreak],"unset"),this.settings.onDidPresent())}else console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}getPaneHeight(){return this.settings.inverse?this.bottomer+this.settings.bottomOffset:this.screen_height-this.topper-this.settings.bottomOffset}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.attachEvents(e)}):this.attachEvents(this.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.events.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.events.onKeyboardHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",()=>{this.parentEl.scrollTop=0,this.parentEl.parentElement.scrollTop=0,this.parentEl.parentElement.parentElement.scrollTop=0})}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.detachEvents(e)}):this.detachEvents(this.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.events.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.events.onKeyboardHideCb))}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}getClosestBreakY(){return this.brs.reduce((t,e)=>Math.abs(e-this.getPanelTransformY())1?this.overflowEl=this.contentEl:(this.overflowEl=t[0],this.overflowEl.style.overflowX="hidden"),this.settings.topperOverflow)if(this.settings.upperThanTop&&console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'),this.rendered){if(0===this.overflowEl.offsetHeight&&0===this.overflowEl.offsetWidth)return;this.setOverflowHeight()}else setTimeout(()=>this.setOverflowHeight(),150)}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"}getTimingFunction(t){return t?"cubic-bezier(0.175, 0.885, 0.370, 1.120)":this.settings.animationType}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.breaks.bottom?"0":"1"}))}checkOverflowAttr(t){this.settings.topperOverflow&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper"));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.className="backdrop",this.backdropEl.style.overflow="hidden",this.backdropEl.style.position="fixed",this.backdropEl.style.width="100%",this.backdropEl.style.bottom="0",this.backdropEl.style.right="0",this.backdropEl.style.left="0",this.backdropEl.style.top="0",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.backdropEl.style.display="none",this.backdropEl.style.zIndex="10",this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.style.display="block",this.backdropEl.addEventListener("click",t=>this.settings.onBackdropTap()),this.resetEvents()}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||this.renderBackdrop();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)}}attachEvents(t){var e,s,i;if(!Support.touch&&Support.pointerEvents)t.addEventListener(this.touchEvents.start,this.events.touchStartCb,!1),t.addEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.addEventListener(this.touchEvents.end,this.events.touchEndCb,!1),null===(e=this.backdropEl)||void 0===e||e.addEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1);else{if(Support.touch){const e=!("touchstart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};t.addEventListener(this.touchEvents.start,this.events.touchStartCb,e),t.addEventListener(this.touchEvents.move,this.events.touchMoveCb,!!Support.passiveListener&&{passive:!1,capture:!1}),t.addEventListener(this.touchEvents.end,this.events.touchEndCb,e),null===(s=this.backdropEl)||void 0===s||s.addEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!!Support.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&t.addEventListener(this.touchEvents.cancel,this.events.touchEndCb,e)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(t.addEventListener("mousedown",this.events.touchStartCb,!1),t.addEventListener("mousemove",this.events.touchMoveCb,!1),t.addEventListener("mouseup",this.events.touchEndCb,!1),null===(i=this.backdropEl)||void 0===i||i.addEventListener("mousemove",this.events.touchMoveBackdropCb,!1))}this.settings.preventClicks&&t.addEventListener("click",this.events.onClickCb,!0)}detachEvents(t){var e,s,i;if(!Support.touch&&Support.pointerEvents)t.removeEventListener(this.touchEvents.start,this.events.touchStartCb,!1),t.removeEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.removeEventListener(this.touchEvents.end,this.events.touchEndCb,!1),null===(e=this.backdropEl)||void 0===e||e.removeEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1);else{if(Support.touch){const e=!("onTouchStart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};t.removeEventListener(this.touchEvents.start,this.events.touchStartCb,e),t.removeEventListener(this.touchEvents.move,this.events.touchMoveCb,!1),t.removeEventListener(this.touchEvents.end,this.events.touchEndCb,e),null===(s=this.backdropEl)||void 0===s||s.removeEventListener(this.touchEvents.move,this.events.touchMoveBackdropCb,!1),this.touchEvents.cancel&&t.removeEventListener(this.touchEvents.cancel,this.events.touchEndCb,e)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(t.removeEventListener("mousedown",this.events.touchStartCb,!1),t.removeEventListener("mousemove",this.events.touchMoveCb,!1),t.removeEventListener("mouseup",this.events.touchEndCb,!1),null===(i=this.backdropEl)||void 0===i||i.removeEventListener("mousemove",this.events.touchMoveBackdropCb,!1))}this.settings.preventClicks&&t.removeEventListener("click",this.events.onClickCb,!0)}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}preventDismiss(t=!1){this.preventDismissEvent=t}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setDarkMode(t={enable:!0}){t.enable?(this.paneEl.style.background="#1c1c1d",this.paneEl.style.color="#ffffff",this.moveEl.style.background="#5a5a5e",this.settings.buttonClose&&(this.closeEl.style.background="#424246",this.iconCloseColor="#a8a7ae")):(this.paneEl.style.background="#ffffff",this.paneEl.style.color="unset",this.moveEl.style.background="#c0c0c0",this.settings.buttonClose&&(this.closeEl.style.background="#ebebeb",this.iconCloseColor="#7a7a7e"))}setBreakpoints(t){if(!this.isPanePresented()||t){if(this.breaks={top:this.screenHeightOffset,middle:this.screenHeightOffset,bottom:this.screenHeightOffset},["top","middle","bottom"].forEach(e=>{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.breaks[e]&&this.settings.breaks[e].enabled&&this.settings.breaks[e].height&&(this.settings.inverse?this.breaks[e]=this.settings.breaks[e].height:this.breaks[e]-=this.settings.breaks[e].height)}),this.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)=>Math.abs(e)Math.abs(e)>Math.abs(t)?e:t),this.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak]),this.isPanePresented()){if(this.settings.breaks[this.prevBreakpoint].enabled&&this.moveToBreak(this.prevBreakpoint),!this.settings.breaks[this.prevBreakpoint].enabled){let t=this.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find(e=>e[1]===t);this.moveToBreak(e[0])}this.paneEl.style.top=this.settings.inverse?`-${this.bottomer}px`:"unset",this.paneEl.style.height=this.getPaneHeight()+"px",this.scrollElementInit(),this.checkOpacityAttr(this.currentBreakpoint),this.checkOverflowAttr(this.currentBreakpoint)}}else console.warn("Cupertino Pane: Provide any breaks configuration")}moveToBreak(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;this.settings.breaks[t].enabled?(this.checkOpacityAttr(this.breaks[t]),this.checkOverflowAttr(this.breaks[t]),this.doTransition({type:"breakpoint",translateY:this.breaks[t]}),this.currentBreakpoint=this.breaks[t]):console.warn("Cupertino Pane: %s breakpoint disabled",t)}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.doTransition({type:"breakpoint",translateY:e})}hide(){return this.isPanePresented()?this.isHidden()?(console.warn("Cupertino Pane: Pane already hidden"),null):void this.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.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null:(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.detachAllEvents(),delete this.rendered,delete this.prevBreakpoint,this.contentEl.style.display="none"}destroy(t={animate:!1}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call destroy()"),null;this.preventDismissEvent?this.preventedDismiss||(this.settings.onWillDismiss({prevented:!0}),this.moveToBreak(this.prevBreakpoint)):(this.settings.onWillDismiss(),t.animate?this.doTransition({type:"destroy",translateY:this.screenHeightOffset}):(this.destroyResets(),this.settings.onDidDismiss()))}pushTransition(t,e){t=this.screenHeightOffset-t;const s=this.settings.pushMinHeight?this.settings.pushMinHeight:this.screenHeightOffset-this.bottomer,i=this.screenHeightOffset-this.topper;this.pushElement.style.transition=e;const n=(t,e,s,i)=>{this.pushElement.style.transform=`translateY(${e}px) scale(${t})`,this.pushElement.style.borderRadius=s+"px",this.pushElement.style.filter=`contrast(${i})`};if(t<=s)return void n(1,0,0,1);const o=(e,n)=>{let o=-1*(i*n-s*e);return o-=(e-n)*t,o/=s-i,o>n&&(o=n),o{"destroy"===t.type&&this.destroyResets(),this.paneEl.style.transition="initial",this.followerEl&&(this.followerEl.style.transition="initial"),this.settings.backdrop&&("destroy"!==t.type&&"hide"!==t.type||(this.backdropEl.style.transition="initial",this.backdropEl.style.display="none")),"present"===t.type&&this.settings.onDidPresent(),"destroy"===t.type&&this.settings.onDidDismiss(),this.settings.onTransitionEnd({target:document.body.contains(this.paneEl)?this.paneEl:null}),this.paneEl.removeEventListener("transitionend",e)};if("breakpoint"===t.type||"end"===t.type||"present"===t.type||"hide"===t.type||"destroy"===t.type){if(this.settings.backdrop&&(this.isHidden()||"hide"===t.type||"destroy"===t.type||"present"===t.type)&&(this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,"hide"!==t.type&&"destroy"!==t.type&&(this.backdropEl.style.display="block",setTimeout(()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`},50))),"end"===t.type&&this.settings.freeMode)return;const s=Object.entries(this.settings.breaks).find(e=>e[1].height===this.screenHeightOffset-t.translateY),i=this.getTimingFunction(!(!s||!s[1].bounce));this.paneEl.style.transition=`transform ${this.settings.animationDuration}ms ${i} 0s`,this.followerEl&&(this.followerEl.style.transition=`transform ${this.settings.animationDuration}ms ${i} 0s`),this.settings.pushElement&&setTimeout(()=>{this.pushTransition(t.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)},this.settings.pushYOffset?50:0),"present"===t.type?(this.paneEl.style.transform=`translateY(${this.screenHeightOffset}px) translateZ(0px)`,setTimeout(()=>{this.settings.onTransitionStart({translateY:{new:t.translateY}}),this.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.followerEl&&(this.followerEl.style.transform="translateY(0px) translateZ(0px)")},50)):(this.settings.onTransitionStart({translateY:{new:t.translateY}}),this.paneEl.style.transform=`translateY(${t.translateY}px) translateZ(0px)`,this.followerEl&&(this.followerEl.style.transform=`translateY(${t.translateY-this.breaks[this.settings.initialBreak]}px) translateZ(0px)`));let n=Object.entries(this.breaks).find(e=>e[1]===t.translateY);return n&&(this.prevBreakpoint=n[0]),void this.paneEl.addEventListener("transitionend",e)}}}exports.CupertinoPane=CupertinoPane; //# 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 index 02108cdf..c551933c 100644 --- a/dist/cupertino-pane.min.js.map +++ b/dist/cupertino-pane.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["0"],"names":["exports","__esModule","Object","defineProperty","value","Support","touch","window","navigator","maxTouchPoints","document","observer","backdropFilter","CSS","supports","passiveListener","supportsPassive","opts","[object Object]","addEventListener","e","gestures","pointerEvents","Device","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","allowClick","disableDragAngle","pointerDown","contentScrollTop","steps","inputBlured","touchStartCb","t","touchStart","touchMoveBackdropCb","touchMoveBackdrop","touchMoveCb","touchMove","touchEndCb","touchEnd","onClickCb","onClick","onKeyboardShowCb","onKeyboardShow","onKeyboardHideCb","onKeyboardHide","onDragStart","disableDragEvents","targetTouch","type","targetTouches","changedTouches","screenY","clientY","screenX","clientX","startY","startX","isDragScrollabe","path","composedPath","push","touchMoveStopPropagation","stopPropagation","onDrag","n","v","diffY","length","newVal","getPanelTransformY","isFormElement","target","isElementScrollable","activeElement","blur","touchAngle","diffX","Math","atan2","abs","PI","overflowEl","style","overflowY","s","scrollTop","inverse","willScrolled","topper","upperThanTop","paneEl","transform","differKoef","lowerThanBottom","bottomer","checkOpacityAttr","checkOverflowAttr","doTransition","translateY","closest","getClosestBreakY","diff","swipeNextSensivity","hasOwnProperty","fastSwipeSensivity","swipeNextPoint","fastSwipeClose","currentBreakpoint","destroy","animate","blurTapEvent","onDragEnd","isNaN","bottomClose","breaks","onTransitionEnd","clickBottomOpen","enabled","moveToBreak","preventClicks","preventDefault","stopImmediatePropagation","setTimeout","fixAndroidResize","prevBreakpoint","entries","find","val","newHeight","currentBreak","keyboardHeight","screen_height","setOverflowHeight","top","moveToHeight","offsetTop","requestAnimationFrame","wrapperEl","position","item","overflow","el","tagName","includes","scrollHeight","clientHeight","Settings","initialBreak","parentElement","followerElement","pushElement","pushMinHeight","pushYOffset","backdrop","backdropOpacity","animationType","animationDuration","dragBy","bottomOffset","darkMode","freeMode","buttonClose","topperOverflow","topperOverflowOffset","showDraggable","draggableOver","handleKeyboard","simulateTouch","passiveListeners","onDidDismiss","onWillDismiss","onDidPresent","onWillPresent","onBackdropTap","onTransitionStart","CupertinoPane","selector","conf","defaultBreaksConf","innerHeight","middle","bottom","screenHeightOffset","rendered","preventDismissEvent","iconCloseColor","brs","maxDiff","settingsBreaks","assign","touchEvents","touchEventsTouch","start","move","end","cancel","touchEventsDesktop","HTMLElement","isPanePresented","console","warn","display","events","parentEl","createElement","className","left","zIndex","maxWidth","right","marginLeft","marginRight","getPaneHeight","background","boxShadow","willChange","borderBottomLeftRadius","borderBottomRightRadius","paddingBottom","borderTopLeftRadius","borderTopRightRadius","paddingTop","draggableEl","padding","moveEl","margin","borderRadius","marginTop","contentEl","transition","overflowX","closeEl","appendChild","setBreakpoints","drawBaseElements","scrollElementInit","followerEl","getTimingFunction","bounce","opacity","setDarkMode","enable","innerHTML","renderBackdrop","body","attachAllEvents","pushTransition","forEach","attachEvents","detachEvents","removeEventListener","detachAllEvents","reduce","prev","curr","attrElements","querySelectorAll","offset","offsetHeight","offsetWidth","debug","wrappers","Array","from","contains","backdropEl","backgroundColor","resetEvents","show","isBackdropPresented","transitionEnd","_a","_b","_c","passive","capture","parseFloat","exec","color","nextY","nextBreak","isHidden","remove","destroyResets","newPaneY","topHeight","minHeight","setStyles","scale","y","border","contrast","filter","getXbyY","min","max","params","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qI,qBAClG/K,KAAK0C,SAASkI,YAAc,GAAK,GAGpB,YAAhBgJ,EAAOxP,MACPpE,KAAK8G,OAAOR,MAAMS,UAAY,cAAc/G,KAAK0M,wCACjD5D,WAAW,KAEP9I,KAAK0C,SAASwJ,kBAAkB,CAAE5E,WAAY,CAAEwM,IAAKF,EAAOtM,cAC5DtH,KAAK8G,OAAOR,MAAMS,UAAY,cAAc6M,EAAOtM,gCAE/CtH,KAAKgQ,aACLhQ,KAAKgQ,WAAW1J,MAAMS,UAAY,oCAEvC,MAIH/G,KAAK0C,SAASwJ,kBAAkB,CAAE5E,WAAY,CAAEwM,IAAKF,EAAOtM,cAC5DtH,KAAK8G,OAAOR,MAAMS,UAAY,cAAc6M,EAAOtM,gCAE/CtH,KAAKgQ,aACLhQ,KAAKgQ,WAAW1J,MAAMS,UAAY,cAAc6M,EAAOtM,WAAatH,KAAKsI,OAAOtI,KAAK0C,SAAS6H,qCAGtG,IAAIwJ,EAAoBrV,OAAOuK,QAAQjJ,KAAKsI,QAAQY,KAAKC,GAAOA,EAAI,KAAOyK,EAAOtM,YAKlF,OAJIyM,IACA/T,KAAKgJ,eAAiB+K,EAAkB,SAE5C/T,KAAK8G,OAAOnH,iBAAiB,gBAAiBuS,KAM1D1T,QAAQ2N,cAAgBA","file":"cupertino-pane.min.js"} \ No newline at end of file +{"version":3,"sources":["0"],"names":["exports","__esModule","Object","defineProperty","value","Support","touch","window","navigator","maxTouchPoints","document","observer","backdropFilter","CSS","supports","passiveListener","supportsPassive","opts","[object Object]","addEventListener","e","gestures","pointerEvents","Device","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","allowClick","disableDragAngle","pointerDown","contentScrollTop","steps","inputBlured","touchStartCb","t","touchStart","touchMoveBackdropCb","touchMoveBackdrop","touchMoveCb","touchMove","touchEndCb","touchEnd","onClickCb","onClick","onKeyboardShowCb","onKeyboardShow","onKeyboardHideCb","onKeyboardHide","onDragStart","disableDragEvents","preventedDismiss","targetTouch","type","targetTouches","changedTouches","screenY","clientY","screenX","clientX","startY","startX","isDragScrollabe","path","composedPath","push","touchMoveStopPropagation","stopPropagation","onDrag","n","v","diffY","length","newVal","getPanelTransformY","isFormElement","target","isElementScrollable","activeElement","blur","touchAngle","diffX","Math","atan2","abs","PI","overflowEl","style","overflowY","s","scrollTop","inverse","willScrolled","topper","upperThanTop","paneEl","transform","differKoef","lowerThanBottom","bottomer","checkOpacityAttr","preventDismissEvent","bottomClose","touches","screen_height","onWillDismiss","prevented","moveToBreak","prevBreakpoint","checkOverflowAttr","doTransition","translateY","closest","getClosestBreakY","diff","swipeNextSensivity","hasOwnProperty","fastSwipeSensivity","swipeNextPoint","fastSwipeClose","currentBreakpoint","destroy","animate","blurTapEvent","onDragEnd","isNaN","breaks","onTransitionEnd","clickBottomOpen","enabled","preventClicks","preventDefault","stopImmediatePropagation","setTimeout","fixAndroidResize","entries","find","val","newHeight","currentBreak","keyboardHeight","setOverflowHeight","top","moveToHeight","offsetTop","requestAnimationFrame","wrapperEl","position","item","overflow","el","tagName","includes","scrollHeight","clientHeight","Settings","initialBreak","parentElement","followerElement","pushElement","pushMinHeight","pushYOffset","backdrop","backdropOpacity","animationType","animationDuration","dragBy","bottomOffset","darkMode","freeMode","buttonClose","topperOverflow","topperOverflowOffset","showDraggable","draggableOver","handleKeyboard","simulateTouch","passiveListeners","onDidDismiss","onDidPresent","onWillPresent","onBackdropTap","onTransitionStart","CupertinoPane","selector","conf","defaultBreaksConf","innerHeight","middle","bottom","screenHeightOffset","rendered","iconCloseColor","brs","maxDiff","settingsBreaks","assign","touchEvents","touchEventsTouch","start","move","end","cancel","touchEventsDesktop","HTMLElement","isPanePresented","console","warn","display","events","parentEl","createElement","className","left","zIndex","maxWidth","right","marginLeft","marginRight","getPaneHeight","background","boxShadow","willChange","borderBottomLeftRadius","borderBottomRightRadius","paddingBottom","borderTopLeftRadius","borderTopRightRadius","paddingTop","draggableEl","padding","moveEl","margin","borderRadius","marginTop","contentEl","transition","overflowX","closeEl","appendChild","setBreakpoints","drawBaseElements","scrollElementInit","followerEl","getTimingFunction","bounce","opacity","setDarkMode","enable","innerHTML","renderBackdrop","body","attachAllEvents","pushTransition","forEach","attachEvents","detachEvents","removeEventListener","detachAllEvents","reduce","prev","curr","attrElements","querySelectorAll","offsetHeight","offsetWidth","offset","wrappers","Array","from","contains","backdropEl","backgroundColor","resetEvents","show","isBackdropPresented","transitionEnd","_a","_b","_c","passive","capture","parseFloat","exec","color","nextY","nextBreak","isHidden","remove","destroyResets","newPaneY","topHeight","minHeight","setStyles","scale","y","border","contrast","filter","getXbyY","min","max","params","timingForNext","new","getNextBreakpoint"],"mappings":";;;;;;;;;;;;AAaC,IAAKA,QAAS,IAAIA,QAAU,CAACC,YAAc,GAG5CC,OAAOC,eAAeH,QAAS,aAAc,CAAEI,OAAO,IAEtD,MAAMC,QACFC,mBACI,OAAQC,OAAkB,YAAmC,IAA9BA,OAAkB,UAAED,UACpCC,OAAOC,UAAUC,eAAiB,GAAO,iBAAkBF,QAAYA,OAAsB,eAAKG,oBAAoBH,OAAsB,eAG/JI,sBACI,MAAQ,qBAAsBJ,QAAU,2BAA4BA,OAExEK,4BACI,OAAOC,IAAIC,SAAS,kBAAmB,cAChCD,IAAIC,SAAS,0BAA2B,aAEnDC,6BACI,IAAIC,GAAkB,EACtB,IACI,MAAMC,EAAOf,OAAOC,eAAe,GAAI,UAAW,CAE9Ce,MACIF,GAAkB,KAG1BT,OAAOY,iBAAiB,sBAAuB,KAAMF,GAEzD,MAAOG,IAGP,OAAOJ,EAEXK,sBACI,MAAO,mBAAoBd,OAE/Be,2BACI,QAASf,OAAqB,cAAM,mBAAoBA,OAAOC,WAAcD,OAAOC,UAAUC,eAAiB,GAIvH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PrE,KAAK+G,OAAOR,MAAMS,UAAY,cAAchH,KAAK8M,wCACjDzD,WAAW,KAEPrJ,KAAK0C,SAAS4J,kBAAkB,CAAEvE,WAAY,CAAEiM,IAAKF,EAAO/L,cAC5D/H,KAAK+G,OAAOR,MAAMS,UAAY,cAAc8M,EAAO/L,gCAE/C/H,KAAKmQ,aACLnQ,KAAKmQ,WAAW5J,MAAMS,UAAY,oCAEvC,MAIHhH,KAAK0C,SAAS4J,kBAAkB,CAAEvE,WAAY,CAAEiM,IAAKF,EAAO/L,cAC5D/H,KAAK+G,OAAOR,MAAMS,UAAY,cAAc8M,EAAO/L,gCAE/C/H,KAAKmQ,aACLnQ,KAAKmQ,WAAW5J,MAAMS,UAAY,cAAc8M,EAAO/L,WAAa/H,KAAK8I,OAAO9I,KAAK0C,SAASkI,qCAGtG,IAAIqJ,EAAoBvV,OAAO6K,QAAQvJ,KAAK8I,QAAQU,KAAKC,GAAOA,EAAI,KAAOqK,EAAO/L,YAKlF,OAJIkM,IACAjU,KAAK4H,eAAiBqM,EAAkB,SAE5CjU,KAAK+G,OAAOpH,iBAAiB,gBAAiByS,KAM1D5T,QAAQ+N,cAAgBA","file":"cupertino-pane.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 74731a0b..c1db07d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cupertino-pane", "description": "Multiplatform slide-over pane", - "version": "1.1.94", + "version": "1.2.0", "author": "Roman Antonov (roman-rr)", "homepage": "https://github.com/roman-rr/cupertino-pane/", "repository": "roman-rr/cupertino-pane", diff --git a/src/cupertino-pane.ts b/src/cupertino-pane.ts index 30068500..e037bb6c 100644 --- a/src/cupertino-pane.ts +++ b/src/cupertino-pane.ts @@ -21,7 +21,8 @@ export class CupertinoPane { public screen_height: number = window.innerHeight; private screenHeightOffset: number = this.screen_height; private rendered: boolean = false; - private preventDismissEvent: boolean = false; + public preventDismissEvent: boolean = false; + public preventedDismiss: boolean = false; private iconCloseColor: string = '#7a7a7e'; private brs: number[] = []; @@ -670,8 +671,8 @@ export class CupertinoPane { /** * Prevent dismiss event */ - public preventDismiss(): void { - this.preventDismissEvent = true; + public preventDismiss(val: boolean = false): void { + this.preventDismissEvent = val; } /** @@ -893,15 +894,19 @@ export class CupertinoPane { return null; } - // Emit event - this.settings.onWillDismiss(); - + // Prevent dismiss if (this.preventDismissEvent) { - this.moveToBreak(this.prevBreakpoint); - this.preventDismissEvent = false; + // Emit event with prevent dismiss if not already sent from drag event + if (!this.preventedDismiss) { + this.settings.onWillDismiss({prevented: true} as any); + this.moveToBreak(this.prevBreakpoint); + } return; } + // Emit event + this.settings.onWillDismiss(); + /****** Animation & Transition ******/ if (conf.animate) { this.doTransition({type: 'destroy', translateY: this.screenHeightOffset}); diff --git a/src/events.ts b/src/events.ts index d684c8a6..654dd8b1 100644 --- a/src/events.ts +++ b/src/events.ts @@ -17,6 +17,7 @@ export class Events { private steps: any[] = []; private inputBlured: boolean = false; + constructor(private instance: CupertinoPane, private settings: CupertinoSettings, private device: Device) { @@ -39,6 +40,9 @@ export class Events { // Allow touch angle by default, disallow no move with condition this.disableDragAngle = false; + // Allow pereventDismiss by default + this.instance.preventedDismiss = false; + const targetTouch = t.type === 'touchstart' && t.targetTouches && (t.targetTouches[0] || t.changedTouches[0]); const screenY = t.type === 'touchstart' ? targetTouch.clientY : t.clientY; const screenX = t.type === 'touchstart' ? targetTouch.clientX : t.clientX; @@ -77,6 +81,7 @@ export class Events { if (this.instance.disableDragEvents) return; if (this.disableDragAngle) return; + if (this.instance.preventedDismiss) return; if (this.settings.touchMoveStopPropagation) { t.stopPropagation(); @@ -164,6 +169,22 @@ export class Events { return; } + // Prevent Dismiss gesture + if (!this.instance.preventedDismiss + && this.instance.preventDismissEvent && this.settings.bottomClose) { + let differKoef = ((-this.instance.topper + this.instance.topper - this.instance.getPanelTransformY()) / this.instance.topper) / -8; + newVal = this.instance.getPanelTransformY() + (diffY * (0.5 - differKoef)); + + let mousePointY = (t.touches[0].screenY - 220 - this.instance.screen_height) * -1; + if (mousePointY <= this.instance.screen_height - this.instance.bottomer) { + this.instance.preventedDismiss = true; + // Emit event with prevent dismiss + this.settings.onWillDismiss({prevented: true} as any); + this.instance.moveToBreak(this.instance.prevBreakpoint); + return; + } + } + // Disallow accidentaly clicks while slide gestures this.allowClick = false;