shirkasoft-ui-components 1.3.15 → 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 -71
  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 +163 -102
  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 -80
  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
@@ -6,10 +6,11 @@ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
6
  import * as i2 from '@jsverse/transloco';
7
7
  import { TranslocoService, TranslocoModule } from '@jsverse/transloco';
8
8
  import { Subject, debounceTime } from 'rxjs';
9
- import { LucidePlus, LucideCircleAlert, LucideTrash2, LucideCircleX, LucideCircleCheck, LucideFunnelX, LucideDynamicIcon } from '@lucide/angular';
9
+ import { LucidePlus, LucideOctagonAlert, LucideTriangleAlert, LucideInfo, LucideTrash2, LucideCircleX, LucideCircleCheck, LucideFunnelX, ShkIconDirective } from 'shirkasoft-ui-components/icons';
10
10
  import { TagComponent } from 'shirkasoft-ui-components/tag';
11
11
  import { TooltipComponent } from 'shirkasoft-ui-components/tooltip';
12
- import { getIcon, PortalDirective } from 'shirkasoft-ui-components/utils';
12
+ import { getIcon, isIconResolver, PortalDirective } from 'shirkasoft-ui-components/utils';
13
+ import { ShkConfigService, formatDateStyle, resolveDateFormat, formatDate, formatCurrency } from 'shirkasoft-ui-components/config';
13
14
 
14
15
  /** Match modes offered by each filter kind that has a match mode selector. */
