@ionic/core 8.0.1-dev.11713535425.1a4afba3 → 8.0.1-nightly.20240419
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 +5 -5
- package/components/ion-input.js +3 -12
- package/dist/cjs/{input-shims-9e59ef62.js → input-shims-20d639e6.js} +5 -5
- package/dist/cjs/ion-app_8.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +3 -12
- package/dist/collection/components/input/input.js +3 -12
- package/dist/collection/utils/input-shims/hacks/scroll-assist.js +5 -5
- package/dist/docs.json +1 -1
- package/dist/esm/{input-shims-0314bbe5.js → input-shims-4530285e.js} +5 -5
- package/dist/esm/ion-app_8.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +3 -12
- package/dist/esm-es5/input-shims-4530285e.js +4 -0
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-cc258008.entry.js → p-32dfbcdc.entry.js} +1 -1
- package/dist/ionic/{p-2690b1de.js → p-46111310.js} +1 -1
- package/dist/ionic/p-46f407f0.system.js +4 -0
- package/dist/ionic/p-76971b4f.entry.js +4 -0
- package/dist/ionic/p-c4e495a3.system.js +1 -1
- package/dist/ionic/{p-ead3aefc.system.entry.js → p-c4eafa12.system.entry.js} +1 -1
- package/dist/ionic/{p-4d2b2d23.system.entry.js → p-e832408b.system.entry.js} +1 -1
- package/hydrate/index.js +3 -12
- package/package.json +1 -1
- package/dist/esm-es5/input-shims-0314bbe5.js +0 -4
- package/dist/ionic/p-df8f26d1.entry.js +0 -4
- package/dist/ionic/p-dfb78785.system.js +0 -4
|
@@ -336,7 +336,7 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
336
336
|
const focusOut = () => {
|
|
337
337
|
hasKeyboardBeenPresentedForTextField = false;
|
|
338
338
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
339
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
339
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
340
340
|
};
|
|
341
341
|
/**
|
|
342
342
|
* When the input is about to receive
|
|
@@ -356,13 +356,13 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
356
356
|
}
|
|
357
357
|
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, addScrollPadding, disableClonedInput, platformHeight);
|
|
358
358
|
win === null || win === void 0 ? void 0 : win.addEventListener('ionKeyboardDidShow', keyboardShow);
|
|
359
|
-
componentEl.addEventListener('focusout', focusOut);
|
|
359
|
+
componentEl.addEventListener('focusout', focusOut, true);
|
|
360
360
|
};
|
|
361
|
-
componentEl.addEventListener('focusin', focusIn);
|
|
361
|
+
componentEl.addEventListener('focusin', focusIn, true);
|
|
362
362
|
return () => {
|
|
363
|
-
componentEl.removeEventListener('focusin', focusIn);
|
|
363
|
+
componentEl.removeEventListener('focusin', focusIn, true);
|
|
364
364
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
365
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
365
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
366
366
|
};
|
|
367
367
|
};
|
|
368
368
|
/**
|
package/components/ion-input.js
CHANGED
|
@@ -75,7 +75,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
75
75
|
ev.preventDefault();
|
|
76
76
|
ev.stopPropagation();
|
|
77
77
|
// Attempt to focus input again after pressing clear button
|
|
78
|
-
console.log('hi there');
|
|
79
78
|
this.setFocus();
|
|
80
79
|
}
|
|
81
80
|
this.value = '';
|
|
@@ -402,7 +401,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
402
401
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
403
402
|
*/
|
|
404
403
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
405
|
-
return (h(Host, { key: '
|
|
404
|
+
return (h(Host, { key: '51c797adf8a7a03e82e02d218addad81836e1e98', class: createColorClasses(this.color, {
|
|
406
405
|
[mode]: true,
|
|
407
406
|
'has-value': hasValue,
|
|
408
407
|
'has-focus': hasFocus,
|
|
@@ -413,22 +412,14 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
413
412
|
'in-item': inItem,
|
|
414
413
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
415
414
|
'input-disabled': disabled,
|
|
416
|
-
}) }, h("label", { key: '
|
|
415
|
+
}) }, h("label", { key: '6d00404de6673d9c650162a8fd23acc8981bff05', class: "input-wrapper", htmlFor: inputId }, this.renderLabelContainer(), h("div", { key: 'ebb124f7f8a0c885043be776242648681a79a47c', class: "native-wrapper" }, h("slot", { key: '9075ddd2b68afa3f1989d09ab5b88403eb20aa00', name: "start" }), h("input", Object.assign({ key: '8be4b3cd6b438742d62db98e00ee788a03673ca4', class: "native-input", ref: (input) => (this.nativeInput = input), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (h("button", { key: 'f06624d084ac036981e499b6145bee957311fc74', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
417
416
|
/**
|
|
418
417
|
* This prevents mobile browsers from
|
|
419
418
|
* blurring the input when the clear
|
|
420
419
|
* button is activated.
|
|
421
420
|
*/
|
|
422
421
|
ev.preventDefault();
|
|
423
|
-
},
|
|
424
|
-
/**
|
|
425
|
-
* Prevent the focusin event from bubbling otherwise it will cause the focusin
|
|
426
|
-
* event listener in scroll assist to fire. When this fires, focus will be moved
|
|
427
|
-
* back to the input even if the clear button was never tapped. This poses issues
|
|
428
|
-
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
429
|
-
*/
|
|
430
|
-
ev.stopPropagation();
|
|
431
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'c4c74c4387e8e81b4e00e0800ad7fd65d190a4ca', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '6cf9e37091750a70ae97faa0104822f92cd313f5', name: "end" })), shouldRenderHighlight && h("div", { key: 'd4d032e244ae917cbedddac633d83501a1a2cf5b', class: "input-highlight" })), this.renderBottomContent()));
|
|
422
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'aaa15a1ab70c008ee6b5e3c64abc1480e5732fc9', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '67abecd72bf5a764e79504b59d9934dbeb66cff9', name: "end" })), shouldRenderHighlight && h("div", { key: '048a7aa3cc8fef97a34f2b25de10730a1de30c0e', class: "input-highlight" })), this.renderBottomContent()));
|
|
432
423
|
}
|
|
433
424
|
get el() { return this; }
|
|
434
425
|
static get watchers() { return {
|
|
@@ -340,7 +340,7 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
340
340
|
const focusOut = () => {
|
|
341
341
|
hasKeyboardBeenPresentedForTextField = false;
|
|
342
342
|
index.win === null || index.win === void 0 ? void 0 : index.win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
343
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
343
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
344
344
|
};
|
|
345
345
|
/**
|
|
346
346
|
* When the input is about to receive
|
|
@@ -360,13 +360,13 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
360
360
|
}
|
|
361
361
|
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, addScrollPadding, disableClonedInput, platformHeight);
|
|
362
362
|
index.win === null || index.win === void 0 ? void 0 : index.win.addEventListener('ionKeyboardDidShow', keyboardShow);
|
|
363
|
-
componentEl.addEventListener('focusout', focusOut);
|
|
363
|
+
componentEl.addEventListener('focusout', focusOut, true);
|
|
364
364
|
};
|
|
365
|
-
componentEl.addEventListener('focusin', focusIn);
|
|
365
|
+
componentEl.addEventListener('focusin', focusIn, true);
|
|
366
366
|
return () => {
|
|
367
|
-
componentEl.removeEventListener('focusin', focusIn);
|
|
367
|
+
componentEl.removeEventListener('focusin', focusIn, true);
|
|
368
368
|
index.win === null || index.win === void 0 ? void 0 : index.win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
369
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
369
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
370
370
|
};
|
|
371
371
|
};
|
|
372
372
|
/**
|
|
@@ -45,7 +45,7 @@ const App = class {
|
|
|
45
45
|
* platforms proceed into this block.
|
|
46
46
|
*/
|
|
47
47
|
const platform = ionicGlobal.isPlatform(window, 'ios') ? 'ios' : 'android';
|
|
48
|
-
Promise.resolve().then(function () { return require('./input-shims-
|
|
48
|
+
Promise.resolve().then(function () { return require('./input-shims-20d639e6.js'); }).then((module) => module.startInputShims(ionicGlobal.config, platform));
|
|
49
49
|
}
|
|
50
50
|
const hardwareBackButtonModule = await Promise.resolve().then(function () { return require('./hardware-back-button-44e7c052.js'); });
|
|
51
51
|
const supportsHardwareBackButtonEvents = isHybrid || hardwareBackButton.shouldUseCloseWatcher();
|
|
@@ -79,7 +79,6 @@ const Input = class {
|
|
|
79
79
|
ev.preventDefault();
|
|
80
80
|
ev.stopPropagation();
|
|
81
81
|
// Attempt to focus input again after pressing clear button
|
|
82
|
-
console.log('hi there');
|
|
83
82
|
this.setFocus();
|
|
84
83
|
}
|
|
85
84
|
this.value = '';
|
|
@@ -406,7 +405,7 @@ const Input = class {
|
|
|
406
405
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
407
406
|
*/
|
|
408
407
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
409
|
-
return (index.h(index.Host, { key: '
|
|
408
|
+
return (index.h(index.Host, { key: '51c797adf8a7a03e82e02d218addad81836e1e98', class: theme.createColorClasses(this.color, {
|
|
410
409
|
[mode]: true,
|
|
411
410
|
'has-value': hasValue,
|
|
412
411
|
'has-focus': hasFocus,
|
|
@@ -417,22 +416,14 @@ const Input = class {
|
|
|
417
416
|
'in-item': inItem,
|
|
418
417
|
'in-item-color': theme.hostContext('ion-item.ion-color', this.el),
|
|
419
418
|
'input-disabled': disabled,
|
|
420
|
-
}) }, index.h("label", { key: '
|
|
419
|
+
}) }, index.h("label", { key: '6d00404de6673d9c650162a8fd23acc8981bff05', class: "input-wrapper", htmlFor: inputId }, this.renderLabelContainer(), index.h("div", { key: 'ebb124f7f8a0c885043be776242648681a79a47c', class: "native-wrapper" }, index.h("slot", { key: '9075ddd2b68afa3f1989d09ab5b88403eb20aa00', name: "start" }), index.h("input", Object.assign({ key: '8be4b3cd6b438742d62db98e00ee788a03673ca4', class: "native-input", ref: (input) => (this.nativeInput = input), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (index.h("button", { key: 'f06624d084ac036981e499b6145bee957311fc74', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
421
420
|
/**
|
|
422
421
|
* This prevents mobile browsers from
|
|
423
422
|
* blurring the input when the clear
|
|
424
423
|
* button is activated.
|
|
425
424
|
*/
|
|
426
425
|
ev.preventDefault();
|
|
427
|
-
},
|
|
428
|
-
/**
|
|
429
|
-
* Prevent the focusin event from bubbling otherwise it will cause the focusin
|
|
430
|
-
* event listener in scroll assist to fire. When this fires, focus will be moved
|
|
431
|
-
* back to the input even if the clear button was never tapped. This poses issues
|
|
432
|
-
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
433
|
-
*/
|
|
434
|
-
ev.stopPropagation();
|
|
435
|
-
}, onClick: this.clearTextInput }, index.h("ion-icon", { key: 'c4c74c4387e8e81b4e00e0800ad7fd65d190a4ca', "aria-hidden": "true", icon: mode === 'ios' ? index$1.closeCircle : index$1.closeSharp }))), index.h("slot", { key: '6cf9e37091750a70ae97faa0104822f92cd313f5', name: "end" })), shouldRenderHighlight && index.h("div", { key: 'd4d032e244ae917cbedddac633d83501a1a2cf5b', class: "input-highlight" })), this.renderBottomContent()));
|
|
426
|
+
}, onClick: this.clearTextInput }, index.h("ion-icon", { key: 'aaa15a1ab70c008ee6b5e3c64abc1480e5732fc9', "aria-hidden": "true", icon: mode === 'ios' ? index$1.closeCircle : index$1.closeSharp }))), index.h("slot", { key: '67abecd72bf5a764e79504b59d9934dbeb66cff9', name: "end" })), shouldRenderHighlight && index.h("div", { key: '048a7aa3cc8fef97a34f2b25de10730a1de30c0e', class: "input-highlight" })), this.renderBottomContent()));
|
|
436
427
|
}
|
|
437
428
|
get el() { return index.getElement(this); }
|
|
438
429
|
static get watchers() { return {
|
|
@@ -69,7 +69,6 @@ export class Input {
|
|
|
69
69
|
ev.preventDefault();
|
|
70
70
|
ev.stopPropagation();
|
|
71
71
|
// Attempt to focus input again after pressing clear button
|
|
72
|
-
console.log('hi there');
|
|
73
72
|
this.setFocus();
|
|
74
73
|
}
|
|
75
74
|
this.value = '';
|
|
@@ -396,7 +395,7 @@ export class Input {
|
|
|
396
395
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
397
396
|
*/
|
|
398
397
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
399
|
-
return (h(Host, { key: '
|
|
398
|
+
return (h(Host, { key: '51c797adf8a7a03e82e02d218addad81836e1e98', class: createColorClasses(this.color, {
|
|
400
399
|
[mode]: true,
|
|
401
400
|
'has-value': hasValue,
|
|
402
401
|
'has-focus': hasFocus,
|
|
@@ -407,22 +406,14 @@ export class Input {
|
|
|
407
406
|
'in-item': inItem,
|
|
408
407
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
409
408
|
'input-disabled': disabled,
|
|
410
|
-
}) }, h("label", { key: '
|
|
409
|
+
}) }, h("label", { key: '6d00404de6673d9c650162a8fd23acc8981bff05', class: "input-wrapper", htmlFor: inputId }, this.renderLabelContainer(), h("div", { key: 'ebb124f7f8a0c885043be776242648681a79a47c', class: "native-wrapper" }, h("slot", { key: '9075ddd2b68afa3f1989d09ab5b88403eb20aa00', name: "start" }), h("input", Object.assign({ key: '8be4b3cd6b438742d62db98e00ee788a03673ca4', class: "native-input", ref: (input) => (this.nativeInput = input), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (h("button", { key: 'f06624d084ac036981e499b6145bee957311fc74', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
411
410
|
/**
|
|
412
411
|
* This prevents mobile browsers from
|
|
413
412
|
* blurring the input when the clear
|
|
414
413
|
* button is activated.
|
|
415
414
|
*/
|
|
416
415
|
ev.preventDefault();
|
|
417
|
-
},
|
|
418
|
-
/**
|
|
419
|
-
* Prevent the focusin event from bubbling otherwise it will cause the focusin
|
|
420
|
-
* event listener in scroll assist to fire. When this fires, focus will be moved
|
|
421
|
-
* back to the input even if the clear button was never tapped. This poses issues
|
|
422
|
-
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
423
|
-
*/
|
|
424
|
-
ev.stopPropagation();
|
|
425
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'c4c74c4387e8e81b4e00e0800ad7fd65d190a4ca', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '6cf9e37091750a70ae97faa0104822f92cd313f5', name: "end" })), shouldRenderHighlight && h("div", { key: 'd4d032e244ae917cbedddac633d83501a1a2cf5b', class: "input-highlight" })), this.renderBottomContent()));
|
|
416
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'aaa15a1ab70c008ee6b5e3c64abc1480e5732fc9', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '67abecd72bf5a764e79504b59d9934dbeb66cff9', name: "end" })), shouldRenderHighlight && h("div", { key: '048a7aa3cc8fef97a34f2b25de10730a1de30c0e', class: "input-highlight" })), this.renderBottomContent()));
|
|
426
417
|
}
|
|
427
418
|
static get is() { return "ion-input"; }
|
|
428
419
|
static get encapsulation() { return "scoped"; }
|
|
@@ -96,7 +96,7 @@ export const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, ke
|
|
|
96
96
|
const focusOut = () => {
|
|
97
97
|
hasKeyboardBeenPresentedForTextField = false;
|
|
98
98
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
99
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
99
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
102
|
* When the input is about to receive
|
|
@@ -116,13 +116,13 @@ export const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, ke
|
|
|
116
116
|
}
|
|
117
117
|
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, addScrollPadding, disableClonedInput, platformHeight);
|
|
118
118
|
win === null || win === void 0 ? void 0 : win.addEventListener('ionKeyboardDidShow', keyboardShow);
|
|
119
|
-
componentEl.addEventListener('focusout', focusOut);
|
|
119
|
+
componentEl.addEventListener('focusout', focusOut, true);
|
|
120
120
|
};
|
|
121
|
-
componentEl.addEventListener('focusin', focusIn);
|
|
121
|
+
componentEl.addEventListener('focusin', focusIn, true);
|
|
122
122
|
return () => {
|
|
123
|
-
componentEl.removeEventListener('focusin', focusIn);
|
|
123
|
+
componentEl.removeEventListener('focusin', focusIn, true);
|
|
124
124
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
125
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
125
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
126
126
|
};
|
|
127
127
|
};
|
|
128
128
|
/**
|
package/dist/docs.json
CHANGED
|
@@ -338,7 +338,7 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
338
338
|
const focusOut = () => {
|
|
339
339
|
hasKeyboardBeenPresentedForTextField = false;
|
|
340
340
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
341
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
341
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
342
342
|
};
|
|
343
343
|
/**
|
|
344
344
|
* When the input is about to receive
|
|
@@ -358,13 +358,13 @@ const enableScrollAssist = (componentEl, inputEl, contentEl, footerEl, keyboardH
|
|
|
358
358
|
}
|
|
359
359
|
jsSetFocus(componentEl, inputEl, contentEl, footerEl, keyboardHeight, addScrollPadding, disableClonedInput, platformHeight);
|
|
360
360
|
win === null || win === void 0 ? void 0 : win.addEventListener('ionKeyboardDidShow', keyboardShow);
|
|
361
|
-
componentEl.addEventListener('focusout', focusOut);
|
|
361
|
+
componentEl.addEventListener('focusout', focusOut, true);
|
|
362
362
|
};
|
|
363
|
-
componentEl.addEventListener('focusin', focusIn);
|
|
363
|
+
componentEl.addEventListener('focusin', focusIn, true);
|
|
364
364
|
return () => {
|
|
365
|
-
componentEl.removeEventListener('focusin', focusIn);
|
|
365
|
+
componentEl.removeEventListener('focusin', focusIn, true);
|
|
366
366
|
win === null || win === void 0 ? void 0 : win.removeEventListener('ionKeyboardDidShow', keyboardShow);
|
|
367
|
-
componentEl.removeEventListener('focusout', focusOut);
|
|
367
|
+
componentEl.removeEventListener('focusout', focusOut, true);
|
|
368
368
|
};
|
|
369
369
|
};
|
|
370
370
|
/**
|
|
@@ -41,7 +41,7 @@ const App = class {
|
|
|
41
41
|
* platforms proceed into this block.
|
|
42
42
|
*/
|
|
43
43
|
const platform = isPlatform(window, 'ios') ? 'ios' : 'android';
|
|
44
|
-
import('./input-shims-
|
|
44
|
+
import('./input-shims-4530285e.js').then((module) => module.startInputShims(config, platform));
|
|
45
45
|
}
|
|
46
46
|
const hardwareBackButtonModule = await import('./hardware-back-button-ba8f64c2.js');
|
|
47
47
|
const supportsHardwareBackButtonEvents = isHybrid || shouldUseCloseWatcher();
|
|
@@ -75,7 +75,6 @@ const Input = class {
|
|
|
75
75
|
ev.preventDefault();
|
|
76
76
|
ev.stopPropagation();
|
|
77
77
|
// Attempt to focus input again after pressing clear button
|
|
78
|
-
console.log('hi there');
|
|
79
78
|
this.setFocus();
|
|
80
79
|
}
|
|
81
80
|
this.value = '';
|
|
@@ -402,7 +401,7 @@ const Input = class {
|
|
|
402
401
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
403
402
|
*/
|
|
404
403
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
405
|
-
return (h(Host, { key: '
|
|
404
|
+
return (h(Host, { key: '51c797adf8a7a03e82e02d218addad81836e1e98', class: createColorClasses(this.color, {
|
|
406
405
|
[mode]: true,
|
|
407
406
|
'has-value': hasValue,
|
|
408
407
|
'has-focus': hasFocus,
|
|
@@ -413,22 +412,14 @@ const Input = class {
|
|
|
413
412
|
'in-item': inItem,
|
|
414
413
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
415
414
|
'input-disabled': disabled,
|
|
416
|
-
}) }, h("label", { key: '
|
|
415
|
+
}) }, h("label", { key: '6d00404de6673d9c650162a8fd23acc8981bff05', class: "input-wrapper", htmlFor: inputId }, this.renderLabelContainer(), h("div", { key: 'ebb124f7f8a0c885043be776242648681a79a47c', class: "native-wrapper" }, h("slot", { key: '9075ddd2b68afa3f1989d09ab5b88403eb20aa00', name: "start" }), h("input", Object.assign({ key: '8be4b3cd6b438742d62db98e00ee788a03673ca4', class: "native-input", ref: (input) => (this.nativeInput = input), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.type, value: value, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (h("button", { key: 'f06624d084ac036981e499b6145bee957311fc74', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
417
416
|
/**
|
|
418
417
|
* This prevents mobile browsers from
|
|
419
418
|
* blurring the input when the clear
|
|
420
419
|
* button is activated.
|
|
421
420
|
*/
|
|
422
421
|
ev.preventDefault();
|
|
423
|
-
},
|
|
424
|
-
/**
|
|
425
|
-
* Prevent the focusin event from bubbling otherwise it will cause the focusin
|
|
426
|
-
* event listener in scroll assist to fire. When this fires, focus will be moved
|
|
427
|
-
* back to the input even if the clear button was never tapped. This poses issues
|
|
428
|
-
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
429
|
-
*/
|
|
430
|
-
ev.stopPropagation();
|
|
431
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'c4c74c4387e8e81b4e00e0800ad7fd65d190a4ca', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '6cf9e37091750a70ae97faa0104822f92cd313f5', name: "end" })), shouldRenderHighlight && h("div", { key: 'd4d032e244ae917cbedddac633d83501a1a2cf5b', class: "input-highlight" })), this.renderBottomContent()));
|
|
422
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'aaa15a1ab70c008ee6b5e3c64abc1480e5732fc9', "aria-hidden": "true", icon: mode === 'ios' ? closeCircle : closeSharp }))), h("slot", { key: '67abecd72bf5a764e79504b59d9934dbeb66cff9', name: "end" })), shouldRenderHighlight && h("div", { key: '048a7aa3cc8fef97a34f2b25de10730a1de30c0e', class: "input-highlight" })), this.renderBottomContent()));
|
|
432
423
|
}
|
|
433
424
|
get el() { return getElement(this); }
|
|
434
425
|
static get watchers() { return {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{__awaiter,__generator,__spreadArray}from"tslib";
|
|
2
|
+
/*!
|
|
3
|
+
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
+
*/import{w as win,d as doc}from"./index-a5d50daf.js";import{g as getScrollElement,c as scrollByPoint,f as findClosestIonContent}from"./index-5cc724f3.js";import{a as addEventListener,b as removeEventListener,r as raf,c as componentOnReady}from"./helpers-da915de8.js";import{a as KeyboardResize,K as Keyboard}from"./keyboard-73175e24.js";import"./index-9b0d46f4.js";import"./capacitor-59395cbd.js";var cloneMap=new WeakMap;var relocateInput=function(r,n,e,t,i){if(t===void 0){t=0}if(i===void 0){i=false}if(cloneMap.has(r)===e){return}if(e){addClone(r,n,t,i)}else{removeClone(r,n)}};var isFocused=function(r){return r===r.getRootNode().activeElement};var addClone=function(r,n,e,t){if(t===void 0){t=false}var i=n.parentNode;var o=n.cloneNode(false);o.classList.add("cloned-input");o.tabIndex=-1;if(t){o.disabled=true}i.appendChild(o);cloneMap.set(r,o);var a=r.ownerDocument;var u=a.dir==="rtl"?9999:-9999;r.style.pointerEvents="none";n.style.transform="translate3d(".concat(u,"px,").concat(e,"px,0) scale(0)")};var removeClone=function(r,n){var e=cloneMap.get(r);if(e){cloneMap.delete(r);e.remove()}r.style.pointerEvents="";n.style.transform=""};var SCROLL_AMOUNT_PADDING=50;var enableHideCaretOnScroll=function(r,n,e){if(!e||!n){return function(){return}}var t=function(e){if(isFocused(n)){relocateInput(r,n,e)}};var i=function(){return relocateInput(r,n,false)};var o=function(){return t(true)};var a=function(){return t(false)};addEventListener(e,"ionScrollStart",o);addEventListener(e,"ionScrollEnd",a);n.addEventListener("blur",i);return function(){removeEventListener(e,"ionScrollStart",o);removeEventListener(e,"ionScrollEnd",a);n.removeEventListener("blur",i)}};var SKIP_SELECTOR="input, textarea, [no-blur], [contenteditable]";var enableInputBlurring=function(){var r=true;var n=false;var e=document;var t=function(){n=true};var i=function(){r=true};var o=function(t){if(n){n=false;return}var i=e.activeElement;if(!i){return}if(i.matches(SKIP_SELECTOR)){return}var o=t.target;if(o===i){return}if(o.matches(SKIP_SELECTOR)||o.closest(SKIP_SELECTOR)){return}r=false;setTimeout((function(){if(!r){i.blur()}}),50)};addEventListener(e,"ionScrollStart",t);e.addEventListener("focusin",i,true);e.addEventListener("touchend",o,false);return function(){removeEventListener(e,"ionScrollStart",t,true);e.removeEventListener("focusin",i,true);e.removeEventListener("touchend",o,false)}};var SCROLL_ASSIST_SPEED=.3;var getScrollData=function(r,n,e,t){var i;var o=(i=r.closest("ion-item,[ion-item]"))!==null&&i!==void 0?i:r;return calcScrollData(o.getBoundingClientRect(),n.getBoundingClientRect(),e,t)};var calcScrollData=function(r,n,e,t){var i=r.top;var o=r.bottom;var a=n.top;var u=Math.min(n.bottom,t-e);var c=a+15;var d=u-SCROLL_AMOUNT_PADDING;var f=d-o;var l=c-i;var s=Math.round(f<0?-f:l>0?-l:0);var v=Math.min(s,i-a);var S=Math.abs(v);var _=S/SCROLL_ASSIST_SPEED;var w=Math.min(400,Math.max(150,_));return{scrollAmount:v,scrollDuration:w,scrollPadding:e,inputSafeY:-(i-c)+4}};var PADDING_TIMER_KEY="$ionPaddingTimer";var setScrollPadding=function(r,n,e){var t=r[PADDING_TIMER_KEY];if(t){clearTimeout(t)}if(n>0){r.style.setProperty("--keyboard-offset","".concat(n,"px"))}else{r[PADDING_TIMER_KEY]=setTimeout((function(){r.style.setProperty("--keyboard-offset","0px");if(e){e()}}),120)}};var setClearScrollPaddingListener=function(r,n,e){var t=function(){if(n){setScrollPadding(n,0,e)}};r.addEventListener("focusout",t,{once:true})};var currentPadding=0;var SKIP_SCROLL_ASSIST="data-ionic-skip-scroll-assist";var enableScrollAssist=function(r,n,e,t,i,o,a,u){if(u===void 0){u=false}var c=o&&(a===undefined||a.mode===KeyboardResize.None);var d=false;var f=win!==undefined?win.innerHeight:0;var l=function(i){if(d===false){d=true;return}jsSetFocus(r,n,e,t,i.detail.keyboardHeight,c,u,f,false)};var s=function(){d=false;win===null||win===void 0?void 0:win.removeEventListener("ionKeyboardDidShow",l);r.removeEventListener("focusout",s,true)};var v=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){if(n.hasAttribute(SKIP_SCROLL_ASSIST)){n.removeAttribute(SKIP_SCROLL_ASSIST);return[2]}jsSetFocus(r,n,e,t,i,c,u,f);win===null||win===void 0?void 0:win.addEventListener("ionKeyboardDidShow",l);r.addEventListener("focusout",s,true);return[2]}))}))};r.addEventListener("focusin",v,true);return function(){r.removeEventListener("focusin",v,true);win===null||win===void 0?void 0:win.removeEventListener("ionKeyboardDidShow",l);r.removeEventListener("focusout",s,true)}};var setManualFocus=function(r){if(document.activeElement===r){return}r.setAttribute(SKIP_SCROLL_ASSIST,"true");r.focus()};var jsSetFocus=function(r,n,e,t,i,o){var a=[];for(var u=6;u<arguments.length;u++){a[u-6]=arguments[u]}return __awaiter(void 0,__spreadArray([r,n,e,t,i,o],a,true),void 0,(function(r,n,e,t,i,o,a,u,c){var d,f,l,s,v,S;if(a===void 0){a=false}if(u===void 0){u=0}if(c===void 0){c=true}return __generator(this,(function(_){switch(_.label){case 0:if(!e&&!t){return[2]}d=getScrollData(r,e||t,i,u);if(e&&Math.abs(d.scrollAmount)<4){setManualFocus(n);if(o&&e!==null){setScrollPadding(e,currentPadding);setClearScrollPaddingListener(n,e,(function(){return currentPadding=0}))}return[2]}relocateInput(r,n,true,d.inputSafeY,a);setManualFocus(n);raf((function(){return r.click()}));if(o&&e){currentPadding=d.scrollPadding;setScrollPadding(e,currentPadding)}if(!(typeof window!=="undefined"))return[3,3];l=function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(f!==undefined){clearTimeout(f)}window.removeEventListener("ionKeyboardDidShow",s);window.removeEventListener("ionKeyboardDidShow",l);if(!e)return[3,2];return[4,scrollByPoint(e,0,d.scrollAmount,d.scrollDuration)];case 1:t.sent();t.label=2;case 2:relocateInput(r,n,false,d.inputSafeY);setManualFocus(n);if(o){setClearScrollPaddingListener(n,e,(function(){return currentPadding=0}))}return[2]}}))}))};s=function(){window.removeEventListener("ionKeyboardDidShow",s);window.addEventListener("ionKeyboardDidShow",l)};if(!e)return[3,2];return[4,getScrollElement(e)];case 1:v=_.sent();S=v.scrollHeight-v.clientHeight;if(c&&d.scrollAmount>S-v.scrollTop){if(n.type==="password"){d.scrollAmount+=SCROLL_AMOUNT_PADDING;window.addEventListener("ionKeyboardDidShow",s)}else{window.addEventListener("ionKeyboardDidShow",l)}f=setTimeout(l,1e3);return[2]}_.label=2;case 2:l();_.label=3;case 3:return[2]}}))}))};var INPUT_BLURRING=true;var startInputShims=function(r,n){return __awaiter(void 0,void 0,void 0,(function(){var e,t,i,o,a,u,c,d,f,l,s,v,S,_,w,p;return __generator(this,(function(I){switch(I.label){case 0:if(doc===undefined){return[2]}e=n==="ios";t=n==="android";i=r.getNumber("keyboardHeight",290);o=r.getBoolean("scrollAssist",true);a=r.getBoolean("hideCaretOnScroll",e);u=r.getBoolean("inputBlurring",false);c=r.getBoolean("scrollPadding",true);d=Array.from(doc.querySelectorAll("ion-input, ion-textarea"));f=new WeakMap;l=new WeakMap;return[4,Keyboard.getResizeMode()];case 1:s=I.sent();v=function(r){return __awaiter(void 0,void 0,void 0,(function(){var n,e,u,d,v,S,v;return __generator(this,(function(_){switch(_.label){case 0:return[4,new Promise((function(n){return componentOnReady(r,n)}))];case 1:_.sent();n=r.shadowRoot||r;e=n.querySelector("input")||n.querySelector("textarea");u=findClosestIonContent(r);d=!u?r.closest("ion-footer"):null;if(!e){return[2]}if(!!u&&a&&!f.has(r)){v=enableHideCaretOnScroll(r,e,u);f.set(r,v)}S=e.type==="date"||e.type==="datetime-local";if(!S&&(!!u||!!d)&&o&&!l.has(r)){v=enableScrollAssist(r,e,u,d,i,c,s,t);l.set(r,v)}return[2]}}))}))};S=function(r){if(a){var n=f.get(r);if(n){n()}f.delete(r)}if(o){var n=l.get(r);if(n){n()}l.delete(r)}};if(u&&INPUT_BLURRING){enableInputBlurring()}for(_=0,w=d;_<w.length;_++){p=w[_];v(p)}doc.addEventListener("ionInputDidLoad",(function(r){v(r.detail)}));doc.addEventListener("ionInputDidUnload",(function(r){S(r.detail)}));return[2]}}))}))};export{startInputShims};
|