@su-labs/tree-table 21.0.1 → 22.0.1

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.
@@ -1,386 +1,857 @@
1
- import { SuTreeTableController, SU_TREE_TABLE_LABELS } from '@su-labs/core/tree-table';
2
- export { SU_TREE_TABLE_LABELS } from '@su-labs/core/tree-table';
3
- import { SuTableCellDirective, SuTablePaginatorComponent, SuTablePinDirective, SuTableToolbarComponent } from '@su-labs/table';
4
- export { SuTableCellDirective } from '@su-labs/table';
5
- import { NgTemplateOutlet } from '@angular/common';
6
- import * as i0 from '@angular/core';
7
- import { ChangeDetectionStrategy, Component, input, output, booleanAttribute, inject, ElementRef, contentChildren, signal, computed, DestroyRef, effect, untracked, afterRenderEffect } from '@angular/core';
8
- import { suPinOffsets } from '@su-labs/core/table';
9
-
10
- /** The pin drawn on pinned columns and pin buttons, as in `@su-labs/table`: `<svg suTreeTablePinIcon></svg>` */
11
- class SuTreeTablePinIconComponent {
12
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTablePinIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
13
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.26", type: SuTreeTablePinIconComponent, isStandalone: true, selector: "svg[suTreeTablePinIcon]", host: { attributes: { "viewBox": "0 0 16 16", "aria-hidden": "true", "fill": "currentColor" } }, ngImport: i0, template: `<svg:path
14
- d="M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z" />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
15
- }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTablePinIconComponent, decorators: [{
17
- type: Component,
18
- args: [{
19
- selector: 'svg[suTreeTablePinIcon]',
20
- changeDetection: ChangeDetectionStrategy.OnPush,
21
- host: { viewBox: '0 0 16 16', 'aria-hidden': 'true', fill: 'currentColor' },
22
- template: `<svg:path
1
+ import { SU_TREE_TABLE_LABELS, SU_TREE_TABLE_LABELS as SU_TREE_TABLE_LABELS$1, SuTreeTableController } from "@su-labs/core/tree-table";
2
+ import { SuTableCellDirective, SuTableCellDirective as SuTableCellDirective$1, SuTablePaginatorComponent, SuTablePinDirective, SuTableToolbarComponent } from "@su-labs/table";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import * as i0 from "@angular/core";
5
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, afterRenderEffect, booleanAttribute, computed, contentChildren, effect, inject, input, output, signal, untracked } from "@angular/core";
6
+ import { suPinOffsets } from "@su-labs/core/table";
7
+ var SuTreeTablePinIconComponent = class SuTreeTablePinIconComponent {
8
+ static ɵfac = i0.ɵɵngDeclareFactory({
9
+ minVersion: "12.0.0",
10
+ version: "22.2.4",
11
+ ngImport: i0,
12
+ type: SuTreeTablePinIconComponent,
13
+ deps: [],
14
+ target: i0.ɵɵFactoryTarget.Component
15
+ });
16
+ static ɵcmp = i0.ɵɵngDeclareComponent({
17
+ minVersion: "14.0.0",
18
+ version: "22.2.4",
19
+ type: SuTreeTablePinIconComponent,
20
+ isStandalone: true,
21
+ selector: "svg[suTreeTablePinIcon]",
22
+ host: { attributes: {
23
+ "viewBox": "0 0 16 16",
24
+ "aria-hidden": "true",
25
+ "fill": "currentColor"
26
+ } },
27
+ ngImport: i0,
28
+ template: `<svg:path
23
29
  d="M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z" />`,
24
- }]
25
- }] });
26
-
27
- /** A row's open and close button, or the room for one on a row without children, so every row's text lines up */
28
- class SuTreeTableToggleComponent {
29
- /** Whether the row's children show; null for a row without children */
30
- expanded = input.required(...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
31
- /** The button's name, e.g. “Expand Fruit” */
32
- label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
33
- toggle = output();
34
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTableToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
35
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: SuTreeTableToggleComponent, isStandalone: true, selector: "su-lib-tree-table-toggle", inputs: { expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { toggle: "toggle" }, ngImport: i0, template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n", styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
36
- }
37
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTableToggleComponent, decorators: [{
38
- type: Component,
39
- args: [{ selector: 'su-lib-tree-table-toggle', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n", styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"] }]
40
- }], propDecorators: { expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], toggle: [{ type: i0.Output, args: ["toggle"] }] } });
41
-
30
+ isInline: true,
31
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
32
+ });
33
+ };
34
+ i0.ɵɵngDeclareClassMetadata({
35
+ minVersion: "12.0.0",
36
+ version: "22.2.4",
37
+ ngImport: i0,
38
+ type: SuTreeTablePinIconComponent,
39
+ decorators: [{
40
+ type: Component,
41
+ args: [{
42
+ selector: "svg[suTreeTablePinIcon]",
43
+ changeDetection: ChangeDetectionStrategy.OnPush,
44
+ host: {
45
+ viewBox: "0 0 16 16",
46
+ "aria-hidden": "true",
47
+ fill: "currentColor"
48
+ },
49
+ template: `<svg:path
50
+ d="M10 1.5 14.5 6l-1.6 1.6-1-.3-2.4 2.4.2 2.8-1.3 1.3L6 11 2.5 14.5 1.5 13.5 5 10 2.2 7.6l1.3-1.3 2.8.2 2.4-2.4-.3-1z" />`
51
+ }]
52
+ }]
53
+ });
54
+ var SuTreeTableToggleComponent = class SuTreeTableToggleComponent {
55
+ expanded = input.required(...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
56
+ label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
57
+ toggle = output();
58
+ static ɵfac = i0.ɵɵngDeclareFactory({
59
+ minVersion: "12.0.0",
60
+ version: "22.2.4",
61
+ ngImport: i0,
62
+ type: SuTreeTableToggleComponent,
63
+ deps: [],
64
+ target: i0.ɵɵFactoryTarget.Component
65
+ });
66
+ static ɵcmp = i0.ɵɵngDeclareComponent({
67
+ minVersion: "17.0.0",
68
+ version: "22.2.4",
69
+ type: SuTreeTableToggleComponent,
70
+ isStandalone: true,
71
+ selector: "su-lib-tree-table-toggle",
72
+ inputs: {
73
+ expanded: {
74
+ classPropertyName: "expanded",
75
+ publicName: "expanded",
76
+ isSignal: true,
77
+ isRequired: true,
78
+ transformFunction: null
79
+ },
80
+ label: {
81
+ classPropertyName: "label",
82
+ publicName: "label",
83
+ isSignal: true,
84
+ isRequired: true,
85
+ transformFunction: null
86
+ }
87
+ },
88
+ outputs: { toggle: "toggle" },
89
+ ngImport: i0,
90
+ template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n",
91
+ styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"],
92
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
93
+ });
94
+ };
95
+ i0.ɵɵngDeclareClassMetadata({
96
+ minVersion: "12.0.0",
97
+ version: "22.2.4",
98
+ ngImport: i0,
99
+ type: SuTreeTableToggleComponent,
100
+ decorators: [{
101
+ type: Component,
102
+ args: [{
103
+ selector: "su-lib-tree-table-toggle",
104
+ changeDetection: ChangeDetectionStrategy.OnPush,
105
+ template: "@if (expanded() !== null) {\n <button\n type=\"button\"\n tabindex=\"-1\"\n class=\"su-tree-table-toggle\"\n [class.is-expanded]=\"expanded()\"\n [attr.aria-label]=\"label()\"\n (click)=\"toggle.emit()\"\n >\n <span class=\"su-tree-table-chevron\" aria-hidden=\"true\"></span>\n </button>\n}\n",
106
+ styles: [":host{display:inline-flex;flex:none;height:var(--su-tree-table-toggle-size, 1.5rem);margin-inline-end:var(--su-tree-table-toggle-gap, .25rem);vertical-align:middle;width:var(--su-tree-table-toggle-size, 1.5rem)}.su-tree-table-toggle{align-items:center;background:transparent;border:none;border-radius:var(--su-tree-table-toggle-radius, 6px);color:var(--su-tree-table-toggle-color, inherit);cursor:pointer;display:inline-flex;height:100%;justify-content:center;padding:0;width:100%}.su-tree-table-toggle:hover{background:var(--su-tree-table-toggle-hover-background, color-mix(in srgb, currentColor 10%, transparent))}.su-tree-table-chevron{border-block-start:2px solid currentColor;border-inline-end:2px solid currentColor;height:.45rem;transform:rotate(45deg);width:.45rem}.su-tree-table-chevron:dir(rtl){transform:rotate(-45deg)}.is-expanded .su-tree-table-chevron{transform:rotate(135deg)}@media(prefers-reduced-motion:no-preference){.su-tree-table-chevron{transition:transform .15s ease}}\n"]
107
+ }]
108
+ }],
109
+ propDecorators: {
110
+ expanded: [{
111
+ type: i0.Input,
112
+ args: [{
113
+ isSignal: true,
114
+ alias: "expanded",
115
+ required: true
116
+ }]
117
+ }],
118
+ label: [{
119
+ type: i0.Input,
120
+ args: [{
121
+ isSignal: true,
122
+ alias: "label",
123
+ required: true
124
+ }]
125
+ }],
126
+ toggle: [{
127
+ type: i0.Output,
128
+ args: ["toggle"]
129
+ }]
130
+ }
131
+ });
42
132
  let nextTreeTableId = 0;
43
- /** The room, in pixels, the pinned columns leave for the scrolling ones before they stop sticking */
44
133
  const MIN_SCROLLING_WIDTH = 96;
45
- /** How long typing pauses, in milliseconds, before the search runs */
46
134
  const SEARCH_DELAY = 200;
47
- /**
48
- * An accessible tree table (`role="treegrid"`) over `SuTreeTableController` from `@su-labs/core/tree-table`: rows
49
- * with child rows that open and close, data or group parents, numbering, merged cells, and the table's sorting,
50
- * search, paging, pinned rows and columns, Columns menu and `--su-table-*` theming.
51
- */
52
- class SuTreeTableComponent {
53
- columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
54
- /** The top-level rows, each with its children */
55
- rows = input.required(...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
56
- /** The table's name for screen readers, shown as its caption */
57
- caption = input.required(...(ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []));
58
- /** Shows the caption on screen too @default false */
59
- showCaption = input(false, { ...(ngDevMode ? { debugName: "showCaption" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
60
- /** The row's identity, e.g. the API's id; keeps open rows and pins across new rows */
61
- rowId = input(...(ngDevMode ? [undefined, { debugName: "rowId" }] : /* istanbul ignore next */ []));
62
- /** A row's child rows, e.g. `(item) => item.children`; a row without any is a leaf */
63
- children = input(...(ngDevMode ? [undefined, { debugName: "children" }] : /* istanbul ignore next */ []));
64
- /** Which rows are group rows, a heading across the table over their children; every row is a data row by default */
65
- rowKind = input(...(ngDevMode ? [undefined, { debugName: "rowKind" }] : /* istanbul ignore next */ []));
66
- /** A group row's text; by default the first column's text */
67
- groupLabel = input(...(ngDevMode ? [undefined, { debugName: "groupLabel" }] : /* istanbul ignore next */ []));
68
- /** The rows open to start with, or `true` for every one @default false */
69
- expanded = input(...(ngDevMode ? [undefined, { debugName: "expanded" }] : /* istanbul ignore next */ []));
70
- /** A first column with each row's number @default false */
71
- numbered = input(false, { ...(ngDevMode ? { debugName: "numbered" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
72
- /** How children are numbered, for every parent or per parent: `nested` (1.1), `restart` or `continue` @default 'nested' */
73
- numbering = input(...(ngDevMode ? [undefined, { debugName: "numbering" }] : /* istanbul ignore next */ []));
74
- /** Rows left without a number, that don't count, e.g. `(row) => row.isGroup` */
75
- unnumbered = input(...(ngDevMode ? [undefined, { debugName: "unnumbered" }] : /* istanbul ignore next */ []));
76
- /** A Columns button with a menu to show or hide columns and the pin in their headings @default false */
77
- columnControls = input(false, { ...(ngDevMode ? { debugName: "columnControls" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
78
- /** A search box above the table; a match keeps its parents on view @default false */
79
- searchable = input(false, { ...(ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
80
- /** The most the table grows before it scrolls inside, any CSS length; the header and pinned rows stay in view */
81
- maxHeight = input(...(ngDevMode ? [undefined, { debugName: "maxHeight" }] : /* istanbul ignore next */ []));
82
- /** Extra classes for a row; the table styles `is-muted` and `is-highlighted` */
83
- rowClass = input(...(ngDevMode ? [undefined, { debugName: "rowClass" }] : /* istanbul ignore next */ []));
84
- /** Top-level rows per page, each with its children; without it, every row shows @default 'all' */
85
- pageSize = input(...(ngDevMode ? [undefined, { debugName: "pageSize" }] : /* istanbul ignore next */ []));
86
- /** The page sizes people choose from under the table, e.g. `[10, 25, 'all']` */
87
- pageSizes = input([], ...(ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []));
88
- /** A Pin button on each top-level row, keeping it and its children above the others on every page @default false */
89
- rowPinning = input(false, { ...(ngDevMode ? { debugName: "rowPinning" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
90
- /** The ids of the top-level rows pinned to start with */
91
- pinnedRows = input(...(ngDevMode ? [undefined, { debugName: "pinnedRows" }] : /* istanbul ignore next */ []));
92
- /** Texts to replace, e.g. in the page's language */
93
- labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
94
- toggled = output();
95
- sortChange = output();
96
- /** The search changed, after typing paused */
97
- searchChange = output();
98
- /** The pinned rows changed: their ids, in pin order */
99
- pinnedRowsChange = output();
100
- /** A column was shown, hidden, pinned or unpinned: every column's state, e.g. to save it */
101
- columnsChange = output();
102
- pageChange = output();
103
- controller = new SuTreeTableController();
104
- host = inject(ElementRef);
105
- cellTemplates = contentChildren(SuTableCellDirective, ...(ngDevMode ? [{ debugName: "cellTemplates" }] : /* istanbul ignore next */ []));
106
- /** The row to move the focus to once it renders, after a key press */
107
- focusTarget = signal(null, ...(ngDevMode ? [{ debugName: "focusTarget" }] : /* istanbul ignore next */ []));
108
- searchTimer;
109
- headerWidths = signal([], ...(ngDevMode ? [{ debugName: "headerWidths" }] : /* istanbul ignore next */ []));
110
- scrollerWidth = signal(0, ...(ngDevMode ? [{ debugName: "scrollerWidth" }] : /* istanbul ignore next */ []));
111
- headerHeight = signal(0, ...(ngDevMode ? [{ debugName: "headerHeight" }] : /* istanbul ignore next */ []));
112
- pinnedRowHeights = signal([], ...(ngDevMode ? [{ debugName: "pinnedRowHeights" }] : /* istanbul ignore next */ []));
113
- headerLayout = computed(() => `${this.state()
114
- .columns.map(column => `${String(column.key)}:${column.pinned}`)
115
- .join()}|${this.numbered()}|${this.rowPinning()}|${this.state()
116
- .pinnedRows.map(row => row.id)
117
- .join()}`, ...(ngDevMode ? [{ debugName: "headerLayout" }] : /* istanbul ignore next */ []));
118
- tableId = `su-tree-table-${nextTreeTableId++}`;
119
- state = signal(this.controller.state.get(), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
120
- text = computed(() => ({
121
- ...SU_TREE_TABLE_LABELS,
122
- ...this.labels(),
123
- }), ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
124
- /** The pinned rows, then the current page */
125
- bodyRows = computed(() => {
126
- const { pinnedRows, rows } = this.state();
127
- return [...pinnedRows, ...rows];
128
- }, ...(ngDevMode ? [{ debugName: "bodyRows" }] : /* istanbul ignore next */ []));
129
- /** The one row in the tab order: the last one focused while it's on screen, else the first */
130
- activeRowId = signal(null, ...(ngDevMode ? [{ debugName: "activeRowId" }] : /* istanbul ignore next */ []));
131
- tabRowId = computed(() => {
132
- const rows = this.bodyRows();
133
- const active = this.activeRowId();
134
- return rows.some(row => row.id === active) ? active : (rows[0]?.id ?? null);
135
- }, ...(ngDevMode ? [{ debugName: "tabRowId" }] : /* istanbul ignore next */ []));
136
- scrolledFromStart = signal(false, ...(ngDevMode ? [{ debugName: "scrolledFromStart" }] : /* istanbul ignore next */ []));
137
- moreAtEnd = signal(false, ...(ngDevMode ? [{ debugName: "moreAtEnd" }] : /* istanbul ignore next */ []));
138
- scrolledFromTop = signal(false, ...(ngDevMode ? [{ debugName: "scrolledFromTop" }] : /* istanbul ignore next */ []));
139
- /** Where each pinned row sticks: under the header and the pinned rows above it */
140
- pinnedRowTops = computed(() => {
141
- let top = this.headerHeight();
142
- return this.pinnedRowHeights().map(height => {
143
- const rowTop = top;
144
- top += height;
145
- return rowTop;
146
- });
147
- }, ...(ngDevMode ? [{ debugName: "pinnedRowTops" }] : /* istanbul ignore next */ []));
148
- columnSlot = computed(() => Number(this.numbered()), ...(ngDevMode ? [{ debugName: "columnSlot" }] : /* istanbul ignore next */ []));
149
- /**
150
- * Where each header slot sticks, in order: the numbers, the columns and the pin buttons. The numbers stay with
151
- * columns pinned to the start, the pin buttons with columns pinned to the end.
152
- */
153
- placements = computed(() => {
154
- const columns = this.state().columns;
155
- const numberPin = columns.some(column => column.pinned === 'start')
156
- ? 'start'
157
- : null;
158
- const actionsPin = columns.some(column => column.pinned === 'end')
159
- ? 'end'
160
- : null;
161
- return suPinOffsets([
162
- ...(this.numbered() ? [numberPin] : []),
163
- ...columns.map(column => column.pinned),
164
- ...(this.rowPinning() ? [actionsPin] : []),
165
- ], this.headerWidths(), this.scrollerWidth(), MIN_SCROLLING_WIDTH);
166
- }, ...(ngDevMode ? [{ debugName: "placements" }] : /* istanbul ignore next */ []));
167
- columnCount = computed(() => this.state().columns.length +
168
- Number(this.numbered()) +
169
- Number(this.rowPinning()), ...(ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []));
170
- constructor() {
171
- const unsubscribe = this.controller.state.subscribe(state => this.state.set(state));
172
- inject(DestroyRef).onDestroy(() => {
173
- unsubscribe();
174
- clearTimeout(this.searchTimer);
175
- });
176
- effect(() => {
177
- const options = {
178
- columns: this.columns(),
179
- rowId: this.rowId(),
180
- children: this.children(),
181
- rowKind: this.rowKind(),
182
- groupLabel: this.groupLabel(),
183
- numbering: this.numbering(),
184
- unnumbered: this.unnumbered(),
185
- labels: this.labels(),
186
- pageSizes: this.pageSizes(),
187
- };
188
- untracked(() => this.controller.configure(options));
189
- });
190
- effect(() => {
191
- const rows = this.rows();
192
- untracked(() => this.controller.setRows(rows));
193
- });
194
- effect(() => {
195
- const expanded = this.expanded();
196
- if (expanded !== undefined) {
197
- untracked(() => this.controller.configure({ expanded }));
198
- }
199
- });
200
- effect(() => {
201
- const pinnedRows = this.pinnedRows();
202
- if (pinnedRows !== undefined) {
203
- untracked(() => this.controller.configure({ pinnedRows }));
204
- }
205
- });
206
- effect(() => {
207
- const pageSize = this.pageSize();
208
- if (pageSize !== undefined) {
209
- untracked(() => this.controller.configure({ pageSize }));
210
- }
211
- });
212
- afterRenderEffect(onCleanup => {
213
- this.headerLayout();
214
- if (typeof ResizeObserver === 'undefined') {
215
- return;
216
- }
217
- const host = this.host.nativeElement;
218
- const scroller = host.querySelector('.su-table-scroll');
219
- const headers = [...host.querySelectorAll('thead th')];
220
- const head = host.querySelector('thead');
221
- const pinnedRows = [
222
- ...host.querySelectorAll('tbody > tr.is-pinned-row'),
223
- ];
224
- const observer = new ResizeObserver(() => {
225
- this.headerHeight.set(head?.getBoundingClientRect().height ?? 0);
226
- const heights = pinnedRows.map(row => row.getBoundingClientRect().height);
227
- const currentHeights = untracked(() => this.pinnedRowHeights());
228
- if (heights.length !== currentHeights.length ||
229
- heights.some((height, index) => height !== currentHeights[index])) {
230
- this.pinnedRowHeights.set(heights);
231
- }
232
- const widths = headers.map(header => header.getBoundingClientRect().width);
233
- const current = untracked(() => this.headerWidths());
234
- if (widths.length !== current.length ||
235
- widths.some((width, index) => width !== current[index])) {
236
- this.headerWidths.set(widths);
237
- }
238
- if (scroller) {
239
- this.scrollerWidth.set(scroller.clientWidth);
240
- this.updateScrollEdges(scroller);
241
- }
242
- });
243
- [...headers, ...pinnedRows].forEach(element => observer.observe(element));
244
- if (scroller) {
245
- observer.observe(scroller);
246
- }
247
- onCleanup(() => observer.disconnect());
248
- });
249
- afterRenderEffect(() => {
250
- const id = this.focusTarget();
251
- this.state();
252
- if (id === null) {
253
- return;
254
- }
255
- const row = this.rowElement(id);
256
- if (row) {
257
- row.focus();
258
- this.focusTarget.set(null);
259
- }
260
- });
261
- }
262
- cellTemplate(key) {
263
- return (this.cellTemplates().find(cell => cell.key() === String(key))?.template ??
264
- null);
265
- }
266
- rowClassOf(row) {
267
- return this.rowClass()?.(row.data) ?? null;
268
- }
269
- toggle(row) {
270
- this.activeRowId.set(row.id);
271
- this.controller.toggle(row.id);
272
- this.emitToggle(row);
273
- }
274
- /** Keys on the focused row itself move between rows and open or close them; keys on its buttons stay theirs */
275
- onRowKey(event, row) {
276
- if (event.target !== event.currentTarget) {
277
- return;
278
- }
279
- const before = row.expanded;
280
- const result = this.controller.rowKey(row.id, event.key);
281
- if (!result.handled) {
282
- return;
283
- }
284
- event.preventDefault();
285
- this.activeRowId.set(result.focusId);
286
- this.focusTarget.set(result.focusId);
287
- if (this.controller.isExpanded(row.id) !== before && before !== null) {
288
- this.emitToggle(row);
289
- }
290
- }
291
- onRowFocus(id) {
292
- this.activeRowId.set(id);
293
- }
294
- /** The pin in a heading unpins its column, or pins it back to the side it was set up with (by default the start) */
295
- toggleColumnPin(key, pinned) {
296
- const setUpPin = this.columns().find(column => column.key === key)?.pinned;
297
- this.controller.pinColumn(key, pinned ? null : (setUpPin ?? 'start'));
298
- this.columnsChange.emit(this.state().allColumns);
299
- }
300
- setColumnPinnable({ key, pinnable, }) {
301
- this.controller.setColumnPinnable(key, pinnable);
302
- this.columnsChange.emit(this.state().allColumns);
303
- }
304
- setColumnsVisible(visible) {
305
- this.controller.setColumnsVisible(visible);
306
- this.columnsChange.emit(this.state().allColumns);
307
- }
308
- setColumnVisible({ key, visible, }) {
309
- this.controller.setColumnVisible(key, visible);
310
- this.columnsChange.emit(this.state().allColumns);
311
- }
312
- /** Narrows the rows once typing pauses, so each keystroke isn't announced */
313
- search(query) {
314
- clearTimeout(this.searchTimer);
315
- this.searchTimer = setTimeout(() => {
316
- this.controller.search(query);
317
- this.searchChange.emit(query);
318
- }, SEARCH_DELAY);
319
- }
320
- onScroll(event) {
321
- if (event.target instanceof HTMLElement) {
322
- this.updateScrollEdges(event.target);
323
- }
324
- }
325
- sortBy(key) {
326
- this.controller.sortBy(key);
327
- this.sortChange.emit(this.state().sort);
328
- }
329
- pinRow(id) {
330
- this.controller.pinRow(id);
331
- this.pinnedRowsChange.emit(this.state()
332
- .pinnedRows.filter(row => row.level === 1)
333
- .map(row => row.id));
334
- }
335
- setPage(page) {
336
- this.controller.setPage(page);
337
- this.emitPage();
338
- }
339
- setPageSize(pageSize) {
340
- this.controller.setPageSize(pageSize);
341
- this.emitPage();
342
- }
343
- rowElement(id) {
344
- return ([
345
- ...this.host.nativeElement.querySelectorAll('tbody > tr[data-su-tree-row]'),
346
- ].find(row => row.dataset['suTreeRow'] === String(id)) ?? null);
347
- }
348
- emitToggle(row) {
349
- this.toggled.emit({
350
- row: row.data,
351
- expanded: this.controller.isExpanded(row.id),
352
- expandedIds: this.controller.expandedIds(),
353
- });
354
- }
355
- /** Shadows show on the pinned edges only while columns or rows are scrolled under them */
356
- updateScrollEdges(scroller) {
357
- this.scrolledFromTop.set(scroller.scrollTop > 1);
358
- const position = Math.abs(scroller.scrollLeft);
359
- this.scrolledFromStart.set(position > 1);
360
- this.moreAtEnd.set(position < scroller.scrollWidth - scroller.clientWidth - 1);
361
- }
362
- emitPage() {
363
- const { page, pageSize } = this.state().pagination;
364
- this.pageChange.emit({ page, pageSize });
365
- }
366
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
367
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: SuTreeTableComponent, isStandalone: true, selector: "su-lib-tree-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: true, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: true, transformFunction: null }, showCaption: { classPropertyName: "showCaption", publicName: "showCaption", isSignal: true, isRequired: false, transformFunction: null }, rowId: { classPropertyName: "rowId", publicName: "rowId", isSignal: true, isRequired: false, transformFunction: null }, children: { classPropertyName: "children", publicName: "children", isSignal: true, isRequired: false, transformFunction: null }, rowKind: { classPropertyName: "rowKind", publicName: "rowKind", isSignal: true, isRequired: false, transformFunction: null }, groupLabel: { classPropertyName: "groupLabel", publicName: "groupLabel", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, numbered: { classPropertyName: "numbered", publicName: "numbered", isSignal: true, isRequired: false, transformFunction: null }, numbering: { classPropertyName: "numbering", publicName: "numbering", isSignal: true, isRequired: false, transformFunction: null }, unnumbered: { classPropertyName: "unnumbered", publicName: "unnumbered", isSignal: true, isRequired: false, transformFunction: null }, columnControls: { classPropertyName: "columnControls", publicName: "columnControls", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizes: { classPropertyName: "pageSizes", publicName: "pageSizes", isSignal: true, isRequired: false, transformFunction: null }, rowPinning: { classPropertyName: "rowPinning", publicName: "rowPinning", isSignal: true, isRequired: false, transformFunction: null }, pinnedRows: { classPropertyName: "pinnedRows", publicName: "pinnedRows", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggled: "toggled", sortChange: "sortChange", searchChange: "searchChange", pinnedRowsChange: "pinnedRowsChange", columnsChange: "columnsChange", pageChange: "pageChange" }, host: { classAttribute: "su-tree-table" }, queries: [{ propertyName: "cellTemplates", predicate: SuTableCellDirective, isSignal: true }], ngImport: i0, template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n", styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var( --su-table-stripe-background, var(--su-table-row-background, transparent) )}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var( --su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent) )}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var( --su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent) );color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var( --su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent) )}tbody tr.is-pinned-row{--su-table-row-tint: var( --su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent) )}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SuTablePaginatorComponent, selector: "su-lib-table-paginator", inputs: ["pagination", "labels", "controlId"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "directive", type: SuTablePinDirective, selector: "[suTablePin]", inputs: ["suTablePin"] }, { kind: "component", type: SuTableToolbarComponent, selector: "su-lib-table-toolbar", inputs: ["labels", "controlId", "searchable", "query", "columnControls", "columns"], outputs: ["queryChange", "pinnableChange", "visibilityChange", "allVisibilityChange"] }, { kind: "component", type: SuTreeTablePinIconComponent, selector: "svg[suTreeTablePinIcon]" }, { kind: "component", type: SuTreeTableToggleComponent, selector: "su-lib-tree-table-toggle", inputs: ["expanded", "label"], outputs: ["toggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
368
- }
369
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuTreeTableComponent, decorators: [{
370
- type: Component,
371
- args: [{ selector: 'su-lib-tree-table', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
372
- NgTemplateOutlet,
373
- SuTablePaginatorComponent,
374
- SuTablePinDirective,
375
- SuTableToolbarComponent,
376
- SuTreeTablePinIconComponent,
377
- SuTreeTableToggleComponent,
378
- ], host: { class: 'su-tree-table' }, template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n", styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var( --su-table-stripe-background, var(--su-table-row-background, transparent) )}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var( --su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent) )}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var( --su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent) );color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var( --su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent) )}tbody tr.is-pinned-row{--su-table-row-tint: var( --su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent) )}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"] }]
379
- }], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: true }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: true }] }], showCaption: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCaption", required: false }] }], rowId: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowId", required: false }] }], children: [{ type: i0.Input, args: [{ isSignal: true, alias: "children", required: false }] }], rowKind: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowKind", required: false }] }], groupLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupLabel", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], numbered: [{ type: i0.Input, args: [{ isSignal: true, alias: "numbered", required: false }] }], numbering: [{ type: i0.Input, args: [{ isSignal: true, alias: "numbering", required: false }] }], unnumbered: [{ type: i0.Input, args: [{ isSignal: true, alias: "unnumbered", required: false }] }], columnControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnControls", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], rowClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowClass", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], pageSizes: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizes", required: false }] }], rowPinning: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowPinning", required: false }] }], pinnedRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedRows", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], toggled: [{ type: i0.Output, args: ["toggled"] }], sortChange: [{ type: i0.Output, args: ["sortChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }], pinnedRowsChange: [{ type: i0.Output, args: ["pinnedRowsChange"] }], columnsChange: [{ type: i0.Output, args: ["columnsChange"] }], pageChange: [{ type: i0.Output, args: ["pageChange"] }], cellTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SuTableCellDirective), { isSignal: true }] }] } });
380
-
381
- /**
382
- * Generated bundle index. Do not edit.
383
- */
135
+ var SuTreeTableComponent = class SuTreeTableComponent {
136
+ columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
137
+ rows = input.required(...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
138
+ caption = input.required(...ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []);
139
+ showCaption = input(false, {
140
+ ...ngDevMode ? { debugName: "showCaption" } : /* istanbul ignore next */ {},
141
+ transform: booleanAttribute
142
+ });
143
+ rowId = input(...ngDevMode ? [void 0, { debugName: "rowId" }] : /* istanbul ignore next */ []);
144
+ children = input(...ngDevMode ? [void 0, { debugName: "children" }] : /* istanbul ignore next */ []);
145
+ rowKind = input(...ngDevMode ? [void 0, { debugName: "rowKind" }] : /* istanbul ignore next */ []);
146
+ groupLabel = input(...ngDevMode ? [void 0, { debugName: "groupLabel" }] : /* istanbul ignore next */ []);
147
+ expanded = input(...ngDevMode ? [void 0, { debugName: "expanded" }] : /* istanbul ignore next */ []);
148
+ numbered = input(false, {
149
+ ...ngDevMode ? { debugName: "numbered" } : /* istanbul ignore next */ {},
150
+ transform: booleanAttribute
151
+ });
152
+ numbering = input(...ngDevMode ? [void 0, { debugName: "numbering" }] : /* istanbul ignore next */ []);
153
+ unnumbered = input(...ngDevMode ? [void 0, { debugName: "unnumbered" }] : /* istanbul ignore next */ []);
154
+ columnControls = input(false, {
155
+ ...ngDevMode ? { debugName: "columnControls" } : /* istanbul ignore next */ {},
156
+ transform: booleanAttribute
157
+ });
158
+ searchable = input(false, {
159
+ ...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
160
+ transform: booleanAttribute
161
+ });
162
+ maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
163
+ rowClass = input(...ngDevMode ? [void 0, { debugName: "rowClass" }] : /* istanbul ignore next */ []);
164
+ pageSize = input(...ngDevMode ? [void 0, { debugName: "pageSize" }] : /* istanbul ignore next */ []);
165
+ pageSizes = input([], ...ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []);
166
+ rowPinning = input(false, {
167
+ ...ngDevMode ? { debugName: "rowPinning" } : /* istanbul ignore next */ {},
168
+ transform: booleanAttribute
169
+ });
170
+ pinnedRows = input(...ngDevMode ? [void 0, { debugName: "pinnedRows" }] : /* istanbul ignore next */ []);
171
+ labels = input({}, ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
172
+ toggled = output();
173
+ sortChange = output();
174
+ searchChange = output();
175
+ pinnedRowsChange = output();
176
+ columnsChange = output();
177
+ pageChange = output();
178
+ controller = new SuTreeTableController();
179
+ host = inject(ElementRef);
180
+ cellTemplates = contentChildren(SuTableCellDirective$1, ...ngDevMode ? [{ debugName: "cellTemplates" }] : /* istanbul ignore next */ []);
181
+ focusTarget = signal(null, ...ngDevMode ? [{ debugName: "focusTarget" }] : /* istanbul ignore next */ []);
182
+ searchTimer;
183
+ headerWidths = signal([], ...ngDevMode ? [{ debugName: "headerWidths" }] : /* istanbul ignore next */ []);
184
+ scrollerWidth = signal(0, ...ngDevMode ? [{ debugName: "scrollerWidth" }] : /* istanbul ignore next */ []);
185
+ headerHeight = signal(0, ...ngDevMode ? [{ debugName: "headerHeight" }] : /* istanbul ignore next */ []);
186
+ pinnedRowHeights = signal([], ...ngDevMode ? [{ debugName: "pinnedRowHeights" }] : /* istanbul ignore next */ []);
187
+ headerLayout = computed(() => `${this.state().columns.map((column) => `${String(column.key)}:${column.pinned}`).join()}|${this.numbered()}|${this.rowPinning()}|${this.state().pinnedRows.map((row) => row.id).join()}`, ...ngDevMode ? [{ debugName: "headerLayout" }] : /* istanbul ignore next */ []);
188
+ tableId = `su-tree-table-${nextTreeTableId++}`;
189
+ state = signal(this.controller.state.get(), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
190
+ text = computed(() => ({
191
+ ...SU_TREE_TABLE_LABELS$1,
192
+ ...this.labels()
193
+ }), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
194
+ bodyRows = computed(() => {
195
+ const { pinnedRows, rows } = this.state();
196
+ return [...pinnedRows, ...rows];
197
+ }, ...ngDevMode ? [{ debugName: "bodyRows" }] : /* istanbul ignore next */ []);
198
+ activeRowId = signal(null, ...ngDevMode ? [{ debugName: "activeRowId" }] : /* istanbul ignore next */ []);
199
+ tabRowId = computed(() => {
200
+ const rows = this.bodyRows();
201
+ const active = this.activeRowId();
202
+ return rows.some((row) => row.id === active) ? active : rows[0]?.id ?? null;
203
+ }, ...ngDevMode ? [{ debugName: "tabRowId" }] : /* istanbul ignore next */ []);
204
+ scrolledFromStart = signal(false, ...ngDevMode ? [{ debugName: "scrolledFromStart" }] : /* istanbul ignore next */ []);
205
+ moreAtEnd = signal(false, ...ngDevMode ? [{ debugName: "moreAtEnd" }] : /* istanbul ignore next */ []);
206
+ scrolledFromTop = signal(false, ...ngDevMode ? [{ debugName: "scrolledFromTop" }] : /* istanbul ignore next */ []);
207
+ pinnedRowTops = computed(() => {
208
+ let top = this.headerHeight();
209
+ return this.pinnedRowHeights().map((height) => {
210
+ const rowTop = top;
211
+ top += height;
212
+ return rowTop;
213
+ });
214
+ }, ...ngDevMode ? [{ debugName: "pinnedRowTops" }] : /* istanbul ignore next */ []);
215
+ columnSlot = computed(() => Number(this.numbered()), ...ngDevMode ? [{ debugName: "columnSlot" }] : /* istanbul ignore next */ []);
216
+ placements = computed(() => {
217
+ const columns = this.state().columns;
218
+ const numberPin = columns.some((column) => column.pinned === "start") ? "start" : null;
219
+ const actionsPin = columns.some((column) => column.pinned === "end") ? "end" : null;
220
+ return suPinOffsets([
221
+ ...this.numbered() ? [numberPin] : [],
222
+ ...columns.map((column) => column.pinned),
223
+ ...this.rowPinning() ? [actionsPin] : []
224
+ ], this.headerWidths(), this.scrollerWidth(), MIN_SCROLLING_WIDTH);
225
+ }, ...ngDevMode ? [{ debugName: "placements" }] : /* istanbul ignore next */ []);
226
+ columnCount = computed(() => this.state().columns.length + Number(this.numbered()) + Number(this.rowPinning()), ...ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []);
227
+ constructor() {
228
+ const unsubscribe = this.controller.state.subscribe((state) => this.state.set(state));
229
+ inject(DestroyRef).onDestroy(() => {
230
+ unsubscribe();
231
+ clearTimeout(this.searchTimer);
232
+ });
233
+ effect(() => {
234
+ const options = {
235
+ columns: this.columns(),
236
+ rowId: this.rowId(),
237
+ children: this.children(),
238
+ rowKind: this.rowKind(),
239
+ groupLabel: this.groupLabel(),
240
+ numbering: this.numbering(),
241
+ unnumbered: this.unnumbered(),
242
+ labels: this.labels(),
243
+ pageSizes: this.pageSizes()
244
+ };
245
+ untracked(() => this.controller.configure(options));
246
+ });
247
+ effect(() => {
248
+ const rows = this.rows();
249
+ untracked(() => this.controller.setRows(rows));
250
+ });
251
+ effect(() => {
252
+ const expanded = this.expanded();
253
+ if (expanded !== void 0) untracked(() => this.controller.configure({ expanded }));
254
+ });
255
+ effect(() => {
256
+ const pinnedRows = this.pinnedRows();
257
+ if (pinnedRows !== void 0) untracked(() => this.controller.configure({ pinnedRows }));
258
+ });
259
+ effect(() => {
260
+ const pageSize = this.pageSize();
261
+ if (pageSize !== void 0) untracked(() => this.controller.configure({ pageSize }));
262
+ });
263
+ afterRenderEffect((onCleanup) => {
264
+ this.headerLayout();
265
+ if (typeof ResizeObserver === "undefined") return;
266
+ const host = this.host.nativeElement;
267
+ const scroller = host.querySelector(".su-table-scroll");
268
+ const headers = [...host.querySelectorAll("thead th")];
269
+ const head = host.querySelector("thead");
270
+ const pinnedRows = [...host.querySelectorAll("tbody > tr.is-pinned-row")];
271
+ const observer = new ResizeObserver(() => {
272
+ this.headerHeight.set(head?.getBoundingClientRect().height ?? 0);
273
+ const heights = pinnedRows.map((row) => row.getBoundingClientRect().height);
274
+ const currentHeights = untracked(() => this.pinnedRowHeights());
275
+ if (heights.length !== currentHeights.length || heights.some((height, index) => height !== currentHeights[index])) this.pinnedRowHeights.set(heights);
276
+ const widths = headers.map((header) => header.getBoundingClientRect().width);
277
+ const current = untracked(() => this.headerWidths());
278
+ if (widths.length !== current.length || widths.some((width, index) => width !== current[index])) this.headerWidths.set(widths);
279
+ if (scroller) {
280
+ this.scrollerWidth.set(scroller.clientWidth);
281
+ this.updateScrollEdges(scroller);
282
+ }
283
+ });
284
+ [...headers, ...pinnedRows].forEach((element) => observer.observe(element));
285
+ if (scroller) observer.observe(scroller);
286
+ onCleanup(() => observer.disconnect());
287
+ });
288
+ afterRenderEffect(() => {
289
+ const id = this.focusTarget();
290
+ this.state();
291
+ if (id === null) return;
292
+ const row = this.rowElement(id);
293
+ if (row) {
294
+ row.focus();
295
+ this.focusTarget.set(null);
296
+ }
297
+ });
298
+ }
299
+ cellTemplate(key) {
300
+ return this.cellTemplates().find((cell) => cell.key() === String(key))?.template ?? null;
301
+ }
302
+ rowClassOf(row) {
303
+ return this.rowClass()?.(row.data) ?? null;
304
+ }
305
+ toggle(row) {
306
+ this.activeRowId.set(row.id);
307
+ this.controller.toggle(row.id);
308
+ this.emitToggle(row);
309
+ }
310
+ onRowKey(event, row) {
311
+ if (event.target !== event.currentTarget) return;
312
+ const before = row.expanded;
313
+ const result = this.controller.rowKey(row.id, event.key);
314
+ if (!result.handled) return;
315
+ event.preventDefault();
316
+ this.activeRowId.set(result.focusId);
317
+ this.focusTarget.set(result.focusId);
318
+ if (this.controller.isExpanded(row.id) !== before && before !== null) this.emitToggle(row);
319
+ }
320
+ onRowFocus(id) {
321
+ this.activeRowId.set(id);
322
+ }
323
+ toggleColumnPin(key, pinned) {
324
+ const setUpPin = this.columns().find((column) => column.key === key)?.pinned;
325
+ this.controller.pinColumn(key, pinned ? null : setUpPin ?? "start");
326
+ this.columnsChange.emit(this.state().allColumns);
327
+ }
328
+ setColumnPinnable({ key, pinnable }) {
329
+ this.controller.setColumnPinnable(key, pinnable);
330
+ this.columnsChange.emit(this.state().allColumns);
331
+ }
332
+ setColumnsVisible(visible) {
333
+ this.controller.setColumnsVisible(visible);
334
+ this.columnsChange.emit(this.state().allColumns);
335
+ }
336
+ setColumnVisible({ key, visible }) {
337
+ this.controller.setColumnVisible(key, visible);
338
+ this.columnsChange.emit(this.state().allColumns);
339
+ }
340
+ search(query) {
341
+ clearTimeout(this.searchTimer);
342
+ this.searchTimer = setTimeout(() => {
343
+ this.controller.search(query);
344
+ this.searchChange.emit(query);
345
+ }, SEARCH_DELAY);
346
+ }
347
+ onScroll(event) {
348
+ if (event.target instanceof HTMLElement) this.updateScrollEdges(event.target);
349
+ }
350
+ sortBy(key) {
351
+ this.controller.sortBy(key);
352
+ this.sortChange.emit(this.state().sort);
353
+ }
354
+ pinRow(id) {
355
+ this.controller.pinRow(id);
356
+ this.pinnedRowsChange.emit(this.state().pinnedRows.filter((row) => row.level === 1).map((row) => row.id));
357
+ }
358
+ setPage(page) {
359
+ this.controller.setPage(page);
360
+ this.emitPage();
361
+ }
362
+ setPageSize(pageSize) {
363
+ this.controller.setPageSize(pageSize);
364
+ this.emitPage();
365
+ }
366
+ rowElement(id) {
367
+ return [...this.host.nativeElement.querySelectorAll("tbody > tr[data-su-tree-row]")].find((row) => row.dataset["suTreeRow"] === String(id)) ?? null;
368
+ }
369
+ emitToggle(row) {
370
+ this.toggled.emit({
371
+ row: row.data,
372
+ expanded: this.controller.isExpanded(row.id),
373
+ expandedIds: this.controller.expandedIds()
374
+ });
375
+ }
376
+ updateScrollEdges(scroller) {
377
+ this.scrolledFromTop.set(scroller.scrollTop > 1);
378
+ const position = Math.abs(scroller.scrollLeft);
379
+ this.scrolledFromStart.set(position > 1);
380
+ this.moreAtEnd.set(position < scroller.scrollWidth - scroller.clientWidth - 1);
381
+ }
382
+ emitPage() {
383
+ const { page, pageSize } = this.state().pagination;
384
+ this.pageChange.emit({
385
+ page,
386
+ pageSize
387
+ });
388
+ }
389
+ static ɵfac = i0.ɵɵngDeclareFactory({
390
+ minVersion: "12.0.0",
391
+ version: "22.2.4",
392
+ ngImport: i0,
393
+ type: SuTreeTableComponent,
394
+ deps: [],
395
+ target: i0.ɵɵFactoryTarget.Component
396
+ });
397
+ static ɵcmp = i0.ɵɵngDeclareComponent({
398
+ minVersion: "17.0.0",
399
+ version: "22.2.4",
400
+ type: SuTreeTableComponent,
401
+ isStandalone: true,
402
+ selector: "su-lib-tree-table",
403
+ inputs: {
404
+ columns: {
405
+ classPropertyName: "columns",
406
+ publicName: "columns",
407
+ isSignal: true,
408
+ isRequired: true,
409
+ transformFunction: null
410
+ },
411
+ rows: {
412
+ classPropertyName: "rows",
413
+ publicName: "rows",
414
+ isSignal: true,
415
+ isRequired: true,
416
+ transformFunction: null
417
+ },
418
+ caption: {
419
+ classPropertyName: "caption",
420
+ publicName: "caption",
421
+ isSignal: true,
422
+ isRequired: true,
423
+ transformFunction: null
424
+ },
425
+ showCaption: {
426
+ classPropertyName: "showCaption",
427
+ publicName: "showCaption",
428
+ isSignal: true,
429
+ isRequired: false,
430
+ transformFunction: null
431
+ },
432
+ rowId: {
433
+ classPropertyName: "rowId",
434
+ publicName: "rowId",
435
+ isSignal: true,
436
+ isRequired: false,
437
+ transformFunction: null
438
+ },
439
+ children: {
440
+ classPropertyName: "children",
441
+ publicName: "children",
442
+ isSignal: true,
443
+ isRequired: false,
444
+ transformFunction: null
445
+ },
446
+ rowKind: {
447
+ classPropertyName: "rowKind",
448
+ publicName: "rowKind",
449
+ isSignal: true,
450
+ isRequired: false,
451
+ transformFunction: null
452
+ },
453
+ groupLabel: {
454
+ classPropertyName: "groupLabel",
455
+ publicName: "groupLabel",
456
+ isSignal: true,
457
+ isRequired: false,
458
+ transformFunction: null
459
+ },
460
+ expanded: {
461
+ classPropertyName: "expanded",
462
+ publicName: "expanded",
463
+ isSignal: true,
464
+ isRequired: false,
465
+ transformFunction: null
466
+ },
467
+ numbered: {
468
+ classPropertyName: "numbered",
469
+ publicName: "numbered",
470
+ isSignal: true,
471
+ isRequired: false,
472
+ transformFunction: null
473
+ },
474
+ numbering: {
475
+ classPropertyName: "numbering",
476
+ publicName: "numbering",
477
+ isSignal: true,
478
+ isRequired: false,
479
+ transformFunction: null
480
+ },
481
+ unnumbered: {
482
+ classPropertyName: "unnumbered",
483
+ publicName: "unnumbered",
484
+ isSignal: true,
485
+ isRequired: false,
486
+ transformFunction: null
487
+ },
488
+ columnControls: {
489
+ classPropertyName: "columnControls",
490
+ publicName: "columnControls",
491
+ isSignal: true,
492
+ isRequired: false,
493
+ transformFunction: null
494
+ },
495
+ searchable: {
496
+ classPropertyName: "searchable",
497
+ publicName: "searchable",
498
+ isSignal: true,
499
+ isRequired: false,
500
+ transformFunction: null
501
+ },
502
+ maxHeight: {
503
+ classPropertyName: "maxHeight",
504
+ publicName: "maxHeight",
505
+ isSignal: true,
506
+ isRequired: false,
507
+ transformFunction: null
508
+ },
509
+ rowClass: {
510
+ classPropertyName: "rowClass",
511
+ publicName: "rowClass",
512
+ isSignal: true,
513
+ isRequired: false,
514
+ transformFunction: null
515
+ },
516
+ pageSize: {
517
+ classPropertyName: "pageSize",
518
+ publicName: "pageSize",
519
+ isSignal: true,
520
+ isRequired: false,
521
+ transformFunction: null
522
+ },
523
+ pageSizes: {
524
+ classPropertyName: "pageSizes",
525
+ publicName: "pageSizes",
526
+ isSignal: true,
527
+ isRequired: false,
528
+ transformFunction: null
529
+ },
530
+ rowPinning: {
531
+ classPropertyName: "rowPinning",
532
+ publicName: "rowPinning",
533
+ isSignal: true,
534
+ isRequired: false,
535
+ transformFunction: null
536
+ },
537
+ pinnedRows: {
538
+ classPropertyName: "pinnedRows",
539
+ publicName: "pinnedRows",
540
+ isSignal: true,
541
+ isRequired: false,
542
+ transformFunction: null
543
+ },
544
+ labels: {
545
+ classPropertyName: "labels",
546
+ publicName: "labels",
547
+ isSignal: true,
548
+ isRequired: false,
549
+ transformFunction: null
550
+ }
551
+ },
552
+ outputs: {
553
+ toggled: "toggled",
554
+ sortChange: "sortChange",
555
+ searchChange: "searchChange",
556
+ pinnedRowsChange: "pinnedRowsChange",
557
+ columnsChange: "columnsChange",
558
+ pageChange: "pageChange"
559
+ },
560
+ host: { classAttribute: "su-tree-table" },
561
+ queries: [{
562
+ propertyName: "cellTemplates",
563
+ predicate: SuTableCellDirective$1,
564
+ isSignal: true
565
+ }],
566
+ ngImport: i0,
567
+ template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n",
568
+ styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var( --su-table-stripe-background, var(--su-table-row-background, transparent) )}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var( --su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent) )}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var( --su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent) );color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var( --su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent) )}tbody tr.is-pinned-row{--su-table-row-tint: var( --su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent) )}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"],
569
+ dependencies: [
570
+ {
571
+ kind: "directive",
572
+ type: NgTemplateOutlet,
573
+ selector: "[ngTemplateOutlet]",
574
+ inputs: [
575
+ "ngTemplateOutletContext",
576
+ "ngTemplateOutlet",
577
+ "ngTemplateOutletInjector"
578
+ ]
579
+ },
580
+ {
581
+ kind: "component",
582
+ type: SuTablePaginatorComponent,
583
+ selector: "su-lib-table-paginator",
584
+ inputs: [
585
+ "pagination",
586
+ "labels",
587
+ "controlId"
588
+ ],
589
+ outputs: ["pageChange", "pageSizeChange"]
590
+ },
591
+ {
592
+ kind: "directive",
593
+ type: SuTablePinDirective,
594
+ selector: "[suTablePin]",
595
+ inputs: ["suTablePin"]
596
+ },
597
+ {
598
+ kind: "component",
599
+ type: SuTableToolbarComponent,
600
+ selector: "su-lib-table-toolbar",
601
+ inputs: [
602
+ "labels",
603
+ "controlId",
604
+ "searchable",
605
+ "query",
606
+ "columnControls",
607
+ "columns"
608
+ ],
609
+ outputs: [
610
+ "queryChange",
611
+ "pinnableChange",
612
+ "visibilityChange",
613
+ "allVisibilityChange"
614
+ ]
615
+ },
616
+ {
617
+ kind: "component",
618
+ type: SuTreeTablePinIconComponent,
619
+ selector: "svg[suTreeTablePinIcon]"
620
+ },
621
+ {
622
+ kind: "component",
623
+ type: SuTreeTableToggleComponent,
624
+ selector: "su-lib-tree-table-toggle",
625
+ inputs: ["expanded", "label"],
626
+ outputs: ["toggle"]
627
+ }
628
+ ],
629
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
630
+ });
631
+ };
632
+ i0.ɵɵngDeclareClassMetadata({
633
+ minVersion: "12.0.0",
634
+ version: "22.2.4",
635
+ ngImport: i0,
636
+ type: SuTreeTableComponent,
637
+ decorators: [{
638
+ type: Component,
639
+ args: [{
640
+ selector: "su-lib-tree-table",
641
+ changeDetection: ChangeDetectionStrategy.OnPush,
642
+ imports: [
643
+ NgTemplateOutlet,
644
+ SuTablePaginatorComponent,
645
+ SuTablePinDirective,
646
+ SuTableToolbarComponent,
647
+ SuTreeTablePinIconComponent,
648
+ SuTreeTableToggleComponent
649
+ ],
650
+ host: { class: "su-tree-table" },
651
+ template: "@let current = state();\n@let t = text();\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\n@let pinnedCount = current.pinnedRows.length;\n@if (searchable() || columnControls()) {\n <su-lib-table-toolbar\n [labels]=\"t\"\n [controlId]=\"tableId\"\n [searchable]=\"searchable()\"\n [query]=\"current.query\"\n [columnControls]=\"columnControls()\"\n [columns]=\"current.allColumns\"\n (queryChange)=\"search($event)\"\n (pinnableChange)=\"setColumnPinnable($event)\"\n (visibilityChange)=\"setColumnVisible($event)\"\n (allVisibilityChange)=\"setColumnsVisible($event)\"\n />\n}\n\n<div\n class=\"su-table-scroll\"\n [class.is-scrolled-start]=\"scrolledFromStart()\"\n [class.has-more-end]=\"moreAtEnd()\"\n [class.is-scrolled-top]=\"scrolledFromTop()\"\n [class.has-pinned-rows]=\"current.pinnedRows.length > 0\"\n [style.max-height]=\"maxHeight()\"\n (scroll)=\"onScroll($event)\"\n>\n <table class=\"su-table-grid\" role=\"treegrid\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (numbered()) {\n <th scope=\"col\" class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ t.number }}</th>\n }\n @for (column of current.columns; track column.key; let columnIndex = $index) {\n <th\n scope=\"col\"\n class=\"su-table-align-{{ column.align }}\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + columnIndex]\"\n [attr.aria-sort]=\"column.sort === 'none' ? null : column.sort\"\n >\n @if (column.sortable) {\n <button type=\"button\" class=\"su-table-sort\" (click)=\"sortBy(column.key)\">\n {{ column.header }}\n <span class=\"su-table-sort-icon is-{{ column.sort }}\" aria-hidden=\"true\"></span>\n </button>\n } @else {\n {{ column.header }}\n }\n @if (column.pinnable) {\n <button\n type=\"button\"\n class=\"su-table-header-pin\"\n [attr.aria-label]=\"t.pinColumn(column.header)\"\n [attr.aria-pressed]=\"column.pinned !== null\"\n (click)=\"toggleColumnPin(column.key, column.pinned)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTreeTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (rowPinning()) {\n <th scope=\"col\" class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">{{ t.actions }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of bodyRows(); track row.id; let rowIndex = $index) {\n <tr\n [attr.data-su-tree-row]=\"row.id\"\n [attr.tabindex]=\"row.id === tabRowId() ? 0 : -1\"\n [attr.aria-level]=\"row.level\"\n [attr.aria-posinset]=\"row.position\"\n [attr.aria-setsize]=\"row.siblings\"\n [attr.aria-expanded]=\"row.expanded\"\n [class]=\"rowClassOf(row)\"\n [class.su-tree-table-row]=\"true\"\n [class.is-group]=\"row.kind === 'group'\"\n [class.is-pinned-row]=\"rowIndex < pinnedCount\"\n [class.is-last-pinned-row]=\"rowIndex === pinnedCount - 1\"\n [style.--su-table-row-top]=\"rowIndex < pinnedCount ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [style.--su-tree-table-level]=\"row.level - 1\"\n (keydown)=\"onRowKey($event, row)\"\n (focus)=\"onRowFocus(row.id)\"\n >\n @if (numbered()) {\n <td class=\"su-tree-table-number\" [suTablePin]=\"pins[0]\">{{ row.number }}</td>\n }\n @if (row.kind === 'group') {\n <td\n role=\"rowheader\"\n class=\"su-tree-table-group-cell su-tree-table-tree-cell\"\n [attr.colspan]=\"current.columns.length\"\n >\n <span class=\"su-tree-table-group-label\">\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n {{ row.label }}\n </span>\n </td>\n } @else {\n @for (cell of row.cells; track cell.key) {\n @let column = current.columns[cell.columnIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : 'gridcell'\"\n [attr.rowspan]=\"cell.rowSpan > 1 ? cell.rowSpan : null\"\n [attr.colspan]=\"cell.colSpan > 1 ? cell.colSpan : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.su-tree-table-tree-cell]=\"cell.columnIndex === 0\"\n [class.is-merged]=\"cell.rowSpan > 1 || cell.colSpan > 1\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [suTablePin]=\"pins[firstColumnSlot + cell.columnIndex]\"\n >\n @if (cell.columnIndex === 0) {\n <su-lib-tree-table-toggle\n [expanded]=\"row.expanded\"\n [label]=\"row.expanded ? t.collapseRow(row.label) : t.expandRow(row.label)\"\n (toggle)=\"toggle(row)\"\n />\n }\n @if (cellTemplate(cell.key); as template) {\n <ng-container *ngTemplateOutlet=\"template; context: { $implicit: row.data, text: cell.text }\" />\n } @else {\n {{ cell.text }}\n }\n </td>\n }\n }\n @if (rowPinning()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n @if (row.level === 1) {\n <div class=\"su-table-actions\">\n <button\n type=\"button\"\n class=\"su-table-button su-table-pin-button\"\n [attr.aria-pressed]=\"row.pinned\"\n [attr.aria-label]=\"t.pinRow + ', ' + row.label\"\n (click)=\"pinRow(row.id)\"\n >\n <svg suTreeTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n </div>\n }\n </td>\n }\n </tr>\n }\n @if (current.rows.length === 0) {\n <tr>\n <td class=\"su-table-empty\" [attr.colspan]=\"columnCount()\">\n {{ current.searching ? t.noMatches(current.query) : t.empty }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div>\n\n@if (current.pagination.pageSizes.length > 0 || current.pagination.pageSize !== 'all') {\n <su-lib-table-paginator\n [pagination]=\"current.pagination\"\n [labels]=\"t\"\n [controlId]=\"tableId + '-page-size'\"\n (pageChange)=\"setPage($event)\"\n (pageSizeChange)=\"setPageSize($event)\"\n />\n}\n\n<div class=\"su-table-visually-hidden\" role=\"status\">{{ current.announcement }}</div>\n\n",
652
+ styles: [":host{color:var(--su-table-text-color, inherit);display:block;min-width:0;font-family:var(--su-table-font-family, inherit);font-size:var(--su-table-font-size, .95rem)}.su-table-scroll{border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);overflow:auto}.su-table-grid{background:var(--su-table-background, transparent);border-collapse:separate;border-spacing:0;min-width:100%}caption{caption-side:top;color:var(--su-table-caption-color, inherit);font-size:var(--su-table-caption-font-size, inherit);font-weight:600;padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start}th,td{background-image:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent));border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));padding:var(--su-table-cell-padding, .6rem .75rem);text-align:start;vertical-align:var(--su-table-cell-vertical-align, middle)}thead th{--su-table-row-tint: var(--su-table-header-background, rgb(0 0 0 / .03));border-bottom:var(--su-table-header-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)));color:var(--su-table-header-color, inherit);font-size:var(--su-table-header-font-size, inherit);font-weight:var(--su-table-header-font-weight, 600);letter-spacing:var(--su-table-header-letter-spacing, normal);padding:var(--su-table-header-padding, var(--su-table-cell-padding, .6rem .75rem));text-transform:var(--su-table-header-text-transform, none);white-space:nowrap}.is-sorted{--su-table-cell-tint: var(--su-table-sorted-background, transparent)}.su-table-row-header{font-weight:var(--su-table-row-header-weight, 600)}tbody tr:last-child>*{border-bottom:none}tbody tr{--su-table-row-tint: var(--su-table-row-background, transparent);background:var(--su-table-row-tint);color:var(--su-table-row-color, inherit)}tbody tr:nth-child(2n){--su-table-row-tint: var( --su-table-stripe-background, var(--su-table-row-background, transparent) )}tbody tr.is-muted{--su-table-row-tint: var(--su-table-muted-background, transparent);color:color-mix(in srgb,currentColor var(--su-table-muted-text, 55%),transparent)}tbody tr.is-highlighted{--su-table-row-tint: var( --su-table-highlight-background, color-mix(in srgb, #f59e0b 14%, transparent) )}tbody tr:hover{--su-table-row-tint: var(--su-table-hover-background, rgb(0 0 0 / .025))}tbody tr.is-selected{--su-table-row-tint: var( --su-table-selected-background, color-mix(in srgb, #2563eb 8%, transparent) );color:var(--su-table-selected-color, inherit)}tbody tr.is-editing{--su-table-row-tint: var( --su-table-editing-background, color-mix(in srgb, #2563eb 5%, transparent) )}tbody tr.is-pinned-row{--su-table-row-tint: var( --su-table-pinned-row-background, color-mix(in srgb, #2563eb 6%, transparent) )}tbody tr.is-last-pinned-row>*{border-bottom:var(--su-table-pinned-row-border, 2px solid color-mix(in srgb, #2563eb 40%, transparent))}thead th,tbody tr.is-pinned-row>*,.is-pinned-start,.is-pinned-end{background:linear-gradient(var(--su-table-cell-tint, transparent),var(--su-table-cell-tint, transparent)),linear-gradient(var(--su-table-row-tint, transparent),var(--su-table-row-tint, transparent)),var(--su-table-pinned-background, Canvas);position:sticky;z-index:1}thead th{top:0;z-index:4}thead th.is-pinned-start,thead th.is-pinned-end{z-index:5}tbody tr.is-pinned-row>*{top:var(--su-table-row-top, 0);z-index:2}tbody tr.is-pinned-row>*.is-pinned-start,tbody tr.is-pinned-row>*.is-pinned-end{z-index:3}.is-scrolled-top:not(.has-pinned-rows) thead th,.is-scrolled-top tr.is-last-pinned-row>*{box-shadow:var(--su-table-sticky-shadow, 0 6px 8px -6px rgba(0, 0, 0, .25))}.is-pinned-edge:after{content:\"\";inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:opacity .15s ease-out;width:1rem}.is-pinned-start.is-pinned-edge{border-inline-end:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.is-pinned-end.is-pinned-edge{border-inline-start:var(--su-table-pinned-border, 1px solid rgba(0, 0, 0, .14))}.su-table-pinned-icon{margin-inline-start:.35rem;opacity:.45;vertical-align:-1px}.su-table-header-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-header-pin{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;margin-inline-start:.2rem;opacity:.3;padding:.2rem;vertical-align:middle}.su-table-header-pin:hover{opacity:.7}.su-table-header-pin[aria-pressed=true]{color:var(--su-table-accent, #2563eb);opacity:1}.is-pinned-start.is-pinned-edge:after{background:linear-gradient(to right,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-start:100%}.is-pinned-end.is-pinned-edge:after{background:linear-gradient(to left,var(--su-table-pinned-shadow, rgba(0, 0, 0, .22)),transparent);inset-inline-end:100%}.is-scrolled-start .is-pinned-start.is-pinned-edge:after,.has-more-end .is-pinned-end.is-pinned-edge:after{opacity:1}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.su-table-sort:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-sort{align-items:center;background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;display:inline-flex;font:inherit;letter-spacing:inherit;text-transform:inherit;gap:.35rem;margin:-.2rem -.35rem;padding:.2rem .35rem}.su-table-sort-icon{border-left:.3rem solid transparent;border-right:.3rem solid transparent;height:0;opacity:.35;width:0}.su-table-sort-icon.is-none,.su-table-sort-icon.is-ascending{border-bottom:.4rem solid currentColor}.su-table-sort-icon.is-descending{border-top:.4rem solid currentColor}.su-table-sort-icon.is-ascending,.su-table-sort-icon.is-descending{opacity:1}.su-table-button{background:var(--su-table-button-background, transparent);border:var(--su-table-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-table-button-radius, 6px);color:var(--su-table-button-color, inherit);cursor:pointer;font:inherit;font-size:.875em;padding:var(--su-table-button-padding, .3rem .7rem);white-space:nowrap}.su-table-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-button:disabled{cursor:not-allowed;opacity:.45}.su-table-button.is-primary{background:var(--su-table-primary-background, #111);border-color:transparent;color:var(--su-table-primary-color, #fff)}.su-table-button.is-danger{border-color:var(--su-table-danger-border, color-mix(in srgb, #b42318 35%, transparent));color:var(--su-table-danger-color, #b42318)}.su-table-button.is-quiet{border-color:transparent}.su-table-button.su-table-pin-button{align-items:center;display:inline-flex;gap:.3rem}.su-table-button.su-table-pin-button svg{opacity:.5}.su-table-button.su-table-pin-button[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-button.su-table-pin-button[aria-pressed=true] svg{opacity:1}.su-table-empty{opacity:.7;padding:1.5rem;text-align:center}.su-table-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:no-preference){tbody tr{transition:background-color .12s ease-out}}tbody tr.su-tree-table-row:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:-2px}.su-tree-table-tree-cell{padding-inline-start:calc(var(--su-tree-table-cell-start, .4rem) + var(--su-tree-table-level, 0) * var(--su-tree-table-indent, 1.25rem));white-space:nowrap}.su-tree-table-number{color:var(--su-tree-table-number-color, color-mix(in srgb, currentColor 65%, transparent));font-variant-numeric:tabular-nums;white-space:nowrap;width:1%}tbody tr.is-group{--su-table-row-tint: var(--su-tree-table-group-background, rgb(0 0 0 / .04));color:var(--su-tree-table-group-color, inherit);font-weight:var(--su-tree-table-group-font-weight, 600)}.su-tree-table-group-label{align-items:center;display:inline-flex;inset-inline-start:0;position:sticky}td.is-merged{--su-table-cell-tint: var(--su-tree-table-merged-background, transparent);vertical-align:var(--su-tree-table-merged-vertical-align, middle)}td[rowspan]{border-inline:var(--su-tree-table-merged-border, var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08)))}\n"]
653
+ }]
654
+ }],
655
+ ctorParameters: () => [],
656
+ propDecorators: {
657
+ columns: [{
658
+ type: i0.Input,
659
+ args: [{
660
+ isSignal: true,
661
+ alias: "columns",
662
+ required: true
663
+ }]
664
+ }],
665
+ rows: [{
666
+ type: i0.Input,
667
+ args: [{
668
+ isSignal: true,
669
+ alias: "rows",
670
+ required: true
671
+ }]
672
+ }],
673
+ caption: [{
674
+ type: i0.Input,
675
+ args: [{
676
+ isSignal: true,
677
+ alias: "caption",
678
+ required: true
679
+ }]
680
+ }],
681
+ showCaption: [{
682
+ type: i0.Input,
683
+ args: [{
684
+ isSignal: true,
685
+ alias: "showCaption",
686
+ required: false
687
+ }]
688
+ }],
689
+ rowId: [{
690
+ type: i0.Input,
691
+ args: [{
692
+ isSignal: true,
693
+ alias: "rowId",
694
+ required: false
695
+ }]
696
+ }],
697
+ children: [{
698
+ type: i0.Input,
699
+ args: [{
700
+ isSignal: true,
701
+ alias: "children",
702
+ required: false
703
+ }]
704
+ }],
705
+ rowKind: [{
706
+ type: i0.Input,
707
+ args: [{
708
+ isSignal: true,
709
+ alias: "rowKind",
710
+ required: false
711
+ }]
712
+ }],
713
+ groupLabel: [{
714
+ type: i0.Input,
715
+ args: [{
716
+ isSignal: true,
717
+ alias: "groupLabel",
718
+ required: false
719
+ }]
720
+ }],
721
+ expanded: [{
722
+ type: i0.Input,
723
+ args: [{
724
+ isSignal: true,
725
+ alias: "expanded",
726
+ required: false
727
+ }]
728
+ }],
729
+ numbered: [{
730
+ type: i0.Input,
731
+ args: [{
732
+ isSignal: true,
733
+ alias: "numbered",
734
+ required: false
735
+ }]
736
+ }],
737
+ numbering: [{
738
+ type: i0.Input,
739
+ args: [{
740
+ isSignal: true,
741
+ alias: "numbering",
742
+ required: false
743
+ }]
744
+ }],
745
+ unnumbered: [{
746
+ type: i0.Input,
747
+ args: [{
748
+ isSignal: true,
749
+ alias: "unnumbered",
750
+ required: false
751
+ }]
752
+ }],
753
+ columnControls: [{
754
+ type: i0.Input,
755
+ args: [{
756
+ isSignal: true,
757
+ alias: "columnControls",
758
+ required: false
759
+ }]
760
+ }],
761
+ searchable: [{
762
+ type: i0.Input,
763
+ args: [{
764
+ isSignal: true,
765
+ alias: "searchable",
766
+ required: false
767
+ }]
768
+ }],
769
+ maxHeight: [{
770
+ type: i0.Input,
771
+ args: [{
772
+ isSignal: true,
773
+ alias: "maxHeight",
774
+ required: false
775
+ }]
776
+ }],
777
+ rowClass: [{
778
+ type: i0.Input,
779
+ args: [{
780
+ isSignal: true,
781
+ alias: "rowClass",
782
+ required: false
783
+ }]
784
+ }],
785
+ pageSize: [{
786
+ type: i0.Input,
787
+ args: [{
788
+ isSignal: true,
789
+ alias: "pageSize",
790
+ required: false
791
+ }]
792
+ }],
793
+ pageSizes: [{
794
+ type: i0.Input,
795
+ args: [{
796
+ isSignal: true,
797
+ alias: "pageSizes",
798
+ required: false
799
+ }]
800
+ }],
801
+ rowPinning: [{
802
+ type: i0.Input,
803
+ args: [{
804
+ isSignal: true,
805
+ alias: "rowPinning",
806
+ required: false
807
+ }]
808
+ }],
809
+ pinnedRows: [{
810
+ type: i0.Input,
811
+ args: [{
812
+ isSignal: true,
813
+ alias: "pinnedRows",
814
+ required: false
815
+ }]
816
+ }],
817
+ labels: [{
818
+ type: i0.Input,
819
+ args: [{
820
+ isSignal: true,
821
+ alias: "labels",
822
+ required: false
823
+ }]
824
+ }],
825
+ toggled: [{
826
+ type: i0.Output,
827
+ args: ["toggled"]
828
+ }],
829
+ sortChange: [{
830
+ type: i0.Output,
831
+ args: ["sortChange"]
832
+ }],
833
+ searchChange: [{
834
+ type: i0.Output,
835
+ args: ["searchChange"]
836
+ }],
837
+ pinnedRowsChange: [{
838
+ type: i0.Output,
839
+ args: ["pinnedRowsChange"]
840
+ }],
841
+ columnsChange: [{
842
+ type: i0.Output,
843
+ args: ["columnsChange"]
844
+ }],
845
+ pageChange: [{
846
+ type: i0.Output,
847
+ args: ["pageChange"]
848
+ }],
849
+ cellTemplates: [{
850
+ type: i0.ContentChildren,
851
+ args: [i0.forwardRef(() => SuTableCellDirective$1), { isSignal: true }]
852
+ }]
853
+ }
854
+ });
855
+ export { SU_TREE_TABLE_LABELS, SuTableCellDirective, SuTreeTableComponent };
384
856
 
385
- export { SuTreeTableComponent };
386
- //# sourceMappingURL=su-labs-tree-table.mjs.map
857
+ //# sourceMappingURL=su-labs-tree-table.mjs.map