@odx/foundation 1.0.0-beta.99 → 1.0.0-rc.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/CHANGELOG.md +335 -0
- package/README.md +61 -29
- package/dist/lib/breakpoints.d.ts +61 -0
- package/dist/lib/breakpoints.js +139 -0
- package/dist/lib/format.d.ts +58 -0
- package/dist/lib/format.js +63 -0
- package/dist/lib/localization.d.ts +12 -0
- package/dist/lib/localization.js +28 -0
- package/dist/lib/models.d.ts +39 -0
- package/dist/lib/models.js +34 -0
- package/dist/lib/signals.d.ts +20 -0
- package/dist/lib/signals.js +47 -0
- package/dist/lib/theming.d.ts +18 -0
- package/dist/lib/theming.js +38 -0
- package/dist/lib/utils/breakpoint.d.ts +38 -0
- package/dist/lib/utils/breakpoint.js +103 -0
- package/dist/lib/utils/shared-media-observer.d.ts +4 -0
- package/dist/lib/utils/shared-media-observer.js +43 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +5 -1227
- package/dist/oss-licenses.json +1 -0
- package/dist/styles.css +1 -1
- package/package.json +27 -50
- package/dist/_virtual_class-decorator-runtime.js +0 -13
- package/dist/components/accordion/accordion.d.ts +0 -25
- package/dist/components/accordion-item/accordion-item.d.ts +0 -26
- package/dist/components/accordion-panel/accordion-panel.d.ts +0 -13
- package/dist/components/action-button/action-button.d.ts +0 -27
- package/dist/components/anchor-navigation/anchor-navigation.d.ts +0 -21
- 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/area-header.d.ts +0 -21
- package/dist/components/avatar/avatar.d.ts +0 -36
- package/dist/components/avatar-group/avatar-group.d.ts +0 -15
- package/dist/components/badge/badge.d.ts +0 -24
- package/dist/components/breadcrumbs/breadcrumbs-item.d.ts +0 -17
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +0 -21
- package/dist/components/breadcrumbs/index.d.ts +0 -3
- package/dist/components/button/button.d.ts +0 -54
- package/dist/components/button-group/button-group.d.ts +0 -20
- package/dist/components/card/card.d.ts +0 -15
- package/dist/components/checkbox/checkbox.d.ts +0 -14
- package/dist/components/checkbox-group/checkbox-group.d.ts +0 -19
- package/dist/components/chip/chip.d.ts +0 -31
- package/dist/components/circular-progress-bar/circular-progress-bar.d.ts +0 -49
- package/dist/components/combobox/autocomplete.d.ts +0 -23
- package/dist/components/content-box/content-box.d.ts +0 -11
- package/dist/components/dropdown/dropdown.d.ts +0 -25
- package/dist/components/form-field/form-field.d.ts +0 -16
- package/dist/components/format/base-format.d.ts +0 -13
- package/dist/components/format/format-bytes.d.ts +0 -13
- package/dist/components/format/format-date.d.ts +0 -14
- package/dist/components/format/format-number.d.ts +0 -20
- package/dist/components/format/index.d.ts +0 -6
- package/dist/components/format/relative-time.d.ts +0 -21
- package/dist/components/header/header-actions.d.ts +0 -10
- package/dist/components/header/header.d.ts +0 -14
- package/dist/components/header/index.d.ts +0 -3
- package/dist/components/headline/headline.d.ts +0 -22
- package/dist/components/highlight/highlight.d.ts +0 -23
- package/dist/components/icon-button/icon-button.d.ts +0 -14
- package/dist/components/image/image.d.ts +0 -34
- package/dist/components/inline-message/inline-message.d.ts +0 -28
- package/dist/components/input/input.d.ts +0 -27
- package/dist/components/kpi/kpi.d.ts +0 -36
- package/dist/components/line-clamp/line-clamp.d.ts +0 -12
- package/dist/components/link/link.d.ts +0 -11
- package/dist/components/list/list.d.ts +0 -15
- package/dist/components/list-item/list-item.d.ts +0 -26
- package/dist/components/loader.d.ts +0 -2
- package/dist/components/loading-overlay/loading-overlay.d.ts +0 -20
- package/dist/components/loading-spinner/loading-spinner.d.ts +0 -12
- package/dist/components/logo/logo.d.ts +0 -21
- package/dist/components/main-menu/index.d.ts +0 -6
- package/dist/components/main-menu/main-menu-button.d.ts +0 -12
- 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/main-menu/main-menu.d.ts +0 -17
- package/dist/components/main.d.ts +0 -72
- package/dist/components/menu/index.d.ts +0 -3
- package/dist/components/menu/menu-label.d.ts +0 -9
- package/dist/components/menu/menu.d.ts +0 -21
- package/dist/components/menu-item/menu-item.d.ts +0 -14
- package/dist/components/modal/modal.d.ts +0 -37
- package/dist/components/navigation-item/navigation-item.d.ts +0 -22
- package/dist/components/option/option.d.ts +0 -11
- package/dist/components/page/page.d.ts +0 -27
- package/dist/components/page-layout/page-layout.d.ts +0 -11
- package/dist/components/pagination/pagination.d.ts +0 -32
- package/dist/components/popover/popover-host.d.ts +0 -35
- package/dist/components/popover/popover-observer.d.ts +0 -11
- package/dist/components/popover/popover.d.ts +0 -13
- package/dist/components/progress-bar/progress-bar.d.ts +0 -30
- package/dist/components/radio-button/radio-button.d.ts +0 -13
- package/dist/components/radio-group/radio-group.d.ts +0 -16
- package/dist/components/rail-navigation/rail-navigation.d.ts +0 -19
- package/dist/components/search-bar/index.d.ts +0 -3
- package/dist/components/search-bar/search-bar.d.ts +0 -33
- package/dist/components/search-bar/search-bar.events.d.ts +0 -7
- package/dist/components/select/select.d.ts +0 -26
- package/dist/components/separator/separator.d.ts +0 -21
- package/dist/components/skeleton/skeleton.d.ts +0 -31
- package/dist/components/slider/index.d.ts +0 -5
- package/dist/components/slider/slider-handle.d.ts +0 -28
- package/dist/components/slider/slider-marks.d.ts +0 -16
- package/dist/components/slider/slider.d.ts +0 -26
- package/dist/components/slider/slider.models.d.ts +0 -29
- package/dist/components/spacer/spacer.d.ts +0 -13
- package/dist/components/spinbox/spinbox.d.ts +0 -23
- package/dist/components/stack/stack.d.ts +0 -38
- package/dist/components/status/status.d.ts +0 -23
- package/dist/components/switch/switch.d.ts +0 -12
- package/dist/components/table/index.d.ts +0 -9
- package/dist/components/table/table-body.d.ts +0 -12
- package/dist/components/table/table-cell.d.ts +0 -12
- package/dist/components/table/table-checkbox-cell.d.ts +0 -19
- package/dist/components/table/table-header-cell.d.ts +0 -13
- package/dist/components/table/table-header.d.ts +0 -14
- package/dist/components/table/table-row.d.ts +0 -20
- package/dist/components/table/table.d.ts +0 -20
- package/dist/components/table/table.models.d.ts +0 -10
- package/dist/components/text/text.d.ts +0 -33
- package/dist/components/title/title.d.ts +0 -22
- package/dist/components/toast/toast.d.ts +0 -24
- package/dist/components/toggle-button/toggle-button.d.ts +0 -13
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +0 -10
- package/dist/components/toggle-content/toggle-content.d.ts +0 -12
- package/dist/components/tooltip/tooltip.d.ts +0 -37
- package/dist/components/translate/translate.d.ts +0 -16
- package/dist/components/visually-hidden/visually-hidden.d.ts +0 -11
- package/dist/components.js +0 -4493
- package/dist/i18n/config.d.ts +0 -32
- package/dist/i18n/format.d.ts +0 -6
- package/dist/i18n/is-localized.d.ts +0 -15
- package/dist/i18n/localization.d.ts +0 -5
- package/dist/i18n/main.d.ts +0 -7
- package/dist/i18n/models.d.ts +0 -7
- package/dist/i18n/translate.d.ts +0 -11
- package/dist/i18n.js +0 -145
- package/dist/lib/control/checkbox-form-control.d.ts +0 -16
- package/dist/lib/control/checkbox-group-form-control.d.ts +0 -23
- package/dist/lib/control/form-control.d.ts +0 -30
- package/dist/lib/control/listbox-form-control.d.ts +0 -26
- package/dist/lib/control/number-form-control.d.ts +0 -13
- package/dist/lib/control/option-control.d.ts +0 -24
- package/dist/lib/control/radio-group-form-control.d.ts +0 -22
- package/dist/lib/controllers/active-descendants-controller.d.ts +0 -29
- package/dist/lib/controllers/drag.controller.d.ts +0 -19
- package/dist/lib/controllers/expandable-controller.d.ts +0 -17
- package/dist/lib/custom-element.d.ts +0 -16
- package/dist/lib/interactive/interactive-element.d.ts +0 -23
- package/dist/lib/interactive/interactive-link.d.ts +0 -21
- package/dist/lib/main.d.ts +0 -28
- package/dist/lib/mixins/can-be-disabled.d.ts +0 -7
- package/dist/lib/mixins/can-be-expanded.d.ts +0 -10
- package/dist/lib/mixins/is-draggable.d.ts +0 -16
- package/dist/lib/models/drag-event.d.ts +0 -9
- package/dist/lib/models/placement.d.ts +0 -17
- 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/utils/compute-popover-placement.d.ts +0 -14
- package/dist/lib/utils/dom.d.ts +0 -27
- package/dist/lib/utils/get-unique-id.d.ts +0 -19
- package/dist/lib/utils/lit.d.ts +0 -4
- package/dist/lib/utils/shared-resize-observer.d.ts +0 -11
- package/dist/lib/utils/types.d.ts +0 -60
- package/dist/loader.js +0 -7
- package/dist/vendor.js +0 -1982
package/dist/components.js
DELETED
|
@@ -1,4493 +0,0 @@
|
|
|
1
|
-
import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
|
|
2
|
-
import { CustomElement, ExpandableItemManager, customElement, CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, Size, Variant, optionalAttr, InteractiveLink, getElementFromEvent, Shape, CanBeDisabled, optionalSlot, CheckboxFormControl, CheckboxGroupFormControl, SharedResizeObserver, findClosestDocument, Placement, waitForAnimations, PopoverPlacementOptions, computePopoverPlacement, getKeyInfo, FormControl, ActiveDescendantsController, getAssignedElement, parseDate, forwardEvent, OptionControl, toPx, RadioGroupFormControl, ListboxFormControl, IsDraggable, NumberFormControl, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation';
|
|
3
|
-
import { queryAssignedElements, property, query, state } from 'lit/decorators.js';
|
|
4
|
-
import { html, isServer, unsafeCSS, css, nothing } from 'lit';
|
|
5
|
-
import { p as pick, e, a as autoUpdate, t as throttle, R as RovingTabindexController, r as round, g as debounce, n, i as c, j as e$1 } from './vendor.js';
|
|
6
|
-
import { when } from 'lit/directives/when.js';
|
|
7
|
-
import { IsLocalized, setTranslation } from '@odx/foundation/i18n';
|
|
8
|
-
import { signal, computed } from '@preact/signals-core';
|
|
9
|
-
import 'lit/html.js';
|
|
10
|
-
|
|
11
|
-
const styles$1g = ":host{display:block}:host(:not([compact])) ::slotted(odx-accordion-item){margin-block:var(--odx-spacing-37)}";
|
|
12
|
-
|
|
13
|
-
const AccordionIndicatorPosition = { START: "start", END: "end" };
|
|
14
|
-
const _OdxAccordion = class _OdxAccordion extends CustomElement {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
this.compact = false;
|
|
18
|
-
this.indicatorPosition = AccordionIndicatorPosition.END;
|
|
19
|
-
this.multiple = false;
|
|
20
|
-
new ExpandableItemManager(this, { getItems: () => this.items });
|
|
21
|
-
}
|
|
22
|
-
static {
|
|
23
|
-
customElement("odx-accordion", styles$1g)(_OdxAccordion);
|
|
24
|
-
}
|
|
25
|
-
updated(props) {
|
|
26
|
-
super.updated(props);
|
|
27
|
-
if (props.has("size") && this.size !== void 0) {
|
|
28
|
-
for (const item of this.items) {
|
|
29
|
-
item.size = this.size;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
toggleAll(state, emitEvent = false) {
|
|
34
|
-
for (const item of this.items) {
|
|
35
|
-
item.toggle(state, emitEvent);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
__decorateClass([
|
|
40
|
-
queryAssignedElements({ selector: "odx-accordion-item", flatten: true })
|
|
41
|
-
], _OdxAccordion.prototype, "items", 2);
|
|
42
|
-
__decorateClass([
|
|
43
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
44
|
-
], _OdxAccordion.prototype, "compact", 2);
|
|
45
|
-
__decorateClass([
|
|
46
|
-
property({ reflect: true, useDefault: true, attribute: "indicator-position" })
|
|
47
|
-
], _OdxAccordion.prototype, "indicatorPosition", 2);
|
|
48
|
-
__decorateClass([
|
|
49
|
-
property({ type: Boolean })
|
|
50
|
-
], _OdxAccordion.prototype, "multiple", 2);
|
|
51
|
-
__decorateClass([
|
|
52
|
-
property()
|
|
53
|
-
], _OdxAccordion.prototype, "size", 2);
|
|
54
|
-
let OdxAccordion = _OdxAccordion;
|
|
55
|
-
|
|
56
|
-
const styles$1f = ":host{display:block;block-size:auto;min-block-size:var(--_block-size)}[part~=label]{display:flex;flex-direction:column;row-gap:var(--odx-size-37)}:host([expanded])::part(indicator){--rotate: 180deg}:host([size=\"lg\"]){--_padding-block: var(--odx-spacing-75)}";
|
|
57
|
-
|
|
58
|
-
const AccordionItemSize = pick(Size, ["MD", "LG"]);
|
|
59
|
-
const _OdxAccordionItem = class _OdxAccordionItem extends CanBeExpanded(InteractiveElement) {
|
|
60
|
-
constructor() {
|
|
61
|
-
super(...arguments);
|
|
62
|
-
this.size = AccordionItemSize.MD;
|
|
63
|
-
}
|
|
64
|
-
static {
|
|
65
|
-
customElement("odx-accordion-item", styles$1f)(_OdxAccordionItem);
|
|
66
|
-
}
|
|
67
|
-
get panel() {
|
|
68
|
-
if (this.nextElementSibling?.role === "region") {
|
|
69
|
-
return this.nextElementSibling;
|
|
70
|
-
}
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
renderContent() {
|
|
74
|
-
return html`
|
|
75
|
-
${super.renderContent()}
|
|
76
|
-
<odx-icon part="indicator" name="core::chevron-down"></odx-icon>
|
|
77
|
-
`;
|
|
78
|
-
}
|
|
79
|
-
willUpdate(props) {
|
|
80
|
-
super.willUpdate(props);
|
|
81
|
-
if (props.has("disabled") || props.has("expanded")) {
|
|
82
|
-
this.#handleExpandedChange();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
#handleExpandedChange() {
|
|
86
|
-
if (!this.panel) return;
|
|
87
|
-
this.id ||= getUniqueId(this.localName);
|
|
88
|
-
this.ariaExpanded = toAriaBooleanAttribute(this.expanded);
|
|
89
|
-
this.setAttribute("aria-controls", this.panel.id);
|
|
90
|
-
this.panel.setAttribute("aria-labelledby", this.id);
|
|
91
|
-
this.panel.hidden = this.disabled || !this.expanded;
|
|
92
|
-
if (this.expanded) return;
|
|
93
|
-
this.panel.querySelector("odx-accordion")?.toggleAll(false);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
__decorateClass([
|
|
97
|
-
property({ reflect: true, useDefault: true })
|
|
98
|
-
], _OdxAccordionItem.prototype, "size", 2);
|
|
99
|
-
let OdxAccordionItem = _OdxAccordionItem;
|
|
100
|
-
|
|
101
|
-
const styles$1e = ":host{display:block;border-block-end:var(--odx-size-px) solid transparent}.content{padding:var(--odx-size-50);padding-block-start:var(--odx-size-12)}:host(:not(:last-of-type)){border-block-end-color:var(--odx-color-stroke-neutral-subtle)}::slotted(odx-accordion){margin-block:calc(-1 * var(--odx-size-37));margin-inline-end:calc(-1 * var(--odx-size-50))}";
|
|
102
|
-
|
|
103
|
-
const _OdxAccordionPanel = class _OdxAccordionPanel extends CustomElement {
|
|
104
|
-
constructor() {
|
|
105
|
-
super(...arguments);
|
|
106
|
-
this.hidden = true;
|
|
107
|
-
}
|
|
108
|
-
static {
|
|
109
|
-
customElement("odx-accordion-panel", styles$1e)(_OdxAccordionPanel);
|
|
110
|
-
}
|
|
111
|
-
connectedCallback() {
|
|
112
|
-
super.connectedCallback();
|
|
113
|
-
this.id ||= getUniqueId(this.localName);
|
|
114
|
-
this.role ||= "region";
|
|
115
|
-
}
|
|
116
|
-
render() {
|
|
117
|
-
return html`
|
|
118
|
-
<odx-toggle-content ?hidden=${this.hidden}>
|
|
119
|
-
<div class="content"><slot></slot></div>
|
|
120
|
-
</odx-toggle-content>
|
|
121
|
-
`;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
__decorateClass([
|
|
125
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
126
|
-
], _OdxAccordionPanel.prototype, "hidden", 2);
|
|
127
|
-
let OdxAccordionPanel = _OdxAccordionPanel;
|
|
128
|
-
|
|
129
|
-
const styles$1d = "@layer base{:host{--_padding-inline: var(--odx-size-75);--_icon-margin: calc(-.5 * (var(--_icon-size) - var(--_padding-inline)) - var(--odx-size-px))}:host,[part=base]{place-content:center}[part~=base]{outline-offset:var(--odx-focus-ring-offset);font-weight:var(--odx-typography-font-weight-medium)}[part=label]{flex:initial}::slotted(odx-avatar){--_color-foreground: inherit}}@layer variant{:host([size=\"xs\"]){--_block-size: var(--odx-size-150);--_padding-inline: var(--odx-size-50);--_font-size: var(--odx-typography-font-size-1);--_icon-size: var(--odx-typography-font-size-4);::slotted(odx-avatar){--_size: var(--odx-size-125);--_spacing: calc(var(--odx-size-37) + var(--odx-size-px));font-size:var(--odx-typography-font-size-1)}[part~=base]{outline-offset:0}}:host([size=\"sm\"]){--_block-size: var(--odx-size-200);--_icon-margin: calc(-1 * var(--odx-size-12) + var(--odx-size-px));--_padding-inline: var(--odx-size-37);--_font-size: var(--odx-typography-font-size-2);--_icon-size: var(--odx-typography-font-size-5);::slotted(odx-avatar){--_size: var(--odx-size-175);--_spacing: calc(var(--odx-size-25) + var(--odx-size-px));font-size:var(--odx-typography-font-size-2)}[part~=base]{outline-offset:0}}:host([size=\"lg\"]){--_block-size: var(--odx-size-300);--_padding-inline: var(--odx-size-100);--_font-size: var(--odx-typography-font-size-4);--_icon-size: var(--odx-typography-font-size-6);::slotted(odx-avatar){--_size: var(--odx-size-250);--_spacing: calc(var(--odx-size-75) + var(--odx-size-px));font-size:var(--odx-typography-font-size-3)}}:host(:is([variant=\"neutral\"],:not([variant]))){--_color-background: var(--odx-color-background-neutral-rest);--_color-background-hover: var(--odx-color-background-neutral-hover);--_color-background-pressed: var(--odx-color-background-neutral-pressed)}:host(:is([variant=\"neutral\"],:not([variant])):not([disabled])){--_color-stroke-hover: var(--odx-color-stroke-control-hover);--_color-stroke-pressed: var(--odx-color-stroke-control-pressed)}:host(:is([variant=\"neutral\"],:not([variant]))[loading]){--_color-stroke: var(--odx-color-stroke-neutral-subtle)}:host([variant=\"primary\"]){--_color-background: var(--odx-color-background-primary-rest);--_color-background-hover: var(--odx-color-background-primary-hover);--_color-background-pressed: var(--odx-color-background-primary-pressed);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"accent\"]){--_color-background: var(--odx-color-background-accent-rest);--_color-background-hover: var(--odx-color-background-accent-hover);--_color-background-pressed: var(--odx-color-background-accent-pressed);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-background-danger-rest);--_color-background-hover: var(--odx-color-background-danger-hover);--_color-background-pressed: var(--odx-color-background-danger-pressed);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"ghost\"]){--_color-background: var(--odx-color-background-transparent-rest);--_color-background-hover: var(--odx-color-background-transparent-hover);--_color-background-pressed: var(--odx-color-background-transparent-pressed);[part~=base]{outline-offset:0}}:host([loading]){--_color-background: var(--odx-color-background-neutral-subtle);--_color-foreground: var(--odx-color-foreground-rest-subtle)}:host([variant=\"primary\"][loading]){--_color-background: var(--odx-color-background-primary-subtle)}:host([variant=\"accent\"][loading]){--_color-background: var(--odx-color-background-accent-subtle)}:host([variant=\"danger\"][loading]){--_color-background: var(--odx-color-background-danger-subtle)}:host([variant=\"ghost\"][loading]){--_color-background: var(--odx-color-background-transparent-rest)}}";
|
|
130
|
-
|
|
131
|
-
const ButtonBadgeAlign = { START: "start", CENTER: "center", END: "end" };
|
|
132
|
-
const ButtonSize = pick(Size, ["XS", "SM", "MD", "LG"]);
|
|
133
|
-
const ButtonVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "ACCENT", "DANGER", "GHOST"]);
|
|
134
|
-
const _OdxButton = class _OdxButton extends InteractiveElement {
|
|
135
|
-
constructor() {
|
|
136
|
-
super();
|
|
137
|
-
/** @internal */
|
|
138
|
-
this.#internals = this.attachInternals();
|
|
139
|
-
this.type = "button";
|
|
140
|
-
this.size = ButtonSize.MD;
|
|
141
|
-
this.variant = ButtonVariant.NEUTRAL;
|
|
142
|
-
this.#handleClick = (_event) => {
|
|
143
|
-
if (this.type === "submit") {
|
|
144
|
-
this.#internals.form?.requestSubmit();
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (this.type === "reset") {
|
|
148
|
-
this.#internals.form?.reset();
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
if (!isServer) {
|
|
153
|
-
this.addEventListener("click", this.#handleClick);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
static {
|
|
157
|
-
customElement("odx-button", styles$1d)(_OdxButton);
|
|
158
|
-
}
|
|
159
|
-
static {
|
|
160
|
-
/** @internal */
|
|
161
|
-
this.formAssociated = true;
|
|
162
|
-
}
|
|
163
|
-
#internals;
|
|
164
|
-
connectedCallback() {
|
|
165
|
-
super.connectedCallback();
|
|
166
|
-
this.toggleAttribute("odx-button", true);
|
|
167
|
-
}
|
|
168
|
-
render() {
|
|
169
|
-
return html`
|
|
170
|
-
${super.render()}
|
|
171
|
-
<slot name="badge"></slot>
|
|
172
|
-
`;
|
|
173
|
-
}
|
|
174
|
-
#handleClick;
|
|
175
|
-
};
|
|
176
|
-
__decorateClass([
|
|
177
|
-
property({ reflect: true, attribute: "align-badge" })
|
|
178
|
-
], _OdxButton.prototype, "alignBadge", 2);
|
|
179
|
-
__decorateClass([
|
|
180
|
-
property()
|
|
181
|
-
], _OdxButton.prototype, "type", 2);
|
|
182
|
-
__decorateClass([
|
|
183
|
-
property({ reflect: true, useDefault: true })
|
|
184
|
-
], _OdxButton.prototype, "size", 2);
|
|
185
|
-
__decorateClass([
|
|
186
|
-
property({ reflect: true, useDefault: true })
|
|
187
|
-
], _OdxButton.prototype, "variant", 2);
|
|
188
|
-
let OdxButton = _OdxButton;
|
|
189
|
-
|
|
190
|
-
const styles$1c = "@layer variant{:host([done]){--_color-background: var(--_color-background-pressed);--_color-stroke: var(--_color-stroke-pressed);cursor:default;[part=base]{pointer-events:none}}}";
|
|
191
|
-
|
|
192
|
-
const _OdxActionButton = class _OdxActionButton extends OdxButton {
|
|
193
|
-
constructor() {
|
|
194
|
-
super(...arguments);
|
|
195
|
-
this.isStatusMessageShown = false;
|
|
196
|
-
this.done = false;
|
|
197
|
-
this.statusIcon = "core::check-filled-mono";
|
|
198
|
-
this.statusMessage = "";
|
|
199
|
-
this.statusTimeout = 2e3;
|
|
200
|
-
this.statusMessageTimeout = 1500;
|
|
201
|
-
this.replaceContent = false;
|
|
202
|
-
this.#handleClick = (event) => {
|
|
203
|
-
event.stopImmediatePropagation();
|
|
204
|
-
if (this.done || this.emit("invoke")) return;
|
|
205
|
-
this.done = true;
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
static {
|
|
209
|
-
customElement("odx-action-button", styles$1c)(_OdxActionButton);
|
|
210
|
-
}
|
|
211
|
-
/** @internal */
|
|
212
|
-
#statusTimeout;
|
|
213
|
-
firstUpdated(props) {
|
|
214
|
-
super.firstUpdated(props);
|
|
215
|
-
this.nativeElement.addEventListener("click", this.#handleClick);
|
|
216
|
-
}
|
|
217
|
-
render() {
|
|
218
|
-
return html`
|
|
219
|
-
${super.render()}
|
|
220
|
-
${when(
|
|
221
|
-
!this.replaceContent && this.statusMessage,
|
|
222
|
-
(statusMessage) => html`
|
|
223
|
-
<odx-tooltip placement="top" .popover=${"manual"} .show=${this.isStatusMessageShown} timeout=${this.statusMessageTimeout}>
|
|
224
|
-
<odx-text size="sm" strong>${statusMessage}</odx-text>
|
|
225
|
-
</odx-tooltip>
|
|
226
|
-
`
|
|
227
|
-
)}
|
|
228
|
-
`;
|
|
229
|
-
}
|
|
230
|
-
renderContent() {
|
|
231
|
-
return html`
|
|
232
|
-
<slot name="prefix"></slot>
|
|
233
|
-
${when(
|
|
234
|
-
this.replaceContent && this.statusMessage && this.done,
|
|
235
|
-
() => this.statusMessage,
|
|
236
|
-
() => html`<slot></slot>`
|
|
237
|
-
)}
|
|
238
|
-
${when(
|
|
239
|
-
this.loading,
|
|
240
|
-
() => this.renderLoader(),
|
|
241
|
-
() => html`<odx-icon name=${optionalAttr(this.done ? this.statusIcon : this.icon)} part="icon"></odx-icon>`
|
|
242
|
-
)}
|
|
243
|
-
<slot name="badge"></slot>
|
|
244
|
-
`;
|
|
245
|
-
}
|
|
246
|
-
willUpdate(props) {
|
|
247
|
-
super.updated(props);
|
|
248
|
-
if (props.has("done") && this.done) {
|
|
249
|
-
this.#handleDoneChange();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
#handleDoneChange() {
|
|
253
|
-
const timeoutDuration = Math.max(0, this.statusTimeout);
|
|
254
|
-
this.isStatusMessageShown = true;
|
|
255
|
-
this.tooltip?.mountPopover(this.nativeElement);
|
|
256
|
-
if (this.statusTimeout <= 0) return;
|
|
257
|
-
clearTimeout(this.#statusTimeout);
|
|
258
|
-
this.#statusTimeout = window.setTimeout(() => {
|
|
259
|
-
this.done = false;
|
|
260
|
-
this.isStatusMessageShown = false;
|
|
261
|
-
}, timeoutDuration);
|
|
262
|
-
}
|
|
263
|
-
#handleClick;
|
|
264
|
-
};
|
|
265
|
-
__decorateClass([
|
|
266
|
-
query("odx-tooltip")
|
|
267
|
-
], _OdxActionButton.prototype, "tooltip", 2);
|
|
268
|
-
__decorateClass([
|
|
269
|
-
state()
|
|
270
|
-
], _OdxActionButton.prototype, "isStatusMessageShown", 2);
|
|
271
|
-
__decorateClass([
|
|
272
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
273
|
-
], _OdxActionButton.prototype, "done", 2);
|
|
274
|
-
__decorateClass([
|
|
275
|
-
property({ reflect: true, useDefault: true })
|
|
276
|
-
], _OdxActionButton.prototype, "icon", 2);
|
|
277
|
-
__decorateClass([
|
|
278
|
-
property({ attribute: "status-icon" })
|
|
279
|
-
], _OdxActionButton.prototype, "statusIcon", 2);
|
|
280
|
-
__decorateClass([
|
|
281
|
-
property({ attribute: "status-message" })
|
|
282
|
-
], _OdxActionButton.prototype, "statusMessage", 2);
|
|
283
|
-
__decorateClass([
|
|
284
|
-
property({ type: Number, attribute: "status-timeout" })
|
|
285
|
-
], _OdxActionButton.prototype, "statusTimeout", 2);
|
|
286
|
-
__decorateClass([
|
|
287
|
-
property({ attribute: false })
|
|
288
|
-
], _OdxActionButton.prototype, "statusMessageTimeout", 2);
|
|
289
|
-
__decorateClass([
|
|
290
|
-
property({ type: Boolean, attribute: "replace-content" })
|
|
291
|
-
], _OdxActionButton.prototype, "replaceContent", 2);
|
|
292
|
-
let OdxActionButton = _OdxActionButton;
|
|
293
|
-
|
|
294
|
-
const styles$1b = ":host{display:inline;text-decoration:underline;color:var(--odx-color-foreground-accent-rest)}:host(:focus-visible){outline:none}[part~=base]{transition:var(--odx-transition-reduced);outline:var(--odx-focus-ring-outline);outline-offset:0;border-radius:var(--odx-border-radius-controls);padding-inline:var(--odx-size-px);text-decoration:inherit;color:inherit;&:focus-visible{outline-color:var(--odx-color-stroke-focus-outer)}}:host(:hover){color:var(--odx-color-foreground-accent-hover)}:host([strong]){font-weight:var(--odx-typography-font-weight-medium)}:host([disabled]),:host([subtle]:not(:hover)){text-decoration:none}:host([disabled]){color:var(--odx-color-foreground-rest-subtle);[part~=base]{cursor:default}}";
|
|
295
|
-
|
|
296
|
-
const _OdxLink = class _OdxLink extends InteractiveLink {
|
|
297
|
-
constructor() {
|
|
298
|
-
super(...arguments);
|
|
299
|
-
this.strong = false;
|
|
300
|
-
this.subtle = false;
|
|
301
|
-
}
|
|
302
|
-
static {
|
|
303
|
-
customElement("odx-link", styles$1b)(_OdxLink);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
__decorateClass([
|
|
307
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
308
|
-
], _OdxLink.prototype, "strong", 2);
|
|
309
|
-
__decorateClass([
|
|
310
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
311
|
-
], _OdxLink.prototype, "subtle", 2);
|
|
312
|
-
let OdxLink = _OdxLink;
|
|
313
|
-
|
|
314
|
-
const styles$1a = ":host{display:flex;gap:var(--odx-size-50)}odx-link{display:block;transition:var(--odx-transition-reduced);transition-property:border-color,color;padding-inline:var(--odx-size-50);&[aria-current=true]{color:var(--odx-color-foreground-rest);font-weight:var(--odx-typography-font-weight-medium)}}:host(:not([vertical])){align-items:center;block-size:var(--odx-size-225);odx-link{--_outline-offset: var(--odx-focus-ring-offset);&[aria-current=true]{border-radius:0;text-decoration:underline}}}:host([vertical]){flex-direction:column;border-inline-start:var(--odx-border-width-thick) solid var(--odx-color-stroke-control-rest);odx-link{margin-inline-start:calc(-1 * var(--odx-border-width-thick));border-inline-start:inherit;&[aria-current=true]{border-inline-start-color:var(--odx-color-background-accent-rest)}}}";
|
|
315
|
-
|
|
316
|
-
const ANCHOR_SELECTOR = "odx-anchor";
|
|
317
|
-
class AnchorObserver {
|
|
318
|
-
constructor(root) {
|
|
319
|
-
this.#intersectionState = signal({});
|
|
320
|
-
this.anchors = signal([]);
|
|
321
|
-
this.visibleAnchors = computed(() => {
|
|
322
|
-
return this.anchors.value.filter((anchor) => !!this.#intersectionState.value[anchor.id]);
|
|
323
|
-
});
|
|
324
|
-
this.updateAnchors = () => {
|
|
325
|
-
const anchors = Array.from(this.root.querySelectorAll(`[${ANCHOR_SELECTOR}][id]`));
|
|
326
|
-
for (const anchor of anchors) {
|
|
327
|
-
if (!this.#isAnchor(anchor)) continue;
|
|
328
|
-
this.#intersectionObserver?.observe(anchor);
|
|
329
|
-
}
|
|
330
|
-
this.anchors.value = anchors;
|
|
331
|
-
};
|
|
332
|
-
this.#handleIntersection = (entries) => {
|
|
333
|
-
const state = this.#intersectionState.value;
|
|
334
|
-
for (const entry of entries) {
|
|
335
|
-
if (!this.#isAnchor(entry.target)) continue;
|
|
336
|
-
state[entry.target.id] = entry.isIntersecting;
|
|
337
|
-
}
|
|
338
|
-
this.#intersectionState.value = { ...state };
|
|
339
|
-
};
|
|
340
|
-
this.root = root ?? document;
|
|
341
|
-
this.#intersectionObserver = new IntersectionObserver(this.#handleIntersection, { root });
|
|
342
|
-
this.#mutationObserver = new MutationObserver((mutations) => {
|
|
343
|
-
if (mutations.length === 0) return;
|
|
344
|
-
this.updateAnchors();
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
#intersectionObserver;
|
|
348
|
-
#intersectionState;
|
|
349
|
-
#mutationObserver;
|
|
350
|
-
observe() {
|
|
351
|
-
this.#mutationObserver?.observe(this.root, { attributes: true, childList: true, subtree: true, attributeFilter: ["odx-anchor"] });
|
|
352
|
-
this.updateAnchors();
|
|
353
|
-
}
|
|
354
|
-
disconnect() {
|
|
355
|
-
this.#intersectionObserver?.disconnect();
|
|
356
|
-
this.#mutationObserver?.disconnect();
|
|
357
|
-
}
|
|
358
|
-
#isAnchor(element) {
|
|
359
|
-
return (element.ariaLabel || element.textContent) && element.hasAttribute(ANCHOR_SELECTOR);
|
|
360
|
-
}
|
|
361
|
-
#handleIntersection;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const _OdxAnchorNavigation = class _OdxAnchorNavigation extends e(CustomElement) {
|
|
365
|
-
constructor() {
|
|
366
|
-
super();
|
|
367
|
-
this.vertical = false;
|
|
368
|
-
this.#handleClick = (event) => {
|
|
369
|
-
const target = getElementFromEvent(event, (node) => node instanceof OdxLink);
|
|
370
|
-
if (!target) return;
|
|
371
|
-
event.preventDefault();
|
|
372
|
-
document.querySelector(target.href)?.scrollIntoView();
|
|
373
|
-
};
|
|
374
|
-
this.addEventListener("click", this.#handleClick);
|
|
375
|
-
}
|
|
376
|
-
static {
|
|
377
|
-
customElement("odx-anchor-navigation", styles$1a)(_OdxAnchorNavigation);
|
|
378
|
-
}
|
|
379
|
-
#anchorObserver;
|
|
380
|
-
connectedCallback() {
|
|
381
|
-
super.connectedCallback();
|
|
382
|
-
this.#handleContainerChange();
|
|
383
|
-
}
|
|
384
|
-
disconnectedCallback() {
|
|
385
|
-
this.#anchorObserver?.disconnect();
|
|
386
|
-
super.disconnectedCallback();
|
|
387
|
-
}
|
|
388
|
-
renderAnchorLink(anchor, isActive = false) {
|
|
389
|
-
return when(
|
|
390
|
-
anchor.ariaLabel || anchor.textContent,
|
|
391
|
-
(label) => html`
|
|
392
|
-
<odx-link href="#${anchor.id}" aria-current=${isActive} subtle>
|
|
393
|
-
${when(!this.vertical, () => html`<odx-icon name="core::link-internal"></odx-icon>`)}
|
|
394
|
-
${label}
|
|
395
|
-
</odx-link>
|
|
396
|
-
`
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
render() {
|
|
400
|
-
const anchors = this.#anchorObserver?.anchors.value ?? [];
|
|
401
|
-
const visibleAnchors = this.#anchorObserver?.visibleAnchors.value;
|
|
402
|
-
return html`${anchors.map((anchor) => this.renderAnchorLink(anchor, visibleAnchors?.[0] === anchor))}`;
|
|
403
|
-
}
|
|
404
|
-
updated(props) {
|
|
405
|
-
if (props.has("container")) {
|
|
406
|
-
this.#handleContainerChange();
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
#handleContainerChange() {
|
|
410
|
-
const root = this.container ? document.querySelector(this.container) : null;
|
|
411
|
-
if (root === this.#anchorObserver?.root) return;
|
|
412
|
-
this.#anchorObserver?.disconnect();
|
|
413
|
-
this.#anchorObserver = new AnchorObserver(root);
|
|
414
|
-
this.#anchorObserver?.observe();
|
|
415
|
-
}
|
|
416
|
-
#handleClick;
|
|
417
|
-
};
|
|
418
|
-
__decorateClass([
|
|
419
|
-
property()
|
|
420
|
-
], _OdxAnchorNavigation.prototype, "container", 2);
|
|
421
|
-
__decorateClass([
|
|
422
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
423
|
-
], _OdxAnchorNavigation.prototype, "vertical", 2);
|
|
424
|
-
let OdxAnchorNavigation = _OdxAnchorNavigation;
|
|
425
|
-
|
|
426
|
-
const styles$19 = ":host{display:flex;gap:var(--odx-size-150);align-items:center;justify-content:space-between;padding:var(--odx-size-75)}.content{margin-inline-end:auto}";
|
|
427
|
-
|
|
428
|
-
const AreaHeaderSize = pick(Size, ["SM", "MD", "LG", "XL"]);
|
|
429
|
-
const _OdxAreaHeader = class _OdxAreaHeader extends CustomElement {
|
|
430
|
-
constructor() {
|
|
431
|
-
super(...arguments);
|
|
432
|
-
this.size = AreaHeaderSize.MD;
|
|
433
|
-
}
|
|
434
|
-
static {
|
|
435
|
-
customElement("odx-area-header", styles$19)(_OdxAreaHeader);
|
|
436
|
-
}
|
|
437
|
-
render() {
|
|
438
|
-
return html`
|
|
439
|
-
<slot name="prefix"></slot>
|
|
440
|
-
<div class="content">
|
|
441
|
-
<slot></slot>
|
|
442
|
-
</div>
|
|
443
|
-
<slot name="suffix"></slot>
|
|
444
|
-
`;
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
__decorateClass([
|
|
448
|
-
property({ reflect: true, useDefault: true })
|
|
449
|
-
], _OdxAreaHeader.prototype, "size", 2);
|
|
450
|
-
let OdxAreaHeader = _OdxAreaHeader;
|
|
451
|
-
|
|
452
|
-
const styles$18 = ":host{--color-background: var(--odx-color-background-transparent-pressed);--color-foreground: inherit;--_border-radius: var(--odx-border-radius-circle);--_size: var(--odx-size-225);display:flex;position:relative;flex:0 0 auto;flex-direction:column;place-content:center;place-items:center;transition:var(--odx-transition-default);transition-property:background-color,box-shadow;border-radius:var(--_border-radius);background-color:var(--color-background);block-size:var(--_size);inline-size:var(--_size);overflow:clip;vertical-align:middle;color:var(--color-foreground);font-size:var(--odx-typography-font-size-3);user-select:none}::slotted(img){position:absolute;inset:var(--odx-size-12);z-index:1;border-radius:var(--_border-radius);inline-size:calc(100% - var(--odx-size-25));pointer-events:none;object-fit:cover}::slotted(odx-icon){font-size:inherit}:host([shape=\"rectangle\"]){--_border-radius: var(--odx-border-radius-sm)}:host([variant=\"neutral\"]){--color-background: var(--odx-experience-color-secondary-rest)}:host([variant=\"accent\"]){--color-background: var(--odx-color-background-accent-rest);--color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"primary\"]){--color-background: var(--odx-color-background-primary-rest);--color-foreground: var(--odx-color-foreground-inverse-static)}:host([size=\"sm\"]){--_size: var(--odx-size-150);font-size:var(--odx-typography-font-size-1);font-weight:var(--odx-typography-font-weight-medium);::slotted(img){inset:var(--odx-size-px);inline-size:calc(100% - var(--odx-size-12))}}:host([size=\"lg\"]){--_size: var(--odx-size-300);font-size:var(--odx-typography-font-size-5)}:host([size=\"xl\"]){--_size: var(--odx-size-400);font-size:var(--odx-typography-font-size-7)}:host([size=\"xxl\"]){--_size: var(--odx-size-600);font-size:var(--odx-typography-font-size-8)}";
|
|
453
|
-
|
|
454
|
-
const AvatarShape = pick(Shape, ["CIRCLE", "RECTANGLE"]);
|
|
455
|
-
const AvatarSize = pick(Size, ["SM", "MD", "LG", "XL", "XXL"]);
|
|
456
|
-
const AvatarVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "ACCENT"]);
|
|
457
|
-
const _OdxAvatar = class _OdxAvatar extends CustomElement {
|
|
458
|
-
constructor() {
|
|
459
|
-
super(...arguments);
|
|
460
|
-
this.shape = AvatarShape.CIRCLE;
|
|
461
|
-
this.size = AvatarSize.MD;
|
|
462
|
-
this.variant = AvatarVariant.NEUTRAL;
|
|
463
|
-
}
|
|
464
|
-
static {
|
|
465
|
-
customElement("odx-avatar", styles$18)(_OdxAvatar);
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
__decorateClass([
|
|
469
|
-
property({ reflect: true, useDefault: true })
|
|
470
|
-
], _OdxAvatar.prototype, "shape", 2);
|
|
471
|
-
__decorateClass([
|
|
472
|
-
property({ reflect: true, useDefault: true })
|
|
473
|
-
], _OdxAvatar.prototype, "size", 2);
|
|
474
|
-
__decorateClass([
|
|
475
|
-
property({ reflect: true, useDefault: true })
|
|
476
|
-
], _OdxAvatar.prototype, "variant", 2);
|
|
477
|
-
let OdxAvatar = _OdxAvatar;
|
|
478
|
-
|
|
479
|
-
const styles$17 = ":host{display:flex;padding-inline:var(--odx-size-25);width:min-content}::slotted(odx-avatar){flex:0 0 auto;z-index:1}::slotted(odx-avatar:not(:first-of-type)){margin-inline-start:calc(-.33 * var(--_size))}:host(:is([size=\"lg\"],[size=\"xl\"])){gap:var(--odx-size-50)}";
|
|
480
|
-
|
|
481
|
-
const _OdxAvatarGroup = class _OdxAvatarGroup extends CustomElement {
|
|
482
|
-
constructor() {
|
|
483
|
-
super(...arguments);
|
|
484
|
-
this.size = AvatarSize.MD;
|
|
485
|
-
this.variant = AvatarVariant.NEUTRAL;
|
|
486
|
-
}
|
|
487
|
-
static {
|
|
488
|
-
customElement("odx-avatar-group", styles$17)(_OdxAvatarGroup);
|
|
489
|
-
}
|
|
490
|
-
updated(props) {
|
|
491
|
-
super.updated(props);
|
|
492
|
-
if (props.has("size") || props.has("variant")) {
|
|
493
|
-
for (const avatar of this.avatars) {
|
|
494
|
-
avatar.shape = AvatarShape.CIRCLE;
|
|
495
|
-
avatar.size = this.size;
|
|
496
|
-
avatar.variant = this.variant;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
__decorateClass([
|
|
502
|
-
queryAssignedElements({ selector: OdxAvatar.tagName })
|
|
503
|
-
], _OdxAvatarGroup.prototype, "avatars", 2);
|
|
504
|
-
__decorateClass([
|
|
505
|
-
property({ reflect: true, useDefault: true })
|
|
506
|
-
], _OdxAvatarGroup.prototype, "size", 2);
|
|
507
|
-
__decorateClass([
|
|
508
|
-
property({ reflect: true, useDefault: true })
|
|
509
|
-
], _OdxAvatarGroup.prototype, "variant", 2);
|
|
510
|
-
let OdxAvatarGroup = _OdxAvatarGroup;
|
|
511
|
-
|
|
512
|
-
const styles$16 = ":host{--_block-size: var(--odx-size-100);display:inline-block;border-radius:var(--odx-border-radius-circle);background-color:var(--_color-background);cursor:default;padding-inline:var(--odx-size-25);block-size:var(--_block-size);min-inline-size:var(--_block-size);vertical-align:middle;text-align:center;line-height:var(--_block-size);color:var(--_color-foreground);font-size:var(--odx-typography-font-size-1);font-weight:var(--odx-typography-font-weight-medium);pointer-events:none;user-select:none}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--_color-background)}70%{box-shadow:0 0 0 var(--odx-size-37) transparent}to{box-shadow:0 0 0 0 transparent}}:host,:host([variant=\"neutral\"]){--_color-background: var(--odx-experience-color-secondary-rest);--_color-foreground: var(--odx-experience-color-secondary-foreground)}:host([variant=\"primary\"]){--_color-background: var(--odx-color-background-primary-rest);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"accent\"]){--_color-background: var(--odx-color-background-accent-rest);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"success\"]){--_color-background: var(--odx-color-background-success-rest);--_color-foreground: var(--odx-color-foreground-rest-static)}:host([variant=\"warning\"]){--_color-background: var(--odx-color-background-warning-rest);--_color-foreground: var(--odx-color-foreground-rest-static)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-background-danger-rest);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([compact]){--_block-size: var(--odx-size-75);margin:var(--odx-size-12);padding:0;inline-size:var(--_block-size)}:host([pulse]){animation:pulse 1.25s infinite}";
|
|
513
|
-
|
|
514
|
-
const BadgeVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "ACCENT", "SUCCESS", "WARNING", "DANGER"]);
|
|
515
|
-
const _OdxBadge = class _OdxBadge extends CustomElement {
|
|
516
|
-
constructor() {
|
|
517
|
-
super(...arguments);
|
|
518
|
-
this.compact = false;
|
|
519
|
-
this.pulse = false;
|
|
520
|
-
this.variant = BadgeVariant.NEUTRAL;
|
|
521
|
-
}
|
|
522
|
-
static {
|
|
523
|
-
customElement("odx-badge", styles$16)(_OdxBadge);
|
|
524
|
-
}
|
|
525
|
-
render() {
|
|
526
|
-
if (this.compact) {
|
|
527
|
-
return html`<odx-visually-hidden><slot></slot></odx-visually-hidden>`;
|
|
528
|
-
}
|
|
529
|
-
return super.render();
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
__decorateClass([
|
|
533
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
534
|
-
], _OdxBadge.prototype, "compact", 2);
|
|
535
|
-
__decorateClass([
|
|
536
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
537
|
-
], _OdxBadge.prototype, "pulse", 2);
|
|
538
|
-
__decorateClass([
|
|
539
|
-
property({ reflect: true, useDefault: true })
|
|
540
|
-
], _OdxBadge.prototype, "variant", 2);
|
|
541
|
-
let OdxBadge = _OdxBadge;
|
|
542
|
-
|
|
543
|
-
const styles$15 = ":host{--_gap: var(--odx-size-37);display:flex;flex-wrap:wrap;column-gap:var(--_gap);place-items:center;cursor:default;padding-block:var(--odx-size-37);padding-inline:var(--odx-size-75);min-block-size:var(--odx-size-225)}odx-breadcrumb-item,::slotted(odx-breadcrumb-item){gap:var(--_gap)}";
|
|
544
|
-
|
|
545
|
-
const styles$14 = ":host{display:contents}.separator{--size: var(--odx-size-75);margin:var(--odx-size-37);color:var(--odx-color-foreground-rest-subtle)}:host([hidden]){display:none}:host([aria-current=\"page\"]) ::slotted(odx-link){color:var(--odx-color-foreground-rest-subtle)!important}::slotted(*){margin:0}";
|
|
546
|
-
|
|
547
|
-
const _OdxBreadcrumbsItem = class _OdxBreadcrumbsItem extends CustomElement {
|
|
548
|
-
constructor() {
|
|
549
|
-
super(...arguments);
|
|
550
|
-
this.fallback = false;
|
|
551
|
-
}
|
|
552
|
-
static {
|
|
553
|
-
customElement("odx-breadcrumbs-item", styles$14)(_OdxBreadcrumbsItem);
|
|
554
|
-
}
|
|
555
|
-
isLast() {
|
|
556
|
-
return !this.nextElementSibling;
|
|
557
|
-
}
|
|
558
|
-
get interactiveElement() {
|
|
559
|
-
return this.linkElements[0] ?? null;
|
|
560
|
-
}
|
|
561
|
-
render() {
|
|
562
|
-
return html`
|
|
563
|
-
<slot></slot>
|
|
564
|
-
${when(!this.isLast(), () => html`<odx-icon class="separator" name="chevron-right"></odx-icon>`)}
|
|
565
|
-
`;
|
|
566
|
-
}
|
|
567
|
-
updated(props) {
|
|
568
|
-
super.updated(props);
|
|
569
|
-
if (this.interactiveElement) {
|
|
570
|
-
this.interactiveElement.subtle = true;
|
|
571
|
-
this.interactiveElement.strong = this.isLast();
|
|
572
|
-
this.interactiveElement.ariaCurrent = this.isLast() ? "page" : null;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
};
|
|
576
|
-
__decorateClass([
|
|
577
|
-
queryAssignedElements({ selector: OdxLink.tagName, flatten: true })
|
|
578
|
-
], _OdxBreadcrumbsItem.prototype, "linkElements", 2);
|
|
579
|
-
__decorateClass([
|
|
580
|
-
property({ type: Boolean })
|
|
581
|
-
], _OdxBreadcrumbsItem.prototype, "fallback", 2);
|
|
582
|
-
let OdxBreadcrumbsItem = _OdxBreadcrumbsItem;
|
|
583
|
-
|
|
584
|
-
const _OdxBreadcrumbs = class _OdxBreadcrumbs extends CustomElement {
|
|
585
|
-
constructor() {
|
|
586
|
-
super(...arguments);
|
|
587
|
-
this.max = 4;
|
|
588
|
-
}
|
|
589
|
-
static {
|
|
590
|
-
customElement("odx-breadcrumbs", styles$15)(_OdxBreadcrumbs);
|
|
591
|
-
}
|
|
592
|
-
firstUpdated(props) {
|
|
593
|
-
super.firstUpdated(props);
|
|
594
|
-
this.role = "navigation";
|
|
595
|
-
this.ariaLabel ||= "Breadcrumbs";
|
|
596
|
-
}
|
|
597
|
-
render() {
|
|
598
|
-
if (Array.isArray(this.items)) {
|
|
599
|
-
const items = this.items.filter((...args) => this.#isItemVisible(...args));
|
|
600
|
-
return html`${items.map(({ label, href }) => html`<odx-breadcrumbs-item><odx-link href=${href}>${label}</odx-link></odx-breadcrumbs-item>`)}`;
|
|
601
|
-
}
|
|
602
|
-
return html`<slot @slotchange=${this.#updateContext}></slot>`;
|
|
603
|
-
}
|
|
604
|
-
updated(props) {
|
|
605
|
-
super.updated(props);
|
|
606
|
-
if (props.has("max")) {
|
|
607
|
-
this.#updateContext();
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
#isItemVisible(_, index, items) {
|
|
611
|
-
return index === 0 || index > items.length - this.max;
|
|
612
|
-
}
|
|
613
|
-
#updateContext() {
|
|
614
|
-
for (const [index, item] of this.itemElements.entries()) {
|
|
615
|
-
item.hidden = !this.#isItemVisible(item, index, this.itemElements);
|
|
616
|
-
}
|
|
617
|
-
const renderedItemElements = this.shadowRoot?.querySelectorAll(OdxBreadcrumbsItem.tagName) ?? [];
|
|
618
|
-
if (renderedItemElements.length === 0) return;
|
|
619
|
-
for (const item of Array.from(renderedItemElements)) {
|
|
620
|
-
item.requestUpdate();
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
__decorateClass([
|
|
625
|
-
queryAssignedElements({ selector: OdxBreadcrumbsItem.tagName, flatten: true })
|
|
626
|
-
], _OdxBreadcrumbs.prototype, "itemElements", 2);
|
|
627
|
-
__decorateClass([
|
|
628
|
-
property({ type: Number })
|
|
629
|
-
], _OdxBreadcrumbs.prototype, "max", 2);
|
|
630
|
-
__decorateClass([
|
|
631
|
-
property({ attribute: false })
|
|
632
|
-
], _OdxBreadcrumbs.prototype, "items", 2);
|
|
633
|
-
let OdxBreadcrumbs = _OdxBreadcrumbs;
|
|
634
|
-
|
|
635
|
-
const styles$13 = ":host{display:inline-flex;gap:var(--odx-size-px);align-items:center}::slotted([odx-button]:not(:first-child,:last-child)){border-radius:0}::slotted([odx-button]:is(:hover,:focus-within)){z-index:1}:host([block]){display:flex;::slotted([odx-button]){width:100%}}:host(:not([vertical])){::slotted([odx-button]:first-child:not(:last-child)){border-start-end-radius:0;border-end-end-radius:0}::slotted(*){margin-inline:0}::slotted([odx-button]:last-child:not(:first-child)){border-start-start-radius:0;border-end-start-radius:0}}:host([vertical]){flex-direction:column;::slotted(*){margin-block:0}::slotted([odx-button]:first-child){border-end-start-radius:0;border-end-end-radius:0}::slotted([odx-button]:last-child){border-start-start-radius:0;border-start-end-radius:0}}";
|
|
636
|
-
|
|
637
|
-
const _OdxButtonGroup = class _OdxButtonGroup extends CanBeDisabled(CustomElement) {
|
|
638
|
-
constructor() {
|
|
639
|
-
super(...arguments);
|
|
640
|
-
this.block = false;
|
|
641
|
-
this.vertical = false;
|
|
642
|
-
this.#updateButtonVariants = () => {
|
|
643
|
-
if (!this.variant) return;
|
|
644
|
-
for (const button of this.buttons) {
|
|
645
|
-
button.variant = this.variant;
|
|
646
|
-
}
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
static {
|
|
650
|
-
customElement("odx-button-group", styles$13)(_OdxButtonGroup);
|
|
651
|
-
}
|
|
652
|
-
render() {
|
|
653
|
-
return html`
|
|
654
|
-
<slot @slotchange=${this.#updateButtonVariants}></slot>
|
|
655
|
-
`;
|
|
656
|
-
}
|
|
657
|
-
updated(props) {
|
|
658
|
-
super.updated(props);
|
|
659
|
-
if (props.has("variant")) {
|
|
660
|
-
this.#updateButtonVariants();
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
#updateButtonVariants;
|
|
664
|
-
};
|
|
665
|
-
__decorateClass([
|
|
666
|
-
queryAssignedElements({ selector: "button, odx-button", flatten: true })
|
|
667
|
-
], _OdxButtonGroup.prototype, "buttons", 2);
|
|
668
|
-
__decorateClass([
|
|
669
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
670
|
-
], _OdxButtonGroup.prototype, "block", 2);
|
|
671
|
-
__decorateClass([
|
|
672
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
673
|
-
], _OdxButtonGroup.prototype, "vertical", 2);
|
|
674
|
-
__decorateClass([
|
|
675
|
-
property()
|
|
676
|
-
], _OdxButtonGroup.prototype, "variant", 2);
|
|
677
|
-
let OdxButtonGroup = _OdxButtonGroup;
|
|
678
|
-
|
|
679
|
-
const styles$12 = ":host{--_card-padding: var(--odx-size-150);display:grid;grid-template-areas:\"image image\" \"avatar avatar\" \"header header-actions\" \"content content\" \"footer footer\";grid-template-columns:1fr auto;place-content:flex-start;transition:var(--odx-transition-reduced);transition-property:box-shadow,transform,border-color;outline:var(--odx-focus-ring-outline);border:var(--odx-border-width-thin) solid transparent;border-radius:var(--odx-border-radius-md);background-color:var(--odx-color-background-level-1);padding:var(--_card-padding);max-width:100%;overflow:clip}.header,.header-actions{display:flex;gap:var(--odx-size-50);place-items:center;margin-block-end:var(--odx-size-50)}.header{grid-area:header}.header-actions{grid-area:header-actions}.avatar{display:flex;grid-area:avatar;place-items:flex-end;margin-block-start:calc(-1 * var(--odx-size-50))}.image{position:relative;grid-area:image;margin:calc(-1 * (var(--_card-padding) + var(--odx-border-width-thin)))}.image:after{position:absolute;inset:0;transition:var(--odx-transition-default);opacity:0;background-color:var(--odx-color-background-transparent-hover);content:\"\";pointer-events:none;backdrop-filter:blur(var(--odx-elevation-blur))}.content{display:inline-block;grid-area:content}.footer{grid-area:footer}.image+*{margin-block-start:var(--odx-size-250)}.image+.avatar{block-size:0}.avatar+*{margin-block-start:var(--odx-size-50)}slot[name=header]::slotted(odx-avatar){align-self:flex-start}slot[name=image]::slotted(*){max-block-size:100%;inline-size:100%;pointer-events:none;object-fit:cover;aspect-ratio:16 / 9;user-select:none}slot[name=avatar]::slotted(*){margin:0}:host([interactive]){border-color:var(--odx-color-stroke-neutral-subtle);cursor:pointer;user-select:none}:host([interactive]:hover:not(:active)){transform:translateY(calc(-1 * var(--odx-size-12)));border-color:transparent;box-shadow:var(--odx-shadow-level-1);.image:after{opacity:1}}:host([interactive]:active){transform:translateY(0)}:host(:focus-visible){outline-color:var(--odx-color-stroke-focus-outer)}";
|
|
680
|
-
|
|
681
|
-
const _OdxCard = class _OdxCard extends CanBeDisabled(CustomElement) {
|
|
682
|
-
constructor() {
|
|
683
|
-
super(...arguments);
|
|
684
|
-
this.interactive = false;
|
|
685
|
-
}
|
|
686
|
-
static {
|
|
687
|
-
customElement("odx-card", styles$12)(_OdxCard);
|
|
688
|
-
}
|
|
689
|
-
updated(_changedProperties) {
|
|
690
|
-
super.updated(_changedProperties);
|
|
691
|
-
if (this.disabled) return;
|
|
692
|
-
if (this.interactive) {
|
|
693
|
-
this.tabIndex = 0;
|
|
694
|
-
} else {
|
|
695
|
-
this.removeAttribute("tabindex");
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
render() {
|
|
699
|
-
return html`
|
|
700
|
-
${optionalSlot(this, "header-actions")}
|
|
701
|
-
${optionalSlot(this, "image")}
|
|
702
|
-
${optionalSlot(this, "avatar")}
|
|
703
|
-
${optionalSlot(this, "header")}
|
|
704
|
-
<div class="content">
|
|
705
|
-
<slot></slot>
|
|
706
|
-
</div>
|
|
707
|
-
${optionalSlot(this, "footer")}
|
|
708
|
-
`;
|
|
709
|
-
}
|
|
710
|
-
};
|
|
711
|
-
__decorateClass([
|
|
712
|
-
property({ type: Boolean, reflect: true })
|
|
713
|
-
], _OdxCard.prototype, "interactive", 2);
|
|
714
|
-
let OdxCard = _OdxCard;
|
|
715
|
-
|
|
716
|
-
const styles$11 = ":host{--_indicator-space: var(--odx-size-12);--_indicator-size: calc(var(--odx-size-150) - var(--_indicator-space) * 2);--_indicator-color-background: var(--odx-color-background-control-rest);--_indicator-color-stroke: var(--odx-color-stroke-control-subtle);--_indicator-color-foreground: transparent;--_label-color-foreground: inherit;display:inline-flex;margin-block:var(--odx-size-37);border-radius:var(--odx-border-radius-controls);cursor:pointer;padding:var(--_indicator-space);user-select:none}:host,.indicator,.content{transition:var(--odx-transition-reduced)}.indicator{display:flex;flex-shrink:0;place-content:center;place-items:center;transition-property:background-color,border-color;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border:var(--odx-border-width-thin) solid var(--_indicator-color-stroke);border-radius:var(--odx-border-radius-controls);border-color:var(--_indicator-color-stroke);background-color:var(--_indicator-color-background);block-size:var(--_indicator-size);inline-size:var(--_indicator-size);color:var(--_indicator-color-foreground)}.label{display:inline-block}.content{transition-property:color;margin-block:calc(-1 * var(--_indicator-space));color:var(--_label-color-foreground)}:host(:not(:empty)) .indicator{margin-inline-end:var(--odx-size-75)}:host(:empty) .content{display:none}:host(:hover){--_indicator-color-stroke: var(--odx-color-stroke-control-hover);--_indicator-color-background: var(--odx-color-background-control-hover)}:host(:focus-visible) .indicator{outline-color:var(--odx-color-stroke-focus-outer)}:host(:is([checked],[indeterminate])){--_indicator-color-background: var(--odx-color-background-control-selected);--_indicator-color-foreground: var(--odx-color-foreground-inverse-static);--_indicator-color-stroke: var(--odx-color-stroke-control-selected)}:host(:is([checked],[indeterminate]):not(:is([readonly],[disabled])):hover){--_indicator-color-background: var(--odx-color-background-control-selected-hover)}:host([disabled]:not([readonly])){--_indicator-color-background: var(--odx-color-background-disabled-rest);--_indicator-color-stroke: var(--odx-color-background-disabled-rest);--_label-color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed}:host([disabled]:not([readonly]):is([checked],[indeterminate])){--_indicator-color-background: var(--odx-color-background-disabled-selected);--_indicator-color-foreground: var(--odx-color-foreground-disabled-selected);--_indicator-color-stroke: var(--_indicator-color-background)}:host([readonly]){--_indicator-color-background: var(--odx-color-background-control-readonly);--_indicator-color-stroke: var(--odx-color-stroke-control-readonly);cursor:default}:host([readonly][checked]){--_indicator-color-foreground: var(--odx-color-foreground-rest)}";
|
|
717
|
-
|
|
718
|
-
const _OdxCheckbox = class _OdxCheckbox extends CheckboxFormControl {
|
|
719
|
-
constructor() {
|
|
720
|
-
super(...arguments);
|
|
721
|
-
this.indeterminate = false;
|
|
722
|
-
}
|
|
723
|
-
static {
|
|
724
|
-
customElement("odx-checkbox", styles$11)(_OdxCheckbox);
|
|
725
|
-
}
|
|
726
|
-
render() {
|
|
727
|
-
return html`
|
|
728
|
-
<div class="indicator">
|
|
729
|
-
<odx-icon name=${this.indeterminate ? "core::minus" : "core::check"}></odx-icon>
|
|
730
|
-
</div>
|
|
731
|
-
<div class="content">
|
|
732
|
-
<div class="label">
|
|
733
|
-
<slot></slot>
|
|
734
|
-
</div>
|
|
735
|
-
<div class="description">
|
|
736
|
-
<slot name="description"></slot>
|
|
737
|
-
</div>
|
|
738
|
-
</div>
|
|
739
|
-
`;
|
|
740
|
-
}
|
|
741
|
-
willUpdate(props) {
|
|
742
|
-
super.willUpdate(props);
|
|
743
|
-
if (props.has("indeterminate")) {
|
|
744
|
-
if (this.indeterminate) {
|
|
745
|
-
this.ariaChecked = "mixed";
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
toggle(state, dispatchEvent = false) {
|
|
750
|
-
super.toggle(state, dispatchEvent);
|
|
751
|
-
if (this.disabled || this.readonly) return;
|
|
752
|
-
this.indeterminate = false;
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
__decorateClass([
|
|
756
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
757
|
-
], _OdxCheckbox.prototype, "indeterminate", 2);
|
|
758
|
-
let OdxCheckbox = _OdxCheckbox;
|
|
759
|
-
|
|
760
|
-
const styles$10 = ":host{display:flex;column-gap:var(--odx-size-75)}::slotted(odx-checkbox-group){margin-inline-start:var(--odx-size-75)}:host(:not([layout=\"horizontal\"])){flex-direction:column}:host([layout=\"list\"]) ::slotted(:is(odx-checkbox,odx-switch):last-of-type){border-block-end:none}:host([layout=\"list\"]) ::slotted(:is(odx-checkbox,odx-switch)){margin:0;border-block-end:var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);padding:var(--odx-size-75);inline-size:auto}";
|
|
761
|
-
|
|
762
|
-
const CheckboxGroupLayout = { VERTICAL: "vertical", HORIZONTAL: "horizontal", LIST: "list" };
|
|
763
|
-
const _OdxCheckboxGroup = class _OdxCheckboxGroup extends CheckboxGroupFormControl {
|
|
764
|
-
constructor() {
|
|
765
|
-
super(...arguments);
|
|
766
|
-
this.layout = CheckboxGroupLayout.VERTICAL;
|
|
767
|
-
this.#handleSlotChange = () => {
|
|
768
|
-
this.groupControl?.removeEventListener("change", this.#handleGroupControlChange);
|
|
769
|
-
this.groupControl?.addEventListener("change", this.#handleGroupControlChange);
|
|
770
|
-
};
|
|
771
|
-
this.#handleGroupControlChange = (event) => {
|
|
772
|
-
if (!this.isGroupControl(event.target)) return;
|
|
773
|
-
event.stopImmediatePropagation();
|
|
774
|
-
this.updateValue(event.target.checked ? this.controls.map((control) => control.value) : [], true);
|
|
775
|
-
};
|
|
776
|
-
}
|
|
777
|
-
static {
|
|
778
|
-
customElement("odx-checkbox-group", styles$10)(_OdxCheckboxGroup);
|
|
779
|
-
}
|
|
780
|
-
render() {
|
|
781
|
-
return html`<slot @slotchange=${this.#handleSlotChange}></slot>`;
|
|
782
|
-
}
|
|
783
|
-
#handleSlotChange;
|
|
784
|
-
#handleGroupControlChange;
|
|
785
|
-
};
|
|
786
|
-
__decorateClass([
|
|
787
|
-
property({ reflect: true, useDefault: true })
|
|
788
|
-
], _OdxCheckboxGroup.prototype, "layout", 2);
|
|
789
|
-
let OdxCheckboxGroup = _OdxCheckboxGroup;
|
|
790
|
-
|
|
791
|
-
const styles$$ = ":host{--_color-background: var(--odx-experience-color-secondary-rest);--_color-background-hover: var(--odx-experience-color-secondary-hover);--_color-foreground: var(--odx-experience-color-secondary-foreground);--_block-size: var(--odx-size-150);--_border-radius: var(--_block-size);--_padding-inline: var(--odx-size-50);display:inline-flex;gap:var(--odx-size-25);place-items:center;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border-radius:var(--_border-radius);background-color:var(--_color-background);cursor:inherit;padding-inline:var(--_padding-inline);block-size:var(--_block-size);overflow:hidden;color:var(--_color-foreground)}:host,[part=base]{transition:var(--odx-transition-reduced);transition-property:color,background-color}[part=base]{min-inline-size:var(--odx-size-150);text-align:center;line-height:inherit;font-weight:var(--odx-typography-font-weight-medium);user-select:none}::slotted(odx-icon){font-size:var(--odx-font-size-text-md)}.action{margin-inline-end:calc(-1 * var(--_padding-inline));border-radius:inherit;&::part(base){outline-offset:calc(-1 * var(--odx-focus-ring-offset))}}:host(:focus-visible){outline-color:var(--odx-color-stroke-focus-outer)}:host([variant=\"primary\"]){--_color-background: var(--odx-color-background-primary-rest);--_color-background-hover: var(--odx-color-background-primary-hover);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"accent\"]){--_color-background: var(--odx-color-background-accent-rest);--_color-background-hover: var(--odx-color-background-accent-hover);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([variant=\"success\"]){--_color-background: var(--odx-color-background-success-rest);--_color-background-hover: var(--odx-color-success-hover);--_color-foreground: var(--odx-color-success-text)}:host([variant=\"warning\"]){--_color-background: var(--odx-color-background-warning-rest);--_color-background-hover: var(--odx-color-background-warning-hover);--_color-foreground: var(--odx-color-foreground-rest)}:host([variant=\"danger\"]){--_color-background: var(--odx-color-background-danger-rest);--_color-background-hover: var(--odx-color-danger-rest-hover);--_color-foreground: var(--odx-color-foreground-inverse-static)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);.action{pointer-events:none}}:host([interactive]){cursor:pointer}:host([interactive]:hover){--_color-background: var(--_color-background-hover)}:host([disabled][interactive]){--_color-background: var(--odx-color-background-disabled-rest);cursor:not-allowed}";
|
|
792
|
-
|
|
793
|
-
const ChipVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "ACCENT", "SUCCESS", "WARNING", "DANGER"]);
|
|
794
|
-
const _OdxChip = class _OdxChip extends CanBeDisabled(CustomElement) {
|
|
795
|
-
constructor() {
|
|
796
|
-
super(...arguments);
|
|
797
|
-
this.removable = false;
|
|
798
|
-
this.interactive = false;
|
|
799
|
-
this.variant = ChipVariant.NEUTRAL;
|
|
800
|
-
this.#handleActionClick = (event) => {
|
|
801
|
-
const actionElement = getElementFromEvent(event, (node) => !!this.actionElement && node === this.actionElement);
|
|
802
|
-
if (!actionElement) return;
|
|
803
|
-
event.stopPropagation();
|
|
804
|
-
this.emit("remove");
|
|
805
|
-
};
|
|
806
|
-
this.#handleClick = (event) => {
|
|
807
|
-
if (this.removable) {
|
|
808
|
-
const actionElement = getElementFromEvent(event, (node) => !!this.actionElement && node === this.actionElement);
|
|
809
|
-
if (actionElement) return;
|
|
810
|
-
}
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
static {
|
|
814
|
-
customElement("odx-chip", styles$$)(_OdxChip);
|
|
815
|
-
}
|
|
816
|
-
render() {
|
|
817
|
-
return html`
|
|
818
|
-
<odx-text part="base" size="sm" strong odxPreventTextOverflow>
|
|
819
|
-
<slot></slot>
|
|
820
|
-
</odx-text>
|
|
821
|
-
${when(this.removable, () => this.renderAction())}
|
|
822
|
-
`;
|
|
823
|
-
}
|
|
824
|
-
renderAction() {
|
|
825
|
-
return html`
|
|
826
|
-
<odx-icon-button class="action" icon="core::close" ?disabled=${this.disabled} @click=${this.#handleActionClick} variant="ghost" size="xs">
|
|
827
|
-
</odx-icon-button>
|
|
828
|
-
`;
|
|
829
|
-
}
|
|
830
|
-
willUpdate(props) {
|
|
831
|
-
super.willUpdate(props);
|
|
832
|
-
if ((props.has("interactive") || props.has("disabled")) && !this.disabled) {
|
|
833
|
-
this.#updateTabIndex();
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
#updateTabIndex() {
|
|
837
|
-
if (this.interactive) {
|
|
838
|
-
this.tabIndex = 0;
|
|
839
|
-
if (!this.actionElement) return;
|
|
840
|
-
this.actionElement.tabIndex = 0;
|
|
841
|
-
} else {
|
|
842
|
-
this.removeAttribute("tabindex");
|
|
843
|
-
if (!this.actionElement) return;
|
|
844
|
-
this.actionElement.removeAttribute("tabindex");
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
updated(props) {
|
|
848
|
-
if (props.has("removable") || props.has("interactive") || props.has("disabled")) {
|
|
849
|
-
if (this.removable || this.interactive) {
|
|
850
|
-
this.addEventListener("click", this.#handleClick, { capture: true });
|
|
851
|
-
} else {
|
|
852
|
-
this.removeEventListener("click", this.#handleClick);
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
#handleActionClick;
|
|
857
|
-
#handleClick;
|
|
858
|
-
};
|
|
859
|
-
__decorateClass([
|
|
860
|
-
query(".action")
|
|
861
|
-
], _OdxChip.prototype, "actionElement", 2);
|
|
862
|
-
__decorateClass([
|
|
863
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
864
|
-
], _OdxChip.prototype, "removable", 2);
|
|
865
|
-
__decorateClass([
|
|
866
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
867
|
-
], _OdxChip.prototype, "interactive", 2);
|
|
868
|
-
__decorateClass([
|
|
869
|
-
property({ reflect: true, useDefault: true })
|
|
870
|
-
], _OdxChip.prototype, "variant", 2);
|
|
871
|
-
let OdxChip = _OdxChip;
|
|
872
|
-
|
|
873
|
-
const styles$_ = ":host{--_indicator-color: var(--odx-color-background-primary-rest);--_track-color: var(--odx-palette-coolgray-10);display:flex;position:relative;place-content:center;place-items:center;block-size:100%;max-block-size:var(--_size);inline-size:100%;max-inline-size:var(--_size);color:currentcolor;aspect-ratio:1}:host::part(track),:host::part(indicator){fill:transparent}:host::part(indicator){stroke:var(--_indicator-color);transform:rotate(-90deg);transform-origin:center;transition:stroke-dashoffset var(--odx-motion-duration-fast) var(--odx-motion-easing-reduced)}:host::part(track){stroke:var(--_track-color)}:host([size=\"sm\"]){--_size: var(--odx-size-225)}:host([size=\"md\"]){--_size: var(--odx-size-300)}:host([size=\"lg\"]){--_size: var(--odx-size-400)}:host([indeterminate]:not([indeterminate=\"false\"]))::part(inner){animation:1.75s linear infinite odx-circular-progress-inner-animation}:host([indeterminate]:not([indeterminate=\"false\"]))::part(indicator){animation:1.75s ease infinite odx-circular-progress-indicator-animation both}@keyframes odx-circular-progress-indicator-animation{0%{stroke-dashoffset:100}25%{stroke-dashoffset:250;transform:rotate(180deg)}to{stroke-dashoffset:100;transform:rotate(270deg)}}@keyframes odx-circular-progress-inner-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}";
|
|
874
|
-
|
|
875
|
-
const CircularProgressBarSize = pick(Size, ["SM", "MD", "LG"]);
|
|
876
|
-
const _OdxCircularProgressBar = class _OdxCircularProgressBar extends CustomElement {
|
|
877
|
-
constructor() {
|
|
878
|
-
super(...arguments);
|
|
879
|
-
this.#value = 0;
|
|
880
|
-
this.viewPortSize = 100;
|
|
881
|
-
this.stroke = 4;
|
|
882
|
-
this.indeterminate = false;
|
|
883
|
-
this.size = CircularProgressBarSize.SM;
|
|
884
|
-
}
|
|
885
|
-
static {
|
|
886
|
-
customElement("odx-circular-progress-bar", styles$_)(_OdxCircularProgressBar);
|
|
887
|
-
}
|
|
888
|
-
#value;
|
|
889
|
-
get #circumference() {
|
|
890
|
-
return Math.floor(2 * this.#radius * Math.PI);
|
|
891
|
-
}
|
|
892
|
-
get #radius() {
|
|
893
|
-
return Math.max(0, this.viewPortSize / 2 - this.#normalizedStrokeWidth / 2);
|
|
894
|
-
}
|
|
895
|
-
set value(val) {
|
|
896
|
-
this.#value = Math.max(-1, Math.min(100, val));
|
|
897
|
-
this.indeterminate = val === -1;
|
|
898
|
-
this.setAttribute("aria-valuenow", `${this.indeterminate ? 0 : val}`);
|
|
899
|
-
}
|
|
900
|
-
get value() {
|
|
901
|
-
return this.#value;
|
|
902
|
-
}
|
|
903
|
-
get #progressValue() {
|
|
904
|
-
return this.indeterminate ? this.#circumference : Math.floor((1 - this.#value / 100) * this.#circumference);
|
|
905
|
-
}
|
|
906
|
-
get #normalizedStrokeWidth() {
|
|
907
|
-
if (this.stroke < 0) return 0;
|
|
908
|
-
const normalizeFactor = this.viewPortSize / (this.offsetWidth || 1);
|
|
909
|
-
let stroke = normalizeFactor * this.stroke;
|
|
910
|
-
if (normalizeFactor >= 3) {
|
|
911
|
-
stroke = Math.max(0, stroke - normalizeFactor);
|
|
912
|
-
}
|
|
913
|
-
return stroke;
|
|
914
|
-
}
|
|
915
|
-
firstUpdated(changes) {
|
|
916
|
-
super.firstUpdated(changes);
|
|
917
|
-
SharedResizeObserver.observe(this, () => this.requestUpdate());
|
|
918
|
-
this.#setAttributes();
|
|
919
|
-
}
|
|
920
|
-
disconnectedCallback() {
|
|
921
|
-
super.disconnectedCallback();
|
|
922
|
-
SharedResizeObserver.unobserve(this);
|
|
923
|
-
}
|
|
924
|
-
render() {
|
|
925
|
-
return html`
|
|
926
|
-
<svg part="inner" viewBox="0 0 ${this.viewPortSize} ${this.viewPortSize}">
|
|
927
|
-
<circle
|
|
928
|
-
part="track"
|
|
929
|
-
stroke-width="${this.#normalizedStrokeWidth}"
|
|
930
|
-
r="${this.#radius}"
|
|
931
|
-
cx="50%"
|
|
932
|
-
cy="50%"
|
|
933
|
-
/>
|
|
934
|
-
<circle
|
|
935
|
-
part="indicator"
|
|
936
|
-
stroke-dasharray="${this.#circumference}"
|
|
937
|
-
stroke-dashoffset="${this.#progressValue}"
|
|
938
|
-
stroke-width="${this.#normalizedStrokeWidth}"
|
|
939
|
-
r="${this.#radius}"
|
|
940
|
-
cx="50%"
|
|
941
|
-
cy="50%"
|
|
942
|
-
/>
|
|
943
|
-
</svg>
|
|
944
|
-
`;
|
|
945
|
-
}
|
|
946
|
-
#setAttributes() {
|
|
947
|
-
this.setAttribute("aria-valuenow", `${this.indeterminate ? 0 : this.value}`);
|
|
948
|
-
this.setAttribute("aria-valuemax", "100");
|
|
949
|
-
this.setAttribute("aria-valuemin", "0");
|
|
950
|
-
this.setAttribute("role", "meter");
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
__decorateClass([
|
|
954
|
-
property({ type: Number })
|
|
955
|
-
], _OdxCircularProgressBar.prototype, "value", 1);
|
|
956
|
-
__decorateClass([
|
|
957
|
-
property({ type: Number, reflect: true, useDefault: true })
|
|
958
|
-
], _OdxCircularProgressBar.prototype, "stroke", 2);
|
|
959
|
-
__decorateClass([
|
|
960
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
961
|
-
], _OdxCircularProgressBar.prototype, "indeterminate", 2);
|
|
962
|
-
__decorateClass([
|
|
963
|
-
property({ reflect: true, useDefault: true })
|
|
964
|
-
], _OdxCircularProgressBar.prototype, "size", 2);
|
|
965
|
-
let OdxCircularProgressBar = _OdxCircularProgressBar;
|
|
966
|
-
|
|
967
|
-
const styles$Z = "@layer base{:host{--max-block-size: 100%;--max-inline-size: 100%;--_popover-color-background: var(--odx-color-background-level-2);--_popover-color-foreground: var(--odx-color-foreground-rest);--_popover-min-block-size: inherit;--_popover-max-block-size: 100%;--_popover-min-inline-size: inherit;--_popover-max-inline-size: 100%;--_popover-transition: var(--odx-popover-transition, var(--odx-motion-duration-default));--_popover-offset: var(--odx-size-50);--_popover-shadow: var(--odx-popover-shadow, var(--odx-shadow-level-1));--_popover-outer-padding: var(--odx-size-75);--_popover-arrow-size: var(--odx-size-50);--_popover-arrow-offset: calc(var(--_popover-offset) - var(--_popover-arrow-size) / 2);--_max-block-size: min(var(--_popover-max-block-size), var(--max-block-size));--_max-inline-size: min(var(--_popover-max-inline-size), var(--max-inline-size));top:var(--_popover-position-y);left:var(--_popover-position-x);transform:translate3d(var(--_popover-transition-offset-x),var(--_popover-transition-offset-y),0);transition:opacity var(--_popover-transition),transform var(--_popover-transition) allow-discrete,overlay var(--_popover-transition) allow-discrete,display var(--_popover-transition) allow-discrete;opacity:0;margin:0;background-color:transparent;max-block-size:var(--_max-block-size);max-inline-size:var(--_max-inline-size)}:host(:not(:popover-open)){display:none}:host(:popover-open){display:flex;transform:translate(0);opacity:1;@starting-style{transform:translate(var(--_popover-transition-offset-x),var(--_popover-transition-offset-y));opacity:0}}odx-popover::part(arrow){transform:rotate(45deg)}}@layer state{:host([popover-placement^=\"top\"]){--_popover-transition-offset-x: 0;--_popover-transition-offset-y: var(--_popover-offset);padding-block:var(--_popover-outer-padding) var(--_popover-offset);max-block-size:calc(var(--_max-block-size) - var(--_popover-outer-padding));odx-popover::part(arrow){bottom:var(--_popover-arrow-offset)}}:host([popover-placement^=\"right\"]){--_popover-transition-offset-x: calc(-1 * var(--_popover-offset));--_popover-transition-offset-y: 0;padding-inline:var(--_popover-offset) var(--_popover-outer-padding);max-inline-size:calc(var(--_max-inline-size) - var(--_popover-outer-padding));odx-popover::part(arrow){left:var(--_popover-arrow-offset)}}:host([popover-placement^=\"bottom\"]){--_popover-transition-offset-x: 0;--_popover-transition-offset-y: calc(-1 * var(--_popover-offset));--_popover-arrow-offset-y: calc(var(--_popover-offset) - 6px);padding-block:var(--_popover-offset) var(--_popover-outer-padding);max-block-size:calc(var(--_max-block-size) - var(--_popover-outer-padding));odx-popover::part(arrow){top:var(--_popover-arrow-offset)}}:host([popover-placement^=\"left\"]){--_popover-transition-offset-x: var(--_popover-offset);--_popover-transition-offset-y: 0;--_popover-arrow-offset-x: calc(var(--_popover-offset) - var(--_arrow-size) / 2);--_popover-arrow-offset-y: 0;padding-inline:var(--_popover-offset) var(--_popover-outer-padding);max-inline-size:calc(var(--_max-inline-size) - var(--_popover-outer-padding));odx-popover::part(arrow){right:var(--_popover-offset)}}}";
|
|
968
|
-
|
|
969
|
-
const popoverTargetAttribute = "odx-popovertarget";
|
|
970
|
-
class PopoverObserver {
|
|
971
|
-
#referenceElements = /* @__PURE__ */ new WeakMap();
|
|
972
|
-
#mutationObserver;
|
|
973
|
-
constructor(host) {
|
|
974
|
-
this.host = host;
|
|
975
|
-
this.root = findClosestDocument(host);
|
|
976
|
-
}
|
|
977
|
-
hasMountedPopover(element) {
|
|
978
|
-
return this.#referenceElements.has(element);
|
|
979
|
-
}
|
|
980
|
-
observe() {
|
|
981
|
-
this.#mutationObserver ??= new MutationObserver((mutations) => {
|
|
982
|
-
if (mutations.length === 0) return;
|
|
983
|
-
this.#updateReferenceElements();
|
|
984
|
-
});
|
|
985
|
-
this.#mutationObserver.observe(this.root, { attributes: true, subtree: true, childList: true, attributeFilter: [popoverTargetAttribute] });
|
|
986
|
-
this.#updateReferenceElements();
|
|
987
|
-
}
|
|
988
|
-
disconnect() {
|
|
989
|
-
this.#mutationObserver?.disconnect();
|
|
990
|
-
}
|
|
991
|
-
#updateReferenceElements() {
|
|
992
|
-
for (const element of Array.from(this.root.querySelectorAll(`[${popoverTargetAttribute}]`))) {
|
|
993
|
-
const popoverId = element.getAttribute(popoverTargetAttribute);
|
|
994
|
-
if (popoverId !== this.host.id) continue;
|
|
995
|
-
this.#referenceElements.set(element, popoverId);
|
|
996
|
-
this.host.mountPopover(element);
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
class PopoverHost extends CanBeDisabled(CustomElement) {
|
|
1002
|
-
constructor() {
|
|
1003
|
-
super();
|
|
1004
|
-
this.#currentReferenceElement = null;
|
|
1005
|
-
this.#openPopovers = /* @__PURE__ */ new WeakSet();
|
|
1006
|
-
this.open = false;
|
|
1007
|
-
this.placement = Placement.BOTTOM;
|
|
1008
|
-
this.fpsLimit = 60;
|
|
1009
|
-
this.#handleToggle = async (event) => {
|
|
1010
|
-
this.open = !!this.referenceElement && event.newState === "open";
|
|
1011
|
-
if (this.hasOpenPopover(this.referenceElement)) {
|
|
1012
|
-
await this.onBeforePopoverShow?.();
|
|
1013
|
-
await waitForAnimations(this);
|
|
1014
|
-
await this.onPopoverShow?.();
|
|
1015
|
-
} else {
|
|
1016
|
-
await this.onBeforePopoverHide?.();
|
|
1017
|
-
await waitForAnimations(this);
|
|
1018
|
-
await this.onPopoverHide?.();
|
|
1019
|
-
}
|
|
1020
|
-
if (!this.referenceElement) return;
|
|
1021
|
-
if (this.open) {
|
|
1022
|
-
this.#openPopovers.add(this.referenceElement);
|
|
1023
|
-
} else {
|
|
1024
|
-
this.#openPopovers.delete(this.referenceElement);
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
if (!isServer) {
|
|
1028
|
-
this.addEventListener("toggle", this.#handleToggle);
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
static {
|
|
1032
|
-
this.styles = unsafeCSS(styles$Z);
|
|
1033
|
-
}
|
|
1034
|
-
#currentReferenceElement;
|
|
1035
|
-
#openPopovers;
|
|
1036
|
-
#positionUpdater;
|
|
1037
|
-
#observer;
|
|
1038
|
-
set referenceElement(value) {
|
|
1039
|
-
if (this.#currentReferenceElement === value) return;
|
|
1040
|
-
this.#currentReferenceElement = value;
|
|
1041
|
-
}
|
|
1042
|
-
get referenceElement() {
|
|
1043
|
-
return this.#currentReferenceElement;
|
|
1044
|
-
}
|
|
1045
|
-
get options() {
|
|
1046
|
-
return PopoverPlacementOptions({ arrowElement: this.popoverElement.arrowElement, placement: this.placement });
|
|
1047
|
-
}
|
|
1048
|
-
connectedCallback() {
|
|
1049
|
-
super.connectedCallback();
|
|
1050
|
-
this.popover ??= "auto";
|
|
1051
|
-
this.#connectObserver();
|
|
1052
|
-
}
|
|
1053
|
-
disconnectedCallback() {
|
|
1054
|
-
super.disconnectedCallback();
|
|
1055
|
-
this.#disconnectObserver();
|
|
1056
|
-
if (!this.referenceElement) return;
|
|
1057
|
-
this.unmountPopover(this.referenceElement);
|
|
1058
|
-
this.hidePopover();
|
|
1059
|
-
}
|
|
1060
|
-
hasMountedPopover(element) {
|
|
1061
|
-
return this.#observer?.hasMountedPopover(element) ?? false;
|
|
1062
|
-
}
|
|
1063
|
-
mountPopover(referenceElement) {
|
|
1064
|
-
if (!referenceElement) return;
|
|
1065
|
-
this.referenceElement = referenceElement;
|
|
1066
|
-
}
|
|
1067
|
-
unmountPopover(_referenceElement) {
|
|
1068
|
-
this.referenceElement = null;
|
|
1069
|
-
}
|
|
1070
|
-
hasOpenPopover(referenceElement) {
|
|
1071
|
-
return !!referenceElement && this.#openPopovers.has(referenceElement);
|
|
1072
|
-
}
|
|
1073
|
-
async showPopover() {
|
|
1074
|
-
if (!this.referenceElement || this.disabled || this.canPopoverShow?.() === false) return;
|
|
1075
|
-
await 0;
|
|
1076
|
-
this.#positionUpdater?.();
|
|
1077
|
-
computePopoverPlacement(this.referenceElement, this, this.options);
|
|
1078
|
-
super.showPopover();
|
|
1079
|
-
this.#positionUpdater = autoUpdate(
|
|
1080
|
-
this.referenceElement,
|
|
1081
|
-
this,
|
|
1082
|
-
throttle(() => this.referenceElement && computePopoverPlacement(this.referenceElement, this, this.options), 1e3 / this.fpsLimit)
|
|
1083
|
-
);
|
|
1084
|
-
}
|
|
1085
|
-
hidePopover() {
|
|
1086
|
-
if (!this.open || this.canPopoverHide?.() === false) return;
|
|
1087
|
-
super.hidePopover();
|
|
1088
|
-
this.#positionUpdater?.();
|
|
1089
|
-
this.#positionUpdater = void 0;
|
|
1090
|
-
}
|
|
1091
|
-
togglePopover(state) {
|
|
1092
|
-
const isOpen = state ?? !this.hasOpenPopover(this.referenceElement);
|
|
1093
|
-
if (isOpen) {
|
|
1094
|
-
this.showPopover();
|
|
1095
|
-
} else {
|
|
1096
|
-
this.hidePopover();
|
|
1097
|
-
}
|
|
1098
|
-
return isOpen;
|
|
1099
|
-
}
|
|
1100
|
-
updateReferenceElementFromEvent(event) {
|
|
1101
|
-
const referenceElement = getElementFromEvent(event, (element) => this.hasMountedPopover(element));
|
|
1102
|
-
if (!referenceElement) return;
|
|
1103
|
-
this.referenceElement = referenceElement;
|
|
1104
|
-
}
|
|
1105
|
-
willUpdate(props) {
|
|
1106
|
-
super.willUpdate(props);
|
|
1107
|
-
if (props.has("referenceElement")) {
|
|
1108
|
-
const previousReferenceElement = props.get("referenceElement");
|
|
1109
|
-
if (previousReferenceElement && this.referenceElement !== previousReferenceElement) {
|
|
1110
|
-
this.#openPopovers.delete(previousReferenceElement);
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
#connectObserver() {
|
|
1115
|
-
this.#disconnectObserver();
|
|
1116
|
-
this.#observer = new PopoverObserver(this);
|
|
1117
|
-
this.#observer?.observe();
|
|
1118
|
-
}
|
|
1119
|
-
#disconnectObserver() {
|
|
1120
|
-
this.#observer?.disconnect();
|
|
1121
|
-
this.#observer = void 0;
|
|
1122
|
-
}
|
|
1123
|
-
#handleToggle;
|
|
1124
|
-
}
|
|
1125
|
-
__decorateClass([
|
|
1126
|
-
query("odx-popover", true)
|
|
1127
|
-
], PopoverHost.prototype, "popoverElement", 2);
|
|
1128
|
-
__decorateClass([
|
|
1129
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
1130
|
-
], PopoverHost.prototype, "open", 2);
|
|
1131
|
-
__decorateClass([
|
|
1132
|
-
property({ attribute: false })
|
|
1133
|
-
], PopoverHost.prototype, "referenceElement", 1);
|
|
1134
|
-
__decorateClass([
|
|
1135
|
-
property({ reflect: true, useDefault: true })
|
|
1136
|
-
], PopoverHost.prototype, "placement", 2);
|
|
1137
|
-
__decorateClass([
|
|
1138
|
-
property({ attribute: false })
|
|
1139
|
-
], PopoverHost.prototype, "fpsLimit", 2);
|
|
1140
|
-
|
|
1141
|
-
const styles$Y = ":host{--_popover-offset: var(--odx-size-37)}";
|
|
1142
|
-
|
|
1143
|
-
const DropdownPlacement = { TOP: Placement.TOP, BOTTOM: Placement.BOTTOM };
|
|
1144
|
-
const _OdxDropdown = class _OdxDropdown extends PopoverHost {
|
|
1145
|
-
constructor() {
|
|
1146
|
-
super(...arguments);
|
|
1147
|
-
this.matchReferenceWidth = false;
|
|
1148
|
-
this.placement = DropdownPlacement.BOTTOM;
|
|
1149
|
-
this.#handleInteraction = (event) => {
|
|
1150
|
-
if (event.defaultPrevented) return;
|
|
1151
|
-
this.updateReferenceElementFromEvent(event);
|
|
1152
|
-
this.togglePopover();
|
|
1153
|
-
};
|
|
1154
|
-
this.#handleKeyboardEvent = (event) => {
|
|
1155
|
-
const key = getKeyInfo(event);
|
|
1156
|
-
if (!(key.enter || key.space) || event.defaultPrevented) return;
|
|
1157
|
-
if (!this.open) {
|
|
1158
|
-
event.preventDefault();
|
|
1159
|
-
event.stopImmediatePropagation();
|
|
1160
|
-
}
|
|
1161
|
-
this.updateReferenceElementFromEvent(event);
|
|
1162
|
-
this.showPopover();
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
static {
|
|
1166
|
-
customElement("odx-dropdown", styles$Y)(_OdxDropdown);
|
|
1167
|
-
}
|
|
1168
|
-
get options() {
|
|
1169
|
-
return PopoverPlacementOptions({
|
|
1170
|
-
...super.options,
|
|
1171
|
-
matchReferenceWidth: this.matchReferenceWidth
|
|
1172
|
-
});
|
|
1173
|
-
}
|
|
1174
|
-
connectedCallback() {
|
|
1175
|
-
super.connectedCallback();
|
|
1176
|
-
this.id ||= getUniqueId("odx-dropdown");
|
|
1177
|
-
}
|
|
1178
|
-
mountPopover(referenceElement) {
|
|
1179
|
-
super.mountPopover(referenceElement);
|
|
1180
|
-
if (!referenceElement) return;
|
|
1181
|
-
this.#updateAriaAttributes(referenceElement, this.id);
|
|
1182
|
-
referenceElement.addEventListener("click", this.#handleInteraction);
|
|
1183
|
-
referenceElement.addEventListener("keydown", this.#handleKeyboardEvent);
|
|
1184
|
-
}
|
|
1185
|
-
unmountPopover(referenceElement) {
|
|
1186
|
-
super.unmountPopover(referenceElement);
|
|
1187
|
-
if (!referenceElement) return;
|
|
1188
|
-
this.#updateAriaAttributes(referenceElement, null);
|
|
1189
|
-
referenceElement.removeEventListener("click", this.#handleInteraction);
|
|
1190
|
-
referenceElement.removeEventListener("keydown", this.#handleKeyboardEvent);
|
|
1191
|
-
}
|
|
1192
|
-
render() {
|
|
1193
|
-
return html`
|
|
1194
|
-
<odx-popover>
|
|
1195
|
-
<slot></slot>
|
|
1196
|
-
</odx-popover>
|
|
1197
|
-
`;
|
|
1198
|
-
}
|
|
1199
|
-
willUpdate(props) {
|
|
1200
|
-
super.willUpdate(props);
|
|
1201
|
-
if (props.has("id") && this.referenceElement) {
|
|
1202
|
-
this.#updateAriaAttributes(this.referenceElement, this.id);
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
#updateAriaAttributes(referenceElement, id) {
|
|
1206
|
-
const ariaAttribute = this.role === "listbox" ? "aria-controls" : "aria-describedby";
|
|
1207
|
-
if (id) {
|
|
1208
|
-
referenceElement.setAttribute(ariaAttribute, id);
|
|
1209
|
-
} else {
|
|
1210
|
-
referenceElement.removeAttribute(ariaAttribute);
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
#handleInteraction;
|
|
1214
|
-
#handleKeyboardEvent;
|
|
1215
|
-
};
|
|
1216
|
-
__decorateClass([
|
|
1217
|
-
property({ type: Boolean, reflect: true, useDefault: true, attribute: "match-reference-width" })
|
|
1218
|
-
], _OdxDropdown.prototype, "matchReferenceWidth", 2);
|
|
1219
|
-
__decorateClass([
|
|
1220
|
-
property({ reflect: true, useDefault: true })
|
|
1221
|
-
], _OdxDropdown.prototype, "placement", 2);
|
|
1222
|
-
let OdxDropdown = _OdxDropdown;
|
|
1223
|
-
|
|
1224
|
-
const styles$X = "::highlight(odx-highlight){background-color:var(--odx-color-foreground-accent-rest);color:var(--odx-color-foreground-inverse-static)}:host([subtle]) ::highlight(odx-highlight){background-color:var(--odx-color-background-accent-subtle);color:var(--odx-color-foreground-accent-rest)}";
|
|
1225
|
-
|
|
1226
|
-
const highlightAttribute = "odx-highlight";
|
|
1227
|
-
const _OdxHighlight = class _OdxHighlight extends CanBeDisabled(CustomElement) {
|
|
1228
|
-
constructor() {
|
|
1229
|
-
super(...arguments);
|
|
1230
|
-
this.root = this;
|
|
1231
|
-
this.minlength = 0;
|
|
1232
|
-
this.subtle = false;
|
|
1233
|
-
}
|
|
1234
|
-
static {
|
|
1235
|
-
customElement("odx-highlight", styles$X)(_OdxHighlight);
|
|
1236
|
-
}
|
|
1237
|
-
updated(props) {
|
|
1238
|
-
super.updated(props);
|
|
1239
|
-
if (props.has("query") || props.has("selector") || props.has("minlength") && !this.disabled) {
|
|
1240
|
-
this.#updateHighlight(this.query ?? "", this.minlength);
|
|
1241
|
-
}
|
|
1242
|
-
if (props.has("disabled") && this.disabled) {
|
|
1243
|
-
CSS.highlights.delete(highlightAttribute);
|
|
1244
|
-
return;
|
|
1245
|
-
}
|
|
1246
|
-
}
|
|
1247
|
-
#updateHighlight(query, minlength) {
|
|
1248
|
-
if (!CSS.highlights) return;
|
|
1249
|
-
const selection = this.#searchTextContent(query.trim().toLowerCase(), minlength);
|
|
1250
|
-
if (selection.length > 0) {
|
|
1251
|
-
CSS.highlights.set(highlightAttribute, new Highlight(...selection));
|
|
1252
|
-
} else {
|
|
1253
|
-
CSS.highlights.delete(highlightAttribute);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
#searchTextContent(query, minlength) {
|
|
1257
|
-
const ranges = [];
|
|
1258
|
-
if (!query || query.length < Math.max(minlength ?? 1, 1)) return ranges;
|
|
1259
|
-
const walker = document.createTreeWalker(this.root, NodeFilter.SHOW_TEXT);
|
|
1260
|
-
while (walker.nextNode()) {
|
|
1261
|
-
const content = walker.currentNode.textContent?.toLowerCase();
|
|
1262
|
-
if (!content?.includes(query)) continue;
|
|
1263
|
-
const parentElement = walker.currentNode.parentElement;
|
|
1264
|
-
if (this.selector && !parentElement?.closest(this.selector)) continue;
|
|
1265
|
-
this.#createRange(content, query, (index) => {
|
|
1266
|
-
const range = new Range();
|
|
1267
|
-
range.setStart(walker.currentNode, index);
|
|
1268
|
-
range.setEnd(walker.currentNode, index + query.length);
|
|
1269
|
-
ranges.push(range);
|
|
1270
|
-
});
|
|
1271
|
-
}
|
|
1272
|
-
return ranges;
|
|
1273
|
-
}
|
|
1274
|
-
#createRange(value, query, callback) {
|
|
1275
|
-
let index = 0;
|
|
1276
|
-
while (index < value.length) {
|
|
1277
|
-
index = value.indexOf(query, index);
|
|
1278
|
-
if (index === -1) break;
|
|
1279
|
-
callback?.(index);
|
|
1280
|
-
index += query.length;
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
__decorateClass([
|
|
1285
|
-
property({ attribute: false })
|
|
1286
|
-
], _OdxHighlight.prototype, "root", 2);
|
|
1287
|
-
__decorateClass([
|
|
1288
|
-
property()
|
|
1289
|
-
], _OdxHighlight.prototype, "query", 2);
|
|
1290
|
-
__decorateClass([
|
|
1291
|
-
property()
|
|
1292
|
-
], _OdxHighlight.prototype, "selector", 2);
|
|
1293
|
-
__decorateClass([
|
|
1294
|
-
property({ type: Number })
|
|
1295
|
-
], _OdxHighlight.prototype, "minlength", 2);
|
|
1296
|
-
__decorateClass([
|
|
1297
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
1298
|
-
], _OdxHighlight.prototype, "subtle", 2);
|
|
1299
|
-
let OdxHighlight = _OdxHighlight;
|
|
1300
|
-
|
|
1301
|
-
const styles$W = ":host{display:block}odx-dropdown{--max-block-size: 320px}::slotted([hidden]){display:none}::slotted([slot=\"control\"]){inline-size:100%}";
|
|
1302
|
-
|
|
1303
|
-
const _OdxAutocomplete = class _OdxAutocomplete extends FormControl {
|
|
1304
|
-
constructor() {
|
|
1305
|
-
super(...arguments);
|
|
1306
|
-
this.activeDescendants = new ActiveDescendantsController(this, {
|
|
1307
|
-
getItems: () => this.options,
|
|
1308
|
-
onChange: (_, option, firstChange) => {
|
|
1309
|
-
option?.scrollIntoView();
|
|
1310
|
-
if (!option || firstChange || option.selected) return;
|
|
1311
|
-
}
|
|
1312
|
-
});
|
|
1313
|
-
this.minQueryLength = 1;
|
|
1314
|
-
this.searchFn = (option, query2) => {
|
|
1315
|
-
if (!query2) return true;
|
|
1316
|
-
return option.label.toLowerCase().includes(query2.toLowerCase().trim());
|
|
1317
|
-
};
|
|
1318
|
-
this.#handleControlSlotChange = () => {
|
|
1319
|
-
if (!this.control) return;
|
|
1320
|
-
this.control.addEventListener("blur", this.#handleControlFocusOut);
|
|
1321
|
-
this.control.addEventListener("clear", this.#handleControlClear);
|
|
1322
|
-
this.control.addEventListener("click", (event) => event.preventDefault());
|
|
1323
|
-
this.control.addEventListener("focus", this.#handleControlFocusIn);
|
|
1324
|
-
this.control.addEventListener("input", this.#handleControlInput);
|
|
1325
|
-
this.control.addEventListener("keydown", this.#handleControlKeyboardEvent);
|
|
1326
|
-
this.dropdown.popover = "manual";
|
|
1327
|
-
this.dropdown.mountPopover(this.control);
|
|
1328
|
-
};
|
|
1329
|
-
this.#handleControlFocusIn = () => {
|
|
1330
|
-
if (this.dropdown.canPopoverShow?.() === false) return;
|
|
1331
|
-
this.dropdown.showPopover();
|
|
1332
|
-
this.activeDescendants.activate();
|
|
1333
|
-
};
|
|
1334
|
-
this.#handleControlFocusOut = () => {
|
|
1335
|
-
if (this.dropdown.canPopoverHide?.() === false) return;
|
|
1336
|
-
this.activeDescendants.deactivate();
|
|
1337
|
-
this.dropdown.hidePopover();
|
|
1338
|
-
};
|
|
1339
|
-
this.#handleControlClear = () => {
|
|
1340
|
-
if (!this.dropdown.open) return;
|
|
1341
|
-
this.#handleControlValueChange(void 0);
|
|
1342
|
-
};
|
|
1343
|
-
this.#handleControlInput = () => {
|
|
1344
|
-
if (this.controlValue.length >= this.minQueryLength) {
|
|
1345
|
-
this.dropdown.showPopover();
|
|
1346
|
-
} else if (this.controlValue.length === 0) {
|
|
1347
|
-
this.dropdown.hidePopover();
|
|
1348
|
-
}
|
|
1349
|
-
if (!this.dropdown.open) return;
|
|
1350
|
-
this.#handleControlValueChange(this.controlValue);
|
|
1351
|
-
};
|
|
1352
|
-
this.#handleControlKeyboardEvent = (event) => {
|
|
1353
|
-
if (!this.control) return;
|
|
1354
|
-
const key = getKeyInfo(event);
|
|
1355
|
-
if (key.enter || key.start || key.end || key.down || key.up) {
|
|
1356
|
-
event.preventDefault();
|
|
1357
|
-
}
|
|
1358
|
-
if (key.space) {
|
|
1359
|
-
event.stopImmediatePropagation();
|
|
1360
|
-
}
|
|
1361
|
-
if (this.activeDescendants.activeItem && key.enter) {
|
|
1362
|
-
this.#handleControlValueChange(this.activeDescendants.activeItem.label);
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
static {
|
|
1367
|
-
customElement("odx-autocomplete", styles$W)(_OdxAutocomplete);
|
|
1368
|
-
}
|
|
1369
|
-
get control() {
|
|
1370
|
-
return getAssignedElement(this.shadowRoot, { slot: "control" });
|
|
1371
|
-
}
|
|
1372
|
-
get controlValue() {
|
|
1373
|
-
return this.control?.value ?? "";
|
|
1374
|
-
}
|
|
1375
|
-
firstUpdated(props) {
|
|
1376
|
-
super.firstUpdated(props);
|
|
1377
|
-
const canPopoverShow = this.dropdown.canPopoverShow;
|
|
1378
|
-
this.dropdown.canPopoverShow = () => {
|
|
1379
|
-
return this.controlValue.length >= this.minQueryLength && canPopoverShow?.() !== false;
|
|
1380
|
-
};
|
|
1381
|
-
}
|
|
1382
|
-
render() {
|
|
1383
|
-
return html`
|
|
1384
|
-
<slot name="control" @slotchange=${this.#handleControlSlotChange}></slot>
|
|
1385
|
-
<odx-dropdown
|
|
1386
|
-
part="dropdown"
|
|
1387
|
-
role="listbox"
|
|
1388
|
-
tabindex="-1"
|
|
1389
|
-
?disabled=${this.disabled}
|
|
1390
|
-
match-reference-width
|
|
1391
|
-
>
|
|
1392
|
-
<odx-highlight minlength=${this.minQueryLength} selector="odx-option" subtle .root=${this}>
|
|
1393
|
-
<odx-stack gap="xs">
|
|
1394
|
-
<slot></slot>
|
|
1395
|
-
</odx-stack>
|
|
1396
|
-
</odx-highlight>
|
|
1397
|
-
</odx-dropdown>
|
|
1398
|
-
`;
|
|
1399
|
-
}
|
|
1400
|
-
#handleControlValueChange(value) {
|
|
1401
|
-
if (!this.control) return;
|
|
1402
|
-
this.control.value = value ?? "";
|
|
1403
|
-
this.highlight.query = this.control.value;
|
|
1404
|
-
let activeOptionIndex;
|
|
1405
|
-
let selectedValue = "";
|
|
1406
|
-
const allOptionsHidden = this.options.reduce((state, option, index) => {
|
|
1407
|
-
option.hidden = !this.searchFn(option, this.controlValue);
|
|
1408
|
-
option.selected = option.label === this.controlValue;
|
|
1409
|
-
if (!option.hidden && activeOptionIndex === void 0) {
|
|
1410
|
-
activeOptionIndex = index;
|
|
1411
|
-
}
|
|
1412
|
-
if (option.selected) {
|
|
1413
|
-
selectedValue = option.value;
|
|
1414
|
-
}
|
|
1415
|
-
return state && option.hidden;
|
|
1416
|
-
}, true);
|
|
1417
|
-
if (allOptionsHidden) {
|
|
1418
|
-
this.dropdown.hidePopover();
|
|
1419
|
-
return;
|
|
1420
|
-
}
|
|
1421
|
-
if (this.activeDescendants.activeItem?.hidden) {
|
|
1422
|
-
this.activeDescendants.update(activeOptionIndex);
|
|
1423
|
-
}
|
|
1424
|
-
if (this.value !== selectedValue) {
|
|
1425
|
-
this.value = selectedValue;
|
|
1426
|
-
this.emit("change");
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
#handleControlSlotChange;
|
|
1430
|
-
#handleControlFocusIn;
|
|
1431
|
-
#handleControlFocusOut;
|
|
1432
|
-
#handleControlClear;
|
|
1433
|
-
#handleControlInput;
|
|
1434
|
-
#handleControlKeyboardEvent;
|
|
1435
|
-
};
|
|
1436
|
-
__decorateClass([
|
|
1437
|
-
queryAssignedElements({ selector: '[role="option"]', flatten: true })
|
|
1438
|
-
], _OdxAutocomplete.prototype, "options", 2);
|
|
1439
|
-
__decorateClass([
|
|
1440
|
-
query(OdxHighlight.tagName, true)
|
|
1441
|
-
], _OdxAutocomplete.prototype, "highlight", 2);
|
|
1442
|
-
__decorateClass([
|
|
1443
|
-
query(OdxDropdown.tagName, true)
|
|
1444
|
-
], _OdxAutocomplete.prototype, "dropdown", 2);
|
|
1445
|
-
__decorateClass([
|
|
1446
|
-
property({ type: Number, attribute: "min-query-length" })
|
|
1447
|
-
], _OdxAutocomplete.prototype, "minQueryLength", 2);
|
|
1448
|
-
let OdxAutocomplete = _OdxAutocomplete;
|
|
1449
|
-
|
|
1450
|
-
const styles$V = ":host{display:block;background-color:var(--odx-color-background-level-1);padding:var(--odx-breakpoint-spacing-200)}::slotted(:is([slot=\"header\"],[slot=\"footer\"])){margin-inline:calc(-1 * var(--odx-size-75))}";
|
|
1451
|
-
|
|
1452
|
-
class OdxContentBox extends CustomElement {
|
|
1453
|
-
static {
|
|
1454
|
-
customElement("odx-content-box", styles$V)(OdxContentBox);
|
|
1455
|
-
}
|
|
1456
|
-
render() {
|
|
1457
|
-
return html`
|
|
1458
|
-
<slot name="header"></slot>
|
|
1459
|
-
<slot></slot>
|
|
1460
|
-
<slot name="footer"></slot>
|
|
1461
|
-
`;
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
const styles$U = ":host{display:block}";
|
|
1466
|
-
|
|
1467
|
-
const FORM_FIELD_CONTROL_SELECTOR = "odx-form-field-control";
|
|
1468
|
-
const _OdxFormField = class _OdxFormField extends CustomElement {
|
|
1469
|
-
static {
|
|
1470
|
-
customElement("odx-form-field", styles$U)(_OdxFormField);
|
|
1471
|
-
}
|
|
1472
|
-
get control() {
|
|
1473
|
-
return this.elements.find((element) => element.hasAttribute(FORM_FIELD_CONTROL_SELECTOR));
|
|
1474
|
-
}
|
|
1475
|
-
connectedCallback() {
|
|
1476
|
-
super.connectedCallback();
|
|
1477
|
-
}
|
|
1478
|
-
render() {
|
|
1479
|
-
const isValid = this.control?.checkValidity();
|
|
1480
|
-
return html`
|
|
1481
|
-
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
1482
|
-
${when(isValid === false, () => this.renderErrorMessage())}
|
|
1483
|
-
|
|
1484
|
-
`;
|
|
1485
|
-
}
|
|
1486
|
-
renderErrorMessage() {
|
|
1487
|
-
return html`
|
|
1488
|
-
<odx-inline-message variant="danger">
|
|
1489
|
-
${this.control?.validationMessage}
|
|
1490
|
-
</odx-inline-message>
|
|
1491
|
-
`;
|
|
1492
|
-
}
|
|
1493
|
-
#handleSlotChange = () => {
|
|
1494
|
-
this.control?.addEventListener("change", () => this.requestUpdate());
|
|
1495
|
-
};
|
|
1496
|
-
};
|
|
1497
|
-
__decorateClass([
|
|
1498
|
-
queryAssignedElements({ flatten: true })
|
|
1499
|
-
], _OdxFormField.prototype, "elements", 2);
|
|
1500
|
-
let OdxFormField = _OdxFormField;
|
|
1501
|
-
|
|
1502
|
-
class BaseFormat extends IsLocalized(CustomElement) {
|
|
1503
|
-
static {
|
|
1504
|
-
this.styles = [css`:host { display: inline; }`];
|
|
1505
|
-
}
|
|
1506
|
-
render() {
|
|
1507
|
-
if (this.value != null) {
|
|
1508
|
-
try {
|
|
1509
|
-
return html`${this.transform(this.value) || this.fallbackValue}`;
|
|
1510
|
-
} catch {
|
|
1511
|
-
return html`${this.fallbackValue ?? nothing}`;
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
return html`${this.fallbackValue ?? nothing}`;
|
|
1515
|
-
}
|
|
1516
|
-
}
|
|
1517
|
-
__decorateClass([
|
|
1518
|
-
property()
|
|
1519
|
-
], BaseFormat.prototype, "fallbackValue", 2);
|
|
1520
|
-
|
|
1521
|
-
const _OdxFormatBytes = class _OdxFormatBytes extends BaseFormat {
|
|
1522
|
-
constructor() {
|
|
1523
|
-
super(...arguments);
|
|
1524
|
-
this.unit = "byte";
|
|
1525
|
-
}
|
|
1526
|
-
static {
|
|
1527
|
-
customElement("odx-format-bytes")(_OdxFormatBytes);
|
|
1528
|
-
}
|
|
1529
|
-
static #unitPrefixesMap = {
|
|
1530
|
-
bit: ["bit", "kilobit", "megabit", "gigabit", "terabit"],
|
|
1531
|
-
byte: ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "petabyte"]
|
|
1532
|
-
};
|
|
1533
|
-
transform(value) {
|
|
1534
|
-
const units = _OdxFormatBytes.#unitPrefixesMap[this.unit];
|
|
1535
|
-
const index = Math.min(Math.max(0, Math.floor(Math.log10(value) / 3)), units.length - 1);
|
|
1536
|
-
const transformedValue = value / 1e3 ** index;
|
|
1537
|
-
return this.formatNumber(transformedValue, {
|
|
1538
|
-
maximumFractionDigits: 2,
|
|
1539
|
-
style: "unit",
|
|
1540
|
-
unit: units[index]
|
|
1541
|
-
});
|
|
1542
|
-
}
|
|
1543
|
-
};
|
|
1544
|
-
__decorateClass([
|
|
1545
|
-
property({ type: Number })
|
|
1546
|
-
], _OdxFormatBytes.prototype, "value", 2);
|
|
1547
|
-
__decorateClass([
|
|
1548
|
-
property()
|
|
1549
|
-
], _OdxFormatBytes.prototype, "unit", 2);
|
|
1550
|
-
let OdxFormatBytes = _OdxFormatBytes;
|
|
1551
|
-
|
|
1552
|
-
const _OdxFormatDate = class _OdxFormatDate extends BaseFormat {
|
|
1553
|
-
static {
|
|
1554
|
-
customElement("odx-format-date")(_OdxFormatDate);
|
|
1555
|
-
}
|
|
1556
|
-
get valueAsDate() {
|
|
1557
|
-
if (this.value == null || this.value === "") {
|
|
1558
|
-
return null;
|
|
1559
|
-
}
|
|
1560
|
-
return parseDate(this.value);
|
|
1561
|
-
}
|
|
1562
|
-
transform(value) {
|
|
1563
|
-
return this.formatDate(value, { dateStyle: this.dateStyle });
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
__decorateClass([
|
|
1567
|
-
property()
|
|
1568
|
-
], _OdxFormatDate.prototype, "value", 2);
|
|
1569
|
-
__decorateClass([
|
|
1570
|
-
property()
|
|
1571
|
-
], _OdxFormatDate.prototype, "dateStyle", 2);
|
|
1572
|
-
let OdxFormatDate = _OdxFormatDate;
|
|
1573
|
-
|
|
1574
|
-
const _OdxFormatNumber = class _OdxFormatNumber extends BaseFormat {
|
|
1575
|
-
static {
|
|
1576
|
-
customElement("odx-format-number")(_OdxFormatNumber);
|
|
1577
|
-
}
|
|
1578
|
-
transform(value) {
|
|
1579
|
-
return this.formatNumber(value, {
|
|
1580
|
-
currency: this.currency,
|
|
1581
|
-
currencyDisplay: this.currencyDisplay,
|
|
1582
|
-
minimumFractionDigits: this.minimumFractionDigits,
|
|
1583
|
-
maximumFractionDigits: this.maximumFractionDigits,
|
|
1584
|
-
minimumIntegerDigits: this.minimumIntegerDigits,
|
|
1585
|
-
unit: this.unit,
|
|
1586
|
-
style: this.type
|
|
1587
|
-
});
|
|
1588
|
-
}
|
|
1589
|
-
};
|
|
1590
|
-
__decorateClass([
|
|
1591
|
-
property({ type: Number })
|
|
1592
|
-
], _OdxFormatNumber.prototype, "value", 2);
|
|
1593
|
-
__decorateClass([
|
|
1594
|
-
property()
|
|
1595
|
-
], _OdxFormatNumber.prototype, "currency", 2);
|
|
1596
|
-
__decorateClass([
|
|
1597
|
-
property()
|
|
1598
|
-
], _OdxFormatNumber.prototype, "currencyDisplay", 2);
|
|
1599
|
-
__decorateClass([
|
|
1600
|
-
property({ type: Number })
|
|
1601
|
-
], _OdxFormatNumber.prototype, "minimumFractionDigits", 2);
|
|
1602
|
-
__decorateClass([
|
|
1603
|
-
property({ type: Number })
|
|
1604
|
-
], _OdxFormatNumber.prototype, "maximumFractionDigits", 2);
|
|
1605
|
-
__decorateClass([
|
|
1606
|
-
property({ type: Number })
|
|
1607
|
-
], _OdxFormatNumber.prototype, "minimumIntegerDigits", 2);
|
|
1608
|
-
__decorateClass([
|
|
1609
|
-
property()
|
|
1610
|
-
], _OdxFormatNumber.prototype, "type", 2);
|
|
1611
|
-
__decorateClass([
|
|
1612
|
-
property()
|
|
1613
|
-
], _OdxFormatNumber.prototype, "unit", 2);
|
|
1614
|
-
__decorateClass([
|
|
1615
|
-
property()
|
|
1616
|
-
], _OdxFormatNumber.prototype, "unitDisplay", 2);
|
|
1617
|
-
let OdxFormatNumber = _OdxFormatNumber;
|
|
1618
|
-
|
|
1619
|
-
const _OdxRelativeTime = class _OdxRelativeTime extends BaseFormat {
|
|
1620
|
-
constructor() {
|
|
1621
|
-
super(...arguments);
|
|
1622
|
-
this.value = Date.now();
|
|
1623
|
-
this.syncInterval = null;
|
|
1624
|
-
}
|
|
1625
|
-
static {
|
|
1626
|
-
customElement("odx-relative-time")(_OdxRelativeTime);
|
|
1627
|
-
}
|
|
1628
|
-
#syncInterval;
|
|
1629
|
-
get valueAsDate() {
|
|
1630
|
-
if (this.value == null || this.value === "") {
|
|
1631
|
-
return null;
|
|
1632
|
-
}
|
|
1633
|
-
return parseDate(this.value);
|
|
1634
|
-
}
|
|
1635
|
-
disconnectedCallback() {
|
|
1636
|
-
super.disconnectedCallback();
|
|
1637
|
-
clearInterval(this.#syncInterval);
|
|
1638
|
-
}
|
|
1639
|
-
willUpdate(props) {
|
|
1640
|
-
super.willUpdate(props);
|
|
1641
|
-
if (props.has("syncInterval")) {
|
|
1642
|
-
this.#setupSyncInterval();
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
transform(value) {
|
|
1646
|
-
const relativeTime = this.formatRelativeTime(value, { style: this.format, numeric: this.numeric, minUnit: this.minUnit });
|
|
1647
|
-
return html`<time datetime=${optionalAttr(this.valueAsDate?.toISOString())}>${relativeTime}</time>`;
|
|
1648
|
-
}
|
|
1649
|
-
#setupSyncInterval() {
|
|
1650
|
-
clearInterval(this.#syncInterval);
|
|
1651
|
-
if (typeof this.syncInterval !== "number") return;
|
|
1652
|
-
this.#syncInterval = window.setInterval(() => this.requestUpdate(), Math.max(this.syncInterval, 1e3));
|
|
1653
|
-
}
|
|
1654
|
-
};
|
|
1655
|
-
__decorateClass([
|
|
1656
|
-
property()
|
|
1657
|
-
], _OdxRelativeTime.prototype, "value", 2);
|
|
1658
|
-
__decorateClass([
|
|
1659
|
-
property()
|
|
1660
|
-
], _OdxRelativeTime.prototype, "format", 2);
|
|
1661
|
-
__decorateClass([
|
|
1662
|
-
property()
|
|
1663
|
-
], _OdxRelativeTime.prototype, "minUnit", 2);
|
|
1664
|
-
__decorateClass([
|
|
1665
|
-
property()
|
|
1666
|
-
], _OdxRelativeTime.prototype, "numeric", 2);
|
|
1667
|
-
__decorateClass([
|
|
1668
|
-
property({ type: Number })
|
|
1669
|
-
], _OdxRelativeTime.prototype, "syncInterval", 2);
|
|
1670
|
-
let OdxRelativeTime = _OdxRelativeTime;
|
|
1671
|
-
|
|
1672
|
-
const styles$T = ":host{display:block;line-height:inherit;color:inherit;font-family:var(--odx-typography-font-family-brand);font-size:inherit;font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"xs\"]){line-height:var(--odx-breakpoint-line-height-heading-6);font-size:var(--odx-breakpoint-font-size-heading-6);font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"sm\"]){line-height:var(--odx-breakpoint-line-height-heading-5);font-size:var(--odx-breakpoint-font-size-heading-5);font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"md\"]){line-height:var(--odx-breakpoint-line-height-heading-4);font-size:var(--odx-breakpoint-font-size-heading-4);font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"lg\"]){line-height:var(--odx-breakpoint-line-height-heading-3);font-size:var(--odx-breakpoint-font-size-heading-3);font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"xl\"]){line-height:var(--odx-breakpoint-line-height-heading-2);font-size:var(--odx-breakpoint-font-size-heading-2);font-weight:var(--odx-typography-font-weight-semibold)}:host([size=\"xxl\"]){line-height:var(--odx-breakpoint-line-height-heading-1);font-size:var(--odx-breakpoint-font-size-heading-1);font-weight:var(--odx-typography-font-weight-semibold)}";
|
|
1673
|
-
|
|
1674
|
-
const TitleSize = pick(Size, ["XS", "SM", "MD", "LG", "XL", "XXL"]);
|
|
1675
|
-
const _OdxTitle = class _OdxTitle extends CustomElement {
|
|
1676
|
-
constructor() {
|
|
1677
|
-
super(...arguments);
|
|
1678
|
-
this.size = TitleSize.SM;
|
|
1679
|
-
}
|
|
1680
|
-
static {
|
|
1681
|
-
customElement("odx-title", styles$T)(_OdxTitle);
|
|
1682
|
-
}
|
|
1683
|
-
willUpdate(props) {
|
|
1684
|
-
super.willUpdate(props);
|
|
1685
|
-
if (props.has("level")) {
|
|
1686
|
-
this.role = typeof this.level === "number" ? "heading" : null;
|
|
1687
|
-
this.ariaLevel = typeof this.level === "number" ? `${this.level}` : null;
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
};
|
|
1691
|
-
__decorateClass([
|
|
1692
|
-
property({ reflect: true, useDefault: true })
|
|
1693
|
-
], _OdxTitle.prototype, "size", 2);
|
|
1694
|
-
__decorateClass([
|
|
1695
|
-
property({ type: Number })
|
|
1696
|
-
], _OdxTitle.prototype, "level", 2);
|
|
1697
|
-
let OdxTitle = _OdxTitle;
|
|
1698
|
-
|
|
1699
|
-
const styles$S = ":host{display:block;position:relative}.base{display:flex;position:relative;column-gap:var(--odx-size-150);place-items:center;z-index:1;background-color:var(--odx-color-background-level-1);padding-inline:var(--odx-size-150);block-size:var(--odx-size-300)}.background{position:absolute;inset:0;z-index:0;box-shadow:0 0 0 100vmax var(--odx-color-background-level-1);background-color:var(--odx-color-background-level-1);clip-path:inset(0 -100vmax)}odx-logo{flex:0 0 auto}::slotted(odx-title){width:max-content}::slotted(odx-main-menu-button){margin-inline-end:calc(-1 * var(--odx-size-75))}::slotted(odx-header-actions){margin-inline-start:auto}@media screen and (width <= 600px){odx-logo{display:none}}";
|
|
1700
|
-
|
|
1701
|
-
const _OdxHeader = class _OdxHeader extends CustomElement {
|
|
1702
|
-
static {
|
|
1703
|
-
customElement("odx-header", styles$S)(_OdxHeader);
|
|
1704
|
-
}
|
|
1705
|
-
connectedCallback() {
|
|
1706
|
-
super.connectedCallback();
|
|
1707
|
-
this.role = "banner";
|
|
1708
|
-
}
|
|
1709
|
-
render() {
|
|
1710
|
-
return html`
|
|
1711
|
-
<div class="base">
|
|
1712
|
-
<slot name="prefix"></slot>
|
|
1713
|
-
<odx-logo size="sm"></odx-logo>
|
|
1714
|
-
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
1715
|
-
<slot name="actions"></slot>
|
|
1716
|
-
</div>
|
|
1717
|
-
<div class="background"></div>
|
|
1718
|
-
`;
|
|
1719
|
-
}
|
|
1720
|
-
#handleSlotChange = () => {
|
|
1721
|
-
const [titleElement] = this.titleElements;
|
|
1722
|
-
if (!titleElement) return;
|
|
1723
|
-
titleElement.ariaLevel = "1";
|
|
1724
|
-
titleElement.role = "heading";
|
|
1725
|
-
titleElement.size = TitleSize.XS;
|
|
1726
|
-
titleElement.setAttribute("odxPreventTextOverflow", "true");
|
|
1727
|
-
};
|
|
1728
|
-
};
|
|
1729
|
-
__decorateClass([
|
|
1730
|
-
queryAssignedElements({ selector: OdxTitle.tagName, flatten: true })
|
|
1731
|
-
], _OdxHeader.prototype, "titleElements", 2);
|
|
1732
|
-
let OdxHeader = _OdxHeader;
|
|
1733
|
-
|
|
1734
|
-
const styles$R = ":host{display:flex;gap:var(--odx-size-75);align-items:center;block-size:100%}::slotted(odx-separator){--min-size: var(--odx-size-150);--margin-inline: 0}";
|
|
1735
|
-
|
|
1736
|
-
class OdxHeaderActions extends CustomElement {
|
|
1737
|
-
static {
|
|
1738
|
-
customElement("odx-header-actions", styles$R)(OdxHeaderActions);
|
|
1739
|
-
}
|
|
1740
|
-
connectedCallback() {
|
|
1741
|
-
super.connectedCallback();
|
|
1742
|
-
this.slot = "actions";
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
const styles$Q = ":host{display:block;font-family:var(--odx-typography-font-family-brand);font-weight:var(--odx-typography-font-weight-semibold)}:host,:host([size=\"md\"]){line-height:var(--odx-breakpoint-line-height-display-md);font-size:var(--odx-breakpoint-font-size-display-md)}:host([size=\"sm\"]){line-height:var(--odx-breakpoint-line-height-display-sm);font-size:var(--odx-breakpoint-font-size-display-sm)}:host([size=\"lg\"]){line-height:var(--odx-breakpoint-line-height-display-lg);font-size:var(--odx-breakpoint-font-size-display-lg)}:host([size=\"xl\"]){line-height:var(--odx-breakpoint-line-height-display-xl);font-size:var(--odx-breakpoint-font-size-display-xl)}";
|
|
1747
|
-
|
|
1748
|
-
const HeadlineSize = pick(Size, ["SM", "MD", "LG", "XL"]);
|
|
1749
|
-
const _OdxHeadline = class _OdxHeadline extends CustomElement {
|
|
1750
|
-
constructor() {
|
|
1751
|
-
super(...arguments);
|
|
1752
|
-
this.size = HeadlineSize.MD;
|
|
1753
|
-
}
|
|
1754
|
-
static {
|
|
1755
|
-
customElement("odx-headline", styles$Q)(_OdxHeadline);
|
|
1756
|
-
}
|
|
1757
|
-
willUpdate(props) {
|
|
1758
|
-
super.willUpdate(props);
|
|
1759
|
-
if (props.has("level")) {
|
|
1760
|
-
this.role = typeof this.level === "number" ? "heading" : null;
|
|
1761
|
-
this.ariaLevel = typeof this.level === "number" ? `${this.level}` : null;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
__decorateClass([
|
|
1766
|
-
property({ reflect: true, useDefault: true })
|
|
1767
|
-
], _OdxHeadline.prototype, "size", 2);
|
|
1768
|
-
__decorateClass([
|
|
1769
|
-
property({ type: Number })
|
|
1770
|
-
], _OdxHeadline.prototype, "level", 2);
|
|
1771
|
-
let OdxHeadline = _OdxHeadline;
|
|
1772
|
-
|
|
1773
|
-
const styles$P = ":host{--icon-rotation: 0deg}[part=icon]{--rotate: var(--icon-rotation);transition:inherit}:host([float]){margin:var(--odx-size-100);border-radius:var(--odx-border-radius-circle);box-shadow:var(--odx-shadow-level-3)}";
|
|
1774
|
-
|
|
1775
|
-
const _OdxIconButton = class _OdxIconButton extends OdxButton {
|
|
1776
|
-
constructor() {
|
|
1777
|
-
super(...arguments);
|
|
1778
|
-
this.float = false;
|
|
1779
|
-
}
|
|
1780
|
-
static {
|
|
1781
|
-
customElement("odx-icon-button", styles$P)(_OdxIconButton);
|
|
1782
|
-
}
|
|
1783
|
-
renderContent() {
|
|
1784
|
-
return html`
|
|
1785
|
-
${when(
|
|
1786
|
-
this.loading,
|
|
1787
|
-
() => this.renderLoader(),
|
|
1788
|
-
() => html`<odx-icon name=${optionalAttr(this.icon)} part="icon"></odx-icon>`
|
|
1789
|
-
)}
|
|
1790
|
-
<odx-visually-hidden>
|
|
1791
|
-
<slot></slot>
|
|
1792
|
-
</odx-visually-hidden>
|
|
1793
|
-
<slot name="badge"></slot>
|
|
1794
|
-
`;
|
|
1795
|
-
}
|
|
1796
|
-
};
|
|
1797
|
-
__decorateClass([
|
|
1798
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
1799
|
-
], _OdxIconButton.prototype, "float", 2);
|
|
1800
|
-
__decorateClass([
|
|
1801
|
-
property()
|
|
1802
|
-
], _OdxIconButton.prototype, "icon", 2);
|
|
1803
|
-
let OdxIconButton = _OdxIconButton;
|
|
1804
|
-
|
|
1805
|
-
const styles$O = ":host{display:block}";
|
|
1806
|
-
|
|
1807
|
-
class ResourceLoader {
|
|
1808
|
-
async load(resource) {
|
|
1809
|
-
const response = await fetch(resource.src);
|
|
1810
|
-
return this.parseResponse(response);
|
|
1811
|
-
}
|
|
1812
|
-
parseResponse(response) {
|
|
1813
|
-
return response.blob();
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
class ImageLoader extends ResourceLoader {
|
|
1817
|
-
load(options) {
|
|
1818
|
-
return new Promise((resolve, reject) => {
|
|
1819
|
-
const image = new Image();
|
|
1820
|
-
image.src = options.src;
|
|
1821
|
-
image.onload = () => resolve(image);
|
|
1822
|
-
image.onerror = () => reject(new Error("Failed to load image"));
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
}
|
|
1826
|
-
const _OdxImage = class _OdxImage extends CustomElement {
|
|
1827
|
-
constructor() {
|
|
1828
|
-
super(...arguments);
|
|
1829
|
-
this.loadingError = false;
|
|
1830
|
-
this.loading = true;
|
|
1831
|
-
}
|
|
1832
|
-
static {
|
|
1833
|
-
customElement("odx-image", styles$O)(_OdxImage);
|
|
1834
|
-
}
|
|
1835
|
-
static {
|
|
1836
|
-
this.loader = new ImageLoader();
|
|
1837
|
-
}
|
|
1838
|
-
render() {
|
|
1839
|
-
return html`
|
|
1840
|
-
${when(!this.loadingError && this.image, () => this.image)}
|
|
1841
|
-
${when(this.loading, this.renderLoader)}
|
|
1842
|
-
`;
|
|
1843
|
-
}
|
|
1844
|
-
renderLoader() {
|
|
1845
|
-
return html`
|
|
1846
|
-
<odx-loading-spinner></odx-loading-spinner>
|
|
1847
|
-
`;
|
|
1848
|
-
}
|
|
1849
|
-
updated(props) {
|
|
1850
|
-
super.updated(props);
|
|
1851
|
-
if (props.has("src") && this.src) {
|
|
1852
|
-
this.load(this.src);
|
|
1853
|
-
this.checkVisibility();
|
|
1854
|
-
}
|
|
1855
|
-
if (props.has("height") || props.has("width")) {
|
|
1856
|
-
this.#handleDimensionChange();
|
|
1857
|
-
}
|
|
1858
|
-
}
|
|
1859
|
-
async load(src) {
|
|
1860
|
-
this.image = void 0;
|
|
1861
|
-
this.loading = true;
|
|
1862
|
-
this.loadingError = false;
|
|
1863
|
-
try {
|
|
1864
|
-
this.image = await _OdxImage.loader.load({ src });
|
|
1865
|
-
this.loading = false;
|
|
1866
|
-
} catch {
|
|
1867
|
-
this.loadingError = true;
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
#handleDimensionChange() {
|
|
1871
|
-
if (!this.image) return;
|
|
1872
|
-
this.image.width = this.width ?? this.image.width;
|
|
1873
|
-
this.image.height = this.height ?? this.image.height;
|
|
1874
|
-
}
|
|
1875
|
-
};
|
|
1876
|
-
__decorateClass([
|
|
1877
|
-
state()
|
|
1878
|
-
], _OdxImage.prototype, "loadingError", 2);
|
|
1879
|
-
__decorateClass([
|
|
1880
|
-
state()
|
|
1881
|
-
], _OdxImage.prototype, "loading", 2);
|
|
1882
|
-
__decorateClass([
|
|
1883
|
-
state()
|
|
1884
|
-
], _OdxImage.prototype, "image", 2);
|
|
1885
|
-
__decorateClass([
|
|
1886
|
-
property()
|
|
1887
|
-
], _OdxImage.prototype, "src", 2);
|
|
1888
|
-
__decorateClass([
|
|
1889
|
-
property()
|
|
1890
|
-
], _OdxImage.prototype, "alt", 2);
|
|
1891
|
-
__decorateClass([
|
|
1892
|
-
property({ type: Number })
|
|
1893
|
-
], _OdxImage.prototype, "height", 2);
|
|
1894
|
-
__decorateClass([
|
|
1895
|
-
property({ type: Number })
|
|
1896
|
-
], _OdxImage.prototype, "width", 2);
|
|
1897
|
-
let OdxImage = _OdxImage;
|
|
1898
|
-
|
|
1899
|
-
const styles$N = ":host{display:flex;gap:var(--odx-size-75);align-items:flex-start;transition:var(--odx-transition-reduced);transition-property:background-color,color,display,opacity;border-color:var(--odx-color-stroke-neutral-subtle);background-color:var(--odx-color-background-level-1);padding:var(--odx-size-75);line-height:var(--odx-typography-line-height-base);color:var(--odx-color-foreground-rest);transition-behavior:allow-discrete;@starting-style{opacity:0}}.icon{--size: var(--odx-size-150)}.base{flex:1 1 auto;line-height:var(--odx-typography-line-height-base);font-size:var(--odx-typography-font-size-2)}.action{--_color-foreground: inherit;margin-block-start:calc(-1 * var(--odx-size-37));margin-inline-end:calc(-1 * var(--odx-size-37))}:host([strong]){border-block-end-width:var(--odx-border-width-thick);border-block-end-style:solid;padding-block-end:calc(var(--odx-size-75) - var(--odx-border-width-thick))}:host([variant=\"primary\"]){border-color:var(--odx-color-stroke-primary-rest);background-color:var(--odx-color-background-primary-subtle)}:host([variant=\"danger\"]){border-color:var(--odx-color-stroke-danger-rest);background-color:var(--odx-color-background-danger-subtle);color:var(--odx-color-foreground-danger-rest)}:host([variant=\"warning\"]){border-color:var(--odx-color-stroke-warning-rest);background-color:var(--odx-color-background-warning-subtle)}:host([variant=\"success\"]){border-color:var(--odx-color-stroke-success-rest);background-color:var(--odx-color-background-success-subtle)}:host([hidden]){display:none;opacity:0}";
|
|
1900
|
-
|
|
1901
|
-
const iconMap = {
|
|
1902
|
-
neutral: "core::info",
|
|
1903
|
-
primary: "core::announcement",
|
|
1904
|
-
success: "core::check-filled-mono",
|
|
1905
|
-
warning: "core::warning",
|
|
1906
|
-
danger: "core::error"
|
|
1907
|
-
};
|
|
1908
|
-
const InlineMessageVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "SUCCESS", "WARNING", "DANGER"]);
|
|
1909
|
-
const _OdxInlineMessage = class _OdxInlineMessage extends CustomElement {
|
|
1910
|
-
constructor() {
|
|
1911
|
-
super(...arguments);
|
|
1912
|
-
this.closable = false;
|
|
1913
|
-
this.strong = false;
|
|
1914
|
-
this.variant = InlineMessageVariant.NEUTRAL;
|
|
1915
|
-
}
|
|
1916
|
-
static {
|
|
1917
|
-
customElement("odx-inline-message", styles$N)(_OdxInlineMessage);
|
|
1918
|
-
}
|
|
1919
|
-
show() {
|
|
1920
|
-
this.ariaHidden = toAriaBooleanAttribute(false);
|
|
1921
|
-
}
|
|
1922
|
-
async hide() {
|
|
1923
|
-
if (this.emit("close")) return;
|
|
1924
|
-
this.hidden = true;
|
|
1925
|
-
await waitForAnimations(this);
|
|
1926
|
-
this.emit("after-close", { cancelable: false });
|
|
1927
|
-
}
|
|
1928
|
-
render() {
|
|
1929
|
-
const resolvedIcon = this.icon === void 0 ? this.variant ? iconMap[this.variant] : null : this.icon;
|
|
1930
|
-
return html`
|
|
1931
|
-
${when(resolvedIcon, (icon) => html`<odx-icon class="icon" name=${icon}></odx-icon>`)}
|
|
1932
|
-
<div class="base">
|
|
1933
|
-
<slot></slot>
|
|
1934
|
-
</div>
|
|
1935
|
-
${when(this.closable, () => html`<odx-icon-button class="action" icon="core::close" variant="ghost" @click=${() => this.hide()}></odx-icon-button>`)}
|
|
1936
|
-
`;
|
|
1937
|
-
}
|
|
1938
|
-
};
|
|
1939
|
-
__decorateClass([
|
|
1940
|
-
property({ type: Boolean })
|
|
1941
|
-
], _OdxInlineMessage.prototype, "closable", 2);
|
|
1942
|
-
__decorateClass([
|
|
1943
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
1944
|
-
], _OdxInlineMessage.prototype, "strong", 2);
|
|
1945
|
-
__decorateClass([
|
|
1946
|
-
property()
|
|
1947
|
-
], _OdxInlineMessage.prototype, "icon", 2);
|
|
1948
|
-
__decorateClass([
|
|
1949
|
-
property({ reflect: true, useDefault: true })
|
|
1950
|
-
], _OdxInlineMessage.prototype, "variant", 2);
|
|
1951
|
-
let OdxInlineMessage = _OdxInlineMessage;
|
|
1952
|
-
|
|
1953
|
-
const styles$M = ":host{--_stroke-color: var(--odx-color-stroke-control-rest);display:inline-flex;position:relative;gap:var(--odx-size-37);place-items:center;transition:var(--odx-transition-reduced);transition-property:background-color,border-color;outline:var(--odx-focus-ring-outline);outline-offset:-2px;border-radius:var(--odx-border-radius-controls);background-color:var(--odx-color-background-control-rest);padding-inline:var(--odx-size-50);block-size:var(--odx-size-225);min-inline-size:15ch;overflow:hidden;font-size:var(--odx-font-size-text-md);&:after{position:absolute;inset-inline:0;bottom:0;transition:inherit;background-color:var(--_stroke-color);block-size:var(--odx-border-width-thin);content:\"\"}}[part~=control]{--_icon-size: var(--odx-typography-font-size-5);--_icon-margin: 0;--odx-color-background-disabled-rest: transparent}[part=input]{appearance:textfield;flex:1 1 auto;outline:none;border:none;background-color:transparent;padding:0;width:100%;block-size:100%;min-width:auto;text-align:inherit;color:inherit;font-weight:var(--odx-typography-font-weight-medium);&::placeholder{color:var(--odx-color-foreground-rest-subtle);font-weight:var(--odx-typography-font-weight-normal)}&::-webkit-inner-spin-button,&::-webkit-outer-spin-button,&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{appearance:none;margin:0}}::slotted(odx-icon){--size: var(--odx-typography-font-size-5)}:host(:hover){border-bottom-color:var(--odx-color-stroke-control-hover);background-color:var(--odx-color-background-control-hover)}:host(:focus-within){outline-color:var(--odx-color-stroke-focus-outer);&:after{content:none}}:host(:is([clearable],[type=\"number\"]):not([readonly])){padding-inline-end:var(--odx-size-px)}:host([clearable]) [part=input]:placeholder-shown~[part*=control-clear]{display:none}:host([block]){display:block}:host([disabled]:not([readonly])){--_stroke-color: var(--odx-color-stroke-disabled-rest);background-color:var(--odx-color-background-disabled-rest);color:var(--odx-color-foreground-disabled-rest);[part~=input]::placeholder{color:var(--odx-color-foreground-disabled-rest)}}:host([readonly]){--_stroke-color: var(--odx-color-stroke-control-readonly);background-color:var(--odx-color-background-control-readonly);[part=input]{cursor:default}}:host([type=\"number\"]){min-inline-size:3ch;&:not([readonly]){text-align:center}}";
|
|
1954
|
-
|
|
1955
|
-
const _OdxInput = class _OdxInput extends FormControl {
|
|
1956
|
-
constructor() {
|
|
1957
|
-
super(...arguments);
|
|
1958
|
-
this.block = false;
|
|
1959
|
-
this.clearable = false;
|
|
1960
|
-
this.hideControls = false;
|
|
1961
|
-
this.placeholder = "";
|
|
1962
|
-
this.type = "text";
|
|
1963
|
-
this.value = "";
|
|
1964
|
-
this.#handleClear = (event) => {
|
|
1965
|
-
if (!this.#isClearable()) return;
|
|
1966
|
-
event.preventDefault();
|
|
1967
|
-
event.stopPropagation();
|
|
1968
|
-
if (this.emit("clear")) return;
|
|
1969
|
-
this.clear();
|
|
1970
|
-
};
|
|
1971
|
-
this.#handleInput = (event) => {
|
|
1972
|
-
this.value = event.target.value;
|
|
1973
|
-
};
|
|
1974
|
-
this.#handleKeyDown = (event) => {
|
|
1975
|
-
const key = getKeyInfo(event);
|
|
1976
|
-
if (!key.escape) return;
|
|
1977
|
-
this.#handleClear(event);
|
|
1978
|
-
};
|
|
1979
|
-
}
|
|
1980
|
-
static {
|
|
1981
|
-
customElement("odx-input", styles$M)(_OdxInput);
|
|
1982
|
-
}
|
|
1983
|
-
stepUp() {
|
|
1984
|
-
if (!this.nativeInput) return;
|
|
1985
|
-
this.nativeInput.stepUp();
|
|
1986
|
-
this.value = this.nativeInput.value;
|
|
1987
|
-
this.requestUpdate();
|
|
1988
|
-
}
|
|
1989
|
-
stepDown() {
|
|
1990
|
-
if (!this.nativeInput) return;
|
|
1991
|
-
this.nativeInput.stepDown();
|
|
1992
|
-
this.value = this.nativeInput.value;
|
|
1993
|
-
this.requestUpdate();
|
|
1994
|
-
}
|
|
1995
|
-
willUpdate(props) {
|
|
1996
|
-
if (props.has("type") && this.type === "number") {
|
|
1997
|
-
this.min ||= 0;
|
|
1998
|
-
this.max ||= 100;
|
|
1999
|
-
this.step ||= 1;
|
|
2000
|
-
this.value ||= String(this.min);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
render() {
|
|
2004
|
-
const isNumberInput = this.type === "number";
|
|
2005
|
-
const min = isNumberInput ? this.min : void 0;
|
|
2006
|
-
const max = isNumberInput ? this.max : void 0;
|
|
2007
|
-
const canStepUp = max == null || this.value == null || Number(this.value) < max;
|
|
2008
|
-
const canStepDown = min == null || this.value == null || Number(this.value) > min;
|
|
2009
|
-
return html`
|
|
2010
|
-
<slot name="prefix"></slot>
|
|
2011
|
-
<input
|
|
2012
|
-
placeholder=${this.disabled || this.readonly ? "" : this.placeholder}
|
|
2013
|
-
part="input"
|
|
2014
|
-
min=${optionalAttr(min)}
|
|
2015
|
-
max=${optionalAttr(max)}
|
|
2016
|
-
step=${optionalAttr(this.step)}
|
|
2017
|
-
type=${this.type}
|
|
2018
|
-
?disabled=${this.disabled}
|
|
2019
|
-
?readonly=${this.readonly}
|
|
2020
|
-
.value=${this.value}
|
|
2021
|
-
size="1"
|
|
2022
|
-
@keydown=${this.#handleKeyDown}
|
|
2023
|
-
@change=${forwardEvent(this)}
|
|
2024
|
-
@input=${this.#handleInput}
|
|
2025
|
-
@search=${forwardEvent(this)}
|
|
2026
|
-
/>
|
|
2027
|
-
${when(
|
|
2028
|
-
!this.readonly && isNumberInput,
|
|
2029
|
-
() => html`
|
|
2030
|
-
<odx-button-group>
|
|
2031
|
-
${this.renderControl("decrement", "core::minus", () => this.stepDown(), this.disabled || !canStepDown)}
|
|
2032
|
-
${this.renderControl("increment", "core::plus", () => this.stepUp(), this.disabled || !canStepUp)}
|
|
2033
|
-
</odx-button-group>
|
|
2034
|
-
`,
|
|
2035
|
-
() => when(this.#isClearable(), () => this.renderControl("clear", "core::cancel", this.#handleClear, this.disabled))
|
|
2036
|
-
)}
|
|
2037
|
-
<slot name="suffix"></slot>
|
|
2038
|
-
`;
|
|
2039
|
-
}
|
|
2040
|
-
renderControl(type, icon, listener, disabled) {
|
|
2041
|
-
if (this.hideControls || this.readonly) return nothing;
|
|
2042
|
-
return html`
|
|
2043
|
-
<odx-icon-button part="control control-${type}" icon=${icon} size="sm" tabindex="-1" variant="ghost" ?disabled=${disabled} @click=${listener}>
|
|
2044
|
-
</odx-icon-button>
|
|
2045
|
-
`;
|
|
2046
|
-
}
|
|
2047
|
-
#isClearable() {
|
|
2048
|
-
return this.clearable && !this.disabled && !this.readonly && !this.required && !!this.value;
|
|
2049
|
-
}
|
|
2050
|
-
#handleClear;
|
|
2051
|
-
#handleInput;
|
|
2052
|
-
#handleKeyDown;
|
|
2053
|
-
};
|
|
2054
|
-
__decorateClass([
|
|
2055
|
-
query("input")
|
|
2056
|
-
], _OdxInput.prototype, "nativeInput", 2);
|
|
2057
|
-
__decorateClass([
|
|
2058
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2059
|
-
], _OdxInput.prototype, "block", 2);
|
|
2060
|
-
__decorateClass([
|
|
2061
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2062
|
-
], _OdxInput.prototype, "clearable", 2);
|
|
2063
|
-
__decorateClass([
|
|
2064
|
-
property({ type: Boolean, reflect: true, useDefault: true, attribute: "hide-controls" })
|
|
2065
|
-
], _OdxInput.prototype, "hideControls", 2);
|
|
2066
|
-
__decorateClass([
|
|
2067
|
-
property()
|
|
2068
|
-
], _OdxInput.prototype, "placeholder", 2);
|
|
2069
|
-
__decorateClass([
|
|
2070
|
-
property({ type: Number, reflect: true })
|
|
2071
|
-
], _OdxInput.prototype, "min", 2);
|
|
2072
|
-
__decorateClass([
|
|
2073
|
-
property({ type: Number, reflect: true })
|
|
2074
|
-
], _OdxInput.prototype, "max", 2);
|
|
2075
|
-
__decorateClass([
|
|
2076
|
-
property({ type: Number, reflect: true })
|
|
2077
|
-
], _OdxInput.prototype, "step", 2);
|
|
2078
|
-
__decorateClass([
|
|
2079
|
-
property({ reflect: true, useDefault: true })
|
|
2080
|
-
], _OdxInput.prototype, "type", 2);
|
|
2081
|
-
__decorateClass([
|
|
2082
|
-
property()
|
|
2083
|
-
], _OdxInput.prototype, "value", 2);
|
|
2084
|
-
let OdxInput = _OdxInput;
|
|
2085
|
-
|
|
2086
|
-
const styles$L = ":host{padding:var(--odx-size-50)}";
|
|
2087
|
-
|
|
2088
|
-
const KpiSize = pick(Size, ["SM", "MD", "LG"]);
|
|
2089
|
-
const KpiVariant = pick(Variant, ["NEUTRAL", "ACCENT", "DANGER", "SUCCESS"]);
|
|
2090
|
-
const _OdxKpi = class _OdxKpi extends CustomElement {
|
|
2091
|
-
constructor() {
|
|
2092
|
-
super(...arguments);
|
|
2093
|
-
this.label = "";
|
|
2094
|
-
this.value = "";
|
|
2095
|
-
this.size = KpiSize.MD;
|
|
2096
|
-
this.variant = KpiVariant.NEUTRAL;
|
|
2097
|
-
this.vertical = false;
|
|
2098
|
-
}
|
|
2099
|
-
static {
|
|
2100
|
-
customElement("odx-kpi", styles$L)(_OdxKpi);
|
|
2101
|
-
}
|
|
2102
|
-
render() {
|
|
2103
|
-
return html`
|
|
2104
|
-
<odx-stack class="base" horizontal align="center" gap=${this.size}>
|
|
2105
|
-
<odx-avatar size=${this.size}><slot></slot></odx-avatar>
|
|
2106
|
-
<odx-stack gap="none">
|
|
2107
|
-
<odx-text size=${this.size}>${this.label}</odx-text>
|
|
2108
|
-
<odx-title size=${this.size}>
|
|
2109
|
-
<odx-text variant=${optionalAttr(this.variant)} inline>
|
|
2110
|
-
${this.value} ${when(this.unit, (unit) => html`<odx-text inline size=${this.size}>${unit}</odx-text>`)}
|
|
2111
|
-
</odx-text>
|
|
2112
|
-
</odx-title>
|
|
2113
|
-
</odx-stack>
|
|
2114
|
-
</odx-stack>
|
|
2115
|
-
`;
|
|
2116
|
-
}
|
|
2117
|
-
};
|
|
2118
|
-
__decorateClass([
|
|
2119
|
-
property()
|
|
2120
|
-
], _OdxKpi.prototype, "label", 2);
|
|
2121
|
-
__decorateClass([
|
|
2122
|
-
property()
|
|
2123
|
-
], _OdxKpi.prototype, "unit", 2);
|
|
2124
|
-
__decorateClass([
|
|
2125
|
-
property()
|
|
2126
|
-
], _OdxKpi.prototype, "value", 2);
|
|
2127
|
-
__decorateClass([
|
|
2128
|
-
property({ reflect: true, useDefault: true })
|
|
2129
|
-
], _OdxKpi.prototype, "size", 2);
|
|
2130
|
-
__decorateClass([
|
|
2131
|
-
property({ reflect: true, useDefault: true })
|
|
2132
|
-
], _OdxKpi.prototype, "variant", 2);
|
|
2133
|
-
__decorateClass([
|
|
2134
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2135
|
-
], _OdxKpi.prototype, "vertical", 2);
|
|
2136
|
-
let OdxKpi = _OdxKpi;
|
|
2137
|
-
|
|
2138
|
-
const styles$K = ":host{display:-webkit-box;min-inline-size:min-content;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:var(--max, 2)}";
|
|
2139
|
-
|
|
2140
|
-
const _OdxLineClamp = class _OdxLineClamp extends CustomElement {
|
|
2141
|
-
static {
|
|
2142
|
-
customElement("odx-line-clamp", styles$K)(_OdxLineClamp);
|
|
2143
|
-
}
|
|
2144
|
-
updated(props) {
|
|
2145
|
-
super.updated(props);
|
|
2146
|
-
if (typeof this.max === "number" && this.max > 0) {
|
|
2147
|
-
this.style.setProperty("--max", String(this.max));
|
|
2148
|
-
} else {
|
|
2149
|
-
this.style.removeProperty("--max");
|
|
2150
|
-
}
|
|
2151
|
-
if (typeof this.max === "number" && this.max > 0) {
|
|
2152
|
-
this.style.setProperty("--min", String(this.max));
|
|
2153
|
-
} else {
|
|
2154
|
-
this.style.removeProperty("--max");
|
|
2155
|
-
}
|
|
2156
|
-
}
|
|
2157
|
-
};
|
|
2158
|
-
__decorateClass([
|
|
2159
|
-
property({ type: Number })
|
|
2160
|
-
], _OdxLineClamp.prototype, "max", 2);
|
|
2161
|
-
let OdxLineClamp = _OdxLineClamp;
|
|
2162
|
-
|
|
2163
|
-
const styles$J = ":host{--item-indent-level: 0;display:block}::slotted([role=\"listitem\"]){--indent-level: var(--item-indent-level)}";
|
|
2164
|
-
|
|
2165
|
-
const _OdxList = class _OdxList extends CustomElement {
|
|
2166
|
-
constructor() {
|
|
2167
|
-
super();
|
|
2168
|
-
this.multiple = false;
|
|
2169
|
-
new ExpandableItemManager(this, { getItems: () => this.items });
|
|
2170
|
-
}
|
|
2171
|
-
static {
|
|
2172
|
-
customElement("odx-list", styles$J)(_OdxList);
|
|
2173
|
-
}
|
|
2174
|
-
connectedCallback() {
|
|
2175
|
-
super.connectedCallback();
|
|
2176
|
-
this.role = "list";
|
|
2177
|
-
}
|
|
2178
|
-
toggleAll(state, emitEvent = false) {
|
|
2179
|
-
for (const item of this.items) {
|
|
2180
|
-
item.toggle(state, emitEvent);
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
};
|
|
2184
|
-
__decorateClass([
|
|
2185
|
-
queryAssignedElements({ selector: '[role="listitem"]', flatten: true })
|
|
2186
|
-
], _OdxList.prototype, "items", 2);
|
|
2187
|
-
__decorateClass([
|
|
2188
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2189
|
-
], _OdxList.prototype, "multiple", 2);
|
|
2190
|
-
let OdxList = _OdxList;
|
|
2191
|
-
|
|
2192
|
-
const styles$I = "@layer base{:host{--indent-level: 0;--_block-size: var(--odx-size-300);--_padding-block: var(--odx-size-75);display:flex;flex-direction:column;place-items:initial;block-size:auto;max-inline-size:100%}[part=base]{place-content:flex-start;z-index:1;outline-offset:calc(-1 * var(--odx-focus-ring-offset));padding-inline-start:calc(var(--odx-size-50) + var(--indent-level) * var(--odx-size-200));block-size:var(--_block-size);text-align:start;line-height:var(--odx-typography-line-height-2);>*{--odx-focus-ring-offset: 0}}[part=separator]{--margin-block: 0;--margin-inline: var(--odx-size-50)}[part=expand-control]::part(icon){transition:var(--odx-transition-reduced)}::slotted(odx-list){--item-indent-level: calc(var(--indent-level) + 1)}:host(:last-of-type) [part=separator]{opacity:0}}@layer variant{[part=base]:has([part=expand-control]:active){--_color-background-pressed: var(--_color-background-hover)}:host(:not([compact])){::slotted(odx-icon){margin-inline:var(--odx-size-37)}}:host([compact]){--_block-size: var(--odx-size-225);[part=expand-control]{--_icon-size: var(--odx-size-150)}}}@layer state{:host(:not([subtle]):hover):after{opacity:0}:host([subtle]:not([disabled])){--_color-background-hover: var(--_color-background);--_color-background-pressed: var(--_color-background);cursor:default}:host([aria-current]){--_color-background: var(--odx-color-background-transparent-selected-hover);--_color-background-hover: var(--odx-color-background-transparent-selected-hover)}:host([aria-current][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-background-hover: var(--_color-background);--_color-background-pressed: var(--_color-background);--_color-foreground: var(--odx-color-foreground-disabled-selected);cursor:not-allowed}:host([expanded]){[part=separator]{opacity:1}[part=expand-control]{--icon-rotation: 180deg}}}";
|
|
2193
|
-
|
|
2194
|
-
const _OdxListItem = class _OdxListItem extends CanBeExpanded(InteractiveElement) {
|
|
2195
|
-
constructor() {
|
|
2196
|
-
super(...arguments);
|
|
2197
|
-
this.compact = false;
|
|
2198
|
-
this.subtle = false;
|
|
2199
|
-
this.selected = false;
|
|
2200
|
-
this.withExpandControl = false;
|
|
2201
|
-
this.withExpandIndicator = false;
|
|
2202
|
-
}
|
|
2203
|
-
static {
|
|
2204
|
-
customElement("odx-list-item", styles$I)(_OdxListItem);
|
|
2205
|
-
}
|
|
2206
|
-
isExpandable() {
|
|
2207
|
-
return !(this.disabled || this.loading) && this.expandableItems.length > 0;
|
|
2208
|
-
}
|
|
2209
|
-
getExpandControl() {
|
|
2210
|
-
if (!this.isExpandable()) return null;
|
|
2211
|
-
return this.renderRoot.querySelector(this.withExpandControl ? '[part="expand-control"]' : '[part="base"]');
|
|
2212
|
-
}
|
|
2213
|
-
connectedCallback() {
|
|
2214
|
-
super.connectedCallback();
|
|
2215
|
-
this.role = "listitem";
|
|
2216
|
-
}
|
|
2217
|
-
render() {
|
|
2218
|
-
const expandSlot = html`<slot name="expand" @slotchange=${() => this.requestUpdate()}></slot>`;
|
|
2219
|
-
return html`
|
|
2220
|
-
${super.render()}
|
|
2221
|
-
<odx-separator part="separator"></odx-separator>
|
|
2222
|
-
${when(
|
|
2223
|
-
this.isExpandable(),
|
|
2224
|
-
() => html`<odx-toggle-content part="content" id="list-item-content" role="region" ?hidden=${!this.expanded}>${expandSlot}</odx-toggle-content>`,
|
|
2225
|
-
() => html`<odx-visually-hidden>${expandSlot}</odx-visually-hidden>`
|
|
2226
|
-
)}
|
|
2227
|
-
`;
|
|
2228
|
-
}
|
|
2229
|
-
renderContent() {
|
|
2230
|
-
const controlSize = this.compact ? ButtonSize.SM : void 0;
|
|
2231
|
-
return html`
|
|
2232
|
-
${super.renderContent(true)}
|
|
2233
|
-
${when(
|
|
2234
|
-
this.withExpandIndicator || this.isExpandable(),
|
|
2235
|
-
() => html`
|
|
2236
|
-
<odx-icon-button
|
|
2237
|
-
id="expand-control"
|
|
2238
|
-
part="expand-control"
|
|
2239
|
-
icon="core::chevron-down"
|
|
2240
|
-
variant="ghost"
|
|
2241
|
-
size=${optionalAttr(controlSize)}
|
|
2242
|
-
?disabled=${this.disabled}
|
|
2243
|
-
.inert=${!this.withExpandControl}
|
|
2244
|
-
>
|
|
2245
|
-
</odx-icon-button>
|
|
2246
|
-
`
|
|
2247
|
-
)}
|
|
2248
|
-
`;
|
|
2249
|
-
}
|
|
2250
|
-
willUpdate(props) {
|
|
2251
|
-
super.updated(props);
|
|
2252
|
-
if (props.has("disabled") || props.has("expanded")) {
|
|
2253
|
-
this.#handleExpandedChange();
|
|
2254
|
-
}
|
|
2255
|
-
if (props.has("selected")) {
|
|
2256
|
-
this.ariaCurrent = this.selected ? "page" : null;
|
|
2257
|
-
}
|
|
2258
|
-
}
|
|
2259
|
-
#handleExpandedChange() {
|
|
2260
|
-
const expandControl = this.getExpandControl();
|
|
2261
|
-
if (!(this.region && expandControl)) return;
|
|
2262
|
-
this.region.setAttribute("aria-labelledby", "expand-control");
|
|
2263
|
-
expandControl.ariaExpanded = toAriaBooleanAttribute(this.expanded);
|
|
2264
|
-
expandControl.setAttribute("aria-controls", this.region.id);
|
|
2265
|
-
if (this.expanded) return;
|
|
2266
|
-
this.querySelector("odx-list")?.toggleAll(false);
|
|
2267
|
-
}
|
|
2268
|
-
};
|
|
2269
|
-
__decorateClass([
|
|
2270
|
-
queryAssignedElements({ slot: "expand" })
|
|
2271
|
-
], _OdxListItem.prototype, "expandableItems", 2);
|
|
2272
|
-
__decorateClass([
|
|
2273
|
-
query("#list-item-content")
|
|
2274
|
-
], _OdxListItem.prototype, "region", 2);
|
|
2275
|
-
__decorateClass([
|
|
2276
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2277
|
-
], _OdxListItem.prototype, "compact", 2);
|
|
2278
|
-
__decorateClass([
|
|
2279
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2280
|
-
], _OdxListItem.prototype, "subtle", 2);
|
|
2281
|
-
__decorateClass([
|
|
2282
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2283
|
-
], _OdxListItem.prototype, "selected", 2);
|
|
2284
|
-
__decorateClass([
|
|
2285
|
-
property({ type: Boolean, attribute: "with-expand-control" })
|
|
2286
|
-
], _OdxListItem.prototype, "withExpandControl", 2);
|
|
2287
|
-
__decorateClass([
|
|
2288
|
-
property({ type: Boolean, attribute: "with-expand-indicator" })
|
|
2289
|
-
], _OdxListItem.prototype, "withExpandIndicator", 2);
|
|
2290
|
-
let OdxListItem = _OdxListItem;
|
|
2291
|
-
|
|
2292
|
-
const styles$H = ":host{--_overlay-fill-color: var(--odx-color-backdrop, rgb(255 255 255 / 25%));display:contents;border-radius:inherit;overflow:hidden}:host::part(overlay){display:flex;position:absolute;inset:0;flex-direction:column;place-content:center;place-items:center;transition:var(--odx-transition-reduced) allow-discrete;visibility:hidden;opacity:0;border-radius:inherit;overflow:hidden;pointer-events:none}:host::part(content){min-inline-size:var(--odx-size-225);text-align:center}:host([loading])::part(overlay){visibility:visible;opacity:1;z-index:9999;background-color:var(--_overlay-fill-color);pointer-events:all;backdrop-filter:blur(var(--odx-size-12))}";
|
|
2293
|
-
|
|
2294
|
-
const LOADING_OVERLAY_HOST_DIRECTIVE = "odx-loading-overlay-host";
|
|
2295
|
-
const _OdxLoadingOverlay = class _OdxLoadingOverlay extends CustomElement {
|
|
2296
|
-
constructor() {
|
|
2297
|
-
super(...arguments);
|
|
2298
|
-
this.#loadingContainerPosition = "";
|
|
2299
|
-
this.loading = false;
|
|
2300
|
-
}
|
|
2301
|
-
static {
|
|
2302
|
-
customElement("odx-loading-overlay", styles$H)(_OdxLoadingOverlay);
|
|
2303
|
-
}
|
|
2304
|
-
#loadingContainerPosition;
|
|
2305
|
-
get loadingContainer() {
|
|
2306
|
-
return this.parentElement ?? this;
|
|
2307
|
-
}
|
|
2308
|
-
disconnectedCallback() {
|
|
2309
|
-
super.disconnectedCallback();
|
|
2310
|
-
this.hideOverlay();
|
|
2311
|
-
}
|
|
2312
|
-
async updated(props) {
|
|
2313
|
-
if (props.has("loading")) {
|
|
2314
|
-
if (this.loading) {
|
|
2315
|
-
this.showOverlay();
|
|
2316
|
-
} else {
|
|
2317
|
-
await waitForAnimations(this.overlay);
|
|
2318
|
-
this.hideOverlay();
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
}
|
|
2322
|
-
render() {
|
|
2323
|
-
return html`
|
|
2324
|
-
<div part="overlay">
|
|
2325
|
-
<div class="content">
|
|
2326
|
-
<odx-loading-spinner></odx-loading-spinner>
|
|
2327
|
-
</div>
|
|
2328
|
-
</div>
|
|
2329
|
-
`;
|
|
2330
|
-
}
|
|
2331
|
-
showOverlay() {
|
|
2332
|
-
this.loadingContainer.toggleAttribute(LOADING_OVERLAY_HOST_DIRECTIVE, true);
|
|
2333
|
-
this.#loadingContainerPosition = window.getComputedStyle(this.loadingContainer).position;
|
|
2334
|
-
if (this.#loadingContainerPosition !== "static") return;
|
|
2335
|
-
this.loadingContainer.style.position = "relative";
|
|
2336
|
-
this.loadingContainer.inert = true;
|
|
2337
|
-
this.loadingContainer.ariaBusy = "true";
|
|
2338
|
-
}
|
|
2339
|
-
hideOverlay() {
|
|
2340
|
-
this.loadingContainer.toggleAttribute(LOADING_OVERLAY_HOST_DIRECTIVE, false);
|
|
2341
|
-
if (this.#loadingContainerPosition !== "static") return;
|
|
2342
|
-
this.loadingContainer.style.position = "";
|
|
2343
|
-
this.loadingContainer.inert = false;
|
|
2344
|
-
this.loadingContainer.ariaBusy = "false";
|
|
2345
|
-
}
|
|
2346
|
-
};
|
|
2347
|
-
__decorateClass([
|
|
2348
|
-
query('[part="overlay"]', true)
|
|
2349
|
-
], _OdxLoadingOverlay.prototype, "overlay", 2);
|
|
2350
|
-
__decorateClass([
|
|
2351
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2352
|
-
], _OdxLoadingOverlay.prototype, "loading", 2);
|
|
2353
|
-
let OdxLoadingOverlay = _OdxLoadingOverlay;
|
|
2354
|
-
|
|
2355
|
-
const styles$G = ":host{--_animation-duration: 1.5s;--_animation-delay: 0s;--_size: var(--odx-size-225);--_space: var(--odx-size-37);--_track-size: calc(var(--odx-size-37) - var(--odx-size-px));--_track-color: var(--odx-color-background-transparent-pressed);display:flex;place-content:center;place-items:center;block-size:1em;color:inherit;font-size:var(--_size)}.base{display:block;block-size:100%;inline-size:100%;aspect-ratio:1;animation:loading-spinner-rotation-animation 1.5s linear infinite}:host(:not([variant=\"dots\"])){inline-size:1em;.track,.indicator{stroke-width:var(--_track-size)}.track{stroke:var(--_track-color)}.indicator{animation:loading-spinner-animation 1.5s ease-in-out infinite;color:inherit;stroke:currentcolor;stroke-dasharray:90,180;stroke-dashoffset:-5;stroke-linecap:round}:not(svg){transform-origin:0 0}}:host([variant=\"dots\"]){gap:calc(var(--_space) / 2);padding:var(--_space);animation:loading-spinner-dots-entry-animation .25s linear both;.indicator{flex:0 0 calc(var(--_size) / 3);z-index:3;border-radius:var(--odx-border-radius-circle);background-color:currentcolor;block-size:calc(var(--_size) / 3);animation:loading-spinner-dots-animation var(--_animation-duration) var(--_animation-delay) infinite cubic-bezier(.96,.21,.41,.76) forwards;&:nth-child(1){--_animation-delay: calc(-1 * var(--_animation-duration) / 6)}&:nth-child(2){--_animation-delay: calc(-1 * var(--_animation-duration) / 12)}&:nth-child(3){--_animation-delay: 0s}}}@keyframes loading-spinner-animation{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes loading-spinner-rotation-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes loading-spinner-dots-entry-animation{0%{opacity:0}to{opacity:1}}@keyframes loading-spinner-dots-animation{0%,75%,to{transform:scale(.667);background-color:var(--odx-color-background-transparent-pressed)}50%{transform:scale(1);background-color:currentcolor}}";
|
|
2356
|
-
|
|
2357
|
-
const _OdxLoadingSpinner = class _OdxLoadingSpinner extends CustomElement {
|
|
2358
|
-
static {
|
|
2359
|
-
customElement("odx-loading-spinner", styles$G)(_OdxLoadingSpinner);
|
|
2360
|
-
}
|
|
2361
|
-
render() {
|
|
2362
|
-
if (this.variant === "dots") {
|
|
2363
|
-
return html`<div class="indicator"></div><div class="indicator"></div><div class="indicator"></div>`;
|
|
2364
|
-
}
|
|
2365
|
-
return html`
|
|
2366
|
-
<svg class="base" role="progressbar" aria-label="Loading" fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
2367
|
-
<circle class="track" cx="24" cy="24" r="20" fill="none"></circle>
|
|
2368
|
-
<circle class="indicator" cx="24" cy="24" r="20" fill="none"></circle>
|
|
2369
|
-
</svg>
|
|
2370
|
-
`;
|
|
2371
|
-
}
|
|
2372
|
-
};
|
|
2373
|
-
__decorateClass([
|
|
2374
|
-
property({ reflect: true })
|
|
2375
|
-
], _OdxLoadingSpinner.prototype, "variant", 2);
|
|
2376
|
-
let OdxLoadingSpinner = _OdxLoadingSpinner;
|
|
2377
|
-
|
|
2378
|
-
const styles$F = ":host{display:inline-block;background-color:currentcolor;aspect-ratio:92 / 36;mask-image:url(\"data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20?%3e%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2091.6%2035.43'%3e%3cpath%20d='m81.18,29.07h5.63v-14.43c0-1.06,0-1.38.21-1.7.32-.74,1.17-1.17,2.23-1.17.96,0,1.59.21,2.34.74v-4.24c-6.27.11-8.29.53-10.41,2.23v18.56Zm-12.11-10.93v-4.24c0-1.59.74-2.44,2.34-2.44,1.49,0,2.34.85,2.34,2.33v4.35h-4.68Zm10.31,3.29v-8.06c0-3.4-1.81-4.99-5.63-4.99h-4.68c-2.02,0-2.87.21-3.93,1.06-1.06.96-1.7,2.33-1.7,3.93v10.71c0,1.48.43,2.55,1.38,3.61,1.06,1.06,2.02,1.38,4.25,1.38h10.2v-4.24c-2.87.85-4.57,1.06-6.69,1.06-2.44,0-3.51-.53-3.51-1.91v-2.55h10.31Zm-27.63,6.37c0-1.59.74-2.44,2.34-2.44s2.44.85,2.44,2.44v2.33c0,1.38-.85,2.23-2.34,2.23-1.59,0-2.44-.85-2.44-2.23v-2.33Zm10.41-.53c0-1.59-.32-2.65-1.17-3.61-1.06-1.17-2.23-1.49-4.46-1.49h-4.68c-2.12,0-2.97.21-4.04,1.06-1.06.95-1.7,2.44-1.7,4.03v3.08c0,1.49.53,2.76,1.38,3.61,1.06,1.17,2.02,1.48,4.36,1.48h4.68c2.02,0,2.98-.21,4.04-1.06,1.06-.95,1.59-2.12,1.59-4.03v-3.08Zm-10.41-13.58c0-1.38.85-2.23,2.44-2.23s2.44.85,2.44,2.23v2.44c0,1.38-.96,2.23-2.44,2.23-1.59,0-2.44-.85-2.44-2.23v-2.44Zm9.99-5.3h-9.99c-1.91,0-2.66.21-3.72,1.06-1.06.96-1.59,2.33-1.59,3.93v3.08c0,1.27.43,2.55,1.28,3.5,1.06,1.17,1.91,1.49,4.04,1.49h4.57c2.02,0,2.87-.32,3.83-1.06,1.06-.95,1.59-2.23,1.59-3.93v-8.06Zm-22.63,17.4h-2.44c-.96,0-1.7-.32-2.13-1.06-.21-.32-.21-.42-.21-1.38v-1.91c0-1.59.74-2.33,2.34-2.33h2.44v6.68Zm0-9.97h-4.89c-1.91,0-2.76.21-3.72,1.17-1.06.85-1.59,2.12-1.59,3.82v3.29c0,1.48.32,2.55,1.17,3.5,1.06,1.17,2.02,1.48,4.25,1.48h10.52v-15.81c0-1.38-.43-2.55-1.38-3.5-1.17-1.17-2.13-1.49-4.25-1.49h-8.5v4.24c2.13-.85,3.51-1.17,5.42-1.17,2.02,0,2.97.64,2.97,2.02v2.44Zm2.34-15.81c-1.81,0-3.19,1.38-3.19,3.08,0,1.8,1.38,3.18,3.19,3.18,1.7,0,3.08-1.38,3.08-3.18,0-1.7-1.38-3.08-3.08-3.08Zm-7.55,0c-1.81,0-3.19,1.38-3.19,3.08,0,1.8,1.38,3.18,3.19,3.18,1.7,0,3.08-1.38,3.08-3.18,0-1.7-1.38-3.08-3.08-3.08Zm-14.77,29.07h5.63v-14.43c0-1.06,0-1.38.21-1.7.32-.74,1.17-1.17,2.23-1.17.96,0,1.59.21,2.34.74v-4.24c-6.27.11-8.29.53-10.41,2.23v18.56ZM0,.72v2.97h9.14c1.06,0,1.59.21,2.13.74.43.53.43.74.43,2.65v15.29c0,2.87-.53,3.4-3.08,3.4h-2.55V6.67H0v22.4h11.26c2.66,0,3.4-.21,4.68-1.49,1.17-1.17,1.38-2.02,1.38-5.31V6.24c0-2.02-.21-2.76-1.06-3.82-1.06-1.17-2.44-1.7-4.36-1.7H0Z'%20/%3e%3c/svg%3e\");mask-repeat:no-repeat;mask-origin:content-box;mask-position:center center}:host([compact]){aspect-ratio:1;mask-image:url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2017%2028'%3e%3cpath%20d='M0%200v2.97h9.14c1.06%200%201.59.21%202.13.74.43.53.43.74.43%202.65v15.29c0%202.87-.53%203.4-3.08%203.4H6.07V5.95H0v22.4h11.26c2.66%200%203.4-.21%204.68-1.49%201.17-1.17%201.38-2.02%201.38-5.31V5.52c0-2.02-.21-2.76-1.06-3.82C15.2.53%2013.82%200%2011.9%200H0Z'%20/%3e%3c/svg%3e\")}:host,:host([size=\"sm\"]){margin-block:var(--odx-size-37);block-size:var(--odx-size-150)}:host([size=\"xs\"]){margin-block:var(--odx-size-25);block-size:calc(var(--odx-size-150) - 2 * var(--odx-size-25))}:host([size=\"md\"]){margin-block:var(--odx-size-37);block-size:var(--odx-size-225)}:host([size=\"lg\"]){margin-block:var(--odx-size-37);block-size:var(--odx-size-300)}:host([size=\"xl\"]){margin-block:var(--odx-size-37);block-size:var(--odx-size-400)}";
|
|
2379
|
-
|
|
2380
|
-
const LogoSize = pick(Size, ["XS", "SM", "MD", "LG", "XL"]);
|
|
2381
|
-
const _OdxLogo = class _OdxLogo extends CustomElement {
|
|
2382
|
-
constructor() {
|
|
2383
|
-
super(...arguments);
|
|
2384
|
-
this.size = LogoSize.SM;
|
|
2385
|
-
this.compact = false;
|
|
2386
|
-
}
|
|
2387
|
-
static {
|
|
2388
|
-
customElement("odx-logo", styles$F)(_OdxLogo);
|
|
2389
|
-
}
|
|
2390
|
-
connectedCallback() {
|
|
2391
|
-
super.connectedCallback();
|
|
2392
|
-
this.ariaLabel ||= "Dräger";
|
|
2393
|
-
this.ariaRoleDescription ||= "Logo";
|
|
2394
|
-
this.role = "img";
|
|
2395
|
-
this.translate = false;
|
|
2396
|
-
}
|
|
2397
|
-
};
|
|
2398
|
-
__decorateClass([
|
|
2399
|
-
property({ reflect: true, useDefault: true })
|
|
2400
|
-
], _OdxLogo.prototype, "size", 2);
|
|
2401
|
-
__decorateClass([
|
|
2402
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2403
|
-
], _OdxLogo.prototype, "compact", 2);
|
|
2404
|
-
let OdxLogo = _OdxLogo;
|
|
2405
|
-
|
|
2406
|
-
const styles$E = ":host{--_transition-duration: var(--odx-motion-duration-default);display:grid;grid-template-rows:auto 1fr auto;transform:translate(-100%);transition:var(--odx-motion-duration-default) var(--odx-motion-easing-default) allow-discrete;visibility:hidden;margin:0;border:none;box-shadow:var(--odx-shadow-level-2);background-color:var(--odx-color-background-brand);padding:0;block-size:100%;inline-size:var(--odx-main-menu-max-width, min(100dvw, 384px));color:var(--odx-color-foreground-inverse-static)}.header,.link-navigation{padding:var(--odx-size-75) var(--odx-size-150)}.navigation{padding:var(--odx-size-75);overflow-y:auto}.link-navigation{column-gap:var(--odx-size-100)}::slotted(:is(odx-link,a)[slot=\"link-navigation\"][disabled]){color:var(--odx-color-foreground-disabled-brand)}:host(:popover-open){display:grid;transform:translate(0);visibility:visible;@starting-style{transform:translate(-100%);visibility:hidden}}:host::backdrop{transition:all var(--odx-motion-duration-default) linear;opacity:0;background-color:var(--odx-color-backdrop);cursor:default;backdrop-filter:blur(0)}:host(:popover-open)::backdrop{backdrop-filter:blur(var(--odx-elevation-blur));opacity:1;@starting-style{backdrop-filter:blur(0);opacity:0}}";
|
|
2407
|
-
|
|
2408
|
-
const _OdxMainMenu = class _OdxMainMenu extends CustomElement {
|
|
2409
|
-
static {
|
|
2410
|
-
customElement("odx-main-menu", styles$E)(_OdxMainMenu);
|
|
2411
|
-
}
|
|
2412
|
-
connectedCallback() {
|
|
2413
|
-
super.connectedCallback();
|
|
2414
|
-
this.popover = "auto";
|
|
2415
|
-
}
|
|
2416
|
-
toggle() {
|
|
2417
|
-
this.togglePopover();
|
|
2418
|
-
}
|
|
2419
|
-
open() {
|
|
2420
|
-
this.showPopover();
|
|
2421
|
-
}
|
|
2422
|
-
close() {
|
|
2423
|
-
this.hidePopover();
|
|
2424
|
-
}
|
|
2425
|
-
render() {
|
|
2426
|
-
return html`
|
|
2427
|
-
<odx-stack class="header">
|
|
2428
|
-
<odx-stack horizontal justify="space-between">
|
|
2429
|
-
<odx-logo size="sm"></odx-logo>
|
|
2430
|
-
<odx-icon-button icon="core::close" variant="primary" @click=${this.close}></odx-icon-button>
|
|
2431
|
-
</odx-stack>
|
|
2432
|
-
<odx-stack gap="xs">
|
|
2433
|
-
<slot name="title"></slot>
|
|
2434
|
-
<slot name="subtitle"></slot>
|
|
2435
|
-
</odx-stack>
|
|
2436
|
-
</odx-stack>
|
|
2437
|
-
<odx-stack role="navigation" class="navigation">
|
|
2438
|
-
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
2439
|
-
</odx-stack>
|
|
2440
|
-
<odx-stack class="link-navigation" gap="xs" horizontal wrap>
|
|
2441
|
-
<slot name="link-navigation"></slot>
|
|
2442
|
-
</odx-stack>
|
|
2443
|
-
`;
|
|
2444
|
-
}
|
|
2445
|
-
#handleSlotChange = () => {
|
|
2446
|
-
for (const link of this.links) {
|
|
2447
|
-
link.slot ||= "link-navigation";
|
|
2448
|
-
link.subtle = true;
|
|
2449
|
-
}
|
|
2450
|
-
};
|
|
2451
|
-
};
|
|
2452
|
-
__decorateClass([
|
|
2453
|
-
queryAssignedElements({ selector: "odx-link", flatten: true })
|
|
2454
|
-
], _OdxMainMenu.prototype, "links", 2);
|
|
2455
|
-
let OdxMainMenu = _OdxMainMenu;
|
|
2456
|
-
|
|
2457
|
-
class OdxMainMenuButton extends CustomElement {
|
|
2458
|
-
static {
|
|
2459
|
-
customElement("odx-main-menu-button")(OdxMainMenuButton);
|
|
2460
|
-
}
|
|
2461
|
-
render() {
|
|
2462
|
-
return html`
|
|
2463
|
-
<odx-icon-button aria-label="Open main menu" icon="core::menu" variant="ghost" @click=${this.#handleClick}>
|
|
2464
|
-
</odx-icon-button>
|
|
2465
|
-
`;
|
|
2466
|
-
}
|
|
2467
|
-
#handleClick = () => {
|
|
2468
|
-
document.querySelector("odx-main-menu")?.open();
|
|
2469
|
-
};
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
const styles$D = ":host{--_color-background: var(--odx-color-background-transparent-rest);--_color-foreground: inherit;user-select:none}[part=base]{display:flex;gap:var(--odx-size-50);place-items:center;transition:var(--odx-transition-default);outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border-radius:var(--odx-border-radius-sm);background-color:var(--_color-background);padding-inline:var(--odx-size-100);block-size:var(--odx-size-300);text-decoration:none;color:var(--_color-foreground);font-weight:var(--odx-font-weight-medium);&:focus-visible{outline-color:var(--odx-color-stroke-focus-outer)}}:host(:is([active],:active,:hover)){--_color-background: var(--odx-color-background-transparent-selected)}:host([disabled]){--_color-foreground: var(--odx-color-foreground-disabled-brand);pointer-events:none}";
|
|
2473
|
-
|
|
2474
|
-
class OdxMainMenuLink extends InteractiveLink {
|
|
2475
|
-
static {
|
|
2476
|
-
customElement("odx-main-menu-link", styles$D)(OdxMainMenuLink);
|
|
2477
|
-
}
|
|
2478
|
-
}
|
|
2479
|
-
|
|
2480
|
-
class OdxMainMenuSubtitle extends CustomElement {
|
|
2481
|
-
constructor() {
|
|
2482
|
-
super(...arguments);
|
|
2483
|
-
this.slot = "subtitle";
|
|
2484
|
-
}
|
|
2485
|
-
static {
|
|
2486
|
-
customElement("odx-main-menu-subtitle")(OdxMainMenuSubtitle);
|
|
2487
|
-
}
|
|
2488
|
-
render() {
|
|
2489
|
-
return html`
|
|
2490
|
-
<odx-text size="md">
|
|
2491
|
-
<slot></slot>
|
|
2492
|
-
</odx-text>
|
|
2493
|
-
`;
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
|
|
2497
|
-
class OdxMainMenuTitle extends CustomElement {
|
|
2498
|
-
constructor() {
|
|
2499
|
-
super(...arguments);
|
|
2500
|
-
this.slot = "title";
|
|
2501
|
-
}
|
|
2502
|
-
static {
|
|
2503
|
-
customElement("odx-main-menu-title")(OdxMainMenuTitle);
|
|
2504
|
-
}
|
|
2505
|
-
render() {
|
|
2506
|
-
return html`
|
|
2507
|
-
<odx-title size="sm">
|
|
2508
|
-
<slot></slot>
|
|
2509
|
-
</odx-title>
|
|
2510
|
-
`;
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
|
|
2514
|
-
const styles$C = ":host{--min-inline-size: 160px;--max-inline-size: 280px;--_gap: var(--odx-size-37)}.base{display:flex;flex-direction:column;gap:var(--_gap);block-size:100%;min-inline-size:var(--min-inline-size);max-inline-size:var(--max-inline-size)}::slotted(odx-separator){--margin-block: 0}";
|
|
2515
|
-
|
|
2516
|
-
const MENU_ITEM_ROLES = ["menuitem", "menuitemcheckbox", "menuitemradio"];
|
|
2517
|
-
const MENU_ITEMS_SELECTOR = MENU_ITEM_ROLES.map((role) => `[role="${role}"]`).join(",");
|
|
2518
|
-
class OdxMenu extends PopoverHost {
|
|
2519
|
-
static {
|
|
2520
|
-
customElement("odx-menu", styles$C)(OdxMenu);
|
|
2521
|
-
}
|
|
2522
|
-
#tabindexController = new RovingTabindexController(this, {
|
|
2523
|
-
elements: () => this.getItems(),
|
|
2524
|
-
direction: "vertical"
|
|
2525
|
-
});
|
|
2526
|
-
getItems() {
|
|
2527
|
-
return Array.from(this.querySelectorAll(MENU_ITEMS_SELECTOR)).filter((item) => !item.disabled);
|
|
2528
|
-
}
|
|
2529
|
-
connectedCallback() {
|
|
2530
|
-
super.connectedCallback();
|
|
2531
|
-
this.role ||= "menu";
|
|
2532
|
-
}
|
|
2533
|
-
mountPopover(referenceElement) {
|
|
2534
|
-
super.mountPopover(referenceElement);
|
|
2535
|
-
referenceElement?.addEventListener("click", this.#handleReferenceInteraction);
|
|
2536
|
-
referenceElement?.addEventListener("keydown", this.#handleReferenceKeyDown);
|
|
2537
|
-
}
|
|
2538
|
-
unmountPopover(referenceElement) {
|
|
2539
|
-
referenceElement.removeEventListener("keydown", this.#handleReferenceKeyDown);
|
|
2540
|
-
referenceElement.removeEventListener("click", this.#handleReferenceInteraction);
|
|
2541
|
-
super.unmountPopover(referenceElement);
|
|
2542
|
-
}
|
|
2543
|
-
onBeforePopoverShow() {
|
|
2544
|
-
this.#tabindexController.update({ elements: () => this.getItems() });
|
|
2545
|
-
this.#tabindexController.currentIndex = 0;
|
|
2546
|
-
this.#tabindexController.focus();
|
|
2547
|
-
}
|
|
2548
|
-
onPopoverShow() {
|
|
2549
|
-
this.addEventListener("keydown", this.#handleKeyDown);
|
|
2550
|
-
}
|
|
2551
|
-
onBeforePopoverHide() {
|
|
2552
|
-
this.removeEventListener("keydown", this.#handleKeyDown);
|
|
2553
|
-
}
|
|
2554
|
-
isMenuItem(element) {
|
|
2555
|
-
return MENU_ITEM_ROLES.includes(element.getAttribute?.("role") ?? "");
|
|
2556
|
-
}
|
|
2557
|
-
render() {
|
|
2558
|
-
return html`
|
|
2559
|
-
<odx-popover>
|
|
2560
|
-
<div class="base">
|
|
2561
|
-
<slot @click=${this.#handleClick}></slot>
|
|
2562
|
-
</div>
|
|
2563
|
-
</odx-popover>
|
|
2564
|
-
`;
|
|
2565
|
-
}
|
|
2566
|
-
#handleReferenceInteraction = (event) => {
|
|
2567
|
-
this.updateReferenceElementFromEvent(event);
|
|
2568
|
-
this.togglePopover();
|
|
2569
|
-
};
|
|
2570
|
-
#handleClick = (event) => {
|
|
2571
|
-
const eventPath = event.composedPath();
|
|
2572
|
-
const closestMenu = eventPath.find((element) => element.localName === this.localName);
|
|
2573
|
-
if (this !== closestMenu) return;
|
|
2574
|
-
const item = eventPath.find((element) => this.isMenuItem(element));
|
|
2575
|
-
if (!item) return;
|
|
2576
|
-
this.emit("select", { detail: { item } });
|
|
2577
|
-
this.hidePopover();
|
|
2578
|
-
};
|
|
2579
|
-
#handleKeyDown = (event) => {
|
|
2580
|
-
const key = getKeyInfo(event);
|
|
2581
|
-
if (!(this.open && (key.tab || key.backTab))) return;
|
|
2582
|
-
event?.preventDefault();
|
|
2583
|
-
event.stopPropagation();
|
|
2584
|
-
this.hidePopover();
|
|
2585
|
-
};
|
|
2586
|
-
#handleReferenceKeyDown = (event) => {
|
|
2587
|
-
if (!getKeyInfo(event).down) return;
|
|
2588
|
-
this.showPopover();
|
|
2589
|
-
};
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
const styles$B = ":host{display:flex;gap:var(--odx-size-50);place-items:center;padding-inline:var(--odx-size-50);font-weight:var(--odx-typography-font-weight-medium);user-select:none}odx-icon,::slotted(odx-icon){--size: var(--odx-typography-font-size-5)}";
|
|
2593
|
-
|
|
2594
|
-
class OdxMenuLabel extends CustomElement {
|
|
2595
|
-
static {
|
|
2596
|
-
customElement("odx-menu-label", styles$B)(OdxMenuLabel);
|
|
2597
|
-
}
|
|
2598
|
-
}
|
|
2599
|
-
|
|
2600
|
-
const _OdxMenuItem = class _OdxMenuItem extends InteractiveElement {
|
|
2601
|
-
static {
|
|
2602
|
-
customElement("odx-menu-item")(_OdxMenuItem);
|
|
2603
|
-
}
|
|
2604
|
-
renderContent() {
|
|
2605
|
-
return html`
|
|
2606
|
-
${when(!this.loading && this.icon, (icon) => html`<odx-icon name="${icon}"></odx-icon>`)}
|
|
2607
|
-
${when(this.loading, () => this.renderLoader())}
|
|
2608
|
-
<odx-line-clamp part="label" .max=${2}>
|
|
2609
|
-
<slot></slot>
|
|
2610
|
-
</odx-line-clamp>
|
|
2611
|
-
<slot name="suffix"></slot>
|
|
2612
|
-
`;
|
|
2613
|
-
}
|
|
2614
|
-
connectedCallback() {
|
|
2615
|
-
super.connectedCallback();
|
|
2616
|
-
this.role ||= "menuitem";
|
|
2617
|
-
}
|
|
2618
|
-
};
|
|
2619
|
-
__decorateClass([
|
|
2620
|
-
property()
|
|
2621
|
-
], _OdxMenuItem.prototype, "icon", 2);
|
|
2622
|
-
let OdxMenuItem = _OdxMenuItem;
|
|
2623
|
-
|
|
2624
|
-
const styles$A = "@layer base{:host{--max-inline-size: 640px;--_modal-outer-padding: var(--odx-breakpoint-spacing-150);display:contents;transition-property:display}:host,.base,.base::backdrop{transition:var(--odx-transition-slow);transition-behavior:allow-discrete}.base,.base::backdrop{opacity:0}.base{transform:translateY(var(--odx-size-100));transition-property:opacity,display,overlay,transform,box-shadow;border:0;border-radius:var(--odx-border-radius-ml);background:transparent;padding:0;inline-size:min(var(--max-inline-size),100% - 2 * var(--_modal-outer-padding));overflow:unset;color:var(--odx-color-foreground-rest);&::backdrop{transition-property:opacity;background-color:var(--odx-color-backdrop);backdrop-filter:blur(var(--odx-elevation-blur))}}.inner{display:flex;flex-direction:column;border-radius:inherit;background-color:var(--odx-color-background-level-1);padding:var(--odx-spacing-50) var(--odx-breakpoint-spacing-150);max-block-size:calc(100dvh - 2 * var(--_modal-outer-padding))}.header,.footer{min-block-size:var(--odx-size-300)}.content{padding:var(--odx-size-75) 0;overflow:auto}.dismiss-action{margin-inline-start:auto}}@layer state{:host(:not([open])){display:none}.base:focus-visible{outline-color:var(--odx-color-stroke-focus-outer)}.base[open]{transform:translate(0);box-shadow:var(--odx-shadow-level-2);&,&::backdrop{opacity:1;@starting-style{opacity:0}}@starting-style{transform:translateY(var(--odx-size-100))}}}";
|
|
2625
|
-
|
|
2626
|
-
const ModalLayout = { MODAL: "modal", SIDESHEET: "sidesheet" };
|
|
2627
|
-
(async () => {
|
|
2628
|
-
await 0;
|
|
2629
|
-
if (isServer) return;
|
|
2630
|
-
window.addEventListener("click", (event) => {
|
|
2631
|
-
const source = getElementFromEvent(
|
|
2632
|
-
event,
|
|
2633
|
-
(node) => node.hasAttribute("odx-modal-toggle") && node.ariaBusy !== "true" && node.ariaDisabled !== "true"
|
|
2634
|
-
);
|
|
2635
|
-
const modalId = source?.getAttribute("odx-modal-toggle");
|
|
2636
|
-
const modal = modalId ? source.ownerDocument.getElementById(modalId) : source?.closest("odx-modal");
|
|
2637
|
-
if (!modal) return;
|
|
2638
|
-
modal.open = !source.closest("odx-modal");
|
|
2639
|
-
});
|
|
2640
|
-
})();
|
|
2641
|
-
const _OdxModal = class _OdxModal extends CustomElement {
|
|
2642
|
-
constructor() {
|
|
2643
|
-
super();
|
|
2644
|
-
this.#closeRequested = false;
|
|
2645
|
-
this.#showRequested = false;
|
|
2646
|
-
this.dismissible = true;
|
|
2647
|
-
this.open = false;
|
|
2648
|
-
this.layout = ModalLayout.MODAL;
|
|
2649
|
-
this.#handleKeyDown = (event) => {
|
|
2650
|
-
if (!getKeyInfo(event).escape) return;
|
|
2651
|
-
event.preventDefault();
|
|
2652
|
-
this.dismiss();
|
|
2653
|
-
};
|
|
2654
|
-
this.#handleClick = (event) => {
|
|
2655
|
-
if (this.backdropDisabled || !event.target.isConnected || getElementFromEvent(event, (node) => node === this.modalContainer)) return;
|
|
2656
|
-
this.dismiss();
|
|
2657
|
-
};
|
|
2658
|
-
if (!isServer) {
|
|
2659
|
-
this.addEventListener("click", this.#handleClick);
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
static {
|
|
2663
|
-
customElement("odx-modal", styles$A)(_OdxModal);
|
|
2664
|
-
}
|
|
2665
|
-
#closeRequested;
|
|
2666
|
-
#showRequested;
|
|
2667
|
-
connectedCallback() {
|
|
2668
|
-
super.connectedCallback();
|
|
2669
|
-
this.id ||= getUniqueId("odx-modal");
|
|
2670
|
-
}
|
|
2671
|
-
async show() {
|
|
2672
|
-
if (this.dialog.open || this.#showRequested) return;
|
|
2673
|
-
this.#showRequested = true;
|
|
2674
|
-
const canShow = await this.canShow?.(this) ?? true;
|
|
2675
|
-
if (!canShow) return;
|
|
2676
|
-
await this.beforeShow?.(this);
|
|
2677
|
-
this.dialog.showModal();
|
|
2678
|
-
await waitForAnimations(this.dialog, true);
|
|
2679
|
-
await this.afterShow?.(this);
|
|
2680
|
-
this.open = true;
|
|
2681
|
-
this.#showRequested = false;
|
|
2682
|
-
}
|
|
2683
|
-
async close(returnValue) {
|
|
2684
|
-
if (!this.dialog.open || this.#closeRequested) return;
|
|
2685
|
-
this.#closeRequested = true;
|
|
2686
|
-
const canClose = await this.canClose?.(this) ?? true;
|
|
2687
|
-
if (!canClose) return;
|
|
2688
|
-
await this.beforeClose?.(this);
|
|
2689
|
-
this.dialog.close(returnValue);
|
|
2690
|
-
await waitForAnimations(this.dialog, true);
|
|
2691
|
-
await this.afterClose?.(this);
|
|
2692
|
-
this.open = false;
|
|
2693
|
-
this.#closeRequested = false;
|
|
2694
|
-
}
|
|
2695
|
-
async dismiss() {
|
|
2696
|
-
if (!this.dismissible) return;
|
|
2697
|
-
await this.close();
|
|
2698
|
-
}
|
|
2699
|
-
render() {
|
|
2700
|
-
return html`
|
|
2701
|
-
<dialog class="base" @close=${forwardEvent(this)} @keydown=${this.#handleKeyDown}>
|
|
2702
|
-
<div class="inner">
|
|
2703
|
-
<odx-stack class="header" align="center" horizontal>
|
|
2704
|
-
<slot name="header"></slot>
|
|
2705
|
-
${when(
|
|
2706
|
-
this.dismissible,
|
|
2707
|
-
() => html`<odx-icon-button class="dismiss-action" icon="core::close" variant="ghost" @click=${this.dismiss} .autofocus=${true}></odx-icon-button>`
|
|
2708
|
-
)}
|
|
2709
|
-
</odx-stack>
|
|
2710
|
-
<div class="content">
|
|
2711
|
-
<slot></slot>
|
|
2712
|
-
</div>
|
|
2713
|
-
<odx-stack class="footer" align="center" justify="end" horizontal>
|
|
2714
|
-
<slot name="footer"></slot>
|
|
2715
|
-
</odx-stack>
|
|
2716
|
-
</div>
|
|
2717
|
-
</dialog>
|
|
2718
|
-
`;
|
|
2719
|
-
}
|
|
2720
|
-
updated(props) {
|
|
2721
|
-
super.updated(props);
|
|
2722
|
-
if (props.has("open")) {
|
|
2723
|
-
this.#handleOpenChange(props.get("open"));
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
#handleOpenChange(previousValue) {
|
|
2727
|
-
if (Boolean(previousValue) === this.open) return;
|
|
2728
|
-
if (this.open) {
|
|
2729
|
-
this.show();
|
|
2730
|
-
} else {
|
|
2731
|
-
this.close();
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
#handleKeyDown;
|
|
2735
|
-
#handleClick;
|
|
2736
|
-
};
|
|
2737
|
-
__decorateClass([
|
|
2738
|
-
query("dialog", true)
|
|
2739
|
-
], _OdxModal.prototype, "dialog", 2);
|
|
2740
|
-
__decorateClass([
|
|
2741
|
-
query(".inner", true)
|
|
2742
|
-
], _OdxModal.prototype, "modalContainer", 2);
|
|
2743
|
-
__decorateClass([
|
|
2744
|
-
property({ type: Boolean, attribute: "backdrop-disabled" })
|
|
2745
|
-
], _OdxModal.prototype, "backdropDisabled", 2);
|
|
2746
|
-
__decorateClass([
|
|
2747
|
-
property({ type: Boolean })
|
|
2748
|
-
], _OdxModal.prototype, "dismissible", 2);
|
|
2749
|
-
__decorateClass([
|
|
2750
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2751
|
-
], _OdxModal.prototype, "open", 2);
|
|
2752
|
-
__decorateClass([
|
|
2753
|
-
property({ reflect: true, useDefault: true })
|
|
2754
|
-
], _OdxModal.prototype, "layout", 2);
|
|
2755
|
-
let OdxModal = _OdxModal;
|
|
2756
|
-
|
|
2757
|
-
const styles$z = "@layer base{:host{--_icon-margin: calc(-.5 * (var(--_icon-size) - var(--_padding-inline)) - var(--odx-size-px));--_padding-inline: var(--odx-size-75)}odx-avatar,::slotted(odx-avatar){--_size: var(--odx-size-150);--_spacing: calc(var(--odx-size-37));font-size:var(--odx-typography-font-size-5)}}@layer state{:host([aria-current]){--_color-background: var(--odx-color-background-transparent-selected);--_color-background-hover: var(--odx-color-background-transparent-selected-hover)}:host([aria-current][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected);cursor:not-allowed}}@layer variant{:host([size=\"lg\"]){--_block-size: var(--odx-size-300);--_padding-inline: var(--odx-size-100);--_font-size: var(--odx-typography-font-size-3);--_icon-size: var(--odx-size-200);odx-avatar,::slotted(odx-avatar){--_size: var(--odx-size-200);--_spacing: calc(var(--odx-size-50));font-size:var(--odx-typography-font-size-5)}}}";
|
|
2758
|
-
|
|
2759
|
-
const NavigationItemSize = pick(Size, ["MD", "LG"]);
|
|
2760
|
-
const _OdxNavigationItem = class _OdxNavigationItem extends InteractiveElement {
|
|
2761
|
-
constructor() {
|
|
2762
|
-
super(...arguments);
|
|
2763
|
-
this.size = NavigationItemSize.MD;
|
|
2764
|
-
this.selected = false;
|
|
2765
|
-
}
|
|
2766
|
-
static {
|
|
2767
|
-
customElement("odx-navigation-item", styles$z)(_OdxNavigationItem);
|
|
2768
|
-
}
|
|
2769
|
-
willUpdate(props) {
|
|
2770
|
-
super.willUpdate(props);
|
|
2771
|
-
if (props.has("selected")) {
|
|
2772
|
-
this.ariaCurrent = this.selected ? "page" : null;
|
|
2773
|
-
}
|
|
2774
|
-
}
|
|
2775
|
-
};
|
|
2776
|
-
__decorateClass([
|
|
2777
|
-
property({ reflect: true, useDefault: true })
|
|
2778
|
-
], _OdxNavigationItem.prototype, "size", 2);
|
|
2779
|
-
__decorateClass([
|
|
2780
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2781
|
-
], _OdxNavigationItem.prototype, "selected", 2);
|
|
2782
|
-
let OdxNavigationItem = _OdxNavigationItem;
|
|
2783
|
-
|
|
2784
|
-
const styles$y = ":host{--_color-background: var(--odx-color-background-transparent-rest);--_color-foreground: inherit;display:inline-flex;gap:var(--odx-size-75);place-items:center;transition:var(--odx-transition-reduced);transition-property:background-color,color;border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding:var(--odx-size-37) var(--odx-size-75);color:var(--_color-foreground);user-select:none}odx-checkbox{margin:0}.label{margin-inline-end:auto}:host(:hover:not([readonly])){--_color-background: var(--odx-color-background-transparent-hover)}:host([odx-active]:not([readonly])),:host(:active:not([readonly])){--_color-background: var(--odx-color-background-transparent-pressed)}:host([selected]){--_color-background: var(--odx-color-background-transparent-selected)}:host([selected]:hover:not([readonly])){--_color-background: var(--odx-color-background-transparent-selected-hover)}:host([disabled]){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed;pointer-events:none}:host([readonly]){cursor:default}:host([selected][disabled]){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}:host([selected][odx-active]:not([readonly])),:host([selected]:active:not([readonly])){--_color-background: var(--odx-color-background-transparent-selected-hover)}";
|
|
2785
|
-
|
|
2786
|
-
class OdxOption extends OptionControl {
|
|
2787
|
-
static {
|
|
2788
|
-
customElement("odx-option", styles$y)(OdxOption);
|
|
2789
|
-
}
|
|
2790
|
-
render() {
|
|
2791
|
-
return html`
|
|
2792
|
-
${when(
|
|
2793
|
-
this.type === "checkbox",
|
|
2794
|
-
() => html`<odx-checkbox .checked=${this.selected} ?disabled=${this.disabled} inert></odx-checkbox>`,
|
|
2795
|
-
() => html`<slot name="prefix"></slot>`
|
|
2796
|
-
)}
|
|
2797
|
-
<div class="label">
|
|
2798
|
-
<slot></slot>
|
|
2799
|
-
</div>
|
|
2800
|
-
<slot name="suffix"></slot>
|
|
2801
|
-
`;
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
|
|
2805
|
-
const styles$x = ":host{--max-inline-size: var(--odx-page-max-inline-size, 100%);--scroll-margin-block-start: calc(var(--header-size, 0px) + var(--subheader-size, 0px));display:grid;grid-template-areas:\"header\" \"subheader\" \"content\" \"footer\";grid-template-rows:minmax(0,auto) minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:100%;min-block-size:100dvh}.header,.subheader{position:sticky;z-index:99}.subheader,.content{background-color:var(--odx-color-background-base);padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header{inset-block-start:0;grid-area:header}.subheader{inset-block-start:var(--header-size, 0);grid-area:subheader}.content{grid-area:content;block-size:100%}.footer{grid-area:footer}::slotted(odx-page-layout){min-block-size:100%}:host([alignment=\"center\"]){.subheader,.content{margin-inline:auto}}:host([layout=\"narrow\"]){--max-inline-size: var(--odx-page-max-inline-size-narrow)}:host([layout=\"wide\"]){--max-inline-size: var(--odx-page-max-inline-size-wide)}";
|
|
2806
|
-
|
|
2807
|
-
const PageAlignment = { CENTER: "center" };
|
|
2808
|
-
const PageLayout = { AUTO: "auto", NARROW: "narrow", WIDE: "wide" };
|
|
2809
|
-
const _OdxPage = class _OdxPage extends CustomElement {
|
|
2810
|
-
constructor() {
|
|
2811
|
-
super(...arguments);
|
|
2812
|
-
this.layout = PageLayout.AUTO;
|
|
2813
|
-
}
|
|
2814
|
-
static {
|
|
2815
|
-
customElement("odx-page", styles$x)(_OdxPage);
|
|
2816
|
-
}
|
|
2817
|
-
firstUpdated(props) {
|
|
2818
|
-
super.firstUpdated(props);
|
|
2819
|
-
SharedResizeObserver.observe(this, () => {
|
|
2820
|
-
this.style.setProperty("--header-size", toPx(this.headerElement.offsetHeight));
|
|
2821
|
-
this.style.setProperty("--subheader-size", toPx(this.subheaderElement.offsetHeight));
|
|
2822
|
-
});
|
|
2823
|
-
}
|
|
2824
|
-
disconnectedCallback() {
|
|
2825
|
-
super.disconnectedCallback();
|
|
2826
|
-
SharedResizeObserver.unobserve(this);
|
|
2827
|
-
}
|
|
2828
|
-
render() {
|
|
2829
|
-
return html`
|
|
2830
|
-
<div class="header" part="header">
|
|
2831
|
-
<slot name="header"></slot>
|
|
2832
|
-
</div>
|
|
2833
|
-
<div class="subheader" part="subheader">
|
|
2834
|
-
<slot name="subheader"></slot>
|
|
2835
|
-
</div>
|
|
2836
|
-
<div class="content" part="content">
|
|
2837
|
-
<slot></slot>
|
|
2838
|
-
</div>
|
|
2839
|
-
<div class="footer" part="footer">
|
|
2840
|
-
<slot name="footer"></slot>
|
|
2841
|
-
</div>
|
|
2842
|
-
`;
|
|
2843
|
-
}
|
|
2844
|
-
};
|
|
2845
|
-
__decorateClass([
|
|
2846
|
-
query(".header", true)
|
|
2847
|
-
], _OdxPage.prototype, "headerElement", 2);
|
|
2848
|
-
__decorateClass([
|
|
2849
|
-
query(".subheader", true)
|
|
2850
|
-
], _OdxPage.prototype, "subheaderElement", 2);
|
|
2851
|
-
__decorateClass([
|
|
2852
|
-
property({ reflect: true, useDefault: true })
|
|
2853
|
-
], _OdxPage.prototype, "alignment", 2);
|
|
2854
|
-
__decorateClass([
|
|
2855
|
-
property({ reflect: true, useDefault: true })
|
|
2856
|
-
], _OdxPage.prototype, "layout", 2);
|
|
2857
|
-
let OdxPage = _OdxPage;
|
|
2858
|
-
|
|
2859
|
-
const styles$w = ":host{display:grid;grid-template-areas:\"navigation header sidebar\" \"navigation content sidebar\" \"footer footer footer\";grid-template-rows:minmax(0,auto) minmax(0,1fr) minmax(0,auto);grid-template-columns:minmax(0,auto) minmax(0,100%) minmax(0,auto);justify-content:start;padding-inline:var(--odx-size-75);inline-size:100%;max-inline-size:var(--max-inline-size)}.header,.navigation,.sidebar{position:sticky;inset-block-start:var(--scroll-margin-block-start);z-index:98;background-color:var(--odx-color-background-base)}.navigation,.sidebar{--_size: calc(100dvh - var(--scroll-margin-block-start));inset-block-end:0;max-block-size:var(--_size);overflow:auto}.content{display:flex;flex-direction:column;grid-area:content;margin-block-end:var(--odx-size-150)}.footer{grid-area:footer}.header{grid-area:header}.navigation{grid-area:navigation;padding-inline-end:var(--odx-size-75)}.sidebar{grid-area:sidebar;padding-inline-start:var(--odx-size-75)}";
|
|
2860
|
-
|
|
2861
|
-
class OdxPageLayout extends CustomElement {
|
|
2862
|
-
static {
|
|
2863
|
-
customElement("odx-page-layout", styles$w)(OdxPageLayout);
|
|
2864
|
-
}
|
|
2865
|
-
render() {
|
|
2866
|
-
return html`
|
|
2867
|
-
${optionalSlot(this, "navigation")}
|
|
2868
|
-
${optionalSlot(this, "header")}
|
|
2869
|
-
<div class="content">
|
|
2870
|
-
<slot></slot>
|
|
2871
|
-
</div>
|
|
2872
|
-
${optionalSlot(this, "sidebar")}
|
|
2873
|
-
${optionalSlot(this, "footer")}
|
|
2874
|
-
`;
|
|
2875
|
-
}
|
|
2876
|
-
}
|
|
2877
|
-
|
|
2878
|
-
const styles$v = ":host{display:block}[odx-button]::part(base){outline-offset:0}";
|
|
2879
|
-
|
|
2880
|
-
setTranslation("en", {
|
|
2881
|
-
odx: {
|
|
2882
|
-
pagination: {
|
|
2883
|
-
"pageCount.default": "Page {{odx.pagination.pageCount.compact}}",
|
|
2884
|
-
"pageCount.compact": "{{ page }} of {{ totalPages }}",
|
|
2885
|
-
summary: "{{ pageStart }} to {{ pageEnd }} of {{ totalItems }}"
|
|
2886
|
-
}
|
|
2887
|
-
}
|
|
2888
|
-
});
|
|
2889
|
-
const _OdxPagination = class _OdxPagination extends IsLocalized(CustomElement) {
|
|
2890
|
-
constructor() {
|
|
2891
|
-
super(...arguments);
|
|
2892
|
-
this.page = 0;
|
|
2893
|
-
this.pageSize = 10;
|
|
2894
|
-
this.totalItems = 0;
|
|
2895
|
-
}
|
|
2896
|
-
static {
|
|
2897
|
-
customElement("odx-pagination", styles$v)(_OdxPagination);
|
|
2898
|
-
}
|
|
2899
|
-
get paginationContext() {
|
|
2900
|
-
return {
|
|
2901
|
-
pageStart: Math.min(Math.max(0, this.page * this.pageSize), this.totalItems),
|
|
2902
|
-
pageEnd: Math.min(Math.max(0, (this.page + 1) * this.pageSize - 1), this.totalItems),
|
|
2903
|
-
page: Math.min(Math.max(1, this.page), this.totalPages),
|
|
2904
|
-
totalPages: this.totalPages,
|
|
2905
|
-
totalItems: this.totalItems,
|
|
2906
|
-
hasPreviousPage: this.page > 0,
|
|
2907
|
-
hasNextPage: this.page < this.totalPages
|
|
2908
|
-
};
|
|
2909
|
-
}
|
|
2910
|
-
get totalPages() {
|
|
2911
|
-
if (this.totalItems === 0) return 1;
|
|
2912
|
-
return Math.ceil(this.totalItems / this.pageSize);
|
|
2913
|
-
}
|
|
2914
|
-
previousPage() {
|
|
2915
|
-
this.page = Math.max(this.page - 1, 0);
|
|
2916
|
-
}
|
|
2917
|
-
nextPage() {
|
|
2918
|
-
this.page = Math.min(this.page + 1, this.totalPages - 1);
|
|
2919
|
-
}
|
|
2920
|
-
firstPage() {
|
|
2921
|
-
this.page = 0;
|
|
2922
|
-
}
|
|
2923
|
-
lastPage() {
|
|
2924
|
-
this.page = this.totalPages - 1;
|
|
2925
|
-
}
|
|
2926
|
-
render() {
|
|
2927
|
-
const { hasPreviousPage, hasNextPage } = this.paginationContext;
|
|
2928
|
-
return html`
|
|
2929
|
-
<odx-stack align="center" gap="xs" justify="end" horizontal>
|
|
2930
|
-
<span>${this.t("odx.pagination.summary", this.paginationContext)}</span>
|
|
2931
|
-
<odx-button-group ?disabled=${!hasPreviousPage}>
|
|
2932
|
-
<odx-icon-button icon="core::chevron-left-end" @click=${() => this.firstPage()} variant="ghost"></odx-icon-button>
|
|
2933
|
-
<odx-icon-button icon="core::chevron-left" @click=${() => this.previousPage()} variant="ghost"></odx-icon-button>
|
|
2934
|
-
</odx-button-group>
|
|
2935
|
-
<span>${this.t("odx.pagination.pageCount.default", this.paginationContext)}</span>
|
|
2936
|
-
<odx-button-group ?disabled=${!hasNextPage}>
|
|
2937
|
-
<odx-icon-button icon="core::chevron-right" @click=${() => this.nextPage()} variant="ghost"></odx-icon-button>
|
|
2938
|
-
<odx-icon-button icon="core::chevron-right-end" @click=${() => this.lastPage()} variant="ghost"></odx-icon-button>
|
|
2939
|
-
</odx-button-group>
|
|
2940
|
-
</odx-stack>
|
|
2941
|
-
`;
|
|
2942
|
-
}
|
|
2943
|
-
updated(props) {
|
|
2944
|
-
super.updated(props);
|
|
2945
|
-
if (props.has("page") && props.get("page") !== this.page) {
|
|
2946
|
-
this.emit("change", { detail: this.paginationContext });
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
};
|
|
2950
|
-
__decorateClass([
|
|
2951
|
-
property({ type: Number })
|
|
2952
|
-
], _OdxPagination.prototype, "page", 2);
|
|
2953
|
-
__decorateClass([
|
|
2954
|
-
property({ type: Number })
|
|
2955
|
-
], _OdxPagination.prototype, "pageSize", 2);
|
|
2956
|
-
__decorateClass([
|
|
2957
|
-
property({ type: Number })
|
|
2958
|
-
], _OdxPagination.prototype, "totalItems", 2);
|
|
2959
|
-
let OdxPagination = _OdxPagination;
|
|
2960
|
-
|
|
2961
|
-
const styles$u = ":host{display:flex;border-radius:var(--odx-border-radius-controls);box-shadow:var(--_popover-shadow);background-color:var(--_popover-color-background)}[part~=base]{display:flex;position:relative;inset-block-start:0!important;inset-inline-start:0!important;flex-direction:column;z-index:2;border-radius:inherit;block-size:fit-content;min-block-size:var(--_popover-min-block-size);max-block-size:100%;min-inline-size:var(--_popover-min-inline-size);max-inline-size:100%;overflow:auto;scrollbar-width:thin;scroll-behavior:smooth;scroll-padding-block:calc(var(--odx-size-150) + var(--_popover-outer-padding))}[part~=content]{display:flex;flex-direction:column;padding:var(--odx-size-75);color:var(--_popover-color-foreground)}[part~=arrow]{position:absolute;z-index:3;background-color:inherit;block-size:var(--_popover-arrow-size);inline-size:var(--_popover-arrow-size)}";
|
|
2962
|
-
|
|
2963
|
-
const _OdxPopover = class _OdxPopover extends CustomElement {
|
|
2964
|
-
constructor() {
|
|
2965
|
-
super(...arguments);
|
|
2966
|
-
this.showArrow = false;
|
|
2967
|
-
}
|
|
2968
|
-
static {
|
|
2969
|
-
customElement("odx-popover", styles$u)(_OdxPopover);
|
|
2970
|
-
}
|
|
2971
|
-
render() {
|
|
2972
|
-
return html`
|
|
2973
|
-
<div part="base">
|
|
2974
|
-
<div part="content">
|
|
2975
|
-
<slot></slot>
|
|
2976
|
-
</div>
|
|
2977
|
-
</div>
|
|
2978
|
-
${when(this.showArrow, () => html`<div part="arrow"></div>`)}
|
|
2979
|
-
`;
|
|
2980
|
-
}
|
|
2981
|
-
};
|
|
2982
|
-
__decorateClass([
|
|
2983
|
-
query('[part="arrow"]')
|
|
2984
|
-
], _OdxPopover.prototype, "arrowElement", 2);
|
|
2985
|
-
__decorateClass([
|
|
2986
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
2987
|
-
], _OdxPopover.prototype, "showArrow", 2);
|
|
2988
|
-
let OdxPopover = _OdxPopover;
|
|
2989
|
-
|
|
2990
|
-
const styles$t = ":host{--_color-foreground: inherit;--_indicator-color: var(--odx-color-background-primary-rest);--_track-color: var(--odx-palette-coolgray-10);--_track-size: var(--odx-size-50);--_value-percentage: 0;display:flex;flex-wrap:wrap;gap:var(--odx-size-50);align-items:center;padding-block:var(--odx-size-25);padding-inline:var(--odx-size-75);line-height:1rem;color:var(--_color-foreground)}.base,.indicator{inline-size:100%}.base{position:relative;border-radius:var(--odx-border-radius-md);background:var(--_track-color);block-size:var(--_track-size);inline-size:100%;overflow:hidden}.indicator{transform:scaleX(calc(var(--_value-percentage) / 100));transform-origin:0% 50%;transition:var(--odx-transition-reduced);transition-property:background-color,transform;background-color:var(--_indicator-color);block-size:100%}[part=label]{flex:1;margin-block:calc(-1 * var(--odx-size-25));padding-block:var(--odx-size-25);text-align:start}[part=value]{align-self:flex-end;margin-inline-start:auto;text-align:end}:host([condensed]){flex-wrap:nowrap;padding-block:0;[part=label]{flex:1 1 auto}[part=value]{order:99}}:host([variant=\"confirm\"]){--_indicator-color: var(--odx-color-background-confirmation-rest)}:host([variant=\"danger\"]){--_indicator-color: var(--odx-color-background-danger-rest);color:var(--odx-color-foreground-danger-rest);font-weight:var(--odx-font-weight-medium)}:host([variant=\"success\"]){--_indicator-color: var(--odx-color-background-success-rest)}:host([indeterminate]) .indicator{animation:indeterminate 1.5s linear infinite}@keyframes indeterminate{0%{transform:translate(0) scaleX(0)}40%{transform:translate(0) scaleX(.4)}to{transform:translate(100%) scaleX(.5)}}";
|
|
2991
|
-
|
|
2992
|
-
const ProgressBarVariant = {
|
|
2993
|
-
...pick(Variant, ["NEUTRAL", "DANGER", "SUCCESS"]),
|
|
2994
|
-
CONFIRM: "confirm"
|
|
2995
|
-
};
|
|
2996
|
-
const _OdxProgressBar = class _OdxProgressBar extends CustomElement {
|
|
2997
|
-
constructor() {
|
|
2998
|
-
super(...arguments);
|
|
2999
|
-
this.min = 0;
|
|
3000
|
-
this.max = 100;
|
|
3001
|
-
this.value = 0;
|
|
3002
|
-
this.condensed = false;
|
|
3003
|
-
this.hideValue = false;
|
|
3004
|
-
this.indeterminate = false;
|
|
3005
|
-
this.variant = ProgressBarVariant.NEUTRAL;
|
|
3006
|
-
}
|
|
3007
|
-
static {
|
|
3008
|
-
customElement("odx-progress-bar", styles$t)(_OdxProgressBar);
|
|
3009
|
-
}
|
|
3010
|
-
get valuePercentage() {
|
|
3011
|
-
return Math.min(Math.max(this.min, round(this.value - this.min / this.max - this.min, 2)), this.max);
|
|
3012
|
-
}
|
|
3013
|
-
get valueHidden() {
|
|
3014
|
-
return this.hideValue || !this.valueText && this.indeterminate;
|
|
3015
|
-
}
|
|
3016
|
-
render() {
|
|
3017
|
-
const valueText = this.valueText || `${this.valuePercentage}%`;
|
|
3018
|
-
return html`
|
|
3019
|
-
${when(this.label, (label) => html`<div part="label" aria-hidden="true" odxPreventTextOverflow>${label}</div>`)}
|
|
3020
|
-
${when(!this.valueHidden, () => html`<odx-text part="value" aria-hidden="true">${valueText}</odx-text>`)}
|
|
3021
|
-
<div
|
|
3022
|
-
class="base"
|
|
3023
|
-
role="progressbar"
|
|
3024
|
-
title=${optionalAttr(this.title)}
|
|
3025
|
-
aria-label=${optionalAttr(this.label)}
|
|
3026
|
-
aria-valuemin="0"
|
|
3027
|
-
aria-valuemax="100"
|
|
3028
|
-
aria-valuenow=${this.indeterminate ? 0 : this.value}
|
|
3029
|
-
style="--_value-percentage: ${this.valuePercentage}"
|
|
3030
|
-
>
|
|
3031
|
-
<div class="indicator"></div>
|
|
3032
|
-
</div>
|
|
3033
|
-
`;
|
|
3034
|
-
}
|
|
3035
|
-
};
|
|
3036
|
-
__decorateClass([
|
|
3037
|
-
queryAssignedElements()
|
|
3038
|
-
], _OdxProgressBar.prototype, "content", 2);
|
|
3039
|
-
__decorateClass([
|
|
3040
|
-
property({ type: Number })
|
|
3041
|
-
], _OdxProgressBar.prototype, "min", 2);
|
|
3042
|
-
__decorateClass([
|
|
3043
|
-
property({ type: Number })
|
|
3044
|
-
], _OdxProgressBar.prototype, "max", 2);
|
|
3045
|
-
__decorateClass([
|
|
3046
|
-
property({ type: Number })
|
|
3047
|
-
], _OdxProgressBar.prototype, "value", 2);
|
|
3048
|
-
__decorateClass([
|
|
3049
|
-
property()
|
|
3050
|
-
], _OdxProgressBar.prototype, "label", 2);
|
|
3051
|
-
__decorateClass([
|
|
3052
|
-
property()
|
|
3053
|
-
], _OdxProgressBar.prototype, "valueText", 2);
|
|
3054
|
-
__decorateClass([
|
|
3055
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3056
|
-
], _OdxProgressBar.prototype, "condensed", 2);
|
|
3057
|
-
__decorateClass([
|
|
3058
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3059
|
-
], _OdxProgressBar.prototype, "hideValue", 2);
|
|
3060
|
-
__decorateClass([
|
|
3061
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3062
|
-
], _OdxProgressBar.prototype, "indeterminate", 2);
|
|
3063
|
-
__decorateClass([
|
|
3064
|
-
property({ reflect: true, useDefault: true })
|
|
3065
|
-
], _OdxProgressBar.prototype, "variant", 2);
|
|
3066
|
-
let OdxProgressBar = _OdxProgressBar;
|
|
3067
|
-
|
|
3068
|
-
const styles$s = "@layer base{:host{--_indicator-space: var(--odx-size-12);--_indicator-size: calc(var(--odx-size-150) - var(--_indicator-space) * 2);--_indicator-color-background: var(--odx-color-background-control-rest);--_indicator-color-stroke: var(--odx-color-stroke-control-subtle);--_indicator-stroke-width: var(--odx-border-width-thin);--_label-color-foreground: inherit;display:inline-flex;margin:var(--odx-size-37) var(--odx-size-75);border-radius:var(--odx-border-radius-controls);cursor:pointer;padding:var(--_indicator-space);user-select:none}:host,.indicator,.content{transition:var(--odx-transition-reduced)}.indicator{display:flex;flex-shrink:0;place-content:center;place-items:center;transition-property:background-color,border-color,border-width,box-shadow;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border:var(--odx-border-width-thin) solid var(--_indicator-color-stroke);border-width:var(--_indicator-stroke-width);border-radius:var(--odx-border-radius-circle);border-color:var(--_indicator-color-stroke);background-color:var(--_indicator-color-background);block-size:var(--_indicator-size);inline-size:var(--_indicator-size)}.label{display:inline-block}.content{transition-property:color;margin-block:calc(-1 * var(--_indicator-space));color:var(--_label-color-foreground)}}@layer state{:host(:empty) .content{display:none}:host(:not(:empty)) .indicator{margin-inline-end:var(--odx-size-75)}:host(:hover){--_indicator-color-background: var(--odx-color-background-control-hover);--_indicator-color-stroke: var(--odx-color-stroke-control-hover)}:host(:focus-visible) .indicator{outline-color:var(--odx-color-stroke-focus-outer)}:host([checked]){--_indicator-color-background: var(--odx-color-stroke-control-selected);--_indicator-color-foreground: var(--odx-color-foreground-inverse-static);--_indicator-color-stroke: var(--odx-color-background-control-selected);--_indicator-stroke-width: var(--odx-size-37)}:host([checked]:not(:is([readonly],[disabled])):hover){--_indicator-color-stroke: var(--odx-color-background-control-selected-hover)}:host([disabled]:not([readonly])){--_indicator-color-background: var(--odx-color-background-disabled-rest);--_indicator-color-stroke: var(--odx-color-disabled-stroke);--_label-color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed}:host([readonly]){--_indicator-color-background: var(--odx-color-background-control-readonly);--_indicator-color-stroke: var(--odx-color-stroke-control-readonly);--_label-color-foreground: var(--odx-color-foreground-rest);cursor:default}:host([readonly][checked]){--_indicator-color-background: var(--odx-color-background-control-selected);--_indicator-color-stroke: var(--odx-color-stroke-control-readonly);--_indicator-stroke-width: var(--odx-size-px);.indicator{box-shadow:0 0 0 var(--odx-size-37) var(--odx-color-background-control-rest) inset}}:host([disabled][checked]:not([readonly])){--_indicator-color-background: var(--odx-color-background-disabled-selected);--_indicator-color-stroke: var(--odx-color-background-disabled-selected);--_indicator-stroke-width: var(--odx-size-px);.indicator{box-shadow:0 0 0 var(--odx-size-37) var(--odx-color-foreground-disabled-selected) inset}}}";
|
|
3069
|
-
|
|
3070
|
-
class OdxRadioButton extends CheckboxFormControl {
|
|
3071
|
-
static {
|
|
3072
|
-
customElement("odx-radio-button", styles$s)(OdxRadioButton);
|
|
3073
|
-
}
|
|
3074
|
-
connectedCallback() {
|
|
3075
|
-
super.connectedCallback();
|
|
3076
|
-
this.role = "radio";
|
|
3077
|
-
}
|
|
3078
|
-
render() {
|
|
3079
|
-
return html`
|
|
3080
|
-
<div class="indicator"></div>
|
|
3081
|
-
<div class="content">
|
|
3082
|
-
<div class="label">
|
|
3083
|
-
<slot></slot>
|
|
3084
|
-
</div>
|
|
3085
|
-
<div class="description">
|
|
3086
|
-
<slot name="description"></slot>
|
|
3087
|
-
</div>
|
|
3088
|
-
</div>
|
|
3089
|
-
`;
|
|
3090
|
-
}
|
|
3091
|
-
toggle(state, emitEvent = false) {
|
|
3092
|
-
super.toggle(state ?? true, emitEvent);
|
|
3093
|
-
}
|
|
3094
|
-
}
|
|
3095
|
-
|
|
3096
|
-
const styles$r = ":host{display:flex}:host(:not([layout=\"horizontal\"])){flex-direction:column}:host([layout=\"list\"]){::slotted(odx-radio-button:last-of-type){border-block-end:none}::slotted(odx-radio-button){margin:0;border-block-end:var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);padding:var(--odx-size-75);inline-size:auto}}";
|
|
3097
|
-
|
|
3098
|
-
const RadioGroupLayout = { VERTICAL: "vertical", HORIZONTAL: "horizontal", LIST: "list" };
|
|
3099
|
-
const _OdxRadioGroup = class _OdxRadioGroup extends RadioGroupFormControl {
|
|
3100
|
-
constructor() {
|
|
3101
|
-
super(...arguments);
|
|
3102
|
-
this.layout = RadioGroupLayout.VERTICAL;
|
|
3103
|
-
}
|
|
3104
|
-
static {
|
|
3105
|
-
customElement("odx-radio-group", styles$r)(_OdxRadioGroup);
|
|
3106
|
-
}
|
|
3107
|
-
};
|
|
3108
|
-
__decorateClass([
|
|
3109
|
-
property({ reflect: true, useDefault: true })
|
|
3110
|
-
], _OdxRadioGroup.prototype, "layout", 2);
|
|
3111
|
-
let OdxRadioGroup = _OdxRadioGroup;
|
|
3112
|
-
|
|
3113
|
-
const styles$q = ":host{--min-inline-size: 180px;--max-inline-size: 240px;display:flex;flex-direction:column;gap:var(--odx-size-75);transition:var(--odx-transition-default);transition-property:min-inline-size,max-inline-size;padding-block:var(--odx-size-150);padding-inline:var(--odx-size-50);block-size:100%;min-inline-size:var(--min-inline-size);max-inline-size:var(--max-inline-size)}.toggle-control{margin-block-start:auto}.toggle-icon{transition:var(--odx-transition-default);transition-property:transform}:host([collapsed]:not([collapsed=\"false\"])){--min-inline-size: var(--odx-size-400);--max-inline-size: var(--odx-size-400);.toggle-icon{--rotate: 180deg}}::slotted(odx-spacer){--size: var(--odx-size-300);--gap-offset: var(--odx-size-75)}";
|
|
3114
|
-
|
|
3115
|
-
setTranslation("en", {
|
|
3116
|
-
odx: { railNavigation: { controlText: { collapsed: "Expand navigation", expanded: "Collapse navigation" } } }
|
|
3117
|
-
});
|
|
3118
|
-
setTranslation("de", {
|
|
3119
|
-
/* cspell:disable-next-line */
|
|
3120
|
-
odx: { railNavigation: { controlText: { collapsed: "Navigation ausklappen", expanded: "Navigation einklappen" } } }
|
|
3121
|
-
});
|
|
3122
|
-
const _OdxRailNavigation = class _OdxRailNavigation extends IsLocalized(CustomElement) {
|
|
3123
|
-
constructor() {
|
|
3124
|
-
super(...arguments);
|
|
3125
|
-
this.collapsed = false;
|
|
3126
|
-
this.#handleSlotChange = () => {
|
|
3127
|
-
for (const item of this.navigationItems) {
|
|
3128
|
-
item.size = NavigationItemSize.LG;
|
|
3129
|
-
}
|
|
3130
|
-
};
|
|
3131
|
-
this.#handleControlClick = () => {
|
|
3132
|
-
this.collapsed = !this.collapsed;
|
|
3133
|
-
};
|
|
3134
|
-
}
|
|
3135
|
-
static {
|
|
3136
|
-
customElement("odx-rail-navigation", styles$q)(_OdxRailNavigation);
|
|
3137
|
-
}
|
|
3138
|
-
render() {
|
|
3139
|
-
return html`
|
|
3140
|
-
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
3141
|
-
<odx-navigation-item class="toggle-control" size="lg" @click=${this.#handleControlClick} odxPreventTextOverflow>
|
|
3142
|
-
<odx-icon class="toggle-icon" name="core::chevron-left" slot="prefix"></odx-icon>
|
|
3143
|
-
<odx-visually-hidden>
|
|
3144
|
-
${this.t(`odx.railNavigation.controlText.${this.collapsed ? "collapsed" : "expanded"}`)}
|
|
3145
|
-
</odx-visually-hidden>
|
|
3146
|
-
</odx-navigation-item>
|
|
3147
|
-
`;
|
|
3148
|
-
}
|
|
3149
|
-
getItems() {
|
|
3150
|
-
return this.navigationItems;
|
|
3151
|
-
}
|
|
3152
|
-
#handleSlotChange;
|
|
3153
|
-
#handleControlClick;
|
|
3154
|
-
};
|
|
3155
|
-
__decorateClass([
|
|
3156
|
-
queryAssignedElements({ selector: OdxNavigationItem.tagName, flatten: true })
|
|
3157
|
-
], _OdxRailNavigation.prototype, "navigationItems", 2);
|
|
3158
|
-
__decorateClass([
|
|
3159
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3160
|
-
], _OdxRailNavigation.prototype, "collapsed", 2);
|
|
3161
|
-
let OdxRailNavigation = _OdxRailNavigation;
|
|
3162
|
-
|
|
3163
|
-
class SearchEvent extends CustomEvent {
|
|
3164
|
-
constructor(value, rawValue) {
|
|
3165
|
-
super("search", { detail: { rawValue, value } });
|
|
3166
|
-
}
|
|
3167
|
-
}
|
|
3168
|
-
|
|
3169
|
-
const styles$p = ":host{--odx-search-max-inline-size: 35em;display:block;max-inline-size:var(--odx-search-max-inline-size)}.input{inline-size:100%}";
|
|
3170
|
-
|
|
3171
|
-
const SearchBarBehavior = { INSTANT: "instant", SUBMIT: "submit" };
|
|
3172
|
-
const _OdxSearchBar = class _OdxSearchBar extends CanBeDisabled(CustomElement) {
|
|
3173
|
-
constructor() {
|
|
3174
|
-
super(...arguments);
|
|
3175
|
-
this.#search = this.search.bind(this);
|
|
3176
|
-
this.behavior = SearchBarBehavior.SUBMIT;
|
|
3177
|
-
this.placeholder = "";
|
|
3178
|
-
this.readonly = false;
|
|
3179
|
-
this.#handleSearch = (event) => {
|
|
3180
|
-
event.preventDefault();
|
|
3181
|
-
this.search(this.#inputValue);
|
|
3182
|
-
};
|
|
3183
|
-
this.#handleInput = (event) => {
|
|
3184
|
-
if (this.behavior !== SearchBarBehavior.INSTANT) return;
|
|
3185
|
-
event.preventDefault();
|
|
3186
|
-
this.#search(this.#inputValue);
|
|
3187
|
-
};
|
|
3188
|
-
this.#handleClear = (event) => {
|
|
3189
|
-
forwardEvent(this)(event);
|
|
3190
|
-
if (event.defaultPrevented) return;
|
|
3191
|
-
this.search("");
|
|
3192
|
-
};
|
|
3193
|
-
}
|
|
3194
|
-
static {
|
|
3195
|
-
customElement("odx-search-bar", styles$p)(_OdxSearchBar);
|
|
3196
|
-
}
|
|
3197
|
-
#value;
|
|
3198
|
-
#search;
|
|
3199
|
-
get #inputValue() {
|
|
3200
|
-
return (this.inputElement.value ?? "").replace(/\s\s+/g, " ").trim();
|
|
3201
|
-
}
|
|
3202
|
-
get value() {
|
|
3203
|
-
return this.#value ?? "";
|
|
3204
|
-
}
|
|
3205
|
-
search(value, options) {
|
|
3206
|
-
if (this.#value === value && options?.forceUpdate !== true) return;
|
|
3207
|
-
this.#updateValue(value, options?.updateInput);
|
|
3208
|
-
if (options?.emitEvent === false) return;
|
|
3209
|
-
this.dispatchEvent(new SearchEvent(value, this.inputElement.value));
|
|
3210
|
-
}
|
|
3211
|
-
connectedCallback() {
|
|
3212
|
-
super.connectedCallback();
|
|
3213
|
-
this.role = "presentation";
|
|
3214
|
-
}
|
|
3215
|
-
updated(props) {
|
|
3216
|
-
if (props.has("debounceTime")) {
|
|
3217
|
-
this.#search = typeof this.debounceTime === "number" ? debounce(this.search.bind(this), this.debounceTime) : this.search.bind(this);
|
|
3218
|
-
}
|
|
3219
|
-
}
|
|
3220
|
-
render() {
|
|
3221
|
-
return html`
|
|
3222
|
-
<odx-input
|
|
3223
|
-
clearable
|
|
3224
|
-
class="input"
|
|
3225
|
-
spellcheck="false"
|
|
3226
|
-
autocomplete="off"
|
|
3227
|
-
placeholder=${this.placeholder}
|
|
3228
|
-
type="search"
|
|
3229
|
-
?disabled=${this.disabled}
|
|
3230
|
-
?readonly=${this.readonly}
|
|
3231
|
-
@clear=${this.#handleClear}
|
|
3232
|
-
@input=${this.#handleInput}
|
|
3233
|
-
@search=${this.#handleSearch}
|
|
3234
|
-
>
|
|
3235
|
-
<odx-icon name="core::search" slot="prefix"></odx-icon>
|
|
3236
|
-
</odx-input>
|
|
3237
|
-
`;
|
|
3238
|
-
}
|
|
3239
|
-
#handleSearch;
|
|
3240
|
-
#handleInput;
|
|
3241
|
-
#handleClear;
|
|
3242
|
-
#updateValue(value, updateInput = false) {
|
|
3243
|
-
this.#value = value;
|
|
3244
|
-
if (!updateInput) return;
|
|
3245
|
-
this.inputElement.value = value;
|
|
3246
|
-
}
|
|
3247
|
-
};
|
|
3248
|
-
__decorateClass([
|
|
3249
|
-
query(".input", true)
|
|
3250
|
-
], _OdxSearchBar.prototype, "inputElement", 2);
|
|
3251
|
-
__decorateClass([
|
|
3252
|
-
property()
|
|
3253
|
-
], _OdxSearchBar.prototype, "behavior", 2);
|
|
3254
|
-
__decorateClass([
|
|
3255
|
-
property({ type: Number })
|
|
3256
|
-
], _OdxSearchBar.prototype, "debounceTime", 2);
|
|
3257
|
-
__decorateClass([
|
|
3258
|
-
property()
|
|
3259
|
-
], _OdxSearchBar.prototype, "placeholder", 2);
|
|
3260
|
-
__decorateClass([
|
|
3261
|
-
property({ type: Boolean, useDefault: true })
|
|
3262
|
-
], _OdxSearchBar.prototype, "readonly", 2);
|
|
3263
|
-
let OdxSearchBar = _OdxSearchBar;
|
|
3264
|
-
|
|
3265
|
-
const styles$o = "@layer base{:host{--_color-background: var(--odx-color-background-control-rest);--_color-foreground: var(--odx-color-foreground-rest);--_color-stroke: var(--odx-color-stroke-control-rest);--_control-size: var(--odx-size-225);--_padding-block: var(--odx-size-37);--_padding-inline: var(--odx-size-50);display:block;border-radius:var(--odx-border-radius-controls);cursor:pointer;inline-size:100%;max-inline-size:320px;overflow:hidden;color:var(--_color-foreground)}.base{display:flex;gap:var(--_padding-block);align-items:center;transition:var(--odx-transition-reduced);transition-property:background-color,border-color;border:var(--odx-border-width-thin) solid transparent;border-bottom-color:var(--_color-stroke);background-color:var(--_color-background);padding-inline:var(--_padding-inline);block-size:var(--_control-size);min-width:200px;overflow:hidden;text-align:start;user-select:none;&:focus-visible{outline:var(--odx-focus-ring-outline);outline-color:var(--odx-color-stroke-focus-outer)}}.value{margin-inline-end:auto;font-weight:var(--odx-typography-font-weight-medium)}.indicator{font-size:var(--odx-typography-font-size-6)}[part~=dropdown]{--max-block-size: 320px}odx-chip{--_border-radius: var(--odx-border-radius-controls)}slot[name=placeholder]{color:var(--odx-color-foreground-rest-subtle);font-weight:var(--odx-typography-font-weight-normal)}:host:has(odx-dropdown[open]){--_color-background: var(--odx-color-background-control-hover);--_color-stroke: var(--odx-color-stroke-control-hover)}}@layer state{:host(:hover){--_color-background: var(--odx-color-background-control-hover);--_color-stroke: var(--odx-color-stroke-control-hover)}:host([multiple]):has(odx-chip) .base{padding-inline-start:var(--_padding-block)}:host([disabled]:not([readonly])){--_color-foreground: var(--odx-color-foreground-disabled-rest);--_color-background: var(--odx-color-background-disabled-rest);--_color-stroke: var(--odx-color-stroke-disabled-rest);cursor:not-allowed;slot[name=placeholder]{color:var(---_color-foreground)}}:host([readonly]){--_color-background: var(--odx-color-background-control-readonly);--_color-stroke: var(--odx-color-stroke-control-readonly);cursor:default;odx-chip{--_color-background: var(--odx-color-foreground-disabled-rest)}.indicator{color:var(--odx-color-foreground-rest-subtle)}}}";
|
|
3266
|
-
|
|
3267
|
-
const _OdxSelect = class _OdxSelect extends ListboxFormControl {
|
|
3268
|
-
constructor() {
|
|
3269
|
-
super();
|
|
3270
|
-
this.maxVisibleSelectedOptions = 2;
|
|
3271
|
-
this.#handleSlotChange = () => {
|
|
3272
|
-
super.handleSlotChange();
|
|
3273
|
-
this.updateOptions((option) => {
|
|
3274
|
-
option.type = this.multiple ? "checkbox" : null;
|
|
3275
|
-
});
|
|
3276
|
-
};
|
|
3277
|
-
this.#handleBlur = () => {
|
|
3278
|
-
this.hideDropdown();
|
|
3279
|
-
};
|
|
3280
|
-
this.#handleToggleAll = (event) => {
|
|
3281
|
-
if (this.disabled || this.readonly) return;
|
|
3282
|
-
event.stopPropagation();
|
|
3283
|
-
event.preventDefault();
|
|
3284
|
-
this.value = this.value.length === this.options.length ? [] : this.options.map((option) => option.value);
|
|
3285
|
-
};
|
|
3286
|
-
this.#handleClear = (event) => {
|
|
3287
|
-
event.preventDefault();
|
|
3288
|
-
event.stopPropagation();
|
|
3289
|
-
if (this.emit("clear")) return;
|
|
3290
|
-
this.clear();
|
|
3291
|
-
};
|
|
3292
|
-
this.#handleSelect = () => {
|
|
3293
|
-
if (this.autoSelect || this.multiple) return;
|
|
3294
|
-
this.hideDropdown();
|
|
3295
|
-
};
|
|
3296
|
-
if (!isServer) {
|
|
3297
|
-
this.addEventListener("select", this.#handleSelect);
|
|
3298
|
-
this.addEventListener("blur", this.#handleBlur);
|
|
3299
|
-
}
|
|
3300
|
-
}
|
|
3301
|
-
static {
|
|
3302
|
-
customElement("odx-select", styles$o)(_OdxSelect);
|
|
3303
|
-
}
|
|
3304
|
-
clear() {
|
|
3305
|
-
this.value = this.multiple ? [] : "";
|
|
3306
|
-
}
|
|
3307
|
-
isDropdownOpen() {
|
|
3308
|
-
return this.dropdown.open;
|
|
3309
|
-
}
|
|
3310
|
-
showDropdown() {
|
|
3311
|
-
this.dropdown.showPopover();
|
|
3312
|
-
}
|
|
3313
|
-
hideDropdown() {
|
|
3314
|
-
this.dropdown.hidePopover();
|
|
3315
|
-
}
|
|
3316
|
-
connectedCallback() {
|
|
3317
|
-
super.connectedCallback();
|
|
3318
|
-
this.role = "combobox";
|
|
3319
|
-
}
|
|
3320
|
-
firstUpdated(props) {
|
|
3321
|
-
super.firstUpdated(props);
|
|
3322
|
-
this.dropdown.mountPopover(this.shadowRoot?.querySelector(".base") ?? null);
|
|
3323
|
-
}
|
|
3324
|
-
canSelect(option) {
|
|
3325
|
-
return (this.autoSelect || this.dropdown.open) && super.canSelect(option);
|
|
3326
|
-
}
|
|
3327
|
-
render() {
|
|
3328
|
-
const allSelected = this.value.length === this.options.length;
|
|
3329
|
-
const dropdownDisabled = this.disabled || this.readonly && (!this.multiple || this.selectedOptions.length === 0);
|
|
3330
|
-
return html`
|
|
3331
|
-
<div class="base" tabindex="0" aria-haspopup="listbox">
|
|
3332
|
-
<div class="value" odxPreventTextOverflow>
|
|
3333
|
-
${when(
|
|
3334
|
-
this.selectedOptions.length,
|
|
3335
|
-
() => html`${this.selectedOptions.map((option) => option.label).join(", ")}`,
|
|
3336
|
-
() => when(!(this.disabled || this.readonly), () => html`<slot name="placeholder">${this.placeholder}</slot>`)
|
|
3337
|
-
)}
|
|
3338
|
-
</div>
|
|
3339
|
-
${when(
|
|
3340
|
-
this.#isClearable(),
|
|
3341
|
-
() => html`<odx-icon-button icon="core::cancel" size="sm" tabindex="-1" variant="ghost" @click=${this.#handleClear}></odx-icon-button>`
|
|
3342
|
-
)}
|
|
3343
|
-
<odx-icon class="indicator" name="core::chevron-down"></odx-icon>
|
|
3344
|
-
</div>
|
|
3345
|
-
<odx-dropdown part="dropdown" role="listbox" ?disabled=${dropdownDisabled} match-reference-width>
|
|
3346
|
-
${when(
|
|
3347
|
-
!dropdownDisabled && this.multiple,
|
|
3348
|
-
() => html`
|
|
3349
|
-
<odx-option type="checkbox" @click=${this.#handleToggleAll} ?readonly=${this.readonly} ?selected=${allSelected} aria-hidden="true">Toggle all</odx-option>
|
|
3350
|
-
`
|
|
3351
|
-
)}
|
|
3352
|
-
<slot @slotchange=${this.#handleSlotChange}></slot>
|
|
3353
|
-
</odx-dropdown>
|
|
3354
|
-
`;
|
|
3355
|
-
}
|
|
3356
|
-
updated(props) {
|
|
3357
|
-
super.updated(props);
|
|
3358
|
-
if (props.has("readonly")) {
|
|
3359
|
-
this.updateOptions((option) => {
|
|
3360
|
-
option.readonly = this.readonly;
|
|
3361
|
-
});
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
#isClearable() {
|
|
3365
|
-
return !(this.disabled || this.readonly || this.required) && this.selectedOptions.length > 0;
|
|
3366
|
-
}
|
|
3367
|
-
#handleSlotChange;
|
|
3368
|
-
#handleBlur;
|
|
3369
|
-
#handleToggleAll;
|
|
3370
|
-
#handleClear;
|
|
3371
|
-
#handleSelect;
|
|
3372
|
-
};
|
|
3373
|
-
__decorateClass([
|
|
3374
|
-
queryAssignedElements({ selector: '[role="option"]', flatten: true })
|
|
3375
|
-
], _OdxSelect.prototype, "options", 2);
|
|
3376
|
-
__decorateClass([
|
|
3377
|
-
query(OdxDropdown.tagName, true)
|
|
3378
|
-
], _OdxSelect.prototype, "dropdown", 2);
|
|
3379
|
-
__decorateClass([
|
|
3380
|
-
property({ type: Number })
|
|
3381
|
-
], _OdxSelect.prototype, "maxVisibleSelectedOptions", 2);
|
|
3382
|
-
let OdxSelect = _OdxSelect;
|
|
3383
|
-
|
|
3384
|
-
const styles$n = ":host{--color: var(--odx-color-stroke-neutral-subtle);--size: var(--odx-size-px);--min-size: var(--odx-size-75);--margin-block: var(--odx-size-75);--margin-inline: var(--odx-size-12);display:block;transition:var(--odx-transition-default);transition-property:opacity;margin-block:calc(var(--margin-block) - .5 * var(--size));margin-inline:var(--margin-inline)}.base{display:flex;align-items:center;text-align:center}.base:before,.base:after{display:block;flex:1 1 auto;background-color:var(--color);block-size:var(--size);content:\"\";pointer-events:none}:host(:not(:empty)){:before{margin-inline-end:var(--odx-size-37)}:after{margin-inline-start:var(--odx-size-37)}}:host([vertical]){margin-block:var(--margin-block);margin-inline:calc(var(--margin-inline) - .5 * var(--size));.base{flex-direction:column}:after,:before{block-size:calc(100% - var(--margin-block) * 2);min-block-size:calc(var(--min-size) / 2);inline-size:var(--size)}}:host(:not([vertical])){:after,:before{min-inline-size:calc(var(--min-size) / 2)}}:host([strong]){--color: var(--odx-color-stroke-neutral-strong)}:host([align=\"start\"]){.base:before{flex:0 0 var(--min-size)}}:host([align=\"end\"]){.base:after{flex:0 0 var(--min-size)}}";
|
|
3385
|
-
|
|
3386
|
-
const SeparatorAlign = { START: "start", CENTER: "center", END: "end" };
|
|
3387
|
-
const _OdxSeparator = class _OdxSeparator extends CustomElement {
|
|
3388
|
-
constructor() {
|
|
3389
|
-
super(...arguments);
|
|
3390
|
-
this.align = SeparatorAlign.CENTER;
|
|
3391
|
-
this.strong = false;
|
|
3392
|
-
this.vertical = false;
|
|
3393
|
-
}
|
|
3394
|
-
static {
|
|
3395
|
-
customElement("odx-separator", styles$n)(_OdxSeparator);
|
|
3396
|
-
}
|
|
3397
|
-
connectedCallback() {
|
|
3398
|
-
super.connectedCallback();
|
|
3399
|
-
this.role = "separator";
|
|
3400
|
-
}
|
|
3401
|
-
render() {
|
|
3402
|
-
return html`<div class="base"><slot></slot></div>`;
|
|
3403
|
-
}
|
|
3404
|
-
};
|
|
3405
|
-
__decorateClass([
|
|
3406
|
-
property({ reflect: true, useDefault: true })
|
|
3407
|
-
], _OdxSeparator.prototype, "align", 2);
|
|
3408
|
-
__decorateClass([
|
|
3409
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3410
|
-
], _OdxSeparator.prototype, "strong", 2);
|
|
3411
|
-
__decorateClass([
|
|
3412
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3413
|
-
], _OdxSeparator.prototype, "vertical", 2);
|
|
3414
|
-
let OdxSeparator = _OdxSeparator;
|
|
3415
|
-
|
|
3416
|
-
const styles$m = ":host{--inline-size: 100%;--_block-size: var(--odx-size-100);--_border-radius: var(--odx-border-radius-controls);--_color-fill: var(--odx-color-background-disabled-rest);display:block;block-size:var(--_block-size);inline-size:var(--inline-size);max-inline-size:100%;overflow:hidden}.base{border-radius:var(--_border-radius);background:var(--_color-fill) linear-gradient(90deg,transparent 33%,var(--odx-color-background-transparent-pressed) 50%,transparent 66%);background-position:150% 100%;background-size:200% 100%;block-size:100%;animation:odx-skeleton-loading 3s infinite linear}@keyframes odx-skeleton-loading{0%{background-position:150% 100%}33%,to{background-position:-50% 100%}}:host([size=\"sm\"]){--_block-size: var(--odx-typography-font-size-1)}:host([size=\"lg\"]){--_block-size: var(--odx-typography-font-size-5)}:host([size=\"xl\"]){--_block-size: var(--odx-typography-font-size-7)}:host([shape=\"button\"]){--inline-size: 6rem;--_block-size: var(--odx-size-225)}:host([shape=\"button\"][size=\"sm\"]){--inline-size: 5rem;--_block-size: var(--odx-size-150)}:host([shape=\"button\"]:is([size=\"lg\"],[size=\"xl\"])){--inline-size: 7rem;--_block-size: var(--odx-size-300)}:host([shape=\"circle\"]){--_border-radius: var(--odx-border-radius-circle)}:host([shape=\"rectangle\"]){--_border-radius: var(--odx-border-radius-md)}:host(:is([shape=\"circle\"],[shape=\"rectangle\"])){--inline-size: var(--_block-size);--_block-size: var(--odx-size-150);flex:0 0 auto}:host(:is([shape=\"circle\"],[shape=\"rectangle\"])[size=\"sm\"]){--_block-size: var(--odx-size-125)}:host(:is([shape=\"circle\"],[shape=\"rectangle\"])[size=\"lg\"]){--_block-size: var(--odx-size-225)}:host(:is([shape=\"circle\"],[shape=\"rectangle\"])[size=\"xl\"]){--_block-size: var(--odx-size-300)}:host([strong]){--_color-fill: var(--odx-color-background-disabled-selected)}:host([subtle]) .base{animation:none}";
|
|
3417
|
-
|
|
3418
|
-
const SkeletonSize = pick(Size, ["SM", "MD", "LG", "XL"]);
|
|
3419
|
-
const SkeletonShape = { NONE: "none", BUTTON: "button", ...pick(Shape, ["CIRCLE", "RECTANGLE"]) };
|
|
3420
|
-
const _OdxSkeleton = class _OdxSkeleton extends CustomElement {
|
|
3421
|
-
constructor() {
|
|
3422
|
-
super(...arguments);
|
|
3423
|
-
this.strong = false;
|
|
3424
|
-
this.subtle = false;
|
|
3425
|
-
this.shape = SkeletonShape.NONE;
|
|
3426
|
-
this.size = SkeletonSize.MD;
|
|
3427
|
-
}
|
|
3428
|
-
static {
|
|
3429
|
-
customElement("odx-skeleton", styles$m)(_OdxSkeleton);
|
|
3430
|
-
}
|
|
3431
|
-
render() {
|
|
3432
|
-
return html`<div class="base"></div>`;
|
|
3433
|
-
}
|
|
3434
|
-
};
|
|
3435
|
-
__decorateClass([
|
|
3436
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3437
|
-
], _OdxSkeleton.prototype, "strong", 2);
|
|
3438
|
-
__decorateClass([
|
|
3439
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3440
|
-
], _OdxSkeleton.prototype, "subtle", 2);
|
|
3441
|
-
__decorateClass([
|
|
3442
|
-
property({ type: String, reflect: true, useDefault: true })
|
|
3443
|
-
], _OdxSkeleton.prototype, "shape", 2);
|
|
3444
|
-
__decorateClass([
|
|
3445
|
-
property({ type: String, reflect: true, useDefault: true })
|
|
3446
|
-
], _OdxSkeleton.prototype, "size", 2);
|
|
3447
|
-
let OdxSkeleton = _OdxSkeleton;
|
|
3448
|
-
|
|
3449
|
-
const SliderLabelVisibility = { AUTO: "auto", HIDDEN: "hidden" };
|
|
3450
|
-
const SliderTrackVisibility = { AUTO: "auto", HIDDEN: "hidden", VISIBLE: "visible" };
|
|
3451
|
-
const sliderContext = {
|
|
3452
|
-
context: n("odx-slider::context"),
|
|
3453
|
-
defaultValue: { step: 1, min: 0, max: 100, minRange: 0, maxRange: 0, range: 100, labelVisibility: SliderLabelVisibility.AUTO, unit: "" }
|
|
3454
|
-
};
|
|
3455
|
-
|
|
3456
|
-
const styles$l = ":host{--_track-size: var(--odx-size-25);--_track-color: var(--odx-slider-track-color, var(--odx-color-background-primary-rest));--_layer-background: 0;--_layer-interactive-disabled: 1;--_layer-interactive: 2;--_layer-foreground: 3;display:flex;flex-direction:column;place-content:center;cursor:pointer;padding-block:var(--odx-size-75) var(--odx-size-50);padding-inline:var(--odx-size-75);min-block-size:var(--odx-size-300);min-inline-size:120px}:host(:active){cursor:grabbing}:host::part(container){position:relative;border-radius:var(--odx-border-radius-sm);background-color:var(--odx-color-background-control-rest);block-size:var(--_track-size)}";
|
|
3457
|
-
|
|
3458
|
-
const styles$k = "*{box-sizing:border-box;margin:0;padding:0}:host{--_thumb-color: var(--_track-color);--_thumb-size: var(--odx-size-150);--_previous-position: 0%;--_position: 0%;--_next-position: 0%;display:contents}:host::part(track),:host::part(thumb),:host::part(label){position:absolute}:host::part(track),:host::part(label){pointer-events:none}:host::part(thumb),:host::part(label){inset-inline-start:var(--_position)}:host::part(track){inset:0 calc(100% - var(--_position)) 0 var(--_previous-position);z-index:var(--_layer-background);border-radius:var(--_track-size);background-color:var(--_track-color)}:host::part(thumb){display:flex;inset-block-start:50%;place-content:center;place-items:center;transform:translate(-50%,-50%);z-index:var(--_layer-interactive);outline:0 solid var(--odx-color-background-transparent-selected);border-radius:var(--odx-border-radius-circle);box-shadow:var(--odx-shadow-level-0);background-color:var(--_thumb-color);cursor:grab;block-size:var(--_thumb-size);inline-size:var(--_thumb-size)}:host::part(label){inset-block-end:100%;transform:translate(-50%) translateY(calc(-1 * var(--odx-size-75))) scale(0);opacity:0;z-index:var(--_layer-foreground);border-radius:var(--odx-border-radius-sm);background-color:var(--odx-color-background-primary-rest);padding-inline:var(--odx-size-50);line-height:var(--odx-size-150);color:var(--odx-color-foreground-inverse-static)}:host::part(with-motion){transition:var(--odx-transition-reduced)}:host([odx-drag-active])::part(with-motion){transition-property:outline}:host::part(thumb):active,:host(:active)::part(thumb){outline-width:var(--odx-size-50)}:host(:hover),:host(:focus-within){--_thumb-color: var(--odx-color-background-accent-rest)}:host(:focus-within)::part(label),:host(:hover)::part(label){transform:translate(-50%) translateY(calc(-1 * var(--odx-size-75))) scale(1);opacity:1}:host([disabled]){pointer-events:none}:host([disabled])::part(thumb){--_thumb-color: var(--odx-color-background-disabled);z-index:var(--_layer-interactive-disabled)}";
|
|
3459
|
-
|
|
3460
|
-
const _OdxSliderHandle = class _OdxSliderHandle extends IsDraggable(NumberFormControl) {
|
|
3461
|
-
constructor() {
|
|
3462
|
-
super(...arguments);
|
|
3463
|
-
this.context = sliderContext.defaultValue;
|
|
3464
|
-
this.#previousHandle = null;
|
|
3465
|
-
this.#nextHandle = null;
|
|
3466
|
-
}
|
|
3467
|
-
static {
|
|
3468
|
-
customElement("odx-slider-handle", styles$k)(_OdxSliderHandle);
|
|
3469
|
-
}
|
|
3470
|
-
#previousHandle;
|
|
3471
|
-
#nextHandle;
|
|
3472
|
-
get minRange() {
|
|
3473
|
-
return Math.ceil(this.context.minRange / this.context.step) * this.context.step;
|
|
3474
|
-
}
|
|
3475
|
-
connectedCallback() {
|
|
3476
|
-
super.connectedCallback();
|
|
3477
|
-
this.role = "slider";
|
|
3478
|
-
this.slot = "thumbs";
|
|
3479
|
-
this.tabIndex = 0;
|
|
3480
|
-
}
|
|
3481
|
-
beforeDragStart(event) {
|
|
3482
|
-
super.beforeDragStart?.(event);
|
|
3483
|
-
this.#nextHandle?.toggleAttribute(IS_DRAG_ACTIVE_ATTRIBUTE, true);
|
|
3484
|
-
this.value = this.#findClosestValue(this.#getValueFromPosition(event.position));
|
|
3485
|
-
this.focus();
|
|
3486
|
-
}
|
|
3487
|
-
dragStart(event) {
|
|
3488
|
-
super.dragStart?.(event);
|
|
3489
|
-
this.#updatePosition(this.#getValueFromPosition(event.position));
|
|
3490
|
-
}
|
|
3491
|
-
dragMove(event) {
|
|
3492
|
-
super.dragMove?.(event);
|
|
3493
|
-
const value = this.#getValueFromPosition(event.position);
|
|
3494
|
-
const closestValue = this.#findClosestValue(value);
|
|
3495
|
-
if (this.value !== closestValue) {
|
|
3496
|
-
this.value = closestValue;
|
|
3497
|
-
}
|
|
3498
|
-
this.#updatePosition(value);
|
|
3499
|
-
}
|
|
3500
|
-
afterDragEnd(event) {
|
|
3501
|
-
super.afterDragEnd?.(event);
|
|
3502
|
-
this.#nextHandle?.toggleAttribute(IS_DRAG_ACTIVE_ATTRIBUTE, false);
|
|
3503
|
-
this.#updatePosition(this.#findClosestValue(this.value));
|
|
3504
|
-
}
|
|
3505
|
-
getDistance(containerElement, event) {
|
|
3506
|
-
const rect = containerElement.getBoundingClientRect();
|
|
3507
|
-
const relativePosition = round((event.x - rect.x) / rect.width) * 100;
|
|
3508
|
-
return Math.abs(this.value - this.#calculateValue(relativePosition));
|
|
3509
|
-
}
|
|
3510
|
-
getValueText() {
|
|
3511
|
-
return this.context.unit ? `${this.value}${this.context.unit}` : super.getValueText();
|
|
3512
|
-
}
|
|
3513
|
-
willUpdate(props) {
|
|
3514
|
-
super.willUpdate(props);
|
|
3515
|
-
if (props.has("value")) {
|
|
3516
|
-
this.value = this.#limitValue(this.value);
|
|
3517
|
-
this.ariaValueNow = String(this.value);
|
|
3518
|
-
}
|
|
3519
|
-
if (props.has("disabled")) {
|
|
3520
|
-
this.dragDisabled = this.disabled;
|
|
3521
|
-
}
|
|
3522
|
-
}
|
|
3523
|
-
updated(props) {
|
|
3524
|
-
super.updated(props);
|
|
3525
|
-
if (this.isDragActive) return;
|
|
3526
|
-
this.#previousHandle = this.#findPreviousHandle();
|
|
3527
|
-
this.#nextHandle = this.#findNextHandle();
|
|
3528
|
-
this.#updatePosition(this.#findClosestValue(this.value));
|
|
3529
|
-
}
|
|
3530
|
-
render() {
|
|
3531
|
-
const label = this.getValueText() || this.value;
|
|
3532
|
-
return html`
|
|
3533
|
-
${when(this.#isTrackVisible(), () => html`<div part="track with-motion"></div>`)}
|
|
3534
|
-
<div part="thumb with-motion" tabindex="0"></div>
|
|
3535
|
-
${when(this.#isLabelVisible(), () => html`<odx-text part="label with-motion" size="sm">${label}</odx-text>`)}
|
|
3536
|
-
`;
|
|
3537
|
-
}
|
|
3538
|
-
#isLabelVisible() {
|
|
3539
|
-
return this.context.labelVisibility !== SliderLabelVisibility.HIDDEN;
|
|
3540
|
-
}
|
|
3541
|
-
#isTrackVisible() {
|
|
3542
|
-
if (this.trackVisibility === SliderTrackVisibility.VISIBLE) {
|
|
3543
|
-
return true;
|
|
3544
|
-
}
|
|
3545
|
-
if (this.trackVisibility === SliderTrackVisibility.HIDDEN) {
|
|
3546
|
-
return false;
|
|
3547
|
-
}
|
|
3548
|
-
return !!this.#previousHandle || !(this.#previousHandle || this.#nextHandle);
|
|
3549
|
-
}
|
|
3550
|
-
#findClosestValue(value) {
|
|
3551
|
-
const closestValue = value - value % this.context.step;
|
|
3552
|
-
const isNextValue = value - closestValue > this.context.step / 2;
|
|
3553
|
-
return this.#limitValue(closestValue + (isNextValue ? this.context.step : 0));
|
|
3554
|
-
}
|
|
3555
|
-
#updatePosition(value) {
|
|
3556
|
-
const valuePercentage = `${round(Math.min(Math.max(0, (value - this.context.min) / this.context.range), 1) * 100, 3)}%`;
|
|
3557
|
-
this.style.setProperty("--_position", valuePercentage);
|
|
3558
|
-
this.#nextHandle?.style.setProperty("--_previous-position", valuePercentage);
|
|
3559
|
-
this.#previousHandle?.style.setProperty("--_next-position", valuePercentage);
|
|
3560
|
-
}
|
|
3561
|
-
#getValueFromPosition(position) {
|
|
3562
|
-
return this.#limitValue(this.#calculateValue(position.x));
|
|
3563
|
-
}
|
|
3564
|
-
#calculateValue(relativePosition) {
|
|
3565
|
-
return Math.min(Math.max(0, relativePosition / 100), 1) * this.context.range + this.context.min;
|
|
3566
|
-
}
|
|
3567
|
-
#limitValue(value) {
|
|
3568
|
-
const startLimit = this.#previousHandle ? Math.max(this.#previousHandle.value, this.min - this.minRange) + this.minRange : this.min;
|
|
3569
|
-
const endLimit = this.#nextHandle ? Math.min(this.#nextHandle.value, this.max + this.minRange) - this.minRange : this.max;
|
|
3570
|
-
return Math.min(Math.max(startLimit, value), endLimit);
|
|
3571
|
-
}
|
|
3572
|
-
#findPreviousHandle() {
|
|
3573
|
-
let sibling = this.previousElementSibling;
|
|
3574
|
-
while (sibling) {
|
|
3575
|
-
if (sibling instanceof _OdxSliderHandle) return sibling;
|
|
3576
|
-
sibling = sibling.previousElementSibling;
|
|
3577
|
-
}
|
|
3578
|
-
return null;
|
|
3579
|
-
}
|
|
3580
|
-
#findNextHandle() {
|
|
3581
|
-
let sibling = this.nextElementSibling;
|
|
3582
|
-
while (sibling) {
|
|
3583
|
-
if (sibling instanceof _OdxSliderHandle) return sibling;
|
|
3584
|
-
sibling = sibling.nextElementSibling;
|
|
3585
|
-
}
|
|
3586
|
-
return null;
|
|
3587
|
-
}
|
|
3588
|
-
};
|
|
3589
|
-
__decorateClass([
|
|
3590
|
-
c({ context: sliderContext.context, subscribe: true })
|
|
3591
|
-
], _OdxSliderHandle.prototype, "context", 2);
|
|
3592
|
-
__decorateClass([
|
|
3593
|
-
property()
|
|
3594
|
-
], _OdxSliderHandle.prototype, "trackVisibility", 2);
|
|
3595
|
-
let OdxSliderHandle = _OdxSliderHandle;
|
|
3596
|
-
|
|
3597
|
-
const _OdxSlider = class _OdxSlider extends CustomElement {
|
|
3598
|
-
constructor() {
|
|
3599
|
-
super();
|
|
3600
|
-
this.dragController = new DragController(this, {
|
|
3601
|
-
getDraggableElements: () => Array.from(this.querySelectorAll(OdxSliderHandle.tagName)),
|
|
3602
|
-
getContainer: () => this.container
|
|
3603
|
-
});
|
|
3604
|
-
this.context = sliderContext.defaultValue;
|
|
3605
|
-
this.#handleKeyboardEvent = (event) => {
|
|
3606
|
-
const key = getKeyInfo(event);
|
|
3607
|
-
const target = event.target;
|
|
3608
|
-
if (target.localName !== OdxSliderHandle.tagName || key.tab || key.backTab || target.disabled) return;
|
|
3609
|
-
event.preventDefault();
|
|
3610
|
-
event.stopPropagation();
|
|
3611
|
-
if (key.left || key.down) {
|
|
3612
|
-
target.value -= this.step;
|
|
3613
|
-
} else if (key.right || key.up) {
|
|
3614
|
-
target.value += this.step;
|
|
3615
|
-
} else if (key.start) {
|
|
3616
|
-
target.value = this.context.min;
|
|
3617
|
-
} else if (key.end) {
|
|
3618
|
-
target.value = this.context.max;
|
|
3619
|
-
}
|
|
3620
|
-
};
|
|
3621
|
-
this.#handleSlotChange = () => {
|
|
3622
|
-
const elements = this.dragController.draggableElements;
|
|
3623
|
-
const min = elements.reduce((min2, element) => Math.min(min2, element.min), Number.POSITIVE_INFINITY);
|
|
3624
|
-
const max = elements.reduce((max2, element) => Math.max(max2, element.max ?? 0), Number.NEGATIVE_INFINITY);
|
|
3625
|
-
this.context = { ...this.context, min, max, range: Math.abs(max - min) };
|
|
3626
|
-
};
|
|
3627
|
-
if (!isServer) {
|
|
3628
|
-
this.addEventListener("keydown", this.#handleKeyboardEvent);
|
|
3629
|
-
}
|
|
3630
|
-
}
|
|
3631
|
-
static {
|
|
3632
|
-
customElement("odx-slider", styles$l)(_OdxSlider);
|
|
3633
|
-
}
|
|
3634
|
-
set step(value) {
|
|
3635
|
-
this.context = { ...this.context, step: Math.max(1, value) };
|
|
3636
|
-
}
|
|
3637
|
-
get step() {
|
|
3638
|
-
return this.context.step;
|
|
3639
|
-
}
|
|
3640
|
-
set minRange(value) {
|
|
3641
|
-
this.context = { ...this.context, minRange: Math.max(0, value) };
|
|
3642
|
-
}
|
|
3643
|
-
get minRange() {
|
|
3644
|
-
return this.context.minRange;
|
|
3645
|
-
}
|
|
3646
|
-
set labelVisibility(value) {
|
|
3647
|
-
this.context = { ...this.context, labelVisibility: value };
|
|
3648
|
-
}
|
|
3649
|
-
get labelVisibility() {
|
|
3650
|
-
return this.context.labelVisibility;
|
|
3651
|
-
}
|
|
3652
|
-
set unit(value) {
|
|
3653
|
-
this.context = { ...this.context, unit: value.trim() };
|
|
3654
|
-
}
|
|
3655
|
-
get unit() {
|
|
3656
|
-
return this.context.unit;
|
|
3657
|
-
}
|
|
3658
|
-
render() {
|
|
3659
|
-
return html`
|
|
3660
|
-
<div part="container" role="presentation">
|
|
3661
|
-
<slot name="thumbs" @slotchange=${this.#handleSlotChange}></slot>
|
|
3662
|
-
<slot name="marks"></slot>
|
|
3663
|
-
</div>
|
|
3664
|
-
`;
|
|
3665
|
-
}
|
|
3666
|
-
#handleKeyboardEvent;
|
|
3667
|
-
#handleSlotChange;
|
|
3668
|
-
};
|
|
3669
|
-
__decorateClass([
|
|
3670
|
-
e$1({ context: sliderContext.context })
|
|
3671
|
-
], _OdxSlider.prototype, "context", 2);
|
|
3672
|
-
__decorateClass([
|
|
3673
|
-
query('[part="container"]', true)
|
|
3674
|
-
], _OdxSlider.prototype, "container", 2);
|
|
3675
|
-
__decorateClass([
|
|
3676
|
-
property({ type: Number })
|
|
3677
|
-
], _OdxSlider.prototype, "step", 1);
|
|
3678
|
-
__decorateClass([
|
|
3679
|
-
property({ type: Number })
|
|
3680
|
-
], _OdxSlider.prototype, "minRange", 1);
|
|
3681
|
-
__decorateClass([
|
|
3682
|
-
property()
|
|
3683
|
-
], _OdxSlider.prototype, "labelVisibility", 1);
|
|
3684
|
-
__decorateClass([
|
|
3685
|
-
property()
|
|
3686
|
-
], _OdxSlider.prototype, "unit", 1);
|
|
3687
|
-
let OdxSlider = _OdxSlider;
|
|
3688
|
-
|
|
3689
|
-
const styles$j = ":host{--_mark-color: var(--odx-slider-mark-color, var(--odx-color-background-brand));--_mark-tick-block-size: var(--odx-size-37);--_mark-tick-inline-size: var(--odx-size-12);display:flex;position:absolute;inset:0;flex-direction:row;align-items:center;z-index:0;pointer-events:none}[part~=mark]{position:relative;flex:1 0 auto}[part~=mark][last]{flex:0 0 0}[part~=mark-tick]{display:block;inset-inline-end:0;transform:translate(calc(-.5 * var(--_mark-tick-inline-size)));background-color:var(--_mark-color);width:2px;height:var(--_mark-tick-block-size)}[part~=mark][last] [part~=mark-tick]{transform:none}[part~=mark-label]{position:absolute;inset-block-start:0;transform:translate(-50%) translateY(var(--odx-size-100));text-align:center;line-height:inherit}[part~=mark]:not(:last-of-type){border-inline-end-color:var(--_mark-color)}[part~=mark][active]:not([active=false]){border-inline-end-color:red}";
|
|
3690
|
-
|
|
3691
|
-
const _OdxSliderMarks = class _OdxSliderMarks extends CustomElement {
|
|
3692
|
-
constructor() {
|
|
3693
|
-
super(...arguments);
|
|
3694
|
-
this.context = sliderContext.defaultValue;
|
|
3695
|
-
this.showLabels = false;
|
|
3696
|
-
}
|
|
3697
|
-
static {
|
|
3698
|
-
customElement("odx-slider-marks", styles$j)(_OdxSliderMarks);
|
|
3699
|
-
}
|
|
3700
|
-
connectedCallback() {
|
|
3701
|
-
super.connectedCallback();
|
|
3702
|
-
this.slot = "marks";
|
|
3703
|
-
}
|
|
3704
|
-
render() {
|
|
3705
|
-
const step = this.step ?? this.context.step;
|
|
3706
|
-
const markCount = Math.floor(this.context.range / step);
|
|
3707
|
-
const marks = new Array(markCount).fill(null).map((_, index) => step * index + this.context.min);
|
|
3708
|
-
return html`
|
|
3709
|
-
${marks.map((value) => this.renderMark(value))}
|
|
3710
|
-
${this.renderMark(this.context.max, true)}
|
|
3711
|
-
`;
|
|
3712
|
-
}
|
|
3713
|
-
renderMark(value, last = false) {
|
|
3714
|
-
const label = this.showLabels ? html`<odx-text part="mark-label" size="xs" strong>${value}</odx-text>` : nothing;
|
|
3715
|
-
return html`
|
|
3716
|
-
<div part="mark" ?last=${last}>
|
|
3717
|
-
<span part="mark-tick"></span>
|
|
3718
|
-
${label}
|
|
3719
|
-
</div>
|
|
3720
|
-
`;
|
|
3721
|
-
}
|
|
3722
|
-
};
|
|
3723
|
-
__decorateClass([
|
|
3724
|
-
c({ context: sliderContext.context, subscribe: true })
|
|
3725
|
-
], _OdxSliderMarks.prototype, "context", 2);
|
|
3726
|
-
__decorateClass([
|
|
3727
|
-
property({ type: Number })
|
|
3728
|
-
], _OdxSliderMarks.prototype, "step", 2);
|
|
3729
|
-
__decorateClass([
|
|
3730
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3731
|
-
], _OdxSliderMarks.prototype, "showLabels", 2);
|
|
3732
|
-
let OdxSliderMarks = _OdxSliderMarks;
|
|
3733
|
-
|
|
3734
|
-
const styles$i = ":host{--gap-offset: 0;--size: 0;display:block;margin:calc(-1 * var(--gap-offset)) 0;block-size:var(--size);inline-size:100%}:host([dynamic]){flex:1 1 auto;block-size:100%;max-block-size:var(--size)}:host([horizontal]){margin:0 calc(-1 * var(--gap-offset));block-size:100%;inline-size:var(--size)}:host([dynamic][horizontal]){inline-size:100%;max-inline-size:var(--size)}:host([fill]){flex:1 1 var(--size);min-block-size:var(--size)}:host([fill][horizontal]){flex:1 1 var(--size);min-inline-size:var(--size)}:host([fill][dynamic]){flex:1 1 auto;min-block-size:auto;max-block-size:100%;min-inline-size:auto}";
|
|
3735
|
-
|
|
3736
|
-
const _OdxSpacer = class _OdxSpacer extends CustomElement {
|
|
3737
|
-
constructor() {
|
|
3738
|
-
super(...arguments);
|
|
3739
|
-
this.horizontal = false;
|
|
3740
|
-
this.dynamic = false;
|
|
3741
|
-
this.fill = false;
|
|
3742
|
-
}
|
|
3743
|
-
static {
|
|
3744
|
-
customElement("odx-spacer", styles$i)(_OdxSpacer);
|
|
3745
|
-
}
|
|
3746
|
-
render() {
|
|
3747
|
-
return "";
|
|
3748
|
-
}
|
|
3749
|
-
};
|
|
3750
|
-
__decorateClass([
|
|
3751
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3752
|
-
], _OdxSpacer.prototype, "horizontal", 2);
|
|
3753
|
-
__decorateClass([
|
|
3754
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3755
|
-
], _OdxSpacer.prototype, "dynamic", 2);
|
|
3756
|
-
__decorateClass([
|
|
3757
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3758
|
-
], _OdxSpacer.prototype, "fill", 2);
|
|
3759
|
-
let OdxSpacer = _OdxSpacer;
|
|
3760
|
-
|
|
3761
|
-
const styles$h = ":host{display:inline-flex;gap:var(--odx-size-37);align-items:center;outline:var(--odx-focus-ring-outline);border-radius:var(--odx-border-radius-controls);block-size:var(--odx-size-225);min-inline-size:20ch}:host(:focus-visible){outline-color:var(--odx-color-stroke-focus-outer)}::slotted(odx-option){flex:1 1 auto;justify-content:center}::slotted(odx-option[hidden]){display:none}";
|
|
3762
|
-
|
|
3763
|
-
const _OdxSpinbox = class _OdxSpinbox extends FormControl {
|
|
3764
|
-
constructor() {
|
|
3765
|
-
super();
|
|
3766
|
-
this.selectedIndex = 0;
|
|
3767
|
-
this.value = "";
|
|
3768
|
-
this.#handleKeyDown = (event) => {
|
|
3769
|
-
if (this.disabled || this.readonly || event.composedPath()[0] !== this) return;
|
|
3770
|
-
const key = getKeyInfo(event);
|
|
3771
|
-
if (key.left) {
|
|
3772
|
-
this.previous();
|
|
3773
|
-
} else if (key.right) {
|
|
3774
|
-
this.next();
|
|
3775
|
-
} else if (key.start) {
|
|
3776
|
-
this.selectedIndex = 0;
|
|
3777
|
-
} else if (key.end) {
|
|
3778
|
-
this.selectedIndex = this.options.length - 1;
|
|
3779
|
-
}
|
|
3780
|
-
};
|
|
3781
|
-
if (!isServer) {
|
|
3782
|
-
this.addEventListener("keydown", this.#handleKeyDown);
|
|
3783
|
-
}
|
|
3784
|
-
}
|
|
3785
|
-
static {
|
|
3786
|
-
customElement("odx-spinbox", styles$h)(_OdxSpinbox);
|
|
3787
|
-
}
|
|
3788
|
-
static {
|
|
3789
|
-
this.shadowRootOptions = {
|
|
3790
|
-
...FormControl.shadowRootOptions,
|
|
3791
|
-
delegatesFocus: false
|
|
3792
|
-
};
|
|
3793
|
-
}
|
|
3794
|
-
clear() {
|
|
3795
|
-
this.value = "";
|
|
3796
|
-
}
|
|
3797
|
-
willUpdate(props) {
|
|
3798
|
-
super.willUpdate(props);
|
|
3799
|
-
if (props.has("selectedIndex")) {
|
|
3800
|
-
const option = this.options[this.selectedIndex];
|
|
3801
|
-
if (option) {
|
|
3802
|
-
this.value = option.value;
|
|
3803
|
-
this.emit("change", { detail: { index: this.selectedIndex, option } });
|
|
3804
|
-
}
|
|
3805
|
-
}
|
|
3806
|
-
}
|
|
3807
|
-
updated(props) {
|
|
3808
|
-
super.updated(props);
|
|
3809
|
-
if (props.has("disabled") || props.has("selectedIndex")) {
|
|
3810
|
-
this.options.forEach((option, index) => {
|
|
3811
|
-
option.toggleAttribute("hidden", this.selectedIndex !== index);
|
|
3812
|
-
option.disabled = this.disabled;
|
|
3813
|
-
});
|
|
3814
|
-
}
|
|
3815
|
-
}
|
|
3816
|
-
previous() {
|
|
3817
|
-
if (this.disabled || this.readonly) return;
|
|
3818
|
-
this.selectedIndex = (this.selectedIndex - 1 + this.options.length) % this.options.length;
|
|
3819
|
-
}
|
|
3820
|
-
next() {
|
|
3821
|
-
if (this.disabled || this.readonly) return;
|
|
3822
|
-
this.selectedIndex = (this.selectedIndex + 1) % this.options.length;
|
|
3823
|
-
}
|
|
3824
|
-
connectedCallback() {
|
|
3825
|
-
super.connectedCallback();
|
|
3826
|
-
this.tabIndex = 0;
|
|
3827
|
-
}
|
|
3828
|
-
render() {
|
|
3829
|
-
return html`
|
|
3830
|
-
<odx-icon-button icon="core::chevron-left" variant="ghost" ?disabled=${this.disabled} @click=${() => this.previous()}></odx-icon-button>
|
|
3831
|
-
<slot></slot>
|
|
3832
|
-
<odx-icon-button icon="core::chevron-right" variant="ghost" ?disabled=${this.disabled} @click=${() => this.next()}></odx-icon-button>
|
|
3833
|
-
`;
|
|
3834
|
-
}
|
|
3835
|
-
#handleKeyDown;
|
|
3836
|
-
};
|
|
3837
|
-
__decorateClass([
|
|
3838
|
-
queryAssignedElements({ selector: '[role="option"]', flatten: true })
|
|
3839
|
-
], _OdxSpinbox.prototype, "options", 2);
|
|
3840
|
-
__decorateClass([
|
|
3841
|
-
property({ type: Number, attribute: "selected-index" })
|
|
3842
|
-
], _OdxSpinbox.prototype, "selectedIndex", 2);
|
|
3843
|
-
__decorateClass([
|
|
3844
|
-
property()
|
|
3845
|
-
], _OdxSpinbox.prototype, "value", 2);
|
|
3846
|
-
let OdxSpinbox = _OdxSpinbox;
|
|
3847
|
-
|
|
3848
|
-
const styles$g = ":host{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;max-inline-size:100%;text-align:start}:host([horizontal]){flex-direction:row}:host([wrap]){flex-wrap:wrap}:host,:host([gap=\"md\"]){gap:var(--odx-spacing-75)}:host([gap=\"none\"]){gap:0}:host([gap=\"xs\"]){gap:var(--odx-spacing-25)}:host([gap=\"sm\"]){gap:var(--odx-spacing-50)}:host([gap=\"lg\"]){gap:var(--odx-spacing-150)}:host([gap=\"xl\"]){gap:var(--odx-size-225)}:host([align=\"start\"]){align-items:flex-start}:host([align=\"center\"]){align-items:center}:host([align=\"end\"]){align-items:end}:host([justify=\"start\"]){justify-content:flex-start}:host([justify=\"end\"]){justify-content:flex-end}:host([justify=\"center\"]){justify-content:center}:host([justify=\"space-between\"]){justify-content:space-between}:host([justify=\"space-around\"]){justify-content:space-around}:host([justify=\"space-evenly\"]){justify-content:space-evenly}";
|
|
3849
|
-
|
|
3850
|
-
const StackAlign = {
|
|
3851
|
-
START: "start",
|
|
3852
|
-
CENTER: "center",
|
|
3853
|
-
END: "end"
|
|
3854
|
-
};
|
|
3855
|
-
const StackGap = {
|
|
3856
|
-
NONE: "none",
|
|
3857
|
-
...pick(Size, ["XS", "SM", "MD", "LG", "XL"])
|
|
3858
|
-
};
|
|
3859
|
-
const StackJustify = {
|
|
3860
|
-
START: "start",
|
|
3861
|
-
END: "end",
|
|
3862
|
-
CENTER: "center",
|
|
3863
|
-
SPACE_BETWEEN: "space-between",
|
|
3864
|
-
SPACE_AROUND: "space-around",
|
|
3865
|
-
SPACE_EVENLY: "space-evenly"
|
|
3866
|
-
};
|
|
3867
|
-
const _OdxStack = class _OdxStack extends CustomElement {
|
|
3868
|
-
constructor() {
|
|
3869
|
-
super(...arguments);
|
|
3870
|
-
this.horizontal = false;
|
|
3871
|
-
this.wrap = false;
|
|
3872
|
-
}
|
|
3873
|
-
static {
|
|
3874
|
-
customElement("odx-stack", styles$g)(_OdxStack);
|
|
3875
|
-
}
|
|
3876
|
-
};
|
|
3877
|
-
__decorateClass([
|
|
3878
|
-
property({ reflect: true })
|
|
3879
|
-
], _OdxStack.prototype, "align", 2);
|
|
3880
|
-
__decorateClass([
|
|
3881
|
-
property({ reflect: true })
|
|
3882
|
-
], _OdxStack.prototype, "justify", 2);
|
|
3883
|
-
__decorateClass([
|
|
3884
|
-
property({ reflect: true })
|
|
3885
|
-
], _OdxStack.prototype, "gap", 2);
|
|
3886
|
-
__decorateClass([
|
|
3887
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3888
|
-
], _OdxStack.prototype, "horizontal", 2);
|
|
3889
|
-
__decorateClass([
|
|
3890
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3891
|
-
], _OdxStack.prototype, "wrap", 2);
|
|
3892
|
-
let OdxStack = _OdxStack;
|
|
3893
|
-
|
|
3894
|
-
const styles$f = ":host{display:inline-flex;gap:var(--odx-size-37);align-items:center;border-radius:var(--odx-border-radius-circle);background-color:var(--odx-color-background-level-1);cursor:default;padding-inline:var(--odx-size-37) var(--odx-size-50);block-size:var(--odx-size-150);font-weight:var(--odx-typography-font-weight-medium)}:host([variant=\"primary\"]){background-color:var(--odx-color-background-primary-subtle)}:host([variant=\"danger\"]){background-color:var(--odx-color-background-danger-subtle);color:var(--odx-color-foreground-danger-rest)}:host([variant=\"warning\"]){background-color:var(--odx-color-background-warning-subtle)}:host([variant=\"success\"]){background-color:var(--odx-color-background-success-subtle)}";
|
|
3895
|
-
|
|
3896
|
-
const StatusVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "SUCCESS", "WARNING", "DANGER"]);
|
|
3897
|
-
const _OdxStatus = class _OdxStatus extends CustomElement {
|
|
3898
|
-
constructor() {
|
|
3899
|
-
super(...arguments);
|
|
3900
|
-
this.pulse = false;
|
|
3901
|
-
this.variant = StatusVariant.NEUTRAL;
|
|
3902
|
-
}
|
|
3903
|
-
static {
|
|
3904
|
-
customElement("odx-status", styles$f)(_OdxStatus);
|
|
3905
|
-
}
|
|
3906
|
-
render() {
|
|
3907
|
-
return html`
|
|
3908
|
-
<odx-badge compact ?pulse=${this.pulse} variant=${optionalAttr(this.variant)}></odx-badge>
|
|
3909
|
-
<slot></slot>
|
|
3910
|
-
`;
|
|
3911
|
-
}
|
|
3912
|
-
};
|
|
3913
|
-
__decorateClass([
|
|
3914
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3915
|
-
], _OdxStatus.prototype, "pulse", 2);
|
|
3916
|
-
__decorateClass([
|
|
3917
|
-
property({ reflect: true, useDefault: true })
|
|
3918
|
-
], _OdxStatus.prototype, "variant", 2);
|
|
3919
|
-
let OdxStatus = _OdxStatus;
|
|
3920
|
-
|
|
3921
|
-
const styles$e = "@layer base{:host{--_color-background: var(--odx-color-background-control-rest);--_color-stroke: var(--odx-color-stroke-control-subtle);--_color-foreground: var(--odx-color-foreground-rest-subtle);--_label-color-foreground: var(--odx-color-foreground-rest);--_thumb-size: var(--odx-size-125);--_thumb-position: 0;display:inline-flex;margin:var(--odx-size-37) var(--odx-size-75);cursor:pointer;user-select:none}.indicator,.content{transition:var(--odx-transition-reduced)}.indicator{display:flex;position:relative;place-items:center;transition-property:background-color,border-color,translate;block-size:var(--odx-size-150);color:var(--_color-foreground)}.track,.thumb{transition:inherit;border:var(--odx-border-width-thin) solid var(--_color-stroke);border-radius:var(--odx-border-radius-circle)}.track{background-color:var(--_color-background);block-size:var(--odx-size-50);inline-size:var(--odx-size-225)}.thumb{display:flex;position:absolute;inset-inline-start:0;place-content:center;place-items:center;backface-visibility:hidden;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);background-color:var(--_color-background);block-size:var(--odx-size-125);inline-size:var(--odx-size-125);translate:var(--_thumb-position) 0}.label{display:inline-block;cursor:inherit}.content{transition-property:color;padding-inline-end:var(--odx-size-25);color:var(--_label-color-foreground)}}@layer state{:host(:not(:empty)) .indicator{margin-inline-end:var(--odx-size-75)}:host(:empty) .content{display:none}:host(:not(:is([checked],[disabled],[readonly])):hover){--_color-stroke: var(--odx-color-stroke-control-hover);--_color-background: var(--odx-color-background-control-hover);--_color-foreground: var(--odx-color-foreground-rest)}:host(:focus-visible) .thumb{outline-color:var(--odx-color-stroke-focus-outer);&:after{position:absolute;inset:-3px;border:var(--odx-focus-ring-offset) solid var(--odx-color-stroke-focus-inner);border-radius:inherit;content:\"\"}}:host([checked]){--_color-background: var(--odx-color-background-control-selected);--_color-stroke: var(--_color-background);--_color-foreground: var(--odx-color-foreground-inverse);--_thumb-position: calc(var(--odx-size-225) - 100%)}:host([checked]:not(:is([readonly],[disabled])):hover){--_color-background: var(--odx-color-background-control-selected-hover)}:host([disabled]:not([readonly])){--_color-background: var(--odx-color-background-disabled-rest);--_color-stroke: var(--odx-color-disabled-stroke);--_color-foreground: var(--odx-color-foreground-disabled-rest);--_label-color-foreground: var(--odx-color-foreground-disabled-rest);cursor:not-allowed}:host([disabled][checked]:not([readonly])){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}:host([readonly]){--_color-stroke: var(--odx-color-stroke-control-readonly);--_color-background: var(--odx-color-background-control-rest);--_color-foreground: var(--odx-color-foreground-rest);cursor:default}}";
|
|
3922
|
-
|
|
3923
|
-
class OdxSwitch extends CheckboxFormControl {
|
|
3924
|
-
static {
|
|
3925
|
-
customElement("odx-switch", styles$e)(OdxSwitch);
|
|
3926
|
-
}
|
|
3927
|
-
connectedCallback() {
|
|
3928
|
-
super.connectedCallback();
|
|
3929
|
-
this.role = "switch";
|
|
3930
|
-
}
|
|
3931
|
-
render() {
|
|
3932
|
-
return html`
|
|
3933
|
-
<div class="indicator">
|
|
3934
|
-
<div class="track"></div>
|
|
3935
|
-
<div class="thumb">
|
|
3936
|
-
<odx-icon name=${this.checked ? "core::check" : "core::close"}></odx-icon>
|
|
3937
|
-
</div>
|
|
3938
|
-
</div>
|
|
3939
|
-
<div class="content">
|
|
3940
|
-
<div class="label">
|
|
3941
|
-
<slot></slot>
|
|
3942
|
-
</div>
|
|
3943
|
-
<div class="description">
|
|
3944
|
-
<slot name="description"></slot>
|
|
3945
|
-
</div>
|
|
3946
|
-
</div>
|
|
3947
|
-
`;
|
|
3948
|
-
}
|
|
3949
|
-
}
|
|
3950
|
-
|
|
3951
|
-
const styles$d = ":host{display:flex;flex-direction:column;background-color:var(--odx-color-background-level-1)}";
|
|
3952
|
-
|
|
3953
|
-
const styles$c = ":host{display:block;block-size:auto;flex:0 0 auto;padding-inline:var(--odx-size-75);line-height:var(--odx-size-300)}.checkbox{padding:var(--odx-size-37)}";
|
|
3954
|
-
|
|
3955
|
-
const _OdxTableCheckboxCell = class _OdxTableCheckboxCell extends CanBeDisabled(CustomElement) {
|
|
3956
|
-
constructor() {
|
|
3957
|
-
super(...arguments);
|
|
3958
|
-
this.checked = false;
|
|
3959
|
-
this.indeterminate = false;
|
|
3960
|
-
this.#handleChange = (event) => {
|
|
3961
|
-
event.preventDefault();
|
|
3962
|
-
event.stopPropagation();
|
|
3963
|
-
this.checked = event.target.checked;
|
|
3964
|
-
this.indeterminate = false;
|
|
3965
|
-
this.emit("change");
|
|
3966
|
-
};
|
|
3967
|
-
}
|
|
3968
|
-
static {
|
|
3969
|
-
customElement("odx-table-checkbox-cell", styles$c)(_OdxTableCheckboxCell);
|
|
3970
|
-
}
|
|
3971
|
-
connectedCallback() {
|
|
3972
|
-
super.connectedCallback();
|
|
3973
|
-
this.role = "gridcell";
|
|
3974
|
-
}
|
|
3975
|
-
click() {
|
|
3976
|
-
this.control.click();
|
|
3977
|
-
}
|
|
3978
|
-
render() {
|
|
3979
|
-
return html`<odx-checkbox class="checkbox" ?checked=${this.checked} ?disabled=${this.disabled} ?indeterminate=${this.indeterminate} @change=${this.#handleChange}></odx-checkbox>`;
|
|
3980
|
-
}
|
|
3981
|
-
#handleChange;
|
|
3982
|
-
};
|
|
3983
|
-
__decorateClass([
|
|
3984
|
-
query(".checkbox")
|
|
3985
|
-
], _OdxTableCheckboxCell.prototype, "control", 2);
|
|
3986
|
-
__decorateClass([
|
|
3987
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
3988
|
-
], _OdxTableCheckboxCell.prototype, "checked", 2);
|
|
3989
|
-
__decorateClass([
|
|
3990
|
-
property({ type: Boolean })
|
|
3991
|
-
], _OdxTableCheckboxCell.prototype, "indeterminate", 2);
|
|
3992
|
-
let OdxTableCheckboxCell = _OdxTableCheckboxCell;
|
|
3993
|
-
|
|
3994
|
-
const styles$b = ":host{display:flex;align-items:center;border-block-end:var(--odx-border-sm);border-color:var(--odx-color-outline-surface);padding-inline:var(--odx-size-75)}odx-checkbox{pointer-events:none;margin-inline-start:var(--odx-size-75)}";
|
|
3995
|
-
|
|
3996
|
-
const _OdxTableHeader = class _OdxTableHeader extends CheckboxFormControl {
|
|
3997
|
-
constructor() {
|
|
3998
|
-
super(...arguments);
|
|
3999
|
-
this.selected = false;
|
|
4000
|
-
}
|
|
4001
|
-
static {
|
|
4002
|
-
customElement("odx-table-header", styles$b)(_OdxTableHeader);
|
|
4003
|
-
}
|
|
4004
|
-
connectedCallback() {
|
|
4005
|
-
super.connectedCallback();
|
|
4006
|
-
this.role = "row";
|
|
4007
|
-
}
|
|
4008
|
-
render() {
|
|
4009
|
-
return html` <slot @change=${this.#handleChange}></slot>`;
|
|
4010
|
-
}
|
|
4011
|
-
async #handleChange(event) {
|
|
4012
|
-
if (event.target.localName !== OdxTableCheckboxCell.tagName) return;
|
|
4013
|
-
this.selected = event.target.checked;
|
|
4014
|
-
await 0;
|
|
4015
|
-
if (!event.defaultPrevented) return;
|
|
4016
|
-
this.selected = !this.selected;
|
|
4017
|
-
}
|
|
4018
|
-
};
|
|
4019
|
-
__decorateClass([
|
|
4020
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4021
|
-
], _OdxTableHeader.prototype, "selected", 2);
|
|
4022
|
-
let OdxTableHeader = _OdxTableHeader;
|
|
4023
|
-
|
|
4024
|
-
const styles$a = ":host{--_color-fill: transparent;display:flex;align-items:center;transition:var(--odx-transition-reduced);transition-property:background-color;border-block-end:var(--odx-border-width-thin) solid var(--odx-color-stroke-neutral-subtle);background-color:var(--_color-fill);cursor:pointer;padding-inline:var(--odx-size-75);inline-size:100%}:host(:not(:last-of-type)){border-color:var(--odx-color-stroke-neutral-subtle)}:host([selectable]:hover){--_color-fill: var(--odx-color-background-transparent-hover)}:host([selected]){--_color-fill: var(--odx-color-background-transparent-selected)}odx-checkbox{margin-inline-start:var(--odx-size-75);pointer-events:none}";
|
|
4025
|
-
|
|
4026
|
-
const _OdxTableRow = class _OdxTableRow extends CanBeDisabled(CustomElement) {
|
|
4027
|
-
constructor() {
|
|
4028
|
-
super(...arguments);
|
|
4029
|
-
this.selected = false;
|
|
4030
|
-
this.selectable = true;
|
|
4031
|
-
this.value = "";
|
|
4032
|
-
this.#handleClick = (event) => {
|
|
4033
|
-
const isCheckboxCell = event.composedPath().some((node) => node.localName === OdxTableCheckboxCell.tagName);
|
|
4034
|
-
if (isCheckboxCell) return;
|
|
4035
|
-
const [checkboxCell] = this.checkboxCells;
|
|
4036
|
-
checkboxCell?.click();
|
|
4037
|
-
};
|
|
4038
|
-
this.#handleChange = async (event) => {
|
|
4039
|
-
this.selected = event.target.checked;
|
|
4040
|
-
await 0;
|
|
4041
|
-
if (!event.defaultPrevented) return;
|
|
4042
|
-
this.selected = !this.selected;
|
|
4043
|
-
};
|
|
4044
|
-
this.#handleSlotchange = ({ target }) => {
|
|
4045
|
-
this.selectable = target.assignedElements().some((element) => element.localName === OdxTableCheckboxCell.tagName);
|
|
4046
|
-
};
|
|
4047
|
-
}
|
|
4048
|
-
static {
|
|
4049
|
-
customElement("odx-table-row", styles$a)(_OdxTableRow);
|
|
4050
|
-
}
|
|
4051
|
-
connectedCallback() {
|
|
4052
|
-
super.connectedCallback();
|
|
4053
|
-
this.role = "row";
|
|
4054
|
-
}
|
|
4055
|
-
render() {
|
|
4056
|
-
return html`
|
|
4057
|
-
<slot @change=${this.#handleChange} @slotchange=${this.#handleSlotchange}></slot>
|
|
4058
|
-
`;
|
|
4059
|
-
}
|
|
4060
|
-
willUpdate(props) {
|
|
4061
|
-
super.willUpdate(props);
|
|
4062
|
-
if (props.has("selected")) {
|
|
4063
|
-
this.#handleSelectedChange();
|
|
4064
|
-
}
|
|
4065
|
-
if (props.has("selectable")) {
|
|
4066
|
-
this.#handleSelectableChange();
|
|
4067
|
-
}
|
|
4068
|
-
}
|
|
4069
|
-
async #handleSelectedChange() {
|
|
4070
|
-
await this.updateComplete;
|
|
4071
|
-
if (this.selectable) {
|
|
4072
|
-
this.ariaSelected = toAriaBooleanAttribute(this.selected, false);
|
|
4073
|
-
} else {
|
|
4074
|
-
this.ariaSelected = null;
|
|
4075
|
-
}
|
|
4076
|
-
const [checkboxCell] = this.checkboxCells;
|
|
4077
|
-
if (!checkboxCell) return;
|
|
4078
|
-
checkboxCell.checked = this.selected;
|
|
4079
|
-
}
|
|
4080
|
-
#handleSelectableChange() {
|
|
4081
|
-
if (this.selectable) {
|
|
4082
|
-
this.addEventListener("click", this.#handleClick);
|
|
4083
|
-
} else {
|
|
4084
|
-
this.removeEventListener("click", this.#handleClick);
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
4087
|
-
#handleClick;
|
|
4088
|
-
#handleChange;
|
|
4089
|
-
#handleSlotchange;
|
|
4090
|
-
};
|
|
4091
|
-
__decorateClass([
|
|
4092
|
-
queryAssignedElements({ selector: OdxTableCheckboxCell.tagName, flatten: true })
|
|
4093
|
-
], _OdxTableRow.prototype, "checkboxCells", 2);
|
|
4094
|
-
__decorateClass([
|
|
4095
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4096
|
-
], _OdxTableRow.prototype, "selected", 2);
|
|
4097
|
-
__decorateClass([
|
|
4098
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4099
|
-
], _OdxTableRow.prototype, "selectable", 2);
|
|
4100
|
-
__decorateClass([
|
|
4101
|
-
property({ type: String })
|
|
4102
|
-
], _OdxTableRow.prototype, "value", 2);
|
|
4103
|
-
let OdxTableRow = _OdxTableRow;
|
|
4104
|
-
|
|
4105
|
-
const _OdxTable = class _OdxTable extends CustomElement {
|
|
4106
|
-
constructor() {
|
|
4107
|
-
super(...arguments);
|
|
4108
|
-
this.#selectedSet = /* @__PURE__ */ new Set();
|
|
4109
|
-
this.mode = "selection";
|
|
4110
|
-
this.selected = [];
|
|
4111
|
-
this.items = [];
|
|
4112
|
-
this.#handleChange = (event) => {
|
|
4113
|
-
if (event.target.localName !== OdxTableCheckboxCell.tagName) return;
|
|
4114
|
-
event.stopPropagation();
|
|
4115
|
-
const rowElement = event.target.parentElement;
|
|
4116
|
-
if (!rowElement) return;
|
|
4117
|
-
const isSelected = event.target.checked;
|
|
4118
|
-
if (rowElement.localName === OdxTableHeader.tagName) {
|
|
4119
|
-
if (event.target.checked) {
|
|
4120
|
-
this.#selectAllRows();
|
|
4121
|
-
} else {
|
|
4122
|
-
this.#deselectAllRows();
|
|
4123
|
-
}
|
|
4124
|
-
} else if (isSelected) {
|
|
4125
|
-
this.#selectedSet.add(rowElement.value);
|
|
4126
|
-
} else {
|
|
4127
|
-
this.#selectedSet.delete(rowElement.value);
|
|
4128
|
-
}
|
|
4129
|
-
};
|
|
4130
|
-
}
|
|
4131
|
-
static {
|
|
4132
|
-
customElement("odx-table", styles$d)(_OdxTable);
|
|
4133
|
-
}
|
|
4134
|
-
#selectedSet;
|
|
4135
|
-
get headerElements() {
|
|
4136
|
-
return Array.from(this.querySelectorAll(OdxTableHeader.tagName));
|
|
4137
|
-
}
|
|
4138
|
-
get rowElements() {
|
|
4139
|
-
return Array.from(this.querySelectorAll(OdxTableRow.tagName));
|
|
4140
|
-
}
|
|
4141
|
-
connectedCallback() {
|
|
4142
|
-
super.connectedCallback();
|
|
4143
|
-
this.role = "grid";
|
|
4144
|
-
}
|
|
4145
|
-
render() {
|
|
4146
|
-
return html`<slot @change=${this.#handleChange}></slot>`;
|
|
4147
|
-
}
|
|
4148
|
-
#selectAllRows() {
|
|
4149
|
-
for (const row of this.rowElements) {
|
|
4150
|
-
row.selected = true;
|
|
4151
|
-
this.#selectedSet.add(row.value);
|
|
4152
|
-
}
|
|
4153
|
-
}
|
|
4154
|
-
#deselectAllRows() {
|
|
4155
|
-
this.#selectedSet.clear();
|
|
4156
|
-
for (const row of this.rowElements) {
|
|
4157
|
-
if (!row.selected) continue;
|
|
4158
|
-
row.selected = false;
|
|
4159
|
-
}
|
|
4160
|
-
}
|
|
4161
|
-
#handleChange;
|
|
4162
|
-
};
|
|
4163
|
-
__decorateClass([
|
|
4164
|
-
property()
|
|
4165
|
-
], _OdxTable.prototype, "mode", 2);
|
|
4166
|
-
__decorateClass([
|
|
4167
|
-
property({ type: Array })
|
|
4168
|
-
], _OdxTable.prototype, "selected", 2);
|
|
4169
|
-
__decorateClass([
|
|
4170
|
-
property({ type: Array })
|
|
4171
|
-
], _OdxTable.prototype, "items", 2);
|
|
4172
|
-
let OdxTable = _OdxTable;
|
|
4173
|
-
|
|
4174
|
-
const tableContext = {
|
|
4175
|
-
context: n("odx-table::context"),
|
|
4176
|
-
defaultValue: { hasCheckboxes: true }
|
|
4177
|
-
};
|
|
4178
|
-
|
|
4179
|
-
const styles$9 = ":host{display:block;flex-grow:1}";
|
|
4180
|
-
|
|
4181
|
-
class OdxTableBody extends CustomElement {
|
|
4182
|
-
static {
|
|
4183
|
-
customElement("odx-table-body", styles$9)(OdxTableBody);
|
|
4184
|
-
}
|
|
4185
|
-
connectedCallback() {
|
|
4186
|
-
super.connectedCallback();
|
|
4187
|
-
this.role = "rowgroup";
|
|
4188
|
-
}
|
|
4189
|
-
render() {
|
|
4190
|
-
return html`<slot></slot>`;
|
|
4191
|
-
}
|
|
4192
|
-
}
|
|
4193
|
-
|
|
4194
|
-
const styles$8 = ":host{display:block;block-size:auto;flex:1 1 0%;padding-inline:var(--odx-size-75);line-height:var(--odx-size-300)}";
|
|
4195
|
-
|
|
4196
|
-
class OdxTableCell extends CustomElement {
|
|
4197
|
-
static {
|
|
4198
|
-
customElement("odx-table-cell", styles$8)(OdxTableCell);
|
|
4199
|
-
}
|
|
4200
|
-
connectedCallback() {
|
|
4201
|
-
super.connectedCallback();
|
|
4202
|
-
this.role = "gridcell";
|
|
4203
|
-
}
|
|
4204
|
-
render() {
|
|
4205
|
-
return html`<slot></slot>`;
|
|
4206
|
-
}
|
|
4207
|
-
}
|
|
4208
|
-
|
|
4209
|
-
const styles$7 = ":host{display:block;block-size:auto;flex:1 1 0%;padding-inline:var(--odx-size-75);line-height:var(--odx-size-225)}";
|
|
4210
|
-
|
|
4211
|
-
const _OdxTableHeaderCell = class _OdxTableHeaderCell extends CustomElement {
|
|
4212
|
-
constructor() {
|
|
4213
|
-
super(...arguments);
|
|
4214
|
-
this.sortable = false;
|
|
4215
|
-
}
|
|
4216
|
-
static {
|
|
4217
|
-
customElement("odx-table-header-cell", styles$7)(_OdxTableHeaderCell);
|
|
4218
|
-
}
|
|
4219
|
-
connectedCallback() {
|
|
4220
|
-
super.connectedCallback();
|
|
4221
|
-
this.role = "columnheader";
|
|
4222
|
-
}
|
|
4223
|
-
render() {
|
|
4224
|
-
return html`
|
|
4225
|
-
<odx-title size="xs">
|
|
4226
|
-
<slot></slot> (${this.sortable ? "sortable" : "not sortable"})
|
|
4227
|
-
</odx-title>
|
|
4228
|
-
`;
|
|
4229
|
-
}
|
|
4230
|
-
};
|
|
4231
|
-
__decorateClass([
|
|
4232
|
-
property({ type: Boolean })
|
|
4233
|
-
], _OdxTableHeaderCell.prototype, "sortable", 2);
|
|
4234
|
-
let OdxTableHeaderCell = _OdxTableHeaderCell;
|
|
4235
|
-
|
|
4236
|
-
const styles$6 = "@layer base{:host{display:block;text-decoration:inherit;line-height:inherit;color:inherit;font-size:inherit;font-weight:inherit}:host([inline]){display:inline-block}}@layer variant{:host([strong]){font-weight:var(--odx-typography-font-weight-medium)}:host([subtle]){color:var(--odx-color-foreground-rest-subtle)}:host([size=\"xs\"]){line-height:var(--odx-typography-line-height-1);font-size:var(--odx-typography-font-size-1)}:host([size=\"sm\"]){line-height:var(--odx-typography-line-height-2);font-size:var(--odx-typography-font-size-2)}:host([size=\"md\"]){line-height:var(--odx-typography-line-height-3);font-size:var(--odx-typography-font-size-3)}:host([size=\"lg\"]){line-height:var(--odx-typography-line-height-4);font-size:var(--odx-typography-font-size-4)}:host([variant=\"accent\"]){color:var(--odx-color-background-accent-rest)}:host([variant=\"success\"]){color:var(--odx-color-background-success-rest)}:host([variant=\"danger\"]){color:var(--odx-color-foreground-danger-rest)}}";
|
|
4237
|
-
|
|
4238
|
-
const TextSize = pick(Size, ["XS", "SM", "MD", "LG"]);
|
|
4239
|
-
const TextVariant = pick(Variant, ["NEUTRAL", "ACCENT", "SUCCESS", "DANGER"]);
|
|
4240
|
-
const _OdxText = class _OdxText extends CustomElement {
|
|
4241
|
-
constructor() {
|
|
4242
|
-
super(...arguments);
|
|
4243
|
-
this.strong = false;
|
|
4244
|
-
this.subtle = false;
|
|
4245
|
-
this.inline = false;
|
|
4246
|
-
this.variant = TextVariant.NEUTRAL;
|
|
4247
|
-
}
|
|
4248
|
-
static {
|
|
4249
|
-
customElement("odx-text", styles$6)(_OdxText);
|
|
4250
|
-
}
|
|
4251
|
-
};
|
|
4252
|
-
__decorateClass([
|
|
4253
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4254
|
-
], _OdxText.prototype, "strong", 2);
|
|
4255
|
-
__decorateClass([
|
|
4256
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4257
|
-
], _OdxText.prototype, "subtle", 2);
|
|
4258
|
-
__decorateClass([
|
|
4259
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4260
|
-
], _OdxText.prototype, "inline", 2);
|
|
4261
|
-
__decorateClass([
|
|
4262
|
-
property({ reflect: true })
|
|
4263
|
-
], _OdxText.prototype, "size", 2);
|
|
4264
|
-
__decorateClass([
|
|
4265
|
-
property({ reflect: true, useDefault: true })
|
|
4266
|
-
], _OdxText.prototype, "variant", 2);
|
|
4267
|
-
let OdxText = _OdxText;
|
|
4268
|
-
|
|
4269
|
-
const styles$5 = ":host{display:inline-block}";
|
|
4270
|
-
|
|
4271
|
-
const ToastVariant = pick(Variant, ["NEUTRAL", "PRIMARY", "SUCCESS", "WARNING", "DANGER"]);
|
|
4272
|
-
const _OdxToast = class _OdxToast extends CustomElement {
|
|
4273
|
-
constructor() {
|
|
4274
|
-
super(...arguments);
|
|
4275
|
-
this.variant = ToastVariant.NEUTRAL;
|
|
4276
|
-
}
|
|
4277
|
-
static {
|
|
4278
|
-
customElement("odx-toast", styles$5)(_OdxToast);
|
|
4279
|
-
}
|
|
4280
|
-
render() {
|
|
4281
|
-
return html`
|
|
4282
|
-
<odx-inline-message icon=${optionalAttr(this.icon)} variant=${this.variant}>
|
|
4283
|
-
<slot name="title"></slot>
|
|
4284
|
-
<slot></slot>
|
|
4285
|
-
</odx-inline-message>
|
|
4286
|
-
`;
|
|
4287
|
-
}
|
|
4288
|
-
};
|
|
4289
|
-
__decorateClass([
|
|
4290
|
-
property()
|
|
4291
|
-
], _OdxToast.prototype, "icon", 2);
|
|
4292
|
-
__decorateClass([
|
|
4293
|
-
property({ reflect: true, useDefault: true })
|
|
4294
|
-
], _OdxToast.prototype, "variant", 2);
|
|
4295
|
-
let OdxToast = _OdxToast;
|
|
4296
|
-
|
|
4297
|
-
const styles$4 = ":host{--_border-radius: var(--odx-border-radius-sm);--_color-background: var(--odx-color-background-control-rest);--_color-stroke: var(--odx-color-stroke-control-subtle);--_color-foreground: var(--odx-color-foreground-rest);--_size: var(--odx-size-225);--_padding-inline: var(--odx-size-75);display:inline-flex;position:relative;align-items:center;justify-content:center;transition:var(--odx-transition-default);transition-property:color,background-color,border-color,outline-color;outline:var(--odx-focus-ring-outline);outline-offset:var(--odx-focus-ring-offset);border:var(--odx-border-width-thin) solid var(--_color-stroke);border-radius:var(--odx-border-radius-controls);background-color:var(--_color-background);cursor:pointer;padding-inline:var(--_padding-inline);block-size:var(--_size);color:var(--_color-foreground);font-weight:var(--odx-typography-font-weight-medium);user-select:none}::slotted(odx-icon){margin-inline:calc(-1 * var(--odx-size-37) - var(--odx-border-width-thin))}::part(label){display:inline-block}:host(:hover){--_color-background: var(--odx-color-background-control-hover);--_color-stroke: var(--odx-color-stroke-control-hover)}:host(:active){--_color-background: var(--odx-color-background-control-pressed);--_color-stroke: var(--odx-color-stroke-control-pressed)}:host(:focus-visible){outline-color:var(--odx-color-stroke-focus-outer)}:host([readonly][checked]),:host([checked]){--_color-background: var(--odx-color-background-control-selected);--_color-foreground: var(--odx-color-foreground-inverse-static);--_color-stroke: var(--odx-color-stroke-control-selected)}:host([checked]:not(:is([readonly],[disabled])):hover){--_color-background: var(--odx-color-background-control-selected-hover)}:host([disabled]:not([readonly])){--_color-background: var(--odx-color-background-disabled-rest);--_color-foreground: var(--odx-color-foreground-disabled-rest);--_color-stroke: var(--odx-color-stroke-disabled-rest);cursor:not-allowed}:host([disabled][checked]:not([readonly])){--_color-background: var(--odx-color-background-disabled-selected);--_color-foreground: var(--odx-color-foreground-disabled-selected)}:host([readonly]){--_color-background: var(--odx-color-background-control-readonly);--_color-stroke: var(--odx-color-stroke-control-subtle);--_color-foreground: var(--odx-color-foreground-rest-subtle);cursor:default}";
|
|
4298
|
-
|
|
4299
|
-
class OdxToggleButton extends CheckboxFormControl {
|
|
4300
|
-
static {
|
|
4301
|
-
customElement("odx-toggle-button", styles$4)(OdxToggleButton);
|
|
4302
|
-
}
|
|
4303
|
-
connectedCallback() {
|
|
4304
|
-
super.connectedCallback();
|
|
4305
|
-
this.role = "button";
|
|
4306
|
-
}
|
|
4307
|
-
updateAriaAttributes() {
|
|
4308
|
-
this.ariaPressed = toAriaBooleanAttribute(this.checked, false);
|
|
4309
|
-
}
|
|
4310
|
-
render() {
|
|
4311
|
-
return html`
|
|
4312
|
-
<slot></slot>
|
|
4313
|
-
`;
|
|
4314
|
-
}
|
|
4315
|
-
}
|
|
4316
|
-
|
|
4317
|
-
const styles$3 = ":host{display:inline-flex;gap:0;align-items:center}::slotted(*){margin-block:0}::slotted(odx-toggle-button:first-child){z-index:1;border-start-end-radius:0;border-end-end-radius:0}::slotted(odx-toggle-button:last-child){border-start-start-radius:0;border-end-start-radius:0}::slotted(odx-toggle-button:not(:first-child,:last-child)){margin-inline:calc(-1 * var(--odx-border-width-thin));border-radius:0}::slotted(odx-toggle-button:is(:hover,:focus-within)){position:relative}::slotted(odx-toggle-button:not(:first-child,:last-child):is(:hover,:focus-within)){z-index:2}:host([block]){display:flex;::slotted(odx-toggle-button){width:100%}}";
|
|
4318
|
-
|
|
4319
|
-
const _OdxToggleButtonGroup = class _OdxToggleButtonGroup extends RadioGroupFormControl {
|
|
4320
|
-
constructor() {
|
|
4321
|
-
super(...arguments);
|
|
4322
|
-
this.block = false;
|
|
4323
|
-
}
|
|
4324
|
-
static {
|
|
4325
|
-
customElement("odx-toggle-button-group", styles$3)(_OdxToggleButtonGroup);
|
|
4326
|
-
}
|
|
4327
|
-
};
|
|
4328
|
-
__decorateClass([
|
|
4329
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4330
|
-
], _OdxToggleButtonGroup.prototype, "block", 2);
|
|
4331
|
-
let OdxToggleButtonGroup = _OdxToggleButtonGroup;
|
|
4332
|
-
|
|
4333
|
-
const styles$2 = ":host{--offset-y: -100%;--transition: var(--odx-transition-default);display:grid;grid-template-rows:1fr;transition:var(--transition)}.base{overflow:hidden}.content{transition:var(--transition);transition-property:transform,opacity}:host([hidden]){grid-template-rows:0fr;.content{transform:translateY(var(--offset-y));opacity:0}}";
|
|
4334
|
-
|
|
4335
|
-
const _OdxToggleContent = class _OdxToggleContent extends CustomElement {
|
|
4336
|
-
constructor() {
|
|
4337
|
-
super(...arguments);
|
|
4338
|
-
this.hidden = false;
|
|
4339
|
-
}
|
|
4340
|
-
static {
|
|
4341
|
-
customElement("odx-toggle-content", styles$2)(_OdxToggleContent);
|
|
4342
|
-
}
|
|
4343
|
-
render() {
|
|
4344
|
-
return html`
|
|
4345
|
-
<div class="base">
|
|
4346
|
-
<div class="content">
|
|
4347
|
-
<slot></slot>
|
|
4348
|
-
</div>
|
|
4349
|
-
</div>
|
|
4350
|
-
`;
|
|
4351
|
-
}
|
|
4352
|
-
};
|
|
4353
|
-
__decorateClass([
|
|
4354
|
-
property({ type: Boolean, reflect: true, useDefault: true })
|
|
4355
|
-
], _OdxToggleContent.prototype, "hidden", 2);
|
|
4356
|
-
let OdxToggleContent = _OdxToggleContent;
|
|
4357
|
-
|
|
4358
|
-
const styles$1 = ":host{--_popover-color-background: var(--odx-color-background-level-3);--_popover-color-foreground: var(--odx-color-foreground-inverse-static)}:host(:not([interactive])){pointer-events:none;user-select:none}odx-popover{border-radius:var(--odx-border-radius-md);&::part(content){padding-block:var(--odx-size-37);padding-inline:var(--odx-size-75)}}";
|
|
4359
|
-
|
|
4360
|
-
const TooltipPlacement = pick(Placement, ["TOP", "RIGHT", "BOTTOM", "LEFT"]);
|
|
4361
|
-
const _OdxTooltip = class _OdxTooltip extends PopoverHost {
|
|
4362
|
-
constructor() {
|
|
4363
|
-
super(...arguments);
|
|
4364
|
-
this.show = false;
|
|
4365
|
-
this.placement = TooltipPlacement.TOP;
|
|
4366
|
-
this.#handleReferenceMouseLeave = (event) => {
|
|
4367
|
-
if (event.relatedTarget === this) return;
|
|
4368
|
-
this.#handleMouseEvents(event);
|
|
4369
|
-
};
|
|
4370
|
-
this.#handleMouseEvents = (event) => {
|
|
4371
|
-
if (event.type !== "mouseenter" && event.type !== "mouseleave") return;
|
|
4372
|
-
this.updateReferenceElementFromEvent(event);
|
|
4373
|
-
this.togglePopover(event.type === "mouseenter");
|
|
4374
|
-
};
|
|
4375
|
-
this.#handleKeyboardFocus = (event) => {
|
|
4376
|
-
if (event.key !== "Tab") return;
|
|
4377
|
-
this.updateReferenceElementFromEvent(event);
|
|
4378
|
-
this.togglePopover(event.type !== "keydown");
|
|
4379
|
-
};
|
|
4380
|
-
}
|
|
4381
|
-
static {
|
|
4382
|
-
customElement("odx-tooltip", styles$1)(_OdxTooltip);
|
|
4383
|
-
}
|
|
4384
|
-
#timeout;
|
|
4385
|
-
connectedCallback() {
|
|
4386
|
-
super.connectedCallback();
|
|
4387
|
-
this.id ||= getUniqueId("odx-tooltip");
|
|
4388
|
-
this.role = "tooltip";
|
|
4389
|
-
}
|
|
4390
|
-
onPopoverShow() {
|
|
4391
|
-
super.onPopoverShow?.();
|
|
4392
|
-
if (typeof this.timeout !== "number" || this.timeout <= 0) return;
|
|
4393
|
-
this.#timeout = window.setTimeout(() => this.togglePopover(false), this.timeout);
|
|
4394
|
-
}
|
|
4395
|
-
onBeforePopoverHide() {
|
|
4396
|
-
super.onBeforePopoverHide?.();
|
|
4397
|
-
clearTimeout(this.#timeout);
|
|
4398
|
-
}
|
|
4399
|
-
mountPopover(referenceElement) {
|
|
4400
|
-
super.mountPopover(referenceElement);
|
|
4401
|
-
if (!referenceElement) return;
|
|
4402
|
-
this.#updateAriaAttributes(referenceElement, this.id);
|
|
4403
|
-
if (this.popover === "manual") return;
|
|
4404
|
-
referenceElement.addEventListener("mouseenter", this.#handleMouseEvents);
|
|
4405
|
-
referenceElement.addEventListener("mouseleave", this.#handleReferenceMouseLeave);
|
|
4406
|
-
referenceElement.addEventListener("keyup", this.#handleKeyboardFocus);
|
|
4407
|
-
referenceElement.addEventListener("keydown", this.#handleKeyboardFocus);
|
|
4408
|
-
}
|
|
4409
|
-
unmountPopover(referenceElement) {
|
|
4410
|
-
super.unmountPopover(referenceElement);
|
|
4411
|
-
this.#updateAriaAttributes(referenceElement, null);
|
|
4412
|
-
referenceElement.removeEventListener("keyup", this.#handleKeyboardFocus);
|
|
4413
|
-
referenceElement.removeEventListener("keydown", this.#handleKeyboardFocus);
|
|
4414
|
-
referenceElement.removeEventListener("mouseenter", this.#handleMouseEvents);
|
|
4415
|
-
referenceElement.removeEventListener("mouseleave", this.#handleReferenceMouseLeave);
|
|
4416
|
-
}
|
|
4417
|
-
render() {
|
|
4418
|
-
return html`
|
|
4419
|
-
<odx-popover showArrow>
|
|
4420
|
-
<slot></slot>
|
|
4421
|
-
</odx-popover>
|
|
4422
|
-
`;
|
|
4423
|
-
}
|
|
4424
|
-
willUpdate(props) {
|
|
4425
|
-
super.willUpdate(props);
|
|
4426
|
-
if (!this.referenceElement) return;
|
|
4427
|
-
if (props.has("id")) {
|
|
4428
|
-
this.#updateAriaAttributes(this.referenceElement, this.id);
|
|
4429
|
-
}
|
|
4430
|
-
if (props.has("show")) {
|
|
4431
|
-
this.togglePopover(this.show);
|
|
4432
|
-
}
|
|
4433
|
-
}
|
|
4434
|
-
#updateAriaAttributes(referenceElement, id) {
|
|
4435
|
-
if (id) {
|
|
4436
|
-
referenceElement.setAttribute("aria-describedby", id);
|
|
4437
|
-
} else {
|
|
4438
|
-
referenceElement.removeAttribute("aria-describedby");
|
|
4439
|
-
}
|
|
4440
|
-
}
|
|
4441
|
-
#handleReferenceMouseLeave;
|
|
4442
|
-
#handleMouseEvents;
|
|
4443
|
-
#handleKeyboardFocus;
|
|
4444
|
-
};
|
|
4445
|
-
__decorateClass([
|
|
4446
|
-
property({ type: Boolean })
|
|
4447
|
-
], _OdxTooltip.prototype, "show", 2);
|
|
4448
|
-
__decorateClass([
|
|
4449
|
-
property({ type: Number })
|
|
4450
|
-
], _OdxTooltip.prototype, "timeout", 2);
|
|
4451
|
-
__decorateClass([
|
|
4452
|
-
property({ reflect: true, useDefault: true })
|
|
4453
|
-
], _OdxTooltip.prototype, "placement", 2);
|
|
4454
|
-
let OdxTooltip = _OdxTooltip;
|
|
4455
|
-
|
|
4456
|
-
const TranslateContextConverter = {
|
|
4457
|
-
fromAttribute(value) {
|
|
4458
|
-
try {
|
|
4459
|
-
return value ? JSON.parse(value) : null;
|
|
4460
|
-
} catch {
|
|
4461
|
-
return value ?? null;
|
|
4462
|
-
}
|
|
4463
|
-
}
|
|
4464
|
-
};
|
|
4465
|
-
const _OdxTranslate = class _OdxTranslate extends IsLocalized(CustomElement) {
|
|
4466
|
-
static {
|
|
4467
|
-
customElement("odx-translate")(_OdxTranslate);
|
|
4468
|
-
}
|
|
4469
|
-
updated(props) {
|
|
4470
|
-
super.updated(props);
|
|
4471
|
-
this.textContent = this.t(this.key ?? "", this.context);
|
|
4472
|
-
}
|
|
4473
|
-
};
|
|
4474
|
-
__decorateClass([
|
|
4475
|
-
property()
|
|
4476
|
-
], _OdxTranslate.prototype, "key", 2);
|
|
4477
|
-
__decorateClass([
|
|
4478
|
-
property({ converter: TranslateContextConverter })
|
|
4479
|
-
], _OdxTranslate.prototype, "context", 2);
|
|
4480
|
-
let OdxTranslate = _OdxTranslate;
|
|
4481
|
-
|
|
4482
|
-
const styles = ":host{all:initial;border:0!important;clip:rect(1px,1px,1px,1px)!important;block-size:1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;inset-block-start:0;inline-size:1px!important}";
|
|
4483
|
-
|
|
4484
|
-
class OdxVisuallyHidden extends CustomElement {
|
|
4485
|
-
static {
|
|
4486
|
-
customElement("odx-visually-hidden", styles)(OdxVisuallyHidden);
|
|
4487
|
-
}
|
|
4488
|
-
render() {
|
|
4489
|
-
return html`<slot></slot>`;
|
|
4490
|
-
}
|
|
4491
|
-
}
|
|
4492
|
-
|
|
4493
|
-
export { AccordionIndicatorPosition, AccordionItemSize, AnchorObserver, AreaHeaderSize, AvatarShape, AvatarSize, AvatarVariant, BadgeVariant, BaseFormat, ButtonBadgeAlign, ButtonSize, ButtonVariant, CheckboxGroupLayout, ChipVariant, CircularProgressBarSize, DropdownPlacement, HeadlineSize, InlineMessageVariant, KpiSize, KpiVariant, LOADING_OVERLAY_HOST_DIRECTIVE, LogoSize, ModalLayout, NavigationItemSize, OdxAccordion, OdxAccordionItem, OdxAccordionPanel, OdxActionButton, OdxAnchorNavigation, OdxAreaHeader, OdxAutocomplete, OdxAvatar, OdxAvatarGroup, OdxBadge, OdxBreadcrumbs, OdxBreadcrumbsItem, OdxButton, OdxButtonGroup, OdxCard, OdxCheckbox, OdxCheckboxGroup, OdxChip, OdxCircularProgressBar, OdxContentBox, OdxDropdown, OdxFormField, OdxFormatBytes, OdxFormatDate, OdxFormatNumber, OdxHeader, OdxHeaderActions, OdxHeadline, OdxHighlight, OdxIconButton, OdxImage, OdxInlineMessage, OdxInput, OdxKpi, OdxLineClamp, OdxLink, OdxList, OdxListItem, OdxLoadingOverlay, OdxLoadingSpinner, OdxLogo, OdxMainMenu, OdxMainMenuButton, OdxMainMenuLink, OdxMainMenuSubtitle, OdxMainMenuTitle, OdxMenu, OdxMenuItem, OdxMenuLabel, OdxModal, OdxNavigationItem, OdxOption, OdxPage, OdxPageLayout, OdxPagination, OdxPopover, OdxProgressBar, OdxRadioButton, OdxRadioGroup, OdxRailNavigation, OdxRelativeTime, OdxSearchBar, OdxSelect, OdxSeparator, OdxSkeleton, OdxSlider, OdxSliderHandle, OdxSliderMarks, OdxSpacer, OdxSpinbox, OdxStack, OdxStatus, OdxSwitch, OdxTable, OdxTableBody, OdxTableCell, OdxTableCheckboxCell, OdxTableHeader, OdxTableHeaderCell, OdxTableRow, OdxText, OdxTitle, OdxToast, OdxToggleButton, OdxToggleButtonGroup, OdxToggleContent, OdxTooltip, OdxTranslate, OdxVisuallyHidden, PageAlignment, PageLayout, ProgressBarVariant, RadioGroupLayout, SearchBarBehavior, SearchEvent, SeparatorAlign, SkeletonShape, SkeletonSize, SliderLabelVisibility, SliderTrackVisibility, StackAlign, StackGap, StackJustify, StatusVariant, TextSize, TextVariant, TitleSize, ToastVariant, TooltipPlacement, sliderContext, tableContext };
|