@ionic/core 8.7.4-dev.11755809082.11a7702b → 8.7.4-dev.11756388042.1a103a79
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/ion-datetime.js +4 -3
- package/components/ion-input.js +8 -63
- package/components/ion-menu.js +5 -2
- package/components/ion-textarea.js +7 -62
- package/components/overlays.js +18 -109
- package/components/picker-column-option.js +3 -3
- package/components/picker-column.js +3 -39
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-input.cjs.entry.js +8 -62
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +6 -3
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-picker-column-option.cjs.entry.js +3 -3
- package/dist/cjs/ion-picker-column.cjs.entry.js +3 -39
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +7 -61
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-CglR7j-u.js → overlays-v_jc1Hok.js} +17 -108
- package/dist/collection/components/datetime/datetime.js +4 -3
- package/dist/collection/components/input/input.js +9 -64
- package/dist/collection/components/menu/menu.js +9 -2
- package/dist/collection/components/picker-column/picker-column.js +3 -39
- package/dist/collection/components/picker-column-option/picker-column-option.ios.css +2 -2
- package/dist/collection/components/picker-column-option/picker-column-option.js +1 -1
- package/dist/collection/components/picker-column-option/picker-column-option.md.css +2 -2
- package/dist/collection/components/textarea/textarea.js +8 -63
- package/dist/collection/utils/overlays.js +17 -109
- package/dist/docs.json +5 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-datetime_3.entry.js +4 -4
- package/dist/esm/ion-input.entry.js +8 -62
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +6 -3
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-picker-column-option.entry.js +3 -3
- package/dist/esm/ion-picker-column.entry.js +3 -39
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-select-modal.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +7 -61
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-ZX_4-t_r.js → overlays-BJaRj3Rj.js} +18 -109
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-f2884bc2.entry.js → p-095073c6.entry.js} +1 -1
- package/dist/ionic/p-1488b7cc.entry.js +4 -0
- package/dist/ionic/p-1ab0fc21.entry.js +4 -0
- package/dist/ionic/{p-92e8f208.entry.js → p-2060feb1.entry.js} +1 -1
- package/dist/ionic/p-22a0f820.entry.js +4 -0
- package/dist/ionic/{p-c575e7ce.entry.js → p-5a9be5a3.entry.js} +1 -1
- package/dist/ionic/{p-7bac2c5f.entry.js → p-60ff6bf6.entry.js} +1 -1
- package/dist/ionic/p-8888efe4.entry.js +4 -0
- package/dist/ionic/{p-ab33ef20.entry.js → p-89c2e0a3.entry.js} +1 -1
- package/dist/ionic/p-CoDfkBuk.js +4 -0
- package/dist/ionic/{p-91d6ccb0.entry.js → p-b17f0554.entry.js} +1 -1
- package/dist/ionic/p-b292804d.entry.js +4 -0
- package/dist/ionic/p-c5210d3e.entry.js +4 -0
- package/dist/ionic/{p-ac434970.entry.js → p-cd93c119.entry.js} +1 -1
- package/dist/ionic/p-dc8d0bb9.entry.js +4 -0
- package/dist/types/components/input/input.d.ts +0 -9
- package/dist/types/components/picker-column/picker-column.d.ts +0 -7
- package/dist/types/components/textarea/textarea.d.ts +0 -9
- package/hydrate/index.js +46 -248
- package/hydrate/index.mjs +46 -248
- package/package.json +2 -2
- package/dist/ionic/p-1d5b934a.entry.js +0 -4
- package/dist/ionic/p-1d65c601.entry.js +0 -4
- package/dist/ionic/p-29032e49.entry.js +0 -4
- package/dist/ionic/p-33017191.entry.js +0 -4
- package/dist/ionic/p-8d96a0cd.entry.js +0 -4
- package/dist/ionic/p-982fe1c4.entry.js +0 -4
- package/dist/ionic/p-CSwZyt05.js +0 -4
- package/dist/ionic/p-f456d176.entry.js +0 -4
|
@@ -5,6 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, writeTask, h, Host } from
|
|
|
5
5
|
import { startFocusVisible } from './focus-visible.js';
|
|
6
6
|
import { r as raf, g as getElementRoot, e as renderHiddenInput } from './helpers.js';
|
|
7
7
|
import { a as printIonError, p as printIonWarning } from './index4.js';
|
|
8
|
+
import { F as FOCUS_TRAP_DISABLE_CLASS } from './overlays.js';
|
|
8
9
|
import { i as isRTL } from './dir.js';
|
|
9
10
|
import { c as createColorClasses } from './theme.js';
|
|
10
11
|
import { c as chevronDown, f as caretUpSharp, g as chevronForward, h as caretDownSharp, a as chevronBack } from './index6.js';
|
|
@@ -1302,7 +1303,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1302
1303
|
const renderArray = forcePresentation === 'time-date'
|
|
1303
1304
|
? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
|
|
1304
1305
|
: [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
|
|
1305
|
-
return h("ion-picker",
|
|
1306
|
+
return h("ion-picker", { class: FOCUS_TRAP_DISABLE_CLASS }, renderArray);
|
|
1306
1307
|
}
|
|
1307
1308
|
renderDatePickerColumns(forcePresentation) {
|
|
1308
1309
|
return forcePresentation === 'date-time' || forcePresentation === 'time-date'
|
|
@@ -1859,7 +1860,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1859
1860
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1860
1861
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1861
1862
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1862
|
-
return (h(Host, { key: '
|
|
1863
|
+
return (h(Host, { key: '57492534800ea059a7c2bbd9f0059cc0b75ae8d2', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1863
1864
|
[mode]: true,
|
|
1864
1865
|
['datetime-readonly']: readonly,
|
|
1865
1866
|
['datetime-disabled']: disabled,
|
|
@@ -1869,7 +1870,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1869
1870
|
[`datetime-size-${size}`]: true,
|
|
1870
1871
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1871
1872
|
[`datetime-grid`]: isGridStyle,
|
|
1872
|
-
})) }, h("div", { key: '
|
|
1873
|
+
})) }, h("div", { key: '97dac5e5195635ac0bc5fb472b9d09e5c3c6bbc3', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1873
1874
|
}
|
|
1874
1875
|
get el() { return this; }
|
|
1875
1876
|
static get watchers() { return {
|
package/components/ion-input.js
CHANGED
|
@@ -43,10 +43,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
43
43
|
* is applied in both cases.
|
|
44
44
|
*/
|
|
45
45
|
this.hasFocus = false;
|
|
46
|
-
/**
|
|
47
|
-
* Track validation state for proper aria-live announcements
|
|
48
|
-
*/
|
|
49
|
-
this.isInvalid = false;
|
|
50
46
|
/**
|
|
51
47
|
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
|
52
48
|
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
|
@@ -132,19 +128,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
132
128
|
}
|
|
133
129
|
this.didInputClearOnEdit = false;
|
|
134
130
|
this.ionBlur.emit(ev);
|
|
135
|
-
/**
|
|
136
|
-
* Check validation state after blur to handle framework-managed classes.
|
|
137
|
-
* Frameworks like Angular update classes asynchronously, often using
|
|
138
|
-
* requestAnimationFrame or promises. Using setTimeout ensures we check
|
|
139
|
-
* after all microtasks and animation frames have completed.
|
|
140
|
-
*/
|
|
141
|
-
setTimeout(() => {
|
|
142
|
-
const newIsInvalid = this.checkValidationState();
|
|
143
|
-
if (this.isInvalid !== newIsInvalid) {
|
|
144
|
-
this.isInvalid = newIsInvalid;
|
|
145
|
-
forceUpdate(this);
|
|
146
|
-
}
|
|
147
|
-
}, 100);
|
|
148
131
|
};
|
|
149
132
|
this.onFocus = (ev) => {
|
|
150
133
|
this.hasFocus = true;
|
|
@@ -244,42 +227,10 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
244
227
|
componentWillLoad() {
|
|
245
228
|
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el, ['tabindex', 'title', 'data-form-type', 'dir']));
|
|
246
229
|
}
|
|
247
|
-
/**
|
|
248
|
-
* Checks if the input is in an invalid state based on validation classes
|
|
249
|
-
*/
|
|
250
|
-
checkValidationState() {
|
|
251
|
-
// Check for both Ionic and Angular validation classes on the element itself
|
|
252
|
-
// Angular applies ng-touched/ng-invalid directly to the host element with ngModel
|
|
253
|
-
const hasIonTouched = this.el.classList.contains('ion-touched');
|
|
254
|
-
const hasIonInvalid = this.el.classList.contains('ion-invalid');
|
|
255
|
-
const hasNgTouched = this.el.classList.contains('ng-touched');
|
|
256
|
-
const hasNgInvalid = this.el.classList.contains('ng-invalid');
|
|
257
|
-
// Return true if we have both touched and invalid states from either framework
|
|
258
|
-
const isTouched = hasIonTouched || hasNgTouched;
|
|
259
|
-
const isInvalid = hasIonInvalid || hasNgInvalid;
|
|
260
|
-
return isTouched && isInvalid;
|
|
261
|
-
}
|
|
262
230
|
connectedCallback() {
|
|
263
231
|
const { el } = this;
|
|
264
232
|
this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => forceUpdate(this));
|
|
265
233
|
this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
266
|
-
// Watch for class changes to update validation state
|
|
267
|
-
if (Build.isBrowser && typeof MutationObserver !== 'undefined') {
|
|
268
|
-
this.validationObserver = new MutationObserver(() => {
|
|
269
|
-
const newIsInvalid = this.checkValidationState();
|
|
270
|
-
if (this.isInvalid !== newIsInvalid) {
|
|
271
|
-
this.isInvalid = newIsInvalid;
|
|
272
|
-
// Force a re-render to update aria-describedby immediately
|
|
273
|
-
forceUpdate(this);
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
this.validationObserver.observe(el, {
|
|
277
|
-
attributes: true,
|
|
278
|
-
attributeFilter: ['class'],
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
// Always set initial state
|
|
282
|
-
this.isInvalid = this.checkValidationState();
|
|
283
234
|
this.debounceChanged();
|
|
284
235
|
if (Build.isBrowser) {
|
|
285
236
|
document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
|
|
@@ -316,11 +267,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
316
267
|
this.notchController.destroy();
|
|
317
268
|
this.notchController = undefined;
|
|
318
269
|
}
|
|
319
|
-
// Clean up validation observer to prevent memory leaks
|
|
320
|
-
if (this.validationObserver) {
|
|
321
|
-
this.validationObserver.disconnect();
|
|
322
|
-
this.validationObserver = undefined;
|
|
323
|
-
}
|
|
324
270
|
}
|
|
325
271
|
/**
|
|
326
272
|
* Sets focus on the native `input` in `ion-input`. Use this method instead of the global
|
|
@@ -422,15 +368,15 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
422
368
|
* Renders the helper text or error text values
|
|
423
369
|
*/
|
|
424
370
|
renderHintText() {
|
|
425
|
-
const { helperText, errorText, helperTextId, errorTextId
|
|
371
|
+
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
426
372
|
return [
|
|
427
|
-
|
|
428
|
-
|
|
373
|
+
h("div", { id: helperTextId, class: "helper-text" }, helperText),
|
|
374
|
+
h("div", { id: errorTextId, class: "error-text" }, errorText),
|
|
429
375
|
];
|
|
430
376
|
}
|
|
431
377
|
getHintTextID() {
|
|
432
|
-
const {
|
|
433
|
-
if (
|
|
378
|
+
const { el, helperText, errorText, helperTextId, errorTextId } = this;
|
|
379
|
+
if (el.classList.contains('ion-touched') && el.classList.contains('ion-invalid') && errorText) {
|
|
434
380
|
return errorTextId;
|
|
435
381
|
}
|
|
436
382
|
if (helperText) {
|
|
@@ -543,7 +489,7 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
543
489
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
544
490
|
*/
|
|
545
491
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
546
|
-
return (h(Host, { key: '
|
|
492
|
+
return (h(Host, { key: '41b2526627e7d2773a80f011b123284203a71ca0', class: createColorClasses(this.color, {
|
|
547
493
|
[mode]: true,
|
|
548
494
|
'has-value': hasValue,
|
|
549
495
|
'has-focus': hasFocus,
|
|
@@ -554,14 +500,14 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
554
500
|
'in-item': inItem,
|
|
555
501
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
556
502
|
'input-disabled': disabled,
|
|
557
|
-
}) }, h("label", { key: '
|
|
503
|
+
}) }, 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: 'f79f68cabcd4ea99419331174a377827db0c0741', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
558
504
|
/**
|
|
559
505
|
* This prevents mobile browsers from
|
|
560
506
|
* blurring the input when the clear
|
|
561
507
|
* button is activated.
|
|
562
508
|
*/
|
|
563
509
|
ev.preventDefault();
|
|
564
|
-
}, onClick: this.clearTextInput }, h("ion-icon", { key: '
|
|
510
|
+
}, onClick: this.clearTextInput }, h("ion-icon", { key: '237ec07ec2e10f08818a332bb596578c2c49f770', "aria-hidden": "true", icon: clearIconData }))), h("slot", { key: '1f0a3624aa3e8dc3c307a6762230ab698768a5e5', name: "end" })), shouldRenderHighlight && h("div", { key: '8a8cbb82695a722a0010b53dd0b1f1f97534a20b', class: "input-highlight" })), this.renderBottomContent()));
|
|
565
511
|
}
|
|
566
512
|
get el() { return this; }
|
|
567
513
|
static get watchers() { return {
|
|
@@ -610,7 +556,6 @@ const Input = /*@__PURE__*/ proxyCustomElement(class Input extends HTMLElement {
|
|
|
610
556
|
"type": [1],
|
|
611
557
|
"value": [1032],
|
|
612
558
|
"hasFocus": [32],
|
|
613
|
-
"isInvalid": [32],
|
|
614
559
|
"setFocus": [64],
|
|
615
560
|
"getInputElement": [64]
|
|
616
561
|
}, [[2, "click", "onClickCapture"]], {
|
package/components/ion-menu.js
CHANGED
|
@@ -300,6 +300,9 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
|
300
300
|
* @param role The role of the element that is closing the menu.
|
|
301
301
|
*/
|
|
302
302
|
setOpen(shouldOpen, animated = true, role) {
|
|
303
|
+
var _a;
|
|
304
|
+
// Blur the active element to prevent it from being kept focused inside an element that will be set with aria-hidden="true"
|
|
305
|
+
(_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
303
306
|
return menuController._setOpen(this, shouldOpen, animated, role);
|
|
304
307
|
}
|
|
305
308
|
trapKeyboardFocus(ev, doc) {
|
|
@@ -662,14 +665,14 @@ const Menu = /*@__PURE__*/ proxyCustomElement(class Menu extends HTMLElement {
|
|
|
662
665
|
* the ionBackButton listener in the menu controller
|
|
663
666
|
* will handle closing the menu when Escape is pressed.
|
|
664
667
|
*/
|
|
665
|
-
return (h(Host, { key: '
|
|
668
|
+
return (h(Host, { key: '70a427f3414a476414c3386efe6c8723fd37eccf', onKeyDown: shouldUseCloseWatcher() ? null : this.onKeydown, role: "navigation", "aria-label": inheritedAttributes['aria-label'] || 'menu', class: {
|
|
666
669
|
[mode]: true,
|
|
667
670
|
[`menu-type-${type}`]: true,
|
|
668
671
|
'menu-enabled': !disabled,
|
|
669
672
|
[`menu-side-${side}`]: true,
|
|
670
673
|
'menu-pane-visible': isPaneVisible,
|
|
671
674
|
'split-pane-side': hostContext('ion-split-pane', el),
|
|
672
|
-
} }, h("div", { key: '
|
|
675
|
+
} }, h("div", { key: '83af04e5a47d5a92caafaf06088a7114ae61984b', class: "menu-inner", part: "container", ref: (el) => (this.menuInnerEl = el) }, h("slot", { key: '7b35048642864bd0f30de9f6b61c949c1b601692' })), h("ion-backdrop", { key: '347af516c7970d80dd11c6d1ed61e9a040ceb5fb', ref: (el) => (this.backdropEl = el), class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
|
673
676
|
}
|
|
674
677
|
get el() { return this; }
|
|
675
678
|
static get watchers() { return {
|
|
@@ -40,10 +40,6 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
40
40
|
* is applied in both cases.
|
|
41
41
|
*/
|
|
42
42
|
this.hasFocus = false;
|
|
43
|
-
/**
|
|
44
|
-
* Track validation state for proper aria-live announcements
|
|
45
|
-
*/
|
|
46
|
-
this.isInvalid = false;
|
|
47
43
|
/**
|
|
48
44
|
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
|
49
45
|
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
|
@@ -133,19 +129,6 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
133
129
|
}
|
|
134
130
|
this.didTextareaClearOnEdit = false;
|
|
135
131
|
this.ionBlur.emit(ev);
|
|
136
|
-
/**
|
|
137
|
-
* Check validation state after blur to handle framework-managed classes.
|
|
138
|
-
* Frameworks like Angular update classes asynchronously, often using
|
|
139
|
-
* requestAnimationFrame or promises. Using setTimeout ensures we check
|
|
140
|
-
* after all microtasks and animation frames have completed.
|
|
141
|
-
*/
|
|
142
|
-
setTimeout(() => {
|
|
143
|
-
const newIsInvalid = this.checkValidationState();
|
|
144
|
-
if (this.isInvalid !== newIsInvalid) {
|
|
145
|
-
this.isInvalid = newIsInvalid;
|
|
146
|
-
forceUpdate(this);
|
|
147
|
-
}
|
|
148
|
-
}, 100);
|
|
149
132
|
};
|
|
150
133
|
this.onKeyDown = (ev) => {
|
|
151
134
|
this.checkClearOnEdit(ev);
|
|
@@ -203,42 +186,10 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
203
186
|
this.el.click();
|
|
204
187
|
}
|
|
205
188
|
}
|
|
206
|
-
/**
|
|
207
|
-
* Checks if the textarea is in an invalid state based on validation classes
|
|
208
|
-
*/
|
|
209
|
-
checkValidationState() {
|
|
210
|
-
// Check for both Ionic and Angular validation classes on the element itself
|
|
211
|
-
// Angular applies ng-touched/ng-invalid directly to the host element with ngModel
|
|
212
|
-
const hasIonTouched = this.el.classList.contains('ion-touched');
|
|
213
|
-
const hasIonInvalid = this.el.classList.contains('ion-invalid');
|
|
214
|
-
const hasNgTouched = this.el.classList.contains('ng-touched');
|
|
215
|
-
const hasNgInvalid = this.el.classList.contains('ng-invalid');
|
|
216
|
-
// Return true if we have both touched and invalid states from either framework
|
|
217
|
-
const isTouched = hasIonTouched || hasNgTouched;
|
|
218
|
-
const isInvalid = hasIonInvalid || hasNgInvalid;
|
|
219
|
-
return isTouched && isInvalid;
|
|
220
|
-
}
|
|
221
189
|
connectedCallback() {
|
|
222
190
|
const { el } = this;
|
|
223
191
|
this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => forceUpdate(this));
|
|
224
192
|
this.notchController = createNotchController(el, () => this.notchSpacerEl, () => this.labelSlot);
|
|
225
|
-
// Watch for class changes to update validation state
|
|
226
|
-
if (Build.isBrowser && typeof MutationObserver !== 'undefined') {
|
|
227
|
-
this.validationObserver = new MutationObserver(() => {
|
|
228
|
-
const newIsInvalid = this.checkValidationState();
|
|
229
|
-
if (this.isInvalid !== newIsInvalid) {
|
|
230
|
-
this.isInvalid = newIsInvalid;
|
|
231
|
-
// Force a re-render to update aria-describedby immediately
|
|
232
|
-
forceUpdate(this);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
this.validationObserver.observe(el, {
|
|
236
|
-
attributes: true,
|
|
237
|
-
attributeFilter: ['class'],
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
// Always set initial state
|
|
241
|
-
this.isInvalid = this.checkValidationState();
|
|
242
193
|
this.debounceChanged();
|
|
243
194
|
if (Build.isBrowser) {
|
|
244
195
|
document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
|
|
@@ -260,11 +211,6 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
260
211
|
this.notchController.destroy();
|
|
261
212
|
this.notchController = undefined;
|
|
262
213
|
}
|
|
263
|
-
// Clean up validation observer to prevent memory leaks
|
|
264
|
-
if (this.validationObserver) {
|
|
265
|
-
this.validationObserver.disconnect();
|
|
266
|
-
this.validationObserver = undefined;
|
|
267
|
-
}
|
|
268
214
|
}
|
|
269
215
|
componentWillLoad() {
|
|
270
216
|
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes(this.el, ['data-form-type', 'title', 'tabindex', 'dir']));
|
|
@@ -435,15 +381,15 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
435
381
|
* Renders the helper text or error text values
|
|
436
382
|
*/
|
|
437
383
|
renderHintText() {
|
|
438
|
-
const { helperText, errorText, helperTextId, errorTextId
|
|
384
|
+
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
439
385
|
return [
|
|
440
|
-
|
|
441
|
-
|
|
386
|
+
h("div", { id: helperTextId, class: "helper-text" }, helperText),
|
|
387
|
+
h("div", { id: errorTextId, class: "error-text" }, errorText),
|
|
442
388
|
];
|
|
443
389
|
}
|
|
444
390
|
getHintTextID() {
|
|
445
|
-
const {
|
|
446
|
-
if (
|
|
391
|
+
const { el, helperText, errorText, helperTextId, errorTextId } = this;
|
|
392
|
+
if (el.classList.contains('ion-touched') && el.classList.contains('ion-invalid') && errorText) {
|
|
447
393
|
return errorTextId;
|
|
448
394
|
}
|
|
449
395
|
if (helperText) {
|
|
@@ -502,7 +448,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
502
448
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
503
449
|
*/
|
|
504
450
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
505
|
-
return (h(Host, { key: '
|
|
451
|
+
return (h(Host, { key: 'd9f2ede0107987fc42c99e310cd2336bad5a5755', class: createColorClasses(this.color, {
|
|
506
452
|
[mode]: true,
|
|
507
453
|
'has-value': hasValue,
|
|
508
454
|
'has-focus': hasFocus,
|
|
@@ -511,7 +457,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
511
457
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
512
458
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
513
459
|
'textarea-disabled': disabled,
|
|
514
|
-
}) }, h("label", { key: '
|
|
460
|
+
}) }, h("label", { key: '9de598b95237462bb3bccffaefe83afbb43554b8', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: 'e33c426c6541d723ccc246bb404c03687726ff83', class: "textarea-wrapper-inner" }, h("div", { key: '521e11af9d54d281b0a2b1c25bcfc6f742c18296', class: "start-slot-wrapper" }, h("slot", { key: '515523f6ca3ce0e5dd08f3275c21a190fb1ca177', name: "start" })), h("div", { key: '916e01e00de8400ae00ef06bc1fb62d8be2eee08', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ key: '810271e6532d90e27dab1fcb26546113c1ce9cb0', 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: '80aca9ea9546dca9d38efd291a6b0be384bb6978', class: "end-slot-wrapper" }, h("slot", { key: '407fab16c66a9f4a542369bfecc0d9afa0065977', name: "end" }))), shouldRenderHighlight && h("div", { key: 'f00523a6698fac8a1996e04303487bef01d10f25', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
515
461
|
}
|
|
516
462
|
get el() { return this; }
|
|
517
463
|
static get watchers() { return {
|
|
@@ -553,7 +499,6 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
553
499
|
"labelPlacement": [1, "label-placement"],
|
|
554
500
|
"shape": [1],
|
|
555
501
|
"hasFocus": [32],
|
|
556
|
-
"isInvalid": [32],
|
|
557
502
|
"setFocus": [64],
|
|
558
503
|
"getInputElement": [64]
|
|
559
504
|
}, [[2, "click", "onClickCapture"]], {
|
package/components/overlays.js
CHANGED
|
@@ -5,7 +5,7 @@ import { d as doc } from './index9.js';
|
|
|
5
5
|
import { h as focusVisibleElement, c as componentOnReady, a as addEventListener, b as removeEventListener, g as getElementRoot } from './helpers.js';
|
|
6
6
|
import { OVERLAY_BACK_BUTTON_PRIORITY, shouldUseCloseWatcher } from './hardware-back-button.js';
|
|
7
7
|
import { c as config, a as printIonError, p as printIonWarning } from './index4.js';
|
|
8
|
-
import { b as getIonMode
|
|
8
|
+
import { b as getIonMode } from './ionic-global.js';
|
|
9
9
|
import { C as CoreDelegate } from './framework-delegate.js';
|
|
10
10
|
import { B as BACKDROP_NO_SCROLL } from './gesture-controller.js';
|
|
11
11
|
|
|
@@ -490,15 +490,17 @@ const getPresentedOverlay = (doc, overlayTag, id) => {
|
|
|
490
490
|
*/
|
|
491
491
|
const setRootAriaHidden = (hidden = false) => {
|
|
492
492
|
const root = getAppRoot(document);
|
|
493
|
-
const viewContainer = root.querySelector('ion-router-outlet,
|
|
493
|
+
const viewContainer = root.querySelector('ion-router-outlet, #ion-view-container-root');
|
|
494
494
|
if (!viewContainer) {
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
if (hidden) {
|
|
498
498
|
viewContainer.setAttribute('aria-hidden', 'true');
|
|
499
|
+
viewContainer.setAttribute('inert', '');
|
|
499
500
|
}
|
|
500
501
|
else {
|
|
501
502
|
viewContainer.removeAttribute('aria-hidden');
|
|
503
|
+
viewContainer.removeAttribute('inert');
|
|
502
504
|
}
|
|
503
505
|
};
|
|
504
506
|
const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
|
|
@@ -506,6 +508,17 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
506
508
|
if (overlay.presented) {
|
|
507
509
|
return;
|
|
508
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* When an overlay that steals focus
|
|
513
|
+
* is dismissed, focus should be returned
|
|
514
|
+
* to the element that was focused
|
|
515
|
+
* prior to the overlay opening. Toast
|
|
516
|
+
* does not steal focus and is excluded
|
|
517
|
+
* from returning focus as a result.
|
|
518
|
+
*/
|
|
519
|
+
if (overlay.el.tagName !== 'ION-TOAST') {
|
|
520
|
+
restoreElementFocus(overlay.el);
|
|
521
|
+
}
|
|
509
522
|
/**
|
|
510
523
|
* Due to accessibility guidelines, toasts do not have
|
|
511
524
|
* focus traps.
|
|
@@ -517,8 +530,6 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
517
530
|
setRootAriaHidden(true);
|
|
518
531
|
document.body.classList.add(BACKDROP_NO_SCROLL);
|
|
519
532
|
}
|
|
520
|
-
hideUnderlyingOverlaysFromScreenReaders(overlay.el);
|
|
521
|
-
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
522
533
|
overlay.presented = true;
|
|
523
534
|
overlay.willPresent.emit();
|
|
524
535
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -532,17 +543,6 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
532
543
|
overlay.didPresent.emit();
|
|
533
544
|
(_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();
|
|
534
545
|
}
|
|
535
|
-
/**
|
|
536
|
-
* When an overlay that steals focus
|
|
537
|
-
* is dismissed, focus should be returned
|
|
538
|
-
* to the element that was focused
|
|
539
|
-
* prior to the overlay opening. Toast
|
|
540
|
-
* does not steal focus and is excluded
|
|
541
|
-
* from returning focus as a result.
|
|
542
|
-
*/
|
|
543
|
-
if (overlay.el.tagName !== 'ION-TOAST') {
|
|
544
|
-
restoreElementFocus(overlay.el);
|
|
545
|
-
}
|
|
546
546
|
/**
|
|
547
547
|
* If the focused element is already
|
|
548
548
|
* inside the overlay component then
|
|
@@ -565,6 +565,7 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
565
565
|
* screen readers.
|
|
566
566
|
*/
|
|
567
567
|
overlay.el.removeAttribute('aria-hidden');
|
|
568
|
+
overlay.el.removeAttribute('inert');
|
|
568
569
|
};
|
|
569
570
|
/**
|
|
570
571
|
* When an overlay component is dismissed,
|
|
@@ -581,6 +582,8 @@ const restoreElementFocus = async (overlayEl) => {
|
|
|
581
582
|
if (!previousElement) {
|
|
582
583
|
return;
|
|
583
584
|
}
|
|
585
|
+
// Ensure active element is blurred to prevent a11y warning issues
|
|
586
|
+
previousElement.blur();
|
|
584
587
|
const shadowRoot = previousElement === null || previousElement === void 0 ? void 0 : previousElement.shadowRoot;
|
|
585
588
|
if (shadowRoot) {
|
|
586
589
|
// If there are no inner focusable elements, just focus the host element.
|
|
@@ -644,12 +647,6 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
644
647
|
}
|
|
645
648
|
overlay.presented = false;
|
|
646
649
|
try {
|
|
647
|
-
/**
|
|
648
|
-
* There is no need to show the overlay to screen readers during
|
|
649
|
-
* the dismiss animation. This is because the overlay will be removed
|
|
650
|
-
* from the DOM after the animation is complete.
|
|
651
|
-
*/
|
|
652
|
-
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
653
650
|
// Overlay contents should not be clickable during dismiss
|
|
654
651
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
655
652
|
overlay.willDismiss.emit({ data, role });
|
|
@@ -688,7 +685,6 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
688
685
|
printIonError(`[${overlay.el.tagName.toLowerCase()}] - `, err);
|
|
689
686
|
}
|
|
690
687
|
overlay.el.remove();
|
|
691
|
-
revealOverlaysToScreenReaders();
|
|
692
688
|
return true;
|
|
693
689
|
};
|
|
694
690
|
const getAppRoot = (doc) => {
|
|
@@ -884,93 +880,6 @@ const createTriggerController = () => {
|
|
|
884
880
|
removeClickListener,
|
|
885
881
|
};
|
|
886
882
|
};
|
|
887
|
-
/**
|
|
888
|
-
* The overlay that is being animated also needs to hide from screen
|
|
889
|
-
* readers during its animation. This ensures that assistive technologies
|
|
890
|
-
* like TalkBack do not announce or interact with the content until the
|
|
891
|
-
* animation is complete, avoiding confusion for users.
|
|
892
|
-
*
|
|
893
|
-
* When the overlay is presented on an Android device, TalkBack's focus rings
|
|
894
|
-
* may appear in the wrong position due to the transition (specifically
|
|
895
|
-
* `transform` styles). This occurs because the focus rings are initially
|
|
896
|
-
* displayed at the starting position of the elements before the transition
|
|
897
|
-
* begins. This workaround ensures the focus rings do not appear in the
|
|
898
|
-
* incorrect location.
|
|
899
|
-
*
|
|
900
|
-
* If this solution is applied to iOS devices, then it leads to a bug where
|
|
901
|
-
* the overlays cannot be accessed by screen readers. This is due to
|
|
902
|
-
* VoiceOver not being able to update the accessibility tree when the
|
|
903
|
-
* `aria-hidden` is removed.
|
|
904
|
-
*
|
|
905
|
-
* @param overlay - The overlay that is being animated.
|
|
906
|
-
*/
|
|
907
|
-
const hideAnimatingOverlayFromScreenReaders = (overlay) => {
|
|
908
|
-
if (doc === undefined)
|
|
909
|
-
return;
|
|
910
|
-
if (isPlatform('android')) {
|
|
911
|
-
/**
|
|
912
|
-
* Once the animation is complete, this attribute will be removed.
|
|
913
|
-
* This is done at the end of the `present` method.
|
|
914
|
-
*/
|
|
915
|
-
overlay.setAttribute('aria-hidden', 'true');
|
|
916
|
-
}
|
|
917
|
-
};
|
|
918
|
-
/**
|
|
919
|
-
* Ensure that underlying overlays have aria-hidden if necessary so that screen readers
|
|
920
|
-
* cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
|
|
921
|
-
* events here because those events do not fire when the screen readers moves to a non-focusable
|
|
922
|
-
* element such as text.
|
|
923
|
-
* Without this logic screen readers would be able to move focus outside of the top focus-trapped overlay.
|
|
924
|
-
*
|
|
925
|
-
* @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
|
|
926
|
-
* fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
|
|
927
|
-
*/
|
|
928
|
-
const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
|
|
929
|
-
var _a;
|
|
930
|
-
if (doc === undefined)
|
|
931
|
-
return;
|
|
932
|
-
const overlays = getPresentedOverlays(doc);
|
|
933
|
-
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
934
|
-
const presentedOverlay = overlays[i];
|
|
935
|
-
const nextPresentedOverlay = (_a = overlays[i + 1]) !== null && _a !== void 0 ? _a : newTopMostOverlay;
|
|
936
|
-
/**
|
|
937
|
-
* If next overlay has aria-hidden then all remaining overlays will have it too.
|
|
938
|
-
* Or, if the next overlay is a Toast that does not have aria-hidden then current overlay
|
|
939
|
-
* should not have aria-hidden either so focus can remain in the current overlay.
|
|
940
|
-
*/
|
|
941
|
-
if (nextPresentedOverlay.hasAttribute('aria-hidden') || nextPresentedOverlay.tagName !== 'ION-TOAST') {
|
|
942
|
-
presentedOverlay.setAttribute('aria-hidden', 'true');
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
/**
|
|
947
|
-
* When dismissing an overlay we need to reveal the new top-most overlay to screen readers.
|
|
948
|
-
* If the top-most overlay is a Toast we potentially need to reveal more overlays since
|
|
949
|
-
* focus is never automatically moved to the Toast.
|
|
950
|
-
*/
|
|
951
|
-
const revealOverlaysToScreenReaders = () => {
|
|
952
|
-
if (doc === undefined)
|
|
953
|
-
return;
|
|
954
|
-
const overlays = getPresentedOverlays(doc);
|
|
955
|
-
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
956
|
-
const currentOverlay = overlays[i];
|
|
957
|
-
/**
|
|
958
|
-
* If the current we are looking at is a Toast then we can remove aria-hidden.
|
|
959
|
-
* However, we potentially need to keep looking at the overlay stack because there
|
|
960
|
-
* could be more Toasts underneath. Additionally, we need to unhide the closest non-Toast
|
|
961
|
-
* overlay too so focus can move there since focus is never automatically moved to the Toast.
|
|
962
|
-
*/
|
|
963
|
-
currentOverlay.removeAttribute('aria-hidden');
|
|
964
|
-
/**
|
|
965
|
-
* If we found a non-Toast element then we can just remove aria-hidden and stop searching entirely
|
|
966
|
-
* since this overlay should always receive focus. As a result, all underlying overlays should still
|
|
967
|
-
* be hidden from screen readers.
|
|
968
|
-
*/
|
|
969
|
-
if (currentOverlay.tagName !== 'ION-TOAST') {
|
|
970
|
-
break;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
883
|
const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
|
|
975
884
|
|
|
976
885
|
export { BACKDROP as B, FOCUS_TRAP_DISABLE_CLASS as F, GESTURE as G, OVERLAY_GESTURE_PRIORITY as O, alertController as a, actionSheetController as b, popoverController as c, createDelegateController as d, createTriggerController as e, present as f, dismiss as g, eventMethod as h, isCancel as i, prepareOverlay as j, setOverlayId as k, loadingController as l, modalController as m, focusFirstDescendant as n, getPresentedOverlay as o, pickerController as p, focusLastDescendant as q, safeCall as s, toastController as t };
|
|
@@ -6,9 +6,9 @@ import { d as inheritAttributes } from './helpers.js';
|
|
|
6
6
|
import { c as createColorClasses } from './theme.js';
|
|
7
7
|
import { b as getIonMode } from './ionic-global.js';
|
|
8
8
|
|
|
9
|
-
const pickerColumnOptionIosCss = "button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}:host(.option-disabled){opacity:0.4}:host(.option-disabled) button{cursor:default}";
|
|
9
|
+
const pickerColumnOptionIosCss = ".picker-column-option-button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}:host(.option-disabled){opacity:0.4}:host(.option-disabled) .picker-column-option-button{cursor:default}";
|
|
10
10
|
|
|
11
|
-
const pickerColumnOptionMdCss = "button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}:host(.option-disabled){opacity:0.4}:host(.option-disabled) button{cursor:default}:host(.option-active){color:var(--ion-color-base)}";
|
|
11
|
+
const pickerColumnOptionMdCss = ".picker-column-option-button{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden}:host(.option-disabled){opacity:0.4}:host(.option-disabled) .picker-column-option-button{cursor:default}:host(.option-active){color:var(--ion-color-base)}";
|
|
12
12
|
|
|
13
13
|
const PickerColumnOption = /*@__PURE__*/ proxyCustomElement(class PickerColumnOption extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
@@ -102,7 +102,7 @@ const PickerColumnOption = /*@__PURE__*/ proxyCustomElement(class PickerColumnOp
|
|
|
102
102
|
return (h(Host, { key: 'f816729941aabcb31ddfdce3ffe2e2139030d715', class: createColorClasses(color, {
|
|
103
103
|
[mode]: true,
|
|
104
104
|
['option-disabled']: disabled,
|
|
105
|
-
}) }, h("
|
|
105
|
+
}) }, h("div", { key: 'd942de84fd14d7dc06b1e5cf4f7920d1dc3c6371', class: 'picker-column-option-button', role: "button", "aria-label": ariaLabel, onClick: () => this.onClick() }, h("slot", { key: 'b0df5717b42209e649097209a01476e1a66f5c5c' }))));
|
|
106
106
|
}
|
|
107
107
|
get el() { return this; }
|
|
108
108
|
static get watchers() { return {
|
|
@@ -409,23 +409,6 @@ const PickerColumn = /*@__PURE__*/ proxyCustomElement(class PickerColumn extends
|
|
|
409
409
|
var _a;
|
|
410
410
|
return el ? (_a = el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : el.innerText : '';
|
|
411
411
|
};
|
|
412
|
-
/**
|
|
413
|
-
* Render an element that overlays the column. This element is for assistive
|
|
414
|
-
* tech to allow users to navigate the column up/down. This element should receive
|
|
415
|
-
* focus as it listens for synthesized keyboard events as required by the
|
|
416
|
-
* slider role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role
|
|
417
|
-
*/
|
|
418
|
-
this.renderAssistiveFocusable = () => {
|
|
419
|
-
const { activeItem } = this;
|
|
420
|
-
const valueText = this.getOptionValueText(activeItem);
|
|
421
|
-
/**
|
|
422
|
-
* When using the picker, the valuetext provides important context that valuenow
|
|
423
|
-
* does not. Additionally, using non-zero valuemin/valuemax values can cause
|
|
424
|
-
* WebKit to incorrectly announce numeric valuetext values (such as a year
|
|
425
|
-
* like "2024") as percentages: https://bugs.webkit.org/show_bug.cgi?id=273126
|
|
426
|
-
*/
|
|
427
|
-
return (h("div", { ref: (el) => (this.assistiveFocusable = el), class: "assistive-focusable", role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": valueText, "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }));
|
|
428
|
-
};
|
|
429
412
|
}
|
|
430
413
|
ariaLabelChanged(newValue) {
|
|
431
414
|
this.ariaLabel = newValue;
|
|
@@ -566,33 +549,14 @@ const PickerColumn = /*@__PURE__*/ proxyCustomElement(class PickerColumn extends
|
|
|
566
549
|
render() {
|
|
567
550
|
const { color, disabled, isActive, numericInput } = this;
|
|
568
551
|
const mode = getIonMode(this);
|
|
569
|
-
return (h(Host, { key: '
|
|
552
|
+
return (h(Host, { key: 'db903fd415f8a2d91994dececca481c1af8ba6a9', class: createColorClasses(color, {
|
|
570
553
|
[mode]: true,
|
|
571
554
|
['picker-column-active']: isActive,
|
|
572
555
|
['picker-column-numeric-input']: numericInput,
|
|
573
556
|
['picker-column-disabled']: disabled,
|
|
574
|
-
}) },
|
|
557
|
+
}) }, h("slot", { key: '02ce9e1dd7df91afcd50b06416552bcffb5dec98', name: "prefix" }), h("div", { key: '6dfd7d2429bec19244a6b1afb4448121963a031b', class: "picker-opts", ref: (el) => {
|
|
575
558
|
this.scrollEl = el;
|
|
576
|
-
},
|
|
577
|
-
/**
|
|
578
|
-
* When an element has an overlay scroll style and
|
|
579
|
-
* a fixed height, Firefox will focus the scrollable
|
|
580
|
-
* container if the content exceeds the container's
|
|
581
|
-
* dimensions.
|
|
582
|
-
*
|
|
583
|
-
* This causes keyboard navigation to focus to this
|
|
584
|
-
* element instead of going to the next element in
|
|
585
|
-
* the tab order.
|
|
586
|
-
*
|
|
587
|
-
* The desired behavior is for the user to be able to
|
|
588
|
-
* focus the assistive focusable element and tab to
|
|
589
|
-
* the next element in the tab order. Instead of tabbing
|
|
590
|
-
* to this element.
|
|
591
|
-
*
|
|
592
|
-
* To prevent this, we set the tabIndex to -1. This
|
|
593
|
-
* will match the behavior of the other browsers.
|
|
594
|
-
*/
|
|
595
|
-
tabIndex: -1 }, h("div", { key: '13a9ee686132af32240710730765de4c0003a9e8', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: 'dbccba4920833cfcebe9b0fc763458ec3053705a', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '682b43f83a5ea2e46067457f3af118535e111edb', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("slot", { key: 'd27e1e1dc0504b2f4627a29912a05bb91e8e413a' }), h("div", { key: '61c948dbb9cf7469aed3018542bc0954211585ba', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: 'cf46c277fbee65e35ff44ce0d53ce12aa9cbf9db', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: 'bbc0e2d491d3f836ab849493ade2f7fa6ad9244e', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), h("slot", { key: 'd25cbbe14b2914fe7b878d43b4e3f4a8c8177d24', name: "suffix" })));
|
|
559
|
+
}, role: "slider", tabindex: this.disabled ? undefined : 0, "aria-label": this.ariaLabel, "aria-valuemin": 0, "aria-valuemax": 0, "aria-valuenow": 0, "aria-valuetext": this.getOptionValueText(this.activeItem), "aria-orientation": "vertical", onKeyDown: (ev) => this.onKeyDown(ev) }, h("div", { key: 'e30ce0b9cefbfe4d4441fa33acf595da31855c3f', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '8be2bd293c12c6ba720d9b31d0d561a96f42e97d', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '8afdcddddabbf646fbb55cb0ba4448309a2c1dd9', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("slot", { key: '6aa0dacc34d6848575ad5b122b9046982308ca43' }), h("div", { key: '92ec8a357414c1b779b11d1dd18fb87a7ee63982', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: 'b89457cb74b5907c25594ff6720ac54ca537e933', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), h("div", { key: '5bbc92e6bc24de08e39873bf08c5b668373ac0f8', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), h("slot", { key: 'd7bf2b519214f0f3576a4ca79844ad97827dd97f', name: "suffix" })));
|
|
596
560
|
}
|
|
597
561
|
get el() { return this; }
|
|
598
562
|
static get watchers() { return {
|