@cdevhub/ngx-tw 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -49
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-alert.mjs +43 -29
- package/fesm2022/cdevhub-ngx-tw-alert.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs +103 -0
- package/fesm2022/cdevhub-ngx-tw-aspect-ratio.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs +56 -31
- package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-badge.mjs +61 -35
- package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +154 -93
- package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-button.mjs +24 -15
- package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +3 -3
- package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs +408 -215
- package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-card.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs +144 -79
- package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +99 -47
- package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs +34 -20
- package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +46 -29
- package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs +195 -110
- package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +140 -73
- package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-core.mjs +16 -11
- package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +393 -149
- package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +305 -150
- package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs +56 -43
- package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +51 -33
- package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +905 -0
- package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +49 -26
- package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs +133 -74
- package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs +2 -2
- package/fesm2022/cdevhub-ngx-tw-icon-lucide.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-icon.mjs +28 -17
- package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-input.mjs +37 -21
- package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-item.mjs +33 -24
- package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-menu.mjs +63 -48
- package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs +622 -0
- package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs +137 -71
- package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-popover.mjs +101 -46
- package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +57 -30
- package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-radio.mjs +108 -57
- package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +46 -26
- package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-select.mjs +217 -122
- package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-separator.mjs +21 -12
- package/fesm2022/cdevhub-ngx-tw-separator.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs +58 -44
- package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs +25 -14
- package/fesm2022/cdevhub-ngx-tw-skeleton.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-slider.mjs +155 -79
- package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-sort.mjs +44 -25
- package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs +29 -16
- package/fesm2022/cdevhub-ngx-tw-spinner.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -42
- package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stat.mjs +107 -64
- package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs +113 -47
- package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-switch.mjs +61 -32
- package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +88 -42
- package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-table.mjs +266 -118
- package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs +101 -51
- package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +798 -0
- package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs +11 -7
- package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-theme.mjs +22 -14
- package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +243 -95
- package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs +149 -82
- package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-toast.mjs +89 -55
- package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +50 -28
- package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs +1129 -0
- package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs +554 -0
- package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -0
- package/fesm2022/cdevhub-ngx-tw.mjs +7 -0
- package/fesm2022/cdevhub-ngx-tw.mjs.map +1 -1
- package/index.json +1 -0
- package/package.json +45 -20
- package/theme/index.css +10 -2
- package/types/cdevhub-ngx-tw-aspect-ratio.d.ts +40 -0
- package/types/cdevhub-ngx-tw-calendar.d.ts +39 -8
- package/types/cdevhub-ngx-tw-command-palette.d.ts +7 -0
- package/types/cdevhub-ngx-tw-date-picker.d.ts +36 -10
- package/types/cdevhub-ngx-tw-file-upload.d.ts +250 -0
- package/types/cdevhub-ngx-tw-form-field.d.ts +22 -3
- package/types/cdevhub-ngx-tw-icon-lucide.d.ts +21 -3
- package/types/cdevhub-ngx-tw-number-input.d.ts +130 -0
- package/types/cdevhub-ngx-tw-popover.d.ts +8 -0
- package/types/cdevhub-ngx-tw-stepper.d.ts +30 -2
- package/types/cdevhub-ngx-tw-tab-nav.d.ts +8 -0
- package/types/cdevhub-ngx-tw-table.d.ts +30 -1
- package/types/cdevhub-ngx-tw-tabs.d.ts +8 -0
- package/types/cdevhub-ngx-tw-tags-input.d.ts +217 -0
- package/types/cdevhub-ngx-tw-time-picker.d.ts +31 -6
- package/types/cdevhub-ngx-tw-transfer.d.ts +330 -0
- package/types/cdevhub-ngx-tw-tree.d.ts +189 -0
- package/types/cdevhub-ngx-tw.d.ts +7 -0
|
@@ -272,10 +272,10 @@ class CellDefDirective {
|
|
|
272
272
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
273
273
|
return true;
|
|
274
274
|
}
|
|
275
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
276
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
275
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CellDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
276
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: CellDefDirective, isStandalone: true, selector: "[twCellDef]", ngImport: i0 });
|
|
277
277
|
}
|
|
278
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: CellDefDirective, decorators: [{
|
|
279
279
|
type: Directive,
|
|
280
280
|
args: [{ selector: '[twCellDef]' }]
|
|
281
281
|
}] });
|
|
@@ -287,10 +287,10 @@ class HeaderCellDefDirective {
|
|
|
287
287
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
288
288
|
return true;
|
|
289
289
|
}
|
|
290
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
291
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
290
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HeaderCellDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
291
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: HeaderCellDefDirective, isStandalone: true, selector: "[twHeaderCellDef]", ngImport: i0 });
|
|
292
292
|
}
|
|
293
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
293
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: HeaderCellDefDirective, decorators: [{
|
|
294
294
|
type: Directive,
|
|
295
295
|
args: [{ selector: '[twHeaderCellDef]' }]
|
|
296
296
|
}] });
|
|
@@ -302,10 +302,10 @@ class FooterCellDefDirective {
|
|
|
302
302
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
303
303
|
return true;
|
|
304
304
|
}
|
|
305
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
306
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
305
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: FooterCellDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
306
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: FooterCellDefDirective, isStandalone: true, selector: "[twFooterCellDef]", ngImport: i0 });
|
|
307
307
|
}
|
|
308
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
308
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: FooterCellDefDirective, decorators: [{
|
|
309
309
|
type: Directive,
|
|
310
310
|
args: [{ selector: '[twFooterCellDef]' }]
|
|
311
311
|
}] });
|
|
@@ -317,10 +317,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
|
|
|
317
317
|
// carry custom templates the consumer projects.
|
|
318
318
|
/** Structural directive on an `<ng-template>` declaring the no-data row fallback. Takes precedence over `[slot="empty"]` when both are present. */
|
|
319
319
|
class NoDataRowDirective extends CdkNoDataRow {
|
|
320
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
321
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
320
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: NoDataRowDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
321
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.7", type: NoDataRowDirective, isStandalone: true, selector: "ng-template[twNoDataRow]", providers: [{ provide: CdkNoDataRow, useExisting: NoDataRowDirective }], usesInheritance: true, ngImport: i0 });
|
|
322
322
|
}
|
|
323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: NoDataRowDirective, decorators: [{
|
|
324
324
|
type: Directive,
|
|
325
325
|
args: [{
|
|
326
326
|
selector: 'ng-template[twNoDataRow]',
|
|
@@ -337,10 +337,10 @@ class RowExpansionDirective {
|
|
|
337
337
|
static ngTemplateContextGuard(_dir, _ctx) {
|
|
338
338
|
return true;
|
|
339
339
|
}
|
|
340
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
341
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
340
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: RowExpansionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
341
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: RowExpansionDirective, isStandalone: true, selector: "ng-template[twRowExpansion]", inputs: { predicate: { classPropertyName: "predicate", publicName: "twRowExpansionWhen", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
342
342
|
}
|
|
343
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
343
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: RowExpansionDirective, decorators: [{
|
|
344
344
|
type: Directive,
|
|
345
345
|
args: [{ selector: 'ng-template[twRowExpansion]' }]
|
|
346
346
|
}], propDecorators: { predicate: [{ type: i0.Input, args: [{ isSignal: true, alias: "twRowExpansionWhen", required: false }] }] } });
|
|
@@ -363,17 +363,23 @@ let nextColumnId = 0;
|
|
|
363
363
|
*/
|
|
364
364
|
class ColumnComponent {
|
|
365
365
|
/** Unique identifier for this column. Required — referenced by `*twRowDef` / `*twHeaderRowDef` and used as the CDK `cdkColumnDef` name. */
|
|
366
|
-
name = input.required(
|
|
366
|
+
name = input.required(/* @ts-ignore */
|
|
367
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
367
368
|
/** Visual configuration: sticky, align, numeric, hideBelow, width. Accepts any subset; unset keys fall back to the defaults. */
|
|
368
|
-
display = input({},
|
|
369
|
+
display = input({}, /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []));
|
|
369
371
|
/** When true, removes this column from the visible column set. Defaults to `false`. */
|
|
370
|
-
hidden = input(false,
|
|
372
|
+
hidden = input(false, /* @ts-ignore */
|
|
373
|
+
...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
371
374
|
/** Ordering hint for the default visible-columns list when no `*twRowDef` is declared. Lower renders first. Defaults to `0`. */
|
|
372
|
-
priority = input(0,
|
|
375
|
+
priority = input(0, /* @ts-ignore */
|
|
376
|
+
...(ngDevMode ? [{ debugName: "priority" }] : /* istanbul ignore next */ []));
|
|
373
377
|
/** Plain text header label. Used when no `*twHeaderCellDef` template is projected. Defaults to `undefined`. */
|
|
374
|
-
headerLabel = input(undefined,
|
|
378
|
+
headerLabel = input(undefined, /* @ts-ignore */
|
|
379
|
+
...(ngDevMode ? [{ debugName: "headerLabel" }] : /* istanbul ignore next */ []));
|
|
375
380
|
/** Label used as `data-label` on cells in responsive `'stack'` mode. Falls back to `headerLabel`, then `name`. Defaults to `undefined`. */
|
|
376
|
-
stackLabel = input(undefined,
|
|
381
|
+
stackLabel = input(undefined, /* @ts-ignore */
|
|
382
|
+
...(ngDevMode ? [{ debugName: "stackLabel" }] : /* istanbul ignore next */ []));
|
|
377
383
|
/**
|
|
378
384
|
* Explicit override for the column header's `aria-sort` attribute. When unset (the default),
|
|
379
385
|
* the column derives its `aria-sort` from a parent `[twSort]` directive via the `TW_SORT_HANDLE`
|
|
@@ -381,53 +387,72 @@ class ColumnComponent {
|
|
|
381
387
|
* `name`. Set explicitly to `'ascending'` / `'descending'` / `'none'` to override; `null` disables
|
|
382
388
|
* the attribute entirely. Defaults to `null`.
|
|
383
389
|
*/
|
|
384
|
-
sortState = input(null,
|
|
390
|
+
sortState = input(null, /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "sortState" }] : /* istanbul ignore next */ []));
|
|
385
392
|
/** @internal Stable identifier used for DOM `data-*` hooks. */
|
|
386
393
|
columnId = `tw-column-${nextColumnId++}`;
|
|
387
394
|
sortHandle = inject(TW_SORT_HANDLE, { optional: true });
|
|
388
395
|
/** @internal Consumer-projected header-cell template (optional). */
|
|
389
|
-
headerCellDef = contentChild(HeaderCellDefDirective,
|
|
396
|
+
headerCellDef = contentChild(HeaderCellDefDirective, /* @ts-ignore */
|
|
397
|
+
...(ngDevMode ? [{ debugName: "headerCellDef" }] : /* istanbul ignore next */ []));
|
|
390
398
|
/** @internal Consumer-projected data-cell template. */
|
|
391
|
-
cellDef = contentChild((CellDefDirective),
|
|
399
|
+
cellDef = contentChild((CellDefDirective), /* @ts-ignore */
|
|
400
|
+
...(ngDevMode ? [{ debugName: "cellDef" }] : /* istanbul ignore next */ []));
|
|
392
401
|
/** @internal Consumer-projected footer-cell template (optional). */
|
|
393
|
-
footerCellDef = contentChild((FooterCellDefDirective),
|
|
402
|
+
footerCellDef = contentChild((FooterCellDefDirective), /* @ts-ignore */
|
|
403
|
+
...(ngDevMode ? [{ debugName: "footerCellDef" }] : /* istanbul ignore next */ []));
|
|
394
404
|
/** @internal Index in the visible column set — pushed by the parent table. */
|
|
395
|
-
columnIndex = signal(0,
|
|
405
|
+
columnIndex = signal(0, /* @ts-ignore */
|
|
406
|
+
...(ngDevMode ? [{ debugName: "columnIndex" }] : /* istanbul ignore next */ []));
|
|
396
407
|
/** @internal Row snapshot pushed by the parent for footer-cell contexts. */
|
|
397
|
-
rowsSnapshot = signal([],
|
|
408
|
+
rowsSnapshot = signal([], /* @ts-ignore */
|
|
409
|
+
...(ngDevMode ? [{ debugName: "rowsSnapshot" }] : /* istanbul ignore next */ []));
|
|
398
410
|
/** @internal Table-pushed extra classes (sticky / hide-below / responsive decorations). */
|
|
399
|
-
extraCellClass = signal('',
|
|
400
|
-
|
|
401
|
-
|
|
411
|
+
extraCellClass = signal('', /* @ts-ignore */
|
|
412
|
+
...(ngDevMode ? [{ debugName: "extraCellClass" }] : /* istanbul ignore next */ []));
|
|
413
|
+
extraHeaderClass = signal('', /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "extraHeaderClass" }] : /* istanbul ignore next */ []));
|
|
415
|
+
extraFooterClass = signal('', /* @ts-ignore */
|
|
416
|
+
...(ngDevMode ? [{ debugName: "extraFooterClass" }] : /* istanbul ignore next */ []));
|
|
402
417
|
/** Resolved display config — partial input merged with `DISPLAY_DEFAULTS`. */
|
|
403
418
|
resolvedDisplay = computed(() => ({
|
|
404
419
|
...DISPLAY_DEFAULTS,
|
|
405
420
|
...this.display(),
|
|
406
|
-
}),
|
|
421
|
+
}), /* @ts-ignore */
|
|
422
|
+
...(ngDevMode ? [{ debugName: "resolvedDisplay" }] : /* istanbul ignore next */ []));
|
|
407
423
|
/** @internal Convenience accessor for the cdkColumnDef `[sticky]` binding. */
|
|
408
|
-
stickyStart = computed(() => this.resolvedDisplay().sticky === 'start',
|
|
424
|
+
stickyStart = computed(() => this.resolvedDisplay().sticky === 'start', /* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "stickyStart" }] : /* istanbul ignore next */ []));
|
|
409
426
|
/** @internal Convenience accessor for the cdkColumnDef `[stickyEnd]` binding. */
|
|
410
|
-
stickyEnd = computed(() => this.resolvedDisplay().sticky === 'end',
|
|
427
|
+
stickyEnd = computed(() => this.resolvedDisplay().sticky === 'end', /* @ts-ignore */
|
|
428
|
+
...(ngDevMode ? [{ debugName: "stickyEnd" }] : /* istanbul ignore next */ []));
|
|
411
429
|
/** @internal Effective align — `numeric` forces `'end'` unless `align` is explicitly set to a non-default value. */
|
|
412
430
|
effectiveAlign = computed(() => {
|
|
413
431
|
const display = this.resolvedDisplay();
|
|
414
432
|
if (display.align === 'start' && display.numeric)
|
|
415
433
|
return 'end';
|
|
416
434
|
return display.align;
|
|
417
|
-
},
|
|
435
|
+
}, /* @ts-ignore */
|
|
436
|
+
...(ngDevMode ? [{ debugName: "effectiveAlign" }] : /* istanbul ignore next */ []));
|
|
418
437
|
/** @internal CSS width string applied to cells. */
|
|
419
|
-
resolvedWidth = computed(() => coerceCssSize(this.resolvedDisplay().width),
|
|
438
|
+
resolvedWidth = computed(() => coerceCssSize(this.resolvedDisplay().width), /* @ts-ignore */
|
|
439
|
+
...(ngDevMode ? [{ debugName: "resolvedWidth" }] : /* istanbul ignore next */ []));
|
|
420
440
|
/** @internal `data-label` emitted on cells in stack mode. */
|
|
421
|
-
stackDataLabel = computed(() => this.stackLabel() ?? this.headerLabel() ?? this.name(),
|
|
441
|
+
stackDataLabel = computed(() => this.stackLabel() ?? this.headerLabel() ?? this.name(), /* @ts-ignore */
|
|
442
|
+
...(ngDevMode ? [{ debugName: "stackDataLabel" }] : /* istanbul ignore next */ []));
|
|
422
443
|
/** @internal Align class plus tabular-numerals when `numeric` is true — shared by data and footer cells. */
|
|
423
444
|
dataCellPrefix = computed(() => {
|
|
424
445
|
const align = ALIGN_CLASSES[this.effectiveAlign()];
|
|
425
446
|
const numeric = this.resolvedDisplay().numeric ? '[font-variant-numeric:tabular-nums]' : '';
|
|
426
447
|
return numeric ? `${align} ${numeric}` : align;
|
|
427
|
-
},
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
448
|
+
}, /* @ts-ignore */
|
|
449
|
+
...(ngDevMode ? [{ debugName: "dataCellPrefix" }] : /* istanbul ignore next */ []));
|
|
450
|
+
cellClasses = computed(() => [this.dataCellPrefix(), this.extraCellClass()].filter(Boolean).join(' '), /* @ts-ignore */
|
|
451
|
+
...(ngDevMode ? [{ debugName: "cellClasses" }] : /* istanbul ignore next */ []));
|
|
452
|
+
headerCellClasses = computed(() => [ALIGN_CLASSES[this.effectiveAlign()], this.extraHeaderClass()].filter(Boolean).join(' '), /* @ts-ignore */
|
|
453
|
+
...(ngDevMode ? [{ debugName: "headerCellClasses" }] : /* istanbul ignore next */ []));
|
|
454
|
+
footerCellClasses = computed(() => [this.dataCellPrefix(), this.extraFooterClass()].filter(Boolean).join(' '), /* @ts-ignore */
|
|
455
|
+
...(ngDevMode ? [{ debugName: "footerCellClasses" }] : /* istanbul ignore next */ []));
|
|
431
456
|
/**
|
|
432
457
|
* @internal `aria-sort` value for the column's `<th>`. Explicit `sortState` wins; otherwise the
|
|
433
458
|
* column auto-resolves against a parent `[twSort]` directive (`TW_SORT_HANDLE`). Returns `null`
|
|
@@ -448,18 +473,21 @@ class ColumnComponent {
|
|
|
448
473
|
if (direction === 'desc')
|
|
449
474
|
return 'descending';
|
|
450
475
|
return null;
|
|
451
|
-
},
|
|
476
|
+
}, /* @ts-ignore */
|
|
477
|
+
...(ngDevMode ? [{ debugName: "ariaSort" }] : /* istanbul ignore next */ []));
|
|
452
478
|
headerContext = computed(() => ({
|
|
453
479
|
$implicit: this.name(),
|
|
454
480
|
column: this.name(),
|
|
455
481
|
columnIndex: this.columnIndex(),
|
|
456
|
-
}),
|
|
482
|
+
}), /* @ts-ignore */
|
|
483
|
+
...(ngDevMode ? [{ debugName: "headerContext" }] : /* istanbul ignore next */ []));
|
|
457
484
|
footerContext = computed(() => ({
|
|
458
485
|
$implicit: this.name(),
|
|
459
486
|
column: this.name(),
|
|
460
487
|
columnIndex: this.columnIndex(),
|
|
461
488
|
rows: this.rowsSnapshot(),
|
|
462
|
-
}),
|
|
489
|
+
}), /* @ts-ignore */
|
|
490
|
+
...(ngDevMode ? [{ debugName: "footerContext" }] : /* istanbul ignore next */ []));
|
|
463
491
|
/** @internal Builds the per-cell template context from CDK-provided row variables. */
|
|
464
492
|
buildCellContext(row, index, count, first, last, even, odd) {
|
|
465
493
|
return {
|
|
@@ -475,10 +503,10 @@ class ColumnComponent {
|
|
|
475
503
|
count,
|
|
476
504
|
};
|
|
477
505
|
}
|
|
478
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
479
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
506
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ColumnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
507
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.7", type: ColumnComponent, isStandalone: true, selector: "tw-column", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, display: { classPropertyName: "display", publicName: "display", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, priority: { classPropertyName: "priority", publicName: "priority", isSignal: true, isRequired: false, transformFunction: null }, headerLabel: { classPropertyName: "headerLabel", publicName: "headerLabel", isSignal: true, isRequired: false, transformFunction: null }, stackLabel: { classPropertyName: "stackLabel", publicName: "stackLabel", isSignal: true, isRequired: false, transformFunction: null }, sortState: { classPropertyName: "sortState", publicName: "sortState", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: none" }, queries: [{ propertyName: "headerCellDef", first: true, predicate: HeaderCellDefDirective, descendants: true, isSignal: true }, { propertyName: "cellDef", first: true, predicate: (CellDefDirective), descendants: true, isSignal: true }, { propertyName: "footerCellDef", first: true, predicate: (FooterCellDefDirective), descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
480
508
|
}
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
509
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: ColumnComponent, decorators: [{
|
|
482
510
|
type: Component,
|
|
483
511
|
args: [{
|
|
484
512
|
selector: 'tw-column',
|
|
@@ -502,34 +530,55 @@ let nextTableId = 0;
|
|
|
502
530
|
class TableComponent {
|
|
503
531
|
// ── Inputs ──
|
|
504
532
|
/** The table's rows. Accepts a plain array, an `Observable<readonly T[]>`, or a CDK `DataSource<T>`. Wired directly to `CdkTable.dataSource`. Defaults to an empty array. */
|
|
505
|
-
data = input([],
|
|
506
|
-
|
|
507
|
-
|
|
533
|
+
data = input([], /* @ts-ignore */
|
|
534
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
535
|
+
/**
|
|
536
|
+
* Tracking function used to identify rows across data changes. When unset, rows are identified by
|
|
537
|
+
* object reference.
|
|
538
|
+
*
|
|
539
|
+
* This drives **selection and expansion membership** as well as CDK's DOM diffing. Supply it when
|
|
540
|
+
* the data source re-emits equal-but-new objects — an HTTP refetch, an immutable store — or the
|
|
541
|
+
* user's selection empties on every refresh with no event and no error. It is called with `-1` as
|
|
542
|
+
* the index for membership lookups, so return a value derived from the row alone (`row.id`), not
|
|
543
|
+
* from the index.
|
|
544
|
+
*/
|
|
545
|
+
trackBy = input(undefined, /* @ts-ignore */
|
|
546
|
+
...(ngDevMode ? [{ debugName: "trackBy" }] : /* istanbul ignore next */ []));
|
|
508
547
|
/** When true, renders the loading slot as an overlay and applies `opacity-60 pointer-events-none` to the body. Defaults to `false`. */
|
|
509
|
-
loading = input(false,
|
|
548
|
+
loading = input(false, /* @ts-ignore */
|
|
549
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
510
550
|
/** When non-null, renders the error slot in place of the body. Defaults to `null`. */
|
|
511
|
-
error = input(null,
|
|
551
|
+
error = input(null, /* @ts-ignore */
|
|
552
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
512
553
|
/** Visual configuration — `variant`, `density`, `size`, `layout`, `rowAnimations`. Accepts a partial; unset keys fall back to the defaults. */
|
|
513
|
-
appearance = input({},
|
|
554
|
+
appearance = input({}, /* @ts-ignore */
|
|
555
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
514
556
|
/** Sticky configuration — `header`, `footer`, `scrollHeight`. Accepts a partial; unset keys fall back to the defaults. */
|
|
515
|
-
sticky = input({},
|
|
557
|
+
sticky = input({}, /* @ts-ignore */
|
|
558
|
+
...(ngDevMode ? [{ debugName: "sticky" }] : /* istanbul ignore next */ []));
|
|
516
559
|
/** Responsive configuration — `mode`, `stackBelow`. Accepts a partial; unset keys fall back to the defaults. */
|
|
517
|
-
responsive = input({},
|
|
560
|
+
responsive = input({}, /* @ts-ignore */
|
|
561
|
+
...(ngDevMode ? [{ debugName: "responsive" }] : /* istanbul ignore next */ []));
|
|
518
562
|
/** Selection configuration — `enabled`. Accepts a partial; unset keys fall back to the defaults. */
|
|
519
|
-
selection = input({},
|
|
563
|
+
selection = input({}, /* @ts-ignore */
|
|
564
|
+
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
520
565
|
/** Whether multiple row templates may render per data object. Required for `*twRowExpansion` and advanced `*twRowDef [when]` usage. Defaults to `false`. */
|
|
521
|
-
multiTemplateRows = input(false,
|
|
566
|
+
multiTemplateRows = input(false, /* @ts-ignore */
|
|
567
|
+
...(ngDevMode ? [{ debugName: "multiTemplateRows" }] : /* istanbul ignore next */ []));
|
|
522
568
|
/** Overrides for user-facing strings. Unset keys fall back to the English defaults. Defaults to `{}`. */
|
|
523
|
-
labels = input({},
|
|
569
|
+
labels = input({}, /* @ts-ignore */
|
|
570
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
524
571
|
/** Accessible name for the `<table>`. Required when no visible `<caption slot="caption">` is provided. */
|
|
525
572
|
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
526
573
|
/** Id of an external element labelling the table. Mirrored to `aria-labelledby` on the `<table>`. */
|
|
527
574
|
ariaLabelledby = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
528
575
|
// ── Models (two-way) ──
|
|
529
576
|
/** Two-way bound set of rows currently expanded. Immutable — set a new `Set` on every change; do not mutate in place. */
|
|
530
|
-
expandedRows = model(new Set(),
|
|
577
|
+
expandedRows = model(new Set(), /* @ts-ignore */
|
|
578
|
+
...(ngDevMode ? [{ debugName: "expandedRows" }] : /* istanbul ignore next */ []));
|
|
531
579
|
/** Two-way bound list of selected rows. Set a new array on every change; do not mutate. Only used when `selection.enabled` is `true`. */
|
|
532
|
-
selected = model([],
|
|
580
|
+
selected = model([], /* @ts-ignore */
|
|
581
|
+
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
533
582
|
// ── Outputs ──
|
|
534
583
|
/** Fires when a row is clicked. Suppressed when the click originated inside an interactive descendant (button, link, input, etc.). */
|
|
535
584
|
rowClicked = output();
|
|
@@ -546,7 +595,8 @@ class TableComponent {
|
|
|
546
595
|
expansionTemplate = contentChild((RowExpansionDirective), { ...(ngDevMode ? { debugName: "expansionTemplate" } : /* istanbul ignore next */ {}), descendants: true });
|
|
547
596
|
// ── View children ──
|
|
548
597
|
/** @internal The CDK table inside our view. */
|
|
549
|
-
cdkTable = viewChild.required('cdkTable'
|
|
598
|
+
cdkTable = viewChild.required('cdkTable', /* @ts-ignore */
|
|
599
|
+
...(ngDevMode ? [{ debugName: "cdkTable" }] : /* istanbul ignore next */ []));
|
|
550
600
|
// ── Injected services ──
|
|
551
601
|
_liveAnnouncer = inject(LiveAnnouncer);
|
|
552
602
|
_elementRef = inject((ElementRef));
|
|
@@ -561,74 +611,93 @@ class TableComponent {
|
|
|
561
611
|
resolvedAppearance = computed(() => ({
|
|
562
612
|
...APPEARANCE_DEFAULTS,
|
|
563
613
|
...this.appearance(),
|
|
564
|
-
}),
|
|
614
|
+
}), /* @ts-ignore */
|
|
615
|
+
...(ngDevMode ? [{ debugName: "resolvedAppearance" }] : /* istanbul ignore next */ []));
|
|
565
616
|
/** @internal Resolved sticky configuration. */
|
|
566
617
|
resolvedSticky = computed(() => ({
|
|
567
618
|
...STICKY_DEFAULTS,
|
|
568
619
|
...this.sticky(),
|
|
569
|
-
}),
|
|
620
|
+
}), /* @ts-ignore */
|
|
621
|
+
...(ngDevMode ? [{ debugName: "resolvedSticky" }] : /* istanbul ignore next */ []));
|
|
570
622
|
/** @internal Resolved responsive configuration. */
|
|
571
623
|
resolvedResponsive = computed(() => ({
|
|
572
624
|
...RESPONSIVE_DEFAULTS,
|
|
573
625
|
...this.responsive(),
|
|
574
|
-
}),
|
|
626
|
+
}), /* @ts-ignore */
|
|
627
|
+
...(ngDevMode ? [{ debugName: "resolvedResponsive" }] : /* istanbul ignore next */ []));
|
|
575
628
|
/** @internal Resolved selection configuration. */
|
|
576
629
|
resolvedSelection = computed(() => ({
|
|
577
630
|
...SELECTION_DEFAULTS,
|
|
578
631
|
...this.selection(),
|
|
579
|
-
}),
|
|
632
|
+
}), /* @ts-ignore */
|
|
633
|
+
...(ngDevMode ? [{ debugName: "resolvedSelection" }] : /* istanbul ignore next */ []));
|
|
580
634
|
// ── Derived state ──
|
|
581
635
|
/** @internal Snapshot of the data array (for footer-cell context). Empty array for async data sources. */
|
|
582
636
|
resolvedRows = computed(() => {
|
|
583
637
|
const d = this.data();
|
|
584
638
|
return Array.isArray(d) ? d : [];
|
|
585
|
-
},
|
|
639
|
+
}, /* @ts-ignore */
|
|
640
|
+
...(ngDevMode ? [{ debugName: "resolvedRows" }] : /* istanbul ignore next */ []));
|
|
586
641
|
/** @internal Whether the data input is a plain array. */
|
|
587
|
-
dataIsArray = computed(() => Array.isArray(this.data()),
|
|
642
|
+
dataIsArray = computed(() => Array.isArray(this.data()), /* @ts-ignore */
|
|
643
|
+
...(ngDevMode ? [{ debugName: "dataIsArray" }] : /* istanbul ignore next */ []));
|
|
588
644
|
/** @internal Snapshot-based empty check; `false` for async sources (we can't know without subscribing). */
|
|
589
|
-
isEmptySnapshot = computed(() => this.dataIsArray() && this.resolvedRows().length === 0,
|
|
645
|
+
isEmptySnapshot = computed(() => this.dataIsArray() && this.resolvedRows().length === 0, /* @ts-ignore */
|
|
646
|
+
...(ngDevMode ? [{ debugName: "isEmptySnapshot" }] : /* istanbul ignore next */ []));
|
|
590
647
|
/** @internal Whether the empty overlay fallback should render (no no-data-row projected). */
|
|
591
648
|
shouldRenderEmptyOverlay = computed(() => this.isEmptySnapshot() &&
|
|
592
649
|
!this.loading() &&
|
|
593
650
|
this.error() === null &&
|
|
594
|
-
!this.noDataRow(),
|
|
651
|
+
!this.noDataRow(), /* @ts-ignore */
|
|
652
|
+
...(ngDevMode ? [{ debugName: "shouldRenderEmptyOverlay" }] : /* istanbul ignore next */ []));
|
|
595
653
|
/** @internal Whether the error overlay should render. */
|
|
596
|
-
shouldRenderErrorOverlay = computed(() => this.error() !== null,
|
|
654
|
+
shouldRenderErrorOverlay = computed(() => this.error() !== null, /* @ts-ignore */
|
|
655
|
+
...(ngDevMode ? [{ debugName: "shouldRenderErrorOverlay" }] : /* istanbul ignore next */ []));
|
|
597
656
|
/** @internal Resolved table labels (defaults merged with input overrides). */
|
|
598
657
|
resolvedLabels = computed(() => ({
|
|
599
658
|
...DEFAULT_TABLE_LABELS,
|
|
600
659
|
...this.labels(),
|
|
601
|
-
}),
|
|
660
|
+
}), /* @ts-ignore */
|
|
661
|
+
...(ngDevMode ? [{ debugName: "resolvedLabels" }] : /* istanbul ignore next */ []));
|
|
602
662
|
/** @internal Computed error message for the default error overlay. Empty when no error is set. */
|
|
603
663
|
errorMessage = computed(() => {
|
|
604
664
|
const err = this.error();
|
|
605
665
|
if (err == null)
|
|
606
666
|
return '';
|
|
607
667
|
return `${this.resolvedLabels().errorPrefix}${String(err)}`;
|
|
608
|
-
},
|
|
668
|
+
}, /* @ts-ignore */
|
|
669
|
+
...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
609
670
|
/** @internal CSS max-height string for the scroll container. */
|
|
610
|
-
maxHeightStyle = computed(() => coerceCssSize(this.resolvedSticky().scrollHeight),
|
|
671
|
+
maxHeightStyle = computed(() => coerceCssSize(this.resolvedSticky().scrollHeight), /* @ts-ignore */
|
|
672
|
+
...(ngDevMode ? [{ debugName: "maxHeightStyle" }] : /* istanbul ignore next */ []));
|
|
611
673
|
/** @internal The visible (non-hidden) columns in render order (by ascending `priority`). */
|
|
612
674
|
visibleColumns = computed(() => this.columns()
|
|
613
675
|
.filter((c) => !c.hidden())
|
|
614
|
-
.sort((a, b) => a.priority() - b.priority()),
|
|
676
|
+
.sort((a, b) => a.priority() - b.priority()), /* @ts-ignore */
|
|
677
|
+
...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
|
|
615
678
|
/** @internal Column names of the visible set, prefixed with `_selection` when `selection.enabled === true`. */
|
|
616
679
|
visibleColumnNames = computed(() => {
|
|
617
680
|
const names = this.visibleColumns().map((c) => c.name());
|
|
618
681
|
return this.resolvedSelection().enabled ? ['_selection', ...names] : names;
|
|
619
|
-
},
|
|
682
|
+
}, /* @ts-ignore */
|
|
683
|
+
...(ngDevMode ? [{ debugName: "visibleColumnNames" }] : /* istanbul ignore next */ []));
|
|
620
684
|
/** @internal Whether any column has a projected footer-cell template. */
|
|
621
|
-
hasFooterRow = computed(() => this.visibleColumns().some((c) => !!c.footerCellDef()),
|
|
685
|
+
hasFooterRow = computed(() => this.visibleColumns().some((c) => !!c.footerCellDef()), /* @ts-ignore */
|
|
686
|
+
...(ngDevMode ? [{ debugName: "hasFooterRow" }] : /* istanbul ignore next */ []));
|
|
622
687
|
/** @internal Whether an expansion template has been declared and multi-template rows are enabled. */
|
|
623
|
-
hasExpansion = computed(() => this.multiTemplateRows() && !!this.expansionTemplate(),
|
|
688
|
+
hasExpansion = computed(() => this.multiTemplateRows() && !!this.expansionTemplate(), /* @ts-ignore */
|
|
689
|
+
...(ngDevMode ? [{ debugName: "hasExpansion" }] : /* istanbul ignore next */ []));
|
|
624
690
|
/** @internal Colspan to use for the expansion `<td>`. */
|
|
625
691
|
expansionColspan = computed(() => {
|
|
626
692
|
const cols = this.visibleColumns().length;
|
|
627
693
|
return Math.max(1, cols + (this.resolvedSelection().enabled ? 1 : 0));
|
|
628
|
-
},
|
|
694
|
+
}, /* @ts-ignore */
|
|
695
|
+
...(ngDevMode ? [{ debugName: "expansionColspan" }] : /* istanbul ignore next */ []));
|
|
629
696
|
/** @internal Pulled by the template for the `*cdkHeaderRowDef`/`*cdkFooterRowDef` `sticky:` field. */
|
|
630
|
-
stickyHeader = computed(() => this.resolvedSticky().header,
|
|
631
|
-
|
|
697
|
+
stickyHeader = computed(() => this.resolvedSticky().header, /* @ts-ignore */
|
|
698
|
+
...(ngDevMode ? [{ debugName: "stickyHeader" }] : /* istanbul ignore next */ []));
|
|
699
|
+
stickyFooter = computed(() => this.resolvedSticky().footer, /* @ts-ignore */
|
|
700
|
+
...(ngDevMode ? [{ debugName: "stickyFooter" }] : /* istanbul ignore next */ []));
|
|
632
701
|
// ── Variant class computation ──
|
|
633
702
|
_variantResult = computed(() => {
|
|
634
703
|
const appearance = this.resolvedAppearance();
|
|
@@ -642,22 +711,29 @@ class TableComponent {
|
|
|
642
711
|
stickyFooter: stickyCfg.footer,
|
|
643
712
|
loading: this.loading(),
|
|
644
713
|
});
|
|
645
|
-
},
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
714
|
+
}, /* @ts-ignore */
|
|
715
|
+
...(ngDevMode ? [{ debugName: "_variantResult" }] : /* istanbul ignore next */ []));
|
|
716
|
+
hostClasses = computed(() => this._variantResult().root(), /* @ts-ignore */
|
|
717
|
+
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
718
|
+
toolbarClasses = computed(() => this._variantResult().toolbar(), /* @ts-ignore */
|
|
719
|
+
...(ngDevMode ? [{ debugName: "toolbarClasses" }] : /* istanbul ignore next */ []));
|
|
720
|
+
scrollWrapperClasses = computed(() => this._variantResult().scrollWrapper(), /* @ts-ignore */
|
|
721
|
+
...(ngDevMode ? [{ debugName: "scrollWrapperClasses" }] : /* istanbul ignore next */ []));
|
|
649
722
|
scrollContainerClasses = computed(() => {
|
|
650
723
|
const base = this._variantResult().scrollContainer();
|
|
651
724
|
return this.maxHeightStyle() ? `${base} overflow-y-auto` : base;
|
|
652
|
-
},
|
|
725
|
+
}, /* @ts-ignore */
|
|
726
|
+
...(ngDevMode ? [{ debugName: "scrollContainerClasses" }] : /* istanbul ignore next */ []));
|
|
653
727
|
tableClasses = computed(() => {
|
|
654
728
|
const base = this._variantResult().table();
|
|
655
729
|
const responsive = this.resolvedResponsive();
|
|
656
730
|
if (responsive.mode !== 'stack')
|
|
657
731
|
return base;
|
|
658
732
|
return `${base} ${STACK_TABLE_UTILITIES[responsive.stackBelow]}`;
|
|
659
|
-
},
|
|
660
|
-
|
|
733
|
+
}, /* @ts-ignore */
|
|
734
|
+
...(ngDevMode ? [{ debugName: "tableClasses" }] : /* istanbul ignore next */ []));
|
|
735
|
+
thClasses = computed(() => this._variantResult().th(), /* @ts-ignore */
|
|
736
|
+
...(ngDevMode ? [{ debugName: "thClasses" }] : /* istanbul ignore next */ []));
|
|
661
737
|
tdClasses = computed(() => {
|
|
662
738
|
const base = this._variantResult().td();
|
|
663
739
|
const responsive = this.resolvedResponsive();
|
|
@@ -665,28 +741,44 @@ class TableComponent {
|
|
|
665
741
|
return `${base} ${STACK_CELL_UTILITIES[responsive.stackBelow]}`;
|
|
666
742
|
}
|
|
667
743
|
return base;
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
744
|
+
}, /* @ts-ignore */
|
|
745
|
+
...(ngDevMode ? [{ debugName: "tdClasses" }] : /* istanbul ignore next */ []));
|
|
746
|
+
footerTdClasses = computed(() => this._variantResult().footerTd(), /* @ts-ignore */
|
|
747
|
+
...(ngDevMode ? [{ debugName: "footerTdClasses" }] : /* istanbul ignore next */ []));
|
|
748
|
+
emptyStateClasses = computed(() => this._variantResult().emptyState(), /* @ts-ignore */
|
|
749
|
+
...(ngDevMode ? [{ debugName: "emptyStateClasses" }] : /* istanbul ignore next */ []));
|
|
750
|
+
emptyIconClasses = computed(() => this._variantResult().emptyIcon(), /* @ts-ignore */
|
|
751
|
+
...(ngDevMode ? [{ debugName: "emptyIconClasses" }] : /* istanbul ignore next */ []));
|
|
752
|
+
emptyMessageClasses = computed(() => this._variantResult().emptyMessage(), /* @ts-ignore */
|
|
753
|
+
...(ngDevMode ? [{ debugName: "emptyMessageClasses" }] : /* istanbul ignore next */ []));
|
|
754
|
+
loadingOverlayClasses = computed(() => this._variantResult().loadingOverlay(), /* @ts-ignore */
|
|
755
|
+
...(ngDevMode ? [{ debugName: "loadingOverlayClasses" }] : /* istanbul ignore next */ []));
|
|
756
|
+
loadingMessageClasses = computed(() => this._variantResult().loadingMessage(), /* @ts-ignore */
|
|
757
|
+
...(ngDevMode ? [{ debugName: "loadingMessageClasses" }] : /* istanbul ignore next */ []));
|
|
758
|
+
errorStateClasses = computed(() => this._variantResult().errorState(), /* @ts-ignore */
|
|
759
|
+
...(ngDevMode ? [{ debugName: "errorStateClasses" }] : /* istanbul ignore next */ []));
|
|
760
|
+
errorIconClasses = computed(() => this._variantResult().errorIcon(), /* @ts-ignore */
|
|
761
|
+
...(ngDevMode ? [{ debugName: "errorIconClasses" }] : /* istanbul ignore next */ []));
|
|
762
|
+
errorMessageClasses = computed(() => this._variantResult().errorMessage(), /* @ts-ignore */
|
|
763
|
+
...(ngDevMode ? [{ debugName: "errorMessageClasses" }] : /* istanbul ignore next */ []));
|
|
764
|
+
footerSlotClasses = computed(() => this._variantResult().footerSlot(), /* @ts-ignore */
|
|
765
|
+
...(ngDevMode ? [{ debugName: "footerSlotClasses" }] : /* istanbul ignore next */ []));
|
|
766
|
+
paginationSlotClasses = computed(() => this._variantResult().paginationSlot(), /* @ts-ignore */
|
|
767
|
+
...(ngDevMode ? [{ debugName: "paginationSlotClasses" }] : /* istanbul ignore next */ []));
|
|
768
|
+
expansionRowClasses = computed(() => this._variantResult().expansionRow(), /* @ts-ignore */
|
|
769
|
+
...(ngDevMode ? [{ debugName: "expansionRowClasses" }] : /* istanbul ignore next */ []));
|
|
770
|
+
expansionCellClasses = computed(() => this._variantResult().expansionCell(), /* @ts-ignore */
|
|
771
|
+
...(ngDevMode ? [{ debugName: "expansionCellClasses" }] : /* istanbul ignore next */ []));
|
|
682
772
|
selectionHeaderClasses = computed(() => {
|
|
683
773
|
const base = this._variantResult().selectionHeader();
|
|
684
774
|
return [base, this.thClasses()].filter(Boolean).join(' ');
|
|
685
|
-
},
|
|
775
|
+
}, /* @ts-ignore */
|
|
776
|
+
...(ngDevMode ? [{ debugName: "selectionHeaderClasses" }] : /* istanbul ignore next */ []));
|
|
686
777
|
selectionCellClasses = computed(() => {
|
|
687
778
|
const base = this._variantResult().selectionCell();
|
|
688
779
|
return [base, this.tdClasses()].filter(Boolean).join(' ');
|
|
689
|
-
},
|
|
780
|
+
}, /* @ts-ignore */
|
|
781
|
+
...(ngDevMode ? [{ debugName: "selectionCellClasses" }] : /* istanbul ignore next */ []));
|
|
690
782
|
// ── CdkTable wiring ──
|
|
691
783
|
//
|
|
692
784
|
// All CdkColumnDefs + row defs are rendered INLINE in our template (see
|
|
@@ -841,7 +933,23 @@ class TableComponent {
|
|
|
841
933
|
}
|
|
842
934
|
/** @internal Whether a row is currently expanded. */
|
|
843
935
|
isRowExpanded(row) {
|
|
844
|
-
|
|
936
|
+
const expanded = this.expandedRows();
|
|
937
|
+
if (expanded.has(row))
|
|
938
|
+
return true;
|
|
939
|
+
// `expandedRows` is a public `model<ReadonlySet<T>>`, and a JS Set cannot
|
|
940
|
+
// take custom equality — so unlike selection this cannot be a keyed Set
|
|
941
|
+
// without a breaking API change. A scan is acceptable here: expansion
|
|
942
|
+
// holds a handful of rows, not the whole page. Skipped entirely when no
|
|
943
|
+
// `trackBy` is supplied, since the reference check above is then complete.
|
|
944
|
+
const track = this.trackBy();
|
|
945
|
+
if (!track)
|
|
946
|
+
return false;
|
|
947
|
+
const key = this.rowKey(row);
|
|
948
|
+
for (const candidate of expanded) {
|
|
949
|
+
if (this.rowKey(candidate) === key)
|
|
950
|
+
return true;
|
|
951
|
+
}
|
|
952
|
+
return false;
|
|
845
953
|
}
|
|
846
954
|
/** @internal CDK `when` predicate used for the auto-generated expansion row. */
|
|
847
955
|
expansionWhen = (index, row) => {
|
|
@@ -877,7 +985,17 @@ class TableComponent {
|
|
|
877
985
|
if (!this.isRowExpanded(row))
|
|
878
986
|
return;
|
|
879
987
|
const next = new Set(this.expandedRows());
|
|
880
|
-
next.delete(row)
|
|
988
|
+
if (!next.delete(row)) {
|
|
989
|
+
// Row was matched by key rather than by reference — find and drop the
|
|
990
|
+
// instance actually held in the set.
|
|
991
|
+
const key = this.rowKey(row);
|
|
992
|
+
for (const candidate of next) {
|
|
993
|
+
if (this.rowKey(candidate) === key) {
|
|
994
|
+
next.delete(candidate);
|
|
995
|
+
break;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
881
999
|
this.expandedRows.set(next);
|
|
882
1000
|
this.expansionChange.emit({ row, expanded: false, expandedRows: next });
|
|
883
1001
|
}
|
|
@@ -888,17 +1006,44 @@ class TableComponent {
|
|
|
888
1006
|
else
|
|
889
1007
|
this.expand(row);
|
|
890
1008
|
}
|
|
1009
|
+
/**
|
|
1010
|
+
* @internal Identity key for a row.
|
|
1011
|
+
*
|
|
1012
|
+
* Selection and expansion are membership questions, and answering them by
|
|
1013
|
+
* object reference breaks the moment a data source re-emits equal-but-new
|
|
1014
|
+
* objects — an HTTP refetch, an immutable store, `signal.set([...mapped])`.
|
|
1015
|
+
* The user's selection empties with no event and no error.
|
|
1016
|
+
*
|
|
1017
|
+
* `trackBy` is already the consumer's declaration of row identity, so it is
|
|
1018
|
+
* reused here rather than adding a second, redundant input. With no `trackBy`
|
|
1019
|
+
* the key IS the row, i.e. reference identity — the same default CDK uses.
|
|
1020
|
+
*
|
|
1021
|
+
* Note this must be a *key* function, not a comparator: a comparator would fix
|
|
1022
|
+
* identity but leave membership as an O(rows x selected) scan, and a
|
|
1023
|
+
* reference-keyed Set would fix the scan but ignore custom identity. Only a
|
|
1024
|
+
* key fixes both.
|
|
1025
|
+
*/
|
|
1026
|
+
rowKey(row) {
|
|
1027
|
+
const track = this.trackBy();
|
|
1028
|
+
return track ? track(-1, row) : row;
|
|
1029
|
+
}
|
|
1030
|
+
/** @internal O(1) membership lookup for the current selection, keyed by `rowKey`. */
|
|
1031
|
+
selectedKeys = computed(() => new Set(this.selected().map((row) => this.rowKey(row))), /* @ts-ignore */
|
|
1032
|
+
...(ngDevMode ? [{ debugName: "selectedKeys" }] : /* istanbul ignore next */ []));
|
|
891
1033
|
/** Whether a given row is currently in the `selected` list. */
|
|
892
1034
|
isSelected(row) {
|
|
893
|
-
return this.
|
|
1035
|
+
return this.selectedKeys().has(this.rowKey(row));
|
|
894
1036
|
}
|
|
895
1037
|
/** Selects or deselects a row and emits `selectionChange`. */
|
|
896
1038
|
setSelected(row, nextSelected) {
|
|
897
1039
|
const previous = this.selected();
|
|
898
|
-
const
|
|
1040
|
+
const key = this.rowKey(row);
|
|
1041
|
+
const isAlreadySelected = this.selectedKeys().has(key);
|
|
899
1042
|
if (isAlreadySelected === nextSelected)
|
|
900
1043
|
return;
|
|
901
|
-
const next = nextSelected
|
|
1044
|
+
const next = nextSelected
|
|
1045
|
+
? [...previous, row]
|
|
1046
|
+
: previous.filter((r) => this.rowKey(r) !== key);
|
|
902
1047
|
this.selected.set(next);
|
|
903
1048
|
this.selectionChange.emit({
|
|
904
1049
|
selected: next,
|
|
@@ -917,10 +1062,10 @@ class TableComponent {
|
|
|
917
1062
|
if (rows.length === 0)
|
|
918
1063
|
return;
|
|
919
1064
|
const previous = this.selected();
|
|
920
|
-
const
|
|
1065
|
+
const previousKeys = this.selectedKeys();
|
|
921
1066
|
const added = [];
|
|
922
1067
|
for (const row of rows) {
|
|
923
|
-
if (!
|
|
1068
|
+
if (!previousKeys.has(this.rowKey(row)))
|
|
924
1069
|
added.push(row);
|
|
925
1070
|
}
|
|
926
1071
|
if (added.length === 0)
|
|
@@ -954,17 +1099,20 @@ class TableComponent {
|
|
|
954
1099
|
const selected = this.selected();
|
|
955
1100
|
if (selected.length === 0)
|
|
956
1101
|
return 'none';
|
|
957
|
-
const
|
|
1102
|
+
const selectedKeys = this.selectedKeys();
|
|
958
1103
|
for (const row of rows) {
|
|
959
|
-
if (!
|
|
1104
|
+
if (!selectedKeys.has(this.rowKey(row)))
|
|
960
1105
|
return 'some';
|
|
961
1106
|
}
|
|
962
1107
|
return 'all';
|
|
963
|
-
},
|
|
1108
|
+
}, /* @ts-ignore */
|
|
1109
|
+
...(ngDevMode ? [{ debugName: "masterSelectionState" }] : /* istanbul ignore next */ []));
|
|
964
1110
|
/** @internal Whether the master "select all" checkbox should render checked. */
|
|
965
|
-
masterChecked = computed(() => this.masterSelectionState() === 'all',
|
|
1111
|
+
masterChecked = computed(() => this.masterSelectionState() === 'all', /* @ts-ignore */
|
|
1112
|
+
...(ngDevMode ? [{ debugName: "masterChecked" }] : /* istanbul ignore next */ []));
|
|
966
1113
|
/** @internal Whether the master "select all" checkbox should render indeterminate. */
|
|
967
|
-
masterIndeterminate = computed(() => this.masterSelectionState() === 'some',
|
|
1114
|
+
masterIndeterminate = computed(() => this.masterSelectionState() === 'some', /* @ts-ignore */
|
|
1115
|
+
...(ngDevMode ? [{ debugName: "masterIndeterminate" }] : /* istanbul ignore next */ []));
|
|
968
1116
|
/** @internal Wires the master checkbox change event to `selectAll` / `clearSelection`. */
|
|
969
1117
|
toggleMasterSelection(checked) {
|
|
970
1118
|
if (checked)
|
|
@@ -976,14 +1124,14 @@ class TableComponent {
|
|
|
976
1124
|
selectRowLabel(rowIndex) {
|
|
977
1125
|
return formatLabel(this.resolvedLabels().selectRowLabel, { index: rowIndex + 1 });
|
|
978
1126
|
}
|
|
979
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
980
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: TableComponent, isStandalone: true, selector: "tw-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, multiTemplateRows: { classPropertyName: "multiTemplateRows", publicName: "multiTemplateRows", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, expandedRows: { classPropertyName: "expandedRows", publicName: "expandedRows", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedRows: "expandedRowsChange", selected: "selectedChange", rowClicked: "rowClicked", selectionChange: "selectionChange", expansionChange: "expansionChange" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "columns", predicate: (ColumnComponent), descendants: true, isSignal: true }, { propertyName: "noDataRow", first: true, predicate: NoDataRowDirective, descendants: true, isSignal: true }, { propertyName: "expansionTemplate", first: true, predicate: (RowExpansionDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "cdkTable", first: true, predicate: ["cdkTable"], descendants: true, isSignal: true }], exportAs: ["twTable"], ngImport: i0, template: "<!-- Toolbar slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"toolbarClasses()\">\n <ng-content select=\"[slot='toolbar']\" />\n</div>\n\n<!-- Scroll wrapper \u2014 also hosts the loading overlay as an absolutely-positioned child. -->\n<div [class]=\"scrollWrapperClasses()\">\n <div [class]=\"scrollContainerClasses()\" [style.max-height]=\"maxHeightStyle()\">\n <table\n #cdkTable=\"cdkTable\"\n cdk-table\n [class]=\"tableClasses()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n <ng-content select=\"[slot='caption']\" />\n\n <!--\n Emit one <ng-container cdkColumnDef> per visible column. CdkColumnDef's\n @ContentChildren(CdkCellDef / CdkHeaderCellDef / CdkFooterCellDef)\n resolves the <th *cdkHeaderCellDef> / <td *cdkCellDef> / <td *cdkFooterCellDef>\n below \u2014 those renderers delegate to the consumer's projected templates\n (col.cellDef() / col.headerCellDef() / col.footerCellDef()) via\n ngTemplateOutlet.\n -->\n @for (col of visibleColumns(); track col.name()) {\n <ng-container\n [cdkColumnDef]=\"col.name()\"\n [sticky]=\"col.stickyStart()\"\n [stickyEnd]=\"col.stickyEnd()\"\n >\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"col.headerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.aria-sort]=\"col.ariaSort()\"\n [attr.data-column]=\"col.name()\"\n scope=\"col\"\n >\n @if (col.headerCellDef(); as hdef) {\n <ng-container\n [ngTemplateOutlet]=\"hdef.template\"\n [ngTemplateOutletContext]=\"col.headerContext()\"\n />\n } @else if (col.headerLabel()) {\n {{ col.headerLabel() }}\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd\"\n [class]=\"col.cellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-label]=\"col.stackDataLabel()\"\n [attr.data-column]=\"col.name()\"\n >\n @if (col.cellDef(); as cdef) {\n <ng-container\n [ngTemplateOutlet]=\"cdef.template\"\n [ngTemplateOutletContext]=\"col.buildCellContext(row, i, c, f, l, e, o)\"\n />\n }\n </td>\n @if (col.footerCellDef()) {\n <td\n cdk-footer-cell\n *cdkFooterCellDef\n [class]=\"col.footerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-column]=\"col.name()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"col.footerCellDef()!.template\"\n [ngTemplateOutletContext]=\"col.footerContext()\"\n />\n </td>\n }\n </ng-container>\n }\n\n <!-- Selection pseudo-column emitted as a leading column when `selection.enabled` is true.\n Hosts the master \"select all\" checkbox in the header and per-row checkboxes in the body.\n The role=\"checkbox\" host on <tw-checkbox> is allowlisted by the row-click suppression\n helper so clicking it does NOT also emit `rowClicked`. -->\n @if (resolvedSelection().enabled) {\n <ng-container cdkColumnDef=\"_selection\">\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"selectionHeaderClasses()\"\n scope=\"col\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"masterChecked()\"\n [indeterminate]=\"masterIndeterminate()\"\n (change)=\"toggleMasterSelection($event)\"\n [aria-label]=\"resolvedLabels().selectAllLabel\"\n />\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index\"\n [class]=\"selectionCellClasses()\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"isSelected(row)\"\n (change)=\"setSelected(row, $event)\"\n [aria-label]=\"selectRowLabel(i)\"\n />\n </td>\n </ng-container>\n }\n\n <!-- Auto-generated row defs driven by visibleColumnNames(). -->\n @if (visibleColumnNames().length > 0) {\n <tr\n cdk-header-row\n *cdkHeaderRowDef=\"visibleColumnNames(); sticky: stickyHeader()\"\n ></tr>\n <tr\n cdk-row\n *cdkRowDef=\"let row; let i = dataIndex; columns: visibleColumnNames()\"\n (click)=\"handleRowClick(row, i, $event)\"\n [attr.aria-selected]=\"rowAriaSelected(row)\"\n ></tr>\n @if (hasFooterRow()) {\n <tr\n cdk-footer-row\n *cdkFooterRowDef=\"visibleColumnNames(); sticky: stickyFooter()\"\n ></tr>\n }\n }\n\n <!-- Expansion pseudo-column + extra row def. -->\n @if (hasExpansion()) {\n <ng-container cdkColumnDef=\"_tw_expansion\">\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = dataIndex\"\n [attr.colspan]=\"expansionColspan()\"\n [class]=\"expansionCellClasses()\"\n >\n @if (expansionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.template\"\n [ngTemplateOutletContext]=\"expansionContext(row, i)\"\n />\n }\n </td>\n </ng-container>\n <tr\n cdk-row\n *cdkRowDef=\"let row; columns: ['_tw_expansion']; when: expansionWhen\"\n [class]=\"expansionRowClasses()\"\n ></tr>\n }\n\n <!-- Consumer-projected content: tw-column metadata components and ng-template-based\n directives (*twNoDataRow, *twRowExpansion). The tw-column hosts are display:none\n so they are harmless inside the <table>. -->\n <ng-content />\n </table>\n\n <!-- Empty-state fallback overlay (hidden when a *twNoDataRow is projected; hidden when loading/error). -->\n @if (shouldRenderEmptyOverlay()) {\n <div [class]=\"emptyStateClasses()\">\n <ng-content select=\"[slot='empty']\">\n <svg\n [class]=\"emptyIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661l-2.4-8.022A2.25 2.25 0 0 0 17.128 3.5H6.873a2.25 2.25 0 0 0-2.122 1.655l-2.4 8.022a2.25 2.25 0 0 0-.1.661Z\"\n />\n </svg>\n <p [class]=\"emptyMessageClasses()\">{{ resolvedLabels().empty }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Error-state overlay. -->\n @if (shouldRenderErrorOverlay()) {\n <div [class]=\"errorStateClasses()\" role=\"alert\">\n <ng-content select=\"[slot='error']\">\n <svg\n [class]=\"errorIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n />\n </svg>\n <p [class]=\"errorMessageClasses()\">{{ errorMessage() }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Loading overlay (absolute-positioned inside scroll wrapper). -->\n @if (loading()) {\n <div\n [class]=\"loadingOverlayClasses()\"\n role=\"status\"\n aria-live=\"polite\"\n animate.enter=\"fade-in\"\n animate.leave=\"fade-out\"\n >\n <ng-content select=\"[slot='loading']\">\n <svg\n class=\"size-5 shrink-0 animate-spin motion-reduce:animate-none text-fg-muted\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.2\"\n />\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"60\"\n stroke-dashoffset=\"40\"\n />\n </svg>\n <span [class]=\"loadingMessageClasses()\">{{ resolvedLabels().loading }}</span>\n </ng-content>\n </div>\n }\n </div>\n</div>\n\n<!-- Footer slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"footerSlotClasses()\">\n <ng-content select=\"[slot='footer']\" />\n</div>\n\n<!-- Pagination slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"paginationSlotClasses()\">\n <ng-content select=\"[slot='pagination']\" />\n</div>\n", dependencies: [{ kind: "ngmodule", type: CdkTableModule }, { kind: "component", type: i1.CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout", "recycleRows"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { kind: "directive", type: i1.CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "directive", type: i1.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i1.CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: i1.CdkFooterCellDef, selector: "[cdkFooterCellDef]" }, { kind: "directive", type: i1.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: i1.CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "component", type: i1.CdkRow, selector: "cdk-row, tr[cdk-row]" }, { kind: "directive", type: i1.CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: i1.CdkFooterCell, selector: "cdk-footer-cell, td[cdk-footer-cell]" }, { kind: "component", type: i1.CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { kind: "directive", type: i1.CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "component", type: i1.CdkFooterRow, selector: "cdk-footer-row, tr[cdk-footer-row]" }, { kind: "directive", type: i1.CdkFooterRowDef, selector: "[cdkFooterRowDef]", inputs: ["cdkFooterRowDef", "cdkFooterRowDefSticky"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CheckboxComponent, selector: "tw-checkbox", inputs: ["color", "size", "variant", "disabled", "required", "label", "description", "labelPosition", "name", "id", "aria-label", "aria-labelledby", "aria-describedby", "errorStateMatcher", "checked", "indeterminate"], outputs: ["checkedChange", "indeterminateChange", "change"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1127
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1128
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: TableComponent, isStandalone: true, selector: "tw-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, multiTemplateRows: { classPropertyName: "multiTemplateRows", publicName: "multiTemplateRows", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, expandedRows: { classPropertyName: "expandedRows", publicName: "expandedRows", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedRows: "expandedRowsChange", selected: "selectedChange", rowClicked: "rowClicked", selectionChange: "selectionChange", expansionChange: "expansionChange" }, host: { properties: { "class": "hostClasses()" } }, queries: [{ propertyName: "columns", predicate: (ColumnComponent), descendants: true, isSignal: true }, { propertyName: "noDataRow", first: true, predicate: NoDataRowDirective, descendants: true, isSignal: true }, { propertyName: "expansionTemplate", first: true, predicate: (RowExpansionDirective), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "cdkTable", first: true, predicate: ["cdkTable"], descendants: true, isSignal: true }], exportAs: ["twTable"], ngImport: i0, template: "<!-- Toolbar slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"toolbarClasses()\">\n <ng-content select=\"[slot='toolbar']\" />\n</div>\n\n<!-- Scroll wrapper \u2014 also hosts the loading overlay as an absolutely-positioned child. -->\n<div [class]=\"scrollWrapperClasses()\">\n <div [class]=\"scrollContainerClasses()\" [style.max-height]=\"maxHeightStyle()\">\n <table\n #cdkTable=\"cdkTable\"\n cdk-table\n [class]=\"tableClasses()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n <ng-content select=\"[slot='caption']\" />\n\n <!--\n Emit one <ng-container cdkColumnDef> per visible column. CdkColumnDef's\n @ContentChildren(CdkCellDef / CdkHeaderCellDef / CdkFooterCellDef)\n resolves the <th *cdkHeaderCellDef> / <td *cdkCellDef> / <td *cdkFooterCellDef>\n below \u2014 those renderers delegate to the consumer's projected templates\n (col.cellDef() / col.headerCellDef() / col.footerCellDef()) via\n ngTemplateOutlet.\n -->\n @for (col of visibleColumns(); track col.name()) {\n <ng-container\n [cdkColumnDef]=\"col.name()\"\n [sticky]=\"col.stickyStart()\"\n [stickyEnd]=\"col.stickyEnd()\"\n >\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"col.headerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.aria-sort]=\"col.ariaSort()\"\n [attr.data-column]=\"col.name()\"\n scope=\"col\"\n >\n @if (col.headerCellDef(); as hdef) {\n <ng-container\n [ngTemplateOutlet]=\"hdef.template\"\n [ngTemplateOutletContext]=\"col.headerContext()\"\n />\n } @else if (col.headerLabel()) {\n {{ col.headerLabel() }}\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd\"\n [class]=\"col.cellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-label]=\"col.stackDataLabel()\"\n [attr.data-column]=\"col.name()\"\n >\n @if (col.cellDef(); as cdef) {\n <ng-container\n [ngTemplateOutlet]=\"cdef.template\"\n [ngTemplateOutletContext]=\"col.buildCellContext(row, i, c, f, l, e, o)\"\n />\n }\n </td>\n @if (col.footerCellDef()) {\n <td\n cdk-footer-cell\n *cdkFooterCellDef\n [class]=\"col.footerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-column]=\"col.name()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"col.footerCellDef()!.template\"\n [ngTemplateOutletContext]=\"col.footerContext()\"\n />\n </td>\n }\n </ng-container>\n }\n\n <!-- Selection pseudo-column emitted as a leading column when `selection.enabled` is true.\n Hosts the master \"select all\" checkbox in the header and per-row checkboxes in the body.\n The role=\"checkbox\" host on <tw-checkbox> is allowlisted by the row-click suppression\n helper so clicking it does NOT also emit `rowClicked`. -->\n @if (resolvedSelection().enabled) {\n <ng-container cdkColumnDef=\"_selection\">\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"selectionHeaderClasses()\"\n scope=\"col\"\n >\n <!-- Select-all needs a full row snapshot, which only the array\n data-source path can produce. Rendering it for an Observable /\n DataSource input gave a checkbox that looked functional, never\n reflected state, and did nothing on click. -->\n @if (dataIsArray()) {\n <tw-checkbox\n size=\"sm\"\n [checked]=\"masterChecked()\"\n [indeterminate]=\"masterIndeterminate()\"\n (change)=\"toggleMasterSelection($event)\"\n [aria-label]=\"resolvedLabels().selectAllLabel\"\n />\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index\"\n [class]=\"selectionCellClasses()\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"isSelected(row)\"\n (change)=\"setSelected(row, $event)\"\n [aria-label]=\"selectRowLabel(i)\"\n />\n </td>\n </ng-container>\n }\n\n <!-- Auto-generated row defs driven by visibleColumnNames(). -->\n @if (visibleColumnNames().length > 0) {\n <tr\n cdk-header-row\n *cdkHeaderRowDef=\"visibleColumnNames(); sticky: stickyHeader()\"\n ></tr>\n <tr\n cdk-row\n *cdkRowDef=\"let row; let i = dataIndex; columns: visibleColumnNames()\"\n (click)=\"handleRowClick(row, i, $event)\"\n [attr.aria-selected]=\"rowAriaSelected(row)\"\n ></tr>\n @if (hasFooterRow()) {\n <tr\n cdk-footer-row\n *cdkFooterRowDef=\"visibleColumnNames(); sticky: stickyFooter()\"\n ></tr>\n }\n }\n\n <!-- Expansion pseudo-column + extra row def. -->\n @if (hasExpansion()) {\n <ng-container cdkColumnDef=\"_tw_expansion\">\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = dataIndex\"\n [attr.colspan]=\"expansionColspan()\"\n [class]=\"expansionCellClasses()\"\n >\n @if (expansionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.template\"\n [ngTemplateOutletContext]=\"expansionContext(row, i)\"\n />\n }\n </td>\n </ng-container>\n <tr\n cdk-row\n *cdkRowDef=\"let row; columns: ['_tw_expansion']; when: expansionWhen\"\n [class]=\"expansionRowClasses()\"\n ></tr>\n }\n\n <!-- Consumer-projected content: tw-column metadata components and ng-template-based\n directives (*twNoDataRow, *twRowExpansion). The tw-column hosts are display:none\n so they are harmless inside the <table>. -->\n <ng-content />\n </table>\n\n <!-- Empty-state fallback overlay (hidden when a *twNoDataRow is projected; hidden when loading/error). -->\n @if (shouldRenderEmptyOverlay()) {\n <div [class]=\"emptyStateClasses()\">\n <ng-content select=\"[slot='empty']\">\n <svg\n [class]=\"emptyIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661l-2.4-8.022A2.25 2.25 0 0 0 17.128 3.5H6.873a2.25 2.25 0 0 0-2.122 1.655l-2.4 8.022a2.25 2.25 0 0 0-.1.661Z\"\n />\n </svg>\n <p [class]=\"emptyMessageClasses()\">{{ resolvedLabels().empty }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Error-state overlay. -->\n @if (shouldRenderErrorOverlay()) {\n <div [class]=\"errorStateClasses()\" role=\"alert\">\n <ng-content select=\"[slot='error']\">\n <svg\n [class]=\"errorIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n />\n </svg>\n <p [class]=\"errorMessageClasses()\">{{ errorMessage() }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Loading overlay (absolute-positioned inside scroll wrapper). -->\n @if (loading()) {\n <div\n [class]=\"loadingOverlayClasses()\"\n role=\"status\"\n aria-live=\"polite\"\n animate.enter=\"fade-in\"\n animate.leave=\"fade-out\"\n >\n <ng-content select=\"[slot='loading']\">\n <svg\n class=\"size-5 shrink-0 animate-spin motion-reduce:animate-none text-fg-muted\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.2\"\n />\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"60\"\n stroke-dashoffset=\"40\"\n />\n </svg>\n <span [class]=\"loadingMessageClasses()\">{{ resolvedLabels().loading }}</span>\n </ng-content>\n </div>\n }\n </div>\n</div>\n\n<!-- Footer slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"footerSlotClasses()\">\n <ng-content select=\"[slot='footer']\" />\n</div>\n\n<!-- Pagination slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"paginationSlotClasses()\">\n <ng-content select=\"[slot='pagination']\" />\n</div>\n", dependencies: [{ kind: "ngmodule", type: CdkTableModule }, { kind: "component", type: i1.CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout", "recycleRows"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { kind: "directive", type: i1.CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }, { kind: "directive", type: i1.CdkCellDef, selector: "[cdkCellDef]" }, { kind: "directive", type: i1.CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { kind: "directive", type: i1.CdkFooterCellDef, selector: "[cdkFooterCellDef]" }, { kind: "directive", type: i1.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["cdkColumnDef", "sticky", "stickyEnd"] }, { kind: "directive", type: i1.CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { kind: "component", type: i1.CdkRow, selector: "cdk-row, tr[cdk-row]" }, { kind: "directive", type: i1.CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { kind: "directive", type: i1.CdkFooterCell, selector: "cdk-footer-cell, td[cdk-footer-cell]" }, { kind: "component", type: i1.CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { kind: "directive", type: i1.CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { kind: "component", type: i1.CdkFooterRow, selector: "cdk-footer-row, tr[cdk-footer-row]" }, { kind: "directive", type: i1.CdkFooterRowDef, selector: "[cdkFooterRowDef]", inputs: ["cdkFooterRowDef", "cdkFooterRowDefSticky"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CheckboxComponent, selector: "tw-checkbox", inputs: ["color", "size", "variant", "disabled", "required", "label", "description", "labelPosition", "name", "id", "aria-label", "aria-labelledby", "aria-describedby", "errorStateMatcher", "checked", "indeterminate"], outputs: ["checkedChange", "indeterminateChange", "change"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
981
1129
|
}
|
|
982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TableComponent, decorators: [{
|
|
983
1131
|
type: Component,
|
|
984
1132
|
args: [{ selector: 'tw-table', exportAs: 'twTable', changeDetection: ChangeDetectionStrategy.OnPush, imports: [CdkTableModule, NgTemplateOutlet, CheckboxComponent], host: {
|
|
985
1133
|
'[class]': 'hostClasses()',
|
|
986
|
-
}, template: "<!-- Toolbar slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"toolbarClasses()\">\n <ng-content select=\"[slot='toolbar']\" />\n</div>\n\n<!-- Scroll wrapper \u2014 also hosts the loading overlay as an absolutely-positioned child. -->\n<div [class]=\"scrollWrapperClasses()\">\n <div [class]=\"scrollContainerClasses()\" [style.max-height]=\"maxHeightStyle()\">\n <table\n #cdkTable=\"cdkTable\"\n cdk-table\n [class]=\"tableClasses()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n <ng-content select=\"[slot='caption']\" />\n\n <!--\n Emit one <ng-container cdkColumnDef> per visible column. CdkColumnDef's\n @ContentChildren(CdkCellDef / CdkHeaderCellDef / CdkFooterCellDef)\n resolves the <th *cdkHeaderCellDef> / <td *cdkCellDef> / <td *cdkFooterCellDef>\n below \u2014 those renderers delegate to the consumer's projected templates\n (col.cellDef() / col.headerCellDef() / col.footerCellDef()) via\n ngTemplateOutlet.\n -->\n @for (col of visibleColumns(); track col.name()) {\n <ng-container\n [cdkColumnDef]=\"col.name()\"\n [sticky]=\"col.stickyStart()\"\n [stickyEnd]=\"col.stickyEnd()\"\n >\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"col.headerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.aria-sort]=\"col.ariaSort()\"\n [attr.data-column]=\"col.name()\"\n scope=\"col\"\n >\n @if (col.headerCellDef(); as hdef) {\n <ng-container\n [ngTemplateOutlet]=\"hdef.template\"\n [ngTemplateOutletContext]=\"col.headerContext()\"\n />\n } @else if (col.headerLabel()) {\n {{ col.headerLabel() }}\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd\"\n [class]=\"col.cellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-label]=\"col.stackDataLabel()\"\n [attr.data-column]=\"col.name()\"\n >\n @if (col.cellDef(); as cdef) {\n <ng-container\n [ngTemplateOutlet]=\"cdef.template\"\n [ngTemplateOutletContext]=\"col.buildCellContext(row, i, c, f, l, e, o)\"\n />\n }\n </td>\n @if (col.footerCellDef()) {\n <td\n cdk-footer-cell\n *cdkFooterCellDef\n [class]=\"col.footerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-column]=\"col.name()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"col.footerCellDef()!.template\"\n [ngTemplateOutletContext]=\"col.footerContext()\"\n />\n </td>\n }\n </ng-container>\n }\n\n <!-- Selection pseudo-column emitted as a leading column when `selection.enabled` is true.\n Hosts the master \"select all\" checkbox in the header and per-row checkboxes in the body.\n The role=\"checkbox\" host on <tw-checkbox> is allowlisted by the row-click suppression\n helper so clicking it does NOT also emit `rowClicked`. -->\n @if (resolvedSelection().enabled) {\n <ng-container cdkColumnDef=\"_selection\">\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"selectionHeaderClasses()\"\n scope=\"col\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"masterChecked()\"\n [indeterminate]=\"masterIndeterminate()\"\n (change)=\"toggleMasterSelection($event)\"\n [aria-label]=\"resolvedLabels().selectAllLabel\"\n />\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index\"\n [class]=\"selectionCellClasses()\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"isSelected(row)\"\n (change)=\"setSelected(row, $event)\"\n [aria-label]=\"selectRowLabel(i)\"\n />\n </td>\n </ng-container>\n }\n\n <!-- Auto-generated row defs driven by visibleColumnNames(). -->\n @if (visibleColumnNames().length > 0) {\n <tr\n cdk-header-row\n *cdkHeaderRowDef=\"visibleColumnNames(); sticky: stickyHeader()\"\n ></tr>\n <tr\n cdk-row\n *cdkRowDef=\"let row; let i = dataIndex; columns: visibleColumnNames()\"\n (click)=\"handleRowClick(row, i, $event)\"\n [attr.aria-selected]=\"rowAriaSelected(row)\"\n ></tr>\n @if (hasFooterRow()) {\n <tr\n cdk-footer-row\n *cdkFooterRowDef=\"visibleColumnNames(); sticky: stickyFooter()\"\n ></tr>\n }\n }\n\n <!-- Expansion pseudo-column + extra row def. -->\n @if (hasExpansion()) {\n <ng-container cdkColumnDef=\"_tw_expansion\">\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = dataIndex\"\n [attr.colspan]=\"expansionColspan()\"\n [class]=\"expansionCellClasses()\"\n >\n @if (expansionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.template\"\n [ngTemplateOutletContext]=\"expansionContext(row, i)\"\n />\n }\n </td>\n </ng-container>\n <tr\n cdk-row\n *cdkRowDef=\"let row; columns: ['_tw_expansion']; when: expansionWhen\"\n [class]=\"expansionRowClasses()\"\n ></tr>\n }\n\n <!-- Consumer-projected content: tw-column metadata components and ng-template-based\n directives (*twNoDataRow, *twRowExpansion). The tw-column hosts are display:none\n so they are harmless inside the <table>. -->\n <ng-content />\n </table>\n\n <!-- Empty-state fallback overlay (hidden when a *twNoDataRow is projected; hidden when loading/error). -->\n @if (shouldRenderEmptyOverlay()) {\n <div [class]=\"emptyStateClasses()\">\n <ng-content select=\"[slot='empty']\">\n <svg\n [class]=\"emptyIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661l-2.4-8.022A2.25 2.25 0 0 0 17.128 3.5H6.873a2.25 2.25 0 0 0-2.122 1.655l-2.4 8.022a2.25 2.25 0 0 0-.1.661Z\"\n />\n </svg>\n <p [class]=\"emptyMessageClasses()\">{{ resolvedLabels().empty }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Error-state overlay. -->\n @if (shouldRenderErrorOverlay()) {\n <div [class]=\"errorStateClasses()\" role=\"alert\">\n <ng-content select=\"[slot='error']\">\n <svg\n [class]=\"errorIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n />\n </svg>\n <p [class]=\"errorMessageClasses()\">{{ errorMessage() }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Loading overlay (absolute-positioned inside scroll wrapper). -->\n @if (loading()) {\n <div\n [class]=\"loadingOverlayClasses()\"\n role=\"status\"\n aria-live=\"polite\"\n animate.enter=\"fade-in\"\n animate.leave=\"fade-out\"\n >\n <ng-content select=\"[slot='loading']\">\n <svg\n class=\"size-5 shrink-0 animate-spin motion-reduce:animate-none text-fg-muted\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.2\"\n />\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"60\"\n stroke-dashoffset=\"40\"\n />\n </svg>\n <span [class]=\"loadingMessageClasses()\">{{ resolvedLabels().loading }}</span>\n </ng-content>\n </div>\n }\n </div>\n</div>\n\n<!-- Footer slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"footerSlotClasses()\">\n <ng-content select=\"[slot='footer']\" />\n</div>\n\n<!-- Pagination slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"paginationSlotClasses()\">\n <ng-content select=\"[slot='pagination']\" />\n</div>\n" }]
|
|
1134
|
+
}, template: "<!-- Toolbar slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"toolbarClasses()\">\n <ng-content select=\"[slot='toolbar']\" />\n</div>\n\n<!-- Scroll wrapper \u2014 also hosts the loading overlay as an absolutely-positioned child. -->\n<div [class]=\"scrollWrapperClasses()\">\n <div [class]=\"scrollContainerClasses()\" [style.max-height]=\"maxHeightStyle()\">\n <table\n #cdkTable=\"cdkTable\"\n cdk-table\n [class]=\"tableClasses()\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledby() ?? null\"\n >\n <ng-content select=\"[slot='caption']\" />\n\n <!--\n Emit one <ng-container cdkColumnDef> per visible column. CdkColumnDef's\n @ContentChildren(CdkCellDef / CdkHeaderCellDef / CdkFooterCellDef)\n resolves the <th *cdkHeaderCellDef> / <td *cdkCellDef> / <td *cdkFooterCellDef>\n below \u2014 those renderers delegate to the consumer's projected templates\n (col.cellDef() / col.headerCellDef() / col.footerCellDef()) via\n ngTemplateOutlet.\n -->\n @for (col of visibleColumns(); track col.name()) {\n <ng-container\n [cdkColumnDef]=\"col.name()\"\n [sticky]=\"col.stickyStart()\"\n [stickyEnd]=\"col.stickyEnd()\"\n >\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"col.headerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.aria-sort]=\"col.ariaSort()\"\n [attr.data-column]=\"col.name()\"\n scope=\"col\"\n >\n @if (col.headerCellDef(); as hdef) {\n <ng-container\n [ngTemplateOutlet]=\"hdef.template\"\n [ngTemplateOutletContext]=\"col.headerContext()\"\n />\n } @else if (col.headerLabel()) {\n {{ col.headerLabel() }}\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index; let c = count; let f = first; let l = last; let e = even; let o = odd\"\n [class]=\"col.cellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-label]=\"col.stackDataLabel()\"\n [attr.data-column]=\"col.name()\"\n >\n @if (col.cellDef(); as cdef) {\n <ng-container\n [ngTemplateOutlet]=\"cdef.template\"\n [ngTemplateOutletContext]=\"col.buildCellContext(row, i, c, f, l, e, o)\"\n />\n }\n </td>\n @if (col.footerCellDef()) {\n <td\n cdk-footer-cell\n *cdkFooterCellDef\n [class]=\"col.footerCellClasses()\"\n [style.width]=\"col.resolvedWidth()\"\n [attr.data-column]=\"col.name()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"col.footerCellDef()!.template\"\n [ngTemplateOutletContext]=\"col.footerContext()\"\n />\n </td>\n }\n </ng-container>\n }\n\n <!-- Selection pseudo-column emitted as a leading column when `selection.enabled` is true.\n Hosts the master \"select all\" checkbox in the header and per-row checkboxes in the body.\n The role=\"checkbox\" host on <tw-checkbox> is allowlisted by the row-click suppression\n helper so clicking it does NOT also emit `rowClicked`. -->\n @if (resolvedSelection().enabled) {\n <ng-container cdkColumnDef=\"_selection\">\n <th\n cdk-header-cell\n *cdkHeaderCellDef\n [class]=\"selectionHeaderClasses()\"\n scope=\"col\"\n >\n <!-- Select-all needs a full row snapshot, which only the array\n data-source path can produce. Rendering it for an Observable /\n DataSource input gave a checkbox that looked functional, never\n reflected state, and did nothing on click. -->\n @if (dataIsArray()) {\n <tw-checkbox\n size=\"sm\"\n [checked]=\"masterChecked()\"\n [indeterminate]=\"masterIndeterminate()\"\n (change)=\"toggleMasterSelection($event)\"\n [aria-label]=\"resolvedLabels().selectAllLabel\"\n />\n }\n </th>\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = index\"\n [class]=\"selectionCellClasses()\"\n >\n <tw-checkbox\n size=\"sm\"\n [checked]=\"isSelected(row)\"\n (change)=\"setSelected(row, $event)\"\n [aria-label]=\"selectRowLabel(i)\"\n />\n </td>\n </ng-container>\n }\n\n <!-- Auto-generated row defs driven by visibleColumnNames(). -->\n @if (visibleColumnNames().length > 0) {\n <tr\n cdk-header-row\n *cdkHeaderRowDef=\"visibleColumnNames(); sticky: stickyHeader()\"\n ></tr>\n <tr\n cdk-row\n *cdkRowDef=\"let row; let i = dataIndex; columns: visibleColumnNames()\"\n (click)=\"handleRowClick(row, i, $event)\"\n [attr.aria-selected]=\"rowAriaSelected(row)\"\n ></tr>\n @if (hasFooterRow()) {\n <tr\n cdk-footer-row\n *cdkFooterRowDef=\"visibleColumnNames(); sticky: stickyFooter()\"\n ></tr>\n }\n }\n\n <!-- Expansion pseudo-column + extra row def. -->\n @if (hasExpansion()) {\n <ng-container cdkColumnDef=\"_tw_expansion\">\n <td\n cdk-cell\n *cdkCellDef=\"let row; let i = dataIndex\"\n [attr.colspan]=\"expansionColspan()\"\n [class]=\"expansionCellClasses()\"\n >\n @if (expansionTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl.template\"\n [ngTemplateOutletContext]=\"expansionContext(row, i)\"\n />\n }\n </td>\n </ng-container>\n <tr\n cdk-row\n *cdkRowDef=\"let row; columns: ['_tw_expansion']; when: expansionWhen\"\n [class]=\"expansionRowClasses()\"\n ></tr>\n }\n\n <!-- Consumer-projected content: tw-column metadata components and ng-template-based\n directives (*twNoDataRow, *twRowExpansion). The tw-column hosts are display:none\n so they are harmless inside the <table>. -->\n <ng-content />\n </table>\n\n <!-- Empty-state fallback overlay (hidden when a *twNoDataRow is projected; hidden when loading/error). -->\n @if (shouldRenderEmptyOverlay()) {\n <div [class]=\"emptyStateClasses()\">\n <ng-content select=\"[slot='empty']\">\n <svg\n [class]=\"emptyIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661l-2.4-8.022A2.25 2.25 0 0 0 17.128 3.5H6.873a2.25 2.25 0 0 0-2.122 1.655l-2.4 8.022a2.25 2.25 0 0 0-.1.661Z\"\n />\n </svg>\n <p [class]=\"emptyMessageClasses()\">{{ resolvedLabels().empty }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Error-state overlay. -->\n @if (shouldRenderErrorOverlay()) {\n <div [class]=\"errorStateClasses()\" role=\"alert\">\n <ng-content select=\"[slot='error']\">\n <svg\n [class]=\"errorIconClasses()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n />\n </svg>\n <p [class]=\"errorMessageClasses()\">{{ errorMessage() }}</p>\n </ng-content>\n </div>\n }\n\n <!-- Loading overlay (absolute-positioned inside scroll wrapper). -->\n @if (loading()) {\n <div\n [class]=\"loadingOverlayClasses()\"\n role=\"status\"\n aria-live=\"polite\"\n animate.enter=\"fade-in\"\n animate.leave=\"fade-out\"\n >\n <ng-content select=\"[slot='loading']\">\n <svg\n class=\"size-5 shrink-0 animate-spin motion-reduce:animate-none text-fg-muted\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n opacity=\"0.2\"\n />\n <circle\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-dasharray=\"60\"\n stroke-dashoffset=\"40\"\n />\n </svg>\n <span [class]=\"loadingMessageClasses()\">{{ resolvedLabels().loading }}</span>\n </ng-content>\n </div>\n }\n </div>\n</div>\n\n<!-- Footer slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"footerSlotClasses()\">\n <ng-content select=\"[slot='footer']\" />\n</div>\n\n<!-- Pagination slot \u2014 hidden when empty via `empty:hidden` in the slot class. -->\n<div [class]=\"paginationSlotClasses()\">\n <ng-content select=\"[slot='pagination']\" />\n</div>\n" }]
|
|
987
1135
|
}], ctorParameters: () => [], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], multiTemplateRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiTemplateRows", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], expandedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandedRows", required: false }] }, { type: i0.Output, args: ["expandedRowsChange"] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], rowClicked: [{ type: i0.Output, args: ["rowClicked"] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], expansionChange: [{ type: i0.Output, args: ["expansionChange"] }], columns: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => ColumnComponent), { ...{ descendants: true }, isSignal: true }] }], noDataRow: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NoDataRowDirective), { ...{ descendants: true }, isSignal: true }] }], expansionTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => RowExpansionDirective), { ...{ descendants: true }, isSignal: true }] }], cdkTable: [{ type: i0.ViewChild, args: ['cdkTable', { isSignal: true }] }] } });
|
|
988
1136
|
|
|
989
1137
|
/**
|