shirkasoft-ui-components 1.3.14 → 1.4.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 (90) hide show
  1. package/README.md +447 -67
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +7 -7
  3. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -1
  4. package/fesm2022/shirkasoft-ui-components-button.mjs +11 -11
  5. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs +6 -6
  7. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -1
  8. package/fesm2022/shirkasoft-ui-components-config.mjs +914 -0
  9. package/fesm2022/shirkasoft-ui-components-config.mjs.map +1 -0
  10. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +8 -8
  11. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
  12. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +901 -753
  13. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
  14. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +5 -5
  15. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -1
  16. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +16 -9
  17. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -1
  18. package/fesm2022/shirkasoft-ui-components-icons.mjs +646 -0
  19. package/fesm2022/shirkasoft-ui-components-icons.mjs.map +1 -0
  20. package/fesm2022/shirkasoft-ui-components-knob.mjs +44 -17
  21. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -1
  22. package/fesm2022/shirkasoft-ui-components-loading.mjs +16 -16
  23. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
  24. package/fesm2022/shirkasoft-ui-components-modal.mjs +42 -31
  25. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
  26. package/fesm2022/shirkasoft-ui-components-notification.mjs +8 -8
  27. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
  28. package/fesm2022/shirkasoft-ui-components-price-input.mjs +79 -29
  29. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
  30. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +7 -7
  31. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -1
  32. package/fesm2022/shirkasoft-ui-components-select.mjs +50 -23
  33. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
  34. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +6 -6
  35. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -1
  36. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +4 -4
  37. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -1
  38. package/fesm2022/shirkasoft-ui-components-table.mjs +165 -111
  39. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
  40. package/fesm2022/shirkasoft-ui-components-tabs.mjs +21 -23
  41. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
  42. package/fesm2022/shirkasoft-ui-components-tag.mjs +9 -9
  43. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
  44. package/fesm2022/shirkasoft-ui-components-text-field.mjs +63 -30
  45. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
  46. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs +280 -0
  47. package/fesm2022/shirkasoft-ui-components-theme-picker.mjs.map +1 -0
  48. package/fesm2022/shirkasoft-ui-components-theme.mjs +180 -0
  49. package/fesm2022/shirkasoft-ui-components-theme.mjs.map +1 -0
  50. package/fesm2022/shirkasoft-ui-components-timeline.mjs +10 -22
  51. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -1
  52. package/fesm2022/shirkasoft-ui-components-toggle.mjs +60 -53
  53. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
  54. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +29 -11
  55. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -1
  56. package/fesm2022/shirkasoft-ui-components-utils.mjs +22 -11
  57. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -1
  58. package/fesm2022/shirkasoft-ui-components-wizard.mjs +9 -10
  59. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -1
  60. package/package.json +33 -3
  61. package/src/baseline.css +2472 -0
  62. package/src/theme.css +15 -543
  63. package/src/themes/ocean.css +56 -0
  64. package/src/themes/sunset.css +55 -0
  65. package/src/themes/violet.css +25 -0
  66. package/src/tokens.css +612 -0
  67. package/types/shirkasoft-ui-components-button.d.ts +1 -1
  68. package/types/shirkasoft-ui-components-config.d.ts +368 -0
  69. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +2 -1
  70. package/types/shirkasoft-ui-components-date-picker.d.ts +276 -224
  71. package/types/shirkasoft-ui-components-fieldset.d.ts +2 -1
  72. package/types/shirkasoft-ui-components-file-upload.d.ts +11 -5
  73. package/types/shirkasoft-ui-components-icons.d.ts +1422 -0
  74. package/types/shirkasoft-ui-components-knob.d.ts +28 -7
  75. package/types/shirkasoft-ui-components-modal.d.ts +11 -7
  76. package/types/shirkasoft-ui-components-notification.d.ts +2 -1
  77. package/types/shirkasoft-ui-components-price-input.d.ts +37 -9
  78. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +3 -3
  79. package/types/shirkasoft-ui-components-select.d.ts +24 -8
  80. package/types/shirkasoft-ui-components-sidebar.d.ts +2 -1
  81. package/types/shirkasoft-ui-components-table.d.ts +91 -77
  82. package/types/shirkasoft-ui-components-tag.d.ts +1 -1
  83. package/types/shirkasoft-ui-components-text-field.d.ts +29 -13
  84. package/types/shirkasoft-ui-components-theme-picker.d.ts +83 -0
  85. package/types/shirkasoft-ui-components-theme.d.ts +88 -0
  86. package/types/shirkasoft-ui-components-timeline.d.ts +5 -4
  87. package/types/shirkasoft-ui-components-toggle.d.ts +20 -13
  88. package/types/shirkasoft-ui-components-tooltip.d.ts +6 -0
  89. package/types/shirkasoft-ui-components-utils.d.ts +16 -6
  90. package/types/shirkasoft-ui-components-wizard.d.ts +4 -3
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { LucideFunnelX, LucideCircleCheck, LucideCircleX, LucideTrash2, LucideCircleAlert } from '@lucide/angular';
2
+ import * as shirkasoft_ui_components_icons from 'shirkasoft-ui-components/icons';
3
3
  import { TagSeverity } from 'shirkasoft-ui-components/tag';
