shirkasoft-ui-components 1.3.11 → 1.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shirkasoft-ui-components",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "Angular UI Components Library — themeable via CSS custom properties",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,4 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { LucideX } from '@lucide/angular';
2
3
 
3
4
  interface RailSidebarItem {
4
5
  id: string;
@@ -23,16 +24,17 @@ interface RailSidebarSectionEvent {
23
24
  key: string;
24
25
  routerLink?: string;
25
26
  }
26
- /**
27
- * Shirkasoft UI Components.
28
- * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
29
- * Belongs to Shirkasoft.
30
- */
31
27
  /**
32
28
  * Narrow "rail" sidebar that expands into sections. Supports sections, roles,
33
- * language switching, collapse/expand and responsive tooltips.
29
+ * language switching, collapse/expand and responsive tooltips. Below
30
+ * `mobileBreakpoint` it turns into an off-canvas drawer opened from a
31
+ * hamburger button, so it doesn't take any width from the page.
34
32
  */
35
33
  declare class RailSidebarComponent {
34
+ private readonly isBrowser;
35
+ private readonly injector;
36
+ /** Unique id of the drawer (for aria-controls). */
37
+ protected readonly uid: string;
36
38
  /** Sections presented as expandable areas of the rail. */
37
39
  sections: _angular_core.InputSignal<RailSidebarSection[]>;
38
40
  /** Current location url used to detect the active section/item. */
@@ -65,6 +67,21 @@ declare class RailSidebarComponent {
65
67
  collapseTooltip: _angular_core.InputSignal<string>;
66
68
  /** Tooltip for expanding the sidebar. */
67
69
  expandTooltip: _angular_core.InputSignal<string>;
70
+ /** Turns the sidebar into a hamburger + drawer below `mobileBreakpoint`. */
71
+ responsive: _angular_core.InputSignal<boolean>;
72
+ /** Viewport width (px) under which the mobile drawer is used. */
73
+ mobileBreakpoint: _angular_core.InputSignal<number>;
74
+ /**
75
+ * Renders the built-in hamburger button on mobile. Set it to false when the
76
+ * app has its own top bar and toggles `[(mobileOpen)]` itself.
77
+ */
78
+ showMobileToggle: _angular_core.InputSignal<boolean>;
79
+ /** Mobile drawer open state, bindable with [(mobileOpen)]. */
80
+ mobileOpen: _angular_core.ModelSignal<boolean>;
81
+ /** Accessible label of the hamburger button. */
82
+ openMenuLabel: _angular_core.InputSignal<string>;
83
+ /** Accessible label of the drawer close button. */
84
+ closeMenuLabel: _angular_core.InputSignal<string>;
68
85
  /** Emitted when a section is selected, with its key and optional route. */
69
86
  sectionSelected: _angular_core.OutputEmitterRef<RailSidebarSectionEvent>;
70
87
  /** Emitted when a navigation item is clicked. */
@@ -78,11 +95,26 @@ declare class RailSidebarComponent {
78
95
  /** Emitted when the workspace/home entry is clicked. */
79
96
  workspaceClick: _angular_core.OutputEmitterRef<void>;
80
97
  protected getIcon: (name: any) => any;
98
+ protected readonly closeIcon: typeof LucideX;
99
+ /** Current viewport width (updated on resize). */
100
+ private viewportWidth;
101
+ /** Whether the mobile drawer mode is active. */
102
+ protected isMobile: _angular_core.Signal<boolean>;
103
+ /** Whether the section panel is shown (always in the mobile drawer). */
104
+ protected expanded: _angular_core.Signal<boolean>;
105
+ private hamburgerBtn;
106
+ private closeBtn;
81
107
  /** Set of group ids currently expanded. */
82
108
  protected expandedGroups: _angular_core.WritableSignal<Set<string>>;
83
109
  constructor();
84
110
  /** Current sidebar width depending on the collapsed state. */
85
111
  protected width: _angular_core.Signal<string>;
112
+ protected onResize(): void;
113
+ protected onEscape(): void;
114
+ /** Opens the mobile drawer and moves the focus into it. */
115
+ openMobile(): void;
116
+ /** Closes the mobile drawer and gives the focus back to the hamburger. */
117
+ closeMobile(): void;
86
118
  /** The section currently selected. */
87
119
  protected activeSection: _angular_core.Signal<RailSidebarSection | null>;
88
120
  /** Items of the active section, filtered by role. */
@@ -109,12 +141,14 @@ declare class RailSidebarComponent {
109
141
  protected onItemClick(item: RailSidebarItem): void;
110
142
  /** Emits `workspaceClick` and expands the sidebar if it was collapsed. */
111
143
  protected onWorkspace(): void;
144
+ /** Emits `logoutRequested` (closing the mobile drawer). */
145
+ protected onLogout(): void;
112
146
  /** Cycles to the next language and emits `setLang`. */
113
147
  protected onToggleLang(): void;
114
148
  /** Toggles collapse and emits `toggleSidebar`. */
115
149
  protected onToggleSidebar(): void;
116
150
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<RailSidebarComponent, never>;
117
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<RailSidebarComponent, "shk-rail-sidebar", never, { "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "activeUrl": { "alias": "activeUrl"; "required": false; "isSignal": true; }; "activeSectionKey": { "alias": "activeSectionKey"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "activeLang": { "alias": "activeLang"; "required": false; "isSignal": true; }; "langs": { "alias": "langs"; "required": false; "isSignal": true; }; "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "appName": { "alias": "appName"; "required": false; "isSignal": true; }; "userRole": { "alias": "userRole"; "required": false; "isSignal": true; }; "labelPipe": { "alias": "labelPipe"; "required": false; "isSignal": true; }; "railWidth": { "alias": "railWidth"; "required": false; "isSignal": true; }; "expandedWidth": { "alias": "expandedWidth"; "required": false; "isSignal": true; }; "workspaceTooltip": { "alias": "workspaceTooltip"; "required": false; "isSignal": true; }; "logoutTooltip": { "alias": "logoutTooltip"; "required": false; "isSignal": true; }; "collapseTooltip": { "alias": "collapseTooltip"; "required": false; "isSignal": true; }; "expandTooltip": { "alias": "expandTooltip"; "required": false; "isSignal": true; }; }, { "activeSectionKey": "activeSectionKeyChange"; "collapsed": "collapsedChange"; "sectionSelected": "sectionSelected"; "itemClick": "itemClick"; "setLang": "setLang"; "logoutRequested": "logoutRequested"; "toggleSidebar": "toggleSidebar"; "workspaceClick": "workspaceClick"; }, never, never, true, never>;
151
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<RailSidebarComponent, "shk-rail-sidebar", never, { "sections": { "alias": "sections"; "required": false; "isSignal": true; }; "activeUrl": { "alias": "activeUrl"; "required": false; "isSignal": true; }; "activeSectionKey": { "alias": "activeSectionKey"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "activeLang": { "alias": "activeLang"; "required": false; "isSignal": true; }; "langs": { "alias": "langs"; "required": false; "isSignal": true; }; "logo": { "alias": "logo"; "required": false; "isSignal": true; }; "appName": { "alias": "appName"; "required": false; "isSignal": true; }; "userRole": { "alias": "userRole"; "required": false; "isSignal": true; }; "labelPipe": { "alias": "labelPipe"; "required": false; "isSignal": true; }; "railWidth": { "alias": "railWidth"; "required": false; "isSignal": true; }; "expandedWidth": { "alias": "expandedWidth"; "required": false; "isSignal": true; }; "workspaceTooltip": { "alias": "workspaceTooltip"; "required": false; "isSignal": true; }; "logoutTooltip": { "alias": "logoutTooltip"; "required": false; "isSignal": true; }; "collapseTooltip": { "alias": "collapseTooltip"; "required": false; "isSignal": true; }; "expandTooltip": { "alias": "expandTooltip"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "mobileBreakpoint": { "alias": "mobileBreakpoint"; "required": false; "isSignal": true; }; "showMobileToggle": { "alias": "showMobileToggle"; "required": false; "isSignal": true; }; "mobileOpen": { "alias": "mobileOpen"; "required": false; "isSignal": true; }; "openMenuLabel": { "alias": "openMenuLabel"; "required": false; "isSignal": true; }; "closeMenuLabel": { "alias": "closeMenuLabel"; "required": false; "isSignal": true; }; }, { "activeSectionKey": "activeSectionKeyChange"; "collapsed": "collapsedChange"; "mobileOpen": "mobileOpenChange"; "sectionSelected": "sectionSelected"; "itemClick": "itemClick"; "setLang": "setLang"; "logoutRequested": "logoutRequested"; "toggleSidebar": "toggleSidebar"; "workspaceClick": "workspaceClick"; }, never, never, true, never>;
118
152
  }
119
153
 
120
154
  export { RailSidebarComponent };
@@ -1,21 +1,97 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { FormGroup } from '@angular/forms';
2
+ import { LucideFunnelX, LucideCircleCheck, LucideCircleX, LucideTrash2 } from '@lucide/angular';
3
3
  import { TagSeverity } from 'shirkasoft-ui-components/tag';
4
4
 
5
+ /** Match modes available in the column filter menu. */
6
+ type FilterMatchMode = 'startsWith' | 'contains' | 'notContains' | 'endsWith' | 'equals' | 'notEquals' | 'lt' | 'lte' | 'gt' | 'gte' | 'dateIs' | 'dateIsNot' | 'dateBefore' | 'dateAfter' | 'in' | 'between';
7
+ /** How the rules of a column filter are combined ("Match All" / "Match Any"). */
8
+ type FilterOperator = 'and' | 'or';
9
+ /** A single rule (constraint) of a column filter. */
10
+ interface FilterRule {
11
+ matchMode: FilterMatchMode;
12
+ value: any;
13
+ }
14
+ /** Full filter state of a column: operator + one or more rules. */
15
+ interface ColumnFilterState {
16
+ operator: FilterOperator;
17
+ rules: FilterRule[];
18
+ }
19
+ /**
20
+ * Column filter types:
21
+ * - `text`: text input with match modes (starts with, contains...). `exact` is
22
+ * a `text` filter whose default match mode is `equals`.
23
+ * - `numeric`: number input with match modes (=, ≠, <, ≤, >, ≥).
24
+ * - `date`: date input with match modes (is, is not, before, after).
25
+ * - `select`: single option, applied immediately.
26
+ * - `multiselect`: several options (match mode `in`), applied immediately.
27
+ * - `boolean`: tri-state checkbox (any / true / false), applied immediately.
28
+ * - `range`: two-thumb slider (match mode `between`), applied on release.
29
+ */
30
+ type ColumnFilterType = 'text' | 'exact' | 'select' | 'multiselect' | 'numeric' | 'date' | 'boolean' | 'range';
31
+ /** Option of a `select` / `multiselect` filter. */
32
+ interface FilterOption {
33
+ label: string;
34
+ value: any;
35
+ /** Optional image (avatar, flag...) shown next to the label. */
36
+ image?: string;
37
+ }
5
38
  interface Column {
39
+ /** Row property to display. Supports dot paths (e.g. `'country.name'`). */
6
40
  field: string;
7
41
  header: string;
8
42
  sortable?: boolean;
9
43
  filter?: boolean;
10
44
  filterPlaceholder?: string;
45
+ /** Minimum column width used on narrow containers (horizontal scroll). */
11
46
  width?: string;
47
+ /** Minimum column width applied always (e.g. `'12rem'`). */
48
+ minWidth?: string;
12
49
  defaultSort?: true;
13
- filterType?: 'text' | 'exact' | 'select';
14
- filterOptions?: {
15
- label: string;
16
- value: any;
17
- }[];
18
- template?: 'text' | 'tag';
50
+ filterType?: ColumnFilterType;
51
+ filterOptions?: FilterOption[];
52
+ /** Row property used to filter (and sort), when different from `field`. Supports dot paths. */
53
+ filterField?: string;
54
+ /** Initial match mode of the filter (defaults depend on `filterType`). */
55
+ filterMatchMode?: FilterMatchMode;
56
+ /** Shows the match mode selector (default true for text/numeric/date). */
57
+ showMatchModes?: boolean;
58
+ /** Shows the "Match All / Match Any" selector (default true for text/numeric/date). */
59
+ showOperator?: boolean;
60
+ /** Shows the "Add Rule" button (default true for text/numeric/date). */
61
+ showAddButton?: boolean;
62
+ /** Maximum number of rules in the filter menu (default 2). */
63
+ maxConstraints?: number;
64
+ /** Title shown at the top of the filter menu (e.g. `'Agent Picker'`). */
65
+ filterMenuTitle?: string;
66
+ /** Lower bound of a `range` filter (default 0). */
67
+ filterMin?: number;
68
+ /** Upper bound of a `range` filter (default 100). */
69
+ filterMax?: number;
70
+ /** Step of a `range` filter (default 1). */
71
+ filterStep?: number;
72
+ /**
73
+ * Cell template:
74
+ * - `text` (default) · `tag` · `progress` (0-100 bar) · `boolean` (check / cross icon)
75
+ * - `date` (uses `dateFormat`) · `currency` (uses `currency`)
76
+ */
77
+ template?: 'text' | 'tag' | 'progress' | 'boolean' | 'date' | 'currency';
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.
81
+ */
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
+ dateFormat?: string;
89
+ /** ISO currency code for `template: 'currency'` (default `'USD'`). */
90
+ currency?: string;
91
+ /** Image (avatar, flag...) rendered before the text of the cell. */
92
+ image?: (row: any) => string | undefined;
93
+ /** Width in px of the cell image (default 28). */
94
+ imageWidth?: number;
19
95
  format?: (row: any) => string;
20
96
  tagValue?: (row: any) => string;
21
97
  tagSeverity?: (row: any) => TagSeverity | undefined;
@@ -54,23 +130,38 @@ interface PageChangeEvent {
54
130
  pageCount: number;
55
131
  }
56
132
  interface FilterChangeEvent {
133
+ /** Value of the first active rule of each filtered column (simple mode). */
57
134
  filters: {
58
135
  [key: string]: any;
59
136
  };
137
+ /** Full state (operator + active rules) of each filtered column. */
138
+ filterMeta: {
139
+ [key: string]: ColumnFilterState;
140
+ };
60
141
  }
142
+ /** Internal filter kind (`exact` is a `text` filter). */
143
+ type FilterKind = 'text' | 'numeric' | 'date' | 'select' | 'multiselect' | 'boolean' | 'range';
61
144
  /**
62
- * Data table with sorting, column filters, global search, pagination,
63
- * row/header actions, tag cells and optional server-side mode.
145
+ * Data table with sorting, column filter menus (match modes,
146
+ * multiple rules, typed filters), global search, pagination, row/header
147
+ * actions, tag/progress/boolean cells and optional server-side mode.
64
148
  */
65
149
  declare class TableComponent {
66
150
  /** Unique id prefix so several tables on the same page don't share element ids. */
67
151
  protected readonly uid: string;
68
- private fb;
69
152
  private cdr;
70
153
  private transloco;
71
154
  private destroyRef;
155
+ private injector;
72
156
  /** Maps icon names to lucide components, falling back to a plus icon. */
73
157
  protected getIcon: (name: any) => any;
158
+ /** Icons used directly by the template (not part of the central map). */
159
+ protected readonly icons: {
160
+ clear: typeof LucideFunnelX;
161
+ yes: typeof LucideCircleCheck;
162
+ no: typeof LucideCircleX;
163
+ trash: typeof LucideTrash2;
164
+ };
74
165
  /**
75
166
  * Minimum width applied to each column (except `actions`, which keeps its
76
167
  * own computed width) only on narrow screens. On wide screens columns
@@ -116,6 +207,11 @@ declare class TableComponent {
116
207
  showSearch: _angular_core.InputSignal<boolean>;
117
208
  /** Placeholder for the global search input. */
118
209
  searchPlaceholder: _angular_core.InputSignal<string>;
210
+ /**
211
+ * Fields (dot paths allowed) searched by the global search. When empty,
212
+ * every primitive top-level value of the row is searched.
213
+ */
214
+ globalFilterFields: _angular_core.InputSignal<string[]>;
119
215
  /** Message shown when there are no rows. */
120
216
  emptyMessage: _angular_core.InputSignal<string>;
121
217
  /** Enables server-side pagination/filtering/sorting mode. */
@@ -129,6 +225,38 @@ declare class TableComponent {
129
225
  }[]>;
130
226
  /** Currently active filter chip value. */
131
227
  activeFilter: _angular_core.InputSignal<string>;
228
+ /** Draws vertical lines between columns (grid look). */
229
+ showGridlines: _angular_core.InputSignal<boolean>;
230
+ /**
231
+ * With `showGridlines`, lets the user widen/narrow columns by dragging the
232
+ * header border (double click resets, arrow keys adjust).
233
+ */
234
+ resizableColumns: _angular_core.InputSignal<boolean>;
235
+ /**
236
+ * Highlights rows where a `required` column is empty: warning row, an icon
237
+ * listing the missing fields and a "Falta …" text in the empty cell.
238
+ */
239
+ validateRequired: _angular_core.InputSignal<boolean>;
240
+ /**
241
+ * Column widths (px) keyed by field. Two-way bindable via
242
+ * `[(columnWidths)]` to restore/save them yourself.
243
+ */
244
+ columnWidths: _angular_core.ModelSignal<Record<string, number>>;
245
+ /**
246
+ * When set, column widths are saved in the browser storage under this key
247
+ * and restored on load (they take precedence over `columnWidths`).
248
+ */
249
+ stateKey: _angular_core.InputSignal<string>;
250
+ /** Storage used with `stateKey`. */
251
+ stateStorage: _angular_core.InputSignal<"local" | "session">;
252
+ /** Highlights the row under the pointer. */
253
+ rowHover: _angular_core.InputSignal<boolean>;
254
+ /** Shows the "Clear" button that resets search, column filters and sort. */
255
+ showClearButton: _angular_core.InputSignal<boolean>;
256
+ /** Shows the "X to Y of Z" report in the paginator. */
257
+ showPageReport: _angular_core.InputSignal<boolean>;
258
+ /** Shows the rows-per-page selector in the paginator. */
259
+ showRowsPerPage: _angular_core.InputSignal<boolean>;
132
260
  /** Whether to render the leading checkbox column for multi-row selection. */
133
261
  selectable: _angular_core.InputSignal<boolean>;
134
262
  /**
@@ -146,12 +274,17 @@ declare class TableComponent {
146
274
  refresh: _angular_core.OutputEmitterRef<void>;
147
275
  /** Emits page changes (server-side mode) with first/rows/page info. */
148
276
  pageChange: _angular_core.OutputEmitterRef<PageChangeEvent>;
149
- /** Emits the active column filters. */
277
+ /** Emits the active column filters (server-side mode). */
150
278
  filterChange: _angular_core.OutputEmitterRef<FilterChangeEvent>;
151
279
  /** Emits the debounced global search term. */
152
280
  searchChange: _angular_core.OutputEmitterRef<string>;
153
281
  /** Emits when a filter chip is clicked. */
154
282
  filterClick: _angular_core.OutputEmitterRef<string>;
283
+ /** Emits when a column is resized (`width` in px, `null` when reset to auto). */
284
+ columnResize: _angular_core.OutputEmitterRef<{
285
+ field: string;
286
+ width: number | null;
287
+ }>;
155
288
  /** Internal copy of the input data used as the base for search/filter. */
156
289
  private originalData;
157
290
  /** Rows after the global search is applied. */
@@ -164,10 +297,6 @@ declare class TableComponent {
164
297
  localTotalRecords: _angular_core.WritableSignal<number>;
165
298
  /** Index of the first row of the current page. */
166
299
  first: _angular_core.WritableSignal<number>;
167
- /** Visibility map for each column filter input. */
168
- showFilterInput: _angular_core.WritableSignal<{
169
- [key: string]: boolean;
170
- }>;
171
300
  /** Current global search term. */
172
301
  searchQuery: _angular_core.WritableSignal<string>;
173
302
  /** Currently sorted field. */
@@ -176,21 +305,28 @@ declare class TableComponent {
176
305
  sortOrder: _angular_core.WritableSignal<number>;
177
306
  /** Local rows per page, kept in sync with the `rowsPerPage` input. */
178
307
  rowsPerPageLocal: _angular_core.WritableSignal<number>;
308
+ /** Applied filter state of each filterable column, keyed by field. */
309
+ filterState: _angular_core.WritableSignal<Record<string, ColumnFilterState>>;
310
+ /** Field whose filter menu is open (only one at a time). */
311
+ openFilterField: _angular_core.WritableSignal<string | null>;
312
+ /** Filter being edited in the open menu (committed on Apply). */
313
+ filterDraft: _angular_core.WritableSignal<ColumnFilterState | null>;
314
+ /** Whether the option list of the multiselect filter is expanded. */
315
+ multiselectOpen: _angular_core.WritableSignal<boolean>;
179
316
  /** Total number of pages based on the effective record count. */
180
317
  totalPages: _angular_core.Signal<number>;
181
318
  /** Current page number (1-based). */
182
319
  currentPage: _angular_core.Signal<number>;
183
- /** Reactive form holding the value of each column filter. */
184
- columnFiltersForm: FormGroup;
320
+ /** Whether any column can be filtered. */
321
+ hasFilterableColumns: _angular_core.Signal<boolean>;
185
322
  /** Subjects used to debounce column filters (server mode) and search. */
186
323
  private filterSubject;
187
324
  private searchSubject;
188
325
  /**
189
326
  * Signature of the last built set of filterable fields (+filter type) to
190
- * avoid rebuilding the form (and losing user input) on reference changes.
327
+ * avoid resetting the filters (and losing user input) on reference changes.
191
328
  */
192
329
  private lastFilterFieldsSignature;
193
- private columnFilterSubscriptions;
194
330
  /** Columns array with the leading `actions` column when row actions exist. */
195
331
  columnsWithActions: _angular_core.Signal<Column[]>;
196
332
  /** Keys of the selected rows, for O(1) lookups in the template. */
@@ -207,6 +343,24 @@ declare class TableComponent {
207
343
  visibleBulkActions: _angular_core.Signal<BulkAction[]>;
208
344
  /** Number of rendered columns, including the selection column. */
209
345
  totalColspan: _angular_core.Signal<number>;
346
+ /** Columns checked by the validation (empty when it's disabled). */
347
+ private requiredColumns;
348
+ /** Whether a value counts as missing: null, undefined, blank text or empty array. */
349
+ private isEmptyValue;
350
+ private columnMissing;
351
+ /** Missing required columns of each displayed row (cached per render). */
352
+ private missingByRow;
353
+ /** Required columns that are empty in the row. */
354
+ missingFields(row: any): Column[];
355
+ /** Whether a cell is a required field without value. */
356
+ isCellMissing(col: Column, row: any): boolean;
357
+ /**
358
+ * Number of rows with missing data in the whole dataset (client mode) or in
359
+ * the current page (server mode).
360
+ */
361
+ missingRowsCount: _angular_core.Signal<number>;
362
+ protected missingCellMessage(col: Column): string;
363
+ protected missingRowMessage(missing: Column[]): string;
210
364
  /** Total records: server-provided in server mode, locally computed otherwise. */
211
365
  effectiveTotalRecords: _angular_core.Signal<number>;
212
366
  /**
@@ -221,23 +375,65 @@ declare class TableComponent {
221
375
  pageReport: _angular_core.Signal<string>;
222
376
  constructor();
223
377
  /**
224
- * Builds (or keeps) the reactive form with one control per filterable
225
- * column. The form is only rebuilt when the set of filterable
226
- * fields/filter types changes, preserving the values already typed by the
227
- * user otherwise. Previous subscriptions are unsubscribed to avoid leaks.
378
+ * Translates a key, falling back to a built-in (Spanish) label when the app
379
+ * doesn't provide it. Reads the translation signals so template calls are
380
+ * re-evaluated when the language or the loaded translations change.
381
+ */
382
+ protected tr(key: string, fallback: string, params?: Record<string, unknown>): string;
383
+ /** Translated label of a filter menu text (`table.filter.<name>`). */
384
+ protected filterLabel(name: string, params?: Record<string, unknown>): string;
385
+ /** Translated label of a match mode (`table.filter.matchModes.<mode>`). */
386
+ protected matchModeLabel(mode: FilterMatchMode): string;
387
+ /** Reads a row value by field name or dot path (`'country.name'`). */
388
+ resolveField(row: any, path: string): any;
389
+ /** Field used to filter/sort a column. */
390
+ private filterFieldOf;
391
+ /** Lowercases and strips diacritics so "garcia" matches "García". */
392
+ private normalize;
393
+ /** Internal filter kind of a column. */
394
+ filterKind(col: Column): FilterKind;
395
+ /** Match modes offered by a column's filter menu. */
396
+ matchModesFor(col: Column): FilterMatchMode[];
397
+ /** Default match mode of a column's filter. */
398
+ private defaultMatchMode;
399
+ /** Whether the column's filter kind supports match modes / several rules. */
400
+ private supportsRules;
401
+ showMatchModesFor(col: Column): boolean;
402
+ showOperatorFor(col: Column): boolean;
403
+ canAddRule(col: Column): boolean;
404
+ /** Whether changes are applied as soon as the value changes (no Apply needed). */
405
+ private appliesImmediately;
406
+ /** Empty filter state of a column. */
407
+ private emptyFilterState;
408
+ private cloneState;
409
+ /** Bounds of a `range` filter. */
410
+ rangeBounds(col: Column): [number, number];
411
+ /** Whether a rule has a value that actually filters. */
412
+ private isRuleActive;
413
+ private activeRules;
414
+ /** Converts a Date / ISO string / timestamp into a local midnight timestamp. */
415
+ private toDay;
416
+ /** Evaluates one rule against a cell value. */
417
+ private matchRule;
418
+ /**
419
+ * Keeps one filter state per filterable column. The state is only reset
420
+ * when the set of filterable fields/filter types changes, preserving what
421
+ * the user already applied otherwise.
228
422
  */
229
423
  private setupColumnFilters;
230
- /** Collects the non-empty column filter values and emits them. */
424
+ /** Collects the active column filters and emits them. */
231
425
  private emitFilterChange;
232
426
  /** Applies the global search over the original data (client mode). */
233
427
  private applySearch;
234
428
  /** Entry point that applies search (which cascades into column filters). */
235
429
  private applyFilters;
236
430
  /**
237
- * Applies every column filter on top of the searched data using each
238
- * column's `filterType` ('select', 'exact' or text contains).
431
+ * Applies every column filter on top of the searched data. The active rules
432
+ * of a column are combined with its operator (Match All / Match Any).
239
433
  */
240
434
  private applyColumnFilters;
435
+ /** Re-runs filtering after a filter state change. */
436
+ private onFiltersChanged;
241
437
  /** Slices the filtered rows for the current page. */
242
438
  private updateDisplayedData;
243
439
  /** Identity used for a row inside the selection. */
@@ -265,6 +461,38 @@ declare class TableComponent {
265
461
  * after a bulk delete) and refreshes kept rows with their new references.
266
462
  */
267
463
  private pruneSelection;
464
+ /** Minimum width (px) a column can be resized to. */
465
+ private readonly MIN_COLUMN_WIDTH;
466
+ /** Actions column auto width: button (2rem) + 1px gap, cell padding, header room. */
467
+ private readonly ACTION_BUTTON_WIDTH;
468
+ private readonly ACTIONS_CELL_PADDING;
469
+ private readonly MIN_ACTIONS_WIDTH;
470
+ /** Field being resized right now (for the active handle style). */
471
+ resizingField: _angular_core.WritableSignal<string | null>;
472
+ /** Set right after a drag so the click that ends it doesn't sort the column. */
473
+ private suppressHeaderClick;
474
+ /** Whether columns can be resized (only with gridlines). */
475
+ isResizable: _angular_core.Signal<boolean>;
476
+ /** CSS width of a resized column, or null when it uses the automatic width. */
477
+ resizedWidth(col: Column): string | null;
478
+ resizedWidthPx(col: Column): number | null;
479
+ /** Header click: sorts unless the click is the end of a resize drag. */
480
+ onHeaderClick(col: Column): void;
481
+ /** Starts dragging the right border of a header cell. */
482
+ startResize(event: PointerEvent, col: Column): void;
483
+ /** Arrow keys on the handle widen/narrow the column (Shift = bigger steps). */
484
+ onResizerKeydown(event: KeyboardEvent, col: Column): void;
485
+ /** Stores the width the column really has (it may be wider than requested). */
486
+ private syncRenderedWidth;
487
+ /** Resets every column to its automatic width (also clears the saved state). */
488
+ resetColumnWidths(): void;
489
+ private storageFor;
490
+ /** Reads saved widths, ignoring missing, invalid or blocked storage. */
491
+ private readStoredWidths;
492
+ private writeStoredWidths;
493
+ /** Resets a column to its automatic width (double click on the handle). */
494
+ resetColumnWidth(col: Column): void;
495
+ private setColumnWidth;
268
496
  /** Emits the filter chip clicked in the template. */
269
497
  onFilterClick(value: string): void;
270
498
  /** Toggles the sort direction of a column (first click sorts ascending). */
@@ -276,35 +504,73 @@ declare class TableComponent {
276
504
  private applySort;
277
505
  /** Handles the global search input (updates query, resets page, debounces server mode). */
278
506
  onSearchInput(value: string): void;
279
- /** Clears a column filter value and hides its input. */
507
+ /** Whether a column has an applied (non-empty) filter. */
508
+ hasFilterValue(field: string): boolean;
509
+ /** Whether any column filter or the global search is active. */
510
+ hasActiveFilters: _angular_core.Signal<boolean>;
511
+ /** Commits the draft of a column into the applied filter state. */
512
+ private commitDraft;
513
+ setDraftOperator(operator: FilterOperator): void;
514
+ setDraftMatchMode(col: Column, index: number, matchMode: FilterMatchMode): void;
515
+ setDraftValue(col: Column, index: number, value: any): void;
516
+ /** Raw value typed in a rule input, converted for its filter kind. */
517
+ onRuleInput(col: Column, index: number, raw: string): void;
518
+ /** Value of a numeric input (`null` when empty). */
519
+ numericValue(raw: string): number | null;
520
+ addRule(col: Column): void;
521
+ removeRule(index: number): void;
522
+ /** Applies the draft (Apply button / Enter) and closes the menu. */
523
+ applyFilter(col: Column): void;
524
+ /** Clears a column filter and closes its menu. */
280
525
  clearFilter(field: string): void;
526
+ /** Multiselect helpers. */
527
+ isOptionSelected(value: any): boolean;
528
+ toggleOption(col: Column, value: any): void;
529
+ selectedOptionsLabel(col: Column): string;
530
+ /** Select filter: picks an option (clicking the selected one clears it) and collapses the list. */
531
+ selectOption(col: Column, value: any): void;
532
+ selectedSingleLabel(col: Column): string;
533
+ /** Boolean filter: cycles any → true → false → any. */
534
+ cycleBoolean(col: Column): void;
535
+ /** Current [low, high] of a range filter draft. */
536
+ rangeValue(col: Column): [number, number];
537
+ /** Updates one thumb of the range slider; `commit` applies it (on release). */
538
+ onRangeInput(col: Column, thumb: 0 | 1, raw: string, commit: boolean): void;
539
+ /** Position (0-100%) of a range value on the track. */
540
+ rangePercent(col: Column, value: number): number;
541
+ /**
542
+ * Resets the global search, every column filter, the sort and the page
543
+ * (the "Clear" button).
544
+ */
545
+ clearAll(): void;
281
546
  /** Width (px) of the column filter popup, used to keep it inside the viewport. */
282
547
  private readonly FILTER_POPUP_WIDTH;
283
548
  /** Viewport position of the open column filter popup. */
284
549
  filterPopupPosition: _angular_core.WritableSignal<{
285
550
  top: number;
286
551
  left: number;
552
+ maxHeight: number;
287
553
  }>;
288
554
  /** Filter button the open popup is anchored to, and its scroll/resize listener cleanup. */
289
555
  private filterAnchor;
290
556
  private filterListenersCleanup;
291
557
  /**
292
- * Toggles a column filter popup. Only one popup is open at a time. The
293
- * popup uses `position: fixed` anchored to the filter button, so the
294
- * header cell (`overflow: hidden`) and the scroll wrapper can't clip it.
558
+ * Toggles a column filter menu. Only one menu is open at a time. The menu
559
+ * uses `position: fixed` anchored to the filter button, so the header cell
560
+ * and the scroll wrapper can't clip it. Edits go to a draft that is applied
561
+ * with the Apply button (select/multiselect/boolean/range apply instantly).
295
562
  */
296
- toggleFilter(field: string, event?: Event): void;
297
- /** Closes every column filter popup (values are kept). */
563
+ toggleFilter(col: Column, event?: Event): void;
564
+ /** Field name usable inside an element id. */
565
+ safeId(field: string): string;
566
+ /** Closes the column filter menu (unapplied draft changes are discarded). */
298
567
  closeFilters(): void;
299
- /** Places the filter popup under its button, clamped to the viewport. */
568
+ /** Places the filter menu under its button, clamped to the viewport. */
300
569
  private updateFilterPopupPosition;
301
- /**
302
- * Whether a column filter is non-empty. Avoids treating the number 0 as
303
- * "no value".
304
- */
305
- hasFilterValue(field: string): boolean;
306
570
  /** Returns the reactive page report string (template helper). */
307
571
  getPageReport(): string;
572
+ /** Goes to a page (0-based), emitting pageChange in server-side mode. */
573
+ goToPage(page: number): void;
308
574
  /** Goes to the first page (emits pageChange in server-side mode). */
309
575
  goToFirst(): void;
310
576
  /** Goes to the last page (emits pageChange in server-side mode). */
@@ -342,6 +608,8 @@ declare class TableComponent {
342
608
  isRowActionVisible(action: RowAction, rowData: any): boolean;
343
609
  /** Truncates a value with an ellipsis past the given character limit. */
344
610
  truncate(value: any, limit?: number): string;
611
+ /** Value of a `progress` cell clamped to 0-100. */
612
+ getProgress(col: Column, rowData: any): number;
345
613
  /** Resolves the value displayed inside a tag cell, static or per-row function. */
346
614
  getTagValue(col: Column, rowData: any): string;
347
615
  /** Resolves and validates the tag severity, falling back to 'secondary'. */
@@ -382,11 +650,11 @@ declare class TableComponent {
382
650
  private getRowKey;
383
651
  /** Closes all open action dropdowns when clicking anywhere on the document. */
384
652
  onDocumentClick(): void;
385
- /** Closes the column filter popup with Escape. */
653
+ /** Closes the column filter menu with Escape. */
386
654
  onEscape(): void;
387
655
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
388
- 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; }; "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; }; }, { "selection": "selectionChange"; "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; }, never, never, true, never>;
656
+ 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; }; "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>;
389
657
  }
390
658
 
391
659
  export { TableComponent };
392
- export type { BulkAction, Column, FilterChangeEvent, PageChangeEvent, RowAction, TableAction };
660
+ export type { BulkAction, Column, ColumnFilterState, ColumnFilterType, FilterChangeEvent, FilterMatchMode, FilterOperator, FilterOption, FilterRule, PageChangeEvent, RowAction, TableAction };