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.
Files changed (98) hide show
  1. package/README.md +415 -42
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +189 -100
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +367 -73
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +206 -142
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +976 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +307 -142
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +1624 -1400
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +347 -92
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +484 -293
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +1141 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +395 -180
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +505 -128
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +311 -303
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +188 -142
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +517 -277
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +669 -289
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +1014 -814
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +508 -184
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +197 -57
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +1918 -1676
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +419 -177
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +177 -51
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +687 -369
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +466 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +147 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +791 -215
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +205 -128
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +244 -180
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +97 -125
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +673 -166
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/fesm2022/shirkasoft-ui-components.mjs +0 -9
  61. package/package.json +37 -7
  62. package/src/baseline.css +2472 -0
  63. package/src/theme.css +15 -543
  64. package/src/themes/ocean.css +56 -0
  65. package/src/themes/sunset.css +55 -0
  66. package/src/themes/violet.css +25 -0
  67. package/src/tokens.css +612 -0
  68. package/types/shirkasoft-ui-components-breadcrumb.d.ts +59 -44
  69. package/types/shirkasoft-ui-components-button.d.ts +142 -49
  70. package/types/shirkasoft-ui-components-chart.d.ts +59 -44
  71. package/types/shirkasoft-ui-components-config.d.ts +357 -0
  72. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +107 -65
  73. package/types/shirkasoft-ui-components-date-picker.d.ts +527 -373
  74. package/types/shirkasoft-ui-components-fieldset.d.ts +135 -59
  75. package/types/shirkasoft-ui-components-file-upload.d.ts +176 -106
  76. package/types/shirkasoft-ui-components-icons.d.ts +1430 -0
  77. package/types/shirkasoft-ui-components-knob.d.ts +151 -64
  78. package/types/shirkasoft-ui-components-loading.d.ts +155 -64
  79. package/types/shirkasoft-ui-components-modal.d.ts +134 -132
  80. package/types/shirkasoft-ui-components-notification.d.ts +63 -58
  81. package/types/shirkasoft-ui-components-price-input.d.ts +198 -85
  82. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +262 -142
  83. package/types/shirkasoft-ui-components-select.d.ts +301 -192
  84. package/types/shirkasoft-ui-components-sidebar.d.ts +198 -92
  85. package/types/shirkasoft-ui-components-skeleton.d.ts +68 -27
  86. package/types/shirkasoft-ui-components-table.d.ts +849 -649
  87. package/types/shirkasoft-ui-components-tabs.d.ts +102 -61
  88. package/types/shirkasoft-ui-components-tag.d.ts +54 -23
  89. package/types/shirkasoft-ui-components-text-field.d.ts +231 -111
  90. package/types/shirkasoft-ui-components-theme-picker.d.ts +117 -0
  91. package/types/shirkasoft-ui-components-theme.d.ts +80 -0
  92. package/types/shirkasoft-ui-components-timeline.d.ts +326 -150
  93. package/types/shirkasoft-ui-components-toggle.d.ts +76 -45
  94. package/types/shirkasoft-ui-components-tooltip.d.ts +64 -43
  95. package/types/shirkasoft-ui-components-utils.d.ts +26 -17
  96. package/types/shirkasoft-ui-components-wizard.d.ts +236 -86
  97. package/types/shirkasoft-ui-components.d.ts +1 -2
  98. package/fesm2022/shirkasoft-ui-components.mjs.map +0 -1