4
4
 
5
5
  /** Match modes available in the column filter menu. */
@@ -76,17 +76,13 @@ interface Column {
76
76
  */
77
77
  template?: 'text' | 'tag' | 'progress' | 'boolean' | 'date' | 'currency';
78
78
  /**
79
- * Marks the field as mandatory: with the table's `validateRequired`, rows
80
- * where it is empty are highlighted and the cell shows a warning.
79
+ * Date pattern for `template: 'date'` ('dd/MM/yyyy', 'MMM d, y', 'yyyy-MM-dd HH:mm'…)
80
+ * or an Angular named format ('shortDate', 'mediumDate', 'longDate', 'fullDate',
81
+ * 'short', 'medium', 'long', 'full').
82
+ * Default: the `dates.format` option (automatic by locale: 'dd/MM/yyyy' for 'es').
81
83
  */
82
- required?: boolean;
83
- /** Text shown in an empty required cell (default "Falta <header>"). */
84
- missingMessage?: string;
85
- /** Custom rule to decide whether the value is missing (default: empty value). */
86
- isMissing?: (row: any) => boolean;
87
- /** Angular date format for `template: 'date'` (default `'dd/MM/yyyy'`). */
88
84
  dateFormat?: string;
89
- /** ISO currency code for `template: 'currency'` (default `'USD'`). */
85
+ /** ISO currency code for `template: 'currency'`. Default: the `numbers.currency` option ('USD'). */
90
86
  currency?: string;
91
87
  /** Image (avatar, flag...) rendered before the text of the cell. */
92
88
  image?: (row: any) => string | undefined;
@@ -139,22 +135,38 @@ interface FilterChangeEvent {
139
135
  [key: string]: ColumnFilterState;
140
136
  };
141
137
  }
