@odx/foundation 1.0.0-beta.27 → 1.0.0-beta.270
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/CHANGELOG.md +208 -0
- package/README.md +38 -15
- package/dist/_virtual_class-decorator-runtime.js +13 -0
- package/dist/active-descendants-controller.js +308 -0
- package/dist/components/abstract/button-control-element.d.ts +23 -0
- package/dist/components/abstract/control-element.d.ts +36 -0
- package/dist/components/abstract/dialog-element.d.ts +61 -0
- package/dist/components/abstract/input-control-element.d.ts +36 -0
- package/dist/components/abstract/link-control-element.d.ts +20 -0
- package/dist/components/abstract/listbox-control-element.d.ts +32 -0
- package/dist/components/accordion/accordion.d.ts +31 -6
- package/dist/components/accordion-item/accordion-item.d.ts +25 -0
- package/dist/components/accordion-panel/accordion-panel.d.ts +22 -0
- package/dist/components/action-button/action-button.d.ts +27 -0
- package/dist/components/action-group/action-group.d.ts +17 -0
- package/dist/components/anchor-navigation/anchor-navigation.d.ts +10 -7
- package/dist/components/area-footer/area-footer.d.ts +29 -0
- package/dist/components/area-header/area-header.d.ts +7 -4
- package/dist/components/autocomplete/autocomplete.d.ts +27 -0
- package/dist/components/avatar/avatar.d.ts +20 -11
- package/dist/components/badge/badge.d.ts +23 -6
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +20 -7
- package/dist/components/button/button.d.ts +19 -37
- package/dist/components/button-group/button-group.d.ts +12 -5
- package/dist/components/card/card.d.ts +22 -3
- package/dist/components/checkbox/checkbox.d.ts +29 -6
- package/dist/components/checkbox-group/checkbox-group.d.ts +10 -8
- package/dist/components/chip/chip.d.ts +8 -5
- package/dist/components/drawer/drawer.d.ts +22 -0
- package/dist/components/dropdown/dropdown.d.ts +23 -16
- package/dist/components/empty-state/empty-state.d.ts +46 -0
- package/dist/components/form-field/form-field.d.ts +3 -4
- package/dist/components/format/base-format.d.ts +2 -2
- package/dist/components/format/format-bytes.d.ts +1 -1
- package/dist/components/format/format-number.d.ts +1 -1
- package/dist/components/format/{index.d.ts → format.d.ts} +1 -1
- package/dist/components/format/relative-time.d.ts +2 -2
- package/dist/components/gradient-overlay/gradient-overlay.d.ts +23 -0
- package/dist/components/header/header.d.ts +13 -2
- package/dist/components/highlight/highlight.d.ts +31 -7
- package/dist/components/icon-button/icon-button.d.ts +25 -17
- package/dist/components/image/image.d.ts +5 -5
- package/dist/components/inline-message/inline-message.d.ts +22 -7
- package/dist/components/input/input.d.ts +41 -13
- package/dist/components/input-number/input-number.d.ts +39 -0
- package/dist/components/key-value/key-value.d.ts +53 -0
- package/dist/components/key-value-list/key-value-list.d.ts +15 -0
- package/dist/components/label/label.d.ts +11 -0
- package/dist/components/line-clamp/line-clamp.d.ts +3 -3
- package/dist/components/link/link.d.ts +12 -4
- package/dist/components/list/list.d.ts +11 -5
- package/dist/components/list-item/list-item.d.ts +39 -0
- package/dist/components/listbox/listbox.d.ts +28 -0
- package/dist/components/loader.d.ts +2 -0
- package/dist/components/loading-overlay/loading-overlay.d.ts +10 -6
- package/dist/components/loading-spinner/loading-spinner.d.ts +10 -3
- package/dist/components/logo/logo.d.ts +6 -3
- package/dist/components/main-menu/main-menu-button.d.ts +3 -2
- package/dist/components/main-menu/main-menu.d.ts +4 -6
- package/dist/components/main.d.ts +87 -64
- package/dist/components/menu/menu.d.ts +6 -5
- package/dist/components/menu-item/menu-item.d.ts +27 -6
- package/dist/components/modal/modal.d.ts +6 -26
- package/dist/components/modal/modal.service.d.ts +11 -0
- package/dist/components/navigation/navigation.d.ts +20 -0
- package/dist/components/navigation-item/navigation-item.d.ts +11 -15
- package/dist/components/navigation-item-group/navigation-item-group.d.ts +22 -0
- package/dist/components/option/option.d.ts +19 -4
- package/dist/components/page/page.d.ts +15 -9
- package/dist/components/page-layout/page-layout.d.ts +10 -1
- package/dist/components/pagination/pagination.d.ts +3 -2
- package/dist/components/popover/compute-popover-placement.d.ts +13 -0
- package/dist/components/popover/popover-host.d.ts +42 -0
- package/dist/components/popover/popover-observer.d.ts +10 -0
- package/dist/{cdk → components}/popover/popover.d.ts +3 -2
- package/dist/components/progress-bar/base-progress.d.ts +23 -0
- package/dist/components/progress-bar/progress-bar.d.ts +3 -19
- package/dist/components/progress-ring/progress-ring.d.ts +31 -0
- package/dist/components/radio-button/radio-button.d.ts +5 -4
- package/dist/components/radio-group/radio-group.d.ts +17 -6
- package/dist/components/rail-navigation/rail-navigation.d.ts +6 -7
- package/dist/components/scroll-container/scroll-container.d.ts +37 -0
- package/dist/components/select/select.d.ts +16 -11
- package/dist/components/separator/separator.d.ts +8 -6
- package/dist/components/sheet/sheet.d.ts +27 -0
- package/dist/components/sidebar/sidebar.d.ts +30 -0
- package/dist/components/skeleton/skeleton.d.ts +12 -18
- package/dist/components/slider/slider-handle.d.ts +31 -11
- package/dist/components/slider/slider-marks.d.ts +2 -3
- package/dist/components/slider/slider.d.ts +7 -5
- package/dist/components/slider/slider.models.d.ts +4 -4
- package/dist/components/status/status.d.ts +9 -5
- package/dist/components/switch/switch.d.ts +4 -3
- package/dist/components/tab-bar/tab-bar.d.ts +41 -0
- package/dist/components/table/table-body.d.ts +1 -3
- package/dist/components/table/table-cell.d.ts +1 -3
- package/dist/components/table/table-checkbox-cell.d.ts +2 -2
- package/dist/components/table/table-header-cell.d.ts +1 -1
- package/dist/components/table/table-header.d.ts +5 -3
- package/dist/components/table/table-row.d.ts +3 -3
- package/dist/components/table/table.d.ts +7 -1
- package/dist/components/text/text.d.ts +10 -5
- package/dist/components/textarea/textarea.d.ts +22 -0
- package/dist/components/tile/tile.d.ts +37 -0
- package/dist/components/title/title.d.ts +13 -7
- package/dist/components/toast/toast.d.ts +10 -4
- package/dist/components/toggle-button/toggle-button.d.ts +32 -6
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +25 -0
- package/dist/components/toggle-content/toggle-content.d.ts +4 -4
- package/dist/components/toolbar/toolbar.d.ts +15 -0
- package/dist/components/tooltip/tooltip.d.ts +41 -5
- package/dist/components/translate/translate.d.ts +2 -2
- package/dist/components-loader.js +3 -0
- package/dist/components.js +4980 -4129
- package/dist/dom.js +86 -0
- package/dist/en.js +6 -0
- package/dist/i18n/{lib/format.d.ts → format.d.ts} +1 -0
- package/dist/i18n/{lib/is-localized.d.ts → is-localized.d.ts} +2 -2
- package/dist/i18n/{lib/localization.d.ts → localization.d.ts} +0 -1
- package/dist/i18n/main.d.ts +19 -6
- package/dist/i18n/translate.d.ts +6 -0
- package/dist/i18n/translations/en.json.d.ts +26 -0
- package/dist/i18n/types.d.ts +14 -0
- package/dist/i18n.js +67 -64
- package/dist/lib/behaviors/can-be-collapsed.d.ts +14 -0
- package/dist/lib/behaviors/can-be-disabled.d.ts +9 -0
- package/dist/lib/behaviors/can-be-expanded.d.ts +15 -0
- package/dist/lib/behaviors/checkbox-control.d.ts +16 -0
- package/dist/lib/behaviors/checkbox-group-control.d.ts +22 -0
- package/dist/lib/behaviors/form-associated.d.ts +21 -0
- package/dist/lib/behaviors/with-presets.d.ts +12 -0
- package/dist/lib/breakpoints-utils.d.ts +28 -0
- package/dist/lib/breakpoints.d.ts +30 -0
- package/dist/lib/controllers/active-descendants-controller.d.ts +27 -0
- package/dist/lib/controllers/drag.controller.d.ts +36 -0
- package/dist/lib/controllers/expandable-controller.d.ts +6 -10
- package/dist/lib/custom-element.d.ts +18 -5
- package/dist/lib/dark-mode.d.ts +12 -0
- package/dist/lib/models.d.ts +68 -0
- package/dist/lib/signals.d.ts +13 -0
- package/dist/main.d.ts +17 -0
- package/dist/main.js +585 -794
- package/dist/oss-licenses.json +37 -0
- package/dist/styles.css +1 -1
- package/dist/utils/attribute-directive.d.ts +20 -0
- package/dist/utils/command-directive.d.ts +22 -0
- package/dist/utils/dedupe-mixin.d.ts +3 -0
- package/dist/utils/detect-keyboard-focus.d.ts +3 -0
- package/dist/utils/dom-events.d.ts +17 -0
- package/dist/utils/dom-renderer.d.ts +16 -0
- package/dist/{lib/types/a11y.d.ts → utils/dom-types.d.ts} +1 -17
- package/dist/utils/dom.d.ts +19 -0
- package/dist/utils/lit.d.ts +7 -0
- package/dist/utils/main.d.ts +16 -0
- package/dist/utils/math.d.ts +10 -0
- package/dist/utils/shared-event-listener.d.ts +3 -0
- package/dist/utils/shared-media-observer.d.ts +4 -0
- package/dist/utils/shared-resize-observer.d.ts +3 -0
- package/dist/utils.js +368 -0
- package/dist/vendor.js +1926 -0
- package/package.json +47 -30
- package/dist/cdk/control/checkbox-form-control.d.ts +0 -15
- package/dist/cdk/control/checkbox-group-form-control.d.ts +0 -21
- package/dist/cdk/control/listbox-form-control.d.ts +0 -22
- package/dist/cdk/control/option-control.d.ts +0 -24
- package/dist/cdk/control/radio-group-form-control.d.ts +0 -22
- package/dist/cdk/drag-drop/drag-events.d.ts +0 -9
- package/dist/cdk/drag-drop/drag.controller.d.ts +0 -18
- package/dist/cdk/drag-drop/is-draggable.d.ts +0 -18
- package/dist/cdk/interactive/interactive-element.d.ts +0 -28
- package/dist/cdk/interactive/interactive-link.d.ts +0 -15
- package/dist/cdk/main.d.ts +0 -14
- package/dist/cdk/popover/popover-host.d.ts +0 -25
- package/dist/cdk/popover/popover.models.d.ts +0 -35
- package/dist/cdk/popover/popover.utils.d.ts +0 -5
- package/dist/cdk.js +0 -939
- package/dist/components/accordion/accordion-header.d.ts +0 -18
- package/dist/components/accordion/accordion-panel.d.ts +0 -13
- package/dist/components/accordion/index.d.ts +0 -4
- package/dist/components/anchor-navigation/anchor-observer.d.ts +0 -11
- package/dist/components/anchor-navigation/index.d.ts +0 -3
- package/dist/components/area-header/index.d.ts +0 -2
- package/dist/components/avatar/index.d.ts +0 -2
- package/dist/components/avatar-group/avatar-group.d.ts +0 -15
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/badge/index.d.ts +0 -2
- package/dist/components/breadcrumbs/breadcrumbs-item.d.ts +0 -17
- package/dist/components/breadcrumbs/index.d.ts +0 -3
- package/dist/components/button/index.d.ts +0 -2
- package/dist/components/button-group/index.d.ts +0 -2
- package/dist/components/card/index.d.ts +0 -2
- package/dist/components/checkbox/index.d.ts +0 -2
- package/dist/components/checkbox-group/index.d.ts +0 -2
- package/dist/components/chip/index.d.ts +0 -2
- package/dist/components/circular-progress-bar/circular-progress-bar.d.ts +0 -50
- package/dist/components/circular-progress-bar/index.d.ts +0 -2
- package/dist/components/combobox/combobox.d.ts +0 -20
- package/dist/components/combobox/index.d.ts +0 -2
- package/dist/components/content-box/content-box.d.ts +0 -11
- package/dist/components/content-box/index.d.ts +0 -2
- package/dist/components/dropdown/index.d.ts +0 -2
- package/dist/components/form-field/index.d.ts +0 -2
- package/dist/components/header/header-actions.d.ts +0 -10
- package/dist/components/header/index.d.ts +0 -3
- package/dist/components/headline/headline.d.ts +0 -21
- package/dist/components/headline/index.d.ts +0 -2
- package/dist/components/highlight/index.d.ts +0 -2
- package/dist/components/icon-button/index.d.ts +0 -2
- package/dist/components/image/index.d.ts +0 -2
- package/dist/components/inline-message/index.d.ts +0 -2
- package/dist/components/input/index.d.ts +0 -2
- package/dist/components/line-clamp/index.d.ts +0 -2
- package/dist/components/link/base-link.d.ts +0 -15
- package/dist/components/link/index.d.ts +0 -3
- package/dist/components/list/index.d.ts +0 -3
- package/dist/components/list/list-item.d.ts +0 -26
- package/dist/components/loading-overlay/index.d.ts +0 -2
- package/dist/components/loading-spinner/index.d.ts +0 -2
- package/dist/components/logo/index.d.ts +0 -2
- package/dist/components/main-menu/index.d.ts +0 -6
- package/dist/components/main-menu/main-menu-link.d.ts +0 -9
- package/dist/components/main-menu/main-menu-subtitle.d.ts +0 -12
- package/dist/components/main-menu/main-menu-title.d.ts +0 -12
- package/dist/components/menu/index.d.ts +0 -3
- package/dist/components/menu/menu-label.d.ts +0 -9
- package/dist/components/menu-item/index.d.ts +0 -2
- package/dist/components/modal/index.d.ts +0 -2
- package/dist/components/navigation-item/index.d.ts +0 -2
- package/dist/components/option/index.d.ts +0 -2
- package/dist/components/page/index.d.ts +0 -2
- package/dist/components/page-layout/index.d.ts +0 -2
- package/dist/components/pagination/index.d.ts +0 -2
- package/dist/components/progress-bar/index.d.ts +0 -2
- package/dist/components/radio-button/index.d.ts +0 -2
- package/dist/components/radio-group/index.d.ts +0 -2
- package/dist/components/rail-navigation/index.d.ts +0 -2
- package/dist/components/search-bar/index.d.ts +0 -3
- package/dist/components/search-bar/search-bar.d.ts +0 -31
- package/dist/components/search-bar/search-bar.events.d.ts +0 -7
- package/dist/components/select/index.d.ts +0 -2
- package/dist/components/separator/index.d.ts +0 -2
- package/dist/components/skeleton/index.d.ts +0 -2
- package/dist/components/slider/index.d.ts +0 -5
- package/dist/components/spacer/index.d.ts +0 -2
- package/dist/components/spacer/spacer.d.ts +0 -13
- package/dist/components/spinbox/index.d.ts +0 -2
- package/dist/components/spinbox/spinbox.d.ts +0 -20
- package/dist/components/stack/index.d.ts +0 -3
- package/dist/components/stack/stack.d.ts +0 -17
- package/dist/components/stack/stack.models.d.ts +0 -26
- package/dist/components/status/index.d.ts +0 -2
- package/dist/components/switch/index.d.ts +0 -2
- package/dist/components/table/index.d.ts +0 -9
- package/dist/components/table/table.models.d.ts +0 -10
- package/dist/components/text/index.d.ts +0 -2
- package/dist/components/title/index.d.ts +0 -2
- package/dist/components/toast/index.d.ts +0 -2
- package/dist/components/toggle-button/index.d.ts +0 -2
- package/dist/components/toggle-content/index.d.ts +0 -2
- package/dist/components/tooltip/index.d.ts +0 -2
- package/dist/components/translate/index.d.ts +0 -2
- package/dist/components/visually-hidden/index.d.ts +0 -2
- package/dist/components/visually-hidden/visually-hidden.d.ts +0 -11
- package/dist/i18n/lib/translate.d.ts +0 -11
- package/dist/lib/controllers/active-desendants-controller.d.ts +0 -25
- package/dist/lib/controllers/focus-trap.controller.d.ts +0 -14
- package/dist/lib/main.d.ts +0 -35
- package/dist/lib/mixins/can-be-disabled.d.ts +0 -15
- package/dist/lib/mixins/can-be-expanded.d.ts +0 -10
- package/dist/lib/mixins/can-be-highlighted.d.ts +0 -8
- package/dist/lib/mixins/can-be-readonly.d.ts +0 -7
- package/dist/lib/mixins/can-be-required.d.ts +0 -7
- package/dist/lib/mixins/can-be-selected.d.ts +0 -9
- package/dist/lib/mixins/can-be-validated.d.ts +0 -12
- package/dist/lib/mixins/form-control.d.ts +0 -17
- package/dist/lib/mixins/number-control.d.ts +0 -12
- package/dist/lib/mixins/with-loading-state.d.ts +0 -8
- package/dist/lib/models/shape.d.ts +0 -7
- package/dist/lib/models/size.d.ts +0 -11
- package/dist/lib/models/variant.d.ts +0 -12
- package/dist/lib/types/utils.d.ts +0 -2
- package/dist/lib/utils/date.d.ts +0 -2
- package/dist/lib/utils/dedupe-mixin.d.ts +0 -3
- package/dist/lib/utils/dom.d.ts +0 -14
- package/dist/lib/utils/get-unique-id.d.ts +0 -36
- package/dist/lib/utils/keyboard-events.d.ts +0 -43
- package/dist/lib/utils/lit.d.ts +0 -5
- package/dist/lib/utils/query-assigned-element.d.ts +0 -16
- package/dist/lib/utils/search-text-content.d.ts +0 -8
- package/dist/lib/utils/shared-intersection-observer.d.ts +0 -18
- package/dist/lib/utils/shared-resize-observer.d.ts +0 -18
- package/dist/lib/utils/transformers.d.ts +0 -3
- package/dist/loader/main.d.ts +0 -2
- package/dist/loader.js +0 -11
- package/dist/vendor-Cef33Vym.js +0 -149
- /package/dist/i18n/{lib/config.d.ts → config.d.ts} +0 -0
- /package/dist/i18n/{lib/models.d.ts → models.d.ts} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
## 1.0.0-beta.270
|
|
2
|
+
|
|
3
|
+
### Major Changes
|
|
4
|
+
|
|
5
|
+
- Remove `odx-search-bar` component, use `odx-input` with `type="search"` instead
|
|
6
|
+
- Remove `alignment` from `odx-area-header`
|
|
7
|
+
- Remove `warning` variant from button-like components, affected components:
|
|
8
|
+
- `odx-button`
|
|
9
|
+
- `odx-icon-button`
|
|
10
|
+
- `odx-action-button`
|
|
11
|
+
- Align breakpoint names and values with Figma:
|
|
12
|
+
- Add `xl` (991px - 1281px)
|
|
13
|
+
- Change `mobile` to `sm` (0 - 480px)
|
|
14
|
+
- Change `tablet` to `md` (480 - 769px)
|
|
15
|
+
- Change `desktop` to `lg` (769px - 991px)
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Always capitalize first letter of button-like components, affected components:
|
|
20
|
+
- `odx-button`
|
|
21
|
+
- `odx-icon-button`
|
|
22
|
+
- `odx-action-button`
|
|
23
|
+
- Add search icon to `odx-input` when `type="search"` and forward search event based on `behavior` and `debounce` properties
|
|
24
|
+
- Add `backdrop-inverse` property to `odx-loading-overlay` component to use inverse backdrop color
|
|
25
|
+
- Rename default slot of `odx-loading-overlay` to `spinner` to prevent empty slot bug
|
|
26
|
+
- Remove `size="sm"` from `odx-header`, use `size="md"` instead
|
|
27
|
+
- Make control labels available to customization via CSS parts API: `::part(label)`
|
|
28
|
+
- Inline `odx-logo` resources to reduce number of network requests
|
|
29
|
+
- Simplify `odx-key-value` styles for better customization
|
|
30
|
+
- Add `--safe-space` CSS custom property to `odx-area-header` to control minimum space taken by base slot
|
|
31
|
+
- Improve `odx-slider-handle` accessibility and UI feedback during drag interaction
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
- Update design token library
|
|
36
|
+
- Fix area header prefix/suffix alignment issue
|
|
37
|
+
- Fix `odx-area-header` layout issue when used in combination with `odx-action-group`
|
|
38
|
+
- Fix focus state inner outline for `odx-checkbox`, `odx-radio-button`, and `odx-switch` in checked state
|
|
39
|
+
- Fix `odx-toolbar` spacing and overflow issues
|
|
40
|
+
- Fix `odx-list-item` separator for `danger` and `warning` variants and `:hover` state
|
|
41
|
+
- Fix `odx-input` placeholder color
|
|
42
|
+
- Fix `odx-input` and `odx-select` overflow causing missing border-radius
|
|
43
|
+
- Fix inline-start spacing of `odx-logo` slotted into `odx-area-header`
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.0-beta.269
|
|
47
|
+
|
|
48
|
+
### Major Changes
|
|
49
|
+
|
|
50
|
+
- Enable `odx-tooltip` on touch devices by default, use `touch-disabled` to disable it
|
|
51
|
+
- Rename `indicator-placement` to `control-placement`, affected components:
|
|
52
|
+
- `odx-checkbox`
|
|
53
|
+
- `odx-radio-button`
|
|
54
|
+
- `odx-switch`
|
|
55
|
+
|
|
56
|
+
- Rename `hover-only` to `click-disabled`, affected components:
|
|
57
|
+
- `odx-tooltip`
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- Add touch targets of `40px` to interactive elements for better accessibility on touch devices
|
|
62
|
+
- Add `touch-disabled` to `odx-tooltip` to disable it on touch devices
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
- Fix `odx-rail-navigation` transition animation when expanding/collapsing
|
|
68
|
+
- Fix cursor styles for `odx-checkbox`, `odx-radio-button`, and `odx-switch` when disabled
|
|
69
|
+
- Add missing box-shadow to `odx-tile` interactive-selected state
|
|
70
|
+
- Prevent `:hover` styles to be applied on parent control if a child interactive element is hovered
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## 1.0.0-beta.268
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
- Only apply `:hover` styles on non-touch devices to prevent sticky hover states
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## 1.0.0-beta.267
|
|
81
|
+
|
|
82
|
+
### Minor Changes
|
|
83
|
+
|
|
84
|
+
- Remove HTML `part` attribute if not needed to reduce shadow DOM complexity
|
|
85
|
+
|
|
86
|
+
### Bug Fixes
|
|
87
|
+
|
|
88
|
+
- Disable native touch interaction feedback on elements which have an `:active` state
|
|
89
|
+
- Fix nested control spacing issue
|
|
90
|
+
- Fix tabindex issue when `odx-checkbox-group` and `odx-radio-group` become enabled
|
|
91
|
+
- Fix remove event not firing on `odx-chip` component
|
|
92
|
+
|
|
93
|
+
### Misc
|
|
94
|
+
|
|
95
|
+
- Cleanup component templates and styles to reduce shadow DOM complexity
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.0-beta.266
|
|
99
|
+
|
|
100
|
+
### Major Changes
|
|
101
|
+
|
|
102
|
+
- Rename `indicator-position` to `indicator-placement`, affected components:
|
|
103
|
+
- `odx-accordion`
|
|
104
|
+
- `odx-checkbox`
|
|
105
|
+
- `odx-radio`
|
|
106
|
+
- `odx-switch`
|
|
107
|
+
-
|
|
108
|
+
- Rename `position` property to `placement` in dialog related components:
|
|
109
|
+
- `odx-dialog`
|
|
110
|
+
- `odx-drawer`
|
|
111
|
+
- Rename `badge-position` to `badge-placement` in button related component
|
|
112
|
+
|
|
113
|
+
### Minor Changes
|
|
114
|
+
|
|
115
|
+
- Add `odx-sheet` component
|
|
116
|
+
- Add `bottom` placement option to `odx-drawer`
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Bug Fixes
|
|
120
|
+
|
|
121
|
+
- Fix `odx-card` outer spacing
|
|
122
|
+
- Fix modal styles
|
|
123
|
+
|
|
124
|
+
## 1.0.0-beta.265
|
|
125
|
+
|
|
126
|
+
### Minor Changes
|
|
127
|
+
|
|
128
|
+
- Add `debounce` property to `odx-input` and `odx-search-bar` components to control input event debouncing
|
|
129
|
+
|
|
130
|
+
### Bug Fixes
|
|
131
|
+
|
|
132
|
+
- Disable `:hover` styles on touch devices to prevent sticky hover states
|
|
133
|
+
- Dedupe mixins to prevent multiple instances of the same mixin being applied
|
|
134
|
+
- Make `odx-content` available in shadow DOM
|
|
135
|
+
- Ensuring consistent tap highlight styling across components
|
|
136
|
+
- Adds active state styling to slotted links within breadcrumbs
|
|
137
|
+
- Focus `odx-input` on password reveal
|
|
138
|
+
|
|
139
|
+
## 1.0.0-beta.264
|
|
140
|
+
|
|
141
|
+
### Bug Fixes
|
|
142
|
+
|
|
143
|
+
- Fix `odx-input-number` not emitting change event with updated value
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 1.0.0-beta.263
|
|
147
|
+
|
|
148
|
+
### Bug Fixes
|
|
149
|
+
|
|
150
|
+
- Fix `odx-input` resize issue
|
|
151
|
+
- Fix `odx-input-number` not updating value to boundaries on step up/down
|
|
152
|
+
- Fix value selection issue in `odx-input` component
|
|
153
|
+
- Inject correct `ResizeObserverEntry` into `ResizeObserver` callbacks of global observers
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
## 1.0.0-beta.262
|
|
157
|
+
|
|
158
|
+
### Minor Changes
|
|
159
|
+
|
|
160
|
+
- Update selected options label for multiselection in `odx-select` component to match design spec
|
|
161
|
+
|
|
162
|
+
### Bug Fixes
|
|
163
|
+
|
|
164
|
+
- Fix modal dismiss event firing on text selection by accident
|
|
165
|
+
- Fix `odx-input` value not updating correctly
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## 1.0.0-beta.261
|
|
169
|
+
|
|
170
|
+
### Bug Fixes
|
|
171
|
+
|
|
172
|
+
- Fix `odx-input` type attribute not updating correctly
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
## 1.0.0-beta.260
|
|
176
|
+
|
|
177
|
+
### Major Changes
|
|
178
|
+
|
|
179
|
+
- Remove generic from `FormAssociated` mixin due to issues with type inference in certain scenarios
|
|
180
|
+
- Remove `--_min-width` custom property from control elements, use `min-width` property instead
|
|
181
|
+
|
|
182
|
+
### Minor Changes
|
|
183
|
+
|
|
184
|
+
- New `odx-input-number` component
|
|
185
|
+
- Improve `odx-input` component accessibility and flexibility
|
|
186
|
+
- Add input `loading` state
|
|
187
|
+
- Add auto sizing behavior for input controls
|
|
188
|
+
- Remove CSS parts from `odx-loading-overlay` component
|
|
189
|
+
|
|
190
|
+
### Bug Fixes
|
|
191
|
+
|
|
192
|
+
- Fix positioning of clear action in `odx-input` and `odx-select` components
|
|
193
|
+
- Move `[loading]` styles into button control to prevent leakage to other components
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## 1.0.0-beta.259
|
|
197
|
+
|
|
198
|
+
### Minor Changes
|
|
199
|
+
|
|
200
|
+
- Bump `@odx/design-tokens` dependency to `^3.1.0`
|
|
201
|
+
- Replace object and math utilities by `es-toolkit/*` equivalents
|
|
202
|
+
- Bump `@odx/icons` dependency to `^4.2.0`
|
|
203
|
+
- Use `font-size` property instead of `--size` custom property for icon sizing
|
|
204
|
+
|
|
205
|
+
### Bug Fixes
|
|
206
|
+
|
|
207
|
+
- Fix checkbox control updated hook not calling parent hook
|
|
208
|
+
- Ensure context API is always used in a root context
|
package/README.md
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
|
|
2
2
|
# @odx/foundation
|
|
3
3
|
|
|
4
|
-
The `@odx/foundation` package is
|
|
4
|
+
The `@odx/foundation` package is a core part of the ODX Design System, providing essential building blocks for creating consistent and cohesive user interfaces. This package includes foundational components, styles, and utilities to ensure a unified design across all ODX projects.
|
|
5
5
|
|
|
6
6
|
### Features
|
|
7
7
|
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
- **CSS Framework**: A comprehensive CSS framework that includes layout, typography, and utility classes to streamline styling and ensure consistency
|
|
9
|
+
- **Components**: Reusable web components, including buttons, tables, headers, and more.
|
|
10
|
+
- **i18n**: Internationalization utilities for building multilingual applications, with support for locale changes and translations.
|
|
11
|
+
- **Global Styles**: Comprehensive global styles, including colors, spacing, and themes.
|
|
12
|
+
- **Browser Support**: <a href="https://web-platform-dx.github.io/web-features/supported-browsers/?targetYear=2024" target="_blank">Baseline 2024</a>
|
|
14
13
|
|
|
15
14
|
### Install
|
|
16
15
|
|
|
17
16
|
[<img alt="NPM Version (with dist tag)" src="https://img.shields.io/npm/v/%40odx%2Ffoundation/latest?style=flat-square">](https://npmjs.org/package/@odx/foundation)
|
|
18
17
|
|
|
19
18
|
|
|
20
|
-
To install `@odx/foundation` in your project, run the following command:
|
|
19
|
+
To install `@odx/foundation` and it's peer dependencies in your project, run the following command:
|
|
21
20
|
|
|
22
21
|
```bash
|
|
23
|
-
npm install @odx/foundation @odx/icons
|
|
22
|
+
npm install @odx/foundation @odx/icons --save
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
> We depend on the <a href="https://lit.dev" target="_blank" rel="noopener"
|
|
25
|
+
> We depend on the <a href="https://lit.dev" target="_blank" rel="noopener">Lit package</a> for building web elements because it offers a lightweight, efficient framework with a simple syntax for creating fast, reusable elements. Its powerful templating system ensures high performance and seamless user experience. Lit is also highly interoperable, making it easy to integrate with other frameworks and libraries.
|
|
27
26
|
>
|
|
28
27
|
> [<img src="https://img.shields.io/npm/dependency-version/@odx/foundation/lit" />](https://npmjs.org/package/lit)
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
### Setup
|
|
32
31
|
|
|
33
|
-
> Ensure that you have followed the installation and setup instructions for our [
|
|
32
|
+
> Ensure that you have followed the installation and setup instructions for our [design tokens](https://npmjs.org/package/@odx/design-tokens) library.
|
|
34
33
|
|
|
35
34
|
Once installed, you can import the foundational components and styles into your project:
|
|
36
35
|
|
|
@@ -43,18 +42,42 @@ import '@odx/icons/core';
|
|
|
43
42
|
import '@odx/foundation/loader';
|
|
44
43
|
|
|
45
44
|
// Load styles (in JS)
|
|
46
|
-
import '@odx/foundation/styles';
|
|
45
|
+
import '@odx/foundation/styles';
|
|
46
|
+
|
|
47
47
|
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
```css
|
|
51
|
-
|
|
51
|
+
/* Load styles (in CSS) */
|
|
52
52
|
@import '@odx/foundation/dist/styles.css';
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Framework integration
|
|
57
|
+
|
|
58
|
+
We currently do not provide any framework specific integration for the `@odx/foundation` package. However, you can easily integrate the web components into your framework of choice by following the standard practices for using web components in that framework.
|
|
59
|
+
|
|
60
|
+
#### Angular Example
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { Directive, input } from '@angular/core';
|
|
64
|
+
|
|
65
|
+
@Directive({
|
|
66
|
+
selector: 'odx-title',
|
|
67
|
+
host: { '[attr.size]': 'size() || null' },
|
|
68
|
+
})
|
|
69
|
+
export class Title {
|
|
70
|
+
size = input<'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'>();
|
|
71
|
+
}
|
|
53
72
|
```
|
|
54
73
|
|
|
74
|
+
#### React Example
|
|
75
|
+
|
|
76
|
+
See <a href="https://lit.dev/docs/frameworks/react/" target="_blank">Lit documentation</a> for more information on how to use web components in React.
|
|
77
|
+
|
|
55
78
|
### Documentation
|
|
56
79
|
|
|
57
|
-
For detailed documentation on how to use the `@odx/foundation` package, including examples and best practices, please visit our <a href="https://odx.
|
|
80
|
+
For detailed documentation on how to use the `@odx/foundation` package, including examples and best practices, please visit our <a href="https://ca-odx-storybook-dev.yellowisland-7b13f2d7.westeurope.azurecontainerapps.io/" target="_blank" rel="noopener">storybook documentation</a>.
|
|
58
81
|
|
|
59
82
|
### Contact
|
|
60
|
-
For questions, feedback, or support, please reach out to us through our <a href="https://odx.draeger.com/contact" target="_blank" rel="noopener"
|
|
83
|
+
For questions, feedback, or support, please reach out to us through our <a href="https://odx.draeger.com/contact" target="_blank" rel="noopener">contact page</a>.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
|
|
4
|
+
const __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { __decorateClass as _ };
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
|
|
2
|
+
import { dedupeMixin, toAriaBooleanAttribute, detectKeyboardFocus, interactionResponse, keyboardFocusDirective, getKeyInfo, booleanAttributeDirective } from '@odx/foundation/utils';
|
|
3
|
+
import { property, state } from 'lit/decorators.js';
|
|
4
|
+
import { LitElement, unsafeCSS, html } from 'lit';
|
|
5
|
+
|
|
6
|
+
const CanBeDisabled = dedupeMixin((superClass) => {
|
|
7
|
+
class CanBeDisabledMixin extends superClass {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.disabled = false;
|
|
11
|
+
this.focusDisabled = false;
|
|
12
|
+
}
|
|
13
|
+
#initialTabIndex;
|
|
14
|
+
get focusTarget() {
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
firstUpdated(props) {
|
|
18
|
+
super.firstUpdated(props);
|
|
19
|
+
this.#initialTabIndex = this.focusTarget.hasAttribute("tabindex") ? this.focusTarget.tabIndex : void 0;
|
|
20
|
+
}
|
|
21
|
+
willUpdate(props) {
|
|
22
|
+
super.willUpdate(props);
|
|
23
|
+
if (props.has("disabled")) {
|
|
24
|
+
this.ariaDisabled = toAriaBooleanAttribute(this.disabled);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
updated(props) {
|
|
28
|
+
super.updated(props);
|
|
29
|
+
if (props.has("disabled") || props.has("focusDisabled")) {
|
|
30
|
+
this.#updateTabIndex();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
#updateTabIndex() {
|
|
34
|
+
if (!this.focusTarget) return;
|
|
35
|
+
if (!this.focusDisabled) {
|
|
36
|
+
this.focusTarget.tabIndex = this.disabled ? -1 : this.#initialTabIndex ?? 0;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (this.#initialTabIndex == null) {
|
|
40
|
+
this.focusTarget.tabIndex = -1;
|
|
41
|
+
} else {
|
|
42
|
+
this.focusTarget.removeAttribute("tabindex");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
__decorateClass([
|
|
47
|
+
property({ type: Boolean, reflect: true, useDefault: true })
|
|
48
|
+
], CanBeDisabledMixin.prototype, "disabled", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
property({ type: Boolean, useDefault: true, attribute: "focus-disabled" })
|
|
51
|
+
], CanBeDisabledMixin.prototype, "focusDisabled", 2);
|
|
52
|
+
return CanBeDisabledMixin;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const FormAssociated = dedupeMixin((superClass) => {
|
|
56
|
+
class FormAssociatedBehavior extends CanBeDisabled(superClass) {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.name = "";
|
|
60
|
+
this.value = "";
|
|
61
|
+
this.readonly = false;
|
|
62
|
+
this.required = false;
|
|
63
|
+
this.invalid = false;
|
|
64
|
+
}
|
|
65
|
+
static {
|
|
66
|
+
this.formAssociated = true;
|
|
67
|
+
}
|
|
68
|
+
get form() {
|
|
69
|
+
return this.internals.form;
|
|
70
|
+
}
|
|
71
|
+
get validity() {
|
|
72
|
+
return this.internals.validity;
|
|
73
|
+
}
|
|
74
|
+
get validationMessage() {
|
|
75
|
+
return this.internals.validationMessage;
|
|
76
|
+
}
|
|
77
|
+
get willValidate() {
|
|
78
|
+
return this.internals.willValidate;
|
|
79
|
+
}
|
|
80
|
+
clear() {
|
|
81
|
+
this.value = "";
|
|
82
|
+
}
|
|
83
|
+
checkValidity() {
|
|
84
|
+
return this.internals.checkValidity();
|
|
85
|
+
}
|
|
86
|
+
reportValidity() {
|
|
87
|
+
this.internals.reportValidity();
|
|
88
|
+
}
|
|
89
|
+
setValidity(flags, target = this) {
|
|
90
|
+
if (!flags) {
|
|
91
|
+
this.internals.setValidity({});
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const errorKey = Object.keys(flags).find((key) => flags?.[key] === true);
|
|
95
|
+
this.internals.setValidity(flags, errorKey ?? "unknown error", target);
|
|
96
|
+
}
|
|
97
|
+
toFormValue() {
|
|
98
|
+
return this.value ? String(this.value) : null;
|
|
99
|
+
}
|
|
100
|
+
willUpdate(props) {
|
|
101
|
+
super.willUpdate(props);
|
|
102
|
+
if (props.has("required")) {
|
|
103
|
+
this.ariaRequired = toAriaBooleanAttribute(this.required);
|
|
104
|
+
}
|
|
105
|
+
if (props.has("readonly")) {
|
|
106
|
+
this.ariaReadOnly = toAriaBooleanAttribute(this.readonly);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
updated(props) {
|
|
110
|
+
super.updated(props);
|
|
111
|
+
if (props.has("value")) {
|
|
112
|
+
this.internals.setFormValue(this.toFormValue());
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
__decorateClass([
|
|
117
|
+
property()
|
|
118
|
+
], FormAssociatedBehavior.prototype, "name", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
property({ type: Boolean, reflect: true, useDefault: true })
|
|
121
|
+
], FormAssociatedBehavior.prototype, "readonly", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property({ type: Boolean, reflect: true, useDefault: true })
|
|
124
|
+
], FormAssociatedBehavior.prototype, "required", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ type: Boolean, reflect: true, useDefault: true })
|
|
127
|
+
], FormAssociatedBehavior.prototype, "invalid", 2);
|
|
128
|
+
return FormAssociatedBehavior;
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const styles = "@layer reset{html{box-sizing:border-box}:not(:defined){visibility:hidden}*,:before,:after{box-sizing:inherit}*{scrollbar-width:thin}:where(h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,code,img,svg,small,strike,strong,sub,sup,b,u,i,ol,ul,li,dl,dt,dd,form,label,table,caption,tbody,tfoot,thead,tr,th,td,main,article,aside,canvas,footer,header,nav,section,time,button,video,textarea,input){appearance:none;border:0;margin:0;padding:0}h1,h2,h3,h4,h5,h6{text-wrap:balance}h1,h2,h3,h4,h5,h6,p{overflow-wrap:break-word}p{text-wrap:pretty}img,picture,video,canvas,embed,iframe,object{max-width:100%;display:block}input,button,textarea,select{appearance:none;font-feature-settings:inherit;font-family:inherit;font-size:inherit}input:-webkit-autofill{&,&:hover,&:focus,&:active{border-radius:var(--odx-border-radius-sm);box-shadow:inset 0 0 1em 1em var(--odx-color-background-transparent-selected);font-weight:inherit;-webkit-text-fill-color:var(--odx-color-foreground-rest);background-clip:text;transition:background-color 5000s ease-in-out!important}}[popover]{border:none;outline:none}[hidden]{display:none!important}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important}}}@layer base{.odx-cluster,.odx-flank,.odx-stack{gap:var(--odx-spacing-layout-md);max-width:100%;text-align:inherit;flex-direction:column;justify-content:flex-start;align-items:center;display:flex}.odx-cluster{flex-flow:wrap;align-items:center}.odx-flank{flex-direction:row}.odx-stack{align-items:stretch}.odx-flank:not(.odx-justify-end)>:not(:first-child),.odx-flank.odx-justify-end>:not(:last-child),.odx-fill{flex:1}.odx-shrink{flex:none}.odx-align-baseline,.odx-align-start{align-items:flex-start}.odx-align-center{align-items:center}.odx-align-end{align-items:end}.odx-justify-start{justify-content:flex-start}.odx-justify-end{justify-content:flex-end}.odx-justify-center{justify-content:center}.odx-justify-space-between{justify-content:space-between}.odx-justify-space-around{justify-content:space-around}.odx-justify-space-evenly{justify-content:space-evenly}.odx-nowrap{flex-wrap:nowrap}[class*=odx-auto-grid]{--max-columns:6;--min-column-size:250px;--gap:var(--odx-spacing-layout-md);--_max-column-size:calc((100% - var(--gap)*(var(--max-columns) + 1))/var(--max-columns));--_min-column-size:min(100%,max(var(--min-column-size),var(--_max-column-size)));--_column-size:minmax(var(--_min-column-size),1fr);grid-template-columns:repeat(auto-fit,var(--_column-size));gap:var(--gap);place-content:center;display:grid}.odx-auto-grid-fill{grid-template-columns:repeat(auto-fill,var(--_column-size))}.odx-content :where(table),.odx-table{--cell-size:var(--odx-size-300);box-sizing:border-box;border-collapse:collapse;background-color:#0000;width:100%;max-width:100%;& caption{line-height:var(--odx-typography-line-height-text-sm);font-size:var(--odx-typography-font-size-text-sm);font-weight:var(--odx-typography-font-weight-semibold)}& thead{background-color:inherit}& tr{transition:var(--odx-motion-transition-reduced);background-color:var(--odx-color-background-transparent);transition-property:background-color,color}& tr:has(td):hover{background-color:var(--odx-color-background-transparent-hover)}& th,td{padding:var(--odx-control-spacing-md)var(--odx-control-spacing-inline-md);min-height:var(--odx-size-250);text-align:start;font-size:inherit}& th{border-bottom:var(--odx-border-width-thin)solid var(--odx-color-stroke-neutral-subtle);cursor:default;vertical-align:top;font-weight:var(--odx-typography-font-weight-medium);-webkit-user-select:none;user-select:none}& td{height:var(--cell-size);vertical-align:middle}& tr:not(:last-child) td{border-bottom:var(--odx-border-width-thin)solid var(--odx-color-stroke-neutral-subtle)}& th :is(odx-input,odx-select){margin-inline:var(--odx-spacing-negative-50)}}:where(a){column-gap:var(--odx-control-spacing-sm);transition:var(--odx-motion-transition-reduced);margin-inline:var(--odx-spacing-negative-12);border-radius:var(--odx-border-radius-control);cursor:pointer;padding-inline:var(--odx-spacing-12);-webkit-text-decoration:inherit;text-decoration:inherit;line-height:inherit;color:var(--odx-color-foreground-accent-rest);outline:none;align-items:center;transition-property:color;display:inline-flex;&:focus-visible{outline:var(--odx-focus-ring-outer);outline-offset:var(--odx-focus-ring-offset-sm)}&[disabled]{color:var(--odx-color-foreground-disabled-rest);pointer-events:none;-webkit-user-select:none;user-select:none;text-decoration:none}>:is(odx-icon,.odx-icon){vertical-align:middle}@media(hover:hover)and (pointer:fine){&:not([disabled]):where(:hover){color:var(--odx-color-foreground-accent-hover)}}}odx-title,[class*=odx-title],h1,h2,h3,h4,h5,h6{font-family:var(--odx-typography-font-family-brand),\"Noto Sans\",Kanit,sans-serif;font-weight:var(--odx-typography-font-weight-semibold);text-wrap:balance;overflow-wrap:break-word;display:block}[class*=odx-title-display-]{font-weight:var(--odx-typography-font-weight-medium)}odx-title,.odx-title{line-height:inherit;font-size:inherit}odx-title[size=xs],.odx-title-xs,h6{line-height:var(--odx-typography-line-height-heading-xs);font-size:var(--odx-typography-font-size-heading-xs)}odx-title[size=sm],.odx-title-sm,h5{line-height:var(--odx-typography-line-height-heading-sm);font-size:var(--odx-typography-font-size-heading-sm)}odx-title[size=md],.odx-title-md,h4{line-height:var(--odx-typography-line-height-heading-md);font-size:var(--odx-typography-font-size-heading-md)}odx-title[size=lg],.odx-title-lg,h3{line-height:var(--odx-typography-line-height-heading-lg);font-size:var(--odx-typography-font-size-heading-lg)}odx-title[size=xl],.odx-title-xl,h2{line-height:var(--odx-typography-line-height-heading-xl);font-size:var(--odx-typography-font-size-heading-xl)}odx-title[size=xxl],.odx-title-xxl,h1{line-height:var(--odx-typography-line-height-heading-xxl);font-size:var(--odx-typography-font-size-heading-xxl)}odx-title[size=display-sm],.odx-title-display-sm{line-height:var(--odx-typography-line-height-display-sm);font-size:var(--odx-typography-font-size-display-sm)}odx-title[size=display-md],.odx-title-display-md{line-height:var(--odx-typography-line-height-display-md);font-size:var(--odx-typography-font-size-display-md)}odx-title[size=display-lg],.odx-title-display-lg{line-height:var(--odx-typography-line-height-display-lg);font-size:var(--odx-typography-font-size-display-lg)}odx-title[size=display-xl],.odx-title-display-xl{line-height:var(--odx-typography-line-height-display-xl);font-size:var(--odx-typography-font-size-display-xl)}odx-text,.odx-text{font-weight:var(--odx-typography-font-weight-normal);overflow-wrap:break-word;display:block}odx-text[inline],.odx-text-inline{display:inline-block}odx-text[strong],.odx-text-strong{font-weight:var(--odx-typography-font-weight-medium)}odx-text[size=md],.odx-text-md{line-height:var(--odx-typography-line-height-text-md);font-size:var(--odx-typography-font-size-text-md)}odx-text[size=xs],.odx-text-xs{line-height:var(--odx-typography-line-height-text-xs);font-size:var(--odx-typography-font-size-text-xs)}odx-text[size=sm],.odx-text-sm{line-height:var(--odx-typography-line-height-text-sm);font-size:var(--odx-typography-font-size-text-sm)}odx-text[size=lg],.odx-text-lg{line-height:var(--odx-typography-line-height-text-lg);font-size:var(--odx-typography-font-size-text-lg)}.odx-content-box>odx-area-header:first-of-type{margin-block-start:calc(-1*var(--odx-spacing-layout-lg))}.odx-content :is(odx-key-value-list,odx-list){margin-block:var(--_content-spacing-md);:is(odx-key-value-list,odx-list){margin-block:0}}[data-odx-control]:has([data-odx-control]):not([disabled]):active{--_color-background-pressed:var(--_color-background-hover)}[data-odx-control]:has([data-odx-control]:hover):not([disabled]){--_color-background-hover:var(--_color-background);--_color-foreground-hover:var(--_color-foreground)}[data-odx-button]:has(odx-icon:only-child){min-width:auto}}@layer variant,state;@layer overrides{.odx-no-interaction{-webkit-user-select:none;user-select:none;pointer-events:none}.odx-no-overflow{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.odx-motion-disabled{scroll-behavior:auto!important;transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important}.odx-visually-hidden:not(:focus-within),.odx-visually-hidden-force{white-space:nowrap!important;width:1px!important;height:1px!important;clip-path:rect(0 0 0 0)!important;border:none!important;padding:0!important;position:absolute!important;overflow:hidden!important}.odx-g-sm{--gap:var(--odx-spacing-layout-sm);gap:var(--odx-spacing-layout-sm)}.odx-gx-sm{column-gap:var(--odx-spacing-layout-sm)}.odx-gy-sm{row-gap:var(--odx-spacing-layout-sm)}.odx-g-md{--gap:var(--odx-spacing-layout-md);gap:var(--odx-spacing-layout-md)}.odx-gx-md{column-gap:var(--odx-spacing-layout-md)}.odx-gy-md{row-gap:var(--odx-spacing-layout-md)}.odx-g-lg{--gap:var(--odx-spacing-layout-lg);gap:var(--odx-spacing-layout-lg)}.odx-gx-lg{column-gap:var(--odx-spacing-layout-lg)}.odx-gy-lg{row-gap:var(--odx-spacing-layout-lg)}.odx-g-0{--gap:0px;gap:0}.odx-gx-0{column-gap:0}.odx-gy-0{row-gap:0}.odx-g-12{--gap:var(--odx-spacing-12);gap:var(--odx-spacing-12)}.odx-gx-12{column-gap:var(--odx-spacing-12)}.odx-gy-12{row-gap:var(--odx-spacing-12)}.odx-g-25{--gap:var(--odx-spacing-25);gap:var(--odx-spacing-25)}.odx-gx-25{column-gap:var(--odx-spacing-25)}.odx-gy-25{row-gap:var(--odx-spacing-25)}.odx-g-37{--gap:var(--odx-spacing-37);gap:var(--odx-spacing-37)}.odx-gx-37{column-gap:var(--odx-spacing-37)}.odx-gy-37{row-gap:var(--odx-spacing-37)}.odx-g-50{--gap:var(--odx-spacing-50);gap:var(--odx-spacing-50)}.odx-gx-50{column-gap:var(--odx-spacing-50)}.odx-gy-50{row-gap:var(--odx-spacing-50)}.odx-g-75{--gap:var(--odx-spacing-75);gap:var(--odx-spacing-75)}.odx-gx-75{column-gap:var(--odx-spacing-75)}.odx-gy-75{row-gap:var(--odx-spacing-75)}.odx-g-100{--gap:var(--odx-spacing-100);gap:var(--odx-spacing-100)}.odx-gx-100{column-gap:var(--odx-spacing-100)}.odx-gy-100{row-gap:var(--odx-spacing-100)}.odx-g-150{--gap:var(--odx-spacing-150);gap:var(--odx-spacing-150)}.odx-gx-150{column-gap:var(--odx-spacing-150)}.odx-gy-150{row-gap:var(--odx-spacing-150)}.odx-p-sm{padding:var(--odx-spacing-layout-sm)}.odx-px-sm{padding-inline:var(--odx-spacing-layout-sm)}.odx-pl-sm{padding-inline-start:var(--odx-spacing-layout-sm)}.odx-pr-sm{padding-inline-end:var(--odx-spacing-layout-sm)}.odx-py-sm{padding-block:var(--odx-spacing-layout-sm)}.odx-pt-sm{padding-block-start:var(--odx-spacing-layout-sm)}.odx-pb-sm{padding-block-end:var(--odx-spacing-layout-sm)}.odx-p-md{padding:var(--odx-spacing-layout-md)}.odx-px-md{padding-inline:var(--odx-spacing-layout-md)}.odx-pl-md{padding-inline-start:var(--odx-spacing-layout-md)}.odx-pr-md{padding-inline-end:var(--odx-spacing-layout-md)}.odx-py-md{padding-block:var(--odx-spacing-layout-md)}.odx-pt-md{padding-block-start:var(--odx-spacing-layout-md)}.odx-pb-md{padding-block-end:var(--odx-spacing-layout-md)}.odx-p-lg{padding:var(--odx-spacing-layout-lg)}.odx-px-lg{padding-inline:var(--odx-spacing-layout-lg)}.odx-pl-lg{padding-inline-start:var(--odx-spacing-layout-lg)}.odx-pr-lg{padding-inline-end:var(--odx-spacing-layout-lg)}.odx-py-lg{padding-block:var(--odx-spacing-layout-lg)}.odx-pt-lg{padding-block-start:var(--odx-spacing-layout-lg)}.odx-pb-lg{padding-block-end:var(--odx-spacing-layout-lg)}.odx-p-0{padding:0}.odx-px-0{padding-inline:0}.odx-pl-0{padding-inline-start:0}.odx-pr-0{padding-inline-end:0}.odx-py-0{padding-block:0}.odx-pt-0{padding-block-start:0}.odx-pb-0{padding-block-end:0}.odx-p-12{padding:var(--odx-spacing-12)}.odx-px-12{padding-inline:var(--odx-spacing-12)}.odx-pl-12{padding-inline-start:var(--odx-spacing-12)}.odx-pr-12{padding-inline-end:var(--odx-spacing-12)}.odx-py-12{padding-block:var(--odx-spacing-12)}.odx-pt-12{padding-block-start:var(--odx-spacing-12)}.odx-pb-12{padding-block-end:var(--odx-spacing-12)}.odx-p-25{padding:var(--odx-spacing-25)}.odx-px-25{padding-inline:var(--odx-spacing-25)}.odx-pl-25{padding-inline-start:var(--odx-spacing-25)}.odx-pr-25{padding-inline-end:var(--odx-spacing-25)}.odx-py-25{padding-block:var(--odx-spacing-25)}.odx-pt-25{padding-block-start:var(--odx-spacing-25)}.odx-pb-25{padding-block-end:var(--odx-spacing-25)}.odx-p-37{padding:var(--odx-spacing-37)}.odx-px-37{padding-inline:var(--odx-spacing-37)}.odx-pl-37{padding-inline-start:var(--odx-spacing-37)}.odx-pr-37{padding-inline-end:var(--odx-spacing-37)}.odx-py-37{padding-block:var(--odx-spacing-37)}.odx-pt-37{padding-block-start:var(--odx-spacing-37)}.odx-pb-37{padding-block-end:var(--odx-spacing-37)}.odx-p-50{padding:var(--odx-spacing-50)}.odx-px-50{padding-inline:var(--odx-spacing-50)}.odx-pl-50{padding-inline-start:var(--odx-spacing-50)}.odx-pr-50{padding-inline-end:var(--odx-spacing-50)}.odx-py-50{padding-block:var(--odx-spacing-50)}.odx-pt-50{padding-block-start:var(--odx-spacing-50)}.odx-pb-50{padding-block-end:var(--odx-spacing-50)}.odx-p-75{padding:var(--odx-spacing-75)}.odx-px-75{padding-inline:var(--odx-spacing-75)}.odx-pl-75{padding-inline-start:var(--odx-spacing-75)}.odx-pr-75{padding-inline-end:var(--odx-spacing-75)}.odx-py-75{padding-block:var(--odx-spacing-75)}.odx-pt-75{padding-block-start:var(--odx-spacing-75)}.odx-pb-75{padding-block-end:var(--odx-spacing-75)}.odx-p-100{padding:var(--odx-spacing-100)}.odx-px-100{padding-inline:var(--odx-spacing-100)}.odx-pl-100{padding-inline-start:var(--odx-spacing-100)}.odx-pr-100{padding-inline-end:var(--odx-spacing-100)}.odx-py-100{padding-block:var(--odx-spacing-100)}.odx-pt-100{padding-block-start:var(--odx-spacing-100)}.odx-pb-100{padding-block-end:var(--odx-spacing-100)}.odx-p-150{padding:var(--odx-spacing-150)}.odx-px-150{padding-inline:var(--odx-spacing-150)}.odx-pl-150{padding-inline-start:var(--odx-spacing-150)}.odx-pr-150{padding-inline-end:var(--odx-spacing-150)}.odx-py-150{padding-block:var(--odx-spacing-150)}.odx-pt-150{padding-block-start:var(--odx-spacing-150)}.odx-pb-150{padding-block-end:var(--odx-spacing-150)}.odx-m-auto{margin:auto}.odx-mx-auto{margin-inline:auto}.odx-ml-auto{margin-inline-start:auto}.odx-mr-auto{margin-inline-end:auto}.odx-my-auto{margin-block:auto}.odx-mt-auto{margin-block-start:auto}.odx-mb-auto{margin-block-end:auto}.odx-m-sm{margin:var(--odx-spacing-layout-sm)}.odx-mx-sm{margin-inline:var(--odx-spacing-layout-sm)}.odx-ml-sm{margin-inline-start:var(--odx-spacing-layout-sm)}.odx-mr-sm{margin-inline-end:var(--odx-spacing-layout-sm)}.odx-my-sm{margin-block:var(--odx-spacing-layout-sm)}.odx-mt-sm{margin-block-start:var(--odx-spacing-layout-sm)}.odx-mb-sm{margin-block-end:var(--odx-spacing-layout-sm)}.odx-m-md{margin:var(--odx-spacing-layout-md)}.odx-mx-md{margin-inline:var(--odx-spacing-layout-md)}.odx-ml-md{margin-inline-start:var(--odx-spacing-layout-md)}.odx-mr-md{margin-inline-end:var(--odx-spacing-layout-md)}.odx-my-md{margin-block:var(--odx-spacing-layout-md)}.odx-mt-md{margin-block-start:var(--odx-spacing-layout-md)}.odx-mb-md{margin-block-end:var(--odx-spacing-layout-md)}.odx-m-lg{margin:var(--odx-spacing-layout-lg)}.odx-mx-lg{margin-inline:var(--odx-spacing-layout-lg)}.odx-ml-lg{margin-inline-start:var(--odx-spacing-layout-lg)}.odx-mr-lg{margin-inline-end:var(--odx-spacing-layout-lg)}.odx-my-lg{margin-block:var(--odx-spacing-layout-lg)}.odx-mt-lg{margin-block-start:var(--odx-spacing-layout-lg)}.odx-mb-lg{margin-block-end:var(--odx-spacing-layout-lg)}.odx-m-0{margin:0}.odx-mx-0{margin-inline:0}.odx-ml-0{margin-inline-start:0}.odx-mr-0{margin-inline-end:0}.odx-my-0{margin-block:0}.odx-mt-0{margin-block-start:0}.odx-mb-0{margin-block-end:0}.odx-m-12{margin:var(--odx-spacing-12)}.odx-mx-12{margin-inline:var(--odx-spacing-12)}.odx-ml-12{margin-inline-start:var(--odx-spacing-12)}.odx-mr-12{margin-inline-end:var(--odx-spacing-12)}.odx-my-12{margin-block:var(--odx-spacing-12)}.odx-mt-12{margin-block-start:var(--odx-spacing-12)}.odx-mb-12{margin-block-end:var(--odx-spacing-12)}.odx-m-25{margin:var(--odx-spacing-25)}.odx-mx-25{margin-inline:var(--odx-spacing-25)}.odx-ml-25{margin-inline-start:var(--odx-spacing-25)}.odx-mr-25{margin-inline-end:var(--odx-spacing-25)}.odx-my-25{margin-block:var(--odx-spacing-25)}.odx-mt-25{margin-block-start:var(--odx-spacing-25)}.odx-mb-25{margin-block-end:var(--odx-spacing-25)}.odx-m-37{margin:var(--odx-spacing-37)}.odx-mx-37{margin-inline:var(--odx-spacing-37)}.odx-ml-37{margin-inline-start:var(--odx-spacing-37)}.odx-mr-37{margin-inline-end:var(--odx-spacing-37)}.odx-my-37{margin-block:var(--odx-spacing-37)}.odx-mt-37{margin-block-start:var(--odx-spacing-37)}.odx-mb-37{margin-block-end:var(--odx-spacing-37)}.odx-m-50{margin:var(--odx-spacing-50)}.odx-mx-50{margin-inline:var(--odx-spacing-50)}.odx-ml-50{margin-inline-start:var(--odx-spacing-50)}.odx-mr-50{margin-inline-end:var(--odx-spacing-50)}.odx-my-50{margin-block:var(--odx-spacing-50)}.odx-mt-50{margin-block-start:var(--odx-spacing-50)}.odx-mb-50{margin-block-end:var(--odx-spacing-50)}.odx-m-75{margin:var(--odx-spacing-75)}.odx-mx-75{margin-inline:var(--odx-spacing-75)}.odx-ml-75{margin-inline-start:var(--odx-spacing-75)}.odx-mr-75{margin-inline-end:var(--odx-spacing-75)}.odx-my-75{margin-block:var(--odx-spacing-75)}.odx-mt-75{margin-block-start:var(--odx-spacing-75)}.odx-mb-75{margin-block-end:var(--odx-spacing-75)}.odx-m-100{margin:var(--odx-spacing-100)}.odx-mx-100{margin-inline:var(--odx-spacing-100)}.odx-ml-100{margin-inline-start:var(--odx-spacing-100)}.odx-mr-100{margin-inline-end:var(--odx-spacing-100)}.odx-my-100{margin-block:var(--odx-spacing-100)}.odx-mt-100{margin-block-start:var(--odx-spacing-100)}.odx-mb-100{margin-block-end:var(--odx-spacing-100)}.odx-m-150{margin:var(--odx-spacing-150)}.odx-mx-150{margin-inline:var(--odx-spacing-150)}.odx-ml-150{margin-inline-start:var(--odx-spacing-150)}.odx-mr-150{margin-inline-end:var(--odx-spacing-150)}.odx-my-150{margin-block:var(--odx-spacing-150)}.odx-mt-150{margin-block-start:var(--odx-spacing-150)}.odx-mb-150{margin-block-end:var(--odx-spacing-150)}}@layer odx.base{.odx-content{--_content-spacing-sm:var(--odx-spacing-layout-sm);--_content-spacing-md:var(--odx-spacing-layout-md);--_content-spacing-lg:var(--odx-spacing-layout-lg);line-height:var(--odx-typography-line-height-text-md);& table,ul,ol,dl,blockquote,pre,figure,video,embed,iframe{margin:var(--_content-spacing-md)0}>:is(odx-title,[class*=odx-title]),>:is(.odx-text,odx-text),li>:is(ul,ol,dl),h1,h2,h3,h4,h5,h6,p,li{margin:var(--_content-spacing-sm)0}& h1,h2,h3,h4,h5,h6{margin-block-start:var(--_content-spacing-lg)}& table,ul,ol,dl,blockquote{padding-inline-start:var(--odx-spacing-150)}& code,pre,mark{border-radius:var(--odx-border-radius-sm);padding:0 var(--odx-spacing-12)}& code,pre{background-color:var(--odx-color-background-control-rest);font-size:var(--odx-typography-font-size-text-sm)}& blockquote{padding-inline-end:var(--odx-spacing-150)}& dt{font-weight:var(--odx-typography-font-weight-medium)}& a{text-decoration:underline}& del{color:var(--odx-color-foreground-danger-rest)}& figure{flex-direction:column;display:flex}& figcaption{border-top:var(--odx-border-width-thick)solid var(--odx-color-stroke-neutral-subtle);padding:var(--_content-spacing-sm);line-height:var(--odx-typography-line-height-text-sm);font-size:var(--odx-typography-font-size-text-sm)}& ins{color:var(--odx-color-foreground-success-rest);text-decoration:none}& mark{background-color:var(--odx-color-background-selection);color:var(--odx-color-foreground-rest)}& pre{padding:var(--odx-control-spacing-md)calc(2*var(--odx-control-spacing-inline-md))}& small{font-size:var(--odx-typography-font-size-text-sm)}& var{font-weight:var(--odx-typography-font-weight-medium)}}.odx-content-sm{--_content-spacing-md:var(--odx-spacing-layout-sm);--_content-spacing-lg:var(--odx-spacing-layout-md);line-height:var(--odx-typography-line-height-text-sm);font-size:var(--odx-typography-font-size-text-sm)}.odx-content-box{background-color:var(--odx-color-background-level-1);padding:var(--odx-spacing-layout-lg)}}";
|
|
132
|
+
|
|
133
|
+
function customElement(tagName, ...styles2) {
|
|
134
|
+
return (target) => {
|
|
135
|
+
const mergedStyles = [CustomElement.styles, target.styles ?? [], ...styles2.map(unsafeCSS)].flat();
|
|
136
|
+
target.tagName = tagName;
|
|
137
|
+
target.styles = Array.from(new Set(mergedStyles));
|
|
138
|
+
target.load = () => {
|
|
139
|
+
if (customElements.get(tagName)) return;
|
|
140
|
+
customElements.define(tagName, target);
|
|
141
|
+
target.initializer?.();
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
class CustomElement extends LitElement {
|
|
146
|
+
constructor() {
|
|
147
|
+
super();
|
|
148
|
+
this.hasContent = false;
|
|
149
|
+
this.slotsWithContent = /* @__PURE__ */ new Set();
|
|
150
|
+
this.#handleSlotChange = () => {
|
|
151
|
+
this.slotsWithContent = new Set(Array.from(this.querySelectorAll(":scope > [slot]")).map((element) => element.slot));
|
|
152
|
+
this.hasContent = Array.from(this.childNodes).some((node) => {
|
|
153
|
+
return node instanceof HTMLElement && !node.slot || node.nodeType === Node.TEXT_NODE && node.textContent?.trim() !== "";
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
this.internals = this.attachInternals();
|
|
157
|
+
}
|
|
158
|
+
static {
|
|
159
|
+
this.styles = unsafeCSS(styles);
|
|
160
|
+
}
|
|
161
|
+
static {
|
|
162
|
+
this.observeSlots = false;
|
|
163
|
+
}
|
|
164
|
+
connectedCallback() {
|
|
165
|
+
super.connectedCallback();
|
|
166
|
+
const { observeSlots } = this.constructor;
|
|
167
|
+
if (observeSlots) {
|
|
168
|
+
this.#handleSlotChange();
|
|
169
|
+
this.renderRoot.addEventListener("slotchange", this.#handleSlotChange);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
emit(event, eventInit) {
|
|
173
|
+
if (typeof event === "string") {
|
|
174
|
+
return !this.dispatchEvent(new CustomEvent(event, { bubbles: false, composed: false, cancelable: true, ...eventInit }));
|
|
175
|
+
}
|
|
176
|
+
return !this.dispatchEvent(event);
|
|
177
|
+
}
|
|
178
|
+
/** @internal */
|
|
179
|
+
whenSlotted(slotName, content = (slot) => slot) {
|
|
180
|
+
if (slotName === void 0) {
|
|
181
|
+
return this.hasContent ? content(html`<slot></slot>`) : html`<slot hidden></slot>`;
|
|
182
|
+
}
|
|
183
|
+
if (this.slotsWithContent.has(slotName)) {
|
|
184
|
+
return content(html`<slot name="${slotName}"></slot>`);
|
|
185
|
+
}
|
|
186
|
+
return html`<slot name="${slotName}" hidden></slot>`;
|
|
187
|
+
}
|
|
188
|
+
render() {
|
|
189
|
+
return html`<slot></slot>`;
|
|
190
|
+
}
|
|
191
|
+
#handleSlotChange;
|
|
192
|
+
}
|
|
193
|
+
__decorateClass([
|
|
194
|
+
state()
|
|
195
|
+
], CustomElement.prototype, "hasContent", 2);
|
|
196
|
+
__decorateClass([
|
|
197
|
+
state({
|
|
198
|
+
hasChanged: (a, b) => {
|
|
199
|
+
if (!(a && b)) return true;
|
|
200
|
+
return a.size === b.size && [...a].every((value) => b.has(value));
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
], CustomElement.prototype, "slotsWithContent", 2);
|
|
204
|
+
async function loadCustomElements(loader) {
|
|
205
|
+
const entries = await loader();
|
|
206
|
+
for (const entry of entries) {
|
|
207
|
+
if (typeof entry !== "function" || !("load" in entry) || typeof entry.load !== "function") continue;
|
|
208
|
+
entry.load?.();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const activeDirective = booleanAttributeDirective({
|
|
213
|
+
name: "data-odx-active",
|
|
214
|
+
onUpdate: (host) => host instanceof LitElement && host.requestUpdate()
|
|
215
|
+
});
|
|
216
|
+
function activeDescendantsControllerOptions(options) {
|
|
217
|
+
return {
|
|
218
|
+
getItems: () => [],
|
|
219
|
+
...options
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
class ActiveDescendantsController {
|
|
223
|
+
#host;
|
|
224
|
+
#options;
|
|
225
|
+
#enabled = false;
|
|
226
|
+
#items = [];
|
|
227
|
+
#activeIndex = -1;
|
|
228
|
+
static {
|
|
229
|
+
detectKeyboardFocus();
|
|
230
|
+
}
|
|
231
|
+
get activeIndex() {
|
|
232
|
+
return this.#activeIndex;
|
|
233
|
+
}
|
|
234
|
+
get activeItem() {
|
|
235
|
+
return this.#items[this.#activeIndex];
|
|
236
|
+
}
|
|
237
|
+
constructor(host, options = {}) {
|
|
238
|
+
this.#host = host;
|
|
239
|
+
this.#options = activeDescendantsControllerOptions(options);
|
|
240
|
+
host.addController(this);
|
|
241
|
+
}
|
|
242
|
+
async hostUpdated() {
|
|
243
|
+
await interactionResponse();
|
|
244
|
+
if (keyboardFocusDirective.applied(this.#host)) {
|
|
245
|
+
this.enable();
|
|
246
|
+
} else {
|
|
247
|
+
this.disable();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
enable() {
|
|
251
|
+
if (this.#enabled) return;
|
|
252
|
+
this.#enabled = true;
|
|
253
|
+
this.#host.addEventListener("keydown", this.#handleKeyDown);
|
|
254
|
+
this.#items = this.#options.getItems().filter((item) => item.isConnected);
|
|
255
|
+
this.update(this.#activeIndex);
|
|
256
|
+
}
|
|
257
|
+
disable() {
|
|
258
|
+
if (!this.#enabled) return;
|
|
259
|
+
this.#enabled = false;
|
|
260
|
+
this.#host.removeEventListener("keydown", this.#handleKeyDown);
|
|
261
|
+
this.update();
|
|
262
|
+
}
|
|
263
|
+
previous() {
|
|
264
|
+
const index = this.#items.findLastIndex((item, index2) => this.#activeIndex > index2 && item.canActivate());
|
|
265
|
+
this.update(index);
|
|
266
|
+
}
|
|
267
|
+
next() {
|
|
268
|
+
const index = this.#items.findIndex((item, index2) => this.#activeIndex < index2 && item.canActivate());
|
|
269
|
+
this.update(index);
|
|
270
|
+
}
|
|
271
|
+
first() {
|
|
272
|
+
this.update(this.#items.findIndex((item) => item.canActivate()));
|
|
273
|
+
}
|
|
274
|
+
last() {
|
|
275
|
+
this.update(this.#items.findLastIndex((item) => item.canActivate()));
|
|
276
|
+
}
|
|
277
|
+
update(index, force = false) {
|
|
278
|
+
const activeIndex = index ?? this.#activeIndex;
|
|
279
|
+
const activeItem = this.#items[activeIndex];
|
|
280
|
+
const previousActiveItem = this.#items[this.#activeIndex];
|
|
281
|
+
if (!(force || activeItem?.canActivate())) return;
|
|
282
|
+
previousActiveItem?.deactivate();
|
|
283
|
+
this.#activeIndex = activeIndex;
|
|
284
|
+
this.#host.ariaActiveDescendantElement = activeItem ?? null;
|
|
285
|
+
if (keyboardFocusDirective.applied(this.#host)) {
|
|
286
|
+
activeItem?.activate();
|
|
287
|
+
} else {
|
|
288
|
+
activeItem?.deactivate();
|
|
289
|
+
}
|
|
290
|
+
this.#options.onChange?.(previousActiveItem, activeItem, previousActiveItem == null && Boolean(activeItem));
|
|
291
|
+
}
|
|
292
|
+
#handleKeyDown = (event) => {
|
|
293
|
+
const key = getKeyInfo(event);
|
|
294
|
+
if (!(key.up || key.down || key.start || key.end)) return;
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
if (key.down) {
|
|
297
|
+
this.next();
|
|
298
|
+
} else if (key.up) {
|
|
299
|
+
this.previous();
|
|
300
|
+
} else if (key.start) {
|
|
301
|
+
this.first();
|
|
302
|
+
} else if (key.end) {
|
|
303
|
+
this.last();
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export { ActiveDescendantsController as A, CustomElement as C, FormAssociated as F, CanBeDisabled as a, activeDirective as b, customElement as c, loadCustomElements as l };
|