shirkasoft-ui-components 1.3.12 → 1.3.14

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.
@@ -6,7 +6,7 @@ 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, LucideTrash2, LucideCircleX, LucideCircleCheck, LucideFunnelX, LucideDynamicIcon } from '@lucide/angular';
9
+ import { LucidePlus, LucideCircleAlert, LucideTrash2, LucideCircleX, LucideCircleCheck, LucideFunnelX, LucideDynamicIcon } from '@lucide/angular';
10
10
  import { TagComponent } from 'shirkasoft-ui-components/tag';
11
11
  import { TooltipComponent } from 'shirkasoft-ui-components/tooltip';
12
12
  import { getIcon, PortalDirective } from 'shirkasoft-ui-components/utils';
@@ -71,16 +71,31 @@ class TableComponent {
71
71
  return value.length === 0;
72
72
  return false;
73
73
  }
74
- columnMissing(col, row) {
75
- return col.isMissing ? !!col.isMissing(row) : this.isEmptyValue(this.resolveField(row, col.field));
74
+ requirementMissing(req, row) {
75
+ return req.isMissing ? !!req.isMissing(row) : this.isEmptyValue(this.resolveField(row, req.field));
76
76
  }
77
- /** Required columns that are empty in the row. */
77
+ /** Required columns / fields that are empty in the row. */
78
78
  missingFields(row) {
79
79
  return this.missingByRow().get(row) ?? [];
80
80
  }
81
- /** Whether a cell is a required field without value. */
81
+ /** Whether a cell is a required column without value. */
82
82
  isCellMissing(col, row) {
83
- return !!col.required && this.missingFields(row).includes(col);
83
+ return !!col.required && this.missingFields(row).some((req) => req.column === col);
84
+ }
85
+ /**
86
+ * Checks an object (e.g. the payload returned by a modal) against the
87
+ * `required` columns and the `requiredFields`, returning what it's missing
88
+ * (empty = complete). Works even when `validateRequired` is off, so it can
89
+ * be used before adding the row.
90
+ */
91
+ validateRow(row) {
92
+ return this.allRequirements()
93
+ .filter((req) => this.requirementMissing(req, row))
94
+ .map((req) => ({ field: req.field, header: req.header }));
95
+ }
96
+ /** Icon of the missing data marks: error circle or warning triangle. */
97
+ missingIcon() {
98
+ return this.missingAsError() ? this.icons.error : this.getIcon('triangle-alert');
84
99
  }
85
100
  missingCellMessage(col) {
86
101
  return col.missingMessage || this.tr('table.missing.cell', 'Falta {{field}}', { field: col.header });
@@ -105,6 +120,7 @@ class TableComponent {
105
120
  yes: LucideCircleCheck,
106
121
  no: LucideCircleX,
107
122
  trash: LucideTrash2,
123
+ error: LucideCircleAlert,
108
124
  };
109
125
  /**
110
126
  * Minimum width applied to each column (except `actions`, which keeps its
@@ -178,6 +194,17 @@ class TableComponent {
178
194
  * listing the missing fields and a "Falta …" text in the empty cell.
179
195
  */
180
196
  this.validateRequired = input(false, ...(ngDevMode ? [{ debugName: "validateRequired" }] : /* istanbul ignore next */ []));
197
+ /**
198
+ * With `validateRequired`, incomplete rows are shown as errors (red). Set it
199
+ * to false to show them as warnings (amber) instead.
200
+ */
201
+ this.missingAsError = input(true, ...(ngDevMode ? [{ debugName: "missingAsError" }] : /* istanbul ignore next */ []));
202
+ /**
203
+ * Mandatory fields that aren't table columns (e.g. `['telefono']` or
204
+ * `[{ field: 'telefono', label: 'Teléfono' }]`). With `validateRequired`
205
+ * they flag the row like `required` columns, and `validateRow` checks them.
206
+ */
207
+ this.requiredFields = input([], ...(ngDevMode ? [{ debugName: "requiredFields" }] : /* istanbul ignore next */ []));
181
208
  /**
182
209
  * Column widths (px) keyed by field. Two-way bindable via
183
210
  * `[(columnWidths)]` to restore/save them yourself.
@@ -193,7 +220,7 @@ class TableComponent {
193
220
  /** Highlights the row under the pointer. */
194
221
  this.rowHover = input(true, ...(ngDevMode ? [{ debugName: "rowHover" }] : /* istanbul ignore next */ []));
195
222
  /** Shows the "Clear" button that resets search, column filters and sort. */
196
- this.showClearButton = input(true, ...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
223
+ this.showClearButton = input(false, ...(ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []));
197
224
  /** Shows the "X to Y of Z" report in the paginator. */
198
225
  this.showPageReport = input(true, ...(ngDevMode ? [{ debugName: "showPageReport" }] : /* istanbul ignore next */ []));
199
226
  /** Shows the rows-per-page selector in the paginator. */
@@ -272,20 +299,23 @@ class TableComponent {
272
299
  const rowActionsArray = this.rowActions();
273
300
  const translatedHeader = this.actionsHeaderLabel();
274
301
  if (showAction && rowActionsArray.length > 0) {
275
- const visibleCount = Math.min(rowActionsArray.length, this.MAX_VISIBLE_ACTIONS);
276
- const hasDropdown = rowActionsArray.length > this.MAX_VISIBLE_ACTIONS;
277
- const extraWidth = hasDropdown ? 40 : 0;
278
- let baseWidth;
279
- if (visibleCount <= 2) {
280
- baseWidth = '110px';
281
- }
282
- else if (visibleCount <= 3) {
283
- baseWidth = '130px';
302
+ // Width from the actions really shown on the current page (each row can
303
+ // hide some with `isVisible`), not from every action defined.
304
+ const rows = this.effectiveDisplayedData();
305
+ let buttons = 0;
306
+ if (rows.length) {
307
+ for (const row of rows) {
308
+ const n = rowActionsArray.filter((a) => this.isRowActionVisible(a, row)).length;
309
+ const shown = n > this.MAX_VISIBLE_ACTIONS ? this.MAX_VISIBLE_ACTIONS + 1 : n; // +1 = "more" button
310
+ if (shown > buttons)
311
+ buttons = shown;
312
+ }
284
313
  }
285
314
  else {
286
- baseWidth = '170px';
315
+ const n = rowActionsArray.length;
316
+ buttons = n > this.MAX_VISIBLE_ACTIONS ? this.MAX_VISIBLE_ACTIONS + 1 : n;
287
317
  }
288
- const actionsWidth = `calc(${baseWidth} + ${extraWidth}px)`;
318
+ const actionsWidth = `${Math.max(this.MIN_ACTIONS_WIDTH, this.ACTIONS_CELL_PADDING + buttons * this.ACTION_BUTTON_WIDTH)}px`;
289
319
  return [
290
320
  {
291
321
  field: 'actions',
@@ -328,16 +358,28 @@ class TableComponent {
328
358
  // ---------------------------------------------------------------------------
329
359
  // Required fields validation
330
360
  // ---------------------------------------------------------------------------
331
- /** Columns checked by the validation (empty when it's disabled). */
332
- this.requiredColumns = computed(() => this.validateRequired() ? this.columns().filter((c) => c.required) : [], ...(ngDevMode ? [{ debugName: "requiredColumns" }] : /* istanbul ignore next */ []));
333
- /** Missing required columns of each displayed row (cached per render). */
361
+ /** Every requirement (required columns + `requiredFields`), active or not. */
362
+ this.allRequirements = computed(() => {
363
+ const fromColumns = this.columns()
364
+ .filter((c) => c.required)
365
+ .map((c) => ({ field: c.field, header: c.header, isMissing: c.isMissing, column: c }));
366
+ const columnFields = new Set(fromColumns.map((r) => r.field));
367
+ const extra = this.requiredFields()
368
+ .map((f) => (typeof f === 'string' ? { field: f } : f))
369
+ .filter((f) => f.field && !columnFields.has(f.field))
370
+ .map((f) => ({ field: f.field, header: f.label || f.field, isMissing: f.isMissing }));
371
+ return [...fromColumns, ...extra];
372
+ }, ...(ngDevMode ? [{ debugName: "allRequirements" }] : /* istanbul ignore next */ []));
373
+ /** Requirements checked on screen (empty when `validateRequired` is off). */
374
+ this.activeRequirements = computed(() => this.validateRequired() ? this.allRequirements() : [], ...(ngDevMode ? [{ debugName: "activeRequirements" }] : /* istanbul ignore next */ []));
375
+ /** Missing requirements of each displayed row (cached per render). */
334
376
  this.missingByRow = computed(() => {
335
- const cols = this.requiredColumns();
377
+ const reqs = this.activeRequirements();
336
378
  const map = new Map();
337
- if (!cols.length)
379
+ if (!reqs.length)
338
380
  return map;
339
381
  for (const row of this.effectiveDisplayedData()) {
340
- map.set(row, cols.filter((c) => this.columnMissing(c, row)));
382
+ map.set(row, reqs.filter((req) => this.requirementMissing(req, row)));
341
383
  }
342
384
  return map;
343
385
  }, ...(ngDevMode ? [{ debugName: "missingByRow" }] : /* istanbul ignore next */ []));
@@ -346,11 +388,11 @@ class TableComponent {
346
388
  * the current page (server mode).
347
389
  */
348
390
  this.missingRowsCount = computed(() => {
349
- const cols = this.requiredColumns();
350
- if (!cols.length)
391
+ const reqs = this.activeRequirements();
392
+ if (!reqs.length)
351
393
  return 0;
352
394
  const rows = this.serverSide() ? this.data() : this.originalData();
353
- return rows.filter((row) => cols.some((c) => this.columnMissing(c, row))).length;
395
+ return rows.filter((row) => reqs.some((req) => this.requirementMissing(req, row))).length;
354
396
  }, ...(ngDevMode ? [{ debugName: "missingRowsCount" }] : /* istanbul ignore next */ []));
355
397
  /** Total records: server-provided in server mode, locally computed otherwise. */
356
398
  this.effectiveTotalRecords = computed(() => {
@@ -387,6 +429,10 @@ class TableComponent {
387
429
  // ---------------------------------------------------------------------------
388
430
  /** Minimum width (px) a column can be resized to. */
389
431
  this.MIN_COLUMN_WIDTH = 60;
432
+ /** Actions column auto width: button (2rem) + 1px gap, cell padding, header room. */
433
+ this.ACTION_BUTTON_WIDTH = 33;
434
+ this.ACTIONS_CELL_PADDING = 24;
435
+ this.MIN_ACTIONS_WIDTH = 84;
390
436
  /** Field being resized right now (for the active handle style). */
391
437
  this.resizingField = signal(null, ...(ngDevMode ? [{ debugName: "resizingField" }] : /* istanbul ignore next */ []));
392
438
  /** Set right after a drag so the click that ends it doesn't sort the column. */
@@ -1578,7 +1624,7 @@ class TableComponent {
1578
1624
  this.closeFilters();
1579
1625
  }
1580
1626
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1581
- 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 }, 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 missingRowsCount() > 0 ||\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 (missingRowsCount() > 0) {\n <span\n class=\"shk-missing-summary inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md whitespace-nowrap order-last\"\n role=\"status\"\n >\n <svg [lucideIcon]=\"getIcon('triangle-alert')\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ tr('table.missing.summary', '{{count}} fila(s) con datos faltantes', { count: missingRowsCount() }) }}\n </span>\n }\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 [class.shk-gridlines]=\"showGridlines()\" [class.shk-row-hover]=\"rowHover()\">\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 @if (validateRequired()) {\n <th\n scope=\"col\"\n data-shk-status\n class=\"w-8 px-1 py-2 min-[1440px]:py-2.5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <span class=\"sr-only\">{{ tr('table.missing.column', 'Datos faltantes') }}</span>\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]=\"col.field === 'actions' ? col.width : resizedWidth(col)\"\n [style.min-width]=\"col.field === 'actions' ? col.width : resizedWidth(col) || 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 @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\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 </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]=\"missingFields(rowData).length > 0\"\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 @if (validateRequired()) {\n <td data-shk-status class=\"w-8 px-1 py-2 text-center\">\n @if (missingFields(rowData); as missing) {\n @if (missing.length > 0) {\n <shk-tooltip [text]=\"missingRowMessage(missing)\" position=\"right\" mode=\"fixed\">\n <svg\n [lucideIcon]=\"getIcon('triangle-alert')\"\n class=\"shk-missing-icon w-4 h-4 inline-block\"\n role=\"img\"\n [attr.aria-label]=\"missingRowMessage(missing)\"\n ></svg>\n </shk-tooltip>\n }\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' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"getIcon('triangle-alert')\" 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]):not([data-shk-status]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]):not([data-shk-status]){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}th[data-shk-status],td[data-shk-status]{width:2rem;min-width:2rem}tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-warning-400) 9%,transparent)}tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 15%,transparent)}.shk-missing-icon,.shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) .shk-missing-icon,:host-context(.dark) .shk-missing-cell{color:var(--shk-warning-400)}.shk-missing-summary{color:var(--shk-warning-800);background-color:var(--shk-warning-50);border:1px solid color-mix(in srgb,var(--shk-warning-400) 45%,transparent)}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 }); }
1627
+ 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 }, requiredFields: { classPropertyName: "requiredFields", publicName: "requiredFields", 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 missingRowsCount() > 0 ||\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 (missingRowsCount() > 0) {\n <span\n [class.shk-missing-error]=\"missingAsError()\"\n class=\"shk-missing-summary inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md whitespace-nowrap order-last\"\n role=\"status\"\n >\n <svg [lucideIcon]=\"missingIcon()\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ tr('table.missing.summary', '{{count}} fila(s) con datos faltantes', { count: missingRowsCount() }) }}\n </span>\n }\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 [class.shk-missing-error]=\"missingAsError()\"\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 @if (validateRequired()) {\n <th\n scope=\"col\"\n data-shk-status\n class=\"w-8 px-1 py-2 min-[1440px]:py-2.5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <span class=\"sr-only\">{{ tr('table.missing.column', 'Datos faltantes') }}</span>\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]=\"missingFields(rowData).length > 0\"\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 @if (validateRequired()) {\n <td data-shk-status class=\"w-8 px-1 py-2 text-center\">\n @if (missingFields(rowData); as missing) {\n @if (missing.length > 0) {\n <shk-tooltip [text]=\"missingRowMessage(missing)\" position=\"right\" mode=\"fixed\">\n <svg\n [lucideIcon]=\"missingIcon()\"\n class=\"shk-missing-icon w-4 h-4 inline-block\"\n role=\"img\"\n [attr.aria-label]=\"missingRowMessage(missing)\"\n ></svg>\n </shk-tooltip>\n }\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' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"missingIcon()\" 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]):not([data-shk-status]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]):not([data-shk-status]){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}th[data-shk-status],td[data-shk-status]{width:2rem;min-width:2rem}tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-warning-400) 9%,transparent)}tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 15%,transparent)}.shk-missing-icon,.shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) .shk-missing-icon,:host-context(.dark) .shk-missing-cell{color:var(--shk-warning-400)}.shk-missing-summary{color:var(--shk-warning-800);background-color:var(--shk-warning-50);border:1px solid color-mix(in srgb,var(--shk-warning-400) 45%,transparent)}table.shk-missing-error tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-error-500) 8%,transparent)}table.shk-missing-error tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-error-500)}table.shk-row-hover.shk-missing-error tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-error-500) 14%,transparent)}table.shk-missing-error .shk-missing-icon,table.shk-missing-error .shk-missing-cell{color:var(--shk-error-600)}:host-context(.dark) table.shk-missing-error .shk-missing-icon,:host-context(.dark) table.shk-missing-error .shk-missing-cell{color:var(--shk-error-400)}.shk-missing-summary.shk-missing-error{color:var(--shk-error-800);background-color:var(--shk-error-50);border-color:color-mix(in srgb,var(--shk-error-500) 40%,transparent)}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 }); }
1582
1628
  }
1583
1629
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: TableComponent, decorators: [{
1584
1630
  type: Component,
@@ -1589,8 +1635,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
1589
1635
  LucideDynamicIcon,
1590
1636
  TagComponent,
1591
1637
  TooltipComponent,
1592
- ], 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 missingRowsCount() > 0 ||\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 (missingRowsCount() > 0) {\n <span\n class=\"shk-missing-summary inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md whitespace-nowrap order-last\"\n role=\"status\"\n >\n <svg [lucideIcon]=\"getIcon('triangle-alert')\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ tr('table.missing.summary', '{{count}} fila(s) con datos faltantes', { count: missingRowsCount() }) }}\n </span>\n }\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 [class.shk-gridlines]=\"showGridlines()\" [class.shk-row-hover]=\"rowHover()\">\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 @if (validateRequired()) {\n <th\n scope=\"col\"\n data-shk-status\n class=\"w-8 px-1 py-2 min-[1440px]:py-2.5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <span class=\"sr-only\">{{ tr('table.missing.column', 'Datos faltantes') }}</span>\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]=\"col.field === 'actions' ? col.width : resizedWidth(col)\"\n [style.min-width]=\"col.field === 'actions' ? col.width : resizedWidth(col) || 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 @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\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 </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]=\"missingFields(rowData).length > 0\"\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 @if (validateRequired()) {\n <td data-shk-status class=\"w-8 px-1 py-2 text-center\">\n @if (missingFields(rowData); as missing) {\n @if (missing.length > 0) {\n <shk-tooltip [text]=\"missingRowMessage(missing)\" position=\"right\" mode=\"fixed\">\n <svg\n [lucideIcon]=\"getIcon('triangle-alert')\"\n class=\"shk-missing-icon w-4 h-4 inline-block\"\n role=\"img\"\n [attr.aria-label]=\"missingRowMessage(missing)\"\n ></svg>\n </shk-tooltip>\n }\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' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"getIcon('triangle-alert')\" 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]):not([data-shk-status]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]):not([data-shk-status]){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}th[data-shk-status],td[data-shk-status]{width:2rem;min-width:2rem}tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-warning-400) 9%,transparent)}tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 15%,transparent)}.shk-missing-icon,.shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) .shk-missing-icon,:host-context(.dark) .shk-missing-cell{color:var(--shk-warning-400)}.shk-missing-summary{color:var(--shk-warning-800);background-color:var(--shk-warning-50);border:1px solid color-mix(in srgb,var(--shk-warning-400) 45%,transparent)}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"] }]
1593
- }], 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 }] }], 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: [{
1638
+ ], 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 missingRowsCount() > 0 ||\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 (missingRowsCount() > 0) {\n <span\n [class.shk-missing-error]=\"missingAsError()\"\n class=\"shk-missing-summary inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium rounded-md whitespace-nowrap order-last\"\n role=\"status\"\n >\n <svg [lucideIcon]=\"missingIcon()\" class=\"w-3.5 h-3.5 shrink-0\"></svg>\n {{ tr('table.missing.summary', '{{count}} fila(s) con datos faltantes', { count: missingRowsCount() }) }}\n </span>\n }\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 [class.shk-missing-error]=\"missingAsError()\"\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 @if (validateRequired()) {\n <th\n scope=\"col\"\n data-shk-status\n class=\"w-8 px-1 py-2 min-[1440px]:py-2.5 _shk-bg-surface-50 dark:[background-color:var(--shk-surface-100)] border-b _shk-border dark:[border-color:var(--shk-surface-200)]\"\n >\n <span class=\"sr-only\">{{ tr('table.missing.column', 'Datos faltantes') }}</span>\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]=\"missingFields(rowData).length > 0\"\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 @if (validateRequired()) {\n <td data-shk-status class=\"w-8 px-1 py-2 text-center\">\n @if (missingFields(rowData); as missing) {\n @if (missing.length > 0) {\n <shk-tooltip [text]=\"missingRowMessage(missing)\" position=\"right\" mode=\"fixed\">\n <svg\n [lucideIcon]=\"missingIcon()\"\n class=\"shk-missing-icon w-4 h-4 inline-block\"\n role=\"img\"\n [attr.aria-label]=\"missingRowMessage(missing)\"\n ></svg>\n </shk-tooltip>\n }\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' && isCellMissing(col, rowData)) {\n <span class=\"shk-missing-cell inline-flex items-center gap-1 italic\">\n <svg [lucideIcon]=\"missingIcon()\" 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]):not([data-shk-status]){min-width:var(--shk-col-width, 140px)}.table-scroll-wrapper td:not([data-shk-actions]):not([data-shk-select]):not([data-shk-status]){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}th[data-shk-status],td[data-shk-status]{width:2rem;min-width:2rem}tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-warning-400) 9%,transparent)}tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-warning-400)}table.shk-row-hover tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-warning-400) 15%,transparent)}.shk-missing-icon,.shk-missing-cell{color:var(--shk-warning-600)}:host-context(.dark) .shk-missing-icon,:host-context(.dark) .shk-missing-cell{color:var(--shk-warning-400)}.shk-missing-summary{color:var(--shk-warning-800);background-color:var(--shk-warning-50);border:1px solid color-mix(in srgb,var(--shk-warning-400) 45%,transparent)}table.shk-missing-error tr.shk-row-missing{background-color:color-mix(in srgb,var(--shk-error-500) 8%,transparent)}table.shk-missing-error tr.shk-row-missing>td:first-child{box-shadow:inset 3px 0 0 var(--shk-error-500)}table.shk-row-hover.shk-missing-error tbody tr.shk-row-missing.shk-data-row:hover{background-color:color-mix(in srgb,var(--shk-error-500) 14%,transparent)}table.shk-missing-error .shk-missing-icon,table.shk-missing-error .shk-missing-cell{color:var(--shk-error-600)}:host-context(.dark) table.shk-missing-error .shk-missing-icon,:host-context(.dark) table.shk-missing-error .shk-missing-cell{color:var(--shk-error-400)}.shk-missing-summary.shk-missing-error{color:var(--shk-error-800);background-color:var(--shk-error-50);border-color:color-mix(in srgb,var(--shk-error-500) 40%,transparent)}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"] }]
1639
+ }], 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 }] }], requiredFields: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredFields", 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: [{
1594
1640
  type: HostListener,
1595
1641
  args: ['document:click']
1596
1642
  }], onEscape: [{