voyager-ionic-core 8.5.6 → 8.5.7
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/checkbox.js +10 -3
- package/components/ion-input.js +14 -3
- package/components/ion-select.js +13 -2
- package/components/ion-textarea.js +13 -2
- package/components/ion-toggle.js +10 -3
- package/dist/cjs/ion-checkbox.cjs.entry.js +10 -3
- package/dist/cjs/ion-input.cjs.entry.js +14 -3
- package/dist/cjs/ion-select_3.cjs.entry.js +13 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +13 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +10 -3
- package/dist/collection/components/checkbox/checkbox.js +10 -3
- package/dist/collection/components/input/input.js +14 -3
- package/dist/collection/components/select/select.js +13 -2
- package/dist/collection/components/textarea/textarea.js +13 -2
- package/dist/collection/components/toggle/toggle.js +10 -3
- package/dist/docs.json +1 -1
- package/dist/esm/ion-checkbox.entry.js +10 -3
- package/dist/esm/ion-input.entry.js +14 -3
- package/dist/esm/ion-select_3.entry.js +13 -2
- package/dist/esm/ion-textarea.entry.js +13 -2
- package/dist/esm/ion-toggle.entry.js +10 -3
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-11dca959.entry.js +4 -0
- package/dist/ionic/p-57d6e18e.entry.js +4 -0
- package/dist/ionic/{p-7c12add8.system.entry.js → p-5fac20aa.system.entry.js} +2 -2
- package/dist/ionic/{p-4ec0e961.system.entry.js → p-965287fb.system.entry.js} +1 -1
- package/dist/ionic/{p-c6879aa4.system.entry.js → p-9df5043e.system.entry.js} +2 -2
- package/dist/ionic/{p-4dde69d1.system.entry.js → p-a7a97bf4.system.entry.js} +1 -1
- package/dist/ionic/p-aad57e35.entry.js +4 -0
- package/dist/ionic/{p-d2c3524b.system.entry.js → p-b904cfe2.system.entry.js} +1 -1
- package/dist/ionic/p-d1eb2d7f.entry.js +4 -0
- package/dist/ionic/p-e1678e42.entry.js +4 -0
- package/dist/ionic/p-f725bf9e.system.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/input/input.d.ts +5 -0
- package/dist/types/components/select/select.d.ts +5 -0
- package/dist/types/components/textarea/textarea.d.ts +5 -0
- package/dist/types/components/toggle/toggle.d.ts +5 -0
- package/hydrate/index.js +60 -13
- package/hydrate/index.mjs +60 -13
- package/package.json +1 -1
- package/dist/ionic/p-1f871cf8.entry.js +0 -4
- package/dist/ionic/p-5798670a.entry.js +0 -4
- package/dist/ionic/p-a78fa846.entry.js +0 -4
- package/dist/ionic/p-b383d331.entry.js +0 -4
- package/dist/ionic/p-da6247e5.entry.js +0 -4
package/components/checkbox.js
CHANGED
|
@@ -64,6 +64,13 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
64
64
|
}
|
|
65
65
|
this.toggleChecked(ev);
|
|
66
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* Stops propagation when the display label is clicked,
|
|
69
|
+
* otherwise, two clicks will be triggered.
|
|
70
|
+
*/
|
|
71
|
+
this.onDivLabelClick = (ev) => {
|
|
72
|
+
ev.stopPropagation();
|
|
73
|
+
};
|
|
67
74
|
this.color = undefined;
|
|
68
75
|
this.name = this.inputId;
|
|
69
76
|
this.checked = false;
|
|
@@ -120,7 +127,7 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
120
127
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
121
128
|
// The host element must have a checkbox role to ensure proper VoiceOver
|
|
122
129
|
// support in Safari for accessibility.
|
|
123
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: '26cbe7220e555107200e9b5deeae754aa534a80b', role: "checkbox", "aria-checked": indeterminate ? 'mixed' : `${checked}`, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId, "aria-labelledby": hasLabelContent ? this.inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, class: createColorClasses(color, {
|
|
124
131
|
[mode]: true,
|
|
125
132
|
'in-item': hostContext('ion-item', el),
|
|
126
133
|
'checkbox-checked': checked,
|
|
@@ -130,10 +137,10 @@ const Checkbox = /*@__PURE__*/ proxyCustomElement(class Checkbox extends HTMLEle
|
|
|
130
137
|
[`checkbox-justify-${justify}`]: justify !== undefined,
|
|
131
138
|
[`checkbox-alignment-${alignment}`]: alignment !== undefined,
|
|
132
139
|
[`checkbox-label-placement-${labelPlacement}`]: true,
|
|
133
|
-
}), onClick: this.onClick }, h("label", { key: '
|
|
140
|
+
}), onClick: this.onClick }, h("label", { key: 'f025cec5ff08e8be4487b9cc0324616ca5dfae2a', class: "checkbox-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: 'dc53f7e4e240dc2e18556e6350df2b5c3169f553', type: "checkbox", checked: checked ? true : undefined, disabled: disabled, id: inputId, onChange: this.toggleChecked, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, inheritedAttributes)), h("div", { key: 'a625e9b50c3b617de8bbbfd624d772454fecaf2d', class: {
|
|
134
141
|
'label-text-wrapper': true,
|
|
135
142
|
'label-text-wrapper-hidden': !hasLabelContent,
|
|
136
|
-
}, part: "label", id: this.inputLabelId }, h("slot", { key: '
|
|
143
|
+
}, part: "label", id: this.inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '87d1a90691327945f4343406706e4ab27f453844' }), this.renderHintText()), h("div", { key: 'b57fed8cdecee4df1ef0d57f157267ee77fac653', class: "native-wrapper" }, h("svg", { key: 'd472a06ec6c8b74dfb651415d2236db8080f6805', class: "checkbox-icon", viewBox: "0 0 24 24", part: "container" }, path)))));
|
|
137
144
|
}
|
|
138
145
|
getSVGPath(mode, indeterminate) {
|
|
139
146
|
let path = indeterminate ? (h("path", { d: "M6 12L18 12", part: "mark" })) : (h("path", { d: "M5.9,12.5l3.8,3.8l8.8-8.8", part: "mark" }));
|
package/components/ion-input.js
CHANGED
|
@@ -82,6 +82,17 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
82
82
|
this.value = '';
|
|
83
83
|
this.emitInputChange(ev);
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* Stops propagation when the label is clicked,
|
|
87
|
+
* otherwise, two clicks will be triggered.
|
|
88
|
+
*/
|
|
89
|
+
this.onLabelClick = (ev) => {
|
|
90
|
+
// Only stop propagation if the click was directly on the label
|
|
91
|
+
// and not on the input or other child elements
|
|
92
|
+
if (ev.target === ev.currentTarget) {
|
|
93
|
+
ev.stopPropagation();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
85
96
|
this.hasFocus = false;
|
|
86
97
|
this.color = undefined;
|
|
87
98
|
this.autocapitalize = 'off';
|
|
@@ -442,7 +453,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
442
453
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
443
454
|
*/
|
|
444
455
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
445
|
-
return (h(Host, { key: '
|
|
456
|
+
return (h(Host, { key: '41b2526627e7d2773a80f011b123284203a71ca0', class: createColorClasses(this.color, {
|
|
446
457
|
[mode]: true,
|
|
447
458
|
'has-value': hasValue,
|
|
448
459
|
'has-focus': hasFocus,
|
|
@@ -453,7 +464,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
453
464
|
'in-item': inItem,
|
|
454
465
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
455
466
|
'input-disabled': disabled,
|
|
456
|
-
}) }, h("label", { key: '
|
|
467
|
+
}) }, h("label", { key: '9ab078363e32528102b441ad1791d83f86fdcbdc', class: "input-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'e34b594980ec62e4c618e827fadf7669a39ad0d8', class: "native-wrapper", onClick: this.onLabelClick }, h("slot", { key: '12dc04ead5502e9e5736240e918bf9331bf7b5d9', name: "start" }), h("input", Object.assign({ key: 'df356eb4ced23109b2c0242f36dc043aba8782d6', 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, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (h("button", { key: 'aa7cb47ac287140a68c5cb0ee9359abaa611e21b', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
457
468
|
/**
|
|
458
469
|
* This prevents mobile browsers from
|
|
459
470
|
* blurring the input when the clear
|
|
@@ -468,7 +479,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
468
479
|
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
469
480
|
*/
|
|
470
481
|
ev.stopPropagation();
|
|
471
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: '
|
|
482
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'cd03e46b97299d9db5cedf81944ae9bbe72bacdc', "aria-hidden": "true", icon: clearIconData }))), h("slot", { key: 'de36b79a89c4b413beba22e8a74c53dbf57a84ab', name: "end" })), shouldRenderHighlight && h("div", { key: 'f088509073845bf767ea7ccfde1e917e1cf93cc1', class: "input-highlight" })), this.renderBottomContent()));
|
|
472
483
|
}
|
|
473
484
|
get el() { return this; }
|
|
474
485
|
static get watchers() { return {
|
package/components/ion-select.js
CHANGED
|
@@ -100,6 +100,17 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
100
100
|
this.hasFocus = false;
|
|
101
101
|
this.ionBlur.emit();
|
|
102
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* Stops propagation when the label is clicked,
|
|
105
|
+
* otherwise, two clicks will be triggered.
|
|
106
|
+
*/
|
|
107
|
+
this.onLabelClick = (ev) => {
|
|
108
|
+
// Only stop propagation if the click was directly on the label
|
|
109
|
+
// and not on the input or other child elements
|
|
110
|
+
if (ev.target === ev.currentTarget) {
|
|
111
|
+
ev.stopPropagation();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
103
114
|
this.isExpanded = false;
|
|
104
115
|
this.hasFocus = false;
|
|
105
116
|
this.cancelText = 'Cancel';
|
|
@@ -710,7 +721,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
710
721
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
711
722
|
*/
|
|
712
723
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
713
|
-
return (h(Host, { key: '
|
|
724
|
+
return (h(Host, { key: '6dd3c92dc3c587960d767c7dd1c142fc20bef8ed', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
714
725
|
[mode]: true,
|
|
715
726
|
'in-item': inItem,
|
|
716
727
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -728,7 +739,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
728
739
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
729
740
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
730
741
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
731
|
-
}) }, h("label", { key: '
|
|
742
|
+
}) }, h("label", { key: 'bc80ee471debb20b33d1cf55f55932b621f1744a', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'deea85c3a3769e90af0933c522028148ee5781a3', class: "select-wrapper-inner" }, h("slot", { key: 'af8192f4d8d5426b39a00ef2ed96f3c4a9e12908', name: "start" }), h("div", { key: '6c278fc6c56b18e26cae930d375aa1da05af135b', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'c459d54471029872b8b3e63f7dfb6bdb869b4942', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '718960718fa91163dd4412e1865f476fef089127', class: "select-highlight" })), this.renderBottomContent()));
|
|
732
743
|
}
|
|
733
744
|
get el() { return this; }
|
|
734
745
|
static get watchers() { return {
|
|
@@ -68,6 +68,17 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
68
68
|
this.onKeyDown = (ev) => {
|
|
69
69
|
this.checkClearOnEdit(ev);
|
|
70
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Stops propagation when the label is clicked,
|
|
73
|
+
* otherwise, two clicks will be triggered.
|
|
74
|
+
*/
|
|
75
|
+
this.onLabelClick = (ev) => {
|
|
76
|
+
// Only stop propagation if the click was directly on the label
|
|
77
|
+
// and not on the input or other child elements
|
|
78
|
+
if (ev.target === ev.currentTarget) {
|
|
79
|
+
ev.stopPropagation();
|
|
80
|
+
}
|
|
81
|
+
};
|
|
71
82
|
this.hasFocus = false;
|
|
72
83
|
this.color = undefined;
|
|
73
84
|
this.autocapitalize = 'none';
|
|
@@ -401,7 +412,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
401
412
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
402
413
|
*/
|
|
403
414
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
404
|
-
return (h(Host, { key: '
|
|
415
|
+
return (h(Host, { key: '7eb390b79de0d671a785bbb783f97e09169472f9', class: createColorClasses(this.color, {
|
|
405
416
|
[mode]: true,
|
|
406
417
|
'has-value': hasValue,
|
|
407
418
|
'has-focus': hasFocus,
|
|
@@ -410,7 +421,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
410
421
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
411
422
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
412
423
|
'textarea-disabled': disabled,
|
|
413
|
-
}) }, h("label", { key: '
|
|
424
|
+
}) }, h("label", { key: 'f5835d8d56fadbd24637fc063a84834064aefc6d', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: '7ca9391a0cdcf47991bd529bfd38d06a3f92d6ec', class: "textarea-wrapper-inner" }, h("div", { key: '12e893e7c4b56f5e9f91ff81cdaf8d76f68988fe', class: "start-slot-wrapper" }, h("slot", { key: 'd9ff42e8989eb1462747fe67575f6c3478f4f8b3', name: "start" })), h("div", { key: '0b9f575368c9c4d990761c390c163825eb311963', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ key: '2c80fc07518265458f27201e15af9578e372fbcf', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes), value)), h("div", { key: '6647296719b79eb3ebe7146f9bfd77a6c37f6c30', class: "end-slot-wrapper" }, h("slot", { key: 'ec3ec3feb6b35ffe11bdcab94b521922b2f7e91f', name: "end" }))), shouldRenderHighlight && h("div", { key: '49e7dca783bc2eee320631859264772be876eaba', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
414
425
|
}
|
|
415
426
|
get el() { return this; }
|
|
416
427
|
static get watchers() { return {
|
package/components/ion-toggle.js
CHANGED
|
@@ -65,6 +65,13 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
65
65
|
this.toggleChecked();
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* Stops propagation when the display label is clicked,
|
|
70
|
+
* otherwise, two clicks will be triggered.
|
|
71
|
+
*/
|
|
72
|
+
this.onDivLabelClick = (ev) => {
|
|
73
|
+
ev.stopPropagation();
|
|
74
|
+
};
|
|
68
75
|
this.onFocus = () => {
|
|
69
76
|
this.ionFocus.emit();
|
|
70
77
|
};
|
|
@@ -203,7 +210,7 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
203
210
|
const value = this.getValue();
|
|
204
211
|
const rtl = isRTL(el) ? 'rtl' : 'ltr';
|
|
205
212
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
206
|
-
return (h(Host, { key: '
|
|
213
|
+
return (h(Host, { key: 'd9dad2132e9d6cf8e9844fefa009402e1a637ef8', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === errorTextId, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, class: createColorClasses(color, {
|
|
207
214
|
[mode]: true,
|
|
208
215
|
'in-item': hostContext('ion-item', el),
|
|
209
216
|
'toggle-activated': activated,
|
|
@@ -213,10 +220,10 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
213
220
|
[`toggle-alignment-${alignment}`]: alignment !== undefined,
|
|
214
221
|
[`toggle-label-placement-${labelPlacement}`]: true,
|
|
215
222
|
[`toggle-${rtl}`]: true,
|
|
216
|
-
}) }, h("label", { key: '
|
|
223
|
+
}) }, h("label", { key: '4becda2f40a735e941ecaba26f14231271e38197', class: "toggle-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: 'c1946dd6aa23dee3562915a7165e012c48b79890', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, inheritedAttributes)), h("div", { key: '2493dc0aa587f5f9d9a7d0a388f92928f2db0cf3', class: {
|
|
217
224
|
'label-text-wrapper': true,
|
|
218
225
|
'label-text-wrapper-hidden': !hasLabel,
|
|
219
|
-
}, part: "label", id: inputLabelId }, h("slot", { key: '
|
|
226
|
+
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '798220850b311a26b081914d5c774b757bde2992' }), this.renderHintText()), h("div", { key: '3c6142c9697b60646f286f6fd59f54609377f7d0', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
220
227
|
}
|
|
221
228
|
get el() { return this; }
|
|
222
229
|
static get watchers() { return {
|
|
@@ -67,6 +67,13 @@ const Checkbox = class {
|
|
|
67
67
|
}
|
|
68
68
|
this.toggleChecked(ev);
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Stops propagation when the display label is clicked,
|
|
72
|
+
* otherwise, two clicks will be triggered.
|
|
73
|
+
*/
|
|
74
|
+
this.onDivLabelClick = (ev) => {
|
|
75
|
+
ev.stopPropagation();
|
|
76
|
+
};
|
|
70
77
|
this.color = undefined;
|
|
71
78
|
this.name = this.inputId;
|
|
72
79
|
this.checked = false;
|
|
@@ -123,7 +130,7 @@ const Checkbox = class {
|
|
|
123
130
|
helpers.renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
124
131
|
// The host element must have a checkbox role to ensure proper VoiceOver
|
|
125
132
|
// support in Safari for accessibility.
|
|
126
|
-
return (index.h(index.Host, { key: '
|
|
133
|
+
return (index.h(index.Host, { key: '26cbe7220e555107200e9b5deeae754aa534a80b', role: "checkbox", "aria-checked": indeterminate ? 'mixed' : `${checked}`, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId, "aria-labelledby": hasLabelContent ? this.inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, class: theme.createColorClasses(color, {
|
|
127
134
|
[mode]: true,
|
|
128
135
|
'in-item': theme.hostContext('ion-item', el),
|
|
129
136
|
'checkbox-checked': checked,
|
|
@@ -133,10 +140,10 @@ const Checkbox = class {
|
|
|
133
140
|
[`checkbox-justify-${justify}`]: justify !== undefined,
|
|
134
141
|
[`checkbox-alignment-${alignment}`]: alignment !== undefined,
|
|
135
142
|
[`checkbox-label-placement-${labelPlacement}`]: true,
|
|
136
|
-
}), onClick: this.onClick }, index.h("label", { key: '
|
|
143
|
+
}), onClick: this.onClick }, index.h("label", { key: 'f025cec5ff08e8be4487b9cc0324616ca5dfae2a', class: "checkbox-wrapper", htmlFor: inputId }, index.h("input", Object.assign({ key: 'dc53f7e4e240dc2e18556e6350df2b5c3169f553', type: "checkbox", checked: checked ? true : undefined, disabled: disabled, id: inputId, onChange: this.toggleChecked, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, inheritedAttributes)), index.h("div", { key: 'a625e9b50c3b617de8bbbfd624d772454fecaf2d', class: {
|
|
137
144
|
'label-text-wrapper': true,
|
|
138
145
|
'label-text-wrapper-hidden': !hasLabelContent,
|
|
139
|
-
}, part: "label", id: this.inputLabelId }, index.h("slot", { key: '
|
|
146
|
+
}, part: "label", id: this.inputLabelId, onClick: this.onDivLabelClick }, index.h("slot", { key: '87d1a90691327945f4343406706e4ab27f453844' }), this.renderHintText()), index.h("div", { key: 'b57fed8cdecee4df1ef0d57f157267ee77fac653', class: "native-wrapper" }, index.h("svg", { key: 'd472a06ec6c8b74dfb651415d2236db8080f6805', class: "checkbox-icon", viewBox: "0 0 24 24", part: "container" }, path)))));
|
|
140
147
|
}
|
|
141
148
|
getSVGPath(mode, indeterminate) {
|
|
142
149
|
let path = indeterminate ? (index.h("path", { d: "M6 12L18 12", part: "mark" })) : (index.h("path", { d: "M5.9,12.5l3.8,3.8l8.8-8.8", part: "mark" }));
|
|
@@ -86,6 +86,17 @@ const Input = class {
|
|
|
86
86
|
this.value = '';
|
|
87
87
|
this.emitInputChange(ev);
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Stops propagation when the label is clicked,
|
|
91
|
+
* otherwise, two clicks will be triggered.
|
|
92
|
+
*/
|
|
93
|
+
this.onLabelClick = (ev) => {
|
|
94
|
+
// Only stop propagation if the click was directly on the label
|
|
95
|
+
// and not on the input or other child elements
|
|
96
|
+
if (ev.target === ev.currentTarget) {
|
|
97
|
+
ev.stopPropagation();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
89
100
|
this.hasFocus = false;
|
|
90
101
|
this.color = undefined;
|
|
91
102
|
this.autocapitalize = 'off';
|
|
@@ -446,7 +457,7 @@ const Input = class {
|
|
|
446
457
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
447
458
|
*/
|
|
448
459
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
449
|
-
return (index.h(index.Host, { key: '
|
|
460
|
+
return (index.h(index.Host, { key: '41b2526627e7d2773a80f011b123284203a71ca0', class: theme.createColorClasses(this.color, {
|
|
450
461
|
[mode]: true,
|
|
451
462
|
'has-value': hasValue,
|
|
452
463
|
'has-focus': hasFocus,
|
|
@@ -457,7 +468,7 @@ const Input = class {
|
|
|
457
468
|
'in-item': inItem,
|
|
458
469
|
'in-item-color': theme.hostContext('ion-item.ion-color', this.el),
|
|
459
470
|
'input-disabled': disabled,
|
|
460
|
-
}) }, index.h("label", { key: '
|
|
471
|
+
}) }, index.h("label", { key: '9ab078363e32528102b441ad1791d83f86fdcbdc', class: "input-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), index.h("div", { key: 'e34b594980ec62e4c618e827fadf7669a39ad0d8', class: "native-wrapper", onClick: this.onLabelClick }, index.h("slot", { key: '12dc04ead5502e9e5736240e918bf9331bf7b5d9', name: "start" }), index.h("input", Object.assign({ key: 'df356eb4ced23109b2c0242f36dc043aba8782d6', 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, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (index.h("button", { key: 'aa7cb47ac287140a68c5cb0ee9359abaa611e21b', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
461
472
|
/**
|
|
462
473
|
* This prevents mobile browsers from
|
|
463
474
|
* blurring the input when the clear
|
|
@@ -472,7 +483,7 @@ const Input = class {
|
|
|
472
483
|
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
473
484
|
*/
|
|
474
485
|
ev.stopPropagation();
|
|
475
|
-
}, onClick: this.clearTextInput }, index.h("ion-icon", { key: '
|
|
486
|
+
}, onClick: this.clearTextInput }, index.h("ion-icon", { key: 'cd03e46b97299d9db5cedf81944ae9bbe72bacdc', "aria-hidden": "true", icon: clearIconData }))), index.h("slot", { key: 'de36b79a89c4b413beba22e8a74c53dbf57a84ab', name: "end" })), shouldRenderHighlight && index.h("div", { key: 'f088509073845bf767ea7ccfde1e917e1cf93cc1', class: "input-highlight" })), this.renderBottomContent()));
|
|
476
487
|
}
|
|
477
488
|
get el() { return index.getElement(this); }
|
|
478
489
|
static get watchers() { return {
|
|
@@ -85,6 +85,17 @@ const Select = class {
|
|
|
85
85
|
this.hasFocus = false;
|
|
86
86
|
this.ionBlur.emit();
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Stops propagation when the label is clicked,
|
|
90
|
+
* otherwise, two clicks will be triggered.
|
|
91
|
+
*/
|
|
92
|
+
this.onLabelClick = (ev) => {
|
|
93
|
+
// Only stop propagation if the click was directly on the label
|
|
94
|
+
// and not on the input or other child elements
|
|
95
|
+
if (ev.target === ev.currentTarget) {
|
|
96
|
+
ev.stopPropagation();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
88
99
|
this.isExpanded = false;
|
|
89
100
|
this.hasFocus = false;
|
|
90
101
|
this.cancelText = 'Cancel';
|
|
@@ -695,7 +706,7 @@ const Select = class {
|
|
|
695
706
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
696
707
|
*/
|
|
697
708
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
698
|
-
return (index.h(index.Host, { key: '
|
|
709
|
+
return (index.h(index.Host, { key: '6dd3c92dc3c587960d767c7dd1c142fc20bef8ed', onClick: this.onClick, class: theme.createColorClasses(this.color, {
|
|
699
710
|
[mode]: true,
|
|
700
711
|
'in-item': inItem,
|
|
701
712
|
'in-item-color': theme.hostContext('ion-item.ion-color', el),
|
|
@@ -713,7 +724,7 @@ const Select = class {
|
|
|
713
724
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
714
725
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
715
726
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
716
|
-
}) }, index.h("label", { key: '
|
|
727
|
+
}) }, index.h("label", { key: 'bc80ee471debb20b33d1cf55f55932b621f1744a', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), index.h("div", { key: 'deea85c3a3769e90af0933c522028148ee5781a3', class: "select-wrapper-inner" }, index.h("slot", { key: 'af8192f4d8d5426b39a00ef2ed96f3c4a9e12908', name: "start" }), index.h("div", { key: '6c278fc6c56b18e26cae930d375aa1da05af135b', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), index.h("slot", { key: 'c459d54471029872b8b3e63f7dfb6bdb869b4942', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && index.h("div", { key: '718960718fa91163dd4412e1865f476fef089127', class: "select-highlight" })), this.renderBottomContent()));
|
|
717
728
|
}
|
|
718
729
|
get el() { return index.getElement(this); }
|
|
719
730
|
static get watchers() { return {
|
|
@@ -73,6 +73,17 @@ const Textarea = class {
|
|
|
73
73
|
this.onKeyDown = (ev) => {
|
|
74
74
|
this.checkClearOnEdit(ev);
|
|
75
75
|
};
|
|
76
|
+
/**
|
|
77
|
+
* Stops propagation when the label is clicked,
|
|
78
|
+
* otherwise, two clicks will be triggered.
|
|
79
|
+
*/
|
|
80
|
+
this.onLabelClick = (ev) => {
|
|
81
|
+
// Only stop propagation if the click was directly on the label
|
|
82
|
+
// and not on the input or other child elements
|
|
83
|
+
if (ev.target === ev.currentTarget) {
|
|
84
|
+
ev.stopPropagation();
|
|
85
|
+
}
|
|
86
|
+
};
|
|
76
87
|
this.hasFocus = false;
|
|
77
88
|
this.color = undefined;
|
|
78
89
|
this.autocapitalize = 'none';
|
|
@@ -406,7 +417,7 @@ const Textarea = class {
|
|
|
406
417
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
407
418
|
*/
|
|
408
419
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
409
|
-
return (index.h(index.Host, { key: '
|
|
420
|
+
return (index.h(index.Host, { key: '7eb390b79de0d671a785bbb783f97e09169472f9', class: theme.createColorClasses(this.color, {
|
|
410
421
|
[mode]: true,
|
|
411
422
|
'has-value': hasValue,
|
|
412
423
|
'has-focus': hasFocus,
|
|
@@ -415,7 +426,7 @@ const Textarea = class {
|
|
|
415
426
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
416
427
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
417
428
|
'textarea-disabled': disabled,
|
|
418
|
-
}) }, index.h("label", { key: '
|
|
429
|
+
}) }, index.h("label", { key: 'f5835d8d56fadbd24637fc063a84834064aefc6d', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), index.h("div", { key: '7ca9391a0cdcf47991bd529bfd38d06a3f92d6ec', class: "textarea-wrapper-inner" }, index.h("div", { key: '12e893e7c4b56f5e9f91ff81cdaf8d76f68988fe', class: "start-slot-wrapper" }, index.h("slot", { key: 'd9ff42e8989eb1462747fe67575f6c3478f4f8b3', name: "start" })), index.h("div", { key: '0b9f575368c9c4d990761c390c163825eb311963', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, index.h("textarea", Object.assign({ key: '2c80fc07518265458f27201e15af9578e372fbcf', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes), value)), index.h("div", { key: '6647296719b79eb3ebe7146f9bfd77a6c37f6c30', class: "end-slot-wrapper" }, index.h("slot", { key: 'ec3ec3feb6b35ffe11bdcab94b521922b2f7e91f', name: "end" }))), shouldRenderHighlight && index.h("div", { key: '49e7dca783bc2eee320631859264772be876eaba', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
419
430
|
}
|
|
420
431
|
get el() { return index.getElement(this); }
|
|
421
432
|
static get watchers() { return {
|
|
@@ -68,6 +68,13 @@ const Toggle = class {
|
|
|
68
68
|
this.toggleChecked();
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Stops propagation when the display label is clicked,
|
|
73
|
+
* otherwise, two clicks will be triggered.
|
|
74
|
+
*/
|
|
75
|
+
this.onDivLabelClick = (ev) => {
|
|
76
|
+
ev.stopPropagation();
|
|
77
|
+
};
|
|
71
78
|
this.onFocus = () => {
|
|
72
79
|
this.ionFocus.emit();
|
|
73
80
|
};
|
|
@@ -206,7 +213,7 @@ const Toggle = class {
|
|
|
206
213
|
const value = this.getValue();
|
|
207
214
|
const rtl = dir.isRTL(el) ? 'rtl' : 'ltr';
|
|
208
215
|
helpers.renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
209
|
-
return (index.h(index.Host, { key: '
|
|
216
|
+
return (index.h(index.Host, { key: 'd9dad2132e9d6cf8e9844fefa009402e1a637ef8', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === errorTextId, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, class: theme.createColorClasses(color, {
|
|
210
217
|
[mode]: true,
|
|
211
218
|
'in-item': theme.hostContext('ion-item', el),
|
|
212
219
|
'toggle-activated': activated,
|
|
@@ -216,10 +223,10 @@ const Toggle = class {
|
|
|
216
223
|
[`toggle-alignment-${alignment}`]: alignment !== undefined,
|
|
217
224
|
[`toggle-label-placement-${labelPlacement}`]: true,
|
|
218
225
|
[`toggle-${rtl}`]: true,
|
|
219
|
-
}) }, index.h("label", { key: '
|
|
226
|
+
}) }, index.h("label", { key: '4becda2f40a735e941ecaba26f14231271e38197', class: "toggle-wrapper", htmlFor: inputId }, index.h("input", Object.assign({ key: 'c1946dd6aa23dee3562915a7165e012c48b79890', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, inheritedAttributes)), index.h("div", { key: '2493dc0aa587f5f9d9a7d0a388f92928f2db0cf3', class: {
|
|
220
227
|
'label-text-wrapper': true,
|
|
221
228
|
'label-text-wrapper-hidden': !hasLabel,
|
|
222
|
-
}, part: "label", id: inputLabelId }, index.h("slot", { key: '
|
|
229
|
+
}, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, index.h("slot", { key: '798220850b311a26b081914d5c774b757bde2992' }), this.renderHintText()), index.h("div", { key: '3c6142c9697b60646f286f6fd59f54609377f7d0', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
223
230
|
}
|
|
224
231
|
get el() { return index.getElement(this); }
|
|
225
232
|
static get watchers() { return {
|
|
@@ -63,6 +63,13 @@ export class Checkbox {
|
|
|
63
63
|
}
|
|
64
64
|
this.toggleChecked(ev);
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Stops propagation when the display label is clicked,
|
|
68
|
+
* otherwise, two clicks will be triggered.
|
|
69
|
+
*/
|
|
70
|
+
this.onDivLabelClick = (ev) => {
|
|
71
|
+
ev.stopPropagation();
|
|
72
|
+
};
|
|
66
73
|
this.color = undefined;
|
|
67
74
|
this.name = this.inputId;
|
|
68
75
|
this.checked = false;
|
|
@@ -119,7 +126,7 @@ export class Checkbox {
|
|
|
119
126
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
120
127
|
// The host element must have a checkbox role to ensure proper VoiceOver
|
|
121
128
|
// support in Safari for accessibility.
|
|
122
|
-
return (h(Host, { key: '
|
|
129
|
+
return (h(Host, { key: '26cbe7220e555107200e9b5deeae754aa534a80b', role: "checkbox", "aria-checked": indeterminate ? 'mixed' : `${checked}`, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId, "aria-labelledby": hasLabelContent ? this.inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, class: createColorClasses(color, {
|
|
123
130
|
[mode]: true,
|
|
124
131
|
'in-item': hostContext('ion-item', el),
|
|
125
132
|
'checkbox-checked': checked,
|
|
@@ -129,10 +136,10 @@ export class Checkbox {
|
|
|
129
136
|
[`checkbox-justify-${justify}`]: justify !== undefined,
|
|
130
137
|
[`checkbox-alignment-${alignment}`]: alignment !== undefined,
|
|
131
138
|
[`checkbox-label-placement-${labelPlacement}`]: true,
|
|
132
|
-
}), onClick: this.onClick }, h("label", { key: '
|
|
139
|
+
}), onClick: this.onClick }, h("label", { key: 'f025cec5ff08e8be4487b9cc0324616ca5dfae2a', class: "checkbox-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: 'dc53f7e4e240dc2e18556e6350df2b5c3169f553', type: "checkbox", checked: checked ? true : undefined, disabled: disabled, id: inputId, onChange: this.toggleChecked, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, inheritedAttributes)), h("div", { key: 'a625e9b50c3b617de8bbbfd624d772454fecaf2d', class: {
|
|
133
140
|
'label-text-wrapper': true,
|
|
134
141
|
'label-text-wrapper-hidden': !hasLabelContent,
|
|
135
|
-
}, part: "label", id: this.inputLabelId }, h("slot", { key: '
|
|
142
|
+
}, part: "label", id: this.inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '87d1a90691327945f4343406706e4ab27f453844' }), this.renderHintText()), h("div", { key: 'b57fed8cdecee4df1ef0d57f157267ee77fac653', class: "native-wrapper" }, h("svg", { key: 'd472a06ec6c8b74dfb651415d2236db8080f6805', class: "checkbox-icon", viewBox: "0 0 24 24", part: "container" }, path)))));
|
|
136
143
|
}
|
|
137
144
|
getSVGPath(mode, indeterminate) {
|
|
138
145
|
let path = indeterminate ? (h("path", { d: "M6 12L18 12", part: "mark" })) : (h("path", { d: "M5.9,12.5l3.8,3.8l8.8-8.8", part: "mark" }));
|
|
@@ -76,6 +76,17 @@ export class Input {
|
|
|
76
76
|
this.value = '';
|
|
77
77
|
this.emitInputChange(ev);
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Stops propagation when the label is clicked,
|
|
81
|
+
* otherwise, two clicks will be triggered.
|
|
82
|
+
*/
|
|
83
|
+
this.onLabelClick = (ev) => {
|
|
84
|
+
// Only stop propagation if the click was directly on the label
|
|
85
|
+
// and not on the input or other child elements
|
|
86
|
+
if (ev.target === ev.currentTarget) {
|
|
87
|
+
ev.stopPropagation();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
79
90
|
this.hasFocus = false;
|
|
80
91
|
this.color = undefined;
|
|
81
92
|
this.autocapitalize = 'off';
|
|
@@ -436,7 +447,7 @@ export class Input {
|
|
|
436
447
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
437
448
|
*/
|
|
438
449
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
439
|
-
return (h(Host, { key: '
|
|
450
|
+
return (h(Host, { key: '41b2526627e7d2773a80f011b123284203a71ca0', class: createColorClasses(this.color, {
|
|
440
451
|
[mode]: true,
|
|
441
452
|
'has-value': hasValue,
|
|
442
453
|
'has-focus': hasFocus,
|
|
@@ -447,7 +458,7 @@ export class Input {
|
|
|
447
458
|
'in-item': inItem,
|
|
448
459
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
449
460
|
'input-disabled': disabled,
|
|
450
|
-
}) }, h("label", { key: '
|
|
461
|
+
}) }, h("label", { key: '9ab078363e32528102b441ad1791d83f86fdcbdc', class: "input-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'e34b594980ec62e4c618e827fadf7669a39ad0d8', class: "native-wrapper", onClick: this.onLabelClick }, h("slot", { key: '12dc04ead5502e9e5736240e918bf9331bf7b5d9', name: "start" }), h("input", Object.assign({ key: 'df356eb4ced23109b2c0242f36dc043aba8782d6', 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, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes)), this.clearInput && !readonly && !disabled && (h("button", { key: 'aa7cb47ac287140a68c5cb0ee9359abaa611e21b', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
451
462
|
/**
|
|
452
463
|
* This prevents mobile browsers from
|
|
453
464
|
* blurring the input when the clear
|
|
@@ -462,7 +473,7 @@ export class Input {
|
|
|
462
473
|
* for screen readers as it means users would be unable to swipe past the clear button.
|
|
463
474
|
*/
|
|
464
475
|
ev.stopPropagation();
|
|
465
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: '
|
|
476
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: 'cd03e46b97299d9db5cedf81944ae9bbe72bacdc', "aria-hidden": "true", icon: clearIconData }))), h("slot", { key: 'de36b79a89c4b413beba22e8a74c53dbf57a84ab', name: "end" })), shouldRenderHighlight && h("div", { key: 'f088509073845bf767ea7ccfde1e917e1cf93cc1', class: "input-highlight" })), this.renderBottomContent()));
|
|
466
477
|
}
|
|
467
478
|
static get is() { return "ion-input"; }
|
|
468
479
|
static get encapsulation() { return "scoped"; }
|
|
@@ -79,6 +79,17 @@ export class Select {
|
|
|
79
79
|
this.hasFocus = false;
|
|
80
80
|
this.ionBlur.emit();
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Stops propagation when the label is clicked,
|
|
84
|
+
* otherwise, two clicks will be triggered.
|
|
85
|
+
*/
|
|
86
|
+
this.onLabelClick = (ev) => {
|
|
87
|
+
// Only stop propagation if the click was directly on the label
|
|
88
|
+
// and not on the input or other child elements
|
|
89
|
+
if (ev.target === ev.currentTarget) {
|
|
90
|
+
ev.stopPropagation();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
82
93
|
this.isExpanded = false;
|
|
83
94
|
this.hasFocus = false;
|
|
84
95
|
this.cancelText = 'Cancel';
|
|
@@ -735,7 +746,7 @@ export class Select {
|
|
|
735
746
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
736
747
|
*/
|
|
737
748
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
738
|
-
return (h(Host, { key: '
|
|
749
|
+
return (h(Host, { key: '6dd3c92dc3c587960d767c7dd1c142fc20bef8ed', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
739
750
|
[mode]: true,
|
|
740
751
|
'in-item': inItem,
|
|
741
752
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -753,7 +764,7 @@ export class Select {
|
|
|
753
764
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
754
765
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
755
766
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
756
|
-
}) }, h("label", { key: '
|
|
767
|
+
}) }, h("label", { key: 'bc80ee471debb20b33d1cf55f55932b621f1744a', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'deea85c3a3769e90af0933c522028148ee5781a3', class: "select-wrapper-inner" }, h("slot", { key: 'af8192f4d8d5426b39a00ef2ed96f3c4a9e12908', name: "start" }), h("div", { key: '6c278fc6c56b18e26cae930d375aa1da05af135b', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: 'c459d54471029872b8b3e63f7dfb6bdb869b4942', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '718960718fa91163dd4412e1865f476fef089127', class: "select-highlight" })), this.renderBottomContent()));
|
|
757
768
|
}
|
|
758
769
|
static get is() { return "ion-select"; }
|
|
759
770
|
static get encapsulation() { return "shadow"; }
|
|
@@ -63,6 +63,17 @@ export class Textarea {
|
|
|
63
63
|
this.onKeyDown = (ev) => {
|
|
64
64
|
this.checkClearOnEdit(ev);
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Stops propagation when the label is clicked,
|
|
68
|
+
* otherwise, two clicks will be triggered.
|
|
69
|
+
*/
|
|
70
|
+
this.onLabelClick = (ev) => {
|
|
71
|
+
// Only stop propagation if the click was directly on the label
|
|
72
|
+
// and not on the input or other child elements
|
|
73
|
+
if (ev.target === ev.currentTarget) {
|
|
74
|
+
ev.stopPropagation();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
66
77
|
this.hasFocus = false;
|
|
67
78
|
this.color = undefined;
|
|
68
79
|
this.autocapitalize = 'none';
|
|
@@ -396,7 +407,7 @@ export class Textarea {
|
|
|
396
407
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
397
408
|
*/
|
|
398
409
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
399
|
-
return (h(Host, { key: '
|
|
410
|
+
return (h(Host, { key: '7eb390b79de0d671a785bbb783f97e09169472f9', class: createColorClasses(this.color, {
|
|
400
411
|
[mode]: true,
|
|
401
412
|
'has-value': hasValue,
|
|
402
413
|
'has-focus': hasFocus,
|
|
@@ -405,7 +416,7 @@ export class Textarea {
|
|
|
405
416
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
406
417
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
407
418
|
'textarea-disabled': disabled,
|
|
408
|
-
}) }, h("label", { key: '
|
|
419
|
+
}) }, h("label", { key: 'f5835d8d56fadbd24637fc063a84834064aefc6d', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: '7ca9391a0cdcf47991bd529bfd38d06a3f92d6ec', class: "textarea-wrapper-inner" }, h("div", { key: '12e893e7c4b56f5e9f91ff81cdaf8d76f68988fe', class: "start-slot-wrapper" }, h("slot", { key: 'd9ff42e8989eb1462747fe67575f6c3478f4f8b3', name: "start" })), h("div", { key: '0b9f575368c9c4d990761c390c163825eb311963', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ key: '2c80fc07518265458f27201e15af9578e372fbcf', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.getHintTextID() === this.errorTextId }, this.inheritedAttributes), value)), h("div", { key: '6647296719b79eb3ebe7146f9bfd77a6c37f6c30', class: "end-slot-wrapper" }, h("slot", { key: 'ec3ec3feb6b35ffe11bdcab94b521922b2f7e91f', name: "end" }))), shouldRenderHighlight && h("div", { key: '49e7dca783bc2eee320631859264772be876eaba', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
409
420
|
}
|
|
410
421
|
static get is() { return "ion-textarea"; }
|
|
411
422
|
static get encapsulation() { return "scoped"; }
|