15
16
  const MATCH_MODES = {
@@ -50,6 +51,20 @@ const FILTER_LABELS = {
50
51
  * Belongs to Shirkasoft.
51
52
  */
52
53
  /** Counter used to generate unique element ids per table instance. */
54
+ /**
55
+ * Angular `DatePipe` named formats accepted in `Column.dateFormat`:
56
+ * `[dateStyle, timeStyle?]` rendered with `Intl`.
57
+ */
58
+ const NAMED_DATE_STYLES = {
59
+ shortDate: ['short'],
60
+ mediumDate: ['medium'],
61
+ longDate: ['long'],
62
+ fullDate: ['full'],
63
+ short: ['short', 'short'],
64
+ medium: ['medium', 'medium'],
65
+ long: ['long', 'long'],
66
+ full: ['full', 'full'],
67
+ };
53
68
  let nextTableId = 0;
54
69
  /**
55
70
  * Data table with sorting, column filter menus (match modes,
@@ -61,72 +76,98 @@ class TableComponent {
61
76
  getColumnWidth(col) {
62
77
  return this.resizedWidth(col) || col.width || this.DEFAULT_COLUMN_WIDTH;
63
78
  }
64
- /** Whether a value counts as missing: null, undefined, blank text or empty array. */
65
- isEmptyValue(value) {
66
- if (value === null || value === undefined)
67
- return true;
68
- if (typeof value === 'string')
69
- return value.trim() === '';
70
- if (Array.isArray(value))
71
- return value.length === 0;
72
- return false;
73
- }
74
- /**
75
- * Whether the requirement fails for a row: its condition (when `required`
76
- * is a function) must apply, and then the value must be missing.
77
- */
78
- requirementMissing(req, row) {
79
- if (typeof req.required === 'function' && !req.required(row))
80
- return false;
81
- return req.isMissing ? !!req.isMissing(row) : this.isEmptyValue(this.resolveField(row, req.field));
79
+ /** Evaluates the rules against a row and returns its violations (messages already translated). */
80
+ collectViolations(row, entries = Object.entries(this.rowValidations())) {
81
+ const violations = [];
82
+ for (const [field, rule] of entries) {
83
+ if (!rule || typeof rule.condition !== 'function')
84
+ continue;
85
+ const value = this.resolveField(row, field);
86
+ let failed = false;
87
+ try {
88
+ failed = !!rule.condition(value, row);
89
+ }
90
+ catch {
91
+ failed = false;
92
+ }
93
+ if (!failed)
94
+ continue;
95
+ violations.push({
96
+ field,
97
+ severity: rule.severity ?? 'critical',
98
+ message: this.resolveViolationMessage(rule, value, row),
99
+ });
100
+ }
101
+ return violations;
82
102
  }
83
- /** Required columns that are empty in the row. */
84
- missingFields(row) {
85
- return this.missingByRow().get(row) ?? [];
103
+ /** Message of a rule: translated when `message` is a registered key, literal otherwise. */
104
+ resolveViolationMessage(rule, value, row) {
105
+ if (!rule.message)
106
+ return undefined;
107
+ return this.tr(rule.message, rule.message, rule.messageParams?.(value, row));
86
108
  }
87
- /** Whether a cell is a required column without value. */
88
- isCellMissing(col, row) {
89
- return !!col.required && this.missingFields(row).some((req) => req.column === col);
109
+ /** Violations of a row (empty when it has no issues). */
110
+ rowViolationsOf(row) {
111
+ return this.violationsByRow().get(row) ?? this.collectViolations(row);
90
112
  }
91
113
  /**
92
- * Checks an object (e.g. the payload returned by a modal) against the
93
- * `required` columns, returning the ones it's missing (empty = complete). Works even when `validateRequired` is off, so it can
94
- * be used before adding the row.
114
+ * Highest severity of a row: `'critical'` > `'moderate'` > `'low'`, or `null`
115
+ * when the row has no issues.
95
116
  */
96
- validateRow(row) {
97
- return this.allRequirements()
98
- .filter((req) => this.requirementMissing(req, row))
99
- .map((req) => ({ field: req.field, header: req.header, severity: this.severityOf(req.column) }));
117
+ rowSeverity(row) {
118
+ let severity = null;
119
+ for (const violation of this.rowViolationsOf(row)) {
120
+ if (!severity || this.severityRank[violation.severity] > this.severityRank[severity]) {
121
+ severity = violation.severity;
122
+ }
123
+ }
124
+ return severity;
100
125
  }
101
126
  /**
102
- * Severity of a row: `'error'` when a mandatory (error) field is missing,
103
- * `'warning'` when only informative fields are missing, `null` when complete.
127
+ * Checks any object (e.g. the payload of a modal) against `rowValidations`,
128
+ * returning its violations (empty = no issues). The row doesn't need to be
129
+ * displayed, so it can be used before adding it.
104
130
  */
105
- rowSeverity(row) {
106
- const missing = this.missingFields(row);
107
- if (!missing.length)
108
- return null;
109
- return missing.some((req) => this.severityOf(req.column) === 'error') ? 'error' : 'warning';
110
- }
111
- /** Severity of a column's missing value (its own, or the table default). */
112
- severityOf(col) {
113
- return col.missingSeverity ?? (this.missingAsError() ? 'error' : 'warning');
114
- }
115
- /** Icon of a missing cell: error circle or warning triangle. */
116
- missingIconFor(col) {
117
- return this.severityOf(col) === 'error' ? this.icons.error : this.getIcon('triangle-alert');
118
- }
119
- missingCellMessage(col) {
120
- return col.missingMessage || this.tr('table.missing.cell', 'Falta {{field}}', { field: col.header });
131
+ validateRow(row) {
132
+ return this.collectViolations(row);
133
+ }
134
+ /** Tooltip of a row: its violation messages, one per line. */
135
+ rowValidationTitle(row) {
136
+ const messages = this.rowViolationsOf(row)
137
+ .map((violation) => violation.message)
138
+ .filter((message) => !!message);
139
+ return messages.length ? messages.join('\n') : null;
140
+ }
141
+ /** Icon of the severity indicator shown in the actions cell. */
142
+ rowValidationIcon(row) {
143
+ const severity = this.rowSeverity(row);
144
+ return severity ? this.icons[severity] : this.icons.low;
145
+ }
146
+ /** Accessible label of the severity indicator (the messages, or the severity). */
147
+ rowValidationLabel(row) {
148
+ const title = this.rowValidationTitle(row);
149
+ if (title)
150
+ return title;
151
+ const severity = this.rowSeverity(row);
152
+ const fallbacks = {
153
+ low: 'Fila con observaciones',
154
+ moderate: 'Fila con advertencias',
155
+ critical: 'Fila con errores',
156
+ };
157
+ return severity
158
+ ? this.tr(`table.severity.${severity}`, fallbacks[severity])
159
+ : '';
121
160
  }
122
161
  constructor() {
123
162
  /** Unique id prefix so several tables on the same page don't share element ids. */
124
163
  this.uid = `shk-table-${nextTableId++}`;
125
164
  this.cdr = inject(ChangeDetectorRef);
126
165
  this.transloco = inject(TranslocoService);
166
+ /** Library-wide options: default date pattern, locale and currency of the cells. */
167
+ this.config = inject(ShkConfigService);
127
168
  this.destroyRef = inject(DestroyRef);
128
169
  this.injector = inject(Injector);
129
- /** Maps icon names to lucide components, falling back to a plus icon. */
170
+ /** Maps icon names to SVG data, falling back to a plus icon. */
130
171
  this.getIcon = (name) => getIcon(name, LucidePlus);
131
172
  /** Icons used directly by the template (not part of the central map). */
132
173
  this.icons = {
@@ -134,7 +175,9 @@ class TableComponent {
134
175
  yes: LucideCircleCheck,
135
176
  no: LucideCircleX,
136
177
  trash: LucideTrash2,
137
- error: LucideCircleAlert,
178
+ low: LucideInfo,
179
+ moderate: LucideTriangleAlert,
180
+ critical: LucideOctagonAlert,
138
181
  };
139
182
  /**
140
183
  * Minimum width applied to each column (except `actions`, which keeps its
@@ -204,15 +247,12 @@ class TableComponent {
204
247
  */
205
248
  this.resizableColumns = input(true, ...(ngDevMode ? [{ debugName: "resizableColumns" }] : /* istanbul ignore next */ []));
206
249
  /**
207
- * Highlights the rows where a `required` column is empty (red for errors,
208
- * amber for warnings) and writes "Falta <header>" in the empty cell.
209
- */
210
- this.validateRequired = input(false, ...(ngDevMode ? [{ debugName: "validateRequired" }] : /* istanbul ignore next */ []));
211
- /**
212
- * Default severity of missing cells: errors (red) when true, warnings
213
- * (amber) when false. Each column can override it with `missingSeverity`.
250
+ * Rules to flag rows with problems, keyed by field of the payload. Each rule
251
+ * applies a condition to the value of that field and paints the whole row:
252
+ * `low` blue, `moderate` amber, `critical` red. When a row has several
253
+ * issues the worst severity wins. See `RowValidation`.
214
254
  */
215
- this.missingAsError = input(true, ...(ngDevMode ? [{ debugName: "missingAsError" }] : /* istanbul ignore next */ []));
255
+ this.rowValidations = input({}, ...(ngDevMode ? [{ debugName: "rowValidations" }] : /* istanbul ignore next */ []));
216
256
  /**
217
257
  * Column widths (px) keyed by field. Two-way bindable via
218
258
  * `[(columnWidths)]` to restore/save them yourself.
@@ -242,6 +282,12 @@ class TableComponent {
242
282
  this.dataKey = input('id', ...(ngDevMode ? [{ debugName: "dataKey" }] : /* istanbul ignore next */ []));
243
283
  /** Optional predicate to disable the checkbox of specific rows. */
244
284
  this.isRowSelectable = input(undefined, ...(ngDevMode ? [{ debugName: "isRowSelectable" }] : /* istanbul ignore next */ []));
285
+ /**
286
+ * With `selectable`, clicking anywhere on a row toggles its selection (not
287
+ * only the checkbox). Clicks on buttons, links and form controls inside the
288
+ * row (row actions, custom templates) are ignored.
289
+ */
290
+ this.selectOnRowClick = input(false, ...(ngDevMode ? [{ debugName: "selectOnRowClick" }] : /* istanbul ignore next */ []));
245
291
  /** Actions shown in the header while at least one row is selected. */
246
292
  this.bulkActions = input([], ...(ngDevMode ? [{ debugName: "bulkActions" }] : /* istanbul ignore next */ []));
247
293
  /** Selected rows. Supports two-way binding via `[(selection)]`. */
@@ -306,22 +352,27 @@ class TableComponent {
306
352
  const showAction = this.showActionRow();
307
353
  const rowActionsArray = this.rowActions();
308
354
  const translatedHeader = this.actionsHeaderLabel();
309
- if (showAction && rowActionsArray.length > 0) {
355
+ // The severity indicator lives in the actions cell, so the column is also
356
+ // rendered when there are no row actions but a displayed row has issues.
357
+ const rows = this.effectiveDisplayedData();
358
+ const hasIndicator = rows.some((row) => this.rowViolationsOf(row).length > 0);
359
+ if ((showAction && rowActionsArray.length > 0) || hasIndicator) {
310
360
  // Width from the actions really shown on the current page (each row can
311
361
  // hide some with `isVisible`), not from every action defined.
312
- const rows = this.effectiveDisplayedData();
313
- let buttons = 0;
362
+ let buttons = hasIndicator ? 1 : 0;
314
363
  if (rows.length) {
315
364
  for (const row of rows) {
316
365
  const n = rowActionsArray.filter((a) => this.isRowActionVisible(a, row)).length;
317
366
  const shown = n > this.MAX_VISIBLE_ACTIONS ? this.MAX_VISIBLE_ACTIONS + 1 : n; // +1 = "more" button
318
- if (shown > buttons)
319
- buttons = shown;
367
+ if (shown + (hasIndicator ? 1 : 0) > buttons)
368
+ buttons = shown + (hasIndicator ? 1 : 0);
320
369
  }
321
370
  }
322
371
  else {
323
372
  const n = rowActionsArray.length;
324
- buttons = n > this.MAX_VISIBLE_ACTIONS ? this.MAX_VISIBLE_ACTIONS + 1 : n;
373
+ const shown = n > this.MAX_VISIBLE_ACTIONS ? this.MAX_VISIBLE_ACTIONS + 1 : n;
374
+ if (shown + (hasIndicator ? 1 : 0) > buttons)
375
+ buttons = shown + (hasIndicator ? 1 : 0);
325
376
  }
326
377
  const actionsWidth = `${Math.max(this.MIN_ACTIONS_WIDTH, this.ACTIONS_CELL_PADDING + buttons * this.ACTION_BUTTON_WIDTH)}px`;
327
378
  return [
@@ -362,31 +413,25 @@ class TableComponent {
362
413
  /** Number of rendered columns, including the selection column. */
363
414
  this.totalColspan = computed(() => this.columnsWithActions().length + (this.selectable() ? 1 : 0), ...(ngDevMode ? [{ debugName: "totalColspan" }] : /* istanbul ignore next */ []));
364
415
  // ---------------------------------------------------------------------------
365
- // Required fields validation
416
+ // Row validation
366
417
  // ---------------------------------------------------------------------------
367
- /** Every `required` column, active or not. */
368
- this.allRequirements = computed(() => this.columns()
369
- .filter((c) => c.required)
370
- .map((c) => ({
371
- field: c.field,
372
- header: c.header,
373
- required: c.required,
374
- isMissing: c.isMissing,
375
- column: c,
376
- })), ...(ngDevMode ? [{ debugName: "allRequirements" }] : /* istanbul ignore next */ []));
377
- /** Requirements checked on screen (empty when `validateRequired` is off). */
378
- this.activeRequirements = computed(() => this.validateRequired() ? this.allRequirements() : [], ...(ngDevMode ? [{ debugName: "activeRequirements" }] : /* istanbul ignore next */ []));
379
- /** Missing requirements of each displayed row (cached per render). */
380
- this.missingByRow = computed(() => {
381
- const reqs = this.activeRequirements();
418
+ /** Rank used to pick the worst severity of a row. */
419
+ this.severityRank = {
420
+ low: 0,
421
+ moderate: 1,
422
+ critical: 2,
423
+ };
424
+ /** Violations of each displayed row (cached per render, re-evaluated on i18n changes). */
425
+ this.violationsByRow = computed(() => {
382
426
  const map = new Map();
383
- if (!reqs.length)
427
+ const entries = Object.entries(this.rowValidations());
428
+ if (!entries.length)
384
429
  return map;
385
430
  for (const row of this.effectiveDisplayedData()) {
386
- map.set(row, reqs.filter((req) => this.requirementMissing(req, row)));
431
+ map.set(row, this.collectViolations(row, entries));
387
432
  }
388
433
  return map;
389
- }, ...(ngDevMode ? [{ debugName: "missingByRow" }] : /* istanbul ignore next */ []));
434
+ }, ...(ngDevMode ? [{ debugName: "violationsByRow" }] : /* istanbul ignore next */ []));
390
435
  /** Total records: server-provided in server mode, locally computed otherwise. */
391
436
  this.effectiveTotalRecords = computed(() => {
392
437
  return this.serverSide() ? this.totalRecords() : this.localTotalRecords();
@@ -925,6 +970,15 @@ class TableComponent {
925
970
  this.selection.set([...this.selection(), row]);
926
971
  }
927
972
  }
973
+ /** Row click: toggles the selection when `selectOnRowClick` is on. */
974
+ onRowClick(event, row) {
975
+ if (!this.selectable() || !this.selectOnRowClick())
976
+ return;
977
+ const target = event.target;
978
+ if (target?.closest('button, a, input, select, textarea, label, [role="button"], [data-shk-select]'))
979
+ return;
980
+ this.toggleRowSelection(row);
981
+ }
928
982
  /**
929
983
  * Header checkbox: selects every selectable row of the current page or,
930
984
  * when all of them are already selected, removes them from the selection.
@@ -1443,22 +1497,29 @@ class TableComponent {
1443
1497
  // Actions & cells
1444
1498
  // ---------------------------------------------------------------------------
1445
1499
  /** Resolves the row action label, static or per-row function. */
1500
+ /** Text of a `template: 'date'` cell (column pattern, else the `dates.*` options). */
1501
+ formatDateCell(value, col) {
1502
+ const locale = this.config.get('dates.locale')();
1503
+ const named = col.dateFormat && NAMED_DATE_STYLES[col.dateFormat];
1504
+ if (named)
1505
+ return formatDateStyle(value, named[0], locale, named[1]);
1506
+ const pattern = resolveDateFormat(col.dateFormat || this.config.get('dates.format')(), locale);
1507
+ return formatDate(value, pattern, locale);
1508
+ }
1509
+ /** Text of a `template: 'currency'` cell (column currency, else the `numbers.*` options). */
1510
+ formatCurrencyCell(value, col) {
1511
+ return formatCurrency(value, col.currency || this.config.get('numbers.currency')(), this.config.get('numbers.locale')(), this.config.get('numbers.decimals')());
1512
+ }
1446
1513
  getRowActionLabel(action, rowData) {
1447
1514
  return typeof action.label === 'function' ? action.label(rowData) : action.label;
1448
1515
  }
1449
1516
  /**
1450
- * Resolves the row action icon: a lucide component, a function returning
1451
- * the icon name, or a raw string resolved by the central icon map.
1517
+ * Resolves the row action icon: `IconNode` data, a function returning the
1518
+ * icon for the row, or a raw string resolved by the central icon map.
1452
1519
  */
1453
1520
  getRowActionIconName(action, rowData) {
1454
1521
  const icon = action.icon;
1455
- if (typeof icon === 'function') {
1456
- if (icon.prototype === undefined) {
1457
- return icon(rowData);
1458
- }
1459
- return icon;
1460
- }
1461
- return icon;
1522
+ return isIconResolver(icon) ? icon(rowData) : icon;
1462
1523
  }
1463
1524
  /** Resolves the CSS class of a row action, static or per-row function. */
1464
1525
  getRowActionClass(action, rowData) {
@@ -1616,20 +1677,20 @@ class TableComponent {
1616
1677
  onEscape() {
1617
1678
  this.closeFilters();
1618
1679
  }
1619
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1620
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: TableComponent, isStandalone: true, selector: "shk-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPage: { classPropertyName: "rowsPerPage", publicName: "rowsPerPage", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showActionRow: { classPropertyName: "showActionRow", publicName: "showActionRow", isSignal: true, isRequired: false, transformFunction: null }, customTemplates: { classPropertyName: "customTemplates", publicName: "customTemplates", isSignal: true, isRequired: false, transformFunction: null }, headerActions: { classPropertyName: "headerActions", publicName: "headerActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, hasShadow: { classPropertyName: "hasShadow", publicName: "hasShadow", isSignal: true, isRequired: false, transformFunction: null }, defaultSortField: { classPropertyName: "defaultSortField", publicName: "defaultSortField", isSignal: true, isRequired: false, transformFunction: null }, defaultSortOrder: { classPropertyName: "defaultSortOrder", publicName: "defaultSortOrder", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFields: { classPropertyName: "globalFilterFields", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, serverSide: { classPropertyName: "serverSide", publicName: "serverSide", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, activeFilter: { classPropertyName: "activeFilter", publicName: "activeFilter", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, validateRequired: { classPropertyName: "validateRequired", publicName: "validateRequired", isSignal: true, isRequired: false, transformFunction: null }, missingAsError: { classPropertyName: "missingAsError", publicName: "missingAsError", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, stateStorage: { classPropertyName: "stateStorage", publicName: "stateStorage", isSignal: true, isRequired: false, transformFunction: null }, rowHover: { classPropertyName: "rowHover", publicName: "rowHover", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showPageReport: { classPropertyName: "showPageReport", publicName: "showPageReport", isSignal: true, isRequired: false, transformFunction: null }, showRowsPerPage: { classPropertyName: "showRowsPerPage", publicName: "showRowsPerPage", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, isRowSelectable: { classPropertyName: "isRowSelectable", publicName: "isRowSelectable", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnWidths: "columnWidthsChange", selection: "selectionChange", refresh: "refresh", pageChange: "pageChange", filterChange: "filterChange", searchChange: "searchChange", filterClick: "filterClick", columnResize: "columnResize" }, host: { listeners: { "document:click": "onDocumentClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "<div class=\"space-y-2 min-[1440px]:space-y-3 mt-2 min-[1440px]:mt-3 animate-fade-in pb-8\">\n @if (\n showSearch() ||\n (showClearButton() && hasFilterableColumns()) ||\n filters().length > 0 ||\n headerActions().length > 0 ||\n (selectable() && bulkActions().length > 0 && selection().length > 0)\n ) {\n <div class=\"card p-2 min-[1440px]:p-2.5 flex flex-row items-center justify-between gap-2\">\n <div class=\"flex items-center gap-2 min-[1440px]:gap-3 flex-1 min-w-0\">\n @if (showSearch()) {\n <div class=\"relative w-full md:w-52 min-[1440px]:w-56\">\n <label [for]=\"uid + '-search'\" class=\"sr-only\">{{\n searchPlaceholder() || ('common.search_placeholder' | transloco)\n }}</label>\n <div class=\"absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none\">\n <svg\n [lucideIcon]=\"getIcon('search')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n </div>\n <input\n [id]=\"uid + '-search'\"\n type=\"text\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($any($event.target).value)\"\n [placeholder]=\"searchPlaceholder() || ('common.search_placeholder' | transloco)\"\n class=\"block w-full pl-8 pr-3 py-1.5 text-xs border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md leading-5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] placeholder:[color:var(--shk-surface-400)] dark:placeholder:[color:var(--shk-surface-500)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)] focus:outline-none focus:bg-white dark:focus:[background-color:var(--shk-surface-100)] focus:[border-color:var(--shk-primary-500)] focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)]\"\n />\n </div>\n }\n @if (showClearButton() && (hasFilterableColumns() || showSearch())) {\n <shk-tooltip [text]=\"tr('table.clearFilters', 'Limpiar b\u00FAsqueda, filtros y orden')\">\n <button\n type=\"button\"\n (click)=\"clearAll()\"\n [disabled]=\"!hasActiveFilters()\"\n class=\"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-600 dark:[color:var(--shk-surface-500)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed whitespace-nowrap\"\n >\n <svg [lucideIcon]=\"icons.clear\" class=\"w-3.5 h-3.5\"></svg>\n {{ tr('table.clear', 'Limpiar') }}\n </button>\n </shk-tooltip>\n }\n @if (filters().length > 0) {\n <div\n class=\"flex _shk-bg-surface-100 dark:[background-color:var(--shk-surface-100)] p-0.5 rounded-md ml-auto\"\n role=\"group\"\n >\n @for (f of filters(); track f.value) {\n <button\n type=\"button\"\n (click)=\"onFilterClick(f.value)\"\n [attr.aria-pressed]=\"f.value === activeFilter()\"\n class=\"px-2.5 min-[1440px]:px-3 py-1 text-xs font-medium rounded _shk-text-surface-700 dark:[color:var(--shk-surface-700)] transition-all\"\n [class]=\"\n f.value === activeFilter()\n ? 'bg-white shadow-sm dark:[background-color:var(--shk-surface-700)]'\n : ''\n \"\n >\n {{ f.label }}\n </button>\n }\n </div>\n }\n </div>\n @if (selectable() && selection().length > 0 && bulkActions().length > 0) {\n <div\n class=\"flex items-center gap-1.5 shrink-0\"\n role=\"toolbar\"\n [attr.aria-label]=\"'table.selected' | transloco: { count: selection().length }\"\n >\n <span\n class=\"text-xs font-medium _shk-text-surface-600 dark:[color:var(--shk-surface-400)] whitespace-nowrap\"\n aria-live=\"polite\"\n >{{ 'table.selected' | transloco: { count: selection().length } }}</span\n >\n <button\n type=\"button\"\n (click)=\"clearSelection()\"\n [attr.aria-label]=\"'table.clearSelection' | transloco\"\n class=\"table-action-btn rounded-md _shk-text-surface-500 dark:[color:var(--shk-surface-400)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n @for (action of visibleBulkActions(); track $index) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isBulkActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"runBulkAction(action)\"\n >\n @if (action.icon) {\n <svg [lucideIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n </div>\n }\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-1.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <svg [lucideIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n <div class=\"card p-0 overflow-hidden table-card\" [class.shadow-lg]=\"hasShadow()\">\n <div class=\"table-scroll-wrapper _shk-scrollbar\">\n <table\n [class.shk-gridlines]=\"showGridlines()\"\n [class.shk-row-hover]=\"rowHover()\"\n >\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n data-shk-select\n class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [disabled]=\"loading() || selectablePageRows().length === 0\"\n (change)=\"toggleSelectAllPage()\"\n [attr.aria-label]=\"'table.selectAll' | transloco\"\n />\n </th>\n }\n @for (col of columnsWithActions(); track col.field) {\n <th\n scope=\"col\"\n (click)=\"onHeaderClick(col)\"\n (keydown)=\"onHeaderKeydown($event, col)\"\n [tabindex]=\"col.field !== 'actions' && col.sortable ? 0 : -1\"\n [attr.role]=\"col.field !== 'actions' && col.sortable ? 'button' : null\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [style.cursor]=\"col.field !== 'actions' && col.sortable ? 'pointer' : 'default'\"\n [style.width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : null)\"\n [style.min-width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : col.minWidth) || null\"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n class=\"relative px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-left text-[10px] min-[1440px]:text-xs font-bold _shk-text-surface-500 dark:[color:var(--shk-surface-400)] uppercase tracking-wider _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)] focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n >\n @if (col.field !== 'actions') {\n <div class=\"flex items-center justify-between gap-2\">\n <span>{{ col.header }}</span>\n <div class=\"flex items-center gap-1 shrink-0\">\n @if (col.sortable) {\n <shk-tooltip [text]=\"'table.tooltips.sort' | transloco\">\n @if (sortField() === col.field) {\n <svg\n [lucideIcon]=\"getIcon(sortOrder() === 1 ? 'arrow-up' : 'arrow-down')\"\n class=\"w-3.5 h-3.5 _shk-text-primary\"\n ></svg>\n } @else {\n <svg\n [lucideIcon]=\"getIcon('arrow-up-down')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n }\n </shk-tooltip>\n }\n @if (col.filter) {\n <shk-tooltip [text]=\"'table.tooltips.filter' | transloco\">\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleFilter(col, $event)\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [attr.aria-expanded]=\"openFilterField() === col.field\"\n aria-haspopup=\"dialog\"\n class=\"_shk-text-surface-400 dark:[color:var(--shk-surface-500)] hover:[color:var(--shk-surface-600)] dark:hover:[color:var(--shk-surface-300)] transition-colors\"\n >\n <svg\n [lucideIcon]=\"getIcon('filter')\"\n class=\"w-3.5 h-3.5\"\n [class._shk-text-primary]=\"hasFilterValue(col.field) || openFilterField() === col.field\"\n ></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n </div>\n\n\n <!-- Column filter menu -->\n @if (col.filter && openFilterField() === col.field && filterDraft(); as draft) {\n <div\n shkPortal\n class=\"shk-filter-overlay fixed z-[9999] w-[240px] overflow-y-auto normal-case tracking-normal font-normal text-xs _shk-text-surface-700 dark:[color:var(--shk-surface-700)] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-lg shadow-lg\"\n role=\"dialog\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [style.top.px]=\"filterPopupPosition().top\"\n [style.left.px]=\"filterPopupPosition().left\"\n [style.max-height.px]=\"filterPopupPosition().maxHeight\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeFilters()\"\n >\n @if (col.filterMenuTitle) {\n <div class=\"px-2 pt-2 font-semibold _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">\n {{ col.filterMenuTitle }}\n </div>\n }\n @if (showOperatorFor(col)) {\n <div class=\"p-2 border-b _shk-border dark:[border-color:var(--shk-surface-200)]\">\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"filterLabel('matchAll') + ' / ' + filterLabel('matchAny')\"\n (change)=\"setDraftOperator($any($event.target).value)\"\n >\n <option value=\"and\" [selected]=\"draft.operator === 'and'\">\n {{ filterLabel('matchAll') }}\n </option>\n <option value=\"or\" [selected]=\"draft.operator === 'or'\">\n {{ filterLabel('matchAny') }}\n </option>\n </select>\n </div>\n }\n\n @switch (filterKind(col)) {\n @case ('select') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: false }\"\n ></ng-container>\n }\n @case ('multiselect') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: true }\"\n ></ng-container>\n }\n @case ('boolean') {\n @let boolValue = draft.rules[0].value;\n <div class=\"p-2\">\n <button\n type=\"button\"\n role=\"checkbox\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n class=\"inline-flex items-center gap-2 rounded-md focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n [attr.aria-checked]=\"\n boolValue === true ? 'true' : boolValue === false ? 'false' : 'mixed'\n \"\n (click)=\"cycleBoolean(col)\"\n >\n <span\n class=\"shk-checkbox-box\"\n [class.shk-checked]=\"boolValue === true || boolValue === false\"\n >\n @if (boolValue === true) {\n <svg [lucideIcon]=\"getIcon('check')\"></svg>\n } @else if (boolValue === false) {\n <svg [lucideIcon]=\"getIcon('x')\"></svg>\n }\n </span>\n <span>{{\n boolValue === true\n ? filterLabel('yes')\n : boolValue === false\n ? filterLabel('no')\n : filterLabel('any')\n }}</span>\n </button>\n </div>\n }\n @case ('range') {\n @let rv = rangeValue(col);\n @let bounds = rangeBounds(col);\n <div class=\"p-2\">\n <div class=\"shk-range\">\n <div class=\"shk-range-track\"></div>\n <div\n class=\"shk-range-fill\"\n [style.left.%]=\"rangePercent(col, rv[0])\"\n [style.width.%]=\"rangePercent(col, rv[1]) - rangePercent(col, rv[0])\"\n ></div>\n <input\n type=\"range\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[0]\"\n [style.z-index]=\"rv[0] >= bounds[1] ? 3 : null\"\n [attr.aria-label]=\"col.header + ' min'\"\n (input)=\"onRangeInput(col, 0, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 0, $any($event.target).value, true)\"\n />\n <input\n type=\"range\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[1]\"\n [attr.aria-label]=\"col.header + ' max'\"\n (input)=\"onRangeInput(col, 1, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 1, $any($event.target).value, true)\"\n />\n </div>\n <div class=\"flex items-center justify-between px-0.5 _shk-text-surface-500 dark:[color:var(--shk-surface-500)]\">\n <span>{{ rv[0] }}</span>\n <span>{{ rv[1] }}</span>\n </div>\n </div>\n }\n @default {\n <!-- text / numeric / date: one block per rule -->\n @for (rule of draft.rules; track $index; let i = $index) {\n <div\n class=\"flex flex-col gap-1.5 p-2\"\n [class.border-b]=\"i < draft.rules.length - 1\"\n [class._shk-border]=\"i < draft.rules.length - 1\"\n >\n @if (showMatchModesFor(col)) {\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"col.header\"\n (change)=\"setDraftMatchMode(col, i, $any($event.target).value)\"\n >\n @for (mode of matchModesFor(col); track mode) {\n <option [value]=\"mode\" [selected]=\"mode === rule.matchMode\">\n {{ matchModeLabel(mode) }}\n </option>\n }\n </select>\n }\n <input\n [id]=\"uid + '-filter-' + safeId(col.field) + '-' + i\"\n [type]=\"filterKind(col) === 'numeric' ? 'number' : filterKind(col) === 'date' ? 'date' : 'text'\"\n [attr.step]=\"filterKind(col) === 'numeric' ? 'any' : null\"\n class=\"shk-filter-input\"\n [value]=\"rule.value ?? ''\"\n [placeholder]=\"col.filterPlaceholder || ('common.search_placeholder' | transloco)\"\n [attr.aria-label]=\"col.header\"\n (input)=\"onRuleInput(col, i, $any($event.target).value)\"\n (keydown.enter)=\"applyFilter(col)\"\n />\n @if (draft.rules.length > 1) {\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-1 py-1 rounded-md [color:var(--shk-error-600)] hover:[background-color:var(--shk-error-50)] transition-colors\"\n (click)=\"removeRule(i)\"\n >\n <svg [lucideIcon]=\"icons.trash\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('removeRule') }}\n </button>\n }\n </div>\n }\n @if (canAddRule(col)) {\n <div class=\"px-2 pb-1\">\n <button\n type=\"button\"\n class=\"w-full inline-flex items-center justify-center gap-1 py-1 rounded-md _shk-text-primary hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"addRule(col)\"\n >\n <svg [lucideIcon]=\"getIcon('plus')\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('addRule') }}\n </button>\n </div>\n }\n }\n }\n\n <div class=\"flex items-center justify-between gap-2 p-2 border-t _shk-border dark:[border-color:var(--shk-surface-200)]\">\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-600 dark:[color:var(--shk-surface-500)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"clearFilter(col.field)\"\n >\n {{ filterLabel('clear') }}\n </button>\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors\"\n (click)=\"applyFilter(col)\"\n >\n {{ filterLabel('apply') }}\n </button>\n </div>\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center\">\n <span>{{ col.header }}</span>\n </div>\n }\n @if (isResizable()) {\n <span\n class=\"shk-col-resizer\"\n [class.shk-resizing]=\"resizingField() === col.field\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n [attr.aria-label]=\"tr('table.resizeColumn', 'Redimensionar columna') + ': ' + col.header\"\n [attr.aria-valuenow]=\"resizedWidthPx(col)\"\n (pointerdown)=\"startResize($event, col)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation(); resetColumnWidth(col)\"\n (keydown)=\"onResizerKeydown($event, col)\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n @if (loading()) {\n <tbody class=\"border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div\n class=\"flex items-center justify-center\"\n role=\"status\"\n [attr.aria-label]=\"'common.loading' | transloco\"\n >\n <svg\n [lucideIcon]=\"getIcon('loader')\"\n class=\"w-6 h-6 animate-spin _shk-text-primary\"\n ></svg>\n </div>\n </td>\n </tr>\n </tbody>\n } @else if (effectiveDisplayedData().length === 0) {\n <tbody class=\"border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div class=\"flex flex-col items-center\">\n <div\n class=\"w-16 h-16 _shk-bg-surface-100 dark:[background-color:var(--shk-surface-100)] rounded-full flex items-center justify-center mb-4\"\n >\n <svg\n [lucideIcon]=\"getIcon('inbox')\"\n class=\"w-8 h-8 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n </div>\n <p\n class=\"text-lg font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-300)]\"\n >\n {{ emptyMessage() || ('common.no_records' | transloco) }}\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n } @else {\n <tbody>\n @for (rowData of effectiveDisplayedData(); track trackByRow(rowData, $index)) {\n <tr\n [attr.aria-selected]=\"selectable() ? isRowSelected(rowData) : null\"\n [class.shk-row-selected]=\"selectable() && isRowSelected(rowData)\"\n [class.shk-row-missing-error]=\"rowSeverity(rowData) === 'error'\"\n [class.shk-row-missing-warning]=\"rowSeverity(rowData) === 'warning'\"\n class=\"shk-data-row transition-colors duration-200 border-b _shk-border dark:[border-color:var(--shk-surface-100)]\"\n >\n @if (selectable()) {\n <td data-shk-select class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center\">\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"isRowSelected(rowData)\"\n [disabled]=\"!canSelectRow(rowData)\"\n (change)=\"toggleRowSelection(rowData)\"\n [attr.aria-label]=\"'table.selectRow' | transloco: { index: first() + $index + 1 }\"\n />\n </td>\n }\n @for (col of columnsWithActions(); track col.field) {\n <td\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [class]=\"\n 'px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)] ' +\n (col.field === 'actions' ? 'whitespace-nowrap' : 'whitespace-normal break-words')\n \"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n [class.shk-cell-missing]=\"col.field !== 'actions' && isCellMissing(col, rowData)\"\n [class.shk-missing-error]=\"col.field !== 'actions' && isCellMissing(col, rowData) && severityOf(col) === 'error'\"\n [class.shk-missing-warning]=\"col.field !== 'actions' && isCellMissing(col, rowData) && severityOf(col) === 'warning'\"\n >\n @if (col.field !== 'actions' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"missingIconFor(col)\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ missingCellMessage(col) }}\n </span>\n } @else if (col.field !== 'actions') {\n @switch (col.template) {\n @case ('tag') {\n <shk-tag\n [value]=\"getTagValue(col, rowData)\"\n [severity]=\"getTagSeverity(col, rowData)\"\n [rounded]=\"getTagRounded(col, rowData)\"\n [icon]=\"getTagIcon(col, rowData)\"\n [style]=\"getTagStyle(col, rowData)\"\n />\n }\n @case ('progress') {\n <div\n class=\"shk-progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"getProgress(col, rowData)\"\n [attr.aria-label]=\"col.header\"\n >\n <div [style.width.%]=\"getProgress(col, rowData)\"></div>\n </div>\n }\n @case ('boolean') {\n @if (resolveField(rowData, col.field)) {\n <svg\n [lucideIcon]=\"icons.yes\"\n class=\"w-4 h-4 [color:var(--shk-success-600)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('yes')\"\n ></svg>\n } @else {\n <svg\n [lucideIcon]=\"icons.no\"\n class=\"w-4 h-4 [color:var(--shk-error-500)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('no')\"\n ></svg>\n }\n }\n @case ('date') {\n {{ resolveField(rowData, col.field) | date: col.dateFormat || 'dd/MM/yyyy' }}\n }\n @case ('currency') {\n {{ resolveField(rowData, col.field) | currency: col.currency || 'USD' : 'symbol' }}\n }\n @default {\n @if (col.image) {\n <div class=\"flex items-center gap-2\">\n @if (col.image(rowData); as src) {\n <img\n [src]=\"src\"\n alt=\"\"\n [width]=\"col.imageWidth || 24\"\n class=\"shrink-0 rounded-sm\"\n />\n }\n <span>\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n </span>\n </div>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n }\n }\n }\n } @else {\n <div class=\"flex items-center justify-start gap-px\">\n @for (action of getVisibleRowActions(rowData); track $index) {\n @if (isRowActionVisible(action, rowData)) {\n <div class=\"relative group\">\n <shk-tooltip\n [text]=\"getRowActionLabel(action, rowData)\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData)\"\n [class]=\"\n 'table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md ' +\n getRowActionClass(action, rowData)\n \"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [attr.aria-label]=\"getRowActionLabel(action, rowData)\"\n >\n <svg\n [lucideIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n </div>\n }\n }\n @if (getHiddenRowActions(rowData).length > 0) {\n <div class=\"relative\">\n <shk-tooltip\n [text]=\"'common.more_options' | transloco\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleActionsDropdown(rowData, $event)\"\n class=\"table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md\"\n [attr.aria-label]=\"'common.more_options' | transloco\"\n [attr.aria-expanded]=\"isActionsDropdownOpen(rowData)\"\n >\n <svg\n [lucideIcon]=\"getIcon('ellipsis-vertical')\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n @if (isActionsDropdownOpen(rowData)) {\n <div\n shkPortal\n class=\"fixed z-[9999] min-w-[160px] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md shadow-lg py-1\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n >\n @for (action of getHiddenRowActions(rowData); track $index) {\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData); toggleActionsDropdown(rowData)\"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [class]=\"\n 'w-full flex items-center gap-2 px-3 py-2 text-xs text-left _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors ' +\n getRowActionClass(action, rowData)\n \"\n >\n <svg\n [lucideIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-3.5 h-3.5 shrink-0\"\n ></svg>\n <span>{{ getRowActionLabel(action, rowData) }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n }\n </table>\n\n <!-- Text content of a cell: format() \u00B7 custom template \u00B7 raw value -->\n <ng-template #cellText let-rowData let-col=\"col\">\n @if (col.format) {\n <span>{{ col.format(rowData) }}</span>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n customTemplates()[col.field] || defaultTemplate;\n context: { $implicit: rowData, field: col.field }\n \"\n ></ng-container>\n }\n </ng-template>\n <ng-template #defaultTemplate let-rowData let-field=\"field\">\n {{ resolveField(rowData, field) }}\n </ng-template>\n\n <!-- Option list of the select / multiselect filters -->\n <ng-template #optionList let-col let-draft=\"draft\" let-multiple=\"multiple\">\n <div class=\"p-2 space-y-1.5\">\n @let selectedLabel = multiple ? selectedOptionsLabel(col) : selectedSingleLabel(col);\n <button\n type=\"button\"\n class=\"shk-filter-select flex items-center justify-between gap-2 text-left\"\n style=\"background-image: none\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [attr.aria-expanded]=\"multiselectOpen()\"\n (click)=\"multiselectOpen.set(!multiselectOpen())\"\n >\n <span class=\"truncate\" [class._shk-text-surface-400]=\"!selectedLabel\">\n {{ selectedLabel || tr('table.filterAll', 'Todos') }}\n </span>\n <svg\n [lucideIcon]=\"getIcon('chevron-down')\"\n class=\"w-3.5 h-3.5 shrink-0 _shk-text-surface-400 transition-transform\"\n [class.rotate-180]=\"multiselectOpen()\"\n ></svg>\n </button>\n @if (multiselectOpen()) {\n <div\n class=\"max-h-52 overflow-y-auto p-0.5 border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md _shk-scrollbar\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple\"\n >\n @for (opt of col.filterOptions || []; track $index) {\n @let isSelected = multiple\n ? isOptionSelected(opt.value)\n : draft.rules[0].value != null && draft.rules[0].value == opt.value;\n <button\n type=\"button\"\n role=\"option\"\n class=\"w-full flex items-center gap-2 px-2 py-1.5 rounded text-left transition-colors hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [class._shk-bg-primary-soft]=\"isSelected\"\n [class._shk-text-primary-700]=\"isSelected\"\n [attr.aria-selected]=\"isSelected\"\n (click)=\"multiple ? toggleOption(col, opt.value) : selectOption(col, opt.value)\"\n >\n @if (multiple) {\n <span class=\"shk-checkbox-box\" [class.shk-checked]=\"isSelected\">\n @if (isSelected) {\n <svg [lucideIcon]=\"getIcon('check')\"></svg>\n }\n </span>\n }\n @if (opt.image) {\n <img [src]=\"opt.image\" alt=\"\" width=\"22\" class=\"shrink-0 rounded-sm\" />\n }\n <span class=\"truncate\">{{ opt.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </div>\n <div\n class=\"table-pagination flex items-center justify-between gap-4 px-2 min-[1440px]:px-3 py-2 border-t _shk-border dark:[border-color:var(--shk-surface-100)]\"\n >\n <div class=\"text-xs _shk-text-surface-600 dark:[color:var(--shk-surface-400)]\">\n @if (showPageReport()) {\n {{ pageReport() }}\n }\n </div>\n <div\n class=\"flex items-center gap-0.5\"\n role=\"navigation\"\n >\n <button\n type=\"button\"\n (click)=\"goToFirst()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.firstPage', 'Primera p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevrons-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"prev()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.prevPage', 'P\u00E1gina anterior')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span\n class=\"px-2 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n type=\"button\"\n (click)=\"next()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.nextPage', 'P\u00E1gina siguiente')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"goToLast()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.lastPage', '\u00DAltima p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevrons-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n <div\n class=\"flex items-center gap-1.5 text-xs _shk-text-surface-600 dark:[color:var(--shk-surface-400)]\"\n >\n @if (showRowsPerPage()) {\n <label [for]=\"uid + '-rows-per-page'\">{{ 'table.rows' | transloco }}</label>\n <select\n [id]=\"uid + '-rows-per-page'\"\n (change)=\"onRowsPerPageChange($any($event.target).value)\"\n class=\"border _shk-border dark:[border-color:var(--shk-surface-200)] rounded px-2 py-1 text-xs bg-white dark:[background-color:var(--shk-surface-100)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)] focus:outline-none focus:[border-color:var(--shk-primary-500)]\"\n >\n @for (opt of rowsPerPageOptions(); track opt) {\n <option [value]=\"opt\" [selected]=\"opt === rowsPerPageLocal()\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n </div>\n </div>\n</div>\n", styles: ["input:focus{outline:none}input[type=text]{font-weight:400!important}table th{white-space:nowrap}table td{white-space:normal;overflow-wrap:break-word}.shk-page-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:.375rem;transition:background-color .15s ease,color .15s ease}.shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-200)}.shk-page-btn:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--shk-primary-500) 45%,transparent)}td button svg{width:1.125rem!important;height:1.125rem!important}td button:disabled{opacity:.4;cursor:not-allowed}.table-action-btn svg{width:1rem!important;height:1rem!important;min-width:1rem!important;min-height:1rem!important}.table-action-btn{padding:.5rem!important;min-width:2rem!important;min-height:2rem!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;border-radius:inherit;-webkit-overflow-scrolling:touch;container-type:inline-size}.table-card,.table-pagination{container-type:inline-size}@container (max-width: 640px){.table-pagination{flex-direction:column;align-items:center;gap:.5rem}.table-pagination>div{justify-content:center}}.table-scroll-wrapper table{table-layout:auto;width:100%}@container (max-width: 768px){.table-scroll-wrapper{scroll-snap-type:x mandatory}.table-scroll-wrapper table{table-layout:auto;width:100%}.table-scroll-wrapper th:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px);max-width:var(--shk-col-width, 140px)}.table-scroll-wrapper th,.table-scroll-wrapper td{scroll-snap-align:start}}th[data-shk-select],td[data-shk-select]{width:2.5rem;min-width:2.5rem}.shk-table-checkbox{width:.875rem;height:.875rem;cursor:pointer;vertical-align:middle;accent-color:var(--shk-primary-500)}.shk-table-checkbox:disabled{opacity:.4;cursor:not-allowed}tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent)}tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 90%,transparent)}:host-context(.dark) tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-900) 20%,transparent)}:host-context(.dark) tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 30%,transparent)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}tr.shk-row-missing-error{background-color:color-mix(in srgb,var(--shk-error-500) 8%,transparent)}tr.shk-row-missing-error>td:first-child{box-shadow:inset 3px 0 0 var(--shk-error-500)}table.shk-row-hover tbody tr.shk-row-missing-error.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-error-500) 14%,transparent)}tr.shk-row-missing-warning{background-color:color-mix(in srgb,var(--shk-warning-400) 10%,transparent)}tr.shk-row-missing-warning>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing-warning.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 16%,transparent)}td.shk-missing-error .shk-missing-cell{color:var(--shk-error-600)}:host-context(.dark) td.shk-missing-error .shk-missing-cell{color:var(--shk-error-400)}td.shk-missing-warning .shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) td.shk-missing-warning .shk-missing-cell{color:var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 30%,transparent)}:host-context(.dark) table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 10%,transparent)}table.shk-gridlines th,table.shk-gridlines td{border-right:1px solid var(--shk-surface-200)}table.shk-gridlines th:last-child,table.shk-gridlines td:last-child{border-right:0}:host-context(.dark) table.shk-gridlines th,:host-context(.dark) table.shk-gridlines td{border-right-color:var(--shk-surface-200)}.shk-col-resizer{position:absolute;top:0;right:-4px;z-index:1;width:8px;height:100%;cursor:col-resize;touch-action:none}.shk-col-resizer:after{content:\"\";position:absolute;top:20%;bottom:20%;left:3px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.shk-col-resizer:hover:after,.shk-col-resizer:focus-visible:after,.shk-col-resizer.shk-resizing:after{background-color:var(--shk-primary-500)}.shk-col-resizer:focus-visible{outline:none}th:last-child .shk-col-resizer{right:0}.shk-filter-input,.shk-filter-select{width:100%;padding:.375rem .625rem;font-size:.75rem;line-height:1.25rem;border-radius:.375rem;border:1px solid var(--shk-surface-200);background-color:#fff;color:var(--shk-surface-700)}.dark .shk-filter-input,.dark .shk-filter-select{background-color:var(--shk-surface-100);border-color:var(--shk-surface-200);color-scheme:dark}.shk-filter-input::placeholder{color:var(--shk-surface-400)}select.shk-filter-select{appearance:none;padding-right:1.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right .5rem center;cursor:pointer}button.shk-filter-select{cursor:pointer}.shk-filter-input:focus,.shk-filter-select:focus{outline:none;border-color:var(--shk-primary-500);box-shadow:0 0 0 1px var(--shk-primary-500)}.shk-checkbox-box{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:.875rem;height:.875rem;border-radius:.1875rem;border:1px solid var(--shk-surface-300);background-color:#fff;color:#fff}.dark .shk-checkbox-box{background-color:var(--shk-surface-100)}.shk-checkbox-box.shk-checked{background-color:var(--shk-primary-500);border-color:var(--shk-primary-500)}.shk-checkbox-box svg{width:.625rem;height:.625rem}.shk-range{position:relative;height:1rem;margin:.5rem .375rem .375rem}.shk-range-track,.shk-range-fill{position:absolute;top:50%;height:.1875rem;transform:translateY(-50%);border-radius:9999px}.shk-range-track{left:0;right:0;background-color:var(--shk-surface-200)}.shk-range-fill{background-color:var(--shk-primary-500)}.shk-range input[type=range]{position:absolute;inset:0;width:100%;margin:0;background:transparent;pointer-events:none;appearance:none;-webkit-appearance:none}.shk-range input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:.875rem;height:.875rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:.625rem;height:.625rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-progress{height:.375rem;min-width:5rem;border-radius:9999px;background-color:var(--shk-surface-200);overflow:hidden}.shk-progress>div{height:100%;border-radius:inherit;background-color:var(--shk-primary-500)}\n"], dependencies: [{ kind: "directive", type: PortalDirective, selector: "[shkPortal]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "component", type: TagComponent, selector: "shk-tag", inputs: ["value", "severity", "rounded", "icon", "style", "styleClass"] }, { kind: "component", type: TooltipComponent, selector: "shk-tooltip", inputs: ["text", "position", "mode", "offset"] }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1680
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1681
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.27", type: TableComponent, isStandalone: true, selector: "shk-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPage: { classPropertyName: "rowsPerPage", publicName: "rowsPerPage", isSignal: true, isRequired: false, transformFunction: null }, rowsPerPageOptions: { classPropertyName: "rowsPerPageOptions", publicName: "rowsPerPageOptions", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, showActionRow: { classPropertyName: "showActionRow", publicName: "showActionRow", isSignal: true, isRequired: false, transformFunction: null }, customTemplates: { classPropertyName: "customTemplates", publicName: "customTemplates", isSignal: true, isRequired: false, transformFunction: null }, headerActions: { classPropertyName: "headerActions", publicName: "headerActions", isSignal: true, isRequired: false, transformFunction: null }, rowActions: { classPropertyName: "rowActions", publicName: "rowActions", isSignal: true, isRequired: false, transformFunction: null }, hasShadow: { classPropertyName: "hasShadow", publicName: "hasShadow", isSignal: true, isRequired: false, transformFunction: null }, defaultSortField: { classPropertyName: "defaultSortField", publicName: "defaultSortField", isSignal: true, isRequired: false, transformFunction: null }, defaultSortOrder: { classPropertyName: "defaultSortOrder", publicName: "defaultSortOrder", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, globalFilterFields: { classPropertyName: "globalFilterFields", publicName: "globalFilterFields", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, serverSide: { classPropertyName: "serverSide", publicName: "serverSide", isSignal: true, isRequired: false, transformFunction: null }, totalRecords: { classPropertyName: "totalRecords", publicName: "totalRecords", isSignal: true, isRequired: false, transformFunction: null }, filters: { classPropertyName: "filters", publicName: "filters", isSignal: true, isRequired: false, transformFunction: null }, activeFilter: { classPropertyName: "activeFilter", publicName: "activeFilter", isSignal: true, isRequired: false, transformFunction: null }, showGridlines: { classPropertyName: "showGridlines", publicName: "showGridlines", isSignal: true, isRequired: false, transformFunction: null }, resizableColumns: { classPropertyName: "resizableColumns", publicName: "resizableColumns", isSignal: true, isRequired: false, transformFunction: null }, rowValidations: { classPropertyName: "rowValidations", publicName: "rowValidations", isSignal: true, isRequired: false, transformFunction: null }, columnWidths: { classPropertyName: "columnWidths", publicName: "columnWidths", isSignal: true, isRequired: false, transformFunction: null }, stateKey: { classPropertyName: "stateKey", publicName: "stateKey", isSignal: true, isRequired: false, transformFunction: null }, stateStorage: { classPropertyName: "stateStorage", publicName: "stateStorage", isSignal: true, isRequired: false, transformFunction: null }, rowHover: { classPropertyName: "rowHover", publicName: "rowHover", isSignal: true, isRequired: false, transformFunction: null }, showClearButton: { classPropertyName: "showClearButton", publicName: "showClearButton", isSignal: true, isRequired: false, transformFunction: null }, showPageReport: { classPropertyName: "showPageReport", publicName: "showPageReport", isSignal: true, isRequired: false, transformFunction: null }, showRowsPerPage: { classPropertyName: "showRowsPerPage", publicName: "showRowsPerPage", isSignal: true, isRequired: false, transformFunction: null }, selectable: { classPropertyName: "selectable", publicName: "selectable", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, isRowSelectable: { classPropertyName: "isRowSelectable", publicName: "isRowSelectable", isSignal: true, isRequired: false, transformFunction: null }, selectOnRowClick: { classPropertyName: "selectOnRowClick", publicName: "selectOnRowClick", isSignal: true, isRequired: false, transformFunction: null }, bulkActions: { classPropertyName: "bulkActions", publicName: "bulkActions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnWidths: "columnWidthsChange", selection: "selectionChange", refresh: "refresh", pageChange: "pageChange", filterChange: "filterChange", searchChange: "searchChange", filterClick: "filterClick", columnResize: "columnResize" }, host: { listeners: { "document:click": "onDocumentClick()", "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "<div class=\"space-y-2 min-[1440px]:space-y-3 mt-2 min-[1440px]:mt-3 animate-fade-in pb-8\">\n @if (\n showSearch() ||\n (showClearButton() && hasFilterableColumns()) ||\n filters().length > 0 ||\n headerActions().length > 0 ||\n (selectable() && bulkActions().length > 0 && selection().length > 0)\n ) {\n <div class=\"card p-2 min-[1440px]:p-2.5 flex flex-row items-center justify-between gap-2\">\n <div class=\"flex items-center gap-2 min-[1440px]:gap-3 flex-1 min-w-0\">\n @if (showSearch()) {\n <div class=\"relative w-full md:w-52 min-[1440px]:w-56\">\n <label [for]=\"uid + '-search'\" class=\"sr-only\">{{\n searchPlaceholder() || ('common.search_placeholder' | transloco)\n }}</label>\n <div class=\"absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none\">\n <svg\n [shkIcon]=\"getIcon('search')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400\"\n ></svg>\n </div>\n <input\n [id]=\"uid + '-search'\"\n type=\"text\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($any($event.target).value)\"\n [placeholder]=\"searchPlaceholder() || ('common.search_placeholder' | transloco)\"\n class=\"block w-full pl-8 pr-3 py-1.5 text-xs border _shk-border rounded-md leading-5 _shk-bg-surface-50 placeholder:[color:var(--shk-surface-400)] dark:placeholder:[color:var(--shk-surface-500)] _shk-text-surface-700 focus:outline-none focus:bg-white dark:focus:[background-color:var(--shk-surface-100)] focus:[border-color:var(--shk-primary-500)] focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)]\"\n />\n </div>\n }\n @if (showClearButton() && (hasFilterableColumns() || showSearch())) {\n <shk-tooltip [text]=\"tr('table.clearFilters', 'Limpiar b\u00FAsqueda, filtros y orden')\">\n <button\n type=\"button\"\n (click)=\"clearAll()\"\n [disabled]=\"!hasActiveFilters()\"\n class=\"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md border _shk-border _shk-text-surface-600 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed whitespace-nowrap\"\n >\n <svg [shkIcon]=\"icons.clear\" class=\"w-3.5 h-3.5\"></svg>\n {{ tr('table.clear', 'Limpiar') }}\n </button>\n </shk-tooltip>\n }\n @if (filters().length > 0) {\n <div\n class=\"flex _shk-bg-surface-100 p-0.5 rounded-md ml-auto\"\n role=\"group\"\n >\n @for (f of filters(); track f.value) {\n <button\n type=\"button\"\n (click)=\"onFilterClick(f.value)\"\n [attr.aria-pressed]=\"f.value === activeFilter()\"\n class=\"px-2.5 min-[1440px]:px-3 py-1 text-xs font-medium rounded _shk-text-surface-700 transition-all\"\n [class]=\"\n f.value === activeFilter()\n ? 'bg-white shadow-sm dark:[background-color:var(--shk-surface-700)]'\n : ''\n \"\n >\n {{ f.label }}\n </button>\n }\n </div>\n }\n </div>\n @if (selectable() && selection().length > 0 && bulkActions().length > 0) {\n <div\n class=\"flex items-center gap-1.5 shrink-0\"\n role=\"toolbar\"\n [attr.aria-label]=\"'table.selected' | transloco: { count: selection().length }\"\n >\n <span\n class=\"text-xs font-medium _shk-text-surface-600 whitespace-nowrap\"\n aria-live=\"polite\"\n >{{ 'table.selected' | transloco: { count: selection().length } }}</span\n >\n <button\n type=\"button\"\n (click)=\"clearSelection()\"\n [attr.aria-label]=\"'table.clearSelection' | transloco\"\n class=\"table-action-btn rounded-md _shk-text-surface-500 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n >\n <svg [shkIcon]=\"getIcon('x')\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n @for (action of visibleBulkActions(); track $index) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isBulkActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"runBulkAction(action)\"\n >\n @if (action.icon) {\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n </div>\n }\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-1.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n <div class=\"card p-0 overflow-hidden table-card\" [class.shadow-lg]=\"hasShadow()\">\n <div class=\"table-scroll-wrapper _shk-scrollbar\">\n <table\n class=\"shk-data-table\"\n [class.shk-gridlines]=\"showGridlines()\"\n [class.shk-row-hover]=\"rowHover()\"\n >\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n data-shk-select\n class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center _shk-bg-surface-50 border-b _shk-border\"\n >\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [disabled]=\"loading() || selectablePageRows().length === 0\"\n (change)=\"toggleSelectAllPage()\"\n [attr.aria-label]=\"'table.selectAll' | transloco\"\n />\n </th>\n }\n @for (col of columnsWithActions(); track col.field) {\n <th\n scope=\"col\"\n (click)=\"onHeaderClick(col)\"\n (keydown)=\"onHeaderKeydown($event, col)\"\n [tabindex]=\"col.field !== 'actions' && col.sortable ? 0 : -1\"\n [attr.role]=\"col.field !== 'actions' && col.sortable ? 'button' : null\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [style.cursor]=\"col.field !== 'actions' && col.sortable ? 'pointer' : 'default'\"\n [style.width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : null)\"\n [style.min-width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : col.minWidth) || null\"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n class=\"relative px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-left text-[10px] min-[1440px]:text-xs font-bold _shk-text-surface-500 uppercase tracking-wider _shk-bg-surface-50 border-b _shk-border focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n >\n @if (col.field !== 'actions') {\n <div class=\"flex items-center justify-between gap-2\">\n <span>{{ col.header }}</span>\n <div class=\"flex items-center gap-1 shrink-0\">\n @if (col.sortable) {\n <shk-tooltip [text]=\"'table.tooltips.sort' | transloco\">\n @if (sortField() === col.field) {\n <svg\n [shkIcon]=\"getIcon(sortOrder() === 1 ? 'arrow-up' : 'arrow-down')\"\n class=\"w-3.5 h-3.5 _shk-text-primary\"\n ></svg>\n } @else {\n <svg\n [shkIcon]=\"getIcon('arrow-up-down')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400\"\n ></svg>\n }\n </shk-tooltip>\n }\n @if (col.filter) {\n <shk-tooltip [text]=\"'table.tooltips.filter' | transloco\">\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleFilter(col, $event)\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [attr.aria-expanded]=\"openFilterField() === col.field\"\n aria-haspopup=\"dialog\"\n class=\"_shk-text-surface-400 hover:[color:var(--shk-surface-600)] dark:hover:[color:var(--shk-surface-300)] transition-colors\"\n >\n <svg\n [shkIcon]=\"getIcon('filter')\"\n class=\"w-3.5 h-3.5\"\n [class._shk-text-primary]=\"hasFilterValue(col.field) || openFilterField() === col.field\"\n ></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n </div>\n\n\n <!-- Column filter menu -->\n @if (col.filter && openFilterField() === col.field && filterDraft(); as draft) {\n <div\n shkPortal\n class=\"shk-filter-overlay fixed z-[9999] w-[240px] overflow-y-auto normal-case tracking-normal font-normal text-xs _shk-text-surface-700 bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border rounded-lg shadow-lg\"\n role=\"dialog\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [style.top.px]=\"filterPopupPosition().top\"\n [style.left.px]=\"filterPopupPosition().left\"\n [style.max-height.px]=\"filterPopupPosition().maxHeight\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeFilters()\"\n >\n @if (col.filterMenuTitle) {\n <div class=\"px-2 pt-2 font-semibold _shk-text-surface-800\">\n {{ col.filterMenuTitle }}\n </div>\n }\n @if (showOperatorFor(col)) {\n <div class=\"p-2 border-b _shk-border\">\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"filterLabel('matchAll') + ' / ' + filterLabel('matchAny')\"\n (change)=\"setDraftOperator($any($event.target).value)\"\n >\n <option value=\"and\" [selected]=\"draft.operator === 'and'\">\n {{ filterLabel('matchAll') }}\n </option>\n <option value=\"or\" [selected]=\"draft.operator === 'or'\">\n {{ filterLabel('matchAny') }}\n </option>\n </select>\n </div>\n }\n\n @switch (filterKind(col)) {\n @case ('select') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: false }\"\n ></ng-container>\n }\n @case ('multiselect') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: true }\"\n ></ng-container>\n }\n @case ('boolean') {\n @let boolValue = draft.rules[0].value;\n <div class=\"p-2\">\n <button\n type=\"button\"\n role=\"checkbox\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n class=\"inline-flex items-center gap-2 rounded-md focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n [attr.aria-checked]=\"\n boolValue === true ? 'true' : boolValue === false ? 'false' : 'mixed'\n \"\n (click)=\"cycleBoolean(col)\"\n >\n <span\n class=\"shk-checkbox-box\"\n [class.shk-checked]=\"boolValue === true || boolValue === false\"\n >\n @if (boolValue === true) {\n <svg [shkIcon]=\"getIcon('check')\"></svg>\n } @else if (boolValue === false) {\n <svg [shkIcon]=\"getIcon('x')\"></svg>\n }\n </span>\n <span>{{\n boolValue === true\n ? filterLabel('yes')\n : boolValue === false\n ? filterLabel('no')\n : filterLabel('any')\n }}</span>\n </button>\n </div>\n }\n @case ('range') {\n @let rv = rangeValue(col);\n @let bounds = rangeBounds(col);\n <div class=\"p-2\">\n <div class=\"shk-range\">\n <div class=\"shk-range-track\"></div>\n <div\n class=\"shk-range-fill\"\n [style.left.%]=\"rangePercent(col, rv[0])\"\n [style.width.%]=\"rangePercent(col, rv[1]) - rangePercent(col, rv[0])\"\n ></div>\n <input\n type=\"range\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[0]\"\n [style.z-index]=\"rv[0] >= bounds[1] ? 3 : null\"\n [attr.aria-label]=\"col.header + ' min'\"\n (input)=\"onRangeInput(col, 0, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 0, $any($event.target).value, true)\"\n />\n <input\n type=\"range\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[1]\"\n [attr.aria-label]=\"col.header + ' max'\"\n (input)=\"onRangeInput(col, 1, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 1, $any($event.target).value, true)\"\n />\n </div>\n <div class=\"flex items-center justify-between px-0.5 _shk-text-surface-500\">\n <span>{{ rv[0] }}</span>\n <span>{{ rv[1] }}</span>\n </div>\n </div>\n }\n @default {\n <!-- text / numeric / date: one block per rule -->\n @for (rule of draft.rules; track $index; let i = $index) {\n <div\n class=\"flex flex-col gap-1.5 p-2\"\n [class.border-b]=\"i < draft.rules.length - 1\"\n [class._shk-border]=\"i < draft.rules.length - 1\"\n >\n @if (showMatchModesFor(col)) {\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"col.header\"\n (change)=\"setDraftMatchMode(col, i, $any($event.target).value)\"\n >\n @for (mode of matchModesFor(col); track mode) {\n <option [value]=\"mode\" [selected]=\"mode === rule.matchMode\">\n {{ matchModeLabel(mode) }}\n </option>\n }\n </select>\n }\n <input\n [id]=\"uid + '-filter-' + safeId(col.field) + '-' + i\"\n [type]=\"filterKind(col) === 'numeric' ? 'number' : filterKind(col) === 'date' ? 'date' : 'text'\"\n [attr.step]=\"filterKind(col) === 'numeric' ? 'any' : null\"\n class=\"shk-filter-input\"\n [value]=\"rule.value ?? ''\"\n [placeholder]=\"col.filterPlaceholder || ('common.search_placeholder' | transloco)\"\n [attr.aria-label]=\"col.header\"\n (input)=\"onRuleInput(col, i, $any($event.target).value)\"\n (keydown.enter)=\"applyFilter(col)\"\n />\n @if (draft.rules.length > 1) {\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-1 py-1 rounded-md [color:var(--shk-error-600)] hover:[background-color:var(--shk-error-50)] transition-colors\"\n (click)=\"removeRule(i)\"\n >\n <svg [shkIcon]=\"icons.trash\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('removeRule') }}\n </button>\n }\n </div>\n }\n @if (canAddRule(col)) {\n <div class=\"px-2 pb-1\">\n <button\n type=\"button\"\n class=\"w-full inline-flex items-center justify-center gap-1 py-1 rounded-md _shk-text-primary hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"addRule(col)\"\n >\n <svg [shkIcon]=\"getIcon('plus')\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('addRule') }}\n </button>\n </div>\n }\n }\n }\n\n <div class=\"flex items-center justify-between gap-2 p-2 border-t _shk-border\">\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md border _shk-border _shk-text-surface-600 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"clearFilter(col.field)\"\n >\n {{ filterLabel('clear') }}\n </button>\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors\"\n (click)=\"applyFilter(col)\"\n >\n {{ filterLabel('apply') }}\n </button>\n </div>\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center\">\n <span>{{ col.header }}</span>\n </div>\n }\n @if (isResizable()) {\n <span\n class=\"shk-col-resizer\"\n [class.shk-resizing]=\"resizingField() === col.field\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n [attr.aria-label]=\"tr('table.resizeColumn', 'Redimensionar columna') + ': ' + col.header\"\n [attr.aria-valuenow]=\"resizedWidthPx(col)\"\n (pointerdown)=\"startResize($event, col)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation(); resetColumnWidth(col)\"\n (keydown)=\"onResizerKeydown($event, col)\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n @if (loading()) {\n <tbody class=\"border-b _shk-border\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div\n class=\"flex items-center justify-center\"\n role=\"status\"\n [attr.aria-label]=\"'common.loading' | transloco\"\n >\n <svg\n [shkIcon]=\"getIcon('loader')\"\n class=\"w-6 h-6 animate-spin _shk-text-primary\"\n ></svg>\n </div>\n </td>\n </tr>\n </tbody>\n } @else if (effectiveDisplayedData().length === 0) {\n <tbody class=\"border-b _shk-border\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div class=\"flex flex-col items-center\">\n <div\n class=\"w-16 h-16 _shk-bg-surface-100 rounded-full flex items-center justify-center mb-4\"\n >\n <svg\n [shkIcon]=\"getIcon('inbox')\"\n class=\"w-8 h-8 _shk-text-surface-400\"\n ></svg>\n </div>\n <p\n class=\"text-lg font-semibold _shk-text-surface-600\"\n >\n {{ emptyMessage() || ('common.no_records' | transloco) }}\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n } @else {\n <tbody>\n @for (rowData of effectiveDisplayedData(); track trackByRow(rowData, $index)) {\n @let rowSeverityValue = rowSeverity(rowData);\n <tr\n [attr.aria-selected]=\"selectable() ? isRowSelected(rowData) : null\"\n [class.shk-row-selected]=\"selectable() && isRowSelected(rowData)\"\n [class.shk-row-low]=\"rowSeverityValue === 'low'\"\n [class.shk-row-moderate]=\"rowSeverityValue === 'moderate'\"\n [class.shk-row-critical]=\"rowSeverityValue === 'critical'\"\n [class.cursor-pointer]=\"selectable() && selectOnRowClick() && canSelectRow(rowData)\"\n (click)=\"onRowClick($event, rowData)\"\n class=\"shk-data-row transition-colors duration-200 border-b _shk-border\"\n >\n @if (selectable()) {\n <td data-shk-select class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center\">\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"isRowSelected(rowData)\"\n [disabled]=\"!canSelectRow(rowData)\"\n (change)=\"toggleRowSelection(rowData)\"\n [attr.aria-label]=\"'table.selectRow' | transloco: { index: first() + $index + 1 }\"\n />\n </td>\n }\n @for (col of columnsWithActions(); track col.field) {\n <td\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [class]=\"\n 'px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)] ' +\n (col.field === 'actions' ? 'whitespace-nowrap' : 'whitespace-normal break-words')\n \"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n >\n @if (col.field !== 'actions') {\n @switch (col.template) {\n @case ('tag') {\n <shk-tag\n [value]=\"getTagValue(col, rowData)\"\n [severity]=\"getTagSeverity(col, rowData)\"\n [rounded]=\"getTagRounded(col, rowData)\"\n [icon]=\"getTagIcon(col, rowData)\"\n [style]=\"getTagStyle(col, rowData)\"\n />\n }\n @case ('progress') {\n <div\n class=\"shk-progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"getProgress(col, rowData)\"\n [attr.aria-label]=\"col.header\"\n >\n <div [style.width.%]=\"getProgress(col, rowData)\"></div>\n </div>\n }\n @case ('boolean') {\n @if (resolveField(rowData, col.field)) {\n <svg\n [shkIcon]=\"icons.yes\"\n class=\"w-4 h-4 [color:var(--shk-success-600)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('yes')\"\n ></svg>\n } @else {\n <svg\n [shkIcon]=\"icons.no\"\n class=\"w-4 h-4 [color:var(--shk-error-500)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('no')\"\n ></svg>\n }\n }\n @case ('date') {\n {{ formatDateCell(resolveField(rowData, col.field), col) }}\n }\n @case ('currency') {\n {{ formatCurrencyCell(resolveField(rowData, col.field), col) }}\n }\n @default {\n @if (col.image) {\n <div class=\"flex items-center gap-2\">\n @if (col.image(rowData); as src) {\n <img\n [src]=\"src\"\n alt=\"\"\n [width]=\"col.imageWidth || 24\"\n class=\"shrink-0 rounded-sm\"\n />\n }\n <span>\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n </span>\n </div>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n }\n }\n }\n } @else {\n <div class=\"flex items-center justify-start gap-px\">\n @for (action of getVisibleRowActions(rowData); track $index) {\n @if (isRowActionVisible(action, rowData)) {\n <div class=\"relative group\">\n <shk-tooltip\n [text]=\"getRowActionLabel(action, rowData)\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData)\"\n [class]=\"\n 'table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md ' +\n getRowActionClass(action, rowData)\n \"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [attr.aria-label]=\"getRowActionLabel(action, rowData)\"\n >\n <svg\n [shkIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n </div>\n }\n }\n @if (getHiddenRowActions(rowData).length > 0) {\n <div class=\"relative\">\n <shk-tooltip\n [text]=\"'common.more_options' | transloco\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleActionsDropdown(rowData, $event)\"\n class=\"table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md\"\n [attr.aria-label]=\"'common.more_options' | transloco\"\n [attr.aria-expanded]=\"isActionsDropdownOpen(rowData)\"\n >\n <svg\n [shkIcon]=\"getIcon('ellipsis-vertical')\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n @if (isActionsDropdownOpen(rowData)) {\n <div\n shkPortal\n class=\"fixed z-[9999] min-w-[160px] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border rounded-md shadow-lg py-1\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n >\n @for (action of getHiddenRowActions(rowData); track $index) {\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData); toggleActionsDropdown(rowData)\"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [class]=\"\n 'w-full flex items-center gap-2 px-3 py-2 text-xs text-left _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors ' +\n getRowActionClass(action, rowData)\n \"\n >\n <svg\n [shkIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-3.5 h-3.5 shrink-0\"\n ></svg>\n <span>{{ getRowActionLabel(action, rowData) }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n @if (rowSeverityValue) {\n <div class=\"relative group\">\n <shk-tooltip [text]=\"rowValidationTitle(rowData) || ''\" position=\"top\">\n <span\n class=\"shk-row-validation-btn\"\n [class.shk-sev-low]=\"rowSeverityValue === 'low'\"\n [class.shk-sev-moderate]=\"rowSeverityValue === 'moderate'\"\n [class.shk-sev-critical]=\"rowSeverityValue === 'critical'\"\n tabindex=\"0\"\n role=\"note\"\n [attr.aria-label]=\"rowValidationLabel(rowData)\"\n >\n <svg [shkIcon]=\"rowValidationIcon(rowData)\"></svg>\n </span>\n </shk-tooltip>\n </div>\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n }\n </table>\n\n <!-- Text content of a cell: format() \u00B7 custom template \u00B7 raw value -->\n <ng-template #cellText let-rowData let-col=\"col\">\n @if (col.format) {\n <span>{{ col.format(rowData) }}</span>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n customTemplates()[col.field] || defaultTemplate;\n context: { $implicit: rowData, field: col.field }\n \"\n ></ng-container>\n }\n </ng-template>\n <ng-template #defaultTemplate let-rowData let-field=\"field\">\n {{ resolveField(rowData, field) }}\n </ng-template>\n\n <!-- Option list of the select / multiselect filters -->\n <ng-template #optionList let-col let-draft=\"draft\" let-multiple=\"multiple\">\n <div class=\"p-2 space-y-1.5\">\n @let selectedLabel = multiple ? selectedOptionsLabel(col) : selectedSingleLabel(col);\n <button\n type=\"button\"\n class=\"shk-filter-select flex items-center justify-between gap-2 text-left\"\n style=\"background-image: none\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [attr.aria-expanded]=\"multiselectOpen()\"\n (click)=\"multiselectOpen.set(!multiselectOpen())\"\n >\n <span class=\"truncate\" [class._shk-text-surface-400]=\"!selectedLabel\">\n {{ selectedLabel || tr('table.filterAll', 'Todos') }}\n </span>\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-3.5 h-3.5 shrink-0 _shk-text-surface-400 transition-transform\"\n [class.rotate-180]=\"multiselectOpen()\"\n ></svg>\n </button>\n @if (multiselectOpen()) {\n <div\n class=\"max-h-52 overflow-y-auto p-0.5 border _shk-border rounded-md _shk-scrollbar\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple\"\n >\n @for (opt of col.filterOptions || []; track $index) {\n @let isSelected = multiple\n ? isOptionSelected(opt.value)\n : draft.rules[0].value != null && draft.rules[0].value == opt.value;\n <button\n type=\"button\"\n role=\"option\"\n class=\"w-full flex items-center gap-2 px-2 py-1.5 rounded text-left transition-colors hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [class._shk-bg-primary-soft]=\"isSelected\"\n [class._shk-text-primary-700]=\"isSelected\"\n [attr.aria-selected]=\"isSelected\"\n (click)=\"multiple ? toggleOption(col, opt.value) : selectOption(col, opt.value)\"\n >\n @if (multiple) {\n <span class=\"shk-checkbox-box\" [class.shk-checked]=\"isSelected\">\n @if (isSelected) {\n <svg [shkIcon]=\"getIcon('check')\"></svg>\n }\n </span>\n }\n @if (opt.image) {\n <img [src]=\"opt.image\" alt=\"\" width=\"22\" class=\"shrink-0 rounded-sm\" />\n }\n <span class=\"truncate\">{{ opt.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </div>\n <div\n class=\"table-pagination flex items-center justify-between gap-4 px-2 min-[1440px]:px-3 py-2 border-t _shk-border\"\n >\n <div class=\"text-xs _shk-text-surface-600\">\n @if (showPageReport()) {\n {{ pageReport() }}\n }\n </div>\n <div\n class=\"flex items-center gap-0.5\"\n role=\"navigation\"\n >\n <button\n type=\"button\"\n (click)=\"goToFirst()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.firstPage', 'Primera p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevrons-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"prev()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.prevPage', 'P\u00E1gina anterior')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span\n class=\"px-2 text-xs font-medium _shk-text-surface-700\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n type=\"button\"\n (click)=\"next()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.nextPage', 'P\u00E1gina siguiente')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"goToLast()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.lastPage', '\u00DAltima p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevrons-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n <div\n class=\"flex items-center gap-1.5 text-xs _shk-text-surface-600\"\n >\n @if (showRowsPerPage()) {\n <label [for]=\"uid + '-rows-per-page'\">{{ 'table.rows' | transloco }}</label>\n <select\n [id]=\"uid + '-rows-per-page'\"\n (change)=\"onRowsPerPageChange($any($event.target).value)\"\n class=\"border _shk-border rounded px-2 py-1 text-xs bg-white dark:[background-color:var(--shk-surface-100)] _shk-text-surface-700 focus:outline-none focus:[border-color:var(--shk-primary-500)]\"\n >\n @for (opt of rowsPerPageOptions(); track opt) {\n <option [value]=\"opt\" [selected]=\"opt === rowsPerPageLocal()\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n </div>\n </div>\n</div>\n", styles: ["input:focus{outline:none}input[type=text]{font-weight:400!important}table th{white-space:nowrap}table td{white-space:normal;overflow-wrap:break-word}.shk-page-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:.375rem;transition:background-color .15s ease,color .15s ease}.shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-200)}.shk-page-btn:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--shk-primary-500) 45%,transparent)}td button svg{width:1.125rem!important;height:1.125rem!important}td button:disabled{opacity:.4;cursor:not-allowed}.table-action-btn svg{width:1rem!important;height:1rem!important;min-width:1rem!important;min-height:1rem!important}.table-action-btn{padding:.5rem!important;min-width:2rem!important;min-height:2rem!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;border-radius:inherit;-webkit-overflow-scrolling:touch;container-type:inline-size}.table-card,.table-pagination{container-type:inline-size}@container (max-width: 640px){.table-pagination{flex-direction:column;align-items:center;gap:.5rem}.table-pagination>div{justify-content:center}}.table-scroll-wrapper table{table-layout:auto;width:100%}@container (max-width: 768px){.table-scroll-wrapper{scroll-snap-type:x mandatory}.table-scroll-wrapper table{table-layout:auto;width:100%}.table-scroll-wrapper th:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px);max-width:var(--shk-col-width, 140px)}.table-scroll-wrapper th,.table-scroll-wrapper td{scroll-snap-align:start}}th[data-shk-select],td[data-shk-select]{width:2.5rem;min-width:2.5rem}.shk-table-checkbox{width:.875rem;height:.875rem;cursor:pointer;vertical-align:middle;accent-color:var(--shk-primary-500)}.shk-table-checkbox:disabled{opacity:.4;cursor:not-allowed}tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent)}tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 90%,transparent)}:host-context(.dark) tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-900) 20%,transparent)}:host-context(.dark) tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 30%,transparent)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.shk-data-table tr.shk-row-low{background-color:color-mix(in srgb,var(--shk-info-600) 22%,transparent)}.shk-data-table tr.shk-row-moderate{background-color:color-mix(in srgb,var(--shk-warning-400) 32%,transparent)}.shk-data-table tr.shk-row-critical{background-color:color-mix(in srgb,var(--shk-error-500) 20%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-low{background-color:color-mix(in srgb,var(--shk-info-600) 26%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-moderate{background-color:color-mix(in srgb,var(--shk-warning-400) 34%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-critical{background-color:color-mix(in srgb,var(--shk-error-500) 24%,transparent)}.shk-row-validation-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border-radius:.375rem;cursor:help;color:var(--shk-surface-500)}.shk-row-validation-btn svg{width:1rem!important;height:1rem!important}.shk-row-validation-btn.shk-sev-low{color:var(--shk-info-600)}.shk-row-validation-btn.shk-sev-moderate{color:var(--shk-warning-600)}:host-context(.dark) .shk-row-validation-btn.shk-sev-moderate{color:var(--shk-warning-400)}.shk-row-validation-btn.shk-sev-critical{color:var(--shk-error-500)}.shk-row-validation-btn:focus-visible{outline:2px solid currentColor;outline-offset:1px}table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 30%,transparent)}:host-context(.dark) table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 10%,transparent)}table.shk-gridlines th,table.shk-gridlines td{border-right:1px solid var(--shk-surface-200)}table.shk-gridlines th:last-child,table.shk-gridlines td:last-child{border-right:0}:host-context(.dark) table.shk-gridlines th,:host-context(.dark) table.shk-gridlines td{border-right-color:var(--shk-surface-200)}.shk-col-resizer{position:absolute;top:0;right:-4px;z-index:1;width:8px;height:100%;cursor:col-resize;touch-action:none}.shk-col-resizer:after{content:\"\";position:absolute;top:20%;bottom:20%;left:3px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.shk-col-resizer:hover:after,.shk-col-resizer:focus-visible:after,.shk-col-resizer.shk-resizing:after{background-color:var(--shk-primary-500)}.shk-col-resizer:focus-visible{outline:none}th:last-child .shk-col-resizer{right:0}.shk-filter-input,.shk-filter-select{width:100%;padding:.375rem .625rem;font-size:.75rem;line-height:1.25rem;border-radius:.375rem;border:1px solid var(--shk-surface-200);background-color:#fff;color:var(--shk-surface-700)}.dark .shk-filter-input,.dark .shk-filter-select{background-color:var(--shk-surface-100);border-color:var(--shk-surface-200);color-scheme:dark}.shk-filter-input::placeholder{color:var(--shk-surface-400)}select.shk-filter-select{appearance:none;padding-right:1.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right .5rem center;cursor:pointer}button.shk-filter-select{cursor:pointer}.shk-filter-input:focus,.shk-filter-select:focus{outline:none;border-color:var(--shk-primary-500);box-shadow:0 0 0 1px var(--shk-primary-500)}.shk-checkbox-box{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:.875rem;height:.875rem;border-radius:.1875rem;border:1px solid var(--shk-surface-300);background-color:#fff;color:#fff}.dark .shk-checkbox-box{background-color:var(--shk-surface-100)}.shk-checkbox-box.shk-checked{background-color:var(--shk-primary-500);border-color:var(--shk-primary-500)}.shk-checkbox-box svg{width:.625rem;height:.625rem}.shk-range{position:relative;height:1rem;margin:.5rem .375rem .375rem}.shk-range-track,.shk-range-fill{position:absolute;top:50%;height:.1875rem;transform:translateY(-50%);border-radius:9999px}.shk-range-track{left:0;right:0;background-color:var(--shk-surface-200)}.shk-range-fill{background-color:var(--shk-primary-500)}.shk-range input[type=range]{position:absolute;inset:0;width:100%;margin:0;background:transparent;pointer-events:none;appearance:none;-webkit-appearance:none}.shk-range input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:.875rem;height:.875rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:.625rem;height:.625rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-progress{height:.375rem;min-width:5rem;border-radius:9999px;background-color:var(--shk-surface-200);overflow:hidden}.shk-progress>div{height:100%;border-radius:inherit;background-color:var(--shk-primary-500)}\n"], dependencies: [{ kind: "directive", type: PortalDirective, selector: "[shkPortal]" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "directive", type: ShkIconDirective, selector: "svg[shkIcon]", inputs: ["shkIcon", "size", "strokeWidth", "color"] }, { kind: "component", type: TagComponent, selector: "shk-tag", inputs: ["value", "severity", "rounded", "icon", "style", "styleClass"] }, { kind: "component", type: TooltipComponent, selector: "shk-tooltip", inputs: ["text", "position", "mode", "offset"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1621
1682
  }
1622
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TableComponent, decorators: [{
1683
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.27", ngImport: i0, type: TableComponent, decorators: [{
1623
1684
  type: Component,
1624
- args: [{ selector: 'shk-table', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1685
+ args: [{ selector: 'shk-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1625
1686
  PortalDirective,
1626
1687
  CommonModule,
1627
1688
  TranslocoModule,
1628
- LucideDynamicIcon,
1689
+ ShkIconDirective,
1629
1690
  TagComponent,
1630
1691
  TooltipComponent,
1631
- ], template: "<div class=\"space-y-2 min-[1440px]:space-y-3 mt-2 min-[1440px]:mt-3 animate-fade-in pb-8\">\n @if (\n showSearch() ||\n (showClearButton() && hasFilterableColumns()) ||\n filters().length > 0 ||\n headerActions().length > 0 ||\n (selectable() && bulkActions().length > 0 && selection().length > 0)\n ) {\n <div class=\"card p-2 min-[1440px]:p-2.5 flex flex-row items-center justify-between gap-2\">\n <div class=\"flex items-center gap-2 min-[1440px]:gap-3 flex-1 min-w-0\">\n @if (showSearch()) {\n <div class=\"relative w-full md:w-52 min-[1440px]:w-56\">\n <label [for]=\"uid + '-search'\" class=\"sr-only\">{{\n searchPlaceholder() || ('common.search_placeholder' | transloco)\n }}</label>\n <div class=\"absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none\">\n <svg\n [lucideIcon]=\"getIcon('search')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n </div>\n <input\n [id]=\"uid + '-search'\"\n type=\"text\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($any($event.target).value)\"\n [placeholder]=\"searchPlaceholder() || ('common.search_placeholder' | transloco)\"\n class=\"block w-full pl-8 pr-3 py-1.5 text-xs border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md leading-5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] placeholder:[color:var(--shk-surface-400)] dark:placeholder:[color:var(--shk-surface-500)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)] focus:outline-none focus:bg-white dark:focus:[background-color:var(--shk-surface-100)] focus:[border-color:var(--shk-primary-500)] focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)]\"\n />\n </div>\n }\n @if (showClearButton() && (hasFilterableColumns() || showSearch())) {\n <shk-tooltip [text]=\"tr('table.clearFilters', 'Limpiar b\u00FAsqueda, filtros y orden')\">\n <button\n type=\"button\"\n (click)=\"clearAll()\"\n [disabled]=\"!hasActiveFilters()\"\n class=\"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-600 dark:[color:var(--shk-surface-500)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed whitespace-nowrap\"\n >\n <svg [lucideIcon]=\"icons.clear\" class=\"w-3.5 h-3.5\"></svg>\n {{ tr('table.clear', 'Limpiar') }}\n </button>\n </shk-tooltip>\n }\n @if (filters().length > 0) {\n <div\n class=\"flex _shk-bg-surface-100 dark:[background-color:var(--shk-surface-100)] p-0.5 rounded-md ml-auto\"\n role=\"group\"\n >\n @for (f of filters(); track f.value) {\n <button\n type=\"button\"\n (click)=\"onFilterClick(f.value)\"\n [attr.aria-pressed]=\"f.value === activeFilter()\"\n class=\"px-2.5 min-[1440px]:px-3 py-1 text-xs font-medium rounded _shk-text-surface-700 dark:[color:var(--shk-surface-700)] transition-all\"\n [class]=\"\n f.value === activeFilter()\n ? 'bg-white shadow-sm dark:[background-color:var(--shk-surface-700)]'\n : ''\n \"\n >\n {{ f.label }}\n </button>\n }\n </div>\n }\n </div>\n @if (selectable() && selection().length > 0 && bulkActions().length > 0) {\n <div\n class=\"flex items-center gap-1.5 shrink-0\"\n role=\"toolbar\"\n [attr.aria-label]=\"'table.selected' | transloco: { count: selection().length }\"\n >\n <span\n class=\"text-xs font-medium _shk-text-surface-600 dark:[color:var(--shk-surface-400)] whitespace-nowrap\"\n aria-live=\"polite\"\n >{{ 'table.selected' | transloco: { count: selection().length } }}</span\n >\n <button\n type=\"button\"\n (click)=\"clearSelection()\"\n [attr.aria-label]=\"'table.clearSelection' | transloco\"\n class=\"table-action-btn rounded-md _shk-text-surface-500 dark:[color:var(--shk-surface-400)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n >\n <svg [lucideIcon]=\"getIcon('x')\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n @for (action of visibleBulkActions(); track $index) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isBulkActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"runBulkAction(action)\"\n >\n @if (action.icon) {\n <svg [lucideIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n </div>\n }\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-1.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <svg [lucideIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n <div class=\"card p-0 overflow-hidden table-card\" [class.shadow-lg]=\"hasShadow()\">\n <div class=\"table-scroll-wrapper _shk-scrollbar\">\n <table\n [class.shk-gridlines]=\"showGridlines()\"\n [class.shk-row-hover]=\"rowHover()\"\n >\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n data-shk-select\n class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [disabled]=\"loading() || selectablePageRows().length === 0\"\n (change)=\"toggleSelectAllPage()\"\n [attr.aria-label]=\"'table.selectAll' | transloco\"\n />\n </th>\n }\n @for (col of columnsWithActions(); track col.field) {\n <th\n scope=\"col\"\n (click)=\"onHeaderClick(col)\"\n (keydown)=\"onHeaderKeydown($event, col)\"\n [tabindex]=\"col.field !== 'actions' && col.sortable ? 0 : -1\"\n [attr.role]=\"col.field !== 'actions' && col.sortable ? 'button' : null\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [style.cursor]=\"col.field !== 'actions' && col.sortable ? 'pointer' : 'default'\"\n [style.width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : null)\"\n [style.min-width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : col.minWidth) || null\"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n class=\"relative px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-left text-[10px] min-[1440px]:text-xs font-bold _shk-text-surface-500 dark:[color:var(--shk-surface-400)] uppercase tracking-wider _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)] focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n >\n @if (col.field !== 'actions') {\n <div class=\"flex items-center justify-between gap-2\">\n <span>{{ col.header }}</span>\n <div class=\"flex items-center gap-1 shrink-0\">\n @if (col.sortable) {\n <shk-tooltip [text]=\"'table.tooltips.sort' | transloco\">\n @if (sortField() === col.field) {\n <svg\n [lucideIcon]=\"getIcon(sortOrder() === 1 ? 'arrow-up' : 'arrow-down')\"\n class=\"w-3.5 h-3.5 _shk-text-primary\"\n ></svg>\n } @else {\n <svg\n [lucideIcon]=\"getIcon('arrow-up-down')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n }\n </shk-tooltip>\n }\n @if (col.filter) {\n <shk-tooltip [text]=\"'table.tooltips.filter' | transloco\">\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleFilter(col, $event)\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [attr.aria-expanded]=\"openFilterField() === col.field\"\n aria-haspopup=\"dialog\"\n class=\"_shk-text-surface-400 dark:[color:var(--shk-surface-500)] hover:[color:var(--shk-surface-600)] dark:hover:[color:var(--shk-surface-300)] transition-colors\"\n >\n <svg\n [lucideIcon]=\"getIcon('filter')\"\n class=\"w-3.5 h-3.5\"\n [class._shk-text-primary]=\"hasFilterValue(col.field) || openFilterField() === col.field\"\n ></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n </div>\n\n\n <!-- Column filter menu -->\n @if (col.filter && openFilterField() === col.field && filterDraft(); as draft) {\n <div\n shkPortal\n class=\"shk-filter-overlay fixed z-[9999] w-[240px] overflow-y-auto normal-case tracking-normal font-normal text-xs _shk-text-surface-700 dark:[color:var(--shk-surface-700)] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-lg shadow-lg\"\n role=\"dialog\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [style.top.px]=\"filterPopupPosition().top\"\n [style.left.px]=\"filterPopupPosition().left\"\n [style.max-height.px]=\"filterPopupPosition().maxHeight\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeFilters()\"\n >\n @if (col.filterMenuTitle) {\n <div class=\"px-2 pt-2 font-semibold _shk-text-surface-800 dark:[color:var(--shk-surface-800)]\">\n {{ col.filterMenuTitle }}\n </div>\n }\n @if (showOperatorFor(col)) {\n <div class=\"p-2 border-b _shk-border dark:[border-color:var(--shk-surface-200)]\">\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"filterLabel('matchAll') + ' / ' + filterLabel('matchAny')\"\n (change)=\"setDraftOperator($any($event.target).value)\"\n >\n <option value=\"and\" [selected]=\"draft.operator === 'and'\">\n {{ filterLabel('matchAll') }}\n </option>\n <option value=\"or\" [selected]=\"draft.operator === 'or'\">\n {{ filterLabel('matchAny') }}\n </option>\n </select>\n </div>\n }\n\n @switch (filterKind(col)) {\n @case ('select') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: false }\"\n ></ng-container>\n }\n @case ('multiselect') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: true }\"\n ></ng-container>\n }\n @case ('boolean') {\n @let boolValue = draft.rules[0].value;\n <div class=\"p-2\">\n <button\n type=\"button\"\n role=\"checkbox\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n class=\"inline-flex items-center gap-2 rounded-md focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n [attr.aria-checked]=\"\n boolValue === true ? 'true' : boolValue === false ? 'false' : 'mixed'\n \"\n (click)=\"cycleBoolean(col)\"\n >\n <span\n class=\"shk-checkbox-box\"\n [class.shk-checked]=\"boolValue === true || boolValue === false\"\n >\n @if (boolValue === true) {\n <svg [lucideIcon]=\"getIcon('check')\"></svg>\n } @else if (boolValue === false) {\n <svg [lucideIcon]=\"getIcon('x')\"></svg>\n }\n </span>\n <span>{{\n boolValue === true\n ? filterLabel('yes')\n : boolValue === false\n ? filterLabel('no')\n : filterLabel('any')\n }}</span>\n </button>\n </div>\n }\n @case ('range') {\n @let rv = rangeValue(col);\n @let bounds = rangeBounds(col);\n <div class=\"p-2\">\n <div class=\"shk-range\">\n <div class=\"shk-range-track\"></div>\n <div\n class=\"shk-range-fill\"\n [style.left.%]=\"rangePercent(col, rv[0])\"\n [style.width.%]=\"rangePercent(col, rv[1]) - rangePercent(col, rv[0])\"\n ></div>\n <input\n type=\"range\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[0]\"\n [style.z-index]=\"rv[0] >= bounds[1] ? 3 : null\"\n [attr.aria-label]=\"col.header + ' min'\"\n (input)=\"onRangeInput(col, 0, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 0, $any($event.target).value, true)\"\n />\n <input\n type=\"range\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[1]\"\n [attr.aria-label]=\"col.header + ' max'\"\n (input)=\"onRangeInput(col, 1, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 1, $any($event.target).value, true)\"\n />\n </div>\n <div class=\"flex items-center justify-between px-0.5 _shk-text-surface-500 dark:[color:var(--shk-surface-500)]\">\n <span>{{ rv[0] }}</span>\n <span>{{ rv[1] }}</span>\n </div>\n </div>\n }\n @default {\n <!-- text / numeric / date: one block per rule -->\n @for (rule of draft.rules; track $index; let i = $index) {\n <div\n class=\"flex flex-col gap-1.5 p-2\"\n [class.border-b]=\"i < draft.rules.length - 1\"\n [class._shk-border]=\"i < draft.rules.length - 1\"\n >\n @if (showMatchModesFor(col)) {\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"col.header\"\n (change)=\"setDraftMatchMode(col, i, $any($event.target).value)\"\n >\n @for (mode of matchModesFor(col); track mode) {\n <option [value]=\"mode\" [selected]=\"mode === rule.matchMode\">\n {{ matchModeLabel(mode) }}\n </option>\n }\n </select>\n }\n <input\n [id]=\"uid + '-filter-' + safeId(col.field) + '-' + i\"\n [type]=\"filterKind(col) === 'numeric' ? 'number' : filterKind(col) === 'date' ? 'date' : 'text'\"\n [attr.step]=\"filterKind(col) === 'numeric' ? 'any' : null\"\n class=\"shk-filter-input\"\n [value]=\"rule.value ?? ''\"\n [placeholder]=\"col.filterPlaceholder || ('common.search_placeholder' | transloco)\"\n [attr.aria-label]=\"col.header\"\n (input)=\"onRuleInput(col, i, $any($event.target).value)\"\n (keydown.enter)=\"applyFilter(col)\"\n />\n @if (draft.rules.length > 1) {\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-1 py-1 rounded-md [color:var(--shk-error-600)] hover:[background-color:var(--shk-error-50)] transition-colors\"\n (click)=\"removeRule(i)\"\n >\n <svg [lucideIcon]=\"icons.trash\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('removeRule') }}\n </button>\n }\n </div>\n }\n @if (canAddRule(col)) {\n <div class=\"px-2 pb-1\">\n <button\n type=\"button\"\n class=\"w-full inline-flex items-center justify-center gap-1 py-1 rounded-md _shk-text-primary hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"addRule(col)\"\n >\n <svg [lucideIcon]=\"getIcon('plus')\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('addRule') }}\n </button>\n </div>\n }\n }\n }\n\n <div class=\"flex items-center justify-between gap-2 p-2 border-t _shk-border dark:[border-color:var(--shk-surface-200)]\">\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md border _shk-border dark:[border-color:var(--shk-surface-200)] _shk-text-surface-600 dark:[color:var(--shk-surface-500)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"clearFilter(col.field)\"\n >\n {{ filterLabel('clear') }}\n </button>\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors\"\n (click)=\"applyFilter(col)\"\n >\n {{ filterLabel('apply') }}\n </button>\n </div>\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center\">\n <span>{{ col.header }}</span>\n </div>\n }\n @if (isResizable()) {\n <span\n class=\"shk-col-resizer\"\n [class.shk-resizing]=\"resizingField() === col.field\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n [attr.aria-label]=\"tr('table.resizeColumn', 'Redimensionar columna') + ': ' + col.header\"\n [attr.aria-valuenow]=\"resizedWidthPx(col)\"\n (pointerdown)=\"startResize($event, col)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation(); resetColumnWidth(col)\"\n (keydown)=\"onResizerKeydown($event, col)\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n @if (loading()) {\n <tbody class=\"border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div\n class=\"flex items-center justify-center\"\n role=\"status\"\n [attr.aria-label]=\"'common.loading' | transloco\"\n >\n <svg\n [lucideIcon]=\"getIcon('loader')\"\n class=\"w-6 h-6 animate-spin _shk-text-primary\"\n ></svg>\n </div>\n </td>\n </tr>\n </tbody>\n } @else if (effectiveDisplayedData().length === 0) {\n <tbody class=\"border-b _shk-border dark:[border-color:var(--shk-surface-100)]\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div class=\"flex flex-col items-center\">\n <div\n class=\"w-16 h-16 _shk-bg-surface-100 dark:[background-color:var(--shk-surface-100)] rounded-full flex items-center justify-center mb-4\"\n >\n <svg\n [lucideIcon]=\"getIcon('inbox')\"\n class=\"w-8 h-8 _shk-text-surface-400 dark:[color:var(--shk-surface-500)]\"\n ></svg>\n </div>\n <p\n class=\"text-lg font-semibold _shk-text-surface-600 dark:[color:var(--shk-surface-300)]\"\n >\n {{ emptyMessage() || ('common.no_records' | transloco) }}\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n } @else {\n <tbody>\n @for (rowData of effectiveDisplayedData(); track trackByRow(rowData, $index)) {\n <tr\n [attr.aria-selected]=\"selectable() ? isRowSelected(rowData) : null\"\n [class.shk-row-selected]=\"selectable() && isRowSelected(rowData)\"\n [class.shk-row-missing-error]=\"rowSeverity(rowData) === 'error'\"\n [class.shk-row-missing-warning]=\"rowSeverity(rowData) === 'warning'\"\n class=\"shk-data-row transition-colors duration-200 border-b _shk-border dark:[border-color:var(--shk-surface-100)]\"\n >\n @if (selectable()) {\n <td data-shk-select class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center\">\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"isRowSelected(rowData)\"\n [disabled]=\"!canSelectRow(rowData)\"\n (change)=\"toggleRowSelection(rowData)\"\n [attr.aria-label]=\"'table.selectRow' | transloco: { index: first() + $index + 1 }\"\n />\n </td>\n }\n @for (col of columnsWithActions(); track col.field) {\n <td\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [class]=\"\n 'px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)] ' +\n (col.field === 'actions' ? 'whitespace-nowrap' : 'whitespace-normal break-words')\n \"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n [class.shk-cell-missing]=\"col.field !== 'actions' && isCellMissing(col, rowData)\"\n [class.shk-missing-error]=\"col.field !== 'actions' && isCellMissing(col, rowData) && severityOf(col) === 'error'\"\n [class.shk-missing-warning]=\"col.field !== 'actions' && isCellMissing(col, rowData) && severityOf(col) === 'warning'\"\n >\n @if (col.field !== 'actions' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"missingIconFor(col)\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ missingCellMessage(col) }}\n </span>\n } @else if (col.field !== 'actions') {\n @switch (col.template) {\n @case ('tag') {\n <shk-tag\n [value]=\"getTagValue(col, rowData)\"\n [severity]=\"getTagSeverity(col, rowData)\"\n [rounded]=\"getTagRounded(col, rowData)\"\n [icon]=\"getTagIcon(col, rowData)\"\n [style]=\"getTagStyle(col, rowData)\"\n />\n }\n @case ('progress') {\n <div\n class=\"shk-progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"getProgress(col, rowData)\"\n [attr.aria-label]=\"col.header\"\n >\n <div [style.width.%]=\"getProgress(col, rowData)\"></div>\n </div>\n }\n @case ('boolean') {\n @if (resolveField(rowData, col.field)) {\n <svg\n [lucideIcon]=\"icons.yes\"\n class=\"w-4 h-4 [color:var(--shk-success-600)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('yes')\"\n ></svg>\n } @else {\n <svg\n [lucideIcon]=\"icons.no\"\n class=\"w-4 h-4 [color:var(--shk-error-500)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('no')\"\n ></svg>\n }\n }\n @case ('date') {\n {{ resolveField(rowData, col.field) | date: col.dateFormat || 'dd/MM/yyyy' }}\n }\n @case ('currency') {\n {{ resolveField(rowData, col.field) | currency: col.currency || 'USD' : 'symbol' }}\n }\n @default {\n @if (col.image) {\n <div class=\"flex items-center gap-2\">\n @if (col.image(rowData); as src) {\n <img\n [src]=\"src\"\n alt=\"\"\n [width]=\"col.imageWidth || 24\"\n class=\"shrink-0 rounded-sm\"\n />\n }\n <span>\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n </span>\n </div>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n }\n }\n }\n } @else {\n <div class=\"flex items-center justify-start gap-px\">\n @for (action of getVisibleRowActions(rowData); track $index) {\n @if (isRowActionVisible(action, rowData)) {\n <div class=\"relative group\">\n <shk-tooltip\n [text]=\"getRowActionLabel(action, rowData)\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData)\"\n [class]=\"\n 'table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md ' +\n getRowActionClass(action, rowData)\n \"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [attr.aria-label]=\"getRowActionLabel(action, rowData)\"\n >\n <svg\n [lucideIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n </div>\n }\n }\n @if (getHiddenRowActions(rowData).length > 0) {\n <div class=\"relative\">\n <shk-tooltip\n [text]=\"'common.more_options' | transloco\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleActionsDropdown(rowData, $event)\"\n class=\"table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md\"\n [attr.aria-label]=\"'common.more_options' | transloco\"\n [attr.aria-expanded]=\"isActionsDropdownOpen(rowData)\"\n >\n <svg\n [lucideIcon]=\"getIcon('ellipsis-vertical')\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n @if (isActionsDropdownOpen(rowData)) {\n <div\n shkPortal\n class=\"fixed z-[9999] min-w-[160px] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md shadow-lg py-1\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n >\n @for (action of getHiddenRowActions(rowData); track $index) {\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData); toggleActionsDropdown(rowData)\"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [class]=\"\n 'w-full flex items-center gap-2 px-3 py-2 text-xs text-left _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors ' +\n getRowActionClass(action, rowData)\n \"\n >\n <svg\n [lucideIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-3.5 h-3.5 shrink-0\"\n ></svg>\n <span>{{ getRowActionLabel(action, rowData) }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n }\n </table>\n\n <!-- Text content of a cell: format() \u00B7 custom template \u00B7 raw value -->\n <ng-template #cellText let-rowData let-col=\"col\">\n @if (col.format) {\n <span>{{ col.format(rowData) }}</span>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n customTemplates()[col.field] || defaultTemplate;\n context: { $implicit: rowData, field: col.field }\n \"\n ></ng-container>\n }\n </ng-template>\n <ng-template #defaultTemplate let-rowData let-field=\"field\">\n {{ resolveField(rowData, field) }}\n </ng-template>\n\n <!-- Option list of the select / multiselect filters -->\n <ng-template #optionList let-col let-draft=\"draft\" let-multiple=\"multiple\">\n <div class=\"p-2 space-y-1.5\">\n @let selectedLabel = multiple ? selectedOptionsLabel(col) : selectedSingleLabel(col);\n <button\n type=\"button\"\n class=\"shk-filter-select flex items-center justify-between gap-2 text-left\"\n style=\"background-image: none\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [attr.aria-expanded]=\"multiselectOpen()\"\n (click)=\"multiselectOpen.set(!multiselectOpen())\"\n >\n <span class=\"truncate\" [class._shk-text-surface-400]=\"!selectedLabel\">\n {{ selectedLabel || tr('table.filterAll', 'Todos') }}\n </span>\n <svg\n [lucideIcon]=\"getIcon('chevron-down')\"\n class=\"w-3.5 h-3.5 shrink-0 _shk-text-surface-400 transition-transform\"\n [class.rotate-180]=\"multiselectOpen()\"\n ></svg>\n </button>\n @if (multiselectOpen()) {\n <div\n class=\"max-h-52 overflow-y-auto p-0.5 border _shk-border dark:[border-color:var(--shk-surface-200)] rounded-md _shk-scrollbar\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple\"\n >\n @for (opt of col.filterOptions || []; track $index) {\n @let isSelected = multiple\n ? isOptionSelected(opt.value)\n : draft.rules[0].value != null && draft.rules[0].value == opt.value;\n <button\n type=\"button\"\n role=\"option\"\n class=\"w-full flex items-center gap-2 px-2 py-1.5 rounded text-left transition-colors hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [class._shk-bg-primary-soft]=\"isSelected\"\n [class._shk-text-primary-700]=\"isSelected\"\n [attr.aria-selected]=\"isSelected\"\n (click)=\"multiple ? toggleOption(col, opt.value) : selectOption(col, opt.value)\"\n >\n @if (multiple) {\n <span class=\"shk-checkbox-box\" [class.shk-checked]=\"isSelected\">\n @if (isSelected) {\n <svg [lucideIcon]=\"getIcon('check')\"></svg>\n }\n </span>\n }\n @if (opt.image) {\n <img [src]=\"opt.image\" alt=\"\" width=\"22\" class=\"shrink-0 rounded-sm\" />\n }\n <span class=\"truncate\">{{ opt.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </div>\n <div\n class=\"table-pagination flex items-center justify-between gap-4 px-2 min-[1440px]:px-3 py-2 border-t _shk-border dark:[border-color:var(--shk-surface-100)]\"\n >\n <div class=\"text-xs _shk-text-surface-600 dark:[color:var(--shk-surface-400)]\">\n @if (showPageReport()) {\n {{ pageReport() }}\n }\n </div>\n <div\n class=\"flex items-center gap-0.5\"\n role=\"navigation\"\n >\n <button\n type=\"button\"\n (click)=\"goToFirst()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.firstPage', 'Primera p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevrons-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"prev()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.prevPage', 'P\u00E1gina anterior')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span\n class=\"px-2 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)]\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n type=\"button\"\n (click)=\"next()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.nextPage', 'P\u00E1gina siguiente')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"goToLast()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.lastPage', '\u00DAltima p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:[color:var(--shk-surface-400)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [lucideIcon]=\"getIcon('chevrons-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n <div\n class=\"flex items-center gap-1.5 text-xs _shk-text-surface-600 dark:[color:var(--shk-surface-400)]\"\n >\n @if (showRowsPerPage()) {\n <label [for]=\"uid + '-rows-per-page'\">{{ 'table.rows' | transloco }}</label>\n <select\n [id]=\"uid + '-rows-per-page'\"\n (change)=\"onRowsPerPageChange($any($event.target).value)\"\n class=\"border _shk-border dark:[border-color:var(--shk-surface-200)] rounded px-2 py-1 text-xs bg-white dark:[background-color:var(--shk-surface-100)] _shk-text-surface-700 dark:[color:var(--shk-surface-700)] focus:outline-none focus:[border-color:var(--shk-primary-500)]\"\n >\n @for (opt of rowsPerPageOptions(); track opt) {\n <option [value]=\"opt\" [selected]=\"opt === rowsPerPageLocal()\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n </div>\n </div>\n</div>\n", styles: ["input:focus{outline:none}input[type=text]{font-weight:400!important}table th{white-space:nowrap}table td{white-space:normal;overflow-wrap:break-word}.shk-page-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:.375rem;transition:background-color .15s ease,color .15s ease}.shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-200)}.shk-page-btn:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--shk-primary-500) 45%,transparent)}td button svg{width:1.125rem!important;height:1.125rem!important}td button:disabled{opacity:.4;cursor:not-allowed}.table-action-btn svg{width:1rem!important;height:1rem!important;min-width:1rem!important;min-height:1rem!important}.table-action-btn{padding:.5rem!important;min-width:2rem!important;min-height:2rem!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;border-radius:inherit;-webkit-overflow-scrolling:touch;container-type:inline-size}.table-card,.table-pagination{container-type:inline-size}@container (max-width: 640px){.table-pagination{flex-direction:column;align-items:center;gap:.5rem}.table-pagination>div{justify-content:center}}.table-scroll-wrapper table{table-layout:auto;width:100%}@container (max-width: 768px){.table-scroll-wrapper{scroll-snap-type:x mandatory}.table-scroll-wrapper table{table-layout:auto;width:100%}.table-scroll-wrapper th:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px);max-width:var(--shk-col-width, 140px)}.table-scroll-wrapper th,.table-scroll-wrapper td{scroll-snap-align:start}}th[data-shk-select],td[data-shk-select]{width:2.5rem;min-width:2.5rem}.shk-table-checkbox{width:.875rem;height:.875rem;cursor:pointer;vertical-align:middle;accent-color:var(--shk-primary-500)}.shk-table-checkbox:disabled{opacity:.4;cursor:not-allowed}tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent)}tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 90%,transparent)}:host-context(.dark) tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-900) 20%,transparent)}:host-context(.dark) tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 30%,transparent)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}tr.shk-row-missing-error{background-color:color-mix(in srgb,var(--shk-error-500) 8%,transparent)}tr.shk-row-missing-error>td:first-child{box-shadow:inset 3px 0 0 var(--shk-error-500)}table.shk-row-hover tbody tr.shk-row-missing-error.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-error-500) 14%,transparent)}tr.shk-row-missing-warning{background-color:color-mix(in srgb,var(--shk-warning-400) 10%,transparent)}tr.shk-row-missing-warning>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing-warning.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 16%,transparent)}td.shk-missing-error .shk-missing-cell{color:var(--shk-error-600)}:host-context(.dark) td.shk-missing-error .shk-missing-cell{color:var(--shk-error-400)}td.shk-missing-warning .shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) td.shk-missing-warning .shk-missing-cell{color:var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 30%,transparent)}:host-context(.dark) table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 10%,transparent)}table.shk-gridlines th,table.shk-gridlines td{border-right:1px solid var(--shk-surface-200)}table.shk-gridlines th:last-child,table.shk-gridlines td:last-child{border-right:0}:host-context(.dark) table.shk-gridlines th,:host-context(.dark) table.shk-gridlines td{border-right-color:var(--shk-surface-200)}.shk-col-resizer{position:absolute;top:0;right:-4px;z-index:1;width:8px;height:100%;cursor:col-resize;touch-action:none}.shk-col-resizer:after{content:\"\";position:absolute;top:20%;bottom:20%;left:3px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.shk-col-resizer:hover:after,.shk-col-resizer:focus-visible:after,.shk-col-resizer.shk-resizing:after{background-color:var(--shk-primary-500)}.shk-col-resizer:focus-visible{outline:none}th:last-child .shk-col-resizer{right:0}.shk-filter-input,.shk-filter-select{width:100%;padding:.375rem .625rem;font-size:.75rem;line-height:1.25rem;border-radius:.375rem;border:1px solid var(--shk-surface-200);background-color:#fff;color:var(--shk-surface-700)}.dark .shk-filter-input,.dark .shk-filter-select{background-color:var(--shk-surface-100);border-color:var(--shk-surface-200);color-scheme:dark}.shk-filter-input::placeholder{color:var(--shk-surface-400)}select.shk-filter-select{appearance:none;padding-right:1.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right .5rem center;cursor:pointer}button.shk-filter-select{cursor:pointer}.shk-filter-input:focus,.shk-filter-select:focus{outline:none;border-color:var(--shk-primary-500);box-shadow:0 0 0 1px var(--shk-primary-500)}.shk-checkbox-box{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:.875rem;height:.875rem;border-radius:.1875rem;border:1px solid var(--shk-surface-300);background-color:#fff;color:#fff}.dark .shk-checkbox-box{background-color:var(--shk-surface-100)}.shk-checkbox-box.shk-checked{background-color:var(--shk-primary-500);border-color:var(--shk-primary-500)}.shk-checkbox-box svg{width:.625rem;height:.625rem}.shk-range{position:relative;height:1rem;margin:.5rem .375rem .375rem}.shk-range-track,.shk-range-fill{position:absolute;top:50%;height:.1875rem;transform:translateY(-50%);border-radius:9999px}.shk-range-track{left:0;right:0;background-color:var(--shk-surface-200)}.shk-range-fill{background-color:var(--shk-primary-500)}.shk-range input[type=range]{position:absolute;inset:0;width:100%;margin:0;background:transparent;pointer-events:none;appearance:none;-webkit-appearance:none}.shk-range input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:.875rem;height:.875rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:.625rem;height:.625rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-progress{height:.375rem;min-width:5rem;border-radius:9999px;background-color:var(--shk-surface-200);overflow:hidden}.shk-progress>div{height:100%;border-radius:inherit;background-color:var(--shk-primary-500)}\n"] }]
1632
- }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], rowsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPage", required: false }] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showActionRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActionRow", required: false }] }], customTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "customTemplates", required: false }] }], headerActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], hasShadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasShadow", required: false }] }], defaultSortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSortField", required: false }] }], defaultSortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSortOrder", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], globalFilterFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFields", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], serverSide: [{ type: i0.Input, args: [{ isSignal: true, alias: "serverSide", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], activeFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeFilter", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], validateRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateRequired", required: false }] }], missingAsError: [{ type: i0.Input, args: [{ isSignal: true, alias: "missingAsError", required: false }] }], columnWidths: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidths", required: false }] }, { type: i0.Output, args: ["columnWidthsChange"] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], stateStorage: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateStorage", required: false }] }], rowHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHover", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], showPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageReport", required: false }] }], showRowsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowsPerPage", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], isRowSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowSelectable", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], filterClick: [{ type: i0.Output, args: ["filterClick"] }], columnResize: [{ type: i0.Output, args: ["columnResize"] }], onDocumentClick: [{
1692
+ ], template: "<div class=\"space-y-2 min-[1440px]:space-y-3 mt-2 min-[1440px]:mt-3 animate-fade-in pb-8\">\n @if (\n showSearch() ||\n (showClearButton() && hasFilterableColumns()) ||\n filters().length > 0 ||\n headerActions().length > 0 ||\n (selectable() && bulkActions().length > 0 && selection().length > 0)\n ) {\n <div class=\"card p-2 min-[1440px]:p-2.5 flex flex-row items-center justify-between gap-2\">\n <div class=\"flex items-center gap-2 min-[1440px]:gap-3 flex-1 min-w-0\">\n @if (showSearch()) {\n <div class=\"relative w-full md:w-52 min-[1440px]:w-56\">\n <label [for]=\"uid + '-search'\" class=\"sr-only\">{{\n searchPlaceholder() || ('common.search_placeholder' | transloco)\n }}</label>\n <div class=\"absolute inset-y-0 left-0 pl-2.5 flex items-center pointer-events-none\">\n <svg\n [shkIcon]=\"getIcon('search')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400\"\n ></svg>\n </div>\n <input\n [id]=\"uid + '-search'\"\n type=\"text\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($any($event.target).value)\"\n [placeholder]=\"searchPlaceholder() || ('common.search_placeholder' | transloco)\"\n class=\"block w-full pl-8 pr-3 py-1.5 text-xs border _shk-border rounded-md leading-5 _shk-bg-surface-50 placeholder:[color:var(--shk-surface-400)] dark:placeholder:[color:var(--shk-surface-500)] _shk-text-surface-700 focus:outline-none focus:bg-white dark:focus:[background-color:var(--shk-surface-100)] focus:[border-color:var(--shk-primary-500)] focus:ring-1 focus:[--tw-ring-color:var(--shk-primary-500)]\"\n />\n </div>\n }\n @if (showClearButton() && (hasFilterableColumns() || showSearch())) {\n <shk-tooltip [text]=\"tr('table.clearFilters', 'Limpiar b\u00FAsqueda, filtros y orden')\">\n <button\n type=\"button\"\n (click)=\"clearAll()\"\n [disabled]=\"!hasActiveFilters()\"\n class=\"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md border _shk-border _shk-text-surface-600 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed whitespace-nowrap\"\n >\n <svg [shkIcon]=\"icons.clear\" class=\"w-3.5 h-3.5\"></svg>\n {{ tr('table.clear', 'Limpiar') }}\n </button>\n </shk-tooltip>\n }\n @if (filters().length > 0) {\n <div\n class=\"flex _shk-bg-surface-100 p-0.5 rounded-md ml-auto\"\n role=\"group\"\n >\n @for (f of filters(); track f.value) {\n <button\n type=\"button\"\n (click)=\"onFilterClick(f.value)\"\n [attr.aria-pressed]=\"f.value === activeFilter()\"\n class=\"px-2.5 min-[1440px]:px-3 py-1 text-xs font-medium rounded _shk-text-surface-700 transition-all\"\n [class]=\"\n f.value === activeFilter()\n ? 'bg-white shadow-sm dark:[background-color:var(--shk-surface-700)]'\n : ''\n \"\n >\n {{ f.label }}\n </button>\n }\n </div>\n }\n </div>\n @if (selectable() && selection().length > 0 && bulkActions().length > 0) {\n <div\n class=\"flex items-center gap-1.5 shrink-0\"\n role=\"toolbar\"\n [attr.aria-label]=\"'table.selected' | transloco: { count: selection().length }\"\n >\n <span\n class=\"text-xs font-medium _shk-text-surface-600 whitespace-nowrap\"\n aria-live=\"polite\"\n >{{ 'table.selected' | transloco: { count: selection().length } }}</span\n >\n <button\n type=\"button\"\n (click)=\"clearSelection()\"\n [attr.aria-label]=\"'table.clearSelection' | transloco\"\n class=\"table-action-btn rounded-md _shk-text-surface-500 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n >\n <svg [shkIcon]=\"getIcon('x')\" class=\"w-3.5 h-3.5\"></svg>\n </button>\n @for (action of visibleBulkActions(); track $index) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isBulkActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"runBulkAction(action)\"\n >\n @if (action.icon) {\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n </div>\n }\n @if (headerActions().length > 0) {\n <div class=\"flex items-center gap-1.5 shrink-0\">\n @for (action of headerActions(); track $index) {\n @if (isHeaderActionVisible(action)) {\n <button\n type=\"button\"\n [class]=\"\n 'inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed ' +\n (action.class || '')\n \"\n [disabled]=\"isHeaderActionDisabled(action)\"\n [attr.aria-label]=\"action.label\"\n (click)=\"action.onClick()\"\n >\n @if (action.icon) {\n <svg [shkIcon]=\"getIcon(action.icon)\" class=\"w-3.5 h-3.5\"></svg>\n }\n {{ action.label }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n <div class=\"card p-0 overflow-hidden table-card\" [class.shadow-lg]=\"hasShadow()\">\n <div class=\"table-scroll-wrapper _shk-scrollbar\">\n <table\n class=\"shk-data-table\"\n [class.shk-gridlines]=\"showGridlines()\"\n [class.shk-row-hover]=\"rowHover()\"\n >\n <thead>\n <tr>\n @if (selectable()) {\n <th\n scope=\"col\"\n data-shk-select\n class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center _shk-bg-surface-50 border-b _shk-border\"\n >\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"allPageSelected()\"\n [indeterminate]=\"somePageSelected()\"\n [disabled]=\"loading() || selectablePageRows().length === 0\"\n (change)=\"toggleSelectAllPage()\"\n [attr.aria-label]=\"'table.selectAll' | transloco\"\n />\n </th>\n }\n @for (col of columnsWithActions(); track col.field) {\n <th\n scope=\"col\"\n (click)=\"onHeaderClick(col)\"\n (keydown)=\"onHeaderKeydown($event, col)\"\n [tabindex]=\"col.field !== 'actions' && col.sortable ? 0 : -1\"\n [attr.role]=\"col.field !== 'actions' && col.sortable ? 'button' : null\"\n [attr.aria-sort]=\"getAriaSort(col)\"\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [style.cursor]=\"col.field !== 'actions' && col.sortable ? 'pointer' : 'default'\"\n [style.width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : null)\"\n [style.min-width]=\"resizedWidth(col) || (col.field === 'actions' ? col.width : col.minWidth) || null\"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n class=\"relative px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-left text-[10px] min-[1440px]:text-xs font-bold _shk-text-surface-500 uppercase tracking-wider _shk-bg-surface-50 border-b _shk-border focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n >\n @if (col.field !== 'actions') {\n <div class=\"flex items-center justify-between gap-2\">\n <span>{{ col.header }}</span>\n <div class=\"flex items-center gap-1 shrink-0\">\n @if (col.sortable) {\n <shk-tooltip [text]=\"'table.tooltips.sort' | transloco\">\n @if (sortField() === col.field) {\n <svg\n [shkIcon]=\"getIcon(sortOrder() === 1 ? 'arrow-up' : 'arrow-down')\"\n class=\"w-3.5 h-3.5 _shk-text-primary\"\n ></svg>\n } @else {\n <svg\n [shkIcon]=\"getIcon('arrow-up-down')\"\n class=\"w-3.5 h-3.5 _shk-text-surface-400\"\n ></svg>\n }\n </shk-tooltip>\n }\n @if (col.filter) {\n <shk-tooltip [text]=\"'table.tooltips.filter' | transloco\">\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleFilter(col, $event)\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [attr.aria-expanded]=\"openFilterField() === col.field\"\n aria-haspopup=\"dialog\"\n class=\"_shk-text-surface-400 hover:[color:var(--shk-surface-600)] dark:hover:[color:var(--shk-surface-300)] transition-colors\"\n >\n <svg\n [shkIcon]=\"getIcon('filter')\"\n class=\"w-3.5 h-3.5\"\n [class._shk-text-primary]=\"hasFilterValue(col.field) || openFilterField() === col.field\"\n ></svg>\n </button>\n </shk-tooltip>\n }\n </div>\n </div>\n\n\n <!-- Column filter menu -->\n @if (col.filter && openFilterField() === col.field && filterDraft(); as draft) {\n <div\n shkPortal\n class=\"shk-filter-overlay fixed z-[9999] w-[240px] overflow-y-auto normal-case tracking-normal font-normal text-xs _shk-text-surface-700 bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border rounded-lg shadow-lg\"\n role=\"dialog\"\n [attr.aria-label]=\"('table.tooltips.filter' | transloco) + ': ' + col.header\"\n [style.top.px]=\"filterPopupPosition().top\"\n [style.left.px]=\"filterPopupPosition().left\"\n [style.max-height.px]=\"filterPopupPosition().maxHeight\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"$event.stopPropagation()\"\n (keydown.escape)=\"closeFilters()\"\n >\n @if (col.filterMenuTitle) {\n <div class=\"px-2 pt-2 font-semibold _shk-text-surface-800\">\n {{ col.filterMenuTitle }}\n </div>\n }\n @if (showOperatorFor(col)) {\n <div class=\"p-2 border-b _shk-border\">\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"filterLabel('matchAll') + ' / ' + filterLabel('matchAny')\"\n (change)=\"setDraftOperator($any($event.target).value)\"\n >\n <option value=\"and\" [selected]=\"draft.operator === 'and'\">\n {{ filterLabel('matchAll') }}\n </option>\n <option value=\"or\" [selected]=\"draft.operator === 'or'\">\n {{ filterLabel('matchAny') }}\n </option>\n </select>\n </div>\n }\n\n @switch (filterKind(col)) {\n @case ('select') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: false }\"\n ></ng-container>\n }\n @case ('multiselect') {\n <ng-container\n *ngTemplateOutlet=\"optionList; context: { $implicit: col, draft: draft, multiple: true }\"\n ></ng-container>\n }\n @case ('boolean') {\n @let boolValue = draft.rules[0].value;\n <div class=\"p-2\">\n <button\n type=\"button\"\n role=\"checkbox\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n class=\"inline-flex items-center gap-2 rounded-md focus:outline-none focus-visible:ring-1 focus-visible:[--tw-ring-color:var(--shk-primary-500)]\"\n [attr.aria-checked]=\"\n boolValue === true ? 'true' : boolValue === false ? 'false' : 'mixed'\n \"\n (click)=\"cycleBoolean(col)\"\n >\n <span\n class=\"shk-checkbox-box\"\n [class.shk-checked]=\"boolValue === true || boolValue === false\"\n >\n @if (boolValue === true) {\n <svg [shkIcon]=\"getIcon('check')\"></svg>\n } @else if (boolValue === false) {\n <svg [shkIcon]=\"getIcon('x')\"></svg>\n }\n </span>\n <span>{{\n boolValue === true\n ? filterLabel('yes')\n : boolValue === false\n ? filterLabel('no')\n : filterLabel('any')\n }}</span>\n </button>\n </div>\n }\n @case ('range') {\n @let rv = rangeValue(col);\n @let bounds = rangeBounds(col);\n <div class=\"p-2\">\n <div class=\"shk-range\">\n <div class=\"shk-range-track\"></div>\n <div\n class=\"shk-range-fill\"\n [style.left.%]=\"rangePercent(col, rv[0])\"\n [style.width.%]=\"rangePercent(col, rv[1]) - rangePercent(col, rv[0])\"\n ></div>\n <input\n type=\"range\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[0]\"\n [style.z-index]=\"rv[0] >= bounds[1] ? 3 : null\"\n [attr.aria-label]=\"col.header + ' min'\"\n (input)=\"onRangeInput(col, 0, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 0, $any($event.target).value, true)\"\n />\n <input\n type=\"range\"\n [min]=\"bounds[0]\"\n [max]=\"bounds[1]\"\n [step]=\"col.filterStep || 1\"\n [value]=\"rv[1]\"\n [attr.aria-label]=\"col.header + ' max'\"\n (input)=\"onRangeInput(col, 1, $any($event.target).value, false)\"\n (change)=\"onRangeInput(col, 1, $any($event.target).value, true)\"\n />\n </div>\n <div class=\"flex items-center justify-between px-0.5 _shk-text-surface-500\">\n <span>{{ rv[0] }}</span>\n <span>{{ rv[1] }}</span>\n </div>\n </div>\n }\n @default {\n <!-- text / numeric / date: one block per rule -->\n @for (rule of draft.rules; track $index; let i = $index) {\n <div\n class=\"flex flex-col gap-1.5 p-2\"\n [class.border-b]=\"i < draft.rules.length - 1\"\n [class._shk-border]=\"i < draft.rules.length - 1\"\n >\n @if (showMatchModesFor(col)) {\n <select\n class=\"shk-filter-select\"\n [attr.aria-label]=\"col.header\"\n (change)=\"setDraftMatchMode(col, i, $any($event.target).value)\"\n >\n @for (mode of matchModesFor(col); track mode) {\n <option [value]=\"mode\" [selected]=\"mode === rule.matchMode\">\n {{ matchModeLabel(mode) }}\n </option>\n }\n </select>\n }\n <input\n [id]=\"uid + '-filter-' + safeId(col.field) + '-' + i\"\n [type]=\"filterKind(col) === 'numeric' ? 'number' : filterKind(col) === 'date' ? 'date' : 'text'\"\n [attr.step]=\"filterKind(col) === 'numeric' ? 'any' : null\"\n class=\"shk-filter-input\"\n [value]=\"rule.value ?? ''\"\n [placeholder]=\"col.filterPlaceholder || ('common.search_placeholder' | transloco)\"\n [attr.aria-label]=\"col.header\"\n (input)=\"onRuleInput(col, i, $any($event.target).value)\"\n (keydown.enter)=\"applyFilter(col)\"\n />\n @if (draft.rules.length > 1) {\n <button\n type=\"button\"\n class=\"inline-flex items-center justify-center gap-1 py-1 rounded-md [color:var(--shk-error-600)] hover:[background-color:var(--shk-error-50)] transition-colors\"\n (click)=\"removeRule(i)\"\n >\n <svg [shkIcon]=\"icons.trash\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('removeRule') }}\n </button>\n }\n </div>\n }\n @if (canAddRule(col)) {\n <div class=\"px-2 pb-1\">\n <button\n type=\"button\"\n class=\"w-full inline-flex items-center justify-center gap-1 py-1 rounded-md _shk-text-primary hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"addRule(col)\"\n >\n <svg [shkIcon]=\"getIcon('plus')\" class=\"w-3.5 h-3.5\"></svg>\n {{ filterLabel('addRule') }}\n </button>\n </div>\n }\n }\n }\n\n <div class=\"flex items-center justify-between gap-2 p-2 border-t _shk-border\">\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md border _shk-border _shk-text-surface-600 hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] transition-colors\"\n (click)=\"clearFilter(col.field)\"\n >\n {{ filterLabel('clear') }}\n </button>\n <button\n type=\"button\"\n class=\"px-3 py-1.5 font-medium rounded-md _shk-bg-primary text-white hover:[background-color:var(--shk-primary-700)] transition-colors\"\n (click)=\"applyFilter(col)\"\n >\n {{ filterLabel('apply') }}\n </button>\n </div>\n </div>\n }\n } @else {\n <div class=\"flex items-center justify-center\">\n <span>{{ col.header }}</span>\n </div>\n }\n @if (isResizable()) {\n <span\n class=\"shk-col-resizer\"\n [class.shk-resizing]=\"resizingField() === col.field\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n tabindex=\"0\"\n [attr.aria-label]=\"tr('table.resizeColumn', 'Redimensionar columna') + ': ' + col.header\"\n [attr.aria-valuenow]=\"resizedWidthPx(col)\"\n (pointerdown)=\"startResize($event, col)\"\n (click)=\"$event.stopPropagation()\"\n (dblclick)=\"$event.stopPropagation(); resetColumnWidth(col)\"\n (keydown)=\"onResizerKeydown($event, col)\"\n ></span>\n }\n </th>\n }\n </tr>\n </thead>\n @if (loading()) {\n <tbody class=\"border-b _shk-border\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div\n class=\"flex items-center justify-center\"\n role=\"status\"\n [attr.aria-label]=\"'common.loading' | transloco\"\n >\n <svg\n [shkIcon]=\"getIcon('loader')\"\n class=\"w-6 h-6 animate-spin _shk-text-primary\"\n ></svg>\n </div>\n </td>\n </tr>\n </tbody>\n } @else if (effectiveDisplayedData().length === 0) {\n <tbody class=\"border-b _shk-border\">\n <tr>\n <td [attr.colspan]=\"totalColspan()\" class=\"text-center py-12\">\n <div class=\"flex flex-col items-center\">\n <div\n class=\"w-16 h-16 _shk-bg-surface-100 rounded-full flex items-center justify-center mb-4\"\n >\n <svg\n [shkIcon]=\"getIcon('inbox')\"\n class=\"w-8 h-8 _shk-text-surface-400\"\n ></svg>\n </div>\n <p\n class=\"text-lg font-semibold _shk-text-surface-600\"\n >\n {{ emptyMessage() || ('common.no_records' | transloco) }}\n </p>\n </div>\n </td>\n </tr>\n </tbody>\n } @else {\n <tbody>\n @for (rowData of effectiveDisplayedData(); track trackByRow(rowData, $index)) {\n @let rowSeverityValue = rowSeverity(rowData);\n <tr\n [attr.aria-selected]=\"selectable() ? isRowSelected(rowData) : null\"\n [class.shk-row-selected]=\"selectable() && isRowSelected(rowData)\"\n [class.shk-row-low]=\"rowSeverityValue === 'low'\"\n [class.shk-row-moderate]=\"rowSeverityValue === 'moderate'\"\n [class.shk-row-critical]=\"rowSeverityValue === 'critical'\"\n [class.cursor-pointer]=\"selectable() && selectOnRowClick() && canSelectRow(rowData)\"\n (click)=\"onRowClick($event, rowData)\"\n class=\"shk-data-row transition-colors duration-200 border-b _shk-border\"\n >\n @if (selectable()) {\n <td data-shk-select class=\"w-10 px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-center\">\n <input\n type=\"checkbox\"\n class=\"shk-table-checkbox\"\n [checked]=\"isRowSelected(rowData)\"\n [disabled]=\"!canSelectRow(rowData)\"\n (change)=\"toggleRowSelection(rowData)\"\n [attr.aria-label]=\"'table.selectRow' | transloco: { index: first() + $index + 1 }\"\n />\n </td>\n }\n @for (col of columnsWithActions(); track col.field) {\n <td\n [attr.data-shk-actions]=\"col.field === 'actions' ? '' : null\"\n [class]=\"\n 'px-2 min-[1440px]:px-3 py-2 min-[1440px]:py-2.5 text-xs font-medium _shk-text-surface-700 dark:[color:var(--shk-surface-700)] ' +\n (col.field === 'actions' ? 'whitespace-nowrap' : 'whitespace-normal break-words')\n \"\n [style.--shk-col-width]=\"col.field !== 'actions' ? getColumnWidth(col) : null\"\n >\n @if (col.field !== 'actions') {\n @switch (col.template) {\n @case ('tag') {\n <shk-tag\n [value]=\"getTagValue(col, rowData)\"\n [severity]=\"getTagSeverity(col, rowData)\"\n [rounded]=\"getTagRounded(col, rowData)\"\n [icon]=\"getTagIcon(col, rowData)\"\n [style]=\"getTagStyle(col, rowData)\"\n />\n }\n @case ('progress') {\n <div\n class=\"shk-progress\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"getProgress(col, rowData)\"\n [attr.aria-label]=\"col.header\"\n >\n <div [style.width.%]=\"getProgress(col, rowData)\"></div>\n </div>\n }\n @case ('boolean') {\n @if (resolveField(rowData, col.field)) {\n <svg\n [shkIcon]=\"icons.yes\"\n class=\"w-4 h-4 [color:var(--shk-success-600)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('yes')\"\n ></svg>\n } @else {\n <svg\n [shkIcon]=\"icons.no\"\n class=\"w-4 h-4 [color:var(--shk-error-500)]\"\n role=\"img\"\n [attr.aria-label]=\"filterLabel('no')\"\n ></svg>\n }\n }\n @case ('date') {\n {{ formatDateCell(resolveField(rowData, col.field), col) }}\n }\n @case ('currency') {\n {{ formatCurrencyCell(resolveField(rowData, col.field), col) }}\n }\n @default {\n @if (col.image) {\n <div class=\"flex items-center gap-2\">\n @if (col.image(rowData); as src) {\n <img\n [src]=\"src\"\n alt=\"\"\n [width]=\"col.imageWidth || 24\"\n class=\"shrink-0 rounded-sm\"\n />\n }\n <span>\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n </span>\n </div>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"cellText; context: { $implicit: rowData, col: col }\"\n ></ng-container>\n }\n }\n }\n } @else {\n <div class=\"flex items-center justify-start gap-px\">\n @for (action of getVisibleRowActions(rowData); track $index) {\n @if (isRowActionVisible(action, rowData)) {\n <div class=\"relative group\">\n <shk-tooltip\n [text]=\"getRowActionLabel(action, rowData)\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData)\"\n [class]=\"\n 'table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md ' +\n getRowActionClass(action, rowData)\n \"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [attr.aria-label]=\"getRowActionLabel(action, rowData)\"\n >\n <svg\n [shkIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n </div>\n }\n }\n @if (getHiddenRowActions(rowData).length > 0) {\n <div class=\"relative\">\n <shk-tooltip\n [text]=\"'common.more_options' | transloco\"\n position=\"top\"\n >\n <button\n type=\"button\"\n (click)=\"$event.stopPropagation(); toggleActionsDropdown(rowData, $event)\"\n class=\"table-action-btn hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] rounded-md\"\n [attr.aria-label]=\"'common.more_options' | transloco\"\n [attr.aria-expanded]=\"isActionsDropdownOpen(rowData)\"\n >\n <svg\n [shkIcon]=\"getIcon('ellipsis-vertical')\"\n class=\"w-4 h-4\"\n ></svg>\n </button>\n </shk-tooltip>\n @if (isActionsDropdownOpen(rowData)) {\n <div\n shkPortal\n class=\"fixed z-[9999] min-w-[160px] bg-white dark:[background-color:var(--shk-surface-100)] border _shk-border rounded-md shadow-lg py-1\"\n [style.top]=\"dropdownPosition().top + 'px'\"\n [style.left]=\"dropdownPosition().left + 'px'\"\n >\n @for (action of getHiddenRowActions(rowData); track $index) {\n <button\n type=\"button\"\n (click)=\"action.onClick(rowData); toggleActionsDropdown(rowData)\"\n [disabled]=\"isRowActionDisabled(action, rowData) || false\"\n [class]=\"\n 'w-full flex items-center gap-2 px-3 py-2 text-xs text-left _shk-text-surface-700 dark:[color:var(--shk-surface-700)] hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors ' +\n getRowActionClass(action, rowData)\n \"\n >\n <svg\n [shkIcon]=\"getIcon(getRowActionIconName(action, rowData))\"\n class=\"w-3.5 h-3.5 shrink-0\"\n ></svg>\n <span>{{ getRowActionLabel(action, rowData) }}</span>\n </button>\n }\n </div>\n }\n </div>\n }\n @if (rowSeverityValue) {\n <div class=\"relative group\">\n <shk-tooltip [text]=\"rowValidationTitle(rowData) || ''\" position=\"top\">\n <span\n class=\"shk-row-validation-btn\"\n [class.shk-sev-low]=\"rowSeverityValue === 'low'\"\n [class.shk-sev-moderate]=\"rowSeverityValue === 'moderate'\"\n [class.shk-sev-critical]=\"rowSeverityValue === 'critical'\"\n tabindex=\"0\"\n role=\"note\"\n [attr.aria-label]=\"rowValidationLabel(rowData)\"\n >\n <svg [shkIcon]=\"rowValidationIcon(rowData)\"></svg>\n </span>\n </shk-tooltip>\n </div>\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n }\n </table>\n\n <!-- Text content of a cell: format() \u00B7 custom template \u00B7 raw value -->\n <ng-template #cellText let-rowData let-col=\"col\">\n @if (col.format) {\n <span>{{ col.format(rowData) }}</span>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n customTemplates()[col.field] || defaultTemplate;\n context: { $implicit: rowData, field: col.field }\n \"\n ></ng-container>\n }\n </ng-template>\n <ng-template #defaultTemplate let-rowData let-field=\"field\">\n {{ resolveField(rowData, field) }}\n </ng-template>\n\n <!-- Option list of the select / multiselect filters -->\n <ng-template #optionList let-col let-draft=\"draft\" let-multiple=\"multiple\">\n <div class=\"p-2 space-y-1.5\">\n @let selectedLabel = multiple ? selectedOptionsLabel(col) : selectedSingleLabel(col);\n <button\n type=\"button\"\n class=\"shk-filter-select flex items-center justify-between gap-2 text-left\"\n style=\"background-image: none\"\n [id]=\"uid + '-filter-' + safeId(col.field) + '-0'\"\n [attr.aria-expanded]=\"multiselectOpen()\"\n (click)=\"multiselectOpen.set(!multiselectOpen())\"\n >\n <span class=\"truncate\" [class._shk-text-surface-400]=\"!selectedLabel\">\n {{ selectedLabel || tr('table.filterAll', 'Todos') }}\n </span>\n <svg\n [shkIcon]=\"getIcon('chevron-down')\"\n class=\"w-3.5 h-3.5 shrink-0 _shk-text-surface-400 transition-transform\"\n [class.rotate-180]=\"multiselectOpen()\"\n ></svg>\n </button>\n @if (multiselectOpen()) {\n <div\n class=\"max-h-52 overflow-y-auto p-0.5 border _shk-border rounded-md _shk-scrollbar\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple\"\n >\n @for (opt of col.filterOptions || []; track $index) {\n @let isSelected = multiple\n ? isOptionSelected(opt.value)\n : draft.rules[0].value != null && draft.rules[0].value == opt.value;\n <button\n type=\"button\"\n role=\"option\"\n class=\"w-full flex items-center gap-2 px-2 py-1.5 rounded text-left transition-colors hover:[background-color:var(--shk-surface-100)] dark:hover:[background-color:var(--shk-surface-200)]\"\n [class._shk-bg-primary-soft]=\"isSelected\"\n [class._shk-text-primary-700]=\"isSelected\"\n [attr.aria-selected]=\"isSelected\"\n (click)=\"multiple ? toggleOption(col, opt.value) : selectOption(col, opt.value)\"\n >\n @if (multiple) {\n <span class=\"shk-checkbox-box\" [class.shk-checked]=\"isSelected\">\n @if (isSelected) {\n <svg [shkIcon]=\"getIcon('check')\"></svg>\n }\n </span>\n }\n @if (opt.image) {\n <img [src]=\"opt.image\" alt=\"\" width=\"22\" class=\"shrink-0 rounded-sm\" />\n }\n <span class=\"truncate\">{{ opt.label }}</span>\n </button>\n }\n </div>\n }\n </div>\n </ng-template>\n </div>\n <div\n class=\"table-pagination flex items-center justify-between gap-4 px-2 min-[1440px]:px-3 py-2 border-t _shk-border\"\n >\n <div class=\"text-xs _shk-text-surface-600\">\n @if (showPageReport()) {\n {{ pageReport() }}\n }\n </div>\n <div\n class=\"flex items-center gap-0.5\"\n role=\"navigation\"\n >\n <button\n type=\"button\"\n (click)=\"goToFirst()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.firstPage', 'Primera p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevrons-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"prev()\"\n [disabled]=\"isFirstPage()\"\n [attr.aria-label]=\"tr('table.prevPage', 'P\u00E1gina anterior')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevron-left')\" class=\"w-4 h-4\"></svg>\n </button>\n <span\n class=\"px-2 text-xs font-medium _shk-text-surface-700\"\n >{{ currentPage() }} / {{ totalPages() }}</span\n >\n <button\n type=\"button\"\n (click)=\"next()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.nextPage', 'P\u00E1gina siguiente')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevron-right')\" class=\"w-4 h-4\"></svg>\n </button>\n <button\n type=\"button\"\n (click)=\"goToLast()\"\n [disabled]=\"isLastPage()\"\n [attr.aria-label]=\"tr('table.lastPage', '\u00DAltima p\u00E1gina')\"\n class=\"shk-page-btn p-1 _shk-text-surface-500 hover:[color:var(--shk-surface-700)] dark:hover:[color:var(--shk-surface-200)] disabled:opacity-30 disabled:cursor-not-allowed rounded transition-colors\"\n >\n <svg [shkIcon]=\"getIcon('chevrons-right')\" class=\"w-4 h-4\"></svg>\n </button>\n </div>\n <div\n class=\"flex items-center gap-1.5 text-xs _shk-text-surface-600\"\n >\n @if (showRowsPerPage()) {\n <label [for]=\"uid + '-rows-per-page'\">{{ 'table.rows' | transloco }}</label>\n <select\n [id]=\"uid + '-rows-per-page'\"\n (change)=\"onRowsPerPageChange($any($event.target).value)\"\n class=\"border _shk-border rounded px-2 py-1 text-xs bg-white dark:[background-color:var(--shk-surface-100)] _shk-text-surface-700 focus:outline-none focus:[border-color:var(--shk-primary-500)]\"\n >\n @for (opt of rowsPerPageOptions(); track opt) {\n <option [value]=\"opt\" [selected]=\"opt === rowsPerPageLocal()\">{{ opt }}</option>\n }\n </select>\n }\n </div>\n </div>\n </div>\n</div>\n", styles: ["input:focus{outline:none}input[type=text]{font-weight:400!important}table th{white-space:nowrap}table td{white-space:normal;overflow-wrap:break-word}.shk-page-btn{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border-radius:.375rem;transition:background-color .15s ease,color .15s ease}.shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-100)}:host-context(.dark) .shk-page-btn:hover:not(:disabled){background-color:var(--shk-surface-200)}.shk-page-btn:focus-visible{outline:none;box-shadow:0 0 0 2px color-mix(in srgb,var(--shk-primary-500) 45%,transparent)}td button svg{width:1.125rem!important;height:1.125rem!important}td button:disabled{opacity:.4;cursor:not-allowed}.table-action-btn svg{width:1rem!important;height:1rem!important;min-width:1rem!important;min-height:1rem!important}.table-action-btn{padding:.5rem!important;min-width:2rem!important;min-height:2rem!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}.table-scroll-wrapper{width:100%;overflow-x:auto;overflow-y:hidden;border-radius:inherit;-webkit-overflow-scrolling:touch;container-type:inline-size}.table-card,.table-pagination{container-type:inline-size}@container (max-width: 640px){.table-pagination{flex-direction:column;align-items:center;gap:.5rem}.table-pagination>div{justify-content:center}}.table-scroll-wrapper table{table-layout:auto;width:100%}@container (max-width: 768px){.table-scroll-wrapper{scroll-snap-type:x mandatory}.table-scroll-wrapper table{table-layout:auto;width:100%}.table-scroll-wrapper th:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]){min-width:var(--shk-col-width, 140px);max-width:var(--shk-col-width, 140px)}.table-scroll-wrapper th,.table-scroll-wrapper td{scroll-snap-align:start}}th[data-shk-select],td[data-shk-select]{width:2.5rem;min-width:2.5rem}.shk-table-checkbox{width:.875rem;height:.875rem;cursor:pointer;vertical-align:middle;accent-color:var(--shk-primary-500)}.shk-table-checkbox:disabled{opacity:.4;cursor:not-allowed}tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-50) 60%,transparent)}tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 90%,transparent)}:host-context(.dark) tr.shk-row-selected{background-color:color-mix(in srgb,var(--shk-primary-900) 20%,transparent)}:host-context(.dark) tr.shk-row-selected:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 30%,transparent)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.shk-data-table tr.shk-row-low{background-color:color-mix(in srgb,var(--shk-info-600) 22%,transparent)}.shk-data-table tr.shk-row-moderate{background-color:color-mix(in srgb,var(--shk-warning-400) 32%,transparent)}.shk-data-table tr.shk-row-critical{background-color:color-mix(in srgb,var(--shk-error-500) 20%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-low{background-color:color-mix(in srgb,var(--shk-info-600) 26%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-moderate{background-color:color-mix(in srgb,var(--shk-warning-400) 34%,transparent)}:host-context(.dark) .shk-data-table tr.shk-row-critical{background-color:color-mix(in srgb,var(--shk-error-500) 24%,transparent)}.shk-row-validation-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border-radius:.375rem;cursor:help;color:var(--shk-surface-500)}.shk-row-validation-btn svg{width:1rem!important;height:1rem!important}.shk-row-validation-btn.shk-sev-low{color:var(--shk-info-600)}.shk-row-validation-btn.shk-sev-moderate{color:var(--shk-warning-600)}:host-context(.dark) .shk-row-validation-btn.shk-sev-moderate{color:var(--shk-warning-400)}.shk-row-validation-btn.shk-sev-critical{color:var(--shk-error-500)}.shk-row-validation-btn:focus-visible{outline:2px solid currentColor;outline-offset:1px}table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-50) 30%,transparent)}:host-context(.dark) table.shk-row-hover tbody tr.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-primary-900) 10%,transparent)}table.shk-gridlines th,table.shk-gridlines td{border-right:1px solid var(--shk-surface-200)}table.shk-gridlines th:last-child,table.shk-gridlines td:last-child{border-right:0}:host-context(.dark) table.shk-gridlines th,:host-context(.dark) table.shk-gridlines td{border-right-color:var(--shk-surface-200)}.shk-col-resizer{position:absolute;top:0;right:-4px;z-index:1;width:8px;height:100%;cursor:col-resize;touch-action:none}.shk-col-resizer:after{content:\"\";position:absolute;top:20%;bottom:20%;left:3px;width:2px;border-radius:1px;background-color:transparent;transition:background-color .15s ease}.shk-col-resizer:hover:after,.shk-col-resizer:focus-visible:after,.shk-col-resizer.shk-resizing:after{background-color:var(--shk-primary-500)}.shk-col-resizer:focus-visible{outline:none}th:last-child .shk-col-resizer{right:0}.shk-filter-input,.shk-filter-select{width:100%;padding:.375rem .625rem;font-size:.75rem;line-height:1.25rem;border-radius:.375rem;border:1px solid var(--shk-surface-200);background-color:#fff;color:var(--shk-surface-700)}.dark .shk-filter-input,.dark .shk-filter-select{background-color:var(--shk-surface-100);border-color:var(--shk-surface-200);color-scheme:dark}.shk-filter-input::placeholder{color:var(--shk-surface-400)}select.shk-filter-select{appearance:none;padding-right:1.75rem;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:right .5rem center;cursor:pointer}button.shk-filter-select{cursor:pointer}.shk-filter-input:focus,.shk-filter-select:focus{outline:none;border-color:var(--shk-primary-500);box-shadow:0 0 0 1px var(--shk-primary-500)}.shk-checkbox-box{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:.875rem;height:.875rem;border-radius:.1875rem;border:1px solid var(--shk-surface-300);background-color:#fff;color:#fff}.dark .shk-checkbox-box{background-color:var(--shk-surface-100)}.shk-checkbox-box.shk-checked{background-color:var(--shk-primary-500);border-color:var(--shk-primary-500)}.shk-checkbox-box svg{width:.625rem;height:.625rem}.shk-range{position:relative;height:1rem;margin:.5rem .375rem .375rem}.shk-range-track,.shk-range-fill{position:absolute;top:50%;height:.1875rem;transform:translateY(-50%);border-radius:9999px}.shk-range-track{left:0;right:0;background-color:var(--shk-surface-200)}.shk-range-fill{background-color:var(--shk-primary-500)}.shk-range input[type=range]{position:absolute;inset:0;width:100%;margin:0;background:transparent;pointer-events:none;appearance:none;-webkit-appearance:none}.shk-range input[type=range]::-webkit-slider-thumb{pointer-events:auto;-webkit-appearance:none;width:.875rem;height:.875rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:.625rem;height:.625rem;border-radius:9999px;background:#fff;border:2px solid var(--shk-primary-500);cursor:grab}.shk-progress{height:.375rem;min-width:5rem;border-radius:9999px;background-color:var(--shk-surface-200);overflow:hidden}.shk-progress>div{height:100%;border-radius:inherit;background-color:var(--shk-primary-500)}\n"] }]
1693
+ }], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], rowsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPage", required: false }] }], rowsPerPageOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPageOptions", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], showActionRow: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActionRow", required: false }] }], customTemplates: [{ type: i0.Input, args: [{ isSignal: true, alias: "customTemplates", required: false }] }], headerActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerActions", required: false }] }], rowActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowActions", required: false }] }], hasShadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasShadow", required: false }] }], defaultSortField: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSortField", required: false }] }], defaultSortOrder: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultSortOrder", required: false }] }], showSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSearch", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], globalFilterFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "globalFilterFields", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], serverSide: [{ type: i0.Input, args: [{ isSignal: true, alias: "serverSide", required: false }] }], totalRecords: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRecords", required: false }] }], filters: [{ type: i0.Input, args: [{ isSignal: true, alias: "filters", required: false }] }], activeFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeFilter", required: false }] }], showGridlines: [{ type: i0.Input, args: [{ isSignal: true, alias: "showGridlines", required: false }] }], resizableColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizableColumns", required: false }] }], rowValidations: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowValidations", required: false }] }], columnWidths: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnWidths", required: false }] }, { type: i0.Output, args: ["columnWidthsChange"] }], stateKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateKey", required: false }] }], stateStorage: [{ type: i0.Input, args: [{ isSignal: true, alias: "stateStorage", required: false }] }], rowHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowHover", required: false }] }], showClearButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearButton", required: false }] }], showPageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPageReport", required: false }] }], showRowsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowsPerPage", required: false }] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], isRowSelectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isRowSelectable", required: false }] }], selectOnRowClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnRowClick", required: false }] }], bulkActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "bulkActions", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], refresh: [{ type: i0.Output, args: ["refresh"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], filterChange: [{ type: i0.Output, args: ["filterChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], filterClick: [{ type: i0.Output, args: ["filterClick"] }], columnResize: [{ type: i0.Output, args: ["columnResize"] }], onDocumentClick: [{
1633
1694
  type: HostListener,
1634
1695
  args: ['document:click']
1635
1696
  }], onEscape: [{