@area8975/ui 0.2.2-dev.49 → 0.2.2-dev.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/fesm2022/area8975-ui-alert.mjs +113 -0
- package/fesm2022/area8975-ui-alert.mjs.map +1 -0
- package/fesm2022/area8975-ui-avatar.mjs +157 -0
- package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
- package/fesm2022/area8975-ui-badge.mjs +116 -0
- package/fesm2022/area8975-ui-badge.mjs.map +1 -0
- package/fesm2022/area8975-ui-button.mjs +314 -0
- package/fesm2022/area8975-ui-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-calendar.mjs +549 -0
- package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
- package/fesm2022/area8975-ui-card-header.mjs +96 -0
- package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
- package/fesm2022/area8975-ui-card.mjs +73 -0
- package/fesm2022/area8975-ui-card.mjs.map +1 -0
- package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
- package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
- package/fesm2022/area8975-ui-charts.mjs +2813 -0
- package/fesm2022/area8975-ui-charts.mjs.map +1 -0
- package/fesm2022/area8975-ui-checkbox.mjs +202 -0
- package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
- package/fesm2022/area8975-ui-colour.mjs +200 -0
- package/fesm2022/area8975-ui-colour.mjs.map +1 -0
- package/fesm2022/area8975-ui-container.mjs +40 -0
- package/fesm2022/area8975-ui-container.mjs.map +1 -0
- package/fesm2022/area8975-ui-counter.mjs +246 -0
- package/fesm2022/area8975-ui-counter.mjs.map +1 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
- package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
- package/fesm2022/area8975-ui-datepicker.mjs +547 -0
- package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
- package/fesm2022/area8975-ui-disclosure.mjs +279 -0
- package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
- package/fesm2022/area8975-ui-drawer.mjs +106 -0
- package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
- package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
- package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropdown.mjs +208 -0
- package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
- package/fesm2022/area8975-ui-dropzone.mjs +332 -0
- package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
- package/fesm2022/area8975-ui-field.mjs +191 -0
- package/fesm2022/area8975-ui-field.mjs.map +1 -0
- package/fesm2022/area8975-ui-file-input.mjs +340 -0
- package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-file.mjs +47 -0
- package/fesm2022/area8975-ui-file.mjs.map +1 -0
- package/fesm2022/area8975-ui-format.mjs +70 -0
- package/fesm2022/area8975-ui-format.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-addon.mjs +42 -0
- package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
- package/fesm2022/area8975-ui-input-group.mjs +86 -0
- package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-input.mjs +682 -0
- package/fesm2022/area8975-ui-input.mjs.map +1 -0
- package/fesm2022/area8975-ui-kpi.mjs +167 -0
- package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
- package/fesm2022/area8975-ui-layout.mjs +63 -0
- package/fesm2022/area8975-ui-layout.mjs.map +1 -0
- package/fesm2022/area8975-ui-loading.mjs +76 -0
- package/fesm2022/area8975-ui-loading.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
- package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
- package/fesm2022/area8975-ui-modal.mjs +235 -0
- package/fesm2022/area8975-ui-modal.mjs.map +1 -0
- package/fesm2022/area8975-ui-money.mjs +230 -0
- package/fesm2022/area8975-ui-money.mjs.map +1 -0
- package/fesm2022/area8975-ui-overlay.mjs +317 -0
- package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
- package/fesm2022/area8975-ui-pagination.mjs +152 -0
- package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
- package/fesm2022/area8975-ui-private.mjs +63 -0
- package/fesm2022/area8975-ui-private.mjs.map +1 -0
- package/fesm2022/area8975-ui-progress.mjs +307 -0
- package/fesm2022/area8975-ui-progress.mjs.map +1 -0
- package/fesm2022/area8975-ui-radio.mjs +199 -0
- package/fesm2022/area8975-ui-radio.mjs.map +1 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
- package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
- package/fesm2022/area8975-ui-search.mjs +266 -0
- package/fesm2022/area8975-ui-search.mjs.map +1 -0
- package/fesm2022/area8975-ui-segmented.mjs +118 -0
- package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
- package/fesm2022/area8975-ui-select.mjs +926 -0
- package/fesm2022/area8975-ui-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
- package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
- package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
- package/fesm2022/area8975-ui-sidebar.mjs +109 -0
- package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
- package/fesm2022/area8975-ui-skeleton.mjs +116 -0
- package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
- package/fesm2022/area8975-ui-stat.mjs +55 -0
- package/fesm2022/area8975-ui-stat.mjs.map +1 -0
- package/fesm2022/area8975-ui-switch.mjs +132 -0
- package/fesm2022/area8975-ui-switch.mjs.map +1 -0
- package/fesm2022/area8975-ui-tab.mjs +217 -0
- package/fesm2022/area8975-ui-tab.mjs.map +1 -0
- package/fesm2022/area8975-ui-table-filters.mjs +499 -0
- package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
- package/fesm2022/area8975-ui-table.mjs +1237 -0
- package/fesm2022/area8975-ui-table.mjs.map +1 -0
- package/fesm2022/area8975-ui-textarea.mjs +375 -0
- package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
- package/fesm2022/area8975-ui-theme.mjs +246 -0
- package/fesm2022/area8975-ui-theme.mjs.map +1 -0
- package/fesm2022/area8975-ui-time-select.mjs +170 -0
- package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
- package/fesm2022/area8975-ui-toast.mjs +269 -0
- package/fesm2022/area8975-ui-toast.mjs.map +1 -0
- package/fesm2022/area8975-ui-toaster.mjs +117 -0
- package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
- package/fesm2022/area8975-ui-tooltip.mjs +196 -0
- package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
- package/fesm2022/area8975-ui-user-menu.mjs +186 -0
- package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
- package/fesm2022/area8975-ui.mjs +0 -16520
- package/package.json +237 -1
- package/types/area8975-ui-alert.d.ts +25 -0
- package/types/area8975-ui-avatar.d.ts +40 -0
- package/types/area8975-ui-badge.d.ts +31 -0
- package/types/area8975-ui-button.d.ts +129 -0
- package/types/area8975-ui-calendar.d.ts +177 -0
- package/types/area8975-ui-card-header.d.ts +28 -0
- package/types/area8975-ui-card.d.ts +18 -0
- package/types/area8975-ui-chart-palette.d.ts +176 -0
- package/types/area8975-ui-charts.d.ts +747 -0
- package/types/area8975-ui-checkbox.d.ts +61 -0
- package/types/area8975-ui-colour.d.ts +31 -0
- package/types/area8975-ui-container.d.ts +5 -0
- package/types/area8975-ui-counter.d.ts +43 -0
- package/types/area8975-ui-date-range-picker.d.ts +132 -0
- package/types/area8975-ui-datepicker.d.ts +124 -0
- package/types/area8975-ui-disclosure.d.ts +79 -0
- package/types/area8975-ui-drawer.d.ts +25 -0
- package/types/area8975-ui-dropdown-button.d.ts +32 -0
- package/types/area8975-ui-dropdown-menu.d.ts +25 -0
- package/types/area8975-ui-dropdown.d.ts +56 -0
- package/types/area8975-ui-dropzone.d.ts +96 -0
- package/types/area8975-ui-field.d.ts +72 -0
- package/types/area8975-ui-file-input.d.ts +72 -0
- package/types/area8975-ui-file.d.ts +21 -0
- package/types/area8975-ui-format.d.ts +37 -0
- package/types/area8975-ui-input-addon.d.ts +10 -0
- package/types/area8975-ui-input-group.d.ts +18 -0
- package/types/area8975-ui-input.d.ts +224 -0
- package/types/area8975-ui-kpi.d.ts +36 -0
- package/types/area8975-ui-layout.d.ts +7 -0
- package/types/area8975-ui-loading.d.ts +16 -0
- package/types/area8975-ui-modal-close-btn.d.ts +14 -0
- package/types/area8975-ui-modal.d.ts +45 -0
- package/types/area8975-ui-money.d.ts +77 -0
- package/types/area8975-ui-overlay.d.ts +75 -0
- package/types/area8975-ui-pagination.d.ts +27 -0
- package/types/area8975-ui-private.d.ts +20 -0
- package/types/area8975-ui-progress.d.ts +127 -0
- package/types/area8975-ui-radio.d.ts +61 -0
- package/types/area8975-ui-rich-text-editor.d.ts +165 -0
- package/types/area8975-ui-search.d.ts +56 -0
- package/types/area8975-ui-segmented.d.ts +41 -0
- package/types/area8975-ui-select.d.ts +293 -0
- package/types/area8975-ui-sidebar-group.d.ts +15 -0
- package/types/area8975-ui-sidebar-item.d.ts +20 -0
- package/types/area8975-ui-sidebar.d.ts +16 -0
- package/types/area8975-ui-skeleton.d.ts +35 -0
- package/types/area8975-ui-stat.d.ts +13 -0
- package/types/area8975-ui-switch.d.ts +32 -0
- package/types/area8975-ui-tab.d.ts +45 -0
- package/types/area8975-ui-table-filters.d.ts +138 -0
- package/types/area8975-ui-table.d.ts +371 -0
- package/types/area8975-ui-textarea.d.ts +126 -0
- package/types/area8975-ui-theme.d.ts +61 -0
- package/types/area8975-ui-time-select.d.ts +35 -0
- package/types/area8975-ui-toast.d.ts +78 -0
- package/types/area8975-ui-toaster.d.ts +23 -0
- package/types/area8975-ui-tooltip.d.ts +47 -0
- package/types/area8975-ui-user-menu.d.ts +39 -0
- package/types/area8975-ui.d.ts +1 -4546
- package/fesm2022/area8975-ui.mjs.map +0 -1
|
@@ -0,0 +1,1237 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectorRef, Component, DestroyRef, Directive, Injectable, TemplateRef, booleanAttribute, computed, contentChild, contentChildren, effect, inject, input, isDevMode, model, output, signal, untracked } from "@angular/core";
|
|
4
|
+
import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
5
|
+
import { UiButtonComponent } from "@area8975/ui/button";
|
|
6
|
+
import { UiCheckboxComponent } from "@area8975/ui/checkbox";
|
|
7
|
+
import { UiDropdownComponent, UiDropdownDirective } from "@area8975/ui/dropdown";
|
|
8
|
+
import { UI_FORMAT, UI_PRIVACY, injectPrivateText } from "@area8975/ui/format";
|
|
9
|
+
import { UiInputComponent } from "@area8975/ui/input";
|
|
10
|
+
import { UiLoadingComponent } from "@area8975/ui/loading";
|
|
11
|
+
import { UiMoneyComponent } from "@area8975/ui/money";
|
|
12
|
+
import { UiPrivateComponent } from "@area8975/ui/private";
|
|
13
|
+
import { SelectLocalDataSource, UiSelectComponent } from "@area8975/ui/select";
|
|
14
|
+
import { UiTooltipComponent } from "@area8975/ui/tooltip";
|
|
15
|
+
import { NgIcon, provideIcons } from "@ng-icons/core";
|
|
16
|
+
import { heroBars2, heroFunnel, heroMagnifyingGlass, heroViewColumns } from "@ng-icons/heroicons/outline";
|
|
17
|
+
import { Subject, catchError, debounceTime, filter, of, switchMap } from "rxjs";
|
|
18
|
+
var UiTableCellDirective = class UiTableCellDirective {
|
|
19
|
+
columnId = input.required({
|
|
20
|
+
...ngDevMode ? { debugName: "columnId" } : /* istanbul ignore next */ {},
|
|
21
|
+
alias: "uiTableCell"
|
|
22
|
+
});
|
|
23
|
+
template = inject(TemplateRef);
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.1",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: UiTableCellDirective,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
31
|
+
});
|
|
32
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
33
|
+
minVersion: "17.1.0",
|
|
34
|
+
version: "22.2.1",
|
|
35
|
+
type: UiTableCellDirective,
|
|
36
|
+
isStandalone: true,
|
|
37
|
+
selector: "ng-template[uiTableCell]",
|
|
38
|
+
inputs: { columnId: {
|
|
39
|
+
classPropertyName: "columnId",
|
|
40
|
+
publicName: "uiTableCell",
|
|
41
|
+
isSignal: true,
|
|
42
|
+
isRequired: true,
|
|
43
|
+
transformFunction: null
|
|
44
|
+
} },
|
|
45
|
+
ngImport: i0
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
49
|
+
minVersion: "12.0.0",
|
|
50
|
+
version: "22.2.1",
|
|
51
|
+
ngImport: i0,
|
|
52
|
+
type: UiTableCellDirective,
|
|
53
|
+
decorators: [{
|
|
54
|
+
type: Directive,
|
|
55
|
+
args: [{ selector: "ng-template[uiTableCell]" }]
|
|
56
|
+
}],
|
|
57
|
+
propDecorators: { columnId: [{
|
|
58
|
+
type: i0.Input,
|
|
59
|
+
args: [{
|
|
60
|
+
isSignal: true,
|
|
61
|
+
alias: "uiTableCell",
|
|
62
|
+
required: true
|
|
63
|
+
}]
|
|
64
|
+
}] }
|
|
65
|
+
});
|
|
66
|
+
var UiTableBarDirective = class UiTableBarDirective {
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
68
|
+
minVersion: "12.0.0",
|
|
69
|
+
version: "22.2.1",
|
|
70
|
+
ngImport: i0,
|
|
71
|
+
type: UiTableBarDirective,
|
|
72
|
+
deps: [],
|
|
73
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
74
|
+
});
|
|
75
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
76
|
+
minVersion: "14.0.0",
|
|
77
|
+
version: "22.2.1",
|
|
78
|
+
type: UiTableBarDirective,
|
|
79
|
+
isStandalone: true,
|
|
80
|
+
selector: "[uiTableBar]",
|
|
81
|
+
ngImport: i0
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
85
|
+
minVersion: "12.0.0",
|
|
86
|
+
version: "22.2.1",
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
type: UiTableBarDirective,
|
|
89
|
+
decorators: [{
|
|
90
|
+
type: Directive,
|
|
91
|
+
args: [{ selector: "[uiTableBar]" }]
|
|
92
|
+
}]
|
|
93
|
+
});
|
|
94
|
+
var UiTableRegistry = class UiTableRegistry {
|
|
95
|
+
tables = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "tables" }] : /* istanbul ignore next */ []);
|
|
96
|
+
get(id) {
|
|
97
|
+
return this.tables().get(id) ?? null;
|
|
98
|
+
}
|
|
99
|
+
register(id, table) {
|
|
100
|
+
const existing = this.tables().get(id);
|
|
101
|
+
if (isDevMode() && existing && existing !== table) console.warn(`[ui-table] two tables share the id "${id}", controls will link to the newest one`);
|
|
102
|
+
this.tables.update((tables) => new Map(tables).set(id, table));
|
|
103
|
+
}
|
|
104
|
+
unregister(id, table) {
|
|
105
|
+
if (this.tables().get(id) !== table) return;
|
|
106
|
+
this.tables.update((tables) => {
|
|
107
|
+
const next = new Map(tables);
|
|
108
|
+
next.delete(id);
|
|
109
|
+
return next;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
113
|
+
minVersion: "12.0.0",
|
|
114
|
+
version: "22.2.1",
|
|
115
|
+
ngImport: i0,
|
|
116
|
+
type: UiTableRegistry,
|
|
117
|
+
deps: [],
|
|
118
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
119
|
+
});
|
|
120
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
121
|
+
minVersion: "12.0.0",
|
|
122
|
+
version: "22.2.1",
|
|
123
|
+
ngImport: i0,
|
|
124
|
+
type: UiTableRegistry,
|
|
125
|
+
providedIn: "root"
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
129
|
+
minVersion: "12.0.0",
|
|
130
|
+
version: "22.2.1",
|
|
131
|
+
ngImport: i0,
|
|
132
|
+
type: UiTableRegistry,
|
|
133
|
+
decorators: [{
|
|
134
|
+
type: Injectable,
|
|
135
|
+
args: [{ providedIn: "root" }]
|
|
136
|
+
}]
|
|
137
|
+
});
|
|
138
|
+
const DEFAULT_COLUMN_WIDTH = 160;
|
|
139
|
+
const SELECTION_COLUMN_WIDTH = 44;
|
|
140
|
+
var UiTableComponent = class UiTableComponent {
|
|
141
|
+
classes = input("", ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
142
|
+
tableId = input(null, ...ngDevMode ? [{ debugName: "tableId" }] : /* istanbul ignore next */ []);
|
|
143
|
+
columns = input.required(...ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []);
|
|
144
|
+
dataSource = input.required(...ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []);
|
|
145
|
+
emptyMessage = input("No data to display.", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
|
|
146
|
+
errorMessage = input("Something went wrong loading this data.", ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
147
|
+
rowId = input((_row, index) => index, ...ngDevMode ? [{ debugName: "rowId" }] : /* istanbul ignore next */ []);
|
|
148
|
+
selectable = input(false, {
|
|
149
|
+
...ngDevMode ? { debugName: "selectable" } : /* istanbul ignore next */ {},
|
|
150
|
+
transform: booleanAttribute
|
|
151
|
+
});
|
|
152
|
+
searchable = input(false, {
|
|
153
|
+
...ngDevMode ? { debugName: "searchable" } : /* istanbul ignore next */ {},
|
|
154
|
+
transform: booleanAttribute
|
|
155
|
+
});
|
|
156
|
+
searchPlaceholder = input("Search...", ...ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []);
|
|
157
|
+
paginated = input(false, {
|
|
158
|
+
...ngDevMode ? { debugName: "paginated" } : /* istanbul ignore next */ {},
|
|
159
|
+
transform: booleanAttribute
|
|
160
|
+
});
|
|
161
|
+
pageSize = input(10, ...ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []);
|
|
162
|
+
toggleableColumns = input(false, {
|
|
163
|
+
...ngDevMode ? { debugName: "toggleableColumns" } : /* istanbul ignore next */ {},
|
|
164
|
+
transform: booleanAttribute
|
|
165
|
+
});
|
|
166
|
+
reorderableColumns = input(false, {
|
|
167
|
+
...ngDevMode ? { debugName: "reorderableColumns" } : /* istanbul ignore next */ {},
|
|
168
|
+
transform: booleanAttribute
|
|
169
|
+
});
|
|
170
|
+
reorderableRows = input(false, {
|
|
171
|
+
...ngDevMode ? { debugName: "reorderableRows" } : /* istanbul ignore next */ {},
|
|
172
|
+
transform: booleanAttribute
|
|
173
|
+
});
|
|
174
|
+
stickyHeader = input(false, {
|
|
175
|
+
...ngDevMode ? { debugName: "stickyHeader" } : /* istanbul ignore next */ {},
|
|
176
|
+
transform: booleanAttribute
|
|
177
|
+
});
|
|
178
|
+
headerless = input(false, {
|
|
179
|
+
...ngDevMode ? { debugName: "headerless" } : /* istanbul ignore next */ {},
|
|
180
|
+
transform: booleanAttribute
|
|
181
|
+
});
|
|
182
|
+
bar = contentChild(UiTableBarDirective, ...ngDevMode ? [{ debugName: "bar" }] : /* istanbul ignore next */ []);
|
|
183
|
+
hasBar = computed(() => !!this.bar(), ...ngDevMode ? [{ debugName: "hasBar" }] : /* istanbul ignore next */ []);
|
|
184
|
+
groupHeading = input(null, ...ngDevMode ? [{ debugName: "groupHeading" }] : /* istanbul ignore next */ []);
|
|
185
|
+
actions = input([], ...ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []);
|
|
186
|
+
sort = model(null, ...ngDevMode ? [{ debugName: "sort" }] : /* istanbul ignore next */ []);
|
|
187
|
+
selectedRowIds = model(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "selectedRowIds" }] : /* istanbul ignore next */ []);
|
|
188
|
+
selectionChange = output();
|
|
189
|
+
rowsReordered = output();
|
|
190
|
+
rows = signal([], ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
191
|
+
total = signal(0, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
|
|
192
|
+
loading = signal(false, ...ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []);
|
|
193
|
+
error = signal(false, ...ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []);
|
|
194
|
+
query = signal("", ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
195
|
+
filters = signal({}, ...ngDevMode ? [{ debugName: "filters" }] : /* istanbul ignore next */ []);
|
|
196
|
+
currentPage = signal(0, ...ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []);
|
|
197
|
+
hiddenColumnIds = signal(/* @__PURE__ */ new Set(), ...ngDevMode ? [{ debugName: "hiddenColumnIds" }] : /* istanbul ignore next */ []);
|
|
198
|
+
columnOrderIds = signal(null, ...ngDevMode ? [{ debugName: "columnOrderIds" }] : /* istanbul ignore next */ []);
|
|
199
|
+
columnWidths = signal({}, ...ngDevMode ? [{ debugName: "columnWidths" }] : /* istanbul ignore next */ []);
|
|
200
|
+
columnMenuOpen = signal(false, ...ngDevMode ? [{ debugName: "columnMenuOpen" }] : /* istanbul ignore next */ []);
|
|
201
|
+
filterMenuOpen = signal(false, ...ngDevMode ? [{ debugName: "filterMenuOpen" }] : /* istanbul ignore next */ []);
|
|
202
|
+
draggedColumnId = signal(null, ...ngDevMode ? [{ debugName: "draggedColumnId" }] : /* istanbul ignore next */ []);
|
|
203
|
+
dragOverColumnId = signal(null, ...ngDevMode ? [{ debugName: "dragOverColumnId" }] : /* istanbul ignore next */ []);
|
|
204
|
+
dragPreview = signal(null, ...ngDevMode ? [{ debugName: "dragPreview" }] : /* istanbul ignore next */ []);
|
|
205
|
+
draggedRowIndex = signal(null, ...ngDevMode ? [{ debugName: "draggedRowIndex" }] : /* istanbul ignore next */ []);
|
|
206
|
+
cellDirectives = contentChildren(UiTableCellDirective, ...ngDevMode ? [{ debugName: "cellDirectives" }] : /* istanbul ignore next */ []);
|
|
207
|
+
cellTemplates = computed(() => new Map(this.cellDirectives().map((cell) => [cell.columnId(), cell.template])), ...ngDevMode ? [{ debugName: "cellTemplates" }] : /* istanbul ignore next */ []);
|
|
208
|
+
isEmpty = computed(() => !this.loading() && !this.error() && this.rows().length === 0, ...ngDevMode ? [{ debugName: "isEmpty" }] : /* istanbul ignore next */ []);
|
|
209
|
+
generatedClasses = computed(() => [
|
|
210
|
+
"ui-table",
|
|
211
|
+
"ui-text-body",
|
|
212
|
+
this.hasSensitiveColumns() && "ui-table--fixed",
|
|
213
|
+
this.classes()
|
|
214
|
+
].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "generatedClasses" }] : /* istanbul ignore next */ []);
|
|
215
|
+
orderedColumns = computed(() => {
|
|
216
|
+
const order = this.columnOrderIds();
|
|
217
|
+
if (!order) return this.columns();
|
|
218
|
+
const byId = new Map(this.columns().map((column) => [column.id, column]));
|
|
219
|
+
const ordered = order.map((id) => byId.get(id)).filter((column) => !!column);
|
|
220
|
+
const missing = this.columns().filter((column) => !order.includes(column.id));
|
|
221
|
+
return [...ordered, ...missing];
|
|
222
|
+
}, ...ngDevMode ? [{ debugName: "orderedColumns" }] : /* istanbul ignore next */ []);
|
|
223
|
+
hideableColumns = computed(() => this.orderedColumns().filter((column) => column.hideable !== false), ...ngDevMode ? [{ debugName: "hideableColumns" }] : /* istanbul ignore next */ []);
|
|
224
|
+
visibleColumns = computed(() => this.orderedColumns().filter((column) => !this.hiddenColumnIds().has(column.id)), ...ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []);
|
|
225
|
+
renderColumns = computed(() => {
|
|
226
|
+
const columns = this.visibleColumns();
|
|
227
|
+
return [
|
|
228
|
+
...columns.filter((column) => column.pin === "left"),
|
|
229
|
+
...columns.filter((column) => !column.pin),
|
|
230
|
+
...columns.filter((column) => column.pin === "right")
|
|
231
|
+
];
|
|
232
|
+
}, ...ngDevMode ? [{ debugName: "renderColumns" }] : /* istanbul ignore next */ []);
|
|
233
|
+
filterableColumns = computed(() => this.orderedColumns().filter((column) => column.filterable), ...ngDevMode ? [{ debugName: "filterableColumns" }] : /* istanbul ignore next */ []);
|
|
234
|
+
hasFilterableColumns = computed(() => this.filterableColumns().length > 0, ...ngDevMode ? [{ debugName: "hasFilterableColumns" }] : /* istanbul ignore next */ []);
|
|
235
|
+
activeFilterCount = computed(() => Object.keys(this.filters()).length, ...ngDevMode ? [{ debugName: "activeFilterCount" }] : /* istanbul ignore next */ []);
|
|
236
|
+
hasActions = computed(() => this.actions().length > 0, ...ngDevMode ? [{ debugName: "hasActions" }] : /* istanbul ignore next */ []);
|
|
237
|
+
columnSpan = computed(() => this.renderColumns().length + (this.selectable() ? 1 : 0) + (this.hasActions() ? 1 : 0), ...ngDevMode ? [{ debugName: "columnSpan" }] : /* istanbul ignore next */ []);
|
|
238
|
+
groupHeadings = computed(() => {
|
|
239
|
+
const headingOf = this.groupHeading();
|
|
240
|
+
if (!headingOf) return this.rows().map(() => null);
|
|
241
|
+
const headings = this.rows().map(headingOf);
|
|
242
|
+
return headings.map((heading, index) => heading === headings[index - 1] ? null : heading);
|
|
243
|
+
}, ...ngDevMode ? [{ debugName: "groupHeadings" }] : /* istanbul ignore next */ []);
|
|
244
|
+
hasSensitiveColumns = computed(() => this.columns().some((column) => column.sensitive), ...ngDevMode ? [{ debugName: "hasSensitiveColumns" }] : /* istanbul ignore next */ []);
|
|
245
|
+
fixedWidth = computed(() => this.hasSensitiveColumns() ? (this.selectable() ? SELECTION_COLUMN_WIDTH : 0) + this.renderColumns().reduce((total, column) => total + this.columnWidth(column), 0) + (this.hasActions() ? this.actionsColumnWidth() : 0) : null, ...ngDevMode ? [{ debugName: "fixedWidth" }] : /* istanbul ignore next */ []);
|
|
246
|
+
actionsColumnWidth = computed(() => Math.max(60, this.actions().length * 40), ...ngDevMode ? [{ debugName: "actionsColumnWidth" }] : /* istanbul ignore next */ []);
|
|
247
|
+
totalPages = computed(() => this.paginated() ? Math.max(1, Math.ceil(this.total() / this.pageSize())) : 1, ...ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []);
|
|
248
|
+
resultsLabel = computed(() => {
|
|
249
|
+
const total = this.total();
|
|
250
|
+
return total === 1 ? "1 result" : `${total} results`;
|
|
251
|
+
}, ...ngDevMode ? [{ debugName: "resultsLabel" }] : /* istanbul ignore next */ []);
|
|
252
|
+
allSelected = computed(() => {
|
|
253
|
+
const rows = this.rows();
|
|
254
|
+
return rows.length > 0 && rows.every((row, index) => this.selectedRowIds().has(this.rowId()(row, index)));
|
|
255
|
+
}, ...ngDevMode ? [{ debugName: "allSelected" }] : /* istanbul ignore next */ []);
|
|
256
|
+
someSelected = computed(() => {
|
|
257
|
+
const rows = this.rows();
|
|
258
|
+
const selected = this.selectedRowIds();
|
|
259
|
+
const count = rows.filter((row, index) => selected.has(this.rowId()(row, index))).length;
|
|
260
|
+
return count > 0 && count < rows.length;
|
|
261
|
+
}, ...ngDevMode ? [{ debugName: "someSelected" }] : /* istanbul ignore next */ []);
|
|
262
|
+
leftOffsets = computed(() => {
|
|
263
|
+
const offsets = {};
|
|
264
|
+
let offset = this.selectable() ? SELECTION_COLUMN_WIDTH : 0;
|
|
265
|
+
for (const column of this.renderColumns().filter((c) => c.pin === "left")) {
|
|
266
|
+
offsets[column.id] = offset;
|
|
267
|
+
offset += this.columnWidth(column);
|
|
268
|
+
}
|
|
269
|
+
return offsets;
|
|
270
|
+
}, ...ngDevMode ? [{ debugName: "leftOffsets" }] : /* istanbul ignore next */ []);
|
|
271
|
+
rightOffsets = computed(() => {
|
|
272
|
+
const offsets = {};
|
|
273
|
+
let offset = 0;
|
|
274
|
+
const columns = this.renderColumns().filter((c) => c.pin === "right").slice().reverse();
|
|
275
|
+
for (const column of columns) {
|
|
276
|
+
offsets[column.id] = offset;
|
|
277
|
+
offset += this.columnWidth(column);
|
|
278
|
+
}
|
|
279
|
+
return offsets;
|
|
280
|
+
}, ...ngDevMode ? [{ debugName: "rightOffsets" }] : /* istanbul ignore next */ []);
|
|
281
|
+
load$ = new Subject();
|
|
282
|
+
destroyRef = inject(DestroyRef);
|
|
283
|
+
cdr = inject(ChangeDetectorRef);
|
|
284
|
+
registry = inject(UiTableRegistry);
|
|
285
|
+
uiFormat = inject(UI_FORMAT);
|
|
286
|
+
privateText = injectPrivateText();
|
|
287
|
+
privacy = inject(UI_PRIVACY);
|
|
288
|
+
loadedQuery = "";
|
|
289
|
+
loadedFilters = {};
|
|
290
|
+
loadedSort = null;
|
|
291
|
+
resizeState = null;
|
|
292
|
+
columnDragState = null;
|
|
293
|
+
filterDataSources = /* @__PURE__ */ new Map();
|
|
294
|
+
constructor() {
|
|
295
|
+
effect((onCleanup) => {
|
|
296
|
+
const id = this.tableId();
|
|
297
|
+
if (!id) return;
|
|
298
|
+
untracked(() => this.registry.register(id, this));
|
|
299
|
+
onCleanup(() => this.registry.unregister(id, this));
|
|
300
|
+
});
|
|
301
|
+
toObservable(this.query).pipe(debounceTime(300), filter((query) => query !== this.loadedQuery), takeUntilDestroyed(this.destroyRef)).subscribe(() => this.resetAndReload());
|
|
302
|
+
toObservable(this.filters).pipe(debounceTime(300), filter((filters) => filters !== this.loadedFilters), takeUntilDestroyed(this.destroyRef)).subscribe(() => this.resetAndReload());
|
|
303
|
+
toObservable(this.sort).pipe(filter((sort) => sort !== this.loadedSort), takeUntilDestroyed(this.destroyRef)).subscribe(() => this.resetAndReload());
|
|
304
|
+
this.load$.pipe(switchMap(() => this.fetch()), takeUntilDestroyed(this.destroyRef)).subscribe((result) => this.applyResult(result));
|
|
305
|
+
}
|
|
306
|
+
ngOnInit() {
|
|
307
|
+
this.reload();
|
|
308
|
+
}
|
|
309
|
+
ngOnDestroy() {
|
|
310
|
+
document.removeEventListener("pointermove", this.onResizeMove);
|
|
311
|
+
document.removeEventListener("pointerup", this.onResizeEnd);
|
|
312
|
+
document.removeEventListener("pointermove", this.onColumnDragMove);
|
|
313
|
+
document.removeEventListener("pointerup", this.onColumnDragEnd);
|
|
314
|
+
}
|
|
315
|
+
reload() {
|
|
316
|
+
this.load$.next();
|
|
317
|
+
}
|
|
318
|
+
cellValue(column, row) {
|
|
319
|
+
return column.accessor(row);
|
|
320
|
+
}
|
|
321
|
+
cellIconValue(column, row) {
|
|
322
|
+
return column.accessor(row);
|
|
323
|
+
}
|
|
324
|
+
moneyCellValue(column, row) {
|
|
325
|
+
const value = column.accessor(row);
|
|
326
|
+
return value === null || value === void 0 ? null : Number(value);
|
|
327
|
+
}
|
|
328
|
+
formattedCellValue(column, row) {
|
|
329
|
+
const value = column.accessor(row);
|
|
330
|
+
if (value === null || value === void 0) return "";
|
|
331
|
+
switch (column.displayType) {
|
|
332
|
+
case "number": return new Intl.NumberFormat().format(Number(value));
|
|
333
|
+
case "date": return new Intl.DateTimeFormat(void 0, { dateStyle: "medium" }).format(new Date(value));
|
|
334
|
+
case "time": return new Intl.DateTimeFormat(void 0, { timeStyle: "short" }).format(new Date(value));
|
|
335
|
+
default: return String(value);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
onQueryChange(value) {
|
|
339
|
+
this.query.set(value);
|
|
340
|
+
}
|
|
341
|
+
filterValue(columnId) {
|
|
342
|
+
return this.filters()[columnId] ?? "";
|
|
343
|
+
}
|
|
344
|
+
onFilterInput(columnId, value) {
|
|
345
|
+
this.setFilter(columnId, value);
|
|
346
|
+
}
|
|
347
|
+
filterDataSource(column) {
|
|
348
|
+
let dataSource = this.filterDataSources.get(column.id);
|
|
349
|
+
if (!dataSource) {
|
|
350
|
+
dataSource = new SelectLocalDataSource(column.filterOptions ?? [], (option, query) => option.label.toLowerCase().includes(query.toLowerCase()));
|
|
351
|
+
this.filterDataSources.set(column.id, dataSource);
|
|
352
|
+
}
|
|
353
|
+
return dataSource;
|
|
354
|
+
}
|
|
355
|
+
selectedFilterOption(column) {
|
|
356
|
+
const value = this.filters()[column.id];
|
|
357
|
+
return column.filterOptions?.find((option) => option.value === value) ?? null;
|
|
358
|
+
}
|
|
359
|
+
filterOptionLabel(option) {
|
|
360
|
+
return option.label;
|
|
361
|
+
}
|
|
362
|
+
sensitiveFilterOptionLabel = (option) => this.privateText(option.label);
|
|
363
|
+
onFilterSelect(columnId, option) {
|
|
364
|
+
this.setFilter(columnId, option?.value);
|
|
365
|
+
}
|
|
366
|
+
clearFilters() {
|
|
367
|
+
this.filters.set({});
|
|
368
|
+
}
|
|
369
|
+
toggleSort(column) {
|
|
370
|
+
if (!column.sortable) return;
|
|
371
|
+
const current = this.sort();
|
|
372
|
+
if (!current || current.columnId !== column.id) this.sort.set({
|
|
373
|
+
columnId: column.id,
|
|
374
|
+
direction: "asc"
|
|
375
|
+
});
|
|
376
|
+
else if (current.direction === "asc") this.sort.set({
|
|
377
|
+
columnId: column.id,
|
|
378
|
+
direction: "desc"
|
|
379
|
+
});
|
|
380
|
+
else this.sort.set(null);
|
|
381
|
+
this.resetAndReload();
|
|
382
|
+
}
|
|
383
|
+
sortDirection(column) {
|
|
384
|
+
const current = this.sort();
|
|
385
|
+
return current?.columnId === column.id ? current.direction : null;
|
|
386
|
+
}
|
|
387
|
+
goToPage(page) {
|
|
388
|
+
if (page < 0 || page >= this.totalPages()) return;
|
|
389
|
+
this.currentPage.set(page);
|
|
390
|
+
this.reload();
|
|
391
|
+
}
|
|
392
|
+
isColumnVisible(column) {
|
|
393
|
+
return !this.hiddenColumnIds().has(column.id);
|
|
394
|
+
}
|
|
395
|
+
toggleColumnVisibility(column) {
|
|
396
|
+
this.hiddenColumnIds.update((hidden) => {
|
|
397
|
+
const next = new Set(hidden);
|
|
398
|
+
if (next.has(column.id)) next.delete(column.id);
|
|
399
|
+
else next.add(column.id);
|
|
400
|
+
return next;
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
isRowSelected(row, index) {
|
|
404
|
+
return this.selectedRowIds().has(this.rowId()(row, index));
|
|
405
|
+
}
|
|
406
|
+
toggleRow(row, index) {
|
|
407
|
+
const id = this.rowId()(row, index);
|
|
408
|
+
this.selectedRowIds.update((selected) => {
|
|
409
|
+
const next = new Set(selected);
|
|
410
|
+
if (next.has(id)) next.delete(id);
|
|
411
|
+
else next.add(id);
|
|
412
|
+
return next;
|
|
413
|
+
});
|
|
414
|
+
this.emitSelectionChange();
|
|
415
|
+
}
|
|
416
|
+
toggleSelectAll() {
|
|
417
|
+
const wasAllSelected = this.allSelected();
|
|
418
|
+
this.selectedRowIds.update((selected) => {
|
|
419
|
+
const next = new Set(selected);
|
|
420
|
+
this.rows().forEach((row, index) => {
|
|
421
|
+
const id = this.rowId()(row, index);
|
|
422
|
+
if (wasAllSelected) next.delete(id);
|
|
423
|
+
else next.add(id);
|
|
424
|
+
});
|
|
425
|
+
return next;
|
|
426
|
+
});
|
|
427
|
+
this.emitSelectionChange();
|
|
428
|
+
}
|
|
429
|
+
columnWidth(column) {
|
|
430
|
+
return this.columnWidths()[column.id] ?? column.width ?? DEFAULT_COLUMN_WIDTH;
|
|
431
|
+
}
|
|
432
|
+
isPinned(column) {
|
|
433
|
+
return column.pin === "left" || column.pin === "right";
|
|
434
|
+
}
|
|
435
|
+
leftOffset(column) {
|
|
436
|
+
return column.pin === "left" ? this.leftOffsets()[column.id] : null;
|
|
437
|
+
}
|
|
438
|
+
rightOffset(column) {
|
|
439
|
+
return column.pin === "right" ? this.rightOffsets()[column.id] : null;
|
|
440
|
+
}
|
|
441
|
+
startResize(event, column) {
|
|
442
|
+
event.preventDefault();
|
|
443
|
+
event.stopPropagation();
|
|
444
|
+
this.resizeState = {
|
|
445
|
+
columnId: column.id,
|
|
446
|
+
startX: event.clientX,
|
|
447
|
+
startWidth: this.columnWidth(column)
|
|
448
|
+
};
|
|
449
|
+
document.addEventListener("pointermove", this.onResizeMove);
|
|
450
|
+
document.addEventListener("pointerup", this.onResizeEnd);
|
|
451
|
+
}
|
|
452
|
+
canReorderRows() {
|
|
453
|
+
return this.reorderableRows() && !this.sort();
|
|
454
|
+
}
|
|
455
|
+
onColumnDragStart(event, column) {
|
|
456
|
+
event.preventDefault();
|
|
457
|
+
const headerCell = event.currentTarget.closest("th");
|
|
458
|
+
const headerRow = headerCell?.closest("tr");
|
|
459
|
+
if (!headerCell || !headerRow) return;
|
|
460
|
+
const cellRect = headerCell.getBoundingClientRect();
|
|
461
|
+
const rowRect = headerRow.getBoundingClientRect();
|
|
462
|
+
this.columnDragState = {
|
|
463
|
+
columnId: column.id,
|
|
464
|
+
pointerOffsetX: event.clientX - cellRect.left,
|
|
465
|
+
previewY: rowRect.top + (rowRect.height - cellRect.height) / 2,
|
|
466
|
+
previewHeight: cellRect.height
|
|
467
|
+
};
|
|
468
|
+
this.draggedColumnId.set(column.id);
|
|
469
|
+
this.dragPreview.set({
|
|
470
|
+
label: column.header,
|
|
471
|
+
x: cellRect.left,
|
|
472
|
+
y: this.columnDragState.previewY,
|
|
473
|
+
width: cellRect.width,
|
|
474
|
+
height: this.columnDragState.previewHeight
|
|
475
|
+
});
|
|
476
|
+
document.addEventListener("pointermove", this.onColumnDragMove);
|
|
477
|
+
document.addEventListener("pointerup", this.onColumnDragEnd);
|
|
478
|
+
}
|
|
479
|
+
onRowDragStart(event, index) {
|
|
480
|
+
this.draggedRowIndex.set(index);
|
|
481
|
+
event.dataTransfer?.setData("text/plain", String(index));
|
|
482
|
+
}
|
|
483
|
+
onRowDragOver(event) {
|
|
484
|
+
if (this.draggedRowIndex() !== null) event.preventDefault();
|
|
485
|
+
}
|
|
486
|
+
onRowDrop(event, index) {
|
|
487
|
+
event.preventDefault();
|
|
488
|
+
const from = this.draggedRowIndex();
|
|
489
|
+
this.draggedRowIndex.set(null);
|
|
490
|
+
if (from === null || from === index) return;
|
|
491
|
+
const next = [...this.rows()];
|
|
492
|
+
const [moved] = next.splice(from, 1);
|
|
493
|
+
next.splice(index, 0, moved);
|
|
494
|
+
this.rows.set(next);
|
|
495
|
+
this.rowsReordered.emit(next);
|
|
496
|
+
}
|
|
497
|
+
onResizeMove = (event) => {
|
|
498
|
+
if (!this.resizeState) return;
|
|
499
|
+
const minWidth = this.columns().find((c) => c.id === this.resizeState.columnId)?.minWidth ?? 60;
|
|
500
|
+
const delta = event.clientX - this.resizeState.startX;
|
|
501
|
+
const width = Math.max(minWidth, this.resizeState.startWidth + delta);
|
|
502
|
+
this.columnWidths.update((widths) => ({
|
|
503
|
+
...widths,
|
|
504
|
+
[this.resizeState.columnId]: width
|
|
505
|
+
}));
|
|
506
|
+
};
|
|
507
|
+
onResizeEnd = () => {
|
|
508
|
+
this.resizeState = null;
|
|
509
|
+
document.removeEventListener("pointermove", this.onResizeMove);
|
|
510
|
+
document.removeEventListener("pointerup", this.onResizeEnd);
|
|
511
|
+
};
|
|
512
|
+
onColumnDragMove = (event) => {
|
|
513
|
+
const state = this.columnDragState;
|
|
514
|
+
if (!state) return;
|
|
515
|
+
this.dragPreview.update((preview) => preview && {
|
|
516
|
+
...preview,
|
|
517
|
+
x: event.clientX - state.pointerOffsetX
|
|
518
|
+
});
|
|
519
|
+
const columnId = (document.elementFromPoint(event.clientX, event.clientY)?.closest("th[data-column-id]"))?.dataset["columnId"];
|
|
520
|
+
this.dragOverColumnId.set(columnId && columnId !== state.columnId ? columnId : null);
|
|
521
|
+
};
|
|
522
|
+
onColumnDragEnd = () => {
|
|
523
|
+
const state = this.columnDragState;
|
|
524
|
+
const overId = this.dragOverColumnId();
|
|
525
|
+
this.columnDragState = null;
|
|
526
|
+
this.draggedColumnId.set(null);
|
|
527
|
+
this.dragOverColumnId.set(null);
|
|
528
|
+
this.dragPreview.set(null);
|
|
529
|
+
document.removeEventListener("pointermove", this.onColumnDragMove);
|
|
530
|
+
document.removeEventListener("pointerup", this.onColumnDragEnd);
|
|
531
|
+
if (!state || !overId || state.columnId === overId) return;
|
|
532
|
+
const order = this.columnOrderIds() ?? this.columns().map((c) => c.id);
|
|
533
|
+
const from = order.indexOf(state.columnId);
|
|
534
|
+
const to = order.indexOf(overId);
|
|
535
|
+
if (from === -1 || to === -1) return;
|
|
536
|
+
const next = [...order];
|
|
537
|
+
next.splice(from, 1);
|
|
538
|
+
next.splice(to, 0, state.columnId);
|
|
539
|
+
this.columnOrderIds.set(next);
|
|
540
|
+
};
|
|
541
|
+
setFilter(columnId, value) {
|
|
542
|
+
this.filters.update((filters) => {
|
|
543
|
+
const next = { ...filters };
|
|
544
|
+
if (value) next[columnId] = value;
|
|
545
|
+
else delete next[columnId];
|
|
546
|
+
return next;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
resetAndReload() {
|
|
550
|
+
this.currentPage.set(0);
|
|
551
|
+
this.reload();
|
|
552
|
+
}
|
|
553
|
+
emitSelectionChange() {
|
|
554
|
+
const ids = this.selectedRowIds();
|
|
555
|
+
const selectedRows = this.rows().filter((row, index) => ids.has(this.rowId()(row, index)));
|
|
556
|
+
this.selectionChange.emit(selectedRows);
|
|
557
|
+
}
|
|
558
|
+
fetch() {
|
|
559
|
+
this.loading.set(true);
|
|
560
|
+
this.error.set(false);
|
|
561
|
+
const params = {
|
|
562
|
+
page: this.currentPage(),
|
|
563
|
+
size: this.paginated() ? this.pageSize() : 0,
|
|
564
|
+
query: this.query(),
|
|
565
|
+
sort: this.sort(),
|
|
566
|
+
filters: this.filters()
|
|
567
|
+
};
|
|
568
|
+
this.loadedQuery = params.query;
|
|
569
|
+
this.loadedFilters = params.filters;
|
|
570
|
+
this.loadedSort = params.sort;
|
|
571
|
+
return this.dataSource().load(params).pipe(catchError(() => of(null)));
|
|
572
|
+
}
|
|
573
|
+
applyResult(result) {
|
|
574
|
+
this.loading.set(false);
|
|
575
|
+
if (result) {
|
|
576
|
+
this.rows.set(result.items);
|
|
577
|
+
this.total.set(result.total);
|
|
578
|
+
} else this.error.set(true);
|
|
579
|
+
this.cdr.markForCheck();
|
|
580
|
+
}
|
|
581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
582
|
+
minVersion: "12.0.0",
|
|
583
|
+
version: "22.2.1",
|
|
584
|
+
ngImport: i0,
|
|
585
|
+
type: UiTableComponent,
|
|
586
|
+
deps: [],
|
|
587
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
588
|
+
});
|
|
589
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
590
|
+
minVersion: "17.0.0",
|
|
591
|
+
version: "22.2.1",
|
|
592
|
+
type: UiTableComponent,
|
|
593
|
+
isStandalone: true,
|
|
594
|
+
selector: "ui-table",
|
|
595
|
+
inputs: {
|
|
596
|
+
classes: {
|
|
597
|
+
classPropertyName: "classes",
|
|
598
|
+
publicName: "classes",
|
|
599
|
+
isSignal: true,
|
|
600
|
+
isRequired: false,
|
|
601
|
+
transformFunction: null
|
|
602
|
+
},
|
|
603
|
+
tableId: {
|
|
604
|
+
classPropertyName: "tableId",
|
|
605
|
+
publicName: "tableId",
|
|
606
|
+
isSignal: true,
|
|
607
|
+
isRequired: false,
|
|
608
|
+
transformFunction: null
|
|
609
|
+
},
|
|
610
|
+
columns: {
|
|
611
|
+
classPropertyName: "columns",
|
|
612
|
+
publicName: "columns",
|
|
613
|
+
isSignal: true,
|
|
614
|
+
isRequired: true,
|
|
615
|
+
transformFunction: null
|
|
616
|
+
},
|
|
617
|
+
dataSource: {
|
|
618
|
+
classPropertyName: "dataSource",
|
|
619
|
+
publicName: "dataSource",
|
|
620
|
+
isSignal: true,
|
|
621
|
+
isRequired: true,
|
|
622
|
+
transformFunction: null
|
|
623
|
+
},
|
|
624
|
+
emptyMessage: {
|
|
625
|
+
classPropertyName: "emptyMessage",
|
|
626
|
+
publicName: "emptyMessage",
|
|
627
|
+
isSignal: true,
|
|
628
|
+
isRequired: false,
|
|
629
|
+
transformFunction: null
|
|
630
|
+
},
|
|
631
|
+
errorMessage: {
|
|
632
|
+
classPropertyName: "errorMessage",
|
|
633
|
+
publicName: "errorMessage",
|
|
634
|
+
isSignal: true,
|
|
635
|
+
isRequired: false,
|
|
636
|
+
transformFunction: null
|
|
637
|
+
},
|
|
638
|
+
rowId: {
|
|
639
|
+
classPropertyName: "rowId",
|
|
640
|
+
publicName: "rowId",
|
|
641
|
+
isSignal: true,
|
|
642
|
+
isRequired: false,
|
|
643
|
+
transformFunction: null
|
|
644
|
+
},
|
|
645
|
+
selectable: {
|
|
646
|
+
classPropertyName: "selectable",
|
|
647
|
+
publicName: "selectable",
|
|
648
|
+
isSignal: true,
|
|
649
|
+
isRequired: false,
|
|
650
|
+
transformFunction: null
|
|
651
|
+
},
|
|
652
|
+
searchable: {
|
|
653
|
+
classPropertyName: "searchable",
|
|
654
|
+
publicName: "searchable",
|
|
655
|
+
isSignal: true,
|
|
656
|
+
isRequired: false,
|
|
657
|
+
transformFunction: null
|
|
658
|
+
},
|
|
659
|
+
searchPlaceholder: {
|
|
660
|
+
classPropertyName: "searchPlaceholder",
|
|
661
|
+
publicName: "searchPlaceholder",
|
|
662
|
+
isSignal: true,
|
|
663
|
+
isRequired: false,
|
|
664
|
+
transformFunction: null
|
|
665
|
+
},
|
|
666
|
+
paginated: {
|
|
667
|
+
classPropertyName: "paginated",
|
|
668
|
+
publicName: "paginated",
|
|
669
|
+
isSignal: true,
|
|
670
|
+
isRequired: false,
|
|
671
|
+
transformFunction: null
|
|
672
|
+
},
|
|
673
|
+
pageSize: {
|
|
674
|
+
classPropertyName: "pageSize",
|
|
675
|
+
publicName: "pageSize",
|
|
676
|
+
isSignal: true,
|
|
677
|
+
isRequired: false,
|
|
678
|
+
transformFunction: null
|
|
679
|
+
},
|
|
680
|
+
toggleableColumns: {
|
|
681
|
+
classPropertyName: "toggleableColumns",
|
|
682
|
+
publicName: "toggleableColumns",
|
|
683
|
+
isSignal: true,
|
|
684
|
+
isRequired: false,
|
|
685
|
+
transformFunction: null
|
|
686
|
+
},
|
|
687
|
+
reorderableColumns: {
|
|
688
|
+
classPropertyName: "reorderableColumns",
|
|
689
|
+
publicName: "reorderableColumns",
|
|
690
|
+
isSignal: true,
|
|
691
|
+
isRequired: false,
|
|
692
|
+
transformFunction: null
|
|
693
|
+
},
|
|
694
|
+
reorderableRows: {
|
|
695
|
+
classPropertyName: "reorderableRows",
|
|
696
|
+
publicName: "reorderableRows",
|
|
697
|
+
isSignal: true,
|
|
698
|
+
isRequired: false,
|
|
699
|
+
transformFunction: null
|
|
700
|
+
},
|
|
701
|
+
stickyHeader: {
|
|
702
|
+
classPropertyName: "stickyHeader",
|
|
703
|
+
publicName: "stickyHeader",
|
|
704
|
+
isSignal: true,
|
|
705
|
+
isRequired: false,
|
|
706
|
+
transformFunction: null
|
|
707
|
+
},
|
|
708
|
+
headerless: {
|
|
709
|
+
classPropertyName: "headerless",
|
|
710
|
+
publicName: "headerless",
|
|
711
|
+
isSignal: true,
|
|
712
|
+
isRequired: false,
|
|
713
|
+
transformFunction: null
|
|
714
|
+
},
|
|
715
|
+
groupHeading: {
|
|
716
|
+
classPropertyName: "groupHeading",
|
|
717
|
+
publicName: "groupHeading",
|
|
718
|
+
isSignal: true,
|
|
719
|
+
isRequired: false,
|
|
720
|
+
transformFunction: null
|
|
721
|
+
},
|
|
722
|
+
actions: {
|
|
723
|
+
classPropertyName: "actions",
|
|
724
|
+
publicName: "actions",
|
|
725
|
+
isSignal: true,
|
|
726
|
+
isRequired: false,
|
|
727
|
+
transformFunction: null
|
|
728
|
+
},
|
|
729
|
+
sort: {
|
|
730
|
+
classPropertyName: "sort",
|
|
731
|
+
publicName: "sort",
|
|
732
|
+
isSignal: true,
|
|
733
|
+
isRequired: false,
|
|
734
|
+
transformFunction: null
|
|
735
|
+
},
|
|
736
|
+
selectedRowIds: {
|
|
737
|
+
classPropertyName: "selectedRowIds",
|
|
738
|
+
publicName: "selectedRowIds",
|
|
739
|
+
isSignal: true,
|
|
740
|
+
isRequired: false,
|
|
741
|
+
transformFunction: null
|
|
742
|
+
}
|
|
743
|
+
},
|
|
744
|
+
outputs: {
|
|
745
|
+
sort: "sortChange",
|
|
746
|
+
selectedRowIds: "selectedRowIdsChange",
|
|
747
|
+
selectionChange: "selectionChange",
|
|
748
|
+
rowsReordered: "rowsReordered"
|
|
749
|
+
},
|
|
750
|
+
host: { classAttribute: "block" },
|
|
751
|
+
providers: [provideIcons({
|
|
752
|
+
heroMagnifyingGlass,
|
|
753
|
+
heroFunnel,
|
|
754
|
+
heroViewColumns,
|
|
755
|
+
heroBars2
|
|
756
|
+
})],
|
|
757
|
+
queries: [{
|
|
758
|
+
propertyName: "bar",
|
|
759
|
+
first: true,
|
|
760
|
+
predicate: UiTableBarDirective,
|
|
761
|
+
descendants: true,
|
|
762
|
+
isSignal: true
|
|
763
|
+
}, {
|
|
764
|
+
propertyName: "cellDirectives",
|
|
765
|
+
predicate: UiTableCellDirective,
|
|
766
|
+
isSignal: true
|
|
767
|
+
}],
|
|
768
|
+
ngImport: i0,
|
|
769
|
+
template: "@if (searchable() || hasFilterableColumns() || toggleableColumns()) {\n <div class=\"ui-table-toolbar\">\n @if (searchable()) {\n <ui-input\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n [placeholder]=\"searchPlaceholder()\"\n class=\"max-w-xs\"\n >\n <ng-template #leading>\n <ng-icon\n name=\"heroMagnifyingGlass\"\n class=\"ms-3 size-4 text-muted-foreground-1\"\n />\n </ng-template>\n </ui-input>\n }\n\n @if (hasFilterableColumns()) {\n <ui-dropdown\n [isOpen]=\"filterMenuOpen\"\n placement=\"bottom-start\"\n closeBehaviour=\"whenClickOutside\"\n >\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n (click)=\"filterMenuOpen.update(open => !open)\"\n >\n <ng-icon name=\"heroFunnel\" class=\"size-4\" />\n Filters\n @if (activeFilterCount()) {\n <span class=\"ui-table-filter-count ui-text-caption\">\n {{ activeFilterCount() }}\n </span>\n }\n </ui-button>\n\n @if (filterMenuOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <div class=\"ui-table-filter-menu\">\n @for (column of filterableColumns(); track column.id) {\n <div class=\"flex flex-col gap-1\">\n <span\n class=\"text-muted-foreground-1 ui-text-caption\"\n >\n {{ column.header }}\n </span>\n\n @if (column.filterOptions) {\n <ui-select\n [dataSource]=\"filterDataSource(column)\"\n [selectedItem]=\"selectedFilterOption(column)\"\n (selectionChange)=\"onFilterSelect(column.id, $event)\"\n [displayWith]=\"column.sensitive ? sensitiveFilterOptionLabel : filterOptionLabel\"\n [clearable]=\"true\"\n clearLabel=\"All\"\n placeholder=\"All\"\n />\n } @else {\n <ui-input\n [value]=\"filterValue(column.id)\"\n (valueChange)=\"onFilterInput(column.id, $event)\"\n placeholder=\"Filter...\"\n [ariaLabel]=\"'Filter ' + column.header\"\n />\n }\n </div>\n }\n\n @if (activeFilterCount()) {\n <ui-button\n appearance=\"link\"\n intent=\"secondary\"\n class=\"text-end\"\n classes=\"self-end p-0! text-sm\"\n (click)=\"clearFilters()\"\n >\n Clear filters\n </ui-button>\n }\n </div>\n </div>\n }\n </ui-dropdown>\n }\n\n @if (toggleableColumns()) {\n <ui-dropdown\n [isOpen]=\"columnMenuOpen\"\n placement=\"bottom-end\"\n closeBehaviour=\"whenClickOutside\"\n class=\"ms-auto\"\n >\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n (click)=\"columnMenuOpen.update(open => !open)\"\n >\n <ng-icon name=\"heroViewColumns\" class=\"size-4\" />\n Columns\n </ui-button>\n\n @if (columnMenuOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <div class=\"bg-layer shadow-xs py-1 border border-dropdown-divider rounded-lg min-w-40\">\n @for (column of hideableColumns(); track column.id) {\n <label\n class=\"flex items-center gap-2 hover:bg-dropdown-item-hover px-3 py-2 ui-text-body-alt cursor-pointer\"\n >\n <ui-checkbox\n [value]=\"isColumnVisible(column)\"\n (valueChange)=\"toggleColumnVisibility(column)\"\n />\n {{ column.header }}\n </label>\n }\n </div>\n </div>\n }\n </ui-dropdown>\n }\n </div>\n}\n\n<div class=\"ui-table-scroll\">\n <table [class]=\"generatedClasses()\" [style.width.px]=\"fixedWidth()\">\n <colgroup>\n @if (selectable()) {\n <col [style.width.px]=\"44\" />\n }\n\n @for (column of renderColumns(); track column.id) {\n <col [style.width.px]=\"columnWidth(column)\" />\n }\n\n @if (hasActions()) {\n <col [style.width.px]=\"actionsColumnWidth()\" />\n }\n </colgroup>\n\n @if (hasBar() || !headerless()) {\n <thead [class.ui-table-sticky]=\"stickyHeader()\">\n @if (hasBar()) {\n <!-- a row of the table, so its checkbox and content line up with the columns below -->\n <tr class=\"ui-table-bar-row\">\n @if (selectable()) {\n <th class=\"ui-table-select-cell\">\n <ui-checkbox\n [value]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (valueChange)=\"toggleSelectAll()\"\n />\n </th>\n }\n <th [attr.colspan]=\"columnSpan() - (selectable() ? 1 : 0)\">\n <ng-content select=\"[uiTableBar]\" />\n </th>\n </tr>\n }\n @if (!headerless()) {\n <tr>\n @if (selectable()) {\n <th class=\"text-center! ui-table-select-cell\">\n <ui-checkbox\n [value]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (valueChange)=\"toggleSelectAll()\"\n />\n </th>\n }\n\n @for (column of renderColumns(); track column.id) {\n <th\n scope=\"col\"\n [attr.data-column-id]=\"column.id\"\n [class.ui-table-pinned]=\"isPinned(column)\"\n [attr.data-pin]=\"column.pin || null\"\n [class.ui-table-column-dragging]=\"draggedColumnId() === column.id\"\n [class.ui-table-column-drag-over]=\"dragOverColumnId() === column.id\"\n [style.left.px]=\"leftOffset(column)\"\n [style.right.px]=\"rightOffset(column)\"\n >\n <div class=\"ui-table-th-content\">\n @if (reorderableColumns() && column.reorderable !== false) {\n <ng-icon\n name=\"heroBars2\"\n class=\"ui-table-drag-handle\"\n (pointerdown)=\"onColumnDragStart($event, column)\"\n />\n }\n\n @if (column.sortable) {\n <ui-button\n appearance=\"none\"\n classes=\"flex items-center gap-1 p-0! border-transparent! rounded-none! cursor-pointer hover:text-foreground focus-visible:text-foreground\"\n (click)=\"toggleSort(column)\"\n >\n <span\n class=\"font-medium text-muted-foreground-1 ui-text-caption uppercase\"\n >\n {{ column.header }}\n </span>\n <svg\n viewBox=\"0 0 8 13\"\n aria-hidden=\"true\"\n class=\"ui-table-sort\"\n [attr.data-direction]=\"sortDirection(column)\"\n >\n <path class=\"ui-table-sort-asc\" d=\"M4 0 8 5H0z\" />\n <path class=\"ui-table-sort-desc\" d=\"M4 13 0 8h8z\" />\n </svg>\n </ui-button>\n } @else {\n <span\n class=\"font-medium text-muted-foreground-1 ui-text-caption ui-text-caption uppercase\"\n >\n {{ column.header }}\n </span>\n }\n </div>\n\n @if (column.resizable) {\n <span\n class=\"ui-table-resize-handle\"\n (pointerdown)=\"startResize($event, column)\"\n ></span>\n }\n </th>\n }\n\n @if (hasActions()) {\n <th class=\"ui-table-actions-cell\"></th>\n }\n </tr>\n }\n </thead>\n }\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status\"\n >\n <ui-loading type=\"loading-dots\" />\n </td>\n </tr>\n } @else if (error()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status ui-table-status-error\"\n >\n {{ errorMessage() }}\n <ui-button\n appearance=\"link\"\n intent=\"danger\"\n classes=\"ms-1 p-0! text-sm underline\"\n (click)=\"reload()\"\n >\n Retry\n </ui-button>\n </td>\n </tr>\n } @else if (isEmpty()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status\"\n >\n {{ emptyMessage() }}\n </td>\n </tr>\n } @else {\n @for (row of rows(); track rowId()(row, $index); let i = $index) {\n @if (groupHeadings()[i]; as heading) {\n <tr class=\"ui-table-group-row\">\n <th scope=\"rowgroup\" [attr.colspan]=\"columnSpan()\">{{ heading }}</th>\n </tr>\n }\n <tr\n [class.ui-table-row-selected]=\"isRowSelected(row, i)\"\n [class.ui-table-row-dragging]=\"draggedRowIndex() === i\"\n [draggable]=\"canReorderRows()\"\n (dragstart)=\"onRowDragStart($event, i)\"\n (dragover)=\"onRowDragOver($event)\"\n (drop)=\"onRowDrop($event, i)\"\n >\n @if (selectable()) {\n <td class=\"ui-table-select-cell\">\n <ui-checkbox\n [value]=\"isRowSelected(row, i)\"\n (valueChange)=\"toggleRow(row, i)\"\n />\n </td>\n }\n\n @for (column of renderColumns(); track column.id) {\n <td\n [class.ui-table-pinned]=\"isPinned(column)\"\n [attr.data-pin]=\"column.pin || null\"\n [style.left.px]=\"leftOffset(column)\"\n [style.right.px]=\"rightOffset(column)\"\n >\n @if (cellTemplates().get(column.id); as template) {\n @if (column.sensitive && privacy() !== 'visible') {\n <ui-private [text]=\"formattedCellValue(column, row)\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"template; context: { $implicit: row, value: cellValue(column, row) }\"\n />\n }\n } @else if (column.displayType === 'icon') {\n <ng-icon\n [name]=\"cellIconValue(column, row)\"\n class=\"size-4\"\n />\n } @else if (column.displayType === 'currency') {\n <ui-money\n [value]=\"moneyCellValue(column, row)\"\n [currency]=\"column.currency ?? uiFormat.currency\"\n placeholder=\"\"\n />\n } @else if (column.sensitive) {\n <ui-private [text]=\"formattedCellValue(column, row)\" />\n } @else {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n <div class=\"ui-table-actions\">\n @for (action of actions(); track action.id) {\n <ui-tooltip [text]=\"action.label\">\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hover:bg-surface-hover hover:text-foreground focus-visible:bg-surface-hover focus-visible:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n </ui-tooltip>\n }\n </div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (dragPreview(); as preview) {\n <div\n class=\"ui-table-drag-preview ui-text-body-alt\"\n [style.left.px]=\"preview.x\"\n [style.top.px]=\"preview.y\"\n [style.width.px]=\"preview.width\"\n [style.height.px]=\"preview.height\"\n >\n <ng-icon name=\"heroBars2\" class=\"ui-table-drag-preview-icon\" />\n <span class=\"truncate\">{{ preview.label }}</span>\n </div>\n}\n\n@if (paginated()) {\n <div class=\"ui-table-footer\">\n <span class=\"text-muted-foreground-1 ui-text-caption\">{{\n resultsLabel()\n }}</span>\n\n <div class=\"ui-table-pagination\">\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n [disabled]=\"currentPage() === 0\"\n (click)=\"goToPage(currentPage() - 1)\"\n >\n Prev\n </ui-button>\n\n <span class=\"ui-text-body-alt\">Page {{ currentPage() + 1 }} of {{\n totalPages()\n }}</span>\n\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n [disabled]=\"currentPage() + 1 >= totalPages()\"\n (click)=\"goToPage(currentPage() + 1)\"\n >\n Next\n </ui-button>\n </div>\n </div>\n}\n",
|
|
770
|
+
styles: ["@layer properties;:host{min-width:100%}.ui-table-toolbar{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3)}.ui-table-scroll{overflow-x:auto;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--table-line)}.ui-table-scroll::-webkit-scrollbar{height:calc(var(--spacing, .25rem) * 2)}.ui-table-scroll::-webkit-scrollbar-thumb{border-radius:0}.ui-table-scroll::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb)}.ui-table-scroll::-webkit-scrollbar-track{background-color:var(--scrollbar-track)}.ui-table-scroll:has(.ui-table-sticky){max-height:480px}.ui-table{min-width:100%}.ui-table--fixed{table-layout:fixed}.ui-table thead{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--table-line);background-color:var(--muted)}.ui-table thead:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table thead.ui-table-sticky{position:sticky;top:0;z-index:20}.ui-table th{padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 3);text-align:start}.ui-table td{overflow:hidden;text-overflow:ellipsis;padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 4);white-space:nowrap}.ui-table tbody{background-color:var(--layer)}:where(.ui-table tbody>:not(:last-child)){--tw-divide-y-reverse: 0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.ui-table tbody>:not(:last-child)){border-color:var(--table-line)}.ui-table tbody tr:last-child{border-bottom-style:var(--tw-border-style)!important;border-bottom-width:0px!important}.ui-table tbody tr:hover{background-color:var(--muted)}.ui-table-row-selected{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table-row-dragging{opacity:40%}.ui-table-pinned{position:sticky;z-index:10;background-color:var(--layer)}.ui-table-row-selected .ui-table-pinned{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table th.ui-table-pinned{position:sticky;z-index:30;background-color:var(--muted)}.ui-table th.ui-table-pinned:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table [data-pin=left]{border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--border-line-2)}.ui-table [data-pin=right]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border-line-2)}.ui-table-th-content{display:flex;align-items:center;gap:var(--spacing, .25rem)}.ui-table-sort{height:calc(var(--spacing, .25rem) * 3);width:calc(var(--spacing, .25rem) * 2);flex-shrink:0;fill:currentcolor;color:var(--muted-foreground-1)}.ui-table-sort path{opacity:30%;transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))}.ui-table-sort[data-direction]{color:var(--color-primary-500, var(--color-blue-500))}.ui-table-sort[data-direction=asc] .ui-table-sort-asc,.ui-table-sort[data-direction=desc] .ui-table-sort-desc{opacity:100%}.ui-table-drag-handle{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;cursor:grab;color:var(--muted-foreground-1)}.ui-table-column-dragging{opacity:40%}.ui-table-column-drag-over{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table-drag-preview{pointer-events:none;position:fixed;z-index:50;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer);padding-right:calc(var(--spacing, .25rem) * 3);padding-left:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--foreground);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-table-drag-preview-icon{width:calc(var(--spacing, .25rem) * 3.5);height:calc(var(--spacing, .25rem) * 3.5);flex-shrink:0;color:var(--color-primary-500, var(--color-blue-500))}.ui-table-resize-handle{position:absolute;top:0;right:0;height:100%;width:calc(var(--spacing, .25rem) * 1.5);cursor:col-resize}.ui-table-resize-handle:hover,.ui-table-resize-handle:focus-visible{background-color:var(--color-primary-300, var(--color-blue-300))}.ui-table-filter-menu{display:flex;width:calc(var(--spacing, .25rem) * 64);flex-direction:column;gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--dropdown-divider);background-color:var(--layer);padding:calc(var(--spacing, .25rem) * 3);--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-table-filter-count{display:inline-flex;height:calc(var(--spacing, .25rem) * 5);min-width:calc(var(--spacing, .25rem) * 5);align-items:center;justify-content:center;border-radius:var(--radius-full, calc(infinity * 1px));background-color:var(--color-primary-50, var(--color-blue-50));padding-inline:var(--spacing, .25rem);color:var(--color-primary-600, var(--color-blue-600))}.ui-table .ui-table-select-cell,.ui-table .ui-table-actions-cell{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:center}.ui-table-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing, .25rem)}.ui-table-status{padding-block:calc(var(--spacing, .25rem) * 8);text-align:center;color:var(--muted-foreground-1)}.ui-table-status-error{color:var(--color-danger-500, var(--color-red-500))}.ui-table .ui-table-bar-row th{background-color:var(--layer);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-normal, 400);font-weight:var(--font-weight-normal, 400)}.ui-table .ui-table-group-row th{background-color:var(--muted);padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 2);text-align:start;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--muted-foreground-1)}.ui-table .ui-table-group-row th:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table-footer{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3)}.ui-table-pagination{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 3)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-divide-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-divide-y-reverse: 0;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"],
|
|
771
|
+
dependencies: [
|
|
772
|
+
{
|
|
773
|
+
kind: "component",
|
|
774
|
+
type: NgIcon,
|
|
775
|
+
selector: "ng-icon",
|
|
776
|
+
inputs: [
|
|
777
|
+
"name",
|
|
778
|
+
"svg",
|
|
779
|
+
"size",
|
|
780
|
+
"strokeWidth",
|
|
781
|
+
"color"
|
|
782
|
+
]
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
kind: "directive",
|
|
786
|
+
type: NgTemplateOutlet,
|
|
787
|
+
selector: "[ngTemplateOutlet]",
|
|
788
|
+
inputs: [
|
|
789
|
+
"ngTemplateOutletContext",
|
|
790
|
+
"ngTemplateOutlet",
|
|
791
|
+
"ngTemplateOutletInjector"
|
|
792
|
+
]
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
kind: "component",
|
|
796
|
+
type: UiButtonComponent,
|
|
797
|
+
selector: "ui-button",
|
|
798
|
+
inputs: [
|
|
799
|
+
"appearance",
|
|
800
|
+
"intent",
|
|
801
|
+
"size",
|
|
802
|
+
"classes",
|
|
803
|
+
"type",
|
|
804
|
+
"ariaLabel",
|
|
805
|
+
"disabled",
|
|
806
|
+
"loading"
|
|
807
|
+
]
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
kind: "component",
|
|
811
|
+
type: UiCheckboxComponent,
|
|
812
|
+
selector: "ui-checkbox",
|
|
813
|
+
inputs: [
|
|
814
|
+
"value",
|
|
815
|
+
"id",
|
|
816
|
+
"name",
|
|
817
|
+
"required",
|
|
818
|
+
"disabled",
|
|
819
|
+
"indeterminate",
|
|
820
|
+
"validationState",
|
|
821
|
+
"classes"
|
|
822
|
+
],
|
|
823
|
+
outputs: ["valueChange", "validationStateChange"]
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
kind: "component",
|
|
827
|
+
type: UiDropdownComponent,
|
|
828
|
+
selector: "ui-dropdown",
|
|
829
|
+
inputs: [
|
|
830
|
+
"isOpen",
|
|
831
|
+
"placement",
|
|
832
|
+
"closeBehaviour",
|
|
833
|
+
"offset",
|
|
834
|
+
"viewportPadding",
|
|
835
|
+
"matchWidth"
|
|
836
|
+
],
|
|
837
|
+
exportAs: ["uiDropdown"]
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
kind: "directive",
|
|
841
|
+
type: UiDropdownDirective,
|
|
842
|
+
selector: "[uiDropdownContent]"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
kind: "component",
|
|
846
|
+
type: UiInputComponent,
|
|
847
|
+
selector: "ui-input",
|
|
848
|
+
inputs: [
|
|
849
|
+
"value",
|
|
850
|
+
"classes",
|
|
851
|
+
"type",
|
|
852
|
+
"id",
|
|
853
|
+
"name",
|
|
854
|
+
"placeholder",
|
|
855
|
+
"autocomplete",
|
|
856
|
+
"inputmode",
|
|
857
|
+
"required",
|
|
858
|
+
"disabled",
|
|
859
|
+
"readonly",
|
|
860
|
+
"validationState",
|
|
861
|
+
"min",
|
|
862
|
+
"max",
|
|
863
|
+
"step",
|
|
864
|
+
"pattern",
|
|
865
|
+
"minlength",
|
|
866
|
+
"maxlength",
|
|
867
|
+
"autofocus",
|
|
868
|
+
"spellcheck",
|
|
869
|
+
"revealable",
|
|
870
|
+
"list",
|
|
871
|
+
"ariaLabel",
|
|
872
|
+
"describedBy",
|
|
873
|
+
"inputRole",
|
|
874
|
+
"ariaExpanded",
|
|
875
|
+
"ariaControls",
|
|
876
|
+
"ariaActiveDescendant",
|
|
877
|
+
"ariaAutocomplete",
|
|
878
|
+
"ariaHasPopup"
|
|
879
|
+
],
|
|
880
|
+
outputs: [
|
|
881
|
+
"valueChange",
|
|
882
|
+
"validationStateChange",
|
|
883
|
+
"focused",
|
|
884
|
+
"blurred"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
kind: "component",
|
|
889
|
+
type: UiSelectComponent,
|
|
890
|
+
selector: "ui-select",
|
|
891
|
+
inputs: [
|
|
892
|
+
"placement",
|
|
893
|
+
"closeBehaviour",
|
|
894
|
+
"dataSource",
|
|
895
|
+
"placeholder",
|
|
896
|
+
"id",
|
|
897
|
+
"describedBy",
|
|
898
|
+
"pageSize",
|
|
899
|
+
"searchMode",
|
|
900
|
+
"disabled",
|
|
901
|
+
"validationState",
|
|
902
|
+
"clearable",
|
|
903
|
+
"clearLabel",
|
|
904
|
+
"creatable",
|
|
905
|
+
"createLabel",
|
|
906
|
+
"groupBy",
|
|
907
|
+
"scrollToSelected",
|
|
908
|
+
"multiple",
|
|
909
|
+
"multipleDisplay",
|
|
910
|
+
"counterAfter",
|
|
911
|
+
"counterLabel",
|
|
912
|
+
"compareWith",
|
|
913
|
+
"displayWith",
|
|
914
|
+
"selectedItem",
|
|
915
|
+
"selectedItems"
|
|
916
|
+
],
|
|
917
|
+
outputs: [
|
|
918
|
+
"validationStateChange",
|
|
919
|
+
"selectionChange",
|
|
920
|
+
"create",
|
|
921
|
+
"selectedItemChange",
|
|
922
|
+
"selectedItemsChange"
|
|
923
|
+
]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
kind: "component",
|
|
927
|
+
type: UiLoadingComponent,
|
|
928
|
+
selector: "ui-loading",
|
|
929
|
+
inputs: ["type"]
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
kind: "component",
|
|
933
|
+
type: UiMoneyComponent,
|
|
934
|
+
selector: "ui-money",
|
|
935
|
+
inputs: [
|
|
936
|
+
"value",
|
|
937
|
+
"currency",
|
|
938
|
+
"locale",
|
|
939
|
+
"signDisplay",
|
|
940
|
+
"colourBySign",
|
|
941
|
+
"wholeUnits",
|
|
942
|
+
"compact",
|
|
943
|
+
"placeholder"
|
|
944
|
+
]
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
kind: "component",
|
|
948
|
+
type: UiPrivateComponent,
|
|
949
|
+
selector: "ui-private",
|
|
950
|
+
inputs: ["text"]
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
kind: "component",
|
|
954
|
+
type: UiTooltipComponent,
|
|
955
|
+
selector: "ui-tooltip",
|
|
956
|
+
inputs: [
|
|
957
|
+
"text",
|
|
958
|
+
"placement",
|
|
959
|
+
"trigger",
|
|
960
|
+
"classes",
|
|
961
|
+
"isOpen"
|
|
962
|
+
],
|
|
963
|
+
exportAs: ["uiTooltip"]
|
|
964
|
+
}
|
|
965
|
+
]
|
|
966
|
+
});
|
|
967
|
+
};
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
969
|
+
minVersion: "12.0.0",
|
|
970
|
+
version: "22.2.1",
|
|
971
|
+
ngImport: i0,
|
|
972
|
+
type: UiTableComponent,
|
|
973
|
+
decorators: [{
|
|
974
|
+
type: Component,
|
|
975
|
+
args: [{
|
|
976
|
+
selector: "ui-table",
|
|
977
|
+
imports: [
|
|
978
|
+
NgIcon,
|
|
979
|
+
NgTemplateOutlet,
|
|
980
|
+
UiButtonComponent,
|
|
981
|
+
UiCheckboxComponent,
|
|
982
|
+
UiDropdownComponent,
|
|
983
|
+
UiDropdownDirective,
|
|
984
|
+
UiInputComponent,
|
|
985
|
+
UiSelectComponent,
|
|
986
|
+
UiLoadingComponent,
|
|
987
|
+
UiMoneyComponent,
|
|
988
|
+
UiPrivateComponent,
|
|
989
|
+
UiTooltipComponent
|
|
990
|
+
],
|
|
991
|
+
host: { class: "block" },
|
|
992
|
+
providers: [provideIcons({
|
|
993
|
+
heroMagnifyingGlass,
|
|
994
|
+
heroFunnel,
|
|
995
|
+
heroViewColumns,
|
|
996
|
+
heroBars2
|
|
997
|
+
})],
|
|
998
|
+
template: "@if (searchable() || hasFilterableColumns() || toggleableColumns()) {\n <div class=\"ui-table-toolbar\">\n @if (searchable()) {\n <ui-input\n [value]=\"query()\"\n (valueChange)=\"onQueryChange($event)\"\n [placeholder]=\"searchPlaceholder()\"\n class=\"max-w-xs\"\n >\n <ng-template #leading>\n <ng-icon\n name=\"heroMagnifyingGlass\"\n class=\"ms-3 size-4 text-muted-foreground-1\"\n />\n </ng-template>\n </ui-input>\n }\n\n @if (hasFilterableColumns()) {\n <ui-dropdown\n [isOpen]=\"filterMenuOpen\"\n placement=\"bottom-start\"\n closeBehaviour=\"whenClickOutside\"\n >\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n (click)=\"filterMenuOpen.update(open => !open)\"\n >\n <ng-icon name=\"heroFunnel\" class=\"size-4\" />\n Filters\n @if (activeFilterCount()) {\n <span class=\"ui-table-filter-count ui-text-caption\">\n {{ activeFilterCount() }}\n </span>\n }\n </ui-button>\n\n @if (filterMenuOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <div class=\"ui-table-filter-menu\">\n @for (column of filterableColumns(); track column.id) {\n <div class=\"flex flex-col gap-1\">\n <span\n class=\"text-muted-foreground-1 ui-text-caption\"\n >\n {{ column.header }}\n </span>\n\n @if (column.filterOptions) {\n <ui-select\n [dataSource]=\"filterDataSource(column)\"\n [selectedItem]=\"selectedFilterOption(column)\"\n (selectionChange)=\"onFilterSelect(column.id, $event)\"\n [displayWith]=\"column.sensitive ? sensitiveFilterOptionLabel : filterOptionLabel\"\n [clearable]=\"true\"\n clearLabel=\"All\"\n placeholder=\"All\"\n />\n } @else {\n <ui-input\n [value]=\"filterValue(column.id)\"\n (valueChange)=\"onFilterInput(column.id, $event)\"\n placeholder=\"Filter...\"\n [ariaLabel]=\"'Filter ' + column.header\"\n />\n }\n </div>\n }\n\n @if (activeFilterCount()) {\n <ui-button\n appearance=\"link\"\n intent=\"secondary\"\n class=\"text-end\"\n classes=\"self-end p-0! text-sm\"\n (click)=\"clearFilters()\"\n >\n Clear filters\n </ui-button>\n }\n </div>\n </div>\n }\n </ui-dropdown>\n }\n\n @if (toggleableColumns()) {\n <ui-dropdown\n [isOpen]=\"columnMenuOpen\"\n placement=\"bottom-end\"\n closeBehaviour=\"whenClickOutside\"\n class=\"ms-auto\"\n >\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n (click)=\"columnMenuOpen.update(open => !open)\"\n >\n <ng-icon name=\"heroViewColumns\" class=\"size-4\" />\n Columns\n </ui-button>\n\n @if (columnMenuOpen()) {\n <div uiDropdownContent class=\"py-2\">\n <div class=\"bg-layer shadow-xs py-1 border border-dropdown-divider rounded-lg min-w-40\">\n @for (column of hideableColumns(); track column.id) {\n <label\n class=\"flex items-center gap-2 hover:bg-dropdown-item-hover px-3 py-2 ui-text-body-alt cursor-pointer\"\n >\n <ui-checkbox\n [value]=\"isColumnVisible(column)\"\n (valueChange)=\"toggleColumnVisibility(column)\"\n />\n {{ column.header }}\n </label>\n }\n </div>\n </div>\n }\n </ui-dropdown>\n }\n </div>\n}\n\n<div class=\"ui-table-scroll\">\n <table [class]=\"generatedClasses()\" [style.width.px]=\"fixedWidth()\">\n <colgroup>\n @if (selectable()) {\n <col [style.width.px]=\"44\" />\n }\n\n @for (column of renderColumns(); track column.id) {\n <col [style.width.px]=\"columnWidth(column)\" />\n }\n\n @if (hasActions()) {\n <col [style.width.px]=\"actionsColumnWidth()\" />\n }\n </colgroup>\n\n @if (hasBar() || !headerless()) {\n <thead [class.ui-table-sticky]=\"stickyHeader()\">\n @if (hasBar()) {\n <!-- a row of the table, so its checkbox and content line up with the columns below -->\n <tr class=\"ui-table-bar-row\">\n @if (selectable()) {\n <th class=\"ui-table-select-cell\">\n <ui-checkbox\n [value]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (valueChange)=\"toggleSelectAll()\"\n />\n </th>\n }\n <th [attr.colspan]=\"columnSpan() - (selectable() ? 1 : 0)\">\n <ng-content select=\"[uiTableBar]\" />\n </th>\n </tr>\n }\n @if (!headerless()) {\n <tr>\n @if (selectable()) {\n <th class=\"text-center! ui-table-select-cell\">\n <ui-checkbox\n [value]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (valueChange)=\"toggleSelectAll()\"\n />\n </th>\n }\n\n @for (column of renderColumns(); track column.id) {\n <th\n scope=\"col\"\n [attr.data-column-id]=\"column.id\"\n [class.ui-table-pinned]=\"isPinned(column)\"\n [attr.data-pin]=\"column.pin || null\"\n [class.ui-table-column-dragging]=\"draggedColumnId() === column.id\"\n [class.ui-table-column-drag-over]=\"dragOverColumnId() === column.id\"\n [style.left.px]=\"leftOffset(column)\"\n [style.right.px]=\"rightOffset(column)\"\n >\n <div class=\"ui-table-th-content\">\n @if (reorderableColumns() && column.reorderable !== false) {\n <ng-icon\n name=\"heroBars2\"\n class=\"ui-table-drag-handle\"\n (pointerdown)=\"onColumnDragStart($event, column)\"\n />\n }\n\n @if (column.sortable) {\n <ui-button\n appearance=\"none\"\n classes=\"flex items-center gap-1 p-0! border-transparent! rounded-none! cursor-pointer hover:text-foreground focus-visible:text-foreground\"\n (click)=\"toggleSort(column)\"\n >\n <span\n class=\"font-medium text-muted-foreground-1 ui-text-caption uppercase\"\n >\n {{ column.header }}\n </span>\n <svg\n viewBox=\"0 0 8 13\"\n aria-hidden=\"true\"\n class=\"ui-table-sort\"\n [attr.data-direction]=\"sortDirection(column)\"\n >\n <path class=\"ui-table-sort-asc\" d=\"M4 0 8 5H0z\" />\n <path class=\"ui-table-sort-desc\" d=\"M4 13 0 8h8z\" />\n </svg>\n </ui-button>\n } @else {\n <span\n class=\"font-medium text-muted-foreground-1 ui-text-caption ui-text-caption uppercase\"\n >\n {{ column.header }}\n </span>\n }\n </div>\n\n @if (column.resizable) {\n <span\n class=\"ui-table-resize-handle\"\n (pointerdown)=\"startResize($event, column)\"\n ></span>\n }\n </th>\n }\n\n @if (hasActions()) {\n <th class=\"ui-table-actions-cell\"></th>\n }\n </tr>\n }\n </thead>\n }\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status\"\n >\n <ui-loading type=\"loading-dots\" />\n </td>\n </tr>\n } @else if (error()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status ui-table-status-error\"\n >\n {{ errorMessage() }}\n <ui-button\n appearance=\"link\"\n intent=\"danger\"\n classes=\"ms-1 p-0! text-sm underline\"\n (click)=\"reload()\"\n >\n Retry\n </ui-button>\n </td>\n </tr>\n } @else if (isEmpty()) {\n <tr>\n <td\n [attr.colspan]=\"columnSpan()\"\n class=\"ui-table-status\"\n >\n {{ emptyMessage() }}\n </td>\n </tr>\n } @else {\n @for (row of rows(); track rowId()(row, $index); let i = $index) {\n @if (groupHeadings()[i]; as heading) {\n <tr class=\"ui-table-group-row\">\n <th scope=\"rowgroup\" [attr.colspan]=\"columnSpan()\">{{ heading }}</th>\n </tr>\n }\n <tr\n [class.ui-table-row-selected]=\"isRowSelected(row, i)\"\n [class.ui-table-row-dragging]=\"draggedRowIndex() === i\"\n [draggable]=\"canReorderRows()\"\n (dragstart)=\"onRowDragStart($event, i)\"\n (dragover)=\"onRowDragOver($event)\"\n (drop)=\"onRowDrop($event, i)\"\n >\n @if (selectable()) {\n <td class=\"ui-table-select-cell\">\n <ui-checkbox\n [value]=\"isRowSelected(row, i)\"\n (valueChange)=\"toggleRow(row, i)\"\n />\n </td>\n }\n\n @for (column of renderColumns(); track column.id) {\n <td\n [class.ui-table-pinned]=\"isPinned(column)\"\n [attr.data-pin]=\"column.pin || null\"\n [style.left.px]=\"leftOffset(column)\"\n [style.right.px]=\"rightOffset(column)\"\n >\n @if (cellTemplates().get(column.id); as template) {\n @if (column.sensitive && privacy() !== 'visible') {\n <ui-private [text]=\"formattedCellValue(column, row)\" />\n } @else {\n <ng-container\n *ngTemplateOutlet=\"template; context: { $implicit: row, value: cellValue(column, row) }\"\n />\n }\n } @else if (column.displayType === 'icon') {\n <ng-icon\n [name]=\"cellIconValue(column, row)\"\n class=\"size-4\"\n />\n } @else if (column.displayType === 'currency') {\n <ui-money\n [value]=\"moneyCellValue(column, row)\"\n [currency]=\"column.currency ?? uiFormat.currency\"\n placeholder=\"\"\n />\n } @else if (column.sensitive) {\n <ui-private [text]=\"formattedCellValue(column, row)\" />\n } @else {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n <div class=\"ui-table-actions\">\n @for (action of actions(); track action.id) {\n <ui-tooltip [text]=\"action.label\">\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hover:bg-surface-hover hover:text-foreground focus-visible:bg-surface-hover focus-visible:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n </ui-tooltip>\n }\n </div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n </table>\n</div>\n\n@if (dragPreview(); as preview) {\n <div\n class=\"ui-table-drag-preview ui-text-body-alt\"\n [style.left.px]=\"preview.x\"\n [style.top.px]=\"preview.y\"\n [style.width.px]=\"preview.width\"\n [style.height.px]=\"preview.height\"\n >\n <ng-icon name=\"heroBars2\" class=\"ui-table-drag-preview-icon\" />\n <span class=\"truncate\">{{ preview.label }}</span>\n </div>\n}\n\n@if (paginated()) {\n <div class=\"ui-table-footer\">\n <span class=\"text-muted-foreground-1 ui-text-caption\">{{\n resultsLabel()\n }}</span>\n\n <div class=\"ui-table-pagination\">\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n [disabled]=\"currentPage() === 0\"\n (click)=\"goToPage(currentPage() - 1)\"\n >\n Prev\n </ui-button>\n\n <span class=\"ui-text-body-alt\">Page {{ currentPage() + 1 }} of {{\n totalPages()\n }}</span>\n\n <ui-button\n size=\"sm\"\n appearance=\"white\"\n intent=\"secondary\"\n [disabled]=\"currentPage() + 1 >= totalPages()\"\n (click)=\"goToPage(currentPage() + 1)\"\n >\n Next\n </ui-button>\n </div>\n </div>\n}\n",
|
|
999
|
+
styles: ["@layer properties;:host{min-width:100%}.ui-table-toolbar{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3)}.ui-table-scroll{overflow-x:auto;border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--table-line)}.ui-table-scroll::-webkit-scrollbar{height:calc(var(--spacing, .25rem) * 2)}.ui-table-scroll::-webkit-scrollbar-thumb{border-radius:0}.ui-table-scroll::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb)}.ui-table-scroll::-webkit-scrollbar-track{background-color:var(--scrollbar-track)}.ui-table-scroll:has(.ui-table-sticky){max-height:480px}.ui-table{min-width:100%}.ui-table--fixed{table-layout:fixed}.ui-table thead{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--table-line);background-color:var(--muted)}.ui-table thead:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table thead.ui-table-sticky{position:sticky;top:0;z-index:20}.ui-table th{padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 3);text-align:start}.ui-table td{overflow:hidden;text-overflow:ellipsis;padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 4);white-space:nowrap}.ui-table tbody{background-color:var(--layer)}:where(.ui-table tbody>:not(:last-child)){--tw-divide-y-reverse: 0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.ui-table tbody>:not(:last-child)){border-color:var(--table-line)}.ui-table tbody tr:last-child{border-bottom-style:var(--tw-border-style)!important;border-bottom-width:0px!important}.ui-table tbody tr:hover{background-color:var(--muted)}.ui-table-row-selected{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table-row-dragging{opacity:40%}.ui-table-pinned{position:sticky;z-index:10;background-color:var(--layer)}.ui-table-row-selected .ui-table-pinned{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table th.ui-table-pinned{position:sticky;z-index:30;background-color:var(--muted)}.ui-table th.ui-table-pinned:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table [data-pin=left]{border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--border-line-2)}.ui-table [data-pin=right]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border-line-2)}.ui-table-th-content{display:flex;align-items:center;gap:var(--spacing, .25rem)}.ui-table-sort{height:calc(var(--spacing, .25rem) * 3);width:calc(var(--spacing, .25rem) * 2);flex-shrink:0;fill:currentcolor;color:var(--muted-foreground-1)}.ui-table-sort path{opacity:30%;transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function, cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration, var(--default-transition-duration, .15s))}.ui-table-sort[data-direction]{color:var(--color-primary-500, var(--color-blue-500))}.ui-table-sort[data-direction=asc] .ui-table-sort-asc,.ui-table-sort[data-direction=desc] .ui-table-sort-desc{opacity:100%}.ui-table-drag-handle{width:calc(var(--spacing, .25rem) * 4);height:calc(var(--spacing, .25rem) * 4);flex-shrink:0;cursor:grab;color:var(--muted-foreground-1)}.ui-table-column-dragging{opacity:40%}.ui-table-column-drag-over{background-color:var(--color-primary-50, var(--color-blue-50))}.ui-table-drag-preview{pointer-events:none;position:fixed;z-index:50;display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--radius-md, .375rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border-line-2);background-color:var(--layer);padding-right:calc(var(--spacing, .25rem) * 3);padding-left:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--foreground);--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-table-drag-preview-icon{width:calc(var(--spacing, .25rem) * 3.5);height:calc(var(--spacing, .25rem) * 3.5);flex-shrink:0;color:var(--color-primary-500, var(--color-blue-500))}.ui-table-resize-handle{position:absolute;top:0;right:0;height:100%;width:calc(var(--spacing, .25rem) * 1.5);cursor:col-resize}.ui-table-resize-handle:hover,.ui-table-resize-handle:focus-visible{background-color:var(--color-primary-300, var(--color-blue-300))}.ui-table-filter-menu{display:flex;width:calc(var(--spacing, .25rem) * 64);flex-direction:column;gap:calc(var(--spacing, .25rem) * 3);border-radius:var(--radius-lg, .5rem);border-style:var(--tw-border-style);border-width:1px;border-color:var(--dropdown-divider);background-color:var(--layer);padding:calc(var(--spacing, .25rem) * 3);--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ui-table-filter-count{display:inline-flex;height:calc(var(--spacing, .25rem) * 5);min-width:calc(var(--spacing, .25rem) * 5);align-items:center;justify-content:center;border-radius:var(--radius-full, calc(infinity * 1px));background-color:var(--color-primary-50, var(--color-blue-50));padding-inline:var(--spacing, .25rem);color:var(--color-primary-600, var(--color-blue-600))}.ui-table .ui-table-select-cell,.ui-table .ui-table-actions-cell{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:center}.ui-table-actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing, .25rem)}.ui-table-status{padding-block:calc(var(--spacing, .25rem) * 8);text-align:center;color:var(--muted-foreground-1)}.ui-table-status-error{color:var(--color-danger-500, var(--color-red-500))}.ui-table .ui-table-bar-row th{background-color:var(--layer);padding-block:calc(var(--spacing, .25rem) * 2);--tw-font-weight: var(--font-weight-normal, 400);font-weight:var(--font-weight-normal, 400)}.ui-table .ui-table-group-row th{background-color:var(--muted);padding-inline:calc(var(--spacing, .25rem) * 6);padding-block:calc(var(--spacing, .25rem) * 2);text-align:start;font-size:var(--text-xs, .75rem);line-height:var(--tw-leading, var(--text-xs--line-height, calc(1 / .75)));--tw-font-weight: var(--font-weight-medium, 500);font-weight:var(--font-weight-medium, 500);color:var(--muted-foreground-1)}.ui-table .ui-table-group-row th:where(.dark,.dark *){background-color:var(--color-neutral-700, oklch(37.1% 0 none))}.ui-table-footer{display:flex;align-items:center;justify-content:space-between;gap:calc(var(--spacing, .25rem) * 2);padding:calc(var(--spacing, .25rem) * 3)}.ui-table-pagination{display:flex;align-items:center;gap:calc(var(--spacing, .25rem) * 3)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-divide-y-reverse{syntax: \"*\"; inherits: false; initial-value: 0;}@property --tw-font-weight{syntax: \"*\"; inherits: false;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-divide-y-reverse: 0;--tw-font-weight: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
1000
|
+
}]
|
|
1001
|
+
}],
|
|
1002
|
+
ctorParameters: () => [],
|
|
1003
|
+
propDecorators: {
|
|
1004
|
+
classes: [{
|
|
1005
|
+
type: i0.Input,
|
|
1006
|
+
args: [{
|
|
1007
|
+
isSignal: true,
|
|
1008
|
+
alias: "classes",
|
|
1009
|
+
required: false
|
|
1010
|
+
}]
|
|
1011
|
+
}],
|
|
1012
|
+
tableId: [{
|
|
1013
|
+
type: i0.Input,
|
|
1014
|
+
args: [{
|
|
1015
|
+
isSignal: true,
|
|
1016
|
+
alias: "tableId",
|
|
1017
|
+
required: false
|
|
1018
|
+
}]
|
|
1019
|
+
}],
|
|
1020
|
+
columns: [{
|
|
1021
|
+
type: i0.Input,
|
|
1022
|
+
args: [{
|
|
1023
|
+
isSignal: true,
|
|
1024
|
+
alias: "columns",
|
|
1025
|
+
required: true
|
|
1026
|
+
}]
|
|
1027
|
+
}],
|
|
1028
|
+
dataSource: [{
|
|
1029
|
+
type: i0.Input,
|
|
1030
|
+
args: [{
|
|
1031
|
+
isSignal: true,
|
|
1032
|
+
alias: "dataSource",
|
|
1033
|
+
required: true
|
|
1034
|
+
}]
|
|
1035
|
+
}],
|
|
1036
|
+
emptyMessage: [{
|
|
1037
|
+
type: i0.Input,
|
|
1038
|
+
args: [{
|
|
1039
|
+
isSignal: true,
|
|
1040
|
+
alias: "emptyMessage",
|
|
1041
|
+
required: false
|
|
1042
|
+
}]
|
|
1043
|
+
}],
|
|
1044
|
+
errorMessage: [{
|
|
1045
|
+
type: i0.Input,
|
|
1046
|
+
args: [{
|
|
1047
|
+
isSignal: true,
|
|
1048
|
+
alias: "errorMessage",
|
|
1049
|
+
required: false
|
|
1050
|
+
}]
|
|
1051
|
+
}],
|
|
1052
|
+
rowId: [{
|
|
1053
|
+
type: i0.Input,
|
|
1054
|
+
args: [{
|
|
1055
|
+
isSignal: true,
|
|
1056
|
+
alias: "rowId",
|
|
1057
|
+
required: false
|
|
1058
|
+
}]
|
|
1059
|
+
}],
|
|
1060
|
+
selectable: [{
|
|
1061
|
+
type: i0.Input,
|
|
1062
|
+
args: [{
|
|
1063
|
+
isSignal: true,
|
|
1064
|
+
alias: "selectable",
|
|
1065
|
+
required: false
|
|
1066
|
+
}]
|
|
1067
|
+
}],
|
|
1068
|
+
searchable: [{
|
|
1069
|
+
type: i0.Input,
|
|
1070
|
+
args: [{
|
|
1071
|
+
isSignal: true,
|
|
1072
|
+
alias: "searchable",
|
|
1073
|
+
required: false
|
|
1074
|
+
}]
|
|
1075
|
+
}],
|
|
1076
|
+
searchPlaceholder: [{
|
|
1077
|
+
type: i0.Input,
|
|
1078
|
+
args: [{
|
|
1079
|
+
isSignal: true,
|
|
1080
|
+
alias: "searchPlaceholder",
|
|
1081
|
+
required: false
|
|
1082
|
+
}]
|
|
1083
|
+
}],
|
|
1084
|
+
paginated: [{
|
|
1085
|
+
type: i0.Input,
|
|
1086
|
+
args: [{
|
|
1087
|
+
isSignal: true,
|
|
1088
|
+
alias: "paginated",
|
|
1089
|
+
required: false
|
|
1090
|
+
}]
|
|
1091
|
+
}],
|
|
1092
|
+
pageSize: [{
|
|
1093
|
+
type: i0.Input,
|
|
1094
|
+
args: [{
|
|
1095
|
+
isSignal: true,
|
|
1096
|
+
alias: "pageSize",
|
|
1097
|
+
required: false
|
|
1098
|
+
}]
|
|
1099
|
+
}],
|
|
1100
|
+
toggleableColumns: [{
|
|
1101
|
+
type: i0.Input,
|
|
1102
|
+
args: [{
|
|
1103
|
+
isSignal: true,
|
|
1104
|
+
alias: "toggleableColumns",
|
|
1105
|
+
required: false
|
|
1106
|
+
}]
|
|
1107
|
+
}],
|
|
1108
|
+
reorderableColumns: [{
|
|
1109
|
+
type: i0.Input,
|
|
1110
|
+
args: [{
|
|
1111
|
+
isSignal: true,
|
|
1112
|
+
alias: "reorderableColumns",
|
|
1113
|
+
required: false
|
|
1114
|
+
}]
|
|
1115
|
+
}],
|
|
1116
|
+
reorderableRows: [{
|
|
1117
|
+
type: i0.Input,
|
|
1118
|
+
args: [{
|
|
1119
|
+
isSignal: true,
|
|
1120
|
+
alias: "reorderableRows",
|
|
1121
|
+
required: false
|
|
1122
|
+
}]
|
|
1123
|
+
}],
|
|
1124
|
+
stickyHeader: [{
|
|
1125
|
+
type: i0.Input,
|
|
1126
|
+
args: [{
|
|
1127
|
+
isSignal: true,
|
|
1128
|
+
alias: "stickyHeader",
|
|
1129
|
+
required: false
|
|
1130
|
+
}]
|
|
1131
|
+
}],
|
|
1132
|
+
headerless: [{
|
|
1133
|
+
type: i0.Input,
|
|
1134
|
+
args: [{
|
|
1135
|
+
isSignal: true,
|
|
1136
|
+
alias: "headerless",
|
|
1137
|
+
required: false
|
|
1138
|
+
}]
|
|
1139
|
+
}],
|
|
1140
|
+
bar: [{
|
|
1141
|
+
type: i0.ContentChild,
|
|
1142
|
+
args: [i0.forwardRef(() => UiTableBarDirective), { isSignal: true }]
|
|
1143
|
+
}],
|
|
1144
|
+
groupHeading: [{
|
|
1145
|
+
type: i0.Input,
|
|
1146
|
+
args: [{
|
|
1147
|
+
isSignal: true,
|
|
1148
|
+
alias: "groupHeading",
|
|
1149
|
+
required: false
|
|
1150
|
+
}]
|
|
1151
|
+
}],
|
|
1152
|
+
actions: [{
|
|
1153
|
+
type: i0.Input,
|
|
1154
|
+
args: [{
|
|
1155
|
+
isSignal: true,
|
|
1156
|
+
alias: "actions",
|
|
1157
|
+
required: false
|
|
1158
|
+
}]
|
|
1159
|
+
}],
|
|
1160
|
+
sort: [{
|
|
1161
|
+
type: i0.Input,
|
|
1162
|
+
args: [{
|
|
1163
|
+
isSignal: true,
|
|
1164
|
+
alias: "sort",
|
|
1165
|
+
required: false
|
|
1166
|
+
}]
|
|
1167
|
+
}, {
|
|
1168
|
+
type: i0.Output,
|
|
1169
|
+
args: ["sortChange"]
|
|
1170
|
+
}],
|
|
1171
|
+
selectedRowIds: [{
|
|
1172
|
+
type: i0.Input,
|
|
1173
|
+
args: [{
|
|
1174
|
+
isSignal: true,
|
|
1175
|
+
alias: "selectedRowIds",
|
|
1176
|
+
required: false
|
|
1177
|
+
}]
|
|
1178
|
+
}, {
|
|
1179
|
+
type: i0.Output,
|
|
1180
|
+
args: ["selectedRowIdsChange"]
|
|
1181
|
+
}],
|
|
1182
|
+
selectionChange: [{
|
|
1183
|
+
type: i0.Output,
|
|
1184
|
+
args: ["selectionChange"]
|
|
1185
|
+
}],
|
|
1186
|
+
rowsReordered: [{
|
|
1187
|
+
type: i0.Output,
|
|
1188
|
+
args: ["rowsReordered"]
|
|
1189
|
+
}],
|
|
1190
|
+
cellDirectives: [{
|
|
1191
|
+
type: i0.ContentChildren,
|
|
1192
|
+
args: [i0.forwardRef(() => UiTableCellDirective), { isSignal: true }]
|
|
1193
|
+
}]
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
var TableLocalDataSource = class {
|
|
1197
|
+
items;
|
|
1198
|
+
options;
|
|
1199
|
+
constructor(items, options = {}) {
|
|
1200
|
+
this.items = items;
|
|
1201
|
+
this.options = options;
|
|
1202
|
+
}
|
|
1203
|
+
load(params) {
|
|
1204
|
+
let result = this.items;
|
|
1205
|
+
const query = params.query.trim();
|
|
1206
|
+
if (query && this.options.search) result = result.filter((item) => this.options.search(item, query));
|
|
1207
|
+
if (Object.keys(params.filters).length && this.options.filter) result = result.filter((item) => this.options.filter(item, params.filters));
|
|
1208
|
+
if (params.sort && this.options.sortValue) {
|
|
1209
|
+
const { columnId, direction } = params.sort;
|
|
1210
|
+
const factor = direction === "asc" ? 1 : -1;
|
|
1211
|
+
result = [...result].sort((a, b) => {
|
|
1212
|
+
const valueA = this.options.sortValue(a, columnId);
|
|
1213
|
+
const valueB = this.options.sortValue(b, columnId);
|
|
1214
|
+
if (valueA === valueB) return 0;
|
|
1215
|
+
return valueA > valueB ? factor : -factor;
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
const total = result.length;
|
|
1219
|
+
const items = params.size > 0 ? result.slice(params.page * params.size, params.page * params.size + params.size) : result;
|
|
1220
|
+
return of({
|
|
1221
|
+
items,
|
|
1222
|
+
total
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
var TableRemoteDataSource = class {
|
|
1227
|
+
fetch;
|
|
1228
|
+
constructor(fetch) {
|
|
1229
|
+
this.fetch = fetch;
|
|
1230
|
+
}
|
|
1231
|
+
load(params) {
|
|
1232
|
+
return this.fetch(params);
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
export { TableLocalDataSource, TableRemoteDataSource, UiTableBarDirective, UiTableCellDirective, UiTableComponent, UiTableRegistry };
|
|
1236
|
+
|
|
1237
|
+
//# sourceMappingURL=area8975-ui-table.mjs.map
|