@star-ng/ui 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +162 -2
- package/fesm2022/star-ng-ui-accordion.mjs +376 -0
- package/fesm2022/star-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/star-ng-ui-autocomplete.mjs +786 -0
- package/fesm2022/star-ng-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/star-ng-ui-avatar.mjs +154 -0
- package/fesm2022/star-ng-ui-avatar.mjs.map +1 -0
- package/fesm2022/star-ng-ui-badge.mjs +153 -0
- package/fesm2022/star-ng-ui-badge.mjs.map +1 -0
- package/fesm2022/star-ng-ui-breadcrumb.mjs +199 -0
- package/fesm2022/star-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/star-ng-ui-button.mjs +282 -0
- package/fesm2022/star-ng-ui-button.mjs.map +1 -0
- package/fesm2022/star-ng-ui-card.mjs +112 -0
- package/fesm2022/star-ng-ui-card.mjs.map +1 -0
- package/fesm2022/star-ng-ui-chart.mjs +1904 -0
- package/fesm2022/star-ng-ui-chart.mjs.map +1 -0
- package/fesm2022/star-ng-ui-checkbox.mjs +345 -0
- package/fesm2022/star-ng-ui-checkbox.mjs.map +1 -0
- package/fesm2022/star-ng-ui-core.mjs +484 -0
- package/fesm2022/star-ng-ui-core.mjs.map +1 -0
- package/fesm2022/star-ng-ui-data-display.mjs +1870 -0
- package/fesm2022/star-ng-ui-data-display.mjs.map +1 -0
- package/fesm2022/star-ng-ui-date-picker.mjs +2786 -0
- package/fesm2022/star-ng-ui-date-picker.mjs.map +1 -0
- package/fesm2022/star-ng-ui-dialog.mjs +948 -0
- package/fesm2022/star-ng-ui-dialog.mjs.map +1 -0
- package/fesm2022/star-ng-ui-drawer.mjs +158 -0
- package/fesm2022/star-ng-ui-drawer.mjs.map +1 -0
- package/fesm2022/star-ng-ui-editor.mjs +416 -0
- package/fesm2022/star-ng-ui-editor.mjs.map +1 -0
- package/fesm2022/star-ng-ui-field.mjs +378 -0
- package/fesm2022/star-ng-ui-field.mjs.map +1 -0
- package/fesm2022/star-ng-ui-file-upload.mjs +762 -0
- package/fesm2022/star-ng-ui-file-upload.mjs.map +1 -0
- package/fesm2022/star-ng-ui-i18n-de.mjs +179 -0
- package/fesm2022/star-ng-ui-i18n-de.mjs.map +1 -0
- package/fesm2022/star-ng-ui-i18n-es.mjs +179 -0
- package/fesm2022/star-ng-ui-i18n-es.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-group.mjs +188 -0
- package/fesm2022/star-ng-ui-input-group.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-mask.mjs +434 -0
- package/fesm2022/star-ng-ui-input-mask.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-number.mjs +691 -0
- package/fesm2022/star-ng-ui-input-number.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-otp.mjs +343 -0
- package/fesm2022/star-ng-ui-input-otp.mjs.map +1 -0
- package/fesm2022/star-ng-ui-input-tags.mjs +616 -0
- package/fesm2022/star-ng-ui-input-tags.mjs.map +1 -0
- package/fesm2022/star-ng-ui-knob.mjs +514 -0
- package/fesm2022/star-ng-ui-knob.mjs.map +1 -0
- package/fesm2022/star-ng-ui-layout.mjs +608 -0
- package/fesm2022/star-ng-ui-layout.mjs.map +1 -0
- package/fesm2022/star-ng-ui-listbox.mjs +886 -0
- package/fesm2022/star-ng-ui-listbox.mjs.map +1 -0
- package/fesm2022/star-ng-ui-media.mjs +833 -0
- package/fesm2022/star-ng-ui-media.mjs.map +1 -0
- package/fesm2022/star-ng-ui-menu.mjs +1840 -0
- package/fesm2022/star-ng-ui-menu.mjs.map +1 -0
- package/fesm2022/star-ng-ui-message.mjs +191 -0
- package/fesm2022/star-ng-ui-message.mjs.map +1 -0
- package/fesm2022/star-ng-ui-paginator.mjs +387 -0
- package/fesm2022/star-ng-ui-paginator.mjs.map +1 -0
- package/fesm2022/star-ng-ui-panel.mjs +324 -0
- package/fesm2022/star-ng-ui-panel.mjs.map +1 -0
- package/fesm2022/star-ng-ui-password.mjs +517 -0
- package/fesm2022/star-ng-ui-password.mjs.map +1 -0
- package/fesm2022/star-ng-ui-popover.mjs +241 -0
- package/fesm2022/star-ng-ui-popover.mjs.map +1 -0
- package/fesm2022/star-ng-ui-progress-bar.mjs +183 -0
- package/fesm2022/star-ng-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/star-ng-ui-radio.mjs +411 -0
- package/fesm2022/star-ng-ui-radio.mjs.map +1 -0
- package/fesm2022/star-ng-ui-rating.mjs +211 -0
- package/fesm2022/star-ng-ui-rating.mjs.map +1 -0
- package/fesm2022/star-ng-ui-select-button.mjs +613 -0
- package/fesm2022/star-ng-ui-select-button.mjs.map +1 -0
- package/fesm2022/star-ng-ui-select.mjs +2547 -0
- package/fesm2022/star-ng-ui-select.mjs.map +1 -0
- package/fesm2022/star-ng-ui-skeleton.mjs +160 -0
- package/fesm2022/star-ng-ui-skeleton.mjs.map +1 -0
- package/fesm2022/star-ng-ui-slider.mjs +552 -0
- package/fesm2022/star-ng-ui-slider.mjs.map +1 -0
- package/fesm2022/star-ng-ui-spinner.mjs +148 -0
- package/fesm2022/star-ng-ui-spinner.mjs.map +1 -0
- package/fesm2022/star-ng-ui-stepper.mjs +360 -0
- package/fesm2022/star-ng-ui-stepper.mjs.map +1 -0
- package/fesm2022/star-ng-ui-table.mjs +3531 -0
- package/fesm2022/star-ng-ui-table.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tabs.mjs +464 -0
- package/fesm2022/star-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tag.mjs +129 -0
- package/fesm2022/star-ng-ui-tag.mjs.map +1 -0
- package/fesm2022/star-ng-ui-theme-switch.mjs +105 -0
- package/fesm2022/star-ng-ui-theme-switch.mjs.map +1 -0
- package/fesm2022/star-ng-ui-theme.mjs +98 -0
- package/fesm2022/star-ng-ui-theme.mjs.map +1 -0
- package/fesm2022/star-ng-ui-toast.mjs +298 -0
- package/fesm2022/star-ng-ui-toast.mjs.map +1 -0
- package/fesm2022/star-ng-ui-toggle-switch.mjs +316 -0
- package/fesm2022/star-ng-ui-toggle-switch.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tooltip.mjs +297 -0
- package/fesm2022/star-ng-ui-tooltip.mjs.map +1 -0
- package/fesm2022/star-ng-ui-transloco.mjs +40 -0
- package/fesm2022/star-ng-ui-transloco.mjs.map +1 -0
- package/fesm2022/star-ng-ui-tree.mjs +1446 -0
- package/fesm2022/star-ng-ui-tree.mjs.map +1 -0
- package/fesm2022/star-ng-ui-utility.mjs +2134 -0
- package/fesm2022/star-ng-ui-utility.mjs.map +1 -0
- package/fesm2022/star-ng-ui.mjs +51 -0
- package/package.json +285 -3
- package/styles/_base.scss +70 -0
- package/styles/_shared.scss +2 -0
- package/styles/_tokens.scss +190 -0
- package/styles/controls/_accordion.scss +75 -0
- package/styles/controls/_autocomplete.scss +44 -0
- package/styles/controls/_avatar.scss +39 -0
- package/styles/controls/_breadcrumb.scss +45 -0
- package/styles/controls/_button.scss +137 -0
- package/styles/controls/_card.scss +38 -0
- package/styles/controls/_chart.scss +214 -0
- package/styles/controls/_chip.scss +51 -0
- package/styles/controls/_choice.scss +153 -0
- package/styles/controls/_data-display.scss +124 -0
- package/styles/controls/_date-picker.scss +300 -0
- package/styles/controls/_dialog.scss +123 -0
- package/styles/controls/_drawer.scss +118 -0
- package/styles/controls/_editor.scss +74 -0
- package/styles/controls/_field.scss +92 -0
- package/styles/controls/_file-upload.scss +136 -0
- package/styles/controls/_input-group.scss +104 -0
- package/styles/controls/_input-mask.scss +46 -0
- package/styles/controls/_input-number.scss +125 -0
- package/styles/controls/_knob.scss +76 -0
- package/styles/controls/_layout.scss +182 -0
- package/styles/controls/_listbox.scss +38 -0
- package/styles/controls/_media.scss +222 -0
- package/styles/controls/_menu.scss +254 -0
- package/styles/controls/_message.scss +48 -0
- package/styles/controls/_org-chart.scss +128 -0
- package/styles/controls/_paginator.scss +59 -0
- package/styles/controls/_panel.scss +83 -0
- package/styles/controls/_popover.scss +40 -0
- package/styles/controls/_progress-bar.scss +74 -0
- package/styles/controls/_select-button.scss +61 -0
- package/styles/controls/_select.scss +216 -0
- package/styles/controls/_skeleton.scss +43 -0
- package/styles/controls/_slider.scss +163 -0
- package/styles/controls/_spinner.scss +34 -0
- package/styles/controls/_stepper.scss +109 -0
- package/styles/controls/_table.scss +523 -0
- package/styles/controls/_tabs.scss +93 -0
- package/styles/controls/_tag.scss +84 -0
- package/styles/controls/_toast.scss +141 -0
- package/styles/controls/_tooltip.scss +14 -0
- package/styles/controls/_tree.scss +113 -0
- package/styles/controls/_utility.scss +654 -0
- package/styles/star-ng.css +5807 -0
- package/styles/star-ng.min.css +1 -0
- package/styles/star-ng.scss +50 -0
- package/theme/star-theme-first-paint.js +1 -0
- package/types/star-ng-ui-accordion.d.ts +82 -0
- package/types/star-ng-ui-autocomplete.d.ts +171 -0
- package/types/star-ng-ui-avatar.d.ts +43 -0
- package/types/star-ng-ui-badge.d.ts +46 -0
- package/types/star-ng-ui-breadcrumb.d.ts +39 -0
- package/types/star-ng-ui-button.d.ts +79 -0
- package/types/star-ng-ui-card.d.ts +29 -0
- package/types/star-ng-ui-chart.d.ts +337 -0
- package/types/star-ng-ui-checkbox.d.ts +92 -0
- package/types/star-ng-ui-core.d.ts +373 -0
- package/types/star-ng-ui-data-display.d.ts +438 -0
- package/types/star-ng-ui-date-picker.d.ts +701 -0
- package/types/star-ng-ui-dialog.d.ts +254 -0
- package/types/star-ng-ui-drawer.d.ts +29 -0
- package/types/star-ng-ui-editor.d.ts +96 -0
- package/types/star-ng-ui-field.d.ts +146 -0
- package/types/star-ng-ui-file-upload.d.ts +192 -0
- package/types/star-ng-ui-i18n-de.d.ts +7 -0
- package/types/star-ng-ui-i18n-es.d.ts +7 -0
- package/types/star-ng-ui-input-group.d.ts +58 -0
- package/types/star-ng-ui-input-mask.d.ts +126 -0
- package/types/star-ng-ui-input-number.d.ts +193 -0
- package/types/star-ng-ui-input-otp.d.ts +86 -0
- package/types/star-ng-ui-input-tags.d.ts +159 -0
- package/types/star-ng-ui-knob.d.ts +121 -0
- package/types/star-ng-ui-layout.d.ts +154 -0
- package/types/star-ng-ui-listbox.d.ts +170 -0
- package/types/star-ng-ui-media.d.ts +161 -0
- package/types/star-ng-ui-menu.d.ts +332 -0
- package/types/star-ng-ui-message.d.ts +52 -0
- package/types/star-ng-ui-paginator.d.ts +85 -0
- package/types/star-ng-ui-panel.d.ts +65 -0
- package/types/star-ng-ui-password.d.ts +129 -0
- package/types/star-ng-ui-popover.d.ts +57 -0
- package/types/star-ng-ui-progress-bar.d.ts +49 -0
- package/types/star-ng-ui-radio.d.ts +116 -0
- package/types/star-ng-ui-rating.d.ts +52 -0
- package/types/star-ng-ui-select-button.d.ts +169 -0
- package/types/star-ng-ui-select.d.ts +563 -0
- package/types/star-ng-ui-skeleton.d.ts +47 -0
- package/types/star-ng-ui-slider.d.ts +145 -0
- package/types/star-ng-ui-spinner.d.ts +29 -0
- package/types/star-ng-ui-stepper.d.ts +89 -0
- package/types/star-ng-ui-table.d.ts +885 -0
- package/types/star-ng-ui-tabs.d.ts +109 -0
- package/types/star-ng-ui-tag.d.ts +35 -0
- package/types/star-ng-ui-theme-switch.d.ts +36 -0
- package/types/star-ng-ui-theme.d.ts +95 -0
- package/types/star-ng-ui-toast.d.ts +84 -0
- package/types/star-ng-ui-toggle-switch.d.ts +81 -0
- package/types/star-ng-ui-tooltip.d.ts +66 -0
- package/types/star-ng-ui-transloco.d.ts +14 -0
- package/types/star-ng-ui-tree.d.ts +343 -0
- package/types/star-ng-ui-utility.d.ts +533 -0
- package/types/star-ng-ui.d.ts +51 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { TemplateRef } from "@angular/core";
|
|
3
|
+
/** Lazy tab body: `<ng-template starTabContent>…</ng-template>` renders on first activation only. */
|
|
4
|
+
export declare class StarTabContent {
|
|
5
|
+
readonly template: TemplateRef<unknown>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTabContent, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<StarTabContent, "ng-template[starTabContent]", never, {}, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One tab and its panel. The host element is the `tabpanel`.
|
|
11
|
+
* Eager content goes directly inside; wrap heavy content in `ng-template starTabContent`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StarTab {
|
|
14
|
+
private readonly tabs;
|
|
15
|
+
private readonly ids;
|
|
16
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
|
17
|
+
readonly label: import("@angular/core").InputSignal<string>;
|
|
18
|
+
/** Phosphor icon class, for example `ph-bold ph-files`. */
|
|
19
|
+
readonly icon: import("@angular/core").InputSignal<string | null>;
|
|
20
|
+
readonly badge: import("@angular/core").InputSignal<string | number | null>;
|
|
21
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
22
|
+
readonly tabId: string;
|
|
23
|
+
readonly panelId: string;
|
|
24
|
+
protected readonly lazy: import("@angular/core").Signal<StarTabContent | undefined>;
|
|
25
|
+
readonly active: import("@angular/core").Signal<boolean>;
|
|
26
|
+
/** Stays true after the first activation, so lazy content keeps its state. */
|
|
27
|
+
protected readonly rendered: import("@angular/core").WritableSignal<boolean>;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTab, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarTab, "star-tab", never, {
|
|
30
|
+
"value": {
|
|
31
|
+
"alias": "value";
|
|
32
|
+
"required": true;
|
|
33
|
+
"isSignal": true;
|
|
34
|
+
};
|
|
35
|
+
"label": {
|
|
36
|
+
"alias": "label";
|
|
37
|
+
"required": true;
|
|
38
|
+
"isSignal": true;
|
|
39
|
+
};
|
|
40
|
+
"icon": {
|
|
41
|
+
"alias": "icon";
|
|
42
|
+
"required": false;
|
|
43
|
+
"isSignal": true;
|
|
44
|
+
};
|
|
45
|
+
"badge": {
|
|
46
|
+
"alias": "badge";
|
|
47
|
+
"required": false;
|
|
48
|
+
"isSignal": true;
|
|
49
|
+
};
|
|
50
|
+
"disabled": {
|
|
51
|
+
"alias": "disabled";
|
|
52
|
+
"required": false;
|
|
53
|
+
"isSignal": true;
|
|
54
|
+
};
|
|
55
|
+
}, {}, ["lazy"], ["*"], true, never>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Tabs (PrimeNG `p-tabs`): `[(value)]`, disabled tabs, icons, badges, lazy panels and the
|
|
59
|
+
* WAI-ARIA tabs keyboard model (Arrow keys, Home, End; automatic or manual activation).
|
|
60
|
+
*
|
|
61
|
+
* ```html
|
|
62
|
+
* <star-tabs [(value)]="tab" ariaLabel="Order sections">
|
|
63
|
+
* <star-tab value="details" label="Details">…</star-tab>
|
|
64
|
+
* <star-tab value="history" label="History"><ng-template starTabContent>…</ng-template></star-tab>
|
|
65
|
+
* </star-tabs>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare class StarTabs {
|
|
69
|
+
readonly value: import("@angular/core").ModelSignal<string | null>;
|
|
70
|
+
readonly variant: import("@angular/core").InputSignal<"line" | "pill">;
|
|
71
|
+
/** `false`: arrow keys move focus only; Enter / Space activate (manual activation). */
|
|
72
|
+
readonly selectOnFocus: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
73
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
74
|
+
readonly changed: import("@angular/core").OutputEmitterRef<string>;
|
|
75
|
+
protected readonly tabs: import("@angular/core").Signal<readonly StarTab[]>;
|
|
76
|
+
private readonly buttons;
|
|
77
|
+
/** Selected value; falls back to the first enabled tab while `value` is unset. */
|
|
78
|
+
readonly selected: import("@angular/core").Signal<string | null>;
|
|
79
|
+
/** Roving tabindex target; follows the selection, moves with arrows in manual mode. */
|
|
80
|
+
protected readonly focusValue: import("@angular/core").WritableSignal<string | null>;
|
|
81
|
+
protected select(tab: StarTab): void;
|
|
82
|
+
protected onKeydown(event: KeyboardEvent, current: StarTab): void;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTabs, never>;
|
|
84
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarTabs, "star-tabs", never, {
|
|
85
|
+
"value": {
|
|
86
|
+
"alias": "value";
|
|
87
|
+
"required": false;
|
|
88
|
+
"isSignal": true;
|
|
89
|
+
};
|
|
90
|
+
"variant": {
|
|
91
|
+
"alias": "variant";
|
|
92
|
+
"required": false;
|
|
93
|
+
"isSignal": true;
|
|
94
|
+
};
|
|
95
|
+
"selectOnFocus": {
|
|
96
|
+
"alias": "selectOnFocus";
|
|
97
|
+
"required": false;
|
|
98
|
+
"isSignal": true;
|
|
99
|
+
};
|
|
100
|
+
"ariaLabel": {
|
|
101
|
+
"alias": "ariaLabel";
|
|
102
|
+
"required": false;
|
|
103
|
+
"isSignal": true;
|
|
104
|
+
};
|
|
105
|
+
}, {
|
|
106
|
+
"value": "valueChange";
|
|
107
|
+
"changed": "changed";
|
|
108
|
+
}, ["tabs"], ["*"], true, never>;
|
|
109
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StarSeverity } from "@star-ng/ui/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Status label (PrimeNG `p-tag`): severity color, optional icon, rounded pill.
|
|
5
|
+
* `<star-tag severity="success" icon="ph-bold ph-check">Closed</star-tag>`
|
|
6
|
+
*/
|
|
7
|
+
export declare class StarTag {
|
|
8
|
+
readonly severity: import("@angular/core").InputSignal<StarSeverity>;
|
|
9
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly icon: import("@angular/core").InputSignal<string | null>;
|
|
11
|
+
readonly rounded: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTag, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarTag, "star-tag", never, {
|
|
14
|
+
"severity": {
|
|
15
|
+
"alias": "severity";
|
|
16
|
+
"required": false;
|
|
17
|
+
"isSignal": true;
|
|
18
|
+
};
|
|
19
|
+
"value": {
|
|
20
|
+
"alias": "value";
|
|
21
|
+
"required": false;
|
|
22
|
+
"isSignal": true;
|
|
23
|
+
};
|
|
24
|
+
"icon": {
|
|
25
|
+
"alias": "icon";
|
|
26
|
+
"required": false;
|
|
27
|
+
"isSignal": true;
|
|
28
|
+
};
|
|
29
|
+
"rounded": {
|
|
30
|
+
"alias": "rounded";
|
|
31
|
+
"required": false;
|
|
32
|
+
"isSignal": true;
|
|
33
|
+
};
|
|
34
|
+
}, {}, never, ["*"], true, never>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StarMenuItem } from "@star-ng/ui/menu";
|
|
2
|
+
import { StarThemeMode } from "@star-ng/ui/theme";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Theme switch: a small speed dial with System, Light and Dark. The button shows the icon of
|
|
6
|
+
* the current choice; `StarThemeService` applies and remembers it. The texts come from
|
|
7
|
+
* `STAR_UI_TEXT` (`theme`, `themeSystem`, `themeLight`, `themeDark`).
|
|
8
|
+
*
|
|
9
|
+
* The control is not positioned: the host places it. For a fixed corner:
|
|
10
|
+
*
|
|
11
|
+
* ```css
|
|
12
|
+
* star-theme-switch {
|
|
13
|
+
* position: fixed;
|
|
14
|
+
* top: var(--star-space-3);
|
|
15
|
+
* inset-inline-end: var(--star-space-4);
|
|
16
|
+
* z-index: 40;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* `<star-theme-switch />`
|
|
21
|
+
*/
|
|
22
|
+
export declare class StarThemeSwitch {
|
|
23
|
+
private readonly theme;
|
|
24
|
+
private readonly text;
|
|
25
|
+
protected readonly activeIndex: import("@angular/core").Signal<number>;
|
|
26
|
+
protected readonly current: import("@angular/core").Signal<{
|
|
27
|
+
readonly mode: StarThemeMode;
|
|
28
|
+
readonly icon: string;
|
|
29
|
+
}>;
|
|
30
|
+
private modeLabel;
|
|
31
|
+
protected readonly items: import("@angular/core").Signal<readonly StarMenuItem[]>;
|
|
32
|
+
/** Accessible name of the button, for example "Theme: Dark". */
|
|
33
|
+
protected readonly label: import("@angular/core").Signal<string>;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarThemeSwitch, never>;
|
|
35
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarThemeSwitch, "star-theme-switch", never, {}, {}, never, never, true, never>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { InjectionToken } from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Source of the first-paint theme script. It sets `data-theme` on `<html>` before the browser
|
|
5
|
+
* paints, so a dark-theme user does not see a light frame while the application starts.
|
|
6
|
+
*
|
|
7
|
+
* The rule is the same as in `StarThemeService`: the saved choice (`system`, `light` or
|
|
8
|
+
* `dark`), else the system setting.
|
|
9
|
+
*
|
|
10
|
+
* A strict Content Security Policy (`script-src 'self'`, no `'unsafe-inline'`) blocks an inline
|
|
11
|
+
* script. There are three ways that work with it. See the "Content Security Policy" section of
|
|
12
|
+
* the "Dark mode" guide:
|
|
13
|
+
*
|
|
14
|
+
* 1. the static file `@star-ng/ui/theme/star-theme-first-paint.js` (see
|
|
15
|
+
* `starThemeFirstPaintFileScript`), loaded with `<script src>`;
|
|
16
|
+
* 2. the hash of this text in the policy (`STAR_THEME_FIRST_PAINT_HASH`,
|
|
17
|
+
* `starThemeFirstPaintHash`);
|
|
18
|
+
* 3. a nonce (`starThemeFirstPaintElement`).
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* // For example in a build script or a server-side template:
|
|
22
|
+
* const html = `<script>${starThemeFirstPaintScript()}</script>`;
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param storageKey The `localStorage` key. Use the value of `STAR_THEME_STORAGE_KEY`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function starThemeFirstPaintScript(storageKey?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Text of the static file `@star-ng/ui/theme/star-theme-first-paint.js`. It is the same script as
|
|
30
|
+
* `starThemeFirstPaintScript()`, but the storage key comes from the `data-storage-key`
|
|
31
|
+
* attribute of its own `<script>` element (default `'star-theme'`), so a custom key needs no
|
|
32
|
+
* inline code:
|
|
33
|
+
*
|
|
34
|
+
* ```html
|
|
35
|
+
* <script src="star-theme-first-paint.js" data-storage-key="my-app-theme"></script>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* A unit test keeps the file and this function identical.
|
|
39
|
+
*/
|
|
40
|
+
export declare function starThemeFirstPaintFileScript(): string;
|
|
41
|
+
/**
|
|
42
|
+
* CSP hash source of `starThemeFirstPaintScript()` with the default storage key. Put it in
|
|
43
|
+
* `script-src`, and write the script between the tags with no extra character: no space, no
|
|
44
|
+
* line break. A unit test recomputes it, so it cannot be stale.
|
|
45
|
+
*/
|
|
46
|
+
export declare const STAR_THEME_FIRST_PAINT_HASH = "'sha256-mHrWsD/vOGmnKvtGE+U7/5fQm439nYWV30PcQ/ez708='";
|
|
47
|
+
/**
|
|
48
|
+
* Computes the CSP hash source (`'sha256-...'`, with the quotes) of the exact text of
|
|
49
|
+
* `starThemeFirstPaintScript(storageKey)`. The browser hashes the UTF-8 bytes of the text
|
|
50
|
+
* between `<script>` and `</script>`. Use it for a custom storage key (needs Web Crypto, so a
|
|
51
|
+
* secure context or a current Node.js version).
|
|
52
|
+
*/
|
|
53
|
+
export declare function starThemeFirstPaintHash(storageKey?: string): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* The full `<script nonce="...">...</script>` element text of the first-paint script, for a
|
|
56
|
+
* server-rendered page. Add `'nonce-<same value>'` to `script-src`. Use a new random nonce
|
|
57
|
+
* (at least 128 bits) for each response.
|
|
58
|
+
*
|
|
59
|
+
* @throws Error when the nonce is not a valid base64 or base64url value. The check keeps
|
|
60
|
+
* markup out of the attribute.
|
|
61
|
+
*/
|
|
62
|
+
export declare function starThemeFirstPaintElement(nonce: string, storageKey?: string): string;
|
|
63
|
+
/** Default `localStorage` key of the saved theme choice. */
|
|
64
|
+
export declare const STAR_THEME_DEFAULT_STORAGE_KEY = "star-theme";
|
|
65
|
+
/** `'system'` follows the operating system setting (`prefers-color-scheme`). */
|
|
66
|
+
export type StarThemeMode = 'system' | 'light' | 'dark';
|
|
67
|
+
/**
|
|
68
|
+
* `localStorage` key of the saved theme choice. Provide another value when two applications
|
|
69
|
+
* on one origin must keep separate choices. The first-paint script must use the same key.
|
|
70
|
+
*/
|
|
71
|
+
export declare const STAR_THEME_STORAGE_KEY: InjectionToken<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Color theme of the application. The StarNG tokens change with `data-theme` on `<html>`
|
|
74
|
+
* (`@star-ng/ui/styles/_tokens.scss`); this service sets that attribute and remembers the choice
|
|
75
|
+
* in the browser (`localStorage`). Inject it in the root component, so the theme applies on
|
|
76
|
+
* every page.
|
|
77
|
+
*
|
|
78
|
+
* The service is optional: an application that has one fixed theme does not need it.
|
|
79
|
+
*/
|
|
80
|
+
export declare class StarThemeService {
|
|
81
|
+
private readonly document;
|
|
82
|
+
private readonly storageKey;
|
|
83
|
+
private readonly view;
|
|
84
|
+
private readonly systemQuery;
|
|
85
|
+
private readonly systemDark;
|
|
86
|
+
/** The user's choice. */
|
|
87
|
+
readonly mode: import("@angular/core").WritableSignal<StarThemeMode>;
|
|
88
|
+
/** The theme in use now: `'system'` resolved to light or dark. */
|
|
89
|
+
readonly theme: import("@angular/core").Signal<"light" | "dark">;
|
|
90
|
+
constructor();
|
|
91
|
+
setMode(mode: StarThemeMode): void;
|
|
92
|
+
private stored;
|
|
93
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarThemeService, never>;
|
|
94
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
95
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export type StarToastSeverity = 'success' | 'info' | 'warn' | 'error';
|
|
3
|
+
export interface StarToastOptions {
|
|
4
|
+
readonly severity?: StarToastSeverity;
|
|
5
|
+
readonly summary: string;
|
|
6
|
+
readonly detail?: string;
|
|
7
|
+
/** Milliseconds before auto close (default 5000). */
|
|
8
|
+
readonly life?: number;
|
|
9
|
+
/** Stays until the user closes it. */
|
|
10
|
+
readonly sticky?: boolean;
|
|
11
|
+
/** Targets a specific `<star-toast key="...">`. */
|
|
12
|
+
readonly key?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface StarToastMessage extends Required<Omit<StarToastOptions, 'detail' | 'key'>> {
|
|
15
|
+
readonly id: number;
|
|
16
|
+
readonly detail?: string;
|
|
17
|
+
readonly key?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Toast notifications (PrimeNG `MessageService` + `p-toast`): severities, auto-close with
|
|
21
|
+
* pause on hover / focus, sticky messages, duplicate suppression and a visible-stack limit.
|
|
22
|
+
*
|
|
23
|
+
* `inject(StarToastService).success('Saved', 'Order ORD-102 was updated.')`
|
|
24
|
+
*/
|
|
25
|
+
export declare class StarToastService {
|
|
26
|
+
private readonly items;
|
|
27
|
+
private readonly timers;
|
|
28
|
+
private nextId;
|
|
29
|
+
readonly messages: import("@angular/core").Signal<readonly StarToastMessage[]>;
|
|
30
|
+
/** Identical summary + detail while still visible is ignored. */
|
|
31
|
+
preventDuplicates: boolean;
|
|
32
|
+
constructor();
|
|
33
|
+
show(options: StarToastOptions): number;
|
|
34
|
+
success(summary: string, detail?: string): number;
|
|
35
|
+
info(summary: string, detail?: string): number;
|
|
36
|
+
warn(summary: string, detail?: string): number;
|
|
37
|
+
error(summary: string, detail?: string): number;
|
|
38
|
+
remove(id: number): void;
|
|
39
|
+
/** Removes all messages, or only those of one `key`. */
|
|
40
|
+
clear(key?: string): void;
|
|
41
|
+
pause(id: number): void;
|
|
42
|
+
resume(id: number): void;
|
|
43
|
+
private startTimer;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarToastService, never>;
|
|
45
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Toast outlet. Place once in the app shell. It renders as a manual popover, so toasts stay
|
|
49
|
+
* above open modal dialogs (top layer).
|
|
50
|
+
*/
|
|
51
|
+
export declare class StarToast {
|
|
52
|
+
protected readonly toasts: StarToastService;
|
|
53
|
+
protected readonly text: import("@star-ng/ui/core").StarUiText;
|
|
54
|
+
private readonly host;
|
|
55
|
+
/**
|
|
56
|
+
* Corner of the screen. `-left` and `-right` are physical; `-start` and `-end` follow the
|
|
57
|
+
* writing direction (the start corner is on the right in right-to-left).
|
|
58
|
+
*/
|
|
59
|
+
readonly position: import("@angular/core").InputSignal<"top-right" | "top-left" | "top-start" | "top-end" | "top-center" | "bottom-right" | "bottom-left" | "bottom-start" | "bottom-end" | "bottom-center">;
|
|
60
|
+
readonly key: import("@angular/core").InputSignal<string | undefined>;
|
|
61
|
+
/** Newest messages beyond this count wait until older ones close. */
|
|
62
|
+
readonly stackLimit: import("@angular/core").InputSignal<number>;
|
|
63
|
+
protected readonly visible: import("@angular/core").Signal<StarToastMessage[]>;
|
|
64
|
+
constructor();
|
|
65
|
+
protected icon(severity: StarToastSeverity): string;
|
|
66
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarToast, never>;
|
|
67
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarToast, "star-toast", never, {
|
|
68
|
+
"position": {
|
|
69
|
+
"alias": "position";
|
|
70
|
+
"required": false;
|
|
71
|
+
"isSignal": true;
|
|
72
|
+
};
|
|
73
|
+
"key": {
|
|
74
|
+
"alias": "key";
|
|
75
|
+
"required": false;
|
|
76
|
+
"isSignal": true;
|
|
77
|
+
};
|
|
78
|
+
"stackLimit": {
|
|
79
|
+
"alias": "stackLimit";
|
|
80
|
+
"required": false;
|
|
81
|
+
"isSignal": true;
|
|
82
|
+
};
|
|
83
|
+
}, {}, never, never, true, never>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { FormCheckboxControl } from "@angular/forms/signals";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* On/off switch (PrimeNG `p-toggleswitch`). Native checkbox with `role="switch"`, so Space toggles
|
|
5
|
+
* and screen readers announce "on" / "off".
|
|
6
|
+
*
|
|
7
|
+
* `<star-toggle-switch [(checked)]="notify">Email notifications</star-toggle-switch>`
|
|
8
|
+
*/
|
|
9
|
+
export declare class StarToggleSwitch implements FormCheckboxControl {
|
|
10
|
+
readonly checked: import("@angular/core").ModelSignal<boolean>;
|
|
11
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
12
|
+
readonly readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
13
|
+
readonly invalid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
14
|
+
readonly touched: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
15
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
16
|
+
readonly size: import("@angular/core").InputSignal<"sm" | "md">;
|
|
17
|
+
readonly inputId: import("@angular/core").InputSignal<string>;
|
|
18
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string | null>;
|
|
19
|
+
/** Set false when the switch has no visible label (then set `ariaLabel`). */
|
|
20
|
+
readonly hasLabel: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
21
|
+
readonly touch: import("@angular/core").OutputEmitterRef<void>;
|
|
22
|
+
private readonly box;
|
|
23
|
+
protected onChange(box: HTMLInputElement): void;
|
|
24
|
+
focus(options?: FocusOptions): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarToggleSwitch, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarToggleSwitch, "star-toggle-switch", never, {
|
|
27
|
+
"checked": {
|
|
28
|
+
"alias": "checked";
|
|
29
|
+
"required": false;
|
|
30
|
+
"isSignal": true;
|
|
31
|
+
};
|
|
32
|
+
"disabled": {
|
|
33
|
+
"alias": "disabled";
|
|
34
|
+
"required": false;
|
|
35
|
+
"isSignal": true;
|
|
36
|
+
};
|
|
37
|
+
"readonly": {
|
|
38
|
+
"alias": "readonly";
|
|
39
|
+
"required": false;
|
|
40
|
+
"isSignal": true;
|
|
41
|
+
};
|
|
42
|
+
"invalid": {
|
|
43
|
+
"alias": "invalid";
|
|
44
|
+
"required": false;
|
|
45
|
+
"isSignal": true;
|
|
46
|
+
};
|
|
47
|
+
"touched": {
|
|
48
|
+
"alias": "touched";
|
|
49
|
+
"required": false;
|
|
50
|
+
"isSignal": true;
|
|
51
|
+
};
|
|
52
|
+
"name": {
|
|
53
|
+
"alias": "name";
|
|
54
|
+
"required": false;
|
|
55
|
+
"isSignal": true;
|
|
56
|
+
};
|
|
57
|
+
"size": {
|
|
58
|
+
"alias": "size";
|
|
59
|
+
"required": false;
|
|
60
|
+
"isSignal": true;
|
|
61
|
+
};
|
|
62
|
+
"inputId": {
|
|
63
|
+
"alias": "inputId";
|
|
64
|
+
"required": false;
|
|
65
|
+
"isSignal": true;
|
|
66
|
+
};
|
|
67
|
+
"ariaLabel": {
|
|
68
|
+
"alias": "ariaLabel";
|
|
69
|
+
"required": false;
|
|
70
|
+
"isSignal": true;
|
|
71
|
+
};
|
|
72
|
+
"hasLabel": {
|
|
73
|
+
"alias": "hasLabel";
|
|
74
|
+
"required": false;
|
|
75
|
+
"isSignal": true;
|
|
76
|
+
};
|
|
77
|
+
}, {
|
|
78
|
+
"checked": "checkedChange";
|
|
79
|
+
"touch": "touch";
|
|
80
|
+
}, never, ["*"], true, never>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Side of the host. `left` and `right` are the physical sides of the screen, as in CSS;
|
|
4
|
+
* `start` and `end` follow the writing direction (`start` is the right side in right-to-left).
|
|
5
|
+
*/
|
|
6
|
+
export type StarTooltipPosition = 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end';
|
|
7
|
+
export declare class StarTooltipPanel {
|
|
8
|
+
readonly text: import("@angular/core").WritableSignal<string>;
|
|
9
|
+
readonly id: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTooltipPanel, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<StarTooltipPanel, "star-tooltip-panel", never, {}, {}, never, never, true, never>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Tooltip (PrimeNG `pTooltip`): shows on hover and keyboard focus, hides on Escape, links the
|
|
15
|
+
* host with `aria-describedby`. Rendered as a native popover so it appears above dialogs.
|
|
16
|
+
*
|
|
17
|
+
* `<button starTooltip="Export to CSV" starTooltipPosition="bottom">…</button>`
|
|
18
|
+
*/
|
|
19
|
+
export declare class StarTooltip {
|
|
20
|
+
private readonly injector;
|
|
21
|
+
private readonly host;
|
|
22
|
+
private readonly panelId;
|
|
23
|
+
private readonly directionality;
|
|
24
|
+
readonly starTooltip: import("@angular/core").InputSignal<string>;
|
|
25
|
+
readonly starTooltipPosition: import("@angular/core").InputSignal<StarTooltipPosition>;
|
|
26
|
+
readonly starTooltipShowDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
27
|
+
readonly starTooltipHideDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
28
|
+
readonly starTooltipDisabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
29
|
+
protected readonly describedBy: import("@angular/core").WritableSignal<string | null>;
|
|
30
|
+
private overlayRef;
|
|
31
|
+
private panelRef;
|
|
32
|
+
private timer;
|
|
33
|
+
constructor();
|
|
34
|
+
protected scheduleShow(): void;
|
|
35
|
+
protected scheduleHide(): void;
|
|
36
|
+
show(): void;
|
|
37
|
+
hide(): void;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StarTooltip, never>;
|
|
39
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<StarTooltip, "[starTooltip]", never, {
|
|
40
|
+
"starTooltip": {
|
|
41
|
+
"alias": "starTooltip";
|
|
42
|
+
"required": false;
|
|
43
|
+
"isSignal": true;
|
|
44
|
+
};
|
|
45
|
+
"starTooltipPosition": {
|
|
46
|
+
"alias": "starTooltipPosition";
|
|
47
|
+
"required": false;
|
|
48
|
+
"isSignal": true;
|
|
49
|
+
};
|
|
50
|
+
"starTooltipShowDelay": {
|
|
51
|
+
"alias": "starTooltipShowDelay";
|
|
52
|
+
"required": false;
|
|
53
|
+
"isSignal": true;
|
|
54
|
+
};
|
|
55
|
+
"starTooltipHideDelay": {
|
|
56
|
+
"alias": "starTooltipHideDelay";
|
|
57
|
+
"required": false;
|
|
58
|
+
"isSignal": true;
|
|
59
|
+
};
|
|
60
|
+
"starTooltipDisabled": {
|
|
61
|
+
"alias": "starTooltipDisabled";
|
|
62
|
+
"required": false;
|
|
63
|
+
"isSignal": true;
|
|
64
|
+
};
|
|
65
|
+
}, {}, never, never, true, never>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Provider } from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Reads the control texts from Transloco: key `<prefix>.<name>` (default `ui.close`, `ui.page`…),
|
|
4
|
+
* with `{{ param }}` placeholders for function entries (names in `STAR_UI_TEXT_PARAMS`).
|
|
5
|
+
* A missing key falls back to the English default.
|
|
6
|
+
*
|
|
7
|
+
* Every entry is a getter that reads a signal which changes on language switch and on
|
|
8
|
+
* translation load, so OnPush controls re-render with the new language.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* providers: [provideStarUiTextFromTransloco()]
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function provideStarUiTextFromTransloco(prefix?: string): Provider;
|