@odx/foundation 1.0.0-alpha.21 → 1.0.0-alpha.22
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/cdk.js +1 -1
- package/dist/components/anchor-navigation/anchor-observer.d.ts +2 -2
- package/dist/components.js +17 -19
- package/dist/i18n/lib/is-localized.mixin.d.ts +2 -2
- package/dist/i18n/lib/translate.d.ts +2 -2
- package/dist/i18n.js +15 -17
- package/dist/lib/main.d.ts +1 -1
- package/dist/main.js +3 -30
- package/dist/{vendor-UwJOss6U.js → vendor-DxR9PGL6.js} +5 -197
- package/package.json +2 -2
- package/dist/lib/utils/effect.d.ts +0 -5
package/dist/cdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dedupeMixin, createOptions, toPx, waitForAnimations, findClosestDocument, createMutationObserver, customElement, CustomElement } from '@odx/foundation';
|
|
2
2
|
import { property, state } from 'lit/decorators.js';
|
|
3
|
-
import { m as minBy, a as computePosition, o as offset, s as shift, f as flip, b as size, d as arrow, h as hide, e as autoUpdate } from './vendor-
|
|
3
|
+
import { m as minBy, a as computePosition, o as offset, s as shift, f as flip, b as size, d as arrow, h as hide, e as autoUpdate } from './vendor-DxR9PGL6.js';
|
|
4
4
|
import { isServer, unsafeCSS, html } from 'lit';
|
|
5
5
|
import { when } from 'lit/directives/when.js';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare class AnchorObserver {
|
|
2
2
|
#private;
|
|
3
3
|
readonly root: Element | Document;
|
|
4
|
-
readonly anchors: import(
|
|
5
|
-
readonly visibleAnchors: import(
|
|
4
|
+
readonly anchors: import('@preact/signals-core').Signal<Element[]>;
|
|
5
|
+
readonly visibleAnchors: import('@preact/signals-core').ReadonlySignal<Element[]>;
|
|
6
6
|
constructor(root?: Element | null);
|
|
7
7
|
observe(): void;
|
|
8
8
|
disconnect(): void;
|
package/dist/components.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { WithAriaControls, CustomElement, toAriaBooleanAttribute, fromAriaBooleanAttribute, customElement, getKeyboardEventInfo, CanBeDisabled, SharedResizeObserver,
|
|
1
|
+
import { WithAriaControls, CustomElement, toAriaBooleanAttribute, fromAriaBooleanAttribute, customElement, getKeyboardEventInfo, CanBeDisabled, SharedResizeObserver, optionalAttr, requestUpdateOnAriaChange, createIntersectionObserver, createMutationObserver, getElementFromEvent, WithLoadingState, getAssignedElements, optionalSlot, CheckboxGroupFormControl, CheckboxFormControl, toggleAttribute, getUniqueId, parseDate, searchTextContent, FormControl, forwardEvent, CanBeSelected, waitForAnimations, FocusTrapController, OptionControl, toPx, RadioGroupFormControl, SelectFormControl, emptySlotFallbackFix, NumberControl } from '@odx/foundation';
|
|
2
2
|
import { html, isServer, unsafeCSS, nothing, css } from 'lit';
|
|
3
3
|
import { property, queryAssignedElements, query, queryAll } from 'lit/decorators.js';
|
|
4
|
-
import { signal, computed, SignalWatcher } from '@lit-labs/signals';
|
|
4
|
+
import { signal, computed, effect, SignalWatcher } from '@lit-labs/preact-signals';
|
|
5
5
|
import { repeat } from 'lit/directives/repeat.js';
|
|
6
6
|
import { when } from 'lit/directives/when.js';
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
-
import { i as isEqual, g as clamp, R as RovingTabindexController, r as round, j as debounce, m as minBy, k as maxBy } from './vendor-UwJOss6U.js';
|
|
9
8
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
9
|
import { PopoverPlacement, PopoverHost, IsDraggable, IS_DRAG_ACTIVE_ATTRIBUTE, DragController } from '@odx/foundation/cdk';
|
|
11
10
|
import { IsLocalized, setTranslation } from '@odx/foundation/i18n';
|
|
11
|
+
import { g as clamp, R as RovingTabindexController, r as round, i as debounce, m as minBy, j as maxBy } from './vendor-DxR9PGL6.js';
|
|
12
12
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
13
13
|
import { createContext, consume, provide } from '@lit/context';
|
|
14
14
|
|
|
@@ -210,8 +210,8 @@ let OdxActionGroupComponent = class extends CanBeDisabled(CustomElement) {
|
|
|
210
210
|
__privateAdd$t(this, _breakpoints, signal([]));
|
|
211
211
|
__privateAdd$t(this, _position, signal(0));
|
|
212
212
|
__privateAdd$t(this, _currentBreakpoint, computed(() => {
|
|
213
|
-
const position = __privateGet$p(this, _position).
|
|
214
|
-
const breakpoints = __privateGet$p(this, _breakpoints).
|
|
213
|
+
const position = __privateGet$p(this, _position).value;
|
|
214
|
+
const breakpoints = __privateGet$p(this, _breakpoints).value;
|
|
215
215
|
return this.assignedElements.findLast((_, index) => {
|
|
216
216
|
return breakpoints[index] && position > breakpoints[index];
|
|
217
217
|
});
|
|
@@ -227,13 +227,12 @@ let OdxActionGroupComponent = class extends CanBeDisabled(CustomElement) {
|
|
|
227
227
|
this,
|
|
228
228
|
() => {
|
|
229
229
|
const baseRect = this.base.getBoundingClientRect();
|
|
230
|
-
|
|
231
|
-
__privateGet$p(this, _position).set(baseRect.left);
|
|
230
|
+
__privateGet$p(this, _position).value = baseRect.left;
|
|
232
231
|
},
|
|
233
232
|
{ fpsLimit: 5 }
|
|
234
233
|
);
|
|
235
234
|
effect(() => {
|
|
236
|
-
const currentBreakpoint = __privateGet$p(this, _currentBreakpoint).
|
|
235
|
+
const currentBreakpoint = __privateGet$p(this, _currentBreakpoint).value;
|
|
237
236
|
console.log(currentBreakpoint);
|
|
238
237
|
});
|
|
239
238
|
}
|
|
@@ -269,9 +268,9 @@ captureSize_fn = async function() {
|
|
|
269
268
|
element.slot = "";
|
|
270
269
|
}
|
|
271
270
|
await 0;
|
|
272
|
-
__privateGet$p(this, _breakpoints).
|
|
273
|
-
|
|
274
|
-
);
|
|
271
|
+
__privateGet$p(this, _breakpoints).value = this.assignedElements.map((element) => {
|
|
272
|
+
return element.getBoundingClientRect().left;
|
|
273
|
+
});
|
|
275
274
|
this.container.classList.remove("measuring");
|
|
276
275
|
};
|
|
277
276
|
_handleSlotChange$7 = new WeakMap();
|
|
@@ -400,10 +399,9 @@ const ANCHOR_SELECTOR = "odx-anchor";
|
|
|
400
399
|
class AnchorObserver {
|
|
401
400
|
constructor(root) {
|
|
402
401
|
this.#intersectionState = signal({});
|
|
403
|
-
this.anchors = signal([]
|
|
402
|
+
this.anchors = signal([]);
|
|
404
403
|
this.visibleAnchors = computed(() => {
|
|
405
|
-
|
|
406
|
-
return this.anchors.get().filter((anchor) => !!intersectionState[anchor.id]);
|
|
404
|
+
return this.anchors.value.filter((anchor) => !!this.#intersectionState.value[anchor.id]);
|
|
407
405
|
});
|
|
408
406
|
this.updateAnchors = () => {
|
|
409
407
|
const anchors = Array.from(this.root.querySelectorAll(`[${ANCHOR_SELECTOR}][id]`));
|
|
@@ -411,15 +409,15 @@ class AnchorObserver {
|
|
|
411
409
|
if (!this.#isAnchor(anchor)) continue;
|
|
412
410
|
this.#intersectionObserver?.observe(anchor);
|
|
413
411
|
}
|
|
414
|
-
this.anchors.
|
|
412
|
+
this.anchors.value = anchors;
|
|
415
413
|
};
|
|
416
414
|
this.#handleIntersection = (entries) => {
|
|
417
|
-
const state = this.#intersectionState.
|
|
415
|
+
const state = this.#intersectionState.value;
|
|
418
416
|
for (const entry of entries) {
|
|
419
417
|
if (!this.#isAnchor(entry.target)) continue;
|
|
420
418
|
state[entry.target.id] = entry.isIntersecting;
|
|
421
419
|
}
|
|
422
|
-
this.#intersectionState.
|
|
420
|
+
this.#intersectionState.value = { ...state };
|
|
423
421
|
};
|
|
424
422
|
this.root = root ?? document;
|
|
425
423
|
this.#intersectionObserver = createIntersectionObserver(this.#handleIntersection, { root });
|
|
@@ -498,8 +496,8 @@ let OdxAnchorNavigationComponent = class extends SignalWatcher(CustomElement) {
|
|
|
498
496
|
);
|
|
499
497
|
}
|
|
500
498
|
render() {
|
|
501
|
-
const anchors = __privateGet$o(this, _anchorObserver)?.anchors.
|
|
502
|
-
const visibleAnchors = __privateGet$o(this, _anchorObserver)?.visibleAnchors.
|
|
499
|
+
const anchors = __privateGet$o(this, _anchorObserver)?.anchors.value ?? [];
|
|
500
|
+
const visibleAnchors = __privateGet$o(this, _anchorObserver)?.visibleAnchors.value;
|
|
503
501
|
return repeat(
|
|
504
502
|
anchors,
|
|
505
503
|
(anchor) => anchor.id,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReadonlySignal } from '@lit-labs/preact-signals';
|
|
2
2
|
import { Constructor, CustomElement } from '../../lib/main.js';
|
|
3
3
|
import { formatDate, formatList, formatNumber, formatRelativeTime } from './format.js';
|
|
4
4
|
import { getLocale } from './localization.js';
|
|
5
5
|
import { translate } from './translate.js';
|
|
6
6
|
export interface IsLocalized {
|
|
7
|
-
readonly locale:
|
|
7
|
+
readonly locale: ReadonlySignal<ReturnType<typeof getLocale>>;
|
|
8
8
|
t: (...args: Parameters<typeof translate>) => string;
|
|
9
9
|
formatDate: typeof formatDate;
|
|
10
10
|
formatNumber: typeof formatNumber;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReadonlySignal } from '@lit-labs/preact-signals';
|
|
2
2
|
import { LocaleInput } from './models.js';
|
|
3
3
|
export type TranslateContext = Record<string, string | number | boolean> | string | number | boolean | null;
|
|
4
4
|
type Translation = {
|
|
@@ -6,6 +6,6 @@ type Translation = {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function interpolate(value: string, context: Record<string, string | number>): string;
|
|
8
8
|
export declare function setTranslation(locale: LocaleInput, translation: Translation): void;
|
|
9
|
-
export declare function translate(key: string, contextInput?: TranslateContext, locale?: LocaleInput | null):
|
|
9
|
+
export declare function translate(key: string, contextInput?: TranslateContext, locale?: LocaleInput | null): ReadonlySignal<string>;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=translate.d.ts.map
|
package/dist/i18n.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { signal, computed, SignalWatcher } from '@lit-labs/signals';
|
|
1
|
+
import { signal, computed, SignalWatcher } from '@lit-labs/preact-signals';
|
|
2
2
|
import { createOptions, parseDate, effect, dedupeMixin } from '@odx/foundation';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as flattenObject, l as isNotNil } from './vendor-DxR9PGL6.js';
|
|
5
5
|
|
|
6
6
|
const I18nOptions = createOptions({
|
|
7
7
|
defaultLocale: () => navigator.language,
|
|
@@ -9,10 +9,10 @@ const I18nOptions = createOptions({
|
|
|
9
9
|
});
|
|
10
10
|
const i18nOptions = signal(null);
|
|
11
11
|
function setI18nOptions(options) {
|
|
12
|
-
i18nOptions.
|
|
12
|
+
i18nOptions.value = getI18nOptions(options);
|
|
13
13
|
}
|
|
14
14
|
function getI18nOptions(options) {
|
|
15
|
-
return I18nOptions(options ?? i18nOptions.
|
|
15
|
+
return I18nOptions(options ?? i18nOptions.value ?? {});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function formatDate(input, options) {
|
|
@@ -66,12 +66,12 @@ function formatRelativeTime(input, options) {
|
|
|
66
66
|
return new Intl.RelativeTimeFormat(options?.locale, relativeTimeFormatOptions).format(Math.round(relativeTime / timeUnit.value), timeUnit.unit);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
const activeLocale = signal(null
|
|
69
|
+
const activeLocale = signal(null);
|
|
70
70
|
function getLocale(localeInput) {
|
|
71
|
-
return new Intl.Locale(localeInput || activeLocale.
|
|
71
|
+
return new Intl.Locale(localeInput || activeLocale.value || getI18nOptions().defaultLocale());
|
|
72
72
|
}
|
|
73
73
|
function setLocale(localeInput) {
|
|
74
|
-
activeLocale.
|
|
74
|
+
activeLocale.value = localeInput ? getLocale(localeInput) : null;
|
|
75
75
|
}
|
|
76
76
|
function syncDocumentLanguage(root = document.documentElement) {
|
|
77
77
|
return effect(() => {
|
|
@@ -80,7 +80,7 @@ function syncDocumentLanguage(root = document.documentElement) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const fallbackLocale = "en";
|
|
83
|
-
const translations
|
|
83
|
+
const translations = signal({});
|
|
84
84
|
function interpolate(value, context) {
|
|
85
85
|
return value.replaceAll(/\{\{\s*([^}\s]+)\s*}}/g, (match, variableName) => {
|
|
86
86
|
return isNotNil(context[variableName]) ? interpolate(context[variableName].toString(), context) : match;
|
|
@@ -88,8 +88,7 @@ function interpolate(value, context) {
|
|
|
88
88
|
}
|
|
89
89
|
function setTranslation(locale, translation) {
|
|
90
90
|
const { language } = getLocale(locale);
|
|
91
|
-
|
|
92
|
-
translations$$.set({ ...translations, [language]: { ...translations[language], ...flattenObject(translation, { delimiter: "." }) } });
|
|
91
|
+
translations.value = { ...translations.value, [language]: { ...translations.value[language], ...flattenObject(translation, { delimiter: "." }) } };
|
|
93
92
|
}
|
|
94
93
|
function translate(key, contextInput, locale) {
|
|
95
94
|
return computed(() => {
|
|
@@ -102,8 +101,7 @@ function translate(key, contextInput, locale) {
|
|
|
102
101
|
}
|
|
103
102
|
function getTranslationRecord(localeInput) {
|
|
104
103
|
const locale = getLocale(localeInput);
|
|
105
|
-
|
|
106
|
-
return translationRecords[locale.toString()] ?? translationRecords[locale.language] ?? null;
|
|
104
|
+
return translations.value[locale.toString()] ?? translations.value[locale.language] ?? null;
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
var __defProp = Object.defineProperty;
|
|
@@ -123,19 +121,19 @@ const IsLocalized = dedupeMixin((superClass) => {
|
|
|
123
121
|
this.locale = computed(() => getLocale(this.lang));
|
|
124
122
|
}
|
|
125
123
|
formatDate(...[input, options]) {
|
|
126
|
-
return formatDate(input, { ...options, locale: options?.locale ?? this.locale.
|
|
124
|
+
return formatDate(input, { ...options, locale: options?.locale ?? this.locale.value });
|
|
127
125
|
}
|
|
128
126
|
formatNumber(...[input, options]) {
|
|
129
|
-
return formatNumber(input, { ...options, locale: options?.locale ?? this.locale.
|
|
127
|
+
return formatNumber(input, { ...options, locale: options?.locale ?? this.locale.value });
|
|
130
128
|
}
|
|
131
129
|
formatList(...[input, options]) {
|
|
132
|
-
return formatList(input, { ...options, locale: options?.locale ?? this.locale.
|
|
130
|
+
return formatList(input, { ...options, locale: options?.locale ?? this.locale.value });
|
|
133
131
|
}
|
|
134
132
|
formatRelativeTime(...[input, options]) {
|
|
135
|
-
return formatRelativeTime(input, { ...options, locale: options?.locale ?? this.locale.
|
|
133
|
+
return formatRelativeTime(input, { ...options, locale: options?.locale ?? this.locale.value });
|
|
136
134
|
}
|
|
137
135
|
t(...[key, context, locale]) {
|
|
138
|
-
return translate(key, context, locale ?? this.locale.
|
|
136
|
+
return translate(key, context, locale ?? this.locale.value).value;
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
139
|
__decorateClass([
|
package/dist/lib/main.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export * from './mixins/with-loading-state.js';
|
|
|
21
21
|
export * from './utils/a11y.js';
|
|
22
22
|
export * from './utils/date.js';
|
|
23
23
|
export * from './utils/dom.js';
|
|
24
|
-
export * from './utils/effect.js';
|
|
25
24
|
export * from './utils/get-unique-id.js';
|
|
26
25
|
export * from './utils/keyboard-events.js';
|
|
27
26
|
export * from './utils/object.js';
|
|
@@ -29,4 +28,5 @@ export * from './utils/search-text-content.js';
|
|
|
29
28
|
export * from './utils/shared-intersection-observer.js';
|
|
30
29
|
export * from './utils/shared-resize-observer.js';
|
|
31
30
|
export * from './custom-element.js';
|
|
31
|
+
export { effect } from '@lit-labs/preact-signals';
|
|
32
32
|
//# sourceMappingURL=main.d.ts.map
|
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as round, t as toMerged, c as createFocusTrap, R as RovingTabindexController } from './vendor-
|
|
1
|
+
import { r as round, t as toMerged, c as createFocusTrap, R as RovingTabindexController } from './vendor-DxR9PGL6.js';
|
|
2
2
|
import { isServer, nothing, html, LitElement, unsafeCSS, CSSResult } from 'lit';
|
|
3
3
|
import { directive, Directive } from 'lit/directive.js';
|
|
4
4
|
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
5
|
-
|
|
5
|
+
export { effect } from '@lit-labs/preact-signals';
|
|
6
6
|
|
|
7
7
|
function createMutationObserver(callback) {
|
|
8
8
|
try {
|
|
@@ -1019,33 +1019,6 @@ function parseDate(value) {
|
|
|
1019
1019
|
return Number.isNaN(date.getTime()) ? null : date;
|
|
1020
1020
|
}
|
|
1021
1021
|
|
|
1022
|
-
let needsEnqueue = true;
|
|
1023
|
-
const watcher = new Signal.subtle.Watcher(() => {
|
|
1024
|
-
if (!needsEnqueue) return;
|
|
1025
|
-
needsEnqueue = false;
|
|
1026
|
-
queueMicrotask(() => {
|
|
1027
|
-
needsEnqueue = true;
|
|
1028
|
-
for (const signal of watcher.getPending()) {
|
|
1029
|
-
signal.get();
|
|
1030
|
-
}
|
|
1031
|
-
watcher.watch();
|
|
1032
|
-
});
|
|
1033
|
-
});
|
|
1034
|
-
function effect(callback) {
|
|
1035
|
-
let cleanup;
|
|
1036
|
-
const signal = new Signal.Computed(() => {
|
|
1037
|
-
cleanup?.();
|
|
1038
|
-
cleanup = callback() ?? void 0;
|
|
1039
|
-
});
|
|
1040
|
-
watcher.watch(signal);
|
|
1041
|
-
signal.get();
|
|
1042
|
-
return () => {
|
|
1043
|
-
watcher.unwatch(signal);
|
|
1044
|
-
cleanup?.();
|
|
1045
|
-
cleanup = void 0;
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
1022
|
function search(value, searchString, callback) {
|
|
1050
1023
|
let index = 0;
|
|
1051
1024
|
while (index < value.length) {
|
|
@@ -1146,4 +1119,4 @@ class SharedResizeObserverInstance {
|
|
|
1146
1119
|
}
|
|
1147
1120
|
const SharedResizeObserver = new SharedResizeObserverInstance();
|
|
1148
1121
|
|
|
1149
|
-
export { CanBeDisabled, CanBeReadonly, CanBeRequired, CanBeSelected, CanBeValidated, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, FocusTrapController, FormControl, KeyboardKey, NumberControl, OptionControl, RadioGroupFormControl, SelectFormControl, SharedIntersectionObserver, SharedResizeObserver, WithAriaControls, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createOptions, createResizeObserver, customElement, dedupeMixin,
|
|
1122
|
+
export { CanBeDisabled, CanBeReadonly, CanBeRequired, CanBeSelected, CanBeValidated, CheckboxFormControl, CheckboxGroupFormControl, CustomElement, FocusTrapController, FormControl, KeyboardKey, NumberControl, OptionControl, RadioGroupFormControl, SelectFormControl, SharedIntersectionObserver, SharedResizeObserver, WithAriaControls, WithLoadingState, clearUniqueIdCache, createIntersectionObserver, createMutationObserver, createOptions, createResizeObserver, customElement, dedupeMixin, emptySlotFallbackFix, findClosestDocument, forwardEvent, fromAriaBooleanAttribute, getAssignedElements, getElementFromEvent, getKeyboardEventInfo, getUniqueId, optionalAttr, optionalSlot, parseDate, requestUpdateOnAriaChange, searchTextContent, toAriaBooleanAttribute, toPx, toggleAttribute, waitForAnimations };
|
|
@@ -1597,20 +1597,16 @@ const dateTag = '[object Date]';
|
|
|
1597
1597
|
const mapTag = '[object Map]';
|
|
1598
1598
|
const setTag = '[object Set]';
|
|
1599
1599
|
const arrayTag = '[object Array]';
|
|
1600
|
-
const functionTag = '[object Function]';
|
|
1601
1600
|
const arrayBufferTag = '[object ArrayBuffer]';
|
|
1602
1601
|
const objectTag = '[object Object]';
|
|
1603
|
-
const errorTag = '[object Error]';
|
|
1604
1602
|
const dataViewTag = '[object DataView]';
|
|
1605
1603
|
const uint8ArrayTag = '[object Uint8Array]';
|
|
1606
1604
|
const uint8ClampedArrayTag = '[object Uint8ClampedArray]';
|
|
1607
1605
|
const uint16ArrayTag = '[object Uint16Array]';
|
|
1608
1606
|
const uint32ArrayTag = '[object Uint32Array]';
|
|
1609
|
-
const bigUint64ArrayTag = '[object BigUint64Array]';
|
|
1610
1607
|
const int8ArrayTag = '[object Int8Array]';
|
|
1611
1608
|
const int16ArrayTag = '[object Int16Array]';
|
|
1612
1609
|
const int32ArrayTag = '[object Int32Array]';
|
|
1613
|
-
const bigInt64ArrayTag = '[object BigInt64Array]';
|
|
1614
1610
|
const float32ArrayTag = '[object Float32Array]';
|
|
1615
1611
|
const float64ArrayTag = '[object Float64Array]';
|
|
1616
1612
|
|
|
@@ -3603,198 +3599,6 @@ const computePosition = (reference, floating, options) => {
|
|
|
3603
3599
|
});
|
|
3604
3600
|
};
|
|
3605
3601
|
|
|
3606
|
-
function eq(value, other) {
|
|
3607
|
-
return value === other || (Number.isNaN(value) && Number.isNaN(other));
|
|
3608
|
-
}
|
|
3609
|
-
|
|
3610
|
-
function isEqualWith(a, b, areValuesEqual) {
|
|
3611
|
-
return isEqualWithImpl(a, b, undefined, undefined, undefined, undefined, areValuesEqual);
|
|
3612
|
-
}
|
|
3613
|
-
function isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {
|
|
3614
|
-
const result = areValuesEqual(a, b, property, aParent, bParent, stack);
|
|
3615
|
-
if (result !== undefined) {
|
|
3616
|
-
return result;
|
|
3617
|
-
}
|
|
3618
|
-
if (typeof a === typeof b) {
|
|
3619
|
-
switch (typeof a) {
|
|
3620
|
-
case 'bigint':
|
|
3621
|
-
case 'string':
|
|
3622
|
-
case 'boolean':
|
|
3623
|
-
case 'symbol':
|
|
3624
|
-
case 'undefined': {
|
|
3625
|
-
return a === b;
|
|
3626
|
-
}
|
|
3627
|
-
case 'number': {
|
|
3628
|
-
return a === b || Object.is(a, b);
|
|
3629
|
-
}
|
|
3630
|
-
case 'function': {
|
|
3631
|
-
return a === b;
|
|
3632
|
-
}
|
|
3633
|
-
case 'object': {
|
|
3634
|
-
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
3635
|
-
}
|
|
3636
|
-
}
|
|
3637
|
-
}
|
|
3638
|
-
return areObjectsEqual(a, b, stack, areValuesEqual);
|
|
3639
|
-
}
|
|
3640
|
-
function areObjectsEqual(a, b, stack, areValuesEqual) {
|
|
3641
|
-
if (Object.is(a, b)) {
|
|
3642
|
-
return true;
|
|
3643
|
-
}
|
|
3644
|
-
let aTag = getTag(a);
|
|
3645
|
-
let bTag = getTag(b);
|
|
3646
|
-
if (aTag === argumentsTag) {
|
|
3647
|
-
aTag = objectTag;
|
|
3648
|
-
}
|
|
3649
|
-
if (bTag === argumentsTag) {
|
|
3650
|
-
bTag = objectTag;
|
|
3651
|
-
}
|
|
3652
|
-
if (aTag !== bTag) {
|
|
3653
|
-
return false;
|
|
3654
|
-
}
|
|
3655
|
-
switch (aTag) {
|
|
3656
|
-
case stringTag:
|
|
3657
|
-
return a.toString() === b.toString();
|
|
3658
|
-
case numberTag: {
|
|
3659
|
-
const x = a.valueOf();
|
|
3660
|
-
const y = b.valueOf();
|
|
3661
|
-
return eq(x, y);
|
|
3662
|
-
}
|
|
3663
|
-
case booleanTag:
|
|
3664
|
-
case dateTag:
|
|
3665
|
-
case symbolTag:
|
|
3666
|
-
return Object.is(a.valueOf(), b.valueOf());
|
|
3667
|
-
case regexpTag: {
|
|
3668
|
-
return a.source === b.source && a.flags === b.flags;
|
|
3669
|
-
}
|
|
3670
|
-
case functionTag: {
|
|
3671
|
-
return a === b;
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
stack = stack ?? new Map();
|
|
3675
|
-
const aStack = stack.get(a);
|
|
3676
|
-
const bStack = stack.get(b);
|
|
3677
|
-
if (aStack != null && bStack != null) {
|
|
3678
|
-
return aStack === b;
|
|
3679
|
-
}
|
|
3680
|
-
stack.set(a, b);
|
|
3681
|
-
stack.set(b, a);
|
|
3682
|
-
try {
|
|
3683
|
-
switch (aTag) {
|
|
3684
|
-
case mapTag: {
|
|
3685
|
-
if (a.size !== b.size) {
|
|
3686
|
-
return false;
|
|
3687
|
-
}
|
|
3688
|
-
for (const [key, value] of a.entries()) {
|
|
3689
|
-
if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) {
|
|
3690
|
-
return false;
|
|
3691
|
-
}
|
|
3692
|
-
}
|
|
3693
|
-
return true;
|
|
3694
|
-
}
|
|
3695
|
-
case setTag: {
|
|
3696
|
-
if (a.size !== b.size) {
|
|
3697
|
-
return false;
|
|
3698
|
-
}
|
|
3699
|
-
const aValues = Array.from(a.values());
|
|
3700
|
-
const bValues = Array.from(b.values());
|
|
3701
|
-
for (let i = 0; i < aValues.length; i++) {
|
|
3702
|
-
const aValue = aValues[i];
|
|
3703
|
-
const index = bValues.findIndex(bValue => {
|
|
3704
|
-
return isEqualWithImpl(aValue, bValue, undefined, a, b, stack, areValuesEqual);
|
|
3705
|
-
});
|
|
3706
|
-
if (index === -1) {
|
|
3707
|
-
return false;
|
|
3708
|
-
}
|
|
3709
|
-
bValues.splice(index, 1);
|
|
3710
|
-
}
|
|
3711
|
-
return true;
|
|
3712
|
-
}
|
|
3713
|
-
case arrayTag:
|
|
3714
|
-
case uint8ArrayTag:
|
|
3715
|
-
case uint8ClampedArrayTag:
|
|
3716
|
-
case uint16ArrayTag:
|
|
3717
|
-
case uint32ArrayTag:
|
|
3718
|
-
case bigUint64ArrayTag:
|
|
3719
|
-
case int8ArrayTag:
|
|
3720
|
-
case int16ArrayTag:
|
|
3721
|
-
case int32ArrayTag:
|
|
3722
|
-
case bigInt64ArrayTag:
|
|
3723
|
-
case float32ArrayTag:
|
|
3724
|
-
case float64ArrayTag: {
|
|
3725
|
-
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) {
|
|
3726
|
-
return false;
|
|
3727
|
-
}
|
|
3728
|
-
if (a.length !== b.length) {
|
|
3729
|
-
return false;
|
|
3730
|
-
}
|
|
3731
|
-
for (let i = 0; i < a.length; i++) {
|
|
3732
|
-
if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) {
|
|
3733
|
-
return false;
|
|
3734
|
-
}
|
|
3735
|
-
}
|
|
3736
|
-
return true;
|
|
3737
|
-
}
|
|
3738
|
-
case arrayBufferTag: {
|
|
3739
|
-
if (a.byteLength !== b.byteLength) {
|
|
3740
|
-
return false;
|
|
3741
|
-
}
|
|
3742
|
-
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
3743
|
-
}
|
|
3744
|
-
case dataViewTag: {
|
|
3745
|
-
if (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) {
|
|
3746
|
-
return false;
|
|
3747
|
-
}
|
|
3748
|
-
return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);
|
|
3749
|
-
}
|
|
3750
|
-
case errorTag: {
|
|
3751
|
-
return a.name === b.name && a.message === b.message;
|
|
3752
|
-
}
|
|
3753
|
-
case objectTag: {
|
|
3754
|
-
const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) ||
|
|
3755
|
-
(isPlainObject(a) && isPlainObject(b));
|
|
3756
|
-
if (!areEqualInstances) {
|
|
3757
|
-
return false;
|
|
3758
|
-
}
|
|
3759
|
-
const aKeys = [...Object.keys(a), ...getSymbols(a)];
|
|
3760
|
-
const bKeys = [...Object.keys(b), ...getSymbols(b)];
|
|
3761
|
-
if (aKeys.length !== bKeys.length) {
|
|
3762
|
-
return false;
|
|
3763
|
-
}
|
|
3764
|
-
for (let i = 0; i < aKeys.length; i++) {
|
|
3765
|
-
const propKey = aKeys[i];
|
|
3766
|
-
const aProp = a[propKey];
|
|
3767
|
-
if (!Object.hasOwn(b, propKey)) {
|
|
3768
|
-
return false;
|
|
3769
|
-
}
|
|
3770
|
-
const bProp = b[propKey];
|
|
3771
|
-
if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) {
|
|
3772
|
-
return false;
|
|
3773
|
-
}
|
|
3774
|
-
}
|
|
3775
|
-
return true;
|
|
3776
|
-
}
|
|
3777
|
-
default: {
|
|
3778
|
-
return false;
|
|
3779
|
-
}
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
finally {
|
|
3783
|
-
stack.delete(a);
|
|
3784
|
-
stack.delete(b);
|
|
3785
|
-
}
|
|
3786
|
-
}
|
|
3787
|
-
|
|
3788
|
-
function noop() { }
|
|
3789
|
-
|
|
3790
|
-
function isEqual(a, b) {
|
|
3791
|
-
return isEqualWith(a, b, noop);
|
|
3792
|
-
}
|
|
3793
|
-
|
|
3794
|
-
function isNotNil(x) {
|
|
3795
|
-
return x != null;
|
|
3796
|
-
}
|
|
3797
|
-
|
|
3798
3602
|
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
3799
3603
|
let pendingThis = undefined;
|
|
3800
3604
|
let pendingArgs = null;
|
|
@@ -3857,4 +3661,8 @@ function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
|
3857
3661
|
return debounced;
|
|
3858
3662
|
}
|
|
3859
3663
|
|
|
3860
|
-
|
|
3664
|
+
function isNotNil(x) {
|
|
3665
|
+
return x != null;
|
|
3666
|
+
}
|
|
3667
|
+
|
|
3668
|
+
export { RovingTabindexController as R, computePosition as a, size as b, createFocusTrap as c, arrow as d, autoUpdate as e, flip as f, clamp$1 as g, hide as h, debounce as i, maxBy as j, flattenObject as k, isNotNil as l, minBy as m, offset as o, round$1 as r, shift as s, toMerged as t };
|
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-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.22",
|
|
5
5
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
7
7
|
"homepage": "https://odx.draeger.com",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"lint": "biome lint ."
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@lit-labs/signals": "~0.
|
|
16
|
+
"@lit-labs/preact-signals": "~1.0.3",
|
|
17
17
|
"@lit/context": "~1.1.4",
|
|
18
18
|
"@odx/design-tokens": "^1.0.0-alpha.1",
|
|
19
19
|
"lit": "~3.2.1"
|