|
|
@@ -1,526 +0,0 @@
|
|
1
|
|
-"use strict";
|
|
2
|
|
-(self["webpackChunkapp"] = self["webpackChunkapp"] || []).push([["node_modules_ionic_core_dist_esm_input-shims-6ed8f5a5_js"],{
|
|
3
|
|
-
|
|
4
|
|
-/***/ 4508:
|
|
5
|
|
-/*!*******************************************************************!*\
|
|
6
|
|
- !*** ./node_modules/@ionic/core/dist/esm/input-shims-6ed8f5a5.js ***!
|
|
7
|
|
- \*******************************************************************/
|
|
8
|
|
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9
|
|
-
|
|
10
|
|
-__webpack_require__.r(__webpack_exports__);
|
|
11
|
|
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
|
-/* harmony export */ "startInputShims": () => (/* binding */ startInputShims)
|
|
13
|
|
-/* harmony export */ });
|
|
14
|
|
-/* harmony import */ var _Users_simplicoltd_projects_fm99_rev_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 1670);
|
|
15
|
|
-/* harmony import */ var _index_5d0c8232_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index-5d0c8232.js */ 3081);
|
|
16
|
|
-/* harmony import */ var _helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers-3b390e48.js */ 9234);
|
|
17
|
|
-/* harmony import */ var _index_c4b11676_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index-c4b11676.js */ 9273);
|
|
18
|
|
-
|
|
19
|
|
-
|
|
20
|
|
-/*!
|
|
21
|
|
- * (C) Ionic http://ionicframework.com - MIT License
|
|
22
|
|
- */
|
|
23
|
|
-
|
|
24
|
|
-
|
|
25
|
|
-
|
|
26
|
|
-const cloneMap = new WeakMap();
|
|
27
|
|
-
|
|
28
|
|
-const relocateInput = (componentEl, inputEl, shouldRelocate, inputRelativeY = 0) => {
|
|
29
|
|
- if (cloneMap.has(componentEl) === shouldRelocate) {
|
|
30
|
|
- return;
|
|
31
|
|
- }
|
|
32
|
|
-
|
|
33
|
|
- if (shouldRelocate) {
|
|
34
|
|
- addClone(componentEl, inputEl, inputRelativeY);
|
|
35
|
|
- } else {
|
|
36
|
|
- removeClone(componentEl, inputEl);
|
|
37
|
|
- }
|
|
38
|
|
-};
|
|
39
|
|
-
|
|
40
|
|
-const isFocused = input => {
|
|
41
|
|
- return input === input.getRootNode().activeElement;
|
|
42
|
|
-};
|
|
43
|
|
-
|
|
44
|
|
-const addClone = (componentEl, inputEl, inputRelativeY) => {
|
|
45
|
|
- // this allows for the actual input to receive the focus from
|
|
46
|
|
- // the user's touch event, but before it receives focus, it
|
|
47
|
|
- // moves the actual input to a location that will not screw
|
|
48
|
|
- // up the app's layout, and does not allow the native browser
|
|
49
|
|
- // to attempt to scroll the input into place (messing up headers/footers)
|
|
50
|
|
- // the cloned input fills the area of where native input should be
|
|
51
|
|
- // while the native input fakes out the browser by relocating itself
|
|
52
|
|
- // before it receives the actual focus event
|
|
53
|
|
- // We hide the focused input (with the visible caret) invisible by making it scale(0),
|
|
54
|
|
- const parentEl = inputEl.parentNode; // DOM WRITES
|
|
55
|
|
-
|
|
56
|
|
- const clonedEl = inputEl.cloneNode(false);
|
|
57
|
|
- clonedEl.classList.add('cloned-input');
|
|
58
|
|
- clonedEl.tabIndex = -1;
|
|
59
|
|
- parentEl.appendChild(clonedEl);
|
|
60
|
|
- cloneMap.set(componentEl, clonedEl);
|
|
61
|
|
- const doc = componentEl.ownerDocument;
|
|
62
|
|
- const tx = doc.dir === 'rtl' ? 9999 : -9999;
|
|
63
|
|
- componentEl.style.pointerEvents = 'none';
|
|
64
|
|
- inputEl.style.transform = `translate3d(${tx}px,${inputRelativeY}px,0) scale(0)`;
|
|
65
|
|
-};
|
|
66
|
|
-
|
|
67
|
|
-const removeClone = (componentEl, inputEl) => {
|
|
68
|
|
- const clone = cloneMap.get(componentEl);
|
|
69
|
|
-
|
|
70
|
|
- if (clone) {
|
|
71
|
|
- cloneMap.delete(componentEl);
|
|
72
|
|
- clone.remove();
|
|
73
|
|
- }
|
|
74
|
|
-
|
|
75
|
|
- componentEl.style.pointerEvents = '';
|
|
76
|
|
- inputEl.style.transform = '';
|
|
77
|
|
-};
|
|
78
|
|
-
|
|
79
|
|
-const enableHideCaretOnScroll = (componentEl, inputEl, scrollEl) => {
|
|
80
|
|
- if (!scrollEl || !inputEl) {
|
|
81
|
|
- return () => {
|
|
82
|
|
- return;
|
|
83
|
|
- };
|
|
84
|
|
- }
|
|
85
|
|
-
|
|
86
|
|
- const scrollHideCaret = shouldHideCaret => {
|
|
87
|
|
- if (isFocused(inputEl)) {
|
|
88
|
|
- relocateInput(componentEl, inputEl, shouldHideCaret);
|
|
89
|
|
- }
|
|
90
|
|
- };
|
|
91
|
|
-
|
|
92
|
|
- const onBlur = () => relocateInput(componentEl, inputEl, false);
|
|
93
|
|
-
|
|
94
|
|
- const hideCaret = () => scrollHideCaret(true);
|
|
95
|
|
-
|
|
96
|
|
- const showCaret = () => scrollHideCaret(false);
|
|
97
|
|
-
|
|
98
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.a)(scrollEl, 'ionScrollStart', hideCaret);
|
|
99
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.a)(scrollEl, 'ionScrollEnd', showCaret);
|
|
100
|
|
- inputEl.addEventListener('blur', onBlur);
|
|
101
|
|
- return () => {
|
|
102
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.b)(scrollEl, 'ionScrollStart', hideCaret);
|
|
103
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.b)(scrollEl, 'ionScrollEnd', showCaret);
|
|
104
|
|
- inputEl.addEventListener('ionBlur', onBlur);
|
|
105
|
|
- };
|
|
106
|
|
-};
|
|
107
|
|
-
|
|
108
|
|
-const SKIP_SELECTOR = 'input, textarea, [no-blur], [contenteditable]';
|
|
109
|
|
-
|
|
110
|
|
-const enableInputBlurring = () => {
|
|
111
|
|
- let focused = true;
|
|
112
|
|
- let didScroll = false;
|
|
113
|
|
- const doc = document;
|
|
114
|
|
-
|
|
115
|
|
- const onScroll = () => {
|
|
116
|
|
- didScroll = true;
|
|
117
|
|
- };
|
|
118
|
|
-
|
|
119
|
|
- const onFocusin = () => {
|
|
120
|
|
- focused = true;
|
|
121
|
|
- };
|
|
122
|
|
-
|
|
123
|
|
- const onTouchend = ev => {
|
|
124
|
|
- // if app did scroll return early
|
|
125
|
|
- if (didScroll) {
|
|
126
|
|
- didScroll = false;
|
|
127
|
|
- return;
|
|
128
|
|
- }
|
|
129
|
|
-
|
|
130
|
|
- const active = doc.activeElement;
|
|
131
|
|
-
|
|
132
|
|
- if (!active) {
|
|
133
|
|
- return;
|
|
134
|
|
- } // only blur if the active element is a text-input or a textarea
|
|
135
|
|
-
|
|
136
|
|
-
|
|
137
|
|
- if (active.matches(SKIP_SELECTOR)) {
|
|
138
|
|
- return;
|
|
139
|
|
- } // if the selected target is the active element, do not blur
|
|
140
|
|
-
|
|
141
|
|
-
|
|
142
|
|
- const tapped = ev.target;
|
|
143
|
|
-
|
|
144
|
|
- if (tapped === active) {
|
|
145
|
|
- return;
|
|
146
|
|
- }
|
|
147
|
|
-
|
|
148
|
|
- if (tapped.matches(SKIP_SELECTOR) || tapped.closest(SKIP_SELECTOR)) {
|
|
149
|
|
- return;
|
|
150
|
|
- }
|
|
151
|
|
-
|
|
152
|
|
- focused = false; // TODO: find a better way, why 50ms?
|
|
153
|
|
-
|
|
154
|
|
- setTimeout(() => {
|
|
155
|
|
- if (!focused) {
|
|
156
|
|
- active.blur();
|
|
157
|
|
- }
|
|
158
|
|
- }, 50);
|
|
159
|
|
- };
|
|
160
|
|
-
|
|
161
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.a)(doc, 'ionScrollStart', onScroll);
|
|
162
|
|
- doc.addEventListener('focusin', onFocusin, true);
|
|
163
|
|
- doc.addEventListener('touchend', onTouchend, false);
|
|
164
|
|
- return () => {
|
|
165
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.b)(doc, 'ionScrollStart', onScroll, true);
|
|
166
|
|
- doc.removeEventListener('focusin', onFocusin, true);
|
|
167
|
|
- doc.removeEventListener('touchend', onTouchend, false);
|
|
168
|
|
- };
|
|
169
|
|
-};
|
|
170
|
|
-
|
|
171
|
|
-const SCROLL_ASSIST_SPEED = 0.3;
|
|
172
|
|
-
|
|
173
|
|
-const getScrollData = (componentEl, contentEl, keyboardHeight) => {
|
|
174
|
|
- var _a;
|
|
175
|
|
-
|
|
176
|
|
- const itemEl = (_a = componentEl.closest('ion-item,[ion-item]')) !== null && _a !== void 0 ? _a : componentEl;
|
|
177
|
|
- return calcScrollData(itemEl.getBoundingClientRect(), contentEl.getBoundingClientRect(), keyboardHeight, componentEl.ownerDocument.defaultView.innerHeight);
|
|
178
|
|
-};
|
|
179
|
|
-
|
|
180
|
|
-const calcScrollData = (inputRect, contentRect, keyboardHeight, platformHeight) => {
|
|
181
|
|
- // compute input's Y values relative to the body
|
|
182
|
|
- const inputTop = inputRect.top;
|
|
183
|
|
- const inputBottom = inputRect.bottom; // compute visible area
|
|
184
|
|
-
|
|
185
|
|
- const visibleAreaTop = contentRect.top;
|
|
186
|
|
- const visibleAreaBottom = Math.min(contentRect.bottom, platformHeight - keyboardHeight); // compute safe area
|
|
187
|
|
-
|
|
188
|
|
- const safeAreaTop = visibleAreaTop + 15;
|
|
189
|
|
- const safeAreaBottom = visibleAreaBottom * 0.75; // figure out if each edge of the input is within the safe area
|
|
190
|
|
-
|
|
191
|
|
- const distanceToBottom = safeAreaBottom - inputBottom;
|
|
192
|
|
- const distanceToTop = safeAreaTop - inputTop; // desiredScrollAmount is the negated distance to the safe area according to our calculations.
|
|
193
|
|
-
|
|
194
|
|
- const desiredScrollAmount = Math.round(distanceToBottom < 0 ? -distanceToBottom : distanceToTop > 0 ? -distanceToTop : 0); // our calculations make some assumptions that aren't always true, like the keyboard being closed when an input
|
|
195
|
|
- // gets focus, so make sure we don't scroll the input above the visible area
|
|
196
|
|
-
|
|
197
|
|
- const scrollAmount = Math.min(desiredScrollAmount, inputTop - visibleAreaTop);
|
|
198
|
|
- const distance = Math.abs(scrollAmount);
|
|
199
|
|
- const duration = distance / SCROLL_ASSIST_SPEED;
|
|
200
|
|
- const scrollDuration = Math.min(400, Math.max(150, duration));
|
|
201
|
|
- return {
|
|
202
|
|
- scrollAmount,
|
|
203
|
|
- scrollDuration,
|
|
204
|
|
- scrollPadding: keyboardHeight,
|
|
205
|
|
- inputSafeY: -(inputTop - safeAreaTop) + 4
|
|
206
|
|
- };
|
|
207
|
|
-};
|
|
208
|
|
-
|
|
209
|
|
-const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardHeight) => {
|
|
210
|
|
- let coord;
|
|
211
|
|
-
|
|
212
|
|
- const touchStart = ev => {
|
|
213
|
|
- coord = (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.p)(ev);
|
|
214
|
|
- };
|
|
215
|
|
-
|
|
216
|
|
- const touchEnd = ev => {
|
|
217
|
|
- // input cover touchend/mouseup
|
|
218
|
|
- if (!coord) {
|
|
219
|
|
- return;
|
|
220
|
|
- } // get where the touchend/mouseup ended
|
|
221
|
|
-
|
|
222
|
|
-
|
|
223
|
|
- const endCoord = (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.p)(ev); // focus this input if the pointer hasn't moved XX pixels
|
|
224
|
|
- // and the input doesn't already have focus
|
|
225
|
|
-
|
|
226
|
|
- if (!hasPointerMoved(6, coord, endCoord) && !isFocused(inputEl)) {
|
|
227
|
|
- // begin the input focus process
|
|
228
|
|
- jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight);
|
|
229
|
|
- }
|
|
230
|
|
- };
|
|
231
|
|
-
|
|
232
|
|
- componentEl.addEventListener('touchstart', touchStart, {
|
|
233
|
|
- capture: true,
|
|
234
|
|
- passive: true
|
|
235
|
|
- });
|
|
236
|
|
- componentEl.addEventListener('touchend', touchEnd, true);
|
|
237
|
|
- return () => {
|
|
238
|
|
- componentEl.removeEventListener('touchstart', touchStart, true);
|
|
239
|
|
- componentEl.removeEventListener('touchend', touchEnd, true);
|
|
240
|
|
- };
|
|
241
|
|
-};
|
|
242
|
|
-
|
|
243
|
|
-const jsSetFocus = /*#__PURE__*/function () {
|
|
244
|
|
- var _ref = (0,_Users_simplicoltd_projects_fm99_rev_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (componentEl, inputEl, contentEl, footerEl, keyboardHeight) {
|
|
245
|
|
- if (!contentEl && !footerEl) {
|
|
246
|
|
- return;
|
|
247
|
|
- }
|
|
248
|
|
-
|
|
249
|
|
- const scrollData = getScrollData(componentEl, contentEl || footerEl, keyboardHeight);
|
|
250
|
|
-
|
|
251
|
|
- if (contentEl && Math.abs(scrollData.scrollAmount) < 4) {
|
|
252
|
|
- // the text input is in a safe position that doesn't
|
|
253
|
|
- // require it to be scrolled into view, just set focus now
|
|
254
|
|
- inputEl.focus();
|
|
255
|
|
- return;
|
|
256
|
|
- } // temporarily move the focus to the focus holder so the browser
|
|
257
|
|
- // doesn't freak out while it's trying to get the input in place
|
|
258
|
|
- // at this point the native text input still does not have focus
|
|
259
|
|
-
|
|
260
|
|
-
|
|
261
|
|
- relocateInput(componentEl, inputEl, true, scrollData.inputSafeY);
|
|
262
|
|
- inputEl.focus();
|
|
263
|
|
- /**
|
|
264
|
|
- * Relocating/Focusing input causes the
|
|
265
|
|
- * click event to be cancelled, so
|
|
266
|
|
- * manually fire one here.
|
|
267
|
|
- */
|
|
268
|
|
-
|
|
269
|
|
- (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.r)(() => componentEl.click());
|
|
270
|
|
-
|
|
271
|
|
- if (typeof window !== 'undefined') {
|
|
272
|
|
- let scrollContentTimeout;
|
|
273
|
|
-
|
|
274
|
|
- const scrollContent = /*#__PURE__*/function () {
|
|
275
|
|
- var _ref2 = (0,_Users_simplicoltd_projects_fm99_rev_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
|
|
276
|
|
- // clean up listeners and timeouts
|
|
277
|
|
- if (scrollContentTimeout !== undefined) {
|
|
278
|
|
- clearTimeout(scrollContentTimeout);
|
|
279
|
|
- }
|
|
280
|
|
-
|
|
281
|
|
- window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);
|
|
282
|
|
- window.removeEventListener('ionKeyboardDidShow', scrollContent); // scroll the input into place
|
|
283
|
|
-
|
|
284
|
|
- if (contentEl) {
|
|
285
|
|
- yield (0,_index_5d0c8232_js__WEBPACK_IMPORTED_MODULE_1__.c)(contentEl, 0, scrollData.scrollAmount, scrollData.scrollDuration);
|
|
286
|
|
- } // the scroll view is in the correct position now
|
|
287
|
|
- // give the native text input focus
|
|
288
|
|
-
|
|
289
|
|
-
|
|
290
|
|
- relocateInput(componentEl, inputEl, false, scrollData.inputSafeY); // ensure this is the focused input
|
|
291
|
|
-
|
|
292
|
|
- inputEl.focus();
|
|
293
|
|
- });
|
|
294
|
|
-
|
|
295
|
|
- return function scrollContent() {
|
|
296
|
|
- return _ref2.apply(this, arguments);
|
|
297
|
|
- };
|
|
298
|
|
- }();
|
|
299
|
|
-
|
|
300
|
|
- const doubleKeyboardEventListener = () => {
|
|
301
|
|
- window.removeEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);
|
|
302
|
|
- window.addEventListener('ionKeyboardDidShow', scrollContent);
|
|
303
|
|
- };
|
|
304
|
|
-
|
|
305
|
|
- if (contentEl) {
|
|
306
|
|
- const scrollEl = yield (0,_index_5d0c8232_js__WEBPACK_IMPORTED_MODULE_1__.g)(contentEl);
|
|
307
|
|
- /**
|
|
308
|
|
- * scrollData will only consider the amount we need
|
|
309
|
|
- * to scroll in order to properly bring the input
|
|
310
|
|
- * into view. It will not consider the amount
|
|
311
|
|
- * we can scroll in the content element.
|
|
312
|
|
- * As a result, scrollData may request a greater
|
|
313
|
|
- * scroll position than is currently available
|
|
314
|
|
- * in the DOM. If this is the case, we need to
|
|
315
|
|
- * wait for the webview to resize/the keyboard
|
|
316
|
|
- * to show in order for additional scroll
|
|
317
|
|
- * bandwidth to become available.
|
|
318
|
|
- */
|
|
319
|
|
-
|
|
320
|
|
- const totalScrollAmount = scrollEl.scrollHeight - scrollEl.clientHeight;
|
|
321
|
|
-
|
|
322
|
|
- if (scrollData.scrollAmount > totalScrollAmount - scrollEl.scrollTop) {
|
|
323
|
|
- /**
|
|
324
|
|
- * On iOS devices, the system will show a "Passwords" bar above the keyboard
|
|
325
|
|
- * after the initial keyboard is shown. This prevents the webview from resizing
|
|
326
|
|
- * until the "Passwords" bar is shown, so we need to wait for that to happen first.
|
|
327
|
|
- */
|
|
328
|
|
- if (inputEl.type === 'password') {
|
|
329
|
|
- // Add 50px to account for the "Passwords" bar
|
|
330
|
|
- scrollData.scrollAmount += 50;
|
|
331
|
|
- window.addEventListener('ionKeyboardDidShow', doubleKeyboardEventListener);
|
|
332
|
|
- } else {
|
|
333
|
|
- window.addEventListener('ionKeyboardDidShow', scrollContent);
|
|
334
|
|
- }
|
|
335
|
|
- /**
|
|
336
|
|
- * This should only fire in 2 instances:
|
|
337
|
|
- * 1. The app is very slow.
|
|
338
|
|
- * 2. The app is running in a browser on an old OS
|
|
339
|
|
- * that does not support Ionic Keyboard Events
|
|
340
|
|
- */
|
|
341
|
|
-
|
|
342
|
|
-
|
|
343
|
|
- scrollContentTimeout = setTimeout(scrollContent, 1000);
|
|
344
|
|
- return;
|
|
345
|
|
- }
|
|
346
|
|
- }
|
|
347
|
|
-
|
|
348
|
|
- scrollContent();
|
|
349
|
|
- }
|
|
350
|
|
- });
|
|
351
|
|
-
|
|
352
|
|
- return function jsSetFocus(_x, _x2, _x3, _x4, _x5) {
|
|
353
|
|
- return _ref.apply(this, arguments);
|
|
354
|
|
- };
|
|
355
|
|
-}();
|
|
356
|
|
-
|
|
357
|
|
-const hasPointerMoved = (threshold, startCoord, endCoord) => {
|
|
358
|
|
- if (startCoord && endCoord) {
|
|
359
|
|
- const deltaX = startCoord.x - endCoord.x;
|
|
360
|
|
- const deltaY = startCoord.y - endCoord.y;
|
|
361
|
|
- const distance = deltaX * deltaX + deltaY * deltaY;
|
|
362
|
|
- return distance > threshold * threshold;
|
|
363
|
|
- }
|
|
364
|
|
-
|
|
365
|
|
- return false;
|
|
366
|
|
-};
|
|
367
|
|
-
|
|
368
|
|
-const PADDING_TIMER_KEY = '$ionPaddingTimer';
|
|
369
|
|
-
|
|
370
|
|
-const enableScrollPadding = keyboardHeight => {
|
|
371
|
|
- const doc = document;
|
|
372
|
|
-
|
|
373
|
|
- const onFocusin = ev => {
|
|
374
|
|
- setScrollPadding(ev.target, keyboardHeight);
|
|
375
|
|
- };
|
|
376
|
|
-
|
|
377
|
|
- const onFocusout = ev => {
|
|
378
|
|
- setScrollPadding(ev.target, 0);
|
|
379
|
|
- };
|
|
380
|
|
-
|
|
381
|
|
- doc.addEventListener('focusin', onFocusin);
|
|
382
|
|
- doc.addEventListener('focusout', onFocusout);
|
|
383
|
|
- return () => {
|
|
384
|
|
- doc.removeEventListener('focusin', onFocusin);
|
|
385
|
|
- doc.removeEventListener('focusout', onFocusout);
|
|
386
|
|
- };
|
|
387
|
|
-};
|
|
388
|
|
-
|
|
389
|
|
-const setScrollPadding = (input, keyboardHeight) => {
|
|
390
|
|
- var _a, _b;
|
|
391
|
|
-
|
|
392
|
|
- if (input.tagName !== 'INPUT') {
|
|
393
|
|
- return;
|
|
394
|
|
- }
|
|
395
|
|
-
|
|
396
|
|
- if (input.parentElement && input.parentElement.tagName === 'ION-INPUT') {
|
|
397
|
|
- return;
|
|
398
|
|
- }
|
|
399
|
|
-
|
|
400
|
|
- if (((_b = (_a = input.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.tagName) === 'ION-SEARCHBAR') {
|
|
401
|
|
- return;
|
|
402
|
|
- }
|
|
403
|
|
-
|
|
404
|
|
- const el = (0,_index_5d0c8232_js__WEBPACK_IMPORTED_MODULE_1__.f)(input);
|
|
405
|
|
-
|
|
406
|
|
- if (el === null) {
|
|
407
|
|
- return;
|
|
408
|
|
- }
|
|
409
|
|
-
|
|
410
|
|
- const timer = el[PADDING_TIMER_KEY];
|
|
411
|
|
-
|
|
412
|
|
- if (timer) {
|
|
413
|
|
- clearTimeout(timer);
|
|
414
|
|
- }
|
|
415
|
|
-
|
|
416
|
|
- if (keyboardHeight > 0) {
|
|
417
|
|
- el.style.setProperty('--keyboard-offset', `${keyboardHeight}px`);
|
|
418
|
|
- } else {
|
|
419
|
|
- el[PADDING_TIMER_KEY] = setTimeout(() => {
|
|
420
|
|
- el.style.setProperty('--keyboard-offset', '0px');
|
|
421
|
|
- }, 120);
|
|
422
|
|
- }
|
|
423
|
|
-};
|
|
424
|
|
-
|
|
425
|
|
-const INPUT_BLURRING = true;
|
|
426
|
|
-const SCROLL_PADDING = true;
|
|
427
|
|
-
|
|
428
|
|
-const startInputShims = config => {
|
|
429
|
|
- const doc = document;
|
|
430
|
|
- const keyboardHeight = config.getNumber('keyboardHeight', 290);
|
|
431
|
|
- const scrollAssist = config.getBoolean('scrollAssist', true);
|
|
432
|
|
- const hideCaret = config.getBoolean('hideCaretOnScroll', true);
|
|
433
|
|
- const inputBlurring = config.getBoolean('inputBlurring', true);
|
|
434
|
|
- const scrollPadding = config.getBoolean('scrollPadding', true);
|
|
435
|
|
- const inputs = Array.from(doc.querySelectorAll('ion-input, ion-textarea'));
|
|
436
|
|
- const hideCaretMap = new WeakMap();
|
|
437
|
|
- const scrollAssistMap = new WeakMap();
|
|
438
|
|
-
|
|
439
|
|
- const registerInput = /*#__PURE__*/function () {
|
|
440
|
|
- var _ref3 = (0,_Users_simplicoltd_projects_fm99_rev_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (componentEl) {
|
|
441
|
|
- yield new Promise(resolve => (0,_helpers_3b390e48_js__WEBPACK_IMPORTED_MODULE_2__.c)(componentEl, resolve));
|
|
442
|
|
- const inputRoot = componentEl.shadowRoot || componentEl;
|
|
443
|
|
- const inputEl = inputRoot.querySelector('input') || inputRoot.querySelector('textarea');
|
|
444
|
|
- const scrollEl = (0,_index_5d0c8232_js__WEBPACK_IMPORTED_MODULE_1__.f)(componentEl);
|
|
445
|
|
- const footerEl = !scrollEl ? componentEl.closest('ion-footer') : null;
|
|
446
|
|
-
|
|
447
|
|
- if (!inputEl) {
|
|
448
|
|
- return;
|
|
449
|
|
- }
|
|
450
|
|
-
|
|
451
|
|
- if (!!scrollEl && hideCaret && !hideCaretMap.has(componentEl)) {
|
|
452
|
|
- const rmFn = enableHideCaretOnScroll(componentEl, inputEl, scrollEl);
|
|
453
|
|
- hideCaretMap.set(componentEl, rmFn);
|
|
454
|
|
- }
|
|
455
|
|
- /**
|
|
456
|
|
- * date/datetime-locale inputs on mobile devices show date picker
|
|
457
|
|
- * overlays instead of keyboards. As a result, scroll assist is
|
|
458
|
|
- * not needed. This also works around a bug in iOS <16 where
|
|
459
|
|
- * scroll assist causes the browser to lock up. See FW-1997.
|
|
460
|
|
- */
|
|
461
|
|
-
|
|
462
|
|
-
|
|
463
|
|
- const isDateInput = inputEl.type === 'date' || inputEl.type === 'datetime-local';
|
|
464
|
|
-
|
|
465
|
|
- if (!isDateInput && (!!scrollEl || !!footerEl) && scrollAssist && !scrollAssistMap.has(componentEl)) {
|
|
466
|
|
- const rmFn = enableScrollAssist(componentEl, inputEl, scrollEl, footerEl, keyboardHeight);
|
|
467
|
|
- scrollAssistMap.set(componentEl, rmFn);
|
|
468
|
|
- }
|
|
469
|
|
- });
|
|
470
|
|
-
|
|
471
|
|
- return function registerInput(_x6) {
|
|
472
|
|
- return _ref3.apply(this, arguments);
|
|
473
|
|
- };
|
|
474
|
|
- }();
|
|
475
|
|
-
|
|
476
|
|
- const unregisterInput = componentEl => {
|
|
477
|
|
- if (hideCaret) {
|
|
478
|
|
- const fn = hideCaretMap.get(componentEl);
|
|
479
|
|
-
|
|
480
|
|
- if (fn) {
|
|
481
|
|
- fn();
|
|
482
|
|
- }
|
|
483
|
|
-
|
|
484
|
|
- hideCaretMap.delete(componentEl);
|
|
485
|
|
- }
|
|
486
|
|
-
|
|
487
|
|
- if (scrollAssist) {
|
|
488
|
|
- const fn = scrollAssistMap.get(componentEl);
|
|
489
|
|
-
|
|
490
|
|
- if (fn) {
|
|
491
|
|
- fn();
|
|
492
|
|
- }
|
|
493
|
|
-
|
|
494
|
|
- scrollAssistMap.delete(componentEl);
|
|
495
|
|
- }
|
|
496
|
|
- };
|
|
497
|
|
-
|
|
498
|
|
- if (inputBlurring && INPUT_BLURRING) {
|
|
499
|
|
- enableInputBlurring();
|
|
500
|
|
- }
|
|
501
|
|
-
|
|
502
|
|
- if (scrollPadding && SCROLL_PADDING) {
|
|
503
|
|
- enableScrollPadding(keyboardHeight);
|
|
504
|
|
- } // Input might be already loaded in the DOM before ion-device-hacks did.
|
|
505
|
|
- // At this point we need to look for all of the inputs not registered yet
|
|
506
|
|
- // and register them.
|
|
507
|
|
-
|
|
508
|
|
-
|
|
509
|
|
- for (const input of inputs) {
|
|
510
|
|
- registerInput(input);
|
|
511
|
|
- }
|
|
512
|
|
-
|
|
513
|
|
- doc.addEventListener('ionInputDidLoad', ev => {
|
|
514
|
|
- registerInput(ev.detail);
|
|
515
|
|
- });
|
|
516
|
|
- doc.addEventListener('ionInputDidUnload', ev => {
|
|
517
|
|
- unregisterInput(ev.detail);
|
|
518
|
|
- });
|
|
519
|
|
-};
|
|
520
|
|
-
|
|
521
|
|
-
|
|
522
|
|
-
|
|
523
|
|
-/***/ })
|
|
524
|
|
-
|
|
525
|
|
-}]);
|
|
526
|
|
-//# sourceMappingURL=node_modules_ionic_core_dist_esm_input-shims-6ed8f5a5_js.js.map
|