@@ -0,0 +1,357 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import * as i0 from "@angular/core";
5
+ import { EnvironmentProviders, InjectionToken, Provider, Signal } from "@angular/core";
6
+ import { ShkThemeConfig } from "shirkasoft-ui-components/theme";
7
+ /**
8
+ * Shirkasoft UI Components.
9
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
10
+ * Belongs to Shirkasoft.
11
+ */
12
+ /** Kind of value an option holds; drives validation and the editor a settings UI shows. */
13
+ type ShkOptionType = 'string' | 'number' | 'boolean' | 'select' | 'color';
14
+ /** One allowed value of a `select` option. */
15
+ interface ShkOptionChoice<T = unknown> {
16
+ value: T;
17
+ label: string;
18
+ }
19
+ /**
20
+ * Definition of a configurable option (an entry of the options registry).
21
+ *
22
+ * The library registers its own (`dates.*`, `numbers.*`, `theme.*`); apps add
23
+ * theirs with `withOptions([...])` or `ShkConfigService.register()`.
24
+ */
25
+ interface ShkOptionDef<T = unknown> {
26
+ /** Unique key, conventionally `module.name` (e.g. `dates.format`). */
27
+ key: string;
28
+ /** Group the option belongs to (e.g. `dates`); used to list options by module. */
29
+ module: string;
30
+ type: ShkOptionType;
31
+ /** Value used until the option is set (or after `reset`). */
32
+ default: T;
33
+ /** Human-readable name for a settings screen. */
34
+ label?: string;
35
+ /** Longer help text for a settings screen. */
36
+ description?: string;
37
+ /** Allowed values for `select` options. */
38
+ choices?: readonly ShkOptionChoice<T>[];
39
+ /**
40
+ * `select` options only: also accept values outside `choices` (the choices
41
+ * are then suggestions, e.g. any BCP 47 locale or ISO currency code).
42
+ */
43
+ allowCustom?: boolean;
44
+ /** Lower bound for `number` options. */
45
+ min?: number;
46
+ /** Upper bound for `number` options. */
47
+ max?: number;
48
+ /**
49
+ * Whether `withPersistence()` stores this option. Defaults to `true`.
50
+ * Options persisted elsewhere (e.g. the theme service) set it to `false`.
51
+ */
52
+ persist?: boolean;
53
+ }
54
+ /** An option as listed by `ShkConfigService.options()`: its definition plus its current value. */
55
+ interface ShkOptionEntry<T = unknown> extends ShkOptionDef<T> {
56
+ value: T;
57
+ /** True when the current value equals the default. */
58
+ isDefault: boolean;
59
+ }
60
+ /** How the date picker shows the selected date when the field is not being edited. */
61
+ type ShkDateDisplayStyle = 'long' | 'medium' | 'short' | 'format';
62
+ /** Values of the options the library registers, by key (gives typed `get`/`set`). */
63
+ interface ShkConfigValues {
64
+ /** BCP 47 locale for month/day names (e.g. `es`, `en-US`). */
65
+ 'dates.locale': string;
66
+ /**
67
+ * Date pattern (`dd/MM/yyyy`, `yyyy-MM-dd`, `d MMM yyyy`…). Empty = automatic:
68
+ * `MM/dd/yyyy` for English locales, `dd/MM/yyyy` otherwise.
69
+ */
70
+ 'dates.format': string;
71
+ 'dates.displayStyle': ShkDateDisplayStyle;
72
+ 'dates.hourFormat': '12' | '24';
73
+ /** First day of the week (0 = Sunday … 6 = Saturday); `null` = from the locale. */
74
+ 'dates.weekStart': number | null;
75
+ /** BCP 47 locale for number grouping/decimal separators. */
76
+ 'numbers.locale': string;
77
+ /** ISO 4217 currency code (e.g. `USD`, `EUR`, `CUP`). */
78
+ 'numbers.currency': string;
79
+ /** Symbol shown by money inputs. Empty = derived from the currency (`$`, `€`…). */
80
+ 'numbers.currencySymbol': string;
81
+ /** Decimal places for money amounts; `null` = the currency's own (2 for USD, 0 for JPY). */
82
+ 'numbers.decimals': number | null;
83
+ /** Active theme pack (built-in or registered with `withTheme({ themes })`). */
84
+ 'theme.name': string;
85
+ 'theme.scheme': 'light' | 'dark' | 'system';
86
+ /** Primary color override applied on top of the theme. Empty = the theme's own. */
87
+ 'theme.primary': string;
88
+ /** Neutral palette override (`slate`, `gray`, `zinc`, `neutral`, `stone`). Empty = the theme's own. */
89
+ 'theme.surface': string;
90
+ }
91
+ type ShkConfigKey = keyof ShkConfigValues;
92
+ /** What a `with*()` feature contributes to the registry. */
93
+ interface ShkConfigFeature {
94
+ /** Extra option definitions to register. */
95
+ options?: readonly ShkOptionDef[];
96
+ /** App-level defaults for registered options (what `reset` returns to). */
97
+ defaults?: Readonly<Record<string, unknown>>;
98
+ }
99
+ /** Features collected from `provideShk(...)`. */
100
+ export declare const SHK_CONFIG_FEATURES: InjectionToken<readonly ShkConfigFeature[]>;
101
+ /** Storage settings enabled by `withPersistence()`. */
102
+ interface ShkConfigPersistence {
103
+ /** localStorage key. Defaults to `shk-config`. */
104
+ storageKey: string;
105
+ }
106
+ export declare const SHK_CONFIG_PERSISTENCE: InjectionToken<ShkConfigPersistence>;
107
+ /**
108
+ * Value held outside the registry (e.g. by `ShkThemeService`). The registry
109
+ * reads and writes through it, so both stay in sync.
110
+ */
111
+ interface ShkOptionSource<T = unknown> {
112
+ value: Signal<T>;
113
+ set(value: T): void;
114
+ }
115
+ /**
116
+ * Registry of the library's configurable options ("nomenclador" de opciones).
117
+ *
118
+ * Every option has a key (`dates.format`), a module, a type and a default.
119
+ * Components read options as signals, so changing one at runtime updates every
120
+ * component that uses it. A settings screen can list them with `options()`.
121
+ *
122
+ * ```ts
123
+ * const config = inject(ShkConfigService);
124
+ * config.get('dates.format')(); // 'dd/MM/yyyy'
125
+ * config.set('numbers.currency', 'EUR'); // every price input/table updates
126
+ * config.options(); // definitions + current values
127
+ * ```
128
+ */
129
+ export declare class ShkConfigService {
130
+ private readonly win;
131
+ private readonly persistence;
132
+ /** Registered definitions, by key. */
133
+ private readonly defs;
134
+ /** Values set explicitly (anything else falls back to the definition's default). */
135
+ private readonly values;
136
+ /** Options whose value lives elsewhere. */
137
+ private readonly sources;
138
+ /** Stored values whose option is not registered yet; applied on `register`. */
139
+ private pending;
140
+ /** Cached per-key signals returned by `get`. */
141
+ private readonly cache;
142
+ /** Every registered option with its current value, in registration order. */
143
+ readonly options: Signal<ShkOptionEntry[]>;
144
+ /** Module names in registration order (`dates`, `numbers`, `theme`, …). */
145
+ readonly modules: Signal<string[]>;
146
+ constructor();
147
+ /** Current value of an option as a signal. Throws for unknown keys. */
148
+ get<K extends ShkConfigKey>(key: K): Signal<ShkConfigValues[K]>;
149
+ get<T = unknown>(key: string): Signal<T>;
150
+ /** Whether an option is registered (e.g. `theme.*` only exists with `withTheme()`). */
151
+ has(key: string): boolean;
152
+ /** Current value of an option (non-reactive read). */
153
+ value<K extends ShkConfigKey>(key: K): ShkConfigValues[K];
154
+ value<T = unknown>(key: string): T;
155
+ /**
156
+ * Sets an option. The value is validated against the definition (type,
157
+ * choices, bounds); an invalid value throws and changes nothing.
158
+ */
159
+ set<K extends ShkConfigKey>(key: K, value: ShkConfigValues[K]): void;
160
+ set(key: string, value: unknown): void;
161
+ /** Restores one option (or all of them) to its default. */
162
+ reset(key?: string): void;
163
+ /**
164
+ * Adds option definitions (or replaces existing ones with the same key).
165
+ * Stored values for them are applied if they are still valid.
166
+ */
167
+ register(defs: readonly ShkOptionDef[]): void;
168
+ /**
169
+ * Binds an option to a value held elsewhere (used by `withTheme()` to share
170
+ * `theme.name`/`theme.scheme` with `ShkThemeService`).
171
+ */
172
+ bind<T>(key: string, source: ShkOptionSource<T>): void;
173
+ /** Changes the defaults of registered options (`reset` returns to these). */
174
+ private setDefaults;
175
+ private read;
176
+ private requireDef;
177
+ /** Returns the value coerced to the option's type, or throws if it is not acceptable. */
178
+ private validate;
179
+ private loadStored;
180
+ private save;
181
+ static ɵfac: i0.ɵɵFactoryDeclaration<ShkConfigService, never>;
182
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
183
+ }
184
+ /**
185
+ * Shirkasoft UI Components.
186
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
187
+ * Belongs to Shirkasoft.
188
+ *
189
+ * Builds the `--shk-primary-*` scale from a single color with CSS `color-mix()`,
190
+ * so the browser derives every shade and no color math ships in JavaScript.
191
+ */
192
+ /** A theme registered with `withTheme({ themes })`. */
193
+ interface ShkCustomTheme {
194
+ /** Main brand color (hex). It becomes `--shk-primary-600`, the shade buttons use. */
195
+ primary: string;
196
+ /** Name shown in settings screens. Defaults to the theme key. */
197
+ label?: string;
198
+ /** Extra CSS custom properties for the theme, e.g. `{ '--shk-surface-50': '#f8fafc' }`. */
199
+ vars?: Readonly<Record<`--shk-${string}`, string>>;
200
+ }
201
+ /** `--shk-primary-50` … `--shk-primary-950` (and the accent vars) derived from one color. */
202
+ export declare function primaryScale(color: string): Record<string, string>;
203
+ /** Neutral palettes for `theme.surface` (Tailwind scales, 50 … 900). */
204
+ export declare const SURFACE_PALETTES: Readonly<Record<string, {
205
+ label: string;
206
+ scale: readonly string[];
207
+ }>>;
208
+ /** A selectable combination shown as a preset: a theme pack and its colors. */
209
+ interface ShkThemePreset {
210
+ /** Theme name (`theme.name`). */
211
+ name: string;
212
+ label: string;
213
+ /** Its primary color (`--shk-primary-600`). */
214
+ primary: string;
215
+ /** Its surface palette (a `SURFACE_PALETTES` key), or '' when it has its own. */
216
+ surface: string;
217
+ }
218
+ /** The built-in theme packs as presets. */
219
+ export declare const BUILT_IN_PRESETS: readonly ShkThemePreset[];
220
+ /**
221
+ * Theme packs offered as presets (built-in + `withTheme({ themes })`), with the
222
+ * primary color and surface each one uses. Read by `shk-theme-picker`.
223
+ */
224
+ export declare const SHK_THEME_PRESETS: InjectionToken<readonly ShkThemePreset[]>;
225
+ /** A configuration module passed to `provideShk()`. */
226
+ interface ShkFeature {
227
+ /** @internal */
228
+ readonly ɵproviders: (Provider | EnvironmentProviders)[];
229
+ }
230
+ /**
231
+ * Configures the library. Every module is optional; component inputs still
232
+ * override the configured values.
233
+ *
234
+ * ```ts
235
+ * bootstrapApplication(App, {
236
+ * providers: [
237
+ * provideShk(
238
+ * withDates({ locale: 'es', format: 'dd/MM/yyyy' }),
239
+ * withNumbers({ currency: 'EUR', locale: 'es-ES' }),
240
+ * withTheme({ defaultTheme: 'marca', themes: { marca: '#2563eb' } }),
241
+ * withPersistence(),
242
+ * ),
243
+ * ],
244
+ * });
245
+ * ```
246
+ */
247
+ export declare function provideShk(...features: ShkFeature[]): EnvironmentProviders;
248
+ /** App defaults for the date options (`dates.*`). */
249
+ interface ShkDatesConfig {
250
+ locale?: ShkConfigValues['dates.locale'];
251
+ format?: ShkConfigValues['dates.format'];
252
+ displayStyle?: ShkConfigValues['dates.displayStyle'];
253
+ hourFormat?: ShkConfigValues['dates.hourFormat'];
254
+ weekStart?: ShkConfigValues['dates.weekStart'];
255
+ }
256
+ /** Date module: locale, pattern, display style, 12/24 h and first day of the week. */
257
+ export declare function withDates(config: ShkDatesConfig): ShkFeature;
258
+ /** App defaults for the number and currency options (`numbers.*`). */
259
+ interface ShkNumbersConfig {
260
+ locale?: ShkConfigValues['numbers.locale'];
261
+ currency?: ShkConfigValues['numbers.currency'];
262
+ currencySymbol?: ShkConfigValues['numbers.currencySymbol'];
263
+ decimals?: ShkConfigValues['numbers.decimals'];
264
+ }
265
+ /** Number module: separators locale, currency, currency symbol and decimals. */
266
+ export declare function withNumbers(config: ShkNumbersConfig): ShkFeature;
267
+ /** Theme module settings. */
268
+ interface ShkThemeModuleConfig extends ShkThemeConfig {
269
+ /**
270
+ * Extra themes generated from one color: `{ marca: '#2563eb' }` or
271
+ * `{ marca: { primary: '#2563eb', label: 'Marca', vars: { … } } }`.
272
+ */
273
+ themes?: Readonly<Record<string, string | ShkCustomTheme>>;
274
+ /** Primary color applied on top of any theme (`theme.primary`). Empty = none. */
275
+ primary?: string;
276
+ /** Neutral palette applied on top of any theme (`theme.surface`). Empty = none. */
277
+ surface?: string;
278
+ }
279
+ /**
280
+ * Theme module: built-in and custom themes, light/dark/system scheme and a
281
+ * runtime primary color. Replaces `provideShkTheme()` (do not use both).
282
+ *
283
+ * `theme.name` and `theme.scheme` are shared with `ShkThemeService` (which
284
+ * persists them); `theme.primary` is stored by `withPersistence()`.
285
+ */
286
+ export declare function withTheme(config?: ShkThemeModuleConfig): ShkFeature;
287
+ /** Registers app-defined options in the same registry (`app.pageSize`, …). */
288
+ export declare function withOptions(options: readonly ShkOptionDef[]): ShkFeature;
289
+ /**
290
+ * Persists changed options in localStorage so they survive reloads.
291
+ * Options with `persist: false` are skipped (the theme service stores its own).
292
+ */
293
+ export declare function withPersistence(config?: {
294
+ storageKey?: string;
295
+ }): ShkFeature;
296
+ /** Date options (`dates.*`), always registered. */
297
+ export declare const DATE_OPTIONS: readonly ShkOptionDef[];
298
+ /** Number and currency options (`numbers.*`), always registered. */
299
+ export declare const NUMBER_OPTIONS: readonly ShkOptionDef[];
300
+ /**
301
+ * Shirkasoft UI Components.
302
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
303
+ * Belongs to Shirkasoft.
304
+ *
305
+ * Locale-aware formatting helpers used by the components and available to apps.
306
+ * Pure functions on top of `Intl`: no Angular locale data needs registering.
307
+ */
308
+ /** Default numeric pattern for a locale: `MM/dd/yyyy` for English, `dd/MM/yyyy` otherwise. */
309
+ export declare function resolveDateFormat(format: string | null | undefined, locale: string): string;
310
+ /** Converts a value to a `Date`. ISO date-only strings (`2026-12-31`) are read as local dates. */
311
+ export declare function toDate(value: Date | string | number | null | undefined): Date | null;
312
+ /**
313
+ * Formats a date with a pattern (`dd/MM/yyyy`, `d MMM yyyy`, `yyyy-MM-dd HH:mm`…).
314
+ *
315
+ * Tokens: `yyyy y yy` year · `MMMM MMM MM M` month · `dd d` day · `EEEE EEE` weekday ·
316
+ * `HH H` 0-23 · `hh h` 1-12 · `mm` minutes · `ss` seconds · `a` AM/PM ·
317
+ * `'text'` literal. Month and weekday names follow `locale`, with its own casing
318
+ * ("31 dic 2026" in Spanish, "Dec 31, 2026" in English).
319
+ * Returns an empty string for empty or invalid values.
320
+ */
321
+ export declare function formatDate(value: Date | string | number | null | undefined, pattern: string, locale: string): string;
322
+ /** An `Intl` date (and optional time) style. */
323
+ type ShkIntlStyle = 'full' | 'long' | 'medium' | 'short';
324
+ /**
325
+ * Date formatted with an `Intl` style (`long`: "31 de diciembre de 2026"),
326
+ * optionally followed by the time in `timeStyle`.
327
+ */
328
+ export declare function formatDateStyle(value: Date | string | number | null | undefined, style: ShkIntlStyle, locale: string, timeStyle?: ShkIntlStyle): string;
329
+ /** A pattern reduced to the parts a user types: field order and separator. */
330
+ interface TypedDateLayout {
331
+ /** Order of day/month/year in the pattern. */
332
+ order: readonly ('d' | 'm' | 'y')[];
333
+ /** Separator between the parts (`/`, `-` or `.`). */
334
+ separator: string;
335
+ }
336
+ /**
337
+ * Field order and separator of a pattern, for typing dates in an input.
338
+ * Named months and weekdays are typed as numbers (`d MMM yyyy` → `dd/MM/yyyy`).
339
+ */
340
+ export declare function typedDateLayout(pattern: string): TypedDateLayout;
341
+ /** Narrow currency symbol (`USD` → `$`, `EUR` → `€`). Unknown codes are returned as-is. */
342
+ export declare function currencySymbol(currency: string, locale: string): string;
343
+ /**
344
+ * Formats an amount as money (`$1,234.50`, `1.234,50 €`, `¥1,000`).
345
+ * `decimals` `null`/omitted = the currency's own digits (2 for USD, 0 for JPY).
346
+ */
347
+ export declare function formatCurrency(value: number | string | null | undefined, currency: string, locale: string, decimals?: number | null): string;
348
+ /** Decimal digits a currency uses by default (USD → 2, JPY → 0, BHD → 3). Unknown codes → 2. */
349
+ export declare function currencyDecimals(currency: string): number;
350
+ /** Formats a number with the locale's grouping and decimal separators. */
351
+ export declare function formatNumber(value: number, locale: string, maxDecimals?: number, minDecimals?: number): string;
352
+ /** Decimal and grouping separators of a locale (`es-ES` → `,` and `.`). */
353
+ export declare function numberSeparators(locale: string): {
354
+ decimal: string;
355
+ group: string;
356
+ };
357
+ export type { ShkConfigFeature, ShkConfigKey, ShkConfigPersistence, ShkConfigValues, ShkCustomTheme, ShkDateDisplayStyle, ShkDatesConfig, ShkFeature, ShkIntlStyle, ShkNumbersConfig, ShkOptionChoice, ShkOptionDef, ShkOptionEntry, ShkOptionSource, ShkOptionType, ShkThemeModuleConfig, ShkThemePreset, TypedDateLayout };
@@ -1,6 +1,8 @@
1
- import * as _angular_core from '@angular/core';
2
- import { OnDestroy } from '@angular/core';
3
-
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import * as i0 from "@angular/core";
5
+ import { OnDestroy } from "@angular/core";
4
6
  /**
5
7
  * Shirkasoft UI Components.
6
8
  * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
@@ -10,42 +12,84 @@ import { OnDestroy } from '@angular/core';
10
12
  * Confirmation dialog opened via `show()` which resolves a Promise<boolean>
11
13
  * with the user's choice.
12
14
  */
