@odx/foundation 1.0.0-alpha.8 → 1.0.0-beta.0
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/README.md +27 -23
- package/dist/cdk/drag-drop/is-draggable.d.ts +1 -1
- package/dist/cdk/main.d.ts +2 -2
- package/dist/cdk/popover/{popover-host.mixin.d.ts → popover-host.d.ts} +4 -3
- package/dist/cdk/popover/popover.d.ts +12 -0
- package/dist/cdk.js +23 -12
- package/dist/components/accordion/accordion-header.d.ts +18 -0
- package/dist/components/accordion/accordion-panel.d.ts +12 -0
- package/dist/components/accordion/accordion.d.ts +17 -0
- package/dist/components/accordion/index.d.ts +3 -3
- package/dist/components/action-group/action-group.d.ts +24 -0
- package/dist/components/action-group/index.d.ts +2 -0
- package/dist/components/anchor-navigation/anchor-navigation.d.ts +21 -0
- package/dist/components/anchor-navigation/anchor-observer.d.ts +11 -0
- package/dist/components/anchor-navigation/index.d.ts +3 -0
- package/dist/components/area-header/{area-header.component.d.ts → area-header.d.ts} +4 -4
- package/dist/components/area-header/index.d.ts +1 -1
- package/dist/components/avatar/{avatar.component.d.ts → avatar.d.ts} +4 -4
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/avatar-group/avatar-group.d.ts +14 -0
- package/dist/components/avatar-group/index.d.ts +1 -1
- package/dist/components/badge/{badge.component.d.ts → badge.d.ts} +6 -4
- package/dist/components/badge/badge.models.d.ts +4 -0
- package/dist/components/badge/index.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs-item.d.ts +17 -0
- package/dist/components/breadcrumbs/{breadcrumbs.component.d.ts → breadcrumbs.d.ts} +4 -4
- package/dist/components/breadcrumbs/index.d.ts +2 -2
- package/dist/components/button/base-button.d.ts +6 -4
- package/dist/components/button/{button.component.d.ts → button.d.ts} +8 -5
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button-group/button-group.d.ts +21 -0
- package/dist/components/button-group/index.d.ts +1 -1
- package/dist/components/card/card.d.ts +13 -0
- package/dist/components/card/index.d.ts +1 -1
- package/dist/components/checkbox/{checkbox.component.d.ts → checkbox.d.ts} +4 -4
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox-group/{checkbox-group.component.d.ts → checkbox-group.d.ts} +4 -4
- package/dist/components/checkbox-group/checkbox-group.models.d.ts +1 -0
- package/dist/components/checkbox-group/index.d.ts +1 -1
- package/dist/components/chip/{chip.component.d.ts → chip.d.ts} +5 -5
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/circular-progress-bar/{circular-progress-bar.component.d.ts → circular-progress-bar.d.ts} +4 -4
- package/dist/components/circular-progress-bar/index.d.ts +1 -1
- package/dist/components/content-box/content-box.d.ts +11 -0
- package/dist/components/content-box/index.d.ts +1 -1
- package/dist/components/dropdown/dropdown.d.ts +24 -0
- package/dist/components/dropdown/index.d.ts +1 -1
- package/dist/components/form-field/{form-field.element.d.ts → form-field.d.ts} +4 -4
- package/dist/components/form-field/index.d.ts +1 -1
- package/dist/components/format/base-format.d.ts +13 -0
- package/dist/components/format/format-bytes.d.ts +13 -0
- package/dist/components/format/{format-date.component.d.ts → format-date.d.ts} +4 -4
- package/dist/components/format/{format-number.component.d.ts → format-number.d.ts} +4 -4
- package/dist/components/format/index.d.ts +5 -4
- package/dist/components/format/{relative-time.component.d.ts → relative-time.d.ts} +4 -4
- package/dist/components/header/header-actions.d.ts +10 -0
- package/dist/components/header/{header.component.d.ts → header.d.ts} +4 -4
- package/dist/components/header/index.d.ts +2 -2
- package/dist/components/headline/{headline.component.d.ts → headline.d.ts} +4 -4
- package/dist/components/headline/index.d.ts +1 -1
- package/dist/components/highlight/highlight.d.ts +14 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/icon-button/{icon-button.component.d.ts → icon-button.d.ts} +6 -5
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/image/image.d.ts +34 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/inline-message/index.d.ts +1 -1
- package/dist/components/inline-message/inline-message.d.ts +18 -0
- package/dist/components/inline-message/inline-message.models.d.ts +8 -5
- package/dist/components/input/index.d.ts +1 -1
- package/dist/components/input/input.d.ts +21 -0
- package/dist/components/line-clamp/index.d.ts +1 -1
- package/dist/components/line-clamp/line-clamp.d.ts +12 -0
- package/dist/components/link/base-link.d.ts +2 -2
- package/dist/components/link/index.d.ts +1 -1
- package/dist/components/link/{link.component.d.ts → link.d.ts} +3 -3
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/list-item.d.ts +23 -0
- package/dist/components/list/list.d.ts +11 -0
- package/dist/components/loading-overlay/index.d.ts +1 -1
- package/dist/components/loading-overlay/{loading-overlay.component.d.ts → loading-overlay.d.ts} +5 -5
- package/dist/components/loading-spinner/index.d.ts +1 -1
- package/dist/components/loading-spinner/loading-spinner.d.ts +13 -0
- package/dist/components/logo/index.d.ts +1 -1
- package/dist/components/logo/logo.d.ts +13 -0
- package/dist/components/main-menu/index.d.ts +5 -5
- package/dist/components/main-menu/main-menu-button.d.ts +12 -0
- package/dist/components/main-menu/main-menu-link.d.ts +9 -0
- package/dist/components/main-menu/main-menu-subtitle.d.ts +12 -0
- package/dist/components/main-menu/main-menu-title.d.ts +12 -0
- package/dist/components/main-menu/{main-menu.component.d.ts → main-menu.d.ts} +4 -4
- package/dist/components/main.d.ts +12 -4
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/menu-label.d.ts +9 -0
- package/dist/components/menu/{menu.component.d.ts → menu.d.ts} +8 -8
- package/dist/components/menu-item/index.d.ts +1 -1
- package/dist/components/menu-item/menu-item.d.ts +15 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/modal.d.ts +35 -0
- package/dist/components/modal/modal.models.d.ts +5 -0
- package/dist/components/navigation-item/index.d.ts +1 -1
- package/dist/components/navigation-item/navigation-item.d.ts +14 -0
- package/dist/components/option/index.d.ts +1 -1
- package/dist/components/option/option.d.ts +12 -0
- package/dist/components/page/index.d.ts +1 -1
- package/dist/components/page/{page.component.d.ts → page.d.ts} +4 -4
- package/dist/components/page-layout/index.d.ts +1 -1
- package/dist/components/page-layout/page-layout.d.ts +11 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/pagination.d.ts +32 -0
- package/dist/components/progress-bar/index.d.ts +1 -1
- package/dist/components/progress-bar/{progress-bar.component.d.ts → progress-bar.d.ts} +4 -4
- package/dist/components/radio-button/index.d.ts +1 -1
- package/dist/components/radio-button/radio-button.d.ts +13 -0
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/radio-group/radio-group.d.ts +11 -0
- package/dist/components/radio-group/radio-group.models.d.ts +1 -0
- package/dist/components/rail-navigation/index.d.ts +1 -1
- package/dist/components/rail-navigation/rail-navigation.d.ts +19 -0
- package/dist/components/search-bar/index.d.ts +1 -1
- package/dist/components/search-bar/{search-bar.component.d.ts → search-bar.d.ts} +6 -5
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/select.d.ts +18 -0
- package/dist/components/separator/index.d.ts +2 -1
- package/dist/components/separator/{separator.component.d.ts → separator.d.ts} +4 -4
- package/dist/components/skeleton/index.d.ts +2 -1
- package/dist/components/skeleton/skeleton.d.ts +16 -0
- package/dist/components/skeleton/skeleton.models.d.ts +13 -0
- package/dist/components/slider/index.d.ts +3 -3
- package/dist/components/slider/{slider-handle.component.d.ts → slider-handle.d.ts} +5 -5
- package/dist/components/slider/{slider-marks.component.d.ts → slider-marks.d.ts} +4 -4
- package/dist/components/slider/{slider.component.d.ts → slider.d.ts} +6 -6
- package/dist/components/spacer/index.d.ts +1 -1
- package/dist/components/spacer/spacer.d.ts +13 -0
- package/dist/components/spinbox/index.d.ts +1 -1
- package/dist/components/spinbox/spinbox.d.ts +20 -0
- package/dist/components/stack/index.d.ts +1 -1
- package/dist/components/stack/{stack.component.d.ts → stack.d.ts} +4 -4
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/switch.d.ts +12 -0
- package/dist/components/table/index.d.ts +8 -7
- package/dist/components/table/table-body.d.ts +12 -0
- package/dist/components/table/table-cell.d.ts +12 -0
- package/dist/components/table/{table-checkbox-cell.element.d.ts → table-checkbox-cell.d.ts} +4 -4
- package/dist/components/table/table-header-cell.d.ts +13 -0
- package/dist/components/table/table-header.d.ts +14 -0
- package/dist/components/table/{table-row.element.d.ts → table-row.d.ts} +4 -4
- package/dist/components/table/table.d.ts +20 -0
- package/dist/components/table/{table.context.d.ts → table.models.d.ts} +1 -1
- package/dist/components/text/index.d.ts +1 -1
- package/dist/components/text/{text.component.d.ts → text.d.ts} +4 -4
- package/dist/components/title/index.d.ts +1 -1
- package/dist/components/title/{title.component.d.ts → title.d.ts} +4 -4
- package/dist/components/toast/index.d.ts +1 -1
- package/dist/components/toast/{toast.element.d.ts → toast.d.ts} +4 -4
- package/dist/components/toggle-button/index.d.ts +1 -1
- package/dist/components/toggle-button/{toggle-button.component.d.ts → toggle-button.d.ts} +4 -4
- package/dist/components/toggle-content/index.d.ts +2 -0
- package/dist/components/toggle-content/toggle-content.d.ts +13 -0
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/{tooltip.element.d.ts → tooltip.d.ts} +5 -6
- package/dist/components/translate/index.d.ts +2 -0
- package/dist/components/translate/translate.d.ts +16 -0
- package/dist/components/visually-hidden/index.d.ts +1 -1
- package/dist/components/visually-hidden/visually-hidden.d.ts +11 -0
- package/dist/components.js +2583 -1675
- package/dist/i18n/lib/config.d.ts +6 -6
- package/dist/i18n/lib/is-localized.mixin.d.ts +5 -3
- package/dist/i18n/lib/localization.d.ts +4 -4
- package/dist/i18n/lib/models.d.ts +1 -1
- package/dist/i18n/lib/translate.d.ts +6 -4
- package/dist/i18n.js +47 -42
- package/dist/lib/custom-element.d.ts +5 -5
- package/dist/lib/decorators/request-update-on-aria-change.d.ts +1 -31
- package/dist/lib/main.d.ts +7 -5
- package/dist/lib/mixins/can-be-disabled.d.ts +1 -1
- package/dist/lib/mixins/can-be-expanded.d.ts +12 -0
- package/dist/lib/mixins/can-be-selected.d.ts +9 -0
- package/dist/lib/{models/aria-mixin-strict.d.ts → utils/a11y.d.ts} +3 -1
- package/dist/lib/utils/dom.d.ts +3 -0
- package/dist/lib/utils/search-text-content.d.ts +7 -0
- package/dist/lib/utils/shared-intersection-observer.d.ts +1 -1
- package/dist/loader/main.d.ts +2 -0
- package/dist/loader.js +13 -0
- package/dist/main.js +219 -537
- package/dist/styles.css +1 -1
- package/dist/{vendor.js → vendor-C_WVAD3D.js} +21 -1
- package/dist/vite.config.d.ts +3 -0
- package/package.json +18 -13
- package/dist/assets/draeger-pangea-text-medium.woff2 +0 -0
- package/dist/assets/draeger-pangea-text-regular.woff2 +0 -0
- package/dist/assets/draeger-pangea-text-semibold.woff2 +0 -0
- package/dist/assets/fonts.css +0 -20
- package/dist/cdk/popover/popover.component.d.ts +0 -12
- package/dist/components/accordion/accordion-header.component.d.ts +0 -18
- package/dist/components/accordion/accordion-panel.component.d.ts +0 -11
- package/dist/components/accordion/accordion.component.d.ts +0 -18
- package/dist/components/avatar-group/avatar-group.component.d.ts +0 -14
- package/dist/components/breadcrumbs/breadcrumbs-item.component.d.ts +0 -17
- package/dist/components/button-group/button-group.component.d.ts +0 -18
- package/dist/components/card/card.component.d.ts +0 -13
- package/dist/components/content-box/content-box.component.d.ts +0 -11
- package/dist/components/dropdown/dropdown.component.d.ts +0 -23
- package/dist/components/format/format-bytes.component.d.ts +0 -13
- package/dist/components/format/format.component.d.ts +0 -13
- package/dist/components/header/header-actions.component.d.ts +0 -10
- package/dist/components/inline-message/inline-message.component.d.ts +0 -14
- package/dist/components/input/input.component.d.ts +0 -20
- package/dist/components/line-clamp/line-clamp.component.d.ts +0 -12
- package/dist/components/list/list-item.component.d.ts +0 -11
- package/dist/components/list/list.component.d.ts +0 -11
- package/dist/components/loading-spinner/loading-spinner.component.d.ts +0 -13
- package/dist/components/logo/logo.component.d.ts +0 -13
- package/dist/components/main-menu/main-menu-button.component.d.ts +0 -12
- package/dist/components/main-menu/main-menu-link.component.d.ts +0 -9
- package/dist/components/main-menu/main-menu-subtitle.component.d.ts +0 -12
- package/dist/components/main-menu/main-menu-title.component.d.ts +0 -12
- package/dist/components/menu/menu-label.component.d.ts +0 -9
- package/dist/components/menu-item/menu-item.component.d.ts +0 -14
- package/dist/components/navigation-item/navigation-item.component.d.ts +0 -16
- package/dist/components/option/option.component.d.ts +0 -12
- package/dist/components/page-layout/page-layout.component.d.ts +0 -11
- package/dist/components/radio-button/radio-button.component.d.ts +0 -13
- package/dist/components/radio-group/radio-group.component.d.ts +0 -11
- package/dist/components/rail-navigation/rail-navigation.component.d.ts +0 -19
- package/dist/components/select/select.component.d.ts +0 -18
- package/dist/components/skeleton/skeleton.component.d.ts +0 -12
- package/dist/components/spacer/spacer.component.d.ts +0 -13
- package/dist/components/spinbox/spinbox.component.d.ts +0 -20
- package/dist/components/switch/switch.component.d.ts +0 -12
- package/dist/components/table/table-body.element.d.ts +0 -12
- package/dist/components/table/table-cell.element.d.ts +0 -12
- package/dist/components/table/table-header-cell.element.d.ts +0 -13
- package/dist/components/table/table-header.element.d.ts +0 -14
- package/dist/components/table/table.element.d.ts +0 -20
- package/dist/components/visually-hidden/visually-hidden.component.d.ts +0 -11
- package/dist/lib/directives/aria-boolean-attr.d.ts +0 -3
- package/dist/lib/external/roving-tabindex.d.ts +0 -87
- package/dist/lib/mixins/with-aria-controls.d.ts +0 -11
- package/dist/lib/utils/string.d.ts +0 -2
- package/public/assets/draeger-pangea-text-medium.woff2 +0 -0
- package/public/assets/draeger-pangea-text-regular.woff2 +0 -0
- package/public/assets/draeger-pangea-text-semibold.woff2 +0 -0
- package/public/assets/fonts.css +0 -20
package/dist/main.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { r as round, t as toMerged, c as createFocusTrap } from './vendor.js';
|
|
1
|
+
import { r as round, t as toMerged, c as createFocusTrap, u as uniqBy, R as RovingTabindexController } from './vendor-C_WVAD3D.js';
|
|
2
2
|
import { isServer, nothing, html, LitElement, unsafeCSS, CSSResult } from 'lit';
|
|
3
3
|
import { directive, Directive } from 'lit/directive.js';
|
|
4
4
|
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
5
|
+
export { effect } from '@lit-labs/preact-signals';
|
|
5
6
|
|
|
6
7
|
function createMutationObserver(callback) {
|
|
7
8
|
try {
|
|
@@ -47,6 +48,16 @@ async function waitForAnimations(element, subtree = false) {
|
|
|
47
48
|
}
|
|
48
49
|
return Promise.all(element.getAnimations({ subtree }).map((animation) => animation.finished)).catch(() => []);
|
|
49
50
|
}
|
|
51
|
+
function forwardEvent(target, eventInit) {
|
|
52
|
+
return (event) => {
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
const shouldPreventDefault = target.dispatchEvent(
|
|
55
|
+
new CustomEvent(event.type, { bubbles: event.bubbles, composed: event.composed, cancelable: event.cancelable, ...eventInit })
|
|
56
|
+
);
|
|
57
|
+
if (shouldPreventDefault) return;
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
};
|
|
60
|
+
}
|
|
50
61
|
|
|
51
62
|
function createOptions(defaultOptions) {
|
|
52
63
|
return (options) => toMerged(defaultOptions, options ?? {});
|
|
@@ -115,14 +126,6 @@ function requestUpdateOnAriaChange(ariaProperties) {
|
|
|
115
126
|
};
|
|
116
127
|
}
|
|
117
128
|
|
|
118
|
-
function toAriaBooleanAttribute(value, removeOnFalse = true) {
|
|
119
|
-
if (removeOnFalse && value === false) return null;
|
|
120
|
-
return String(value);
|
|
121
|
-
}
|
|
122
|
-
function fromAriaBooleanAttribute(value) {
|
|
123
|
-
return value === "true";
|
|
124
|
-
}
|
|
125
|
-
|
|
126
129
|
const optionalAttr = (value) => {
|
|
127
130
|
if (value === void 0 || value === null || value === "") return nothing;
|
|
128
131
|
return value;
|
|
@@ -151,404 +154,25 @@ class SlotFallbackDirective extends Directive {
|
|
|
151
154
|
}
|
|
152
155
|
const emptySlotFallbackFix = directive(SlotFallbackDirective);
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
if (typeof value === type) {
|
|
156
|
-
return () => value;
|
|
157
|
-
} else if (typeof value === "function") {
|
|
158
|
-
return value;
|
|
159
|
-
}
|
|
160
|
-
return fallback;
|
|
161
|
-
}
|
|
162
|
-
class FocusGroupController {
|
|
163
|
-
constructor(host, { hostDelegatesFocus, direction, elementEnterAction, elements, focusInIndex, isFocusableElement, listenerScope } = {
|
|
164
|
-
elements: () => []
|
|
165
|
-
}) {
|
|
166
|
-
this._currentIndex = -1;
|
|
167
|
-
this.prevIndex = -1;
|
|
168
|
-
this._direction = () => "both";
|
|
169
|
-
this.directionLength = 5;
|
|
170
|
-
this.hostDelegatesFocus = false;
|
|
171
|
-
this.elementEnterAction = (_el) => {
|
|
172
|
-
return;
|
|
173
|
-
};
|
|
174
|
-
this._focused = false;
|
|
175
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
176
|
-
this._focusInIndex = (_elements) => 0;
|
|
177
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
178
|
-
this.isFocusableElement = (_el) => true;
|
|
179
|
-
this._listenerScope = () => this.host;
|
|
180
|
-
// When elements are virtualized, the delta between the first element
|
|
181
|
-
// and the first rendered element.
|
|
182
|
-
this.offset = 0;
|
|
183
|
-
this.recentlyConnected = false;
|
|
184
|
-
this.handleFocusin = (event) => {
|
|
185
|
-
if (!this.isEventWithinListenerScope(event)) return;
|
|
186
|
-
const path = event.composedPath();
|
|
187
|
-
let targetIndex = -1;
|
|
188
|
-
path.find((el) => {
|
|
189
|
-
targetIndex = this.elements.indexOf(el);
|
|
190
|
-
return targetIndex !== -1;
|
|
191
|
-
});
|
|
192
|
-
this.prevIndex = this.currentIndex;
|
|
193
|
-
this.currentIndex = targetIndex > -1 ? targetIndex : this.currentIndex;
|
|
194
|
-
if (this.isRelatedTargetOrContainAnElement(event)) {
|
|
195
|
-
this.hostContainsFocus();
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* handleClick - Finds the element that was clicked and sets the tabindex to 0
|
|
200
|
-
* @returns void
|
|
201
|
-
*/
|
|
202
|
-
this.handleClick = () => {
|
|
203
|
-
const elements = this.elements;
|
|
204
|
-
if (!elements.length) return;
|
|
205
|
-
let focusElement = elements[this.currentIndex];
|
|
206
|
-
if (this.currentIndex < 0) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (!focusElement || !this.isFocusableElement(focusElement)) {
|
|
210
|
-
this.setCurrentIndexCircularly(1);
|
|
211
|
-
focusElement = elements[this.currentIndex];
|
|
212
|
-
}
|
|
213
|
-
if (focusElement && this.isFocusableElement(focusElement)) {
|
|
214
|
-
elements[this.prevIndex]?.setAttribute("tabindex", "-1");
|
|
215
|
-
focusElement.setAttribute("tabindex", "0");
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
this.handleFocusout = (event) => {
|
|
219
|
-
if (this.isRelatedTargetOrContainAnElement(event)) {
|
|
220
|
-
this.hostNoLongerContainsFocus();
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
this.handleKeydown = (event) => {
|
|
224
|
-
if (!this.acceptsEventKey(event.key) || event.defaultPrevented) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
let diff = 0;
|
|
228
|
-
this.prevIndex = this.currentIndex;
|
|
229
|
-
switch (event.key) {
|
|
230
|
-
case "ArrowRight":
|
|
231
|
-
diff += 1;
|
|
232
|
-
break;
|
|
233
|
-
case "ArrowDown":
|
|
234
|
-
diff += this.direction === "grid" ? this.directionLength : 1;
|
|
235
|
-
break;
|
|
236
|
-
case "ArrowLeft":
|
|
237
|
-
diff -= 1;
|
|
238
|
-
break;
|
|
239
|
-
case "ArrowUp":
|
|
240
|
-
diff -= this.direction === "grid" ? this.directionLength : 1;
|
|
241
|
-
break;
|
|
242
|
-
case "End":
|
|
243
|
-
this.currentIndex = 0;
|
|
244
|
-
diff -= 1;
|
|
245
|
-
break;
|
|
246
|
-
case "Home":
|
|
247
|
-
this.currentIndex = this.elements.length - 1;
|
|
248
|
-
diff += 1;
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
event.preventDefault();
|
|
252
|
-
if (this.direction === "grid" && this.currentIndex + diff < 0) {
|
|
253
|
-
this.currentIndex = 0;
|
|
254
|
-
} else if (this.direction === "grid" && this.currentIndex + diff > this.elements.length - 1) {
|
|
255
|
-
this.currentIndex = this.elements.length - 1;
|
|
256
|
-
} else {
|
|
257
|
-
this.setCurrentIndexCircularly(diff);
|
|
258
|
-
}
|
|
259
|
-
this.elementEnterAction(this.elements[this.currentIndex]);
|
|
260
|
-
this.focus();
|
|
261
|
-
};
|
|
262
|
-
this.mutationObserver = new MutationObserver(() => {
|
|
263
|
-
this.handleItemMutation();
|
|
264
|
-
});
|
|
265
|
-
this.hostDelegatesFocus = hostDelegatesFocus || false;
|
|
266
|
-
this.host = host;
|
|
267
|
-
this.host.addController(this);
|
|
268
|
-
this._elements = elements;
|
|
269
|
-
this.isFocusableElement = isFocusableElement || this.isFocusableElement;
|
|
270
|
-
this._direction = ensureMethod(direction, "string", this._direction);
|
|
271
|
-
this.elementEnterAction = elementEnterAction || this.elementEnterAction;
|
|
272
|
-
this._focusInIndex = ensureMethod(focusInIndex, "number", this._focusInIndex);
|
|
273
|
-
this._listenerScope = ensureMethod(listenerScope, "object", this._listenerScope);
|
|
274
|
-
}
|
|
275
|
-
get currentIndex() {
|
|
276
|
-
if (this._currentIndex === -1) {
|
|
277
|
-
this._currentIndex = this.focusInIndex;
|
|
278
|
-
}
|
|
279
|
-
return this._currentIndex - this.offset;
|
|
280
|
-
}
|
|
281
|
-
set currentIndex(currentIndex) {
|
|
282
|
-
this._currentIndex = currentIndex + this.offset;
|
|
283
|
-
}
|
|
284
|
-
get direction() {
|
|
285
|
-
return this._direction();
|
|
286
|
-
}
|
|
287
|
-
get elements() {
|
|
288
|
-
if (!this.cachedElements) {
|
|
289
|
-
this.cachedElements = this._elements();
|
|
290
|
-
}
|
|
291
|
-
return this.cachedElements;
|
|
292
|
-
}
|
|
293
|
-
set focused(focused) {
|
|
294
|
-
if (focused === this.focused) return;
|
|
295
|
-
this._focused = focused;
|
|
296
|
-
}
|
|
297
|
-
get focused() {
|
|
298
|
-
return this._focused;
|
|
299
|
-
}
|
|
300
|
-
get focusInElement() {
|
|
301
|
-
return this.elements[this.focusInIndex];
|
|
302
|
-
}
|
|
303
|
-
get focusInIndex() {
|
|
304
|
-
return this._focusInIndex(this.elements);
|
|
305
|
-
}
|
|
306
|
-
isEventWithinListenerScope(event) {
|
|
307
|
-
if (this._listenerScope() === this.host) return true;
|
|
308
|
-
return event.composedPath().includes(this._listenerScope());
|
|
309
|
-
}
|
|
310
|
-
/* In handleItemMutation() method the first if condition is checking if the element is not focused or if the element's children's length is not decreasing then it means no element has been deleted and we must return.
|
|
311
|
-
Then we are checking if the deleted element was the focused one before the deletion if so then we need to proceed else we casn return;
|
|
312
|
-
*/
|
|
313
|
-
handleItemMutation() {
|
|
314
|
-
if (this._currentIndex == -1 || this.elements.length <= this._elements().length) return;
|
|
315
|
-
const focusedElement = this.elements[this.currentIndex];
|
|
316
|
-
this.clearElementCache();
|
|
317
|
-
if (this.elements.includes(focusedElement)) return;
|
|
318
|
-
const moveToNextElement = this.currentIndex !== this.elements.length;
|
|
319
|
-
const diff = moveToNextElement ? 1 : -1;
|
|
320
|
-
if (moveToNextElement) {
|
|
321
|
-
this.setCurrentIndexCircularly(-1);
|
|
322
|
-
}
|
|
323
|
-
this.setCurrentIndexCircularly(diff);
|
|
324
|
-
this.focus();
|
|
325
|
-
}
|
|
326
|
-
update({ elements } = { elements: () => [] }) {
|
|
327
|
-
this.unmanage();
|
|
328
|
-
this._elements = elements;
|
|
329
|
-
this.clearElementCache();
|
|
330
|
-
this.manage();
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* resets the focusedItem to initial item
|
|
334
|
-
*/
|
|
335
|
-
reset() {
|
|
336
|
-
const elements = this.elements;
|
|
337
|
-
if (!elements.length) return;
|
|
338
|
-
this.setCurrentIndexCircularly(this.focusInIndex - this.currentIndex);
|
|
339
|
-
let focusElement = elements[this.currentIndex];
|
|
340
|
-
if (this.currentIndex < 0) {
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
if (!focusElement || !this.isFocusableElement(focusElement)) {
|
|
344
|
-
this.setCurrentIndexCircularly(1);
|
|
345
|
-
focusElement = elements[this.currentIndex];
|
|
346
|
-
}
|
|
347
|
-
if (focusElement && this.isFocusableElement(focusElement)) {
|
|
348
|
-
elements[this.prevIndex]?.setAttribute("tabindex", "-1");
|
|
349
|
-
focusElement.setAttribute("tabindex", "0");
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
focusOnItem(item, options) {
|
|
353
|
-
if (item && this.isFocusableElement(item) && this.elements.indexOf(item)) {
|
|
354
|
-
const diff = this.elements.indexOf(item) - this.currentIndex;
|
|
355
|
-
this.setCurrentIndexCircularly(diff);
|
|
356
|
-
this.elements[this.prevIndex]?.setAttribute("tabindex", "-1");
|
|
357
|
-
}
|
|
358
|
-
this.focus(options);
|
|
359
|
-
}
|
|
360
|
-
focus(options) {
|
|
361
|
-
const elements = this.elements;
|
|
362
|
-
if (!elements.length) return;
|
|
363
|
-
let focusElement = elements[this.currentIndex];
|
|
364
|
-
if (!focusElement || !this.isFocusableElement(focusElement)) {
|
|
365
|
-
this.setCurrentIndexCircularly(1);
|
|
366
|
-
focusElement = elements[this.currentIndex];
|
|
367
|
-
}
|
|
368
|
-
if (focusElement && this.isFocusableElement(focusElement)) {
|
|
369
|
-
if (!this.hostDelegatesFocus || elements[this.prevIndex] !== focusElement) {
|
|
370
|
-
elements[this.prevIndex]?.setAttribute("tabindex", "-1");
|
|
371
|
-
}
|
|
372
|
-
focusElement.tabIndex = 0;
|
|
373
|
-
focusElement.focus(options);
|
|
374
|
-
if (this.hostDelegatesFocus && !this.focused) {
|
|
375
|
-
this.hostContainsFocus();
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
clearElementCache(offset = 0) {
|
|
380
|
-
this.mutationObserver.disconnect();
|
|
381
|
-
delete this.cachedElements;
|
|
382
|
-
this.offset = offset;
|
|
383
|
-
requestAnimationFrame(() => {
|
|
384
|
-
this.elements.forEach((element) => {
|
|
385
|
-
this.mutationObserver.observe(element, {
|
|
386
|
-
attributes: true
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
setCurrentIndexCircularly(diff) {
|
|
392
|
-
const { length } = this.elements;
|
|
393
|
-
let steps = length;
|
|
394
|
-
this.prevIndex = this.currentIndex;
|
|
395
|
-
let nextIndex = (length + this.currentIndex + diff) % length;
|
|
396
|
-
while (
|
|
397
|
-
// don't cycle the elements more than once
|
|
398
|
-
steps && this.elements[nextIndex] && // @ts-ignore
|
|
399
|
-
!this.isFocusableElement(this.elements[nextIndex])
|
|
400
|
-
) {
|
|
401
|
-
nextIndex = (length + nextIndex + diff) % length;
|
|
402
|
-
steps -= 1;
|
|
403
|
-
}
|
|
404
|
-
this.currentIndex = nextIndex;
|
|
405
|
-
}
|
|
406
|
-
hostContainsFocus() {
|
|
407
|
-
this.host.addEventListener("focusout", this.handleFocusout);
|
|
408
|
-
this.host.addEventListener("keydown", this.handleKeydown);
|
|
409
|
-
this.focused = true;
|
|
410
|
-
}
|
|
411
|
-
hostNoLongerContainsFocus() {
|
|
412
|
-
this.host.addEventListener("focusin", this.handleFocusin);
|
|
413
|
-
this.host.removeEventListener("focusout", this.handleFocusout);
|
|
414
|
-
this.host.removeEventListener("keydown", this.handleKeydown);
|
|
415
|
-
this.focused = false;
|
|
416
|
-
}
|
|
417
|
-
isRelatedTargetOrContainAnElement(event) {
|
|
418
|
-
const relatedTarget = event.relatedTarget;
|
|
419
|
-
const isRelatedTargetAnElement = this.elements.includes(relatedTarget);
|
|
420
|
-
const isRelatedTargetContainedWithinElements = this.elements.some((el) => el.contains(relatedTarget));
|
|
421
|
-
return !(isRelatedTargetAnElement || isRelatedTargetContainedWithinElements);
|
|
422
|
-
}
|
|
423
|
-
acceptsEventKey(key) {
|
|
424
|
-
if (key === "End" || key === "Home") {
|
|
425
|
-
return true;
|
|
426
|
-
}
|
|
427
|
-
switch (this.direction) {
|
|
428
|
-
case "horizontal":
|
|
429
|
-
return key === "ArrowLeft" || key === "ArrowRight";
|
|
430
|
-
case "vertical":
|
|
431
|
-
return key === "ArrowUp" || key === "ArrowDown";
|
|
432
|
-
case "both":
|
|
433
|
-
case "grid":
|
|
434
|
-
return key.startsWith("Arrow");
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
manage() {
|
|
438
|
-
this.addEventListeners();
|
|
439
|
-
}
|
|
440
|
-
unmanage() {
|
|
441
|
-
this.removeEventListeners();
|
|
442
|
-
}
|
|
443
|
-
addEventListeners() {
|
|
444
|
-
this.host.addEventListener("focusin", this.handleFocusin);
|
|
445
|
-
this.host.addEventListener("click", this.handleClick);
|
|
446
|
-
}
|
|
447
|
-
removeEventListeners() {
|
|
448
|
-
this.host.removeEventListener("focusin", this.handleFocusin);
|
|
449
|
-
this.host.removeEventListener("focusout", this.handleFocusout);
|
|
450
|
-
this.host.removeEventListener("keydown", this.handleKeydown);
|
|
451
|
-
this.host.removeEventListener("click", this.handleClick);
|
|
452
|
-
}
|
|
453
|
-
hostConnected() {
|
|
454
|
-
this.recentlyConnected = true;
|
|
455
|
-
this.addEventListeners();
|
|
456
|
-
}
|
|
457
|
-
hostDisconnected() {
|
|
458
|
-
this.mutationObserver.disconnect();
|
|
459
|
-
this.removeEventListeners();
|
|
460
|
-
}
|
|
461
|
-
hostUpdated() {
|
|
462
|
-
if (this.recentlyConnected) {
|
|
463
|
-
this.recentlyConnected = false;
|
|
464
|
-
this.elements.forEach((element) => {
|
|
465
|
-
this.mutationObserver.observe(element, {
|
|
466
|
-
attributes: true
|
|
467
|
-
});
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
class RovingTabindexController extends FocusGroupController {
|
|
473
|
-
constructor() {
|
|
474
|
-
super(...arguments);
|
|
475
|
-
this.managed = true;
|
|
476
|
-
this.manageIndexesAnimationFrame = 0;
|
|
477
|
-
}
|
|
478
|
-
set focused(focused) {
|
|
479
|
-
if (focused === this.focused) return;
|
|
480
|
-
super.focused = focused;
|
|
481
|
-
this.manageTabindexes();
|
|
482
|
-
}
|
|
483
|
-
get focused() {
|
|
484
|
-
return super.focused;
|
|
485
|
-
}
|
|
486
|
-
clearElementCache(offset = 0) {
|
|
487
|
-
cancelAnimationFrame(this.manageIndexesAnimationFrame);
|
|
488
|
-
super.clearElementCache(offset);
|
|
489
|
-
if (!this.managed) return;
|
|
490
|
-
this.manageIndexesAnimationFrame = requestAnimationFrame(() => this.manageTabindexes());
|
|
491
|
-
}
|
|
492
|
-
manageTabindexes() {
|
|
493
|
-
if (this.focused && !this.hostDelegatesFocus) {
|
|
494
|
-
this.updateTabindexes(() => ({ tabIndex: -1 }));
|
|
495
|
-
} else {
|
|
496
|
-
this.updateTabindexes((el) => {
|
|
497
|
-
return {
|
|
498
|
-
removeTabIndex: el.contains(this.focusInElement) && el !== this.focusInElement,
|
|
499
|
-
tabIndex: el === this.focusInElement ? 0 : -1
|
|
500
|
-
};
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
updateTabindexes(getTabIndex) {
|
|
505
|
-
this.elements.forEach((el) => {
|
|
506
|
-
const { tabIndex, removeTabIndex } = getTabIndex(el);
|
|
507
|
-
if (!removeTabIndex) {
|
|
508
|
-
if (this.focused) {
|
|
509
|
-
if (el !== this.elements[this.currentIndex]) {
|
|
510
|
-
el.tabIndex = tabIndex;
|
|
511
|
-
}
|
|
512
|
-
} else {
|
|
513
|
-
el.tabIndex = tabIndex;
|
|
514
|
-
}
|
|
515
|
-
return;
|
|
516
|
-
}
|
|
517
|
-
const updatable = el;
|
|
518
|
-
if (updatable.requestUpdate) updatable.requestUpdate();
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
manage() {
|
|
522
|
-
this.managed = true;
|
|
523
|
-
this.manageTabindexes();
|
|
524
|
-
super.manage();
|
|
525
|
-
}
|
|
526
|
-
unmanage() {
|
|
527
|
-
this.managed = false;
|
|
528
|
-
this.updateTabindexes(() => ({ tabIndex: 0 }));
|
|
529
|
-
super.unmanage();
|
|
530
|
-
}
|
|
531
|
-
hostUpdated() {
|
|
532
|
-
super.hostUpdated();
|
|
533
|
-
if (!this.host.hasUpdated) {
|
|
534
|
-
this.manageTabindexes();
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
const customElementStyles = "@layer reset,base,variant,state,theme,override;@layer reset{:where(*,*:before,*:after){box-sizing:border-box}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty;margin:0}h1,h2,h3,h4,h5,h6{text-wrap:balance;margin:0}#root,#__next{isolation:isolate;margin:0}}@layer base{*{scrollbar-color:var(--odx-color-neutral-rest) var(--odx-palette-transparent)}:where(*:not(body)){scrollbar-width:thin}}@layer base{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-size:var(--_font-size);font-weight:var(--odx-typography-font-weight-semibold);line-height:var(--_line-height);color:inherit}h6{--_font-size: var(--odx-breakpoint-font-size-heading-6);--_line-height: var(--odx-breakpoint-line-height-heading-6)}h5{--_font-size: var(--odx-breakpoint-font-size-heading-5);--_line-height: var(--odx-breakpoint-line-height-heading-5)}h4{--_font-size: var(--odx-breakpoint-font-size-heading-4);--_line-height: var(--odx-breakpoint-line-height-heading-4)}h3{--_font-size: var(--odx-breakpoint-font-size-heading-3);--_line-height: var(--odx-breakpoint-line-height-heading-3)}h2{--_font-size: var(--odx-breakpoint-font-size-heading-2);--_line-height: var(--odx-breakpoint-line-height-heading-2)}h1{--_font-size: var(--odx-breakpoint-font-size-heading-1);--_line-height: var(--odx-breakpoint-line-height-heading-1)}[odxPreventTextOverflow]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@layer reset{:where(:host){box-sizing:border-box;border:none;color:inherit;outline:none}}";
|
|
157
|
+
const customElementStyles = "@layer reset,base,variant,state,theme,override;@layer reset{:is(*){box-sizing:border-box;scrollbar-width:thin}:before,:after{box-sizing:border-box}[popover]{border:none;outline:none}img,picture,video,canvas,svg{display:block;max-width:100%;margin:0}input,button,textarea,select{font:inherit;margin:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word;margin:0}p{text-wrap:pretty}h1,h2,h3,h4,h5,h6{text-wrap:balance}#root,#__next{isolation:isolate;margin:0}}@layer base{h1,h2,h3,h4,h5,h6{display:block;font-family:var(--odx-typography-font-family-brand);font-size:var(--_font-size);font-weight:var(--odx-typography-font-weight-semibold);line-height:var(--_line-height)}h6{--_font-size: var(--odx-breakpoint-font-size-heading-6);--_line-height: var(--odx-breakpoint-line-height-heading-6)}h5{--_font-size: var(--odx-breakpoint-font-size-heading-5);--_line-height: var(--odx-breakpoint-line-height-heading-5)}h4{--_font-size: var(--odx-breakpoint-font-size-heading-4);--_line-height: var(--odx-breakpoint-line-height-heading-4)}h3{--_font-size: var(--odx-breakpoint-font-size-heading-3);--_line-height: var(--odx-breakpoint-line-height-heading-3)}h2{--_font-size: var(--odx-breakpoint-font-size-heading-2);--_line-height: var(--odx-breakpoint-line-height-heading-2)}h1{--_font-size: var(--odx-breakpoint-font-size-heading-1);--_line-height: var(--odx-breakpoint-line-height-heading-1)}[odxPreventTextOverflow]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}@layer reset{:host{border:none;border-color:transparent;outline:none}}";
|
|
540
158
|
|
|
541
159
|
function toCSSResult(value) {
|
|
542
160
|
return value instanceof CSSResult || value instanceof CSSStyleSheet ? value : unsafeCSS(value);
|
|
543
161
|
}
|
|
162
|
+
function isCustomElementClass(candidate) {
|
|
163
|
+
if (!candidate || typeof candidate !== "function") return false;
|
|
164
|
+
return "selector" in candidate && "define" in candidate && typeof candidate.define === "function";
|
|
165
|
+
}
|
|
544
166
|
function customElement(selector, styles = []) {
|
|
545
|
-
if (selector && globalThis.customElements.get(selector)) return () => void 0;
|
|
546
|
-
const preparedStyles = [customElementStyles, styles].map(toCSSResult);
|
|
547
167
|
return (target) => {
|
|
548
|
-
|
|
168
|
+
const preparedStyles = [customElementStyles, target.styles ?? [], ...styles].filter(Boolean).flat(2).map(toCSSResult);
|
|
549
169
|
if (selector) {
|
|
170
|
+
target.styles = uniqBy(preparedStyles, String);
|
|
550
171
|
target.selector = selector;
|
|
551
|
-
|
|
172
|
+
target.define = () => {
|
|
173
|
+
if (customElements.get(selector)) return;
|
|
174
|
+
customElements.define(selector, target);
|
|
175
|
+
};
|
|
552
176
|
}
|
|
553
177
|
};
|
|
554
178
|
}
|
|
@@ -557,10 +181,18 @@ class CustomElement extends LitElement {
|
|
|
557
181
|
return html`<slot></slot>`;
|
|
558
182
|
}
|
|
559
183
|
emit(event, eventInit) {
|
|
560
|
-
return !this.dispatchEvent(new CustomEvent(event, { bubbles:
|
|
184
|
+
return !this.dispatchEvent(new CustomEvent(event, { bubbles: false, composed: false, cancelable: true, ...eventInit }));
|
|
561
185
|
}
|
|
562
186
|
}
|
|
563
187
|
|
|
188
|
+
function toAriaBooleanAttribute(value, removeOnFalse = true) {
|
|
189
|
+
if (removeOnFalse && value === false) return null;
|
|
190
|
+
return String(value);
|
|
191
|
+
}
|
|
192
|
+
function fromAriaBooleanAttribute(value) {
|
|
193
|
+
return value === "true";
|
|
194
|
+
}
|
|
195
|
+
|
|
564
196
|
const appliedClassMixins = /* @__PURE__ */ new WeakMap();
|
|
565
197
|
function wasMixinPreviouslyApplied(mixin, superClass) {
|
|
566
198
|
let klass = superClass;
|
|
@@ -583,18 +215,18 @@ function dedupeMixin(mixin) {
|
|
|
583
215
|
};
|
|
584
216
|
}
|
|
585
217
|
|
|
586
|
-
var __defProp$
|
|
587
|
-
var __getOwnPropDesc$
|
|
588
|
-
var __decorateClass$
|
|
589
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
218
|
+
var __defProp$c = Object.defineProperty;
|
|
219
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
220
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
221
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
590
222
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
591
223
|
if (decorator = decorators[i])
|
|
592
224
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
593
|
-
if (kind && result) __defProp$
|
|
225
|
+
if (kind && result) __defProp$c(target, key, result);
|
|
594
226
|
return result;
|
|
595
227
|
};
|
|
596
228
|
const CanBeDisabled = dedupeMixin((superClass) => {
|
|
597
|
-
class
|
|
229
|
+
class CanBeDisabledMixin extends superClass {
|
|
598
230
|
constructor() {
|
|
599
231
|
super(...arguments);
|
|
600
232
|
this.#initialTabIndex = null;
|
|
@@ -602,6 +234,9 @@ const CanBeDisabled = dedupeMixin((superClass) => {
|
|
|
602
234
|
this.disabled = false;
|
|
603
235
|
}
|
|
604
236
|
#initialTabIndex;
|
|
237
|
+
isContextDisabled() {
|
|
238
|
+
return this._contextDisabled || this.disabled;
|
|
239
|
+
}
|
|
605
240
|
connectedCallback() {
|
|
606
241
|
super.connectedCallback?.();
|
|
607
242
|
this.#initialTabIndex = this.hasAttribute("tabindex") ? this.tabIndex : null;
|
|
@@ -609,17 +244,11 @@ const CanBeDisabled = dedupeMixin((superClass) => {
|
|
|
609
244
|
willUpdate(props) {
|
|
610
245
|
super.willUpdate?.(props);
|
|
611
246
|
if (props.has("_contextDisabled") || props.has("disabled")) {
|
|
612
|
-
this.#
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
updated(props) {
|
|
616
|
-
super.updated?.(props);
|
|
617
|
-
if (props.has("_contextDisabled") || props.has("disabled")) {
|
|
618
|
-
this.onDisabledChanged?.(this._contextDisabled || this.disabled);
|
|
247
|
+
this.#handleDisabledChange();
|
|
619
248
|
}
|
|
620
249
|
}
|
|
621
|
-
#
|
|
622
|
-
const disabled = this.
|
|
250
|
+
#handleDisabledChange() {
|
|
251
|
+
const disabled = this.isContextDisabled();
|
|
623
252
|
this.ariaDisabled = toAriaBooleanAttribute(disabled);
|
|
624
253
|
if (disabled) {
|
|
625
254
|
this.tabIndex = -1;
|
|
@@ -630,23 +259,23 @@ const CanBeDisabled = dedupeMixin((superClass) => {
|
|
|
630
259
|
}
|
|
631
260
|
}
|
|
632
261
|
}
|
|
633
|
-
__decorateClass$
|
|
262
|
+
__decorateClass$c([
|
|
634
263
|
property({ type: Boolean })
|
|
635
|
-
],
|
|
636
|
-
__decorateClass$
|
|
264
|
+
], CanBeDisabledMixin.prototype, "_contextDisabled", 2);
|
|
265
|
+
__decorateClass$c([
|
|
637
266
|
property({ type: Boolean })
|
|
638
|
-
],
|
|
639
|
-
return
|
|
267
|
+
], CanBeDisabledMixin.prototype, "disabled", 2);
|
|
268
|
+
return CanBeDisabledMixin;
|
|
640
269
|
});
|
|
641
270
|
|
|
642
|
-
var __defProp$
|
|
643
|
-
var __getOwnPropDesc$
|
|
644
|
-
var __decorateClass$
|
|
645
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
271
|
+
var __defProp$b = Object.defineProperty;
|
|
272
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
273
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
274
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
646
275
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
647
276
|
if (decorator = decorators[i])
|
|
648
277
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
649
|
-
if (kind && result) __defProp$
|
|
278
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
650
279
|
return result;
|
|
651
280
|
};
|
|
652
281
|
const CanBeReadonly = dedupeMixin((superClass) => {
|
|
@@ -662,20 +291,20 @@ const CanBeReadonly = dedupeMixin((superClass) => {
|
|
|
662
291
|
}
|
|
663
292
|
}
|
|
664
293
|
}
|
|
665
|
-
__decorateClass$
|
|
294
|
+
__decorateClass$b([
|
|
666
295
|
property({ type: Boolean, reflect: true })
|
|
667
296
|
], CanBeReadonlyElement.prototype, "readonly", 2);
|
|
668
297
|
return CanBeReadonlyElement;
|
|
669
298
|
});
|
|
670
299
|
|
|
671
|
-
var __defProp$
|
|
672
|
-
var __getOwnPropDesc$
|
|
673
|
-
var __decorateClass$
|
|
674
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
300
|
+
var __defProp$a = Object.defineProperty;
|
|
301
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
302
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
303
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
675
304
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
676
305
|
if (decorator = decorators[i])
|
|
677
306
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
678
|
-
if (kind && result) __defProp$
|
|
307
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
679
308
|
return result;
|
|
680
309
|
};
|
|
681
310
|
const CanBeRequired = dedupeMixin((superClass) => {
|
|
@@ -691,7 +320,7 @@ const CanBeRequired = dedupeMixin((superClass) => {
|
|
|
691
320
|
}
|
|
692
321
|
}
|
|
693
322
|
}
|
|
694
|
-
__decorateClass$
|
|
323
|
+
__decorateClass$a([
|
|
695
324
|
property({ type: Boolean, reflect: true })
|
|
696
325
|
], CanBeRequiredElement.prototype, "required", 2);
|
|
697
326
|
return CanBeRequiredElement;
|
|
@@ -726,14 +355,14 @@ const CanBeValidated = dedupeMixin((superClass) => {
|
|
|
726
355
|
return CanBeValidatedElement;
|
|
727
356
|
});
|
|
728
357
|
|
|
729
|
-
var __defProp$
|
|
730
|
-
var __getOwnPropDesc$
|
|
731
|
-
var __decorateClass$
|
|
732
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
358
|
+
var __defProp$9 = Object.defineProperty;
|
|
359
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
360
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
361
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
733
362
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
734
363
|
if (decorator = decorators[i])
|
|
735
364
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
736
|
-
if (kind && result) __defProp$
|
|
365
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
737
366
|
return result;
|
|
738
367
|
};
|
|
739
368
|
const FormControl = dedupeMixin((superClass) => {
|
|
@@ -770,10 +399,10 @@ const FormControl = dedupeMixin((superClass) => {
|
|
|
770
399
|
}
|
|
771
400
|
}
|
|
772
401
|
}
|
|
773
|
-
__decorateClass$
|
|
402
|
+
__decorateClass$9([
|
|
774
403
|
property()
|
|
775
404
|
], FormControlElement.prototype, "name", 2);
|
|
776
|
-
__decorateClass$
|
|
405
|
+
__decorateClass$9([
|
|
777
406
|
property()
|
|
778
407
|
], FormControlElement.prototype, "value", 2);
|
|
779
408
|
return FormControlElement;
|
|
@@ -820,14 +449,14 @@ function getKeyboardEventInfo(event) {
|
|
|
820
449
|
};
|
|
821
450
|
}
|
|
822
451
|
|
|
823
|
-
var __defProp$
|
|
824
|
-
var __getOwnPropDesc$
|
|
825
|
-
var __decorateClass$
|
|
826
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
452
|
+
var __defProp$8 = Object.defineProperty;
|
|
453
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
454
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
455
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
827
456
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
828
457
|
if (decorator = decorators[i])
|
|
829
458
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
830
|
-
if (kind && result) __defProp$
|
|
459
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
831
460
|
return result;
|
|
832
461
|
};
|
|
833
462
|
const LINK_SELECTORS = /* @__PURE__ */ new Set(["a", "button", "odx-link"]);
|
|
@@ -887,18 +516,18 @@ class CheckboxFormControl extends FormControl(CustomElement) {
|
|
|
887
516
|
#handleClick;
|
|
888
517
|
#handleKeyboardEvent;
|
|
889
518
|
}
|
|
890
|
-
__decorateClass$
|
|
519
|
+
__decorateClass$8([
|
|
891
520
|
property({ type: Boolean, reflect: true })
|
|
892
521
|
], CheckboxFormControl.prototype, "checked", 2);
|
|
893
522
|
|
|
894
|
-
var __defProp$
|
|
895
|
-
var __getOwnPropDesc$
|
|
896
|
-
var __decorateClass$
|
|
897
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
523
|
+
var __defProp$7 = Object.defineProperty;
|
|
524
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
525
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
526
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
898
527
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
899
528
|
if (decorator = decorators[i])
|
|
900
529
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
901
|
-
if (kind && result) __defProp$
|
|
530
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
902
531
|
return result;
|
|
903
532
|
};
|
|
904
533
|
const GROUP_CONTROL_SELECTOR = "odx-checkbox-group-control";
|
|
@@ -986,22 +615,22 @@ const _CheckboxGroupFormControl = class _CheckboxGroupFormControl extends FormCo
|
|
|
986
615
|
return this.elements.filter((element) => this.isControl(element) && predicate(element));
|
|
987
616
|
}
|
|
988
617
|
};
|
|
989
|
-
__decorateClass$
|
|
618
|
+
__decorateClass$7([
|
|
990
619
|
queryAssignedElements({ flatten: true })
|
|
991
620
|
], _CheckboxGroupFormControl.prototype, "elements", 2);
|
|
992
|
-
__decorateClass$
|
|
621
|
+
__decorateClass$7([
|
|
993
622
|
property({ type: Array })
|
|
994
623
|
], _CheckboxGroupFormControl.prototype, "value", 2);
|
|
995
624
|
let CheckboxGroupFormControl = _CheckboxGroupFormControl;
|
|
996
625
|
|
|
997
|
-
var __defProp$
|
|
998
|
-
var __getOwnPropDesc$
|
|
999
|
-
var __decorateClass$
|
|
1000
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
626
|
+
var __defProp$6 = Object.defineProperty;
|
|
627
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
628
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
629
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
1001
630
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1002
631
|
if (decorator = decorators[i])
|
|
1003
632
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1004
|
-
if (kind && result) __defProp$
|
|
633
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
1005
634
|
return result;
|
|
1006
635
|
};
|
|
1007
636
|
class OptionControl extends CanBeDisabled(CustomElement) {
|
|
@@ -1031,21 +660,21 @@ class OptionControl extends CanBeDisabled(CustomElement) {
|
|
|
1031
660
|
}
|
|
1032
661
|
}
|
|
1033
662
|
}
|
|
1034
|
-
__decorateClass$
|
|
663
|
+
__decorateClass$6([
|
|
1035
664
|
property({ type: Boolean })
|
|
1036
665
|
], OptionControl.prototype, "selected", 2);
|
|
1037
|
-
__decorateClass$
|
|
666
|
+
__decorateClass$6([
|
|
1038
667
|
property()
|
|
1039
668
|
], OptionControl.prototype, "value", 2);
|
|
1040
669
|
|
|
1041
|
-
var __defProp$
|
|
1042
|
-
var __getOwnPropDesc$
|
|
1043
|
-
var __decorateClass$
|
|
1044
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
670
|
+
var __defProp$5 = Object.defineProperty;
|
|
671
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
672
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
673
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
1045
674
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1046
675
|
if (decorator = decorators[i])
|
|
1047
676
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1048
|
-
if (kind && result) __defProp$
|
|
677
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
1049
678
|
return result;
|
|
1050
679
|
};
|
|
1051
680
|
class RadioGroupFormControl extends FormControl(CustomElement) {
|
|
@@ -1114,18 +743,18 @@ class RadioGroupFormControl extends FormControl(CustomElement) {
|
|
|
1114
743
|
this.value = target.value;
|
|
1115
744
|
};
|
|
1116
745
|
}
|
|
1117
|
-
__decorateClass$
|
|
746
|
+
__decorateClass$5([
|
|
1118
747
|
queryAssignedElements({ flatten: true })
|
|
1119
748
|
], RadioGroupFormControl.prototype, "elements", 2);
|
|
1120
749
|
|
|
1121
|
-
var __defProp$
|
|
1122
|
-
var __getOwnPropDesc$
|
|
1123
|
-
var __decorateClass$
|
|
1124
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
750
|
+
var __defProp$4 = Object.defineProperty;
|
|
751
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
752
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
753
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
1125
754
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1126
755
|
if (decorator = decorators[i])
|
|
1127
756
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1128
|
-
if (kind && result) __defProp$
|
|
757
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
1129
758
|
return result;
|
|
1130
759
|
};
|
|
1131
760
|
class SelectFormControl extends FormControl(
|
|
@@ -1211,13 +840,50 @@ class SelectFormControl extends FormControl(
|
|
|
1211
840
|
}
|
|
1212
841
|
#handleClick;
|
|
1213
842
|
}
|
|
1214
|
-
__decorateClass$
|
|
843
|
+
__decorateClass$4([
|
|
1215
844
|
property({ type: Boolean, reflect: true })
|
|
1216
845
|
], SelectFormControl.prototype, "multiple", 2);
|
|
1217
|
-
__decorateClass$
|
|
846
|
+
__decorateClass$4([
|
|
1218
847
|
property()
|
|
1219
848
|
], SelectFormControl.prototype, "value", 2);
|
|
1220
849
|
|
|
850
|
+
var __defProp$3 = Object.defineProperty;
|
|
851
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
852
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
853
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
854
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
855
|
+
if (decorator = decorators[i])
|
|
856
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
857
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
858
|
+
return result;
|
|
859
|
+
};
|
|
860
|
+
const CanBeExpanded = dedupeMixin((superClass) => {
|
|
861
|
+
class CanBeExpandedMixin extends CanBeDisabled(superClass) {
|
|
862
|
+
constructor() {
|
|
863
|
+
super(...arguments);
|
|
864
|
+
this.expanded = false;
|
|
865
|
+
}
|
|
866
|
+
collapse(emitEvent = false) {
|
|
867
|
+
this.toggle(false, emitEvent);
|
|
868
|
+
}
|
|
869
|
+
expand(emitEvent = false) {
|
|
870
|
+
this.toggle(true, emitEvent);
|
|
871
|
+
}
|
|
872
|
+
toggle(force, emitEvent = false) {
|
|
873
|
+
const newState = force ?? !this.expanded;
|
|
874
|
+
if (this.isContextDisabled() || this.expanded === newState) return;
|
|
875
|
+
const currentState = this.expanded;
|
|
876
|
+
this.expanded = newState;
|
|
877
|
+
if (!emitEvent || !this.emit(newState ? "expand" : "collapse", { composed: true, bubbles: true })) return;
|
|
878
|
+
this.expanded = currentState;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
__decorateClass$3([
|
|
882
|
+
property({ type: Boolean })
|
|
883
|
+
], CanBeExpandedMixin.prototype, "expanded", 2);
|
|
884
|
+
return CanBeExpandedMixin;
|
|
885
|
+
});
|
|
886
|
+
|
|
1221
887
|
var __defProp$2 = Object.defineProperty;
|
|
1222
888
|
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
1223
889
|
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
@@ -1228,6 +894,39 @@ var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
|
1228
894
|
if (kind && result) __defProp$2(target, key, result);
|
|
1229
895
|
return result;
|
|
1230
896
|
};
|
|
897
|
+
const CanBeSelected = dedupeMixin((superClass) => {
|
|
898
|
+
class CanBeSelectedElement extends superClass {
|
|
899
|
+
constructor() {
|
|
900
|
+
super(...arguments);
|
|
901
|
+
this.selected = false;
|
|
902
|
+
this.ariaSelectedValue = "page";
|
|
903
|
+
}
|
|
904
|
+
willUpdate(props) {
|
|
905
|
+
super.willUpdate(props);
|
|
906
|
+
if (props.has("selected") || props.has("ariaSelectedValue")) {
|
|
907
|
+
this.ariaCurrent = this.selected ? this.ariaSelectedValue : null;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
__decorateClass$2([
|
|
912
|
+
property({ type: Boolean })
|
|
913
|
+
], CanBeSelectedElement.prototype, "selected", 2);
|
|
914
|
+
__decorateClass$2([
|
|
915
|
+
property()
|
|
916
|
+
], CanBeSelectedElement.prototype, "ariaSelectedValue", 2);
|
|
917
|
+
return CanBeSelectedElement;
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
var __defProp$1 = Object.defineProperty;
|
|
921
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
922
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
923
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
924
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
925
|
+
if (decorator = decorators[i])
|
|
926
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
927
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
928
|
+
return result;
|
|
929
|
+
};
|
|
1231
930
|
const MIN_STEP_VALUE = 1 / 2 ^ 16;
|
|
1232
931
|
const NumberControl = dedupeMixin((superClass) => {
|
|
1233
932
|
class NumberControlElement extends FormControl(superClass) {
|
|
@@ -1262,73 +961,21 @@ const NumberControl = dedupeMixin((superClass) => {
|
|
|
1262
961
|
return String(this.value);
|
|
1263
962
|
}
|
|
1264
963
|
}
|
|
1265
|
-
__decorateClass$
|
|
964
|
+
__decorateClass$1([
|
|
1266
965
|
property({ type: Number })
|
|
1267
966
|
], NumberControlElement.prototype, "min", 2);
|
|
1268
|
-
__decorateClass$
|
|
967
|
+
__decorateClass$1([
|
|
1269
968
|
property({ type: Number })
|
|
1270
969
|
], NumberControlElement.prototype, "max", 2);
|
|
1271
|
-
__decorateClass$
|
|
970
|
+
__decorateClass$1([
|
|
1272
971
|
property({ type: Number })
|
|
1273
972
|
], NumberControlElement.prototype, "step", 2);
|
|
1274
|
-
__decorateClass$
|
|
973
|
+
__decorateClass$1([
|
|
1275
974
|
property({ type: Number, reflect: true })
|
|
1276
975
|
], NumberControlElement.prototype, "value", 2);
|
|
1277
976
|
return NumberControlElement;
|
|
1278
977
|
});
|
|
1279
978
|
|
|
1280
|
-
const uniqueIdCache = /* @__PURE__ */ new Map();
|
|
1281
|
-
function getUniqueId(key) {
|
|
1282
|
-
const nextIndex = (uniqueIdCache.get(key) ?? 0) + 1;
|
|
1283
|
-
uniqueIdCache.set(key, nextIndex);
|
|
1284
|
-
return `${key}-${nextIndex}`;
|
|
1285
|
-
}
|
|
1286
|
-
function clearUniqueIdCache(key) {
|
|
1287
|
-
if (key) {
|
|
1288
|
-
uniqueIdCache.delete(key);
|
|
1289
|
-
} else {
|
|
1290
|
-
uniqueIdCache.clear();
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
var __defProp$1 = Object.defineProperty;
|
|
1295
|
-
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
1296
|
-
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
1297
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
1298
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1299
|
-
if (decorator = decorators[i])
|
|
1300
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1301
|
-
if (kind && result) __defProp$1(target, key, result);
|
|
1302
|
-
return result;
|
|
1303
|
-
};
|
|
1304
|
-
const WithAriaControls = dedupeMixin((superClass) => {
|
|
1305
|
-
class WithAriaControlsElement extends CanBeDisabled(superClass) {
|
|
1306
|
-
get region() {
|
|
1307
|
-
return this.nextElementSibling;
|
|
1308
|
-
}
|
|
1309
|
-
updateA11yAttributes() {
|
|
1310
|
-
if (!this.region) return;
|
|
1311
|
-
this.id ||= getUniqueId(this.localName);
|
|
1312
|
-
this.role ||= "button";
|
|
1313
|
-
this.region.role ||= "region";
|
|
1314
|
-
this.region.id ||= `${this.id}-region`;
|
|
1315
|
-
this.region.ariaHidden = this.disabled ? "true" : this.region.ariaHidden;
|
|
1316
|
-
this.setAttribute("aria-controls", this.region.id);
|
|
1317
|
-
this.region.setAttribute("aria-labelledby", this.id);
|
|
1318
|
-
}
|
|
1319
|
-
update(props) {
|
|
1320
|
-
super.update(props);
|
|
1321
|
-
if (props.has("disabled") || props.has("id")) {
|
|
1322
|
-
this.updateA11yAttributes();
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
__decorateClass$1([
|
|
1327
|
-
property({ reflect: true })
|
|
1328
|
-
], WithAriaControlsElement.prototype, "id", 2);
|
|
1329
|
-
return WithAriaControlsElement;
|
|
1330
|
-
});
|
|
1331
|
-
|
|
1332
979
|
var __defProp = Object.defineProperty;
|
|
1333
980
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1334
981
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -1366,9 +1013,50 @@ function parseDate(value) {
|
|
|
1366
1013
|
return Number.isNaN(date.getTime()) ? null : date;
|
|
1367
1014
|
}
|
|
1368
1015
|
|
|
1369
|
-
|
|
1016
|
+
const uniqueIdCache = /* @__PURE__ */ new Map();
|
|
1017
|
+
function getUniqueId(key) {
|
|
1018
|
+
const nextIndex = (uniqueIdCache.get(key) ?? 0) + 1;
|
|
1019
|
+
uniqueIdCache.set(key, nextIndex);
|
|
1020
|
+
return `${key}-${nextIndex}`;
|
|
1021
|
+
}
|
|
1022
|
+
function clearUniqueIdCache(key) {
|
|
1023
|
+
if (key) {
|
|
1024
|
+
uniqueIdCache.delete(key);
|
|
1025
|
+
} else {
|
|
1026
|
+
uniqueIdCache.clear();
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function search(value, searchString, callback) {
|
|
1031
|
+
let index = 0;
|
|
1032
|
+
while (index < value.length) {
|
|
1033
|
+
index = value.indexOf(searchString, index);
|
|
1034
|
+
if (index === -1) break;
|
|
1035
|
+
callback?.(index);
|
|
1036
|
+
index += searchString.length;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
function searchTextContent(options) {
|
|
1040
|
+
const query = options.query?.trim().toLowerCase();
|
|
1041
|
+
const ranges = [];
|
|
1042
|
+
if (!query || query.length < options.minlength) return ranges;
|
|
1043
|
+
const walker = document.createTreeWalker(options.root, NodeFilter.SHOW_TEXT);
|
|
1044
|
+
while (walker.nextNode()) {
|
|
1045
|
+
const content = walker.currentNode.textContent?.toLowerCase();
|
|
1046
|
+
if (!content?.includes(query)) continue;
|
|
1047
|
+
search(content, query, (index) => {
|
|
1048
|
+
const range = new Range();
|
|
1049
|
+
range.setStart(walker.currentNode, index);
|
|
1050
|
+
range.setEnd(walker.currentNode, index + query.length);
|
|
1051
|
+
ranges.push(range);
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
return ranges;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
function createIntersectionObserver(callback, options) {
|
|
1370
1058
|
try {
|
|
1371
|
-
return new IntersectionObserver(callback);
|
|
1059
|
+
return new IntersectionObserver(callback, options);
|
|
1372
1060
|
} catch {
|
|
1373
1061
|
return { root: null, rootMargin: "", thresholds: [], takeRecords: () => [], observe: () => void 0, disconnect: () => void 0, unobserve: () => void 0 };
|
|
1374
1062
|
}
|
|
@@ -1439,10 +1127,4 @@ class SharedResizeObserverInstance {
|
|
|
1439
1127
|
}
|
|
1440
1128
|
const SharedResizeObserver = new SharedResizeObserverInstance();
|
|
1441
1129
|
|
|
1442
|
-
|
|
1443
|
-
return value.replaceAll(/\{\{\s*([^}\s]+)\s*}}/g, (match, variableName) => {
|
|
1444
|
-
return context[variableName] ? interpolate(context[variableName].toString(), context) : match;
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
export { CanBeDisabled, CanBeReadonly, CanBeRequired, CanBeValidated, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, FocusGroupController, FocusTrapController, FormControl, KeyboardKey, NumberControl, OptionControl, RadioGroupFormControl, RovingTabindexController, SelectFormControl, SharedIntersectionObserver, SharedResizeObserver, WithAriaControls, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createOptions, createResizeObserver, customElement, dedupeMixin, emptySlotFallbackFix, findClosestDocument, fromAriaBooleanAttribute, getAssignedElements, getElementFromEvent, getKeyboardEventInfo, getUniqueId, interpolate, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
|
|
1130
|
+
export { CanBeDisabled, CanBeExpanded, CanBeReadonly, CanBeRequired, CanBeSelected, CanBeValidated, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, FocusTrapController, FormControl, KeyboardKey, NumberControl, OptionControl, RadioGroupFormControl, SelectFormControl, SharedIntersectionObserver, SharedResizeObserver, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createOptions, createResizeObserver, customElement, dedupeMixin, emptySlotFallbackFix, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getAssignedElements, getElementFromEvent, getKeyboardEventInfo, getUniqueId, isCustomElementClass, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, searchTextContent, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
|