@ionic/core 8.7.3-dev.11755006024.11261c64 → 8.7.3-dev.11755195979.1ec83531
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 +3 -4
- package/components/ion-input.js +38 -7
- package/components/ion-textarea.js +37 -6
- package/components/overlays.js +97 -1
- package/components/picker-column-option.js +3 -3
- package/components/picker-column.js +39 -3
- 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 +37 -7
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- 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 +39 -3
- 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 +36 -6
- 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-DsQx1liJ.js → overlays-CglR7j-u.js} +96 -0
- package/dist/collection/components/datetime/datetime.js +3 -4
- package/dist/collection/components/input/input.js +39 -8
- package/dist/collection/components/picker-column/picker-column.js +39 -3
- 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 +38 -7
- package/dist/collection/utils/overlays.js +97 -0
- package/dist/docs.json +1 -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 +37 -7
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- 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 +39 -3
- 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 +36 -6
- 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-NqBaHPvD.js → overlays-ZX_4-t_r.js} +97 -1
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-1d5b934a.entry.js +4 -0
- package/dist/ionic/p-29032e49.entry.js +4 -0
- package/dist/ionic/p-44415a3b.entry.js +4 -0
- package/dist/ionic/{p-abdfa903.entry.js → p-7bac2c5f.entry.js} +1 -1
- package/dist/ionic/{p-6979d2fe.entry.js → p-8d96a0cd.entry.js} +1 -1
- package/dist/ionic/{p-ea415755.entry.js → p-91d6ccb0.entry.js} +1 -1
- package/dist/ionic/{p-25f16425.entry.js → p-92e8f208.entry.js} +1 -1
- package/dist/ionic/{p-4be3f593.entry.js → p-982fe1c4.entry.js} +1 -1
- package/dist/ionic/p-CSwZyt05.js +4 -0
- package/dist/ionic/{p-bbea41a8.entry.js → p-ab33ef20.entry.js} +1 -1
- package/dist/ionic/{p-82f92e81.entry.js → p-ac434970.entry.js} +1 -1
- package/dist/ionic/{p-cb155366.entry.js → p-c575e7ce.entry.js} +1 -1
- package/dist/ionic/{p-2b9eb6e6.entry.js → p-f2884bc2.entry.js} +1 -1
- package/dist/ionic/p-f456d176.entry.js +4 -0
- package/dist/ionic/p-f80f7416.entry.js +4 -0
- package/dist/types/components/input/input.d.ts +9 -0
- package/dist/types/components/picker-column/picker-column.d.ts +7 -0
- package/dist/types/components/textarea/textarea.d.ts +9 -0
- package/hydrate/index.js +186 -22
- package/hydrate/index.mjs +186 -22
- package/package.json +1 -1
- package/dist/ionic/p-1488b7cc.entry.js +0 -4
- package/dist/ionic/p-61646e84.entry.js +0 -4
- package/dist/ionic/p-8888efe4.entry.js +0 -4
- package/dist/ionic/p-Dks1yZU6.js +0 -4
- package/dist/ionic/p-b292804d.entry.js +0 -4
- package/dist/ionic/p-c5210d3e.entry.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -6188,6 +6188,8 @@ const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts)
|
|
|
6188
6188
|
setRootAriaHidden(true);
|
|
6189
6189
|
document.body.classList.add(BACKDROP_NO_SCROLL);
|
|
6190
6190
|
}
|
|
6191
|
+
hideUnderlyingOverlaysFromScreenReaders(overlay.el);
|
|
6192
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6191
6193
|
overlay.presented = true;
|
|
6192
6194
|
overlay.willPresent.emit();
|
|
6193
6195
|
(_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();
|
|
@@ -6313,6 +6315,12 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6313
6315
|
}
|
|
6314
6316
|
overlay.presented = false;
|
|
6315
6317
|
try {
|
|
6318
|
+
/**
|
|
6319
|
+
* There is no need to show the overlay to screen readers during
|
|
6320
|
+
* the dismiss animation. This is because the overlay will be removed
|
|
6321
|
+
* from the DOM after the animation is complete.
|
|
6322
|
+
*/
|
|
6323
|
+
hideAnimatingOverlayFromScreenReaders(overlay.el);
|
|
6316
6324
|
// Overlay contents should not be clickable during dismiss
|
|
6317
6325
|
overlay.el.style.setProperty('pointer-events', 'none');
|
|
6318
6326
|
overlay.willDismiss.emit({ data, role });
|
|
@@ -6351,6 +6359,7 @@ const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnim
|
|
|
6351
6359
|
printIonError(`[${overlay.el.tagName.toLowerCase()}] - `, err);
|
|
6352
6360
|
}
|
|
6353
6361
|
overlay.el.remove();
|
|
6362
|
+
revealOverlaysToScreenReaders();
|
|
6354
6363
|
return true;
|
|
6355
6364
|
};
|
|
6356
6365
|
const getAppRoot = (doc) => {
|
|
@@ -6546,6 +6555,93 @@ const createTriggerController = () => {
|
|
|
6546
6555
|
removeClickListener,
|
|
6547
6556
|
};
|
|
6548
6557
|
};
|
|
6558
|
+
/**
|
|
6559
|
+
* The overlay that is being animated also needs to hide from screen
|
|
6560
|
+
* readers during its animation. This ensures that assistive technologies
|
|
6561
|
+
* like TalkBack do not announce or interact with the content until the
|
|
6562
|
+
* animation is complete, avoiding confusion for users.
|
|
6563
|
+
*
|
|
6564
|
+
* When the overlay is presented on an Android device, TalkBack's focus rings
|
|
6565
|
+
* may appear in the wrong position due to the transition (specifically
|
|
6566
|
+
* `transform` styles). This occurs because the focus rings are initially
|
|
6567
|
+
* displayed at the starting position of the elements before the transition
|
|
6568
|
+
* begins. This workaround ensures the focus rings do not appear in the
|
|
6569
|
+
* incorrect location.
|
|
6570
|
+
*
|
|
6571
|
+
* If this solution is applied to iOS devices, then it leads to a bug where
|
|
6572
|
+
* the overlays cannot be accessed by screen readers. This is due to
|
|
6573
|
+
* VoiceOver not being able to update the accessibility tree when the
|
|
6574
|
+
* `aria-hidden` is removed.
|
|
6575
|
+
*
|
|
6576
|
+
* @param overlay - The overlay that is being animated.
|
|
6577
|
+
*/
|
|
6578
|
+
const hideAnimatingOverlayFromScreenReaders = (overlay) => {
|
|
6579
|
+
if (doc === undefined)
|
|
6580
|
+
return;
|
|
6581
|
+
if (isPlatform('android')) {
|
|
6582
|
+
/**
|
|
6583
|
+
* Once the animation is complete, this attribute will be removed.
|
|
6584
|
+
* This is done at the end of the `present` method.
|
|
6585
|
+
*/
|
|
6586
|
+
overlay.setAttribute('aria-hidden', 'true');
|
|
6587
|
+
}
|
|
6588
|
+
};
|
|
6589
|
+
/**
|
|
6590
|
+
* Ensure that underlying overlays have aria-hidden if necessary so that screen readers
|
|
6591
|
+
* cannot move focus to these elements. Note that we cannot rely on focus/focusin/focusout
|
|
6592
|
+
* events here because those events do not fire when the screen readers moves to a non-focusable
|
|
6593
|
+
* element such as text.
|
|
6594
|
+
* Without this logic screen readers would be able to move focus outside of the top focus-trapped overlay.
|
|
6595
|
+
*
|
|
6596
|
+
* @param newTopMostOverlay - The overlay that is being presented. Since the overlay has not been
|
|
6597
|
+
* fully presented yet at the time this function is called it will not be included in the getPresentedOverlays result.
|
|
6598
|
+
*/
|
|
6599
|
+
const hideUnderlyingOverlaysFromScreenReaders = (newTopMostOverlay) => {
|
|
6600
|
+
var _a;
|
|
6601
|
+
if (doc === undefined)
|
|
6602
|
+
return;
|
|
6603
|
+
const overlays = getPresentedOverlays(doc);
|
|
6604
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6605
|
+
const presentedOverlay = overlays[i];
|
|
6606
|
+
const nextPresentedOverlay = (_a = overlays[i + 1]) !== null && _a !== void 0 ? _a : newTopMostOverlay;
|
|
6607
|
+
/**
|
|
6608
|
+
* If next overlay has aria-hidden then all remaining overlays will have it too.
|
|
6609
|
+
* Or, if the next overlay is a Toast that does not have aria-hidden then current overlay
|
|
6610
|
+
* should not have aria-hidden either so focus can remain in the current overlay.
|
|
6611
|
+
*/
|
|
6612
|
+
if (nextPresentedOverlay.hasAttribute('aria-hidden') || nextPresentedOverlay.tagName !== 'ION-TOAST') {
|
|
6613
|
+
presentedOverlay.setAttribute('aria-hidden', 'true');
|
|
6614
|
+
}
|
|
6615
|
+
}
|
|
6616
|
+
};
|
|
6617
|
+
/**
|
|
6618
|
+
* When dismissing an overlay we need to reveal the new top-most overlay to screen readers.
|
|
6619
|
+
* If the top-most overlay is a Toast we potentially need to reveal more overlays since
|
|
6620
|
+
* focus is never automatically moved to the Toast.
|
|
6621
|
+
*/
|
|
6622
|
+
const revealOverlaysToScreenReaders = () => {
|
|
6623
|
+
if (doc === undefined)
|
|
6624
|
+
return;
|
|
6625
|
+
const overlays = getPresentedOverlays(doc);
|
|
6626
|
+
for (let i = overlays.length - 1; i >= 0; i--) {
|
|
6627
|
+
const currentOverlay = overlays[i];
|
|
6628
|
+
/**
|
|
6629
|
+
* If the current we are looking at is a Toast then we can remove aria-hidden.
|
|
6630
|
+
* However, we potentially need to keep looking at the overlay stack because there
|
|
6631
|
+
* could be more Toasts underneath. Additionally, we need to unhide the closest non-Toast
|
|
6632
|
+
* overlay too so focus can move there since focus is never automatically moved to the Toast.
|
|
6633
|
+
*/
|
|
6634
|
+
currentOverlay.removeAttribute('aria-hidden');
|
|
6635
|
+
/**
|
|
6636
|
+
* If we found a non-Toast element then we can just remove aria-hidden and stop searching entirely
|
|
6637
|
+
* since this overlay should always receive focus. As a result, all underlying overlays should still
|
|
6638
|
+
* be hidden from screen readers.
|
|
6639
|
+
*/
|
|
6640
|
+
if (currentOverlay.tagName !== 'ION-TOAST') {
|
|
6641
|
+
break;
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
6644
|
+
};
|
|
6549
6645
|
const FOCUS_TRAP_DISABLE_CLASS = 'ion-disable-focus-trap';
|
|
6550
6646
|
|
|
6551
6647
|
const hostContext = (selector, el) => {
|
|
@@ -13435,7 +13531,7 @@ class Datetime {
|
|
|
13435
13531
|
const renderArray = forcePresentation === 'time-date'
|
|
13436
13532
|
? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
|
|
13437
13533
|
: [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
|
|
13438
|
-
return hAsync("ion-picker",
|
|
13534
|
+
return hAsync("ion-picker", null, renderArray);
|
|
13439
13535
|
}
|
|
13440
13536
|
renderDatePickerColumns(forcePresentation) {
|
|
13441
13537
|
return forcePresentation === 'date-time' || forcePresentation === 'time-date'
|
|
@@ -13992,7 +14088,7 @@ class Datetime {
|
|
|
13992
14088
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
13993
14089
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
13994
14090
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
13995
|
-
return (hAsync(Host, { key: '
|
|
14091
|
+
return (hAsync(Host, { key: 'f35cf200ff05d33074576e3d2754d3b2a0735b96', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
|
|
13996
14092
|
[mode]: true,
|
|
13997
14093
|
['datetime-readonly']: readonly,
|
|
13998
14094
|
['datetime-disabled']: disabled,
|
|
@@ -14002,7 +14098,7 @@ class Datetime {
|
|
|
14002
14098
|
[`datetime-size-${size}`]: true,
|
|
14003
14099
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
14004
14100
|
[`datetime-grid`]: isGridStyle,
|
|
14005
|
-
})) }, hAsync("div", { key: '
|
|
14101
|
+
})) }, hAsync("div", { key: '859e9354a12bfa58ac3f964c2e66839f17071c00', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
14006
14102
|
}
|
|
14007
14103
|
get el() { return getElement(this); }
|
|
14008
14104
|
static get watchers() { return {
|
|
@@ -16533,6 +16629,10 @@ class Input {
|
|
|
16533
16629
|
* is applied in both cases.
|
|
16534
16630
|
*/
|
|
16535
16631
|
this.hasFocus = false;
|
|
16632
|
+
/**
|
|
16633
|
+
* Track validation state for proper aria-live announcements
|
|
16634
|
+
*/
|
|
16635
|
+
this.isInvalid = false;
|
|
16536
16636
|
/**
|
|
16537
16637
|
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
|
16538
16638
|
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
|
@@ -16716,6 +16816,12 @@ class Input {
|
|
|
16716
16816
|
componentWillLoad() {
|
|
16717
16817
|
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes$1(this.el, ['tabindex', 'title', 'data-form-type', 'dir']));
|
|
16718
16818
|
}
|
|
16819
|
+
/**
|
|
16820
|
+
* Checks if the input is in an invalid state based on validation classes
|
|
16821
|
+
*/
|
|
16822
|
+
checkValidationState() {
|
|
16823
|
+
return this.el.classList.contains('ion-touched') && this.el.classList.contains('ion-invalid');
|
|
16824
|
+
}
|
|
16719
16825
|
connectedCallback() {
|
|
16720
16826
|
const { el } = this;
|
|
16721
16827
|
this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => forceUpdate());
|
|
@@ -16746,6 +16852,11 @@ class Input {
|
|
|
16746
16852
|
this.notchController.destroy();
|
|
16747
16853
|
this.notchController = undefined;
|
|
16748
16854
|
}
|
|
16855
|
+
// Clean up validation observer to prevent memory leaks
|
|
16856
|
+
if (this.validationObserver) {
|
|
16857
|
+
this.validationObserver.disconnect();
|
|
16858
|
+
this.validationObserver = undefined;
|
|
16859
|
+
}
|
|
16749
16860
|
}
|
|
16750
16861
|
/**
|
|
16751
16862
|
* Sets focus on the native `input` in `ion-input`. Use this method instead of the global
|
|
@@ -16847,15 +16958,15 @@ class Input {
|
|
|
16847
16958
|
* Renders the helper text or error text values
|
|
16848
16959
|
*/
|
|
16849
16960
|
renderHintText() {
|
|
16850
|
-
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
16961
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
16851
16962
|
return [
|
|
16852
16963
|
hAsync("div", { id: helperTextId, class: "helper-text" }, helperText),
|
|
16853
|
-
hAsync("div", { id: errorTextId, class: "error-text" }, errorText),
|
|
16964
|
+
hAsync("div", { id: errorTextId, class: "error-text", role: isInvalid && errorText ? 'alert' : undefined, "aria-live": isInvalid && errorText ? 'polite' : 'off', "aria-atomic": "true" }, isInvalid && errorText ? errorText : ''),
|
|
16854
16965
|
];
|
|
16855
16966
|
}
|
|
16856
16967
|
getHintTextID() {
|
|
16857
|
-
const {
|
|
16858
|
-
if (
|
|
16968
|
+
const { isInvalid, helperText, errorText, helperTextId, errorTextId } = this;
|
|
16969
|
+
if (isInvalid && errorText) {
|
|
16859
16970
|
return errorTextId;
|
|
16860
16971
|
}
|
|
16861
16972
|
if (helperText) {
|
|
@@ -16968,7 +17079,7 @@ class Input {
|
|
|
16968
17079
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
16969
17080
|
*/
|
|
16970
17081
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
16971
|
-
return (hAsync(Host, { key: '
|
|
17082
|
+
return (hAsync(Host, { key: 'fcb5d96c872ce63cb6252b6d7d302ab30e6ea83b', class: createColorClasses$1(this.color, {
|
|
16972
17083
|
[mode]: true,
|
|
16973
17084
|
'has-value': hasValue,
|
|
16974
17085
|
'has-focus': hasFocus,
|
|
@@ -16979,14 +17090,14 @@ class Input {
|
|
|
16979
17090
|
'in-item': inItem,
|
|
16980
17091
|
'in-item-color': hostContext('ion-item.ion-color', this.el),
|
|
16981
17092
|
'input-disabled': disabled,
|
|
16982
|
-
}) }, hAsync("label", { key: '
|
|
17093
|
+
}) }, hAsync("label", { key: '73bcaaf2527cbf295283b4581046fb9b361ce2dd', class: "input-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), hAsync("div", { key: '22dd6c6623a284e6a51910fa47b0a2ebdbd5971d', class: "native-wrapper", onClick: this.onLabelClick }, hAsync("slot", { key: 'c02dac4336eb8e7570ed07cfa18fadca4bc6dd9d', name: "start" }), hAsync("input", Object.assign({ key: '42fc6409e9ee51feed480a672bf074cfa6f74c8f', 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 && (hAsync("button", { key: 'b124a2b970542daa6fcb45ac5546a9fde22b45be', "aria-label": "reset", type: "button", class: "input-clear-icon", onPointerDown: (ev) => {
|
|
16983
17094
|
/**
|
|
16984
17095
|
* This prevents mobile browsers from
|
|
16985
17096
|
* blurring the input when the clear
|
|
16986
17097
|
* button is activated.
|
|
16987
17098
|
*/
|
|
16988
17099
|
ev.preventDefault();
|
|
16989
|
-
}, onClick: this.clearTextInput }, hAsync("ion-icon", { key: '
|
|
17100
|
+
}, onClick: this.clearTextInput }, hAsync("ion-icon", { key: '243037c08825c2bf26c53bb9507f7cd73e56a4de', "aria-hidden": "true", icon: clearIconData }))), hAsync("slot", { key: '9faff25f968c089b7716a8afb405ba5afb86a1ac', name: "end" })), shouldRenderHighlight && hAsync("div", { key: '54bf3da059a2bf30e4990ba34abb23fd3bf137b0', class: "input-highlight" })), this.renderBottomContent()));
|
|
16990
17101
|
}
|
|
16991
17102
|
get el() { return getElement(this); }
|
|
16992
17103
|
static get watchers() { return {
|
|
@@ -17038,6 +17149,7 @@ class Input {
|
|
|
17038
17149
|
"type": [1],
|
|
17039
17150
|
"value": [1032],
|
|
17040
17151
|
"hasFocus": [32],
|
|
17152
|
+
"isInvalid": [32],
|
|
17041
17153
|
"setFocus": [64],
|
|
17042
17154
|
"getInputElement": [64]
|
|
17043
17155
|
},
|
|
@@ -25408,6 +25520,23 @@ class PickerColumn {
|
|
|
25408
25520
|
var _a;
|
|
25409
25521
|
return el ? (_a = el.getAttribute('aria-label')) !== null && _a !== void 0 ? _a : el.innerText : '';
|
|
25410
25522
|
};
|
|
25523
|
+
/**
|
|
25524
|
+
* Render an element that overlays the column. This element is for assistive
|
|
25525
|
+
* tech to allow users to navigate the column up/down. This element should receive
|
|
25526
|
+
* focus as it listens for synthesized keyboard events as required by the
|
|
25527
|
+
* slider role: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/slider_role
|
|
25528
|
+
*/
|
|
25529
|
+
this.renderAssistiveFocusable = () => {
|
|
25530
|
+
const { activeItem } = this;
|
|
25531
|
+
const valueText = this.getOptionValueText(activeItem);
|
|
25532
|
+
/**
|
|
25533
|
+
* When using the picker, the valuetext provides important context that valuenow
|
|
25534
|
+
* does not. Additionally, using non-zero valuemin/valuemax values can cause
|
|
25535
|
+
* WebKit to incorrectly announce numeric valuetext values (such as a year
|
|
25536
|
+
* like "2024") as percentages: https://bugs.webkit.org/show_bug.cgi?id=273126
|
|
25537
|
+
*/
|
|
25538
|
+
return (hAsync("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) }));
|
|
25539
|
+
};
|
|
25411
25540
|
}
|
|
25412
25541
|
ariaLabelChanged(newValue) {
|
|
25413
25542
|
this.ariaLabel = newValue;
|
|
@@ -25548,14 +25677,33 @@ class PickerColumn {
|
|
|
25548
25677
|
render() {
|
|
25549
25678
|
const { color, disabled, isActive, numericInput } = this;
|
|
25550
25679
|
const mode = getIonMode$1(this);
|
|
25551
|
-
return (hAsync(Host, { key: '
|
|
25680
|
+
return (hAsync(Host, { key: 'ea0280355b2f87895bf7dddd289ccf473aa759f3', class: createColorClasses$1(color, {
|
|
25552
25681
|
[mode]: true,
|
|
25553
25682
|
['picker-column-active']: isActive,
|
|
25554
25683
|
['picker-column-numeric-input']: numericInput,
|
|
25555
25684
|
['picker-column-disabled']: disabled,
|
|
25556
|
-
}) }, hAsync("slot", { key: '
|
|
25685
|
+
}) }, this.renderAssistiveFocusable(), hAsync("slot", { key: '482992131cdeb85b1f61430d7fe1322a16345769', name: "prefix" }), hAsync("div", { key: '43f7f80d621d411ef366b3ca1396299e8c9a0c97', "aria-hidden": "true", class: "picker-opts", ref: (el) => {
|
|
25557
25686
|
this.scrollEl = el;
|
|
25558
|
-
},
|
|
25687
|
+
},
|
|
25688
|
+
/**
|
|
25689
|
+
* When an element has an overlay scroll style and
|
|
25690
|
+
* a fixed height, Firefox will focus the scrollable
|
|
25691
|
+
* container if the content exceeds the container's
|
|
25692
|
+
* dimensions.
|
|
25693
|
+
*
|
|
25694
|
+
* This causes keyboard navigation to focus to this
|
|
25695
|
+
* element instead of going to the next element in
|
|
25696
|
+
* the tab order.
|
|
25697
|
+
*
|
|
25698
|
+
* The desired behavior is for the user to be able to
|
|
25699
|
+
* focus the assistive focusable element and tab to
|
|
25700
|
+
* the next element in the tab order. Instead of tabbing
|
|
25701
|
+
* to this element.
|
|
25702
|
+
*
|
|
25703
|
+
* To prevent this, we set the tabIndex to -1. This
|
|
25704
|
+
* will match the behavior of the other browsers.
|
|
25705
|
+
*/
|
|
25706
|
+
tabIndex: -1 }, hAsync("div", { key: '13a9ee686132af32240710730765de4c0003a9e8', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: 'dbccba4920833cfcebe9b0fc763458ec3053705a', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: '682b43f83a5ea2e46067457f3af118535e111edb', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("slot", { key: 'd27e1e1dc0504b2f4627a29912a05bb91e8e413a' }), hAsync("div", { key: '61c948dbb9cf7469aed3018542bc0954211585ba', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: 'cf46c277fbee65e35ff44ce0d53ce12aa9cbf9db', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: 'bbc0e2d491d3f836ab849493ade2f7fa6ad9244e', class: "picker-item-empty", "aria-hidden": "true" }, "\u00A0")), hAsync("slot", { key: 'd25cbbe14b2914fe7b878d43b4e3f4a8c8177d24', name: "suffix" })));
|
|
25559
25707
|
}
|
|
25560
25708
|
get el() { return getElement(this); }
|
|
25561
25709
|
static get watchers() { return {
|
|
@@ -25947,9 +26095,9 @@ const DECELERATION_FRICTION = 0.97;
|
|
|
25947
26095
|
const MAX_PICKER_SPEED = 90;
|
|
25948
26096
|
const TRANSITION_DURATION = 150;
|
|
25949
26097
|
|
|
25950
|
-
const pickerColumnOptionIosCss = "
|
|
26098
|
+
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}";
|
|
25951
26099
|
|
|
25952
|
-
const pickerColumnOptionMdCss = "
|
|
26100
|
+
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)}";
|
|
25953
26101
|
|
|
25954
26102
|
class PickerColumnOption {
|
|
25955
26103
|
constructor(hostRef) {
|
|
@@ -26041,7 +26189,7 @@ class PickerColumnOption {
|
|
|
26041
26189
|
return (hAsync(Host, { key: 'f816729941aabcb31ddfdce3ffe2e2139030d715', class: createColorClasses$1(color, {
|
|
26042
26190
|
[mode]: true,
|
|
26043
26191
|
['option-disabled']: disabled,
|
|
26044
|
-
}) }, hAsync("
|
|
26192
|
+
}) }, hAsync("button", { key: '48dff7833bb60fc8331cd353a0885e6affa683d1', tabindex: "-1", "aria-label": ariaLabel, disabled: disabled, onClick: () => this.onClick() }, hAsync("slot", { key: 'f9224d0e7b7aa6c05b29abfdcfe0f30ad6ee3141' }))));
|
|
26045
26193
|
}
|
|
26046
26194
|
get el() { return getElement(this); }
|
|
26047
26195
|
static get watchers() { return {
|
|
@@ -34744,6 +34892,10 @@ class Textarea {
|
|
|
34744
34892
|
* is applied in both cases.
|
|
34745
34893
|
*/
|
|
34746
34894
|
this.hasFocus = false;
|
|
34895
|
+
/**
|
|
34896
|
+
* Track validation state for proper aria-live announcements
|
|
34897
|
+
*/
|
|
34898
|
+
this.isInvalid = false;
|
|
34747
34899
|
/**
|
|
34748
34900
|
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
|
34749
34901
|
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
|
@@ -34889,6 +35041,12 @@ class Textarea {
|
|
|
34889
35041
|
this.el.click();
|
|
34890
35042
|
}
|
|
34891
35043
|
}
|
|
35044
|
+
/**
|
|
35045
|
+
* Checks if the textarea is in an invalid state based on validation classes
|
|
35046
|
+
*/
|
|
35047
|
+
checkValidationState() {
|
|
35048
|
+
return this.el.classList.contains('ion-touched') && this.el.classList.contains('ion-invalid');
|
|
35049
|
+
}
|
|
34892
35050
|
connectedCallback() {
|
|
34893
35051
|
const { el } = this;
|
|
34894
35052
|
this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => forceUpdate());
|
|
@@ -34904,6 +35062,11 @@ class Textarea {
|
|
|
34904
35062
|
this.notchController.destroy();
|
|
34905
35063
|
this.notchController = undefined;
|
|
34906
35064
|
}
|
|
35065
|
+
// Clean up validation observer to prevent memory leaks
|
|
35066
|
+
if (this.validationObserver) {
|
|
35067
|
+
this.validationObserver.disconnect();
|
|
35068
|
+
this.validationObserver = undefined;
|
|
35069
|
+
}
|
|
34907
35070
|
}
|
|
34908
35071
|
componentWillLoad() {
|
|
34909
35072
|
this.inheritedAttributes = Object.assign(Object.assign({}, inheritAriaAttributes(this.el)), inheritAttributes$1(this.el, ['data-form-type', 'title', 'tabindex', 'dir']));
|
|
@@ -35074,15 +35237,15 @@ class Textarea {
|
|
|
35074
35237
|
* Renders the helper text or error text values
|
|
35075
35238
|
*/
|
|
35076
35239
|
renderHintText() {
|
|
35077
|
-
const { helperText, errorText, helperTextId, errorTextId } = this;
|
|
35240
|
+
const { helperText, errorText, helperTextId, errorTextId, isInvalid } = this;
|
|
35078
35241
|
return [
|
|
35079
35242
|
hAsync("div", { id: helperTextId, class: "helper-text" }, helperText),
|
|
35080
|
-
hAsync("div", { id: errorTextId, class: "error-text" }, errorText),
|
|
35243
|
+
hAsync("div", { id: errorTextId, class: "error-text", role: isInvalid && errorText ? 'alert' : undefined, "aria-live": isInvalid && errorText ? 'polite' : 'off', "aria-atomic": "true" }, isInvalid && errorText ? errorText : ''),
|
|
35081
35244
|
];
|
|
35082
35245
|
}
|
|
35083
35246
|
getHintTextID() {
|
|
35084
|
-
const {
|
|
35085
|
-
if (
|
|
35247
|
+
const { isInvalid, helperText, errorText, helperTextId, errorTextId } = this;
|
|
35248
|
+
if (isInvalid && errorText) {
|
|
35086
35249
|
return errorTextId;
|
|
35087
35250
|
}
|
|
35088
35251
|
if (helperText) {
|
|
@@ -35141,7 +35304,7 @@ class Textarea {
|
|
|
35141
35304
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
35142
35305
|
*/
|
|
35143
35306
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
35144
|
-
return (hAsync(Host, { key: '
|
|
35307
|
+
return (hAsync(Host, { key: 'b67193cbdbd70844901e7f58346cb6021ea8ff9b', class: createColorClasses$1(this.color, {
|
|
35145
35308
|
[mode]: true,
|
|
35146
35309
|
'has-value': hasValue,
|
|
35147
35310
|
'has-focus': hasFocus,
|
|
@@ -35150,7 +35313,7 @@ class Textarea {
|
|
|
35150
35313
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
35151
35314
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
35152
35315
|
'textarea-disabled': disabled,
|
|
35153
|
-
}) }, hAsync("label", { key: '
|
|
35316
|
+
}) }, hAsync("label", { key: '11cb5c9eefd6c82f0d94a283f65e3bfea7cfd31f', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), hAsync("div", { key: 'f23c54b1d02b07ae54a729a1c871788b804031fe', class: "textarea-wrapper-inner" }, hAsync("div", { key: 'd467679b2132c67307eacf29f0cb9cffe9fa3f70', class: "start-slot-wrapper" }, hAsync("slot", { key: 'e75629aeb663218b24598803a400c0755bbc0958', name: "start" })), hAsync("div", { key: 'dacfbeaee43984034a59375adcda329e5cf73de4', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, hAsync("textarea", Object.assign({ key: 'cee91118b3d2fa7f6b0660bab8384cd508e432b1', 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)), hAsync("div", { key: '7802d173e3e338776ae2a095037191fdfe771dda', class: "end-slot-wrapper" }, hAsync("slot", { key: '1b721a633799701fab2527b046c03ee23fa30c2e', name: "end" }))), shouldRenderHighlight && hAsync("div", { key: 'ae2836d8d7ab9a1a6e70c3c17bbf99e30835c39d', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
35154
35317
|
}
|
|
35155
35318
|
get el() { return getElement(this); }
|
|
35156
35319
|
static get watchers() { return {
|
|
@@ -35195,6 +35358,7 @@ class Textarea {
|
|
|
35195
35358
|
"labelPlacement": [1, "label-placement"],
|
|
35196
35359
|
"shape": [1],
|
|
35197
35360
|
"hasFocus": [32],
|
|
35361
|
+
"isInvalid": [32],
|
|
35198
35362
|
"setFocus": [64],
|
|
35199
35363
|
"getInputElement": [64]
|
|
35200
35364
|
},
|