shirkasoft-ui-components 1.13.18 → 2.0.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/README.md +415 -42
- package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
- package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-button.mjs +367 -73
- package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
- package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-config.mjs +976 -0
- package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1624 -1400
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
- package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs +484 -293
- package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-icons.mjs +1141 -0
- package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-knob.mjs +395 -180
- package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
- package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -303
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
- package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-price-input.mjs +517 -277
- package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
- package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-select.mjs +1014 -814
- package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
- package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
- package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-table.mjs +1918 -1676
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -177
- package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tag.mjs +177 -51
- package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-text-field.mjs +687 -369
- package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +466 -0
- package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-theme.mjs +147 -0
- package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
- package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -215
- package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-toggle.mjs +205 -128
- package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
- package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-utils.mjs +97 -125
- package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -166
- package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components.mjs +0 -9
- package/package.json +37 -7
- package/src/baseline.css +2472 -0
- package/src/theme.css +15 -543
- package/src/themes/ocean.css +56 -0
- package/src/themes/sunset.css +55 -0
- package/src/themes/violet.css +25 -0
- package/src/tokens.css +612 -0
- package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
- package/types/shirkasoft-ui-components-button.d.ts +142 -49
- package/types/shirkasoft-ui-components-chart.d.ts +59 -44
- package/types/shirkasoft-ui-components-config.d.ts +357 -0
- package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -65
- package/types/shirkasoft-ui-components-date-picker.d.ts +527 -373
- package/types/shirkasoft-ui-components-fieldset.d.ts +135 -59
- package/types/shirkasoft-ui-components-file-upload.d.ts +176 -106
- package/types/shirkasoft-ui-components-icons.d.ts +1430 -0
- package/types/shirkasoft-ui-components-knob.d.ts +151 -64
- package/types/shirkasoft-ui-components-loading.d.ts +155 -64
- package/types/shirkasoft-ui-components-modal.d.ts +134 -132
- package/types/shirkasoft-ui-components-notification.d.ts +63 -58
- package/types/shirkasoft-ui-components-price-input.d.ts +198 -85
- package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
- package/types/shirkasoft-ui-components-select.d.ts +301 -192
- package/types/shirkasoft-ui-components-sidebar.d.ts +198 -92
- package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
- package/types/shirkasoft-ui-components-table.d.ts +849 -649
- package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
- package/types/shirkasoft-ui-components-tag.d.ts +54 -23
- package/types/shirkasoft-ui-components-text-field.d.ts +231 -111
- package/types/shirkasoft-ui-components-theme-picker.d.ts +117 -0
- package/types/shirkasoft-ui-components-theme.d.ts +80 -0
- package/types/shirkasoft-ui-components-timeline.d.ts +326 -150
- package/types/shirkasoft-ui-components-toggle.d.ts +76 -45
- package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
- package/types/shirkasoft-ui-components-utils.d.ts +26 -17
- package/types/shirkasoft-ui-components-wizard.d.ts +236 -86
- package/types/shirkasoft-ui-components.d.ts +1 -2
- package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { ElementRef } from "@angular/core";
|
|
6
|
+
import { ControlValueAccessor, FormControl, FormGroup } from "@angular/forms";
|
|
7
|
+
import { FormValueControl } from "@angular/forms/signals";
|
|
5
8
|
/**
|
|
6
9
|
* Shirkasoft UI Components.
|
|
7
10
|
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
@@ -11,110 +14,227 @@ import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
|
|
|
11
14
|
* Text input (or textarea) that implements ControlValueAccessor with built-in
|
|
12
15
|
* validation messages, card/number formatting, password reveal and search mode.
|
|
13
16
|
*/
|
|
14
|
-
declare class TextFieldComponent implements ControlValueAccessor {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
17
|
+
export declare class TextFieldComponent implements ControlValueAccessor, FormValueControl<any> {
|
|
18
|
+
private cdr;
|
|
19
|
+
/** id attribute applied to the native input. */
|
|
20
|
+
id: import("@angular/core").InputSignal<string>;
|
|
21
|
+
/** Formats the value as a credit card number (XXXX-XXXX-XXXX-XXXX). */
|
|
22
|
+
formatCard: import("@angular/core").InputSignal<boolean>;
|
|
23
|
+
/** Blocks the minus sign from being typed. */
|
|
24
|
+
preventNegative: import("@angular/core").InputSignal<boolean>;
|
|
25
|
+
/** Label rendered above the field. */
|
|
26
|
+
label: import("@angular/core").InputSignal<string>;
|
|
27
|
+
/** Native input type ('text', 'password', 'number', etc.). */
|
|
28
|
+
type: import("@angular/core").InputSignal<string>;
|
|
29
|
+
/** Allows digits only, stripping any other character. */
|
|
30
|
+
numbersOnly: import("@angular/core").InputSignal<boolean>;
|
|
31
|
+
/** When true, allows decimals and normalizes ',' to '.'. */
|
|
32
|
+
allowDecimals: import("@angular/core").InputSignal<boolean>;
|
|
33
|
+
/** Maximum number of characters the user can type. */
|
|
34
|
+
maxLength: import("@angular/core").InputSignal<number | undefined>;
|
|
35
|
+
/** Placeholder text of the native input. */
|
|
36
|
+
placeholder: import("@angular/core").InputSignal<string>;
|
|
37
|
+
/** Custom messages keyed by validation error name. */
|
|
38
|
+
errorMessages: import("@angular/core").InputSignal<{
|
|
39
|
+
[key: string]: string;
|
|
40
|
+
}>;
|
|
41
|
+
/** Parent reactive form used to resolve the control by label. */
|
|
42
|
+
formGroup: import("@angular/core").InputSignal<FormGroup<any> | undefined>;
|
|
43
|
+
/** Reactive control bound directly to this field. */
|
|
44
|
+
control: import("@angular/core").InputSignal<FormControl<any> | undefined>;
|
|
45
|
+
/** Disables the field. */
|
|
46
|
+
disabled: import("@angular/core").InputSignal<boolean>;
|
|
47
|
+
/** Custom error message shown regardless of validation errors. */
|
|
48
|
+
errorMessage: import("@angular/core").InputSignal<string>;
|
|
49
|
+
/** Renders a textarea instead of an input. */
|
|
50
|
+
isTextArea: import("@angular/core").InputSignal<boolean>;
|
|
51
|
+
/** Height classes applied when `isTextArea` is true. */
|
|
52
|
+
textAreaHeight: import("@angular/core").InputSignal<string>;
|
|
53
|
+
/** Renders the field as a read-only search trigger. */
|
|
54
|
+
searchMode: import("@angular/core").InputSignal<boolean>;
|
|
55
|
+
/** Value shown when `searchMode` is enabled. */
|
|
56
|
+
displayValue: import("@angular/core").InputSignal<string>;
|
|
57
|
+
/** Native autocomplete attribute. */
|
|
58
|
+
autocomplete: import("@angular/core").InputSignal<string>;
|
|
59
|
+
/** Emitted when the search button is clicked (search mode). */
|
|
60
|
+
searchButtonClick: import("@angular/core").OutputEmitterRef<void>;
|
|
61
|
+
/** Emitted on blur so Signal Forms can mark the field as touched. */
|
|
62
|
+
touch: import("@angular/core").OutputEmitterRef<void>;
|
|
63
|
+
protected readonly getIcon: (name: any) => import("shirkasoft-ui-components/icons").IconNode | null;
|
|
64
|
+
/** Reference to the native input element. */
|
|
65
|
+
inputElement: import("@angular/core").Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
66
|
+
/** Reference to the native textarea element. */
|
|
67
|
+
textareaElement: import("@angular/core").Signal<ElementRef<HTMLTextAreaElement> | undefined>;
|
|
68
|
+
/** Field value. Two-way bindable and used by Signal Forms `[formField]`. */
|
|
69
|
+
value: import("@angular/core").ModelSignal<any>;
|
|
70
|
+
/** Internal alias kept for the existing implementation. */
|
|
71
|
+
private get _value();
|
|
72
|
+
/** Reactive disabled state from the form control. */
|
|
73
|
+
private _disabledState;
|
|
74
|
+
/** Whether the password is currently revealed. */
|
|
75
|
+
showPassword: import("@angular/core").WritableSignal<boolean>;
|
|
76
|
+
/** Tracks whether the control was in error at some point (for "was fixed" UX). */
|
|
77
|
+
hadError: import("@angular/core").WritableSignal<boolean>;
|
|
78
|
+
/** Counter bumped to trigger recomputation of derived error signals. */
|
|
79
|
+
private errorTracker;
|
|
80
|
+
/** Text displayed in search mode when `displayValue` is set. */
|
|
81
|
+
displayLabel: import("@angular/core").Signal<string>;
|
|
82
|
+
/** Control whose status/value changes are currently observed. */
|
|
83
|
+
private observedControl;
|
|
84
|
+
/** Subscription to `observedControl`; replaced when the control changes. */
|
|
85
|
+
private controlSubscription?;
|
|
86
|
+
/** Effective disabled state combining the input and the form binding. */
|
|
87
|
+
isDisabled: import("@angular/core").Signal<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Internal control used when no reactive control is supplied (`[formField]`,
|
|
90
|
+
* `formControlName`/`ngModel` on the host, or plain `[(value)]`). The native
|
|
91
|
+
* input always needs a control for its `[formControl]` binding.
|
|
92
|
+
*/
|
|
93
|
+
private readonly innerControl;
|
|
94
|
+
/** Explicit `control`, or `formGroup.get(label)`, or `undefined` if none. */
|
|
95
|
+
private externalControl;
|
|
96
|
+
/** True when the field is driven by its internal control (no reactive control given). */
|
|
97
|
+
private usesInnerControl;
|
|
98
|
+
/** Resolves the reactive control: external one if any, otherwise the internal one. */
|
|
99
|
+
actualControl: import("@angular/core").Signal<FormControl<any>>;
|
|
100
|
+
/** True when the resolved control is invalid and dirty or touched. */
|
|
101
|
+
shouldShowError: import("@angular/core").Signal<boolean>;
|
|
102
|
+
/** True when the control had an error before and is now valid (success state). */
|
|
103
|
+
wasFixedError: import("@angular/core").Signal<boolean>;
|
|
104
|
+
/** Resolved list of error messages for the current control state. */
|
|
105
|
+
getErrorMessages: import("@angular/core").Signal<string[]>;
|
|
106
|
+
/** Effective input type (handles textarea and password reveal). */
|
|
107
|
+
effectiveType: import("@angular/core").Signal<string>;
|
|
108
|
+
private transloco;
|
|
109
|
+
/** Callback notified with the new value (ControlValueAccessor). */
|
|
110
|
+
private onChange;
|
|
111
|
+
/** Callback notified when the field is touched (ControlValueAccessor). */
|
|
112
|
+
private onTouched;
|
|
113
|
+
private destroyRef;
|
|
114
|
+
constructor();
|
|
115
|
+
/** Prevents disallowed characters based on the `numbersOnly`/`allowDecimals` config. */
|
|
116
|
+
numberValidation(event: KeyboardEvent): void;
|
|
117
|
+
/** Marks the field as touched and refreshes the error state. */
|
|
118
|
+
onBlur(): void;
|
|
119
|
+
/** Formats the raw input as a credit card number and notifies the control. */
|
|
120
|
+
onCardInput(event: Event): void;
|
|
121
|
+
/** Handles raw input: applies number/card/max-length formatting and notifies the control. */
|
|
122
|
+
onInput(event: Event): void;
|
|
123
|
+
/** Toggles the visibility of a password field. */
|
|
124
|
+
togglePasswordVisibility(): void;
|
|
125
|
+
/** Sets the value from the form control applying the same formatting rules. */
|
|
126
|
+
writeValue(value: any): void;
|
|
127
|
+
/** Registers the callback invoked on value changes (ControlValueAccessor). */
|
|
128
|
+
registerOnChange(fn: any): void;
|
|
129
|
+
/** Registers the callback invoked when the field is touched. */
|
|
130
|
+
registerOnTouched(fn: any): void;
|
|
131
|
+
/** Reflects the disabled state of the form control. */
|
|
132
|
+
setDisabledState(isDisabled: boolean): void;
|
|
133
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextFieldComponent, never>;
|
|
134
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextFieldComponent, "shk-text-field", never, {
|
|
135
|
+
"id": {
|
|
136
|
+
"alias": "id";
|
|
137
|
+
"required": false;
|
|
138
|
+
"isSignal": true;
|
|
139
|
+
};
|
|
140
|
+
"formatCard": {
|
|
141
|
+
"alias": "formatCard";
|
|
142
|
+
"required": false;
|
|
143
|
+
"isSignal": true;
|
|
144
|
+
};
|
|
145
|
+
"preventNegative": {
|
|
146
|
+
"alias": "preventNegative";
|
|
147
|
+
"required": false;
|
|
148
|
+
"isSignal": true;
|
|
149
|
+
};
|
|
150
|
+
"label": {
|
|
151
|
+
"alias": "label";
|
|
152
|
+
"required": false;
|
|
153
|
+
"isSignal": true;
|
|
154
|
+
};
|
|
155
|
+
"type": {
|
|
156
|
+
"alias": "type";
|
|
157
|
+
"required": false;
|
|
158
|
+
"isSignal": true;
|
|
159
|
+
};
|
|
160
|
+
"numbersOnly": {
|
|
161
|
+
"alias": "numbersOnly";
|
|
162
|
+
"required": false;
|
|
163
|
+
"isSignal": true;
|
|
164
|
+
};
|
|
165
|
+
"allowDecimals": {
|
|
166
|
+
"alias": "allowDecimals";
|
|
167
|
+
"required": false;
|
|
168
|
+
"isSignal": true;
|
|
169
|
+
};
|
|
170
|
+
"maxLength": {
|
|
171
|
+
"alias": "maxLength";
|
|
172
|
+
"required": false;
|
|
173
|
+
"isSignal": true;
|
|
174
|
+
};
|
|
175
|
+
"placeholder": {
|
|
176
|
+
"alias": "placeholder";
|
|
177
|
+
"required": false;
|
|
178
|
+
"isSignal": true;
|
|
179
|
+
};
|
|
180
|
+
"errorMessages": {
|
|
181
|
+
"alias": "errorMessages";
|
|
182
|
+
"required": false;
|
|
183
|
+
"isSignal": true;
|
|
184
|
+
};
|
|
185
|
+
"formGroup": {
|
|
186
|
+
"alias": "formGroup";
|
|
187
|
+
"required": false;
|
|
188
|
+
"isSignal": true;
|
|
189
|
+
};
|
|
190
|
+
"control": {
|
|
191
|
+
"alias": "control";
|
|
192
|
+
"required": false;
|
|
193
|
+
"isSignal": true;
|
|
194
|
+
};
|
|
195
|
+
"disabled": {
|
|
196
|
+
"alias": "disabled";
|
|
197
|
+
"required": false;
|
|
198
|
+
"isSignal": true;
|
|
199
|
+
};
|
|
200
|
+
"errorMessage": {
|
|
201
|
+
"alias": "errorMessage";
|
|
202
|
+
"required": false;
|
|
203
|
+
"isSignal": true;
|
|
204
|
+
};
|
|
205
|
+
"isTextArea": {
|
|
206
|
+
"alias": "isTextArea";
|
|
207
|
+
"required": false;
|
|
208
|
+
"isSignal": true;
|
|
209
|
+
};
|
|
210
|
+
"textAreaHeight": {
|
|
211
|
+
"alias": "textAreaHeight";
|
|
212
|
+
"required": false;
|
|
213
|
+
"isSignal": true;
|
|
214
|
+
};
|
|
215
|
+
"searchMode": {
|
|
216
|
+
"alias": "searchMode";
|
|
217
|
+
"required": false;
|
|
218
|
+
"isSignal": true;
|
|
219
|
+
};
|
|
220
|
+
"displayValue": {
|
|
221
|
+
"alias": "displayValue";
|
|
222
|
+
"required": false;
|
|
223
|
+
"isSignal": true;
|
|
224
|
+
};
|
|
225
|
+
"autocomplete": {
|
|
226
|
+
"alias": "autocomplete";
|
|
227
|
+
"required": false;
|
|
228
|
+
"isSignal": true;
|
|
229
|
+
};
|
|
230
|
+
"value": {
|
|
231
|
+
"alias": "value";
|
|
232
|
+
"required": false;
|
|
233
|
+
"isSignal": true;
|
|
234
|
+
};
|
|
235
|
+
}, {
|
|
236
|
+
"searchButtonClick": "searchButtonClick";
|
|
237
|
+
"touch": "touch";
|
|
238
|
+
"value": "valueChange";
|
|
239
|
+
}, never, never, true, never>;
|
|
240
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Shirkasoft UI Components.
|
|
7
|
+
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
8
|
+
* Belongs to Shirkasoft.
|
|
9
|
+
*/
|
|
10
|
+
/** A primary color offered by the picker. */
|
|
11
|
+
interface ShkPickerColor {
|
|
12
|
+
/** Hex color; it becomes `--shk-primary-600` (`theme.primary`). */
|
|
13
|
+
color: string;
|
|
14
|
+
/** Accessible name / tooltip. */
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Default primary colors (Tailwind 600 shades). Red and rose are left out on
|
|
19
|
+
* purpose: red is reserved for danger states.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DEFAULT_PRIMARY_COLORS: readonly ShkPickerColor[];
|
|
22
|
+
/**
|
|
23
|
+
* Theme customizer: a palette button that opens a panel to pick the primary
|
|
24
|
+
* color, the surface (neutral) palette and a theme preset at runtime.
|
|
25
|
+
*
|
|
26
|
+
* It edits the `theme.primary`, `theme.surface` and `theme.name` options, so it
|
|
27
|
+
* needs `provideShk(withTheme(...))`; add `withPersistence()` to remember the
|
|
28
|
+
* choice. Without `withTheme()` it renders nothing.
|
|
29
|
+
*
|
|
30
|
+
* ```html
|
|
31
|
+
* <shk-theme-picker />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class ThemePickerComponent {
|
|
35
|
+
private readonly config;
|
|
36
|
+
private readonly host;
|
|
37
|
+
private readonly trigger;
|
|
38
|
+
/** Primary colors offered. */
|
|
39
|
+
readonly primaryColors: import("@angular/core").InputSignal<readonly ShkPickerColor[]>;
|
|
40
|
+
/** Shows the surface (neutral palette) section. */
|
|
41
|
+
readonly showSurface: import("@angular/core").InputSignal<boolean>;
|
|
42
|
+
/** Shows the theme presets section (needs more than one preset). */
|
|
43
|
+
readonly showPresets: import("@angular/core").InputSignal<boolean>;
|
|
44
|
+
/** Accessible name and tooltip of the button. */
|
|
45
|
+
readonly triggerLabel: import("@angular/core").InputSignal<string>;
|
|
46
|
+
readonly primaryLabel: import("@angular/core").InputSignal<string>;
|
|
47
|
+
readonly surfaceLabel: import("@angular/core").InputSignal<string>;
|
|
48
|
+
readonly presetsLabel: import("@angular/core").InputSignal<string>;
|
|
49
|
+
/** `theme.*` options exist only when the app uses `withTheme()`. */
|
|
50
|
+
protected readonly available: boolean;
|
|
51
|
+
protected readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
52
|
+
protected readonly panelId: string;
|
|
53
|
+
protected readonly paletteIcon: import("shirkasoft-ui-components/icons").IconNode | null;
|
|
54
|
+
protected readonly presets: readonly import("shirkasoft-ui-components/config").ShkThemePreset[];
|
|
55
|
+
/** Surface palettes, each shown with its 500 shade. */
|
|
56
|
+
protected readonly surfaces: {
|
|
57
|
+
name: string;
|
|
58
|
+
label: string;
|
|
59
|
+
color: string;
|
|
60
|
+
}[];
|
|
61
|
+
protected readonly themeName: import("@angular/core").Signal<string>;
|
|
62
|
+
private readonly currentPreset;
|
|
63
|
+
private readonly primaryOverride;
|
|
64
|
+
private readonly surfaceOverride;
|
|
65
|
+
/** Primary color in use: the override, else the preset's own (lowercase hex). */
|
|
66
|
+
protected readonly activePrimary: import("@angular/core").Signal<string>;
|
|
67
|
+
/** Surface palette in use: the override, else the preset's own. */
|
|
68
|
+
protected readonly activeSurface: import("@angular/core").Signal<string>;
|
|
69
|
+
/** True while no primary/surface override is applied on top of the preset. */
|
|
70
|
+
protected readonly isPresetPure: import("@angular/core").Signal<boolean>;
|
|
71
|
+
protected toggle(): void;
|
|
72
|
+
protected setPrimary(color: string): void;
|
|
73
|
+
protected setSurface(name: string): void;
|
|
74
|
+
/** Applies a theme pack and clears the primary/surface overrides. */
|
|
75
|
+
protected setPreset(name: string): void;
|
|
76
|
+
protected onDocumentPointerDown(event: PointerEvent): void;
|
|
77
|
+
protected onEscape(): void;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemePickerComponent, never>;
|
|
79
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ThemePickerComponent, "shk-theme-picker", never, {
|
|
80
|
+
"primaryColors": {
|
|
81
|
+
"alias": "primaryColors";
|
|
82
|
+
"required": false;
|
|
83
|
+
"isSignal": true;
|
|
84
|
+
};
|
|
85
|
+
"showSurface": {
|
|
86
|
+
"alias": "showSurface";
|
|
87
|
+
"required": false;
|
|
88
|
+
"isSignal": true;
|
|
89
|
+
};
|
|
90
|
+
"showPresets": {
|
|
91
|
+
"alias": "showPresets";
|
|
92
|
+
"required": false;
|
|
93
|
+
"isSignal": true;
|
|
94
|
+
};
|
|
95
|
+
"triggerLabel": {
|
|
96
|
+
"alias": "triggerLabel";
|
|
97
|
+
"required": false;
|
|
98
|
+
"isSignal": true;
|
|
99
|
+
};
|
|
100
|
+
"primaryLabel": {
|
|
101
|
+
"alias": "primaryLabel";
|
|
102
|
+
"required": false;
|
|
103
|
+
"isSignal": true;
|
|
104
|
+
};
|
|
105
|
+
"surfaceLabel": {
|
|
106
|
+
"alias": "surfaceLabel";
|
|
107
|
+
"required": false;
|
|
108
|
+
"isSignal": true;
|
|
109
|
+
};
|
|
110
|
+
"presetsLabel": {
|
|
111
|
+
"alias": "presetsLabel";
|
|
112
|
+
"required": false;
|
|
113
|
+
"isSignal": true;
|
|
114
|
+
};
|
|
115
|
+
}, {}, never, never, true, never>;
|
|
116
|
+
}
|
|
117
|
+
export type { ShkPickerColor };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { EnvironmentProviders, InjectionToken } from "@angular/core";
|
|
6
|
+
/** Built-in theme packs shipped with the library. */
|
|
7
|
+
type ShkThemeName = 'default' | 'ocean' | 'violet' | 'sunset' | (string & {});
|
|
8
|
+
/** Color scheme selection. `system` follows `prefers-color-scheme`. */
|
|
9
|
+
type ShkColorScheme = 'light' | 'dark' | 'system';
|
|
10
|
+
interface ShkThemeConfig {
|
|
11
|
+
/** Theme applied when nothing is stored yet. Defaults to `default`. */
|
|
12
|
+
defaultTheme?: ShkThemeName;
|
|
13
|
+
/** Scheme applied when nothing is stored yet. Defaults to `system`. */
|
|
14
|
+
defaultScheme?: ShkColorScheme;
|
|
15
|
+
/** Persist the selection in localStorage. Defaults to `true`. */
|
|
16
|
+
persist?: boolean;
|
|
17
|
+
/** localStorage keys. */
|
|
18
|
+
storageKey?: string;
|
|
19
|
+
schemeStorageKey?: string;
|
|
20
|
+
/** Attribute written on <html>. Defaults to `data-shk-theme`. */
|
|
21
|
+
attribute?: string;
|
|
22
|
+
/** Class toggled on <html> for dark mode. Defaults to `dark`. */
|
|
23
|
+
darkClass?: string;
|
|
24
|
+
}
|
|
25
|
+
type ResolvedShkThemeConfig = Required<ShkThemeConfig>;
|
|
26
|
+
export declare const SHK_THEMES: readonly ShkThemeName[];
|
|
27
|
+
export declare const DEFAULT_SHK_THEME_CONFIG: ResolvedShkThemeConfig;
|
|
28
|
+
export declare const SHK_THEME_CONFIG: InjectionToken<Required<ShkThemeConfig>>;
|
|
29
|
+
/**
|
|
30
|
+
* Configures the theme system and applies the stored/default theme while the
|
|
31
|
+
* app boots, so it is active even if nothing injects `ShkThemeService`.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* bootstrapApplication(App, {
|
|
35
|
+
* providers: [provideShkTheme({ defaultTheme: 'ocean', defaultScheme: 'dark' })],
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function provideShkTheme(config?: ShkThemeConfig): EnvironmentProviders;
|
|
40
|
+
/**
|
|
41
|
+
* Applies and persists the color theme.
|
|
42
|
+
*
|
|
43
|
+
* Themes are plain CSS custom properties, so switching a theme is just an
|
|
44
|
+
* attribute change on `<html>` — no component re-render involved.
|
|
45
|
+
*/
|
|
46
|
+
export declare class ShkThemeService {
|
|
47
|
+
private readonly doc;
|
|
48
|
+
private readonly config;
|
|
49
|
+
private readonly win;
|
|
50
|
+
/** Every theme name the service knows about. */
|
|
51
|
+
readonly availableThemes: readonly ShkThemeName[];
|
|
52
|
+
/** Currently active theme. */
|
|
53
|
+
readonly theme: import("@angular/core").WritableSignal<ShkThemeName>;
|
|
54
|
+
/** Currently selected scheme (`light`, `dark` or `system`). */
|
|
55
|
+
readonly scheme: import("@angular/core").WritableSignal<ShkColorScheme>;
|
|
56
|
+
/** `true` when dark colors are being applied. */
|
|
57
|
+
readonly isDark: import("@angular/core").WritableSignal<boolean>;
|
|
58
|
+
/** Convenience flag for templates. */
|
|
59
|
+
readonly isSystem: import("@angular/core").Signal<boolean>;
|
|
60
|
+
private mediaQuery?;
|
|
61
|
+
constructor();
|
|
62
|
+
/** Switches the active theme pack. */
|
|
63
|
+
setTheme(theme: ShkThemeName): void;
|
|
64
|
+
/** Selects light, dark or system scheme. */
|
|
65
|
+
setScheme(scheme: ShkColorScheme): void;
|
|
66
|
+
/** Flips between light and dark (leaves `system` on the opposite value). */
|
|
67
|
+
toggleDark(): void;
|
|
68
|
+
/** Applies a theme without persisting it (useful for previews). */
|
|
69
|
+
previewTheme(theme: ShkThemeName): void;
|
|
70
|
+
private restore;
|
|
71
|
+
private applyTheme;
|
|
72
|
+
private applyScheme;
|
|
73
|
+
private watchSystem;
|
|
74
|
+
private prefersDark;
|
|
75
|
+
private read;
|
|
76
|
+
private persist;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ShkThemeService, never>;
|
|
78
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
79
|
+
}
|
|
80
|
+
export type { ResolvedShkThemeConfig, ShkColorScheme, ShkThemeConfig, ShkThemeName };
|