shirkasoft-ui-components 1.2.0 → 1.3.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 (79) hide show
  1. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs +199 -0
  2. package/fesm2022/shirkasoft-ui-components-breadcrumb.mjs.map +1 -0
  3. package/fesm2022/shirkasoft-ui-components-button.mjs +148 -0
  4. package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -0
  5. package/fesm2022/shirkasoft-ui-components-chart.mjs +153 -0
  6. package/fesm2022/shirkasoft-ui-components-chart.mjs.map +1 -0
  7. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +143 -0
  8. package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -0
  9. package/fesm2022/shirkasoft-ui-components-date-picker.mjs +638 -0
  10. package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -0
  11. package/fesm2022/shirkasoft-ui-components-fieldset.mjs +94 -0
  12. package/fesm2022/shirkasoft-ui-components-fieldset.mjs.map +1 -0
  13. package/fesm2022/shirkasoft-ui-components-file-upload.mjs +242 -0
  14. package/fesm2022/shirkasoft-ui-components-file-upload.mjs.map +1 -0
  15. package/fesm2022/shirkasoft-ui-components-knob.mjs +269 -0
  16. package/fesm2022/shirkasoft-ui-components-knob.mjs.map +1 -0
  17. package/fesm2022/shirkasoft-ui-components-loading.mjs +255 -0
  18. package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -0
  19. package/fesm2022/shirkasoft-ui-components-modal.mjs +290 -0
  20. package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -0
  21. package/fesm2022/shirkasoft-ui-components-notification.mjs +143 -0
  22. package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -0
  23. package/fesm2022/shirkasoft-ui-components-price-input.mjs +64 -0
  24. package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -0
  25. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs +205 -0
  26. package/fesm2022/shirkasoft-ui-components-rail-sidebar.mjs.map +1 -0
  27. package/fesm2022/shirkasoft-ui-components-select.mjs +737 -0
  28. package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -0
  29. package/fesm2022/shirkasoft-ui-components-sidebar.mjs +185 -0
  30. package/fesm2022/shirkasoft-ui-components-sidebar.mjs.map +1 -0
  31. package/fesm2022/shirkasoft-ui-components-skeleton.mjs +74 -0
  32. package/fesm2022/shirkasoft-ui-components-skeleton.mjs.map +1 -0
  33. package/fesm2022/shirkasoft-ui-components-table.mjs +689 -0
  34. package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -0
  35. package/fesm2022/shirkasoft-ui-components-tabs.mjs +249 -0
  36. package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -0
  37. package/fesm2022/shirkasoft-ui-components-tag.mjs +70 -0
  38. package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -0
  39. package/fesm2022/shirkasoft-ui-components-text-field.mjs +370 -0
  40. package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -0
  41. package/fesm2022/shirkasoft-ui-components-timeline.mjs +222 -0
  42. package/fesm2022/shirkasoft-ui-components-timeline.mjs.map +1 -0
  43. package/fesm2022/shirkasoft-ui-components-toggle.mjs +186 -0
  44. package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -0
  45. package/fesm2022/shirkasoft-ui-components-tooltip.mjs +169 -0
  46. package/fesm2022/shirkasoft-ui-components-tooltip.mjs.map +1 -0
  47. package/fesm2022/shirkasoft-ui-components-utils.mjs +64 -0
  48. package/fesm2022/shirkasoft-ui-components-utils.mjs.map +1 -0
  49. package/fesm2022/shirkasoft-ui-components-wizard.mjs +167 -0
  50. package/fesm2022/shirkasoft-ui-components-wizard.mjs.map +1 -0
  51. package/fesm2022/shirkasoft-ui-components.mjs +0 -5729
  52. package/fesm2022/shirkasoft-ui-components.mjs.map +1 -1
  53. package/package.json +101 -1
  54. package/types/shirkasoft-ui-components-breadcrumb.d.ts +68 -0
  55. package/types/shirkasoft-ui-components-button.d.ts +59 -0
  56. package/types/shirkasoft-ui-components-chart.d.ts +65 -0
  57. package/types/shirkasoft-ui-components-confirm-dialog.d.ts +88 -0
  58. package/types/shirkasoft-ui-components-date-picker.d.ts +200 -0
  59. package/types/shirkasoft-ui-components-fieldset.d.ts +72 -0
  60. package/types/shirkasoft-ui-components-file-upload.d.ts +87 -0
  61. package/types/shirkasoft-ui-components-knob.d.ts +69 -0
  62. package/types/shirkasoft-ui-components-loading.d.ts +94 -0
  63. package/types/shirkasoft-ui-components-modal.d.ts +139 -0
  64. package/types/shirkasoft-ui-components-notification.d.ts +82 -0
  65. package/types/shirkasoft-ui-components-price-input.d.ts +41 -0
  66. package/types/shirkasoft-ui-components-rail-sidebar.d.ts +121 -0
  67. package/types/shirkasoft-ui-components-select.d.ts +182 -0
  68. package/types/shirkasoft-ui-components-sidebar.d.ts +106 -0
  69. package/types/shirkasoft-ui-components-skeleton.d.ts +36 -0
  70. package/types/shirkasoft-ui-components-table.d.ts +293 -0
  71. package/types/shirkasoft-ui-components-tabs.d.ts +102 -0
  72. package/types/shirkasoft-ui-components-tag.d.ts +31 -0
  73. package/types/shirkasoft-ui-components-text-field.d.ts +120 -0
  74. package/types/shirkasoft-ui-components-timeline.d.ts +178 -0
  75. package/types/shirkasoft-ui-components-toggle.d.ts +48 -0
  76. package/types/shirkasoft-ui-components-tooltip.d.ts +47 -0
  77. package/types/shirkasoft-ui-components-utils.d.ts +9 -0
  78. package/types/shirkasoft-ui-components-wizard.d.ts +101 -0
  79. package/types/shirkasoft-ui-components.d.ts +1 -2333
