aiber-martin/www/input-shims-4f0dbb39-js-es5.js.map
Martin Donnelly a4b8625d0f init
2020-12-17 16:23:12 +00:00

1 line
30 KiB
Plaintext

{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/input-shims-4f0dbb39.js"],"names":["cloneMap","WeakMap","relocateInput","componentEl","inputEl","shouldRelocate","inputRelativeY","has","addClone","removeClone","isFocused","input","getRootNode","activeElement","parentEl","parentNode","clonedEl","cloneNode","classList","add","tabIndex","appendChild","set","doc","ownerDocument","tx","dir","style","pointerEvents","transform","clone","get","remove","enableHideCaretOnScroll","scrollEl","scrollHideCaret","shouldHideCaret","onBlur","hideCaret","showCaret","addEventListener","removeEventListener","SKIP_SELECTOR","enableInputBlurring","focused","didScroll","document","onScroll","onFocusin","onTouchend","ev","active","matches","tapped","target","closest","setTimeout","blur","SCROLL_ASSIST_SPEED","getScrollData","contentEl","keyboardHeight","itemEl","calcScrollData","getBoundingClientRect","defaultView","innerHeight","inputRect","contentRect","platformHeight","inputTop","top","inputBottom","bottom","visibleAreaTop","visibleAreaBottom","Math","min","safeAreaTop","safeAreaBottom","distanceToBottom","distanceToTop","desiredScrollAmount","round","scrollAmount","distance","abs","duration","scrollDuration","max","scrollPadding","inputSafeY","enableScrollAssist","footerEl","coord","touchStart","touchEnd","endCoord","hasPointerMoved","preventDefault","stopPropagation","jsSetFocus","scrollData","focus","window","scrollContent","scrollContentTimeout","undefined","clearTimeout","doubleKeyboardEventListener","scrollByPoint","getScrollElement","totalScrollAmount","scrollHeight","clientHeight","scrollTop","type","threshold","startCoord","deltaX","x","deltaY","y","PADDING_TIMER_KEY","enableScrollPadding","setScrollPadding","onFocusout","tagName","parentElement","el","timer","setProperty","INPUT_BLURRING","SCROLL_PADDING","startInputShims","config","getNumber","scrollAssist","getBoolean","inputBlurring","inputs","Array","from","querySelectorAll","hideCaretMap","scrollAssistMap","registerInput","componentOnReady","inputRoot","shadowRoot","querySelector","rmFn","unregisterInput","fn","detail"],"mappings":";;;;;;;;;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AAH;;AAAA,0BAAbL,aAAa;AAAA;AAAA;AAAA,WAAnB;;AAoBA,YAAMM,eAAe,GAAG,SAAlBA,eAAkB,CAACrJ,WAAD,EAAiB;AACrC,cAAKmC,SAAL,EAAgB;AACZ,gBAAMmH,EAAE,GAAGT,YAAY,CAACjH,GAAb,CAAiB5B,WAAjB,CAAX;;AACA,gBAAIsJ,EAAJ,EAAQ;AACJA,gBAAE;AACL;;AACDT,wBAAY,UAAZ,CAAoB7I,WAApB;AACH;;AACD,cAAKsI,YAAL,EAAmB;AACf,gBAAMgB,GAAE,GAAGR,eAAe,CAAClH,GAAhB,CAAoB5B,WAApB,CAAX;;AACA,gBAAIsJ,GAAJ,EAAQ;AACJA,iBAAE;AACL;;AACDR,2BAAe,UAAf,CAAuB9I,WAAvB;AACH;AACJ,SAfD;;AAgBA,YAAIwI,aAAa,IAAIP,cAArB,EAAqC;AACjCzF,6BAAmB;AACtB;;AACD,YAAI+C,aAAa,IAAI2C,cAArB,EAAqC;AACjCT,6BAAmB,CAAC/D,cAAD,CAAnB;AACH,SAnD+B,CAoDhC;AACA;AACA;;;AACA,mCAAoB+E,MAApB,6BAA4B;AAAvB,cAAMjI,KAAK,cAAX;AACDuI,uBAAa,CAACvI,KAAD,CAAb;AACH;;AACDY,WAAG,CAACiB,gBAAJ,CAAqB,iBAArB,EAAyC,UAACU,EAAD,EAAQ;AAC7CgG,uBAAa,CAAChG,EAAE,CAACwG,MAAJ,CAAb;AACH,SAFD;AAGAnI,WAAG,CAACiB,gBAAJ,CAAqB,mBAArB,EAA2C,UAACU,EAAD,EAAQ;AAC/CsG,yBAAe,CAACtG,EAAE,CAACwG,MAAJ,CAAf;AACH,SAFD;AAGH,OAhED","file":"input-shims-4f0dbb39-js-es5.js","sourcesContent":["import { p as pointerCoord } from './helpers-5c745fbd.js';\n\nconst cloneMap = new WeakMap();\nconst relocateInput = (componentEl, inputEl, shouldRelocate, inputRelativeY = 0) => {\n if (cloneMap.has(componentEl) === shouldRelocate) {\n return;\n }\n if (shouldRelocate) {\n addClone(componentEl, inputEl, inputRelativeY);\n }\n else {\n removeClone(componentEl, inputEl);\n }\n};\nconst isFocused = (input) => {\n return input === input.getRootNode().activeElement;\n};\nconst addClone = (componentEl, inputEl, inputRelativeY) => {\n // this allows for the actual input to receive the focus from\n // the user's touch event, but before it receives focus, it\n // moves the actual input to a location that will not screw\n // up the app's layout, and does not allow the native browser\n // to attempt to scroll the input into place (messing up headers/footers)\n // the cloned input fills the area of where native input should be\n // while the native input fakes out the browser by relocating itself\n // before it receives the actual focus event\n // We hide the focused input (with the visible caret) invisible by making it scale(0),\n const parentEl = inputEl.parentNode;\n // DOM WRITES\n const clonedEl = inputEl.cloneNode(false);\n clonedEl.classList.add('cloned-input');\n clonedEl.tabIndex = -1;\n parentEl.appendChild(clonedEl);\n cloneMap.set(componentEl, clonedEl);\n const doc = componentEl.ownerDocument;\n const tx = doc.dir === 'rtl' ? 9999 : -9999;\n componentEl.style.pointerEvents = 'none';\n inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0) scale(0)`;\n};\nconst removeClone = (componentEl, inputEl) => {\n const clone = cloneMap.get(componentEl);\n if (clone) {\n cloneMap.delete(componentEl);\n clone.remove();\n }\n componentEl.style.pointerEvents = '';\n inputEl.style.transform = '';\n};\n\nconst enableHideCaretOnScroll = (componentEl, inputEl, scrollEl) => {\n if (!scrollEl || !inputEl) {\n return () => { return; };\n }\n const scrollHideCaret = (shouldHideCaret) => {\n if (isFocused(inputEl)) {\n relocateInput(componentEl, inputEl, shouldHideCaret);\n }\n };\n const onBlur = () => relocateInput(componentEl, inputEl, false);\n const hideCaret = () => scrollHideCaret(true);\n const showCaret = () => scrollHideCaret(false);\n scrollEl.addEventListener('ionScrollStart', hideCaret);\n scrollEl.addEventListener('ionScrollEnd', showCaret);\n inputEl.addEventListener('blur', onBlur);\n return () => {\n scrollEl.removeEventListener('ionScrollStart', hideCaret);\n scrollEl.removeEventListener('ionScrollEnd', showCaret);\n inputEl.addEventListener('ionBlur', onBlur);\n };\n};\n\nconst SKIP_SELECTOR = 'input, textarea, [no-blur]';\nconst enableInputBlurring = () => {\n let focused = true;\n let didScroll = false;\n const doc = document;\n const onScroll = () => {\n didScroll = true;\n };\n const onFocusin = () => {\n focused = true;\n };\n const onTouchend = (ev) => {\n // if app did scroll return early\n if (didScroll) {\n didScroll = false;\n return;\n }\n const active = doc.activeElement;\n if (!active) {\n return;\n }\n // only blur if the active element is a text-input or a textarea\n if (active.matches(SKIP_SELECTOR)) {\n return;\n }\n // if the selected target is the active element, do not blur\n const tapped = ev.target;\n if (tapped === active) {\n return;\n }\n if (tapped.matches(SKIP_SELECTOR) || tapped.closest(SKIP_SELECTOR)) {\n return;\n }\n focused = false;\n // TODO: find a better way, why 50ms?\n setTimeout(() => {\n if (!focused) {\n active.blur();\n }\n }, 50);\n };\n doc.addEventListener('ionScrollStart', onScroll);\n doc.addEventListener('focusin', onFocusin, true);\n doc.addEventListener('touchend', onTouchend, false);\n return () => {\n doc.removeEventListener('ionScrollStart', onScroll, true);\n doc.removeEventListener('focusin', onFocusin, true);\n doc.removeEventListener('touchend', onTouchend, false);\n };\n};\n\nconst SCROLL_ASSIST_SPEED = 0.3;\nconst getScrollData = (componentEl, contentEl, keyboardHeight) => {\n const itemEl = componentEl.closest('ion-item,[ion-item]') || componentEl;\n return calcScrollData(itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, componentEl.ownerDocument.defaultView.innerHeight);\n};\nconst calcScrollData = (inputRect, contentRect, keyboardHeight, platformHeight) => {\n // compute input's Y values relative to the body\n const inputTop = inputRect.top;\n const inputBottom = inputRect.bottom;\n // compute visible area\n const visibleAreaTop = contentRect.top;\n const visibleAreaBottom = Math.min(contentRect.bottom, platformHeight - keyboardHeight);\n // compute safe area\n const safeAreaTop = visibleAreaTop + 15;\n const safeAreaBottom = visibleAreaBottom * 0.75;\n // figure out if each edge of the input is within the safe area\n const distanceToBottom = safeAreaBottom - inputBottom;\n const distanceToTop = safeAreaTop - inputTop;\n // desiredScrollAmount is the negated distance to the safe area according to our calculations.\n const desiredScrollAmount = Math.round((distanceToBottom < 0)\n ? -distanceToBottom\n : (distanceToTop > 0)\n ? -distanceToTop\n : 0);\n // our calculations make some assumptions that aren't always true, like the keyboard being closed when an input\n // gets focus, so make sure we don't scroll the input above the visible area\n const scrollAmount = Math.min(desiredScrollAmount, inputTop - visibleAreaTop);\n const distance = Math.abs(scrollAmount);\n const duration = distance / SCROLL_ASSIST_SPEED;\n const scrollDuration = Math.min(400, Math.max(150, duration));\n return {\n scrollAmount,\n scrollDuration,\n scrollPadding: keyboardHeight,\n inputSafeY: -(inputTop - safeAreaTop) + 4\n };\n};\n\nconst enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {\n let coord;\n const touchStart = (ev) => {\n coord = pointerCoord(ev);\n };\n const touchEnd = (ev) => {\n // input cover touchend/mouseup\n if (!coord) {\n return;\n }\n // get where the touchend/mouseup ended\n const endCoord = pointerCoord(ev);\n // focus this input if the pointer hasn't moved XX pixels\n // and the input doesn't already have focus\n if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {\n ev.preventDefault();\n ev.stopPropagation();\n // begin the input focus process\n jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight);\n }\n };\n componentEl.addEventListener('touchstart', touchStart, true);\n componentEl.addEventListener('touchend', touchEnd, true);\n return () => {\n componentEl.removeEventListener('touchstart', touchStart, true);\n componentEl.removeEventListener('touchend', touchEnd, true);\n };\n};\nconst jsSetFocus = async (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {\n if (!contentEl && !footerEl) {\n return;\n }\n const scrollData = getScrollData(componentEl, (contentEl || footerEl), keyboardHeight);\n if (contentEl && Math.abs(scrollData.scrollAmount) < 4) {\n // the text input is in a safe position that doesn't\n // require it to be scrolled into view, just set focus now\n inputEl.focus();\n return;\n }\n // temporarily move the focus to the focus holder so the browser\n // doesn't freak out while it's trying to get the input in place\n // at this point the native text input still does not have focus\n relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);\n inputEl.focus();\n /* tslint:disable-next-line */\n if (typeof window !== 'undefined') {\n let scrollContentTimeout;\n const scrollContent = async () => {\n // clean up listeners and timeouts\n if (scrollContentTimeout !== undefined) {\n clearTimeout(scrollContentTimeout);\n }\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.removeEventListener('ionKeyboardDidShow', scrollContent);\n // scroll the input into place\n if (contentEl) {\n await contentEl.scrollByPoint(0, scrollData.scrollAmount, scrollData.scrollDuration);\n }\n // the scroll view is in the correct position now\n // give the native text input focus\n relocateInput(componentEl, inputEl, false, scrollData.inputSafeY);\n // ensure this is the focused input\n inputEl.focus();\n };\n const doubleKeyboardEventListener = () => {\n window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n };\n if (contentEl) {\n const scrollEl = await contentEl.getScrollElement();\n /**\n * scrollData will only consider the amount we need\n * to scroll in order to properly bring the input\n * into view. It will not consider the amount\n * we can scroll in the content element.\n * As a result, scrollData may request a greater\n * scroll position than is currently available\n * in the DOM. If this is the case, we need to\n * wait for the webview to resize/the keyboard\n * to show in order for additional scroll\n * bandwidth to become available.\n */\n const totalScrollAmount = scrollEl.scrollHeight - scrollEl.clientHeight;\n if (scrollData.scrollAmount > (totalScrollAmount - scrollEl.scrollTop)) {\n /**\n * On iOS devices, the system will show a \"Passwords\" bar above the keyboard\n * after the initial keyboard is shown. This prevents the webview from resizing\n * until the \"Passwords\" bar is shown, so we need to wait for that to happen first.\n */\n if (inputEl.type === 'password') {\n // Add 50px to account for the \"Passwords\" bar\n scrollData.scrollAmount += 50;\n window.addEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);\n }\n else {\n window.addEventListener('ionKeyboardDidShow', scrollContent);\n }\n /**\n * This should only fire in 2 instances:\n * 1. The app is very slow.\n * 2. The app is running in a browser on an old OS\n * that does not support Ionic Keyboard Events\n */\n scrollContentTimeout = setTimeout(scrollContent, 1000);\n return;\n }\n }\n scrollContent();\n }\n};\nconst hasPointerMoved = (threshold, startCoord, endCoord) => {\n if (startCoord && endCoord) {\n const deltaX = (startCoord.x - endCoord.x);\n const deltaY = (startCoord.y - endCoord.y);\n const distance = deltaX * deltaX + deltaY * deltaY;\n return distance > (threshold * threshold);\n }\n return false;\n};\n\nconst PADDING_TIMER_KEY = '$ionPaddingTimer';\nconst enableScrollPadding = (keyboardHeight) => {\n const doc = document;\n const onFocusin = (ev) => {\n setScrollPadding(ev.target, keyboardHeight);\n };\n const onFocusout = (ev) => {\n setScrollPadding(ev.target, 0);\n };\n doc.addEventListener('focusin', onFocusin);\n doc.addEventListener('focusout', onFocusout);\n return () => {\n doc.removeEventListener('focusin', onFocusin);\n doc.removeEventListener('focusout', onFocusout);\n };\n};\nconst setScrollPadding = (input, keyboardHeight) => {\n if (input.tagName !== 'INPUT') {\n return;\n }\n if (input.parentElement && input.parentElement.tagName === 'ION-INPUT') {\n return;\n }\n if (input.parentElement &&\n input.parentElement.parentElement &&\n input.parentElement.parentElement.tagName === 'ION-SEARCHBAR') {\n return;\n }\n const el = input.closest('ion-content');\n if (el === null) {\n return;\n }\n const timer = el[PADDING_TIMER_KEY];\n if (timer) {\n clearTimeout(timer);\n }\n if (keyboardHeight > 0) {\n el.style.setProperty('--keyboard-offset', `${keyboardHeight}px`);\n }\n else {\n el[PADDING_TIMER_KEY] = setTimeout(() => {\n el.style.setProperty('--keyboard-offset', '0px');\n }, 120);\n }\n};\n\nconst INPUT_BLURRING = true;\nconst SCROLL_PADDING = true;\nconst startInputShims = (config) => {\n const doc = document;\n const keyboardHeight = config.getNumber('keyboardHeight', 290);\n const scrollAssist = config.getBoolean('scrollAssist', true);\n const hideCaret = config.getBoolean('hideCaretOnScroll', true);\n const inputBlurring = config.getBoolean('inputBlurring', true);\n const scrollPadding = config.getBoolean('scrollPadding', true);\n const inputs = Array.from(doc.querySelectorAll('ion-input, ion-textarea'));\n const hideCaretMap = new WeakMap();\n const scrollAssistMap = new WeakMap();\n const registerInput = async (componentEl) => {\n if (componentEl.componentOnReady) {\n await componentEl.componentOnReady();\n }\n const inputRoot = componentEl.shadowRoot || componentEl;\n const inputEl = inputRoot.querySelector('input') || inputRoot.querySelector('textarea');\n const scrollEl = componentEl.closest('ion-content');\n const footerEl = (!scrollEl) ? componentEl.closest('ion-footer') : null;\n if (!inputEl) {\n return;\n }\n if ( !!scrollEl && hideCaret && !hideCaretMap.has(componentEl)) {\n const rmFn = enableHideCaretOnScroll(componentEl, inputEl, scrollEl);\n hideCaretMap.set(componentEl, rmFn);\n }\n if ( (!!scrollEl || !!footerEl) && scrollAssist && !scrollAssistMap.has(componentEl)) {\n const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight);\n scrollAssistMap.set(componentEl, rmFn);\n }\n };\n const unregisterInput = (componentEl) => {\n if ( hideCaret) {\n const fn = hideCaretMap.get(componentEl);\n if (fn) {\n fn();\n }\n hideCaretMap.delete(componentEl);\n }\n if ( scrollAssist) {\n const fn = scrollAssistMap.get(componentEl);\n if (fn) {\n fn();\n }\n scrollAssistMap.delete(componentEl);\n }\n };\n if (inputBlurring && INPUT_BLURRING) {\n enableInputBlurring();\n }\n if (scrollPadding && SCROLL_PADDING) {\n enableScrollPadding(keyboardHeight);\n }\n // Input might be already loaded in the DOM before ion-device-hacks did.\n // At this point we need to look for all of the inputs not registered yet\n // and register them.\n for (const input of inputs) {\n registerInput(input);\n }\n doc.addEventListener('ionInputDidLoad', ((ev) => {\n registerInput(ev.detail);\n }));\n doc.addEventListener('ionInputDidUnload', ((ev) => {\n unregisterInput(ev.detail);\n }));\n};\n\nexport { startInputShims };\n"]}