@tectra-ng/ui 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -19
- package/analog-clock/README.md +31 -0
- package/countdown/README.md +45 -0
- package/country/README.md +14 -4
- package/data-view/README.md +71 -0
- package/datepicker/README.md +109 -0
- package/export/README.md +79 -0
- package/export-font/OFL.txt +93 -0
- package/export-font/README.md +7 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +386 -0
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chip.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chip.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-countdown.mjs +513 -0
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-country.mjs +47 -6
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-data-view.mjs +1370 -0
- package/fesm2022/tectra-ng-ui-data-view.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs +2640 -0
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs +7 -0
- package/fesm2022/tectra-ng-ui-export-font.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-export.mjs +2574 -0
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-fieldset.mjs +2 -2
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-number.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +4 -4
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menu.mjs +2 -2
- package/fesm2022/tectra-ng-ui-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-message.mjs +2 -2
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +601 -0
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-paginator.mjs +2 -2
- package/fesm2022/tectra-ng-ui-paginator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-select.mjs +4 -4
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-slider.mjs +2 -2
- package/fesm2022/tectra-ng-ui-slider.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-sparkline.mjs +240 -0
- package/fesm2022/tectra-ng-ui-sparkline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +661 -0
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +1368 -1348
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tag.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-timeline.mjs +407 -0
- package/fesm2022/tectra-ng-ui-timeline.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs +2 -2
- package/fesm2022/tectra-ng-ui-toggle-switch.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-select.mjs +7 -46
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +901 -0
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree.mjs +1940 -0
- package/fesm2022/tectra-ng-ui-tree.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs +928 -0
- package/fesm2022/tectra-ng-ui-virtual-scroller.mjs.map +1 -0
- package/month-calendar/README.md +46 -0
- package/package.json +56 -4
- package/sparkline/README.md +27 -0
- package/stat-tiles/README.md +53 -0
- package/timeline/README.md +42 -0
- package/tree/README.md +93 -0
- package/tree-table/README.md +84 -0
- package/types/tectra-ng-ui-analog-clock.d.ts +127 -0
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -0
- package/types/tectra-ng-ui-autocomplete.d.ts +11 -0
- package/types/tectra-ng-ui-autocomplete.d.ts.map +1 -1
- package/types/tectra-ng-ui-chip.d.ts +3 -0
- package/types/tectra-ng-ui-chip.d.ts.map +1 -1
- package/types/tectra-ng-ui-countdown.d.ts +150 -0
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -0
- package/types/tectra-ng-ui-country-select.d.ts +11 -0
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +9 -3
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-data-view.d.ts +363 -0
- package/types/tectra-ng-ui-data-view.d.ts.map +1 -0
- package/types/tectra-ng-ui-datepicker.d.ts +801 -0
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -0
- package/types/tectra-ng-ui-export-font.d.ts +5 -0
- package/types/tectra-ng-ui-export-font.d.ts.map +1 -0
- package/types/tectra-ng-ui-export.d.ts +427 -0
- package/types/tectra-ng-ui-export.d.ts.map +1 -0
- package/types/tectra-ng-ui-fieldset.d.ts +8 -0
- package/types/tectra-ng-ui-fieldset.d.ts.map +1 -1
- package/types/tectra-ng-ui-input-number.d.ts +1 -0
- package/types/tectra-ng-ui-input-number.d.ts.map +1 -1
- package/types/tectra-ng-ui-input.d.ts +4 -0
- package/types/tectra-ng-ui-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-menu.d.ts +2 -0
- package/types/tectra-ng-ui-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +5 -0
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-month-calendar.d.ts +287 -0
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -0
- package/types/tectra-ng-ui-multiselect.d.ts +11 -0
- package/types/tectra-ng-ui-multiselect.d.ts.map +1 -1
- package/types/tectra-ng-ui-paginator.d.ts +1 -0
- package/types/tectra-ng-ui-paginator.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +11 -0
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-slider.d.ts +1 -0
- package/types/tectra-ng-ui-slider.d.ts.map +1 -1
- package/types/tectra-ng-ui-sparkline.d.ts +80 -0
- package/types/tectra-ng-ui-sparkline.d.ts.map +1 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts +287 -0
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +181 -15
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tag.d.ts +8 -0
- package/types/tectra-ng-ui-tag.d.ts.map +1 -1
- package/types/tectra-ng-ui-timeline.d.ts +129 -0
- package/types/tectra-ng-ui-timeline.d.ts.map +1 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts +5 -0
- package/types/tectra-ng-ui-toggle-switch.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +19 -22
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-table.d.ts +94 -0
- package/types/tectra-ng-ui-tree-table.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree.d.ts +571 -0
- package/types/tectra-ng-ui-tree.d.ts.map +1 -0
- package/types/tectra-ng-ui-virtual-scroller.d.ts +297 -0
- package/types/tectra-ng-ui-virtual-scroller.d.ts.map +1 -0
- package/virtual-scroller/README.md +60 -0
|
@@ -1,31 +1,46 @@
|
|
|
1
1
|
import { BreakpointObserver } from "@angular/cdk/layout";
|
|
2
|
+
import * as i3 from "@angular/cdk/drag-drop";
|
|
2
3
|
import { CdkDrag, CdkDragHandle, CdkDropList, moveItemInArray } from "@angular/cdk/drag-drop";
|
|
3
|
-
import { NgTemplateOutlet } from "@angular/common";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, TemplateRef, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, model, numberAttribute, output, signal, untracked, viewChild } from "@angular/core";
|
|
6
6
|
import { toObservable, toSignal } from "@angular/core/rxjs-interop";
|
|
7
|
-
import * as i1 from "@angular/forms";
|
|
8
|
-
import { FormsModule } from "@angular/forms";
|
|
9
7
|
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
10
8
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
11
9
|
import { optionalBoolean, optionalNumber } from "@tectra-ng/core/utils";
|
|
12
|
-
import { TxIcon } from "@tectra-ng/icons";
|
|
13
10
|
import { toStyleObject } from "@tectra-ng/themes";
|
|
11
|
+
import { map, of, switchMap } from "rxjs";
|
|
12
|
+
import { csvCell, downloadCsv } from "@tectra-ng/ui/export";
|
|
13
|
+
import * as i1 from "@angular/common";
|
|
14
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
15
|
+
import * as i1$1 from "@angular/forms";
|
|
16
|
+
import { FormsModule } from "@angular/forms";
|
|
17
|
+
import * as i4 from "@tectra-ng/icons";
|
|
18
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
19
|
+
import * as i7 from "@tectra-ng/ui/button";
|
|
14
20
|
import { TxButton } from "@tectra-ng/ui/button";
|
|
21
|
+
import * as i8 from "@tectra-ng/ui/checkbox";
|
|
15
22
|
import { TxCheckbox } from "@tectra-ng/ui/checkbox";
|
|
23
|
+
import * as i9 from "@tectra-ng/ui/input";
|
|
16
24
|
import { TxInput } from "@tectra-ng/ui/input";
|
|
25
|
+
import * as i10 from "@tectra-ng/ui/input-number";
|
|
17
26
|
import { TxInputNumber } from "@tectra-ng/ui/input-number";
|
|
18
|
-
import
|
|
27
|
+
import * as i15 from "@tectra-ng/ui/menu";
|
|
19
28
|
import { TxMenu, TxMenuItemTemplate, TxMenuTrigger } from "@tectra-ng/ui/menu";
|
|
29
|
+
import * as i13 from "@tectra-ng/ui/paginator";
|
|
20
30
|
import { TxPaginator } from "@tectra-ng/ui/paginator";
|
|
31
|
+
import * as i14 from "@tectra-ng/ui/progress-spinner";
|
|
21
32
|
import { TxProgressSpinner } from "@tectra-ng/ui/progress-spinner";
|
|
33
|
+
import * as i12 from "@tectra-ng/ui/radio-button";
|
|
22
34
|
import { TxRadioButton } from "@tectra-ng/ui/radio-button";
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
35
|
+
import * as i11 from "@tectra-ng/ui/select";
|
|
36
|
+
import { TxSelect } from "@tectra-ng/ui/select";
|
|
37
|
+
import * as i6 from "@tectra-ng/ui/skeleton";
|
|
38
|
+
import { TxSkeleton } from "@tectra-ng/ui/skeleton";
|
|
39
|
+
import * as i5 from "@tectra-ng/ui/tooltip";
|
|
26
40
|
import { TxTooltip } from "@tectra-ng/ui/tooltip";
|
|
27
41
|
import { TxMultiselect } from "@tectra-ng/ui/multiselect";
|
|
28
|
-
import {
|
|
42
|
+
import { TxPopover, TxPopoverTrigger } from "@tectra-ng/ui/popover";
|
|
43
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
29
44
|
import { TxStyleLoader } from "@tectra-ng/core/styles";
|
|
30
45
|
const ACTION_BUTTON_WIDTH = 30;
|
|
31
46
|
const ACTION_BUTTON_GAP = 7;
|
|
@@ -121,7 +136,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
121
136
|
type: TxTableActionsStore,
|
|
122
137
|
decorators: [{ type: Injectable }]
|
|
123
138
|
});
|
|
124
|
-
const TX_TABLE = new InjectionToken("TX_TABLE");
|
|
125
139
|
function resolveField(row, field) {
|
|
126
140
|
if (!field || row === null || row === void 0) return void 0;
|
|
127
141
|
return field.split(".").reduce((value, key) => value === null || value === void 0 ? void 0 : value[key], row);
|
|
@@ -196,250 +210,568 @@ function mergeColumnOrder(columns, order, visible) {
|
|
|
196
210
|
});
|
|
197
211
|
return result;
|
|
198
212
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
213
|
+
const TX_FILTER_MATCH_MODES = {
|
|
214
|
+
text: [
|
|
215
|
+
"startsWith",
|
|
216
|
+
"contains",
|
|
217
|
+
"notContains",
|
|
218
|
+
"endsWith",
|
|
219
|
+
"equals",
|
|
220
|
+
"notEquals"
|
|
221
|
+
],
|
|
222
|
+
numeric: [
|
|
223
|
+
"equals",
|
|
224
|
+
"notEquals",
|
|
225
|
+
"lt",
|
|
226
|
+
"lte",
|
|
227
|
+
"gt",
|
|
228
|
+
"gte"
|
|
229
|
+
],
|
|
230
|
+
date: [
|
|
231
|
+
"dateIs",
|
|
232
|
+
"dateIsNot",
|
|
233
|
+
"dateBefore",
|
|
234
|
+
"dateAfter"
|
|
235
|
+
],
|
|
236
|
+
boolean: ["equals"]
|
|
237
|
+
};
|
|
238
|
+
function defaultMatchMode(column) {
|
|
239
|
+
if (column.filterOptions?.length) return "in";
|
|
240
|
+
return (column.filterMatchModes ?? TX_FILTER_MATCH_MODES[column.filterType ?? "text"])[0];
|
|
241
|
+
}
|
|
242
|
+
function isFilled(value) {
|
|
243
|
+
if (value === null || value === void 0) return false;
|
|
244
|
+
if (typeof value === "string") return value.trim() !== "";
|
|
245
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
function isFilterActive(filter) {
|
|
249
|
+
return !!filter?.rules.some((rule) => isFilled(rule.value));
|
|
250
|
+
}
|
|
251
|
+
function normalize(value, locale) {
|
|
252
|
+
return String(value).normalize("NFD").replace(/\p{Diacritic}/gu, "").toLocaleLowerCase(locale);
|
|
253
|
+
}
|
|
254
|
+
function toTime(value) {
|
|
255
|
+
if (value === null || value === void 0 || value === "") return null;
|
|
256
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
257
|
+
return Number.isNaN(date.getTime()) ? null : date.getTime();
|
|
258
|
+
}
|
|
259
|
+
function dayOf(value) {
|
|
260
|
+
const time = toTime(value);
|
|
261
|
+
return time === null ? null : new Date(time).toDateString();
|
|
262
|
+
}
|
|
263
|
+
function compare(value, filter) {
|
|
264
|
+
if (value === null || value === void 0) return null;
|
|
265
|
+
if (typeof value === "number" || typeof filter === "number") {
|
|
266
|
+
const left = Number(value);
|
|
267
|
+
const right = Number(filter);
|
|
268
|
+
return Number.isNaN(left) || Number.isNaN(right) ? null : left - right;
|
|
235
269
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
270
|
+
const left = toTime(value);
|
|
271
|
+
const right = toTime(filter);
|
|
272
|
+
if (value instanceof Date && left !== null && right !== null) return left - right;
|
|
273
|
+
return String(value).localeCompare(String(filter), void 0, {
|
|
274
|
+
numeric: true,
|
|
275
|
+
sensitivity: "base"
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function matchesRule(value, rule, locale) {
|
|
279
|
+
const filter = rule.value;
|
|
280
|
+
if (!isFilled(filter)) return true;
|
|
281
|
+
const text = value === null || value === void 0 ? "" : normalize(value, locale);
|
|
282
|
+
const needle = typeof filter === "string" || typeof filter === "number" ? normalize(filter, locale) : "";
|
|
283
|
+
switch (rule.matchMode) {
|
|
284
|
+
case "startsWith": return text.startsWith(needle);
|
|
285
|
+
case "contains": return text.includes(needle);
|
|
286
|
+
case "notContains": return !text.includes(needle);
|
|
287
|
+
case "endsWith": return text.endsWith(needle);
|
|
288
|
+
case "equals":
|
|
289
|
+
if (typeof filter === "boolean") return value === filter;
|
|
290
|
+
if (typeof filter === "number") return Number(value) === filter;
|
|
291
|
+
if (filter instanceof Date) return toTime(value) === toTime(filter);
|
|
292
|
+
return text === needle;
|
|
293
|
+
case "notEquals":
|
|
294
|
+
if (typeof filter === "boolean") return value !== filter;
|
|
295
|
+
if (typeof filter === "number") return Number(value) !== filter;
|
|
296
|
+
if (filter instanceof Date) return toTime(value) !== toTime(filter);
|
|
297
|
+
return text !== needle;
|
|
298
|
+
case "in": return Array.isArray(filter) && filter.some((item) => item === value || item !== null && value !== null && normalize(item, locale) === text);
|
|
299
|
+
case "lt":
|
|
300
|
+
case "lte":
|
|
301
|
+
case "gt":
|
|
302
|
+
case "gte": {
|
|
303
|
+
const result = compare(value, filter);
|
|
304
|
+
if (result === null) return false;
|
|
305
|
+
return rule.matchMode === "lt" ? result < 0 : rule.matchMode === "lte" ? result <= 0 : rule.matchMode === "gt" ? result > 0 : result >= 0;
|
|
306
|
+
}
|
|
307
|
+
case "between": {
|
|
308
|
+
const [from, to] = Array.isArray(filter) ? filter : [];
|
|
309
|
+
const fromResult = isFilled(from) ? compare(value, from) : 0;
|
|
310
|
+
const toResult = isFilled(to) ? compare(value, to) : 0;
|
|
311
|
+
return fromResult !== null && toResult !== null && fromResult >= 0 && toResult <= 0;
|
|
312
|
+
}
|
|
313
|
+
case "dateIs": return dayOf(value) !== null && dayOf(value) === dayOf(filter);
|
|
314
|
+
case "dateIsNot": return dayOf(value) !== dayOf(filter);
|
|
315
|
+
case "dateBefore": {
|
|
316
|
+
const left = toTime(value);
|
|
317
|
+
const right = toTime(filter);
|
|
318
|
+
return left !== null && right !== null && left < right;
|
|
319
|
+
}
|
|
320
|
+
case "dateAfter": {
|
|
321
|
+
const left = toTime(value);
|
|
322
|
+
const right = toTime(filter);
|
|
323
|
+
return left !== null && right !== null && left > right;
|
|
324
|
+
}
|
|
241
325
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
326
|
+
}
|
|
327
|
+
function matchesFilter(value, filter, locale) {
|
|
328
|
+
const rules = filter.rules.filter((rule) => isFilled(rule.value));
|
|
329
|
+
if (!rules.length) return true;
|
|
330
|
+
return filter.operator === "or" ? rules.some((rule) => matchesRule(value, rule, locale)) : rules.every((rule) => matchesRule(value, rule, locale));
|
|
331
|
+
}
|
|
332
|
+
function filterRows(rows, filters, columns, globalFilter, globalFields, locale) {
|
|
333
|
+
const active = Object.entries(filters).filter(([, filter]) => isFilterActive(filter));
|
|
334
|
+
const query = globalFilter.trim() ? normalize(globalFilter.trim(), locale) : "";
|
|
335
|
+
if (!active.length && !query) return [...rows];
|
|
336
|
+
const fieldOf = (key) => columns.find((column) => column.field === key)?.filterField ?? key;
|
|
337
|
+
return rows.filter((row) => {
|
|
338
|
+
if (!active.every(([key, filter]) => matchesFilter(resolveField(row, fieldOf(key)), filter, locale))) return false;
|
|
339
|
+
if (!query) return true;
|
|
340
|
+
return globalFields.some((field) => {
|
|
341
|
+
const value = resolveField(row, field);
|
|
342
|
+
return value !== null && value !== void 0 && normalize(value, locale).includes(query);
|
|
253
343
|
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
function toCsv(rows, columns, options = {}) {
|
|
347
|
+
const separator = options.separator ?? ",";
|
|
348
|
+
const read = options.value ?? ((row, column) => resolveField(row, column.field));
|
|
349
|
+
const lines = rows.map((row) => columns.map((column) => csvCell(read(row, column), separator)).join(separator));
|
|
350
|
+
if (options.header !== false) lines.unshift(columns.map((column) => csvCell(columnLabel(column), separator)).join(separator));
|
|
351
|
+
return lines.join("\r\n");
|
|
352
|
+
}
|
|
353
|
+
var TxTableStyles = class TxTableStyles {
|
|
265
354
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
266
355
|
minVersion: "12.0.0",
|
|
267
356
|
version: "22.2.3",
|
|
268
357
|
ngImport: i0,
|
|
269
|
-
type:
|
|
358
|
+
type: TxTableStyles,
|
|
270
359
|
deps: [],
|
|
271
360
|
target: i0.ɵɵFactoryTarget.Component
|
|
272
361
|
});
|
|
273
362
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
274
|
-
minVersion: "
|
|
363
|
+
minVersion: "14.0.0",
|
|
275
364
|
version: "22.2.3",
|
|
276
|
-
type:
|
|
365
|
+
type: TxTableStyles,
|
|
277
366
|
isStandalone: true,
|
|
278
|
-
selector: "tx-table-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
367
|
+
selector: "tx-table-styles",
|
|
368
|
+
ngImport: i0,
|
|
369
|
+
template: "",
|
|
370
|
+
isInline: true,
|
|
371
|
+
styles: [".tx-table__drag-preview{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:var(--tx-table-header-cell-padding);border:1px solid var(--tx-table-drag-preview-border-color);border-radius:var(--tx-table-drag-preview-border-radius);background:var(--tx-table-drag-preview-background);box-shadow:var(--tx-table-drag-preview-shadow);color:var(--tx-table-header-cell-color);font-family:inherit;font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);list-style:none}.tx-table__drag-preview .tx-table__resizer{display:none}.cdk-drag-animating.tx-table__th{transition:transform .3s cubic-bezier(.2,.8,.4,1)}.tx-table__menu-action{display:inline-flex;flex-shrink:0;pointer-events:none}.tx-table__menu-action .tx-button{width:24px;min-width:24px;height:24px;padding:0;font-size:10.5px}.tx-table__menu-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-menu__item:has(.tx-table__menu-action :is(button,a):disabled){opacity:.5;pointer-events:none}@media(prefers-reduced-motion:reduce){.cdk-drag-animating.tx-table__th{transition:none}}\n"],
|
|
372
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
373
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
377
|
+
minVersion: "12.0.0",
|
|
378
|
+
version: "22.2.3",
|
|
379
|
+
ngImport: i0,
|
|
380
|
+
type: TxTableStyles,
|
|
381
|
+
decorators: [{
|
|
382
|
+
type: Component,
|
|
383
|
+
args: [{
|
|
384
|
+
selector: "tx-table-styles",
|
|
385
|
+
template: "",
|
|
386
|
+
encapsulation: ViewEncapsulation.None,
|
|
387
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
388
|
+
styles: [".tx-table__drag-preview{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:var(--tx-table-header-cell-padding);border:1px solid var(--tx-table-drag-preview-border-color);border-radius:var(--tx-table-drag-preview-border-radius);background:var(--tx-table-drag-preview-background);box-shadow:var(--tx-table-drag-preview-shadow);color:var(--tx-table-header-cell-color);font-family:inherit;font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);list-style:none}.tx-table__drag-preview .tx-table__resizer{display:none}.cdk-drag-animating.tx-table__th{transition:transform .3s cubic-bezier(.2,.8,.4,1)}.tx-table__menu-action{display:inline-flex;flex-shrink:0;pointer-events:none}.tx-table__menu-action .tx-button{width:24px;min-width:24px;height:24px;padding:0;font-size:10.5px}.tx-table__menu-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-menu__item:has(.tx-table__menu-action :is(button,a):disabled){opacity:.5;pointer-events:none}@media(prefers-reduced-motion:reduce){.cdk-drag-animating.tx-table__th{transition:none}}\n"]
|
|
389
|
+
}]
|
|
390
|
+
}]
|
|
391
|
+
});
|
|
392
|
+
const TX_TABLE = new InjectionToken("TX_TABLE");
|
|
393
|
+
const MAX_RULES = 2;
|
|
394
|
+
function toDateInput(value) {
|
|
395
|
+
if (!(value instanceof Date) || Number.isNaN(value.getTime())) return "";
|
|
396
|
+
const pad = (part) => String(part).padStart(2, "0");
|
|
397
|
+
return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}`;
|
|
398
|
+
}
|
|
399
|
+
function fromDateInput(value) {
|
|
400
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
|
|
401
|
+
return match ? new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3])) : null;
|
|
402
|
+
}
|
|
403
|
+
var TxTableColumnFilter = class TxTableColumnFilter {
|
|
404
|
+
table = inject(TX_TABLE);
|
|
405
|
+
panel = viewChild("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
|
|
406
|
+
timer;
|
|
407
|
+
column = input.required(...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
|
|
408
|
+
display = input("menu", ...ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []);
|
|
409
|
+
maxRules = MAX_RULES;
|
|
410
|
+
translations = injectTranslations();
|
|
411
|
+
type = computed(() => this.column().filterOptions?.length ? "options" : this.column().filterType ?? "text", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
412
|
+
modes = computed(() => this.type() === "options" || this.type() === "boolean" ? [] : this.column().filterMatchModes ?? TX_FILTER_MATCH_MODES[this.column().filterType ?? "text"], ...ngDevMode ? [{ debugName: "modes" }] : /* istanbul ignore next */ []);
|
|
413
|
+
current = computed(() => this.table.filters()[this.column().field], ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
414
|
+
active = computed(() => isFilterActive(this.current()), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
415
|
+
draft = signal({
|
|
416
|
+
operator: "and",
|
|
417
|
+
rules: [{
|
|
418
|
+
value: null,
|
|
419
|
+
matchMode: "startsWith"
|
|
420
|
+
}]
|
|
421
|
+
}, ...ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []);
|
|
422
|
+
live = computed(() => this.current() ?? this.empty(), ...ngDevMode ? [{ debugName: "live" }] : /* istanbul ignore next */ []);
|
|
423
|
+
modeOptions = computed(() => this.modes().map((mode) => ({
|
|
424
|
+
value: mode,
|
|
425
|
+
label: this.translations()[mode]
|
|
426
|
+
})), ...ngDevMode ? [{ debugName: "modeOptions" }] : /* istanbul ignore next */ []);
|
|
427
|
+
operatorOptions = computed(() => [{
|
|
428
|
+
value: "and",
|
|
429
|
+
label: this.translations().filterMatchAll
|
|
430
|
+
}, {
|
|
431
|
+
value: "or",
|
|
432
|
+
label: this.translations().filterMatchAny
|
|
433
|
+
}], ...ngDevMode ? [{ debugName: "operatorOptions" }] : /* istanbul ignore next */ []);
|
|
434
|
+
booleanOptions = computed(() => [
|
|
435
|
+
{
|
|
436
|
+
value: null,
|
|
437
|
+
label: this.translations().filterAny
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
value: true,
|
|
441
|
+
label: this.translations().yes
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
value: false,
|
|
445
|
+
label: this.translations().no
|
|
446
|
+
}
|
|
447
|
+
], ...ngDevMode ? [{ debugName: "booleanOptions" }] : /* istanbul ignore next */ []);
|
|
448
|
+
modeItems = computed(() => {
|
|
449
|
+
const selected = this.live().rules[0]?.matchMode;
|
|
450
|
+
return this.modeOptions().map((option) => ({
|
|
451
|
+
id: option.value,
|
|
452
|
+
label: option.label,
|
|
453
|
+
icon: option.value === selected ? "check" : void 0,
|
|
454
|
+
command: () => this.setLiveMode(option.value)
|
|
455
|
+
}));
|
|
456
|
+
}, ...ngDevMode ? [{ debugName: "modeItems" }] : /* istanbul ignore next */ []);
|
|
457
|
+
buttonLabel = computed(() => this.translations().filterColumn.replace("{column}", columnLabel(this.column())), ...ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []);
|
|
458
|
+
valueLabel = computed(() => `${columnLabel(this.column())}: ${this.translations().filterValue}`, ...ngDevMode ? [{ debugName: "valueLabel" }] : /* istanbul ignore next */ []);
|
|
459
|
+
constructor() {
|
|
460
|
+
inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));
|
|
461
|
+
}
|
|
462
|
+
empty() {
|
|
463
|
+
return {
|
|
464
|
+
operator: "and",
|
|
465
|
+
rules: [{
|
|
466
|
+
value: null,
|
|
467
|
+
matchMode: defaultMatchMode(this.column())
|
|
468
|
+
}]
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
startDraft() {
|
|
472
|
+
const current = this.current();
|
|
473
|
+
this.draft.set(current ? {
|
|
474
|
+
operator: current.operator,
|
|
475
|
+
rules: current.rules.map((rule) => ({ ...rule }))
|
|
476
|
+
} : this.empty());
|
|
477
|
+
}
|
|
478
|
+
dateValue(value) {
|
|
479
|
+
return toDateInput(value);
|
|
480
|
+
}
|
|
481
|
+
parseDate(value) {
|
|
482
|
+
return fromDateInput(value);
|
|
483
|
+
}
|
|
484
|
+
setValue(index, value, live) {
|
|
485
|
+
if (live) {
|
|
486
|
+
const filter = this.live();
|
|
487
|
+
const rules = filter.rules.map((rule, position) => position === index ? {
|
|
488
|
+
...rule,
|
|
489
|
+
value
|
|
490
|
+
} : rule);
|
|
491
|
+
clearTimeout(this.timer);
|
|
492
|
+
const commit = () => this.table.applyFilter(this.column().field, {
|
|
493
|
+
...filter,
|
|
494
|
+
rules
|
|
495
|
+
});
|
|
496
|
+
if (this.type() === "text") this.timer = setTimeout(commit, this.table.filterDelay());
|
|
497
|
+
else commit();
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this.updateRules((rules) => rules.map((rule, position) => position === index ? {
|
|
501
|
+
...rule,
|
|
502
|
+
value
|
|
503
|
+
} : rule));
|
|
504
|
+
}
|
|
505
|
+
setMode(index, matchMode) {
|
|
506
|
+
this.updateRules((rules) => rules.map((rule, position) => position === index ? {
|
|
507
|
+
...rule,
|
|
508
|
+
matchMode
|
|
509
|
+
} : rule));
|
|
510
|
+
}
|
|
511
|
+
setLiveMode(matchMode) {
|
|
512
|
+
const filter = this.live();
|
|
513
|
+
this.table.applyFilter(this.column().field, {
|
|
514
|
+
...filter,
|
|
515
|
+
rules: filter.rules.map((rule, index) => index === 0 ? {
|
|
516
|
+
...rule,
|
|
517
|
+
matchMode
|
|
518
|
+
} : rule)
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
setOperator(operator) {
|
|
522
|
+
this.draft.set({
|
|
523
|
+
...this.draft(),
|
|
524
|
+
operator
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
addRule() {
|
|
528
|
+
this.updateRules((rules) => [...rules, {
|
|
529
|
+
value: null,
|
|
530
|
+
matchMode: defaultMatchMode(this.column())
|
|
531
|
+
}]);
|
|
532
|
+
}
|
|
533
|
+
removeRule(index) {
|
|
534
|
+
this.updateRules((rules) => rules.filter((_, position) => position !== index));
|
|
535
|
+
}
|
|
536
|
+
apply() {
|
|
537
|
+
this.table.applyFilter(this.column().field, this.draft());
|
|
538
|
+
this.panel()?.hide();
|
|
539
|
+
}
|
|
540
|
+
clear() {
|
|
541
|
+
this.draft.set(this.empty());
|
|
542
|
+
this.table.applyFilter(this.column().field, null);
|
|
543
|
+
this.panel()?.hide();
|
|
544
|
+
}
|
|
545
|
+
updateRules(change) {
|
|
546
|
+
this.draft.set({
|
|
547
|
+
...this.draft(),
|
|
548
|
+
rules: change(this.draft().rules)
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
552
|
+
minVersion: "12.0.0",
|
|
553
|
+
version: "22.2.3",
|
|
554
|
+
ngImport: i0,
|
|
555
|
+
type: TxTableColumnFilter,
|
|
556
|
+
deps: [],
|
|
557
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
558
|
+
});
|
|
559
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
560
|
+
minVersion: "17.0.0",
|
|
561
|
+
version: "22.2.3",
|
|
562
|
+
type: TxTableColumnFilter,
|
|
563
|
+
isStandalone: true,
|
|
564
|
+
selector: "tx-table-column-filter",
|
|
565
|
+
inputs: {
|
|
566
|
+
column: {
|
|
567
|
+
classPropertyName: "column",
|
|
568
|
+
publicName: "column",
|
|
569
|
+
isSignal: true,
|
|
570
|
+
isRequired: true,
|
|
571
|
+
transformFunction: null
|
|
572
|
+
},
|
|
573
|
+
display: {
|
|
574
|
+
classPropertyName: "display",
|
|
575
|
+
publicName: "display",
|
|
311
576
|
isSignal: true,
|
|
312
577
|
isRequired: false,
|
|
313
578
|
transformFunction: null
|
|
314
579
|
}
|
|
315
580
|
},
|
|
316
|
-
|
|
317
|
-
|
|
581
|
+
host: {
|
|
582
|
+
properties: { "class.tx-table-column-filter--row": "display() === 'row'" },
|
|
583
|
+
classAttribute: "tx-table-column-filter"
|
|
584
|
+
},
|
|
585
|
+
viewQueries: [{
|
|
586
|
+
propertyName: "panel",
|
|
587
|
+
first: true,
|
|
588
|
+
predicate: ["panel"],
|
|
589
|
+
descendants: true,
|
|
590
|
+
isSignal: true
|
|
591
|
+
}],
|
|
318
592
|
ngImport: i0,
|
|
319
593
|
template: `
|
|
320
|
-
<
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
<tx-popover #panel placement="bottom-end" [ariaLabel]="translations().tableSettings" [unstyled]="unstyled()">
|
|
332
|
-
<div class="tx-table-settings__panel">
|
|
333
|
-
@if (tabs().length > 1) {
|
|
334
|
-
<div class="tx-table-settings__tabs" role="tablist">
|
|
335
|
-
@for (tab of tabs(); track tab) {
|
|
336
|
-
<button
|
|
337
|
-
type="button"
|
|
338
|
-
role="tab"
|
|
339
|
-
class="tx-table-settings__tab"
|
|
340
|
-
[id]="id + '-' + tab"
|
|
341
|
-
[attr.aria-selected]="tab === currentTab()"
|
|
342
|
-
[attr.aria-controls]="id + '-panel'"
|
|
343
|
-
[attr.tabindex]="tab === currentTab() ? 0 : -1"
|
|
344
|
-
[txTooltip]="tab === 'columns' ? translations().tableColumnsHint : translations().tableActionsHint"
|
|
345
|
-
(click)="activeTab.set(tab)"
|
|
346
|
-
(keydown.arrowright)="moveTab(1)"
|
|
347
|
-
(keydown.arrowleft)="moveTab(-1)"
|
|
348
|
-
>
|
|
349
|
-
<tx-icon aria-hidden="true" [name]="tab === 'columns' ? 'table' : 'bolt'" />
|
|
350
|
-
{{ tab === 'columns' ? translations().tableColumns : translations().tableActions }}
|
|
351
|
-
</button>
|
|
352
|
-
}
|
|
353
|
-
</div>
|
|
354
|
-
} @else {
|
|
355
|
-
<div class="tx-table-settings__title" [id]="id + '-' + currentTab()">
|
|
356
|
-
<tx-icon aria-hidden="true" [name]="currentTab() === 'columns' ? 'table' : 'bolt'" />
|
|
357
|
-
<span>{{ currentTab() === 'columns' ? translations().tableColumns : translations().tableActions }}</span>
|
|
358
|
-
</div>
|
|
594
|
+
<ng-template #editor let-rule let-index="index" let-live="live">
|
|
595
|
+
@switch (type()) {
|
|
596
|
+
@case ('numeric') {
|
|
597
|
+
<tx-input-number
|
|
598
|
+
size="small"
|
|
599
|
+
class="tx-table-filter__value"
|
|
600
|
+
[ariaLabel]="valueLabel()"
|
|
601
|
+
[placeholder]="column().filterPlaceholder"
|
|
602
|
+
[ngModel]="rule.value"
|
|
603
|
+
(ngModelChange)="setValue(index, $event, live)"
|
|
604
|
+
/>
|
|
359
605
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
606
|
+
@case ('date') {
|
|
607
|
+
<input
|
|
608
|
+
txInput
|
|
609
|
+
type="date"
|
|
610
|
+
size="small"
|
|
611
|
+
class="tx-table-filter__value"
|
|
612
|
+
[attr.aria-label]="valueLabel()"
|
|
613
|
+
[value]="dateValue(rule.value)"
|
|
614
|
+
(change)="setValue(index, parseDate($any($event.target).value), live)"
|
|
615
|
+
/>
|
|
616
|
+
}
|
|
617
|
+
@case ('boolean') {
|
|
618
|
+
<tx-select
|
|
619
|
+
size="small"
|
|
620
|
+
class="tx-table-filter__value"
|
|
621
|
+
optionLabel="label"
|
|
622
|
+
optionValue="value"
|
|
623
|
+
[options]="booleanOptions()"
|
|
624
|
+
[ariaLabel]="valueLabel()"
|
|
625
|
+
[ngModel]="rule.value"
|
|
626
|
+
(ngModelChange)="setValue(index, $event, true)"
|
|
627
|
+
/>
|
|
628
|
+
}
|
|
629
|
+
@case ('options') {
|
|
630
|
+
<tx-multiselect
|
|
631
|
+
size="small"
|
|
632
|
+
class="tx-table-filter__value"
|
|
633
|
+
optionLabel="label"
|
|
634
|
+
optionValue="value"
|
|
635
|
+
[maxSelectedLabels]="2"
|
|
636
|
+
[options]="column().filterOptions ?? []"
|
|
637
|
+
[ariaLabel]="valueLabel()"
|
|
638
|
+
[placeholder]="column().filterPlaceholder ?? translations().filterAny"
|
|
639
|
+
[ngModel]="rule.value ?? []"
|
|
640
|
+
(ngModelChange)="setValue(index, $event, live)"
|
|
641
|
+
/>
|
|
642
|
+
}
|
|
643
|
+
@default {
|
|
644
|
+
<input
|
|
645
|
+
txInput
|
|
646
|
+
type="text"
|
|
647
|
+
size="small"
|
|
648
|
+
class="tx-table-filter__value"
|
|
649
|
+
[attr.aria-label]="valueLabel()"
|
|
650
|
+
[placeholder]="column().filterPlaceholder ?? ''"
|
|
651
|
+
[value]="rule.value ?? ''"
|
|
652
|
+
(input)="setValue(index, $any($event.target).value, live)"
|
|
653
|
+
(keydown.enter)="apply()"
|
|
654
|
+
/>
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
</ng-template>
|
|
658
|
+
|
|
659
|
+
@if (display() === 'row') {
|
|
660
|
+
<div class="tx-table-filter__row">
|
|
661
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: live().rules[0], index: 0, live: true }" />
|
|
662
|
+
@if (modes().length > 1) {
|
|
663
|
+
<button
|
|
664
|
+
txButton
|
|
665
|
+
type="button"
|
|
666
|
+
text
|
|
667
|
+
rounded
|
|
668
|
+
size="small"
|
|
669
|
+
severity="secondary"
|
|
670
|
+
class="tx-table-filter__button"
|
|
671
|
+
[class.tx-table-filter__button--active]="active()"
|
|
672
|
+
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
673
|
+
[attr.aria-label]="buttonLabel()"
|
|
674
|
+
[txMenuTrigger]="modeMenu"
|
|
675
|
+
></button>
|
|
676
|
+
<tx-menu #modeMenu popup [model]="modeItems()" [ariaLabel]="translations().filterMatchMode" />
|
|
677
|
+
}
|
|
678
|
+
</div>
|
|
679
|
+
} @else {
|
|
680
|
+
<button
|
|
681
|
+
txButton
|
|
682
|
+
type="button"
|
|
683
|
+
text
|
|
684
|
+
rounded
|
|
685
|
+
size="small"
|
|
686
|
+
severity="secondary"
|
|
687
|
+
class="tx-table-filter__button"
|
|
688
|
+
[class.tx-table-filter__button--active]="active()"
|
|
689
|
+
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
690
|
+
[attr.aria-label]="buttonLabel()"
|
|
691
|
+
[txPopoverTrigger]="panel"
|
|
692
|
+
(click)="$event.stopPropagation()"
|
|
693
|
+
></button>
|
|
694
|
+
<tx-popover #panel placement="bottom-start" [ariaLabel]="buttonLabel()" (opened)="startDraft()">
|
|
695
|
+
<div class="tx-table-filter">
|
|
696
|
+
@if (type() === 'boolean' || type() === 'options') {
|
|
697
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: draft().rules[0], index: 0, live: false }" />
|
|
405
698
|
} @else {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
699
|
+
@if (draft().rules.length > 1) {
|
|
700
|
+
<tx-select
|
|
701
|
+
size="small"
|
|
702
|
+
optionLabel="label"
|
|
703
|
+
optionValue="value"
|
|
704
|
+
[options]="operatorOptions()"
|
|
705
|
+
[ariaLabel]="translations().filterMatchAll + ' / ' + translations().filterMatchAny"
|
|
706
|
+
[ngModel]="draft().operator"
|
|
707
|
+
(ngModelChange)="setOperator($event)"
|
|
708
|
+
/>
|
|
709
|
+
}
|
|
710
|
+
@for (rule of draft().rules; track $index; let index = $index) {
|
|
711
|
+
<div class="tx-table-filter__rule">
|
|
712
|
+
@if (modes().length > 1) {
|
|
713
|
+
<tx-select
|
|
714
|
+
size="small"
|
|
715
|
+
optionLabel="label"
|
|
716
|
+
optionValue="value"
|
|
717
|
+
[options]="modeOptions()"
|
|
718
|
+
[ariaLabel]="translations().filterMatchMode"
|
|
719
|
+
[ngModel]="rule.matchMode"
|
|
720
|
+
(ngModelChange)="setMode(index, $event)"
|
|
419
721
|
/>
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
722
|
+
}
|
|
723
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: rule, index, live: false }" />
|
|
724
|
+
@if (draft().rules.length > 1) {
|
|
725
|
+
<button
|
|
726
|
+
txButton
|
|
727
|
+
type="button"
|
|
728
|
+
text
|
|
729
|
+
size="small"
|
|
730
|
+
severity="danger"
|
|
731
|
+
icon="trash"
|
|
732
|
+
[label]="translations().filterRemoveRule"
|
|
733
|
+
(click)="removeRule(index)"
|
|
734
|
+
></button>
|
|
735
|
+
}
|
|
736
|
+
</div>
|
|
737
|
+
}
|
|
738
|
+
@if (draft().rules.length < maxRules) {
|
|
739
|
+
<button txButton type="button" text size="small" icon="plus" [label]="translations().filterAddRule" (click)="addRule()"></button>
|
|
740
|
+
}
|
|
423
741
|
}
|
|
742
|
+
<div class="tx-table-filter__footer">
|
|
743
|
+
<button txButton type="button" outlined size="small" severity="secondary" [label]="translations().clear" (click)="clear()"></button>
|
|
744
|
+
<button txButton type="button" size="small" [label]="translations().filterApply" (click)="apply()"></button>
|
|
745
|
+
</div>
|
|
424
746
|
</div>
|
|
425
|
-
</
|
|
426
|
-
|
|
747
|
+
</tx-popover>
|
|
748
|
+
}
|
|
427
749
|
`,
|
|
428
750
|
isInline: true,
|
|
429
|
-
styles: [":host{display:inline-flex
|
|
751
|
+
styles: [":host{display:inline-flex;min-width:0}:host(.tx-table-column-filter--row){display:flex;width:100%}.tx-table-filter__row{display:flex;flex:1;align-items:center;gap:var(--tx-table-filter-gap, 7px);min-width:0}.tx-table-filter__row .tx-table-filter__value{flex:1;min-width:0;width:100%}.tx-table-filter{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);min-width:var(--tx-table-filter-min-width, 175px)}.tx-table-filter__rule{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);padding-bottom:var(--tx-table-filter-gap, 7px);border-bottom:1px solid var(--tx-surface-border)}.tx-table-filter__rule:last-of-type{padding-bottom:0;border-bottom:0}.tx-table-filter__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--tx-table-filter-gap, 7px)}.tx-table-filter__value{width:100%}.tx-table-filter__button--active{color:var(--tx-primary-base)}\n"],
|
|
430
752
|
dependencies: [
|
|
753
|
+
{
|
|
754
|
+
kind: "directive",
|
|
755
|
+
type: NgTemplateOutlet,
|
|
756
|
+
selector: "[ngTemplateOutlet]",
|
|
757
|
+
inputs: [
|
|
758
|
+
"ngTemplateOutletContext",
|
|
759
|
+
"ngTemplateOutlet",
|
|
760
|
+
"ngTemplateOutletInjector"
|
|
761
|
+
]
|
|
762
|
+
},
|
|
431
763
|
{
|
|
432
764
|
kind: "ngmodule",
|
|
433
765
|
type: FormsModule
|
|
434
766
|
},
|
|
435
767
|
{
|
|
436
768
|
kind: "directive",
|
|
437
|
-
type: i1.NgControlStatus,
|
|
769
|
+
type: i1$1.NgControlStatus,
|
|
438
770
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
439
771
|
},
|
|
440
772
|
{
|
|
441
773
|
kind: "directive",
|
|
442
|
-
type: i1.NgModel,
|
|
774
|
+
type: i1$1.NgModel,
|
|
443
775
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
444
776
|
inputs: [
|
|
445
777
|
"name",
|
|
@@ -451,76 +783,9 @@ var TxTableSettings = class TxTableSettings {
|
|
|
451
783
|
exportAs: ["ngModel"]
|
|
452
784
|
},
|
|
453
785
|
{
|
|
454
|
-
kind: "
|
|
455
|
-
type:
|
|
456
|
-
selector: "[
|
|
457
|
-
inputs: [
|
|
458
|
-
"cdkDropListConnectedTo",
|
|
459
|
-
"cdkDropListData",
|
|
460
|
-
"cdkDropListOrientation",
|
|
461
|
-
"id",
|
|
462
|
-
"cdkDropListLockAxis",
|
|
463
|
-
"cdkDropListDisabled",
|
|
464
|
-
"cdkDropListSortingDisabled",
|
|
465
|
-
"cdkDropListEnterPredicate",
|
|
466
|
-
"cdkDropListSortPredicate",
|
|
467
|
-
"cdkDropListAutoScrollDisabled",
|
|
468
|
-
"cdkDropListAutoScrollStep",
|
|
469
|
-
"cdkDropListElementContainer",
|
|
470
|
-
"cdkDropListHasAnchor"
|
|
471
|
-
],
|
|
472
|
-
outputs: [
|
|
473
|
-
"cdkDropListDropped",
|
|
474
|
-
"cdkDropListEntered",
|
|
475
|
-
"cdkDropListExited",
|
|
476
|
-
"cdkDropListSorted"
|
|
477
|
-
],
|
|
478
|
-
exportAs: ["cdkDropList"]
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
kind: "directive",
|
|
482
|
-
type: CdkDrag,
|
|
483
|
-
selector: "[cdkDrag]",
|
|
484
|
-
inputs: [
|
|
485
|
-
"cdkDragData",
|
|
486
|
-
"cdkDragLockAxis",
|
|
487
|
-
"cdkDragRootElement",
|
|
488
|
-
"cdkDragBoundary",
|
|
489
|
-
"cdkDragStartDelay",
|
|
490
|
-
"cdkDragFreeDragPosition",
|
|
491
|
-
"cdkDragDisabled",
|
|
492
|
-
"cdkDragConstrainPosition",
|
|
493
|
-
"cdkDragPreviewClass",
|
|
494
|
-
"cdkDragPreviewContainer",
|
|
495
|
-
"cdkDragScale"
|
|
496
|
-
],
|
|
497
|
-
outputs: [
|
|
498
|
-
"cdkDragStarted",
|
|
499
|
-
"cdkDragReleased",
|
|
500
|
-
"cdkDragEnded",
|
|
501
|
-
"cdkDragEntered",
|
|
502
|
-
"cdkDragExited",
|
|
503
|
-
"cdkDragDropped",
|
|
504
|
-
"cdkDragMoved"
|
|
505
|
-
],
|
|
506
|
-
exportAs: ["cdkDrag"]
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
kind: "directive",
|
|
510
|
-
type: CdkDragHandle,
|
|
511
|
-
selector: "[cdkDragHandle]",
|
|
512
|
-
inputs: ["cdkDragHandleDisabled"]
|
|
513
|
-
},
|
|
514
|
-
{
|
|
515
|
-
kind: "component",
|
|
516
|
-
type: TxIcon,
|
|
517
|
-
selector: "tx-icon",
|
|
518
|
-
inputs: ["name"]
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
kind: "component",
|
|
522
|
-
type: TxButton,
|
|
523
|
-
selector: "button[txButton], a[txButton]",
|
|
786
|
+
kind: "component",
|
|
787
|
+
type: TxButton,
|
|
788
|
+
selector: "button[txButton], a[txButton]",
|
|
524
789
|
inputs: [
|
|
525
790
|
"label",
|
|
526
791
|
"severity",
|
|
@@ -548,23 +813,48 @@ var TxTableSettings = class TxTableSettings {
|
|
|
548
813
|
"unstyled"
|
|
549
814
|
]
|
|
550
815
|
},
|
|
816
|
+
{
|
|
817
|
+
kind: "directive",
|
|
818
|
+
type: TxInput,
|
|
819
|
+
selector: "input[txInput], textarea[txInput]",
|
|
820
|
+
inputs: [
|
|
821
|
+
"invalid",
|
|
822
|
+
"size",
|
|
823
|
+
"variant",
|
|
824
|
+
"fluid",
|
|
825
|
+
"dt",
|
|
826
|
+
"pt",
|
|
827
|
+
"ptOptions",
|
|
828
|
+
"unstyled"
|
|
829
|
+
]
|
|
830
|
+
},
|
|
551
831
|
{
|
|
552
832
|
kind: "component",
|
|
553
|
-
type:
|
|
554
|
-
selector: "tx-
|
|
833
|
+
type: TxInputNumber,
|
|
834
|
+
selector: "tx-input-number",
|
|
555
835
|
inputs: [
|
|
556
|
-
"
|
|
557
|
-
"
|
|
558
|
-
"
|
|
559
|
-
"
|
|
560
|
-
"
|
|
561
|
-
"
|
|
562
|
-
"
|
|
563
|
-
"
|
|
564
|
-
"
|
|
836
|
+
"mode",
|
|
837
|
+
"currency",
|
|
838
|
+
"currencyDisplay",
|
|
839
|
+
"locale",
|
|
840
|
+
"useGrouping",
|
|
841
|
+
"minFractionDigits",
|
|
842
|
+
"maxFractionDigits",
|
|
843
|
+
"prefix",
|
|
844
|
+
"suffix",
|
|
845
|
+
"min",
|
|
846
|
+
"max",
|
|
847
|
+
"step",
|
|
848
|
+
"showButtons",
|
|
849
|
+
"buttonLayout",
|
|
850
|
+
"incrementIcon",
|
|
851
|
+
"decrementIcon",
|
|
852
|
+
"allowEmpty",
|
|
853
|
+
"showClear",
|
|
854
|
+
"placeholder",
|
|
565
855
|
"size",
|
|
566
856
|
"variant",
|
|
567
|
-
"
|
|
857
|
+
"fluid",
|
|
568
858
|
"invalid",
|
|
569
859
|
"disabled",
|
|
570
860
|
"readonly",
|
|
@@ -579,7 +869,44 @@ var TxTableSettings = class TxTableSettings {
|
|
|
579
869
|
"ptOptions",
|
|
580
870
|
"unstyled"
|
|
581
871
|
],
|
|
582
|
-
outputs: ["
|
|
872
|
+
outputs: ["changed", "cleared"]
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
kind: "component",
|
|
876
|
+
type: TxSelect,
|
|
877
|
+
selector: "tx-select",
|
|
878
|
+
inputs: [
|
|
879
|
+
"options",
|
|
880
|
+
"editable",
|
|
881
|
+
"checkmark",
|
|
882
|
+
"dropdownIcon",
|
|
883
|
+
"dt",
|
|
884
|
+
"pt",
|
|
885
|
+
"ptOptions",
|
|
886
|
+
"unstyled"
|
|
887
|
+
],
|
|
888
|
+
outputs: ["changed"]
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
kind: "component",
|
|
892
|
+
type: TxMultiselect,
|
|
893
|
+
selector: "tx-multiselect",
|
|
894
|
+
inputs: [
|
|
895
|
+
"options",
|
|
896
|
+
"display",
|
|
897
|
+
"maxSelectedLabels",
|
|
898
|
+
"selectedItemsLabel",
|
|
899
|
+
"selectAllLabel",
|
|
900
|
+
"countLabel",
|
|
901
|
+
"selectionLimit",
|
|
902
|
+
"showToggleAll",
|
|
903
|
+
"dropdownIcon",
|
|
904
|
+
"dt",
|
|
905
|
+
"pt",
|
|
906
|
+
"ptOptions",
|
|
907
|
+
"unstyled"
|
|
908
|
+
],
|
|
909
|
+
outputs: ["changed"]
|
|
583
910
|
},
|
|
584
911
|
{
|
|
585
912
|
kind: "component",
|
|
@@ -618,31 +945,34 @@ var TxTableSettings = class TxTableSettings {
|
|
|
618
945
|
inputs: ["txPopoverTrigger"]
|
|
619
946
|
},
|
|
620
947
|
{
|
|
621
|
-
kind: "
|
|
622
|
-
type:
|
|
623
|
-
selector: "
|
|
948
|
+
kind: "component",
|
|
949
|
+
type: TxMenu,
|
|
950
|
+
selector: "tx-menu, tx-tiered-menu",
|
|
624
951
|
inputs: [
|
|
625
|
-
"
|
|
626
|
-
"
|
|
627
|
-
"
|
|
628
|
-
"
|
|
629
|
-
"
|
|
630
|
-
"
|
|
631
|
-
"
|
|
632
|
-
"
|
|
633
|
-
"
|
|
634
|
-
"
|
|
635
|
-
"
|
|
636
|
-
"
|
|
637
|
-
"tooltipContext",
|
|
638
|
-
"tooltipClass",
|
|
639
|
-
"tooltipDt",
|
|
640
|
-
"tooltipPt",
|
|
641
|
-
"tooltipPtOptions",
|
|
642
|
-
"tooltipUnstyled"
|
|
952
|
+
"model",
|
|
953
|
+
"popup",
|
|
954
|
+
"tiered",
|
|
955
|
+
"placement",
|
|
956
|
+
"offset",
|
|
957
|
+
"variant",
|
|
958
|
+
"ariaLabel",
|
|
959
|
+
"ariaLabelledBy",
|
|
960
|
+
"dt",
|
|
961
|
+
"pt",
|
|
962
|
+
"ptOptions",
|
|
963
|
+
"unstyled"
|
|
643
964
|
],
|
|
644
|
-
outputs: [
|
|
645
|
-
|
|
965
|
+
outputs: [
|
|
966
|
+
"itemSelected",
|
|
967
|
+
"opened",
|
|
968
|
+
"closed"
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
kind: "directive",
|
|
973
|
+
type: TxMenuTrigger,
|
|
974
|
+
selector: "[txMenuTrigger]",
|
|
975
|
+
inputs: ["txMenuTrigger"]
|
|
646
976
|
}
|
|
647
977
|
],
|
|
648
978
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -652,699 +982,457 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
652
982
|
minVersion: "12.0.0",
|
|
653
983
|
version: "22.2.3",
|
|
654
984
|
ngImport: i0,
|
|
655
|
-
type:
|
|
985
|
+
type: TxTableColumnFilter,
|
|
656
986
|
decorators: [{
|
|
657
987
|
type: Component,
|
|
658
988
|
args: [{
|
|
659
|
-
selector: "tx-table-
|
|
989
|
+
selector: "tx-table-column-filter",
|
|
660
990
|
imports: [
|
|
991
|
+
NgTemplateOutlet,
|
|
661
992
|
FormsModule,
|
|
662
|
-
CdkDropList,
|
|
663
|
-
CdkDrag,
|
|
664
|
-
CdkDragHandle,
|
|
665
|
-
TxIcon,
|
|
666
993
|
TxButton,
|
|
667
|
-
|
|
994
|
+
TxInput,
|
|
995
|
+
TxInputNumber,
|
|
996
|
+
TxSelect,
|
|
997
|
+
TxMultiselect,
|
|
668
998
|
TxPopover,
|
|
669
999
|
TxPopoverTrigger,
|
|
670
|
-
|
|
1000
|
+
TxMenu,
|
|
1001
|
+
TxMenuTrigger
|
|
671
1002
|
],
|
|
672
1003
|
template: `
|
|
673
|
-
<
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
<tx-popover #panel placement="bottom-end" [ariaLabel]="translations().tableSettings" [unstyled]="unstyled()">
|
|
685
|
-
<div class="tx-table-settings__panel">
|
|
686
|
-
@if (tabs().length > 1) {
|
|
687
|
-
<div class="tx-table-settings__tabs" role="tablist">
|
|
688
|
-
@for (tab of tabs(); track tab) {
|
|
689
|
-
<button
|
|
690
|
-
type="button"
|
|
691
|
-
role="tab"
|
|
692
|
-
class="tx-table-settings__tab"
|
|
693
|
-
[id]="id + '-' + tab"
|
|
694
|
-
[attr.aria-selected]="tab === currentTab()"
|
|
695
|
-
[attr.aria-controls]="id + '-panel'"
|
|
696
|
-
[attr.tabindex]="tab === currentTab() ? 0 : -1"
|
|
697
|
-
[txTooltip]="tab === 'columns' ? translations().tableColumnsHint : translations().tableActionsHint"
|
|
698
|
-
(click)="activeTab.set(tab)"
|
|
699
|
-
(keydown.arrowright)="moveTab(1)"
|
|
700
|
-
(keydown.arrowleft)="moveTab(-1)"
|
|
701
|
-
>
|
|
702
|
-
<tx-icon aria-hidden="true" [name]="tab === 'columns' ? 'table' : 'bolt'" />
|
|
703
|
-
{{ tab === 'columns' ? translations().tableColumns : translations().tableActions }}
|
|
704
|
-
</button>
|
|
705
|
-
}
|
|
706
|
-
</div>
|
|
707
|
-
} @else {
|
|
708
|
-
<div class="tx-table-settings__title" [id]="id + '-' + currentTab()">
|
|
709
|
-
<tx-icon aria-hidden="true" [name]="currentTab() === 'columns' ? 'table' : 'bolt'" />
|
|
710
|
-
<span>{{ currentTab() === 'columns' ? translations().tableColumns : translations().tableActions }}</span>
|
|
711
|
-
</div>
|
|
1004
|
+
<ng-template #editor let-rule let-index="index" let-live="live">
|
|
1005
|
+
@switch (type()) {
|
|
1006
|
+
@case ('numeric') {
|
|
1007
|
+
<tx-input-number
|
|
1008
|
+
size="small"
|
|
1009
|
+
class="tx-table-filter__value"
|
|
1010
|
+
[ariaLabel]="valueLabel()"
|
|
1011
|
+
[placeholder]="column().filterPlaceholder"
|
|
1012
|
+
[ngModel]="rule.value"
|
|
1013
|
+
(ngModelChange)="setValue(index, $event, live)"
|
|
1014
|
+
/>
|
|
712
1015
|
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
1016
|
+
@case ('date') {
|
|
1017
|
+
<input
|
|
1018
|
+
txInput
|
|
1019
|
+
type="date"
|
|
1020
|
+
size="small"
|
|
1021
|
+
class="tx-table-filter__value"
|
|
1022
|
+
[attr.aria-label]="valueLabel()"
|
|
1023
|
+
[value]="dateValue(rule.value)"
|
|
1024
|
+
(change)="setValue(index, parseDate($any($event.target).value), live)"
|
|
1025
|
+
/>
|
|
1026
|
+
}
|
|
1027
|
+
@case ('boolean') {
|
|
1028
|
+
<tx-select
|
|
1029
|
+
size="small"
|
|
1030
|
+
class="tx-table-filter__value"
|
|
1031
|
+
optionLabel="label"
|
|
1032
|
+
optionValue="value"
|
|
1033
|
+
[options]="booleanOptions()"
|
|
1034
|
+
[ariaLabel]="valueLabel()"
|
|
1035
|
+
[ngModel]="rule.value"
|
|
1036
|
+
(ngModelChange)="setValue(index, $event, true)"
|
|
1037
|
+
/>
|
|
1038
|
+
}
|
|
1039
|
+
@case ('options') {
|
|
1040
|
+
<tx-multiselect
|
|
1041
|
+
size="small"
|
|
1042
|
+
class="tx-table-filter__value"
|
|
1043
|
+
optionLabel="label"
|
|
1044
|
+
optionValue="value"
|
|
1045
|
+
[maxSelectedLabels]="2"
|
|
1046
|
+
[options]="column().filterOptions ?? []"
|
|
1047
|
+
[ariaLabel]="valueLabel()"
|
|
1048
|
+
[placeholder]="column().filterPlaceholder ?? translations().filterAny"
|
|
1049
|
+
[ngModel]="rule.value ?? []"
|
|
1050
|
+
(ngModelChange)="setValue(index, $event, live)"
|
|
1051
|
+
/>
|
|
1052
|
+
}
|
|
1053
|
+
@default {
|
|
1054
|
+
<input
|
|
1055
|
+
txInput
|
|
1056
|
+
type="text"
|
|
1057
|
+
size="small"
|
|
1058
|
+
class="tx-table-filter__value"
|
|
1059
|
+
[attr.aria-label]="valueLabel()"
|
|
1060
|
+
[placeholder]="column().filterPlaceholder ?? ''"
|
|
1061
|
+
[value]="rule.value ?? ''"
|
|
1062
|
+
(input)="setValue(index, $any($event.target).value, live)"
|
|
1063
|
+
(keydown.enter)="apply()"
|
|
1064
|
+
/>
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
</ng-template>
|
|
1068
|
+
|
|
1069
|
+
@if (display() === 'row') {
|
|
1070
|
+
<div class="tx-table-filter__row">
|
|
1071
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: live().rules[0], index: 0, live: true }" />
|
|
1072
|
+
@if (modes().length > 1) {
|
|
1073
|
+
<button
|
|
1074
|
+
txButton
|
|
1075
|
+
type="button"
|
|
1076
|
+
text
|
|
1077
|
+
rounded
|
|
1078
|
+
size="small"
|
|
1079
|
+
severity="secondary"
|
|
1080
|
+
class="tx-table-filter__button"
|
|
1081
|
+
[class.tx-table-filter__button--active]="active()"
|
|
1082
|
+
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
1083
|
+
[attr.aria-label]="buttonLabel()"
|
|
1084
|
+
[txMenuTrigger]="modeMenu"
|
|
1085
|
+
></button>
|
|
1086
|
+
<tx-menu #modeMenu popup [model]="modeItems()" [ariaLabel]="translations().filterMatchMode" />
|
|
1087
|
+
}
|
|
1088
|
+
</div>
|
|
1089
|
+
} @else {
|
|
1090
|
+
<button
|
|
1091
|
+
txButton
|
|
1092
|
+
type="button"
|
|
1093
|
+
text
|
|
1094
|
+
rounded
|
|
1095
|
+
size="small"
|
|
1096
|
+
severity="secondary"
|
|
1097
|
+
class="tx-table-filter__button"
|
|
1098
|
+
[class.tx-table-filter__button--active]="active()"
|
|
1099
|
+
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
1100
|
+
[attr.aria-label]="buttonLabel()"
|
|
1101
|
+
[txPopoverTrigger]="panel"
|
|
1102
|
+
(click)="$event.stopPropagation()"
|
|
1103
|
+
></button>
|
|
1104
|
+
<tx-popover #panel placement="bottom-start" [ariaLabel]="buttonLabel()" (opened)="startDraft()">
|
|
1105
|
+
<div class="tx-table-filter">
|
|
1106
|
+
@if (type() === 'boolean' || type() === 'options') {
|
|
1107
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: draft().rules[0], index: 0, live: false }" />
|
|
758
1108
|
} @else {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
1109
|
+
@if (draft().rules.length > 1) {
|
|
1110
|
+
<tx-select
|
|
1111
|
+
size="small"
|
|
1112
|
+
optionLabel="label"
|
|
1113
|
+
optionValue="value"
|
|
1114
|
+
[options]="operatorOptions()"
|
|
1115
|
+
[ariaLabel]="translations().filterMatchAll + ' / ' + translations().filterMatchAny"
|
|
1116
|
+
[ngModel]="draft().operator"
|
|
1117
|
+
(ngModelChange)="setOperator($event)"
|
|
1118
|
+
/>
|
|
1119
|
+
}
|
|
1120
|
+
@for (rule of draft().rules; track $index; let index = $index) {
|
|
1121
|
+
<div class="tx-table-filter__rule">
|
|
1122
|
+
@if (modes().length > 1) {
|
|
1123
|
+
<tx-select
|
|
1124
|
+
size="small"
|
|
1125
|
+
optionLabel="label"
|
|
1126
|
+
optionValue="value"
|
|
1127
|
+
[options]="modeOptions()"
|
|
1128
|
+
[ariaLabel]="translations().filterMatchMode"
|
|
1129
|
+
[ngModel]="rule.matchMode"
|
|
1130
|
+
(ngModelChange)="setMode(index, $event)"
|
|
772
1131
|
/>
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
1132
|
+
}
|
|
1133
|
+
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: rule, index, live: false }" />
|
|
1134
|
+
@if (draft().rules.length > 1) {
|
|
1135
|
+
<button
|
|
1136
|
+
txButton
|
|
1137
|
+
type="button"
|
|
1138
|
+
text
|
|
1139
|
+
size="small"
|
|
1140
|
+
severity="danger"
|
|
1141
|
+
icon="trash"
|
|
1142
|
+
[label]="translations().filterRemoveRule"
|
|
1143
|
+
(click)="removeRule(index)"
|
|
1144
|
+
></button>
|
|
1145
|
+
}
|
|
1146
|
+
</div>
|
|
1147
|
+
}
|
|
1148
|
+
@if (draft().rules.length < maxRules) {
|
|
1149
|
+
<button txButton type="button" text size="small" icon="plus" [label]="translations().filterAddRule" (click)="addRule()"></button>
|
|
1150
|
+
}
|
|
776
1151
|
}
|
|
1152
|
+
<div class="tx-table-filter__footer">
|
|
1153
|
+
<button txButton type="button" outlined size="small" severity="secondary" [label]="translations().clear" (click)="clear()"></button>
|
|
1154
|
+
<button txButton type="button" size="small" [label]="translations().filterApply" (click)="apply()"></button>
|
|
1155
|
+
</div>
|
|
777
1156
|
</div>
|
|
778
|
-
</
|
|
779
|
-
|
|
1157
|
+
</tx-popover>
|
|
1158
|
+
}
|
|
780
1159
|
`,
|
|
781
1160
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
782
|
-
host: {
|
|
783
|
-
|
|
1161
|
+
host: {
|
|
1162
|
+
class: "tx-table-column-filter",
|
|
1163
|
+
"[class.tx-table-column-filter--row]": "display() === 'row'"
|
|
1164
|
+
},
|
|
1165
|
+
styles: [":host{display:inline-flex;min-width:0}:host(.tx-table-column-filter--row){display:flex;width:100%}.tx-table-filter__row{display:flex;flex:1;align-items:center;gap:var(--tx-table-filter-gap, 7px);min-width:0}.tx-table-filter__row .tx-table-filter__value{flex:1;min-width:0;width:100%}.tx-table-filter{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);min-width:var(--tx-table-filter-min-width, 175px)}.tx-table-filter__rule{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);padding-bottom:var(--tx-table-filter-gap, 7px);border-bottom:1px solid var(--tx-surface-border)}.tx-table-filter__rule:last-of-type{padding-bottom:0;border-bottom:0}.tx-table-filter__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--tx-table-filter-gap, 7px)}.tx-table-filter__value{width:100%}.tx-table-filter__button--active{color:var(--tx-primary-base)}\n"]
|
|
784
1166
|
}]
|
|
785
1167
|
}],
|
|
1168
|
+
ctorParameters: () => [],
|
|
786
1169
|
propDecorators: {
|
|
787
|
-
|
|
788
|
-
type: i0.
|
|
789
|
-
args: [{
|
|
790
|
-
isSignal: true,
|
|
791
|
-
alias: "columns",
|
|
792
|
-
required: false
|
|
793
|
-
}]
|
|
794
|
-
}],
|
|
795
|
-
hidden: [{
|
|
796
|
-
type: i0.Input,
|
|
797
|
-
args: [{
|
|
798
|
-
isSignal: true,
|
|
799
|
-
alias: "hidden",
|
|
800
|
-
required: false
|
|
801
|
-
}]
|
|
802
|
-
}],
|
|
803
|
-
showColumns: [{
|
|
804
|
-
type: i0.Input,
|
|
805
|
-
args: [{
|
|
806
|
-
isSignal: true,
|
|
807
|
-
alias: "showColumns",
|
|
808
|
-
required: false
|
|
809
|
-
}]
|
|
1170
|
+
panel: [{
|
|
1171
|
+
type: i0.ViewChild,
|
|
1172
|
+
args: ["panel", { isSignal: true }]
|
|
810
1173
|
}],
|
|
811
|
-
|
|
1174
|
+
column: [{
|
|
812
1175
|
type: i0.Input,
|
|
813
1176
|
args: [{
|
|
814
1177
|
isSignal: true,
|
|
815
|
-
alias: "
|
|
816
|
-
required:
|
|
1178
|
+
alias: "column",
|
|
1179
|
+
required: true
|
|
817
1180
|
}]
|
|
818
1181
|
}],
|
|
819
|
-
|
|
1182
|
+
display: [{
|
|
820
1183
|
type: i0.Input,
|
|
821
1184
|
args: [{
|
|
822
1185
|
isSignal: true,
|
|
823
|
-
alias: "
|
|
1186
|
+
alias: "display",
|
|
824
1187
|
required: false
|
|
825
1188
|
}]
|
|
826
|
-
}],
|
|
827
|
-
columnToggled: [{
|
|
828
|
-
type: i0.Output,
|
|
829
|
-
args: ["columnToggled"]
|
|
830
|
-
}]
|
|
831
|
-
}
|
|
832
|
-
});
|
|
833
|
-
const TX_FILTER_MATCH_MODES = {
|
|
834
|
-
text: [
|
|
835
|
-
"startsWith",
|
|
836
|
-
"contains",
|
|
837
|
-
"notContains",
|
|
838
|
-
"endsWith",
|
|
839
|
-
"equals",
|
|
840
|
-
"notEquals"
|
|
841
|
-
],
|
|
842
|
-
numeric: [
|
|
843
|
-
"equals",
|
|
844
|
-
"notEquals",
|
|
845
|
-
"lt",
|
|
846
|
-
"lte",
|
|
847
|
-
"gt",
|
|
848
|
-
"gte"
|
|
849
|
-
],
|
|
850
|
-
date: [
|
|
851
|
-
"dateIs",
|
|
852
|
-
"dateIsNot",
|
|
853
|
-
"dateBefore",
|
|
854
|
-
"dateAfter"
|
|
855
|
-
],
|
|
856
|
-
boolean: ["equals"]
|
|
857
|
-
};
|
|
858
|
-
function defaultMatchMode(column) {
|
|
859
|
-
if (column.filterOptions?.length) return "in";
|
|
860
|
-
return (column.filterMatchModes ?? TX_FILTER_MATCH_MODES[column.filterType ?? "text"])[0];
|
|
861
|
-
}
|
|
862
|
-
function isFilled(value) {
|
|
863
|
-
if (value === null || value === void 0) return false;
|
|
864
|
-
if (typeof value === "string") return value.trim() !== "";
|
|
865
|
-
if (Array.isArray(value)) return value.length > 0;
|
|
866
|
-
return true;
|
|
867
|
-
}
|
|
868
|
-
function isFilterActive(filter) {
|
|
869
|
-
return !!filter?.rules.some((rule) => isFilled(rule.value));
|
|
870
|
-
}
|
|
871
|
-
function normalize(value, locale) {
|
|
872
|
-
return String(value).normalize("NFD").replace(/\p{Diacritic}/gu, "").toLocaleLowerCase(locale);
|
|
873
|
-
}
|
|
874
|
-
function toTime(value) {
|
|
875
|
-
if (value === null || value === void 0 || value === "") return null;
|
|
876
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
877
|
-
return Number.isNaN(date.getTime()) ? null : date.getTime();
|
|
878
|
-
}
|
|
879
|
-
function dayOf(value) {
|
|
880
|
-
const time = toTime(value);
|
|
881
|
-
return time === null ? null : new Date(time).toDateString();
|
|
882
|
-
}
|
|
883
|
-
function compare(value, filter) {
|
|
884
|
-
if (value === null || value === void 0) return null;
|
|
885
|
-
if (typeof value === "number" || typeof filter === "number") {
|
|
886
|
-
const left = Number(value);
|
|
887
|
-
const right = Number(filter);
|
|
888
|
-
return Number.isNaN(left) || Number.isNaN(right) ? null : left - right;
|
|
889
|
-
}
|
|
890
|
-
const left = toTime(value);
|
|
891
|
-
const right = toTime(filter);
|
|
892
|
-
if (value instanceof Date && left !== null && right !== null) return left - right;
|
|
893
|
-
return String(value).localeCompare(String(filter), void 0, {
|
|
894
|
-
numeric: true,
|
|
895
|
-
sensitivity: "base"
|
|
896
|
-
});
|
|
897
|
-
}
|
|
898
|
-
function matchesRule(value, rule, locale) {
|
|
899
|
-
const filter = rule.value;
|
|
900
|
-
if (!isFilled(filter)) return true;
|
|
901
|
-
const text = value === null || value === void 0 ? "" : normalize(value, locale);
|
|
902
|
-
const needle = typeof filter === "string" || typeof filter === "number" ? normalize(filter, locale) : "";
|
|
903
|
-
switch (rule.matchMode) {
|
|
904
|
-
case "startsWith": return text.startsWith(needle);
|
|
905
|
-
case "contains": return text.includes(needle);
|
|
906
|
-
case "notContains": return !text.includes(needle);
|
|
907
|
-
case "endsWith": return text.endsWith(needle);
|
|
908
|
-
case "equals":
|
|
909
|
-
if (typeof filter === "boolean") return value === filter;
|
|
910
|
-
if (typeof filter === "number") return Number(value) === filter;
|
|
911
|
-
if (filter instanceof Date) return toTime(value) === toTime(filter);
|
|
912
|
-
return text === needle;
|
|
913
|
-
case "notEquals":
|
|
914
|
-
if (typeof filter === "boolean") return value !== filter;
|
|
915
|
-
if (typeof filter === "number") return Number(value) !== filter;
|
|
916
|
-
if (filter instanceof Date) return toTime(value) !== toTime(filter);
|
|
917
|
-
return text !== needle;
|
|
918
|
-
case "in": return Array.isArray(filter) && filter.some((item) => item === value || item !== null && value !== null && normalize(item, locale) === text);
|
|
919
|
-
case "lt":
|
|
920
|
-
case "lte":
|
|
921
|
-
case "gt":
|
|
922
|
-
case "gte": {
|
|
923
|
-
const result = compare(value, filter);
|
|
924
|
-
if (result === null) return false;
|
|
925
|
-
return rule.matchMode === "lt" ? result < 0 : rule.matchMode === "lte" ? result <= 0 : rule.matchMode === "gt" ? result > 0 : result >= 0;
|
|
926
|
-
}
|
|
927
|
-
case "between": {
|
|
928
|
-
const [from, to] = Array.isArray(filter) ? filter : [];
|
|
929
|
-
const fromResult = isFilled(from) ? compare(value, from) : 0;
|
|
930
|
-
const toResult = isFilled(to) ? compare(value, to) : 0;
|
|
931
|
-
return fromResult !== null && toResult !== null && fromResult >= 0 && toResult <= 0;
|
|
932
|
-
}
|
|
933
|
-
case "dateIs": return dayOf(value) !== null && dayOf(value) === dayOf(filter);
|
|
934
|
-
case "dateIsNot": return dayOf(value) !== dayOf(filter);
|
|
935
|
-
case "dateBefore": {
|
|
936
|
-
const left = toTime(value);
|
|
937
|
-
const right = toTime(filter);
|
|
938
|
-
return left !== null && right !== null && left < right;
|
|
939
|
-
}
|
|
940
|
-
case "dateAfter": {
|
|
941
|
-
const left = toTime(value);
|
|
942
|
-
const right = toTime(filter);
|
|
943
|
-
return left !== null && right !== null && left > right;
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
function matchesFilter(value, filter, locale) {
|
|
948
|
-
const rules = filter.rules.filter((rule) => isFilled(rule.value));
|
|
949
|
-
if (!rules.length) return true;
|
|
950
|
-
return filter.operator === "or" ? rules.some((rule) => matchesRule(value, rule, locale)) : rules.every((rule) => matchesRule(value, rule, locale));
|
|
951
|
-
}
|
|
952
|
-
function filterRows(rows, filters, columns, globalFilter, globalFields, locale) {
|
|
953
|
-
const active = Object.entries(filters).filter(([, filter]) => isFilterActive(filter));
|
|
954
|
-
const query = globalFilter.trim() ? normalize(globalFilter.trim(), locale) : "";
|
|
955
|
-
if (!active.length && !query) return [...rows];
|
|
956
|
-
const fieldOf = (key) => columns.find((column) => column.field === key)?.filterField ?? key;
|
|
957
|
-
return rows.filter((row) => {
|
|
958
|
-
if (!active.every(([key, filter]) => matchesFilter(resolveField(row, fieldOf(key)), filter, locale))) return false;
|
|
959
|
-
if (!query) return true;
|
|
960
|
-
return globalFields.some((field) => {
|
|
961
|
-
const value = resolveField(row, field);
|
|
962
|
-
return value !== null && value !== void 0 && normalize(value, locale).includes(query);
|
|
963
|
-
});
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
const MAX_RULES = 2;
|
|
967
|
-
function toDateInput(value) {
|
|
968
|
-
if (!(value instanceof Date) || Number.isNaN(value.getTime())) return "";
|
|
969
|
-
const pad = (part) => String(part).padStart(2, "0");
|
|
970
|
-
return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}`;
|
|
971
|
-
}
|
|
972
|
-
function fromDateInput(value) {
|
|
973
|
-
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
|
|
974
|
-
return match ? new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3])) : null;
|
|
975
|
-
}
|
|
976
|
-
var TxTableColumnFilter = class TxTableColumnFilter {
|
|
977
|
-
table = inject(TX_TABLE);
|
|
978
|
-
panel = viewChild("panel", ...ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []);
|
|
979
|
-
timer;
|
|
980
|
-
column = input.required(...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
|
|
981
|
-
display = input("menu", ...ngDevMode ? [{ debugName: "display" }] : /* istanbul ignore next */ []);
|
|
982
|
-
maxRules = MAX_RULES;
|
|
983
|
-
translations = injectTranslations();
|
|
984
|
-
type = computed(() => this.column().filterOptions?.length ? "options" : this.column().filterType ?? "text", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
985
|
-
modes = computed(() => this.type() === "options" || this.type() === "boolean" ? [] : this.column().filterMatchModes ?? TX_FILTER_MATCH_MODES[this.column().filterType ?? "text"], ...ngDevMode ? [{ debugName: "modes" }] : /* istanbul ignore next */ []);
|
|
986
|
-
current = computed(() => this.table.filters()[this.column().field], ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
987
|
-
active = computed(() => isFilterActive(this.current()), ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
988
|
-
draft = signal({
|
|
989
|
-
operator: "and",
|
|
990
|
-
rules: [{
|
|
991
|
-
value: null,
|
|
992
|
-
matchMode: "startsWith"
|
|
993
1189
|
}]
|
|
994
|
-
}, ...ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []);
|
|
995
|
-
live = computed(() => this.current() ?? this.empty(), ...ngDevMode ? [{ debugName: "live" }] : /* istanbul ignore next */ []);
|
|
996
|
-
modeOptions = computed(() => this.modes().map((mode) => ({
|
|
997
|
-
value: mode,
|
|
998
|
-
label: this.translations()[mode]
|
|
999
|
-
})), ...ngDevMode ? [{ debugName: "modeOptions" }] : /* istanbul ignore next */ []);
|
|
1000
|
-
operatorOptions = computed(() => [{
|
|
1001
|
-
value: "and",
|
|
1002
|
-
label: this.translations().filterMatchAll
|
|
1003
|
-
}, {
|
|
1004
|
-
value: "or",
|
|
1005
|
-
label: this.translations().filterMatchAny
|
|
1006
|
-
}], ...ngDevMode ? [{ debugName: "operatorOptions" }] : /* istanbul ignore next */ []);
|
|
1007
|
-
booleanOptions = computed(() => [
|
|
1008
|
-
{
|
|
1009
|
-
value: null,
|
|
1010
|
-
label: this.translations().filterAny
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
value: true,
|
|
1014
|
-
label: this.translations().yes
|
|
1015
|
-
},
|
|
1016
|
-
{
|
|
1017
|
-
value: false,
|
|
1018
|
-
label: this.translations().no
|
|
1019
|
-
}
|
|
1020
|
-
], ...ngDevMode ? [{ debugName: "booleanOptions" }] : /* istanbul ignore next */ []);
|
|
1021
|
-
modeItems = computed(() => {
|
|
1022
|
-
const selected = this.live().rules[0]?.matchMode;
|
|
1023
|
-
return this.modeOptions().map((option) => ({
|
|
1024
|
-
id: option.value,
|
|
1025
|
-
label: option.label,
|
|
1026
|
-
icon: option.value === selected ? "check" : void 0,
|
|
1027
|
-
command: () => this.setLiveMode(option.value)
|
|
1028
|
-
}));
|
|
1029
|
-
}, ...ngDevMode ? [{ debugName: "modeItems" }] : /* istanbul ignore next */ []);
|
|
1030
|
-
buttonLabel = computed(() => this.translations().filterColumn.replace("{column}", columnLabel(this.column())), ...ngDevMode ? [{ debugName: "buttonLabel" }] : /* istanbul ignore next */ []);
|
|
1031
|
-
valueLabel = computed(() => `${columnLabel(this.column())}: ${this.translations().filterValue}`, ...ngDevMode ? [{ debugName: "valueLabel" }] : /* istanbul ignore next */ []);
|
|
1032
|
-
constructor() {
|
|
1033
|
-
inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));
|
|
1034
|
-
}
|
|
1035
|
-
empty() {
|
|
1036
|
-
return {
|
|
1037
|
-
operator: "and",
|
|
1038
|
-
rules: [{
|
|
1039
|
-
value: null,
|
|
1040
|
-
matchMode: defaultMatchMode(this.column())
|
|
1041
|
-
}]
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
startDraft() {
|
|
1045
|
-
const current = this.current();
|
|
1046
|
-
this.draft.set(current ? {
|
|
1047
|
-
operator: current.operator,
|
|
1048
|
-
rules: current.rules.map((rule) => ({ ...rule }))
|
|
1049
|
-
} : this.empty());
|
|
1050
|
-
}
|
|
1051
|
-
dateValue(value) {
|
|
1052
|
-
return toDateInput(value);
|
|
1053
|
-
}
|
|
1054
|
-
parseDate(value) {
|
|
1055
|
-
return fromDateInput(value);
|
|
1056
|
-
}
|
|
1057
|
-
setValue(index, value, live) {
|
|
1058
|
-
if (live) {
|
|
1059
|
-
const filter = this.live();
|
|
1060
|
-
const rules = filter.rules.map((rule, position) => position === index ? {
|
|
1061
|
-
...rule,
|
|
1062
|
-
value
|
|
1063
|
-
} : rule);
|
|
1064
|
-
clearTimeout(this.timer);
|
|
1065
|
-
const commit = () => this.table.applyFilter(this.column().field, {
|
|
1066
|
-
...filter,
|
|
1067
|
-
rules
|
|
1068
|
-
});
|
|
1069
|
-
if (this.type() === "text") this.timer = setTimeout(commit, this.table.filterDelay());
|
|
1070
|
-
else commit();
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
this.updateRules((rules) => rules.map((rule, position) => position === index ? {
|
|
1074
|
-
...rule,
|
|
1075
|
-
value
|
|
1076
|
-
} : rule));
|
|
1077
|
-
}
|
|
1078
|
-
setMode(index, matchMode) {
|
|
1079
|
-
this.updateRules((rules) => rules.map((rule, position) => position === index ? {
|
|
1080
|
-
...rule,
|
|
1081
|
-
matchMode
|
|
1082
|
-
} : rule));
|
|
1083
|
-
}
|
|
1084
|
-
setLiveMode(matchMode) {
|
|
1085
|
-
const filter = this.live();
|
|
1086
|
-
this.table.applyFilter(this.column().field, {
|
|
1087
|
-
...filter,
|
|
1088
|
-
rules: filter.rules.map((rule, index) => index === 0 ? {
|
|
1089
|
-
...rule,
|
|
1090
|
-
matchMode
|
|
1091
|
-
} : rule)
|
|
1092
|
-
});
|
|
1093
1190
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1191
|
+
});
|
|
1192
|
+
var TxTableSettings = class TxTableSettings {
|
|
1193
|
+
table = inject(TX_TABLE);
|
|
1194
|
+
document = inject(DOCUMENT);
|
|
1195
|
+
columns = input([], ...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
1196
|
+
hidden = input(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []);
|
|
1197
|
+
showColumns = input(true, {
|
|
1198
|
+
...ngDevMode ? { debugName: "showColumns" } : /* istanbul ignore next */ {},
|
|
1199
|
+
transform: booleanAttribute
|
|
1200
|
+
});
|
|
1201
|
+
showActions = input(false, {
|
|
1202
|
+
...ngDevMode ? { debugName: "showActions" } : /* istanbul ignore next */ {},
|
|
1203
|
+
transform: booleanAttribute
|
|
1204
|
+
});
|
|
1205
|
+
unstyled = input(false, ...ngDevMode ? [{ debugName: "unstyled" }] : /* istanbul ignore next */ []);
|
|
1206
|
+
columnToggled = output();
|
|
1207
|
+
id = uniqueId("tx-table-settings");
|
|
1208
|
+
translations = injectTranslations();
|
|
1209
|
+
store = this.table.actionsStore;
|
|
1210
|
+
activeTab = signal("columns", ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
|
|
1211
|
+
canReorder = this.table.reorderableColumns;
|
|
1212
|
+
listedColumns = computed(() => this.columns().filter((column) => column.hideable !== false || this.canReorder() && column.reorderable !== false), ...ngDevMode ? [{ debugName: "listedColumns" }] : /* istanbul ignore next */ []);
|
|
1213
|
+
tabs = computed(() => {
|
|
1214
|
+
const tabs = [];
|
|
1215
|
+
if (this.showColumns()) tabs.push("columns");
|
|
1216
|
+
if (this.showActions() && this.store.registeredActions().length) tabs.push("actions");
|
|
1217
|
+
return tabs;
|
|
1218
|
+
}, ...ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []);
|
|
1219
|
+
currentTab = computed(() => this.tabs().includes(this.activeTab()) ? this.activeTab() : this.tabs()[0] ?? "columns", ...ngDevMode ? [{ debugName: "currentTab" }] : /* istanbul ignore next */ []);
|
|
1220
|
+
label(column) {
|
|
1221
|
+
return columnLabel(column);
|
|
1099
1222
|
}
|
|
1100
|
-
|
|
1101
|
-
this.
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1223
|
+
moveTab(step) {
|
|
1224
|
+
const tabs = this.tabs();
|
|
1225
|
+
const next = tabs[(tabs.indexOf(this.currentTab()) + step + tabs.length) % tabs.length];
|
|
1226
|
+
this.activeTab.set(next);
|
|
1227
|
+
this.document.getElementById(`${this.id}-${next}`)?.focus();
|
|
1105
1228
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1229
|
+
dropColumn(event) {
|
|
1230
|
+
const columns = this.listedColumns();
|
|
1231
|
+
const from = columns[event.previousIndex];
|
|
1232
|
+
const to = columns[event.currentIndex];
|
|
1233
|
+
if (from && to && to.reorderable !== false) this.table.reorderColumn(from.field, to.field);
|
|
1108
1234
|
}
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1235
|
+
moveColumn(column, step, event) {
|
|
1236
|
+
if (!this.canReorder() || column.reorderable === false) return;
|
|
1237
|
+
event.preventDefault();
|
|
1238
|
+
const columns = this.listedColumns();
|
|
1239
|
+
const target = columns[columns.indexOf(column) + step];
|
|
1240
|
+
if (!target || target.reorderable === false) return;
|
|
1241
|
+
this.table.reorderColumn(column.field, target.field);
|
|
1242
|
+
const field = column.field;
|
|
1243
|
+
setTimeout(() => {
|
|
1244
|
+
const index = this.listedColumns().findIndex((item) => item.field === field);
|
|
1245
|
+
this.document.querySelectorAll(`#${this.id}-panel .tx-table-settings__action input`)[index]?.focus();
|
|
1246
|
+
});
|
|
1112
1247
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
this.
|
|
1116
|
-
|
|
1248
|
+
moveAction(index, step, event) {
|
|
1249
|
+
const target = index + step;
|
|
1250
|
+
if (target < 0 || target >= this.store.registeredActions().length) return;
|
|
1251
|
+
event.preventDefault();
|
|
1252
|
+
this.store.reorder(index, target);
|
|
1253
|
+
setTimeout(() => this.document.querySelectorAll(`#${this.id}-panel .tx-table-settings__action input`)[target]?.focus());
|
|
1117
1254
|
}
|
|
1118
|
-
|
|
1119
|
-
this.
|
|
1120
|
-
...this.draft(),
|
|
1121
|
-
rules: change(this.draft().rules)
|
|
1122
|
-
});
|
|
1255
|
+
dropAction(event) {
|
|
1256
|
+
this.store.reorder(event.previousIndex, event.currentIndex);
|
|
1123
1257
|
}
|
|
1124
1258
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1125
1259
|
minVersion: "12.0.0",
|
|
1126
1260
|
version: "22.2.3",
|
|
1127
1261
|
ngImport: i0,
|
|
1128
|
-
type:
|
|
1262
|
+
type: TxTableSettings,
|
|
1129
1263
|
deps: [],
|
|
1130
1264
|
target: i0.ɵɵFactoryTarget.Component
|
|
1131
1265
|
});
|
|
1132
1266
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1133
1267
|
minVersion: "17.0.0",
|
|
1134
1268
|
version: "22.2.3",
|
|
1135
|
-
type:
|
|
1269
|
+
type: TxTableSettings,
|
|
1136
1270
|
isStandalone: true,
|
|
1137
|
-
selector: "tx-table-
|
|
1271
|
+
selector: "tx-table-settings",
|
|
1138
1272
|
inputs: {
|
|
1139
|
-
|
|
1140
|
-
classPropertyName: "
|
|
1141
|
-
publicName: "
|
|
1273
|
+
columns: {
|
|
1274
|
+
classPropertyName: "columns",
|
|
1275
|
+
publicName: "columns",
|
|
1142
1276
|
isSignal: true,
|
|
1143
|
-
isRequired:
|
|
1277
|
+
isRequired: false,
|
|
1144
1278
|
transformFunction: null
|
|
1145
1279
|
},
|
|
1146
|
-
|
|
1147
|
-
classPropertyName: "
|
|
1148
|
-
publicName: "
|
|
1280
|
+
hidden: {
|
|
1281
|
+
classPropertyName: "hidden",
|
|
1282
|
+
publicName: "hidden",
|
|
1283
|
+
isSignal: true,
|
|
1284
|
+
isRequired: false,
|
|
1285
|
+
transformFunction: null
|
|
1286
|
+
},
|
|
1287
|
+
showColumns: {
|
|
1288
|
+
classPropertyName: "showColumns",
|
|
1289
|
+
publicName: "showColumns",
|
|
1290
|
+
isSignal: true,
|
|
1291
|
+
isRequired: false,
|
|
1292
|
+
transformFunction: null
|
|
1293
|
+
},
|
|
1294
|
+
showActions: {
|
|
1295
|
+
classPropertyName: "showActions",
|
|
1296
|
+
publicName: "showActions",
|
|
1297
|
+
isSignal: true,
|
|
1298
|
+
isRequired: false,
|
|
1299
|
+
transformFunction: null
|
|
1300
|
+
},
|
|
1301
|
+
unstyled: {
|
|
1302
|
+
classPropertyName: "unstyled",
|
|
1303
|
+
publicName: "unstyled",
|
|
1149
1304
|
isSignal: true,
|
|
1150
1305
|
isRequired: false,
|
|
1151
1306
|
transformFunction: null
|
|
1152
1307
|
}
|
|
1153
1308
|
},
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
classAttribute: "tx-table-column-filter"
|
|
1157
|
-
},
|
|
1158
|
-
viewQueries: [{
|
|
1159
|
-
propertyName: "panel",
|
|
1160
|
-
first: true,
|
|
1161
|
-
predicate: ["panel"],
|
|
1162
|
-
descendants: true,
|
|
1163
|
-
isSignal: true
|
|
1164
|
-
}],
|
|
1309
|
+
outputs: { columnToggled: "columnToggled" },
|
|
1310
|
+
host: { classAttribute: "tx-table-settings" },
|
|
1165
1311
|
ngImport: i0,
|
|
1166
1312
|
template: `
|
|
1167
|
-
<
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
optionLabel="label"
|
|
1207
|
-
optionValue="value"
|
|
1208
|
-
[maxSelectedLabels]="2"
|
|
1209
|
-
[options]="column().filterOptions ?? []"
|
|
1210
|
-
[ariaLabel]="valueLabel()"
|
|
1211
|
-
[placeholder]="column().filterPlaceholder ?? translations().filterAny"
|
|
1212
|
-
[ngModel]="rule.value ?? []"
|
|
1213
|
-
(ngModelChange)="setValue(index, $event, live)"
|
|
1214
|
-
/>
|
|
1215
|
-
}
|
|
1216
|
-
@default {
|
|
1217
|
-
<input
|
|
1218
|
-
txInput
|
|
1219
|
-
type="text"
|
|
1220
|
-
size="small"
|
|
1221
|
-
class="tx-table-filter__value"
|
|
1222
|
-
[attr.aria-label]="valueLabel()"
|
|
1223
|
-
[placeholder]="column().filterPlaceholder ?? ''"
|
|
1224
|
-
[value]="rule.value ?? ''"
|
|
1225
|
-
(input)="setValue(index, $any($event.target).value, live)"
|
|
1226
|
-
(keydown.enter)="apply()"
|
|
1227
|
-
/>
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
</ng-template>
|
|
1231
|
-
|
|
1232
|
-
@if (display() === 'row') {
|
|
1233
|
-
<div class="tx-table-filter__row">
|
|
1234
|
-
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: live().rules[0], index: 0, live: true }" />
|
|
1235
|
-
@if (modes().length > 1) {
|
|
1236
|
-
<button
|
|
1237
|
-
txButton
|
|
1238
|
-
type="button"
|
|
1239
|
-
text
|
|
1240
|
-
rounded
|
|
1241
|
-
size="small"
|
|
1242
|
-
severity="secondary"
|
|
1243
|
-
class="tx-table-filter__button"
|
|
1244
|
-
[class.tx-table-filter__button--active]="active()"
|
|
1245
|
-
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
1246
|
-
[attr.aria-label]="buttonLabel()"
|
|
1247
|
-
[txMenuTrigger]="modeMenu"
|
|
1248
|
-
></button>
|
|
1249
|
-
<tx-menu #modeMenu popup [model]="modeItems()" [ariaLabel]="translations().filterMatchMode" />
|
|
1313
|
+
<button
|
|
1314
|
+
txButton
|
|
1315
|
+
type="button"
|
|
1316
|
+
size="small"
|
|
1317
|
+
icon="cog"
|
|
1318
|
+
class="tx-table-settings__button"
|
|
1319
|
+
[unstyled]="unstyled()"
|
|
1320
|
+
[txTooltip]="translations().tableSettings"
|
|
1321
|
+
[attr.aria-label]="translations().tableSettings"
|
|
1322
|
+
[txPopoverTrigger]="panel"
|
|
1323
|
+
></button>
|
|
1324
|
+
<tx-popover #panel placement="bottom-end" [ariaLabel]="translations().tableSettings" [unstyled]="unstyled()">
|
|
1325
|
+
<div class="tx-table-settings__panel">
|
|
1326
|
+
@if (tabs().length > 1) {
|
|
1327
|
+
<div class="tx-table-settings__tabs" role="tablist">
|
|
1328
|
+
@for (tab of tabs(); track tab) {
|
|
1329
|
+
<button
|
|
1330
|
+
type="button"
|
|
1331
|
+
role="tab"
|
|
1332
|
+
class="tx-table-settings__tab"
|
|
1333
|
+
[id]="id + '-' + tab"
|
|
1334
|
+
[attr.aria-selected]="tab === currentTab()"
|
|
1335
|
+
[attr.aria-controls]="id + '-panel'"
|
|
1336
|
+
[attr.tabindex]="tab === currentTab() ? 0 : -1"
|
|
1337
|
+
[txTooltip]="tab === 'columns' ? translations().tableColumnsHint : translations().tableActionsHint"
|
|
1338
|
+
(click)="activeTab.set(tab)"
|
|
1339
|
+
(keydown.arrowright)="moveTab(1)"
|
|
1340
|
+
(keydown.arrowleft)="moveTab(-1)"
|
|
1341
|
+
>
|
|
1342
|
+
<tx-icon aria-hidden="true" [name]="tab === 'columns' ? 'table' : 'bolt'" />
|
|
1343
|
+
{{ tab === 'columns' ? translations().tableColumns : translations().tableActions }}
|
|
1344
|
+
</button>
|
|
1345
|
+
}
|
|
1346
|
+
</div>
|
|
1347
|
+
} @else {
|
|
1348
|
+
<div class="tx-table-settings__title" [id]="id + '-' + currentTab()">
|
|
1349
|
+
<tx-icon aria-hidden="true" [name]="currentTab() === 'columns' ? 'table' : 'bolt'" />
|
|
1350
|
+
<span>{{ currentTab() === 'columns' ? translations().tableColumns : translations().tableActions }}</span>
|
|
1351
|
+
</div>
|
|
1250
1352
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1353
|
+
<div
|
|
1354
|
+
class="tx-table-settings__list"
|
|
1355
|
+
[id]="id + '-panel'"
|
|
1356
|
+
[attr.role]="tabs().length > 1 ? 'tabpanel' : 'group'"
|
|
1357
|
+
[attr.aria-labelledby]="id + '-' + currentTab()"
|
|
1358
|
+
>
|
|
1359
|
+
@if (currentTab() === 'columns') {
|
|
1360
|
+
<div
|
|
1361
|
+
#columnList
|
|
1362
|
+
cdkDropList
|
|
1363
|
+
class="tx-table-settings__actions"
|
|
1364
|
+
[cdkDropListDisabled]="!canReorder()"
|
|
1365
|
+
(cdkDropListDropped)="dropColumn($event)"
|
|
1366
|
+
>
|
|
1367
|
+
@for (column of listedColumns(); track column.field) {
|
|
1368
|
+
<div
|
|
1369
|
+
cdkDrag
|
|
1370
|
+
cdkDragLockAxis="y"
|
|
1371
|
+
class="tx-table-settings__action"
|
|
1372
|
+
[cdkDragBoundary]="columnList"
|
|
1373
|
+
[class.tx-table-settings__action--static]="!canReorder() || column.reorderable === false"
|
|
1374
|
+
[cdkDragDisabled]="!canReorder() || column.reorderable === false"
|
|
1375
|
+
>
|
|
1376
|
+
@if (canReorder()) {
|
|
1377
|
+
<span
|
|
1378
|
+
cdkDragHandle
|
|
1379
|
+
class="tx-table-settings__handle"
|
|
1380
|
+
[class.tx-table-settings__handle--hidden]="column.reorderable === false"
|
|
1381
|
+
[attr.aria-hidden]="true"
|
|
1382
|
+
>
|
|
1383
|
+
<tx-icon name="bars" />
|
|
1384
|
+
</span>
|
|
1385
|
+
}
|
|
1386
|
+
<tx-checkbox
|
|
1387
|
+
binary
|
|
1388
|
+
[label]="label(column)"
|
|
1389
|
+
[disabled]="column.hideable === false"
|
|
1390
|
+
[ngModel]="!hidden().has(column.field)"
|
|
1391
|
+
(ngModelChange)="columnToggled.emit({ field: column.field, visible: $event })"
|
|
1392
|
+
(keydown.alt.arrowup)="moveColumn(column, -1, $event)"
|
|
1393
|
+
(keydown.alt.arrowdown)="moveColumn(column, 1, $event)"
|
|
1394
|
+
/>
|
|
1395
|
+
</div>
|
|
1396
|
+
}
|
|
1397
|
+
</div>
|
|
1271
1398
|
} @else {
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
@if (modes().length > 1) {
|
|
1286
|
-
<tx-select
|
|
1287
|
-
size="small"
|
|
1288
|
-
optionLabel="label"
|
|
1289
|
-
optionValue="value"
|
|
1290
|
-
[options]="modeOptions()"
|
|
1291
|
-
[ariaLabel]="translations().filterMatchMode"
|
|
1292
|
-
[ngModel]="rule.matchMode"
|
|
1293
|
-
(ngModelChange)="setMode(index, $event)"
|
|
1399
|
+
<div #actionList cdkDropList class="tx-table-settings__actions" (cdkDropListDropped)="dropAction($event)">
|
|
1400
|
+
@for (action of store.registeredActions(); track action.id; let index = $index) {
|
|
1401
|
+
<div cdkDrag cdkDragLockAxis="y" class="tx-table-settings__action" [cdkDragBoundary]="actionList">
|
|
1402
|
+
<span cdkDragHandle class="tx-table-settings__handle" aria-hidden="true">
|
|
1403
|
+
<tx-icon aria-hidden="true" name="bars" />
|
|
1404
|
+
</span>
|
|
1405
|
+
<tx-checkbox
|
|
1406
|
+
binary
|
|
1407
|
+
[label]="action.label"
|
|
1408
|
+
[ngModel]="store.isPinned(action.id)"
|
|
1409
|
+
(ngModelChange)="store.setPinned(action.id, $event)"
|
|
1410
|
+
(keydown.alt.arrowup)="moveAction(index, -1, $event)"
|
|
1411
|
+
(keydown.alt.arrowdown)="moveAction(index, 1, $event)"
|
|
1294
1412
|
/>
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
<button
|
|
1299
|
-
txButton
|
|
1300
|
-
type="button"
|
|
1301
|
-
text
|
|
1302
|
-
size="small"
|
|
1303
|
-
severity="danger"
|
|
1304
|
-
icon="trash"
|
|
1305
|
-
[label]="translations().filterRemoveRule"
|
|
1306
|
-
(click)="removeRule(index)"
|
|
1307
|
-
></button>
|
|
1308
|
-
}
|
|
1309
|
-
</div>
|
|
1310
|
-
}
|
|
1311
|
-
@if (draft().rules.length < maxRules) {
|
|
1312
|
-
<button txButton type="button" text size="small" icon="plus" [label]="translations().filterAddRule" (click)="addRule()"></button>
|
|
1313
|
-
}
|
|
1413
|
+
</div>
|
|
1414
|
+
}
|
|
1415
|
+
</div>
|
|
1314
1416
|
}
|
|
1315
|
-
<div class="tx-table-filter__footer">
|
|
1316
|
-
<button txButton type="button" outlined size="small" severity="secondary" [label]="translations().clear" (click)="clear()"></button>
|
|
1317
|
-
<button txButton type="button" size="small" [label]="translations().filterApply" (click)="apply()"></button>
|
|
1318
|
-
</div>
|
|
1319
1417
|
</div>
|
|
1320
|
-
</
|
|
1321
|
-
|
|
1418
|
+
</div>
|
|
1419
|
+
</tx-popover>
|
|
1322
1420
|
`,
|
|
1323
1421
|
isInline: true,
|
|
1324
|
-
styles: [":host{display:inline-flex;
|
|
1422
|
+
styles: [":host{display:inline-flex}.tx-table-settings__panel{display:flex;flex-direction:column;box-sizing:border-box;width:var(--tx-table-settings-width);gap:var(--tx-table-settings-gap)}.tx-table-settings__tabs,.tx-table-settings__title{display:flex;align-items:center;gap:var(--tx-table-settings-title-gap)}.tx-table-settings__title{padding-bottom:var(--tx-table-settings-item-padding);border-bottom:1px solid var(--tx-surface-border);color:var(--tx-text-primary);font-weight:var(--tx-table-settings-title-font-weight)}.tx-table-settings__tabs{border-bottom:1px solid var(--tx-surface-border)}.tx-table-settings__tab{display:inline-flex;flex:1;align-items:center;justify-content:center;gap:var(--tx-table-settings-title-gap);margin:0 0 -1px;padding:var(--tx-table-settings-item-padding) 0 calc(var(--tx-table-settings-item-padding) * 2);border:0;border-bottom:2px solid transparent;background:none;color:var(--tx-text-muted);font:inherit;font-weight:var(--tx-table-settings-title-font-weight);cursor:pointer}.tx-table-settings__tab[aria-selected=true]{border-bottom-color:var(--tx-primary-base);color:var(--tx-primary-base)}.tx-table-settings__tab:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}.tx-table-settings__list{display:flex;flex-direction:column;gap:var(--tx-table-settings-gap);max-height:var(--tx-table-settings-max-height);overflow-y:auto}.tx-table-settings__actions{display:flex;flex-direction:column;gap:calc(var(--tx-table-settings-item-padding) / 2)}.tx-table-settings__action{display:flex;align-items:center;gap:var(--tx-table-settings-title-gap);padding:var(--tx-table-settings-item-padding);border-radius:var(--tx-table-settings-item-radius);background:var(--tx-surface-card)}.tx-table-settings__action:hover{background:var(--tx-table-settings-item-hover-background)}.tx-table-settings__action--static{background:transparent}.tx-table-settings__handle--hidden{visibility:hidden}.tx-table-settings__handle{display:inline-flex;color:var(--tx-table-settings-handle-color);font-size:var(--tx-table-settings-handle-size);cursor:move}.cdk-drag-preview.tx-table-settings__action{box-shadow:var(--tx-shadow-overlay)}.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform var(--tx-motion-duration) cubic-bezier(0,0,.2,1)}@media(prefers-reduced-motion:reduce){.cdk-drag-animating{transition:none}}\n"],
|
|
1325
1423
|
dependencies: [
|
|
1326
|
-
{
|
|
1327
|
-
kind: "directive",
|
|
1328
|
-
type: NgTemplateOutlet,
|
|
1329
|
-
selector: "[ngTemplateOutlet]",
|
|
1330
|
-
inputs: [
|
|
1331
|
-
"ngTemplateOutletContext",
|
|
1332
|
-
"ngTemplateOutlet",
|
|
1333
|
-
"ngTemplateOutletInjector"
|
|
1334
|
-
]
|
|
1335
|
-
},
|
|
1336
1424
|
{
|
|
1337
1425
|
kind: "ngmodule",
|
|
1338
1426
|
type: FormsModule
|
|
1339
1427
|
},
|
|
1340
1428
|
{
|
|
1341
1429
|
kind: "directive",
|
|
1342
|
-
type: i1.NgControlStatus,
|
|
1430
|
+
type: i1$1.NgControlStatus,
|
|
1343
1431
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
1344
1432
|
},
|
|
1345
1433
|
{
|
|
1346
1434
|
kind: "directive",
|
|
1347
|
-
type: i1.NgModel,
|
|
1435
|
+
type: i1$1.NgModel,
|
|
1348
1436
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
1349
1437
|
inputs: [
|
|
1350
1438
|
"name",
|
|
@@ -1355,6 +1443,73 @@ var TxTableColumnFilter = class TxTableColumnFilter {
|
|
|
1355
1443
|
outputs: ["ngModelChange"],
|
|
1356
1444
|
exportAs: ["ngModel"]
|
|
1357
1445
|
},
|
|
1446
|
+
{
|
|
1447
|
+
kind: "directive",
|
|
1448
|
+
type: CdkDropList,
|
|
1449
|
+
selector: "[cdkDropList], cdk-drop-list",
|
|
1450
|
+
inputs: [
|
|
1451
|
+
"cdkDropListConnectedTo",
|
|
1452
|
+
"cdkDropListData",
|
|
1453
|
+
"cdkDropListOrientation",
|
|
1454
|
+
"id",
|
|
1455
|
+
"cdkDropListLockAxis",
|
|
1456
|
+
"cdkDropListDisabled",
|
|
1457
|
+
"cdkDropListSortingDisabled",
|
|
1458
|
+
"cdkDropListEnterPredicate",
|
|
1459
|
+
"cdkDropListSortPredicate",
|
|
1460
|
+
"cdkDropListAutoScrollDisabled",
|
|
1461
|
+
"cdkDropListAutoScrollStep",
|
|
1462
|
+
"cdkDropListElementContainer",
|
|
1463
|
+
"cdkDropListHasAnchor"
|
|
1464
|
+
],
|
|
1465
|
+
outputs: [
|
|
1466
|
+
"cdkDropListDropped",
|
|
1467
|
+
"cdkDropListEntered",
|
|
1468
|
+
"cdkDropListExited",
|
|
1469
|
+
"cdkDropListSorted"
|
|
1470
|
+
],
|
|
1471
|
+
exportAs: ["cdkDropList"]
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
kind: "directive",
|
|
1475
|
+
type: CdkDrag,
|
|
1476
|
+
selector: "[cdkDrag]",
|
|
1477
|
+
inputs: [
|
|
1478
|
+
"cdkDragData",
|
|
1479
|
+
"cdkDragLockAxis",
|
|
1480
|
+
"cdkDragRootElement",
|
|
1481
|
+
"cdkDragBoundary",
|
|
1482
|
+
"cdkDragStartDelay",
|
|
1483
|
+
"cdkDragFreeDragPosition",
|
|
1484
|
+
"cdkDragDisabled",
|
|
1485
|
+
"cdkDragConstrainPosition",
|
|
1486
|
+
"cdkDragPreviewClass",
|
|
1487
|
+
"cdkDragPreviewContainer",
|
|
1488
|
+
"cdkDragScale"
|
|
1489
|
+
],
|
|
1490
|
+
outputs: [
|
|
1491
|
+
"cdkDragStarted",
|
|
1492
|
+
"cdkDragReleased",
|
|
1493
|
+
"cdkDragEnded",
|
|
1494
|
+
"cdkDragEntered",
|
|
1495
|
+
"cdkDragExited",
|
|
1496
|
+
"cdkDragDropped",
|
|
1497
|
+
"cdkDragMoved"
|
|
1498
|
+
],
|
|
1499
|
+
exportAs: ["cdkDrag"]
|
|
1500
|
+
},
|
|
1501
|
+
{
|
|
1502
|
+
kind: "directive",
|
|
1503
|
+
type: CdkDragHandle,
|
|
1504
|
+
selector: "[cdkDragHandle]",
|
|
1505
|
+
inputs: ["cdkDragHandleDisabled"]
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
kind: "component",
|
|
1509
|
+
type: TxIcon,
|
|
1510
|
+
selector: "tx-icon",
|
|
1511
|
+
inputs: ["name"]
|
|
1512
|
+
},
|
|
1358
1513
|
{
|
|
1359
1514
|
kind: "component",
|
|
1360
1515
|
type: TxButton,
|
|
@@ -1383,51 +1538,26 @@ var TxTableColumnFilter = class TxTableColumnFilter {
|
|
|
1383
1538
|
"dt",
|
|
1384
1539
|
"pt",
|
|
1385
1540
|
"ptOptions",
|
|
1386
|
-
"unstyled"
|
|
1387
|
-
]
|
|
1388
|
-
},
|
|
1389
|
-
{
|
|
1390
|
-
kind: "
|
|
1391
|
-
type:
|
|
1392
|
-
selector: "
|
|
1393
|
-
inputs: [
|
|
1394
|
-
"
|
|
1395
|
-
"
|
|
1396
|
-
"
|
|
1397
|
-
"
|
|
1398
|
-
"
|
|
1399
|
-
"
|
|
1400
|
-
"
|
|
1401
|
-
"
|
|
1402
|
-
|
|
1403
|
-
},
|
|
1404
|
-
{
|
|
1405
|
-
kind: "component",
|
|
1406
|
-
type: TxInputNumber,
|
|
1407
|
-
selector: "tx-input-number",
|
|
1408
|
-
inputs: [
|
|
1409
|
-
"mode",
|
|
1410
|
-
"currency",
|
|
1411
|
-
"currencyDisplay",
|
|
1412
|
-
"locale",
|
|
1413
|
-
"useGrouping",
|
|
1414
|
-
"minFractionDigits",
|
|
1415
|
-
"maxFractionDigits",
|
|
1416
|
-
"prefix",
|
|
1417
|
-
"suffix",
|
|
1418
|
-
"min",
|
|
1419
|
-
"max",
|
|
1420
|
-
"step",
|
|
1421
|
-
"showButtons",
|
|
1422
|
-
"buttonLayout",
|
|
1423
|
-
"incrementIcon",
|
|
1424
|
-
"decrementIcon",
|
|
1425
|
-
"allowEmpty",
|
|
1426
|
-
"showClear",
|
|
1427
|
-
"placeholder",
|
|
1541
|
+
"unstyled"
|
|
1542
|
+
]
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
kind: "component",
|
|
1546
|
+
type: TxCheckbox,
|
|
1547
|
+
selector: "tx-checkbox",
|
|
1548
|
+
inputs: [
|
|
1549
|
+
"label",
|
|
1550
|
+
"description",
|
|
1551
|
+
"value",
|
|
1552
|
+
"binary",
|
|
1553
|
+
"trueValue",
|
|
1554
|
+
"falseValue",
|
|
1555
|
+
"indeterminate",
|
|
1556
|
+
"icon",
|
|
1557
|
+
"indeterminateIcon",
|
|
1428
1558
|
"size",
|
|
1429
1559
|
"variant",
|
|
1430
|
-
"
|
|
1560
|
+
"tile",
|
|
1431
1561
|
"invalid",
|
|
1432
1562
|
"disabled",
|
|
1433
1563
|
"readonly",
|
|
@@ -1442,44 +1572,7 @@ var TxTableColumnFilter = class TxTableColumnFilter {
|
|
|
1442
1572
|
"ptOptions",
|
|
1443
1573
|
"unstyled"
|
|
1444
1574
|
],
|
|
1445
|
-
outputs: ["
|
|
1446
|
-
},
|
|
1447
|
-
{
|
|
1448
|
-
kind: "component",
|
|
1449
|
-
type: TxSelect,
|
|
1450
|
-
selector: "tx-select",
|
|
1451
|
-
inputs: [
|
|
1452
|
-
"options",
|
|
1453
|
-
"editable",
|
|
1454
|
-
"checkmark",
|
|
1455
|
-
"dropdownIcon",
|
|
1456
|
-
"dt",
|
|
1457
|
-
"pt",
|
|
1458
|
-
"ptOptions",
|
|
1459
|
-
"unstyled"
|
|
1460
|
-
],
|
|
1461
|
-
outputs: ["changed"]
|
|
1462
|
-
},
|
|
1463
|
-
{
|
|
1464
|
-
kind: "component",
|
|
1465
|
-
type: TxMultiselect,
|
|
1466
|
-
selector: "tx-multiselect",
|
|
1467
|
-
inputs: [
|
|
1468
|
-
"options",
|
|
1469
|
-
"display",
|
|
1470
|
-
"maxSelectedLabels",
|
|
1471
|
-
"selectedItemsLabel",
|
|
1472
|
-
"selectAllLabel",
|
|
1473
|
-
"countLabel",
|
|
1474
|
-
"selectionLimit",
|
|
1475
|
-
"showToggleAll",
|
|
1476
|
-
"dropdownIcon",
|
|
1477
|
-
"dt",
|
|
1478
|
-
"pt",
|
|
1479
|
-
"ptOptions",
|
|
1480
|
-
"unstyled"
|
|
1481
|
-
],
|
|
1482
|
-
outputs: ["changed"]
|
|
1575
|
+
outputs: ["indeterminateChange", "changed"]
|
|
1483
1576
|
},
|
|
1484
1577
|
{
|
|
1485
1578
|
kind: "component",
|
|
@@ -1518,34 +1611,31 @@ var TxTableColumnFilter = class TxTableColumnFilter {
|
|
|
1518
1611
|
inputs: ["txPopoverTrigger"]
|
|
1519
1612
|
},
|
|
1520
1613
|
{
|
|
1521
|
-
kind: "
|
|
1522
|
-
type:
|
|
1523
|
-
selector: "
|
|
1614
|
+
kind: "directive",
|
|
1615
|
+
type: TxTooltip,
|
|
1616
|
+
selector: "[txTooltip]",
|
|
1524
1617
|
inputs: [
|
|
1525
|
-
"
|
|
1526
|
-
"
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
"
|
|
1530
|
-
"
|
|
1531
|
-
"
|
|
1532
|
-
"
|
|
1533
|
-
"
|
|
1534
|
-
"
|
|
1535
|
-
"
|
|
1536
|
-
"
|
|
1618
|
+
"txTooltip",
|
|
1619
|
+
"tooltipPlacement",
|
|
1620
|
+
"tooltipEvent",
|
|
1621
|
+
"tooltipShowDelay",
|
|
1622
|
+
"tooltipHideDelay",
|
|
1623
|
+
"tooltipLife",
|
|
1624
|
+
"tooltipOffset",
|
|
1625
|
+
"tooltipArrow",
|
|
1626
|
+
"tooltipInteractive",
|
|
1627
|
+
"tooltipDisabled",
|
|
1628
|
+
"tooltipOverflowOnly",
|
|
1629
|
+
"tooltipMultiline",
|
|
1630
|
+
"tooltipContext",
|
|
1631
|
+
"tooltipClass",
|
|
1632
|
+
"tooltipDt",
|
|
1633
|
+
"tooltipPt",
|
|
1634
|
+
"tooltipPtOptions",
|
|
1635
|
+
"tooltipUnstyled"
|
|
1537
1636
|
],
|
|
1538
|
-
outputs: [
|
|
1539
|
-
|
|
1540
|
-
"opened",
|
|
1541
|
-
"closed"
|
|
1542
|
-
]
|
|
1543
|
-
},
|
|
1544
|
-
{
|
|
1545
|
-
kind: "directive",
|
|
1546
|
-
type: TxMenuTrigger,
|
|
1547
|
-
selector: "[txMenuTrigger]",
|
|
1548
|
-
inputs: ["txMenuTrigger"]
|
|
1637
|
+
outputs: ["tooltipShown", "tooltipHidden"],
|
|
1638
|
+
exportAs: ["txTooltip"]
|
|
1549
1639
|
}
|
|
1550
1640
|
],
|
|
1551
1641
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
@@ -1555,280 +1645,206 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1555
1645
|
minVersion: "12.0.0",
|
|
1556
1646
|
version: "22.2.3",
|
|
1557
1647
|
ngImport: i0,
|
|
1558
|
-
type:
|
|
1648
|
+
type: TxTableSettings,
|
|
1559
1649
|
decorators: [{
|
|
1560
1650
|
type: Component,
|
|
1561
1651
|
args: [{
|
|
1562
|
-
selector: "tx-table-
|
|
1652
|
+
selector: "tx-table-settings",
|
|
1563
1653
|
imports: [
|
|
1564
|
-
NgTemplateOutlet,
|
|
1565
1654
|
FormsModule,
|
|
1655
|
+
CdkDropList,
|
|
1656
|
+
CdkDrag,
|
|
1657
|
+
CdkDragHandle,
|
|
1658
|
+
TxIcon,
|
|
1566
1659
|
TxButton,
|
|
1567
|
-
|
|
1568
|
-
TxInputNumber,
|
|
1569
|
-
TxSelect,
|
|
1570
|
-
TxMultiselect,
|
|
1660
|
+
TxCheckbox,
|
|
1571
1661
|
TxPopover,
|
|
1572
1662
|
TxPopoverTrigger,
|
|
1573
|
-
|
|
1574
|
-
TxMenuTrigger
|
|
1663
|
+
TxTooltip
|
|
1575
1664
|
],
|
|
1576
1665
|
template: `
|
|
1577
|
-
<
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
(ngModelChange)="setValue(index, $event, true)"
|
|
1610
|
-
/>
|
|
1611
|
-
}
|
|
1612
|
-
@case ('options') {
|
|
1613
|
-
<tx-multiselect
|
|
1614
|
-
size="small"
|
|
1615
|
-
class="tx-table-filter__value"
|
|
1616
|
-
optionLabel="label"
|
|
1617
|
-
optionValue="value"
|
|
1618
|
-
[maxSelectedLabels]="2"
|
|
1619
|
-
[options]="column().filterOptions ?? []"
|
|
1620
|
-
[ariaLabel]="valueLabel()"
|
|
1621
|
-
[placeholder]="column().filterPlaceholder ?? translations().filterAny"
|
|
1622
|
-
[ngModel]="rule.value ?? []"
|
|
1623
|
-
(ngModelChange)="setValue(index, $event, live)"
|
|
1624
|
-
/>
|
|
1625
|
-
}
|
|
1626
|
-
@default {
|
|
1627
|
-
<input
|
|
1628
|
-
txInput
|
|
1629
|
-
type="text"
|
|
1630
|
-
size="small"
|
|
1631
|
-
class="tx-table-filter__value"
|
|
1632
|
-
[attr.aria-label]="valueLabel()"
|
|
1633
|
-
[placeholder]="column().filterPlaceholder ?? ''"
|
|
1634
|
-
[value]="rule.value ?? ''"
|
|
1635
|
-
(input)="setValue(index, $any($event.target).value, live)"
|
|
1636
|
-
(keydown.enter)="apply()"
|
|
1637
|
-
/>
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1640
|
-
</ng-template>
|
|
1641
|
-
|
|
1642
|
-
@if (display() === 'row') {
|
|
1643
|
-
<div class="tx-table-filter__row">
|
|
1644
|
-
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: live().rules[0], index: 0, live: true }" />
|
|
1645
|
-
@if (modes().length > 1) {
|
|
1646
|
-
<button
|
|
1647
|
-
txButton
|
|
1648
|
-
type="button"
|
|
1649
|
-
text
|
|
1650
|
-
rounded
|
|
1651
|
-
size="small"
|
|
1652
|
-
severity="secondary"
|
|
1653
|
-
class="tx-table-filter__button"
|
|
1654
|
-
[class.tx-table-filter__button--active]="active()"
|
|
1655
|
-
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
1656
|
-
[attr.aria-label]="buttonLabel()"
|
|
1657
|
-
[txMenuTrigger]="modeMenu"
|
|
1658
|
-
></button>
|
|
1659
|
-
<tx-menu #modeMenu popup [model]="modeItems()" [ariaLabel]="translations().filterMatchMode" />
|
|
1660
|
-
}
|
|
1661
|
-
</div>
|
|
1662
|
-
} @else {
|
|
1663
|
-
<button
|
|
1664
|
-
txButton
|
|
1665
|
-
type="button"
|
|
1666
|
-
text
|
|
1667
|
-
rounded
|
|
1668
|
-
size="small"
|
|
1669
|
-
severity="secondary"
|
|
1670
|
-
class="tx-table-filter__button"
|
|
1671
|
-
[class.tx-table-filter__button--active]="active()"
|
|
1672
|
-
[icon]="active() ? 'filter-fill' : 'filter'"
|
|
1673
|
-
[attr.aria-label]="buttonLabel()"
|
|
1674
|
-
[txPopoverTrigger]="panel"
|
|
1675
|
-
(click)="$event.stopPropagation()"
|
|
1676
|
-
></button>
|
|
1677
|
-
<tx-popover #panel placement="bottom-start" [ariaLabel]="buttonLabel()" (opened)="startDraft()">
|
|
1678
|
-
<div class="tx-table-filter">
|
|
1679
|
-
@if (type() === 'boolean' || type() === 'options') {
|
|
1680
|
-
<ng-container [ngTemplateOutlet]="editor" [ngTemplateOutletContext]="{ $implicit: draft().rules[0], index: 0, live: false }" />
|
|
1681
|
-
} @else {
|
|
1682
|
-
@if (draft().rules.length > 1) {
|
|
1683
|
-
<tx-select
|
|
1684
|
-
size="small"
|
|
1685
|
-
optionLabel="label"
|
|
1686
|
-
optionValue="value"
|
|
1687
|
-
[options]="operatorOptions()"
|
|
1688
|
-
[ariaLabel]="translations().filterMatchAll + ' / ' + translations().filterMatchAny"
|
|
1689
|
-
[ngModel]="draft().operator"
|
|
1690
|
-
(ngModelChange)="setOperator($event)"
|
|
1691
|
-
/>
|
|
1666
|
+
<button
|
|
1667
|
+
txButton
|
|
1668
|
+
type="button"
|
|
1669
|
+
size="small"
|
|
1670
|
+
icon="cog"
|
|
1671
|
+
class="tx-table-settings__button"
|
|
1672
|
+
[unstyled]="unstyled()"
|
|
1673
|
+
[txTooltip]="translations().tableSettings"
|
|
1674
|
+
[attr.aria-label]="translations().tableSettings"
|
|
1675
|
+
[txPopoverTrigger]="panel"
|
|
1676
|
+
></button>
|
|
1677
|
+
<tx-popover #panel placement="bottom-end" [ariaLabel]="translations().tableSettings" [unstyled]="unstyled()">
|
|
1678
|
+
<div class="tx-table-settings__panel">
|
|
1679
|
+
@if (tabs().length > 1) {
|
|
1680
|
+
<div class="tx-table-settings__tabs" role="tablist">
|
|
1681
|
+
@for (tab of tabs(); track tab) {
|
|
1682
|
+
<button
|
|
1683
|
+
type="button"
|
|
1684
|
+
role="tab"
|
|
1685
|
+
class="tx-table-settings__tab"
|
|
1686
|
+
[id]="id + '-' + tab"
|
|
1687
|
+
[attr.aria-selected]="tab === currentTab()"
|
|
1688
|
+
[attr.aria-controls]="id + '-panel'"
|
|
1689
|
+
[attr.tabindex]="tab === currentTab() ? 0 : -1"
|
|
1690
|
+
[txTooltip]="tab === 'columns' ? translations().tableColumnsHint : translations().tableActionsHint"
|
|
1691
|
+
(click)="activeTab.set(tab)"
|
|
1692
|
+
(keydown.arrowright)="moveTab(1)"
|
|
1693
|
+
(keydown.arrowleft)="moveTab(-1)"
|
|
1694
|
+
>
|
|
1695
|
+
<tx-icon aria-hidden="true" [name]="tab === 'columns' ? 'table' : 'bolt'" />
|
|
1696
|
+
{{ tab === 'columns' ? translations().tableColumns : translations().tableActions }}
|
|
1697
|
+
</button>
|
|
1692
1698
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1699
|
+
</div>
|
|
1700
|
+
} @else {
|
|
1701
|
+
<div class="tx-table-settings__title" [id]="id + '-' + currentTab()">
|
|
1702
|
+
<tx-icon aria-hidden="true" [name]="currentTab() === 'columns' ? 'table' : 'bolt'" />
|
|
1703
|
+
<span>{{ currentTab() === 'columns' ? translations().tableColumns : translations().tableActions }}</span>
|
|
1704
|
+
</div>
|
|
1705
|
+
}
|
|
1706
|
+
<div
|
|
1707
|
+
class="tx-table-settings__list"
|
|
1708
|
+
[id]="id + '-panel'"
|
|
1709
|
+
[attr.role]="tabs().length > 1 ? 'tabpanel' : 'group'"
|
|
1710
|
+
[attr.aria-labelledby]="id + '-' + currentTab()"
|
|
1711
|
+
>
|
|
1712
|
+
@if (currentTab() === 'columns') {
|
|
1713
|
+
<div
|
|
1714
|
+
#columnList
|
|
1715
|
+
cdkDropList
|
|
1716
|
+
class="tx-table-settings__actions"
|
|
1717
|
+
[cdkDropListDisabled]="!canReorder()"
|
|
1718
|
+
(cdkDropListDropped)="dropColumn($event)"
|
|
1719
|
+
>
|
|
1720
|
+
@for (column of listedColumns(); track column.field) {
|
|
1721
|
+
<div
|
|
1722
|
+
cdkDrag
|
|
1723
|
+
cdkDragLockAxis="y"
|
|
1724
|
+
class="tx-table-settings__action"
|
|
1725
|
+
[cdkDragBoundary]="columnList"
|
|
1726
|
+
[class.tx-table-settings__action--static]="!canReorder() || column.reorderable === false"
|
|
1727
|
+
[cdkDragDisabled]="!canReorder() || column.reorderable === false"
|
|
1728
|
+
>
|
|
1729
|
+
@if (canReorder()) {
|
|
1730
|
+
<span
|
|
1731
|
+
cdkDragHandle
|
|
1732
|
+
class="tx-table-settings__handle"
|
|
1733
|
+
[class.tx-table-settings__handle--hidden]="column.reorderable === false"
|
|
1734
|
+
[attr.aria-hidden]="true"
|
|
1735
|
+
>
|
|
1736
|
+
<tx-icon name="bars" />
|
|
1737
|
+
</span>
|
|
1738
|
+
}
|
|
1739
|
+
<tx-checkbox
|
|
1740
|
+
binary
|
|
1741
|
+
[label]="label(column)"
|
|
1742
|
+
[disabled]="column.hideable === false"
|
|
1743
|
+
[ngModel]="!hidden().has(column.field)"
|
|
1744
|
+
(ngModelChange)="columnToggled.emit({ field: column.field, visible: $event })"
|
|
1745
|
+
(keydown.alt.arrowup)="moveColumn(column, -1, $event)"
|
|
1746
|
+
(keydown.alt.arrowdown)="moveColumn(column, 1, $event)"
|
|
1704
1747
|
/>
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1748
|
+
</div>
|
|
1749
|
+
}
|
|
1750
|
+
</div>
|
|
1751
|
+
} @else {
|
|
1752
|
+
<div #actionList cdkDropList class="tx-table-settings__actions" (cdkDropListDropped)="dropAction($event)">
|
|
1753
|
+
@for (action of store.registeredActions(); track action.id; let index = $index) {
|
|
1754
|
+
<div cdkDrag cdkDragLockAxis="y" class="tx-table-settings__action" [cdkDragBoundary]="actionList">
|
|
1755
|
+
<span cdkDragHandle class="tx-table-settings__handle" aria-hidden="true">
|
|
1756
|
+
<tx-icon aria-hidden="true" name="bars" />
|
|
1757
|
+
</span>
|
|
1758
|
+
<tx-checkbox
|
|
1759
|
+
binary
|
|
1760
|
+
[label]="action.label"
|
|
1761
|
+
[ngModel]="store.isPinned(action.id)"
|
|
1762
|
+
(ngModelChange)="store.setPinned(action.id, $event)"
|
|
1763
|
+
(keydown.alt.arrowup)="moveAction(index, -1, $event)"
|
|
1764
|
+
(keydown.alt.arrowdown)="moveAction(index, 1, $event)"
|
|
1765
|
+
/>
|
|
1766
|
+
</div>
|
|
1767
|
+
}
|
|
1768
|
+
</div>
|
|
1724
1769
|
}
|
|
1725
|
-
<div class="tx-table-filter__footer">
|
|
1726
|
-
<button txButton type="button" outlined size="small" severity="secondary" [label]="translations().clear" (click)="clear()"></button>
|
|
1727
|
-
<button txButton type="button" size="small" [label]="translations().filterApply" (click)="apply()"></button>
|
|
1728
|
-
</div>
|
|
1729
1770
|
</div>
|
|
1730
|
-
</
|
|
1731
|
-
|
|
1771
|
+
</div>
|
|
1772
|
+
</tx-popover>
|
|
1732
1773
|
`,
|
|
1733
1774
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1734
|
-
host: {
|
|
1735
|
-
|
|
1736
|
-
"[class.tx-table-column-filter--row]": "display() === 'row'"
|
|
1737
|
-
},
|
|
1738
|
-
styles: [":host{display:inline-flex;min-width:0}:host(.tx-table-column-filter--row){display:flex;width:100%}.tx-table-filter__row{display:flex;flex:1;align-items:center;gap:var(--tx-table-filter-gap, 7px);min-width:0}.tx-table-filter__row .tx-table-filter__value{flex:1;min-width:0;width:100%}.tx-table-filter{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);min-width:var(--tx-table-filter-min-width, 175px)}.tx-table-filter__rule{display:flex;flex-direction:column;gap:var(--tx-table-filter-gap, 7px);padding-bottom:var(--tx-table-filter-gap, 7px);border-bottom:1px solid var(--tx-surface-border)}.tx-table-filter__rule:last-of-type{padding-bottom:0;border-bottom:0}.tx-table-filter__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--tx-table-filter-gap, 7px)}.tx-table-filter__value{width:100%}.tx-table-filter__button--active{color:var(--tx-primary-base)}\n"]
|
|
1775
|
+
host: { class: "tx-table-settings" },
|
|
1776
|
+
styles: [":host{display:inline-flex}.tx-table-settings__panel{display:flex;flex-direction:column;box-sizing:border-box;width:var(--tx-table-settings-width);gap:var(--tx-table-settings-gap)}.tx-table-settings__tabs,.tx-table-settings__title{display:flex;align-items:center;gap:var(--tx-table-settings-title-gap)}.tx-table-settings__title{padding-bottom:var(--tx-table-settings-item-padding);border-bottom:1px solid var(--tx-surface-border);color:var(--tx-text-primary);font-weight:var(--tx-table-settings-title-font-weight)}.tx-table-settings__tabs{border-bottom:1px solid var(--tx-surface-border)}.tx-table-settings__tab{display:inline-flex;flex:1;align-items:center;justify-content:center;gap:var(--tx-table-settings-title-gap);margin:0 0 -1px;padding:var(--tx-table-settings-item-padding) 0 calc(var(--tx-table-settings-item-padding) * 2);border:0;border-bottom:2px solid transparent;background:none;color:var(--tx-text-muted);font:inherit;font-weight:var(--tx-table-settings-title-font-weight);cursor:pointer}.tx-table-settings__tab[aria-selected=true]{border-bottom-color:var(--tx-primary-base);color:var(--tx-primary-base)}.tx-table-settings__tab:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}.tx-table-settings__list{display:flex;flex-direction:column;gap:var(--tx-table-settings-gap);max-height:var(--tx-table-settings-max-height);overflow-y:auto}.tx-table-settings__actions{display:flex;flex-direction:column;gap:calc(var(--tx-table-settings-item-padding) / 2)}.tx-table-settings__action{display:flex;align-items:center;gap:var(--tx-table-settings-title-gap);padding:var(--tx-table-settings-item-padding);border-radius:var(--tx-table-settings-item-radius);background:var(--tx-surface-card)}.tx-table-settings__action:hover{background:var(--tx-table-settings-item-hover-background)}.tx-table-settings__action--static{background:transparent}.tx-table-settings__handle--hidden{visibility:hidden}.tx-table-settings__handle{display:inline-flex;color:var(--tx-table-settings-handle-color);font-size:var(--tx-table-settings-handle-size);cursor:move}.cdk-drag-preview.tx-table-settings__action{box-shadow:var(--tx-shadow-overlay)}.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform var(--tx-motion-duration) cubic-bezier(0,0,.2,1)}@media(prefers-reduced-motion:reduce){.cdk-drag-animating{transition:none}}\n"]
|
|
1739
1777
|
}]
|
|
1740
1778
|
}],
|
|
1741
|
-
ctorParameters: () => [],
|
|
1742
1779
|
propDecorators: {
|
|
1743
|
-
|
|
1744
|
-
type: i0.
|
|
1745
|
-
args: [
|
|
1780
|
+
columns: [{
|
|
1781
|
+
type: i0.Input,
|
|
1782
|
+
args: [{
|
|
1783
|
+
isSignal: true,
|
|
1784
|
+
alias: "columns",
|
|
1785
|
+
required: false
|
|
1786
|
+
}]
|
|
1746
1787
|
}],
|
|
1747
|
-
|
|
1788
|
+
hidden: [{
|
|
1748
1789
|
type: i0.Input,
|
|
1749
1790
|
args: [{
|
|
1750
1791
|
isSignal: true,
|
|
1751
|
-
alias: "
|
|
1752
|
-
required:
|
|
1792
|
+
alias: "hidden",
|
|
1793
|
+
required: false
|
|
1753
1794
|
}]
|
|
1754
1795
|
}],
|
|
1755
|
-
|
|
1796
|
+
showColumns: [{
|
|
1756
1797
|
type: i0.Input,
|
|
1757
1798
|
args: [{
|
|
1758
1799
|
isSignal: true,
|
|
1759
|
-
alias: "
|
|
1800
|
+
alias: "showColumns",
|
|
1801
|
+
required: false
|
|
1802
|
+
}]
|
|
1803
|
+
}],
|
|
1804
|
+
showActions: [{
|
|
1805
|
+
type: i0.Input,
|
|
1806
|
+
args: [{
|
|
1807
|
+
isSignal: true,
|
|
1808
|
+
alias: "showActions",
|
|
1809
|
+
required: false
|
|
1810
|
+
}]
|
|
1811
|
+
}],
|
|
1812
|
+
unstyled: [{
|
|
1813
|
+
type: i0.Input,
|
|
1814
|
+
args: [{
|
|
1815
|
+
isSignal: true,
|
|
1816
|
+
alias: "unstyled",
|
|
1760
1817
|
required: false
|
|
1761
1818
|
}]
|
|
1819
|
+
}],
|
|
1820
|
+
columnToggled: [{
|
|
1821
|
+
type: i0.Output,
|
|
1822
|
+
args: ["columnToggled"]
|
|
1762
1823
|
}]
|
|
1763
1824
|
}
|
|
1764
1825
|
});
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
link.style.display = "none";
|
|
1788
|
-
document.body.appendChild(link);
|
|
1789
|
-
link.click();
|
|
1790
|
-
link.remove();
|
|
1791
|
-
view.setTimeout(() => view.URL.revokeObjectURL(url));
|
|
1792
|
-
}
|
|
1793
|
-
var TxTableStyles = class TxTableStyles {
|
|
1794
|
-
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1795
|
-
minVersion: "12.0.0",
|
|
1796
|
-
version: "22.2.3",
|
|
1797
|
-
ngImport: i0,
|
|
1798
|
-
type: TxTableStyles,
|
|
1799
|
-
deps: [],
|
|
1800
|
-
target: i0.ɵɵFactoryTarget.Component
|
|
1801
|
-
});
|
|
1802
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1803
|
-
minVersion: "14.0.0",
|
|
1804
|
-
version: "22.2.3",
|
|
1805
|
-
type: TxTableStyles,
|
|
1806
|
-
isStandalone: true,
|
|
1807
|
-
selector: "tx-table-styles",
|
|
1808
|
-
ngImport: i0,
|
|
1809
|
-
template: "",
|
|
1810
|
-
isInline: true,
|
|
1811
|
-
styles: [".tx-table__drag-preview{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:var(--tx-table-header-cell-padding);border:1px solid var(--tx-table-drag-preview-border-color);border-radius:var(--tx-table-drag-preview-border-radius);background:var(--tx-table-drag-preview-background);box-shadow:var(--tx-table-drag-preview-shadow);color:var(--tx-table-header-cell-color);font-family:inherit;font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);list-style:none}.tx-table__drag-preview .tx-table__resizer{display:none}.cdk-drag-animating.tx-table__th{transition:transform .3s cubic-bezier(.2,.8,.4,1)}.tx-table__menu-action{display:inline-flex;flex-shrink:0;pointer-events:none}.tx-table__menu-action .tx-button{width:24px;min-width:24px;height:24px;padding:0;font-size:10.5px}.tx-table__menu-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-menu__item:has(.tx-table__menu-action :is(button,a):disabled){opacity:.5;pointer-events:none}@media(prefers-reduced-motion:reduce){.cdk-drag-animating.tx-table__th{transition:none}}\n"],
|
|
1812
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1813
|
-
encapsulation: i0.ViewEncapsulation.None
|
|
1814
|
-
});
|
|
1815
|
-
};
|
|
1816
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
1817
|
-
minVersion: "12.0.0",
|
|
1818
|
-
version: "22.2.3",
|
|
1819
|
-
ngImport: i0,
|
|
1820
|
-
type: TxTableStyles,
|
|
1821
|
-
decorators: [{
|
|
1822
|
-
type: Component,
|
|
1823
|
-
args: [{
|
|
1824
|
-
selector: "tx-table-styles",
|
|
1825
|
-
template: "",
|
|
1826
|
-
encapsulation: ViewEncapsulation.None,
|
|
1827
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1828
|
-
styles: [".tx-table__drag-preview{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:var(--tx-table-header-cell-padding);border:1px solid var(--tx-table-drag-preview-border-color);border-radius:var(--tx-table-drag-preview-border-radius);background:var(--tx-table-drag-preview-background);box-shadow:var(--tx-table-drag-preview-shadow);color:var(--tx-table-header-cell-color);font-family:inherit;font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);list-style:none}.tx-table__drag-preview .tx-table__resizer{display:none}.cdk-drag-animating.tx-table__th{transition:transform .3s cubic-bezier(.2,.8,.4,1)}.tx-table__menu-action{display:inline-flex;flex-shrink:0;pointer-events:none}.tx-table__menu-action .tx-button{width:24px;min-width:24px;height:24px;padding:0;font-size:10.5px}.tx-table__menu-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-menu__item:has(.tx-table__menu-action :is(button,a):disabled){opacity:.5;pointer-events:none}@media(prefers-reduced-motion:reduce){.cdk-drag-animating.tx-table__th{transition:none}}\n"]
|
|
1829
|
-
}]
|
|
1830
|
-
}]
|
|
1831
|
-
});
|
|
1826
|
+
const TX_TABLE_IMPORTS = [
|
|
1827
|
+
NgTemplateOutlet,
|
|
1828
|
+
FormsModule,
|
|
1829
|
+
CdkDropList,
|
|
1830
|
+
CdkDrag,
|
|
1831
|
+
CdkDragHandle,
|
|
1832
|
+
TxIcon,
|
|
1833
|
+
TxTooltip,
|
|
1834
|
+
TxSkeleton,
|
|
1835
|
+
TxButton,
|
|
1836
|
+
TxCheckbox,
|
|
1837
|
+
TxInput,
|
|
1838
|
+
TxInputNumber,
|
|
1839
|
+
TxSelect,
|
|
1840
|
+
TxRadioButton,
|
|
1841
|
+
TxPaginator,
|
|
1842
|
+
TxProgressSpinner,
|
|
1843
|
+
TxMenu,
|
|
1844
|
+
TxMenuItemTemplate,
|
|
1845
|
+
TxTableSettings,
|
|
1846
|
+
TxTableColumnFilter
|
|
1847
|
+
];
|
|
1832
1848
|
var TxTableCell = class TxTableCell {
|
|
1833
1849
|
templateRef = inject(TemplateRef);
|
|
1834
1850
|
txTableCell = input.required(...ngDevMode ? [{ debugName: "txTableCell" }] : /* istanbul ignore next */ []);
|
|
@@ -2622,7 +2638,11 @@ var TxTable = class TxTable {
|
|
|
2622
2638
|
}));
|
|
2623
2639
|
}, ...ngDevMode ? [{ debugName: "frozenRows" }] : /* istanbul ignore next */ []);
|
|
2624
2640
|
animatedGroups = computed(() => !!this.groupRowsBy() && this.expandableRowGroups() && this.rowGroupMode() === "subheader", ...ngDevMode ? [{ debugName: "animatedGroups" }] : /* istanbul ignore next */ []);
|
|
2625
|
-
|
|
2641
|
+
animatedRows = computed(() => this.animatedGroups() || this.isTree && !this.virtualScroll(), ...ngDevMode ? [{ debugName: "animatedRows" }] : /* istanbul ignore next */ []);
|
|
2642
|
+
isTree = false;
|
|
2643
|
+
treeCheckbox = computed(() => this.isTree && this.selectionMode() === "checkbox", ...ngDevMode ? [{ debugName: "treeCheckbox" }] : /* istanbul ignore next */ []);
|
|
2644
|
+
treeField = computed(() => this.isTree ? this.visibleColumns()[0]?.field ?? null : null, ...ngDevMode ? [{ debugName: "treeField" }] : /* istanbul ignore next */ []);
|
|
2645
|
+
hasSelectColumn = computed(() => this.selectionMode() === "checkbox" && !this.treeCheckbox() || this.selectionMode() === "radio", ...ngDevMode ? [{ debugName: "hasSelectColumn" }] : /* istanbul ignore next */ []);
|
|
2626
2646
|
hasExpandColumn = computed(() => !!this.expansionTemplate(), ...ngDevMode ? [{ debugName: "hasExpandColumn" }] : /* istanbul ignore next */ []);
|
|
2627
2647
|
hasActionsColumn = computed(() => !!this.actionsTemplate(), ...ngDevMode ? [{ debugName: "hasActionsColumn" }] : /* istanbul ignore next */ []);
|
|
2628
2648
|
renderColumns = computed(() => {
|
|
@@ -2783,8 +2803,11 @@ var TxTable = class TxTable {
|
|
|
2783
2803
|
const offset = this.frozenOffsets()[item.column.field] ?? 0;
|
|
2784
2804
|
return item.frozen === "start" ? { insetInlineStart: `${offset}px` } : { insetInlineEnd: `${offset}px` };
|
|
2785
2805
|
}
|
|
2806
|
+
dataOf(row) {
|
|
2807
|
+
return row;
|
|
2808
|
+
}
|
|
2786
2809
|
cellValue(row, column) {
|
|
2787
|
-
return resolveField(row, column.field);
|
|
2810
|
+
return resolveField(this.dataOf(row), column.field);
|
|
2788
2811
|
}
|
|
2789
2812
|
displayValue(row, column) {
|
|
2790
2813
|
const value = this.cellValue(row, column);
|
|
@@ -2894,11 +2917,15 @@ var TxTable = class TxTable {
|
|
|
2894
2917
|
this.emitLazyLoad();
|
|
2895
2918
|
this.saveState();
|
|
2896
2919
|
}
|
|
2920
|
+
identityOf(row) {
|
|
2921
|
+
const dataKey = this.dataKey();
|
|
2922
|
+
return dataKey ? resolveField(row, dataKey) : row;
|
|
2923
|
+
}
|
|
2897
2924
|
isSelected(row) {
|
|
2898
2925
|
const selection = this.selection();
|
|
2899
2926
|
if (selection === null || selection === void 0) return false;
|
|
2900
|
-
const
|
|
2901
|
-
const same = (other) =>
|
|
2927
|
+
const identity = this.identityOf(row);
|
|
2928
|
+
const same = (other) => this.identityOf(other) === identity;
|
|
2902
2929
|
return Array.isArray(selection) ? selection.some(same) : same(selection);
|
|
2903
2930
|
}
|
|
2904
2931
|
multiple() {
|
|
@@ -2934,8 +2961,7 @@ var TxTable = class TxTable {
|
|
|
2934
2961
|
this.selection.set(checked ? [...rest, ...page] : rest);
|
|
2935
2962
|
}
|
|
2936
2963
|
sameRow(a, b) {
|
|
2937
|
-
|
|
2938
|
-
return dataKey ? resolveField(a, dataKey) === resolveField(b, dataKey) : a === b;
|
|
2964
|
+
return this.identityOf(a) === this.identityOf(b);
|
|
2939
2965
|
}
|
|
2940
2966
|
onRowClick(item, position, event) {
|
|
2941
2967
|
this.rowClick.emit({
|
|
@@ -2972,8 +2998,13 @@ var TxTable = class TxTable {
|
|
|
2972
2998
|
const [start, end] = from < to ? [from, to] : [to, from];
|
|
2973
2999
|
this.selection.set(rows.slice(start, end + 1).filter((row) => row.selectable).map((row) => row.row));
|
|
2974
3000
|
}
|
|
3001
|
+
rowsFocusable() {
|
|
3002
|
+
return this.rowSelection();
|
|
3003
|
+
}
|
|
3004
|
+
treeRowKey;
|
|
2975
3005
|
onRowKeydown(item, position, event) {
|
|
2976
|
-
if (!this.
|
|
3006
|
+
if (!this.rowsFocusable() || event.target !== event.currentTarget) return;
|
|
3007
|
+
if (this.treeRowKey?.(item, position, event)) return;
|
|
2977
3008
|
const count = this.renderRows().length;
|
|
2978
3009
|
const focus = (next) => {
|
|
2979
3010
|
const index = Math.max(0, Math.min(count - 1, next));
|
|
@@ -2999,6 +3030,7 @@ var TxTable = class TxTable {
|
|
|
2999
3030
|
break;
|
|
3000
3031
|
case " ":
|
|
3001
3032
|
case "Enter":
|
|
3033
|
+
if (!this.selectionMode()) break;
|
|
3002
3034
|
event.preventDefault();
|
|
3003
3035
|
this.toggleRow(item, event);
|
|
3004
3036
|
this.selectionAnchor = position;
|
|
@@ -3044,6 +3076,12 @@ var TxTable = class TxTable {
|
|
|
3044
3076
|
});
|
|
3045
3077
|
}
|
|
3046
3078
|
}
|
|
3079
|
+
isCollapsedRow(item) {
|
|
3080
|
+
return !!item.group?.collapsed || !!item.tree?.hidden;
|
|
3081
|
+
}
|
|
3082
|
+
toggleNode(item, event) {
|
|
3083
|
+
this.toggleExpansion(item, event);
|
|
3084
|
+
}
|
|
3047
3085
|
isClosing(key) {
|
|
3048
3086
|
return this.closingKeys().includes(key);
|
|
3049
3087
|
}
|
|
@@ -3088,8 +3126,8 @@ var TxTable = class TxTable {
|
|
|
3088
3126
|
}
|
|
3089
3127
|
editorContext(item, column) {
|
|
3090
3128
|
return {
|
|
3091
|
-
$implicit: item.row,
|
|
3092
|
-
row: item.row,
|
|
3129
|
+
$implicit: this.dataOf(item.row),
|
|
3130
|
+
row: this.dataOf(item.row),
|
|
3093
3131
|
index: item.index,
|
|
3094
3132
|
column,
|
|
3095
3133
|
value: this.draftValue(item, column),
|
|
@@ -3123,9 +3161,9 @@ var TxTable = class TxTable {
|
|
|
3123
3161
|
this.cellEdit.set(null);
|
|
3124
3162
|
const item = this.renderRows().find((row) => row.key === edit.key);
|
|
3125
3163
|
if (!item) return;
|
|
3126
|
-
const previousValue = resolveField(item.row, edit.field);
|
|
3164
|
+
const previousValue = resolveField(this.dataOf(item.row), edit.field);
|
|
3127
3165
|
if (previousValue !== edit.value) {
|
|
3128
|
-
writeField(item.row, edit.field, edit.value);
|
|
3166
|
+
writeField(this.dataOf(item.row), edit.field, edit.value);
|
|
3129
3167
|
this.editVersion.update((version) => version + 1);
|
|
3130
3168
|
}
|
|
3131
3169
|
this.cellEditComplete.emit({
|
|
@@ -3142,7 +3180,7 @@ var TxTable = class TxTable {
|
|
|
3142
3180
|
this.cellEdit.set(null);
|
|
3143
3181
|
const item = this.renderRows().find((row) => row.key === edit.key);
|
|
3144
3182
|
if (item) {
|
|
3145
|
-
const value = resolveField(item.row, edit.field);
|
|
3183
|
+
const value = resolveField(this.dataOf(item.row), edit.field);
|
|
3146
3184
|
this.cellEditCancel.emit({
|
|
3147
3185
|
row: item.row,
|
|
3148
3186
|
index: item.index,
|
|
@@ -3231,11 +3269,11 @@ var TxTable = class TxTable {
|
|
|
3231
3269
|
const previous = {};
|
|
3232
3270
|
const changes = {};
|
|
3233
3271
|
Object.entries(draft).forEach(([field, value]) => {
|
|
3234
|
-
const old = resolveField(item.row, field);
|
|
3272
|
+
const old = resolveField(this.dataOf(item.row), field);
|
|
3235
3273
|
previous[field] = old;
|
|
3236
3274
|
if (old !== value) {
|
|
3237
3275
|
changes[field] = value;
|
|
3238
|
-
writeField(item.row, field, value);
|
|
3276
|
+
writeField(this.dataOf(item.row), field, value);
|
|
3239
3277
|
}
|
|
3240
3278
|
});
|
|
3241
3279
|
this.closeRowEdit(item.key);
|
|
@@ -3252,7 +3290,7 @@ var TxTable = class TxTable {
|
|
|
3252
3290
|
if (!draft) return;
|
|
3253
3291
|
this.closeRowEdit(item.key);
|
|
3254
3292
|
const previous = {};
|
|
3255
|
-
Object.keys(draft).forEach((field) => previous[field] = resolveField(item.row, field));
|
|
3293
|
+
Object.keys(draft).forEach((field) => previous[field] = resolveField(this.dataOf(item.row), field));
|
|
3256
3294
|
this.rowEditCancel.emit({
|
|
3257
3295
|
row: item.row,
|
|
3258
3296
|
index: item.index,
|
|
@@ -3370,16 +3408,19 @@ var TxTable = class TxTable {
|
|
|
3370
3408
|
}
|
|
3371
3409
|
exportCSV(options = {}) {
|
|
3372
3410
|
const selection = this.selection();
|
|
3373
|
-
const rows = options.selectionOnly ? Array.isArray(selection) ? selection : selection ? [selection] : [] : this.
|
|
3411
|
+
const rows = options.selectionOnly ? Array.isArray(selection) ? selection : selection ? [selection] : [] : this.exportRows();
|
|
3374
3412
|
const columns = this.visibleColumns();
|
|
3375
3413
|
const own = this.exportFunction();
|
|
3376
3414
|
const csv = toCsv(rows, columns, {
|
|
3377
3415
|
separator: this.csvSeparator(),
|
|
3378
|
-
value: own ? (row, column) => own(row, column) :
|
|
3416
|
+
value: own ? (row, column) => own(row, column) : (row, column) => this.cellValue(row, column)
|
|
3379
3417
|
});
|
|
3380
3418
|
downloadCsv(this.document, csv, options.filename ?? this.exportFilename());
|
|
3381
3419
|
return csv;
|
|
3382
3420
|
}
|
|
3421
|
+
exportRows() {
|
|
3422
|
+
return this.sortedRows().filter((row) => row !== null && row !== void 0);
|
|
3423
|
+
}
|
|
3383
3424
|
canExpand(item) {
|
|
3384
3425
|
const expandable = this.expandableRows();
|
|
3385
3426
|
return !expandable || expandable(item.row, item.index);
|
|
@@ -4395,12 +4436,12 @@ var TxTable = class TxTable {
|
|
|
4395
4436
|
isSignal: true
|
|
4396
4437
|
}],
|
|
4397
4438
|
ngImport: i0,
|
|
4398
|
-
template: "@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() ? selectionMode() === 'multiple' : null\"\n [attr.role]=\"rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.tabindex]=\"rowSelection() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"!!item.group?.collapsed\"\n [attr.inert]=\"item.group?.collapsed ? '' : null\"\n [attr.aria-hidden]=\"item.group?.collapsed ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.row, row: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedGroups()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <input\n txInput\n type=\"date\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"dateInput(draftValue(item, column.column))\"\n (change)=\"setDraft(item, column.column, parseDateInput($any($event.target).value))\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: item.row,\n row: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n }\n }\n</ng-template>\n",
|
|
4399
|
-
styles: [":host{display:block;min-width:0}.tx-table__toolbar{display:flex;align-items:center;justify-content:space-between}.tx-table__toolbar-slot{flex:1;min-width:0}.tx-table__frame{position:relative}.tx-table__scroller{position:relative;overflow:auto}.tx-table__scroller--empty{overflow:hidden}.tx-table__table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0}.tx-table__thead{position:sticky;inset-block-start:0;z-index:2}.tx-table__th,.tx-table__td,.tx-table__footer-cell{box-sizing:border-box;overflow:hidden;text-align:start;vertical-align:middle}.tx-table__th{position:relative;white-space:nowrap;text-overflow:ellipsis}.tx-table__td{white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}[data-align=center]{text-align:center}[data-align=end]{text-align:end}.tx-table__cell--frozen{position:sticky;z-index:1}.tx-table__sort{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}.tx-table__header-content{display:flex;align-items:center;min-width:0}.tx-table__header-content>.tx-table__sort,.tx-table__header-content>.tx-table__column-title{min-width:0}.tx-table__filter{flex-shrink:0;margin-inline-start:auto}.tx-table__filter-cell{overflow:visible}.tx-table__column-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__sort-icon{flex-shrink:0}.tx-table__sort-icon--desc{transform:rotate(180deg)}.tx-table__sort-badge{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tx-table__resizer{position:absolute;inset-block:0;inset-inline-end:-5px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.tx-table__resizer:before{content:\"\";position:absolute;inset-block:0;inset-inline-start:-2px;width:14px}.tx-table__resizer-line{height:100%}.tx-table__th--draggable{cursor:grab}.tx-table__th--draggable:active{cursor:grabbing}.tx-table__row--selectable{cursor:pointer}.tx-table__row-toggle{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin:0;padding:0;border:0;background:transparent;cursor:pointer}.tx-table__row-toggle-icon:dir(rtl){transform:scaleX(-1)}.tx-table__row-toggle-icon--open,.tx-table__row-toggle-icon--open:dir(rtl){transform:rotate(90deg)}.tx-table__expansion-body{display:grid;grid-template-rows:0fr}.tx-table__expansion-body--open{grid-template-rows:1fr}.tx-table__expansion-inner{min-height:0;overflow:hidden}.tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{visibility:hidden}.tx-table__grip{position:absolute;inset-block-start:50%;inset-inline-start:1px;opacity:0;transform:translateY(-50%);pointer-events:none}.tx-table__th--draggable:hover .tx-table__grip,.tx-table__th--draggable:focus-within .tx-table__grip{opacity:1}.tx-table__select{display:inline-flex;vertical-align:middle}.tx-table__editor{display:flex;align-items:center;min-width:0}.tx-table__editor-control{flex:1;width:100%;min-width:0}.tx-table__row-editor{display:flex;align-items:center;justify-content:center}.tx-table__td--editable{cursor:text}.tx-table__td--editing{overflow:visible;text-overflow:clip}.tx-table__cell-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__spacer>td{padding:0;border:0}.tx-table__cell-body{display:grid;grid-template-rows:1fr}.tx-table__cell-inner{min-height:0;overflow:hidden;text-overflow:ellipsis}.tx-table__row--collapsed .tx-table__cell-body{grid-template-rows:0fr}.tx-table__row--collapsed .tx-table__cell-inner{visibility:hidden}.tx-table__frozen-tbody{position:sticky;z-index:2}.tx-table__row-handle{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:grab;touch-action:none}.tx-table__tbody.cdk-drop-list-dragging .tx-table__row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.tx-table__row.cdk-drag-preview{display:table-row}.tx-table__group-content{display:flex;align-items:center}.tx-table__loading{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center}.tx-table__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.tx-table__cards{display:grid}.tx-table__card{position:relative;display:flex;flex-direction:column;min-width:0}.tx-table__card-field,.tx-table__card-title{display:flex;align-items:center;min-width:0;overflow-wrap:break-word}.tx-table__card-field{text-align:end}.tx-table__card-label{flex-shrink:0;max-width:45%;margin-inline-end:auto;text-align:start}.tx-table__card-value{min-width:0}.tx-table__card-select{position:absolute;z-index:1}.tx-table__card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;order:99;margin-top:auto}.tx-table--resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.tx-table--resizing *{cursor:col-resize}:host([data-styled]){color:var(--tx-table-color);font-size:var(--tx-table-font-size);line-height:var(--tx-table-line-height)}:host([data-styled]) .tx-table__toolbar{gap:var(--tx-table-toolbar-gap);margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__scroller{padding-bottom:var(--tx-table-scroller-padding-bottom);scrollbar-color:var(--tx-table-scroller-scrollbar-thumb) transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar{width:var(--tx-table-scroller-scrollbar-size);height:var(--tx-table-scroller-scrollbar-size)}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-track,:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-corner{background:transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background-color:var(--tx-table-scroller-scrollbar-thumb);background-clip:padding-box}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--tx-table-scroller-scrollbar-thumb-hover)}:host([data-styled]) .tx-table__scroller--empty{padding-bottom:0}:host([data-styled]) .tx-table__thead{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__th{padding:var(--tx-table-header-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-header-cell-background);color:var(--tx-table-header-cell-color);font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__header-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__filter{margin-block:calc(var(--tx-table-filter-button-inset) * -1)}:host([data-styled]) .tx-table__filter-cell{padding:var(--tx-table-filter-cell-padding);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__sort{gap:var(--tx-table-header-cell-gap);border-radius:var(--tx-radius-xs)}:host([data-styled]) .tx-table__sort:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__sort-icon{--tx-icon-size: var(--tx-table-sort-icon-size);color:var(--tx-table-sort-icon-color);transition:transform .3s ease}:host([data-styled]) .tx-table__sort-badge{min-width:var(--tx-table-sort-icon-badge-size);height:var(--tx-table-sort-icon-badge-size);border-radius:999px;background:var(--tx-table-sort-icon-badge-background);color:var(--tx-table-sort-icon-badge-color);font-size:var(--tx-table-sort-icon-badge-font-size)}:host([data-styled]) .tx-table__resizer{width:var(--tx-table-column-resizer-width)}:host([data-styled]) .tx-table__resizer-line{width:var(--tx-table-column-resizer-line-width);background-color:transparent;transition:background-color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__resizer:hover .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer--active .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer:focus-visible .tx-table__resizer-line{background-color:var(--tx-table-column-resizer-color)}:host([data-styled]) .tx-table__resizer:focus-visible{outline:none}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging{background:var(--tx-table-drop-point-background)}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging .tx-table__th:hover{background:var(--tx-table-drop-point-hover-background)}:host([data-styled]) .tx-table__th.cdk-drag-placeholder{opacity:.6}:host([data-styled]) .tx-table__row{background:var(--tx-table-row-background);color:var(--tx-table-row-color);outline-color:transparent;transition:background var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__td{height:var(--tx-table-body-cell-height);padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px}:host([data-styled]) .tx-table__expansion-cell{padding:0;border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__expansion-content{padding:var(--tx-table-body-cell-padding)}:host([data-styled]) .tx-table__expansion-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{transition:visibility 0s linear var(--tx-table-expansion-duration)}@starting-style{:host([data-styled]) .tx-table__expansion-body--open{grid-template-rows:0fr}}:host([data-styled]) .tx-table__row-toggle-icon{transition:transform var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__row--collapsed>.tx-table__td{height:0;padding-block:0;border-bottom-width:0}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row{transition:visibility 0s linear}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row--collapsed{visibility:collapse;transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__cell-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__cell-inner{transition:visibility 0s linear}:host([data-styled]) .tx-table__row--collapsed .tx-table__cell-inner{transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td{transition:height var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),padding-block var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),border-bottom-width var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__grip{--tx-icon-size: var(--tx-table-grip-size);color:var(--tx-table-grip-color);transition:opacity var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__footer-cell{padding:var(--tx-table-footer-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-footer-cell-background);color:var(--tx-table-footer-cell-color);font-weight:var(--tx-table-footer-cell-font-weight)}:host([data-styled]) .tx-table__cell--frozen{background:var(--tx-table-row-background);box-shadow:var(--tx-table-frozen-column-shadow)}:host([data-styled]) .tx-table__th.tx-table__cell--frozen{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__cell--frozen-last{border-inline-end:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__cell--frozen-first-end{border-inline-start:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__row .tx-table__cell--frozen{background:inherit}:host([data-styled]) .tx-table__row--selected{background:var(--tx-table-row-selected-background);color:var(--tx-table-row-selected-color)}:host([data-styled]) .tx-table__row--selected>.tx-table__td{border-block-end-color:var(--tx-table-body-cell-selected-border-color)}:host([data-styled]) .tx-table__row--menu>.tx-table__td{background:var(--tx-table-row-menu-background)}:host([data-styled]) .tx-table__row:focus-visible{outline:var(--tx-table-row-focus-ring-width) var(--tx-table-row-focus-ring-style) var(--tx-table-row-focus-ring-color);outline-offset:var(--tx-table-row-focus-ring-offset)}:host([data-styled]) .tx-table__row-handle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-radius-xs);color:var(--tx-table-grip-color)}:host([data-styled]) .tx-table__row-handle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__row.cdk-drag-preview{box-shadow:var(--tx-table-drag-preview-shadow);background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__row.cdk-drag-placeholder{opacity:.4}:host([data-styled]) .tx-table__group-cell{padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-group-background);font-weight:var(--tx-table-group-font-weight)}:host([data-styled]) .tx-table__group-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__group-count{color:var(--tx-text-muted);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__frozen-tbody .tx-table__td{background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__td--editable:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) .tx-table__td--editing{padding-block:var(--tx-table-editor-padding-block)}:host([data-styled]) .tx-table__row-editor{gap:var(--tx-table-actions-gap)}:host([data-styled]) .tx-table__row-toggle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-table-row-toggle-button-border-radius);color:var(--tx-table-row-toggle-button-color);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__row-toggle:hover{background:var(--tx-table-row-toggle-button-hover-background);color:var(--tx-table-row-toggle-button-hover-color)}:host([data-styled]) .tx-table__row-toggle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__loading{background:var(--tx-table-loading-background);-webkit-backdrop-filter:blur(var(--tx-table-loading-blur));backdrop-filter:blur(var(--tx-table-loading-blur))}:host([data-styled]) .tx-table__empty{padding:var(--tx-table-empty-padding);border:1px solid var(--tx-table-border-color);border-top:0;color:var(--tx-table-empty-color)}:host([data-styled]) .tx-table__paginator{margin-top:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__paginator--top{margin-top:0;margin-bottom:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__select-all{margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--tx-table-card-min-width)),1fr));gap:var(--tx-table-card-gap)}:host([data-styled]) .tx-table__card{border-radius:var(--tx-table-card-border-radius);background:var(--tx-table-card-background);box-shadow:inset 0 0 0 1px var(--tx-table-card-border-color)}:host([data-styled]) .tx-table__card--selected{box-shadow:inset 0 0 0 1px var(--tx-table-row-focus-ring-color)}:host([data-styled]) .tx-table__card-field{gap:var(--tx-table-card-field-gap);padding:var(--tx-table-card-field-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-field-font-size)}:host([data-styled]) .tx-table__card-field:last-child{border-bottom:0}:host([data-styled]) .tx-table__card-label{color:var(--tx-table-card-label-color);font-size:var(--tx-table-card-label-font-size)}:host([data-styled]) .tx-table__card-title{padding:var(--tx-table-card-title-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-title-font-size);font-weight:var(--tx-table-card-title-font-weight)}:host([data-styled]) .tx-table__card-title--select{padding-inline-end:calc(var(--tx-table-card-select-inset) * 4)}:host([data-styled]) .tx-table__card-select{inset-block-start:var(--tx-table-card-select-inset);inset-inline-end:var(--tx-table-card-select-inset)}:host([data-styled]) .tx-table__card-actions{gap:var(--tx-table-actions-gap);padding:var(--tx-table-card-actions-padding)}:host([data-styled].tx-table--gridlines) .tx-table__th{border-width:1px 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__th:last-child{border-width:1px}:host([data-styled].tx-table--gridlines) .tx-table__thead>tr:not(:first-child)>.tx-table__th{border-top-width:0}:host([data-styled].tx-table--gridlines) .tx-table__td,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell{border-width:0 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__td:last-child,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell:last-child{border-width:0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__expansion-cell,:host([data-styled].tx-table--gridlines) .tx-table__group-cell{border-width:0 1px 1px}:host([data-styled].tx-table--striped) .tx-table__row--odd:not(.tx-table__row--selected){background:var(--tx-table-row-striped-background)}:host([data-styled].tx-table--hoverable) .tx-table__row:not(.tx-table__row--selected):hover{background:var(--tx-table-row-hover-background)}:host([data-styled][data-size=small]) .tx-table__th{padding:var(--tx-table-header-cell-sm-padding)}:host([data-styled][data-size=small]) .tx-table__td{height:var(--tx-table-body-cell-sm-height);padding:var(--tx-table-body-cell-sm-padding)}:host([data-styled][data-size=large]) .tx-table__th{padding:var(--tx-table-header-cell-lg-padding)}:host([data-styled][data-size=large]) .tx-table__td{height:var(--tx-table-body-cell-lg-height);padding:var(--tx-table-body-cell-lg-padding)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__th,:host([data-styled]) .tx-table__row,:host([data-styled]) .tx-table__sort-icon,:host([data-styled]) .tx-table__resizer-line,:host([data-styled]) .tx-table__row-toggle,:host([data-styled]) .tx-table__row-toggle-icon,:host([data-styled]) .tx-table__grip,:host([data-styled]) .tx-table__expansion-body,:host([data-styled]) .tx-table__cell-body,:host([data-styled]) .tx-table__cell-inner,:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td,:host([data-styled]) .tx-table__expansion-inner{transition:none}}\n"],
|
|
4439
|
+
template: "@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() || treeCheckbox() ? selectionMode() !== 'single' : null\"\n [attr.role]=\"isTree ? 'treegrid' : rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (treeCheckbox() && item.column.field === treeField()) {\n <tx-checkbox\n binary\n class=\"tx-table__select tx-table__tree-select-all\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n }\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.aria-level]=\"item.tree?.level ?? null\"\n [attr.aria-expanded]=\"item.tree && !item.tree.leaf ? item.tree.expanded : null\"\n [attr.aria-setsize]=\"item.tree?.setSize ?? null\"\n [attr.aria-posinset]=\"item.tree?.posInSet ?? null\"\n [attr.aria-busy]=\"item.tree?.loading || null\"\n [attr.tabindex]=\"rowsFocusable() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"isCollapsedRow(item)\"\n [attr.inert]=\"isCollapsedRow(item) ? '' : null\"\n [attr.aria-hidden]=\"isCollapsedRow(item) ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), row: dataOf(item.row), node: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedRows()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (item.tree && column.column.field === treeField()) {\n <div class=\"tx-table__tree-cell\" [style.--tx-table-tree-level]=\"item.tree.level - 1\">\n <button\n type=\"button\"\n class=\"tx-table__row-toggle tx-table__tree-toggle\"\n [class.tx-table__tree-toggle--hidden]=\"item.tree.leaf\"\n [attr.tabindex]=\"item.tree.leaf ? -1 : null\"\n [attr.aria-hidden]=\"item.tree.leaf || null\"\n [attr.aria-expanded]=\"item.tree.leaf ? null : item.tree.expanded\"\n [attr.aria-label]=\"item.tree.expanded ? translations().collapseRow : translations().expandRow\"\n [class]=\"passThrough().treeToggle?.class\"\n [style]=\"passThrough().treeToggle?.style\"\n (click)=\"toggleNode(item, $event)\"\n >\n @if (item.tree.loading) {\n <tx-icon aria-hidden=\"true\" name=\"spinner\" class=\"tx-table__tree-toggle-icon--loading\" />\n } @else {\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.tree.expanded\" />\n }\n </button>\n @if (treeCheckbox()) {\n <tx-checkbox\n binary\n class=\"tx-table__tree-checkbox\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n [indeterminate]=\"item.tree.partial\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n }\n <div class=\"tx-table__tree-content\">\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n }\n }\n }\n</ng-template>\n\n<ng-template #dataCell let-item let-column=\"column\">\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <input\n txInput\n type=\"date\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"dateInput(draftValue(item, column.column))\"\n (change)=\"setDraft(item, column.column, parseDateInput($any($event.target).value))\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataOf(item.row),\n row: dataOf(item.row),\n node: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n</ng-template>\n",
|
|
4440
|
+
styles: [":host{display:block;min-width:0}.tx-table__toolbar{display:flex;align-items:center;justify-content:space-between}.tx-table__toolbar-slot{flex:1;min-width:0}.tx-table__frame{position:relative}.tx-table__scroller{position:relative;overflow:auto}.tx-table__scroller--empty{overflow:hidden}.tx-table__table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0}.tx-table__thead{position:sticky;inset-block-start:0;z-index:2}.tx-table__th,.tx-table__td,.tx-table__footer-cell{box-sizing:border-box;overflow:hidden;text-align:start;vertical-align:middle}.tx-table__th{position:relative;white-space:nowrap;text-overflow:ellipsis}.tx-table__td{white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}[data-align=center]{text-align:center}[data-align=end]{text-align:end}.tx-table__cell--frozen{position:sticky;z-index:1}.tx-table__sort{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}.tx-table__header-content{display:flex;align-items:center;min-width:0}.tx-table__header-content>.tx-table__sort,.tx-table__header-content>.tx-table__column-title{min-width:0}.tx-table__filter{flex-shrink:0;margin-inline-start:auto}.tx-table__filter-cell{overflow:visible}.tx-table__column-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__sort-icon{flex-shrink:0}.tx-table__sort-icon--desc{transform:rotate(180deg)}.tx-table__sort-badge{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tx-table__resizer{position:absolute;inset-block:0;inset-inline-end:-5px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.tx-table__resizer:before{content:\"\";position:absolute;inset-block:0;inset-inline-start:-2px;width:14px}.tx-table__resizer-line{height:100%}.tx-table__th--draggable{cursor:grab}.tx-table__th--draggable:active{cursor:grabbing}.tx-table__row--selectable{cursor:pointer}.tx-table__row-toggle{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin:0;padding:0;border:0;background:transparent;cursor:pointer}.tx-table__row-toggle-icon:dir(rtl){transform:scaleX(-1)}.tx-table__row-toggle-icon--open,.tx-table__row-toggle-icon--open:dir(rtl){transform:rotate(90deg)}.tx-table__expansion-body{display:grid;grid-template-rows:0fr}.tx-table__expansion-body--open{grid-template-rows:1fr}.tx-table__expansion-inner{min-height:0;overflow:hidden}.tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{visibility:hidden}.tx-table__grip{position:absolute;inset-block-start:50%;inset-inline-start:1px;opacity:0;transform:translateY(-50%);pointer-events:none}.tx-table__th--draggable:hover .tx-table__grip,.tx-table__th--draggable:focus-within .tx-table__grip{opacity:1}.tx-table__select{display:inline-flex;vertical-align:middle}.tx-table__editor{display:flex;align-items:center;min-width:0}.tx-table__editor-control{flex:1;width:100%;min-width:0}.tx-table__row-editor{display:flex;align-items:center;justify-content:center}.tx-table__td--editable{cursor:text}.tx-table__td--editing{overflow:visible;text-overflow:clip}.tx-table__cell-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__spacer>td{padding:0;border:0}.tx-table__cell-body{display:grid;grid-template-rows:1fr}.tx-table__cell-inner{min-height:0;overflow:hidden;text-overflow:ellipsis}.tx-table__row--collapsed .tx-table__cell-body{grid-template-rows:0fr}.tx-table__row--collapsed .tx-table__cell-inner{visibility:hidden}.tx-table__frozen-tbody{position:sticky;z-index:2}.tx-table__row-handle{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:grab;touch-action:none}.tx-table__tbody.cdk-drop-list-dragging .tx-table__row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.tx-table__row.cdk-drag-preview{display:table-row}.tx-table__group-content{display:flex;align-items:center}.tx-table__loading{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center}.tx-table__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.tx-table__cards{display:grid}.tx-table__card{position:relative;display:flex;flex-direction:column;min-width:0}.tx-table__card-field,.tx-table__card-title{display:flex;align-items:center;min-width:0;overflow-wrap:break-word}.tx-table__card-field{text-align:end}.tx-table__card-label{flex-shrink:0;max-width:45%;margin-inline-end:auto;text-align:start}.tx-table__card-value{min-width:0}.tx-table__card-select{position:absolute;z-index:1}.tx-table__card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;order:99;margin-top:auto}.tx-table--resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.tx-table--resizing *{cursor:col-resize}.tx-table__tree-cell{display:flex;align-items:center;min-width:0}.tx-table__tree-content{min-width:0;overflow:hidden;text-overflow:ellipsis}.tx-table__tree-toggle{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.tx-table__tree-toggle--hidden{visibility:hidden}.tx-table__tree-select-all{margin-inline-end:var(--tx-tree-table-node-gap)}:host([data-styled]){color:var(--tx-table-color);font-size:var(--tx-table-font-size);line-height:var(--tx-table-line-height)}:host([data-styled]) .tx-table__toolbar{gap:var(--tx-table-toolbar-gap);margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__scroller{padding-bottom:var(--tx-table-scroller-padding-bottom);scrollbar-color:var(--tx-table-scroller-scrollbar-thumb) transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar{width:var(--tx-table-scroller-scrollbar-size);height:var(--tx-table-scroller-scrollbar-size)}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-track,:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-corner{background:transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background-color:var(--tx-table-scroller-scrollbar-thumb);background-clip:padding-box}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--tx-table-scroller-scrollbar-thumb-hover)}:host([data-styled]) .tx-table__scroller--empty{padding-bottom:0}:host([data-styled]) .tx-table__thead{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__th{padding:var(--tx-table-header-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-header-cell-background);color:var(--tx-table-header-cell-color);font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__header-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__filter{margin-block:calc(var(--tx-table-filter-button-inset) * -1)}:host([data-styled]) .tx-table__filter-cell{padding:var(--tx-table-filter-cell-padding);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__sort{gap:var(--tx-table-header-cell-gap);border-radius:var(--tx-radius-xs)}:host([data-styled]) .tx-table__sort:focus-visible{outline:var(--tx-table-header-cell-focus-ring-width) var(--tx-table-header-cell-focus-ring-style) var(--tx-table-header-cell-focus-ring-color);outline-offset:var(--tx-table-header-cell-focus-ring-offset);box-shadow:var(--tx-table-header-cell-focus-ring-shadow)}:host([data-styled]) .tx-table__sort-icon{--tx-icon-size: var(--tx-table-sort-icon-size);color:var(--tx-table-sort-icon-color);transition:transform .3s ease}:host([data-styled]) .tx-table__sort-badge{min-width:var(--tx-table-sort-icon-badge-size);height:var(--tx-table-sort-icon-badge-size);border-radius:999px;background:var(--tx-table-sort-icon-badge-background);color:var(--tx-table-sort-icon-badge-color);font-size:var(--tx-table-sort-icon-badge-font-size)}:host([data-styled]) .tx-table__resizer{width:var(--tx-table-column-resizer-width)}:host([data-styled]) .tx-table__resizer-line{width:var(--tx-table-column-resizer-line-width);background-color:transparent;transition:background-color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__resizer:hover .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer--active .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer:focus-visible .tx-table__resizer-line{background-color:var(--tx-table-column-resizer-color)}:host([data-styled]) .tx-table__resizer:focus-visible{outline:none}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging{background:var(--tx-table-drop-point-background)}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging .tx-table__th:hover{background:var(--tx-table-drop-point-hover-background)}:host([data-styled]) .tx-table__th.cdk-drag-placeholder{opacity:.6}:host([data-styled]) .tx-table__row{background:var(--tx-table-row-background);color:var(--tx-table-row-color);outline-color:transparent;transition:background var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__td{height:var(--tx-table-body-cell-height);padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px}:host([data-styled]) .tx-table__expansion-cell{padding:0;border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__expansion-content{padding:var(--tx-table-body-cell-padding)}:host([data-styled]) .tx-table__expansion-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{transition:visibility 0s linear var(--tx-table-expansion-duration)}@starting-style{:host([data-styled]) .tx-table__expansion-body--open{grid-template-rows:0fr}}:host([data-styled]) .tx-table__row-toggle-icon{transition:transform var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__row--collapsed>.tx-table__td{height:0;padding-block:0;border-bottom-width:0}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row{transition:visibility 0s linear}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row--collapsed{visibility:collapse;transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__cell-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__cell-inner{transition:visibility 0s linear}:host([data-styled]) .tx-table__row--collapsed .tx-table__cell-inner{transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td{transition:height var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),padding-block var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),border-bottom-width var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__grip{--tx-icon-size: var(--tx-table-grip-size);color:var(--tx-table-grip-color);transition:opacity var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__footer-cell{padding:var(--tx-table-footer-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-footer-cell-background);color:var(--tx-table-footer-cell-color);font-weight:var(--tx-table-footer-cell-font-weight)}:host([data-styled]) .tx-table__cell--frozen{background:var(--tx-table-row-background);box-shadow:var(--tx-table-frozen-column-shadow)}:host([data-styled]) .tx-table__th.tx-table__cell--frozen{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__cell--frozen-last{border-inline-end:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__cell--frozen-first-end{border-inline-start:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__row .tx-table__cell--frozen{background:inherit}:host([data-styled]) .tx-table__row--selected{background:var(--tx-table-row-selected-background);color:var(--tx-table-row-selected-color)}:host([data-styled]) .tx-table__row--selected>.tx-table__td{border-block-end-color:var(--tx-table-body-cell-selected-border-color)}:host([data-styled]) .tx-table__row--menu>.tx-table__td{background:var(--tx-table-row-menu-background)}:host([data-styled]) .tx-table__row:focus-visible{outline:var(--tx-table-row-focus-ring-width) var(--tx-table-row-focus-ring-style) var(--tx-table-row-focus-ring-color);outline-offset:var(--tx-table-row-focus-ring-offset);box-shadow:var(--tx-table-row-focus-ring-shadow)}:host([data-styled]) .tx-table__row-handle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-radius-xs);color:var(--tx-table-grip-color)}:host([data-styled]) .tx-table__row-handle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__row.cdk-drag-preview{box-shadow:var(--tx-table-drag-preview-shadow);background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__row.cdk-drag-placeholder{opacity:.4}:host([data-styled]) .tx-table__group-cell{padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-group-background);font-weight:var(--tx-table-group-font-weight)}:host([data-styled]) .tx-table__group-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__group-count{color:var(--tx-text-muted);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__frozen-tbody .tx-table__td{background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__td--editable:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) .tx-table__td--editing{padding-block:var(--tx-table-editor-padding-block)}:host([data-styled]) .tx-table__row-editor{gap:var(--tx-table-actions-gap)}:host([data-styled]) .tx-table__row-toggle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-table-row-toggle-button-border-radius);color:var(--tx-table-row-toggle-button-color);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__row-toggle:hover{background:var(--tx-table-row-toggle-button-hover-background);color:var(--tx-table-row-toggle-button-hover-color)}:host([data-styled]) .tx-table__row-toggle:focus-visible{outline:var(--tx-table-row-toggle-button-focus-ring-width) var(--tx-table-row-toggle-button-focus-ring-style) var(--tx-table-row-toggle-button-focus-ring-color);outline-offset:var(--tx-table-row-toggle-button-focus-ring-offset);box-shadow:var(--tx-table-row-toggle-button-focus-ring-shadow)}:host([data-styled]) .tx-table__tree-cell{gap:var(--tx-tree-table-node-gap);padding-inline-start:calc(var(--tx-table-tree-level, 0) * var(--tx-tree-table-node-indent))}:host([data-styled]) .tx-table__tree-toggle-icon--loading{animation:tx-table-tree-spin .8s linear infinite}:host([data-styled]) .tx-table__loading{background:var(--tx-table-loading-background);-webkit-backdrop-filter:blur(var(--tx-table-loading-blur));backdrop-filter:blur(var(--tx-table-loading-blur))}:host([data-styled]) .tx-table__empty{padding:var(--tx-table-empty-padding);border:1px solid var(--tx-table-border-color);border-top:0;color:var(--tx-table-empty-color)}:host([data-styled]) .tx-table__paginator{margin-top:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__paginator--top{margin-top:0;margin-bottom:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__select-all{margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--tx-table-card-min-width)),1fr));gap:var(--tx-table-card-gap)}:host([data-styled]) .tx-table__card{border-radius:var(--tx-table-card-border-radius);background:var(--tx-table-card-background);box-shadow:inset 0 0 0 1px var(--tx-table-card-border-color)}:host([data-styled]) .tx-table__card--selected{box-shadow:inset 0 0 0 1px var(--tx-table-row-focus-ring-color)}:host([data-styled]) .tx-table__card-field{gap:var(--tx-table-card-field-gap);padding:var(--tx-table-card-field-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-field-font-size)}:host([data-styled]) .tx-table__card-field:last-child{border-bottom:0}:host([data-styled]) .tx-table__card-label{color:var(--tx-table-card-label-color);font-size:var(--tx-table-card-label-font-size)}:host([data-styled]) .tx-table__card-title{padding:var(--tx-table-card-title-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-title-font-size);font-weight:var(--tx-table-card-title-font-weight)}:host([data-styled]) .tx-table__card-title--select{padding-inline-end:calc(var(--tx-table-card-select-inset) * 4)}:host([data-styled]) .tx-table__card-select{inset-block-start:var(--tx-table-card-select-inset);inset-inline-end:var(--tx-table-card-select-inset)}:host([data-styled]) .tx-table__card-actions{gap:var(--tx-table-actions-gap);padding:var(--tx-table-card-actions-padding)}:host([data-styled].tx-table--gridlines) .tx-table__th{border-width:1px 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__th:last-child{border-width:1px}:host([data-styled].tx-table--gridlines) .tx-table__thead>tr:not(:first-child)>.tx-table__th{border-top-width:0}:host([data-styled].tx-table--gridlines) .tx-table__td,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell{border-width:0 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__td:last-child,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell:last-child{border-width:0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__expansion-cell,:host([data-styled].tx-table--gridlines) .tx-table__group-cell{border-width:0 1px 1px}:host([data-styled].tx-table--striped) .tx-table__row--odd:not(.tx-table__row--selected){background:var(--tx-table-row-striped-background)}:host([data-styled].tx-table--hoverable) .tx-table__row:not(.tx-table__row--selected):hover{background:var(--tx-table-row-hover-background)}:host([data-styled][data-size=small]) .tx-table__th{padding:var(--tx-table-header-cell-sm-padding)}:host([data-styled][data-size=small]) .tx-table__td{height:var(--tx-table-body-cell-sm-height);padding:var(--tx-table-body-cell-sm-padding)}:host([data-styled][data-size=large]) .tx-table__th{padding:var(--tx-table-header-cell-lg-padding)}:host([data-styled][data-size=large]) .tx-table__td{height:var(--tx-table-body-cell-lg-height);padding:var(--tx-table-body-cell-lg-padding)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__th,:host([data-styled]) .tx-table__row,:host([data-styled]) .tx-table__sort-icon,:host([data-styled]) .tx-table__resizer-line,:host([data-styled]) .tx-table__row-toggle,:host([data-styled]) .tx-table__row-toggle-icon,:host([data-styled]) .tx-table__grip,:host([data-styled]) .tx-table__expansion-body,:host([data-styled]) .tx-table__cell-body,:host([data-styled]) .tx-table__cell-inner,:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td,:host([data-styled]) .tx-table__expansion-inner{transition:none}}@keyframes tx-table-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__tree-toggle-icon--loading{animation-duration:2.4s}}\n"],
|
|
4400
4441
|
dependencies: [
|
|
4401
4442
|
{
|
|
4402
4443
|
kind: "directive",
|
|
4403
|
-
type: NgTemplateOutlet,
|
|
4444
|
+
type: i1.NgTemplateOutlet,
|
|
4404
4445
|
selector: "[ngTemplateOutlet]",
|
|
4405
4446
|
inputs: [
|
|
4406
4447
|
"ngTemplateOutletContext",
|
|
@@ -4410,16 +4451,16 @@ var TxTable = class TxTable {
|
|
|
4410
4451
|
},
|
|
4411
4452
|
{
|
|
4412
4453
|
kind: "ngmodule",
|
|
4413
|
-
type: FormsModule
|
|
4454
|
+
type: i1$1.FormsModule
|
|
4414
4455
|
},
|
|
4415
4456
|
{
|
|
4416
4457
|
kind: "directive",
|
|
4417
|
-
type: i1.NgControlStatus,
|
|
4458
|
+
type: i1$1.NgControlStatus,
|
|
4418
4459
|
selector: "[formControlName],[ngModel],[formControl]"
|
|
4419
4460
|
},
|
|
4420
4461
|
{
|
|
4421
4462
|
kind: "directive",
|
|
4422
|
-
type: i1.NgModel,
|
|
4463
|
+
type: i1$1.NgModel,
|
|
4423
4464
|
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
4424
4465
|
inputs: [
|
|
4425
4466
|
"name",
|
|
@@ -4432,7 +4473,7 @@ var TxTable = class TxTable {
|
|
|
4432
4473
|
},
|
|
4433
4474
|
{
|
|
4434
4475
|
kind: "directive",
|
|
4435
|
-
type: CdkDropList,
|
|
4476
|
+
type: i3.CdkDropList,
|
|
4436
4477
|
selector: "[cdkDropList], cdk-drop-list",
|
|
4437
4478
|
inputs: [
|
|
4438
4479
|
"cdkDropListConnectedTo",
|
|
@@ -4459,7 +4500,7 @@ var TxTable = class TxTable {
|
|
|
4459
4500
|
},
|
|
4460
4501
|
{
|
|
4461
4502
|
kind: "directive",
|
|
4462
|
-
type: CdkDrag,
|
|
4503
|
+
type: i3.CdkDrag,
|
|
4463
4504
|
selector: "[cdkDrag]",
|
|
4464
4505
|
inputs: [
|
|
4465
4506
|
"cdkDragData",
|
|
@@ -4487,19 +4528,19 @@ var TxTable = class TxTable {
|
|
|
4487
4528
|
},
|
|
4488
4529
|
{
|
|
4489
4530
|
kind: "directive",
|
|
4490
|
-
type: CdkDragHandle,
|
|
4531
|
+
type: i3.CdkDragHandle,
|
|
4491
4532
|
selector: "[cdkDragHandle]",
|
|
4492
4533
|
inputs: ["cdkDragHandleDisabled"]
|
|
4493
4534
|
},
|
|
4494
4535
|
{
|
|
4495
4536
|
kind: "component",
|
|
4496
|
-
type: TxIcon,
|
|
4537
|
+
type: i4.TxIcon,
|
|
4497
4538
|
selector: "tx-icon",
|
|
4498
4539
|
inputs: ["name"]
|
|
4499
4540
|
},
|
|
4500
4541
|
{
|
|
4501
4542
|
kind: "directive",
|
|
4502
|
-
type: TxTooltip,
|
|
4543
|
+
type: i5.TxTooltip,
|
|
4503
4544
|
selector: "[txTooltip]",
|
|
4504
4545
|
inputs: [
|
|
4505
4546
|
"txTooltip",
|
|
@@ -4526,7 +4567,7 @@ var TxTable = class TxTable {
|
|
|
4526
4567
|
},
|
|
4527
4568
|
{
|
|
4528
4569
|
kind: "component",
|
|
4529
|
-
type: TxSkeleton,
|
|
4570
|
+
type: i6.TxSkeleton,
|
|
4530
4571
|
selector: "tx-skeleton",
|
|
4531
4572
|
inputs: [
|
|
4532
4573
|
"shape",
|
|
@@ -4544,7 +4585,7 @@ var TxTable = class TxTable {
|
|
|
4544
4585
|
},
|
|
4545
4586
|
{
|
|
4546
4587
|
kind: "component",
|
|
4547
|
-
type: TxButton,
|
|
4588
|
+
type: i7.TxButton,
|
|
4548
4589
|
selector: "button[txButton], a[txButton]",
|
|
4549
4590
|
inputs: [
|
|
4550
4591
|
"label",
|
|
@@ -4575,7 +4616,7 @@ var TxTable = class TxTable {
|
|
|
4575
4616
|
},
|
|
4576
4617
|
{
|
|
4577
4618
|
kind: "component",
|
|
4578
|
-
type: TxCheckbox,
|
|
4619
|
+
type: i8.TxCheckbox,
|
|
4579
4620
|
selector: "tx-checkbox",
|
|
4580
4621
|
inputs: [
|
|
4581
4622
|
"label",
|
|
@@ -4608,7 +4649,7 @@ var TxTable = class TxTable {
|
|
|
4608
4649
|
},
|
|
4609
4650
|
{
|
|
4610
4651
|
kind: "directive",
|
|
4611
|
-
type: TxInput,
|
|
4652
|
+
type: i9.TxInput,
|
|
4612
4653
|
selector: "input[txInput], textarea[txInput]",
|
|
4613
4654
|
inputs: [
|
|
4614
4655
|
"invalid",
|
|
@@ -4623,7 +4664,7 @@ var TxTable = class TxTable {
|
|
|
4623
4664
|
},
|
|
4624
4665
|
{
|
|
4625
4666
|
kind: "component",
|
|
4626
|
-
type: TxInputNumber,
|
|
4667
|
+
type: i10.TxInputNumber,
|
|
4627
4668
|
selector: "tx-input-number",
|
|
4628
4669
|
inputs: [
|
|
4629
4670
|
"mode",
|
|
@@ -4666,7 +4707,7 @@ var TxTable = class TxTable {
|
|
|
4666
4707
|
},
|
|
4667
4708
|
{
|
|
4668
4709
|
kind: "component",
|
|
4669
|
-
type: TxSelect,
|
|
4710
|
+
type: i11.TxSelect,
|
|
4670
4711
|
selector: "tx-select",
|
|
4671
4712
|
inputs: [
|
|
4672
4713
|
"options",
|
|
@@ -4682,7 +4723,7 @@ var TxTable = class TxTable {
|
|
|
4682
4723
|
},
|
|
4683
4724
|
{
|
|
4684
4725
|
kind: "component",
|
|
4685
|
-
type: TxRadioButton,
|
|
4726
|
+
type: i12.TxRadioButton,
|
|
4686
4727
|
selector: "tx-radio-button",
|
|
4687
4728
|
inputs: [
|
|
4688
4729
|
"value",
|
|
@@ -4709,7 +4750,7 @@ var TxTable = class TxTable {
|
|
|
4709
4750
|
},
|
|
4710
4751
|
{
|
|
4711
4752
|
kind: "component",
|
|
4712
|
-
type: TxPaginator,
|
|
4753
|
+
type: i13.TxPaginator,
|
|
4713
4754
|
selector: "tx-paginator",
|
|
4714
4755
|
inputs: [
|
|
4715
4756
|
"first",
|
|
@@ -4748,7 +4789,7 @@ var TxTable = class TxTable {
|
|
|
4748
4789
|
},
|
|
4749
4790
|
{
|
|
4750
4791
|
kind: "component",
|
|
4751
|
-
type: TxProgressSpinner,
|
|
4792
|
+
type: i14.TxProgressSpinner,
|
|
4752
4793
|
selector: "tx-progress-spinner",
|
|
4753
4794
|
inputs: [
|
|
4754
4795
|
"size",
|
|
@@ -4765,7 +4806,7 @@ var TxTable = class TxTable {
|
|
|
4765
4806
|
},
|
|
4766
4807
|
{
|
|
4767
4808
|
kind: "component",
|
|
4768
|
-
type: TxMenu,
|
|
4809
|
+
type: i15.TxMenu,
|
|
4769
4810
|
selector: "tx-menu, tx-tiered-menu",
|
|
4770
4811
|
inputs: [
|
|
4771
4812
|
"model",
|
|
@@ -4789,7 +4830,7 @@ var TxTable = class TxTable {
|
|
|
4789
4830
|
},
|
|
4790
4831
|
{
|
|
4791
4832
|
kind: "directive",
|
|
4792
|
-
type: TxMenuItemTemplate,
|
|
4833
|
+
type: i15.TxMenuItemTemplate,
|
|
4793
4834
|
selector: "ng-template[txMenuItem]"
|
|
4794
4835
|
},
|
|
4795
4836
|
{
|
|
@@ -4824,28 +4865,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4824
4865
|
type: Component,
|
|
4825
4866
|
args: [{
|
|
4826
4867
|
selector: "tx-table",
|
|
4827
|
-
imports:
|
|
4828
|
-
NgTemplateOutlet,
|
|
4829
|
-
FormsModule,
|
|
4830
|
-
CdkDropList,
|
|
4831
|
-
CdkDrag,
|
|
4832
|
-
CdkDragHandle,
|
|
4833
|
-
TxIcon,
|
|
4834
|
-
TxTooltip,
|
|
4835
|
-
TxSkeleton,
|
|
4836
|
-
TxButton,
|
|
4837
|
-
TxCheckbox,
|
|
4838
|
-
TxInput,
|
|
4839
|
-
TxInputNumber,
|
|
4840
|
-
TxSelect,
|
|
4841
|
-
TxRadioButton,
|
|
4842
|
-
TxPaginator,
|
|
4843
|
-
TxProgressSpinner,
|
|
4844
|
-
TxMenu,
|
|
4845
|
-
TxMenuItemTemplate,
|
|
4846
|
-
TxTableSettings,
|
|
4847
|
-
TxTableColumnFilter
|
|
4848
|
-
],
|
|
4868
|
+
imports: TX_TABLE_IMPORTS,
|
|
4849
4869
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4850
4870
|
providers: [TxTableActionsStore, {
|
|
4851
4871
|
provide: TX_TABLE,
|
|
@@ -4864,8 +4884,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4864
4884
|
"[class.tx-table--resizing]": "resizing() !== null",
|
|
4865
4885
|
"[class.tx-table--loading]": "loading()"
|
|
4866
4886
|
},
|
|
4867
|
-
template: "@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() ? selectionMode() === 'multiple' : null\"\n [attr.role]=\"rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.tabindex]=\"rowSelection() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"!!item.group?.collapsed\"\n [attr.inert]=\"item.group?.collapsed ? '' : null\"\n [attr.aria-hidden]=\"item.group?.collapsed ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: item.row, row: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedGroups()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <input\n txInput\n type=\"date\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"dateInput(draftValue(item, column.column))\"\n (change)=\"setDraft(item, column.column, parseDateInput($any($event.target).value))\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: item.row,\n row: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n }\n }\n</ng-template>\n",
|
|
4868
|
-
styles: [":host{display:block;min-width:0}.tx-table__toolbar{display:flex;align-items:center;justify-content:space-between}.tx-table__toolbar-slot{flex:1;min-width:0}.tx-table__frame{position:relative}.tx-table__scroller{position:relative;overflow:auto}.tx-table__scroller--empty{overflow:hidden}.tx-table__table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0}.tx-table__thead{position:sticky;inset-block-start:0;z-index:2}.tx-table__th,.tx-table__td,.tx-table__footer-cell{box-sizing:border-box;overflow:hidden;text-align:start;vertical-align:middle}.tx-table__th{position:relative;white-space:nowrap;text-overflow:ellipsis}.tx-table__td{white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}[data-align=center]{text-align:center}[data-align=end]{text-align:end}.tx-table__cell--frozen{position:sticky;z-index:1}.tx-table__sort{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}.tx-table__header-content{display:flex;align-items:center;min-width:0}.tx-table__header-content>.tx-table__sort,.tx-table__header-content>.tx-table__column-title{min-width:0}.tx-table__filter{flex-shrink:0;margin-inline-start:auto}.tx-table__filter-cell{overflow:visible}.tx-table__column-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__sort-icon{flex-shrink:0}.tx-table__sort-icon--desc{transform:rotate(180deg)}.tx-table__sort-badge{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tx-table__resizer{position:absolute;inset-block:0;inset-inline-end:-5px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.tx-table__resizer:before{content:\"\";position:absolute;inset-block:0;inset-inline-start:-2px;width:14px}.tx-table__resizer-line{height:100%}.tx-table__th--draggable{cursor:grab}.tx-table__th--draggable:active{cursor:grabbing}.tx-table__row--selectable{cursor:pointer}.tx-table__row-toggle{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin:0;padding:0;border:0;background:transparent;cursor:pointer}.tx-table__row-toggle-icon:dir(rtl){transform:scaleX(-1)}.tx-table__row-toggle-icon--open,.tx-table__row-toggle-icon--open:dir(rtl){transform:rotate(90deg)}.tx-table__expansion-body{display:grid;grid-template-rows:0fr}.tx-table__expansion-body--open{grid-template-rows:1fr}.tx-table__expansion-inner{min-height:0;overflow:hidden}.tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{visibility:hidden}.tx-table__grip{position:absolute;inset-block-start:50%;inset-inline-start:1px;opacity:0;transform:translateY(-50%);pointer-events:none}.tx-table__th--draggable:hover .tx-table__grip,.tx-table__th--draggable:focus-within .tx-table__grip{opacity:1}.tx-table__select{display:inline-flex;vertical-align:middle}.tx-table__editor{display:flex;align-items:center;min-width:0}.tx-table__editor-control{flex:1;width:100%;min-width:0}.tx-table__row-editor{display:flex;align-items:center;justify-content:center}.tx-table__td--editable{cursor:text}.tx-table__td--editing{overflow:visible;text-overflow:clip}.tx-table__cell-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__spacer>td{padding:0;border:0}.tx-table__cell-body{display:grid;grid-template-rows:1fr}.tx-table__cell-inner{min-height:0;overflow:hidden;text-overflow:ellipsis}.tx-table__row--collapsed .tx-table__cell-body{grid-template-rows:0fr}.tx-table__row--collapsed .tx-table__cell-inner{visibility:hidden}.tx-table__frozen-tbody{position:sticky;z-index:2}.tx-table__row-handle{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:grab;touch-action:none}.tx-table__tbody.cdk-drop-list-dragging .tx-table__row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.tx-table__row.cdk-drag-preview{display:table-row}.tx-table__group-content{display:flex;align-items:center}.tx-table__loading{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center}.tx-table__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.tx-table__cards{display:grid}.tx-table__card{position:relative;display:flex;flex-direction:column;min-width:0}.tx-table__card-field,.tx-table__card-title{display:flex;align-items:center;min-width:0;overflow-wrap:break-word}.tx-table__card-field{text-align:end}.tx-table__card-label{flex-shrink:0;max-width:45%;margin-inline-end:auto;text-align:start}.tx-table__card-value{min-width:0}.tx-table__card-select{position:absolute;z-index:1}.tx-table__card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;order:99;margin-top:auto}.tx-table--resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.tx-table--resizing *{cursor:col-resize}:host([data-styled]){color:var(--tx-table-color);font-size:var(--tx-table-font-size);line-height:var(--tx-table-line-height)}:host([data-styled]) .tx-table__toolbar{gap:var(--tx-table-toolbar-gap);margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__scroller{padding-bottom:var(--tx-table-scroller-padding-bottom);scrollbar-color:var(--tx-table-scroller-scrollbar-thumb) transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar{width:var(--tx-table-scroller-scrollbar-size);height:var(--tx-table-scroller-scrollbar-size)}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-track,:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-corner{background:transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background-color:var(--tx-table-scroller-scrollbar-thumb);background-clip:padding-box}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--tx-table-scroller-scrollbar-thumb-hover)}:host([data-styled]) .tx-table__scroller--empty{padding-bottom:0}:host([data-styled]) .tx-table__thead{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__th{padding:var(--tx-table-header-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-header-cell-background);color:var(--tx-table-header-cell-color);font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__header-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__filter{margin-block:calc(var(--tx-table-filter-button-inset) * -1)}:host([data-styled]) .tx-table__filter-cell{padding:var(--tx-table-filter-cell-padding);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__sort{gap:var(--tx-table-header-cell-gap);border-radius:var(--tx-radius-xs)}:host([data-styled]) .tx-table__sort:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__sort-icon{--tx-icon-size: var(--tx-table-sort-icon-size);color:var(--tx-table-sort-icon-color);transition:transform .3s ease}:host([data-styled]) .tx-table__sort-badge{min-width:var(--tx-table-sort-icon-badge-size);height:var(--tx-table-sort-icon-badge-size);border-radius:999px;background:var(--tx-table-sort-icon-badge-background);color:var(--tx-table-sort-icon-badge-color);font-size:var(--tx-table-sort-icon-badge-font-size)}:host([data-styled]) .tx-table__resizer{width:var(--tx-table-column-resizer-width)}:host([data-styled]) .tx-table__resizer-line{width:var(--tx-table-column-resizer-line-width);background-color:transparent;transition:background-color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__resizer:hover .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer--active .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer:focus-visible .tx-table__resizer-line{background-color:var(--tx-table-column-resizer-color)}:host([data-styled]) .tx-table__resizer:focus-visible{outline:none}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging{background:var(--tx-table-drop-point-background)}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging .tx-table__th:hover{background:var(--tx-table-drop-point-hover-background)}:host([data-styled]) .tx-table__th.cdk-drag-placeholder{opacity:.6}:host([data-styled]) .tx-table__row{background:var(--tx-table-row-background);color:var(--tx-table-row-color);outline-color:transparent;transition:background var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__td{height:var(--tx-table-body-cell-height);padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px}:host([data-styled]) .tx-table__expansion-cell{padding:0;border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__expansion-content{padding:var(--tx-table-body-cell-padding)}:host([data-styled]) .tx-table__expansion-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{transition:visibility 0s linear var(--tx-table-expansion-duration)}@starting-style{:host([data-styled]) .tx-table__expansion-body--open{grid-template-rows:0fr}}:host([data-styled]) .tx-table__row-toggle-icon{transition:transform var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__row--collapsed>.tx-table__td{height:0;padding-block:0;border-bottom-width:0}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row{transition:visibility 0s linear}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row--collapsed{visibility:collapse;transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__cell-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__cell-inner{transition:visibility 0s linear}:host([data-styled]) .tx-table__row--collapsed .tx-table__cell-inner{transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td{transition:height var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),padding-block var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),border-bottom-width var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__grip{--tx-icon-size: var(--tx-table-grip-size);color:var(--tx-table-grip-color);transition:opacity var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__footer-cell{padding:var(--tx-table-footer-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-footer-cell-background);color:var(--tx-table-footer-cell-color);font-weight:var(--tx-table-footer-cell-font-weight)}:host([data-styled]) .tx-table__cell--frozen{background:var(--tx-table-row-background);box-shadow:var(--tx-table-frozen-column-shadow)}:host([data-styled]) .tx-table__th.tx-table__cell--frozen{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__cell--frozen-last{border-inline-end:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__cell--frozen-first-end{border-inline-start:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__row .tx-table__cell--frozen{background:inherit}:host([data-styled]) .tx-table__row--selected{background:var(--tx-table-row-selected-background);color:var(--tx-table-row-selected-color)}:host([data-styled]) .tx-table__row--selected>.tx-table__td{border-block-end-color:var(--tx-table-body-cell-selected-border-color)}:host([data-styled]) .tx-table__row--menu>.tx-table__td{background:var(--tx-table-row-menu-background)}:host([data-styled]) .tx-table__row:focus-visible{outline:var(--tx-table-row-focus-ring-width) var(--tx-table-row-focus-ring-style) var(--tx-table-row-focus-ring-color);outline-offset:var(--tx-table-row-focus-ring-offset)}:host([data-styled]) .tx-table__row-handle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-radius-xs);color:var(--tx-table-grip-color)}:host([data-styled]) .tx-table__row-handle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__row.cdk-drag-preview{box-shadow:var(--tx-table-drag-preview-shadow);background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__row.cdk-drag-placeholder{opacity:.4}:host([data-styled]) .tx-table__group-cell{padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-group-background);font-weight:var(--tx-table-group-font-weight)}:host([data-styled]) .tx-table__group-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__group-count{color:var(--tx-text-muted);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__frozen-tbody .tx-table__td{background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__td--editable:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) .tx-table__td--editing{padding-block:var(--tx-table-editor-padding-block)}:host([data-styled]) .tx-table__row-editor{gap:var(--tx-table-actions-gap)}:host([data-styled]) .tx-table__row-toggle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-table-row-toggle-button-border-radius);color:var(--tx-table-row-toggle-button-color);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__row-toggle:hover{background:var(--tx-table-row-toggle-button-hover-background);color:var(--tx-table-row-toggle-button-hover-color)}:host([data-styled]) .tx-table__row-toggle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__loading{background:var(--tx-table-loading-background);-webkit-backdrop-filter:blur(var(--tx-table-loading-blur));backdrop-filter:blur(var(--tx-table-loading-blur))}:host([data-styled]) .tx-table__empty{padding:var(--tx-table-empty-padding);border:1px solid var(--tx-table-border-color);border-top:0;color:var(--tx-table-empty-color)}:host([data-styled]) .tx-table__paginator{margin-top:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__paginator--top{margin-top:0;margin-bottom:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__select-all{margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--tx-table-card-min-width)),1fr));gap:var(--tx-table-card-gap)}:host([data-styled]) .tx-table__card{border-radius:var(--tx-table-card-border-radius);background:var(--tx-table-card-background);box-shadow:inset 0 0 0 1px var(--tx-table-card-border-color)}:host([data-styled]) .tx-table__card--selected{box-shadow:inset 0 0 0 1px var(--tx-table-row-focus-ring-color)}:host([data-styled]) .tx-table__card-field{gap:var(--tx-table-card-field-gap);padding:var(--tx-table-card-field-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-field-font-size)}:host([data-styled]) .tx-table__card-field:last-child{border-bottom:0}:host([data-styled]) .tx-table__card-label{color:var(--tx-table-card-label-color);font-size:var(--tx-table-card-label-font-size)}:host([data-styled]) .tx-table__card-title{padding:var(--tx-table-card-title-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-title-font-size);font-weight:var(--tx-table-card-title-font-weight)}:host([data-styled]) .tx-table__card-title--select{padding-inline-end:calc(var(--tx-table-card-select-inset) * 4)}:host([data-styled]) .tx-table__card-select{inset-block-start:var(--tx-table-card-select-inset);inset-inline-end:var(--tx-table-card-select-inset)}:host([data-styled]) .tx-table__card-actions{gap:var(--tx-table-actions-gap);padding:var(--tx-table-card-actions-padding)}:host([data-styled].tx-table--gridlines) .tx-table__th{border-width:1px 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__th:last-child{border-width:1px}:host([data-styled].tx-table--gridlines) .tx-table__thead>tr:not(:first-child)>.tx-table__th{border-top-width:0}:host([data-styled].tx-table--gridlines) .tx-table__td,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell{border-width:0 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__td:last-child,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell:last-child{border-width:0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__expansion-cell,:host([data-styled].tx-table--gridlines) .tx-table__group-cell{border-width:0 1px 1px}:host([data-styled].tx-table--striped) .tx-table__row--odd:not(.tx-table__row--selected){background:var(--tx-table-row-striped-background)}:host([data-styled].tx-table--hoverable) .tx-table__row:not(.tx-table__row--selected):hover{background:var(--tx-table-row-hover-background)}:host([data-styled][data-size=small]) .tx-table__th{padding:var(--tx-table-header-cell-sm-padding)}:host([data-styled][data-size=small]) .tx-table__td{height:var(--tx-table-body-cell-sm-height);padding:var(--tx-table-body-cell-sm-padding)}:host([data-styled][data-size=large]) .tx-table__th{padding:var(--tx-table-header-cell-lg-padding)}:host([data-styled][data-size=large]) .tx-table__td{height:var(--tx-table-body-cell-lg-height);padding:var(--tx-table-body-cell-lg-padding)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__th,:host([data-styled]) .tx-table__row,:host([data-styled]) .tx-table__sort-icon,:host([data-styled]) .tx-table__resizer-line,:host([data-styled]) .tx-table__row-toggle,:host([data-styled]) .tx-table__row-toggle-icon,:host([data-styled]) .tx-table__grip,:host([data-styled]) .tx-table__expansion-body,:host([data-styled]) .tx-table__cell-body,:host([data-styled]) .tx-table__cell-inner,:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td,:host([data-styled]) .tx-table__expansion-inner{transition:none}}\n"]
|
|
4887
|
+
template: "@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() || treeCheckbox() ? selectionMode() !== 'single' : null\"\n [attr.role]=\"isTree ? 'treegrid' : rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (treeCheckbox() && item.column.field === treeField()) {\n <tx-checkbox\n binary\n class=\"tx-table__select tx-table__tree-select-all\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n }\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.aria-level]=\"item.tree?.level ?? null\"\n [attr.aria-expanded]=\"item.tree && !item.tree.leaf ? item.tree.expanded : null\"\n [attr.aria-setsize]=\"item.tree?.setSize ?? null\"\n [attr.aria-posinset]=\"item.tree?.posInSet ?? null\"\n [attr.aria-busy]=\"item.tree?.loading || null\"\n [attr.tabindex]=\"rowsFocusable() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"isCollapsedRow(item)\"\n [attr.inert]=\"isCollapsedRow(item) ? '' : null\"\n [attr.aria-hidden]=\"isCollapsedRow(item) ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), row: dataOf(item.row), node: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedRows()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (item.tree && column.column.field === treeField()) {\n <div class=\"tx-table__tree-cell\" [style.--tx-table-tree-level]=\"item.tree.level - 1\">\n <button\n type=\"button\"\n class=\"tx-table__row-toggle tx-table__tree-toggle\"\n [class.tx-table__tree-toggle--hidden]=\"item.tree.leaf\"\n [attr.tabindex]=\"item.tree.leaf ? -1 : null\"\n [attr.aria-hidden]=\"item.tree.leaf || null\"\n [attr.aria-expanded]=\"item.tree.leaf ? null : item.tree.expanded\"\n [attr.aria-label]=\"item.tree.expanded ? translations().collapseRow : translations().expandRow\"\n [class]=\"passThrough().treeToggle?.class\"\n [style]=\"passThrough().treeToggle?.style\"\n (click)=\"toggleNode(item, $event)\"\n >\n @if (item.tree.loading) {\n <tx-icon aria-hidden=\"true\" name=\"spinner\" class=\"tx-table__tree-toggle-icon--loading\" />\n } @else {\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.tree.expanded\" />\n }\n </button>\n @if (treeCheckbox()) {\n <tx-checkbox\n binary\n class=\"tx-table__tree-checkbox\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n [indeterminate]=\"item.tree.partial\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n }\n <div class=\"tx-table__tree-content\">\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n }\n }\n }\n</ng-template>\n\n<ng-template #dataCell let-item let-column=\"column\">\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <input\n txInput\n type=\"date\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"dateInput(draftValue(item, column.column))\"\n (change)=\"setDraft(item, column.column, parseDateInput($any($event.target).value))\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataOf(item.row),\n row: dataOf(item.row),\n node: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n</ng-template>\n",
|
|
4888
|
+
styles: [":host{display:block;min-width:0}.tx-table__toolbar{display:flex;align-items:center;justify-content:space-between}.tx-table__toolbar-slot{flex:1;min-width:0}.tx-table__frame{position:relative}.tx-table__scroller{position:relative;overflow:auto}.tx-table__scroller--empty{overflow:hidden}.tx-table__table{width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0}.tx-table__thead{position:sticky;inset-block-start:0;z-index:2}.tx-table__th,.tx-table__td,.tx-table__footer-cell{box-sizing:border-box;overflow:hidden;text-align:start;vertical-align:middle}.tx-table__th{position:relative;white-space:nowrap;text-overflow:ellipsis}.tx-table__td{white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums}[data-align=center]{text-align:center}[data-align=end]{text-align:end}.tx-table__cell--frozen{position:sticky;z-index:1}.tx-table__sort{display:inline-flex;align-items:center;max-width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}.tx-table__header-content{display:flex;align-items:center;min-width:0}.tx-table__header-content>.tx-table__sort,.tx-table__header-content>.tx-table__column-title{min-width:0}.tx-table__filter{flex-shrink:0;margin-inline-start:auto}.tx-table__filter-cell{overflow:visible}.tx-table__column-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__sort-icon{flex-shrink:0}.tx-table__sort-icon--desc{transform:rotate(180deg)}.tx-table__sort-badge{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.tx-table__resizer{position:absolute;inset-block:0;inset-inline-end:-5px;z-index:3;display:flex;align-items:center;justify-content:center;cursor:col-resize;touch-action:none}.tx-table__resizer:before{content:\"\";position:absolute;inset-block:0;inset-inline-start:-2px;width:14px}.tx-table__resizer-line{height:100%}.tx-table__th--draggable{cursor:grab}.tx-table__th--draggable:active{cursor:grabbing}.tx-table__row--selectable{cursor:pointer}.tx-table__row-toggle{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin:0;padding:0;border:0;background:transparent;cursor:pointer}.tx-table__row-toggle-icon:dir(rtl){transform:scaleX(-1)}.tx-table__row-toggle-icon--open,.tx-table__row-toggle-icon--open:dir(rtl){transform:rotate(90deg)}.tx-table__expansion-body{display:grid;grid-template-rows:0fr}.tx-table__expansion-body--open{grid-template-rows:1fr}.tx-table__expansion-inner{min-height:0;overflow:hidden}.tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{visibility:hidden}.tx-table__grip{position:absolute;inset-block-start:50%;inset-inline-start:1px;opacity:0;transform:translateY(-50%);pointer-events:none}.tx-table__th--draggable:hover .tx-table__grip,.tx-table__th--draggable:focus-within .tx-table__grip{opacity:1}.tx-table__select{display:inline-flex;vertical-align:middle}.tx-table__editor{display:flex;align-items:center;min-width:0}.tx-table__editor-control{flex:1;width:100%;min-width:0}.tx-table__row-editor{display:flex;align-items:center;justify-content:center}.tx-table__td--editable{cursor:text}.tx-table__td--editing{overflow:visible;text-overflow:clip}.tx-table__cell-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tx-table__spacer>td{padding:0;border:0}.tx-table__cell-body{display:grid;grid-template-rows:1fr}.tx-table__cell-inner{min-height:0;overflow:hidden;text-overflow:ellipsis}.tx-table__row--collapsed .tx-table__cell-body{grid-template-rows:0fr}.tx-table__row--collapsed .tx-table__cell-inner{visibility:hidden}.tx-table__frozen-tbody{position:sticky;z-index:2}.tx-table__row-handle{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:grab;touch-action:none}.tx-table__tbody.cdk-drop-list-dragging .tx-table__row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.tx-table__row.cdk-drag-preview{display:table-row}.tx-table__group-content{display:flex;align-items:center}.tx-table__loading{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center}.tx-table__sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.tx-table__cards{display:grid}.tx-table__card{position:relative;display:flex;flex-direction:column;min-width:0}.tx-table__card-field,.tx-table__card-title{display:flex;align-items:center;min-width:0;overflow-wrap:break-word}.tx-table__card-field{text-align:end}.tx-table__card-label{flex-shrink:0;max-width:45%;margin-inline-end:auto;text-align:start}.tx-table__card-value{min-width:0}.tx-table__card-select{position:absolute;z-index:1}.tx-table__card-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;order:99;margin-top:auto}.tx-table--resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.tx-table--resizing *{cursor:col-resize}.tx-table__tree-cell{display:flex;align-items:center;min-width:0}.tx-table__tree-content{min-width:0;overflow:hidden;text-overflow:ellipsis}.tx-table__tree-toggle{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;margin:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}.tx-table__tree-toggle--hidden{visibility:hidden}.tx-table__tree-select-all{margin-inline-end:var(--tx-tree-table-node-gap)}:host([data-styled]){color:var(--tx-table-color);font-size:var(--tx-table-font-size);line-height:var(--tx-table-line-height)}:host([data-styled]) .tx-table__toolbar{gap:var(--tx-table-toolbar-gap);margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__scroller{padding-bottom:var(--tx-table-scroller-padding-bottom);scrollbar-color:var(--tx-table-scroller-scrollbar-thumb) transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar{width:var(--tx-table-scroller-scrollbar-size);height:var(--tx-table-scroller-scrollbar-size)}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-track,:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-corner{background:transparent}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:999px;background-color:var(--tx-table-scroller-scrollbar-thumb);background-clip:padding-box}:host([data-styled]) .tx-table__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--tx-table-scroller-scrollbar-thumb-hover)}:host([data-styled]) .tx-table__scroller--empty{padding-bottom:0}:host([data-styled]) .tx-table__thead{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__th{padding:var(--tx-table-header-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-header-cell-background);color:var(--tx-table-header-cell-color);font-size:var(--tx-table-header-cell-font-size);font-weight:var(--tx-table-header-cell-font-weight);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__header-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__filter{margin-block:calc(var(--tx-table-filter-button-inset) * -1)}:host([data-styled]) .tx-table__filter-cell{padding:var(--tx-table-filter-cell-padding);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__sort{gap:var(--tx-table-header-cell-gap);border-radius:var(--tx-radius-xs)}:host([data-styled]) .tx-table__sort:focus-visible{outline:var(--tx-table-header-cell-focus-ring-width) var(--tx-table-header-cell-focus-ring-style) var(--tx-table-header-cell-focus-ring-color);outline-offset:var(--tx-table-header-cell-focus-ring-offset);box-shadow:var(--tx-table-header-cell-focus-ring-shadow)}:host([data-styled]) .tx-table__sort-icon{--tx-icon-size: var(--tx-table-sort-icon-size);color:var(--tx-table-sort-icon-color);transition:transform .3s ease}:host([data-styled]) .tx-table__sort-badge{min-width:var(--tx-table-sort-icon-badge-size);height:var(--tx-table-sort-icon-badge-size);border-radius:999px;background:var(--tx-table-sort-icon-badge-background);color:var(--tx-table-sort-icon-badge-color);font-size:var(--tx-table-sort-icon-badge-font-size)}:host([data-styled]) .tx-table__resizer{width:var(--tx-table-column-resizer-width)}:host([data-styled]) .tx-table__resizer-line{width:var(--tx-table-column-resizer-line-width);background-color:transparent;transition:background-color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__resizer:hover .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer--active .tx-table__resizer-line,:host([data-styled]) .tx-table__resizer:focus-visible .tx-table__resizer-line{background-color:var(--tx-table-column-resizer-color)}:host([data-styled]) .tx-table__resizer:focus-visible{outline:none}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging{background:var(--tx-table-drop-point-background)}:host([data-styled]) .tx-table__header-row.cdk-drop-list-dragging .tx-table__th:hover{background:var(--tx-table-drop-point-hover-background)}:host([data-styled]) .tx-table__th.cdk-drag-placeholder{opacity:.6}:host([data-styled]) .tx-table__row{background:var(--tx-table-row-background);color:var(--tx-table-row-color);outline-color:transparent;transition:background var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__td{height:var(--tx-table-body-cell-height);padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px}:host([data-styled]) .tx-table__expansion-cell{padding:0;border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__expansion-content{padding:var(--tx-table-body-cell-padding)}:host([data-styled]) .tx-table__expansion-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__expansion-body:not(.tx-table__expansion-body--open)>.tx-table__expansion-inner{transition:visibility 0s linear var(--tx-table-expansion-duration)}@starting-style{:host([data-styled]) .tx-table__expansion-body--open{grid-template-rows:0fr}}:host([data-styled]) .tx-table__row-toggle-icon{transition:transform var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__row--collapsed>.tx-table__td{height:0;padding-block:0;border-bottom-width:0}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row{transition:visibility 0s linear}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row--collapsed{visibility:collapse;transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__cell-body{transition:grid-template-rows var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__cell-inner{transition:visibility 0s linear}:host([data-styled]) .tx-table__row--collapsed .tx-table__cell-inner{transition-delay:var(--tx-table-expansion-duration)}:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td{transition:height var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),padding-block var(--tx-table-expansion-duration) var(--tx-table-expansion-easing),border-bottom-width var(--tx-table-expansion-duration) var(--tx-table-expansion-easing)}:host([data-styled]) .tx-table__grip{--tx-icon-size: var(--tx-table-grip-size);color:var(--tx-table-grip-color);transition:opacity var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__footer-cell{padding:var(--tx-table-footer-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-footer-cell-background);color:var(--tx-table-footer-cell-color);font-weight:var(--tx-table-footer-cell-font-weight)}:host([data-styled]) .tx-table__cell--frozen{background:var(--tx-table-row-background);box-shadow:var(--tx-table-frozen-column-shadow)}:host([data-styled]) .tx-table__th.tx-table__cell--frozen{background:var(--tx-table-header-cell-background)}:host([data-styled]) .tx-table__cell--frozen-last{border-inline-end:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__cell--frozen-first-end{border-inline-start:1px solid var(--tx-table-border-color)}:host([data-styled]) .tx-table__row .tx-table__cell--frozen{background:inherit}:host([data-styled]) .tx-table__row--selected{background:var(--tx-table-row-selected-background);color:var(--tx-table-row-selected-color)}:host([data-styled]) .tx-table__row--selected>.tx-table__td{border-block-end-color:var(--tx-table-body-cell-selected-border-color)}:host([data-styled]) .tx-table__row--menu>.tx-table__td{background:var(--tx-table-row-menu-background)}:host([data-styled]) .tx-table__row:focus-visible{outline:var(--tx-table-row-focus-ring-width) var(--tx-table-row-focus-ring-style) var(--tx-table-row-focus-ring-color);outline-offset:var(--tx-table-row-focus-ring-offset);box-shadow:var(--tx-table-row-focus-ring-shadow)}:host([data-styled]) .tx-table__row-handle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-radius-xs);color:var(--tx-table-grip-color)}:host([data-styled]) .tx-table__row-handle:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:2px}:host([data-styled]) .tx-table__row.cdk-drag-preview{box-shadow:var(--tx-table-drag-preview-shadow);background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__row.cdk-drag-placeholder{opacity:.4}:host([data-styled]) .tx-table__group-cell{padding:var(--tx-table-body-cell-padding);border-color:var(--tx-table-border-color);border-style:solid;border-width:0 0 1px;background:var(--tx-table-group-background);font-weight:var(--tx-table-group-font-weight)}:host([data-styled]) .tx-table__group-content{gap:var(--tx-table-header-cell-gap)}:host([data-styled]) .tx-table__group-count{color:var(--tx-text-muted);font-weight:var(--tx-font-weight-regular)}:host([data-styled]) .tx-table__frozen-tbody .tx-table__td{background:var(--tx-table-row-background)}:host([data-styled]) .tx-table__td--editable:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:-2px}:host([data-styled]) .tx-table__td--editing{padding-block:var(--tx-table-editor-padding-block)}:host([data-styled]) .tx-table__row-editor{gap:var(--tx-table-actions-gap)}:host([data-styled]) .tx-table__row-toggle{width:var(--tx-table-row-toggle-button-size);height:var(--tx-table-row-toggle-button-size);border-radius:var(--tx-table-row-toggle-button-border-radius);color:var(--tx-table-row-toggle-button-color);transition:background var(--tx-table-transition-duration),color var(--tx-table-transition-duration)}:host([data-styled]) .tx-table__row-toggle:hover{background:var(--tx-table-row-toggle-button-hover-background);color:var(--tx-table-row-toggle-button-hover-color)}:host([data-styled]) .tx-table__row-toggle:focus-visible{outline:var(--tx-table-row-toggle-button-focus-ring-width) var(--tx-table-row-toggle-button-focus-ring-style) var(--tx-table-row-toggle-button-focus-ring-color);outline-offset:var(--tx-table-row-toggle-button-focus-ring-offset);box-shadow:var(--tx-table-row-toggle-button-focus-ring-shadow)}:host([data-styled]) .tx-table__tree-cell{gap:var(--tx-tree-table-node-gap);padding-inline-start:calc(var(--tx-table-tree-level, 0) * var(--tx-tree-table-node-indent))}:host([data-styled]) .tx-table__tree-toggle-icon--loading{animation:tx-table-tree-spin .8s linear infinite}:host([data-styled]) .tx-table__loading{background:var(--tx-table-loading-background);-webkit-backdrop-filter:blur(var(--tx-table-loading-blur));backdrop-filter:blur(var(--tx-table-loading-blur))}:host([data-styled]) .tx-table__empty{padding:var(--tx-table-empty-padding);border:1px solid var(--tx-table-border-color);border-top:0;color:var(--tx-table-empty-color)}:host([data-styled]) .tx-table__paginator{margin-top:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__paginator--top{margin-top:0;margin-bottom:var(--tx-table-paginator-margin-top)}:host([data-styled]) .tx-table__select-all{margin-bottom:var(--tx-table-toolbar-margin-bottom)}:host([data-styled]) .tx-table__cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--tx-table-card-min-width)),1fr));gap:var(--tx-table-card-gap)}:host([data-styled]) .tx-table__card{border-radius:var(--tx-table-card-border-radius);background:var(--tx-table-card-background);box-shadow:inset 0 0 0 1px var(--tx-table-card-border-color)}:host([data-styled]) .tx-table__card--selected{box-shadow:inset 0 0 0 1px var(--tx-table-row-focus-ring-color)}:host([data-styled]) .tx-table__card-field{gap:var(--tx-table-card-field-gap);padding:var(--tx-table-card-field-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-field-font-size)}:host([data-styled]) .tx-table__card-field:last-child{border-bottom:0}:host([data-styled]) .tx-table__card-label{color:var(--tx-table-card-label-color);font-size:var(--tx-table-card-label-font-size)}:host([data-styled]) .tx-table__card-title{padding:var(--tx-table-card-title-padding);border-bottom:1px solid var(--tx-table-card-border-color);font-size:var(--tx-table-card-title-font-size);font-weight:var(--tx-table-card-title-font-weight)}:host([data-styled]) .tx-table__card-title--select{padding-inline-end:calc(var(--tx-table-card-select-inset) * 4)}:host([data-styled]) .tx-table__card-select{inset-block-start:var(--tx-table-card-select-inset);inset-inline-end:var(--tx-table-card-select-inset)}:host([data-styled]) .tx-table__card-actions{gap:var(--tx-table-actions-gap);padding:var(--tx-table-card-actions-padding)}:host([data-styled].tx-table--gridlines) .tx-table__th{border-width:1px 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__th:last-child{border-width:1px}:host([data-styled].tx-table--gridlines) .tx-table__thead>tr:not(:first-child)>.tx-table__th{border-top-width:0}:host([data-styled].tx-table--gridlines) .tx-table__td,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell{border-width:0 0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__td:last-child,:host([data-styled].tx-table--gridlines) .tx-table__footer-cell:last-child{border-width:0 1px 1px}:host([data-styled].tx-table--gridlines) .tx-table__expansion-cell,:host([data-styled].tx-table--gridlines) .tx-table__group-cell{border-width:0 1px 1px}:host([data-styled].tx-table--striped) .tx-table__row--odd:not(.tx-table__row--selected){background:var(--tx-table-row-striped-background)}:host([data-styled].tx-table--hoverable) .tx-table__row:not(.tx-table__row--selected):hover{background:var(--tx-table-row-hover-background)}:host([data-styled][data-size=small]) .tx-table__th{padding:var(--tx-table-header-cell-sm-padding)}:host([data-styled][data-size=small]) .tx-table__td{height:var(--tx-table-body-cell-sm-height);padding:var(--tx-table-body-cell-sm-padding)}:host([data-styled][data-size=large]) .tx-table__th{padding:var(--tx-table-header-cell-lg-padding)}:host([data-styled][data-size=large]) .tx-table__td{height:var(--tx-table-body-cell-lg-height);padding:var(--tx-table-body-cell-lg-padding)}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__th,:host([data-styled]) .tx-table__row,:host([data-styled]) .tx-table__sort-icon,:host([data-styled]) .tx-table__resizer-line,:host([data-styled]) .tx-table__row-toggle,:host([data-styled]) .tx-table__row-toggle-icon,:host([data-styled]) .tx-table__grip,:host([data-styled]) .tx-table__expansion-body,:host([data-styled]) .tx-table__cell-body,:host([data-styled]) .tx-table__cell-inner,:host([data-styled]) .tx-table__tbody:has(.tx-table__cell-body)>.tx-table__row>.tx-table__td,:host([data-styled]) .tx-table__expansion-inner{transition:none}}@keyframes tx-table-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-table__tree-toggle-icon--loading{animation-duration:2.4s}}\n"]
|
|
4869
4889
|
}]
|
|
4870
4890
|
}],
|
|
4871
4891
|
ctorParameters: () => [],
|
|
@@ -5992,6 +6012,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5992
6012
|
}]
|
|
5993
6013
|
}
|
|
5994
6014
|
});
|
|
5995
|
-
export { TX_TABLE, TX_TABLE_ACTIONS_FIELD, TX_TABLE_EDITOR_FIELD, TX_TABLE_EXPAND_FIELD, TX_TABLE_REORDER_FIELD, TX_TABLE_SELECT_FIELD, TxTable, TxTableAction, TxTableActions, TxTableActionsStore, TxTableActionsTemplate, TxTableCard, TxTableCell, TxTableEditor, TxTableEmpty, TxTableExpansion, TxTableFooterCell, TxTableGroupFooter, TxTableGroupHeader, TxTableHeaderCell, actionIdOf, columnLabel, compareValues, mergeColumnOrder, nextSortOrder, pxOf, resolveField, rowKeyOf, sortRows, writeField };
|
|
6015
|
+
export { TX_FILTER_MATCH_MODES, TX_TABLE, TX_TABLE_ACTIONS_FIELD, TX_TABLE_EDITOR_FIELD, TX_TABLE_EXPAND_FIELD, TX_TABLE_REORDER_FIELD, TX_TABLE_SELECT_FIELD, TxTable, TxTableAction, TxTableActions, TxTableActionsStore, TxTableActionsTemplate, TxTableCard, TxTableCell, TxTableColumnFilter, TxTableEditor, TxTableEmpty, TxTableExpansion, TxTableFooterCell, TxTableGroupFooter, TxTableGroupHeader, TxTableHeaderCell, TxTableSettings, actionIdOf, columnLabel, compareValues, defaultMatchMode, filterRows, isFilled, isFilterActive, matchesFilter, matchesRule, mergeColumnOrder, nextSortOrder, pxOf, resolveField, rowKeyOf, sortRows, writeField };
|
|
5996
6016
|
|
|
5997
6017
|
//# sourceMappingURL=tectra-ng-ui-table.mjs.map
|