@odx/foundation 1.0.0-beta.25 → 1.0.0-beta.26
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/dist/components/accordion/accordion-header.d.ts +1 -2
- package/dist/components/list/list-item.d.ts +1 -2
- package/dist/components/list/list.d.ts +3 -0
- package/dist/components.js +102 -111
- package/dist/lib/controllers/expandable-controller.d.ts +1 -1
- package/dist/lib/mixins/can-be-expanded.d.ts +1 -1
- package/dist/main.js +14 -4
- package/package.json +1 -1
|
@@ -10,10 +10,9 @@ declare const OdxAccordionHeader_base: import('../../lib/main.js').Constructor<C
|
|
|
10
10
|
export declare class OdxAccordionHeader extends OdxAccordionHeader_base {
|
|
11
11
|
#private;
|
|
12
12
|
get panel(): HTMLElement | null;
|
|
13
|
-
constructor();
|
|
14
13
|
connectedCallback(): void;
|
|
15
14
|
protected renderContent(): TemplateResult;
|
|
16
|
-
protected
|
|
15
|
+
protected willUpdate(props: PropertyValues<this>): void;
|
|
17
16
|
}
|
|
18
17
|
export {};
|
|
19
18
|
//# sourceMappingURL=accordion-header.d.ts.map
|
|
@@ -15,13 +15,12 @@ export declare class OdxListItem extends OdxListItem_base {
|
|
|
15
15
|
muted: boolean;
|
|
16
16
|
withExpandControl: boolean;
|
|
17
17
|
withExpandIndicator: boolean;
|
|
18
|
-
constructor();
|
|
19
18
|
isExpandable(): boolean;
|
|
20
19
|
getExpandControl(): HTMLElement | null;
|
|
21
20
|
connectedCallback(): void;
|
|
22
21
|
protected render(): TemplateResult;
|
|
23
22
|
protected renderContent(): TemplateResult;
|
|
24
|
-
protected
|
|
23
|
+
protected willUpdate(props: PropertyValues<this>): void;
|
|
25
24
|
}
|
|
26
25
|
export {};
|
|
27
26
|
//# sourceMappingURL=list-item.d.ts.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { CustomElement } from '../../lib/main.js';
|
|
2
|
+
import { OdxListItem } from './list-item.js';
|
|
2
3
|
declare global {
|
|
3
4
|
interface HTMLElementTagNameMap {
|
|
4
5
|
'odx-list': OdxList;
|
|
5
6
|
}
|
|
6
7
|
}
|
|
7
8
|
export declare class OdxList extends CustomElement {
|
|
9
|
+
items: OdxListItem[];
|
|
8
10
|
multiple: boolean;
|
|
9
11
|
constructor();
|
|
10
12
|
connectedCallback(): void;
|
|
13
|
+
toggleAll(force?: boolean, emitEvent?: boolean): void;
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=list.d.ts.map
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CanBeExpanded, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, CanBeDisabled, SharedResizeObserver, optionalAttr, createIntersectionObserver, createMutationObserver, getElementFromEvent, enumFrom, Size, Shape, Variant, optionalSlot, toggleAttribute, getKeyboardEventInfo, queryAssignedElement, parseDate, searchTextContent, waitForAnimations, FormControl, forwardEvent, CanBeSelected, WithLoadingState, FocusTrapController, toPx,
|
|
1
|
+
import { CanBeExpanded, getUniqueId, toAriaBooleanAttribute, customElement, requestUpdateOnAriaChange, CustomElement, ExpandableItemManager, CanBeDisabled, SharedResizeObserver, optionalAttr, createIntersectionObserver, createMutationObserver, getElementFromEvent, enumFrom, Size, Shape, Variant, optionalSlot, toggleAttribute, getKeyboardEventInfo, queryAssignedElement, parseDate, searchTextContent, waitForAnimations, FormControl, forwardEvent, CanBeSelected, WithLoadingState, FocusTrapController, toPx, emptySlotFallbackFix, NumberControl } from '@odx/foundation';
|
|
2
2
|
import { InteractiveElement, CheckboxGroupFormControl, CheckboxFormControl, PopoverPlacement, PopoverHost, PopoverPlacementOptions, ListboxFormControl, OptionControl, RadioGroupFormControl, IsDraggable, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation/cdk';
|
|
3
|
-
import {
|
|
3
|
+
import { html, isServer, css, nothing } from 'lit';
|
|
4
4
|
import { property, queryAssignedElements, query, queryAll, state } from 'lit/decorators.js';
|
|
5
5
|
import { signal, computed, effect, SignalWatcher } from '@lit-labs/preact-signals';
|
|
6
6
|
import { repeat } from 'lit/directives/repeat.js';
|
|
@@ -25,24 +25,13 @@ var __decorateClass$1p = (decorators, target, key, kind) => {
|
|
|
25
25
|
return result;
|
|
26
26
|
};
|
|
27
27
|
var __accessCheck$w = (obj, member, msg) => member.has(obj) || __typeError$w("Cannot " + msg);
|
|
28
|
-
var __privateGet$r = (obj, member, getter) => (__accessCheck$w(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
29
28
|
var __privateAdd$w = (obj, member, value) => member.has(obj) ? __typeError$w("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
30
29
|
var __privateMethod$j = (obj, member, method) => (__accessCheck$w(obj, member, "access private method"), method);
|
|
31
|
-
var _OdxAccordionHeader_instances,
|
|
30
|
+
var _OdxAccordionHeader_instances, handleExpandedChange_fn$1;
|
|
32
31
|
let OdxAccordionHeader = class extends CanBeExpanded(InteractiveElement) {
|
|
33
32
|
constructor() {
|
|
34
|
-
super();
|
|
33
|
+
super(...arguments);
|
|
35
34
|
__privateAdd$w(this, _OdxAccordionHeader_instances);
|
|
36
|
-
__privateAdd$w(this, _handleClick$8, () => {
|
|
37
|
-
if (!this.panel) return;
|
|
38
|
-
this.toggle();
|
|
39
|
-
if (!this.expanded) {
|
|
40
|
-
this.panel?.querySelector("odx-accordion")?.toggleAll(false);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
if (!isServer) {
|
|
44
|
-
this.addEventListener("click", __privateGet$r(this, _handleClick$8));
|
|
45
|
-
}
|
|
46
35
|
}
|
|
47
36
|
get panel() {
|
|
48
37
|
if (this.nextElementSibling?.role === "region") {
|
|
@@ -60,22 +49,23 @@ let OdxAccordionHeader = class extends CanBeExpanded(InteractiveElement) {
|
|
|
60
49
|
<odx-icon part="indicator" name="core::chevron-down" size="md"></odx-icon>
|
|
61
50
|
`;
|
|
62
51
|
}
|
|
63
|
-
|
|
64
|
-
super.
|
|
52
|
+
willUpdate(props) {
|
|
53
|
+
super.willUpdate?.(props);
|
|
65
54
|
if (props.has("disabled") || props.has("expanded")) {
|
|
66
|
-
__privateMethod$j(this, _OdxAccordionHeader_instances,
|
|
55
|
+
__privateMethod$j(this, _OdxAccordionHeader_instances, handleExpandedChange_fn$1).call(this);
|
|
67
56
|
}
|
|
68
57
|
}
|
|
69
58
|
};
|
|
70
59
|
_OdxAccordionHeader_instances = new WeakSet();
|
|
71
|
-
|
|
60
|
+
handleExpandedChange_fn$1 = function() {
|
|
72
61
|
if (!this.panel) return;
|
|
73
62
|
this.ariaExpanded = toAriaBooleanAttribute(this.expanded);
|
|
74
63
|
this.setAttribute("aria-controls", this.panel.id);
|
|
75
|
-
this.panel.hidden = this.disabled || !this.expanded;
|
|
76
64
|
this.panel.setAttribute("aria-labelledby", this.id);
|
|
65
|
+
this.panel.hidden = this.disabled || !this.expanded;
|
|
66
|
+
if (this.expanded) return;
|
|
67
|
+
this.panel.querySelector("odx-accordion")?.toggleAll(false);
|
|
77
68
|
};
|
|
78
|
-
_handleClick$8 = new WeakMap();
|
|
79
69
|
OdxAccordionHeader = __decorateClass$1p([
|
|
80
70
|
customElement("odx-accordion-header", [styles$1e])
|
|
81
71
|
], OdxAccordionHeader);
|
|
@@ -174,7 +164,7 @@ var __decorateClass$1m = (decorators, target, key, kind) => {
|
|
|
174
164
|
return result;
|
|
175
165
|
};
|
|
176
166
|
var __accessCheck$v = (obj, member, msg) => member.has(obj) || __typeError$v("Cannot " + msg);
|
|
177
|
-
var __privateGet$
|
|
167
|
+
var __privateGet$p = (obj, member, getter) => (__accessCheck$v(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
178
168
|
var __privateAdd$v = (obj, member, value) => member.has(obj) ? __typeError$v("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
179
169
|
var __privateMethod$i = (obj, member, method) => (__accessCheck$v(obj, member, "access private method"), method);
|
|
180
170
|
var _breakpoints, _position, _currentBreakpoint, _OdxActionGroup_instances, captureSize_fn, _handleSlotChange$9;
|
|
@@ -185,8 +175,8 @@ let OdxActionGroup = class extends CanBeDisabled(CustomElement) {
|
|
|
185
175
|
__privateAdd$v(this, _breakpoints, signal([]));
|
|
186
176
|
__privateAdd$v(this, _position, signal(0));
|
|
187
177
|
__privateAdd$v(this, _currentBreakpoint, computed(() => {
|
|
188
|
-
const position = __privateGet$
|
|
189
|
-
const breakpoints = __privateGet$
|
|
178
|
+
const position = __privateGet$p(this, _position).value;
|
|
179
|
+
const breakpoints = __privateGet$p(this, _breakpoints).value;
|
|
190
180
|
return this.assignedElements.findLast((_, index) => {
|
|
191
181
|
return breakpoints[index] && position > breakpoints[index];
|
|
192
182
|
});
|
|
@@ -202,19 +192,19 @@ let OdxActionGroup = class extends CanBeDisabled(CustomElement) {
|
|
|
202
192
|
this,
|
|
203
193
|
() => {
|
|
204
194
|
const baseRect = this.base.getBoundingClientRect();
|
|
205
|
-
__privateGet$
|
|
195
|
+
__privateGet$p(this, _position).value = baseRect.left;
|
|
206
196
|
},
|
|
207
197
|
{ fpsLimit: 5 }
|
|
208
198
|
);
|
|
209
199
|
effect(() => {
|
|
210
|
-
__privateGet$
|
|
200
|
+
__privateGet$p(this, _currentBreakpoint).value;
|
|
211
201
|
});
|
|
212
202
|
}
|
|
213
203
|
render() {
|
|
214
204
|
return html`
|
|
215
205
|
<div class="base">
|
|
216
206
|
<odx-stack class="container" horizontal>
|
|
217
|
-
<slot @slotchange=${__privateGet$
|
|
207
|
+
<slot @slotchange=${__privateGet$p(this, _handleSlotChange$9)}></slot>
|
|
218
208
|
<odx-icon-button id="action-menu" icon="core::chevron-down"></odx-icon-button>
|
|
219
209
|
</odx-stack>
|
|
220
210
|
<odx-menu anchor="action-menu" placement="bottom-end">
|
|
@@ -240,7 +230,7 @@ captureSize_fn = async function() {
|
|
|
240
230
|
element.slot = "";
|
|
241
231
|
}
|
|
242
232
|
await 0;
|
|
243
|
-
__privateGet$
|
|
233
|
+
__privateGet$p(this, _breakpoints).value = this.assignedElements.map((element) => {
|
|
244
234
|
return element.getBoundingClientRect().left;
|
|
245
235
|
});
|
|
246
236
|
this.container.classList.remove("measuring");
|
|
@@ -428,31 +418,31 @@ var __decorateClass$1j = (decorators, target, key, kind) => {
|
|
|
428
418
|
return result;
|
|
429
419
|
};
|
|
430
420
|
var __accessCheck$u = (obj, member, msg) => member.has(obj) || __typeError$u("Cannot " + msg);
|
|
431
|
-
var __privateGet$
|
|
421
|
+
var __privateGet$o = (obj, member, getter) => (__accessCheck$u(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
432
422
|
var __privateAdd$u = (obj, member, value) => member.has(obj) ? __typeError$u("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
433
423
|
var __privateSet$5 = (obj, member, value, setter) => (__accessCheck$u(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
434
424
|
var __privateMethod$h = (obj, member, method) => (__accessCheck$u(obj, member, "access private method"), method);
|
|
435
|
-
var _anchorObserver, _OdxAnchorNavigation_instances, handleContainerChange_fn, _handleClick$
|
|
425
|
+
var _anchorObserver, _OdxAnchorNavigation_instances, handleContainerChange_fn, _handleClick$6;
|
|
436
426
|
let OdxAnchorNavigation = class extends SignalWatcher(CustomElement) {
|
|
437
427
|
constructor() {
|
|
438
428
|
super();
|
|
439
429
|
__privateAdd$u(this, _OdxAnchorNavigation_instances);
|
|
440
430
|
__privateAdd$u(this, _anchorObserver);
|
|
441
431
|
this.vertical = false;
|
|
442
|
-
__privateAdd$u(this, _handleClick$
|
|
432
|
+
__privateAdd$u(this, _handleClick$6, (event) => {
|
|
443
433
|
const target = getElementFromEvent(event, (node) => node instanceof OdxLink);
|
|
444
434
|
if (!target) return;
|
|
445
435
|
event.preventDefault();
|
|
446
436
|
document.querySelector(target.href)?.scrollIntoView();
|
|
447
437
|
});
|
|
448
|
-
this.addEventListener("click", __privateGet$
|
|
438
|
+
this.addEventListener("click", __privateGet$o(this, _handleClick$6));
|
|
449
439
|
}
|
|
450
440
|
connectedCallback() {
|
|
451
441
|
super.connectedCallback();
|
|
452
442
|
__privateMethod$h(this, _OdxAnchorNavigation_instances, handleContainerChange_fn).call(this);
|
|
453
443
|
}
|
|
454
444
|
disconnectedCallback() {
|
|
455
|
-
__privateGet$
|
|
445
|
+
__privateGet$o(this, _anchorObserver)?.disconnect();
|
|
456
446
|
super.disconnectedCallback();
|
|
457
447
|
}
|
|
458
448
|
renderAnchorLink(anchor, isActive = false) {
|
|
@@ -467,8 +457,8 @@ let OdxAnchorNavigation = class extends SignalWatcher(CustomElement) {
|
|
|
467
457
|
);
|
|
468
458
|
}
|
|
469
459
|
render() {
|
|
470
|
-
const anchors = __privateGet$
|
|
471
|
-
const visibleAnchors = __privateGet$
|
|
460
|
+
const anchors = __privateGet$o(this, _anchorObserver)?.anchors.value ?? [];
|
|
461
|
+
const visibleAnchors = __privateGet$o(this, _anchorObserver)?.visibleAnchors.value;
|
|
472
462
|
return repeat(
|
|
473
463
|
anchors,
|
|
474
464
|
(anchor) => anchor.id,
|
|
@@ -485,12 +475,12 @@ _anchorObserver = new WeakMap();
|
|
|
485
475
|
_OdxAnchorNavigation_instances = new WeakSet();
|
|
486
476
|
handleContainerChange_fn = function() {
|
|
487
477
|
const root = this.container ? document.querySelector(this.container) : null;
|
|
488
|
-
if (root === __privateGet$
|
|
489
|
-
__privateGet$
|
|
478
|
+
if (root === __privateGet$o(this, _anchorObserver)?.root) return;
|
|
479
|
+
__privateGet$o(this, _anchorObserver)?.disconnect();
|
|
490
480
|
__privateSet$5(this, _anchorObserver, new AnchorObserver(root));
|
|
491
|
-
__privateGet$
|
|
481
|
+
__privateGet$o(this, _anchorObserver)?.observe();
|
|
492
482
|
};
|
|
493
|
-
_handleClick$
|
|
483
|
+
_handleClick$6 = new WeakMap();
|
|
494
484
|
__decorateClass$1j([
|
|
495
485
|
property()
|
|
496
486
|
], OdxAnchorNavigation.prototype, "container", 2);
|
|
@@ -810,7 +800,7 @@ var __decorateClass$1b = (decorators, target, key, kind) => {
|
|
|
810
800
|
return result;
|
|
811
801
|
};
|
|
812
802
|
var __accessCheck$s = (obj, member, msg) => member.has(obj) || __typeError$s("Cannot " + msg);
|
|
813
|
-
var __privateGet$
|
|
803
|
+
var __privateGet$n = (obj, member, getter) => (__accessCheck$s(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
814
804
|
var __privateAdd$s = (obj, member, value) => member.has(obj) ? __typeError$s("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
815
805
|
var __privateMethod$f = (obj, member, method) => (__accessCheck$s(obj, member, "access private method"), method);
|
|
816
806
|
var _internals, _OdxButton_instances, handleClick_fn;
|
|
@@ -839,11 +829,11 @@ _internals = new WeakMap();
|
|
|
839
829
|
_OdxButton_instances = new WeakSet();
|
|
840
830
|
handleClick_fn = function(_event) {
|
|
841
831
|
if (this.type === "submit") {
|
|
842
|
-
__privateGet$
|
|
832
|
+
__privateGet$n(this, _internals).form?.requestSubmit();
|
|
843
833
|
return;
|
|
844
834
|
}
|
|
845
835
|
if (this.type === "reset") {
|
|
846
|
-
__privateGet$
|
|
836
|
+
__privateGet$n(this, _internals).form?.reset();
|
|
847
837
|
return;
|
|
848
838
|
}
|
|
849
839
|
};
|
|
@@ -912,7 +902,7 @@ var __decorateClass$19 = (decorators, target, key, kind) => {
|
|
|
912
902
|
return result;
|
|
913
903
|
};
|
|
914
904
|
var __accessCheck$r = (obj, member, msg) => member.has(obj) || __typeError$r("Cannot " + msg);
|
|
915
|
-
var __privateGet$
|
|
905
|
+
var __privateGet$m = (obj, member, getter) => (__accessCheck$r(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
916
906
|
var __privateAdd$r = (obj, member, value) => member.has(obj) ? __typeError$r("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
917
907
|
var _handleSlotChange$8, _handleGroupControlChange;
|
|
918
908
|
const CheckboxGroupLayout = { INLINE: "inline", LIST: "list" };
|
|
@@ -921,7 +911,7 @@ let OdxCheckboxGroup = class extends CheckboxGroupFormControl {
|
|
|
921
911
|
super(...arguments);
|
|
922
912
|
__privateAdd$r(this, _handleSlotChange$8, () => {
|
|
923
913
|
for (const control of this.groupControls) {
|
|
924
|
-
control.addEventListener("change", __privateGet$
|
|
914
|
+
control.addEventListener("change", __privateGet$m(this, _handleGroupControlChange));
|
|
925
915
|
}
|
|
926
916
|
});
|
|
927
917
|
__privateAdd$r(this, _handleGroupControlChange, (event) => {
|
|
@@ -935,7 +925,7 @@ let OdxCheckboxGroup = class extends CheckboxGroupFormControl {
|
|
|
935
925
|
});
|
|
936
926
|
}
|
|
937
927
|
render() {
|
|
938
|
-
return html`<slot @slotchange=${__privateGet$
|
|
928
|
+
return html`<slot @slotchange=${__privateGet$m(this, _handleSlotChange$8)}></slot>`;
|
|
939
929
|
}
|
|
940
930
|
};
|
|
941
931
|
_handleSlotChange$8 = new WeakMap();
|
|
@@ -1016,9 +1006,9 @@ var __decorateClass$17 = (decorators, target, key, kind) => {
|
|
|
1016
1006
|
return result;
|
|
1017
1007
|
};
|
|
1018
1008
|
var __accessCheck$q = (obj, member, msg) => member.has(obj) || __typeError$q("Cannot " + msg);
|
|
1019
|
-
var __privateGet$
|
|
1009
|
+
var __privateGet$l = (obj, member, getter) => (__accessCheck$q(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1020
1010
|
var __privateAdd$q = (obj, member, value) => member.has(obj) ? __typeError$q("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1021
|
-
var _handleActionClick, _handleClick$
|
|
1011
|
+
var _handleActionClick, _handleClick$5;
|
|
1022
1012
|
const ChipVariant = enumFrom(Variant, ["NEUTRAL", "PRIMARY", "ACCENT", "SUCCESS", "WARNING", "DANGER"]);
|
|
1023
1013
|
let OdxChip = class extends CanBeDisabled(CustomElement) {
|
|
1024
1014
|
constructor() {
|
|
@@ -1031,7 +1021,7 @@ let OdxChip = class extends CanBeDisabled(CustomElement) {
|
|
|
1031
1021
|
event.stopPropagation();
|
|
1032
1022
|
this.emit("remove");
|
|
1033
1023
|
});
|
|
1034
|
-
__privateAdd$q(this, _handleClick$
|
|
1024
|
+
__privateAdd$q(this, _handleClick$5, (event) => {
|
|
1035
1025
|
if (this.removable) {
|
|
1036
1026
|
const actionElement = getElementFromEvent(event, (node) => !!this.actionElement && node === this.actionElement);
|
|
1037
1027
|
if (actionElement) return;
|
|
@@ -1048,7 +1038,7 @@ let OdxChip = class extends CanBeDisabled(CustomElement) {
|
|
|
1048
1038
|
}
|
|
1049
1039
|
renderAction() {
|
|
1050
1040
|
return html`
|
|
1051
|
-
<button class="action" ?disabled=${this.disabled} @click=${__privateGet$
|
|
1041
|
+
<button class="action" ?disabled=${this.disabled} @click=${__privateGet$l(this, _handleActionClick)}>
|
|
1052
1042
|
<odx-icon class="action-icon" name="core::close"></odx-icon>
|
|
1053
1043
|
</button>
|
|
1054
1044
|
`;
|
|
@@ -1065,15 +1055,15 @@ let OdxChip = class extends CanBeDisabled(CustomElement) {
|
|
|
1065
1055
|
updated(props) {
|
|
1066
1056
|
if (props.has("removable") || props.has("interactive") || props.has("disabled")) {
|
|
1067
1057
|
if (this.removable || this.interactive) {
|
|
1068
|
-
this.addEventListener("click", __privateGet$
|
|
1058
|
+
this.addEventListener("click", __privateGet$l(this, _handleClick$5), { capture: true });
|
|
1069
1059
|
} else {
|
|
1070
|
-
this.removeEventListener("click", __privateGet$
|
|
1060
|
+
this.removeEventListener("click", __privateGet$l(this, _handleClick$5));
|
|
1071
1061
|
}
|
|
1072
1062
|
}
|
|
1073
1063
|
}
|
|
1074
1064
|
};
|
|
1075
1065
|
_handleActionClick = new WeakMap();
|
|
1076
|
-
_handleClick$
|
|
1066
|
+
_handleClick$5 = new WeakMap();
|
|
1077
1067
|
__decorateClass$17([
|
|
1078
1068
|
query(".action")
|
|
1079
1069
|
], OdxChip.prototype, "actionElement", 2);
|
|
@@ -1106,7 +1096,7 @@ var __decorateClass$16 = (decorators, target, key, kind) => {
|
|
|
1106
1096
|
return result;
|
|
1107
1097
|
};
|
|
1108
1098
|
var __accessCheck$p = (obj, member, msg) => member.has(obj) || __typeError$p("Cannot " + msg);
|
|
1109
|
-
var __privateGet$
|
|
1099
|
+
var __privateGet$k = (obj, member, getter) => (__accessCheck$p(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1110
1100
|
var __privateAdd$p = (obj, member, value) => member.has(obj) ? __typeError$p("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1111
1101
|
var __privateSet$4 = (obj, member, value, setter) => (__accessCheck$p(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
1112
1102
|
var _value$1, _OdxCircularProgressBar_instances, circumference_get, radius_get, progressValue_get, normalizedStrokeWidth_get;
|
|
@@ -1130,7 +1120,7 @@ let OdxCircularProgressBar = class extends CustomElement {
|
|
|
1130
1120
|
}
|
|
1131
1121
|
}
|
|
1132
1122
|
get value() {
|
|
1133
|
-
return __privateGet$
|
|
1123
|
+
return __privateGet$k(this, _value$1);
|
|
1134
1124
|
}
|
|
1135
1125
|
firstUpdated(changes) {
|
|
1136
1126
|
super.firstUpdated?.(changes);
|
|
@@ -1148,17 +1138,17 @@ let OdxCircularProgressBar = class extends CustomElement {
|
|
|
1148
1138
|
<svg part="inner" viewBox="0 0 ${this.viewPortSize} ${this.viewPortSize}">
|
|
1149
1139
|
<circle
|
|
1150
1140
|
part="track"
|
|
1151
|
-
stroke-width="${__privateGet$
|
|
1152
|
-
r="${__privateGet$
|
|
1141
|
+
stroke-width="${__privateGet$k(this, _OdxCircularProgressBar_instances, normalizedStrokeWidth_get)}"
|
|
1142
|
+
r="${__privateGet$k(this, _OdxCircularProgressBar_instances, radius_get)}"
|
|
1153
1143
|
cx="50%"
|
|
1154
1144
|
cy="50%"
|
|
1155
1145
|
/>
|
|
1156
1146
|
<circle
|
|
1157
1147
|
part="indicator"
|
|
1158
|
-
stroke-dasharray="${__privateGet$
|
|
1159
|
-
stroke-dashoffset="${__privateGet$
|
|
1160
|
-
stroke-width="${__privateGet$
|
|
1161
|
-
r="${__privateGet$
|
|
1148
|
+
stroke-dasharray="${__privateGet$k(this, _OdxCircularProgressBar_instances, circumference_get)}"
|
|
1149
|
+
stroke-dashoffset="${__privateGet$k(this, _OdxCircularProgressBar_instances, progressValue_get)}"
|
|
1150
|
+
stroke-width="${__privateGet$k(this, _OdxCircularProgressBar_instances, normalizedStrokeWidth_get)}"
|
|
1151
|
+
r="${__privateGet$k(this, _OdxCircularProgressBar_instances, radius_get)}"
|
|
1162
1152
|
cx="50%"
|
|
1163
1153
|
cy="50%"
|
|
1164
1154
|
/>
|
|
@@ -1175,13 +1165,13 @@ let OdxCircularProgressBar = class extends CustomElement {
|
|
|
1175
1165
|
_value$1 = new WeakMap();
|
|
1176
1166
|
_OdxCircularProgressBar_instances = new WeakSet();
|
|
1177
1167
|
circumference_get = function() {
|
|
1178
|
-
return Math.floor(2 * __privateGet$
|
|
1168
|
+
return Math.floor(2 * __privateGet$k(this, _OdxCircularProgressBar_instances, radius_get) * Math.PI);
|
|
1179
1169
|
};
|
|
1180
1170
|
radius_get = function() {
|
|
1181
|
-
return Math.max(0, this.viewPortSize / 2 - __privateGet$
|
|
1171
|
+
return Math.max(0, this.viewPortSize / 2 - __privateGet$k(this, _OdxCircularProgressBar_instances, normalizedStrokeWidth_get) / 2);
|
|
1182
1172
|
};
|
|
1183
1173
|
progressValue_get = function() {
|
|
1184
|
-
return this.indeterminate ? __privateGet$
|
|
1174
|
+
return this.indeterminate ? __privateGet$k(this, _OdxCircularProgressBar_instances, circumference_get) : Math.floor((1 - __privateGet$k(this, _value$1) / 100) * __privateGet$k(this, _OdxCircularProgressBar_instances, circumference_get));
|
|
1185
1175
|
};
|
|
1186
1176
|
normalizedStrokeWidth_get = function() {
|
|
1187
1177
|
if (this.stroke < 0) return 0;
|
|
@@ -1224,10 +1214,10 @@ var __decorateClass$15 = (decorators, target, key, kind) => {
|
|
|
1224
1214
|
return result;
|
|
1225
1215
|
};
|
|
1226
1216
|
var __accessCheck$o = (obj, member, msg) => member.has(obj) || __typeError$o("Cannot " + msg);
|
|
1227
|
-
var __privateGet$
|
|
1217
|
+
var __privateGet$j = (obj, member, getter) => (__accessCheck$o(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1228
1218
|
var __privateAdd$o = (obj, member, value) => member.has(obj) ? __typeError$o("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1229
1219
|
var __privateMethod$e = (obj, member, method) => (__accessCheck$o(obj, member, "access private method"), method);
|
|
1230
|
-
var _OdxDropdown_instances, updateAriaAttributes_fn$
|
|
1220
|
+
var _OdxDropdown_instances, updateAriaAttributes_fn$1, _handleClick$4, _handleKeyboardEvent$1;
|
|
1231
1221
|
const DropdownPlacement = { TOP: PopoverPlacement.TOP, BOTTOM: PopoverPlacement.BOTTOM };
|
|
1232
1222
|
let OdxDropdown = class extends CanBeDisabled(PopoverHost) {
|
|
1233
1223
|
constructor() {
|
|
@@ -1235,7 +1225,7 @@ let OdxDropdown = class extends CanBeDisabled(PopoverHost) {
|
|
|
1235
1225
|
__privateAdd$o(this, _OdxDropdown_instances);
|
|
1236
1226
|
this.matchReferenceWidth = false;
|
|
1237
1227
|
this.placement = DropdownPlacement.BOTTOM;
|
|
1238
|
-
__privateAdd$o(this, _handleClick$
|
|
1228
|
+
__privateAdd$o(this, _handleClick$4, (_event) => {
|
|
1239
1229
|
this.togglePopover();
|
|
1240
1230
|
});
|
|
1241
1231
|
__privateAdd$o(this, _handleKeyboardEvent$1, (event) => {
|
|
@@ -1260,16 +1250,16 @@ let OdxDropdown = class extends CanBeDisabled(PopoverHost) {
|
|
|
1260
1250
|
mountPopover(referenceElement) {
|
|
1261
1251
|
super.mountPopover(referenceElement);
|
|
1262
1252
|
if (this.disabled || !referenceElement) return;
|
|
1263
|
-
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$
|
|
1264
|
-
referenceElement.addEventListener("click", __privateGet$
|
|
1265
|
-
referenceElement.addEventListener("keydown", __privateGet$
|
|
1253
|
+
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$1).call(this, referenceElement, this.id);
|
|
1254
|
+
referenceElement.addEventListener("click", __privateGet$j(this, _handleClick$4));
|
|
1255
|
+
referenceElement.addEventListener("keydown", __privateGet$j(this, _handleKeyboardEvent$1));
|
|
1266
1256
|
this.emit("mount", { detail: { referenceElement } });
|
|
1267
1257
|
}
|
|
1268
1258
|
unmountPopover(referenceElement) {
|
|
1269
1259
|
super.unmountPopover(referenceElement);
|
|
1270
|
-
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$
|
|
1271
|
-
referenceElement.removeEventListener("click", __privateGet$
|
|
1272
|
-
referenceElement.removeEventListener("keydown", __privateGet$
|
|
1260
|
+
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$1).call(this, referenceElement, null);
|
|
1261
|
+
referenceElement.removeEventListener("click", __privateGet$j(this, _handleClick$4));
|
|
1262
|
+
referenceElement.removeEventListener("keydown", __privateGet$j(this, _handleKeyboardEvent$1));
|
|
1273
1263
|
this.emit("unmount", { detail: { referenceElement } });
|
|
1274
1264
|
}
|
|
1275
1265
|
onBeforePopoverShow() {
|
|
@@ -1294,7 +1284,7 @@ let OdxDropdown = class extends CanBeDisabled(PopoverHost) {
|
|
|
1294
1284
|
willUpdate(props) {
|
|
1295
1285
|
super.willUpdate?.(props);
|
|
1296
1286
|
if (props.has("id")) {
|
|
1297
|
-
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$
|
|
1287
|
+
__privateMethod$e(this, _OdxDropdown_instances, updateAriaAttributes_fn$1).call(this, this.referenceElement, this.id);
|
|
1298
1288
|
}
|
|
1299
1289
|
if (props.has("disabled")) {
|
|
1300
1290
|
if (this.disabled) {
|
|
@@ -1306,10 +1296,10 @@ let OdxDropdown = class extends CanBeDisabled(PopoverHost) {
|
|
|
1306
1296
|
}
|
|
1307
1297
|
};
|
|
1308
1298
|
_OdxDropdown_instances = new WeakSet();
|
|
1309
|
-
updateAriaAttributes_fn$
|
|
1299
|
+
updateAriaAttributes_fn$1 = function(referenceElement, id) {
|
|
1310
1300
|
toggleAttribute(referenceElement, "aria-describedby", id);
|
|
1311
1301
|
};
|
|
1312
|
-
_handleClick$
|
|
1302
|
+
_handleClick$4 = new WeakMap();
|
|
1313
1303
|
_handleKeyboardEvent$1 = new WeakMap();
|
|
1314
1304
|
__decorateClass$15([
|
|
1315
1305
|
query("odx-popover", true)
|
|
@@ -1340,7 +1330,7 @@ var __decorateClass$14 = (decorators, target, key, kind) => {
|
|
|
1340
1330
|
return result;
|
|
1341
1331
|
};
|
|
1342
1332
|
var __accessCheck$n = (obj, member, msg) => member.has(obj) || __typeError$n("Cannot " + msg);
|
|
1343
|
-
var __privateGet$
|
|
1333
|
+
var __privateGet$i = (obj, member, getter) => (__accessCheck$n(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1344
1334
|
var __privateAdd$n = (obj, member, value) => member.has(obj) ? __typeError$n("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1345
1335
|
var _handleSlotChange$7, _handleControlChange, _handleControlKeyboardEvent, _handleControlInput, _handleControlClear;
|
|
1346
1336
|
let OdxCombobox = class extends ListboxFormControl {
|
|
@@ -1353,9 +1343,9 @@ let OdxCombobox = class extends ListboxFormControl {
|
|
|
1353
1343
|
});
|
|
1354
1344
|
__privateAdd$n(this, _handleControlChange, () => {
|
|
1355
1345
|
if (!this.control) return;
|
|
1356
|
-
this.control.addEventListener("clear", __privateGet$
|
|
1357
|
-
this.control.addEventListener("input", __privateGet$
|
|
1358
|
-
this.control.addEventListener("keydown", __privateGet$
|
|
1346
|
+
this.control.addEventListener("clear", __privateGet$i(this, _handleControlClear));
|
|
1347
|
+
this.control.addEventListener("input", __privateGet$i(this, _handleControlInput));
|
|
1348
|
+
this.control.addEventListener("keydown", __privateGet$i(this, _handleControlKeyboardEvent));
|
|
1359
1349
|
this.dropdown.referenceElement = this.control;
|
|
1360
1350
|
});
|
|
1361
1351
|
__privateAdd$n(this, _handleControlKeyboardEvent, (event) => {
|
|
@@ -1384,11 +1374,11 @@ let OdxCombobox = class extends ListboxFormControl {
|
|
|
1384
1374
|
render() {
|
|
1385
1375
|
return html`
|
|
1386
1376
|
<odx-highlight>
|
|
1387
|
-
<slot name="control" @slotchange=${__privateGet$
|
|
1377
|
+
<slot name="control" @slotchange=${__privateGet$i(this, _handleControlChange)}>
|
|
1388
1378
|
</slot>
|
|
1389
1379
|
</odx-highlight>
|
|
1390
1380
|
<odx-dropdown part="dropdown" role="listbox" tabindex="-1" ?disabled=${this.disabled} match-reference-width>
|
|
1391
|
-
<slot @slotchange=${__privateGet$
|
|
1381
|
+
<slot @slotchange=${__privateGet$i(this, _handleSlotChange$7)}></slot>
|
|
1392
1382
|
</odx-dropdown>
|
|
1393
1383
|
`;
|
|
1394
1384
|
}
|
|
@@ -1456,7 +1446,7 @@ var __decorateClass$12 = (decorators, target, key, kind) => {
|
|
|
1456
1446
|
return result;
|
|
1457
1447
|
};
|
|
1458
1448
|
var __accessCheck$m = (obj, member, msg) => member.has(obj) || __typeError$m("Cannot " + msg);
|
|
1459
|
-
var __privateGet$
|
|
1449
|
+
var __privateGet$h = (obj, member, getter) => (__accessCheck$m(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1460
1450
|
var __privateAdd$m = (obj, member, value) => member.has(obj) ? __typeError$m("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1461
1451
|
var _handleSlotChange$6;
|
|
1462
1452
|
const FORM_FIELD_CONTROL_SELECTOR = "odx-form-field-control";
|
|
@@ -1476,7 +1466,7 @@ let OdxFormField = class extends CustomElement {
|
|
|
1476
1466
|
render() {
|
|
1477
1467
|
const isValid = this.control?.checkValidity();
|
|
1478
1468
|
return html`
|
|
1479
|
-
<slot @slotchange=${__privateGet$
|
|
1469
|
+
<slot @slotchange=${__privateGet$h(this, _handleSlotChange$6)}></slot>
|
|
1480
1470
|
${when(isValid === false, () => this.renderErrorMessage())}
|
|
1481
1471
|
|
|
1482
1472
|
`;
|
|
@@ -1665,7 +1655,7 @@ var __decorateClass$Z = (decorators, target, key, kind) => {
|
|
|
1665
1655
|
return result;
|
|
1666
1656
|
};
|
|
1667
1657
|
var __accessCheck$l = (obj, member, msg) => member.has(obj) || __typeError$l("Cannot " + msg);
|
|
1668
|
-
var __privateGet$
|
|
1658
|
+
var __privateGet$g = (obj, member, getter) => (__accessCheck$l(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1669
1659
|
var __privateAdd$l = (obj, member, value) => member.has(obj) ? __typeError$l("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1670
1660
|
var __privateSet$3 = (obj, member, value, setter) => (__accessCheck$l(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
1671
1661
|
var __privateMethod$d = (obj, member, method) => (__accessCheck$l(obj, member, "access private method"), method);
|
|
@@ -1686,7 +1676,7 @@ let OdxRelativeTime = class extends BaseFormat {
|
|
|
1686
1676
|
}
|
|
1687
1677
|
disconnectedCallback() {
|
|
1688
1678
|
super.disconnectedCallback();
|
|
1689
|
-
clearInterval(__privateGet$
|
|
1679
|
+
clearInterval(__privateGet$g(this, _syncInterval));
|
|
1690
1680
|
}
|
|
1691
1681
|
willUpdate(props) {
|
|
1692
1682
|
super.willUpdate?.(props);
|
|
@@ -1702,7 +1692,7 @@ let OdxRelativeTime = class extends BaseFormat {
|
|
|
1702
1692
|
_syncInterval = new WeakMap();
|
|
1703
1693
|
_OdxRelativeTime_instances = new WeakSet();
|
|
1704
1694
|
setupSyncInterval_fn = function() {
|
|
1705
|
-
clearInterval(__privateGet$
|
|
1695
|
+
clearInterval(__privateGet$g(this, _syncInterval));
|
|
1706
1696
|
if (typeof this.syncInterval !== "number") return;
|
|
1707
1697
|
__privateSet$3(this, _syncInterval, window.setInterval(() => this.requestUpdate(), Math.max(this.syncInterval, 1e3)));
|
|
1708
1698
|
};
|
|
@@ -1792,7 +1782,7 @@ var __decorateClass$W = (decorators, target, key, kind) => {
|
|
|
1792
1782
|
return result;
|
|
1793
1783
|
};
|
|
1794
1784
|
var __accessCheck$k = (obj, member, msg) => member.has(obj) || __typeError$k("Cannot " + msg);
|
|
1795
|
-
var __privateGet$
|
|
1785
|
+
var __privateGet$f = (obj, member, getter) => (__accessCheck$k(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
1796
1786
|
var __privateAdd$k = (obj, member, value) => member.has(obj) ? __typeError$k("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
1797
1787
|
var _handleSlotChange$5;
|
|
1798
1788
|
let OdxHeader = class extends CustomElement {
|
|
@@ -1816,7 +1806,7 @@ let OdxHeader = class extends CustomElement {
|
|
|
1816
1806
|
<div class="base">
|
|
1817
1807
|
<slot name="prefix"></slot>
|
|
1818
1808
|
<odx-logo size="sm"></odx-logo>
|
|
1819
|
-
<slot @slotchange=${__privateGet$
|
|
1809
|
+
<slot @slotchange=${__privateGet$f(this, _handleSlotChange$5)}></slot>
|
|
1820
1810
|
<slot name="actions"></slot>
|
|
1821
1811
|
</div>
|
|
1822
1812
|
<div class="background"></div>
|
|
@@ -2147,7 +2137,7 @@ var __decorateClass$Q = (decorators, target, key, kind) => {
|
|
|
2147
2137
|
return result;
|
|
2148
2138
|
};
|
|
2149
2139
|
var __accessCheck$i = (obj, member, msg) => member.has(obj) || __typeError$i("Cannot " + msg);
|
|
2150
|
-
var __privateGet$
|
|
2140
|
+
var __privateGet$e = (obj, member, getter) => (__accessCheck$i(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2151
2141
|
var __privateAdd$i = (obj, member, value) => member.has(obj) ? __typeError$i("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2152
2142
|
var __privateMethod$b = (obj, member, method) => (__accessCheck$i(obj, member, "access private method"), method);
|
|
2153
2143
|
var _OdxInput_instances, isClearable_fn$1, _handleClear$2, _handleInput$1, _handleKeyDown$2;
|
|
@@ -2183,7 +2173,7 @@ let OdxInput = class extends FormControl(CustomElement) {
|
|
|
2183
2173
|
render() {
|
|
2184
2174
|
const clearButton = when(
|
|
2185
2175
|
__privateMethod$b(this, _OdxInput_instances, isClearable_fn$1).call(this),
|
|
2186
|
-
() => html`<odx-icon-button class="clear" icon="core::close" size="sm" tabindex="-1" variant="ghost" @click=${__privateGet$
|
|
2176
|
+
() => html`<odx-icon-button class="clear" icon="core::close" size="sm" tabindex="-1" variant="ghost" @click=${__privateGet$e(this, _handleClear$2)}></odx-icon-button>`
|
|
2187
2177
|
);
|
|
2188
2178
|
return html`
|
|
2189
2179
|
<div part="base">
|
|
@@ -2196,9 +2186,9 @@ let OdxInput = class extends FormControl(CustomElement) {
|
|
|
2196
2186
|
?readonly=${this.readonly}
|
|
2197
2187
|
.value=${this.value}
|
|
2198
2188
|
size="1"
|
|
2199
|
-
@keydown=${__privateGet$
|
|
2189
|
+
@keydown=${__privateGet$e(this, _handleKeyDown$2)}
|
|
2200
2190
|
@change=${forwardEvent(this)}
|
|
2201
|
-
@input=${__privateGet$
|
|
2191
|
+
@input=${__privateGet$e(this, _handleInput$1)}
|
|
2202
2192
|
@search=${forwardEvent(this)}
|
|
2203
2193
|
/>
|
|
2204
2194
|
${clearButton}
|
|
@@ -2284,36 +2274,28 @@ var __decorateClass$O = (decorators, target, key, kind) => {
|
|
|
2284
2274
|
return result;
|
|
2285
2275
|
};
|
|
2286
2276
|
var __accessCheck$h = (obj, member, msg) => member.has(obj) || __typeError$h("Cannot " + msg);
|
|
2287
|
-
var __privateGet$e = (obj, member, getter) => (__accessCheck$h(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2288
2277
|
var __privateAdd$h = (obj, member, value) => member.has(obj) ? __typeError$h("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2289
2278
|
var __privateMethod$a = (obj, member, method) => (__accessCheck$h(obj, member, "access private method"), method);
|
|
2290
|
-
var _OdxListItem_instances,
|
|
2279
|
+
var _OdxListItem_instances, handleExpandedChange_fn;
|
|
2291
2280
|
let OdxListItem = class extends CanBeSelected(CanBeExpanded(InteractiveElement)) {
|
|
2292
2281
|
constructor() {
|
|
2293
|
-
super();
|
|
2282
|
+
super(...arguments);
|
|
2294
2283
|
__privateAdd$h(this, _OdxListItem_instances);
|
|
2295
2284
|
this.compact = false;
|
|
2296
2285
|
this.muted = false;
|
|
2297
2286
|
this.withExpandControl = false;
|
|
2298
2287
|
this.withExpandIndicator = false;
|
|
2299
|
-
__privateAdd$h(this, _handleClick$4, (event) => {
|
|
2300
|
-
const expandControl = this.getExpandControl();
|
|
2301
|
-
if (!(this.withExpandIndicator || this.isExpandable()) || !getElementFromEvent(event, (node) => node === expandControl)) return;
|
|
2302
|
-
this.toggle();
|
|
2303
|
-
});
|
|
2304
|
-
if (!isServer) {
|
|
2305
|
-
this.addEventListener("click", __privateGet$e(this, _handleClick$4));
|
|
2306
|
-
}
|
|
2307
2288
|
}
|
|
2308
2289
|
isExpandable() {
|
|
2309
2290
|
return !this.disabled && !this.loading && this.expandableItems.length > 0;
|
|
2310
2291
|
}
|
|
2311
2292
|
getExpandControl() {
|
|
2293
|
+
if (!this.isExpandable()) return null;
|
|
2312
2294
|
return this.shadowRoot?.querySelector(this.withExpandControl ? '[part="expand-control"]' : '[part="base"]') ?? null;
|
|
2313
2295
|
}
|
|
2314
2296
|
connectedCallback() {
|
|
2315
2297
|
super.connectedCallback();
|
|
2316
|
-
this.role
|
|
2298
|
+
this.role = "listitem";
|
|
2317
2299
|
}
|
|
2318
2300
|
render() {
|
|
2319
2301
|
const expandSlot = html`<slot name="expand" @slotchange=${() => this.requestUpdate()}></slot>`;
|
|
@@ -2348,22 +2330,23 @@ let OdxListItem = class extends CanBeSelected(CanBeExpanded(InteractiveElement))
|
|
|
2348
2330
|
)}
|
|
2349
2331
|
`;
|
|
2350
2332
|
}
|
|
2351
|
-
|
|
2333
|
+
willUpdate(props) {
|
|
2352
2334
|
super.updated?.(props);
|
|
2353
2335
|
if (props.has("disabled") || props.has("expanded")) {
|
|
2354
|
-
__privateMethod$a(this, _OdxListItem_instances,
|
|
2336
|
+
__privateMethod$a(this, _OdxListItem_instances, handleExpandedChange_fn).call(this);
|
|
2355
2337
|
}
|
|
2356
2338
|
}
|
|
2357
2339
|
};
|
|
2358
2340
|
_OdxListItem_instances = new WeakSet();
|
|
2359
|
-
|
|
2341
|
+
handleExpandedChange_fn = function() {
|
|
2360
2342
|
const expandControl = this.getExpandControl();
|
|
2361
2343
|
if (!this.region || !expandControl) return;
|
|
2362
2344
|
this.region.setAttribute("aria-labelledby", "expand-control");
|
|
2363
2345
|
expandControl.ariaExpanded = toAriaBooleanAttribute(this.expanded);
|
|
2364
2346
|
expandControl.setAttribute("aria-controls", this.region.id);
|
|
2347
|
+
if (this.expanded) return;
|
|
2348
|
+
this.querySelector("odx-list")?.toggleAll(false);
|
|
2365
2349
|
};
|
|
2366
|
-
_handleClick$4 = new WeakMap();
|
|
2367
2350
|
__decorateClass$O([
|
|
2368
2351
|
queryAssignedElements({ slot: "expand" })
|
|
2369
2352
|
], OdxListItem.prototype, "expandableItems", 2);
|
|
@@ -2386,7 +2369,7 @@ OdxListItem = __decorateClass$O([
|
|
|
2386
2369
|
customElement("odx-list-item", [styles$J])
|
|
2387
2370
|
], OdxListItem);
|
|
2388
2371
|
|
|
2389
|
-
const styles$I = "@layer base{:host{display:block;--item-indent-level: 0}::slotted(
|
|
2372
|
+
const styles$I = "@layer base{:host{display:block;--item-indent-level: 0}::slotted([role=\"listitem\"]){--indent-level: var(--item-indent-level)}}";
|
|
2390
2373
|
|
|
2391
2374
|
var __defProp$N = Object.defineProperty;
|
|
2392
2375
|
var __getOwnPropDesc$N = Object.getOwnPropertyDescriptor;
|
|
@@ -2402,13 +2385,21 @@ let OdxList = class extends CustomElement {
|
|
|
2402
2385
|
constructor() {
|
|
2403
2386
|
super();
|
|
2404
2387
|
this.multiple = false;
|
|
2405
|
-
new ExpandableItemManager(this, { getItems: () =>
|
|
2388
|
+
new ExpandableItemManager(this, { getItems: () => this.items });
|
|
2406
2389
|
}
|
|
2407
2390
|
connectedCallback() {
|
|
2408
2391
|
super.connectedCallback();
|
|
2409
2392
|
this.role = "list";
|
|
2410
2393
|
}
|
|
2394
|
+
toggleAll(force, emitEvent = false) {
|
|
2395
|
+
for (const item of this.items) {
|
|
2396
|
+
item.toggle(force, emitEvent);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2411
2399
|
};
|
|
2400
|
+
__decorateClass$N([
|
|
2401
|
+
queryAssignedElements({ selector: '[role="listitem"]', flatten: true })
|
|
2402
|
+
], OdxList.prototype, "items", 2);
|
|
2412
2403
|
__decorateClass$N([
|
|
2413
2404
|
property({ type: Boolean, reflect: true })
|
|
2414
2405
|
], OdxList.prototype, "multiple", 2);
|
|
@@ -3481,7 +3472,7 @@ let OdxRailNavigation = class extends IsLocalized(CustomElement) {
|
|
|
3481
3472
|
super(...arguments);
|
|
3482
3473
|
this.collapsed = false;
|
|
3483
3474
|
__privateAdd$a(this, _handleSlotChange$3, () => {
|
|
3484
|
-
for (const item of
|
|
3475
|
+
for (const item of this.navigationItems) {
|
|
3485
3476
|
item.size = "lg";
|
|
3486
3477
|
}
|
|
3487
3478
|
});
|
|
@@ -10,7 +10,7 @@ export interface ExpandableItemManagerOptions<T extends ExpandableItem = Expanda
|
|
|
10
10
|
export declare const ExpandableItemManagerOptions: (options?: Partial<ExpandableItemManagerOptions>) => ExpandableItemManagerOptions;
|
|
11
11
|
export declare class ExpandableItemManager<T extends ExpandableItem> implements ReactiveController {
|
|
12
12
|
#private;
|
|
13
|
-
get
|
|
13
|
+
get items(): T[];
|
|
14
14
|
constructor(host: ExpandableItemManagerHost, options?: ExpandableItemManagerOptions);
|
|
15
15
|
hostConnected?(): void;
|
|
16
16
|
}
|
|
@@ -3,8 +3,8 @@ import { Constructor } from '../utils/dedupe-mixin.js';
|
|
|
3
3
|
import { CanBeDisabled } from './can-be-disabled.js';
|
|
4
4
|
export interface CanBeExpanded extends CanBeDisabled {
|
|
5
5
|
expanded: boolean;
|
|
6
|
-
expandable: boolean;
|
|
7
6
|
toggle(force?: boolean, emitEvent?: boolean): void;
|
|
7
|
+
getExpandControl(): HTMLElement | null;
|
|
8
8
|
}
|
|
9
9
|
export declare const CanBeExpanded: <T extends Constructor<CustomElement>>(superClass: T) => Constructor<CanBeExpanded> & T;
|
|
10
10
|
//# sourceMappingURL=can-be-expanded.d.ts.map
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { effect } from '@lit-labs/preact-signals';
|
|
2
2
|
import { isServer, LitElement, html, unsafeCSS, nothing } from 'lit';
|
|
3
|
-
import { createFocusTrap } from 'focus-trap';
|
|
4
3
|
import { r as round, u as uniqBy } from './vendor-Cef33Vym.js';
|
|
5
4
|
export { p as enumFrom } from './vendor-Cef33Vym.js';
|
|
5
|
+
import { createFocusTrap } from 'focus-trap';
|
|
6
6
|
import { createContext, ContextProvider, consume } from '@lit/context';
|
|
7
7
|
import { property } from 'lit/decorators.js';
|
|
8
8
|
import { directive, Directive } from 'lit/directive.js';
|
|
@@ -89,7 +89,7 @@ const ExpandableItemManagerOptions = (options) => ({
|
|
|
89
89
|
class ExpandableItemManager {
|
|
90
90
|
#host;
|
|
91
91
|
#config;
|
|
92
|
-
get
|
|
92
|
+
get items() {
|
|
93
93
|
return this.#config.getItems?.() ?? [];
|
|
94
94
|
}
|
|
95
95
|
constructor(host, options) {
|
|
@@ -98,17 +98,24 @@ class ExpandableItemManager {
|
|
|
98
98
|
this.#host.addController(this);
|
|
99
99
|
if (!isServer) {
|
|
100
100
|
this.#host.addEventListener("toggle", this.#handleToggle);
|
|
101
|
+
this.#host.addEventListener("click", this.#handleClick);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
#handleToggle = (event) => {
|
|
104
105
|
if (!event.target) return;
|
|
105
106
|
event.stopPropagation();
|
|
106
107
|
if (!fromToggleEventState(event.newState) || this.#host.multiple) return;
|
|
107
|
-
for (const item of this.
|
|
108
|
+
for (const item of this.items) {
|
|
108
109
|
if (event.target === item) continue;
|
|
109
110
|
item.toggle(false);
|
|
110
111
|
}
|
|
111
112
|
};
|
|
113
|
+
#handleClick = (event) => {
|
|
114
|
+
const item = getElementFromEvent(event, (node) => this.items.includes(node));
|
|
115
|
+
if (!item || !getElementFromEvent(event, (node) => node === item.getExpandControl())) return;
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
item.toggle();
|
|
118
|
+
};
|
|
112
119
|
}
|
|
113
120
|
|
|
114
121
|
function createMutationObserver(callback) {
|
|
@@ -147,7 +154,7 @@ function toPx(value) {
|
|
|
147
154
|
}
|
|
148
155
|
function getAssignedElements(host, ...slots) {
|
|
149
156
|
const selector = slots.map((slot) => `[slot=${slot}]`).join(", ") || "*";
|
|
150
|
-
return Array.from(host.querySelectorAll(
|
|
157
|
+
return Array.from(host.querySelectorAll(selector));
|
|
151
158
|
}
|
|
152
159
|
async function waitForAnimations(element, subtree = false) {
|
|
153
160
|
if (!element || typeof element.getAnimations !== "function") {
|
|
@@ -327,6 +334,9 @@ const CanBeExpanded = dedupeMixin((superClass) => {
|
|
|
327
334
|
super(...arguments);
|
|
328
335
|
this.expanded = false;
|
|
329
336
|
}
|
|
337
|
+
getExpandControl() {
|
|
338
|
+
return this;
|
|
339
|
+
}
|
|
330
340
|
toggle(force, emitEvent = true) {
|
|
331
341
|
const newState = force ?? !this.expanded;
|
|
332
342
|
if (this.disabled || this.expanded === newState) return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odx/foundation",
|
|
3
3
|
"description": "A library of Web Component building blocks for ODX",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.26",
|
|
5
5
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://odx.draeger.com",
|