@@ -0,0 +1,293 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { TagSeverity } from 'shirkasoft-ui-components/tag';
4
+
5
+ interface Column {
6
+ field: string;
7
+ header: string;
8
+ sortable?: boolean;
9
+ filter?: boolean;
10
+ filterPlaceholder?: string;
11
+ width?: string;
12
+ defaultSort?: true;
13
+ filterType?: 'text' | 'exact' | 'select';
14
+ filterOptions?: {
15
+ label: string;
16
+ value: any;
17
+ }[];
18
+ template?: 'text' | 'tag';
19
+ format?: (row: any) => string;
20
+ tagValue?: (row: any) => string;
21
+ tagSeverity?: (row: any) => TagSeverity | undefined;
22
+ tagRounded?: boolean | ((row: any) => boolean);
23
+ tagIcon?: string | ((row: any) => string);
24
+ tagStyle?: (row: any) => Record<string, string | number> | undefined;
25
+ }
26
+ interface TableAction {
27
+ label: string;
28
+ icon: string | any;
29
+ onClick: () => void;
30
+ class?: string;
31
+ isVisible?: () => boolean;
32
+ isDisabled?: () => boolean;
33
+ }
34
+ interface RowAction {
35
+ label: string | ((data: any) => string);
36
+ icon: string | ((data: any) => any) | any;
37
+ onClick: (rowData: any) => void;
38
+ class?: string | ((data: any) => string);
39
+ isVisible?: (rowData: any) => boolean;
40
+ isDisabled?: (rowData: any) => boolean;
41
+ }
42
+ interface PageChangeEvent {
43
+ first: number;
44
+ rows: number;
45
+ page: number;
46
+ pageCount: number;
47
+ }
48
+ interface FilterChangeEvent {
49
+ filters: {
50
+ [key: string]: any;
51
+ };
52
+ }
53
+ /**
54
+ * Shirkasoft UI Components.
55
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
56
+ * Belongs to Shirkasoft.
57
+ */
58
+ /**
59
+ * Data table with sorting, column filters, global search, pagination,
60
+ * row/header actions, tag cells and optional server-side mode.
61
+ */
62
+ declare class TableComponent {
63
+ private fb;
64
+ private cdr;
65
+ private transloco;
66
+ private destroyRef;
67
+ /** Maps icon names to lucide components, falling back to a plus icon. */
68
+ protected getIcon: (name: any) => any;
69
+ /**
70
+ * Minimum width applied to each column (except `actions`, which keeps its
71
+ * own computed width) only on narrow screens. On wide screens columns
72
+ * stretch normally to fill the container width. Can be overridden per
73
+ * column via `col.width`.
74
+ */
75
+ protected readonly DEFAULT_COLUMN_WIDTH = "140px";
76
+ /** Returns the effective CSS width for a column ('actions' included). */
77
+ getColumnWidth(col: Column): string;
78
+ /** Signal with the translated "Actions" header label. */
79
+ private actionsHeaderLabel;
80
+ /** Signal reacting to language changes so imperative translations are recomputed. */
81
+ private currentLang;
82
+ /** Reactive signal of loaded translations so pageReport is not stuck with raw keys. */
83
+ private translations;
84
+ /** Full dataset. In server-side mode only the current page rows. */
85
+ data: _angular_core.InputSignal<any[]>;
86
+ /** Column definitions (field, header, filterable, tag cell options, etc.). */
87
+ columns: _angular_core.InputSignal<Column[]>;
88
+ /** Number of rows displayed per page. */
89
+ rowsPerPage: _angular_core.InputSignal<number>;
90
+ /** Options shown in the rows-per-page selector. */
91
+ rowsPerPageOptions: _angular_core.InputSignal<number[]>;
92
+ /** Whether the table is in loading state (shows the overlay/skeleton). */
93
+ loading: _angular_core.InputSignal<boolean>;
94
+ /** Whether to render the row actions column. */
95
+ showActionRow: _angular_core.InputSignal<boolean>;
96
+ /** Custom cell/header templates keyed by column field. */
97
+ customTemplates: _angular_core.InputSignal<{
98
+ [key: string]: any;
99
+ }>;
100
+ /** Actions rendered in the table header. */
101
+ headerActions: _angular_core.InputSignal<TableAction[]>;
102
+ /** Actions rendered per row (icon, label, class, visibility/disabled). */
103
+ rowActions: _angular_core.InputSignal<RowAction[]>;
104
+ /** Whether the table container renders a drop shadow. */
105
+ hasShadow: _angular_core.InputSignal<boolean>;
106
+ /** Field used as the default initial sort. */
107
+ defaultSortField: _angular_core.InputSignal<string>;
108
+ /** Order used by the default initial sort (1 asc, -1 desc). */
109
+ defaultSortOrder: _angular_core.InputSignal<number>;
110
+ /** Whether the global search input is shown. */
111
+ showSearch: _angular_core.InputSignal<boolean>;
112
+ /** Placeholder for the global search input. */
113
+ searchPlaceholder: _angular_core.InputSignal<string>;
114
+ /** Message shown when there are no rows. */
115
+ emptyMessage: _angular_core.InputSignal<string>;
116
+ /** Enables server-side pagination/filtering/sorting mode. */
117
+ serverSide: _angular_core.InputSignal<boolean>;
118
+ /** Total number of records in server-side mode (for pagination math). */
119
+ totalRecords: _angular_core.InputSignal<number>;
120
+ /** Optional prebuilt filter chips (label + value) shown above the table. */
121
+ filters: _angular_core.InputSignal<{
122
+ label: string;
123
+ value: string;
124
+ }[]>;
125
+ /** Currently active filter chip value. */
126
+ activeFilter: _angular_core.InputSignal<string>;
127
+ /** Emits when the user clicks the refresh button. */
128
+ refresh: _angular_core.OutputEmitterRef<void>;
129
+ /** Emits page changes (server-side mode) with first/rows/page info. */
130
+ pageChange: _angular_core.OutputEmitterRef<PageChangeEvent>;
131
+ /** Emits the active column filters. */
132
+ filterChange: _angular_core.OutputEmitterRef<FilterChangeEvent>;
133
+ /** Emits the debounced global search term. */
134
+ searchChange: _angular_core.OutputEmitterRef<string>;
135
+ /** Emits when a filter chip is clicked. */
136
+ filterClick: _angular_core.OutputEmitterRef<string>;
137
+ /** Internal copy of the input data used as the base for search/filter. */
138
+ private originalData;
139
+ /** Rows after the global search is applied. */
140
+ searchedData: _angular_core.WritableSignal<any[]>;
141
+ /** Rows after column filters are applied. */
142
+ filteredData: _angular_core.WritableSignal<any[]>;
143
+ /** Rows belonging to the current page (after slicing). */
144
+ displayedData: _angular_core.WritableSignal<any[]>;
145
+ /** Local total records after filtering (client mode). */
146
+ localTotalRecords: _angular_core.WritableSignal<number>;
147
+ /** Index of the first row of the current page. */
148
+ first: _angular_core.WritableSignal<number>;
149
+ /** Visibility map for each column filter input. */
150
+ showFilterInput: _angular_core.WritableSignal<{
151
+ [key: string]: boolean;
152
+ }>;
153
+ /** Current global search term. */
154
+ searchQuery: _angular_core.WritableSignal<string>;
155
+ /** Currently sorted field. */
156
+ sortField: _angular_core.WritableSignal<string>;
157
+ /** Current sort direction (1 asc, -1 desc). */
158
+ sortOrder: _angular_core.WritableSignal<number>;
159
+ /** Local rows per page, kept in sync with the `rowsPerPage` input. */
160
+ rowsPerPageLocal: _angular_core.WritableSignal<number>;
161
+ /** Total number of pages based on the effective record count. */
162
+ totalPages: _angular_core.Signal<number>;
163
+ /** Current page number (1-based). */
164
+ currentPage: _angular_core.Signal<number>;
165
+ /** Reactive form holding the value of each column filter. */
166
+ columnFiltersForm: FormGroup;
167
+ /** Subjects used to debounce column filters (server mode) and search. */
168
+ private filterSubject;
169
+ private searchSubject;
170
+ /**
171
+ * Signature of the last built set of filterable fields (+filter type) to
172
+ * avoid rebuilding the form (and losing user input) on reference changes.
173
+ */
174
+ private lastFilterFieldsSignature;
175
+ private columnFilterSubscriptions;
176
+ /** Columns array with the leading `actions` column when row actions exist. */
177
+ columnsWithActions: _angular_core.Signal<Column[]>;
178
+ /** Total records: server-provided in server mode, locally computed otherwise. */
179
+ effectiveTotalRecords: _angular_core.Signal<number>;
180
+ /**
181
+ * Rows rendered by the template: the input data in server-side mode or the
182
+ * locally sliced/page current rows otherwise.
183
+ */
184
+ effectiveDisplayedData: _angular_core.Signal<any[]>;
185
+ /**
186
+ * Reactive "X to Y of Z" report. Depends on loaded translations and the
187
+ * active language so it always reflects the translated template.
188
+ */
189
+ pageReport: _angular_core.Signal<string>;
190
+ constructor();
191
+ /**
192
+ * Builds (or keeps) the reactive form with one control per filterable
193
+ * column. The form is only rebuilt when the set of filterable
194
+ * fields/filter types changes, preserving the values already typed by the
195
+ * user otherwise. Previous subscriptions are unsubscribed to avoid leaks.
196
+ */
197
+ private setupColumnFilters;
198
+ /** Collects the non-empty column filter values and emits them. */
199
+ private emitFilterChange;
200
+ /** Applies the global search over the original data (client mode). */
201
+ private applySearch;
202
+ /** Entry point that applies search (which cascades into column filters). */
203
+ private applyFilters;
204
+ /**
205
+ * Applies every column filter on top of the searched data using each
206
+ * column's `filterType` ('select', 'exact' or text contains).
207
+ */
208
+ private applyColumnFilters;
209
+ /** Slices the filtered rows for the current page. */
210
+ private updateDisplayedData;
211
+ /** Emits the filter chip clicked in the template. */
212
+ onFilterClick(value: string): void;
213
+ /** Toggles the sort direction of a column (first click sorts ascending). */
214
+ toggleSort(field: string): void;
215
+ /**
216
+ * Sorts the filtered rows by the current field. Rows with null/undefined
217
+ * values are always kept at the end regardless of sort direction.
218
+ */
219
+ private applySort;
220
+ /** Handles the global search input (updates query, resets page, debounces server mode). */
221
+ onSearchInput(value: string): void;
222
+ /** Clears a column filter value and hides its input. */
223
+ clearFilter(field: string): void;
224
+ /** Toggles the visibility of a column filter input. */
225
+ toggleFilter(field: string): void;
226
+ /**
227
+ * Whether a column filter is non-empty. Avoids treating the number 0 as
228
+ * "no value".
229
+ */
230
+ hasFilterValue(field: string): boolean;
231
+ /** Returns the reactive page report string (template helper). */
232
+ getPageReport(): string;
233
+ /** Goes to the first page (emits pageChange in server-side mode). */
234
+ goToFirst(): void;
235
+ /** Goes to the last page (emits pageChange in server-side mode). */
236
+ goToLast(): void;
237
+ /** Updates rows-per-page and resets to the first page. */
238
+ onRowsPerPageChange(rows: number): void;
239
+ /** Emits the refresh output. */
240
+ refreshData(): void;
241
+ /** Whether the current page is the first one. */
242
+ isFirstPage(): boolean;
243
+ /** Whether the current page is the last one. */
244
+ isLastPage(): boolean;
245
+ /** Moves to the next page (emits pageChange in server-side mode). */
246
+ next(): void;
247
+ /** Moves to the previous page (emits pageChange in server mode). */
248
+ prev(): void;
249
+ /** Resets the table to the first page. */
250
+ reset(): void;
251
+ /** Resolves the row action label, static or per-row function. */
252
+ getRowActionLabel(action: RowAction, rowData: any): string;
253
+ /**
254
+ * Resolves the row action icon: a lucide component, a function returning
255
+ * the icon name, or a raw string resolved by the central icon map.
256
+ */
257
+ getRowActionIconName(action: RowAction, rowData: any): any;
258
+ /** Resolves the CSS class of a row action, static or per-row function. */
259
+ getRowActionClass(action: RowAction, rowData: any): string;
260
+ /** Whether a header action is disabled. */
261
+ isHeaderActionDisabled(action: TableAction): boolean;
262
+ /** Whether a header action is visible. */
263
+ isHeaderActionVisible(action: TableAction): boolean;
264
+ /** Whether a row action is disabled for the given row. */
265
+ isRowActionDisabled(action: RowAction, rowData: any): boolean;
266
+ /** Whether a row action is visible for the given row. */
267
+ isRowActionVisible(action: RowAction, rowData: any): boolean;
268
+ /** Truncates a value with an ellipsis past the given character limit. */
269
+ truncate(value: any, limit?: number): string;
270
+ /** Resolves the value displayed inside a tag cell, static or per-row function. */
271
+ getTagValue(col: Column, rowData: any): string;
272
+ /** Resolves and validates the tag severity, falling back to 'secondary'. */
273
+ getTagSeverity(col: Column, rowData: any): TagSeverity;
274
+ /** Resolves whether the tag in a cell is rounded, static or per-row function. */
275
+ getTagRounded(col: Column, rowData: any): boolean;
276
+ /** Resolves the icon shown inside a tag cell, static or per-row function. */
277
+ getTagIcon(col: Column, rowData: any): string;
278
+ /** Resolves the CSS styles of a tag cell, static or per-row function. */
279
+ getTagStyle(col: Column, rowData: any): Record<string, string | number>;
280
+ /**
281
+ * trackBy for row identity: prefers `id`/`_id` and falls back to the index.
282
+ */
283
+ trackByRow(row: any, index: number): any;
284
+ /** Keyboard support (Enter/Space) for sorting a column header. */
285
+ onHeaderKeydown(event: KeyboardEvent, col: Column): void;
286
+ /** Accessible aria-sort value for a given column header. */
287
+ getAriaSort(col: Column): 'ascending' | 'descending' | 'none';
288
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
289
+ 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; }; "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; }; }, { "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; }, never, never, true, never>;
290
+ }
291
+
292
+ export { TableComponent };
293
+ export type { Column, FilterChangeEvent, PageChangeEvent, RowAction, TableAction };
@@ -0,0 +1,102 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ /**
4
+ * Shirkasoft UI Components.
5
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
6
+ * Belongs to Shirkasoft.
7
+ */
8
+ /** Shared state between shk-abs and its tab/tabpanel children. */
9
+ declare class TabsService {
10
+ /** Currently active tab value. */
11
+ readonly active: i0.WritableSignal<any>;
12
+ /** Sets the active tab to the given value. */
13
+ select(value: any): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<TabsService>;
16
+ }
17
+
18
+ /**
19
+ * Shirkasoft UI Components.
20
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
21
+ * Belongs to Shirkasoft.
22
+ */
23
+ /** Container for tab panels. Renders its projected shk-tablist/shh-tab content. */
24
+ declare class TabsComponent {
25
+ /** Currently active tab value. Two-way bindable with [(value)]. */
26
+ value: i0.ModelSignal<any>;
27
+ /** Allows the tab header to scroll horizontally when it overflows. */
28
+ scrollable: i0.InputSignal<boolean>;
29
+ /** Shared service used to sync the active tab with the children. */
30
+ protected tabsSvc: TabsService;
31
+ constructor();
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabsComponent, "shk-tabs", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["*"], true, never>;
34
+ }
35
+
36
+ /**
37
+ * Shirkasoft UI Components.
38
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
39
+ * Belongs to Shirkasoft.
40
+ */
41
+ /** Horizontal bar that contains the shk-tab headers. */
42
+ declare class TablistComponent {
43
+ /** Allows the header to scroll horizontally when it overflows. */
44
+ scrollable: i0.InputSignal<boolean>;
45
+ /** Extra CSS classes. */
46
+ styleClass: i0.InputSignal<string>;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<TablistComponent, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<TablistComponent, "shk-tablist", never, { "scrollable": { "alias": "scrollable"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
49
+ }
50
+
51
+ /**
52
+ * Shirkasoft UI Components.
53
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
54
+ * Belongs to Shirkasoft.
55
+ */
56
+ /** A single tab header. Clicking it activates the matching panel. */
57
+ declare class TabComponent {
58
+ /** Value that links this tab to its panel. */
59
+ value: i0.InputSignal<any>;
60
+ /** Disables the tab. */
61
+ disabled: i0.InputSignal<boolean>;
62
+ /** Extra CSS classes. */
63
+ styleClass: i0.InputSignal<string>;
64
+ /** Shared service used to read the active tab value. */
65
+ protected tabsSvc: TabsService;
66
+ /** Whether this tab is the active one. */
67
+ protected active: i0.Signal<boolean>;
68
+ /** Activates this tab through the shared service. */
69
+ select(): void;
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabComponent, never>;
71
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabComponent, "shk-tab", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
72
+ }
73
+
74
+ /**
75
+ * Shirkasoft UI Components.
76
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
77
+ * Belongs to Shirkasoft.
78
+ */
79
+ /** Container that groups the shk-tabpanel content sections. */
80
+ declare class TabpanelsComponent {
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabpanelsComponent, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabpanelsComponent, "shk-tabpanels", never, {}, {}, never, ["*"], true, never>;
83
+ }
84
+
85
+ /**
86
+ * Shirkasoft UI Components.
87
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
88
+ * Belongs to Shirkasoft.
89
+ */
90
+ /** Content section shown only while its value is the active tab. */
91
+ declare class TabPanelComponent {
92
+ /** Value that links this panel to its tab. */
93
+ value: i0.InputSignal<any>;
94
+ /** Shared service used to read the active tab value. */
95
+ protected tabsSvc: TabsService;
96
+ /** Whether this panel is the active one. */
97
+ protected active: i0.Signal<boolean>;
98
+ static ɵfac: i0.ɵɵFactoryDeclaration<TabPanelComponent, never>;
99
+ static ɵcmp: i0.ɵɵComponentDeclaration<TabPanelComponent, "shk-tabpanel", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
100
+ }
101
+
102
+ export { TabComponent, TabPanelComponent, TablistComponent, TabpanelsComponent, TabsComponent, TabsService };
@@ -0,0 +1,31 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { getIcon } from 'shirkasoft-ui-components/utils';
3
+
4
+ /**
5
+ * Shirkasoft UI Components.
6
+ * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
7
+ * Belongs to Shirkasoft.
8
+ */
9
+ type TagSeverity = 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'contrast';
10
+ /** Small label used to highlight a value, status or category. */
11
+ declare class TagComponent {
12
+ /** Text shown inside the tag. */
13
+ value: _angular_core.InputSignal<string | number>;
14
+ /** Color variant. Defaults to 'secondary'. */
15
+ severity: _angular_core.InputSignal<TagSeverity>;
16
+ /** Renders the tag with fully rounded corners (pill). */
17
+ rounded: _angular_core.InputSignal<boolean>;
18
+ /** Optional leading lucide icon name or component. */
19
+ icon: _angular_core.InputSignal<any>;
20
+ /** Inline styles applied to the tag. */
21
+ style: _angular_core.InputSignal<Record<string, string | number>>;
22
+ /** Extra CSS classes. */
23
+ styleClass: _angular_core.InputSignal<string>;
24
+ protected getIcon: typeof getIcon;
25
+ protected tagClass: _angular_core.Signal<string>;
26
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TagComponent, never>;
27
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TagComponent, "shk-tag", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
28
+ }
29
+
30
+ export { TagComponent };
31
+ export type { TagSeverity };
@@ -0,0 +1,120 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef } from '@angular/core';
3
+ import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
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
+ /**
11
+ * Text input (or textarea) that implements ControlValueAccessor with built-in
12
+ * validation messages, card/number formatting, password reveal and search mode.
13
+ */
14
+ declare class TextFieldComponent implements ControlValueAccessor {
15
+ private cdr;
16
+ /** id attribute applied to the native input. */
17
+ id: _angular_core.InputSignal<string>;
18
+ /** Formats the value as a credit card number (XXXX-XXXX-XXXX-XXXX). */
19
+ formatCard: _angular_core.InputSignal<boolean>;
20
+ /** Blocks the minus sign from being typed. */
21
+ preventNegative: _angular_core.InputSignal<boolean>;
22
+ /** Label rendered above the field. */
23
+ label: _angular_core.InputSignal<string>;
24
+ /** Native input type ('text', 'password', 'number', etc.). */
25
+ type: _angular_core.InputSignal<string>;
26
+ /** Allows digits only, stripping any other character. */
27
+ numbersOnly: _angular_core.InputSignal<boolean>;
28
+ /** When true, allows decimals and normalizes ',' to '.'. */
29
+ allowDecimals: _angular_core.InputSignal<boolean>;
30
+ /** Maximum number of characters the user can type. */
31
+ maxLength: _angular_core.InputSignal<number | undefined>;
32
+ /** Placeholder text of the native input. */
33
+ placeholder: _angular_core.InputSignal<string>;
34
+ /** Custom messages keyed by validation error name. */
35
+ errorMessages: _angular_core.InputSignal<{
36
+ [key: string]: string;
37
+ }>;
38
+ /** Parent reactive form used to resolve the control by label. */
39
+ formGroup: _angular_core.InputSignal<FormGroup<any> | undefined>;
40
+ /** Reactive control bound directly to this field. */
41
+ control: _angular_core.InputSignal<FormControl<any> | undefined>;
42
+ /** Disables the field. */
43
+ disabled: _angular_core.InputSignal<boolean>;
44
+ /** Custom error message shown regardless of validation errors. */
45
+ errorMessage: _angular_core.InputSignal<string>;
46
+ /** Renders a textarea instead of an input. */
47
+ isTextArea: _angular_core.InputSignal<boolean>;
48
+ /** Height classes applied when `isTextArea` is true. */
49
+ textAreaHeight: _angular_core.InputSignal<string>;
50
+ /** Renders the field as a read-only search trigger. */
51
+ searchMode: _angular_core.InputSignal<boolean>;
52
+ /** Value shown when `searchMode` is enabled. */
53
+ displayValue: _angular_core.InputSignal<string>;
54
+ /** Native autocomplete attribute. */
55
+ autocomplete: _angular_core.InputSignal<string>;
56
+ /** Emitted when the search button is clicked (search mode). */
57
+ searchButtonClick: _angular_core.OutputEmitterRef<void>;
58
+ protected readonly getIcon: (name: any) => any;
59
+ /** Reference to the native input element. */
60
+ inputElement: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
61
+ /** Reference to the native textarea element. */
62
+ textareaElement: _angular_core.Signal<ElementRef<HTMLTextAreaElement> | undefined>;
63
+ /** Internal raw value of the field. */
64
+ private _value;
65
+ /** Reactive disabled state from the form control. */
66
+ private _disabledState;
67
+ /** Whether the password is currently revealed. */
68
+ showPassword: _angular_core.WritableSignal<boolean>;
69
+ /** Tracks whether the control was in error at some point (for "was fixed" UX). */
70
+ hadError: _angular_core.WritableSignal<boolean>;
71
+ /** Counter bumped to trigger recomputation of derived error signals. */
72
+ private errorTracker;
73
+ /** Text displayed in search mode when `displayValue` is set. */
74
+ displayLabel: _angular_core.Signal<string>;
75
+ /** Prevents re-subscribing to the same form control. */
76
+ private subscribed;
77
+ /** Effective disabled state combining the input and the form binding. */
78
+ 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>;
83
+ /** True when the resolved control is invalid and dirty or touched. */
84
+ shouldShowError: _angular_core.Signal<boolean | undefined>;
85
+ /** True when the control had an error before and is now valid (success state). */
86
+ wasFixedError: _angular_core.Signal<boolean | undefined>;
87
+ /** Resolved list of error messages for the current control state. */
88
+ getErrorMessages: _angular_core.Signal<string[]>;
89
+ /** Effective input type (handles textarea and password reveal). */
90
+ effectiveType: _angular_core.Signal<string>;
91
+ private transloco;
92
+ /** Callback notified with the new value (ControlValueAccessor). */
93
+ private onChange;
94
+ /** Callback notified when the field is touched (ControlValueAccessor). */
95
+ private onTouched;
96
+ private destroyRef;
97
+ constructor();
98
+ /** Prevents disallowed characters based on the `numbersOnly`/`allowDecimals` config. */
99
+ numberValidation(event: KeyboardEvent): void;
100
+ /** Marks the field as touched and refreshes the error state. */
101
+ onBlur(): void;
102
+ /** Formats the raw input as a credit card number and notifies the control. */
103
+ onCardInput(event: Event): void;
104
+ /** Handles raw input: applies number/card/max-length formatting and notifies the control. */
105
+ onInput(event: Event): void;
106
+ /** Toggles the visibility of a password field. */
107
+ togglePasswordVisibility(): void;
108
+ /** Sets the value from the form control applying the same formatting rules. */
109
+ writeValue(value: any): void;
110
+ /** Registers the callback invoked on value changes (ControlValueAccessor). */
111
+ registerOnChange(fn: any): void;
112
+ /** Registers the callback invoked when the field is touched. */
113
+ registerOnTouched(fn: any): void;
114
+ /** Reflects the disabled state of the form control. */
115
+ setDisabledState(isDisabled: boolean): void;
116
+ 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>;
118
+ }
119
+
120
+ export { TextFieldComponent };