13
- declare class ConfirmDialogComponent implements OnDestroy {
14
- protected getIcon: (name: any) => any;
15
- /** Title shown in the dialog header. */
16
- title: _angular_core.InputSignal<string>;
17
- /** Message body of the dialog. */
18
- message: _angular_core.InputSignal<string>;
19
- /** Label of the confirm button. */
20
- confirmLabel: _angular_core.InputSignal<string>;
21
- /** Label of the cancel button. */
22
- cancelLabel: _angular_core.InputSignal<string>;
23
- /** Text shown on the confirm button while `loading` is true. */
24
- loadingText: _angular_core.InputSignal<string>;
25
- /** Visual style: 'danger', 'info' or 'warning'. */
26
- type: _angular_core.InputSignal<"danger" | "info" | "warning">;
27
- /** Shows a spinner and disables the confirm button. */
28
- loading: _angular_core.InputSignal<boolean>;
29
- /** Whether the cancel button is shown. */
30
- showCancel: _angular_core.InputSignal<boolean>;
31
- /** Controls dialog visibility. */
32
- visible: _angular_core.WritableSignal<boolean>;
33
- /** Resolver of the currently pending confirmation promise. */
34
- private resolveRef;
35
- /** Emitted whenever the dialog is closed (confirm or cancel). */
36
- closed: _angular_core.OutputEmitterRef<void>;
37
- /** Opens the dialog and returns a promise resolving with the user choice. */
38
- show(): Promise<boolean>;
39
- /** Resolves with `true` when the user confirms. */
40
- onConfirm(): void;
41
- /** Resolves with `false` when the user cancels. */
42
- onCancel(): void;
43
- /** Clears the pending resolver on destroy. */
44
- ngOnDestroy(): void;
45
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
46
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmDialogComponent, "shk-confirm-dialog", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; "isSignal": true; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showCancel": { "alias": "showCancel"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
15
+ export declare class ConfirmDialogComponent implements OnDestroy {
16
+ protected getIcon: (name: any) => import("shirkasoft-ui-components/icons").IconNode | null;
17
+ /** Title shown in the dialog header. */
18
+ title: import("@angular/core").InputSignal<string>;
19
+ /** Message body of the dialog. */
20
+ message: import("@angular/core").InputSignal<string>;
21
+ /** Label of the confirm button. */
22
+ confirmLabel: import("@angular/core").InputSignal<string>;
23
+ /** Label of the cancel button. */
24
+ cancelLabel: import("@angular/core").InputSignal<string>;
25
+ /** Text shown on the confirm button while `loading` is true. */
26
+ loadingText: import("@angular/core").InputSignal<string>;
27
+ /** Visual style: 'danger', 'info' or 'warning'. */
28
+ type: import("@angular/core").InputSignal<"danger" | "info" | "warning">;
29
+ /** Shows a spinner and disables the confirm button. */
30
+ loading: import("@angular/core").InputSignal<boolean>;
31
+ /** Whether the cancel button is shown. */
32
+ showCancel: import("@angular/core").InputSignal<boolean>;
33
+ /** Controls dialog visibility. */
34
+ visible: import("@angular/core").WritableSignal<boolean>;
35
+ /** Resolver of the currently pending confirmation promise. */
36
+ private resolveRef;
37
+ /** Emitted whenever the dialog is closed (confirm or cancel). */
38
+ closed: import("@angular/core").OutputEmitterRef<void>;
39
+ /** Opens the dialog and returns a promise resolving with the user choice. */
40
+ show(): Promise<boolean>;
41
+ /** Resolves with `true` when the user confirms. */
42
+ onConfirm(): void;
43
+ /** Resolves with `false` when the user cancels. */
44
+ onCancel(): void;
45
+ /** Clears the pending resolver on destroy. */
46
+ ngOnDestroy(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "shk-confirm-dialog", never, {
49
+ "title": {
50
+ "alias": "title";
51
+ "required": false;
52
+ "isSignal": true;
53
+ };
54
+ "message": {
55
+ "alias": "message";
56
+ "required": false;
57
+ "isSignal": true;
58
+ };
59
+ "confirmLabel": {
60
+ "alias": "confirmLabel";
61
+ "required": false;
62
+ "isSignal": true;
63
+ };
64
+ "cancelLabel": {
65
+ "alias": "cancelLabel";
66
+ "required": false;
67
+ "isSignal": true;
68
+ };
69
+ "loadingText": {
70
+ "alias": "loadingText";
71
+ "required": false;
72
+ "isSignal": true;
73
+ };
74
+ "type": {
75
+ "alias": "type";
76
+ "required": false;
77
+ "isSignal": true;
78
+ };
79
+ "loading": {
80
+ "alias": "loading";
81
+ "required": false;
82
+ "isSignal": true;
83
+ };
84
+ "showCancel": {
85
+ "alias": "showCancel";
86
+ "required": false;
87
+ "isSignal": true;
88
+ };
89
+ }, {
90
+ "closed": "closed";
91
+ }, never, never, true, never>;
47
92
  }
48
-
49
93
  /**
50
94
  * Shirkasoft UI Components.
51
95
  * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
@@ -53,36 +97,34 @@ declare class ConfirmDialogComponent implements OnDestroy {
53
97
  */
54
98
  /** Options for opening a confirmation dialog. */
55
99
  interface ConfirmConfig {
56
- title?: string;
57
- message: string;
58
- confirmLabel?: string;
59
- cancelLabel?: string;
60
- loadingText?: string;
61
- type?: 'danger' | 'info' | 'warning';
62
- showCancel?: boolean;
63
- loading?: boolean;
100
+ title?: string;
101
+ message: string;
102
+ confirmLabel?: string;
103
+ cancelLabel?: string;
104
+ loadingText?: string;
105
+ type?: 'danger' | 'info' | 'warning';
106
+ showCancel?: boolean;
107
+ loading?: boolean;
64
108
  }
65
109
  /**
66
110
  * Programmatically opens the confirmation dialog and resolves a Promise
67
111
  * with the user's decision (true = confirm, false = cancel).
68
112
  */
69
- declare class ConfirmDialogService {
70
- /** Reference to the currently open dialog, if any. */
71
- private dialogRef;
72
- private destroyRef;
73
- private appRef;
74
- private injector;
75
- constructor();
76
- /**
77
- * Opens a confirmation dialog with the given configuration and returns a
78
- * promise resolving with the user's choice.
79
- */
80
- confirm(config: ConfirmConfig): Promise<boolean>;
81
- /** Detaches and destroys the mounted dialog if present. */
82
- private cleanupDialog;
83
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmDialogService, never>;
84
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<ConfirmDialogService>;
113
+ export declare class ConfirmDialogService {
114
+ /** Reference to the currently open dialog, if any. */
115
+ private dialogRef;
116
+ private destroyRef;
117
+ private appRef;
118
+ private injector;
119
+ constructor();
120
+ /**
121
+ * Opens a confirmation dialog with the given configuration and returns a
122
+ * promise resolving with the user's choice.
123
+ */
124
+ confirm(config: ConfirmConfig): Promise<boolean>;
125
+ /** Detaches and destroys the mounted dialog if present. */
126
+ private cleanupDialog;
127
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogService, never>;
128
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
85
129
  }
86
-
87
- export { ConfirmDialogComponent, ConfirmDialogService };
88
- export type { ConfirmConfig };
130
+ export type { ConfirmConfig };