From 29a8a53e712488454b628eed65fa2a4ed0f1bb9d Mon Sep 17 00:00:00 2001 From: roman-rr Date: Thu, 28 Jan 2021 19:23:55 +0700 Subject: [PATCH] Keyboard fixes, window.resize events - issue #125 #127 --- CHANGELOG.md | 10 +++ README.md | 2 - dist/cupertino-pane.esm.bundle.js | 123 ++++++++++++++++---------- dist/cupertino-pane.esm.bundle.js.map | 2 +- dist/cupertino-pane.js | 123 ++++++++++++++++---------- dist/cupertino-pane.js.map | 2 +- dist/cupertino-pane.min.js | 6 +- dist/cupertino-pane.min.js.map | 2 +- dist/events.d.ts | 9 +- package.json | 2 +- playground/overflow.html | 1 - src/breakpoints.ts | 18 ++-- src/cupertino-pane.ts | 8 -- src/events.ts | 112 ++++++++++++++++------- 14 files changed, 258 insertions(+), 162 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50053f39..308ab489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ # Change Log All notable changes to this project will be documented in this file. +## [1.2.4] - 2021-01-28 + +### Enhancements +- Keyboard will move pane up, only if focused element is child of Pane +- `window.resize` events are now automatically managed [#127](https://github.com/roman-rr/cupertino-pane/issues/127) + +### Bug Fixes +- Fixed `currentBreak()` method +- Fixed and improved keyboard events [#125](https://github.com/roman-rr/cupertino-pane/issues/125) + ## [1.2.3] - 2021-01-22 ### Features diff --git a/README.md b/README.md index b255a564..5a36b0f5 100644 --- a/README.md +++ b/README.md @@ -387,9 +387,7 @@ By default, we are now handle keyboard in hybrid mobile applications and push pa If you would like handle this part by yourself, set option `handleKeyboard: false`. ## Future Goals -- [Issues] Handle keyboard only for Pane inputs, #125, #127 - [Docs] ($150 budget) -> Package branding -- [Code] Fix immutable issue in breakpoint class - [Accurance] Draw experiment application (Normal/TimeStamp/Native) - Native Touch Plugin - [Docs] (Traffic + Carbon ads) -> Docs engine (F7, Netlify, Gatsby, GH pages) - [Showcase] Apple Music F7 diff --git a/dist/cupertino-pane.esm.bundle.js b/dist/cupertino-pane.esm.bundle.js index 03c9da3f..276c6c17 100644 --- a/dist/cupertino-pane.esm.bundle.js +++ b/dist/cupertino-pane.esm.bundle.js @@ -1,5 +1,5 @@ /** - * Cupertino Pane 1.2.32 + * Cupertino Pane 1.2.4 * Multiplatform slide-over pane * https://github.com/roman-rr/cupertino-pane/ * @@ -7,7 +7,7 @@ * * Released under the MIT License * - * Released on: January 26, 2021 + * Released on: January 28, 2021 */ /*! ***************************************************************************** @@ -187,7 +187,8 @@ class Events { this.pointerDown = false; this.contentScrollTop = 0; this.steps = []; - this.inputBlured = false; + this.inputBluredbyMove = false; + this.movedByKeyboard = false; this.touchEvents = (() => { const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel']; let desktop = ['mousedown', 'mousemove', 'mouseup']; @@ -246,7 +247,7 @@ class Events { * Window resize event * @param e */ - this.onOrientationChangeCb = (e) => this.onOrientationChange(e); + this.onWindowResizeCb = (e) => this.onWindowResize(e); } attachAllEvents() { if (!this.settings.dragBy) { @@ -278,7 +279,8 @@ class Events { } }); } - window.addEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.addEventListener('resize', this.onWindowResizeCb); } detachAllEvents() { if (!this.settings.dragBy) { @@ -296,7 +298,8 @@ class Events { window.removeEventListener('keyboardWillShow', this.onKeyboardShowCb); window.removeEventListener('keyboardWillHide', this.onKeyboardHideCb); } - window.removeEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.removeEventListener('resize', this.onWindowResizeCb); } resetEvents() { this.detachAllEvents(); @@ -401,7 +404,7 @@ class Events { if (this.isFormElement(document.activeElement) && !(this.isFormElement(t.target))) { document.activeElement.blur(); - this.inputBlured = true; + this.inputBluredbyMove = true; } } // Touch angle @@ -550,54 +553,64 @@ class Events { } } onKeyboardShow(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0) { + // focud element not inside pane + if (!this.isPaneDescendant(document.activeElement)) { + return; + } + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { setTimeout(() => this.fixAndroidResize(), 20); } + this.movedByKeyboard = true; this.breakpoints.prevBreakpoint = Object.entries(this.breakpoints.breaks).find(val => val[1] === this.instance.getPanelTransformY())[0]; let newHeight = this.settings.breaks[this.instance.currentBreak()].height + e.keyboardHeight; - if (this.instance.screen_height < newHeight) { - let diff = newHeight - this.instance.screen_height + (135 * 0.35); - newHeight = this.instance.screen_height - (135 * 0.35); - this.instance.setOverflowHeight(e.keyboardHeight); - this.instance.moveToBreak(this.settings.breaks.top.enabled ? 'top' : 'middle'); + // Landscape case + let isLandscape = window.matchMedia('(orientation: landscape)').matches; + if (isLandscape) { + newHeight = this.instance.screen_height; } - else { - this.instance.setOverflowHeight(e.keyboardHeight); + // higher than screen + offsets + if (newHeight > this.instance.screen_height - 80) { + newHeight = this.instance.screen_height - 80; + } + // Move pane up if new position more than 50px + if (newHeight - 50 >= this.settings.breaks[this.instance.currentBreak()].height) { this.instance.moveToHeight(newHeight); - setTimeout(() => this.instance.overflowEl.scrollTop = document.activeElement.offsetTop); } + // Remove offset because on new height no offsets needs + // Timeout await for keyboard presented + setTimeout(() => { + this.instance.setOverflowHeight(e.keyboardHeight - this.settings.topperOverflowOffset); + this.instance.overflowEl.scrollTop = document.activeElement.offsetTop; + }, 300); } onKeyboardHide(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0) { + // Move back + if (!this.movedByKeyboard) { + return; + } + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { this.fixAndroidResize(); } - if (this.inputBlured) { - this.inputBlured = false; + this.movedByKeyboard = false; + this.instance.setOverflowHeight(); + if (this.inputBluredbyMove) { + this.inputBluredbyMove = false; + return; } - else { - if (!this.instance.isHidden()) { - this.instance.moveToBreak(this.breakpoints.prevBreakpoint); - } + if (!this.instance.isHidden()) { + this.instance.moveToBreak(this.breakpoints.prevBreakpoint); } - setTimeout(() => this.instance.setOverflowHeight()); } - onOrientationChange(e) { + onWindowResize(e) { return __awaiter(this, void 0, void 0, function* () { - // Browsers issue: Currently no proper way to get window.innerHeight without timeout yield new Promise((resolve) => setTimeout(() => resolve(true), 150)); this.instance.updateScreenHeights(); this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints), false); @@ -637,6 +650,16 @@ class Events { } return true; } + isPaneDescendant(el) { + let node = el.parentNode; + while (node != null) { + if (node == this.instance.paneEl) { + return true; + } + node = node.parentNode; + } + return false; + } isFormElement(el) { const formElements = [ 'input', 'select', 'option', @@ -651,6 +674,14 @@ class Events { isElementScrollable(el) { return el.scrollHeight > el.clientHeight ? true : false; } + isOnViewport() { + if (this.instance.paneEl + && this.instance.paneEl.offsetWidth === 0 + && this.instance.paneEl.offsetHeight === 0) { + return false; + } + return true; + } } class Settings { @@ -755,7 +786,7 @@ class Breakpoints { } ['top', 'middle', 'bottom'].forEach((val) => { // bottom offset for bulletins - var _a, _b; + var _a; this.breaks[val] -= this.settings.bottomOffset; // Set default if no exist if (!this.settings.breaks[val]) { @@ -770,10 +801,11 @@ class Breakpoints { if (((_a = this.settings.breaks[val]) === null || _a === void 0 ? void 0 : _a.height) > this.instance.screen_height) { this.settings.breaks[val].height = this.instance.screen_height - this.settings.bottomOffset; } - if (this.settings.breaks['top'] && this.settings.breaks['middle'] - && this.settings.breaks['top'].height === ((_b = this.settings.breaks['middle']) === null || _b === void 0 ? void 0 : _b.height)) { - this.settings.breaks['middle'].enabled = false; - this.settings.initialBreak = 'top'; + if (this.settings.breaks['top'] && this.settings.breaks['middle']) { + if (this.settings.breaks['top'].height - 50 <= this.settings.breaks['middle'].height) { + this.settings.breaks['middle'].enabled = false; + this.settings.initialBreak = 'top'; + } } } // fitHeight (bullet-in styles fir screen) @@ -801,12 +833,11 @@ class Breakpoints { } } }); - // Save breakpoints (not for resize event) - // TODO: solve immutable issue: 1.Weak set 2. Use In events.ts - if (lock) { + // initial lock on present + if (!this.lockedBreakpoints) { this.lockedBreakpoints = JSON.stringify(this.settings.breaks); } - // Warnings + // Warnings if (!this.instance.isPanePresented()) { if (!this.settings.breaks[this.settings.initialBreak].enabled) { console.warn('Cupertino Pane: Please set initialBreak for enabled breakpoint'); @@ -1254,12 +1285,6 @@ class CupertinoPane { } } setOverflowHeight(offset = 0) { - // overflowEl is not visible - ignoring execution - // TODO: inputs only for visible elements - if (this.overflowEl.offsetHeight === 0 - && this.overflowEl.offsetWidth === 0) { - return; - } if (!this.settings.inverse) { this.overflowEl.style.height = `${this.getPaneHeight() - this.settings.topperOverflowOffset diff --git a/dist/cupertino-pane.esm.bundle.js.map b/dist/cupertino-pane.esm.bundle.js.map index e166a01b..8cbc32d5 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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ane 1.2.32 + * Cupertino Pane 1.2.4 * Multiplatform slide-over pane * https://github.com/roman-rr/cupertino-pane/ * @@ -7,7 +7,7 @@ * * Released under the MIT License * - * Released on: January 26, 2021 + * Released on: January 28, 2021 */ @@ -193,7 +193,8 @@ class Events { this.pointerDown = false; this.contentScrollTop = 0; this.steps = []; - this.inputBlured = false; + this.inputBluredbyMove = false; + this.movedByKeyboard = false; this.touchEvents = (() => { const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel']; let desktop = ['mousedown', 'mousemove', 'mouseup']; @@ -252,7 +253,7 @@ class Events { * Window resize event * @param e */ - this.onOrientationChangeCb = (e) => this.onOrientationChange(e); + this.onWindowResizeCb = (e) => this.onWindowResize(e); } attachAllEvents() { if (!this.settings.dragBy) { @@ -284,7 +285,8 @@ class Events { } }); } - window.addEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.addEventListener('resize', this.onWindowResizeCb); } detachAllEvents() { if (!this.settings.dragBy) { @@ -302,7 +304,8 @@ class Events { window.removeEventListener('keyboardWillShow', this.onKeyboardShowCb); window.removeEventListener('keyboardWillHide', this.onKeyboardHideCb); } - window.removeEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.removeEventListener('resize', this.onWindowResizeCb); } resetEvents() { this.detachAllEvents(); @@ -407,7 +410,7 @@ class Events { if (this.isFormElement(document.activeElement) && !(this.isFormElement(t.target))) { document.activeElement.blur(); - this.inputBlured = true; + this.inputBluredbyMove = true; } } // Touch angle @@ -556,54 +559,64 @@ class Events { } } onKeyboardShow(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0) { + // focud element not inside pane + if (!this.isPaneDescendant(document.activeElement)) { + return; + } + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { setTimeout(() => this.fixAndroidResize(), 20); } + this.movedByKeyboard = true; this.breakpoints.prevBreakpoint = Object.entries(this.breakpoints.breaks).find(val => val[1] === this.instance.getPanelTransformY())[0]; let newHeight = this.settings.breaks[this.instance.currentBreak()].height + e.keyboardHeight; - if (this.instance.screen_height < newHeight) { - let diff = newHeight - this.instance.screen_height + (135 * 0.35); - newHeight = this.instance.screen_height - (135 * 0.35); - this.instance.setOverflowHeight(e.keyboardHeight); - this.instance.moveToBreak(this.settings.breaks.top.enabled ? 'top' : 'middle'); + // Landscape case + let isLandscape = window.matchMedia('(orientation: landscape)').matches; + if (isLandscape) { + newHeight = this.instance.screen_height; } - else { - this.instance.setOverflowHeight(e.keyboardHeight); + // higher than screen + offsets + if (newHeight > this.instance.screen_height - 80) { + newHeight = this.instance.screen_height - 80; + } + // Move pane up if new position more than 50px + if (newHeight - 50 >= this.settings.breaks[this.instance.currentBreak()].height) { this.instance.moveToHeight(newHeight); - setTimeout(() => this.instance.overflowEl.scrollTop = document.activeElement.offsetTop); } + // Remove offset because on new height no offsets needs + // Timeout await for keyboard presented + setTimeout(() => { + this.instance.setOverflowHeight(e.keyboardHeight - this.settings.topperOverflowOffset); + this.instance.overflowEl.scrollTop = document.activeElement.offsetTop; + }, 300); } onKeyboardHide(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0) { + // Move back + if (!this.movedByKeyboard) { + return; + } + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { this.fixAndroidResize(); } - if (this.inputBlured) { - this.inputBlured = false; + this.movedByKeyboard = false; + this.instance.setOverflowHeight(); + if (this.inputBluredbyMove) { + this.inputBluredbyMove = false; + return; } - else { - if (!this.instance.isHidden()) { - this.instance.moveToBreak(this.breakpoints.prevBreakpoint); - } + if (!this.instance.isHidden()) { + this.instance.moveToBreak(this.breakpoints.prevBreakpoint); } - setTimeout(() => this.instance.setOverflowHeight()); } - onOrientationChange(e) { + onWindowResize(e) { return __awaiter(this, void 0, void 0, function* () { - // Browsers issue: Currently no proper way to get window.innerHeight without timeout yield new Promise((resolve) => setTimeout(() => resolve(true), 150)); this.instance.updateScreenHeights(); this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints), false); @@ -643,6 +656,16 @@ class Events { } return true; } + isPaneDescendant(el) { + let node = el.parentNode; + while (node != null) { + if (node == this.instance.paneEl) { + return true; + } + node = node.parentNode; + } + return false; + } isFormElement(el) { const formElements = [ 'input', 'select', 'option', @@ -657,6 +680,14 @@ class Events { isElementScrollable(el) { return el.scrollHeight > el.clientHeight ? true : false; } + isOnViewport() { + if (this.instance.paneEl + && this.instance.paneEl.offsetWidth === 0 + && this.instance.paneEl.offsetHeight === 0) { + return false; + } + return true; + } } class Settings { @@ -761,7 +792,7 @@ class Breakpoints { } ['top', 'middle', 'bottom'].forEach((val) => { // bottom offset for bulletins - var _a, _b; + var _a; this.breaks[val] -= this.settings.bottomOffset; // Set default if no exist if (!this.settings.breaks[val]) { @@ -776,10 +807,11 @@ class Breakpoints { if (((_a = this.settings.breaks[val]) === null || _a === void 0 ? void 0 : _a.height) > this.instance.screen_height) { this.settings.breaks[val].height = this.instance.screen_height - this.settings.bottomOffset; } - if (this.settings.breaks['top'] && this.settings.breaks['middle'] - && this.settings.breaks['top'].height === ((_b = this.settings.breaks['middle']) === null || _b === void 0 ? void 0 : _b.height)) { - this.settings.breaks['middle'].enabled = false; - this.settings.initialBreak = 'top'; + if (this.settings.breaks['top'] && this.settings.breaks['middle']) { + if (this.settings.breaks['top'].height - 50 <= this.settings.breaks['middle'].height) { + this.settings.breaks['middle'].enabled = false; + this.settings.initialBreak = 'top'; + } } } // fitHeight (bullet-in styles fir screen) @@ -807,12 +839,11 @@ class Breakpoints { } } }); - // Save breakpoints (not for resize event) - // TODO: solve immutable issue: 1.Weak set 2. Use In events.ts - if (lock) { + // initial lock on present + if (!this.lockedBreakpoints) { this.lockedBreakpoints = JSON.stringify(this.settings.breaks); } - // Warnings + // Warnings if (!this.instance.isPanePresented()) { if (!this.settings.breaks[this.settings.initialBreak].enabled) { console.warn('Cupertino Pane: Please set initialBreak for enabled breakpoint'); @@ -1260,12 +1291,6 @@ class CupertinoPane { } } setOverflowHeight(offset = 0) { - // overflowEl is not visible - ignoring execution - // TODO: inputs only for visible elements - if (this.overflowEl.offsetHeight === 0 - && this.overflowEl.offsetWidth === 0) { - return; - } if (!this.settings.inverse) { this.overflowEl.style.height = `${this.getPaneHeight() - this.settings.topperOverflowOffset diff --git a/dist/cupertino-pane.js.map b/dist/cupertino-pane.js.map index 657f7c5f..1081c4a5 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 7a6de39e..a7db1863 100644 --- a/dist/cupertino-pane.min.js +++ b/dist/cupertino-pane.min.js @@ -1,5 +1,5 @@ /** - * Cupertino Pane 1.2.32 + * Cupertino Pane 1.2.4 * Multiplatform slide-over pane * https://github.com/roman-rr/cupertino-pane/ * @@ -7,7 +7,7 @@ * * Released under the MIT License * - * Released on: January 26, 2021 + * Released on: January 28, 2021 */ if(!exports)var exports={__esModule:!0}; @@ -25,5 +25,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function __awaiter(t,e,s,i){return new(s||(s=Promise))((function(n,o){function r(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}h((i=i.apply(t,e||[])).next())}))}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,p=e.indexOf("Gecko/")>=0&&e.indexOf("Firefox/")>=0,d="Win32"===t,c=e.toLowerCase().indexOf("electron")>=0,g="MacIntel"===t;!o&&g&&Support.touch&&(1024===s&&1366===i||834===s&&1194===i||834===s&&1112===i||768===s&&1024===i)&&(o=e.match(/(Version)\/([\d.]+)/),g=!1),this.ie=h,this.edge=l,this.firefox=p,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)||c,this.desktop&&(this.electron=c,this.macos=g,this.windows=d,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class Events{constructor(t,e,s,i){this.instance=t,this.settings=e,this.device=s,this.breakpoints=i,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBlured=!1,this.touchEvents=(()=>{const t=["touchstart","touchmove","touchend","touchcancel"];let e=["mousedown","mousemove","mouseup"];Support.pointerEvents&&(e=["pointerdown","pointermove","pointerup"]);const s={start:t[0],move:t[1],end:t[2],cancel:t[3]},i={start:e[0],move:e[1],end:e[2]};return Support.touch||!this.settings.simulateTouch?s:i})(),this.touchStartCb=t=>this.touchStart(t),this.touchMoveBackdropCb=t=>this.touchMoveBackdrop(t),this.touchMoveCb=t=>this.touchMove(t),this.touchEndCb=t=>this.touchEnd(t),this.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardHideCb=t=>this.onKeyboardHide(t),this.onOrientationChangeCb=t=>this.onOrientationChange(t)}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.eventListeners("addEventListener",e)}):this.eventListeners("addEventListener",this.instance.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.onKeyboardHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",()=>{this.instance.parentEl.scrollTop=0,this.instance.parentEl.parentElement&&(this.instance.parentEl.parentElement.scrollTop=0,this.instance.parentEl.parentElement.parentElement&&(this.instance.parentEl.parentElement.parentElement.scrollTop=0))}),window.addEventListener("orientationchange",this.onOrientationChangeCb)}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.eventListeners("removeEventListener",e)}):this.eventListeners("removeEventListener",this.instance.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.onKeyboardHideCb)),window.removeEventListener("orientationchange",this.onOrientationChangeCb)}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}eventListeners(t,e){var s,i,n;if(!Support.touch&&Support.pointerEvents)e[t](this.touchEvents.start,this.touchStartCb,!1),e[t](this.touchEvents.move,this.touchMoveCb,!1),e[t](this.touchEvents.end,this.touchEndCb,!1),null===(s=this.instance.backdropEl)||void 0===s||s[t](this.touchEvents.move,this.touchMoveBackdropCb,!1);else{if(Support.touch){const s=!("touchstart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};e[t](this.touchEvents.start,this.touchStartCb,s),e[t](this.touchEvents.move,this.touchMoveCb,!!Support.passiveListener&&{passive:!1,capture:!1}),e[t](this.touchEvents.end,this.touchEndCb,s),null===(i=this.instance.backdropEl)||void 0===i||i[t](this.touchEvents.move,this.touchMoveBackdropCb,!!Support.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&e[t](this.touchEvents.cancel,this.touchEndCb,s)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(e[t]("mousedown",this.touchStartCb,!1),e[t]("mousemove",this.touchMoveCb,!1),e[t]("mouseup",this.touchEndCb,!1),null===(n=this.instance.backdropEl)||void 0===n||n[t]("mousemove",this.touchMoveBackdropCb,!1))}this.settings.preventClicks&&e[t]("click",this.onClickCb,!0)}touchStart(t){if(this.settings.onDragStart(t),this.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.breakpoints.topper&&this.contentScrollTop>0||a<=this.breakpoints.topper)return}if(!this.settings.inverse&&!this.settings.upperThanTop&&a<=this.breakpoints.topper)this.instance.paneEl.style.transform=`translateY(${this.breakpoints.topper}px) translateZ(0px)`;else{if(a<=this.breakpoints.topper&&this.settings.upperThanTop){const t=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.topper/-8;a=this.instance.getPanelTransformY()+r*t}if((!this.settings.lowerThanBottom||this.settings.inverse)&&a>=this.breakpoints.bottomer)return this.instance.paneEl.style.transform=`translateY(${this.breakpoints.bottomer}px) translateZ(0px)`,void this.instance.checkOpacityAttr(a);if(!this.instance.preventedDismiss&&this.instance.preventDismissEvent&&this.settings.bottomClose){let e=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.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.breakpoints.bottomer)return this.instance.preventedDismiss=!0,this.settings.onWillDismiss({prevented:!0}),void this.instance.moveToBreak(this.breakpoints.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.breakpoints.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.breakpoints.currentBreakpointthis.fixAndroidResize(),20),this.breakpoints.prevBreakpoint=Object.entries(this.breakpoints.breaks).find(t=>t[1]===this.instance.getPanelTransformY())[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;if(this.instance.screen_heightthis.instance.overflowEl.scrollTop=document.activeElement.offsetTop)}onKeyboardHide(t){this.instance.paneEl&&0===this.instance.paneEl.offsetWidth&&0===this.instance.paneEl.offsetHeight||(this.device.android&&this.fixAndroidResize(),this.inputBlured?this.inputBlured=!1:this.instance.isHidden()||this.instance.moveToBreak(this.breakpoints.prevBreakpoint),setTimeout(()=>this.instance.setOverflowHeight()))}onOrientationChange(t){return __awaiter(this,void 0,void 0,(function*(){yield new Promise(t=>setTimeout(()=>t(!0),150)),this.instance.updateScreenHeights(),this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints),!1)}))}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,fitHeight:!1,maxFitHeight:null,fitScreenHeight:!0,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,buttonDestroy:!0,buttonClose:!0,topperOverflow:!0,topperOverflowOffset:0,lowerThanBottom:!0,upperThanTop:!1,showDraggable:!0,draggableOver:!1,clickBottomOpen:!0,preventClicks:!0,handleKeyboard:!0,simulateTouch:!0,passiveListeners:!0,touchMoveStopPropagation:!1,touchAngle:null,breaks:{},onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class Breakpoints{constructor(t,e){this.instance=t,this.settings=e,this.breaks={},this.calcHeightInProcess=!1,this.brs=[],this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}}}buildBreakpoints(t,e=!0){var s,i;return __awaiter(this,void 0,void 0,(function*(){if(this.breaks={top:this.instance.screenHeightOffset,middle:this.instance.screenHeightOffset,bottom:this.instance.screenHeightOffset},this.settings.fitHeight){this.settings.fitScreenHeight=!1,this.settings.initialBreak="top",this.settings.topperOverflow=!1;let e=yield this.getPaneFitHeight();this.settings.maxFitHeight&&e>this.settings.maxFitHeight&&(e=this.settings.maxFitHeight,this.settings.topperOverflow=!0),t={top:{enabled:!0,height:e},middle:{enabled:!1},bottom:{enabled:!1}}}if(["top","middle","bottom"].forEach(e=>{var s,i;this.breaks[e]-=this.settings.bottomOffset,this.settings.breaks[e]||(this.settings.breaks[e]=this.defaultBreaksConf[e]),t&&t[e]&&(this.settings.breaks[e]=t[e]),this.settings.fitScreenHeight&&((null===(s=this.settings.breaks[e])||void 0===s?void 0:s.height)>this.instance.screen_height&&(this.settings.breaks[e].height=this.instance.screen_height-this.settings.bottomOffset),this.settings.breaks.top&&this.settings.breaks.middle&&this.settings.breaks.top.height===(null===(i=this.settings.breaks.middle)||void 0===i?void 0:i.height)&&(this.settings.breaks.middle.enabled=!1,this.settings.initialBreak="top")),this.settings.fitHeight&&"top"===e&&(this.settings.breaks[e].height>this.instance.screen_height?(this.settings.breaks[e].height=this.instance.screen_height-2*this.settings.bottomOffset,this.settings.topperOverflow=!0):this.instance.overflowEl&&!this.settings.maxFitHeight&&(this.settings.topperOverflow=!1,this.instance.overflowEl.style.overflowY="hidden")),this.settings.breaks[e]&&this.settings.breaks[e].enabled&&this.settings.breaks[e].height&&(this.settings.inverse?this.breaks[e]=this.settings.breaks[e].height:this.breaks[e]-=this.settings.breaks[e].height)}),e&&(this.lockedBreakpoints=JSON.stringify(this.settings.breaks)),this.instance.isPanePresented()||this.settings.breaks[this.settings.initialBreak].enabled||console.warn("Cupertino Pane: Please set initialBreak for enabled breakpoint"),this.settings.breaks.middle.height>=this.settings.breaks.top.height&&console.warn("Cupertino Pane: Please set middle height lower than top height"),this.settings.breaks.middle.height<=this.settings.breaks.bottom.height&&console.warn("Cupertino Pane: Please set bottom height lower than middle height"),this.brs=[],["top","middle","bottom"].forEach(t=>{this.settings.breaks[t].enabled&&this.brs.push(this.breaks[t])}),this.topper=this.brs.reduce((t,e)=>eMath.abs(e)>Math.abs(t)?e:t),this.instance.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak]),this.instance.isPanePresented()){if((null===(s=this.settings.breaks[this.prevBreakpoint])||void 0===s?void 0:s.enabled)&&this.instance.moveToBreak(this.prevBreakpoint),!(null===(i=this.settings.breaks[this.prevBreakpoint])||void 0===i?void 0:i.enabled)){let t=this.instance.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find(e=>e[1]===t);this.instance.moveToBreak(e[0])}this.instance.paneEl.style.top=this.settings.inverse?`-${this.bottomer}px`:"unset",this.instance.paneEl.style.height=this.instance.getPaneHeight()+"px",this.instance.scrollElementInit(),this.instance.checkOpacityAttr(this.currentBreakpoint),this.instance.checkOverflowAttr(this.currentBreakpoint)}}))}getCurrentBreakName(){return this.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null}getPaneFitHeight(){return __awaiter(this,void 0,void 0,(function*(){this.calcHeightInProcess=!0;let t,e=this.instance.el.querySelectorAll("img");this.instance.el.style.height="unset",this.instance.rendered||(this.instance.el.style.visibility="hidden",this.instance.el.style.pointerEvents="none",this.instance.el.style.display="block",this.instance.wrapperEl.style.visibility="hidden",this.instance.wrapperEl.style.pointerEvents="none",this.instance.wrapperEl.style.display="block");let s=[];return e.length&&(s=Array.from(e).map(t=>new Promise(e=>{t.complete&&t.naturalHeight?e(!0):t.onload=()=>e(!0)}))),s.push(new Promise(t=>setTimeout(()=>t(!0),this.instance.rendered?0:150))),yield Promise.all(s),t=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("height"))+(parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-bottom"))),t+=this.instance.el.offsetTop,this.instance.rendered||(this.instance.el.style.visibility="unset",this.instance.el.style.pointerEvents="unset",this.instance.el.style.display="none",this.instance.wrapperEl.style.visibility="unset",this.instance.wrapperEl.style.pointerEvents="unset",this.instance.wrapperEl.style.display="none"),this.calcHeightInProcess=!1,t}))}getClosestBreakY(){return this.brs.reduce((t,e)=>Math.abs(e-this.instance.getPanelTransformY()){let i={},n={};if(this.settings.inverse?(i.top=this.breakpoints.breaks.bottom,i.middle=this.breakpoints.breaks.middle,i.bottom=this.breakpoints.breaks.top,n.top=Object.assign({},this.settings.breaks.bottom),n.middle=Object.assign({},this.settings.breaks.middle),n.bottom=Object.assign({},this.settings.breaks.top)):(i=Object.assign({},this.breakpoints.breaks),n=Object.assign({},this.settings.breaks)),this.breakpoints.currentBreakpoint===i.top){if(t>e){if(n.middle.enabled)return i.middle;if(n.bottom.enabled)return i.middlee&&n.bottom.enabled?i.bottom:i.middle;if(this.breakpoints.currentBreakpoint===i.bottom){if(t<-e){if(n.middle.enabled)return i.middle>s?s:i.middle;if(n.top.enabled)return i.top}return i.bottom}return s},t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.error("Cupertino Pane: specified selector or DOM element already in use",this.selector):(this.el=this.selector,this.el.style.display="none",this.settings=Object.assign(Object.assign({},this.settings),e),this.settings.parentElement?this.settings.parentElement=document.querySelector(this.settings.parentElement):this.settings.parentElement=this.el.parentElement,this.breakpoints=new Breakpoints(this,this.settings),this.events=new Events(this,this.settings,this.device,this.breakpoints)):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.addStyle("\n .cupertino-pane-wrapper {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n }\n "),this.paneEl=document.createElement("div"),this.paneEl.className="pane",this.addStyle(`\n .cupertino-pane-wrapper .pane {\n position: fixed;\n z-index: 11;\n width: 100%;\n max-width: 500px;\n left: 0px;\n right: 0px;\n margin-left: auto;\n margin-right: auto;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0,0,0,.12);\n overflow = hidden;\n will-change = transform;\n transform: translateY(${this.screenHeightOffset}px) translateZ(0px);\n ${this.settings.inverse?"padding-bottom: 15px; border-radius: 0 0 20px 20px;":"padding-top: 15px; border-radius: 20px 20px 0 0;"}\n }\n .cupertino-pane-wrapper.darkmode .pane {\n background: #1c1c1d; \n color: #ffffff;\n }\n `),this.draggableEl=document.createElement("div"),this.draggableEl.className="draggable",this.addStyle(`\n .cupertino-pane-wrapper .draggable {\n padding: 5px;\n position: absolute;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n height: 30px;\n z-index: 12;\n ${this.settings.inverse?"bottom: 0;":"top: 0;"}\n ${this.settings.showDraggable?"":"opacity: 0;"}\n ${this.settings.draggableOver?"top: -30px;padding: 15px;":""}\n }\n `),this.moveEl=document.createElement("div"),this.moveEl.className="move",this.addStyle(`\n .cupertino-pane-wrapper .move {\n margin: 0 auto;\n height: 5px;\n background: #c0c0c0;\n width: 36px;\n border-radius: 4px;\n ${this.settings.inverse?"margin-top: 15px;":""}\n ${this.settings.draggableOver?"width: 70px; background: rgba(225, 225, 225, 0.6);":""}\n ${this.settings.draggableOver&&Support.backdropFilter?"\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n ":""}\n }\n .cupertino-pane-wrapper.darkmode .move {\n background: #5a5a5e;\n }\n `),this.destroyButtonEl=document.createElement("div"),this.destroyButtonEl.className="destroy-button",this.addStyle(`\n .cupertino-pane-wrapper .destroy-button {\n ${this.settings.inverse?"":"\n width: 26px;\n height: 26px;\n position: absolute;\n background: #ebebeb;\n right: 20px;\n z-index: 14;\n border-radius: 100%;\n top: 16px;\n "}\n }\n .cupertino-pane-wrapper.darkmode .destroy-button {\n background: #424246;\n }\n `),this.contentEl=this.el,this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",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}){var e;return __awaiter(this,void 0,void 0,(function*(){if(this.el)if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.updateScreenHeights(),yield this.drawBaseElements(),yield this.setBreakpoints(),this.paneEl.style.height=this.getPaneHeight()+"px",this.settings.inverse&&(this.paneEl.style.top=`-${this.breakpoints.bottomer}px`),this.wrapperEl.style.display="block",this.contentEl.style.display="block",this.wrapperEl.classList.add("rendered"),this.rendered=!0,this.settings.followerElement){if(!document.querySelector(this.settings.followerElement))return void console.warn("Cupertino Pane: wrong follower element selector specified",this.settings.followerElement);this.followerEl=document.querySelector(this.settings.followerElement),this.followerEl.style.willChange="transform, border-radius",this.followerEl.style.transform="translateY(0px) translateZ(0px)",this.followerEl.style.transition=`all ${this.settings.animationDuration}ms ${this.getTimingFunction(null===(e=this.settings.breaks[this.currentBreak()])||void 0===e?void 0:e.bounce)} 0s`}this.settings.pushElement&&(this.pushElement=document.querySelector(this.settings.pushElement)),this.settings.darkMode&&this.setDarkMode({enable:!0}),this.settings.buttonClose&&this.settings.buttonDestroy&&!this.settings.inverse&&(this.paneEl.appendChild(this.destroyButtonEl),this.destroyButtonEl.addEventListener("click",t=>this.destroy({animate:!0,destroyButton:!0})),this.destroyButtonEl.innerHTML=`\n \n `),this.settings.bottomClose&&(this.settings.breaks.bottom.enabled=!0),this.settings.freeMode&&(this.settings.lowerThanBottom=!1),this.settings.backdrop&&this.renderBackdrop(),this.device.android&&(document.body.style.overscrollBehaviorY="none"),this.events.attachAllEvents(),t.animate?this.doTransition({type:"present",translateY:this.breakpoints.breaks[this.settings.initialBreak]}):(this.breakpoints.prevBreakpoint=this.settings.initialBreak,this.paneEl.style.transform=`translateY(${this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.pushElement&&this.pushTransition(this.breakpoints.breaks[this.settings.initialBreak],"unset"),this.settings.onDidPresent()),this.checkOpacityAttr(this.breakpoints.currentBreakpoint),yield new Promise(t=>setTimeout(()=>t(!0),150)),this.scrollElementInit(),this.checkOverflowAttr(this.breakpoints.currentBreakpoint)}else console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}))}getPaneHeight(){return this.settings.inverse?this.breakpoints.bottomer+this.settings.bottomOffset:this.screen_height-this.breakpoints.topper-this.settings.bottomOffset}updateScreenHeights(){this.settings.inverse?(this.screen_height=window.innerHeight,this.screenHeightOffset=0):(this.screen_height=window.innerHeight,this.screenHeightOffset=window.innerHeight)}scrollElementInit(){let t=this.el.querySelectorAll("[overflow-y]");!t.length||t.length>1?this.overflowEl=this.contentEl:(this.overflowEl=t[0],this.overflowEl.style.overflowX="hidden"),this.settings.topperOverflow&&(this.settings.upperThanTop&&console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'),this.setOverflowHeight())}setOverflowHeight(t=0){0===this.overflowEl.offsetHeight&&0===this.overflowEl.offsetWidth||(this.settings.inverse?this.overflowEl.style.height=this.getPaneHeight()-30-this.settings.topperOverflowOffset-this.overflowEl.offsetTop+"px":this.overflowEl.style.height=this.getPaneHeight()-this.settings.topperOverflowOffset-this.overflowEl.offsetTop-t+"px")}checkOpacityAttr(t){let e=this.el.querySelectorAll("[hide-on-bottom]");e.length&&(this.settings.inverse||e.forEach(e=>{e.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,e.style.opacity=t>=this.breakpoints.breaks.bottom?"0":"1"}))}checkOverflowAttr(t){this.settings.topperOverflow&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.breakpoints.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.breakpoints.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper.rendered"));return!!t.length&&!!t.find(t=>t.contains(this.selector))}getTimingFunction(t){return t?"cubic-bezier(0.175, 0.885, 0.370, 1.120)":this.settings.animationType}isBackdropPresented(){return!!document.querySelector(".cupertino-pane-wrapper .backdrop")}renderBackdrop(){this.backdropEl=document.createElement("div"),this.backdropEl.className="backdrop",this.addStyle(`\n .cupertino-pane-wrapper .backdrop {\n overflow: hidden;\n position: fixed;\n width: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n display: none;\n z-index: 10;\n transition: all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s;\n background-color: rgba(0,0,0, ${this.settings.backdropOpacity});\n }\n `),this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.addEventListener("click",t=>this.settings.onBackdropTap())}addStyle(t){const e=document.createElement("style");e.textContent=t,document.head.prepend(e)}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||(this.renderBackdrop(),this.events.resetEvents());const e=()=>{this.backdropEl.style.transition="initial",this.backdropEl.style.display="none",this.backdropEl.removeEventListener("transitionend",e)};if(this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",t.show)this.backdropEl.style.display="block",setTimeout(()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`},50);else{if("none"===this.backdropEl.style.display)return;this.backdropEl.addEventListener("transitionend",e)}}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}preventDismiss(t=!1){this.preventDismissEvent=t}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setDarkMode(t={enable:!0}){t.enable?(this.wrapperEl.classList.add("darkmode"),this.iconCloseColor="#a8a7ae"):(this.wrapperEl.classList.remove("darkmode"),this.iconCloseColor="#7a7a7e")}setBreakpoints(t){return __awaiter(this,void 0,void 0,(function*(){!this.isPanePresented()||t?yield this.breakpoints.buildBreakpoints(t):console.warn("Cupertino Pane: Provide any breaks configuration")}))}calcFitHeight(){return __awaiter(this,void 0,void 0,(function*(){this.breakpoints.calcHeightInProcess?console.warn("Cupertino Pane: calcFitHeight() already in process"):yield this.breakpoints.buildBreakpoints(this.breakpoints.lockedBreakpoints)}))}moveToBreak(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;this.settings.breaks[t].enabled?(this.checkOpacityAttr(this.breakpoints.breaks[t]),this.checkOverflowAttr(this.breakpoints.breaks[t]),this.doTransition({type:"breakpoint",translateY:this.breakpoints.breaks[t]}),this.breakpoints.currentBreakpoint=this.breakpoints.breaks[t]):console.warn("Cupertino Pane: %s breakpoint disabled",t)}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToHeight()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.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.breakpoints.getCurrentBreakName():(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.events.detachAllEvents(),delete this.rendered,delete this.breakpoints.prevBreakpoint,this.contentEl.style.display="none"}destroy(t={animate:!1,destroyButton:!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.breakpoints.prevBreakpoint)):(this.settings.onWillDismiss(),t.animate?this.doTransition({type:"destroy",translateY:this.screenHeightOffset,destroyButton:t.destroyButton}):(this.destroyResets(),this.settings.onDidDismiss({destroyButton:t.destroyButton})))}pushTransition(t,e){t=this.screenHeightOffset-t;const s=this.settings.pushMinHeight?this.settings.pushMinHeight:this.screenHeightOffset-this.breakpoints.bottomer,i=this.screenHeightOffset-this.breakpoints.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({destroyButton:t.destroyButton}),this.settings.onTransitionEnd({target:document.body.contains(this.paneEl)?this.paneEl:null}),this.paneEl.removeEventListener("transitionend",s)};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 i=Object.entries(this.settings.breaks).find(e=>e[1].height===this.screenHeightOffset-t.translateY),n=this.getTimingFunction(!(!i||!(null===(e=i[1])||void 0===e?void 0:e.bounce)));this.paneEl.style.transition=`transform ${this.settings.animationDuration}ms ${n} 0s`,this.followerEl&&(this.followerEl.style.transition=`transform ${this.settings.animationDuration}ms ${n} 0s`),this.settings.pushElement&&setTimeout(()=>{this.pushTransition(t.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)},this.settings.pushYOffset?50:0),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(${t.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`)},"present"===t.type?50:0);let o=Object.entries(this.breakpoints.breaks).find(e=>e[1]===t.translateY);return o&&(this.breakpoints.prevBreakpoint=o[0]),void this.paneEl.addEventListener("transitionend",s)}}}exports.CupertinoPane=CupertinoPane; +function __awaiter(t,e,s,i){return new(s||(s=Promise))((function(n,o){function r(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(r,a)}h((i=i.apply(t,e||[])).next())}))}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,p=e.indexOf("Gecko/")>=0&&e.indexOf("Firefox/")>=0,d="Win32"===t,c=e.toLowerCase().indexOf("electron")>=0,g="MacIntel"===t;!o&&g&&Support.touch&&(1024===s&&1366===i||834===s&&1194===i||834===s&&1112===i||768===s&&1024===i)&&(o=e.match(/(Version)\/([\d.]+)/),g=!1),this.ie=h,this.edge=l,this.firefox=p,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)||c,this.desktop&&(this.electron=c,this.macos=g,this.windows=d,this.macos&&(this.os="macos"),this.windows&&(this.os="windows")),this.pixelRatio=window.devicePixelRatio||1}}class Events{constructor(t,e,s,i){this.instance=t,this.settings=e,this.device=s,this.breakpoints=i,this.allowClick=!0,this.disableDragAngle=!1,this.pointerDown=!1,this.contentScrollTop=0,this.steps=[],this.inputBluredbyMove=!1,this.movedByKeyboard=!1,this.touchEvents=(()=>{const t=["touchstart","touchmove","touchend","touchcancel"];let e=["mousedown","mousemove","mouseup"];Support.pointerEvents&&(e=["pointerdown","pointermove","pointerup"]);const s={start:t[0],move:t[1],end:t[2],cancel:t[3]},i={start:e[0],move:e[1],end:e[2]};return Support.touch||!this.settings.simulateTouch?s:i})(),this.touchStartCb=t=>this.touchStart(t),this.touchMoveBackdropCb=t=>this.touchMoveBackdrop(t),this.touchMoveCb=t=>this.touchMove(t),this.touchEndCb=t=>this.touchEnd(t),this.onClickCb=t=>this.onClick(t),this.onKeyboardShowCb=t=>this.onKeyboardShow(t),this.onKeyboardHideCb=t=>this.onKeyboardHide(t),this.onWindowResizeCb=t=>this.onWindowResize(t)}attachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.eventListeners("addEventListener",e)}):this.eventListeners("addEventListener",this.instance.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.addEventListener("keyboardWillShow",this.onKeyboardShowCb),window.addEventListener("keyboardWillHide",this.onKeyboardHideCb)),!this.settings.handleKeyboard&&this.device.cordova&&this.device.android&&window.addEventListener("keyboardWillHide",()=>{this.instance.parentEl.scrollTop=0,this.instance.parentEl.parentElement&&(this.instance.parentEl.parentElement.scrollTop=0,this.instance.parentEl.parentElement.parentElement&&(this.instance.parentEl.parentElement.parentElement.scrollTop=0))}),window.addEventListener("resize",this.onWindowResizeCb)}detachAllEvents(){this.settings.dragBy?this.settings.dragBy.forEach(t=>{const e=document.querySelector(t);e&&this.eventListeners("removeEventListener",e)}):this.eventListeners("removeEventListener",this.instance.paneEl),this.settings.handleKeyboard&&this.device.cordova&&(window.removeEventListener("keyboardWillShow",this.onKeyboardShowCb),window.removeEventListener("keyboardWillHide",this.onKeyboardHideCb)),window.removeEventListener("resize",this.onWindowResizeCb)}resetEvents(){this.detachAllEvents(),this.attachAllEvents()}eventListeners(t,e){var s,i,n;if(!Support.touch&&Support.pointerEvents)e[t](this.touchEvents.start,this.touchStartCb,!1),e[t](this.touchEvents.move,this.touchMoveCb,!1),e[t](this.touchEvents.end,this.touchEndCb,!1),null===(s=this.instance.backdropEl)||void 0===s||s[t](this.touchEvents.move,this.touchMoveBackdropCb,!1);else{if(Support.touch){const s=!("touchstart"!==this.touchEvents.start||!Support.passiveListener||!this.settings.passiveListeners)&&{passive:!0,capture:!1};e[t](this.touchEvents.start,this.touchStartCb,s),e[t](this.touchEvents.move,this.touchMoveCb,!!Support.passiveListener&&{passive:!1,capture:!1}),e[t](this.touchEvents.end,this.touchEndCb,s),null===(i=this.instance.backdropEl)||void 0===i||i[t](this.touchEvents.move,this.touchMoveBackdropCb,!!Support.passiveListener&&{passive:!1,capture:!1}),this.touchEvents.cancel&&e[t](this.touchEvents.cancel,this.touchEndCb,s)}(this.settings.simulateTouch&&!this.device.ios&&!this.device.android||this.settings.simulateTouch&&!Support.touch&&this.device.ios)&&(e[t]("mousedown",this.touchStartCb,!1),e[t]("mousemove",this.touchMoveCb,!1),e[t]("mouseup",this.touchEndCb,!1),null===(n=this.instance.backdropEl)||void 0===n||n[t]("mousemove",this.touchMoveBackdropCb,!1))}this.settings.preventClicks&&e[t]("click",this.onClickCb,!0)}touchStart(t){if(this.settings.onDragStart(t),this.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.inputBluredbyMove=!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.breakpoints.topper&&this.contentScrollTop>0||a<=this.breakpoints.topper)return}if(!this.settings.inverse&&!this.settings.upperThanTop&&a<=this.breakpoints.topper)this.instance.paneEl.style.transform=`translateY(${this.breakpoints.topper}px) translateZ(0px)`;else{if(a<=this.breakpoints.topper&&this.settings.upperThanTop){const t=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.topper/-8;a=this.instance.getPanelTransformY()+r*t}if((!this.settings.lowerThanBottom||this.settings.inverse)&&a>=this.breakpoints.bottomer)return this.instance.paneEl.style.transform=`translateY(${this.breakpoints.bottomer}px) translateZ(0px)`,void this.instance.checkOpacityAttr(a);if(!this.instance.preventedDismiss&&this.instance.preventDismissEvent&&this.settings.bottomClose){let e=(-this.breakpoints.topper+this.breakpoints.topper-this.instance.getPanelTransformY())/this.breakpoints.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.breakpoints.bottomer)return this.instance.preventedDismiss=!0,this.settings.onWillDismiss({prevented:!0}),void this.instance.moveToBreak(this.breakpoints.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.breakpoints.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.breakpoints.currentBreakpointthis.fixAndroidResize(),20),this.movedByKeyboard=!0,this.breakpoints.prevBreakpoint=Object.entries(this.breakpoints.breaks).find(t=>t[1]===this.instance.getPanelTransformY())[0];let e=this.settings.breaks[this.instance.currentBreak()].height+t.keyboardHeight;window.matchMedia("(orientation: landscape)").matches&&(e=this.instance.screen_height),e>this.instance.screen_height-80&&(e=this.instance.screen_height-80),e-50>=this.settings.breaks[this.instance.currentBreak()].height&&this.instance.moveToHeight(e),setTimeout(()=>{this.instance.setOverflowHeight(t.keyboardHeight-this.settings.topperOverflowOffset),this.instance.overflowEl.scrollTop=document.activeElement.offsetTop},300)}onKeyboardHide(t){this.movedByKeyboard&&this.isOnViewport()&&(this.device.android&&this.fixAndroidResize(),this.movedByKeyboard=!1,this.instance.setOverflowHeight(),this.inputBluredbyMove?this.inputBluredbyMove=!1:this.instance.isHidden()||this.instance.moveToBreak(this.breakpoints.prevBreakpoint))}onWindowResize(t){return __awaiter(this,void 0,void 0,(function*(){yield new Promise(t=>setTimeout(()=>t(!0),150)),this.instance.updateScreenHeights(),this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints),!1)}))}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()))}isPaneDescendant(t){let e=t.parentNode;for(;null!=e;){if(e==this.instance.paneEl)return!0;e=e.parentNode}return!1}isFormElement(t){return!!(t&&t.tagName&&["input","select","option","textarea","button","label"].includes(t.tagName.toLowerCase()))}isElementScrollable(t){return t.scrollHeight>t.clientHeight}isOnViewport(){return!this.instance.paneEl||0!==this.instance.paneEl.offsetWidth||0!==this.instance.paneEl.offsetHeight}}class Settings{constructor(){this.instance={initialBreak:"middle",inverse:!1,parentElement:null,followerElement:null,fitHeight:!1,maxFitHeight:null,fitScreenHeight:!0,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,buttonDestroy:!0,buttonClose:!0,topperOverflow:!0,topperOverflowOffset:0,lowerThanBottom:!0,upperThanTop:!1,showDraggable:!0,draggableOver:!1,clickBottomOpen:!0,preventClicks:!0,handleKeyboard:!0,simulateTouch:!0,passiveListeners:!0,touchMoveStopPropagation:!1,touchAngle:null,breaks:{},onDidDismiss:()=>{},onWillDismiss:()=>{},onDidPresent:()=>{},onWillPresent:()=>{},onDragStart:()=>{},onDrag:()=>{},onDragEnd:()=>{},onBackdropTap:()=>{},onTransitionStart:()=>{},onTransitionEnd:()=>{}}}}class Breakpoints{constructor(t,e){this.instance=t,this.settings=e,this.breaks={},this.calcHeightInProcess=!1,this.brs=[],this.defaultBreaksConf={top:{enabled:!0,height:window.innerHeight-47.25},middle:{enabled:!0,height:300},bottom:{enabled:!0,height:100}}}buildBreakpoints(t,e=!0){var s,i;return __awaiter(this,void 0,void 0,(function*(){if(this.breaks={top:this.instance.screenHeightOffset,middle:this.instance.screenHeightOffset,bottom:this.instance.screenHeightOffset},this.settings.fitHeight){this.settings.fitScreenHeight=!1,this.settings.initialBreak="top",this.settings.topperOverflow=!1;let e=yield this.getPaneFitHeight();this.settings.maxFitHeight&&e>this.settings.maxFitHeight&&(e=this.settings.maxFitHeight,this.settings.topperOverflow=!0),t={top:{enabled:!0,height:e},middle:{enabled:!1},bottom:{enabled:!1}}}if(["top","middle","bottom"].forEach(e=>{var s;this.breaks[e]-=this.settings.bottomOffset,this.settings.breaks[e]||(this.settings.breaks[e]=this.defaultBreaksConf[e]),t&&t[e]&&(this.settings.breaks[e]=t[e]),this.settings.fitScreenHeight&&((null===(s=this.settings.breaks[e])||void 0===s?void 0:s.height)>this.instance.screen_height&&(this.settings.breaks[e].height=this.instance.screen_height-this.settings.bottomOffset),this.settings.breaks.top&&this.settings.breaks.middle&&this.settings.breaks.top.height-50<=this.settings.breaks.middle.height&&(this.settings.breaks.middle.enabled=!1,this.settings.initialBreak="top")),this.settings.fitHeight&&"top"===e&&(this.settings.breaks[e].height>this.instance.screen_height?(this.settings.breaks[e].height=this.instance.screen_height-2*this.settings.bottomOffset,this.settings.topperOverflow=!0):this.instance.overflowEl&&!this.settings.maxFitHeight&&(this.settings.topperOverflow=!1,this.instance.overflowEl.style.overflowY="hidden")),this.settings.breaks[e]&&this.settings.breaks[e].enabled&&this.settings.breaks[e].height&&(this.settings.inverse?this.breaks[e]=this.settings.breaks[e].height:this.breaks[e]-=this.settings.breaks[e].height)}),this.lockedBreakpoints||(this.lockedBreakpoints=JSON.stringify(this.settings.breaks)),this.instance.isPanePresented()||this.settings.breaks[this.settings.initialBreak].enabled||console.warn("Cupertino Pane: Please set initialBreak for enabled breakpoint"),this.settings.breaks.middle.height>=this.settings.breaks.top.height&&console.warn("Cupertino Pane: Please set middle height lower than top height"),this.settings.breaks.middle.height<=this.settings.breaks.bottom.height&&console.warn("Cupertino Pane: Please set bottom height lower than middle height"),this.brs=[],["top","middle","bottom"].forEach(t=>{this.settings.breaks[t].enabled&&this.brs.push(this.breaks[t])}),this.topper=this.brs.reduce((t,e)=>eMath.abs(e)>Math.abs(t)?e:t),this.instance.isPanePresented()||(this.currentBreakpoint=this.breaks[this.settings.initialBreak]),this.instance.isPanePresented()){if((null===(s=this.settings.breaks[this.prevBreakpoint])||void 0===s?void 0:s.enabled)&&this.instance.moveToBreak(this.prevBreakpoint),!(null===(i=this.settings.breaks[this.prevBreakpoint])||void 0===i?void 0:i.enabled)){let t=this.instance.swipeNextPoint(1,1,this.getClosestBreakY());const e=Object.entries(this.breaks).find(e=>e[1]===t);this.instance.moveToBreak(e[0])}this.instance.paneEl.style.top=this.settings.inverse?`-${this.bottomer}px`:"unset",this.instance.paneEl.style.height=this.instance.getPaneHeight()+"px",this.instance.scrollElementInit(),this.instance.checkOpacityAttr(this.currentBreakpoint),this.instance.checkOverflowAttr(this.currentBreakpoint)}}))}getCurrentBreakName(){return this.breaks.top===this.currentBreakpoint?"top":this.breaks.middle===this.currentBreakpoint?"middle":this.breaks.bottom===this.currentBreakpoint?"bottom":null}getPaneFitHeight(){return __awaiter(this,void 0,void 0,(function*(){this.calcHeightInProcess=!0;let t,e=this.instance.el.querySelectorAll("img");this.instance.el.style.height="unset",this.instance.rendered||(this.instance.el.style.visibility="hidden",this.instance.el.style.pointerEvents="none",this.instance.el.style.display="block",this.instance.wrapperEl.style.visibility="hidden",this.instance.wrapperEl.style.pointerEvents="none",this.instance.wrapperEl.style.display="block");let s=[];return e.length&&(s=Array.from(e).map(t=>new Promise(e=>{t.complete&&t.naturalHeight?e(!0):t.onload=()=>e(!0)}))),s.push(new Promise(t=>setTimeout(()=>t(!0),this.instance.rendered?0:150))),yield Promise.all(s),t=parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("height"))+(parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-top"))+parseInt(document.defaultView.getComputedStyle(this.instance.el,"").getPropertyValue("margin-bottom"))),t+=this.instance.el.offsetTop,this.instance.rendered||(this.instance.el.style.visibility="unset",this.instance.el.style.pointerEvents="unset",this.instance.el.style.display="none",this.instance.wrapperEl.style.visibility="unset",this.instance.wrapperEl.style.pointerEvents="unset",this.instance.wrapperEl.style.display="none"),this.calcHeightInProcess=!1,t}))}getClosestBreakY(){return this.brs.reduce((t,e)=>Math.abs(e-this.instance.getPanelTransformY()){let i={},n={};if(this.settings.inverse?(i.top=this.breakpoints.breaks.bottom,i.middle=this.breakpoints.breaks.middle,i.bottom=this.breakpoints.breaks.top,n.top=Object.assign({},this.settings.breaks.bottom),n.middle=Object.assign({},this.settings.breaks.middle),n.bottom=Object.assign({},this.settings.breaks.top)):(i=Object.assign({},this.breakpoints.breaks),n=Object.assign({},this.settings.breaks)),this.breakpoints.currentBreakpoint===i.top){if(t>e){if(n.middle.enabled)return i.middle;if(n.bottom.enabled)return i.middlee&&n.bottom.enabled?i.bottom:i.middle;if(this.breakpoints.currentBreakpoint===i.bottom){if(t<-e){if(n.middle.enabled)return i.middle>s?s:i.middle;if(n.top.enabled)return i.top}return i.bottom}return s},t instanceof HTMLElement?this.selector=t:this.selector=document.querySelector(t),this.selector?this.isPanePresented()?console.error("Cupertino Pane: specified selector or DOM element already in use",this.selector):(this.el=this.selector,this.el.style.display="none",this.settings=Object.assign(Object.assign({},this.settings),e),this.settings.parentElement?this.settings.parentElement=document.querySelector(this.settings.parentElement):this.settings.parentElement=this.el.parentElement,this.breakpoints=new Breakpoints(this,this.settings),this.events=new Events(this,this.settings,this.device,this.breakpoints)):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.addStyle("\n .cupertino-pane-wrapper {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n }\n "),this.paneEl=document.createElement("div"),this.paneEl.className="pane",this.addStyle(`\n .cupertino-pane-wrapper .pane {\n position: fixed;\n z-index: 11;\n width: 100%;\n max-width: 500px;\n left: 0px;\n right: 0px;\n margin-left: auto;\n margin-right: auto;\n background: #ffffff;\n box-shadow: 0 4px 16px rgba(0,0,0,.12);\n overflow = hidden;\n will-change = transform;\n transform: translateY(${this.screenHeightOffset}px) translateZ(0px);\n ${this.settings.inverse?"padding-bottom: 15px; border-radius: 0 0 20px 20px;":"padding-top: 15px; border-radius: 20px 20px 0 0;"}\n }\n .cupertino-pane-wrapper.darkmode .pane {\n background: #1c1c1d; \n color: #ffffff;\n }\n `),this.draggableEl=document.createElement("div"),this.draggableEl.className="draggable",this.addStyle(`\n .cupertino-pane-wrapper .draggable {\n padding: 5px;\n position: absolute;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n height: 30px;\n z-index: 12;\n ${this.settings.inverse?"bottom: 0;":"top: 0;"}\n ${this.settings.showDraggable?"":"opacity: 0;"}\n ${this.settings.draggableOver?"top: -30px;padding: 15px;":""}\n }\n `),this.moveEl=document.createElement("div"),this.moveEl.className="move",this.addStyle(`\n .cupertino-pane-wrapper .move {\n margin: 0 auto;\n height: 5px;\n background: #c0c0c0;\n width: 36px;\n border-radius: 4px;\n ${this.settings.inverse?"margin-top: 15px;":""}\n ${this.settings.draggableOver?"width: 70px; background: rgba(225, 225, 225, 0.6);":""}\n ${this.settings.draggableOver&&Support.backdropFilter?"\n backdrop-filter: saturate(180%) blur(20px);\n -webkit-backdrop-filter: saturate(180%) blur(20px);\n ":""}\n }\n .cupertino-pane-wrapper.darkmode .move {\n background: #5a5a5e;\n }\n `),this.destroyButtonEl=document.createElement("div"),this.destroyButtonEl.className="destroy-button",this.addStyle(`\n .cupertino-pane-wrapper .destroy-button {\n ${this.settings.inverse?"":"\n width: 26px;\n height: 26px;\n position: absolute;\n background: #ebebeb;\n right: 20px;\n z-index: 14;\n border-radius: 100%;\n top: 16px;\n "}\n }\n .cupertino-pane-wrapper.darkmode .destroy-button {\n background: #424246;\n }\n `),this.contentEl=this.el,this.contentEl.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.contentEl.style.overflowX="hidden",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}){var e;return __awaiter(this,void 0,void 0,(function*(){if(this.el)if(this.isPanePresented()&&this.rendered)this.moveToBreak(this.settings.initialBreak);else if(!this.isPanePresented()||this.rendered){if(this.settings.onWillPresent(),this.updateScreenHeights(),yield this.drawBaseElements(),yield this.setBreakpoints(),this.paneEl.style.height=this.getPaneHeight()+"px",this.settings.inverse&&(this.paneEl.style.top=`-${this.breakpoints.bottomer}px`),this.wrapperEl.style.display="block",this.contentEl.style.display="block",this.wrapperEl.classList.add("rendered"),this.rendered=!0,this.settings.followerElement){if(!document.querySelector(this.settings.followerElement))return void console.warn("Cupertino Pane: wrong follower element selector specified",this.settings.followerElement);this.followerEl=document.querySelector(this.settings.followerElement),this.followerEl.style.willChange="transform, border-radius",this.followerEl.style.transform="translateY(0px) translateZ(0px)",this.followerEl.style.transition=`all ${this.settings.animationDuration}ms ${this.getTimingFunction(null===(e=this.settings.breaks[this.currentBreak()])||void 0===e?void 0:e.bounce)} 0s`}this.settings.pushElement&&(this.pushElement=document.querySelector(this.settings.pushElement)),this.settings.darkMode&&this.setDarkMode({enable:!0}),this.settings.buttonClose&&this.settings.buttonDestroy&&!this.settings.inverse&&(this.paneEl.appendChild(this.destroyButtonEl),this.destroyButtonEl.addEventListener("click",t=>this.destroy({animate:!0,destroyButton:!0})),this.destroyButtonEl.innerHTML=`\n \n `),this.settings.bottomClose&&(this.settings.breaks.bottom.enabled=!0),this.settings.freeMode&&(this.settings.lowerThanBottom=!1),this.settings.backdrop&&this.renderBackdrop(),this.device.android&&(document.body.style.overscrollBehaviorY="none"),this.events.attachAllEvents(),t.animate?this.doTransition({type:"present",translateY:this.breakpoints.breaks[this.settings.initialBreak]}):(this.breakpoints.prevBreakpoint=this.settings.initialBreak,this.paneEl.style.transform=`translateY(${this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`,this.settings.pushElement&&this.pushTransition(this.breakpoints.breaks[this.settings.initialBreak],"unset"),this.settings.onDidPresent()),this.checkOpacityAttr(this.breakpoints.currentBreakpoint),yield new Promise(t=>setTimeout(()=>t(!0),150)),this.scrollElementInit(),this.checkOverflowAttr(this.breakpoints.currentBreakpoint)}else console.warn("Cupertino Pane: specified selector or DOM element already in use",this.selector)}))}getPaneHeight(){return this.settings.inverse?this.breakpoints.bottomer+this.settings.bottomOffset:this.screen_height-this.breakpoints.topper-this.settings.bottomOffset}updateScreenHeights(){this.settings.inverse?(this.screen_height=window.innerHeight,this.screenHeightOffset=0):(this.screen_height=window.innerHeight,this.screenHeightOffset=window.innerHeight)}scrollElementInit(){let t=this.el.querySelectorAll("[overflow-y]");!t.length||t.length>1?this.overflowEl=this.contentEl:(this.overflowEl=t[0],this.overflowEl.style.overflowX="hidden"),this.settings.topperOverflow&&(this.settings.upperThanTop&&console.warn('Cupertino Pane: "upperThanTop" allowed for disabled "topperOverflow"'),this.setOverflowHeight())}setOverflowHeight(t=0){this.settings.inverse?this.overflowEl.style.height=this.getPaneHeight()-30-this.settings.topperOverflowOffset-this.overflowEl.offsetTop+"px":this.overflowEl.style.height=this.getPaneHeight()-this.settings.topperOverflowOffset-this.overflowEl.offsetTop-t+"px"}checkOpacityAttr(t){let e=this.el.querySelectorAll("[hide-on-bottom]");e.length&&(this.settings.inverse||e.forEach(e=>{e.style.transition=`opacity ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,e.style.opacity=t>=this.breakpoints.breaks.bottom?"0":"1"}))}checkOverflowAttr(t){this.settings.topperOverflow&&(this.settings.inverse?this.overflowEl.style.overflowY=t>=this.breakpoints.bottomer?"auto":"hidden":this.overflowEl.style.overflowY=t<=this.breakpoints.topper?"auto":"hidden")}isPanePresented(){let t=Array.from(document.querySelectorAll(".cupertino-pane-wrapper.rendered"));return!!t.length&&!!t.find(t=>t.contains(this.selector))}getTimingFunction(t){return t?"cubic-bezier(0.175, 0.885, 0.370, 1.120)":this.settings.animationType}isBackdropPresented(){return!!document.querySelector(".cupertino-pane-wrapper .backdrop")}renderBackdrop(){this.backdropEl=document.createElement("div"),this.backdropEl.className="backdrop",this.addStyle(`\n .cupertino-pane-wrapper .backdrop {\n overflow: hidden;\n position: fixed;\n width: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0;\n display: none;\n z-index: 10;\n transition: all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s;\n background-color: rgba(0,0,0, ${this.settings.backdropOpacity});\n }\n `),this.wrapperEl.appendChild(this.backdropEl),this.backdropEl.addEventListener("click",t=>this.settings.onBackdropTap())}addStyle(t){const e=document.createElement("style");e.textContent=t,document.head.prepend(e)}backdrop(t={show:!0}){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call backdrop()"),null;this.isBackdropPresented()||(this.renderBackdrop(),this.events.resetEvents());const e=()=>{this.backdropEl.style.transition="initial",this.backdropEl.style.display="none",this.backdropEl.removeEventListener("transitionend",e)};if(this.backdropEl.style.transition=`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`,this.backdropEl.style.backgroundColor="rgba(0,0,0,.0)",t.show)this.backdropEl.style.display="block",setTimeout(()=>{this.backdropEl.style.backgroundColor=`rgba(0,0,0, ${this.settings.backdropOpacity})`},50);else{if("none"===this.backdropEl.style.display)return;this.backdropEl.addEventListener("transitionend",e)}}getPanelTransformY(){return parseFloat(/\.*translateY\((.*)px\)/i.exec(this.paneEl.style.transform)[1])}preventDismiss(t=!1){this.preventDismissEvent=t}disableDrag(){this.disableDragEvents=!0}enableDrag(){this.disableDragEvents=!1}setDarkMode(t={enable:!0}){t.enable?(this.wrapperEl.classList.add("darkmode"),this.iconCloseColor="#a8a7ae"):(this.wrapperEl.classList.remove("darkmode"),this.iconCloseColor="#7a7a7e")}setBreakpoints(t){return __awaiter(this,void 0,void 0,(function*(){!this.isPanePresented()||t?yield this.breakpoints.buildBreakpoints(t):console.warn("Cupertino Pane: Provide any breaks configuration")}))}calcFitHeight(){return __awaiter(this,void 0,void 0,(function*(){this.breakpoints.calcHeightInProcess?console.warn("Cupertino Pane: calcFitHeight() already in process"):yield this.breakpoints.buildBreakpoints(this.breakpoints.lockedBreakpoints)}))}moveToBreak(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToBreak()"),null;this.settings.breaks[t].enabled?(this.checkOpacityAttr(this.breakpoints.breaks[t]),this.checkOverflowAttr(this.breakpoints.breaks[t]),this.doTransition({type:"breakpoint",translateY:this.breakpoints.breaks[t]}),this.breakpoints.currentBreakpoint=this.breakpoints.breaks[t]):console.warn("Cupertino Pane: %s breakpoint disabled",t)}moveToHeight(t){if(!this.isPanePresented())return console.warn("Cupertino Pane: Present pane before call moveToHeight()"),null;let e=this.screenHeightOffset?this.screen_height-t:t;this.checkOpacityAttr(e),this.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.breakpoints.getCurrentBreakName():(console.warn("Cupertino Pane: Present pane before call currentBreak()"),null)}destroyResets(){this.parentEl.appendChild(this.contentEl),this.wrapperEl.remove(),this.events.detachAllEvents(),delete this.rendered,delete this.breakpoints.prevBreakpoint,this.contentEl.style.display="none"}destroy(t={animate:!1,destroyButton:!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.breakpoints.prevBreakpoint)):(this.settings.onWillDismiss(),t.animate?this.doTransition({type:"destroy",translateY:this.screenHeightOffset,destroyButton:t.destroyButton}):(this.destroyResets(),this.settings.onDidDismiss({destroyButton:t.destroyButton})))}pushTransition(t,e){t=this.screenHeightOffset-t;const s=this.settings.pushMinHeight?this.settings.pushMinHeight:this.screenHeightOffset-this.breakpoints.bottomer,i=this.screenHeightOffset-this.breakpoints.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({destroyButton:t.destroyButton}),this.settings.onTransitionEnd({target:document.body.contains(this.paneEl)?this.paneEl:null}),this.paneEl.removeEventListener("transitionend",s)};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 i=Object.entries(this.settings.breaks).find(e=>e[1].height===this.screenHeightOffset-t.translateY),n=this.getTimingFunction(!(!i||!(null===(e=i[1])||void 0===e?void 0:e.bounce)));this.paneEl.style.transition=`transform ${this.settings.animationDuration}ms ${n} 0s`,this.followerEl&&(this.followerEl.style.transition=`transform ${this.settings.animationDuration}ms ${n} 0s`),this.settings.pushElement&&setTimeout(()=>{this.pushTransition(t.translateY,`all ${this.settings.animationDuration}ms ${this.settings.animationType} 0s`)},this.settings.pushYOffset?50:0),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(${t.translateY-this.breakpoints.breaks[this.settings.initialBreak]}px) translateZ(0px)`)},"present"===t.type?50:0);let o=Object.entries(this.breakpoints.breaks).find(e=>e[1]===t.translateY);return o&&(this.breakpoints.prevBreakpoint=o[0]),void this.paneEl.addEventListener("transitionend",s)}}}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 aeb63d07..3488f69e 100644 --- a/dist/cupertino-pane.min.js.map +++ b/dist/cupertino-pane.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["0"],"names":["exports","__esModule","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","Object","defineProperty","Support","touch","window","navigator","maxTouchPoints","document","observer","backdropFilter","CSS","supports","passiveListener","supportsPassive","opts","[object Object]","addEventListener","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","breakpoints","allowClick","disableDragAngle","pointerDown","contentScrollTop","steps","inputBlured","touchEvents","touchEventsTouch","start","move","end","cancel","touchEventsDesktop","simulateTouch","touchStartCb","t","touchStart","touchMoveBackdropCb","touchMoveBackdrop","touchMoveCb","touchMove","touchEndCb","touchEnd","onClickCb","onClick","onKeyboardShowCb","onKeyboardShow","onKeyboardHideCb","onKeyboardHide","onOrientationChangeCb","onOrientationChange","dragBy","forEach","selector","el","eventListeners","paneEl","handleKeyboard","parentEl","scrollTop","parentElement","removeEventListener","detachAllEvents","attachAllEvents","type","_a","_b","_c","backdropEl","passiveListeners","passive","capture","preventClicks","onDragStart","disableDragEvents","preventedDismiss","targetTouch","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","inverse","willScrolled","topper","upperThanTop","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","preventDefault","stopImmediatePropagation","offsetWidth","offsetHeight","setTimeout","fixAndroidResize","entries","find","val","newHeight","currentBreak","keyboardHeight","setOverflowHeight","top","moveToHeight","offsetTop","isHidden","updateScreenHeights","buildBreakpoints","JSON","parse","lockedBreakpoints","requestAnimationFrame","wrapperEl","position","item","overflow","tagName","includes","scrollHeight","clientHeight","Settings","initialBreak","followerElement","fitHeight","maxFitHeight","fitScreenHeight","pushElement","pushMinHeight","pushYOffset","backdrop","backdropOpacity","animationType","animationDuration","bottomOffset","darkMode","freeMode","buttonDestroy","buttonClose","topperOverflow","topperOverflowOffset","showDraggable","draggableOver","onDidDismiss","onDidPresent","onWillPresent","onBackdropTap","onTransitionStart","Breakpoints","calcHeightInProcess","brs","defaultBreaksConf","innerHeight","middle","bottom","conf","lock","screenHeightOffset","getPaneFitHeight","stringify","isPanePresented","console","warn","reduce","prev","curr","nextY","nextBreak","getPaneHeight","scrollElementInit","images","querySelectorAll","rendered","visibility","display","promises","Array","from","map","image","complete","naturalHeight","onload","all","parseInt","defaultView","getComputedStyle","getPropertyValue","CupertinoPane","iconCloseColor","maxDiff","settingsBreaks","assign","HTMLElement","error","events","createElement","className","addStyle","draggableEl","moveEl","destroyButtonEl","contentEl","transition","overflowX","appendChild","drawBaseElements","setBreakpoints","classList","add","followerEl","willChange","getTimingFunction","bounce","setDarkMode","enable","destroyButton","innerHTML","renderBackdrop","body","pushTransition","attrElements","offset","opacity","wrappers","contains","styleString","textContent","head","prepend","show","isBackdropPresented","resetEvents","transitionEnd","backgroundColor","parseFloat","exec","remove","getCurrentBreakName","destroyResets","newPaneY","topHeight","minHeight","setStyles","scale","y","border","contrast","borderRadius","filter","getXbyY","min","max","params","timingForNext","new","getNextBreakpoint"],"mappings":";;;;;;;;;;;;AAaC,IAAKA,QAAS,IAAIA,QAAU,CAACC,YAAc;;;;;;;;;;;;;;;AAoB5C,SAASC,UAAUC,EAASC,EAAYC,EAAGC,GAEvC,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,IACvF,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,OAITO,KAAKR,EAAWK,GAClGH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS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CnC,WAAW,KAEPpL,KAAK0C,SAAS+L,kBAAkB,CAAE5E,WAAY,CAAEwL,IAAKF,EAAOtL,cAC5D7J,KAAKiF,OAAOsD,MAAMO,UAAY,cAAcqM,EAAOtL,gCAE/C7J,KAAKwS,aACLxS,KAAKwS,WAAWjK,MAAMO,UAAY,cAAcqM,EAAOtL,WAAa7J,KAAK4C,YAAYgI,OAAO5K,KAAK0C,SAASsK,qCAE/F,YAAhBmI,EAAO1P,KAAqB,GAAK,GACpC,IAAI6P,EAAoB1W,OAAO0M,QAAQtL,KAAK4C,YAAYgI,QAAQW,KAAKC,GAAOA,EAAI,KAAO2J,EAAOtL,YAK9F,OAJIyL,IACAtV,KAAK4C,YAAY8G,eAAiB4L,EAAkB,SAExDtV,KAAKiF,OAAOrF,iBAAiB,gBAAiBmU,KAM1DvW,QAAQ0T,cAAgBA","file":"cupertino-pane.min.js"} \ No newline at end of file +{"version":3,"sources":["0"],"names":["exports","__esModule","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","Object","defineProperty","Support","touch","window","navigator","maxTouchPoints","document","observer","backdropFilter","CSS","supports","passiveListener","supportsPassive","opts","[object Object]","addEventListener","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","breakpoints","allowClick","disableDragAngle","pointerDown","contentScrollTop","steps","inputBluredbyMove","movedByKeyboard","touchEvents","touchEventsTouch","start","move","end","cancel","touchEventsDesktop","simulateTouch","touchStartCb","t","touchStart","touchMoveBackdropCb","touchMoveBackdrop","touchMoveCb","touchMove","touchEndCb","touchEnd","onClickCb","onClick","onKeyboardShowCb","onKeyboardShow","onKeyboardHideCb","onKeyboardHide","onWindowResizeCb","onWindowResize","dragBy","forEach","selector","el","eventListeners","paneEl","handleKeyboard","parentEl","scrollTop","parentElement","removeEventListener","detachAllEvents","attachAllEvents","type","_a","_b","_c","backdropEl","passiveListeners","passive","capture","preventClicks","onDragStart","disableDragEvents","preventedDismiss","targetTouch","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","inverse","willScrolled","topper","upperThanTop","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","preventDefault","stopImmediatePropagation","isPaneDescendant","isOnViewport","setTimeout","fixAndroidResize","entries","find","val","newHeight","currentBreak","keyboardHeight","moveToHeight","setOverflowHeight","topperOverflowOffset","offsetTop","isHidden","updateScreenHeights","buildBreakpoints","JSON","parse","lockedBreakpoints","requestAnimationFrame","wrapperEl","position","item","overflow","node","parentNode","tagName","includes","scrollHeight","clientHeight","offsetWidth","offsetHeight","Settings","initialBreak","followerElement","fitHeight","maxFitHeight","fitScreenHeight","pushElement","pushMinHeight","pushYOffset","backdrop","backdropOpacity","animationType","animationDuration","bottomOffset","darkMode","freeMode","buttonDestroy","buttonClose","topperOverflow","showDraggable","draggableOver","onDidDismiss","onDidPresent","onWillPresent","onBackdropTap","onTransitionStart","Breakpoints","calcHeightInProcess","brs","defaultBreaksConf","top","innerHeight","middle","bottom","conf","lock","screenHeightOffset","getPaneFitHeight","stringify","isPanePresented","console","warn","reduce","prev","curr","nextY","nextBreak","getPaneHeight","scrollElementInit","images","querySelectorAll","rendered","visibility","display","promises","Array","from","map","image","complete","naturalHeight","onload","all","parseInt","defaultView","getComputedStyle","getPropertyValue","CupertinoPane","iconCloseColor","maxDiff","settingsBreaks","assign","HTMLElement","error","events","createElement","className","addStyle","draggableEl","moveEl","destroyButtonEl","contentEl","transition","overflowX","appendChild","drawBaseElements","setBreakpoints","classList","add","followerEl","willChange","getTimingFunction","bounce","setDarkMode","enable","destroyButton","innerHTML","renderBackdrop","body","pushTransition","attrElements","offset","opacity","wrappers","contains","styleString","textContent","head","prepend","show","isBackdropPresented","resetEvents","transitionEnd","backgroundColor","parseFloat","exec","remove","getCurrentBreakName","destroyResets","newPaneY","topHeight","minHeight","setStyles","scale","y","border","contrast","borderRadius","filter","getXbyY","min","max","params","timingForNext","new","getNextBreakpoint"],"mappings":";;;;;;;;;;;;AAaC,IAAKA,QAAS,IAAIA,QAAU,CAACC,YAAc;;;;;;;;;;;;;;;AAoB5C,SAASC,UAAUC,EAASC,EAAYC,EAAGC,GAEvC,OAAO,IAAKD,IAAMA,EAAIE,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ,GAAS,IAAMC,EAAKN,EAAiB,MAAEK,IAAW,MAAOG,GAAKL,EAAOK,IACvF,SAASF,EAAKI,GAJlB,IAAeL,EAIaK,EAAOC,KAAOT,EAAQQ,EAAOL,QAJ1CA,EAIyDK,EAAOL,MAJhDA,aAAiBN,EAAIM,EAAQ,IAAIN,GAAE,SAAUG,GAAWA,EAAQG,OAITO,KAAKR,EAAWK,GAClGH,GAAMN,EAAYA,EAAUa,MAAMhB,EAASC,GAAc,KAAKS,WAvBtEO,OAAOC,eAAerB,QAAS,aAAc,CAAEW,OAAO,IA2BtD,MAAMW,QACFC,mBACI,OAAQC,OAAkB,YAAmC,IAA9BA,O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O9J,KAAK0C,SAASsL,uBAAuBhO,KAAK0C,SAASqL,qBAClG/N,KAAK0C,SAASkL,YAAc,GAAK,GAGxCvC,WAAW,KAEPrL,KAAK0C,SAASmM,kBAAkB,CAAE/E,WAAY,CAAE4L,IAAKF,EAAO1L,cAC5D9J,KAAKkF,OAAOsD,MAAMO,UAAY,cAAcyM,EAAO1L,gCAE/C9J,KAAK6S,aACL7S,KAAK6S,WAAWrK,MAAMO,UAAY,cAAcyM,EAAO1L,WAAa9J,KAAK4C,YAAYiI,OAAO7K,KAAK0C,SAAS2K,qCAE/F,YAAhBmI,EAAO9P,KAAqB,GAAK,GACpC,IAAIiQ,EAAoB/W,OAAO2M,QAAQvL,KAAK4C,YAAYiI,QAAQW,KAAKC,GAAOA,EAAI,KAAO+J,EAAO1L,YAK9F,OAJI6L,IACA3V,KAAK4C,YAAY+G,eAAiBgM,EAAkB,SAExD3V,KAAKkF,OAAOtF,iBAAiB,gBAAiBwU,KAM1D5W,QAAQ+T,cAAgBA","file":"cupertino-pane.min.js"} \ No newline at end of file diff --git a/dist/events.d.ts b/dist/events.d.ts index c6c5b93a..318fd77b 100644 --- a/dist/events.d.ts +++ b/dist/events.d.ts @@ -17,7 +17,8 @@ export declare class Events { private startY; private startX; private steps; - private inputBlured; + private inputBluredbyMove; + private movedByKeyboard; constructor(instance: CupertinoPane, settings: CupertinoSettings, device: Device, breakpoints: Breakpoints); attachAllEvents(): void; detachAllEvents(): void; @@ -70,8 +71,8 @@ export declare class Events { * Window resize event * @param e */ - onOrientationChangeCb: (e: any) => Promise; - private onOrientationChange; + onWindowResizeCb: (e: any) => Promise; + private onWindowResize; /** * Private class methods */ @@ -85,6 +86,8 @@ export declare class Events { */ private isDragScrollabe; private willScrolled; + private isPaneDescendant; private isFormElement; private isElementScrollable; + private isOnViewport; } diff --git a/package.json b/package.json index 41bdf0ef..ac1d88a1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cupertino-pane", "description": "Multiplatform slide-over pane", - "version": "1.2.32", + "version": "1.2.4", "author": "Roman Antonov (roman-rr)", "homepage": "https://github.com/roman-rr/cupertino-pane/", "repository": "roman-rr/cupertino-pane", diff --git a/playground/overflow.html b/playground/overflow.html index 16db7008..ccc65a2d 100644 --- a/playground/overflow.html +++ b/playground/overflow.html @@ -142,7 +142,6 @@

