@edsis/angular 22.2.11 → 22.2.14
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/fesm2022/edsis-angular-chart-area.mjs +3 -3
- package/fesm2022/edsis-angular-chart-bar.mjs +3 -3
- package/fesm2022/edsis-angular-chart-core.mjs +34 -34
- package/fesm2022/edsis-angular-chart-line.mjs +3 -3
- package/fesm2022/edsis-angular-chart-pie.mjs +3 -3
- package/fesm2022/edsis-angular-chart-primitives.mjs +33 -33
- package/fesm2022/edsis-angular-chart-radar.mjs +3 -3
- package/fesm2022/edsis-angular-chart-radial.mjs +3 -3
- package/fesm2022/edsis-angular-chart-scatter.mjs +3 -3
- package/fesm2022/edsis-angular-component-accordion.mjs +15 -15
- package/fesm2022/edsis-angular-component-alert-dialog.mjs +27 -27
- package/fesm2022/edsis-angular-component-alert.mjs +12 -12
- package/fesm2022/edsis-angular-component-aspect-ratio.mjs +3 -3
- package/fesm2022/edsis-angular-component-avatar.mjs +18 -18
- package/fesm2022/edsis-angular-component-badge.mjs +3 -3
- package/fesm2022/edsis-angular-component-breadcrumb.mjs +21 -21
- package/fesm2022/edsis-angular-component-button-group.mjs +9 -9
- package/fesm2022/edsis-angular-component-button.mjs +3 -3
- package/fesm2022/edsis-angular-component-calendar.mjs +3 -3
- package/fesm2022/edsis-angular-component-card.mjs +21 -21
- package/fesm2022/edsis-angular-component-carousel.mjs +18 -18
- package/fesm2022/edsis-angular-component-checkbox.mjs +3 -3
- package/fesm2022/edsis-angular-component-collapsible.mjs +12 -12
- package/fesm2022/edsis-angular-component-combobox.mjs +3 -3
- package/fesm2022/edsis-angular-component-command.mjs +27 -27
- package/fesm2022/edsis-angular-component-composer.mjs +21 -21
- package/fesm2022/edsis-angular-component-context-menu.mjs +3 -3
- package/fesm2022/edsis-angular-component-date-picker.mjs +3 -3
- package/fesm2022/edsis-angular-component-dialog.mjs +21 -21
- package/fesm2022/edsis-angular-component-dropdown-menu.mjs +39 -39
- package/fesm2022/edsis-angular-component-editor.mjs +18 -18
- package/fesm2022/edsis-angular-component-empty.mjs +18 -18
- package/fesm2022/edsis-angular-component-form.mjs +36 -36
- package/fesm2022/edsis-angular-component-hover-card.mjs +9 -9
- package/fesm2022/edsis-angular-component-icon.mjs +6 -6
- package/fesm2022/edsis-angular-component-input-group.mjs +18 -18
- package/fesm2022/edsis-angular-component-input-otp.mjs +15 -15
- package/fesm2022/edsis-angular-component-input.mjs +3 -3
- package/fesm2022/edsis-angular-component-item.mjs +30 -30
- package/fesm2022/edsis-angular-component-kanban.mjs +27 -27
- package/fesm2022/edsis-angular-component-kbd.mjs +6 -6
- package/fesm2022/edsis-angular-component-label.mjs +3 -3
- package/fesm2022/edsis-angular-component-menubar.mjs +12 -12
- package/fesm2022/edsis-angular-component-native-select.mjs +9 -9
- package/fesm2022/edsis-angular-component-navigation-menu.mjs +21 -21
- package/fesm2022/edsis-angular-component-pagination.mjs +3 -3
- package/fesm2022/edsis-angular-component-pillbox.mjs +15 -15
- package/fesm2022/edsis-angular-component-popover.mjs +6 -6
- package/fesm2022/edsis-angular-component-progress.mjs +3 -3
- package/fesm2022/edsis-angular-component-radio.mjs +6 -6
- package/fesm2022/edsis-angular-component-resizable.mjs +12 -12
- package/fesm2022/edsis-angular-component-scroll-area.mjs +3 -3
- package/fesm2022/edsis-angular-component-segmented-control.mjs +9 -7
- package/fesm2022/edsis-angular-component-select.mjs +6 -6
- package/fesm2022/edsis-angular-component-separator.mjs +3 -3
- package/fesm2022/edsis-angular-component-sheet.mjs +21 -21
- package/fesm2022/edsis-angular-component-skeleton.mjs +3 -3
- package/fesm2022/edsis-angular-component-slider.mjs +6 -6
- package/fesm2022/edsis-angular-component-spinner.mjs +3 -3
- package/fesm2022/edsis-angular-component-switch.mjs +3 -3
- package/fesm2022/edsis-angular-component-table.mjs +24 -24
- package/fesm2022/edsis-angular-component-tabs.mjs +18 -18
- package/fesm2022/edsis-angular-component-textarea.mjs +3 -3
- package/fesm2022/edsis-angular-component-timeline.mjs +18 -18
- package/fesm2022/edsis-angular-component-toast.mjs +3 -3
- package/fesm2022/edsis-angular-component-toggle-group.mjs +9 -9
- package/fesm2022/edsis-angular-component-toggle.mjs +3 -3
- package/fesm2022/edsis-angular-component-tooltip.mjs +15 -15
- package/fesm2022/edsis-angular-component-utils-core.mjs +420 -4
- package/fesm2022/edsis-angular-component-utils-scale.mjs +3 -3
- package/fesm2022/edsis-angular-navigation-icon.mjs +3 -3
- package/fesm2022/{edsis-angular-navigation-navigation-badge-count.component-D70Ju6_f.mjs → edsis-angular-navigation-navigation-badge-count.component-CLXtMyMX.mjs} +3 -3
- package/fesm2022/{edsis-angular-navigation-navigation-dockbar-menu.component-Wtnee3lp.mjs → edsis-angular-navigation-navigation-dockbar-menu.component-BNduIDrI.mjs} +30 -7
- package/fesm2022/{edsis-angular-navigation-navigation-entry-grid.component-CjxqB5LR.mjs → edsis-angular-navigation-navigation-entry-grid.component-CsD4tbBb.mjs} +60 -21
- package/fesm2022/{edsis-angular-navigation-navigation-flyout-menu.component-DGq4YT1o.mjs → edsis-angular-navigation-navigation-flyout-menu.component-Bs4PLVd6.mjs} +9 -7
- package/fesm2022/{edsis-angular-navigation-navigation-horizontal.component-CG8KNHK2.mjs → edsis-angular-navigation-navigation-horizontal.component-B1XQjUwa.mjs} +10 -8
- package/fesm2022/{edsis-angular-navigation-navigation-item.component-DLHZ8--d.mjs → edsis-angular-navigation-navigation-item.component-CIt0rwpl.mjs} +182 -55
- package/fesm2022/{edsis-angular-navigation-navigation-list.component-I8GW0_HG.mjs → edsis-angular-navigation-navigation-list.component-Dpre1l6O.mjs} +24 -4
- package/fesm2022/edsis-angular-navigation-service.mjs +7 -7
- package/fesm2022/edsis-angular-navigation.mjs +90 -66
- package/fesm2022/edsis-angular-theme-component-settings.mjs +88 -23
- package/fesm2022/edsis-angular-theme-layout-services.mjs +7 -7
- package/fesm2022/edsis-angular-theme-layout-wrapper.mjs +54 -30
- package/fesm2022/edsis-angular-theme-layout.mjs +26 -29
- package/fesm2022/edsis-angular-theme-on-fill.mjs +3 -3
- package/fesm2022/edsis-angular-theme-page-core.mjs +3 -3
- package/fesm2022/edsis-angular-theme-page-filter.mjs +6 -6
- package/fesm2022/edsis-angular-theme-page-overview.mjs +3 -3
- package/fesm2022/edsis-angular-theme-page-root.mjs +4 -3
- package/fesm2022/edsis-angular-theme-page-side.mjs +6 -6
- package/fesm2022/edsis-angular-theme-page-slots.mjs +12 -12
- package/fesm2022/edsis-angular-theme-shell-services.mjs +4 -4
- package/fesm2022/edsis-angular-theme-shell.mjs +10 -9
- package/fesm2022/edsis-angular-theme-styles.mjs +109 -178
- package/navigation/README.md +32 -2
- package/package.json +2 -2
- package/theme/component/settings/README.md +15 -0
- package/theme/styles/README.md +71 -1
- package/theme/styles/css/base/components.css +29 -75
- package/theme/styles/css/base/theme.css +3 -3
- package/theme/styles/css/base/tokens.css +8 -0
- package/types/edsis-angular-component-card.d.ts +1 -1
- package/types/edsis-angular-component-command.d.ts +1 -1
- package/types/edsis-angular-component-segmented-control.d.ts +3 -3
- package/types/edsis-angular-component-utils-core.d.ts +147 -3
- package/types/edsis-angular-navigation-types.d.ts +2 -0
- package/types/edsis-angular-navigation.d.ts +8 -1
- package/types/edsis-angular-theme-component-settings.d.ts +9 -1
- package/types/edsis-angular-theme-layout-wrapper.d.ts +9 -2
- package/types/edsis-angular-theme-layout.d.ts +0 -1
- package/types/edsis-angular-theme-styles.d.ts +30 -26
|
@@ -16,7 +16,7 @@ var TooltipComponent = class TooltipComponent {
|
|
|
16
16
|
closeDelay = input(150, ...ngDevMode ? [{ debugName: "closeDelay" }] : /* istanbul ignore next */ []);
|
|
17
17
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
18
18
|
minVersion: "12.0.0",
|
|
19
|
-
version: "22.2.
|
|
19
|
+
version: "22.2.6",
|
|
20
20
|
ngImport: i0,
|
|
21
21
|
type: TooltipComponent,
|
|
22
22
|
deps: [],
|
|
@@ -24,7 +24,7 @@ var TooltipComponent = class TooltipComponent {
|
|
|
24
24
|
});
|
|
25
25
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
26
26
|
minVersion: "17.1.0",
|
|
27
|
-
version: "22.2.
|
|
27
|
+
version: "22.2.6",
|
|
28
28
|
type: TooltipComponent,
|
|
29
29
|
isStandalone: true,
|
|
30
30
|
selector: "Tooltip",
|
|
@@ -77,7 +77,7 @@ var TooltipComponent = class TooltipComponent {
|
|
|
77
77
|
};
|
|
78
78
|
i0.ɵɵngDeclareClassMetadata({
|
|
79
79
|
minVersion: "12.0.0",
|
|
80
|
-
version: "22.2.
|
|
80
|
+
version: "22.2.6",
|
|
81
81
|
ngImport: i0,
|
|
82
82
|
type: TooltipComponent,
|
|
83
83
|
decorators: [{
|
|
@@ -144,7 +144,7 @@ var TooltipContentDirective = class TooltipContentDirective {
|
|
|
144
144
|
densityBase = this.componentScale.densityBase;
|
|
145
145
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
146
146
|
minVersion: "12.0.0",
|
|
147
|
-
version: "22.2.
|
|
147
|
+
version: "22.2.6",
|
|
148
148
|
ngImport: i0,
|
|
149
149
|
type: TooltipContentDirective,
|
|
150
150
|
deps: [],
|
|
@@ -152,7 +152,7 @@ var TooltipContentDirective = class TooltipContentDirective {
|
|
|
152
152
|
});
|
|
153
153
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
154
154
|
minVersion: "14.0.0",
|
|
155
|
-
version: "22.2.
|
|
155
|
+
version: "22.2.6",
|
|
156
156
|
type: TooltipContentDirective,
|
|
157
157
|
isStandalone: true,
|
|
158
158
|
selector: "ng-template[TooltipContent]",
|
|
@@ -171,7 +171,7 @@ var TooltipContentDirective = class TooltipContentDirective {
|
|
|
171
171
|
};
|
|
172
172
|
i0.ɵɵngDeclareClassMetadata({
|
|
173
173
|
minVersion: "12.0.0",
|
|
174
|
-
version: "22.2.
|
|
174
|
+
version: "22.2.6",
|
|
175
175
|
ngImport: i0,
|
|
176
176
|
type: TooltipContentDirective,
|
|
177
177
|
decorators: [{
|
|
@@ -363,7 +363,7 @@ var TooltipTriggerDirective = class TooltipTriggerDirective {
|
|
|
363
363
|
}
|
|
364
364
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
365
365
|
minVersion: "12.0.0",
|
|
366
|
-
version: "22.2.
|
|
366
|
+
version: "22.2.6",
|
|
367
367
|
ngImport: i0,
|
|
368
368
|
type: TooltipTriggerDirective,
|
|
369
369
|
deps: [],
|
|
@@ -371,7 +371,7 @@ var TooltipTriggerDirective = class TooltipTriggerDirective {
|
|
|
371
371
|
});
|
|
372
372
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
373
373
|
minVersion: "17.1.0",
|
|
374
|
-
version: "22.2.
|
|
374
|
+
version: "22.2.6",
|
|
375
375
|
type: TooltipTriggerDirective,
|
|
376
376
|
isStandalone: true,
|
|
377
377
|
selector: "[TooltipTrigger]",
|
|
@@ -446,7 +446,7 @@ var TooltipTriggerDirective = class TooltipTriggerDirective {
|
|
|
446
446
|
};
|
|
447
447
|
i0.ɵɵngDeclareClassMetadata({
|
|
448
448
|
minVersion: "12.0.0",
|
|
449
|
-
version: "22.2.
|
|
449
|
+
version: "22.2.6",
|
|
450
450
|
ngImport: i0,
|
|
451
451
|
type: TooltipTriggerDirective,
|
|
452
452
|
decorators: [{
|
|
@@ -559,7 +559,7 @@ var TooltipTextComponent = class TooltipTextComponent {
|
|
|
559
559
|
text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
560
560
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
561
561
|
minVersion: "12.0.0",
|
|
562
|
-
version: "22.2.
|
|
562
|
+
version: "22.2.6",
|
|
563
563
|
ngImport: i0,
|
|
564
564
|
type: TooltipTextComponent,
|
|
565
565
|
deps: [],
|
|
@@ -567,7 +567,7 @@ var TooltipTextComponent = class TooltipTextComponent {
|
|
|
567
567
|
});
|
|
568
568
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
569
569
|
minVersion: "14.0.0",
|
|
570
|
-
version: "22.2.
|
|
570
|
+
version: "22.2.6",
|
|
571
571
|
type: TooltipTextComponent,
|
|
572
572
|
isStandalone: true,
|
|
573
573
|
selector: "ng-component",
|
|
@@ -578,7 +578,7 @@ var TooltipTextComponent = class TooltipTextComponent {
|
|
|
578
578
|
};
|
|
579
579
|
i0.ɵɵngDeclareClassMetadata({
|
|
580
580
|
minVersion: "12.0.0",
|
|
581
|
-
version: "22.2.
|
|
581
|
+
version: "22.2.6",
|
|
582
582
|
ngImport: i0,
|
|
583
583
|
type: TooltipTextComponent,
|
|
584
584
|
decorators: [{
|
|
@@ -678,7 +678,7 @@ var TooltipDirective = class TooltipDirective {
|
|
|
678
678
|
}
|
|
679
679
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
680
680
|
minVersion: "12.0.0",
|
|
681
|
-
version: "22.2.
|
|
681
|
+
version: "22.2.6",
|
|
682
682
|
ngImport: i0,
|
|
683
683
|
type: TooltipDirective,
|
|
684
684
|
deps: [],
|
|
@@ -686,7 +686,7 @@ var TooltipDirective = class TooltipDirective {
|
|
|
686
686
|
});
|
|
687
687
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
688
688
|
minVersion: "17.1.0",
|
|
689
|
-
version: "22.2.
|
|
689
|
+
version: "22.2.6",
|
|
690
690
|
type: TooltipDirective,
|
|
691
691
|
isStandalone: true,
|
|
692
692
|
selector: "[Tooltip]",
|
|
@@ -740,7 +740,7 @@ var TooltipDirective = class TooltipDirective {
|
|
|
740
740
|
};
|
|
741
741
|
i0.ɵɵngDeclareClassMetadata({
|
|
742
742
|
minVersion: "12.0.0",
|
|
743
|
-
version: "22.2.
|
|
743
|
+
version: "22.2.6",
|
|
744
744
|
ngImport: i0,
|
|
745
745
|
type: TooltipDirective,
|
|
746
746
|
decorators: [{
|
|
@@ -141,12 +141,254 @@ function uniqueId(prefix) {
|
|
|
141
141
|
counter += 1;
|
|
142
142
|
return `${prefix}-${counter}`;
|
|
143
143
|
}
|
|
144
|
+
const STORAGE_VERSION_KEY = "theme-storage-version";
|
|
145
|
+
const LOCK_NAME = "ui-theme-storage-reset";
|
|
146
|
+
const LOCK_WAIT_MS = 2e3;
|
|
147
|
+
function parseStorageVersion(value) {
|
|
148
|
+
if (value === null || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value)) return null;
|
|
149
|
+
const parts = value.split(".").map(Number);
|
|
150
|
+
return parts.every(Number.isSafeInteger) ? parts : null;
|
|
151
|
+
}
|
|
152
|
+
function compareVersions(left, right) {
|
|
153
|
+
for (let index = 0; index < 3; index++) if (left[index] !== right[index]) return left[index] > right[index] ? 1 : -1;
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
const roots = /* @__PURE__ */ new WeakMap();
|
|
157
|
+
function registerStorageRoot(documentRef, coordinator) {
|
|
158
|
+
const existing = roots.get(documentRef);
|
|
159
|
+
if (existing && (coordinator || existing.coordinator)) throw new Error("Automatic theme storage reset permits only one theme root per Document.");
|
|
160
|
+
const root = existing ?? {
|
|
161
|
+
owners: /* @__PURE__ */ new Set(),
|
|
162
|
+
coordinator
|
|
163
|
+
};
|
|
164
|
+
const owner = {};
|
|
165
|
+
root.owners.add(owner);
|
|
166
|
+
roots.set(documentRef, root);
|
|
167
|
+
coordinator?.listen();
|
|
168
|
+
return () => {
|
|
169
|
+
coordinator?.destroy();
|
|
170
|
+
root.owners.delete(owner);
|
|
171
|
+
if (roots.get(documentRef) === root && root.owners.size === 0) roots.delete(documentRef);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function storageCoordinator(documentRef) {
|
|
175
|
+
return documentRef ? roots.get(documentRef)?.coordinator ?? null : null;
|
|
176
|
+
}
|
|
177
|
+
var StorageCoordinator = class {
|
|
178
|
+
documentRef;
|
|
179
|
+
version;
|
|
180
|
+
preserveKeys;
|
|
181
|
+
setStatus;
|
|
182
|
+
state = "pending";
|
|
183
|
+
versionParts;
|
|
184
|
+
invalidations = /* @__PURE__ */ new Set();
|
|
185
|
+
requests = /* @__PURE__ */ new Set();
|
|
186
|
+
tail = Promise.resolve();
|
|
187
|
+
initialization;
|
|
188
|
+
destroyed = false;
|
|
189
|
+
reloadPending = false;
|
|
190
|
+
lastReloadTarget = null;
|
|
191
|
+
window;
|
|
192
|
+
constructor(documentRef, version, preserveKeys, setStatus) {
|
|
193
|
+
this.documentRef = documentRef;
|
|
194
|
+
this.version = version;
|
|
195
|
+
this.preserveKeys = preserveKeys;
|
|
196
|
+
this.setStatus = setStatus;
|
|
197
|
+
const parts = parseStorageVersion(version);
|
|
198
|
+
if (!parts) throw new Error("Theme package version must use stable MAJOR.MINOR.PATCH.");
|
|
199
|
+
this.versionParts = parts;
|
|
200
|
+
this.window = documentRef.defaultView;
|
|
201
|
+
setStatus("pending");
|
|
202
|
+
}
|
|
203
|
+
listen() {
|
|
204
|
+
this.window?.addEventListener("storage", this.onStorage);
|
|
205
|
+
this.window?.addEventListener("focus", this.onWake);
|
|
206
|
+
this.window?.addEventListener("pageshow", this.onWake);
|
|
207
|
+
}
|
|
208
|
+
initialize(hydrate) {
|
|
209
|
+
this.initialization ??= this.bootstrap(hydrate);
|
|
210
|
+
return this.initialization;
|
|
211
|
+
}
|
|
212
|
+
async bootstrap(hydrate) {
|
|
213
|
+
try {
|
|
214
|
+
if (!this.window) this.transition("unavailable");
|
|
215
|
+
else if (!this.window.navigator.locks) this.transition("unsupported");
|
|
216
|
+
else await this.lock(() => {
|
|
217
|
+
const storage = this.nativeStorage();
|
|
218
|
+
const previous = parseStorageVersion(storage.getItem(STORAGE_VERSION_KEY));
|
|
219
|
+
if (!previous) {
|
|
220
|
+
storage.setItem(STORAGE_VERSION_KEY, this.version);
|
|
221
|
+
this.transition("adopted");
|
|
222
|
+
} else {
|
|
223
|
+
const order = compareVersions(this.versionParts, previous);
|
|
224
|
+
if (order < 0) {
|
|
225
|
+
this.lastReloadTarget = previous;
|
|
226
|
+
this.transition("stale");
|
|
227
|
+
} else if (order === 0) this.transition("ready");
|
|
228
|
+
else {
|
|
229
|
+
const keys = [];
|
|
230
|
+
for (let index = 0; index < storage.length; index++) {
|
|
231
|
+
const key = storage.key(index);
|
|
232
|
+
if (key !== null) keys.push(key);
|
|
233
|
+
}
|
|
234
|
+
for (const key of keys) if (key !== "theme-storage-version" && !this.preserveKeys.has(key)) storage.removeItem(key);
|
|
235
|
+
storage.setItem(STORAGE_VERSION_KEY, this.version);
|
|
236
|
+
this.transition("reset");
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (this.canPersist() && this.observeMarker(storage)) hydrate();
|
|
240
|
+
});
|
|
241
|
+
} catch {
|
|
242
|
+
this.fail();
|
|
243
|
+
}
|
|
244
|
+
if (!this.destroyed && !this.canPersist()) hydrate();
|
|
245
|
+
}
|
|
246
|
+
nativeStorage() {
|
|
247
|
+
const storage = this.window?.localStorage;
|
|
248
|
+
if (!storage) throw new Error("Storage unavailable.");
|
|
249
|
+
return storage;
|
|
250
|
+
}
|
|
251
|
+
canPersist() {
|
|
252
|
+
return !this.destroyed && [
|
|
253
|
+
"ready",
|
|
254
|
+
"adopted",
|
|
255
|
+
"reset"
|
|
256
|
+
].includes(this.state);
|
|
257
|
+
}
|
|
258
|
+
assertInitialized() {
|
|
259
|
+
if (!this.destroyed && this.state === "pending") throw new Error("Theme storage is pending. Await ThemeStorageVersionService.initialize() before reading preferences.");
|
|
260
|
+
}
|
|
261
|
+
read(key) {
|
|
262
|
+
this.assertInitialized();
|
|
263
|
+
if (!this.canPersist()) return null;
|
|
264
|
+
try {
|
|
265
|
+
return this.nativeStorage().getItem(key);
|
|
266
|
+
} catch {
|
|
267
|
+
this.fail();
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
write(key, value, owner) {
|
|
272
|
+
this.mutate((storage) => storage.setItem(key, value), owner);
|
|
273
|
+
}
|
|
274
|
+
remove(key, owner) {
|
|
275
|
+
this.mutate((storage) => storage.removeItem(key), owner);
|
|
276
|
+
}
|
|
277
|
+
mutate(action, owner) {
|
|
278
|
+
this.assertInitialized();
|
|
279
|
+
if (!this.canPersist()) return;
|
|
280
|
+
this.tail = this.tail.then(async () => {
|
|
281
|
+
if (!this.canPersist() || owner?.destroyed) return;
|
|
282
|
+
await this.lock(() => {
|
|
283
|
+
if (!this.canPersist() || owner?.destroyed) return;
|
|
284
|
+
const storage = this.nativeStorage();
|
|
285
|
+
if (this.observeMarker(storage)) action(storage);
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
onInvalidation(callback) {
|
|
290
|
+
this.invalidations.add(callback);
|
|
291
|
+
return () => this.invalidations.delete(callback);
|
|
292
|
+
}
|
|
293
|
+
transition(status) {
|
|
294
|
+
if (this.destroyed) return;
|
|
295
|
+
this.state = status;
|
|
296
|
+
this.setStatus(status);
|
|
297
|
+
}
|
|
298
|
+
fail() {
|
|
299
|
+
if (this.destroyed || [
|
|
300
|
+
"failed",
|
|
301
|
+
"unsupported",
|
|
302
|
+
"unavailable"
|
|
303
|
+
].includes(this.state)) return;
|
|
304
|
+
this.transition("failed");
|
|
305
|
+
for (const request of this.requests) request.abort();
|
|
306
|
+
for (const callback of this.invalidations) callback();
|
|
307
|
+
}
|
|
308
|
+
observeMarker(storage) {
|
|
309
|
+
const marker = parseStorageVersion(storage.getItem(STORAGE_VERSION_KEY));
|
|
310
|
+
if (this.state === "stale" && (!marker || compareVersions(marker, this.lastReloadTarget ?? this.versionParts) <= 0)) return false;
|
|
311
|
+
if (!marker) {
|
|
312
|
+
this.fail();
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
const order = compareVersions(marker, this.versionParts);
|
|
316
|
+
if (order > 0) {
|
|
317
|
+
this.transition("stale");
|
|
318
|
+
if (!this.lastReloadTarget || compareVersions(marker, this.lastReloadTarget) > 0) {
|
|
319
|
+
this.lastReloadTarget = marker;
|
|
320
|
+
this.reloadPending = true;
|
|
321
|
+
}
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
if (order < 0) {
|
|
325
|
+
this.fail();
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
async lock(action) {
|
|
331
|
+
if (this.destroyed) return;
|
|
332
|
+
const controller = new AbortController();
|
|
333
|
+
this.requests.add(controller);
|
|
334
|
+
const timeout = setTimeout(() => controller.abort(), LOCK_WAIT_MS);
|
|
335
|
+
try {
|
|
336
|
+
const manager = this.window?.navigator.locks;
|
|
337
|
+
if (!manager) {
|
|
338
|
+
this.fail();
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
await manager.request(LOCK_NAME, {
|
|
342
|
+
mode: "exclusive",
|
|
343
|
+
signal: controller.signal
|
|
344
|
+
}, () => {
|
|
345
|
+
clearTimeout(timeout);
|
|
346
|
+
if (!this.destroyed && !controller.signal.aborted) action();
|
|
347
|
+
});
|
|
348
|
+
} catch {
|
|
349
|
+
this.fail();
|
|
350
|
+
} finally {
|
|
351
|
+
clearTimeout(timeout);
|
|
352
|
+
this.requests.delete(controller);
|
|
353
|
+
}
|
|
354
|
+
if (this.reloadPending) {
|
|
355
|
+
this.reloadPending = false;
|
|
356
|
+
if (!this.destroyed && this.state === "stale") this.window?.location.reload();
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
onStorage = (event) => {
|
|
360
|
+
if (event.storageArea && event.storageArea !== this.window?.localStorage) return;
|
|
361
|
+
if (event.key === null || event.key === "theme-storage-version") this.onWake();
|
|
362
|
+
};
|
|
363
|
+
onWake = () => {
|
|
364
|
+
if (this.destroyed || this.state === "pending" || [
|
|
365
|
+
"failed",
|
|
366
|
+
"unsupported",
|
|
367
|
+
"unavailable"
|
|
368
|
+
].includes(this.state)) return;
|
|
369
|
+
this.lock(() => {
|
|
370
|
+
if (!this.destroyed && ![
|
|
371
|
+
"failed",
|
|
372
|
+
"unsupported",
|
|
373
|
+
"unavailable"
|
|
374
|
+
].includes(this.state)) this.observeMarker(this.nativeStorage());
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
destroy() {
|
|
378
|
+
this.destroyed = true;
|
|
379
|
+
for (const request of this.requests) request.abort();
|
|
380
|
+
this.invalidations.clear();
|
|
381
|
+
this.window?.removeEventListener("storage", this.onStorage);
|
|
382
|
+
this.window?.removeEventListener("focus", this.onWake);
|
|
383
|
+
this.window?.removeEventListener("pageshow", this.onWake);
|
|
384
|
+
}
|
|
385
|
+
};
|
|
144
386
|
const UNAVAILABLE = {
|
|
145
387
|
read: () => null,
|
|
146
388
|
write: () => {},
|
|
147
389
|
remove: () => {}
|
|
148
390
|
};
|
|
149
|
-
function documentLocalStorage(documentRef) {
|
|
391
|
+
function documentLocalStorage(documentRef, owner) {
|
|
150
392
|
const resolve = () => {
|
|
151
393
|
try {
|
|
152
394
|
return documentRef?.defaultView?.localStorage ?? null;
|
|
@@ -156,6 +398,8 @@ function documentLocalStorage(documentRef) {
|
|
|
156
398
|
};
|
|
157
399
|
return {
|
|
158
400
|
read: (key) => {
|
|
401
|
+
const coordinator = storageCoordinator(documentRef);
|
|
402
|
+
if (coordinator) return coordinator.read(key);
|
|
159
403
|
try {
|
|
160
404
|
return resolve()?.getItem(key) ?? null;
|
|
161
405
|
} catch {
|
|
@@ -163,19 +407,191 @@ function documentLocalStorage(documentRef) {
|
|
|
163
407
|
}
|
|
164
408
|
},
|
|
165
409
|
write: (key, value) => {
|
|
410
|
+
const coordinator = storageCoordinator(documentRef);
|
|
411
|
+
if (owner?.destroyed) return;
|
|
412
|
+
if (coordinator) {
|
|
413
|
+
coordinator.write(key, value, owner);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
166
416
|
try {
|
|
167
417
|
resolve()?.setItem(key, value);
|
|
168
418
|
} catch {}
|
|
169
419
|
},
|
|
170
420
|
remove: (key) => {
|
|
421
|
+
const coordinator = storageCoordinator(documentRef);
|
|
422
|
+
if (owner?.destroyed) return;
|
|
423
|
+
if (coordinator) {
|
|
424
|
+
coordinator.remove(key, owner);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
171
427
|
try {
|
|
172
428
|
resolve()?.removeItem(key);
|
|
173
429
|
} catch {}
|
|
174
430
|
}
|
|
175
431
|
};
|
|
176
432
|
}
|
|
177
|
-
function globalLocalStorage(isBrowser) {
|
|
433
|
+
function globalLocalStorage(isBrowser, owner) {
|
|
178
434
|
if (!isBrowser) return UNAVAILABLE;
|
|
179
|
-
return documentLocalStorage(typeof document === "undefined" ? null : document);
|
|
435
|
+
return documentLocalStorage(typeof document === "undefined" ? null : document, owner);
|
|
436
|
+
}
|
|
437
|
+
const TEXT_CONTRAST_MIN = 4.5;
|
|
438
|
+
const NON_TEXT_CONTRAST_MIN = 3;
|
|
439
|
+
const SOLVE_MARGIN = .02;
|
|
440
|
+
const NUMBER = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)";
|
|
441
|
+
const SEPARATOR = "(?:\\s*,\\s*|\\s+)";
|
|
442
|
+
let hslTriplet;
|
|
443
|
+
const hslTripletPattern = () => hslTriplet ??= new RegExp(`^\\s*(${NUMBER})(deg|grad|rad|turn)?${SEPARATOR}(${NUMBER})%${SEPARATOR}(${NUMBER})%\\s*$`, "i");
|
|
444
|
+
const HEX_COLOR = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
445
|
+
const DEGREES_PER_UNIT = {
|
|
446
|
+
deg: 1,
|
|
447
|
+
grad: .9,
|
|
448
|
+
rad: 57.29577951308232,
|
|
449
|
+
turn: 360
|
|
450
|
+
};
|
|
451
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
452
|
+
const normalizeHue = (hue) => (hue % 360 + 360) % 360;
|
|
453
|
+
function parseHslTriplet(value) {
|
|
454
|
+
const match = hslTripletPattern().exec(value);
|
|
455
|
+
if (!match) return null;
|
|
456
|
+
const [h, s, l] = [
|
|
457
|
+
Number(match[1]),
|
|
458
|
+
Number(match[3]),
|
|
459
|
+
Number(match[4])
|
|
460
|
+
];
|
|
461
|
+
if (![
|
|
462
|
+
h,
|
|
463
|
+
s,
|
|
464
|
+
l
|
|
465
|
+
].every(Number.isFinite)) return null;
|
|
466
|
+
return {
|
|
467
|
+
h: normalizeHue(h * DEGREES_PER_UNIT[match[2]?.toLowerCase() ?? "deg"]),
|
|
468
|
+
s,
|
|
469
|
+
l
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function formatHslTriplet({ h, s, l }) {
|
|
473
|
+
return `${h} ${clamp(Math.round(s), 0, 100)}% ${clamp(Math.round(l), 0, 100)}%`;
|
|
474
|
+
}
|
|
475
|
+
function hexToHslTriplet(value) {
|
|
476
|
+
const exact = hexToHsl(value);
|
|
477
|
+
return exact ? formatHslTriplet({
|
|
478
|
+
h: Math.round(exact.h),
|
|
479
|
+
s: exact.s,
|
|
480
|
+
l: exact.l
|
|
481
|
+
}) : null;
|
|
482
|
+
}
|
|
483
|
+
function hexToHsl(value) {
|
|
484
|
+
const match = HEX_COLOR.exec(value.trim());
|
|
485
|
+
if (!match) return null;
|
|
486
|
+
const digits = match[1];
|
|
487
|
+
const expanded = digits.length === 3 ? digits.split("").map((digit) => digit + digit).join("") : digits;
|
|
488
|
+
const [red, green, blue] = [
|
|
489
|
+
0,
|
|
490
|
+
2,
|
|
491
|
+
4
|
|
492
|
+
].map((offset) => Number.parseInt(expanded.slice(offset, offset + 2), 16) / 255);
|
|
493
|
+
const largest = Math.max(red, green, blue);
|
|
494
|
+
const smallest = Math.min(red, green, blue);
|
|
495
|
+
const delta = largest - smallest;
|
|
496
|
+
const lightness = (largest + smallest) / 2;
|
|
497
|
+
let hue = 0;
|
|
498
|
+
if (delta !== 0) {
|
|
499
|
+
if (largest === red) hue = 60 * (((green - blue) / delta + 6) % 6);
|
|
500
|
+
else if (largest === green) hue = 60 * ((blue - red) / delta + 2);
|
|
501
|
+
else hue = 60 * ((red - green) / delta + 4);
|
|
502
|
+
}
|
|
503
|
+
const saturation = delta === 0 ? 0 : delta / (1 - Math.abs(2 * lightness - 1));
|
|
504
|
+
return {
|
|
505
|
+
h: hue,
|
|
506
|
+
s: saturation * 100,
|
|
507
|
+
l: lightness * 100
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
function hslToRgb({ h, s, l }) {
|
|
511
|
+
const saturation = clamp(s, 0, 100) / 100;
|
|
512
|
+
const lightness = clamp(l, 0, 100) / 100;
|
|
513
|
+
const k = (n) => (n + h / 30) % 12;
|
|
514
|
+
const a = saturation * Math.min(lightness, 1 - lightness);
|
|
515
|
+
const channel = (n) => lightness - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
516
|
+
return [
|
|
517
|
+
channel(0),
|
|
518
|
+
channel(8),
|
|
519
|
+
channel(4)
|
|
520
|
+
];
|
|
521
|
+
}
|
|
522
|
+
const toLinear = (channel) => channel <= .03928 ? channel / 12.92 : Math.pow((channel + .055) / 1.055, 2.4);
|
|
523
|
+
const toPainted = (channel) => Math.round(clamp(channel, 0, 1) * 255) / 255;
|
|
524
|
+
function relativeLuminance(triplet) {
|
|
525
|
+
const parsed = parseHslTriplet(triplet);
|
|
526
|
+
if (!parsed) return 0;
|
|
527
|
+
const [r, g, b] = hslToRgb(parsed).map(toPainted);
|
|
528
|
+
return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
|
|
529
|
+
}
|
|
530
|
+
function contrastRatio(a, b) {
|
|
531
|
+
const ya = relativeLuminance(a);
|
|
532
|
+
const yb = relativeLuminance(b);
|
|
533
|
+
return (Math.max(ya, yb) + .05) / (Math.min(ya, yb) + .05);
|
|
534
|
+
}
|
|
535
|
+
function solveLightnessNearest(options) {
|
|
536
|
+
const target = options.min + (options.margin ?? .02);
|
|
537
|
+
const start = Math.round(clamp(options.from, 0, 100));
|
|
538
|
+
for (let delta = 0; delta <= 100; delta += 1) for (const candidate of delta === 0 ? [start] : [start - delta, start + delta]) {
|
|
539
|
+
if (candidate < 0 || candidate > 100) continue;
|
|
540
|
+
const triplet = formatHslTriplet({
|
|
541
|
+
h: options.h,
|
|
542
|
+
s: options.s,
|
|
543
|
+
l: candidate
|
|
544
|
+
});
|
|
545
|
+
if (options.against.every((background) => contrastRatio(triplet, background) >= target)) return triplet;
|
|
546
|
+
}
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
function fitForeground(options) {
|
|
550
|
+
const min = options.min ?? 4.5;
|
|
551
|
+
if (contrastRatio(options.foreground, options.background) >= min) return options.foreground;
|
|
552
|
+
const parsed = parseHslTriplet(options.foreground);
|
|
553
|
+
if (!parsed) return options.foreground;
|
|
554
|
+
return solveLightnessNearest({
|
|
555
|
+
h: parsed.h,
|
|
556
|
+
s: parsed.s,
|
|
557
|
+
against: [options.background],
|
|
558
|
+
min,
|
|
559
|
+
from: parsed.l
|
|
560
|
+
}) ?? options.foreground;
|
|
561
|
+
}
|
|
562
|
+
const ON_FILL_INK = /* @__PURE__ */ Object.freeze({
|
|
563
|
+
light: "0 0% 12%",
|
|
564
|
+
dark: "0 0% 10%"
|
|
565
|
+
});
|
|
566
|
+
const ON_FILL_WHITE = "0 0% 100%";
|
|
567
|
+
function pickFillForeground(fill, dark, min = TEXT_CONTRAST_MIN) {
|
|
568
|
+
const lightRatio = contrastRatio(ON_FILL_WHITE, fill);
|
|
569
|
+
const darkRatio = contrastRatio(dark, fill);
|
|
570
|
+
const preferred = lightRatio >= darkRatio ? ON_FILL_WHITE : dark;
|
|
571
|
+
if (Math.max(lightRatio, darkRatio) >= min) return preferred;
|
|
572
|
+
const ink = parseHslTriplet(dark);
|
|
573
|
+
return solveLightnessNearest({
|
|
574
|
+
h: ink.h,
|
|
575
|
+
s: ink.s,
|
|
576
|
+
against: [fill],
|
|
577
|
+
min,
|
|
578
|
+
from: ink.l
|
|
579
|
+
}) ?? formatHslTriplet({
|
|
580
|
+
h: ink.h,
|
|
581
|
+
s: ink.s,
|
|
582
|
+
l: 0
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
function toFillTriplet(fill) {
|
|
586
|
+
const parsed = parseHslTriplet(fill);
|
|
587
|
+
if (parsed) return `${parsed.h} ${parsed.s}% ${parsed.l}%`;
|
|
588
|
+
const hex = hexToHsl(fill);
|
|
589
|
+
return hex ? `${hex.h} ${hex.s}% ${hex.l}%` : null;
|
|
590
|
+
}
|
|
591
|
+
function foregroundFor(fill, mode = "light") {
|
|
592
|
+
if (typeof fill !== "string") return null;
|
|
593
|
+
const triplet = toFillTriplet(fill.trim());
|
|
594
|
+
if (!triplet) return null;
|
|
595
|
+
return pickFillForeground(triplet, ON_FILL_INK[mode === "dark" ? "dark" : "light"]);
|
|
180
596
|
}
|
|
181
|
-
export { COMPONENT_DENSITIES, COMPONENT_RADII, RovingRow, UI_ID_GENERATOR, UiIdGenerator, cn, densityBaseValue, documentLocalStorage, globalLocalStorage, injectUniqueId, radiusBaseValue, uniqueId };
|
|
597
|
+
export { COMPONENT_DENSITIES, COMPONENT_RADII, NON_TEXT_CONTRAST_MIN, ON_FILL_INK, RovingRow, SOLVE_MARGIN, STORAGE_VERSION_KEY, StorageCoordinator, TEXT_CONTRAST_MIN, UI_ID_GENERATOR, UiIdGenerator, cn, contrastRatio, densityBaseValue, documentLocalStorage, fitForeground, foregroundFor, formatHslTriplet, globalLocalStorage, hexToHslTriplet, injectUniqueId, parseHslTriplet, parseStorageVersion, radiusBaseValue, registerStorageRoot, relativeLuminance, solveLightnessNearest, storageCoordinator, uniqueId };
|
|
@@ -8,7 +8,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
|
|
|
8
8
|
densityBase = computed(() => densityBaseValue(this.density()), ...ngDevMode ? [{ debugName: "densityBase" }] : /* istanbul ignore next */ []);
|
|
9
9
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
10
|
minVersion: "12.0.0",
|
|
11
|
-
version: "22.2.
|
|
11
|
+
version: "22.2.6",
|
|
12
12
|
ngImport: i0,
|
|
13
13
|
type: ComponentScaleDirective,
|
|
14
14
|
deps: [],
|
|
@@ -16,7 +16,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
|
|
|
16
16
|
});
|
|
17
17
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
18
18
|
minVersion: "17.1.0",
|
|
19
|
-
version: "22.2.
|
|
19
|
+
version: "22.2.6",
|
|
20
20
|
type: ComponentScaleDirective,
|
|
21
21
|
isStandalone: true,
|
|
22
22
|
inputs: {
|
|
@@ -44,7 +44,7 @@ var ComponentScaleDirective = class ComponentScaleDirective {
|
|
|
44
44
|
};
|
|
45
45
|
i0.ɵɵngDeclareClassMetadata({
|
|
46
46
|
minVersion: "12.0.0",
|
|
47
|
-
version: "22.2.
|
|
47
|
+
version: "22.2.6",
|
|
48
48
|
ngImport: i0,
|
|
49
49
|
type: ComponentScaleDirective,
|
|
50
50
|
decorators: [{
|
|
@@ -7,7 +7,7 @@ var NavigationIconDirective = class NavigationIconDirective {
|
|
|
7
7
|
}
|
|
8
8
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
9
9
|
minVersion: "12.0.0",
|
|
10
|
-
version: "22.2.
|
|
10
|
+
version: "22.2.6",
|
|
11
11
|
ngImport: i0,
|
|
12
12
|
type: NavigationIconDirective,
|
|
13
13
|
deps: [],
|
|
@@ -15,7 +15,7 @@ var NavigationIconDirective = class NavigationIconDirective {
|
|
|
15
15
|
});
|
|
16
16
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
17
17
|
minVersion: "14.0.0",
|
|
18
|
-
version: "22.2.
|
|
18
|
+
version: "22.2.6",
|
|
19
19
|
type: NavigationIconDirective,
|
|
20
20
|
isStandalone: true,
|
|
21
21
|
selector: "ng-template[NavigationIcon]",
|
|
@@ -24,7 +24,7 @@ var NavigationIconDirective = class NavigationIconDirective {
|
|
|
24
24
|
};
|
|
25
25
|
i0.ɵɵngDeclareClassMetadata({
|
|
26
26
|
minVersion: "12.0.0",
|
|
27
|
-
version: "22.2.
|
|
27
|
+
version: "22.2.6",
|
|
28
28
|
ngImport: i0,
|
|
29
29
|
type: NavigationIconDirective,
|
|
30
30
|
decorators: [{
|
|
@@ -124,7 +124,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
|
|
|
124
124
|
badgeClasses = computed(() => cn("nav-count pointer-events-none ml-auto inline-flex shrink-0 items-center justify-center self-center rounded-full bg-destructive text-destructive-foreground", this.badge()?.classes, this.class()), ...ngDevMode ? [{ debugName: "badgeClasses" }] : /* istanbul ignore next */ []);
|
|
125
125
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
126
126
|
minVersion: "12.0.0",
|
|
127
|
-
version: "22.2.
|
|
127
|
+
version: "22.2.6",
|
|
128
128
|
ngImport: i0,
|
|
129
129
|
type: NavigationBadgeCountComponent,
|
|
130
130
|
deps: [],
|
|
@@ -132,7 +132,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
|
|
|
132
132
|
});
|
|
133
133
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
134
134
|
minVersion: "17.0.0",
|
|
135
|
-
version: "22.2.
|
|
135
|
+
version: "22.2.6",
|
|
136
136
|
type: NavigationBadgeCountComponent,
|
|
137
137
|
isStandalone: true,
|
|
138
138
|
selector: "NavigationBadgeCount",
|
|
@@ -180,7 +180,7 @@ var NavigationBadgeCountComponent = class NavigationBadgeCountComponent {
|
|
|
180
180
|
};
|
|
181
181
|
i0.ɵɵngDeclareClassMetadata({
|
|
182
182
|
minVersion: "12.0.0",
|
|
183
|
-
version: "22.2.
|
|
183
|
+
version: "22.2.6",
|
|
184
184
|
ngImport: i0,
|
|
185
185
|
type: NavigationBadgeCountComponent,
|
|
186
186
|
decorators: [{
|