@ionic/core 7.3.4-dev.11694542086.1f624b36 → 7.3.4-dev.11694548895.1578981b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/input-shims.js +18 -78
- package/dist/cjs/{input-shims-d8e322aa.js → input-shims-93284c80.js} +18 -79
- package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
- package/dist/collection/utils/input-shims/hacks/scroll-assist.js +16 -75
- package/dist/collection/utils/input-shims/hacks/scroll-data.js +2 -3
- package/dist/docs.json +1 -1
- package/dist/esm/{input-shims-c738363e.js → input-shims-4f1b0af9.js} +18 -79
- package/dist/esm/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/input-shims-4f1b0af9.js +4 -0
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-1d4a4a94.system.js +4 -0
- package/dist/ionic/p-c4abd708.js +4 -0
- package/dist/ionic/p-c68a8814.system.js +1 -1
- package/dist/ionic/{p-c2b524f3.system.entry.js → p-d524e68b.system.entry.js} +1 -1
- package/dist/ionic/{p-7b14f1a9.entry.js → p-fc991193.entry.js} +1 -1
- package/dist/types/utils/input-shims/hacks/scroll-data.d.ts +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/input-shims-c738363e.js +0 -4
- package/dist/ionic/p-c254bde2.js +0 -4
- package/dist/ionic/p-f58cbf92.system.js +0 -4
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{__awaiter,__generator}from"tslib";
|
|
2
|
-
/*!
|
|
3
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{g as getScrollElement,c as scrollByPoint,f as findClosestIonContent}from"./index-746a238e.js";import{a as addEventListener,b as removeEventListener,r as raf,c as componentOnReady}from"./helpers-3379ba19.js";import{a as KeyboardResize,K as Keyboard}from"./keyboard-b063f012.js";import"./index-595d62c9.js";import"./capacitor-b4979570.js";import"./index-7a14ecec.js";var cloneMap=new WeakMap;var relocateInput=function(e,t,n,r,o){if(r===void 0){r=0}if(o===void 0){o=false}if(cloneMap.has(e)===n){return}if(n){addClone(e,t,r,o)}else{removeClone(e,t)}};var isFocused=function(e){return e===e.getRootNode().activeElement};var addClone=function(e,t,n,r){if(r===void 0){r=false}var o=t.parentNode;var i=t.cloneNode(false);i.classList.add("cloned-input");i.tabIndex=-1;if(r){i.disabled=true}o.appendChild(i);cloneMap.set(e,i);var a=e.ownerDocument;var s=a.dir==="rtl"?9999:-9999;e.style.pointerEvents="none";t.style.transform="translate3d(".concat(s,"px,").concat(n,"px,0) scale(0)")};var removeClone=function(e,t){var n=cloneMap.get(e);if(n){cloneMap.delete(e);n.remove()}e.style.pointerEvents="";t.style.transform=""};var SCROLL_AMOUNT_PADDING=50;var enableHideCaretOnScroll=function(e,t,n){if(!n||!t){return function(){return}}var r=function(n){if(isFocused(t)){relocateInput(e,t,n)}};var o=function(){return relocateInput(e,t,false)};var i=function(){return r(true)};var a=function(){return r(false)};addEventListener(n,"ionScrollStart",i);addEventListener(n,"ionScrollEnd",a);t.addEventListener("blur",o);return function(){removeEventListener(n,"ionScrollStart",i);removeEventListener(n,"ionScrollEnd",a);t.removeEventListener("blur",o)}};var SKIP_SELECTOR="input, textarea, [no-blur], [contenteditable]";var enableInputBlurring=function(){var e=true;var t=false;var n=document;var r=function(){t=true};var o=function(){e=true};var i=function(r){if(t){t=false;return}var o=n.activeElement;if(!o){return}if(o.matches(SKIP_SELECTOR)){return}var i=r.target;if(i===o){return}if(i.matches(SKIP_SELECTOR)||i.closest(SKIP_SELECTOR)){return}e=false;setTimeout((function(){if(!e){o.blur()}}),50)};addEventListener(n,"ionScrollStart",r);n.addEventListener("focusin",o,true);n.addEventListener("touchend",i,false);return function(){removeEventListener(n,"ionScrollStart",r,true);n.removeEventListener("focusin",o,true);n.removeEventListener("touchend",i,false)}};var SCROLL_ASSIST_SPEED=.3;var getScrollData=function(e,t,n){var r;var o=(r=e.closest("ion-item,[ion-item]"))!==null&&r!==void 0?r:e;return calcScrollData(o.getBoundingClientRect(),t.getBoundingClientRect(),n,e.ownerDocument.defaultView.innerHeight)};var calcScrollData=function(e,t,n,r){var o=e.top;var i=e.bottom;var a=t.top;var s=Math.min(t.bottom,r-n);var u=a+15;var l=s-SCROLL_AMOUNT_PADDING;var d=l-i;var c=u-o;var f=Math.round(d<0?-d:c>0?-c:0);var v=Math.min(f,o-a);var S=Math.abs(v);var m=S/SCROLL_ASSIST_SPEED;var p=Math.min(400,Math.max(150,m));return{scrollAmount:v,scrollDuration:p,scrollPadding:n,inputSafeY:-(o-u)+4}};var PADDING_TIMER_KEY="$ionPaddingTimer";var setScrollPadding=function(e,t,n){var r=e[PADDING_TIMER_KEY];if(r){clearTimeout(r)}if(t>0){e.style.setProperty("--keyboard-offset","".concat(t,"px"))}else{e[PADDING_TIMER_KEY]=setTimeout((function(){e.style.setProperty("--keyboard-offset","0px");if(n){n()}}),120)}};var setClearScrollPaddingListener=function(e,t,n){var r=function(){if(t){setScrollPadding(t,0,n)}};e.addEventListener("focusout",r,{once:true})};var currentPadding=0;var SKIP_SCROLL_ASSIST="data-ionic-skip-scroll-assist";var enableScrollAssist=function(e,t,n,r,o,i,a,s){if(s===void 0){s=false}var u=i&&(a===undefined||a.mode===KeyboardResize.None);var l=false;var d=function(o){if(l===false){l=true;return}jsSetFocus(e,t,n,r,o.detail.keyboardHeight,u,s,false)};var c=function(){l=false;window.removeEventListener("ionKeyboardDidShow",d)};var f=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(i){if(t.hasAttribute(SKIP_SCROLL_ASSIST)){t.removeAttribute(SKIP_SCROLL_ASSIST);return[2]}jsSetFocus(e,t,n,r,o,u,s);window.addEventListener("ionKeyboardDidShow",d);e.addEventListener("focusout",c,true);return[2]}))}))};e.addEventListener("focusin",f,true);return function(){e.removeEventListener("focusin",f,true);window.removeEventListener("ionKeyboardDidShow",d);e.removeEventListener("focusout",c,true)}};var setManualFocus=function(e){if(document.activeElement===e){return}e.setAttribute(SKIP_SCROLL_ASSIST,"true");e.focus()};var jsSetFocus=function(e,t,n,r,o,i,a,s){if(a===void 0){a=false}if(s===void 0){s=true}return __awaiter(void 0,void 0,void 0,(function(){var u,l,d,c,f,v;return __generator(this,(function(S){switch(S.label){case 0:if(!n&&!r){return[2]}u=getScrollData(e,n||r,o);if(n&&Math.abs(u.scrollAmount)<4){setManualFocus(t);if(i&&n!==null){setScrollPadding(n,currentPadding);setClearScrollPaddingListener(t,n,(function(){return currentPadding=0}))}return[2]}relocateInput(e,t,true,u.inputSafeY,a);setManualFocus(t);raf((function(){return e.click()}));if(i&&n){currentPadding=u.scrollPadding;setScrollPadding(n,currentPadding)}if(!(typeof window!=="undefined"))return[3,3];d=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:if(l!==undefined){clearTimeout(l)}window.removeEventListener("ionKeyboardDidShow",c);window.removeEventListener("ionKeyboardDidShow",d);if(!n)return[3,2];return[4,scrollByPoint(n,0,u.scrollAmount,u.scrollDuration)];case 1:r.sent();r.label=2;case 2:relocateInput(e,t,false,u.inputSafeY);setManualFocus(t);if(i){setClearScrollPaddingListener(t,n,(function(){return currentPadding=0}))}return[2]}}))}))};c=function(){window.removeEventListener("ionKeyboardDidShow",c);window.addEventListener("ionKeyboardDidShow",d)};if(!n)return[3,2];return[4,getScrollElement(n)];case 1:f=S.sent();v=f.scrollHeight-f.clientHeight;if(s&&u.scrollAmount>v-f.scrollTop){if(t.type==="password"){u.scrollAmount+=SCROLL_AMOUNT_PADDING;window.addEventListener("ionKeyboardDidShow",c)}else{window.addEventListener("ionKeyboardDidShow",d)}l=setTimeout(d,1e3);return[2]}S.label=2;case 2:d();S.label=3;case 3:return[2]}}))}))};var INPUT_BLURRING=true;var startInputShims=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,l,d,c,f,v,S,m,p,L,E;return __generator(this,(function(_){switch(_.label){case 0:n=document;r=t==="ios";o=t==="android";i=e.getNumber("keyboardHeight",290);a=e.getBoolean("scrollAssist",true);s=e.getBoolean("hideCaretOnScroll",r);u=e.getBoolean("inputBlurring",r);l=e.getBoolean("scrollPadding",true);d=Array.from(n.querySelectorAll("ion-input, ion-textarea"));c=new WeakMap;f=new WeakMap;return[4,Keyboard.getResizeMode()];case 1:v=_.sent();S=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,n,r,u,d,S,d;return __generator(this,(function(m){switch(m.label){case 0:return[4,new Promise((function(t){return componentOnReady(e,t)}))];case 1:m.sent();t=e.shadowRoot||e;n=t.querySelector("input")||t.querySelector("textarea");r=findClosestIonContent(e);u=!r?e.closest("ion-footer"):null;if(!n){return[2]}if(!!r&&s&&!c.has(e)){d=enableHideCaretOnScroll(e,n,r);c.set(e,d)}S=n.type==="date"||n.type==="datetime-local";if(!S&&(!!r||!!u)&&a&&!f.has(e)){d=enableScrollAssist(e,n,r,u,i,l,v,o);f.set(e,d)}return[2]}}))}))};m=function(e){if(s){var t=c.get(e);if(t){t()}c.delete(e)}if(a){var t=f.get(e);if(t){t()}f.delete(e)}};if(u&&INPUT_BLURRING){enableInputBlurring()}for(p=0,L=d;p<L.length;p++){E=L[p];S(E)}n.addEventListener("ionInputDidLoad",(function(e){S(e.detail)}));n.addEventListener("ionInputDidUnload",(function(e){m(e.detail)}));return[2]}}))}))};export{startInputShims};
|
package/dist/ionic/p-c254bde2.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{g as o,c as n,f as t}from"./p-b24aa895.js";import{a as i,b as a,r as e,c as r}from"./p-63eb0acd.js";import{a as s,K as d}from"./p-419eb426.js";import"./p-1b8e1d03.js";import"./p-cc196b34.js";import"./p-b347cfd1.js";const c=new WeakMap,l=(o,n,t,i=0,a=!1)=>{c.has(o)!==t&&(t?u(o,n,i,a):w(o,n))},u=(o,n,t,i=!1)=>{const a=n.parentNode,e=n.cloneNode(!1);e.classList.add("cloned-input"),e.tabIndex=-1,i&&(e.disabled=!0),a.appendChild(e),c.set(o,e);const r="rtl"===o.ownerDocument.dir?9999:-9999;o.style.pointerEvents="none",n.style.transform=`translate3d(${r}px,${t}px,0) scale(0)`},w=(o,n)=>{const t=c.get(o);t&&(c.delete(o),t.remove()),o.style.pointerEvents="",n.style.transform=""},f="input, textarea, [no-blur], [contenteditable]",p="$ionPaddingTimer",b=(o,n,t)=>{const i=o[p];i&&clearTimeout(i),n>0?o.style.setProperty("--keyboard-offset",`${n}px`):o[p]=setTimeout((()=>{o.style.setProperty("--keyboard-offset","0px"),t&&t()}),120)},m=(o,n,t)=>{o.addEventListener("focusout",(()=>{n&&b(n,0,t)}),{once:!0})};let h=0;const y="data-ionic-skip-scroll-assist",S=o=>{document.activeElement!==o&&(o.setAttribute(y,"true"),o.focus())},D=async(t,i,a,r,s,d,c=!1,u=!0)=>{if(!a&&!r)return;const w=((o,n,t)=>{var i;return((o,n,t,i)=>{const a=o.top,e=o.bottom,r=n.top,s=r+15,d=Math.min(n.bottom,i-t)-50-e,c=s-a,l=Math.round(d<0?-d:c>0?-c:0),u=Math.min(l,a-r),w=Math.abs(u);return{scrollAmount:u,scrollDuration:Math.min(400,Math.max(150,w/.3)),scrollPadding:t,inputSafeY:4-(a-s)}})((null!==(i=o.closest("ion-item,[ion-item]"))&&void 0!==i?i:o).getBoundingClientRect(),n.getBoundingClientRect(),t,o.ownerDocument.defaultView.innerHeight)})(t,a||r,s);if(a&&Math.abs(w.scrollAmount)<4)return S(i),void(d&&null!==a&&(b(a,h),m(i,a,(()=>h=0))));if(l(t,i,!0,w.inputSafeY,c),S(i),e((()=>t.click())),d&&a&&(h=w.scrollPadding,b(a,h)),"undefined"!=typeof window){let e;const r=async()=>{void 0!==e&&clearTimeout(e),window.removeEventListener("ionKeyboardDidShow",s),window.removeEventListener("ionKeyboardDidShow",r),a&&await n(a,0,w.scrollAmount,w.scrollDuration),l(t,i,!1,w.inputSafeY),S(i),d&&m(i,a,(()=>h=0))},s=()=>{window.removeEventListener("ionKeyboardDidShow",s),window.addEventListener("ionKeyboardDidShow",r)};if(a){const n=await o(a);if(u&&w.scrollAmount>n.scrollHeight-n.clientHeight-n.scrollTop)return"password"===i.type?(w.scrollAmount+=50,window.addEventListener("ionKeyboardDidShow",s)):window.addEventListener("ionKeyboardDidShow",r),void(e=setTimeout(r,1e3))}r()}},K=async(o,n)=>{const e=document,c="ios"===n,u="android"===n,w=o.getNumber("keyboardHeight",290),p=o.getBoolean("scrollAssist",!0),b=o.getBoolean("hideCaretOnScroll",c),m=o.getBoolean("inputBlurring",c),h=o.getBoolean("scrollPadding",!0),S=Array.from(e.querySelectorAll("ion-input, ion-textarea")),K=new WeakMap,M=new WeakMap,v=await d.getResizeMode(),x=async o=>{await new Promise((n=>r(o,n)));const n=o.shadowRoot||o,e=n.querySelector("input")||n.querySelector("textarea"),d=t(o),c=d?null:o.closest("ion-footer");if(e){if(d&&b&&!K.has(o)){const n=((o,n,t)=>{if(!t||!n)return()=>{};const e=t=>{var i;(i=n)===i.getRootNode().activeElement&&l(o,n,t)},r=()=>l(o,n,!1),s=()=>e(!0),d=()=>e(!1);return i(t,"ionScrollStart",s),i(t,"ionScrollEnd",d),n.addEventListener("blur",r),()=>{a(t,"ionScrollStart",s),a(t,"ionScrollEnd",d),n.removeEventListener("blur",r)}})(o,e,d);K.set(o,n)}if("date"!==e.type&&"datetime-local"!==e.type&&(d||c)&&p&&!M.has(o)){const n=((o,n,t,i,a,e,r,d=!1)=>{const c=e&&(void 0===r||r.mode===s.None);let l=!1;const u=a=>{!1!==l?D(o,n,t,i,a.detail.keyboardHeight,c,d,!1):l=!0},w=()=>{l=!1,window.removeEventListener("ionKeyboardDidShow",u)},f=async()=>{n.hasAttribute(y)?n.removeAttribute(y):(D(o,n,t,i,a,c,d),window.addEventListener("ionKeyboardDidShow",u),o.addEventListener("focusout",w,!0))};return o.addEventListener("focusin",f,!0),()=>{o.removeEventListener("focusin",f,!0),window.removeEventListener("ionKeyboardDidShow",u),o.removeEventListener("focusout",w,!0)}})(o,e,d,c,w,h,v,u);M.set(o,n)}}};m&&(()=>{let o=!0,n=!1;const t=document;i(t,"ionScrollStart",(()=>{n=!0})),t.addEventListener("focusin",(()=>{o=!0}),!0),t.addEventListener("touchend",(i=>{if(n)return void(n=!1);const a=t.activeElement;if(!a)return;if(a.matches(f))return;const e=i.target;e!==a&&(e.matches(f)||e.closest(f)||(o=!1,setTimeout((()=>{o||a.blur()}),50)))}),!1)})();for(const o of S)x(o);e.addEventListener("ionInputDidLoad",(o=>{x(o.detail)})),e.addEventListener("ionInputDidUnload",(o=>{(o=>{if(b){const n=K.get(o);n&&n(),K.delete(o)}if(p){const n=M.get(o);n&&n(),M.delete(o)}})(o.detail)}))};export{K as startInputShims}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{s(r.next(e))}catch(e){o(e)}}function u(e){try{s(r["throw"](e))}catch(e){o(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,u)}s((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(e){return function(t){return s([e,t])}}function s(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(n=0)),n)try{if(r=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1];o=u;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(u);break}if(o[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/System.register(["./p-64475ab5.system.js","./p-815c2fba.system.js","./p-bba2ce59.system.js","./p-479cdbf8.system.js","./p-ccdcb022.system.js","./p-0e94957a.system.js"],(function(e){"use strict";var t,n,r,i,o,a,u,s,c;return{setters:[function(e){t=e.g;n=e.c;r=e.f},function(e){i=e.a;o=e.b;a=e.r;u=e.c},function(e){s=e.a;c=e.K},function(){},function(){},function(){}],execute:function(){var f=this;var l=new WeakMap;var d=function(e,t,n,r,i){if(r===void 0){r=0}if(i===void 0){i=false}if(l.has(e)===n){return}if(n){h(e,t,r,i)}else{w(e,t)}};var v=function(e){return e===e.getRootNode().activeElement};var h=function(e,t,n,r){if(r===void 0){r=false}var i=t.parentNode;var o=t.cloneNode(false);o.classList.add("cloned-input");o.tabIndex=-1;if(r){o.disabled=true}i.appendChild(o);l.set(e,o);var a=e.ownerDocument;var u=a.dir==="rtl"?9999:-9999;e.style.pointerEvents="none";t.style.transform="translate3d(".concat(u,"px,").concat(n,"px,0) scale(0)")};var w=function(e,t){var n=l.get(e);if(n){l.delete(e);n.remove()}e.style.pointerEvents="";t.style.transform=""};var m=50;var p=function(e,t,n){if(!n||!t){return function(){return}}var r=function(n){if(v(t)){d(e,t,n)}};var a=function(){return d(e,t,false)};var u=function(){return r(true)};var s=function(){return r(false)};i(n,"ionScrollStart",u);i(n,"ionScrollEnd",s);t.addEventListener("blur",a);return function(){o(n,"ionScrollStart",u);o(n,"ionScrollEnd",s);t.removeEventListener("blur",a)}};var b="input, textarea, [no-blur], [contenteditable]";var y=function(){var e=true;var t=false;var n=document;var r=function(){t=true};var a=function(){e=true};var u=function(r){if(t){t=false;return}var i=n.activeElement;if(!i){return}if(i.matches(b)){return}var o=r.target;if(o===i){return}if(o.matches(b)||o.closest(b)){return}e=false;setTimeout((function(){if(!e){i.blur()}}),50)};i(n,"ionScrollStart",r);n.addEventListener("focusin",a,true);n.addEventListener("touchend",u,false);return function(){o(n,"ionScrollStart",r,true);n.removeEventListener("focusin",a,true);n.removeEventListener("touchend",u,false)}};var g=.3;var E=function(e,t,n){var r;var i=(r=e.closest("ion-item,[ion-item]"))!==null&&r!==void 0?r:e;return S(i.getBoundingClientRect(),t.getBoundingClientRect(),n,e.ownerDocument.defaultView.innerHeight)};var S=function(e,t,n,r){var i=e.top;var o=e.bottom;var a=t.top;var u=Math.min(t.bottom,r-n);var s=a+15;var c=u-m;var f=c-o;var l=s-i;var d=Math.round(f<0?-f:l>0?-l:0);var v=Math.min(d,i-a);var h=Math.abs(v);var w=h/g;var p=Math.min(400,Math.max(150,w));return{scrollAmount:v,scrollDuration:p,scrollPadding:n,inputSafeY:-(i-s)+4}};var _="$ionPaddingTimer";var L=function(e,t,n){var r=e[_];if(r){clearTimeout(r)}if(t>0){e.style.setProperty("--keyboard-offset","".concat(t,"px"))}else{e[_]=setTimeout((function(){e.style.setProperty("--keyboard-offset","0px");if(n){n()}}),120)}};var x=function(e,t,n){var r=function(){if(t){L(t,0,n)}};e.addEventListener("focusout",r,{once:true})};var D=0;var k="data-ionic-skip-scroll-assist";var A=function(e,t,n,r,i,o,a,u){if(u===void 0){u=false}var c=o&&(a===undefined||a.mode===s.None);var l=false;var d=function(i){if(l===false){l=true;return}K(e,t,n,r,i.detail.keyboardHeight,c,u,false)};var v=function(){l=false;window.removeEventListener("ionKeyboardDidShow",d)};var h=function(){return __awaiter(f,void 0,void 0,(function(){return __generator(this,(function(o){if(t.hasAttribute(k)){t.removeAttribute(k);return[2]}K(e,t,n,r,i,c,u);window.addEventListener("ionKeyboardDidShow",d);e.addEventListener("focusout",v,true);return[2]}))}))};e.addEventListener("focusin",h,true);return function(){e.removeEventListener("focusin",h,true);window.removeEventListener("ionKeyboardDidShow",d);e.removeEventListener("focusout",v,true)}};var M=function(e){if(document.activeElement===e){return}e.setAttribute(k,"true");e.focus()};var K=function(e,r,i,o,u,s,c,l){if(c===void 0){c=false}if(l===void 0){l=true}return __awaiter(f,void 0,void 0,(function(){var f,v,h,w,p,b;var y=this;return __generator(this,(function(g){switch(g.label){case 0:if(!i&&!o){return[2]}f=E(e,i||o,u);if(i&&Math.abs(f.scrollAmount)<4){M(r);if(s&&i!==null){L(i,D);x(r,i,(function(){return D=0}))}return[2]}d(e,r,true,f.inputSafeY,c);M(r);a((function(){return e.click()}));if(s&&i){D=f.scrollPadding;L(i,D)}if(!(typeof window!=="undefined"))return[3,3];h=function(){return __awaiter(y,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(v!==undefined){clearTimeout(v)}window.removeEventListener("ionKeyboardDidShow",w);window.removeEventListener("ionKeyboardDidShow",h);if(!i)return[3,2];return[4,n(i,0,f.scrollAmount,f.scrollDuration)];case 1:t.sent();t.label=2;case 2:d(e,r,false,f.inputSafeY);M(r);if(s){x(r,i,(function(){return D=0}))}return[2]}}))}))};w=function(){window.removeEventListener("ionKeyboardDidShow",w);window.addEventListener("ionKeyboardDidShow",h)};if(!i)return[3,2];return[4,t(i)];case 1:p=g.sent();b=p.scrollHeight-p.clientHeight;if(l&&f.scrollAmount>b-p.scrollTop){if(r.type==="password"){f.scrollAmount+=m;window.addEventListener("ionKeyboardDidShow",w)}else{window.addEventListener("ionKeyboardDidShow",h)}v=setTimeout(h,1e3);return[2]}g.label=2;case 2:h();g.label=3;case 3:return[2]}}))}))};var P=true;var T=e("startInputShims",(function(e,t){return __awaiter(f,void 0,void 0,(function(){var n,i,o,a,s,f,l,d,v,h,w,m,b,g,E,S,_;var L=this;return __generator(this,(function(x){switch(x.label){case 0:n=document;i=t==="ios";o=t==="android";a=e.getNumber("keyboardHeight",290);s=e.getBoolean("scrollAssist",true);f=e.getBoolean("hideCaretOnScroll",i);l=e.getBoolean("inputBlurring",i);d=e.getBoolean("scrollPadding",true);v=Array.from(n.querySelectorAll("ion-input, ion-textarea"));h=new WeakMap;w=new WeakMap;return[4,c.getResizeMode()];case 1:m=x.sent();b=function(e){return __awaiter(L,void 0,void 0,(function(){var t,n,i,c,l,v,l;return __generator(this,(function(b){switch(b.label){case 0:return[4,new Promise((function(t){return u(e,t)}))];case 1:b.sent();t=e.shadowRoot||e;n=t.querySelector("input")||t.querySelector("textarea");i=r(e);c=!i?e.closest("ion-footer"):null;if(!n){return[2]}if(!!i&&f&&!h.has(e)){l=p(e,n,i);h.set(e,l)}v=n.type==="date"||n.type==="datetime-local";if(!v&&(!!i||!!c)&&s&&!w.has(e)){l=A(e,n,i,c,a,d,m,o);w.set(e,l)}return[2]}}))}))};g=function(e){if(f){var t=h.get(e);if(t){t()}h.delete(e)}if(s){var t=w.get(e);if(t){t()}w.delete(e)}};if(l&&P){y()}for(E=0,S=v;E<S.length;E++){_=S[E];b(_)}n.addEventListener("ionInputDidLoad",(function(e){b(e.detail)}));n.addEventListener("ionInputDidUnload",(function(e){g(e.detail)}));return[2]}}))}))}))}}}));
|