Size matters not

// top: { enabled: false, offset: 700 } // }, darkMode: true, - fitScreenHeight: true, // draggableOver: true, // dragByCursor: false, // backdrop: true, diff --git a/src/breakpoints.ts b/src/breakpoints.ts index 5a3ab8b9..e2bd6571 100644 --- a/src/breakpoints.ts +++ b/src/breakpoints.ts @@ -77,10 +77,11 @@ export class Breakpoints { if (this.settings.breaks[val]?.height > this.instance.screen_height) { this.settings.breaks[val].height = this.instance.screen_height - this.settings.bottomOffset; } - if (this.settings.breaks['top'] && this.settings.breaks['middle'] - && this.settings.breaks['top'].height === this.settings.breaks['middle']?.height) { - this.settings.breaks['middle'].enabled = false; - this.settings.initialBreak = 'top'; + if (this.settings.breaks['top'] && this.settings.breaks['middle']) { + if (this.settings.breaks['top'].height - 50 <= this.settings.breaks['middle'].height) { + this.settings.breaks['middle'].enabled = false; + this.settings.initialBreak = 'top'; + } } } @@ -109,13 +110,12 @@ export class Breakpoints { } }); - // Save breakpoints (not for resize event) - // TODO: solve immutable issue: 1.Weak set 2. Use In events.ts - if (lock) { + // initial lock on present + if (!this.lockedBreakpoints) { this.lockedBreakpoints = JSON.stringify(this.settings.breaks); } - - // Warnings + + // Warnings if (!this.instance.isPanePresented()) { if (!this.settings.breaks[this.settings.initialBreak].enabled) { console.warn('Cupertino Pane: Please set initialBreak for enabled breakpoint'); diff --git a/src/cupertino-pane.ts b/src/cupertino-pane.ts index 4ee39922..2dd30e23 100644 --- a/src/cupertino-pane.ts +++ b/src/cupertino-pane.ts @@ -334,13 +334,6 @@ export class CupertinoPane { } public setOverflowHeight(offset = 0) { - // overflowEl is not visible - ignoring execution - // TODO: inputs only for visible elements - if (this.overflowEl.offsetHeight === 0 - && this.overflowEl.offsetWidth === 0) { - return; - } - if (!this.settings.inverse) { this.overflowEl.style.height = `${this.getPaneHeight() - this.settings.topperOverflowOffset @@ -730,7 +723,6 @@ export class CupertinoPane { * Transitions handler */ public doTransition(params:any = {}): void { - // touchmove simple event if (params.type === 'move') { this.paneEl.style.transition = 'all 0ms linear 0ms'; diff --git a/src/events.ts b/src/events.ts index af6323f4..539074f2 100644 --- a/src/events.ts +++ b/src/events.ts @@ -17,7 +17,8 @@ export class Events { private startY: number; private startX: number; private steps: any[] = []; - private inputBlured: boolean = false; + private inputBluredbyMove: boolean = false; + private movedByKeyboard: boolean = false; constructor(private instance: CupertinoPane, @@ -57,7 +58,8 @@ export class Events { }); } - window.addEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.addEventListener('resize', this.onWindowResizeCb); } public detachAllEvents() { @@ -76,7 +78,8 @@ export class Events { window.removeEventListener('keyboardWillHide', this.onKeyboardHideCb); } - window.removeEventListener('orientationchange', this.onOrientationChangeCb); + // Orientation change + window resize + window.removeEventListener('resize', this.onWindowResizeCb); } public resetEvents() { @@ -232,7 +235,7 @@ export class Events { if (this.isFormElement(document.activeElement) && !(this.isFormElement(t.target))) { (document.activeElement).blur(); - this.inputBlured = true; + this.inputBluredbyMove = true; } } @@ -422,31 +425,46 @@ export class Events { */ public onKeyboardShowCb = (e) => this.onKeyboardShow(e); private onKeyboardShow(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0 ) { + // focud element not inside pane + if (!this.isPaneDescendant(document.activeElement)) { + return; + } + + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { setTimeout(() => this.fixAndroidResize(), 20); } + this.movedByKeyboard = true; this.breakpoints.prevBreakpoint = Object.entries(this.breakpoints.breaks).find(val => val[1] === this.instance.getPanelTransformY())[0]; let newHeight = this.settings.breaks[this.instance.currentBreak()].height + e.keyboardHeight; + + // Landscape case + let isLandscape = window.matchMedia('(orientation: landscape)').matches; + if (isLandscape) { + newHeight = this.instance.screen_height; + } - if (this.instance.screen_height < newHeight) { - let diff = newHeight - this.instance.screen_height + (135 * 0.35); - newHeight = this.instance.screen_height - (135 * 0.35); - this.instance.setOverflowHeight(e.keyboardHeight); - this.instance.moveToBreak(this.settings.breaks.top.enabled ? 'top' : 'middle'); - } else { - this.instance.setOverflowHeight(e.keyboardHeight); - this.instance.moveToHeight(newHeight); - setTimeout(() => this.instance.overflowEl.scrollTop = (document.activeElement).offsetTop); + // higher than screen + offsets + if (newHeight > this.instance.screen_height - 80) { + newHeight = this.instance.screen_height - 80; } + + // Move pane up if new position more than 50px + if (newHeight - 50 >= this.settings.breaks[this.instance.currentBreak()].height) { + this.instance.moveToHeight(newHeight); + } + + // Remove offset because on new height no offsets needs + // Timeout await for keyboard presented + setTimeout(() => { + this.instance.setOverflowHeight(e.keyboardHeight - this.settings.topperOverflowOffset); + this.instance.overflowEl.scrollTop = (document.activeElement).offsetTop; + }, 300); } /** @@ -455,36 +473,40 @@ export class Events { */ public onKeyboardHideCb = (e) => this.onKeyboardHide(e); private onKeyboardHide(e) { - // TODO: instead of this -> check that inputBlured is instance child - if (this.instance.paneEl - && this.instance.paneEl.offsetWidth === 0 - && this.instance.paneEl.offsetHeight === 0 ) { + // Move back + if (!this.movedByKeyboard) { + return; + } + + // pane not visible on viewport + if (!this.isOnViewport()) { return; } - // TODO! if (this.device.android) { this.fixAndroidResize(); } - if (this.inputBlured) { - this.inputBlured = false; - } else { - if (!this.instance.isHidden()) { - this.instance.moveToBreak(this.breakpoints.prevBreakpoint); - } - } + this.movedByKeyboard = false; - setTimeout(() => this.instance.setOverflowHeight()); + this.instance.setOverflowHeight(); + + if (this.inputBluredbyMove) { + this.inputBluredbyMove = false; + return; + } + + if (!this.instance.isHidden()) { + this.instance.moveToBreak(this.breakpoints.prevBreakpoint); + } } /** * Window resize event * @param e */ - public onOrientationChangeCb = (e) => this.onOrientationChange(e); - private async onOrientationChange(e) { - // Browsers issue: Currently no proper way to get window.innerHeight without timeout + public onWindowResizeCb = (e) => this.onWindowResize(e); + private async onWindowResize(e) { await new Promise((resolve) => setTimeout(() => resolve(true), 150)); this.instance.updateScreenHeights(); this.breakpoints.buildBreakpoints(JSON.parse(this.breakpoints.lockedBreakpoints), false); @@ -528,6 +550,17 @@ export class Events { return true; } + private isPaneDescendant(el): boolean { + let node = el.parentNode; + while (node != null) { + if (node == this.instance.paneEl) { + return true; + } + node = node.parentNode; + } + return false; + } + private isFormElement(el):boolean { const formElements: string[] = [ 'input', 'select', 'option', @@ -544,4 +577,15 @@ export class Events { private isElementScrollable(el):boolean { return el.scrollHeight > el.clientHeight ? true : false; } + + private isOnViewport(): boolean { + if (this.instance.paneEl + && this.instance.paneEl.offsetWidth === 0 + && this.instance.paneEl.offsetHeight === 0 ) { + return false; + } + + return true; + } + }