142
- /** Mandatory field that isn't shown as a column (see `requiredFields`). */
143
- interface RequiredField {
144
- /** Row property (dot paths allowed). */
145
- field: string;
146
- /** Name shown in the messages (defaults to `field`). */
147
- label?: string;
148
- /** Custom rule (default: null/undefined/blank text/empty array). */
149
- isMissing?: (row: any) => boolean;
138
+ /** Severity of a row problem: informational (blue), warning (amber) or blocking (red). */
139
+ type RowSeverity = 'low' | 'moderate' | 'critical';
140
+ /**
141
+ * Rule applied to one field of the payload. The key of the
142
+ * `rowValidations` map is the field (dot paths allowed), so the rule only
143
+ * needs to say when the value is a problem and how severe it is.
144
+ */
145
+ interface RowValidation {
146
+ /**
147
+ * Condition over the field value and the whole row. Return `true` when the
148
+ * row has a problem in that field.
149
+ *
150
+ * @example (value) => value == null || Number(value) <= 0
151
+ * @example (value, row) => !row.factura_id && !value
152
+ */
153
+ condition: (value: any, row: any) => boolean;
154
+ /** Color of the row: `low` blue, `moderate` amber, `critical` red. The worst one wins. */
155
+ severity: RowSeverity;
156
+ /**
157
+ * Message of the violation: a translation key (Transloco) or literal text.
158
+ * When the key isn't translated, the literal is used as is.
159
+ */
160
+ message?: string;
161
+ /** Values interpolated into `message` (`{{name}}`), resolved per row. */
162
+ messageParams?: (value: any, row: any) => Record<string, unknown>;
150
163
  }
151
- /** A required column or required field, as checked by the validation. */
152
- interface MissingRequirement {
164
+ /** A violation found by `rowValidations`, with its message already translated. */
165
+ interface RowViolation {
166
+ /** Field of the payload that failed (the key of `rowValidations`). */
153
167
  field: string;
154
- header: string;
155
- isMissing?: (row: any) => boolean;
156
- /** The column, when the requirement comes from a `required` column. */
157
- column?: Column;
168
+ severity: RowSeverity;
169
+ message?: string;
158
170
  }
159
171
  /** Internal filter kind (`exact` is a `text` filter). */
160
172
  type FilterKind = 'text' | 'numeric' | 'date' | 'select' | 'multiselect' | 'boolean' | 'range';
@@ -168,17 +180,21 @@ declare class TableComponent {
168
180
  protected readonly uid: string;
169
181
  private cdr;
170
182
  private transloco;
183
+ /** Library-wide options: default date pattern, locale and currency of the cells. */
184
+ private readonly config;
171
185
  private destroyRef;
172
186
  private injector;
173
- /** Maps icon names to lucide components, falling back to a plus icon. */
174
- protected getIcon: (name: any) => any;
187
+ /** Maps icon names to SVG data, falling back to a plus icon. */
188
+ protected getIcon: (name: any) => shirkasoft_ui_components_icons.IconNode | null;
175
189
  /** Icons used directly by the template (not part of the central map). */
176
190
  protected readonly icons: {
177
- clear: typeof LucideFunnelX;
178
- yes: typeof LucideCircleCheck;
179
- no: typeof LucideCircleX;
180
- trash: typeof LucideTrash2;
181
- error: typeof LucideCircleAlert;
191
+ clear: shirkasoft_ui_components_icons.IconNode;
192
+ yes: shirkasoft_ui_components_icons.IconNode;
193
+ no: shirkasoft_ui_components_icons.IconNode;
194
+ trash: shirkasoft_ui_components_icons.IconNode;
195
+ low: shirkasoft_ui_components_icons.IconNode;
196
+ moderate: shirkasoft_ui_components_icons.IconNode;
197
+ critical: shirkasoft_ui_components_icons.IconNode;
182
198
  };
183
199
  /**
184
200
  * Minimum width applied to each column (except `actions`, which keeps its
@@ -251,21 +267,12 @@ declare class TableComponent {
251
267
  */
252
268
  resizableColumns: _angular_core.InputSignal<boolean>;
253
269
  /**
254
- * Highlights rows where a `required` column is empty: warning row, an icon
255
- * listing the missing fields and a "Falta …" text in the empty cell.
270
+ * Rules to flag rows with problems, keyed by field of the payload. Each rule
271
+ * applies a condition to the value of that field and paints the whole row:
272
+ * `low` blue, `moderate` amber, `critical` red. When a row has several
273
+ * issues the worst severity wins. See `RowValidation`.
256
274
  */
257
- validateRequired: _angular_core.InputSignal<boolean>;
258
- /**
259
- * With `validateRequired`, incomplete rows are shown as errors (red). Set it
260
- * to false to show them as warnings (amber) instead.
261
- */
262
- missingAsError: _angular_core.InputSignal<boolean>;
263
- /**
264
- * Mandatory fields that aren't table columns (e.g. `['telefono']` or
265
- * `[{ field: 'telefono', label: 'Teléfono' }]`). With `validateRequired`
266
- * they flag the row like `required` columns, and `validateRow` checks them.
267
- */
268
- requiredFields: _angular_core.InputSignal<(string | RequiredField)[]>;
275
+ rowValidations: _angular_core.InputSignal<Record<string, RowValidation>>;
269
276
  /**
270
277
  * Column widths (px) keyed by field. Two-way bindable via
271
278
  * `[(columnWidths)]` to restore/save them yourself.
@@ -295,6 +302,12 @@ declare class TableComponent {
295
302
  dataKey: _angular_core.InputSignal<string>;
296
303
  /** Optional predicate to disable the checkbox of specific rows. */
297
304
  isRowSelectable: _angular_core.InputSignal<((row: any) => boolean) | undefined>;
305
+ /**
306
+ * With `selectable`, clicking anywhere on a row toggles its selection (not
307
+ * only the checkbox). Clicks on buttons, links and form controls inside the
308
+ * row (row actions, custom templates) are ignored.
309
+ */
310
+ selectOnRowClick: _angular_core.InputSignal<boolean>;
298
311
  /** Actions shown in the header while at least one row is selected. */
299
312
  bulkActions: _angular_core.InputSignal<BulkAction[]>;
300
313
  /** Selected rows. Supports two-way binding via `[(selection)]`. */
@@ -372,38 +385,33 @@ declare class TableComponent {
372
385
  visibleBulkActions: _angular_core.Signal<BulkAction[]>;
373
386
  /** Number of rendered columns, including the selection column. */
374
387
  totalColspan: _angular_core.Signal<number>;
375
- /** Every requirement (required columns + `requiredFields`), active or not. */
376
- private allRequirements;
377
- /** Requirements checked on screen (empty when `validateRequired` is off). */
378
- private activeRequirements;
379
- /** Whether a value counts as missing: null, undefined, blank text or empty array. */
380
- private isEmptyValue;
381
- private requirementMissing;
382
- /** Missing requirements of each displayed row (cached per render). */
383
- private missingByRow;
384
- /** Required columns / fields that are empty in the row. */
385
- missingFields(row: any): MissingRequirement[];
386
- /** Whether a cell is a required column without value. */
387
- isCellMissing(col: Column, row: any): boolean;
388
+ /** Rank used to pick the worst severity of a row. */
389
+ private readonly severityRank;
390
+ /** Violations of each displayed row (cached per render, re-evaluated on i18n changes). */
391
+ private violationsByRow;
392
+ /** Evaluates the rules against a row and returns its violations (messages already translated). */
393
+ private collectViolations;
394
+ /** Message of a rule: translated when `message` is a registered key, literal otherwise. */
395
+ private resolveViolationMessage;
396
+ /** Violations of a row (empty when it has no issues). */
397
+ rowViolationsOf(row: any): RowViolation[];
388
398
  /**
389
- * Number of rows with missing data in the whole dataset (client mode) or in
390
- * the current page (server mode).
399
+ * Highest severity of a row: `'critical'` > `'moderate'` > `'low'`, or `null`
400
+ * when the row has no issues.
391
401
  */
392
- missingRowsCount: _angular_core.Signal<number>;
402
+ rowSeverity(row: any): RowSeverity | null;
393
403
  /**
394
- * Checks an object (e.g. the payload returned by a modal) against the
395
- * `required` columns and the `requiredFields`, returning what it's missing
396
- * (empty = complete). Works even when `validateRequired` is off, so it can
397
- * be used before adding the row.
404
+ * Checks any object (e.g. the payload of a modal) against `rowValidations`,
405
+ * returning its violations (empty = no issues). The row doesn't need to be
406
+ * displayed, so it can be used before adding it.
398
407
  */
399
- validateRow(row: any): {
400
- field: string;
401
- header: string;
402
- }[];
403
- /** Icon of the missing data marks: error circle or warning triangle. */
404
- protected missingIcon(): any;
405
- protected missingCellMessage(col: Column): string;
406
- protected missingRowMessage(missing: MissingRequirement[]): string;
408
+ validateRow(row: any): RowViolation[];
409
+ /** Tooltip of a row: its violation messages, one per line. */
410
+ protected rowValidationTitle(row: any): string | null;
411
+ /** Icon of the severity indicator shown in the actions cell. */
412
+ protected rowValidationIcon(row: any): any;
413
+ /** Accessible label of the severity indicator (the messages, or the severity). */
414
+ protected rowValidationLabel(row: any): string;
407
415
  /** Total records: server-provided in server mode, locally computed otherwise. */
408
416
  effectiveTotalRecords: _angular_core.Signal<number>;
409
417
  /**
@@ -487,6 +495,8 @@ declare class TableComponent {
487
495
  isRowSelected(row: any): boolean;
488
496
  /** Selects/deselects a single row. */
489
497
  toggleRowSelection(row: any): void;
498
+ /** Row click: toggles the selection when `selectOnRowClick` is on. */
499
+ onRowClick(event: MouseEvent, row: any): void;
490
500
  /**
491
501
  * Header checkbox: selects every selectable row of the current page or,
492
502
  * when all of them are already selected, removes them from the selection.
@@ -633,10 +643,14 @@ declare class TableComponent {
633
643
  /** Resets the table to the first page. */
634
644
  reset(): void;
635
645
  /** Resolves the row action label, static or per-row function. */
646
+ /** Text of a `template: 'date'` cell (column pattern, else the `dates.*` options). */
647
+ formatDateCell(value: unknown, col: Column): string;
648
+ /** Text of a `template: 'currency'` cell (column currency, else the `numbers.*` options). */
649
+ formatCurrencyCell(value: unknown, col: Column): string;
636
650
  getRowActionLabel(action: RowAction, rowData: any): string;
637
651
  /**
638
- * Resolves the row action icon: a lucide component, a function returning
639
- * the icon name, or a raw string resolved by the central icon map.
652
+ * Resolves the row action icon: `IconNode` data, a function returning the
653
+ * icon for the row, or a raw string resolved by the central icon map.
640
654
  */
641
655
  getRowActionIconName(action: RowAction, rowData: any): any;
642
656
  /** Resolves the CSS class of a row action, static or per-row function. */
@@ -696,8 +710,8 @@ declare class TableComponent {
696
710
  /** Closes the column filter menu with Escape. */
697
711
  onEscape(): void;
698
712
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
699
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "shk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rowsPerPage": { "alias": "rowsPerPage"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showActionRow": { "alias": "showActionRow"; "required": false; "isSignal": true; }; "customTemplates": { "alias": "customTemplates"; "required": false; "isSignal": true; }; "headerActions": { "alias": "headerActions"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "hasShadow": { "alias": "hasShadow"; "required": false; "isSignal": true; }; "defaultSortField": { "alias": "defaultSortField"; "required": false; "isSignal": true; }; "defaultSortOrder": { "alias": "defaultSortOrder"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "globalFilterFields": { "alias": "globalFilterFields"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "serverSide": { "alias": "serverSide"; "required": false; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "activeFilter": { "alias": "activeFilter"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "resizableColumns": { "alias": "resizableColumns"; "required": false; "isSignal": true; }; "validateRequired": { "alias": "validateRequired"; "required": false; "isSignal": true; }; "missingAsError": { "alias": "missingAsError"; "required": false; "isSignal": true; }; "requiredFields": { "alias": "requiredFields"; "required": false; "isSignal": true; }; "columnWidths": { "alias": "columnWidths"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "stateStorage": { "alias": "stateStorage"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showPageReport": { "alias": "showPageReport"; "required": false; "isSignal": true; }; "showRowsPerPage": { "alias": "showRowsPerPage"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "isRowSelectable": { "alias": "isRowSelectable"; "required": false; "isSignal": true; }; "bulkActions": { "alias": "bulkActions"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; }, { "columnWidths": "columnWidthsChange"; "selection": "selectionChange"; "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; "columnResize": "columnResize"; }, never, never, true, never>;
713
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "shk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rowsPerPage": { "alias": "rowsPerPage"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showActionRow": { "alias": "showActionRow"; "required": false; "isSignal": true; }; "customTemplates": { "alias": "customTemplates"; "required": false; "isSignal": true; }; "headerActions": { "alias": "headerActions"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "hasShadow": { "alias": "hasShadow"; "required": false; "isSignal": true; }; "defaultSortField": { "alias": "defaultSortField"; "required": false; "isSignal": true; }; "defaultSortOrder": { "alias": "defaultSortOrder"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "globalFilterFields": { "alias": "globalFilterFields"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "serverSide": { "alias": "serverSide"; "required": false; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "activeFilter": { "alias": "activeFilter"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "resizableColumns": { "alias": "resizableColumns"; "required": false; "isSignal": true; }; "rowValidations": { "alias": "rowValidations"; "required": false; "isSignal": true; }; "columnWidths": { "alias": "columnWidths"; "required": false; "isSignal": true; }; "stateKey": { "alias": "stateKey"; "required": false; "isSignal": true; }; "stateStorage": { "alias": "stateStorage"; "required": false; "isSignal": true; }; "rowHover": { "alias": "rowHover"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showPageReport": { "alias": "showPageReport"; "required": false; "isSignal": true; }; "showRowsPerPage": { "alias": "showRowsPerPage"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "isRowSelectable": { "alias": "isRowSelectable"; "required": false; "isSignal": true; }; "selectOnRowClick": { "alias": "selectOnRowClick"; "required": false; "isSignal": true; }; "bulkActions": { "alias": "bulkActions"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; }, { "columnWidths": "columnWidthsChange"; "selection": "selectionChange"; "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; "columnResize": "columnResize"; }, never, never, true, never>;
700
714
  }
701
715
 
702
716
  export { TableComponent };
703
- export type { BulkAction, Column, ColumnFilterState, ColumnFilterType, FilterChangeEvent, FilterMatchMode, FilterOperator, FilterOption, FilterRule, MissingRequirement, PageChangeEvent, RequiredField, RowAction, TableAction };
717
+ export type { BulkAction, Column, ColumnFilterState, ColumnFilterType, FilterChangeEvent, FilterMatchMode, FilterOperator, FilterOption, FilterRule, PageChangeEvent, RowAction, RowSeverity, RowValidation, RowViolation, TableAction };
@@ -15,7 +15,7 @@ declare class TagComponent {
15
15
  severity: _angular_core.InputSignal<TagSeverity>;
16
16
  /** Renders the tag with fully rounded corners (pill). */
17
17
  rounded: _angular_core.InputSignal<boolean>;
18
- /** Optional leading lucide icon name or component. */
18
+ /** Optional leading icon: registered name (e.g. `'check'`) or `IconNode` data. */
19
19
  icon: _angular_core.InputSignal<any>;
20
20
  /** Inline styles applied to the tag. */
21
21
  style: _angular_core.InputSignal<Record<string, string | number>>;
@@ -1,6 +1,8 @@
1
+ import * as shirkasoft_ui_components_icons from 'shirkasoft-ui-components/icons';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { ElementRef } from '@angular/core';
3
4
  import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
5
+ import { FormValueControl } from '@angular/forms/signals';
4
6
 
5
7
  /**
6
8
  * Shirkasoft UI Components.
@@ -11,7 +13,7 @@ import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
11
13
  * Text input (or textarea) that implements ControlValueAccessor with built-in
12
14
  * validation messages, card/number formatting, password reveal and search mode.
13
15
  */
14
- declare class TextFieldComponent implements ControlValueAccessor {
16
+ declare class TextFieldComponent implements ControlValueAccessor, FormValueControl<any> {
15
17
  private cdr;
16
18
  /** id attribute applied to the native input. */
17
19
  id: _angular_core.InputSignal<string>;
@@ -55,13 +57,17 @@ declare class TextFieldComponent implements ControlValueAccessor {
55
57
  autocomplete: _angular_core.InputSignal<string>;
56
58
  /** Emitted when the search button is clicked (search mode). */
57
59
  searchButtonClick: _angular_core.OutputEmitterRef<void>;
58
- protected readonly getIcon: (name: any) => any;
60
+ /** Emitted on blur so Signal Forms can mark the field as touched. */
61
+ touch: _angular_core.OutputEmitterRef<void>;
62
+ protected readonly getIcon: (name: any) => shirkasoft_ui_components_icons.IconNode | null;
59
63
  /** Reference to the native input element. */
60
64
  inputElement: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
61
65
  /** Reference to the native textarea element. */
62
66
  textareaElement: _angular_core.Signal<ElementRef<HTMLTextAreaElement> | undefined>;
63
- /** Internal raw value of the field. */
64
- private _value;
67
+ /** Field value. Two-way bindable and used by Signal Forms `[formField]`. */
68
+ value: _angular_core.ModelSignal<any>;
69
+ /** Internal alias kept for the existing implementation. */
70
+ private get _value();
65
71
  /** Reactive disabled state from the form control. */
66
72
  private _disabledState;
67
73
  /** Whether the password is currently revealed. */
@@ -72,18 +78,28 @@ declare class TextFieldComponent implements ControlValueAccessor {
72
78
  private errorTracker;
73
79
  /** Text displayed in search mode when `displayValue` is set. */
74
80
  displayLabel: _angular_core.Signal<string>;
75
- /** Prevents re-subscribing to the same form control. */
76
- private subscribed;
81
+ /** Control whose status/value changes are currently observed. */
82
+ private observedControl;
83
+ /** Subscription to `observedControl`; replaced when the control changes. */
84
+ private controlSubscription?;
77
85
  /** Effective disabled state combining the input and the form binding. */
78
86
  isDisabled: _angular_core.Signal<boolean>;
79
- /** Current field value. */
80
- value: _angular_core.Signal<any>;
81
- /** Resolves the reactive control: explicit `control` or `formGroup.get(label)`. */
82
- actualControl: _angular_core.Signal<FormControl<any> | undefined>;
87
+ /**
88
+ * Internal control used when no reactive control is supplied (`[formField]`,
89
+ * `formControlName`/`ngModel` on the host, or plain `[(value)]`). The native
90
+ * input always needs a control for its `[formControl]` binding.
91
+ */
92
+ private readonly innerControl;
93
+ /** Explicit `control`, or `formGroup.get(label)`, or `undefined` if none. */
94
+ private externalControl;
95
+ /** True when the field is driven by its internal control (no reactive control given). */
96
+ private usesInnerControl;
97
+ /** Resolves the reactive control: external one if any, otherwise the internal one. */
98
+ actualControl: _angular_core.Signal<FormControl<any>>;
83
99
  /** True when the resolved control is invalid and dirty or touched. */
84
- shouldShowError: _angular_core.Signal<boolean | undefined>;
100
+ shouldShowError: _angular_core.Signal<boolean>;
85
101
  /** True when the control had an error before and is now valid (success state). */
86
- wasFixedError: _angular_core.Signal<boolean | undefined>;
102
+ wasFixedError: _angular_core.Signal<boolean>;
87
103
  /** Resolved list of error messages for the current control state. */
88
104
  getErrorMessages: _angular_core.Signal<string[]>;
89
105
  /** Effective input type (handles textarea and password reveal). */
@@ -114,7 +130,7 @@ declare class TextFieldComponent implements ControlValueAccessor {
114
130
  /** Reflects the disabled state of the form control. */
115
131
  setDisabledState(isDisabled: boolean): void;
116
132
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TextFieldComponent, never>;
117
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextFieldComponent, "shk-text-field", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "formatCard": { "alias": "formatCard"; "required": false; "isSignal": true; }; "preventNegative": { "alias": "preventNegative"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "numbersOnly": { "alias": "numbersOnly"; "required": false; "isSignal": true; }; "allowDecimals": { "alias": "allowDecimals"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "isTextArea": { "alias": "isTextArea"; "required": false; "isSignal": true; }; "textAreaHeight": { "alias": "textAreaHeight"; "required": false; "isSignal": true; }; "searchMode": { "alias": "searchMode"; "required": false; "isSignal": true; }; "displayValue": { "alias": "displayValue"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; }, { "searchButtonClick": "searchButtonClick"; }, never, never, true, never>;
133
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TextFieldComponent, "shk-text-field", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "formatCard": { "alias": "formatCard"; "required": false; "isSignal": true; }; "preventNegative": { "alias": "preventNegative"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "numbersOnly": { "alias": "numbersOnly"; "required": false; "isSignal": true; }; "allowDecimals": { "alias": "allowDecimals"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "isTextArea": { "alias": "isTextArea"; "required": false; "isSignal": true; }; "textAreaHeight": { "alias": "textAreaHeight"; "required": false; "isSignal": true; }; "searchMode": { "alias": "searchMode"; "required": false; "isSignal": true; }; "displayValue": { "alias": "displayValue"; "required": false; "isSignal": true; }; "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "searchButtonClick": "searchButtonClick"; "touch": "touch"; "value": "valueChange"; }, never, never, true, never>;
118
134
  }
119
135
 
120
136
  export { TextFieldComponent };
@@ -0,0 +1,83 @@
1
+ import * as shirkasoft_ui_components_config from 'shirkasoft-ui-components/config';
2
+ import * as shirkasoft_ui_components_icons from 'shirkasoft-ui-components/icons';
3
+ import * as _angular_core from '@angular/core';
4
+
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
+ 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
+ declare class ThemePickerComponent {
35
+ private readonly config;
36
+ private readonly host;
37
+ private readonly trigger;
38
+ /** Primary colors offered. */
39
+ readonly primaryColors: _angular_core.InputSignal<readonly ShkPickerColor[]>;
40
+ /** Shows the surface (neutral palette) section. */
41
+ readonly showSurface: _angular_core.InputSignal<boolean>;
42
+ /** Shows the theme presets section (needs more than one preset). */
43
+ readonly showPresets: _angular_core.InputSignal<boolean>;
44
+ /** Accessible name and tooltip of the button. */
45
+ readonly triggerLabel: _angular_core.InputSignal<string>;
46
+ readonly primaryLabel: _angular_core.InputSignal<string>;
47
+ readonly surfaceLabel: _angular_core.InputSignal<string>;
48
+ readonly presetsLabel: _angular_core.InputSignal<string>;
49
+ /** `theme.*` options exist only when the app uses `withTheme()`. */
50
+ protected readonly available: boolean;
51
+ protected readonly open: _angular_core.WritableSignal<boolean>;
52
+ protected readonly panelId: string;
53
+ protected readonly paletteIcon: shirkasoft_ui_components_icons.IconNode | null;
54
+ protected readonly presets: readonly 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: _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: _angular_core.Signal<string>;
67
+ /** Surface palette in use: the override, else the preset's own. */
68
+ protected readonly activeSurface: _angular_core.Signal<string>;
69
+ /** True while no primary/surface override is applied on top of the preset. */
70
+ protected readonly isPresetPure: _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: _angular_core.ɵɵFactoryDeclaration<ThemePickerComponent, never>;
79
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ThemePickerComponent, "shk-theme-picker", never, { "primaryColors": { "alias": "primaryColors"; "required": false; "isSignal": true; }; "showSurface": { "alias": "showSurface"; "required": false; "isSignal": true; }; "showPresets": { "alias": "showPresets"; "required": false; "isSignal": true; }; "triggerLabel": { "alias": "triggerLabel"; "required": false; "isSignal": true; }; "primaryLabel": { "alias": "primaryLabel"; "required": false; "isSignal": true; }; "surfaceLabel": { "alias": "surfaceLabel"; "required": false; "isSignal": true; }; "presetsLabel": { "alias": "presetsLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
80
+ }
81
+
82
+ export { DEFAULT_PRIMARY_COLORS, ThemePickerComponent };
83
+ export type { ShkPickerColor };
@@ -0,0 +1,88 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { InjectionToken, EnvironmentProviders } from '@angular/core';
3
+
4
+ /** Built-in theme packs shipped with the library. */
5
+ type ShkThemeName = 'default' | 'ocean' | 'violet' | 'sunset' | (string & {});
6
+ /** Color scheme selection. `system` follows `prefers-color-scheme`. */
7
+ type ShkColorScheme = 'light' | 'dark' | 'system';
8
+ interface ShkThemeConfig {
9
+ /** Theme applied when nothing is stored yet. Defaults to `default`. */
10
+ defaultTheme?: ShkThemeName;
11
+ /** Scheme applied when nothing is stored yet. Defaults to `system`. */
12
+ defaultScheme?: ShkColorScheme;
13
+ /** Persist the selection in localStorage. Defaults to `true`. */
14
+ persist?: boolean;
15
+ /** localStorage keys. */
16
+ storageKey?: string;
17
+ schemeStorageKey?: string;
18
+ /** Attribute written on <html>. Defaults to `data-shk-theme`. */
19
+ attribute?: string;
20
+ /** Class toggled on <html> for dark mode. Defaults to `dark`. */
21
+ darkClass?: string;
22
+ }
23
+ type ResolvedShkThemeConfig = Required<ShkThemeConfig>;
24
+ declare const SHK_THEMES: readonly ShkThemeName[];
25
+ declare const DEFAULT_SHK_THEME_CONFIG: ResolvedShkThemeConfig;
26
+ declare const SHK_THEME_CONFIG: InjectionToken<Required<ShkThemeConfig>>;
27
+
28
+ /**
29
+ * Shirkasoft UI Components.
30
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
31
+ * Belongs to Shirkasoft.
32
+ */
33
+
34
+ /**
35
+ * Configures the theme system and applies the stored/default theme while the
36
+ * app boots, so it is active even if nothing injects `ShkThemeService`.
37
+ *
38
+ * ```ts
39
+ * bootstrapApplication(App, {
40
+ * providers: [provideShkTheme({ defaultTheme: 'ocean', defaultScheme: 'dark' })],
41
+ * });
42
+ * ```
43
+ */
44
+ declare function provideShkTheme(config?: ShkThemeConfig): EnvironmentProviders;
45
+
46
+ /**
47
+ * Applies and persists the color theme.
48
+ *
49
+ * Themes are plain CSS custom properties, so switching a theme is just an
50
+ * attribute change on `<html>` — no component re-render involved.
51
+ */
52
+ declare class ShkThemeService {
53
+ private readonly doc;
54
+ private readonly config;
55
+ private readonly win;
56
+ /** Every theme name the service knows about. */
57
+ readonly availableThemes: readonly ShkThemeName[];
58
+ /** Currently active theme. */
59
+ readonly theme: _angular_core.WritableSignal<ShkThemeName>;
60
+ /** Currently selected scheme (`light`, `dark` or `system`). */
61
+ readonly scheme: _angular_core.WritableSignal<ShkColorScheme>;
62
+ /** `true` when dark colors are being applied. */
63
+ readonly isDark: _angular_core.WritableSignal<boolean>;
64
+ /** Convenience flag for templates. */
65
+ readonly isSystem: _angular_core.Signal<boolean>;
66
+ private mediaQuery?;
67
+ constructor();
68
+ /** Switches the active theme pack. */
69
+ setTheme(theme: ShkThemeName): void;
70
+ /** Selects light, dark or system scheme. */
71
+ setScheme(scheme: ShkColorScheme): void;
72
+ /** Flips between light and dark (leaves `system` on the opposite value). */
73
+ toggleDark(): void;
74
+ /** Applies a theme without persisting it (useful for previews). */
75
+ previewTheme(theme: ShkThemeName): void;
76
+ private restore;
77
+ private applyTheme;
78
+ private applyScheme;
79
+ private watchSystem;
80
+ private prefersDark;
81
+ private read;
82
+ private persist;
83
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ShkThemeService, never>;
84
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<ShkThemeService>;
85
+ }
86
+
87
+ export { DEFAULT_SHK_THEME_CONFIG, SHK_THEMES, SHK_THEME_CONFIG, ShkThemeService, provideShkTheme };
88
+ export type { ResolvedShkThemeConfig, ShkColorScheme, ShkThemeConfig, ShkThemeName };
@@ -1,4 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import * as shirkasoft_ui_components_icons from 'shirkasoft-ui-components/icons';
2
3
 
3
4
  /**
4
5
  * Shirkasoft UI Components.
@@ -18,7 +19,7 @@ interface TimelineSubItem {
18
19
  subtitle?: string;
19
20
  /** Used to look up icon / color in `iconMap` and `iconColors`. */
20
21
  type?: string;
21
- /** Overrides the resolved icon (name or component). */
22
+ /** Overrides the resolved icon (registered name or `IconNode` data). */
22
23
  icon?: string | any;
23
24
  /** Hex background for the icon box (fallback). */
24
25
  color?: string;
@@ -80,10 +81,10 @@ declare const DEFAULT_SUPPLIER_ICON_COLORS: Record<string, {
80
81
  bg: string;
81
82
  text: string;
82
83
  }>;
83
- /** Maps a sub-item `type` to a lucide icon component. */
84
+ /** Maps a sub-item `type` to its icon data (`IconNode`). */
84
85
  declare const DEFAULT_SUPPLIER_TYPE_ICONS: Record<string, any>;
85
86
  declare class TimelineComponent {
86
- protected getIcon: (name: any) => any;
87
+ protected getIcon: (name: any) => shirkasoft_ui_components_icons.IconNode | null;
87
88
  /** Timeline data. */
88
89
  items: _angular_core.InputSignal<TimelineItem[]>;
89
90
  /** 'left' = line and markers on the left; 'alternate' = cards alternate around a centered line on lg+; 'split' = markers centered with days on the left and activities on the right. */
@@ -119,7 +120,7 @@ declare class TimelineComponent {
119
120
  addSubItemTooltip: _angular_core.InputSignal<string>;
120
121
  itemActions: _angular_core.InputSignal<TimelineItemAction[]>;
121
122
  subItemActions: _angular_core.InputSignal<TimelineSubItemAction[]>;
122
- /** Maps a sub-item `type` to a lucide icon (name or component). */
123
+ /** Maps a sub-item `type` to an icon (registered name or `IconNode` data). */
123
124
  iconMap: _angular_core.InputSignal<{
124
125
  [type: string]: any;
125
126
  }>;