@odx/foundation 1.0.0-beta.141 → 1.0.0-beta.143
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/anchor-navigation/anchor-navigation.d.ts +4 -3
- package/dist/components/anchor-navigation/index.d.ts +0 -1
- package/dist/components/toggle-button-group/toggle-button-group.d.ts +3 -2
- package/dist/components.js +101 -101
- package/dist/lib/control/radio-group-form-control.d.ts +5 -5
- package/dist/lib/utils/dom.d.ts +1 -1
- package/dist/main.js +15 -12
- package/package.json +6 -6
- package/dist/components/anchor-navigation/anchor-observer.d.ts +0 -13
|
@@ -9,11 +9,12 @@ declare global {
|
|
|
9
9
|
declare const OdxAnchorNavigation_base: typeof CustomElement;
|
|
10
10
|
export declare class OdxAnchorNavigation extends OdxAnchorNavigation_base {
|
|
11
11
|
#private;
|
|
12
|
-
|
|
12
|
+
readonly activeItems: import('@preact/signals-core').ReadonlySignal<OdxNavigationItem[]>;
|
|
13
|
+
root: Document | Element;
|
|
14
|
+
rootMargin?: string;
|
|
15
|
+
threshold: number;
|
|
13
16
|
vertical: boolean;
|
|
14
17
|
constructor();
|
|
15
|
-
getItems(): OdxNavigationItem[];
|
|
16
|
-
connectedCallback(): void;
|
|
17
18
|
disconnectedCallback(): void;
|
|
18
19
|
protected render(): TemplateResult;
|
|
19
20
|
protected updated(props: PropertyValues<this>): void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RadioGroupFormControl } from '../../lib/main.js';
|
|
2
2
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
-
import { ToggleButtonSize, ToggleButtonVariant } from '../toggle-button/toggle-button.js';
|
|
3
|
+
import { OdxToggleButton, ToggleButtonSize, ToggleButtonVariant } from '../toggle-button/toggle-button.js';
|
|
4
4
|
declare global {
|
|
5
5
|
interface HTMLElementTagNameMap {
|
|
6
6
|
'odx-toggle-button-group': OdxToggleButtonGroup;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
export declare class OdxToggleButtonGroup extends RadioGroupFormControl {
|
|
9
|
+
export declare class OdxToggleButtonGroup extends RadioGroupFormControl<OdxToggleButton> {
|
|
10
10
|
#private;
|
|
11
11
|
block: boolean;
|
|
12
12
|
size: ToggleButtonSize;
|
|
@@ -14,4 +14,5 @@ export declare class OdxToggleButtonGroup extends RadioGroupFormControl {
|
|
|
14
14
|
constructor();
|
|
15
15
|
protected render(): TemplateResult | string;
|
|
16
16
|
protected updated(props: PropertyValues<this>): void;
|
|
17
|
+
protected isControl(element: unknown): element is OdxToggleButton;
|
|
17
18
|
}
|
package/dist/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as __decorateClass } from './_virtual_class-decorator-runtime.js';
|
|
2
|
-
import { CustomElement, ExpandableItemManager, customElement, getAssignedElements, CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, Size, Variant, optionalAttr, getIdFromHref, getElementFromEvent,
|
|
2
|
+
import { CustomElement, ExpandableItemManager, customElement, getAssignedElements, CanBeExpanded, InteractiveElement, getUniqueId, toAriaBooleanAttribute, Size, Variant, optionalAttr, getIdFromHref, getElementFromEvent, Shape, InteractiveLink, getAssignedElement, CanBeDisabled, optionalSlot, CheckboxFormControl, CheckboxGroupFormControl, findClosestDocument, Placement, waitForAnimations, PopoverPlacementOptions, computePopoverPlacement, getKeyInfo, FormControl, ActiveDescendantsController, parseDate, toPx, forwardEvent, OptionControl, SharedResizeObserver, ProgressVariant, RadioGroupFormControl, ListboxFormControl, IsDraggable, NumberFormControl, IS_DRAG_ACTIVE_ATTRIBUTE, DragController, clickedOutside, supportsHover } from '@odx/foundation';
|
|
3
3
|
import { property, query, state } from 'lit/decorators.js';
|
|
4
4
|
import { html, isServer, unsafeCSS, css, nothing } from 'lit';
|
|
5
5
|
import { p as pick, e, d 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';
|
|
@@ -22,7 +22,7 @@ const _OdxAccordion = class _OdxAccordion extends CustomElement {
|
|
|
22
22
|
customElement("odx-accordion", styles$1h)(_OdxAccordion);
|
|
23
23
|
}
|
|
24
24
|
getItems() {
|
|
25
|
-
return getAssignedElements(this.renderRoot, { selector: "odx-accordion-item"
|
|
25
|
+
return getAssignedElements(this.renderRoot, { selector: "odx-accordion-item" });
|
|
26
26
|
}
|
|
27
27
|
updated(props) {
|
|
28
28
|
super.updated(props);
|
|
@@ -241,7 +241,7 @@ const _OdxActionButton = class _OdxActionButton extends OdxButton {
|
|
|
241
241
|
this.tooltip?.mountPopover(this.nativeElement);
|
|
242
242
|
if (this.statusTimeout <= 0) return;
|
|
243
243
|
clearTimeout(this.#statusTimeout);
|
|
244
|
-
this.#statusTimeout = setTimeout(() => {
|
|
244
|
+
this.#statusTimeout = globalThis.setTimeout(() => {
|
|
245
245
|
this.done = false;
|
|
246
246
|
this.isStatusMessageShown = false;
|
|
247
247
|
}, timeoutDuration);
|
|
@@ -308,109 +308,95 @@ __decorateClass([
|
|
|
308
308
|
], _OdxNavigationItem.prototype, "selected", 2);
|
|
309
309
|
let OdxNavigationItem = _OdxNavigationItem;
|
|
310
310
|
|
|
311
|
-
const styles$1b = ":host{display:flex;gap:var(--odx-size-37);min-inline-size:180px}:host(:not([vertical])){align-items:center;border-block-end:var(--odx-border-width-thick) solid var(--odx-color-stroke-neutral-subtle);padding-block:var(--odx-size-
|
|
312
|
-
|
|
313
|
-
class AnchorObserver {
|
|
314
|
-
constructor(root, options = {}) {
|
|
315
|
-
this.#intersectionState = signal({});
|
|
316
|
-
this.#anchorToTargetMap = /* @__PURE__ */ new WeakMap();
|
|
317
|
-
this.#anchors = signal([]);
|
|
318
|
-
this.activeAnchors = computed(() => this.#anchors.value.filter((anchor) => this.isAnchorActive(anchor)));
|
|
319
|
-
this.root = root;
|
|
320
|
-
this.#intersectionObserver = new IntersectionObserver(
|
|
321
|
-
(entries) => {
|
|
322
|
-
const state = this.#intersectionState.value;
|
|
323
|
-
for (const entry of entries) {
|
|
324
|
-
if (!entry.target.id) continue;
|
|
325
|
-
state[entry.target.id] = entry.isIntersecting;
|
|
326
|
-
}
|
|
327
|
-
this.#intersectionState.value = { ...state };
|
|
328
|
-
},
|
|
329
|
-
{ root, threshold: options.threshold ?? 0.1 }
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
#intersectionObserver;
|
|
333
|
-
#intersectionState;
|
|
334
|
-
#anchorToTargetMap;
|
|
335
|
-
#anchors;
|
|
336
|
-
disconnect() {
|
|
337
|
-
this.#intersectionObserver?.disconnect();
|
|
338
|
-
}
|
|
339
|
-
isAnchorActive(anchor) {
|
|
340
|
-
const target = this.#anchorToTargetMap.get(anchor);
|
|
341
|
-
return !!(target && this.#intersectionState.value[target.id]);
|
|
342
|
-
}
|
|
343
|
-
updateAnchors(anchors = []) {
|
|
344
|
-
for (const anchor of anchors) {
|
|
345
|
-
if (!anchor.href) continue;
|
|
346
|
-
const targetId = getIdFromHref(anchor.href);
|
|
347
|
-
const target = targetId ? this.root.querySelector(`#${targetId}`) : null;
|
|
348
|
-
if (!target) continue;
|
|
349
|
-
this.#intersectionObserver?.observe(target);
|
|
350
|
-
this.#anchorToTargetMap.set(anchor, target);
|
|
351
|
-
}
|
|
352
|
-
this.#anchors.value = anchors;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
311
|
+
const styles$1b = ":host{display:flex;gap:var(--odx-size-37);min-inline-size:180px}:host(:not([vertical])){align-items:center;margin-block-end:var(--odx-size-37);border-block-end:var(--odx-border-width-thick) solid var(--odx-color-stroke-neutral-subtle);padding-block:var(--odx-size-37) 0;padding-inline:var(--odx-size-50);::slotted(odx-navigation-item){margin-block-end:calc(-1 * var(--odx-border-width-thick));border-block-end:var(--odx-border-width-thick) solid var(--odx-color-stroke-neutral-subtle);border-bottom-left-radius:0;border-bottom-right-radius:0}::slotted(odx-navigation-item[selected]){border-block-end-color:var(--odx-color-background-accent-rest)}::slotted(*:not(odx-navigation-item)){margin-inline:var(--odx-size-37)}}:host([vertical]){flex-direction:column;border-inline-start:var(--odx-border-width-thick) solid var(--odx-color-stroke-neutral-subtle);padding-block:var(--odx-size-50);padding-inline:0 var(--odx-size-37);::slotted(odx-navigation-item){margin-inline-start:calc(-1 * var(--odx-border-width-thick));border-inline-start:var(--odx-border-width-thick) solid var(--odx-color-stroke-neutral-subtle);border-top-left-radius:0;border-bottom-left-radius:0}::slotted(odx-navigation-item[selected]){border-inline-start-color:var(--odx-color-background-accent-rest)}::slotted(*:not(odx-navigation-item)){margin-inline:var(--odx-size-75)}}";
|
|
355
312
|
|
|
356
313
|
const _OdxAnchorNavigation = class _OdxAnchorNavigation extends e(CustomElement) {
|
|
357
314
|
constructor() {
|
|
358
315
|
super();
|
|
316
|
+
this.#items = signal([]);
|
|
317
|
+
this.#intersectionState = signal({});
|
|
318
|
+
this.activeItems = computed(() => {
|
|
319
|
+
return this.#items.value.filter((item) => {
|
|
320
|
+
const id = getIdFromHref(item.href);
|
|
321
|
+
return id ? this.#intersectionState.value[id] : false;
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
this.root = document;
|
|
325
|
+
this.threshold = 0.5;
|
|
359
326
|
this.vertical = false;
|
|
360
327
|
this.#handleClick = (event) => {
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
if (!
|
|
328
|
+
const item = getElementFromEvent(event, (node) => node instanceof OdxNavigationItem);
|
|
329
|
+
if (!item) return;
|
|
330
|
+
const anchor = this.#findAnchor(item);
|
|
331
|
+
if (!anchor) return;
|
|
365
332
|
event.preventDefault();
|
|
366
|
-
|
|
367
|
-
|
|
333
|
+
anchor.scrollIntoView({ block: "start" });
|
|
334
|
+
};
|
|
335
|
+
this.#handleIntersection = (entries) => {
|
|
336
|
+
this.#intersectionState.value = entries.reduce((state, { target, isIntersecting }) => {
|
|
337
|
+
if (target.id) {
|
|
338
|
+
state[target.id] = isIntersecting;
|
|
339
|
+
}
|
|
340
|
+
return state;
|
|
341
|
+
}, {});
|
|
368
342
|
};
|
|
369
343
|
this.#handleSlotChange = () => {
|
|
370
|
-
this.#
|
|
344
|
+
this.#items.value = getAssignedElements(this.renderRoot, { selector: OdxNavigationItem.tagName });
|
|
345
|
+
this.#observeAnchors();
|
|
371
346
|
};
|
|
372
|
-
|
|
347
|
+
if (!isServer) {
|
|
348
|
+
this.addEventListener("click", this.#handleClick);
|
|
349
|
+
}
|
|
373
350
|
}
|
|
374
351
|
static {
|
|
375
352
|
customElement("odx-anchor-navigation", styles$1b)(_OdxAnchorNavigation);
|
|
376
353
|
}
|
|
377
|
-
#
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
connectedCallback() {
|
|
382
|
-
super.connectedCallback();
|
|
383
|
-
this.#handleContainerChange();
|
|
384
|
-
}
|
|
354
|
+
#items;
|
|
355
|
+
#intersectionObserver;
|
|
356
|
+
#intersectionState;
|
|
385
357
|
disconnectedCallback() {
|
|
386
|
-
this.#anchorObserver?.disconnect();
|
|
387
358
|
super.disconnectedCallback();
|
|
359
|
+
this.#intersectionObserver?.disconnect();
|
|
388
360
|
}
|
|
389
361
|
render() {
|
|
390
362
|
return html`<slot @slotchange=${this.#handleSlotChange}></slot>`;
|
|
391
363
|
}
|
|
392
364
|
updated(props) {
|
|
393
|
-
if (props.has("
|
|
394
|
-
this
|
|
365
|
+
if (props.has("root") || props.has("rootMargin") || props.has("threshold")) {
|
|
366
|
+
const options = { root: this.root, rootMargin: this.rootMargin, threshold: this.threshold };
|
|
367
|
+
this.#intersectionObserver?.disconnect();
|
|
368
|
+
this.#intersectionObserver = new IntersectionObserver(this.#handleIntersection, options);
|
|
369
|
+
this.#observeAnchors();
|
|
395
370
|
}
|
|
396
|
-
for (const item of this.
|
|
397
|
-
item.selected =
|
|
371
|
+
for (const item of this.#items.value) {
|
|
372
|
+
item.selected = this.activeItems.value[0] === item;
|
|
398
373
|
item.lineClamp = this.vertical ? 2 : 1;
|
|
399
374
|
}
|
|
400
375
|
}
|
|
401
|
-
#
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
this.#
|
|
376
|
+
#findAnchor(item) {
|
|
377
|
+
const id = getIdFromHref(item.href);
|
|
378
|
+
return id ? this.root.querySelector(`#${id}`) : null;
|
|
379
|
+
}
|
|
380
|
+
#observeAnchors() {
|
|
381
|
+
for (const item of this.#items.value) {
|
|
382
|
+
const anchor = this.#findAnchor(item);
|
|
383
|
+
if (!anchor) continue;
|
|
384
|
+
this.#intersectionObserver?.observe(anchor);
|
|
385
|
+
}
|
|
407
386
|
}
|
|
408
387
|
#handleClick;
|
|
388
|
+
#handleIntersection;
|
|
409
389
|
#handleSlotChange;
|
|
410
390
|
};
|
|
411
391
|
__decorateClass([
|
|
412
|
-
property()
|
|
413
|
-
], _OdxAnchorNavigation.prototype, "
|
|
392
|
+
property({ attribute: false })
|
|
393
|
+
], _OdxAnchorNavigation.prototype, "root", 2);
|
|
394
|
+
__decorateClass([
|
|
395
|
+
property({ attribute: "root-margin" })
|
|
396
|
+
], _OdxAnchorNavigation.prototype, "rootMargin", 2);
|
|
397
|
+
__decorateClass([
|
|
398
|
+
property({ type: Number })
|
|
399
|
+
], _OdxAnchorNavigation.prototype, "threshold", 2);
|
|
414
400
|
__decorateClass([
|
|
415
401
|
property({ type: Boolean, reflect: true, useDefault: true })
|
|
416
402
|
], _OdxAnchorNavigation.prototype, "vertical", 2);
|
|
@@ -556,7 +542,7 @@ class OdxBreadcrumbsItem extends CustomElement {
|
|
|
556
542
|
}
|
|
557
543
|
updated(props) {
|
|
558
544
|
super.updated(props);
|
|
559
|
-
const linkElement = getAssignedElement(this.renderRoot, { selector: OdxLink.tagName
|
|
545
|
+
const linkElement = getAssignedElement(this.renderRoot, { selector: OdxLink.tagName }) || null;
|
|
560
546
|
if (!linkElement) return;
|
|
561
547
|
linkElement.subtle = true;
|
|
562
548
|
linkElement.strong = !this.nextElementSibling;
|
|
@@ -596,7 +582,7 @@ const _OdxBreadcrumbs = class _OdxBreadcrumbs extends CustomElement {
|
|
|
596
582
|
return index === 0 || index > items.length - this.max;
|
|
597
583
|
}
|
|
598
584
|
#updateContext() {
|
|
599
|
-
const itemElements = getAssignedElements(this.renderRoot, { selector: OdxBreadcrumbsItem.tagName
|
|
585
|
+
const itemElements = getAssignedElements(this.renderRoot, { selector: OdxBreadcrumbsItem.tagName });
|
|
600
586
|
for (const [index, item] of itemElements.entries()) {
|
|
601
587
|
item.hidden = !this.#isItemVisible(item, index, itemElements);
|
|
602
588
|
}
|
|
@@ -1256,7 +1242,7 @@ const _OdxAutocomplete = class _OdxAutocomplete extends FormControl {
|
|
|
1256
1242
|
};
|
|
1257
1243
|
}
|
|
1258
1244
|
get options() {
|
|
1259
|
-
return getAssignedElements(this.renderRoot, { selector: '[role="option"]'
|
|
1245
|
+
return getAssignedElements(this.renderRoot, { selector: '[role="option"]' });
|
|
1260
1246
|
}
|
|
1261
1247
|
get control() {
|
|
1262
1248
|
return getAssignedElement(this.renderRoot, { slot: "control" });
|
|
@@ -1405,7 +1391,7 @@ const _OdxFormField = class _OdxFormField extends CustomElement {
|
|
|
1405
1391
|
customElement("odx-form-field", styles$U)(_OdxFormField);
|
|
1406
1392
|
}
|
|
1407
1393
|
getControl() {
|
|
1408
|
-
return getAssignedElement(this.renderRoot, { slot: "control"
|
|
1394
|
+
return getAssignedElement(this.renderRoot, { slot: "control" }) || null;
|
|
1409
1395
|
}
|
|
1410
1396
|
connectedCallback() {
|
|
1411
1397
|
super.connectedCallback();
|
|
@@ -1584,7 +1570,7 @@ const _OdxRelativeTime = class _OdxRelativeTime extends BaseFormat {
|
|
|
1584
1570
|
#setupSyncInterval() {
|
|
1585
1571
|
clearInterval(this.#syncInterval);
|
|
1586
1572
|
if (typeof this.syncInterval !== "number") return;
|
|
1587
|
-
this.#syncInterval = setInterval(() => this.requestUpdate(), Math.max(this.syncInterval, 1e3));
|
|
1573
|
+
this.#syncInterval = globalThis.setInterval(() => this.requestUpdate(), Math.max(this.syncInterval, 1e3));
|
|
1588
1574
|
}
|
|
1589
1575
|
};
|
|
1590
1576
|
__decorateClass([
|
|
@@ -1689,7 +1675,7 @@ class OdxHeader extends CustomElement {
|
|
|
1689
1675
|
`;
|
|
1690
1676
|
}
|
|
1691
1677
|
#handleSlotChange = () => {
|
|
1692
|
-
const titleElement = getAssignedElement(this.renderRoot, { selector: OdxTitle.tagName
|
|
1678
|
+
const titleElement = getAssignedElement(this.renderRoot, { selector: OdxTitle.tagName });
|
|
1693
1679
|
if (!titleElement) return;
|
|
1694
1680
|
titleElement.ariaLevel = "1";
|
|
1695
1681
|
titleElement.role = "heading";
|
|
@@ -2283,7 +2269,7 @@ const _OdxList = class _OdxList extends CustomElement {
|
|
|
2283
2269
|
customElement("odx-list", styles$H)(_OdxList);
|
|
2284
2270
|
}
|
|
2285
2271
|
getItems() {
|
|
2286
|
-
return getAssignedElements(this.renderRoot, { selector: OdxListItem.tagName
|
|
2272
|
+
return getAssignedElements(this.renderRoot, { selector: OdxListItem.tagName });
|
|
2287
2273
|
}
|
|
2288
2274
|
connectedCallback() {
|
|
2289
2275
|
super.connectedCallback();
|
|
@@ -2421,11 +2407,11 @@ const _OdxMainMenu = class _OdxMainMenu extends CustomElement {
|
|
|
2421
2407
|
super();
|
|
2422
2408
|
this.open = false;
|
|
2423
2409
|
this.#handleSlotChange = () => {
|
|
2424
|
-
for (const link of getAssignedElements(this.renderRoot, { selector: OdxLink.tagName
|
|
2410
|
+
for (const link of getAssignedElements(this.renderRoot, { selector: OdxLink.tagName })) {
|
|
2425
2411
|
link.slot ||= "link-navigation";
|
|
2426
2412
|
link.subtle = true;
|
|
2427
2413
|
}
|
|
2428
|
-
for (const item of getAssignedElements(this.renderRoot, { selector: OdxNavigationItem.tagName
|
|
2414
|
+
for (const item of getAssignedElements(this.renderRoot, { selector: OdxNavigationItem.tagName })) {
|
|
2429
2415
|
item.size = NavigationItemSize.LG;
|
|
2430
2416
|
}
|
|
2431
2417
|
};
|
|
@@ -2491,7 +2477,10 @@ class OdxMainMenuButton extends CustomElement {
|
|
|
2491
2477
|
`;
|
|
2492
2478
|
}
|
|
2493
2479
|
#handleClick = () => {
|
|
2494
|
-
document.
|
|
2480
|
+
for (const menu of Array.from(document.querySelectorAll("odx-main-menu"))) {
|
|
2481
|
+
menu.togglePopover(true);
|
|
2482
|
+
if (menu.open) return;
|
|
2483
|
+
}
|
|
2495
2484
|
};
|
|
2496
2485
|
}
|
|
2497
2486
|
|
|
@@ -2647,6 +2636,7 @@ const ModalLayout = { MODAL: "modal", SIDESHEET: "sidesheet" };
|
|
|
2647
2636
|
event,
|
|
2648
2637
|
(node) => node.hasAttribute("odx-modal-toggle") && node.ariaBusy !== "true" && node.ariaDisabled !== "true"
|
|
2649
2638
|
);
|
|
2639
|
+
if (!source) return;
|
|
2650
2640
|
const modalId = source?.getAttribute("odx-modal-toggle");
|
|
2651
2641
|
const modal = modalId ? source.ownerDocument.getElementById(modalId) : source?.closest("odx-modal");
|
|
2652
2642
|
if (!modal) return;
|
|
@@ -2783,7 +2773,7 @@ const _OdxNavigationItemGroup = class _OdxNavigationItemGroup extends CanBeExpan
|
|
|
2783
2773
|
customElement("odx-navigation-item-group", styles$A)(_OdxNavigationItemGroup);
|
|
2784
2774
|
}
|
|
2785
2775
|
getItems() {
|
|
2786
|
-
return getAssignedElements(this.renderRoot, { selector: OdxNavigationItem.tagName
|
|
2776
|
+
return getAssignedElements(this.renderRoot, { selector: OdxNavigationItem.tagName });
|
|
2787
2777
|
}
|
|
2788
2778
|
render() {
|
|
2789
2779
|
const contentHidden = this.disabled || !this.expanded;
|
|
@@ -2796,15 +2786,17 @@ const _OdxNavigationItemGroup = class _OdxNavigationItemGroup extends CanBeExpan
|
|
|
2796
2786
|
</odx-navigation-item>
|
|
2797
2787
|
<odx-toggle-content ?hidden=${contentHidden} tabindex=${optionalAttr(contentHidden ? -1 : null)}>
|
|
2798
2788
|
<div class="content odx-stack">
|
|
2799
|
-
<slot
|
|
2789
|
+
<slot></slot>
|
|
2800
2790
|
</div>
|
|
2801
2791
|
</odx-toggle-content>
|
|
2802
2792
|
`;
|
|
2803
2793
|
}
|
|
2804
2794
|
updated(props) {
|
|
2805
2795
|
super.updated(props);
|
|
2806
|
-
|
|
2807
|
-
item
|
|
2796
|
+
if (props.has("size") && this.size != null) {
|
|
2797
|
+
for (const item of this.getItems()) {
|
|
2798
|
+
item.size = this.size;
|
|
2799
|
+
}
|
|
2808
2800
|
}
|
|
2809
2801
|
}
|
|
2810
2802
|
};
|
|
@@ -2897,7 +2889,7 @@ __decorateClass([
|
|
|
2897
2889
|
], _OdxPage.prototype, "layout", 2);
|
|
2898
2890
|
let OdxPage = _OdxPage;
|
|
2899
2891
|
|
|
2900
|
-
const styles$x = ":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;
|
|
2892
|
+
const styles$x = ":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;padding-block:var(--odx-size-150)}.footer{grid-area:footer}.header{grid-area:header}.navigation{grid-area:navigation;padding:var(--odx-size-150);padding-inline-start:0}.sidebar{grid-area:sidebar;padding-inline-start:var(--odx-size-75)}";
|
|
2901
2893
|
|
|
2902
2894
|
class OdxPageLayout extends CustomElement {
|
|
2903
2895
|
static {
|
|
@@ -3298,7 +3290,7 @@ __decorateClass([
|
|
|
3298
3290
|
], _OdxRailNavigation.prototype, "size", 2);
|
|
3299
3291
|
let OdxRailNavigation = _OdxRailNavigation;
|
|
3300
3292
|
|
|
3301
|
-
const styles$p = ":host{display:block;transition:var(--odx-transition-
|
|
3293
|
+
const styles$p = ":host{display:block;transition:var(--odx-transition-default);min-inline-size:min(15ch,50dvw);max-inline-size:35ch}.input{inline-size:100%;min-inline-size:0}:host([collapsed]:not(:focus-within)){cursor:pointer;min-inline-size:0;max-inline-size:var(--odx-size-225);.input{gap:0;&::part(input){opacity:0}&:after{background-color:transparent}}}";
|
|
3302
3294
|
|
|
3303
3295
|
const SearchBarBehavior = { INSTANT: "instant", SUBMIT: "submit" };
|
|
3304
3296
|
class SearchEvent extends CustomEvent {
|
|
@@ -3942,7 +3934,7 @@ const _OdxSpinbox = class _OdxSpinbox extends FormControl {
|
|
|
3942
3934
|
customElement("odx-spinbox", styles$h)(_OdxSpinbox);
|
|
3943
3935
|
}
|
|
3944
3936
|
get options() {
|
|
3945
|
-
return getAssignedElements(this.renderRoot, { selector: '[role="option"]'
|
|
3937
|
+
return getAssignedElements(this.renderRoot, { selector: '[role="option"]' });
|
|
3946
3938
|
}
|
|
3947
3939
|
clear() {
|
|
3948
3940
|
this.value = "";
|
|
@@ -4163,7 +4155,7 @@ const _OdxTableRow = class _OdxTableRow extends CanBeDisabled(CustomElement) {
|
|
|
4163
4155
|
customElement("odx-table-row", styles$b)(_OdxTableRow);
|
|
4164
4156
|
}
|
|
4165
4157
|
get checkboxCells() {
|
|
4166
|
-
return getAssignedElements(this.renderRoot, { selector: OdxTableCheckboxCell.tagName
|
|
4158
|
+
return getAssignedElements(this.renderRoot, { selector: OdxTableCheckboxCell.tagName });
|
|
4167
4159
|
}
|
|
4168
4160
|
connectedCallback() {
|
|
4169
4161
|
super.connectedCallback();
|
|
@@ -4501,11 +4493,19 @@ const _OdxToggleButtonGroup = class _OdxToggleButtonGroup extends RadioGroupForm
|
|
|
4501
4493
|
}
|
|
4502
4494
|
updated(props) {
|
|
4503
4495
|
super.updated(props);
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4496
|
+
if (props.has("size")) {
|
|
4497
|
+
for (const control of this.getControls()) {
|
|
4498
|
+
control.size = this.size;
|
|
4499
|
+
}
|
|
4508
4500
|
}
|
|
4501
|
+
if (props.has("variant")) {
|
|
4502
|
+
for (const control of this.getControls()) {
|
|
4503
|
+
control.variant = this.variant;
|
|
4504
|
+
}
|
|
4505
|
+
}
|
|
4506
|
+
}
|
|
4507
|
+
isControl(element) {
|
|
4508
|
+
return element instanceof OdxToggleButton;
|
|
4509
4509
|
}
|
|
4510
4510
|
#handleChange;
|
|
4511
4511
|
};
|
|
@@ -4646,7 +4646,7 @@ const _OdxTooltip = class _OdxTooltip extends PopoverHost {
|
|
|
4646
4646
|
onPopoverShow() {
|
|
4647
4647
|
super.onPopoverShow?.();
|
|
4648
4648
|
if (this.timeout <= 0) return;
|
|
4649
|
-
this.#timeout = setTimeout(() => this.togglePopover(false), this.timeout);
|
|
4649
|
+
this.#timeout = globalThis.setTimeout(() => this.togglePopover(false), this.timeout);
|
|
4650
4650
|
}
|
|
4651
4651
|
onBeforePopoverShow() {
|
|
4652
4652
|
if (_OdxTooltip.currentInstance !== this) {
|
|
@@ -4719,7 +4719,7 @@ const _OdxTooltip = class _OdxTooltip extends PopoverHost {
|
|
|
4719
4719
|
return;
|
|
4720
4720
|
}
|
|
4721
4721
|
const delay = shouldOpen ? this.delayIn : this.delayOut;
|
|
4722
|
-
_OdxTooltip.#delayTimer = setTimeout(() => {
|
|
4722
|
+
_OdxTooltip.#delayTimer = globalThis.setTimeout(() => {
|
|
4723
4723
|
this.togglePopover(shouldOpen);
|
|
4724
4724
|
_OdxTooltip.#delayTimer = void 0;
|
|
4725
4725
|
}, delay);
|
|
@@ -4785,4 +4785,4 @@ class OdxVisuallyHidden extends CustomElement {
|
|
|
4785
4785
|
}
|
|
4786
4786
|
}
|
|
4787
4787
|
|
|
4788
|
-
export { AccordionIndicatorPosition, AccordionItemSize,
|
|
4788
|
+
export { AccordionIndicatorPosition, AccordionItemSize, AreaHeaderSize, AutoGridMode, AvatarShape, AvatarSize, AvatarVariant, BadgeVariant, BaseFormat, ButtonSize, ButtonVariant, CheckboxGroupLayout, ChipVariant, DropdownPlacement, EmptyStateSize, EmptyStateVariant, GradientOverlaySize, HighlightVariant, InlineMessageVariant, KpiSize, KpiVariant, LOADING_OVERLAY_HOST_DIRECTIVE, LogoSize, ModalLayout, NavigationItemSize, OdxAccordion, OdxAccordionItem, OdxAccordionPanel, OdxActionButton, OdxAnchorNavigation, OdxAreaHeader, OdxAutoGrid, OdxAutocomplete, OdxAvatar, OdxBadge, OdxBreadcrumbs, OdxBreadcrumbsItem, OdxButton, OdxButtonGroup, OdxCard, OdxCheckbox, OdxCheckboxGroup, OdxChip, OdxContentBox, OdxDropdown, OdxEmptyState, OdxFormField, OdxFormatBytes, OdxFormatDate, OdxFormatNumber, OdxGradientOverlay, OdxHeader, OdxHeaderActions, OdxHighlight, OdxIconButton, OdxImage, OdxInlineMessage, OdxInput, OdxKpi, OdxLabel, OdxLineClamp, OdxLink, OdxList, OdxListItem, OdxLoadingOverlay, OdxLoadingSpinner, OdxLogo, OdxMainMenu, OdxMainMenuButton, OdxMainMenuSubtitle, OdxMainMenuTitle, OdxMenu, OdxMenuItem, OdxModal, OdxNavigationItem, OdxNavigationItemGroup, OdxOption, OdxPage, OdxPageLayout, OdxPagination, OdxPopover, OdxProgressBar, OdxProgressRing, OdxRadioButton, OdxRadioGroup, OdxRailNavigation, OdxRelativeTime, OdxSearchBar, OdxSelect, OdxSeparator, OdxSkeleton, OdxSlider, OdxSliderHandle, OdxSliderMarks, OdxSpacer, OdxSpinbox, OdxStatus, OdxSwitch, OdxTable, OdxTableBody, OdxTableCell, OdxTableCheckboxCell, OdxTableHeader, OdxTableHeaderCell, OdxTableRow, OdxText, OdxTitle, OdxToast, OdxToggleButton, OdxToggleButtonGroup, OdxToggleContent, OdxToolbar, OdxTooltip, OdxTranslate, OdxVisuallyHidden, PageAlignment, PageLayout, ProgressRingSize, RadioGroupLayout, SearchBarBehavior, SearchEvent, SeparatorAlign, SkeletonShape, SkeletonSize, SliderLabelVisibility, SliderTrackVisibility, StatusVariant, TextSize, TextVariant, TitleSize, ToastVariant, ToggleButtonSize, ToggleButtonVariant, ToolbarSize, TooltipPlacement, TooltipSize, TooltipVariant, sliderContext, tableContext };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PropertyValues } from 'lit';
|
|
2
2
|
import { CheckboxFormControl } from './checkbox-form-control.js';
|
|
3
3
|
import { FormControl } from './form-control.js';
|
|
4
|
-
export declare class RadioGroupFormControl extends FormControl<string> {
|
|
4
|
+
export declare class RadioGroupFormControl<Control extends CheckboxFormControl = CheckboxFormControl> extends FormControl<string> {
|
|
5
5
|
#private;
|
|
6
6
|
value: string;
|
|
7
7
|
constructor();
|
|
8
|
-
getControls():
|
|
8
|
+
getControls(): Control[];
|
|
9
9
|
connectedCallback(): void;
|
|
10
|
-
protected isControl(element: unknown): element is
|
|
11
|
-
protected isControlChecked(control:
|
|
10
|
+
protected isControl(element: unknown): element is Control;
|
|
11
|
+
protected isControlChecked(control: Control): boolean;
|
|
12
12
|
protected willUpdate(changes: PropertyValues<this>): void;
|
|
13
|
-
protected updateControls(updateFn: (control:
|
|
13
|
+
protected updateControls(updateFn: (control: Control, index: number) => void): void;
|
|
14
14
|
}
|
package/dist/lib/utils/dom.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare function parseDate(value: number | string | Date): Date | null;
|
|
|
4
4
|
export declare function getIdFromHref(href: string): string | null;
|
|
5
5
|
export declare function findClosestDocument(node: Node): Document | ShadowRoot;
|
|
6
6
|
export declare function forwardEvent(target: HTMLElement, eventInit?: EventInit): EventListener;
|
|
7
|
-
export declare function getElementFromEvent<T = HTMLElement>(event: Event, filterFn: (node: Element) => boolean): T;
|
|
7
|
+
export declare function getElementFromEvent<T = HTMLElement>(event: Event, filterFn: (node: Element) => boolean): T | undefined;
|
|
8
8
|
export declare function waitForAnimations(element?: Element | null, subtree?: boolean): Promise<Animation[]>;
|
|
9
9
|
export declare function toAriaBooleanAttribute(value: boolean, removeOnFalse?: boolean): 'true' | 'false';
|
|
10
10
|
export declare function toPx(value?: number | null): string | null;
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getAssignedElements as getAssignedElements$1 } from '@odx/foundation';
|
|
|
6
6
|
|
|
7
7
|
const name = "@odx/foundation";
|
|
8
8
|
const displayName = "ODX Design System Foundation";
|
|
9
|
-
const version = "1.0.0-beta.
|
|
9
|
+
const version = "1.0.0-beta.143";
|
|
10
10
|
const pkg = {
|
|
11
11
|
name,
|
|
12
12
|
displayName,
|
|
@@ -225,15 +225,17 @@ class CheckboxFormControl extends FormControl {
|
|
|
225
225
|
this.role = null;
|
|
226
226
|
this.checked = false;
|
|
227
227
|
this.value = "";
|
|
228
|
-
this.#handleClick = (
|
|
228
|
+
this.#handleClick = (event) => {
|
|
229
|
+
const target = event.target;
|
|
229
230
|
if (LINK_SELECTORS.has(target.localName)) return;
|
|
230
231
|
this.toggle(void 0, true);
|
|
231
232
|
};
|
|
232
233
|
this.#handleKeyboardEvent = (event) => {
|
|
234
|
+
const target = event.target;
|
|
233
235
|
const key = getKeyInfo(event);
|
|
234
236
|
if (!(key.enter || key.space)) return;
|
|
235
237
|
event.preventDefault();
|
|
236
|
-
if (event.type === "keydown" || LINK_SELECTORS.has(
|
|
238
|
+
if (event.type === "keydown" || LINK_SELECTORS.has(target.localName)) return;
|
|
237
239
|
this.toggle(void 0, true);
|
|
238
240
|
};
|
|
239
241
|
if (!isServer) {
|
|
@@ -585,7 +587,7 @@ class ListboxFormControl extends FormControl {
|
|
|
585
587
|
}
|
|
586
588
|
}
|
|
587
589
|
get options() {
|
|
588
|
-
return getAssignedElements(this.renderRoot, { selector: '[role="option"]'
|
|
590
|
+
return getAssignedElements(this.renderRoot, { selector: '[role="option"]' });
|
|
589
591
|
}
|
|
590
592
|
get selectedOptions() {
|
|
591
593
|
return this.options.filter((option) => option.selected);
|
|
@@ -912,21 +914,22 @@ class ExpandableItemManager {
|
|
|
912
914
|
this.#host.addEventListener("click", this.#handleClick);
|
|
913
915
|
}
|
|
914
916
|
}
|
|
917
|
+
#handleClick = (event) => {
|
|
918
|
+
const item = getElementFromEvent(event, (node) => this.items.includes(node));
|
|
919
|
+
if (!(item && getElementFromEvent(event, (node) => node === item.getExpandControl()))) return;
|
|
920
|
+
event.stopPropagation();
|
|
921
|
+
item.toggle();
|
|
922
|
+
};
|
|
915
923
|
#handleToggle = (event) => {
|
|
916
|
-
|
|
924
|
+
const target = event.target;
|
|
925
|
+
if (!target) return;
|
|
917
926
|
event.stopPropagation();
|
|
918
927
|
if (event.newState !== "open" || this.#host.multiple) return;
|
|
919
928
|
for (const item of this.items) {
|
|
920
|
-
if (
|
|
929
|
+
if (target === item) continue;
|
|
921
930
|
item.toggle(false);
|
|
922
931
|
}
|
|
923
932
|
};
|
|
924
|
-
#handleClick = (event) => {
|
|
925
|
-
const item = getElementFromEvent(event, (node) => this.items.includes(node));
|
|
926
|
-
if (!(item && getElementFromEvent(event, (node) => node === item.getExpandControl()))) return;
|
|
927
|
-
event.stopPropagation();
|
|
928
|
-
item.toggle();
|
|
929
|
-
};
|
|
930
933
|
}
|
|
931
934
|
|
|
932
935
|
const optionalAttr = (value) => {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@odx/foundation",
|
|
3
3
|
"displayName": "ODX Design System Foundation",
|
|
4
4
|
"description": "A library of Web Component building blocks for ODX",
|
|
5
|
-
"version": "1.0.0-beta.
|
|
5
|
+
"version": "1.0.0-beta.143",
|
|
6
6
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
7
7
|
"license": "SEE LICENSE IN LICENSE",
|
|
8
8
|
"homepage": "https://odx.draeger.com",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@wc-toolkit/cem-inheritance": "1.1.0",
|
|
35
35
|
"@wc-toolkit/cem-validator": "1.0.3",
|
|
36
36
|
"@wc-toolkit/module-path-resolver": "1.0.0",
|
|
37
|
-
"@wc-toolkit/type-parser": "1.0
|
|
38
|
-
"es-toolkit": "1.39.
|
|
39
|
-
"stylelint": "16.
|
|
37
|
+
"@wc-toolkit/type-parser": "1.1.0",
|
|
38
|
+
"es-toolkit": "1.39.5",
|
|
39
|
+
"stylelint": "16.21.0",
|
|
40
40
|
"stylelint-config-concentric-order": "5.2.1",
|
|
41
41
|
"stylelint-config-standard": "38.0.0",
|
|
42
42
|
"ts-lit-plugin": "2.0.2",
|
|
43
|
-
"vite": "
|
|
43
|
+
"vite": "7.0.0",
|
|
44
44
|
"vite-plugin-dts": "4.5.4",
|
|
45
45
|
"@odx/storybook-utils": "0.0.0",
|
|
46
46
|
"@odx/typescript-config": "0.0.0"
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"build": "vite build",
|
|
82
|
-
"dev:tsc": "tsc --build --noEmit --watch",
|
|
83
82
|
"dev": "vite build --watch --mode=development",
|
|
83
|
+
"dev:tsc": "tsc --build tsconfig.lib.json --noEmit --watch",
|
|
84
84
|
"lint": "biome lint lib i18n styles components",
|
|
85
85
|
"generate:manifest": "cem analyze"
|
|
86
86
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { InteractiveLink } from '../../lib/main.js';
|
|
2
|
-
export interface AnchorObserverOptions {
|
|
3
|
-
threshold?: number;
|
|
4
|
-
}
|
|
5
|
-
export declare class AnchorObserver {
|
|
6
|
-
#private;
|
|
7
|
-
readonly root: Document | Element;
|
|
8
|
-
readonly activeAnchors: import('@preact/signals-core').ReadonlySignal<InteractiveLink[]>;
|
|
9
|
-
constructor(root: Document | Element, options?: AnchorObserverOptions);
|
|
10
|
-
disconnect(): void;
|
|
11
|
-
isAnchorActive(anchor: InteractiveLink): boolean;
|
|
12
|
-
updateAnchors(anchors?: InteractiveLink[]): void;
|
|
13
|
-
}
|