@tectra-ng/blocks 0.4.0 → 0.4.2
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/cookie-notice/README.md +3 -1
- package/fesm2022/tectra-ng-blocks-action-tile.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-app-layout.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-command-palette.mjs +2 -2
- package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-console-layout.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +53 -7
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-empty-state.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs +2 -2
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-network-status.mjs +114 -34
- package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-page-header.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +41 -6
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-public-header.mjs +4 -4
- package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-theme-configurator.mjs +414 -0
- package/fesm2022/tectra-ng-blocks-theme-configurator.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs +55 -25
- package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks.mjs +1 -1
- package/network-status/README.md +20 -4
- package/package.json +11 -6
- package/pinned-tabs/README.md +5 -1
- package/theme-configurator/README.md +59 -0
- package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -1
- package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-cookie-notice.d.ts +15 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -1
- package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -1
- package/types/tectra-ng-blocks-network-status.d.ts +29 -7
- package/types/tectra-ng-blocks-network-status.d.ts.map +1 -1
- package/types/tectra-ng-blocks-page-header.d.ts.map +1 -1
- package/types/tectra-ng-blocks-pinned-tabs.d.ts +15 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -1
- package/types/tectra-ng-blocks-theme-configurator.d.ts +98 -0
- package/types/tectra-ng-blocks-theme-configurator.d.ts.map +1 -0
- package/types/tectra-ng-blocks-wizard.d.ts +2 -0
- package/types/tectra-ng-blocks-wizard.d.ts.map +1 -1
- package/types/tectra-ng-blocks.d.ts +1 -1
- package/wizard/README.md +1 -1
|
@@ -1,10 +1,73 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, effect, inject, input, numberAttribute, output, signal } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Injectable, afterNextRender, afterRenderEffect, computed, effect, inject, input, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
4
|
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
5
5
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
6
|
import { TxIcon, provideTxIconDefaults, txIconCheck, txIconText, txIconWifi } from "@tectra-ng/icons";
|
|
7
7
|
import { networkStatusTokens, toStyleObject } from "@tectra-ng/themes";
|
|
8
|
+
const RESTORED_DURATION = 3e3;
|
|
9
|
+
var TxNetworkService = class TxNetworkService {
|
|
10
|
+
document = inject(DOCUMENT);
|
|
11
|
+
state = signal("online", ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
12
|
+
restoreTimer;
|
|
13
|
+
status = this.state.asReadonly();
|
|
14
|
+
restoredDuration = signal(RESTORED_DURATION, ...ngDevMode ? [{ debugName: "restoredDuration" }] : /* istanbul ignore next */ []);
|
|
15
|
+
constructor() {
|
|
16
|
+
const destroyRef = inject(DestroyRef);
|
|
17
|
+
destroyRef.onDestroy(() => clearTimeout(this.restoreTimer));
|
|
18
|
+
afterNextRender(() => {
|
|
19
|
+
const view = this.document.defaultView;
|
|
20
|
+
if (!view) return;
|
|
21
|
+
if (view.navigator?.onLine === false) this.markOffline();
|
|
22
|
+
const offline = () => this.markOffline();
|
|
23
|
+
const online = () => this.markOnline();
|
|
24
|
+
view.addEventListener("offline", offline);
|
|
25
|
+
view.addEventListener("online", online);
|
|
26
|
+
destroyRef.onDestroy(() => {
|
|
27
|
+
view.removeEventListener("offline", offline);
|
|
28
|
+
view.removeEventListener("online", online);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
markOffline() {
|
|
33
|
+
clearTimeout(this.restoreTimer);
|
|
34
|
+
this.state.set("offline");
|
|
35
|
+
}
|
|
36
|
+
markOnline() {
|
|
37
|
+
if (this.state() !== "offline") return;
|
|
38
|
+
this.state.set("restored");
|
|
39
|
+
clearTimeout(this.restoreTimer);
|
|
40
|
+
this.restoreTimer = setTimeout(() => {
|
|
41
|
+
if (this.state() === "restored") this.state.set("online");
|
|
42
|
+
}, this.restoredDuration());
|
|
43
|
+
}
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
45
|
+
minVersion: "12.0.0",
|
|
46
|
+
version: "22.2.5",
|
|
47
|
+
ngImport: i0,
|
|
48
|
+
type: TxNetworkService,
|
|
49
|
+
deps: [],
|
|
50
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
51
|
+
});
|
|
52
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
53
|
+
minVersion: "12.0.0",
|
|
54
|
+
version: "22.2.5",
|
|
55
|
+
ngImport: i0,
|
|
56
|
+
type: TxNetworkService,
|
|
57
|
+
providedIn: "root"
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
61
|
+
minVersion: "12.0.0",
|
|
62
|
+
version: "22.2.5",
|
|
63
|
+
ngImport: i0,
|
|
64
|
+
type: TxNetworkService,
|
|
65
|
+
decorators: [{
|
|
66
|
+
type: Injectable,
|
|
67
|
+
args: [{ providedIn: "root" }]
|
|
68
|
+
}],
|
|
69
|
+
ctorParameters: () => []
|
|
70
|
+
});
|
|
8
71
|
const NETWORK_STATUS_ICON_DEFAULTS = {
|
|
9
72
|
check: txIconCheck,
|
|
10
73
|
text: txIconText,
|
|
@@ -14,7 +77,9 @@ const NETWORK_STATUS_THEME = { networkStatus: networkStatusTokens };
|
|
|
14
77
|
var TxNetworkStatus = class TxNetworkStatus {
|
|
15
78
|
networkStatusTheme = injectTokens(NETWORK_STATUS_THEME);
|
|
16
79
|
document = inject(DOCUMENT);
|
|
17
|
-
|
|
80
|
+
network = inject(TxNetworkService);
|
|
81
|
+
region = viewChild.required("region", ...ngDevMode ? [{ debugName: "region" }] : /* istanbul ignore next */ []);
|
|
82
|
+
pill = viewChild("pill", ...ngDevMode ? [{ debugName: "pill" }] : /* istanbul ignore next */ []);
|
|
18
83
|
offlineText = input(void 0, ...ngDevMode ? [{ debugName: "offlineText" }] : /* istanbul ignore next */ []);
|
|
19
84
|
restoredText = input(void 0, ...ngDevMode ? [{ debugName: "restoredText" }] : /* istanbul ignore next */ []);
|
|
20
85
|
restoredDuration = input(3e3, {
|
|
@@ -37,23 +102,18 @@ var TxNetworkStatus = class TxNetworkStatus {
|
|
|
37
102
|
...toStyleObject(this.dt(), "--tx-network-status"),
|
|
38
103
|
...this.passThrough().root?.style
|
|
39
104
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
40
|
-
status =
|
|
105
|
+
status = this.network.status;
|
|
41
106
|
visible = computed(() => this.status() !== "online", ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
42
107
|
message = computed(() => this.status() === "restored" ? this.restoredText() ?? this.translations().connectionRestored : this.offlineText() ?? this.translations().offline, ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
|
|
43
108
|
constructor() {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
view.addEventListener("online", online);
|
|
53
|
-
destroyRef.onDestroy(() => {
|
|
54
|
-
view.removeEventListener("offline", offline);
|
|
55
|
-
view.removeEventListener("online", online);
|
|
56
|
-
});
|
|
109
|
+
effect(() => this.network.restoredDuration.set(this.restoredDuration()));
|
|
110
|
+
let last = this.status();
|
|
111
|
+
effect(() => {
|
|
112
|
+
const status = this.status();
|
|
113
|
+
if (status !== last) {
|
|
114
|
+
last = status;
|
|
115
|
+
untracked(() => this.statusChange.emit(status));
|
|
116
|
+
}
|
|
57
117
|
});
|
|
58
118
|
effect((onCleanup) => {
|
|
59
119
|
const name = this.bodyClass();
|
|
@@ -62,25 +122,21 @@ var TxNetworkStatus = class TxNetworkStatus {
|
|
|
62
122
|
body.classList.toggle(name, this.visible());
|
|
63
123
|
onCleanup(() => body.classList.remove(name));
|
|
64
124
|
});
|
|
65
|
-
|
|
125
|
+
afterRenderEffect((onCleanup) => {
|
|
126
|
+
const body = this.document.body;
|
|
127
|
+
const pill = this.visible() ? this.pill()?.nativeElement : void 0;
|
|
128
|
+
if (!body || !pill) return;
|
|
129
|
+
const view = this.document.defaultView;
|
|
130
|
+
const bottom = Number.parseFloat(view?.getComputedStyle(this.region().nativeElement).bottom ?? "") || 0;
|
|
131
|
+
body.style.setProperty(BOTTOM_OFFSET, `${Math.round(bottom + pill.offsetHeight)}px`);
|
|
132
|
+
onCleanup(() => body.style.removeProperty(BOTTOM_OFFSET));
|
|
133
|
+
});
|
|
66
134
|
}
|
|
67
135
|
onOffline() {
|
|
68
|
-
|
|
69
|
-
this.setStatus("offline");
|
|
136
|
+
this.network.markOffline();
|
|
70
137
|
}
|
|
71
138
|
onOnline() {
|
|
72
|
-
|
|
73
|
-
this.setStatus("restored");
|
|
74
|
-
clearTimeout(this.restoreTimer);
|
|
75
|
-
this.restoreTimer = setTimeout(() => {
|
|
76
|
-
if (this.status() === "restored") this.setStatus("online");
|
|
77
|
-
}, this.restoredDuration());
|
|
78
|
-
}
|
|
79
|
-
setStatus(status) {
|
|
80
|
-
if (this.status() !== status) {
|
|
81
|
-
this.status.set(status);
|
|
82
|
-
this.statusChange.emit(status);
|
|
83
|
-
}
|
|
139
|
+
this.network.markOnline();
|
|
84
140
|
}
|
|
85
141
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
86
142
|
minVersion: "12.0.0",
|
|
@@ -163,11 +219,25 @@ var TxNetworkStatus = class TxNetworkStatus {
|
|
|
163
219
|
},
|
|
164
220
|
classAttribute: "tx-network-status"
|
|
165
221
|
},
|
|
222
|
+
viewQueries: [{
|
|
223
|
+
propertyName: "region",
|
|
224
|
+
first: true,
|
|
225
|
+
predicate: ["region"],
|
|
226
|
+
descendants: true,
|
|
227
|
+
isSignal: true
|
|
228
|
+
}, {
|
|
229
|
+
propertyName: "pill",
|
|
230
|
+
first: true,
|
|
231
|
+
predicate: ["pill"],
|
|
232
|
+
descendants: true,
|
|
233
|
+
isSignal: true
|
|
234
|
+
}],
|
|
166
235
|
ngImport: i0,
|
|
167
236
|
template: `
|
|
168
|
-
<div class="tx-network-status__region" role="status" aria-live="polite">
|
|
237
|
+
<div #region class="tx-network-status__region" role="status" aria-live="polite">
|
|
169
238
|
@if (visible()) {
|
|
170
239
|
<div
|
|
240
|
+
#pill
|
|
171
241
|
class="tx-network-status__pill"
|
|
172
242
|
animate.enter="tx-network-status__pill--enter"
|
|
173
243
|
animate.leave="tx-network-status__pill--leave"
|
|
@@ -206,9 +276,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
206
276
|
selector: "tx-network-status",
|
|
207
277
|
imports: [TxIcon],
|
|
208
278
|
template: `
|
|
209
|
-
<div class="tx-network-status__region" role="status" aria-live="polite">
|
|
279
|
+
<div #region class="tx-network-status__region" role="status" aria-live="polite">
|
|
210
280
|
@if (visible()) {
|
|
211
281
|
<div
|
|
282
|
+
#pill
|
|
212
283
|
class="tx-network-status__pill"
|
|
213
284
|
animate.enter="tx-network-status__pill--enter"
|
|
214
285
|
animate.leave="tx-network-status__pill--leave"
|
|
@@ -237,6 +308,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
237
308
|
}],
|
|
238
309
|
ctorParameters: () => [],
|
|
239
310
|
propDecorators: {
|
|
311
|
+
region: [{
|
|
312
|
+
type: i0.ViewChild,
|
|
313
|
+
args: ["region", { isSignal: true }]
|
|
314
|
+
}],
|
|
315
|
+
pill: [{
|
|
316
|
+
type: i0.ViewChild,
|
|
317
|
+
args: ["pill", { isSignal: true }]
|
|
318
|
+
}],
|
|
240
319
|
offlineText: [{
|
|
241
320
|
type: i0.Input,
|
|
242
321
|
args: [{
|
|
@@ -307,6 +386,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
307
386
|
}]
|
|
308
387
|
}
|
|
309
388
|
});
|
|
310
|
-
|
|
389
|
+
const BOTTOM_OFFSET = "--tx-bottom-overlay-offset";
|
|
390
|
+
export { TxNetworkService, TxNetworkStatus };
|
|
311
391
|
|
|
312
392
|
//# sourceMappingURL=tectra-ng-blocks-network-status.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-network-status.mjs","names":[],"sources":["../../../../packages/blocks/network-status/src/network-status.icons.ts","../../../../packages/blocks/network-status/src/network-status.theme.ts","../../../../packages/blocks/network-status/src/network-status.component.ts"],"sourcesContent":["import { TxIconSet, txIconCheck, txIconText, txIconWifi } from '@tectra-ng/icons';\n\nexport const NETWORK_STATUS_ICON_DEFAULTS: TxIconSet = {\n check: txIconCheck,\n text: txIconText,\n wifi: txIconWifi,\n};\n","import { networkStatusTokens } from '@tectra-ng/themes';\n\nexport const NETWORK_STATUS_THEME = {\n networkStatus: networkStatusTokens,\n};\n","import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, effect, inject, input, numberAttribute, output, signal } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraNetworkStatusTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxNetworkState, TxNetworkStatusPart } from './network-status.types';\nimport { NETWORK_STATUS_ICON_DEFAULTS } from './network-status.icons';\nimport { NETWORK_STATUS_THEME } from './network-status.theme';\n\n@Component({\n selector: 'tx-network-status',\n imports: [TxIcon],\n template: `\n <div class=\"tx-network-status__region\" role=\"status\" aria-live=\"polite\">\n @if (visible()) {\n <div\n class=\"tx-network-status__pill\"\n animate.enter=\"tx-network-status__pill--enter\"\n animate.leave=\"tx-network-status__pill--leave\"\n [attr.data-status]=\"status()\"\n [class]=\"passThrough().pill?.class\"\n [style]=\"passThrough().pill?.style\"\n >\n <span class=\"tx-network-status__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"status() === 'restored' ? 'check' : 'wifi'\" />\n </span>\n <span class=\"tx-network-status__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ message() }}</span>\n </div>\n }\n </div>\n `,\n styleUrl: './network-status.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-network-status',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n viewProviders: [provideTxIconDefaults(NETWORK_STATUS_ICON_DEFAULTS)],\n})\nexport class TxNetworkStatus {\n private readonly networkStatusTheme = injectTokens(NETWORK_STATUS_THEME);\n\n private readonly document = inject(DOCUMENT);\n private restoreTimer: ReturnType<typeof setTimeout> | undefined;\n\n readonly offlineText = input<string | undefined>(undefined);\n readonly restoredText = input<string | undefined>(undefined);\n readonly restoredDuration = input<number, unknown>(3000, { transform: numberAttribute });\n readonly bodyClass = input<string>('tx-offline');\n readonly dt = input<TectraDeepPartial<TectraNetworkStatusTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxNetworkStatusPart, TxNetworkStatus> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly statusChange = output<TxNetworkState>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('networkStatus', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-network-status'), ...this.passThrough().root?.style }));\n\n readonly status = signal<TxNetworkState>('online');\n protected readonly visible = computed(() => this.status() !== 'online');\n protected readonly message = computed(() =>\n this.status() === 'restored' ? (this.restoredText() ?? this.translations().connectionRestored) : (this.offlineText() ?? this.translations().offline),\n );\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n if (view.navigator?.onLine === false) {\n this.setStatus('offline');\n }\n const offline = () => this.onOffline();\n const online = () => this.onOnline();\n view.addEventListener('offline', offline);\n view.addEventListener('online', online);\n destroyRef.onDestroy(() => {\n view.removeEventListener('offline', offline);\n view.removeEventListener('online', online);\n });\n });\n effect((onCleanup) => {\n const name = this.bodyClass();\n const body = this.document.body;\n if (!name || !body) {\n return;\n }\n body.classList.toggle(name, this.visible());\n onCleanup(() => body.classList.remove(name));\n });\n destroyRef.onDestroy(() => clearTimeout(this.restoreTimer));\n }\n\n onOffline(): void {\n clearTimeout(this.restoreTimer);\n this.setStatus('offline');\n }\n\n onOnline(): void {\n if (this.status() !== 'offline') {\n return;\n }\n this.setStatus('restored');\n clearTimeout(this.restoreTimer);\n this.restoreTimer = setTimeout(() => {\n if (this.status() === 'restored') {\n this.setStatus('online');\n }\n }, this.restoredDuration());\n }\n\n private setStatus(status: TxNetworkState): void {\n if (this.status() !== status) {\n this.status.set(status);\n this.statusChange.emit(status);\n }\n }\n}\n"],"mappings":";;;;;;;AAEA,MAAa,+BAA0C;CACrD,OAAO;CACP,MAAM;CACN,MAAM;AACP;ACJD,MAAa,uBAAuB,EAClC,eAAe,oBAChB;ACsCD,IAAa,kBAAb,MAAa,gBAAe;CACT,qBAAqB,aAAa,oBAAoB;CAEtD,WAAW,OAAO,QAAQ;CACnC;CAEC,cAAc,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAClD,eAAe,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACnD,mBAAmB,MAAuB,KAAI;EAAA,GAAA,YAAA,EAAA,WAAA,mBAAA,+BAAA,CAAA;EAAI,WAAW;CAAe,CAAA;CAC5E,YAAY,MAAc,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CACvC,KAAK,MAAgE,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;C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,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-network-status.mjs","names":[],"sources":["../../../../packages/blocks/network-status/src/network.service.ts","../../../../packages/blocks/network-status/src/network-status.icons.ts","../../../../packages/blocks/network-status/src/network-status.theme.ts","../../../../packages/blocks/network-status/src/network-status.component.ts"],"sourcesContent":["import { DOCUMENT, DestroyRef, Injectable, afterNextRender, inject, signal } from '@angular/core';\nimport { TxNetworkState } from './network-status.types';\n\nconst RESTORED_DURATION = 3000;\n\n/**\n * The connection state of the app as a signal, fed by the browser `offline` / `online` events and\n * `navigator.onLine`; `markOffline()` and `markOnline()` set it from code, e.g. after a failed request.\n * On the server it stays `online`.\n */\n@Injectable({ providedIn: 'root' })\nexport class TxNetworkService {\n private readonly document = inject(DOCUMENT);\n private readonly state = signal<TxNetworkState>('online');\n private restoreTimer: ReturnType<typeof setTimeout> | undefined;\n\n /** `online`, `offline`, or `restored` for a moment after the connection came back. */\n readonly status = this.state.asReadonly();\n /** How long `restored` lasts before the state turns `online`, in ms (default 3000). */\n readonly restoredDuration = signal(RESTORED_DURATION);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => clearTimeout(this.restoreTimer));\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n if (view.navigator?.onLine === false) {\n this.markOffline();\n }\n const offline = () => this.markOffline();\n const online = () => this.markOnline();\n view.addEventListener('offline', offline);\n view.addEventListener('online', online);\n destroyRef.onDestroy(() => {\n view.removeEventListener('offline', offline);\n view.removeEventListener('online', online);\n });\n });\n }\n\n /** Sets the state to `offline`. */\n markOffline(): void {\n clearTimeout(this.restoreTimer);\n this.state.set('offline');\n }\n\n /** Sets the state to `restored` when it was `offline`, and to `online` after `restoredDuration`. */\n markOnline(): void {\n if (this.state() !== 'offline') {\n return;\n }\n this.state.set('restored');\n clearTimeout(this.restoreTimer);\n this.restoreTimer = setTimeout(() => {\n if (this.state() === 'restored') {\n this.state.set('online');\n }\n }, this.restoredDuration());\n }\n}\n","import { TxIconSet, txIconCheck, txIconText, txIconWifi } from '@tectra-ng/icons';\n\nexport const NETWORK_STATUS_ICON_DEFAULTS: TxIconSet = {\n check: txIconCheck,\n text: txIconText,\n wifi: txIconWifi,\n};\n","import { networkStatusTokens } from '@tectra-ng/themes';\n\nexport const NETWORK_STATUS_THEME = {\n networkStatus: networkStatusTokens,\n};\n","import { ChangeDetectionStrategy, Component, DOCUMENT, ElementRef, afterRenderEffect, computed, effect, inject, input, numberAttribute, output, untracked, viewChild } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraNetworkStatusTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxNetworkState, TxNetworkStatusPart } from './network-status.types';\nimport { NETWORK_STATUS_ICON_DEFAULTS } from './network-status.icons';\nimport { TxNetworkService } from './network.service';\nimport { NETWORK_STATUS_THEME } from './network-status.theme';\n\n@Component({\n selector: 'tx-network-status',\n imports: [TxIcon],\n template: `\n <div #region class=\"tx-network-status__region\" role=\"status\" aria-live=\"polite\">\n @if (visible()) {\n <div\n #pill\n class=\"tx-network-status__pill\"\n animate.enter=\"tx-network-status__pill--enter\"\n animate.leave=\"tx-network-status__pill--leave\"\n [attr.data-status]=\"status()\"\n [class]=\"passThrough().pill?.class\"\n [style]=\"passThrough().pill?.style\"\n >\n <span class=\"tx-network-status__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"status() === 'restored' ? 'check' : 'wifi'\" />\n </span>\n <span class=\"tx-network-status__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ message() }}</span>\n </div>\n }\n </div>\n `,\n styleUrl: './network-status.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-network-status',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n viewProviders: [provideTxIconDefaults(NETWORK_STATUS_ICON_DEFAULTS)],\n})\nexport class TxNetworkStatus {\n private readonly networkStatusTheme = injectTokens(NETWORK_STATUS_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly network = inject(TxNetworkService);\n private readonly region = viewChild.required<ElementRef<HTMLElement>>('region');\n private readonly pill = viewChild<ElementRef<HTMLElement>>('pill');\n\n readonly offlineText = input<string | undefined>(undefined);\n readonly restoredText = input<string | undefined>(undefined);\n readonly restoredDuration = input<number, unknown>(3000, { transform: numberAttribute });\n readonly bodyClass = input<string>('tx-offline');\n readonly dt = input<TectraDeepPartial<TectraNetworkStatusTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxNetworkStatusPart, TxNetworkStatus> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly statusChange = output<TxNetworkState>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('networkStatus', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-network-status'), ...this.passThrough().root?.style }));\n\n readonly status = this.network.status;\n protected readonly visible = computed(() => this.status() !== 'online');\n protected readonly message = computed(() =>\n this.status() === 'restored' ? (this.restoredText() ?? this.translations().connectionRestored) : (this.offlineText() ?? this.translations().offline),\n );\n\n constructor() {\n effect(() => this.network.restoredDuration.set(this.restoredDuration()));\n let last = this.status();\n effect(() => {\n const status = this.status();\n if (status !== last) {\n last = status;\n untracked(() => this.statusChange.emit(status));\n }\n });\n effect((onCleanup) => {\n const name = this.bodyClass();\n const body = this.document.body;\n if (!name || !body) {\n return;\n }\n body.classList.toggle(name, this.visible());\n onCleanup(() => body.classList.remove(name));\n });\n afterRenderEffect((onCleanup) => {\n const body = this.document.body;\n const pill = this.visible() ? this.pill()?.nativeElement : undefined;\n if (!body || !pill) {\n return;\n }\n const view = this.document.defaultView;\n const bottom = Number.parseFloat(view?.getComputedStyle(this.region().nativeElement).bottom ?? '') || 0;\n body.style.setProperty(BOTTOM_OFFSET, `${Math.round(bottom + pill.offsetHeight)}px`);\n onCleanup(() => body.style.removeProperty(BOTTOM_OFFSET));\n });\n }\n\n onOffline(): void {\n this.network.markOffline();\n }\n\n onOnline(): void {\n this.network.markOnline();\n }\n}\n\nconst BOTTOM_OFFSET = '--tx-bottom-overlay-offset';\n"],"mappings":";;;;;;;AAGA,MAAM,oBAAoB;AAQ1B,IAAa,mBAAb,MAAa,iBAAgB;CACV,WAAW,OAAO,QAAQ;CAC1B,QAAQ,OAAuB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACjD;CAGC,SAAS,KAAK,MAAM,WAAU;CAE9B,mBAAmB,OAAO,mBAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,mBAAA,CAAA,+BAAA,CAAA,CAAA;CAErD,cAAA;EACE,MAAM,aAAa,OAAO,UAAU;EACpC,WAAW,gBAAgB,aAAa,KAAK,YAAY,CAAC;EAC1D,sBAAqB;GACnB,MAAM,OAAO,KAAK,SAAS;GAC3B,IAAI,CAAC,MACH;GAEF,IAAI,KAAK,WAAW,WAAW,OAC7B,KAAK,YAAW;GAElB,MAAM,gBAAgB,KAAK,YAAW;GACtC,MAAM,eAAe,KAAK,WAAU;GACpC,KAAK,iBAAiB,WAAW,OAAO;GACxC,KAAK,iBAAiB,UAAU,MAAM;GACtC,WAAW,gBAAe;IACxB,KAAK,oBAAoB,WAAW,OAAO;IAC3C,KAAK,oBAAoB,UAAU,MAAM;GAC3C,CAAC;EACH,CAAC;CACH;CAGA,cAAW;EACT,aAAa,KA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;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;CAAA;AAAA,CAAA;AAiEnE,MAAM,gBAAgB"}
|
|
@@ -97,7 +97,8 @@ var TxPageHeader = class TxPageHeader {
|
|
|
97
97
|
properties: {
|
|
98
98
|
"class": "passThrough().root?.class",
|
|
99
99
|
"style": "hostStyle()",
|
|
100
|
-
"attr.data-styled": "!isUnstyled() || null"
|
|
100
|
+
"attr.data-styled": "!isUnstyled() || null",
|
|
101
|
+
"attr.title": "null"
|
|
101
102
|
},
|
|
102
103
|
classAttribute: "tx-page-header"
|
|
103
104
|
},
|
|
@@ -133,7 +134,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
133
134
|
class: "tx-page-header",
|
|
134
135
|
"[class]": "passThrough().root?.class",
|
|
135
136
|
"[style]": "hostStyle()",
|
|
136
|
-
"[attr.data-styled]": "!isUnstyled() || null"
|
|
137
|
+
"[attr.data-styled]": "!isUnstyled() || null",
|
|
138
|
+
"[attr.title]": "null"
|
|
137
139
|
},
|
|
138
140
|
viewProviders: [provideTxIconDefaults(PAGE_HEADER_ICON_DEFAULTS)],
|
|
139
141
|
template: "<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n</div>\n<div class=\"tx-page-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content />\n</div>\n",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-page-header.mjs","names":[],"sources":["../../../../packages/blocks/page-header/src/page-header.icons.ts","../../../../packages/blocks/page-header/src/page-header.theme.ts","../../../../packages/blocks/page-header/src/page-header.component.ts","../../../../packages/blocks/page-header/src/page-header.component.html"],"sourcesContent":["import { TxIconSet, txIconHeading } from '@tectra-ng/icons';\n\nexport const PAGE_HEADER_ICON_DEFAULTS: TxIconSet = {\n heading: txIconHeading,\n};\n","import { buttonTokens, pageHeaderTokens } from '@tectra-ng/themes';\n\nexport const PAGE_HEADER_THEME = {\n button: buttonTokens,\n pageHeader: pageHeaderTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraPageHeaderTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPageHeaderLevel, TxPageHeaderPart } from './page-header.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { PAGE_HEADER_ICON_DEFAULTS } from './page-header.icons';\nimport { PAGE_HEADER_THEME } from './page-header.theme';\n\n@Component({\n selector: 'tx-page-header',\n imports: [NgTemplateOutlet],\n templateUrl: './page-header.component.html',\n styleUrl: './page-header.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-page-header',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n viewProviders: [provideTxIconDefaults(PAGE_HEADER_ICON_DEFAULTS)],\n})\nexport class TxPageHeader {\n private readonly pageHeaderTheme = injectTokens(PAGE_HEADER_THEME);\n\n readonly title = input.required<string>();\n readonly subtitle = input<string | undefined>(undefined);\n readonly headingLevel = input<TxPageHeaderLevel>(1);\n readonly dt = input<TectraDeepPartial<TectraPageHeaderTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPageHeaderPart, TxPageHeader> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pageHeader', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-page-header'), ...this.passThrough().root?.style }));\n}\n","<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n</div>\n<div class=\"tx-page-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content />\n</div>\n"],"mappings":";;;;;;;AAEA,MAAa,4BAAuC,EAClD,SAAS,cACV;ACFD,MAAa,oBAAoB;CAC/B,QAAQ;CACR,YAAY;AACb;
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-page-header.mjs","names":[],"sources":["../../../../packages/blocks/page-header/src/page-header.icons.ts","../../../../packages/blocks/page-header/src/page-header.theme.ts","../../../../packages/blocks/page-header/src/page-header.component.ts","../../../../packages/blocks/page-header/src/page-header.component.html"],"sourcesContent":["import { TxIconSet, txIconHeading } from '@tectra-ng/icons';\n\nexport const PAGE_HEADER_ICON_DEFAULTS: TxIconSet = {\n heading: txIconHeading,\n};\n","import { buttonTokens, pageHeaderTokens } from '@tectra-ng/themes';\n\nexport const PAGE_HEADER_THEME = {\n button: buttonTokens,\n pageHeader: pageHeaderTokens,\n};\n","import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraPageHeaderTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPageHeaderLevel, TxPageHeaderPart } from './page-header.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { PAGE_HEADER_ICON_DEFAULTS } from './page-header.icons';\nimport { PAGE_HEADER_THEME } from './page-header.theme';\n\n@Component({\n selector: 'tx-page-header',\n imports: [NgTemplateOutlet],\n templateUrl: './page-header.component.html',\n styleUrl: './page-header.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-page-header',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.title]': 'null',\n },\n viewProviders: [provideTxIconDefaults(PAGE_HEADER_ICON_DEFAULTS)],\n})\nexport class TxPageHeader {\n private readonly pageHeaderTheme = injectTokens(PAGE_HEADER_THEME);\n\n readonly title = input.required<string>();\n readonly subtitle = input<string | undefined>(undefined);\n readonly headingLevel = input<TxPageHeaderLevel>(1);\n readonly dt = input<TectraDeepPartial<TectraPageHeaderTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPageHeaderPart, TxPageHeader> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pageHeader', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-page-header'), ...this.passThrough().root?.style }));\n}\n","<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n</div>\n<div class=\"tx-page-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content />\n</div>\n"],"mappings":";;;;;;;AAEA,MAAa,4BAAuC,EAClD,SAAS,cACV;ACFD,MAAa,oBAAoB;CAC/B,QAAQ;CACR,YAAY;AACb;ACoBD,IAAa,eAAb,MAAa,aAAY;CACN,kBAAkB,aAAa,iBAAiB;CAExD,QAAQ,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Component, DOCUMENT, DestroyRef, computed, inject, input, linkedSignal, model, signal } from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, inject, input, linkedSignal, model, signal } from "@angular/core";
|
|
3
3
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
4
4
|
import { TxIcon, provideTxIconDefaults, txIconCheck, txIconSlidersH } from "@tectra-ng/icons";
|
|
5
5
|
import { TxButton } from "@tectra-ng/ui/button";
|
|
@@ -238,6 +238,7 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
238
238
|
destroyRef = inject(DestroyRef);
|
|
239
239
|
stateKey = input.required(...ngDevMode ? [{ debugName: "stateKey" }] : /* istanbul ignore next */ []);
|
|
240
240
|
options = input.required(...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
|
|
241
|
+
defaultPinned = input([], ...ngDevMode ? [{ debugName: "defaultPinned" }] : /* istanbul ignore next */ []);
|
|
241
242
|
allLabel = input(void 0, ...ngDevMode ? [{ debugName: "allLabel" }] : /* istanbul ignore next */ []);
|
|
242
243
|
selected = model([], ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
243
244
|
dialogTitle = input(void 0, ...ngDevMode ? [{ debugName: "dialogTitle" }] : /* istanbul ignore next */ []);
|
|
@@ -257,7 +258,12 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
257
258
|
...toStyleObject(this.dt(), "--tx-pinned-tabs"),
|
|
258
259
|
...this.passThrough().root?.style
|
|
259
260
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
260
|
-
|
|
261
|
+
storageReady = signal(false, ...ngDevMode ? [{ debugName: "storageReady" }] : /* istanbul ignore next */ []);
|
|
262
|
+
pinned = linkedSignal(() => {
|
|
263
|
+
const key = this.stateKey();
|
|
264
|
+
const fallback = this.defaultPinned();
|
|
265
|
+
return this.storageReady() ? this.readPinned(key) ?? fallback : fallback;
|
|
266
|
+
}, ...ngDevMode ? [{ debugName: "pinned" }] : /* istanbul ignore next */ []);
|
|
261
267
|
tabs = computed(() => {
|
|
262
268
|
const pinned = this.pinned();
|
|
263
269
|
const tabs = this.options().filter((option) => pinned.includes(option.value)).map(({ value, label }) => ({
|
|
@@ -274,6 +280,15 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
274
280
|
if (!selected.length) return ALL;
|
|
275
281
|
return selected.length === 1 ? selected[0] : void 0;
|
|
276
282
|
}, ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
|
|
283
|
+
constructor() {
|
|
284
|
+
afterNextRender(() => this.storageReady.set(true));
|
|
285
|
+
}
|
|
286
|
+
pin(value) {
|
|
287
|
+
if (!this.pinned().includes(value)) this.savePinned([...this.pinned(), value]);
|
|
288
|
+
}
|
|
289
|
+
unpin(value) {
|
|
290
|
+
if (this.pinned().includes(value)) this.savePinned(this.pinned().filter((item) => item !== value));
|
|
291
|
+
}
|
|
277
292
|
pick(value) {
|
|
278
293
|
this.selected.set(value === ALL ? [] : [String(value)]);
|
|
279
294
|
}
|
|
@@ -288,9 +303,7 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
288
303
|
data,
|
|
289
304
|
size: "medium"
|
|
290
305
|
}).closed.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((pinned) => {
|
|
291
|
-
if (
|
|
292
|
-
this.pinned.set(pinned);
|
|
293
|
-
this.writePinned(pinned);
|
|
306
|
+
if (pinned) this.savePinned(pinned);
|
|
294
307
|
});
|
|
295
308
|
}
|
|
296
309
|
storage() {
|
|
@@ -302,12 +315,18 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
302
315
|
}
|
|
303
316
|
readPinned(key) {
|
|
304
317
|
try {
|
|
305
|
-
const
|
|
318
|
+
const stored = this.storage()?.getItem(key);
|
|
319
|
+
if (stored === null || stored === void 0) return null;
|
|
320
|
+
const parsed = JSON.parse(stored);
|
|
306
321
|
return Array.isArray(parsed) ? parsed.map(String) : [];
|
|
307
322
|
} catch {
|
|
308
323
|
return [];
|
|
309
324
|
}
|
|
310
325
|
}
|
|
326
|
+
savePinned(pinned) {
|
|
327
|
+
this.pinned.set(pinned);
|
|
328
|
+
this.writePinned(pinned);
|
|
329
|
+
}
|
|
311
330
|
writePinned(pinned) {
|
|
312
331
|
try {
|
|
313
332
|
this.storage()?.setItem(this.stateKey(), JSON.stringify(pinned));
|
|
@@ -344,6 +363,13 @@ var TxPinnedTabs = class TxPinnedTabs {
|
|
|
344
363
|
isRequired: true,
|
|
345
364
|
transformFunction: null
|
|
346
365
|
},
|
|
366
|
+
defaultPinned: {
|
|
367
|
+
classPropertyName: "defaultPinned",
|
|
368
|
+
publicName: "defaultPinned",
|
|
369
|
+
isSignal: true,
|
|
370
|
+
isRequired: false,
|
|
371
|
+
transformFunction: null
|
|
372
|
+
},
|
|
347
373
|
allLabel: {
|
|
348
374
|
classPropertyName: "allLabel",
|
|
349
375
|
publicName: "allLabel",
|
|
@@ -607,6 +633,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
607
633
|
styles: [":host{display:flex;align-items:center;min-width:0}.tx-pinned-tabs__tabs{min-width:0;max-width:100%}.tx-pinned-tabs__button{flex-shrink:0}:host([data-styled]){gap:var(--tx-pinned-tabs-gap)}\n"]
|
|
608
634
|
}]
|
|
609
635
|
}],
|
|
636
|
+
ctorParameters: () => [],
|
|
610
637
|
propDecorators: {
|
|
611
638
|
stateKey: [{
|
|
612
639
|
type: i0.Input,
|
|
@@ -624,6 +651,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
624
651
|
required: true
|
|
625
652
|
}]
|
|
626
653
|
}],
|
|
654
|
+
defaultPinned: [{
|
|
655
|
+
type: i0.Input,
|
|
656
|
+
args: [{
|
|
657
|
+
isSignal: true,
|
|
658
|
+
alias: "defaultPinned",
|
|
659
|
+
required: false
|
|
660
|
+
}]
|
|
661
|
+
}],
|
|
627
662
|
allLabel: [{
|
|
628
663
|
type: i0.Input,
|
|
629
664
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-pinned-tabs.mjs","names":[],"sources":["../../../../packages/blocks/pinned-tabs/src/pinned-tabs.icons.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs.theme.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs-dialog.component.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs.component.ts"],"sourcesContent":["import { TxIconSet, txIconCheck, txIconSlidersH } from '@tectra-ng/icons';\n\nexport const PINNED_TABS_ICON_DEFAULTS: TxIconSet = {\n check: txIconCheck,\n 'sliders-h': txIconSlidersH,\n};\n","import { iconTokens, pinnedTabsTokens } from '@tectra-ng/themes';\n\nexport const PINNED_TABS_THEME = {\n icon: iconTokens,\n pinnedTabs: pinnedTabsTokens,\n};\n","import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxDialogContent, TxDialogFooter, TxDialogHeader, injectDialogData, injectDialogRef } from '@tectra-ng/ui/dialog';\nimport { TxMessage } from '@tectra-ng/ui/message';\nimport { TxPinnedTabsDialogData } from './pinned-tabs.types';\nimport { PINNED_TABS_ICON_DEFAULTS } from './pinned-tabs.icons';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { PINNED_TABS_THEME } from './pinned-tabs.theme';\n\n/** The dialog where the user picks the values to pin as tabs; opened by `tx-pinned-tabs`. */\n@Component({\n selector: 'tx-pinned-tabs-dialog',\n imports: [TxDialogHeader, TxDialogContent, TxDialogFooter, TxButton, TxIcon, TxMessage],\n template: `\n <tx-dialog-header [title]=\"data.title || translations().pinnedTabs\" />\n <tx-dialog-content>\n <div class=\"tx-pinned-tabs-dialog\">\n <tx-message severity=\"secondary\" variant=\"simple\" [text]=\"data.text || translations().pinnedTabsHint\" />\n <div class=\"tx-pinned-tabs-dialog__section\">\n <span class=\"tx-pinned-tabs-dialog__counter\" aria-live=\"polite\">{{ counter() }}</span>\n <div class=\"tx-pinned-tabs-dialog__options\" role=\"group\" [attr.aria-label]=\"data.title || translations().pinnedTabs\">\n @for (option of data.options; track option.value) {\n <button\n type=\"button\"\n role=\"checkbox\"\n class=\"tx-pinned-tabs-dialog__option\"\n [class.tx-pinned-tabs-dialog__option--selected]=\"draft().includes(option.value)\"\n [attr.aria-checked]=\"draft().includes(option.value)\"\n [title]=\"option.label\"\n (click)=\"toggle(option.value)\"\n >\n <span class=\"tx-pinned-tabs-dialog__label\">{{ option.label }}</span>\n <span class=\"tx-pinned-tabs-dialog__check\" aria-hidden=\"true\"><tx-icon name=\"check\" /></span>\n </button>\n }\n </div>\n </div>\n </div>\n </tx-dialog-content>\n <tx-dialog-footer>\n <div class=\"tx-pinned-tabs-dialog__actions\">\n <button txButton type=\"button\" severity=\"secondary\" fluid (click)=\"ref.close()\">{{ translations().cancel }}</button>\n <button txButton type=\"button\" icon=\"check\" fluid (click)=\"save()\">{{ translations().save }}</button>\n </div>\n </tx-dialog-footer>\n `,\n styleUrl: './pinned-tabs-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [provideTxIconDefaults(PINNED_TABS_ICON_DEFAULTS)],\n})\nexport class TxPinnedTabsDialog {\n private readonly pinnedTabsTheme = injectTokens(PINNED_TABS_THEME);\n\n private readonly locale = inject(TxLocaleService);\n protected readonly data = injectDialogData<TxPinnedTabsDialogData>();\n protected readonly ref = injectDialogRef<string[]>();\n protected readonly translations = injectTranslations();\n protected readonly draft = signal<readonly string[]>(this.data.pinned);\n protected readonly chosen = computed(() => {\n const draft = this.draft();\n return this.data.options.map((option) => option.value).filter((value) => draft.includes(value));\n });\n protected readonly counter = computed(() =>\n this.locale.translate('pinnedSelected', { count: this.chosen().length, total: this.data.options.length }),\n );\n\n protected toggle(value: string): void {\n this.draft.update((draft) => (draft.includes(value) ? draft.filter((item) => item !== value) : [...draft, value]));\n }\n\n protected save(): void {\n this.ref.close(this.chosen());\n }\n}\n","import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, computed, inject, input, linkedSignal, model } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraPinnedTabsTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxDialogService } from '@tectra-ng/ui/dialog';\nimport { TxTabItem, TxTabValue, TxTabs } from '@tectra-ng/ui/tabs';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxPinnedTabsDialog } from './pinned-tabs-dialog.component';\nimport { TxPinnedTabOption, TxPinnedTabsDialogData, TxPinnedTabsPart } from './pinned-tabs.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { PINNED_TABS_ICON_DEFAULTS } from './pinned-tabs.icons';\nimport { PINNED_TABS_THEME } from './pinned-tabs.theme';\n\nconst ALL = '__all__';\n\n@Component({\n selector: 'tx-pinned-tabs',\n imports: [TxButton, TxTabs, TxTooltip],\n template: `\n @if (tabs().length) {\n <tx-tabs\n class=\"tx-pinned-tabs__tabs\"\n variant=\"pills\"\n [ariaLabel]=\"ariaLabel()\"\n [tabs]=\"tabs()\"\n [value]=\"activeTab()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().tabs?.class\"\n [style]=\"passThrough().tabs?.style\"\n (tabChange)=\"pick($event)\"\n />\n }\n <button\n txButton\n type=\"button\"\n class=\"tx-pinned-tabs__button\"\n severity=\"secondary\"\n outlined\n size=\"small\"\n icon=\"sliders-h\"\n [iconOnly]=\"!!tabs().length\"\n [attr.aria-label]=\"tabs().length ? translations().customize : null\"\n [txTooltip]=\"tabs().length ? translations().customize : undefined\"\n [disabled]=\"!options().length\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().button?.class\"\n [style]=\"passThrough().button?.style\"\n (click)=\"openSettings()\"\n >\n @if (!tabs().length) {\n {{ translations().customize }}\n }\n </button>\n `,\n styleUrl: './pinned-tabs.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-pinned-tabs',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-pinned-tabs--empty]': '!tabs().length',\n },\n viewProviders: [provideTxIconDefaults(PINNED_TABS_ICON_DEFAULTS)],\n})\nexport class TxPinnedTabs {\n private readonly pinnedTabsTheme = injectTokens(PINNED_TABS_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly dialogs = inject(TxDialogService);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly stateKey = input.required<string>();\n readonly options = input.required<readonly TxPinnedTabOption[]>();\n readonly allLabel = input<string | undefined>(undefined);\n readonly selected = model<readonly string[]>([]);\n readonly dialogTitle = input<string | undefined>(undefined);\n readonly dialogText = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPinnedTabsTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPinnedTabsPart, TxPinnedTabs> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pinnedTabs', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-pinned-tabs'), ...this.passThrough().root?.style }));\n\n readonly pinned = linkedSignal<readonly string[]>(() => this.readPinned(this.stateKey()));\n\n readonly tabs = computed<TxTabItem[]>(() => {\n const pinned = this.pinned();\n const tabs = this.options()\n .filter((option) => pinned.includes(option.value))\n .map(({ value, label }) => ({ value, label }));\n return tabs.length ? [{ value: ALL, label: this.allLabel() ?? this.translations().all }, ...tabs] : [];\n });\n\n protected readonly activeTab = computed<TxTabValue | undefined>(() => {\n const selected = this.selected();\n if (!selected.length) {\n return ALL;\n }\n return selected.length === 1 ? selected[0] : undefined;\n });\n\n protected pick(value: TxTabValue): void {\n this.selected.set(value === ALL ? [] : [String(value)]);\n }\n\n openSettings(): void {\n const data: TxPinnedTabsDialogData = {\n options: this.options(),\n pinned: this.pinned(),\n title: this.dialogTitle(),\n text: this.dialogText(),\n };\n this.dialogs\n .open<TxPinnedTabsDialog, TxPinnedTabsDialogData, string[]>(TxPinnedTabsDialog, { data, size: 'medium' })\n .closed.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((pinned) => {\n if (!pinned) {\n return;\n }\n this.pinned.set(pinned);\n this.writePinned(pinned);\n });\n }\n\n private storage(): Storage | null {\n try {\n return this.document.defaultView?.localStorage ?? null;\n } catch {\n return null;\n }\n }\n\n private readPinned(key: string): string[] {\n try {\n const parsed: unknown = JSON.parse(this.storage()?.getItem(key) ?? '[]');\n return Array.isArray(parsed) ? parsed.map(String) : [];\n } catch {\n return [];\n }\n }\n\n private writePinned(pinned: readonly string[]): void {\n try {\n this.storage()?.setItem(this.stateKey(), JSON.stringify(pinned));\n } catch {\n return;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,4BAAuC;CAClD,OAAO;CACP,aAAa;AACd;ACHD,MAAa,oBAAoB;CAC/B,MAAM;CACN,YAAY;AACb;AC+CD,IAAa,qBAAb,MAAa,mBAAkB;CACZ,kBAAkB,aAAa,iBAAiB;CAEhD,SAAS,OAAO,eAAe;CAC7B,OAAO,iBAAgB;CACvB,MAAM,gBAAe;CACrB,eAAe,mBAAkB;CACjC,QAAQ,OAA0B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AAA;EAlDxB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,SACjB;IAAC;IAAU;IAAQ;GAAS;GAAC,UAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;IACtB,iCAAiC;GAClC;GAAA,eACc,CAAC,sBAAsB,yBAAyB,CAAC;GAAC,QAAA,CAAA,gMAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-pinned-tabs.mjs","names":[],"sources":["../../../../packages/blocks/pinned-tabs/src/pinned-tabs.icons.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs.theme.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs-dialog.component.ts","../../../../packages/blocks/pinned-tabs/src/pinned-tabs.component.ts"],"sourcesContent":["import { TxIconSet, txIconCheck, txIconSlidersH } from '@tectra-ng/icons';\n\nexport const PINNED_TABS_ICON_DEFAULTS: TxIconSet = {\n check: txIconCheck,\n 'sliders-h': txIconSlidersH,\n};\n","import { iconTokens, pinnedTabsTokens } from '@tectra-ng/themes';\n\nexport const PINNED_TABS_THEME = {\n icon: iconTokens,\n pinnedTabs: pinnedTabsTokens,\n};\n","import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxDialogContent, TxDialogFooter, TxDialogHeader, injectDialogData, injectDialogRef } from '@tectra-ng/ui/dialog';\nimport { TxMessage } from '@tectra-ng/ui/message';\nimport { TxPinnedTabsDialogData } from './pinned-tabs.types';\nimport { PINNED_TABS_ICON_DEFAULTS } from './pinned-tabs.icons';\nimport { injectTokens } from '@tectra-ng/core/config';\nimport { PINNED_TABS_THEME } from './pinned-tabs.theme';\n\n/** The dialog where the user picks the values to pin as tabs; opened by `tx-pinned-tabs`. */\n@Component({\n selector: 'tx-pinned-tabs-dialog',\n imports: [TxDialogHeader, TxDialogContent, TxDialogFooter, TxButton, TxIcon, TxMessage],\n template: `\n <tx-dialog-header [title]=\"data.title || translations().pinnedTabs\" />\n <tx-dialog-content>\n <div class=\"tx-pinned-tabs-dialog\">\n <tx-message severity=\"secondary\" variant=\"simple\" [text]=\"data.text || translations().pinnedTabsHint\" />\n <div class=\"tx-pinned-tabs-dialog__section\">\n <span class=\"tx-pinned-tabs-dialog__counter\" aria-live=\"polite\">{{ counter() }}</span>\n <div class=\"tx-pinned-tabs-dialog__options\" role=\"group\" [attr.aria-label]=\"data.title || translations().pinnedTabs\">\n @for (option of data.options; track option.value) {\n <button\n type=\"button\"\n role=\"checkbox\"\n class=\"tx-pinned-tabs-dialog__option\"\n [class.tx-pinned-tabs-dialog__option--selected]=\"draft().includes(option.value)\"\n [attr.aria-checked]=\"draft().includes(option.value)\"\n [title]=\"option.label\"\n (click)=\"toggle(option.value)\"\n >\n <span class=\"tx-pinned-tabs-dialog__label\">{{ option.label }}</span>\n <span class=\"tx-pinned-tabs-dialog__check\" aria-hidden=\"true\"><tx-icon name=\"check\" /></span>\n </button>\n }\n </div>\n </div>\n </div>\n </tx-dialog-content>\n <tx-dialog-footer>\n <div class=\"tx-pinned-tabs-dialog__actions\">\n <button txButton type=\"button\" severity=\"secondary\" fluid (click)=\"ref.close()\">{{ translations().cancel }}</button>\n <button txButton type=\"button\" icon=\"check\" fluid (click)=\"save()\">{{ translations().save }}</button>\n </div>\n </tx-dialog-footer>\n `,\n styleUrl: './pinned-tabs-dialog.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n viewProviders: [provideTxIconDefaults(PINNED_TABS_ICON_DEFAULTS)],\n})\nexport class TxPinnedTabsDialog {\n private readonly pinnedTabsTheme = injectTokens(PINNED_TABS_THEME);\n\n private readonly locale = inject(TxLocaleService);\n protected readonly data = injectDialogData<TxPinnedTabsDialogData>();\n protected readonly ref = injectDialogRef<string[]>();\n protected readonly translations = injectTranslations();\n protected readonly draft = signal<readonly string[]>(this.data.pinned);\n protected readonly chosen = computed(() => {\n const draft = this.draft();\n return this.data.options.map((option) => option.value).filter((value) => draft.includes(value));\n });\n protected readonly counter = computed(() =>\n this.locale.translate('pinnedSelected', { count: this.chosen().length, total: this.data.options.length }),\n );\n\n protected toggle(value: string): void {\n this.draft.update((draft) => (draft.includes(value) ? draft.filter((item) => item !== value) : [...draft, value]));\n }\n\n protected save(): void {\n this.ref.close(this.chosen());\n }\n}\n","import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, inject, input, linkedSignal, model, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraPinnedTabsTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxDialogService } from '@tectra-ng/ui/dialog';\nimport { TxTabItem, TxTabValue, TxTabs } from '@tectra-ng/ui/tabs';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxPinnedTabsDialog } from './pinned-tabs-dialog.component';\nimport { TxPinnedTabOption, TxPinnedTabsDialogData, TxPinnedTabsPart } from './pinned-tabs.types';\nimport { provideTxIconDefaults } from '@tectra-ng/icons';\nimport { PINNED_TABS_ICON_DEFAULTS } from './pinned-tabs.icons';\nimport { PINNED_TABS_THEME } from './pinned-tabs.theme';\n\nconst ALL = '__all__';\n\n@Component({\n selector: 'tx-pinned-tabs',\n imports: [TxButton, TxTabs, TxTooltip],\n template: `\n @if (tabs().length) {\n <tx-tabs\n class=\"tx-pinned-tabs__tabs\"\n variant=\"pills\"\n [ariaLabel]=\"ariaLabel()\"\n [tabs]=\"tabs()\"\n [value]=\"activeTab()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().tabs?.class\"\n [style]=\"passThrough().tabs?.style\"\n (tabChange)=\"pick($event)\"\n />\n }\n <button\n txButton\n type=\"button\"\n class=\"tx-pinned-tabs__button\"\n severity=\"secondary\"\n outlined\n size=\"small\"\n icon=\"sliders-h\"\n [iconOnly]=\"!!tabs().length\"\n [attr.aria-label]=\"tabs().length ? translations().customize : null\"\n [txTooltip]=\"tabs().length ? translations().customize : undefined\"\n [disabled]=\"!options().length\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().button?.class\"\n [style]=\"passThrough().button?.style\"\n (click)=\"openSettings()\"\n >\n @if (!tabs().length) {\n {{ translations().customize }}\n }\n </button>\n `,\n styleUrl: './pinned-tabs.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-pinned-tabs',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-pinned-tabs--empty]': '!tabs().length',\n },\n viewProviders: [provideTxIconDefaults(PINNED_TABS_ICON_DEFAULTS)],\n})\nexport class TxPinnedTabs {\n private readonly pinnedTabsTheme = injectTokens(PINNED_TABS_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly dialogs = inject(TxDialogService);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly stateKey = input.required<string>();\n readonly options = input.required<readonly TxPinnedTabOption[]>();\n readonly defaultPinned = input<readonly string[]>([]);\n readonly allLabel = input<string | undefined>(undefined);\n readonly selected = model<readonly string[]>([]);\n readonly dialogTitle = input<string | undefined>(undefined);\n readonly dialogText = input<string | undefined>(undefined);\n readonly ariaLabel = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraPinnedTabsTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPinnedTabsPart, TxPinnedTabs> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pinnedTabs', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-pinned-tabs'), ...this.passThrough().root?.style }));\n\n private readonly storageReady = signal(false);\n\n readonly pinned = linkedSignal<readonly string[]>(() => {\n const key = this.stateKey();\n const fallback = this.defaultPinned();\n return this.storageReady() ? (this.readPinned(key) ?? fallback) : fallback;\n });\n\n readonly tabs = computed<TxTabItem[]>(() => {\n const pinned = this.pinned();\n const tabs = this.options()\n .filter((option) => pinned.includes(option.value))\n .map(({ value, label }) => ({ value, label }));\n return tabs.length ? [{ value: ALL, label: this.allLabel() ?? this.translations().all }, ...tabs] : [];\n });\n\n protected readonly activeTab = computed<TxTabValue | undefined>(() => {\n const selected = this.selected();\n if (!selected.length) {\n return ALL;\n }\n return selected.length === 1 ? selected[0] : undefined;\n });\n\n constructor() {\n afterNextRender(() => this.storageReady.set(true));\n }\n\n pin(value: string): void {\n if (!this.pinned().includes(value)) {\n this.savePinned([...this.pinned(), value]);\n }\n }\n\n unpin(value: string): void {\n if (this.pinned().includes(value)) {\n this.savePinned(this.pinned().filter((item) => item !== value));\n }\n }\n\n protected pick(value: TxTabValue): void {\n this.selected.set(value === ALL ? [] : [String(value)]);\n }\n\n openSettings(): void {\n const data: TxPinnedTabsDialogData = {\n options: this.options(),\n pinned: this.pinned(),\n title: this.dialogTitle(),\n text: this.dialogText(),\n };\n this.dialogs\n .open<TxPinnedTabsDialog, TxPinnedTabsDialogData, string[]>(TxPinnedTabsDialog, { data, size: 'medium' })\n .closed.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe((pinned) => {\n if (pinned) {\n this.savePinned(pinned);\n }\n });\n }\n\n private storage(): Storage | null {\n try {\n return this.document.defaultView?.localStorage ?? null;\n } catch {\n return null;\n }\n }\n\n private readPinned(key: string): string[] | null {\n try {\n const stored = this.storage()?.getItem(key);\n if (stored === null || stored === undefined) {\n return null;\n }\n const parsed: unknown = JSON.parse(stored);\n return Array.isArray(parsed) ? parsed.map(String) : [];\n } catch {\n return [];\n }\n }\n\n private savePinned(pinned: readonly string[]): void {\n this.pinned.set(pinned);\n this.writePinned(pinned);\n }\n\n private writePinned(pinned: readonly string[]): void {\n try {\n this.storage()?.setItem(this.stateKey(), JSON.stringify(pinned));\n } catch {\n return;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAEA,MAAa,4BAAuC;CAClD,OAAO;CACP,aAAa;AACd;ACHD,MAAa,oBAAoB;CAC/B,MAAM;CACN,YAAY;AACb;AC+CD,IAAa,qBAAb,MAAa,mBAAkB;CACZ,kBAAkB,aAAa,iBAAiB;CAEhD,SAAS,OAAO,eAAe;CAC7B,OAAO,iBAAgB;CACvB,MAAM,gBAAe;CACrB,eAAe,mBAAkB;CACjC,QAAQ,OAA0B,KAAK,KAAK,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACnD,SAAS,eAAc;EACxC,MAAM,QAAQ,KAAK,MAAK;EACxB,OAAO,KAAK,KAAK,QAAQ,KAAK,WAAW,OAAO,KAAK,CAAC,CAAC,QAAQ,UAAU,MAAM,SAAS,KAAK,CAAC;CAChG,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CACiB,UAAU,eAC3B,KAAK,OAAO,UAAU,kBAAkB;EAAE,OAAO,KAAK,OAAM,CAAE,CAAC;EAAQ,OAAO,KAAK,KAAK,QAAQ;CAAM,CAAE,GACzG,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAES,OAAO,OAAa;EAC5B,KAAK,MAAM,QAAQ,UAAW,MAAM,SAAS,KAAK,IAAI,MAAM,QAAQ,SAA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