@su-labs/table 0.0.0-stage → 22.1.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/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +379 -2
- package/fesm2022/su-labs-table.mjs +1480 -0
- package/fesm2022/su-labs-table.mjs.map +1 -0
- package/package.json +53 -3
- package/types/su-labs-table.d.ts +487 -0
|
@@ -0,0 +1,1480 @@
|
|
|
1
|
+
import { SU_TABLE_LABELS, SU_TABLE_LABELS as SU_TABLE_LABELS$1, SuTableController, suCheckboxEditor, suDateEditor, suNumberEditor, suSelectEditor, suTableDropIndex, suTextEditor } from "@su-labs/core/table";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, TemplateRef, afterRenderEffect, booleanAttribute, computed, contentChildren, effect, inject, input, output, signal, untracked, viewChild } from "@angular/core";
|
|
4
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
5
|
+
var SuTableCellDirective = class SuTableCellDirective {
|
|
6
|
+
key = input.required({
|
|
7
|
+
...ngDevMode ? { debugName: "key" } : /* istanbul ignore next */ {},
|
|
8
|
+
alias: "suTableCell"
|
|
9
|
+
});
|
|
10
|
+
rowsOf = input([], {
|
|
11
|
+
...ngDevMode ? { debugName: "rowsOf" } : /* istanbul ignore next */ {},
|
|
12
|
+
alias: "suTableCellOf"
|
|
13
|
+
});
|
|
14
|
+
template = inject(TemplateRef);
|
|
15
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
19
|
+
minVersion: "12.0.0",
|
|
20
|
+
version: "22.2.4",
|
|
21
|
+
ngImport: i0,
|
|
22
|
+
type: SuTableCellDirective,
|
|
23
|
+
deps: [],
|
|
24
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
25
|
+
});
|
|
26
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
27
|
+
minVersion: "17.1.0",
|
|
28
|
+
version: "22.2.4",
|
|
29
|
+
type: SuTableCellDirective,
|
|
30
|
+
isStandalone: true,
|
|
31
|
+
selector: "ng-template[suTableCell]",
|
|
32
|
+
inputs: {
|
|
33
|
+
key: {
|
|
34
|
+
classPropertyName: "key",
|
|
35
|
+
publicName: "suTableCell",
|
|
36
|
+
isSignal: true,
|
|
37
|
+
isRequired: true,
|
|
38
|
+
transformFunction: null
|
|
39
|
+
},
|
|
40
|
+
rowsOf: {
|
|
41
|
+
classPropertyName: "rowsOf",
|
|
42
|
+
publicName: "suTableCellOf",
|
|
43
|
+
isSignal: true,
|
|
44
|
+
isRequired: false,
|
|
45
|
+
transformFunction: null
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
ngImport: i0
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
52
|
+
minVersion: "12.0.0",
|
|
53
|
+
version: "22.2.4",
|
|
54
|
+
ngImport: i0,
|
|
55
|
+
type: SuTableCellDirective,
|
|
56
|
+
decorators: [{
|
|
57
|
+
type: Directive,
|
|
58
|
+
args: [{ selector: "ng-template[suTableCell]" }]
|
|
59
|
+
}],
|
|
60
|
+
propDecorators: {
|
|
61
|
+
key: [{
|
|
62
|
+
type: i0.Input,
|
|
63
|
+
args: [{
|
|
64
|
+
isSignal: true,
|
|
65
|
+
alias: "suTableCell",
|
|
66
|
+
required: true
|
|
67
|
+
}]
|
|
68
|
+
}],
|
|
69
|
+
rowsOf: [{
|
|
70
|
+
type: i0.Input,
|
|
71
|
+
args: [{
|
|
72
|
+
isSignal: true,
|
|
73
|
+
alias: "suTableCellOf",
|
|
74
|
+
required: false
|
|
75
|
+
}]
|
|
76
|
+
}]
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var SuTableFieldComponent = class SuTableFieldComponent {
|
|
80
|
+
field = input.required(...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
|
|
81
|
+
controlId = input.required(...ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []);
|
|
82
|
+
ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
83
|
+
mixedLabel = input.required(...ngDevMode ? [{ debugName: "mixedLabel" }] : /* istanbul ignore next */ []);
|
|
84
|
+
valueChange = output();
|
|
85
|
+
errorId = computed(() => `${this.controlId()}-error`, ...ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []);
|
|
86
|
+
placeholder = computed(() => {
|
|
87
|
+
const field = this.field();
|
|
88
|
+
return field.mixed ? this.mixedLabel() : field.editor.attributes.placeholder ?? null;
|
|
89
|
+
}, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
90
|
+
onChange(event) {
|
|
91
|
+
const target = event.target;
|
|
92
|
+
if (target instanceof HTMLInputElement && target.type === "checkbox") this.valueChange.emit(target.checked);
|
|
93
|
+
else if (target instanceof HTMLInputElement || target instanceof HTMLSelectElement || target instanceof HTMLTextAreaElement) this.valueChange.emit(target.value);
|
|
94
|
+
}
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
96
|
+
minVersion: "12.0.0",
|
|
97
|
+
version: "22.2.4",
|
|
98
|
+
ngImport: i0,
|
|
99
|
+
type: SuTableFieldComponent,
|
|
100
|
+
deps: [],
|
|
101
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
102
|
+
});
|
|
103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
104
|
+
minVersion: "17.0.0",
|
|
105
|
+
version: "22.2.4",
|
|
106
|
+
type: SuTableFieldComponent,
|
|
107
|
+
isStandalone: true,
|
|
108
|
+
selector: "su-lib-table-field",
|
|
109
|
+
inputs: {
|
|
110
|
+
field: {
|
|
111
|
+
classPropertyName: "field",
|
|
112
|
+
publicName: "field",
|
|
113
|
+
isSignal: true,
|
|
114
|
+
isRequired: true,
|
|
115
|
+
transformFunction: null
|
|
116
|
+
},
|
|
117
|
+
controlId: {
|
|
118
|
+
classPropertyName: "controlId",
|
|
119
|
+
publicName: "controlId",
|
|
120
|
+
isSignal: true,
|
|
121
|
+
isRequired: true,
|
|
122
|
+
transformFunction: null
|
|
123
|
+
},
|
|
124
|
+
ariaLabel: {
|
|
125
|
+
classPropertyName: "ariaLabel",
|
|
126
|
+
publicName: "ariaLabel",
|
|
127
|
+
isSignal: true,
|
|
128
|
+
isRequired: false,
|
|
129
|
+
transformFunction: null
|
|
130
|
+
},
|
|
131
|
+
mixedLabel: {
|
|
132
|
+
classPropertyName: "mixedLabel",
|
|
133
|
+
publicName: "mixedLabel",
|
|
134
|
+
isSignal: true,
|
|
135
|
+
isRequired: true,
|
|
136
|
+
transformFunction: null
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
outputs: { valueChange: "valueChange" },
|
|
140
|
+
host: { classAttribute: "su-table-field" },
|
|
141
|
+
ngImport: i0,
|
|
142
|
+
template: "@let item = field();\n@let attributes = item.editor.attributes;\n@switch (item.editor.input) {\n @case ('checkbox') {\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [id]=\"controlId()\"\n [checked]=\"item.value === true\"\n [indeterminate]=\"item.mixed\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (change)=\"onChange($event)\"\n />\n }\n @case ('select') {\n <select\n class=\"su-table-control\"\n [id]=\"controlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (change)=\"onChange($event)\"\n >\n @if (item.mixed) {\n <option value=\"\" disabled selected>{{ mixedLabel() }}</option>\n }\n @for (option of item.editor.options; track option.value) {\n <option [value]=\"option.value\" [selected]=\"!item.mixed && option.value === item.value\">\n {{ option.label }}\n </option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea\n class=\"su-table-control\"\n rows=\"2\"\n [id]=\"controlId()\"\n [value]=\"item.value\"\n [attr.placeholder]=\"placeholder()\"\n [attr.maxlength]=\"attributes.maxLength ?? null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (input)=\"onChange($event)\"\n ></textarea>\n }\n @default {\n <input\n class=\"su-table-control\"\n [type]=\"item.editor.input\"\n [id]=\"controlId()\"\n [value]=\"item.value\"\n [attr.placeholder]=\"placeholder()\"\n [attr.min]=\"attributes.min ?? null\"\n [attr.max]=\"attributes.max ?? null\"\n [attr.step]=\"attributes.step ?? null\"\n [attr.maxlength]=\"attributes.maxLength ?? null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (input)=\"onChange($event)\"\n />\n }\n}\n@if (item.error) {\n <span class=\"su-table-error\" [id]=\"errorId()\">{{ item.error }}</span>\n}\n",
|
|
143
|
+
styles: [":host{display:flex;flex-direction:column;gap:.2rem}.su-table-control{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-control:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-control{min-height:2rem;min-width:6rem;padding:.3rem .45rem;width:100%}.su-table-control[aria-invalid=true]{border-color:var(--su-table-danger-color, #b42318)}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:1rem;margin:0;width:1rem}.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-error{color:var(--su-table-danger-color, #b42318);font-size:.8em;font-weight:400}\n"],
|
|
144
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
148
|
+
minVersion: "12.0.0",
|
|
149
|
+
version: "22.2.4",
|
|
150
|
+
ngImport: i0,
|
|
151
|
+
type: SuTableFieldComponent,
|
|
152
|
+
decorators: [{
|
|
153
|
+
type: Component,
|
|
154
|
+
args: [{
|
|
155
|
+
selector: "su-lib-table-field",
|
|
156
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
157
|
+
host: { class: "su-table-field" },
|
|
158
|
+
template: "@let item = field();\n@let attributes = item.editor.attributes;\n@switch (item.editor.input) {\n @case ('checkbox') {\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [id]=\"controlId()\"\n [checked]=\"item.value === true\"\n [indeterminate]=\"item.mixed\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (change)=\"onChange($event)\"\n />\n }\n @case ('select') {\n <select\n class=\"su-table-control\"\n [id]=\"controlId()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (change)=\"onChange($event)\"\n >\n @if (item.mixed) {\n <option value=\"\" disabled selected>{{ mixedLabel() }}</option>\n }\n @for (option of item.editor.options; track option.value) {\n <option [value]=\"option.value\" [selected]=\"!item.mixed && option.value === item.value\">\n {{ option.label }}\n </option>\n }\n </select>\n }\n @case ('textarea') {\n <textarea\n class=\"su-table-control\"\n rows=\"2\"\n [id]=\"controlId()\"\n [value]=\"item.value\"\n [attr.placeholder]=\"placeholder()\"\n [attr.maxlength]=\"attributes.maxLength ?? null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (input)=\"onChange($event)\"\n ></textarea>\n }\n @default {\n <input\n class=\"su-table-control\"\n [type]=\"item.editor.input\"\n [id]=\"controlId()\"\n [value]=\"item.value\"\n [attr.placeholder]=\"placeholder()\"\n [attr.min]=\"attributes.min ?? null\"\n [attr.max]=\"attributes.max ?? null\"\n [attr.step]=\"attributes.step ?? null\"\n [attr.maxlength]=\"attributes.maxLength ?? null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-invalid]=\"item.error ? true : null\"\n [attr.aria-describedby]=\"item.error ? errorId() : null\"\n (input)=\"onChange($event)\"\n />\n }\n}\n@if (item.error) {\n <span class=\"su-table-error\" [id]=\"errorId()\">{{ item.error }}</span>\n}\n",
|
|
159
|
+
styles: [":host{display:flex;flex-direction:column;gap:.2rem}.su-table-control{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-control:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-control{min-height:2rem;min-width:6rem;padding:.3rem .45rem;width:100%}.su-table-control[aria-invalid=true]{border-color:var(--su-table-danger-color, #b42318)}.su-table-checkbox{accent-color:var(--su-table-accent, #2563eb);height:1rem;margin:0;width:1rem}.su-table-checkbox:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-error{color:var(--su-table-danger-color, #b42318);font-size:.8em;font-weight:400}\n"]
|
|
160
|
+
}]
|
|
161
|
+
}],
|
|
162
|
+
propDecorators: {
|
|
163
|
+
field: [{
|
|
164
|
+
type: i0.Input,
|
|
165
|
+
args: [{
|
|
166
|
+
isSignal: true,
|
|
167
|
+
alias: "field",
|
|
168
|
+
required: true
|
|
169
|
+
}]
|
|
170
|
+
}],
|
|
171
|
+
controlId: [{
|
|
172
|
+
type: i0.Input,
|
|
173
|
+
args: [{
|
|
174
|
+
isSignal: true,
|
|
175
|
+
alias: "controlId",
|
|
176
|
+
required: true
|
|
177
|
+
}]
|
|
178
|
+
}],
|
|
179
|
+
ariaLabel: [{
|
|
180
|
+
type: i0.Input,
|
|
181
|
+
args: [{
|
|
182
|
+
isSignal: true,
|
|
183
|
+
alias: "ariaLabel",
|
|
184
|
+
required: false
|
|
185
|
+
}]
|
|
186
|
+
}],
|
|
187
|
+
mixedLabel: [{
|
|
188
|
+
type: i0.Input,
|
|
189
|
+
args: [{
|
|
190
|
+
isSignal: true,
|
|
191
|
+
alias: "mixedLabel",
|
|
192
|
+
required: true
|
|
193
|
+
}]
|
|
194
|
+
}],
|
|
195
|
+
valueChange: [{
|
|
196
|
+
type: i0.Output,
|
|
197
|
+
args: ["valueChange"]
|
|
198
|
+
}]
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
var SuTablePaginatorComponent = class SuTablePaginatorComponent {
|
|
202
|
+
pagination = input.required(...ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []);
|
|
203
|
+
labels = input.required(...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
204
|
+
controlId = input.required(...ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []);
|
|
205
|
+
pageChange = output();
|
|
206
|
+
pageSizeChange = output();
|
|
207
|
+
turn(page) {
|
|
208
|
+
const { pageCount } = this.pagination();
|
|
209
|
+
if (page >= 0 && page < pageCount) this.pageChange.emit(page);
|
|
210
|
+
}
|
|
211
|
+
onPageSize(event) {
|
|
212
|
+
if (event.target instanceof HTMLSelectElement) {
|
|
213
|
+
const { value } = event.target;
|
|
214
|
+
const size = this.pagination().pageSizes.find((item) => String(item) === value);
|
|
215
|
+
if (size !== void 0) this.pageSizeChange.emit(size);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
219
|
+
minVersion: "12.0.0",
|
|
220
|
+
version: "22.2.4",
|
|
221
|
+
ngImport: i0,
|
|
222
|
+
type: SuTablePaginatorComponent,
|
|
223
|
+
deps: [],
|
|
224
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
225
|
+
});
|
|
226
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
227
|
+
minVersion: "17.0.0",
|
|
228
|
+
version: "22.2.4",
|
|
229
|
+
type: SuTablePaginatorComponent,
|
|
230
|
+
isStandalone: true,
|
|
231
|
+
selector: "su-lib-table-paginator",
|
|
232
|
+
inputs: {
|
|
233
|
+
pagination: {
|
|
234
|
+
classPropertyName: "pagination",
|
|
235
|
+
publicName: "pagination",
|
|
236
|
+
isSignal: true,
|
|
237
|
+
isRequired: true,
|
|
238
|
+
transformFunction: null
|
|
239
|
+
},
|
|
240
|
+
labels: {
|
|
241
|
+
classPropertyName: "labels",
|
|
242
|
+
publicName: "labels",
|
|
243
|
+
isSignal: true,
|
|
244
|
+
isRequired: true,
|
|
245
|
+
transformFunction: null
|
|
246
|
+
},
|
|
247
|
+
controlId: {
|
|
248
|
+
classPropertyName: "controlId",
|
|
249
|
+
publicName: "controlId",
|
|
250
|
+
isSignal: true,
|
|
251
|
+
isRequired: true,
|
|
252
|
+
transformFunction: null
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
outputs: {
|
|
256
|
+
pageChange: "pageChange",
|
|
257
|
+
pageSizeChange: "pageSizeChange"
|
|
258
|
+
},
|
|
259
|
+
ngImport: i0,
|
|
260
|
+
template: "@let paging = pagination();\n@let t = labels();\n<nav class=\"su-table-paginator\" [attr.aria-label]=\"t.pagination\">\n @if (paging.pageSizes.length > 0) {\n <div class=\"su-table-paginator-size\">\n <label [for]=\"controlId()\">{{ t.rowsPerPage }}</label>\n <select class=\"su-table-paginator-select\" [id]=\"controlId()\" (change)=\"onPageSize($event)\">\n @for (size of paging.pageSizes; track size) {\n <option [value]=\"size\" [selected]=\"size === paging.pageSize\">{{ size === 'all' ? t.allRows : size }}</option>\n }\n </select>\n </div>\n }\n <span class=\"su-table-paginator-range\">{{ t.range(paging.rangeStart, paging.rangeEnd, paging.totalRows) }}</span>\n @if (paging.pageCount > 1) {\n <div class=\"su-table-paginator-pages\">\n <button\n type=\"button\"\n class=\"su-table-paginator-button\"\n [attr.aria-label]=\"t.previousPage\"\n [attr.aria-disabled]=\"paging.page === 0\"\n (click)=\"turn(paging.page - 1)\"\n >\n <span aria-hidden=\"true\">‹</span>\n </button>\n <span class=\"su-table-paginator-page\">{{ t.page(paging.page + 1, paging.pageCount) }}</span>\n <button\n type=\"button\"\n class=\"su-table-paginator-button\"\n [attr.aria-label]=\"t.nextPage\"\n [attr.aria-disabled]=\"paging.page === paging.pageCount - 1\"\n (click)=\"turn(paging.page + 1)\"\n >\n <span aria-hidden=\"true\">›</span>\n </button>\n </div>\n }\n</nav>\n",
|
|
261
|
+
styles: [":host{display:block;margin-top:.75rem}.su-table-paginator{align-items:center;display:flex;flex-wrap:wrap;font-size:.875em;gap:.5rem 1.25rem;justify-content:flex-end}.su-table-paginator-size,.su-table-paginator-pages{align-items:center;display:flex;gap:.5rem}.su-table-paginator-range,.su-table-paginator-page{font-variant-numeric:tabular-nums}.su-table-paginator-select,.su-table-paginator-button{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-paginator-select:focus-visible,.su-table-paginator-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-paginator-select,.su-table-paginator-button{min-height:2rem}.su-table-paginator-select{padding:.2rem .4rem}.su-table-paginator-button{cursor:pointer;font-size:1.1em;line-height:1;min-width:2rem}.su-table-paginator-button[aria-disabled=true]{cursor:not-allowed;opacity:.4}\n"],
|
|
262
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
266
|
+
minVersion: "12.0.0",
|
|
267
|
+
version: "22.2.4",
|
|
268
|
+
ngImport: i0,
|
|
269
|
+
type: SuTablePaginatorComponent,
|
|
270
|
+
decorators: [{
|
|
271
|
+
type: Component,
|
|
272
|
+
args: [{
|
|
273
|
+
selector: "su-lib-table-paginator",
|
|
274
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
275
|
+
template: "@let paging = pagination();\n@let t = labels();\n<nav class=\"su-table-paginator\" [attr.aria-label]=\"t.pagination\">\n @if (paging.pageSizes.length > 0) {\n <div class=\"su-table-paginator-size\">\n <label [for]=\"controlId()\">{{ t.rowsPerPage }}</label>\n <select class=\"su-table-paginator-select\" [id]=\"controlId()\" (change)=\"onPageSize($event)\">\n @for (size of paging.pageSizes; track size) {\n <option [value]=\"size\" [selected]=\"size === paging.pageSize\">{{ size === 'all' ? t.allRows : size }}</option>\n }\n </select>\n </div>\n }\n <span class=\"su-table-paginator-range\">{{ t.range(paging.rangeStart, paging.rangeEnd, paging.totalRows) }}</span>\n @if (paging.pageCount > 1) {\n <div class=\"su-table-paginator-pages\">\n <button\n type=\"button\"\n class=\"su-table-paginator-button\"\n [attr.aria-label]=\"t.previousPage\"\n [attr.aria-disabled]=\"paging.page === 0\"\n (click)=\"turn(paging.page - 1)\"\n >\n <span aria-hidden=\"true\">‹</span>\n </button>\n <span class=\"su-table-paginator-page\">{{ t.page(paging.page + 1, paging.pageCount) }}</span>\n <button\n type=\"button\"\n class=\"su-table-paginator-button\"\n [attr.aria-label]=\"t.nextPage\"\n [attr.aria-disabled]=\"paging.page === paging.pageCount - 1\"\n (click)=\"turn(paging.page + 1)\"\n >\n <span aria-hidden=\"true\">›</span>\n </button>\n </div>\n }\n</nav>\n",
|
|
276
|
+
styles: [":host{display:block;margin-top:.75rem}.su-table-paginator{align-items:center;display:flex;flex-wrap:wrap;font-size:.875em;gap:.5rem 1.25rem;justify-content:flex-end}.su-table-paginator-size,.su-table-paginator-pages{align-items:center;display:flex;gap:.5rem}.su-table-paginator-range,.su-table-paginator-page{font-variant-numeric:tabular-nums}.su-table-paginator-select,.su-table-paginator-button{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-paginator-select:focus-visible,.su-table-paginator-button:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-paginator-select,.su-table-paginator-button{min-height:2rem}.su-table-paginator-select{padding:.2rem .4rem}.su-table-paginator-button{cursor:pointer;font-size:1.1em;line-height:1;min-width:2rem}.su-table-paginator-button[aria-disabled=true]{cursor:not-allowed;opacity:.4}\n"]
|
|
277
|
+
}]
|
|
278
|
+
}],
|
|
279
|
+
propDecorators: {
|
|
280
|
+
pagination: [{
|
|
281
|
+
type: i0.Input,
|
|
282
|
+
args: [{
|
|
283
|
+
isSignal: true,
|
|
284
|
+
alias: "pagination",
|
|
285
|
+
required: true
|
|
286
|
+
}]
|
|
287
|
+
}],
|
|
288
|
+
labels: [{
|
|
289
|
+
type: i0.Input,
|
|
290
|
+
args: [{
|
|
291
|
+
isSignal: true,
|
|
292
|
+
alias: "labels",
|
|
293
|
+
required: true
|
|
294
|
+
}]
|
|
295
|
+
}],
|
|
296
|
+
controlId: [{
|
|
297
|
+
type: i0.Input,
|
|
298
|
+
args: [{
|
|
299
|
+
isSignal: true,
|
|
300
|
+
alias: "controlId",
|
|
301
|
+
required: true
|
|
302
|
+
}]
|
|
303
|
+
}],
|
|
304
|
+
pageChange: [{
|
|
305
|
+
type: i0.Output,
|
|
306
|
+
args: ["pageChange"]
|
|
307
|
+
}],
|
|
308
|
+
pageSizeChange: [{
|
|
309
|
+
type: i0.Output,
|
|
310
|
+
args: ["pageSizeChange"]
|
|
311
|
+
}]
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
var SuTablePinDirective = class SuTablePinDirective {
|
|
315
|
+
placement = input(null, {
|
|
316
|
+
...ngDevMode ? { debugName: "placement" } : /* istanbul ignore next */ {},
|
|
317
|
+
alias: "suTablePin"
|
|
318
|
+
});
|
|
319
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
320
|
+
minVersion: "12.0.0",
|
|
321
|
+
version: "22.2.4",
|
|
322
|
+
ngImport: i0,
|
|
323
|
+
type: SuTablePinDirective,
|
|
324
|
+
deps: [],
|
|
325
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
326
|
+
});
|
|
327
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
328
|
+
minVersion: "17.1.0",
|
|
329
|
+
version: "22.2.4",
|
|
330
|
+
type: SuTablePinDirective,
|
|
331
|
+
isStandalone: true,
|
|
332
|
+
selector: "[suTablePin]",
|
|
333
|
+
inputs: { placement: {
|
|
334
|
+
classPropertyName: "placement",
|
|
335
|
+
publicName: "suTablePin",
|
|
336
|
+
isSignal: true,
|
|
337
|
+
isRequired: false,
|
|
338
|
+
transformFunction: null
|
|
339
|
+
} },
|
|
340
|
+
host: { properties: {
|
|
341
|
+
"class.is-pinned-start": "placement()?.pin === 'start'",
|
|
342
|
+
"class.is-pinned-end": "placement()?.pin === 'end'",
|
|
343
|
+
"class.is-pinned-edge": "placement()?.edge",
|
|
344
|
+
"style.inset-inline-start.px": "placement()?.pin === 'start' ? placement()?.offset : null",
|
|
345
|
+
"style.inset-inline-end.px": "placement()?.pin === 'end' ? placement()?.offset : null"
|
|
346
|
+
} },
|
|
347
|
+
ngImport: i0
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
351
|
+
minVersion: "12.0.0",
|
|
352
|
+
version: "22.2.4",
|
|
353
|
+
ngImport: i0,
|
|
354
|
+
type: SuTablePinDirective,
|
|
355
|
+
decorators: [{
|
|
356
|
+
type: Directive,
|
|
357
|
+
args: [{
|
|
358
|
+
selector: "[suTablePin]",
|
|
359
|
+
host: {
|
|
360
|
+
"[class.is-pinned-start]": "placement()?.pin === 'start'",
|
|
361
|
+
"[class.is-pinned-end]": "placement()?.pin === 'end'",
|
|
362
|
+
"[class.is-pinned-edge]": "placement()?.edge",
|
|
363
|
+
"[style.inset-inline-start.px]": "placement()?.pin === 'start' ? placement()?.offset : null",
|
|
364
|
+
"[style.inset-inline-end.px]": "placement()?.pin === 'end' ? placement()?.offset : null"
|
|
365
|
+
}
|
|
366
|
+
}]
|
|
367
|
+
}],
|
|
368
|
+
propDecorators: { placement: [{
|
|
369
|
+
type: i0.Input,
|
|
370
|
+
args: [{
|
|
371
|
+
isSignal: true,
|
|
372
|
+
alias: "suTablePin",
|
|
373
|
+
required: false
|
|
374
|
+
}]
|
|
375
|
+
}] }
|
|
376
|
+
});
|
|
377
|
+
var SuTablePinIconComponent = class SuTablePinIconComponent {
|
|
378
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
379
|
+
minVersion: "12.0.0",
|
|
380
|
+
version: "22.2.4",
|
|
381
|
+
ngImport: i0,
|
|
382
|
+
type: SuTablePinIconComponent,
|
|
383
|
+
deps: [],
|
|
384
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
385
|
+
});
|
|
386
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
387
|
+
minVersion: "14.0.0",
|
|
388
|
+
version: "22.2.4",
|
|
389
|
+
type: SuTablePinIconComponent,
|
|
390
|
+
isStandalone: true,
|
|
391
|
+
selector: "svg[suTablePinIcon]",
|
|
392
|
+
host: { attributes: {
|
|
393
|
+
"viewBox": "0 0 16 16",
|
|
394
|
+
"aria-hidden": "true",
|
|
395
|
+
"fill": "currentColor"
|
|
396
|
+
} },
|
|
397
|
+
ngImport: i0,
|
|
398
|
+
template: `<svg:path
|
|
399
|
+
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" />`,
|
|
400
|
+
isInline: true,
|
|
401
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
405
|
+
minVersion: "12.0.0",
|
|
406
|
+
version: "22.2.4",
|
|
407
|
+
ngImport: i0,
|
|
408
|
+
type: SuTablePinIconComponent,
|
|
409
|
+
decorators: [{
|
|
410
|
+
type: Component,
|
|
411
|
+
args: [{
|
|
412
|
+
selector: "svg[suTablePinIcon]",
|
|
413
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
414
|
+
host: {
|
|
415
|
+
viewBox: "0 0 16 16",
|
|
416
|
+
"aria-hidden": "true",
|
|
417
|
+
fill: "currentColor"
|
|
418
|
+
},
|
|
419
|
+
template: `<svg:path
|
|
420
|
+
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" />`
|
|
421
|
+
}]
|
|
422
|
+
}]
|
|
423
|
+
});
|
|
424
|
+
var SuTableToolbarComponent = class SuTableToolbarComponent {
|
|
425
|
+
labels = input.required(...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
426
|
+
controlId = input.required(...ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []);
|
|
427
|
+
searchable = input(false, ...ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []);
|
|
428
|
+
query = input("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
429
|
+
columnControls = input(false, ...ngDevMode ? [{ debugName: "columnControls" }] : /* istanbul ignore next */ []);
|
|
430
|
+
columns = input([], ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
431
|
+
queryChange = output();
|
|
432
|
+
pinnableChange = output();
|
|
433
|
+
visibilityChange = output();
|
|
434
|
+
allVisibilityChange = output();
|
|
435
|
+
menu = viewChild("menu", ...ngDevMode ? [{ debugName: "menu" }] : /* istanbul ignore next */ []);
|
|
436
|
+
menuButton = viewChild("menuButton", ...ngDevMode ? [{ debugName: "menuButton" }] : /* istanbul ignore next */ []);
|
|
437
|
+
columnsOpen = signal(false, ...ngDevMode ? [{ debugName: "columnsOpen" }] : /* istanbul ignore next */ []);
|
|
438
|
+
columnQuery = signal("", ...ngDevMode ? [{ debugName: "columnQuery" }] : /* istanbul ignore next */ []);
|
|
439
|
+
listedColumns = computed(() => {
|
|
440
|
+
const query = this.columnQuery().trim().toLocaleLowerCase();
|
|
441
|
+
return this.columns().filter((column) => column.header.toLocaleLowerCase().includes(query));
|
|
442
|
+
}, ...ngDevMode ? [{ debugName: "listedColumns" }] : /* istanbul ignore next */ []);
|
|
443
|
+
shownCount = computed(() => this.columns().filter((column) => column.visible).length, ...ngDevMode ? [{ debugName: "shownCount" }] : /* istanbul ignore next */ []);
|
|
444
|
+
toggleMenu() {
|
|
445
|
+
this.columnsOpen.update((open) => !open);
|
|
446
|
+
this.columnQuery.set("");
|
|
447
|
+
}
|
|
448
|
+
closeMenu() {
|
|
449
|
+
this.columnsOpen.set(false);
|
|
450
|
+
this.menuButton()?.nativeElement.focus();
|
|
451
|
+
}
|
|
452
|
+
closeOutside(event) {
|
|
453
|
+
const menu = this.menu()?.nativeElement;
|
|
454
|
+
if (menu && event.target instanceof Node && !menu.contains(event.target)) this.columnsOpen.set(false);
|
|
455
|
+
}
|
|
456
|
+
onQuery(event) {
|
|
457
|
+
if (event.target instanceof HTMLInputElement) this.queryChange.emit(event.target.value);
|
|
458
|
+
}
|
|
459
|
+
clearQuery(event) {
|
|
460
|
+
if (event.target instanceof HTMLInputElement && event.target.value !== "") {
|
|
461
|
+
event.preventDefault();
|
|
462
|
+
event.stopPropagation();
|
|
463
|
+
event.target.value = "";
|
|
464
|
+
this.queryChange.emit("");
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
onColumnQuery(event) {
|
|
468
|
+
if (event.target instanceof HTMLInputElement) this.columnQuery.set(event.target.value);
|
|
469
|
+
}
|
|
470
|
+
onVisible(key, event) {
|
|
471
|
+
if (event.target instanceof HTMLInputElement) this.visibilityChange.emit({
|
|
472
|
+
key,
|
|
473
|
+
visible: event.target.checked
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
onAllVisible(event) {
|
|
477
|
+
if (event.target instanceof HTMLInputElement) this.allVisibilityChange.emit(event.target.checked);
|
|
478
|
+
}
|
|
479
|
+
togglePinnable(column) {
|
|
480
|
+
this.pinnableChange.emit({
|
|
481
|
+
key: column.key,
|
|
482
|
+
pinnable: !column.pinnable
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
486
|
+
minVersion: "12.0.0",
|
|
487
|
+
version: "22.2.4",
|
|
488
|
+
ngImport: i0,
|
|
489
|
+
type: SuTableToolbarComponent,
|
|
490
|
+
deps: [],
|
|
491
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
492
|
+
});
|
|
493
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
494
|
+
minVersion: "17.0.0",
|
|
495
|
+
version: "22.2.4",
|
|
496
|
+
type: SuTableToolbarComponent,
|
|
497
|
+
isStandalone: true,
|
|
498
|
+
selector: "su-lib-table-toolbar",
|
|
499
|
+
inputs: {
|
|
500
|
+
labels: {
|
|
501
|
+
classPropertyName: "labels",
|
|
502
|
+
publicName: "labels",
|
|
503
|
+
isSignal: true,
|
|
504
|
+
isRequired: true,
|
|
505
|
+
transformFunction: null
|
|
506
|
+
},
|
|
507
|
+
controlId: {
|
|
508
|
+
classPropertyName: "controlId",
|
|
509
|
+
publicName: "controlId",
|
|
510
|
+
isSignal: true,
|
|
511
|
+
isRequired: true,
|
|
512
|
+
transformFunction: null
|
|
513
|
+
},
|
|
514
|
+
searchable: {
|
|
515
|
+
classPropertyName: "searchable",
|
|
516
|
+
publicName: "searchable",
|
|
517
|
+
isSignal: true,
|
|
518
|
+
isRequired: false,
|
|
519
|
+
transformFunction: null
|
|
520
|
+
},
|
|
521
|
+
query: {
|
|
522
|
+
classPropertyName: "query",
|
|
523
|
+
publicName: "query",
|
|
524
|
+
isSignal: true,
|
|
525
|
+
isRequired: false,
|
|
526
|
+
transformFunction: null
|
|
527
|
+
},
|
|
528
|
+
columnControls: {
|
|
529
|
+
classPropertyName: "columnControls",
|
|
530
|
+
publicName: "columnControls",
|
|
531
|
+
isSignal: true,
|
|
532
|
+
isRequired: false,
|
|
533
|
+
transformFunction: null
|
|
534
|
+
},
|
|
535
|
+
columns: {
|
|
536
|
+
classPropertyName: "columns",
|
|
537
|
+
publicName: "columns",
|
|
538
|
+
isSignal: true,
|
|
539
|
+
isRequired: false,
|
|
540
|
+
transformFunction: null
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
outputs: {
|
|
544
|
+
queryChange: "queryChange",
|
|
545
|
+
pinnableChange: "pinnableChange",
|
|
546
|
+
visibilityChange: "visibilityChange",
|
|
547
|
+
allVisibilityChange: "allVisibilityChange"
|
|
548
|
+
},
|
|
549
|
+
host: { listeners: { "document:pointerdown": "closeOutside($event)" } },
|
|
550
|
+
viewQueries: [{
|
|
551
|
+
propertyName: "menu",
|
|
552
|
+
first: true,
|
|
553
|
+
predicate: ["menu"],
|
|
554
|
+
descendants: true,
|
|
555
|
+
isSignal: true
|
|
556
|
+
}, {
|
|
557
|
+
propertyName: "menuButton",
|
|
558
|
+
first: true,
|
|
559
|
+
predicate: ["menuButton"],
|
|
560
|
+
descendants: true,
|
|
561
|
+
isSignal: true
|
|
562
|
+
}],
|
|
563
|
+
ngImport: i0,
|
|
564
|
+
template: "@let t = labels();\n<div class=\"su-table-bar\">\n @if (searchable()) {\n <div class=\"su-table-search\">\n <svg class=\"su-table-search-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" />\n <path d=\"m10.5 10.5 3.5 3.5\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n <input\n type=\"search\"\n class=\"su-table-search-input\"\n [id]=\"controlId() + '-search'\"\n [value]=\"query()\"\n [attr.aria-label]=\"t.search\"\n [attr.placeholder]=\"t.search\"\n (input)=\"onQuery($event)\"\n (keydown.escape)=\"clearQuery($event)\"\n />\n </div>\n }\n @if (columnControls()) {\n <div #menu class=\"su-table-columns\">\n <button\n #menuButton\n type=\"button\"\n class=\"su-table-button\"\n [attr.aria-expanded]=\"columnsOpen()\"\n [attr.aria-controls]=\"controlId() + '-columns'\"\n (click)=\"toggleMenu()\"\n >\n {{ t.columns }}\n </button>\n @if (columnsOpen()) {\n <div\n class=\"su-table-menu\"\n role=\"group\"\n [id]=\"controlId() + '-columns'\"\n [attr.aria-labelledby]=\"controlId() + '-columns-title'\"\n (keydown.escape)=\"closeMenu()\"\n >\n <p class=\"su-table-menu-title\" [id]=\"controlId() + '-columns-title'\">{{ t.columns }}</p>\n <div class=\"su-table-search\">\n <svg class=\"su-table-search-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" />\n <path d=\"m10.5 10.5 3.5 3.5\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n <input\n type=\"search\"\n class=\"su-table-search-input\"\n [value]=\"columnQuery()\"\n [attr.aria-label]=\"t.searchColumns\"\n [attr.placeholder]=\"t.search\"\n (input)=\"onColumnQuery($event)\"\n />\n </div>\n <label class=\"su-table-menu-item is-all\">\n <input\n type=\"checkbox\"\n [checked]=\"shownCount() === columns().length\"\n [indeterminate]=\"shownCount() > 0 && shownCount() < columns().length\"\n (change)=\"onAllVisible($event)\"\n />\n <span>{{ t.allColumns }}</span>\n </label>\n <ul class=\"su-table-menu-list\">\n @for (column of listedColumns(); track column.key) {\n <li class=\"su-table-menu-item\">\n <label>\n <input\n type=\"checkbox\"\n [checked]=\"column.visible\"\n [disabled]=\"column.visible && shownCount() === 1\"\n (change)=\"onVisible(column.key, $event)\"\n />\n <span>{{ column.header }}</span>\n </label>\n <button\n type=\"button\"\n class=\"su-table-menu-pin\"\n [attr.aria-label]=\"t.showPin(column.header)\"\n [attr.aria-pressed]=\"column.pinnable\"\n [disabled]=\"!column.visible\"\n (click)=\"togglePinnable(column)\"\n >\n <svg suTablePinIcon width=\"13\" height=\"13\"></svg>\n </button>\n </li>\n }\n </ul>\n </div>\n }\n </div>\n }\n</div>\n",
|
|
565
|
+
styles: [":host{display:block}.su-table-bar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end;margin-bottom:.75rem}.su-table-search{align-items:center;display:flex;flex:1 1 14rem;margin-inline-end:auto;max-width:22rem;position:relative}.su-table-search-icon{inset-inline-start:.6rem;opacity:.55;pointer-events:none;position:absolute}.su-table-search-input{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-search-input:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-search-input{min-height:2.1rem;padding:.3rem .6rem .3rem 2rem;width:100%}.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-columns{position:relative}.su-table-menu{background:var(--su-table-menu-background, Canvas);border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);box-shadow:var(--su-table-menu-shadow, 0 12px 32px rgba(0, 0, 0, .18));box-sizing:border-box;display:grid;gap:.6rem;inset-inline-end:0;max-height:22rem;max-width:calc(100vw - 2rem);overflow:auto;padding:.85rem;position:absolute;top:calc(100% + .4rem);width:16rem;z-index:10}.su-table-menu .su-table-search{flex:none;margin:0;max-width:none}.su-table-menu-title{font-weight:600;margin:0}.su-table-menu-list{display:grid;gap:.15rem;list-style:none;margin:0;padding:0}.su-table-menu-item{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.su-table-menu-item label{align-items:center;cursor:pointer;display:flex;flex:1;gap:.55rem;min-width:0;padding:.3rem 0}.su-table-menu-item input{accent-color:var(--su-table-accent, #2563eb);flex:none;height:1rem;margin:0;width:1rem}.su-table-menu-item input:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-menu-item.is-all{border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));cursor:pointer;gap:.55rem;justify-content:flex-start;padding:.3rem 0 .5rem}.su-table-menu-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-menu-pin{align-items:center;background:none;border:1px solid transparent;border-radius:6px;color:inherit;cursor:pointer;display:inline-flex;height:1.75rem;justify-content:center;width:1.75rem}.su-table-menu-pin svg{opacity:.35}.su-table-menu-pin[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-menu-pin[aria-pressed=true] svg{opacity:1}.su-table-menu-pin:disabled{cursor:not-allowed;opacity:.4}\n"],
|
|
566
|
+
dependencies: [{
|
|
567
|
+
kind: "component",
|
|
568
|
+
type: SuTablePinIconComponent,
|
|
569
|
+
selector: "svg[suTablePinIcon]"
|
|
570
|
+
}],
|
|
571
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
575
|
+
minVersion: "12.0.0",
|
|
576
|
+
version: "22.2.4",
|
|
577
|
+
ngImport: i0,
|
|
578
|
+
type: SuTableToolbarComponent,
|
|
579
|
+
decorators: [{
|
|
580
|
+
type: Component,
|
|
581
|
+
args: [{
|
|
582
|
+
selector: "su-lib-table-toolbar",
|
|
583
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
584
|
+
imports: [SuTablePinIconComponent],
|
|
585
|
+
host: { "(document:pointerdown)": "closeOutside($event)" },
|
|
586
|
+
template: "@let t = labels();\n<div class=\"su-table-bar\">\n @if (searchable()) {\n <div class=\"su-table-search\">\n <svg class=\"su-table-search-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" />\n <path d=\"m10.5 10.5 3.5 3.5\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n <input\n type=\"search\"\n class=\"su-table-search-input\"\n [id]=\"controlId() + '-search'\"\n [value]=\"query()\"\n [attr.aria-label]=\"t.search\"\n [attr.placeholder]=\"t.search\"\n (input)=\"onQuery($event)\"\n (keydown.escape)=\"clearQuery($event)\"\n />\n </div>\n }\n @if (columnControls()) {\n <div #menu class=\"su-table-columns\">\n <button\n #menuButton\n type=\"button\"\n class=\"su-table-button\"\n [attr.aria-expanded]=\"columnsOpen()\"\n [attr.aria-controls]=\"controlId() + '-columns'\"\n (click)=\"toggleMenu()\"\n >\n {{ t.columns }}\n </button>\n @if (columnsOpen()) {\n <div\n class=\"su-table-menu\"\n role=\"group\"\n [id]=\"controlId() + '-columns'\"\n [attr.aria-labelledby]=\"controlId() + '-columns-title'\"\n (keydown.escape)=\"closeMenu()\"\n >\n <p class=\"su-table-menu-title\" [id]=\"controlId() + '-columns-title'\">{{ t.columns }}</p>\n <div class=\"su-table-search\">\n <svg class=\"su-table-search-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"4.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" />\n <path d=\"m10.5 10.5 3.5 3.5\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" />\n </svg>\n <input\n type=\"search\"\n class=\"su-table-search-input\"\n [value]=\"columnQuery()\"\n [attr.aria-label]=\"t.searchColumns\"\n [attr.placeholder]=\"t.search\"\n (input)=\"onColumnQuery($event)\"\n />\n </div>\n <label class=\"su-table-menu-item is-all\">\n <input\n type=\"checkbox\"\n [checked]=\"shownCount() === columns().length\"\n [indeterminate]=\"shownCount() > 0 && shownCount() < columns().length\"\n (change)=\"onAllVisible($event)\"\n />\n <span>{{ t.allColumns }}</span>\n </label>\n <ul class=\"su-table-menu-list\">\n @for (column of listedColumns(); track column.key) {\n <li class=\"su-table-menu-item\">\n <label>\n <input\n type=\"checkbox\"\n [checked]=\"column.visible\"\n [disabled]=\"column.visible && shownCount() === 1\"\n (change)=\"onVisible(column.key, $event)\"\n />\n <span>{{ column.header }}</span>\n </label>\n <button\n type=\"button\"\n class=\"su-table-menu-pin\"\n [attr.aria-label]=\"t.showPin(column.header)\"\n [attr.aria-pressed]=\"column.pinnable\"\n [disabled]=\"!column.visible\"\n (click)=\"togglePinnable(column)\"\n >\n <svg suTablePinIcon width=\"13\" height=\"13\"></svg>\n </button>\n </li>\n }\n </ul>\n </div>\n }\n </div>\n }\n</div>\n",
|
|
587
|
+
styles: [":host{display:block}.su-table-bar{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end;margin-bottom:.75rem}.su-table-search{align-items:center;display:flex;flex:1 1 14rem;margin-inline-end:auto;max-width:22rem;position:relative}.su-table-search-icon{inset-inline-start:.6rem;opacity:.55;pointer-events:none;position:absolute}.su-table-search-input{background:var(--su-table-input-background, transparent);border:var(--su-table-input-border, 1px solid rgba(0, 0, 0, .25));border-radius:var(--su-table-input-radius, 6px);box-sizing:border-box;color:inherit;font:inherit}.su-table-search-input:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-search-input{min-height:2.1rem;padding:.3rem .6rem .3rem 2rem;width:100%}.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-columns{position:relative}.su-table-menu{background:var(--su-table-menu-background, Canvas);border:var(--su-table-border, 1px solid rgba(0, 0, 0, .12));border-radius:var(--su-table-radius, 10px);box-shadow:var(--su-table-menu-shadow, 0 12px 32px rgba(0, 0, 0, .18));box-sizing:border-box;display:grid;gap:.6rem;inset-inline-end:0;max-height:22rem;max-width:calc(100vw - 2rem);overflow:auto;padding:.85rem;position:absolute;top:calc(100% + .4rem);width:16rem;z-index:10}.su-table-menu .su-table-search{flex:none;margin:0;max-width:none}.su-table-menu-title{font-weight:600;margin:0}.su-table-menu-list{display:grid;gap:.15rem;list-style:none;margin:0;padding:0}.su-table-menu-item{align-items:center;display:flex;gap:.5rem;justify-content:space-between}.su-table-menu-item label{align-items:center;cursor:pointer;display:flex;flex:1;gap:.55rem;min-width:0;padding:.3rem 0}.su-table-menu-item input{accent-color:var(--su-table-accent, #2563eb);flex:none;height:1rem;margin:0;width:1rem}.su-table-menu-item input:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-menu-item.is-all{border-bottom:var(--su-table-row-border, 1px solid rgba(0, 0, 0, .08));cursor:pointer;gap:.55rem;justify-content:flex-start;padding:.3rem 0 .5rem}.su-table-menu-pin:focus-visible{outline:var(--su-table-focus-outline, 2px solid currentColor);outline-offset:2px}.su-table-menu-pin{align-items:center;background:none;border:1px solid transparent;border-radius:6px;color:inherit;cursor:pointer;display:inline-flex;height:1.75rem;justify-content:center;width:1.75rem}.su-table-menu-pin svg{opacity:.35}.su-table-menu-pin[aria-pressed=true]{border-color:var(--su-table-accent, #2563eb);color:var(--su-table-accent, #2563eb)}.su-table-menu-pin[aria-pressed=true] svg{opacity:1}.su-table-menu-pin:disabled{cursor:not-allowed;opacity:.4}\n"]
|
|
588
|
+
}]
|
|
589
|
+
}],
|
|
590
|
+
propDecorators: {
|
|
591
|
+
labels: [{
|
|
592
|
+
type: i0.Input,
|
|
593
|
+
args: [{
|
|
594
|
+
isSignal: true,
|
|
595
|
+
alias: "labels",
|
|
596
|
+
required: true
|
|
597
|
+
}]
|
|
598
|
+
}],
|
|
599
|
+
controlId: [{
|
|
600
|
+
type: i0.Input,
|
|
601
|
+
args: [{
|
|
602
|
+
isSignal: true,
|
|
603
|
+
alias: "controlId",
|
|
604
|
+
required: true
|
|
605
|
+
}]
|
|
606
|
+
}],
|
|
607
|
+
searchable: [{
|
|
608
|
+
type: i0.Input,
|
|
609
|
+
args: [{
|
|
610
|
+
isSignal: true,
|
|
611
|
+
alias: "searchable",
|
|
612
|
+
required: false
|
|
613
|
+
}]
|
|
614
|
+
}],
|
|
615
|
+
query: [{
|
|
616
|
+
type: i0.Input,
|
|
617
|
+
args: [{
|
|
618
|
+
isSignal: true,
|
|
619
|
+
alias: "query",
|
|
620
|
+
required: false
|
|
621
|
+
}]
|
|
622
|
+
}],
|
|
623
|
+
columnControls: [{
|
|
624
|
+
type: i0.Input,
|
|
625
|
+
args: [{
|
|
626
|
+
isSignal: true,
|
|
627
|
+
alias: "columnControls",
|
|
628
|
+
required: false
|
|
629
|
+
}]
|
|
630
|
+
}],
|
|
631
|
+
columns: [{
|
|
632
|
+
type: i0.Input,
|
|
633
|
+
args: [{
|
|
634
|
+
isSignal: true,
|
|
635
|
+
alias: "columns",
|
|
636
|
+
required: false
|
|
637
|
+
}]
|
|
638
|
+
}],
|
|
639
|
+
queryChange: [{
|
|
640
|
+
type: i0.Output,
|
|
641
|
+
args: ["queryChange"]
|
|
642
|
+
}],
|
|
643
|
+
pinnableChange: [{
|
|
644
|
+
type: i0.Output,
|
|
645
|
+
args: ["pinnableChange"]
|
|
646
|
+
}],
|
|
647
|
+
visibilityChange: [{
|
|
648
|
+
type: i0.Output,
|
|
649
|
+
args: ["visibilityChange"]
|
|
650
|
+
}],
|
|
651
|
+
allVisibilityChange: [{
|
|
652
|
+
type: i0.Output,
|
|
653
|
+
args: ["allVisibilityChange"]
|
|
654
|
+
}],
|
|
655
|
+
menu: [{
|
|
656
|
+
type: i0.ViewChild,
|
|
657
|
+
args: ["menu", { isSignal: true }]
|
|
658
|
+
}],
|
|
659
|
+
menuButton: [{
|
|
660
|
+
type: i0.ViewChild,
|
|
661
|
+
args: ["menuButton", { isSignal: true }]
|
|
662
|
+
}]
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
const SU_TABLE_EDIT_ACTION = "edit";
|
|
666
|
+
let nextTableId = 0;
|
|
667
|
+
const MIN_SCROLLING_WIDTH = 96;
|
|
668
|
+
const SEARCH_DELAY = 200;
|
|
669
|
+
var SuTableComponent = class SuTableComponent {
|
|
670
|
+
columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
671
|
+
rows = input.required(...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
672
|
+
caption = input.required(...ngDevMode ? [{ debugName: "caption" }] : /* istanbul ignore next */ []);
|
|
673
|
+
showCaption = input(false, {
|
|
674
|
+
...ngDevMode ? { debugName: "showCaption" } : /* istanbul ignore next */ {},
|
|
675
|
+
transform: booleanAttribute
|
|
676
|
+
});
|
|
677
|
+
rowId = input(...ngDevMode ? [void 0, { debugName: "rowId" }] : /* istanbul ignore next */ []);
|
|
678
|
+
actions = input([], ...ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []);
|
|
679
|
+
selectable = input(false, {
|
|
680
|
+
...ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {},
|
|
681
|
+
transform: booleanAttribute
|
|
682
|
+
});
|
|
683
|
+
reorderable = input(false, {
|
|
684
|
+
...ngDevMode ? { debugName: "reorderable" } : /* istanbul ignore next */ {},
|
|
685
|
+
transform: booleanAttribute
|
|
686
|
+
});
|
|
687
|
+
columnControls = input(false, {
|
|
688
|
+
...ngDevMode ? { debugName: "columnControls" } : /* istanbul ignore next */ {},
|
|
689
|
+
transform: booleanAttribute
|
|
690
|
+
});
|
|
691
|
+
searchable = input(false, {
|
|
692
|
+
...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
|
|
693
|
+
transform: booleanAttribute
|
|
694
|
+
});
|
|
695
|
+
maxHeight = input(...ngDevMode ? [void 0, { debugName: "maxHeight" }] : /* istanbul ignore next */ []);
|
|
696
|
+
rowClass = input(...ngDevMode ? [void 0, { debugName: "rowClass" }] : /* istanbul ignore next */ []);
|
|
697
|
+
editOnDoubleClick = input(true, {
|
|
698
|
+
...ngDevMode ? { debugName: "editOnDoubleClick" } : /* istanbul ignore next */ {},
|
|
699
|
+
transform: booleanAttribute
|
|
700
|
+
});
|
|
701
|
+
pageSize = input(...ngDevMode ? [void 0, { debugName: "pageSize" }] : /* istanbul ignore next */ []);
|
|
702
|
+
pageSizes = input([], ...ngDevMode ? [{ debugName: "pageSizes" }] : /* istanbul ignore next */ []);
|
|
703
|
+
rowPinning = input(false, {
|
|
704
|
+
...ngDevMode ? { debugName: "rowPinning" } : /* istanbul ignore next */ {},
|
|
705
|
+
transform: booleanAttribute
|
|
706
|
+
});
|
|
707
|
+
pinnedRows = input(...ngDevMode ? [void 0, { debugName: "pinnedRows" }] : /* istanbul ignore next */ []);
|
|
708
|
+
labels = input({}, ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
709
|
+
edited = output();
|
|
710
|
+
reordered = output();
|
|
711
|
+
action = output();
|
|
712
|
+
sortChange = output();
|
|
713
|
+
selectionChange = output();
|
|
714
|
+
searchChange = output();
|
|
715
|
+
pinnedRowsChange = output();
|
|
716
|
+
columnsChange = output();
|
|
717
|
+
pageChange = output();
|
|
718
|
+
controller = new SuTableController();
|
|
719
|
+
host = inject(ElementRef);
|
|
720
|
+
cellTemplates = contentChildren(SuTableCellDirective, ...ngDevMode ? [{ debugName: "cellTemplates" }] : /* istanbul ignore next */ []);
|
|
721
|
+
focusHandleId = signal(null, ...ngDevMode ? [{ debugName: "focusHandleId" }] : /* istanbul ignore next */ []);
|
|
722
|
+
focusFieldId = signal(null, ...ngDevMode ? [{ debugName: "focusFieldId" }] : /* istanbul ignore next */ []);
|
|
723
|
+
searchTimer;
|
|
724
|
+
headerWidths = signal([], ...ngDevMode ? [{ debugName: "headerWidths" }] : /* istanbul ignore next */ []);
|
|
725
|
+
scrollerWidth = signal(0, ...ngDevMode ? [{ debugName: "scrollerWidth" }] : /* istanbul ignore next */ []);
|
|
726
|
+
headerLayout = computed(() => `${this.state().columns.map((column) => `${String(column.key)}:${column.pinned}`).join()}|${this.reorderable()}|${this.selectable()}|${this.hasActions()}|${this.state().pinnedRows.map((row) => row.id).join()}`, ...ngDevMode ? [{ debugName: "headerLayout" }] : /* istanbul ignore next */ []);
|
|
727
|
+
headerHeight = signal(0, ...ngDevMode ? [{ debugName: "headerHeight" }] : /* istanbul ignore next */ []);
|
|
728
|
+
pinnedRowHeights = signal([], ...ngDevMode ? [{ debugName: "pinnedRowHeights" }] : /* istanbul ignore next */ []);
|
|
729
|
+
tableId = `su-table-${nextTableId++}`;
|
|
730
|
+
state = signal(this.controller.state.get(), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
|
|
731
|
+
text = computed(() => ({
|
|
732
|
+
...SU_TABLE_LABELS$1,
|
|
733
|
+
...this.labels()
|
|
734
|
+
}), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
735
|
+
drag = signal(null, ...ngDevMode ? [{ debugName: "drag" }] : /* istanbul ignore next */ []);
|
|
736
|
+
inlineDraft = computed(() => {
|
|
737
|
+
const draft = this.state().draft;
|
|
738
|
+
return draft && !draft.bulk ? draft : null;
|
|
739
|
+
}, ...ngDevMode ? [{ debugName: "inlineDraft" }] : /* istanbul ignore next */ []);
|
|
740
|
+
bulkDraft = computed(() => {
|
|
741
|
+
const draft = this.state().draft;
|
|
742
|
+
return draft?.bulk ? draft : null;
|
|
743
|
+
}, ...ngDevMode ? [{ debugName: "bulkDraft" }] : /* istanbul ignore next */ []);
|
|
744
|
+
hasActions = computed(() => this.actions().length > 0 || this.rowPinning() || this.inlineDraft() !== null, ...ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []);
|
|
745
|
+
bodyRows = computed(() => {
|
|
746
|
+
const { pinnedRows, rows } = this.state();
|
|
747
|
+
return [...pinnedRows, ...rows];
|
|
748
|
+
}, ...ngDevMode ? [{ debugName: "bodyRows" }] : /* istanbul ignore next */ []);
|
|
749
|
+
scrolledFromStart = signal(false, ...ngDevMode ? [{ debugName: "scrolledFromStart" }] : /* istanbul ignore next */ []);
|
|
750
|
+
moreAtEnd = signal(false, ...ngDevMode ? [{ debugName: "moreAtEnd" }] : /* istanbul ignore next */ []);
|
|
751
|
+
scrolledFromTop = signal(false, ...ngDevMode ? [{ debugName: "scrolledFromTop" }] : /* istanbul ignore next */ []);
|
|
752
|
+
pinnedRowTops = computed(() => {
|
|
753
|
+
let top = this.headerHeight();
|
|
754
|
+
return this.pinnedRowHeights().map((height) => {
|
|
755
|
+
const rowTop = top;
|
|
756
|
+
top += height;
|
|
757
|
+
return rowTop;
|
|
758
|
+
});
|
|
759
|
+
}, ...ngDevMode ? [{ debugName: "pinnedRowTops" }] : /* istanbul ignore next */ []);
|
|
760
|
+
columnSlot = computed(() => Number(this.reorderable()) + Number(this.selectable()), ...ngDevMode ? [{ debugName: "columnSlot" }] : /* istanbul ignore next */ []);
|
|
761
|
+
placements = computed(() => {
|
|
762
|
+
const columns = this.state().columns;
|
|
763
|
+
const utilityPin = columns.some((column) => column.pinned === "start") ? "start" : null;
|
|
764
|
+
const actionsPin = columns.some((column) => column.pinned === "end") ? "end" : null;
|
|
765
|
+
const pins = [
|
|
766
|
+
...this.reorderable() ? [utilityPin] : [],
|
|
767
|
+
...this.selectable() ? [utilityPin] : [],
|
|
768
|
+
...columns.map((column) => column.pinned),
|
|
769
|
+
...this.hasActions() ? [actionsPin] : []
|
|
770
|
+
];
|
|
771
|
+
const widths = this.headerWidths();
|
|
772
|
+
if (pins.reduce((sum, pin, index) => pin ? sum + (widths[index] ?? 0) : sum, 0) > this.scrollerWidth() - MIN_SCROLLING_WIDTH) return pins.map(() => null);
|
|
773
|
+
const lastStart = pins.lastIndexOf("start");
|
|
774
|
+
const firstEnd = pins.indexOf("end");
|
|
775
|
+
const widthOf = (pin, from, to) => pins.slice(from, to).reduce((sum, slotPin, index) => slotPin === pin ? sum + (widths[from + index] ?? 0) : sum, 0);
|
|
776
|
+
return pins.map((pin, index) => pin ? {
|
|
777
|
+
pin,
|
|
778
|
+
offset: pin === "start" ? widthOf(pin, 0, index) : widthOf(pin, index + 1, pins.length),
|
|
779
|
+
edge: index === (pin === "start" ? lastStart : firstEnd)
|
|
780
|
+
} : null);
|
|
781
|
+
}, ...ngDevMode ? [{ debugName: "placements" }] : /* istanbul ignore next */ []);
|
|
782
|
+
columnCount = computed(() => this.state().columns.length + Number(this.reorderable()) + Number(this.selectable()) + Number(this.hasActions()), ...ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []);
|
|
783
|
+
constructor() {
|
|
784
|
+
const unsubscribe = this.controller.state.subscribe((state) => this.state.set(state));
|
|
785
|
+
inject(DestroyRef).onDestroy(() => {
|
|
786
|
+
unsubscribe();
|
|
787
|
+
clearTimeout(this.searchTimer);
|
|
788
|
+
});
|
|
789
|
+
effect(() => {
|
|
790
|
+
const options = {
|
|
791
|
+
columns: this.columns(),
|
|
792
|
+
rowId: this.rowId(),
|
|
793
|
+
actions: this.actions(),
|
|
794
|
+
labels: this.labels(),
|
|
795
|
+
pageSizes: this.pageSizes()
|
|
796
|
+
};
|
|
797
|
+
untracked(() => this.controller.configure(options));
|
|
798
|
+
});
|
|
799
|
+
effect(() => {
|
|
800
|
+
const rows = this.rows();
|
|
801
|
+
untracked(() => this.controller.setRows(rows));
|
|
802
|
+
});
|
|
803
|
+
effect(() => {
|
|
804
|
+
const pinnedRows = this.pinnedRows();
|
|
805
|
+
if (pinnedRows !== void 0) untracked(() => this.controller.configure({ pinnedRows }));
|
|
806
|
+
});
|
|
807
|
+
effect(() => {
|
|
808
|
+
const pageSize = this.pageSize();
|
|
809
|
+
if (pageSize !== void 0) untracked(() => this.controller.configure({ pageSize }));
|
|
810
|
+
});
|
|
811
|
+
afterRenderEffect((onCleanup) => {
|
|
812
|
+
this.headerLayout();
|
|
813
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
814
|
+
const host = this.host.nativeElement;
|
|
815
|
+
const scroller = host.querySelector(".su-table-scroll");
|
|
816
|
+
const headers = [...host.querySelectorAll("thead th")];
|
|
817
|
+
const head = host.querySelector("thead");
|
|
818
|
+
const pinnedRows = [...host.querySelectorAll("tbody > tr.is-pinned-row")];
|
|
819
|
+
const observer = new ResizeObserver(() => {
|
|
820
|
+
this.headerHeight.set(head?.getBoundingClientRect().height ?? 0);
|
|
821
|
+
const heights = pinnedRows.map((row) => row.getBoundingClientRect().height);
|
|
822
|
+
const currentHeights = untracked(() => this.pinnedRowHeights());
|
|
823
|
+
if (heights.length !== currentHeights.length || heights.some((height, index) => height !== currentHeights[index])) this.pinnedRowHeights.set(heights);
|
|
824
|
+
const widths = headers.map((header) => header.getBoundingClientRect().width);
|
|
825
|
+
const current = untracked(() => this.headerWidths());
|
|
826
|
+
if (widths.some((width, index) => width !== current[index])) this.headerWidths.set(widths);
|
|
827
|
+
if (scroller) {
|
|
828
|
+
this.scrollerWidth.set(scroller.clientWidth);
|
|
829
|
+
this.updateScrollEdges(scroller);
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
[...headers, ...pinnedRows].forEach((element) => observer.observe(element));
|
|
833
|
+
if (scroller) observer.observe(scroller);
|
|
834
|
+
onCleanup(() => observer.disconnect());
|
|
835
|
+
});
|
|
836
|
+
afterRenderEffect(() => {
|
|
837
|
+
const id = this.focusFieldId();
|
|
838
|
+
const field = id ? document.getElementById(id) : null;
|
|
839
|
+
if (field instanceof HTMLInputElement || field instanceof HTMLTextAreaElement) {
|
|
840
|
+
field.focus();
|
|
841
|
+
field.select();
|
|
842
|
+
} else field?.focus();
|
|
843
|
+
if (field) this.focusFieldId.set(null);
|
|
844
|
+
});
|
|
845
|
+
afterRenderEffect(() => {
|
|
846
|
+
const id = this.focusHandleId();
|
|
847
|
+
this.state();
|
|
848
|
+
const handle = this.host.nativeElement.querySelector(`[data-su-handle="${id}"]`);
|
|
849
|
+
if (id !== null && handle && document.activeElement !== handle) handle.focus();
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
cellTemplate(key) {
|
|
853
|
+
return this.cellTemplates().find((cell) => cell.key() === String(key))?.template ?? null;
|
|
854
|
+
}
|
|
855
|
+
inlineField(key) {
|
|
856
|
+
return this.inlineDraft()?.fields.find((field) => field.key === key) ?? null;
|
|
857
|
+
}
|
|
858
|
+
controlId(id, key) {
|
|
859
|
+
return `${this.tableId}-${id}-${String(key)}`;
|
|
860
|
+
}
|
|
861
|
+
toggleColumnPin(key, pinned) {
|
|
862
|
+
this.controller.pinColumn(key, pinned ? null : "start");
|
|
863
|
+
this.columnsChange.emit(this.state().allColumns);
|
|
864
|
+
}
|
|
865
|
+
setColumnPinnable({ key, pinnable }) {
|
|
866
|
+
this.controller.setColumnPinnable(key, pinnable);
|
|
867
|
+
this.columnsChange.emit(this.state().allColumns);
|
|
868
|
+
}
|
|
869
|
+
setColumnsVisible(visible) {
|
|
870
|
+
this.controller.setColumnsVisible(visible);
|
|
871
|
+
this.columnsChange.emit(this.state().allColumns);
|
|
872
|
+
}
|
|
873
|
+
setColumnVisible({ key, visible }) {
|
|
874
|
+
this.controller.setColumnVisible(key, visible);
|
|
875
|
+
this.columnsChange.emit(this.state().allColumns);
|
|
876
|
+
}
|
|
877
|
+
search(query) {
|
|
878
|
+
clearTimeout(this.searchTimer);
|
|
879
|
+
this.searchTimer = setTimeout(() => {
|
|
880
|
+
this.controller.search(query);
|
|
881
|
+
this.searchChange.emit(query);
|
|
882
|
+
}, SEARCH_DELAY);
|
|
883
|
+
}
|
|
884
|
+
onScroll(event) {
|
|
885
|
+
if (event.target instanceof HTMLElement) this.updateScrollEdges(event.target);
|
|
886
|
+
}
|
|
887
|
+
sortBy(key) {
|
|
888
|
+
this.controller.sortBy(key);
|
|
889
|
+
this.sortChange.emit(this.state().sort);
|
|
890
|
+
}
|
|
891
|
+
select(id) {
|
|
892
|
+
this.controller.select(id);
|
|
893
|
+
this.selectionChange.emit(this.controller.selectedRows());
|
|
894
|
+
}
|
|
895
|
+
selectAll(selected) {
|
|
896
|
+
this.controller.selectAll(selected);
|
|
897
|
+
this.selectionChange.emit(this.controller.selectedRows());
|
|
898
|
+
}
|
|
899
|
+
pinRow(id) {
|
|
900
|
+
this.controller.pinRow(id);
|
|
901
|
+
this.pinnedRowsChange.emit(this.state().pinnedRows.map((row) => row.id));
|
|
902
|
+
}
|
|
903
|
+
runAction(action, row) {
|
|
904
|
+
if (action.id === "edit" && this.state().editable) {
|
|
905
|
+
this.controller.startEdit([row.id]);
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
this.action.emit({
|
|
909
|
+
id: action.id,
|
|
910
|
+
rows: [row.data]
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
runBulkAction(action) {
|
|
914
|
+
this.action.emit({
|
|
915
|
+
id: action.id,
|
|
916
|
+
rows: this.controller.selectedRows()
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
setPage(page) {
|
|
920
|
+
this.controller.setPage(page);
|
|
921
|
+
this.emitPage();
|
|
922
|
+
}
|
|
923
|
+
setPageSize(pageSize) {
|
|
924
|
+
this.controller.setPageSize(pageSize);
|
|
925
|
+
this.emitPage();
|
|
926
|
+
}
|
|
927
|
+
editsOnDoubleClick(key) {
|
|
928
|
+
return this.editOnDoubleClick() && this.state().columns.some((column) => column.key === key && column.editor);
|
|
929
|
+
}
|
|
930
|
+
editCell(row, key) {
|
|
931
|
+
if (!this.editsOnDoubleClick(key)) return;
|
|
932
|
+
const draft = this.state().draft;
|
|
933
|
+
if (!draft) this.controller.startEdit([row.id]);
|
|
934
|
+
else if (draft.bulk || draft.ids[0] !== row.id) return;
|
|
935
|
+
this.focusFieldId.set(this.controlId(row.id, key));
|
|
936
|
+
}
|
|
937
|
+
keepTextUnselected(event, key) {
|
|
938
|
+
if (event.detail > 1 && this.editsOnDoubleClick(key)) event.preventDefault();
|
|
939
|
+
}
|
|
940
|
+
editSelected() {
|
|
941
|
+
this.controller.startEdit();
|
|
942
|
+
}
|
|
943
|
+
setDraft(key, value) {
|
|
944
|
+
this.controller.setDraft(key, value);
|
|
945
|
+
}
|
|
946
|
+
save(event) {
|
|
947
|
+
event?.preventDefault();
|
|
948
|
+
const result = this.controller.save();
|
|
949
|
+
if (result.ok && result.rows.length > 0) this.edited.emit(result.rows);
|
|
950
|
+
}
|
|
951
|
+
cancelEdit() {
|
|
952
|
+
this.controller.cancelEdit();
|
|
953
|
+
}
|
|
954
|
+
onEditKey(event) {
|
|
955
|
+
if (event.key === "Escape") this.cancelEdit();
|
|
956
|
+
else if (event.key === "Enter" && !(event.target instanceof HTMLTextAreaElement)) this.save(event);
|
|
957
|
+
}
|
|
958
|
+
onHandleKey(event, id) {
|
|
959
|
+
const result = this.controller.moveKey(id, event.key);
|
|
960
|
+
if (!result.handled) {
|
|
961
|
+
this.focusHandleId.set(null);
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
event.preventDefault();
|
|
965
|
+
this.focusHandleId.set(id);
|
|
966
|
+
if (result.order) this.emitReorder(result.order);
|
|
967
|
+
}
|
|
968
|
+
onHandleDown(event, id, index) {
|
|
969
|
+
if (event.button !== 0) return;
|
|
970
|
+
event.preventDefault();
|
|
971
|
+
if (event.target instanceof Element) event.target.setPointerCapture(event.pointerId);
|
|
972
|
+
const rows = [...this.host.nativeElement.querySelectorAll("tbody > tr[data-su-row]")].map((row) => row.getBoundingClientRect());
|
|
973
|
+
this.drag.set({
|
|
974
|
+
id,
|
|
975
|
+
from: index,
|
|
976
|
+
to: index,
|
|
977
|
+
startY: event.clientY + window.scrollY,
|
|
978
|
+
offsetY: 0,
|
|
979
|
+
height: rows[index]?.height ?? 0,
|
|
980
|
+
middles: rows.map(({ top, height }) => top + window.scrollY + height / 2)
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
onHandleMove(event) {
|
|
984
|
+
const drag = this.drag();
|
|
985
|
+
if (!drag) return;
|
|
986
|
+
const pointerY = event.clientY + window.scrollY;
|
|
987
|
+
this.drag.set({
|
|
988
|
+
...drag,
|
|
989
|
+
to: suTableDropIndex(pointerY, drag.middles, drag.from),
|
|
990
|
+
offsetY: pointerY - drag.startY
|
|
991
|
+
});
|
|
992
|
+
}
|
|
993
|
+
onHandleUp() {
|
|
994
|
+
const drag = this.drag();
|
|
995
|
+
this.drag.set(null);
|
|
996
|
+
const order = drag ? this.controller.move(drag.id, drag.to) : null;
|
|
997
|
+
if (order) this.emitReorder(order);
|
|
998
|
+
}
|
|
999
|
+
onHandleCancel() {
|
|
1000
|
+
this.drag.set(null);
|
|
1001
|
+
}
|
|
1002
|
+
rowClassOf(row) {
|
|
1003
|
+
return this.rowClass()?.(row.data) ?? null;
|
|
1004
|
+
}
|
|
1005
|
+
dropSide(index) {
|
|
1006
|
+
const drag = this.drag();
|
|
1007
|
+
if (!drag || drag.to === drag.from || drag.to !== index) return null;
|
|
1008
|
+
return drag.to > drag.from ? "after" : "before";
|
|
1009
|
+
}
|
|
1010
|
+
dragTransform(index) {
|
|
1011
|
+
const drag = this.drag();
|
|
1012
|
+
if (!drag) return null;
|
|
1013
|
+
if (index === drag.from) return `translateY(${drag.offsetY}px)`;
|
|
1014
|
+
const slidesUp = index > drag.from && index <= drag.to;
|
|
1015
|
+
const slidesDown = index < drag.from && index >= drag.to;
|
|
1016
|
+
return slidesUp || slidesDown ? `translateY(${slidesUp ? -drag.height : drag.height}px)` : null;
|
|
1017
|
+
}
|
|
1018
|
+
updateScrollEdges(scroller) {
|
|
1019
|
+
this.scrolledFromTop.set(scroller.scrollTop > 1);
|
|
1020
|
+
const position = Math.abs(scroller.scrollLeft);
|
|
1021
|
+
this.scrolledFromStart.set(position > 1);
|
|
1022
|
+
this.moreAtEnd.set(position < scroller.scrollWidth - scroller.clientWidth - 1);
|
|
1023
|
+
}
|
|
1024
|
+
emitPage() {
|
|
1025
|
+
const { page, pageSize } = this.state().pagination;
|
|
1026
|
+
this.pageChange.emit({
|
|
1027
|
+
page,
|
|
1028
|
+
pageSize
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
emitReorder(ids) {
|
|
1032
|
+
this.reordered.emit({
|
|
1033
|
+
ids,
|
|
1034
|
+
rows: this.controller.rowsOf(ids)
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1038
|
+
minVersion: "12.0.0",
|
|
1039
|
+
version: "22.2.4",
|
|
1040
|
+
ngImport: i0,
|
|
1041
|
+
type: SuTableComponent,
|
|
1042
|
+
deps: [],
|
|
1043
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
1044
|
+
});
|
|
1045
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1046
|
+
minVersion: "17.0.0",
|
|
1047
|
+
version: "22.2.4",
|
|
1048
|
+
type: SuTableComponent,
|
|
1049
|
+
isStandalone: true,
|
|
1050
|
+
selector: "su-lib-table",
|
|
1051
|
+
inputs: {
|
|
1052
|
+
columns: {
|
|
1053
|
+
classPropertyName: "columns",
|
|
1054
|
+
publicName: "columns",
|
|
1055
|
+
isSignal: true,
|
|
1056
|
+
isRequired: true,
|
|
1057
|
+
transformFunction: null
|
|
1058
|
+
},
|
|
1059
|
+
rows: {
|
|
1060
|
+
classPropertyName: "rows",
|
|
1061
|
+
publicName: "rows",
|
|
1062
|
+
isSignal: true,
|
|
1063
|
+
isRequired: true,
|
|
1064
|
+
transformFunction: null
|
|
1065
|
+
},
|
|
1066
|
+
caption: {
|
|
1067
|
+
classPropertyName: "caption",
|
|
1068
|
+
publicName: "caption",
|
|
1069
|
+
isSignal: true,
|
|
1070
|
+
isRequired: true,
|
|
1071
|
+
transformFunction: null
|
|
1072
|
+
},
|
|
1073
|
+
showCaption: {
|
|
1074
|
+
classPropertyName: "showCaption",
|
|
1075
|
+
publicName: "showCaption",
|
|
1076
|
+
isSignal: true,
|
|
1077
|
+
isRequired: false,
|
|
1078
|
+
transformFunction: null
|
|
1079
|
+
},
|
|
1080
|
+
rowId: {
|
|
1081
|
+
classPropertyName: "rowId",
|
|
1082
|
+
publicName: "rowId",
|
|
1083
|
+
isSignal: true,
|
|
1084
|
+
isRequired: false,
|
|
1085
|
+
transformFunction: null
|
|
1086
|
+
},
|
|
1087
|
+
actions: {
|
|
1088
|
+
classPropertyName: "actions",
|
|
1089
|
+
publicName: "actions",
|
|
1090
|
+
isSignal: true,
|
|
1091
|
+
isRequired: false,
|
|
1092
|
+
transformFunction: null
|
|
1093
|
+
},
|
|
1094
|
+
selectable: {
|
|
1095
|
+
classPropertyName: "selectable",
|
|
1096
|
+
publicName: "selectable",
|
|
1097
|
+
isSignal: true,
|
|
1098
|
+
isRequired: false,
|
|
1099
|
+
transformFunction: null
|
|
1100
|
+
},
|
|
1101
|
+
reorderable: {
|
|
1102
|
+
classPropertyName: "reorderable",
|
|
1103
|
+
publicName: "reorderable",
|
|
1104
|
+
isSignal: true,
|
|
1105
|
+
isRequired: false,
|
|
1106
|
+
transformFunction: null
|
|
1107
|
+
},
|
|
1108
|
+
columnControls: {
|
|
1109
|
+
classPropertyName: "columnControls",
|
|
1110
|
+
publicName: "columnControls",
|
|
1111
|
+
isSignal: true,
|
|
1112
|
+
isRequired: false,
|
|
1113
|
+
transformFunction: null
|
|
1114
|
+
},
|
|
1115
|
+
searchable: {
|
|
1116
|
+
classPropertyName: "searchable",
|
|
1117
|
+
publicName: "searchable",
|
|
1118
|
+
isSignal: true,
|
|
1119
|
+
isRequired: false,
|
|
1120
|
+
transformFunction: null
|
|
1121
|
+
},
|
|
1122
|
+
maxHeight: {
|
|
1123
|
+
classPropertyName: "maxHeight",
|
|
1124
|
+
publicName: "maxHeight",
|
|
1125
|
+
isSignal: true,
|
|
1126
|
+
isRequired: false,
|
|
1127
|
+
transformFunction: null
|
|
1128
|
+
},
|
|
1129
|
+
rowClass: {
|
|
1130
|
+
classPropertyName: "rowClass",
|
|
1131
|
+
publicName: "rowClass",
|
|
1132
|
+
isSignal: true,
|
|
1133
|
+
isRequired: false,
|
|
1134
|
+
transformFunction: null
|
|
1135
|
+
},
|
|
1136
|
+
editOnDoubleClick: {
|
|
1137
|
+
classPropertyName: "editOnDoubleClick",
|
|
1138
|
+
publicName: "editOnDoubleClick",
|
|
1139
|
+
isSignal: true,
|
|
1140
|
+
isRequired: false,
|
|
1141
|
+
transformFunction: null
|
|
1142
|
+
},
|
|
1143
|
+
pageSize: {
|
|
1144
|
+
classPropertyName: "pageSize",
|
|
1145
|
+
publicName: "pageSize",
|
|
1146
|
+
isSignal: true,
|
|
1147
|
+
isRequired: false,
|
|
1148
|
+
transformFunction: null
|
|
1149
|
+
},
|
|
1150
|
+
pageSizes: {
|
|
1151
|
+
classPropertyName: "pageSizes",
|
|
1152
|
+
publicName: "pageSizes",
|
|
1153
|
+
isSignal: true,
|
|
1154
|
+
isRequired: false,
|
|
1155
|
+
transformFunction: null
|
|
1156
|
+
},
|
|
1157
|
+
rowPinning: {
|
|
1158
|
+
classPropertyName: "rowPinning",
|
|
1159
|
+
publicName: "rowPinning",
|
|
1160
|
+
isSignal: true,
|
|
1161
|
+
isRequired: false,
|
|
1162
|
+
transformFunction: null
|
|
1163
|
+
},
|
|
1164
|
+
pinnedRows: {
|
|
1165
|
+
classPropertyName: "pinnedRows",
|
|
1166
|
+
publicName: "pinnedRows",
|
|
1167
|
+
isSignal: true,
|
|
1168
|
+
isRequired: false,
|
|
1169
|
+
transformFunction: null
|
|
1170
|
+
},
|
|
1171
|
+
labels: {
|
|
1172
|
+
classPropertyName: "labels",
|
|
1173
|
+
publicName: "labels",
|
|
1174
|
+
isSignal: true,
|
|
1175
|
+
isRequired: false,
|
|
1176
|
+
transformFunction: null
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
outputs: {
|
|
1180
|
+
edited: "edited",
|
|
1181
|
+
reordered: "reordered",
|
|
1182
|
+
action: "action",
|
|
1183
|
+
sortChange: "sortChange",
|
|
1184
|
+
selectionChange: "selectionChange",
|
|
1185
|
+
searchChange: "searchChange",
|
|
1186
|
+
pinnedRowsChange: "pinnedRowsChange",
|
|
1187
|
+
columnsChange: "columnsChange",
|
|
1188
|
+
pageChange: "pageChange"
|
|
1189
|
+
},
|
|
1190
|
+
host: { classAttribute: "su-table" },
|
|
1191
|
+
queries: [{
|
|
1192
|
+
propertyName: "cellTemplates",
|
|
1193
|
+
predicate: SuTableCellDirective,
|
|
1194
|
+
isSignal: true
|
|
1195
|
+
}],
|
|
1196
|
+
ngImport: i0,
|
|
1197
|
+
template: "@let current = state();\n@let t = text();\n@let selectedCount = current.selectedIds.length;\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\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@if (selectable() && selectedCount > 0) {\n <div class=\"su-table-toolbar\" role=\"toolbar\" [attr.aria-label]=\"t.selected(selectedCount)\">\n <span class=\"su-table-toolbar-count\">{{ t.selected(selectedCount) }}</span>\n @if (current.editable && !current.draft) {\n <button type=\"button\" class=\"su-table-button\" (click)=\"editSelected()\">\n {{ t.editSelected(selectedCount) }}\n </button>\n }\n @for (action of current.bulkActions; track action.id) {\n <button type=\"button\" class=\"su-table-button\" [class.is-danger]=\"action.danger\" (click)=\"runBulkAction(action)\">\n {{ action.label }}\n </button>\n }\n <button type=\"button\" class=\"su-table-button is-quiet\" (click)=\"selectAll(false)\">{{ t.clearSelection }}</button>\n </div>\n}\n\n@if (bulkDraft(); as draft) {\n <form\n class=\"su-table-bulk\"\n [attr.aria-labelledby]=\"tableId + '-bulk-title'\"\n (submit)=\"save($event)\"\n (keydown.escape)=\"cancelEdit()\"\n >\n <h3 class=\"su-table-bulk-title\" [id]=\"tableId + '-bulk-title'\">{{ t.editing(draft.ids.length) }}</h3>\n <div class=\"su-table-bulk-fields\">\n @for (field of draft.fields; track field.key) {\n <div class=\"su-table-bulk-field\">\n <label class=\"su-table-label\" [for]=\"controlId('bulk', field.key)\">{{ field.header }}</label>\n <su-lib-table-field\n [field]=\"field\"\n [controlId]=\"controlId('bulk', field.key)\"\n [mixedLabel]=\"t.mixed\"\n (valueChange)=\"setDraft(field.key, $event)\"\n />\n </div>\n }\n </div>\n <div class=\"su-table-bulk-actions\">\n <button type=\"submit\" class=\"su-table-button is-primary\">{{ t.save }}</button>\n <button type=\"button\" class=\"su-table-button\" (click)=\"cancelEdit()\">{{ t.cancel }}</button>\n </div>\n </form>\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\" [class.is-dragging-rows]=\"drag() !== null\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (reorderable()) {\n <th scope=\"col\" class=\"su-table-handle-cell\" [suTablePin]=\"pins[0]\">\n <span class=\"su-table-visually-hidden\">{{ t.order }}</span>\n </th>\n }\n @if (selectable()) {\n <th scope=\"col\" class=\"su-table-select-cell\" [suTablePin]=\"pins[firstColumnSlot - 1]\">\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [checked]=\"current.selection === 'all'\"\n [indeterminate]=\"current.selection === 'some'\"\n [disabled]=\"current.rows.length === 0\"\n [attr.aria-label]=\"t.selectAll\"\n (change)=\"selectAll()\"\n />\n </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 suTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (hasActions()) {\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 @let editing = inlineDraft()?.ids?.[0] === row.id;\n @let index = rowIndex - current.pinnedRows.length;\n <tr\n [attr.data-su-row]=\"row.pinned ? null : ''\"\n [class.is-pinned-row]=\"row.pinned\"\n [class.is-last-pinned-row]=\"index === -1\"\n [style.--su-table-row-top]=\"row.pinned ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [class.is-selected]=\"row.selected\"\n [class.is-editing]=\"editing\"\n [class.is-grabbed]=\"current.grabbedId === row.id\"\n [class]=\"rowClassOf(row)\"\n [class.is-dragging]=\"drag()?.id === row.id\"\n [class.is-drop-before]=\"dropSide(index) === 'before'\"\n [class.is-drop-after]=\"dropSide(index) === 'after'\"\n [style.transform]=\"dragTransform(index)\"\n (keydown)=\"editing && onEditKey($event)\"\n >\n @if (reorderable()) {\n <td class=\"su-table-handle-cell\" [suTablePin]=\"pins[0]\">\n @if (!row.pinned && !current.searching) {\n <button\n type=\"button\"\n class=\"su-table-handle\"\n [attr.data-su-handle]=\"row.id\"\n [attr.aria-label]=\"t.moveRow(row.label)\"\n [attr.aria-pressed]=\"current.grabbedId === row.id\"\n (keydown)=\"onHandleKey($event, row.id)\"\n (pointerdown)=\"onHandleDown($event, row.id, index)\"\n (pointermove)=\"onHandleMove($event)\"\n (pointerup)=\"onHandleUp()\"\n (pointercancel)=\"onHandleCancel()\"\n >\n <span class=\"su-table-grip\" aria-hidden=\"true\"></span>\n </button>\n }\n </td>\n }\n @if (selectable()) {\n <td class=\"su-table-select-cell\" [suTablePin]=\"pins[firstColumnSlot - 1]\">\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [checked]=\"row.selected\"\n [attr.aria-label]=\"t.selectRow(row.label)\"\n (change)=\"select(row.id)\"\n />\n </td>\n }\n @for (cell of row.cells; track cell.key; let cellIndex = $index) {\n @let column = current.columns[cellIndex];\n @let pin = pins[firstColumnSlot + cellIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [class.is-editable]=\"!editing && editsOnDoubleClick(cell.key)\"\n [suTablePin]=\"pin\"\n (mousedown)=\"keepTextUnselected($event, cell.key)\"\n (dblclick)=\"editCell(row, cell.key)\"\n >\n @if (editing && inlineField(cell.key); as field) {\n <su-lib-table-field\n [field]=\"field\"\n [controlId]=\"controlId(row.id, cell.key)\"\n [ariaLabel]=\"column.header\"\n [mixedLabel]=\"t.mixed\"\n (valueChange)=\"setDraft(cell.key, $event)\"\n />\n } @else 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 @if (hasActions()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n <div class=\"su-table-actions\">\n @if (editing) {\n <button type=\"button\" class=\"su-table-button is-primary\" (click)=\"save()\">{{ t.save }}</button>\n <button type=\"button\" class=\"su-table-button\" (click)=\"cancelEdit()\">{{ t.cancel }}</button>\n } @else {\n @if (rowPinning()) {\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 suTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n }\n @for (action of row.actions; track action.id) {\n <button\n type=\"button\"\n class=\"su-table-button\"\n [class.is-danger]=\"action.danger\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label + ', ' + row.label\"\n (click)=\"runAction(action, row)\"\n >\n {{ action.label }}\n </button>\n }\n }\n </div>\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",
|
|
1198
|
+
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}}\n"],
|
|
1199
|
+
dependencies: [
|
|
1200
|
+
{
|
|
1201
|
+
kind: "directive",
|
|
1202
|
+
type: NgTemplateOutlet,
|
|
1203
|
+
selector: "[ngTemplateOutlet]",
|
|
1204
|
+
inputs: [
|
|
1205
|
+
"ngTemplateOutletContext",
|
|
1206
|
+
"ngTemplateOutlet",
|
|
1207
|
+
"ngTemplateOutletInjector"
|
|
1208
|
+
]
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
kind: "component",
|
|
1212
|
+
type: SuTableFieldComponent,
|
|
1213
|
+
selector: "su-lib-table-field",
|
|
1214
|
+
inputs: [
|
|
1215
|
+
"field",
|
|
1216
|
+
"controlId",
|
|
1217
|
+
"ariaLabel",
|
|
1218
|
+
"mixedLabel"
|
|
1219
|
+
],
|
|
1220
|
+
outputs: ["valueChange"]
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
kind: "component",
|
|
1224
|
+
type: SuTablePaginatorComponent,
|
|
1225
|
+
selector: "su-lib-table-paginator",
|
|
1226
|
+
inputs: [
|
|
1227
|
+
"pagination",
|
|
1228
|
+
"labels",
|
|
1229
|
+
"controlId"
|
|
1230
|
+
],
|
|
1231
|
+
outputs: ["pageChange", "pageSizeChange"]
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
kind: "directive",
|
|
1235
|
+
type: SuTablePinDirective,
|
|
1236
|
+
selector: "[suTablePin]",
|
|
1237
|
+
inputs: ["suTablePin"]
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
kind: "component",
|
|
1241
|
+
type: SuTablePinIconComponent,
|
|
1242
|
+
selector: "svg[suTablePinIcon]"
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
kind: "component",
|
|
1246
|
+
type: SuTableToolbarComponent,
|
|
1247
|
+
selector: "su-lib-table-toolbar",
|
|
1248
|
+
inputs: [
|
|
1249
|
+
"labels",
|
|
1250
|
+
"controlId",
|
|
1251
|
+
"searchable",
|
|
1252
|
+
"query",
|
|
1253
|
+
"columnControls",
|
|
1254
|
+
"columns"
|
|
1255
|
+
],
|
|
1256
|
+
outputs: [
|
|
1257
|
+
"queryChange",
|
|
1258
|
+
"pinnableChange",
|
|
1259
|
+
"visibilityChange",
|
|
1260
|
+
"allVisibilityChange"
|
|
1261
|
+
]
|
|
1262
|
+
}
|
|
1263
|
+
],
|
|
1264
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1265
|
+
});
|
|
1266
|
+
};
|
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1268
|
+
minVersion: "12.0.0",
|
|
1269
|
+
version: "22.2.4",
|
|
1270
|
+
ngImport: i0,
|
|
1271
|
+
type: SuTableComponent,
|
|
1272
|
+
decorators: [{
|
|
1273
|
+
type: Component,
|
|
1274
|
+
args: [{
|
|
1275
|
+
selector: "su-lib-table",
|
|
1276
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1277
|
+
imports: [
|
|
1278
|
+
NgTemplateOutlet,
|
|
1279
|
+
SuTableFieldComponent,
|
|
1280
|
+
SuTablePaginatorComponent,
|
|
1281
|
+
SuTablePinDirective,
|
|
1282
|
+
SuTablePinIconComponent,
|
|
1283
|
+
SuTableToolbarComponent
|
|
1284
|
+
],
|
|
1285
|
+
host: { class: "su-table" },
|
|
1286
|
+
template: "@let current = state();\n@let t = text();\n@let selectedCount = current.selectedIds.length;\n@let pins = placements();\n@let firstColumnSlot = columnSlot();\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@if (selectable() && selectedCount > 0) {\n <div class=\"su-table-toolbar\" role=\"toolbar\" [attr.aria-label]=\"t.selected(selectedCount)\">\n <span class=\"su-table-toolbar-count\">{{ t.selected(selectedCount) }}</span>\n @if (current.editable && !current.draft) {\n <button type=\"button\" class=\"su-table-button\" (click)=\"editSelected()\">\n {{ t.editSelected(selectedCount) }}\n </button>\n }\n @for (action of current.bulkActions; track action.id) {\n <button type=\"button\" class=\"su-table-button\" [class.is-danger]=\"action.danger\" (click)=\"runBulkAction(action)\">\n {{ action.label }}\n </button>\n }\n <button type=\"button\" class=\"su-table-button is-quiet\" (click)=\"selectAll(false)\">{{ t.clearSelection }}</button>\n </div>\n}\n\n@if (bulkDraft(); as draft) {\n <form\n class=\"su-table-bulk\"\n [attr.aria-labelledby]=\"tableId + '-bulk-title'\"\n (submit)=\"save($event)\"\n (keydown.escape)=\"cancelEdit()\"\n >\n <h3 class=\"su-table-bulk-title\" [id]=\"tableId + '-bulk-title'\">{{ t.editing(draft.ids.length) }}</h3>\n <div class=\"su-table-bulk-fields\">\n @for (field of draft.fields; track field.key) {\n <div class=\"su-table-bulk-field\">\n <label class=\"su-table-label\" [for]=\"controlId('bulk', field.key)\">{{ field.header }}</label>\n <su-lib-table-field\n [field]=\"field\"\n [controlId]=\"controlId('bulk', field.key)\"\n [mixedLabel]=\"t.mixed\"\n (valueChange)=\"setDraft(field.key, $event)\"\n />\n </div>\n }\n </div>\n <div class=\"su-table-bulk-actions\">\n <button type=\"submit\" class=\"su-table-button is-primary\">{{ t.save }}</button>\n <button type=\"button\" class=\"su-table-button\" (click)=\"cancelEdit()\">{{ t.cancel }}</button>\n </div>\n </form>\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\" [class.is-dragging-rows]=\"drag() !== null\">\n <caption [class.su-table-visually-hidden]=\"!showCaption()\">{{ caption() }}</caption>\n <thead>\n <tr>\n @if (reorderable()) {\n <th scope=\"col\" class=\"su-table-handle-cell\" [suTablePin]=\"pins[0]\">\n <span class=\"su-table-visually-hidden\">{{ t.order }}</span>\n </th>\n }\n @if (selectable()) {\n <th scope=\"col\" class=\"su-table-select-cell\" [suTablePin]=\"pins[firstColumnSlot - 1]\">\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [checked]=\"current.selection === 'all'\"\n [indeterminate]=\"current.selection === 'some'\"\n [disabled]=\"current.rows.length === 0\"\n [attr.aria-label]=\"t.selectAll\"\n (change)=\"selectAll()\"\n />\n </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 suTablePinIcon width=\"12\" height=\"12\"></svg>\n </button>\n } @else if (pins[firstColumnSlot + columnIndex]) {\n <svg suTablePinIcon class=\"su-table-pinned-icon\" width=\"11\" height=\"11\"></svg>\n }\n </th>\n }\n @if (hasActions()) {\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 @let editing = inlineDraft()?.ids?.[0] === row.id;\n @let index = rowIndex - current.pinnedRows.length;\n <tr\n [attr.data-su-row]=\"row.pinned ? null : ''\"\n [class.is-pinned-row]=\"row.pinned\"\n [class.is-last-pinned-row]=\"index === -1\"\n [style.--su-table-row-top]=\"row.pinned ? pinnedRowTops()[rowIndex] + 'px' : null\"\n [class.is-selected]=\"row.selected\"\n [class.is-editing]=\"editing\"\n [class.is-grabbed]=\"current.grabbedId === row.id\"\n [class]=\"rowClassOf(row)\"\n [class.is-dragging]=\"drag()?.id === row.id\"\n [class.is-drop-before]=\"dropSide(index) === 'before'\"\n [class.is-drop-after]=\"dropSide(index) === 'after'\"\n [style.transform]=\"dragTransform(index)\"\n (keydown)=\"editing && onEditKey($event)\"\n >\n @if (reorderable()) {\n <td class=\"su-table-handle-cell\" [suTablePin]=\"pins[0]\">\n @if (!row.pinned && !current.searching) {\n <button\n type=\"button\"\n class=\"su-table-handle\"\n [attr.data-su-handle]=\"row.id\"\n [attr.aria-label]=\"t.moveRow(row.label)\"\n [attr.aria-pressed]=\"current.grabbedId === row.id\"\n (keydown)=\"onHandleKey($event, row.id)\"\n (pointerdown)=\"onHandleDown($event, row.id, index)\"\n (pointermove)=\"onHandleMove($event)\"\n (pointerup)=\"onHandleUp()\"\n (pointercancel)=\"onHandleCancel()\"\n >\n <span class=\"su-table-grip\" aria-hidden=\"true\"></span>\n </button>\n }\n </td>\n }\n @if (selectable()) {\n <td class=\"su-table-select-cell\" [suTablePin]=\"pins[firstColumnSlot - 1]\">\n <input\n type=\"checkbox\"\n class=\"su-table-checkbox\"\n [checked]=\"row.selected\"\n [attr.aria-label]=\"t.selectRow(row.label)\"\n (change)=\"select(row.id)\"\n />\n </td>\n }\n @for (cell of row.cells; track cell.key; let cellIndex = $index) {\n @let column = current.columns[cellIndex];\n @let pin = pins[firstColumnSlot + cellIndex];\n <td\n class=\"su-table-align-{{ column.align }}\"\n [attr.role]=\"cell.key === current.rowHeaderKey ? 'rowheader' : null\"\n [class.su-table-row-header]=\"cell.key === current.rowHeaderKey\"\n [class.is-sorted]=\"column.sort !== 'none'\"\n [class.is-editable]=\"!editing && editsOnDoubleClick(cell.key)\"\n [suTablePin]=\"pin\"\n (mousedown)=\"keepTextUnselected($event, cell.key)\"\n (dblclick)=\"editCell(row, cell.key)\"\n >\n @if (editing && inlineField(cell.key); as field) {\n <su-lib-table-field\n [field]=\"field\"\n [controlId]=\"controlId(row.id, cell.key)\"\n [ariaLabel]=\"column.header\"\n [mixedLabel]=\"t.mixed\"\n (valueChange)=\"setDraft(cell.key, $event)\"\n />\n } @else 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 @if (hasActions()) {\n <td class=\"su-table-actions-cell\" [suTablePin]=\"pins[pins.length - 1]\">\n <div class=\"su-table-actions\">\n @if (editing) {\n <button type=\"button\" class=\"su-table-button is-primary\" (click)=\"save()\">{{ t.save }}</button>\n <button type=\"button\" class=\"su-table-button\" (click)=\"cancelEdit()\">{{ t.cancel }}</button>\n } @else {\n @if (rowPinning()) {\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 suTablePinIcon width=\"12\" height=\"12\"></svg>\n {{ t.pinRow }}\n </button>\n }\n @for (action of row.actions; track action.id) {\n <button\n type=\"button\"\n class=\"su-table-button\"\n [class.is-danger]=\"action.danger\"\n [disabled]=\"action.disabled\"\n [attr.aria-label]=\"action.label + ', ' + row.label\"\n (click)=\"runAction(action, row)\"\n >\n {{ action.label }}\n </button>\n }\n }\n </div>\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",
|
|
1287
|
+
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}}\n"]
|
|
1288
|
+
}]
|
|
1289
|
+
}],
|
|
1290
|
+
ctorParameters: () => [],
|
|
1291
|
+
propDecorators: {
|
|
1292
|
+
columns: [{
|
|
1293
|
+
type: i0.Input,
|
|
1294
|
+
args: [{
|
|
1295
|
+
isSignal: true,
|
|
1296
|
+
alias: "columns",
|
|
1297
|
+
required: true
|
|
1298
|
+
}]
|
|
1299
|
+
}],
|
|
1300
|
+
rows: [{
|
|
1301
|
+
type: i0.Input,
|
|
1302
|
+
args: [{
|
|
1303
|
+
isSignal: true,
|
|
1304
|
+
alias: "rows",
|
|
1305
|
+
required: true
|
|
1306
|
+
}]
|
|
1307
|
+
}],
|
|
1308
|
+
caption: [{
|
|
1309
|
+
type: i0.Input,
|
|
1310
|
+
args: [{
|
|
1311
|
+
isSignal: true,
|
|
1312
|
+
alias: "caption",
|
|
1313
|
+
required: true
|
|
1314
|
+
}]
|
|
1315
|
+
}],
|
|
1316
|
+
showCaption: [{
|
|
1317
|
+
type: i0.Input,
|
|
1318
|
+
args: [{
|
|
1319
|
+
isSignal: true,
|
|
1320
|
+
alias: "showCaption",
|
|
1321
|
+
required: false
|
|
1322
|
+
}]
|
|
1323
|
+
}],
|
|
1324
|
+
rowId: [{
|
|
1325
|
+
type: i0.Input,
|
|
1326
|
+
args: [{
|
|
1327
|
+
isSignal: true,
|
|
1328
|
+
alias: "rowId",
|
|
1329
|
+
required: false
|
|
1330
|
+
}]
|
|
1331
|
+
}],
|
|
1332
|
+
actions: [{
|
|
1333
|
+
type: i0.Input,
|
|
1334
|
+
args: [{
|
|
1335
|
+
isSignal: true,
|
|
1336
|
+
alias: "actions",
|
|
1337
|
+
required: false
|
|
1338
|
+
}]
|
|
1339
|
+
}],
|
|
1340
|
+
selectable: [{
|
|
1341
|
+
type: i0.Input,
|
|
1342
|
+
args: [{
|
|
1343
|
+
isSignal: true,
|
|
1344
|
+
alias: "selectable",
|
|
1345
|
+
required: false
|
|
1346
|
+
}]
|
|
1347
|
+
}],
|
|
1348
|
+
reorderable: [{
|
|
1349
|
+
type: i0.Input,
|
|
1350
|
+
args: [{
|
|
1351
|
+
isSignal: true,
|
|
1352
|
+
alias: "reorderable",
|
|
1353
|
+
required: false
|
|
1354
|
+
}]
|
|
1355
|
+
}],
|
|
1356
|
+
columnControls: [{
|
|
1357
|
+
type: i0.Input,
|
|
1358
|
+
args: [{
|
|
1359
|
+
isSignal: true,
|
|
1360
|
+
alias: "columnControls",
|
|
1361
|
+
required: false
|
|
1362
|
+
}]
|
|
1363
|
+
}],
|
|
1364
|
+
searchable: [{
|
|
1365
|
+
type: i0.Input,
|
|
1366
|
+
args: [{
|
|
1367
|
+
isSignal: true,
|
|
1368
|
+
alias: "searchable",
|
|
1369
|
+
required: false
|
|
1370
|
+
}]
|
|
1371
|
+
}],
|
|
1372
|
+
maxHeight: [{
|
|
1373
|
+
type: i0.Input,
|
|
1374
|
+
args: [{
|
|
1375
|
+
isSignal: true,
|
|
1376
|
+
alias: "maxHeight",
|
|
1377
|
+
required: false
|
|
1378
|
+
}]
|
|
1379
|
+
}],
|
|
1380
|
+
rowClass: [{
|
|
1381
|
+
type: i0.Input,
|
|
1382
|
+
args: [{
|
|
1383
|
+
isSignal: true,
|
|
1384
|
+
alias: "rowClass",
|
|
1385
|
+
required: false
|
|
1386
|
+
}]
|
|
1387
|
+
}],
|
|
1388
|
+
editOnDoubleClick: [{
|
|
1389
|
+
type: i0.Input,
|
|
1390
|
+
args: [{
|
|
1391
|
+
isSignal: true,
|
|
1392
|
+
alias: "editOnDoubleClick",
|
|
1393
|
+
required: false
|
|
1394
|
+
}]
|
|
1395
|
+
}],
|
|
1396
|
+
pageSize: [{
|
|
1397
|
+
type: i0.Input,
|
|
1398
|
+
args: [{
|
|
1399
|
+
isSignal: true,
|
|
1400
|
+
alias: "pageSize",
|
|
1401
|
+
required: false
|
|
1402
|
+
}]
|
|
1403
|
+
}],
|
|
1404
|
+
pageSizes: [{
|
|
1405
|
+
type: i0.Input,
|
|
1406
|
+
args: [{
|
|
1407
|
+
isSignal: true,
|
|
1408
|
+
alias: "pageSizes",
|
|
1409
|
+
required: false
|
|
1410
|
+
}]
|
|
1411
|
+
}],
|
|
1412
|
+
rowPinning: [{
|
|
1413
|
+
type: i0.Input,
|
|
1414
|
+
args: [{
|
|
1415
|
+
isSignal: true,
|
|
1416
|
+
alias: "rowPinning",
|
|
1417
|
+
required: false
|
|
1418
|
+
}]
|
|
1419
|
+
}],
|
|
1420
|
+
pinnedRows: [{
|
|
1421
|
+
type: i0.Input,
|
|
1422
|
+
args: [{
|
|
1423
|
+
isSignal: true,
|
|
1424
|
+
alias: "pinnedRows",
|
|
1425
|
+
required: false
|
|
1426
|
+
}]
|
|
1427
|
+
}],
|
|
1428
|
+
labels: [{
|
|
1429
|
+
type: i0.Input,
|
|
1430
|
+
args: [{
|
|
1431
|
+
isSignal: true,
|
|
1432
|
+
alias: "labels",
|
|
1433
|
+
required: false
|
|
1434
|
+
}]
|
|
1435
|
+
}],
|
|
1436
|
+
edited: [{
|
|
1437
|
+
type: i0.Output,
|
|
1438
|
+
args: ["edited"]
|
|
1439
|
+
}],
|
|
1440
|
+
reordered: [{
|
|
1441
|
+
type: i0.Output,
|
|
1442
|
+
args: ["reordered"]
|
|
1443
|
+
}],
|
|
1444
|
+
action: [{
|
|
1445
|
+
type: i0.Output,
|
|
1446
|
+
args: ["action"]
|
|
1447
|
+
}],
|
|
1448
|
+
sortChange: [{
|
|
1449
|
+
type: i0.Output,
|
|
1450
|
+
args: ["sortChange"]
|
|
1451
|
+
}],
|
|
1452
|
+
selectionChange: [{
|
|
1453
|
+
type: i0.Output,
|
|
1454
|
+
args: ["selectionChange"]
|
|
1455
|
+
}],
|
|
1456
|
+
searchChange: [{
|
|
1457
|
+
type: i0.Output,
|
|
1458
|
+
args: ["searchChange"]
|
|
1459
|
+
}],
|
|
1460
|
+
pinnedRowsChange: [{
|
|
1461
|
+
type: i0.Output,
|
|
1462
|
+
args: ["pinnedRowsChange"]
|
|
1463
|
+
}],
|
|
1464
|
+
columnsChange: [{
|
|
1465
|
+
type: i0.Output,
|
|
1466
|
+
args: ["columnsChange"]
|
|
1467
|
+
}],
|
|
1468
|
+
pageChange: [{
|
|
1469
|
+
type: i0.Output,
|
|
1470
|
+
args: ["pageChange"]
|
|
1471
|
+
}],
|
|
1472
|
+
cellTemplates: [{
|
|
1473
|
+
type: i0.ContentChildren,
|
|
1474
|
+
args: [i0.forwardRef(() => SuTableCellDirective), { isSignal: true }]
|
|
1475
|
+
}]
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
export { SU_TABLE_EDIT_ACTION, SU_TABLE_LABELS, SuTableCellDirective, SuTableComponent, SuTableFieldComponent, SuTablePaginatorComponent, SuTablePinDirective, SuTableToolbarComponent, suCheckboxEditor, suDateEditor, suNumberEditor, suSelectEditor, suTextEditor };
|
|
1479
|
+
|
|
1480
|
+
//# sourceMappingURL=su-labs-table.mjs.map
|