aiber-test/www/keyboard-5742b5da-js-es5.js.map
2020-12-18 09:30:04 +00:00

1 line
8.0 KiB
Plaintext

{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/keyboard-5742b5da.js"],"names":["KEYBOARD_DID_OPEN","KEYBOARD_DID_CLOSE","KEYBOARD_THRESHOLD","previousVisualViewport","currentVisualViewport","keyboardOpen","resetKeyboardAssist","startKeyboardAssist","win","startNativeListeners","visualViewport","copyVisualViewport","onresize","trackViewportChanges","keyboardDidOpen","keyboardDidResize","setKeyboardOpen","keyboardDidClose","setKeyboardClose","addEventListener","ev","fireKeyboardOpenEvent","fireKeyboardCloseEvent","scaledHeightDifference","height","scale","width","innerHeight","nativeEv","keyboardHeight","CustomEvent","detail","dispatchEvent","Object","assign","Math","round","offsetTop","offsetLeft","pageTop","pageLeft"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAAA,UAAMA,iBAAiB,GAAG,oBAA1B;AACA,UAAMC,kBAAkB,GAAG,oBAA3B;AACA,UAAMC,kBAAkB,GAAG,GAA3B;AACA,UAAIC,sBAAsB,GAAG,EAA7B;AACA,UAAIC,qBAAqB,GAAG,EAA5B;AACA,UAAIC,YAAY,GAAG,KAAnB;AACA;;;;AAGA,UAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAM;AAChCH,8BAAsB,GAAG,EAAzB;AACAC,6BAAqB,GAAG,EAAxB;AACAC,oBAAY,GAAG,KAAf;AACD,OAJD;;AAKA,UAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,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AACAA,6BAAqB,GAAGO,kBAAkB,CAACH,GAAG,CAACE,cAAL,CAA1C;AACD,OAHD;AAIA;;;;;;AAIA,UAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAACD,cAAD,EAAoB;AAC7C,eAAO;AACLgB,eAAK,EAAES,IAAI,CAACC,KAAL,CAAW1B,cAAc,CAACgB,KAA1B,CADF;AAELF,gBAAM,EAAEW,IAAI,CAACC,KAAL,CAAW1B,cAAc,CAACc,MAA1B,CAFH;AAGLa,mBAAS,EAAE3B,cAAc,CAAC2B,SAHrB;AAILC,oBAAU,EAAE5B,cAAc,CAAC4B,UAJtB;AAKLC,iBAAO,EAAE7B,cAAc,CAAC6B,OALnB;AAMLC,kBAAQ,EAAE9B,cAAc,CAAC8B,QANpB;AAOLf,eAAK,EAAEf,cAAc,CAACe;AAPjB,SAAP;AASD,OAVD","file":"keyboard-5742b5da-js-es5.js","sourcesContent":["const KEYBOARD_DID_OPEN = 'ionKeyboardDidShow';\nconst KEYBOARD_DID_CLOSE = 'ionKeyboardDidHide';\nconst KEYBOARD_THRESHOLD = 150;\nlet previousVisualViewport = {};\nlet currentVisualViewport = {};\nlet keyboardOpen = false;\n/**\n * This is only used for tests\n */\nconst resetKeyboardAssist = () => {\n previousVisualViewport = {};\n currentVisualViewport = {};\n keyboardOpen = false;\n};\nconst startKeyboardAssist = (win) => {\n startNativeListeners(win);\n if (!win.visualViewport) {\n return;\n }\n currentVisualViewport = copyVisualViewport(win.visualViewport);\n win.visualViewport.onresize = () => {\n trackViewportChanges(win);\n if (keyboardDidOpen() || keyboardDidResize(win)) {\n setKeyboardOpen(win);\n }\n else if (keyboardDidClose(win)) {\n setKeyboardClose(win);\n }\n };\n};\n/**\n * Listen for events fired by native keyboard plugin\n * in Capacitor/Cordova so devs only need to listen\n * in one place.\n */\nconst startNativeListeners = (win) => {\n win.addEventListener('keyboardDidShow', ev => setKeyboardOpen(win, ev));\n win.addEventListener('keyboardDidHide', () => setKeyboardClose(win));\n};\nconst setKeyboardOpen = (win, ev) => {\n fireKeyboardOpenEvent(win, ev);\n keyboardOpen = true;\n};\nconst setKeyboardClose = (win) => {\n fireKeyboardCloseEvent(win);\n keyboardOpen = false;\n};\n/**\n * Returns `true` if the `keyboardOpen` flag is not\n * set, the previous visual viewport width equal the current\n * visual viewport width, and if the scaled difference\n * of the previous visual viewport height minus the current\n * visual viewport height is greater than KEYBOARD_THRESHOLD\n *\n * We need to be able to accommodate users who have zooming\n * enabled in their browser (or have zoomed in manually) which\n * is why we take into account the current visual viewport's\n * scale value.\n */\nconst keyboardDidOpen = () => {\n const scaledHeightDifference = (previousVisualViewport.height - currentVisualViewport.height) * currentVisualViewport.scale;\n return (!keyboardOpen &&\n previousVisualViewport.width === currentVisualViewport.width &&\n scaledHeightDifference > KEYBOARD_THRESHOLD);\n};\n/**\n * Returns `true` if the keyboard is open,\n * but the keyboard did not close\n */\nconst keyboardDidResize = (win) => {\n return keyboardOpen && !keyboardDidClose(win);\n};\n/**\n * Determine if the keyboard was closed\n * Returns `true` if the `keyboardOpen` flag is set and\n * the current visual viewport height equals the\n * layout viewport height.\n */\nconst keyboardDidClose = (win) => {\n return keyboardOpen && currentVisualViewport.height === win.innerHeight;\n};\n/**\n * Dispatch a keyboard open event\n */\nconst fireKeyboardOpenEvent = (win, nativeEv) => {\n const keyboardHeight = nativeEv ? nativeEv.keyboardHeight : win.innerHeight - currentVisualViewport.height;\n const ev = new CustomEvent(KEYBOARD_DID_OPEN, {\n detail: { keyboardHeight }\n });\n win.dispatchEvent(ev);\n};\n/**\n * Dispatch a keyboard close event\n */\nconst fireKeyboardCloseEvent = (win) => {\n const ev = new CustomEvent(KEYBOARD_DID_CLOSE);\n win.dispatchEvent(ev);\n};\n/**\n * Given a window object, create a copy of\n * the current visual and layout viewport states\n * while also preserving the previous visual and\n * layout viewport states\n */\nconst trackViewportChanges = (win) => {\n previousVisualViewport = Object.assign({}, currentVisualViewport);\n currentVisualViewport = copyVisualViewport(win.visualViewport);\n};\n/**\n * Creates a deep copy of the visual viewport\n * at a given state\n */\nconst copyVisualViewport = (visualViewport) => {\n return {\n width: Math.round(visualViewport.width),\n height: Math.round(visualViewport.height),\n offsetTop: visualViewport.offsetTop,\n offsetLeft: visualViewport.offsetLeft,\n pageTop: visualViewport.pageTop,\n pageLeft: visualViewport.pageLeft,\n scale: visualViewport.scale\n };\n};\n\nexport { KEYBOARD_DID_CLOSE, KEYBOARD_DID_OPEN, copyVisualViewport, keyboardDidClose, keyboardDidOpen, keyboardDidResize, resetKeyboardAssist, setKeyboardClose, setKeyboardOpen, startKeyboardAssist, trackViewportChanges };\n"]}