@su-labs/tree-table 21.0.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/fesm2022/su-labs-tree-table.mjs +852 -381
- package/fesm2022/su-labs-tree-table.mjs.map +1 -1
- package/package.json +4 -4
- package/types/su-labs-tree-table.d.ts +236 -129
|
@@ -1,386 +1,857 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, 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))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}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}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.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-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.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-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.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
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, 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))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}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}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.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-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.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-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, 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))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}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}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.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-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.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-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.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)}td.is-editable:hover,th.is-editable:hover{--su-table-cell-tint: var(--su-table-editable-hover-background, color-mix(in srgb, currentColor 6%, 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))}tbody tr.is-grabbed,tbody tr.is-dragging{--su-table-row-tint: var(--su-table-grabbed-background, color-mix(in srgb, #2563eb 14%, transparent));outline:var(--su-table-grabbed-outline, 2px solid color-mix(in srgb, #2563eb 60%, transparent));outline-offset:-2px}tbody tr.is-dragging{background:linear-gradient(var(--su-table-row-tint),var(--su-table-row-tint)),var(--su-table-dragging-background, Canvas);box-shadow:var(--su-table-dragging-shadow, 0 8px 24px rgba(0, 0, 0, .18));cursor:grabbing;position:relative;z-index:3}tbody tr.is-drop-before>*{box-shadow:inset 0 var(--su-table-drop-line-width, 2px) 0 var(--su-table-drop-line-color, #2563eb)}tbody tr.is-drop-after>*{box-shadow:inset 0 calc(-1 * var(--su-table-drop-line-width, 2px)) 0 var(--su-table-drop-line-color, #2563eb)}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}@media(prefers-reduced-motion:no-preference){.is-dragging-rows tbody tr:not(.is-dragging){transition:transform .15s ease-out}}td.is-editable,th.is-editable{cursor:text}.su-table-align-start{text-align:start}.su-table-align-center{text-align:center}.su-table-align-end{text-align:end}.su-table-handle-cell,.su-table-select-cell{text-align:center;width:1%}.su-table-actions-cell{text-align:end;width:1%}.su-table-actions{display:flex;gap:.35rem;justify-content:flex-end}.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-handle{background:none;border:none;border-radius:4px;color:var(--su-table-handle-color, inherit);cursor:grab;display:inline-flex;padding:.35rem .3rem;touch-action:none}.su-table-handle:active{cursor:grabbing}.su-table-grip{background-image:radial-gradient(currentColor 1.2px,transparent 1.4px);background-size:6px 6px;display:block;height:18px;opacity:.6;width:12px}.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-sort:focus-visible,.su-table-handle:focus-visible,.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:var(--su-table-checkbox-size, 1rem);margin:0;width:var(--su-table-checkbox-size, 1rem)}.su-table-toolbar,.su-table-bulk{background:var(--su-table-panel-background, rgba(0, 0, 0, .03));border-radius:var(--su-table-radius, 10px);margin-bottom:.75rem;padding:.6rem .75rem}.su-table-toolbar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.su-table-toolbar-count{font-weight:600;margin-right:auto}.su-table-bulk-title{font-size:1rem;margin:0 0 .75rem}.su-table-bulk-fields{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fill,minmax(12rem,1fr))}.su-table-bulk-field{display:flex;flex-direction:column;gap:.3rem}.su-table-label{font-size:.85em;font-weight:600}.su-table-bulk-actions{display:flex;gap:.5rem;margin-top:.75rem}.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
|
-
|
|
386
|
-
//# sourceMappingURL=su-labs-tree-table.mjs.map
|
|
857
|
+
//# sourceMappingURL=su-labs-tree-table.mjs.map
|