@area8975/ui 0.1.1-dev.19 → 0.1.1-dev.21
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/fesm2022/area8975-ui.mjs +194 -49
- package/fesm2022/area8975-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/area8975-ui.d.ts +48 -3
package/fesm2022/area8975-ui.mjs
CHANGED
|
@@ -7,6 +7,28 @@ import { takeUntilDestroyed, toObservable } from "@angular/core/rxjs-interop";
|
|
|
7
7
|
import { Subject, catchError, debounceTime, filter, of, skip, switchMap } from "rxjs";
|
|
8
8
|
import { autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
|
|
9
9
|
import { heroCheckCircleSolid, heroExclamationTriangleSolid, heroInformationCircleSolid, heroXCircleSolid } from "@ng-icons/heroicons/solid";
|
|
10
|
+
const UiPrivacies = [
|
|
11
|
+
"visible",
|
|
12
|
+
"discreet",
|
|
13
|
+
"hidden"
|
|
14
|
+
];
|
|
15
|
+
const UI_PRIVACY = new InjectionToken("UI_PRIVACY", {
|
|
16
|
+
providedIn: "root",
|
|
17
|
+
factory: () => signal("visible").asReadonly()
|
|
18
|
+
});
|
|
19
|
+
function provideUiPrivacy(privacy) {
|
|
20
|
+
return {
|
|
21
|
+
provide: UI_PRIVACY,
|
|
22
|
+
useFactory: privacy
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const PRIVACY_MASK = " - - -";
|
|
26
|
+
function maskMoney(currency, locale) {
|
|
27
|
+
return new Intl.NumberFormat(locale, {
|
|
28
|
+
style: "currency",
|
|
29
|
+
currency
|
|
30
|
+
}).formatToParts(0).map((part) => part.type === "currency" || part.type === "literal" ? part.value : PRIVACY_MASK).filter((value, index, values) => value !== PRIVACY_MASK || values[index - 1] !== PRIVACY_MASK).join("");
|
|
31
|
+
}
|
|
10
32
|
const UI_FORMAT_DEFAULTS = {
|
|
11
33
|
currency: "GBP",
|
|
12
34
|
locale: "en-GB"
|
|
@@ -24,14 +46,25 @@ function provideUiFormat(format) {
|
|
|
24
46
|
}
|
|
25
47
|
};
|
|
26
48
|
}
|
|
49
|
+
const MONEY = Symbol("money");
|
|
50
|
+
function moneyFormatterParts(formatter) {
|
|
51
|
+
return formatter[MONEY] ?? null;
|
|
52
|
+
}
|
|
27
53
|
function injectMoneyFormatter(options = {}) {
|
|
28
54
|
const { currency, locale } = inject(UI_FORMAT);
|
|
55
|
+
const privacy = inject(UI_PRIVACY);
|
|
29
56
|
const formatter = new Intl.NumberFormat(locale, {
|
|
30
57
|
style: "currency",
|
|
31
58
|
currency,
|
|
32
59
|
...options
|
|
33
60
|
});
|
|
34
|
-
|
|
61
|
+
const resolved = formatter.resolvedOptions();
|
|
62
|
+
const mask = maskMoney(resolved.currency ?? currency, resolved.locale);
|
|
63
|
+
const format = (value) => formatter.format(value);
|
|
64
|
+
return Object.assign((value) => privacy() === "visible" ? format(value) : mask, { [MONEY]: {
|
|
65
|
+
format,
|
|
66
|
+
mask
|
|
67
|
+
} });
|
|
35
68
|
}
|
|
36
69
|
var UiDarkClass = class UiDarkClass {
|
|
37
70
|
isDark = signal(false, ...ngDevMode ? [{ debugName: "isDark" }] : /* istanbul ignore next */ []);
|
|
@@ -128,6 +161,7 @@ function chartSeriesStyle(index, dashes, dark = false) {
|
|
|
128
161
|
}
|
|
129
162
|
var UiAxisChartBase = class UiAxisChartBase {
|
|
130
163
|
uiFormat = inject(UI_FORMAT);
|
|
164
|
+
privacy = inject(UI_PRIVACY);
|
|
131
165
|
dark = inject(UiDarkClass).isDark;
|
|
132
166
|
ink = computed(() => chartInk(this.dark()), ...ngDevMode ? [{ debugName: "ink" }] : /* istanbul ignore next */ []);
|
|
133
167
|
series = input.required(...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
|
|
@@ -135,6 +169,10 @@ var UiAxisChartBase = class UiAxisChartBase {
|
|
|
135
169
|
ariaLabel = input.required(...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
136
170
|
height = input(300, ...ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []);
|
|
137
171
|
valueFormatter = input(numberFormatter(this.uiFormat.locale), ...ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []);
|
|
172
|
+
sensitive = input(void 0, {
|
|
173
|
+
...ngDevMode ? { debugName: "sensitive" } : /* istanbul ignore next */ {},
|
|
174
|
+
transform: (value) => value === void 0 ? void 0 : booleanAttribute(value)
|
|
175
|
+
});
|
|
138
176
|
categoryLabel = input("Category", ...ngDevMode ? [{ debugName: "categoryLabel" }] : /* istanbul ignore next */ []);
|
|
139
177
|
loading = input(false, {
|
|
140
178
|
...ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {},
|
|
@@ -155,6 +193,16 @@ var UiAxisChartBase = class UiAxisChartBase {
|
|
|
155
193
|
hiddenSeries = signal([], ...ngDevMode ? [{ debugName: "hiddenSeries" }] : /* istanbul ignore next */ []);
|
|
156
194
|
emphasis = signal(null, ...ngDevMode ? [{ debugName: "emphasis" }] : /* istanbul ignore next */ []);
|
|
157
195
|
supportsDashes = false;
|
|
196
|
+
money = computed(() => moneyFormatterParts(this.valueFormatter()), ...ngDevMode ? [{ debugName: "money" }] : /* istanbul ignore next */ []);
|
|
197
|
+
privacyMode = computed(() => this.sensitive() ?? !!this.money() ? this.privacy() : "visible", ...ngDevMode ? [{ debugName: "privacyMode" }] : /* istanbul ignore next */ []);
|
|
198
|
+
masked = computed(() => this.privacyMode() !== "visible", ...ngDevMode ? [{ debugName: "masked" }] : /* istanbul ignore next */ []);
|
|
199
|
+
concealed = computed(() => this.privacyMode() === "hidden", ...ngDevMode ? [{ debugName: "concealed" }] : /* istanbul ignore next */ []);
|
|
200
|
+
displayFormatter = computed(() => {
|
|
201
|
+
const money = this.money();
|
|
202
|
+
if (!this.masked()) return money?.format ?? this.valueFormatter();
|
|
203
|
+
const mask = money?.mask ?? maskMoney(this.uiFormat.currency, this.uiFormat.locale);
|
|
204
|
+
return () => mask;
|
|
205
|
+
}, ...ngDevMode ? [{ debugName: "displayFormatter" }] : /* istanbul ignore next */ []);
|
|
158
206
|
apexHeight = computed(() => {
|
|
159
207
|
const height = this.height();
|
|
160
208
|
return height === "fill" ? "100%" : height;
|
|
@@ -196,7 +244,7 @@ var UiAxisChartBase = class UiAxisChartBase {
|
|
|
196
244
|
return count ? `${count} more in grey` : "";
|
|
197
245
|
}, ...ngDevMode ? [{ debugName: "legendNote" }] : /* istanbul ignore next */ []);
|
|
198
246
|
formatValue(value) {
|
|
199
|
-
return value === null || value === void 0 ? "-" : this.
|
|
247
|
+
return value === null || value === void 0 ? "-" : this.displayFormatter()(value);
|
|
200
248
|
}
|
|
201
249
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
202
250
|
minVersion: "12.0.0",
|
|
@@ -247,6 +295,13 @@ var UiAxisChartBase = class UiAxisChartBase {
|
|
|
247
295
|
isRequired: false,
|
|
248
296
|
transformFunction: null
|
|
249
297
|
},
|
|
298
|
+
sensitive: {
|
|
299
|
+
classPropertyName: "sensitive",
|
|
300
|
+
publicName: "sensitive",
|
|
301
|
+
isSignal: true,
|
|
302
|
+
isRequired: false,
|
|
303
|
+
transformFunction: null
|
|
304
|
+
},
|
|
250
305
|
categoryLabel: {
|
|
251
306
|
classPropertyName: "categoryLabel",
|
|
252
307
|
publicName: "categoryLabel",
|
|
@@ -354,6 +409,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
354
409
|
required: false
|
|
355
410
|
}]
|
|
356
411
|
}],
|
|
412
|
+
sensitive: [{
|
|
413
|
+
type: i0.Input,
|
|
414
|
+
args: [{
|
|
415
|
+
isSignal: true,
|
|
416
|
+
alias: "sensitive",
|
|
417
|
+
required: false
|
|
418
|
+
}]
|
|
419
|
+
}],
|
|
357
420
|
categoryLabel: [{
|
|
358
421
|
type: i0.Input,
|
|
359
422
|
args: [{
|
|
@@ -491,7 +554,7 @@ function chartTooltipHtml(title, rows, footer = "", total) {
|
|
|
491
554
|
style="--ui-chart-tooltip-colour: ${escapeHtml(row.colour)}"
|
|
492
555
|
></span>
|
|
493
556
|
<span class="ui-chart-tooltip-name">${escapeHtml(row.name)}</span>
|
|
494
|
-
|
|
557
|
+
${row.value === void 0 ? "" : `<span class="ui-chart-tooltip-value">${escapeHtml(row.value)}</span>`}
|
|
495
558
|
</div>
|
|
496
559
|
`).join("");
|
|
497
560
|
return `
|
|
@@ -1027,8 +1090,15 @@ var UiChartTableComponent = class UiChartTableComponent {
|
|
|
1027
1090
|
...ngDevMode ? { debugName: "visible" } : /* istanbul ignore next */ {},
|
|
1028
1091
|
transform: booleanAttribute
|
|
1029
1092
|
});
|
|
1093
|
+
masked = input(false, {
|
|
1094
|
+
...ngDevMode ? { debugName: "masked" } : /* istanbul ignore next */ {},
|
|
1095
|
+
transform: booleanAttribute
|
|
1096
|
+
});
|
|
1097
|
+
isValue(value) {
|
|
1098
|
+
return value !== null && value !== void 0;
|
|
1099
|
+
}
|
|
1030
1100
|
format(value) {
|
|
1031
|
-
return value
|
|
1101
|
+
return this.isValue(value) ? this.valueFormatter()(value) : "-";
|
|
1032
1102
|
}
|
|
1033
1103
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1034
1104
|
minVersion: "12.0.0",
|
|
@@ -1086,6 +1156,13 @@ var UiChartTableComponent = class UiChartTableComponent {
|
|
|
1086
1156
|
isSignal: true,
|
|
1087
1157
|
isRequired: false,
|
|
1088
1158
|
transformFunction: null
|
|
1159
|
+
},
|
|
1160
|
+
masked: {
|
|
1161
|
+
classPropertyName: "masked",
|
|
1162
|
+
publicName: "masked",
|
|
1163
|
+
isSignal: true,
|
|
1164
|
+
isRequired: false,
|
|
1165
|
+
transformFunction: null
|
|
1089
1166
|
}
|
|
1090
1167
|
},
|
|
1091
1168
|
ngImport: i0,
|
|
@@ -1107,7 +1184,12 @@ var UiChartTableComponent = class UiChartTableComponent {
|
|
|
1107
1184
|
<tr>
|
|
1108
1185
|
<th scope="row" class="ui-text-body-alt">{{ category }}</th>
|
|
1109
1186
|
@for (item of series(); track item.name) {
|
|
1110
|
-
<td class="ui-text-body-alt">
|
|
1187
|
+
<td class="ui-text-body-alt">
|
|
1188
|
+
@if (masked() && isValue(item.data[row])) {
|
|
1189
|
+
<span aria-hidden="true">{{ format(item.data[row]) }}</span>
|
|
1190
|
+
<span class="sr-only">amount hidden</span>
|
|
1191
|
+
} @else {{{ format(item.data[row]) }}}
|
|
1192
|
+
</td>
|
|
1111
1193
|
}
|
|
1112
1194
|
</tr>
|
|
1113
1195
|
}
|
|
@@ -1146,7 +1228,12 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1146
1228
|
<tr>
|
|
1147
1229
|
<th scope="row" class="ui-text-body-alt">{{ category }}</th>
|
|
1148
1230
|
@for (item of series(); track item.name) {
|
|
1149
|
-
<td class="ui-text-body-alt">
|
|
1231
|
+
<td class="ui-text-body-alt">
|
|
1232
|
+
@if (masked() && isValue(item.data[row])) {
|
|
1233
|
+
<span aria-hidden="true">{{ format(item.data[row]) }}</span>
|
|
1234
|
+
<span class="sr-only">amount hidden</span>
|
|
1235
|
+
} @else {{{ format(item.data[row]) }}}
|
|
1236
|
+
</td>
|
|
1150
1237
|
}
|
|
1151
1238
|
</tr>
|
|
1152
1239
|
}
|
|
@@ -1205,6 +1292,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1205
1292
|
alias: "visible",
|
|
1206
1293
|
required: false
|
|
1207
1294
|
}]
|
|
1295
|
+
}],
|
|
1296
|
+
masked: [{
|
|
1297
|
+
type: i0.Input,
|
|
1298
|
+
args: [{
|
|
1299
|
+
isSignal: true,
|
|
1300
|
+
alias: "masked",
|
|
1301
|
+
required: false
|
|
1302
|
+
}]
|
|
1208
1303
|
}]
|
|
1209
1304
|
}
|
|
1210
1305
|
});
|
|
@@ -1232,6 +1327,10 @@ var UiChartFrameComponent = class UiChartFrameComponent {
|
|
|
1232
1327
|
...ngDevMode ? { debugName: "showTable" } : /* istanbul ignore next */ {},
|
|
1233
1328
|
transform: booleanAttribute
|
|
1234
1329
|
});
|
|
1330
|
+
masked = input(false, {
|
|
1331
|
+
...ngDevMode ? { debugName: "masked" } : /* istanbul ignore next */ {},
|
|
1332
|
+
transform: booleanAttribute
|
|
1333
|
+
});
|
|
1235
1334
|
showLegend = input(true, {
|
|
1236
1335
|
...ngDevMode ? { debugName: "showLegend" } : /* istanbul ignore next */ {},
|
|
1237
1336
|
transform: booleanAttribute
|
|
@@ -1355,6 +1454,13 @@ var UiChartFrameComponent = class UiChartFrameComponent {
|
|
|
1355
1454
|
isRequired: false,
|
|
1356
1455
|
transformFunction: null
|
|
1357
1456
|
},
|
|
1457
|
+
masked: {
|
|
1458
|
+
classPropertyName: "masked",
|
|
1459
|
+
publicName: "masked",
|
|
1460
|
+
isSignal: true,
|
|
1461
|
+
isRequired: false,
|
|
1462
|
+
transformFunction: null
|
|
1463
|
+
},
|
|
1358
1464
|
showLegend: {
|
|
1359
1465
|
classPropertyName: "showLegend",
|
|
1360
1466
|
publicName: "showLegend",
|
|
@@ -1425,6 +1531,7 @@ var UiChartFrameComponent = class UiChartFrameComponent {
|
|
|
1425
1531
|
[categories]="categories()"
|
|
1426
1532
|
[series]="series()"
|
|
1427
1533
|
[valueFormatter]="valueFormatter()"
|
|
1534
|
+
[masked]="masked()"
|
|
1428
1535
|
[categoryLabel]="categoryLabel()"
|
|
1429
1536
|
[visible]="showTable()"
|
|
1430
1537
|
/>
|
|
@@ -1453,7 +1560,8 @@ var UiChartFrameComponent = class UiChartFrameComponent {
|
|
|
1453
1560
|
"series",
|
|
1454
1561
|
"valueFormatter",
|
|
1455
1562
|
"categoryLabel",
|
|
1456
|
-
"visible"
|
|
1563
|
+
"visible",
|
|
1564
|
+
"masked"
|
|
1457
1565
|
]
|
|
1458
1566
|
},
|
|
1459
1567
|
{
|
|
@@ -1533,6 +1641,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1533
1641
|
[categories]="categories()"
|
|
1534
1642
|
[series]="series()"
|
|
1535
1643
|
[valueFormatter]="valueFormatter()"
|
|
1644
|
+
[masked]="masked()"
|
|
1536
1645
|
[categoryLabel]="categoryLabel()"
|
|
1537
1646
|
[visible]="showTable()"
|
|
1538
1647
|
/>
|
|
@@ -1669,6 +1778,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1669
1778
|
required: false
|
|
1670
1779
|
}]
|
|
1671
1780
|
}],
|
|
1781
|
+
masked: [{
|
|
1782
|
+
type: i0.Input,
|
|
1783
|
+
args: [{
|
|
1784
|
+
isSignal: true,
|
|
1785
|
+
alias: "masked",
|
|
1786
|
+
required: false
|
|
1787
|
+
}]
|
|
1788
|
+
}],
|
|
1672
1789
|
showLegend: [{
|
|
1673
1790
|
type: i0.Input,
|
|
1674
1791
|
args: [{
|
|
@@ -1716,15 +1833,16 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1716
1833
|
const base = baseChartOptions(ink);
|
|
1717
1834
|
const labels = chartAxisLabels(ink);
|
|
1718
1835
|
const horizontal = this.orientation() === "horizontal";
|
|
1719
|
-
const format = this.
|
|
1836
|
+
const format = this.displayFormatter();
|
|
1837
|
+
const masked = this.masked();
|
|
1720
1838
|
const series = this.series();
|
|
1721
1839
|
const categories = this.categories();
|
|
1722
1840
|
const colours = this.colours();
|
|
1723
1841
|
const picked = categories.indexOf(this.highlightCategory() ?? "");
|
|
1724
1842
|
const thickness = `${MAX_BAR_THICKNESS}px`;
|
|
1725
|
-
const valueLabels = {
|
|
1843
|
+
const valueLabels = masked ? { show: false } : {
|
|
1726
1844
|
...labels,
|
|
1727
|
-
formatter: format
|
|
1845
|
+
formatter: (value) => format(Number(value))
|
|
1728
1846
|
};
|
|
1729
1847
|
return mergeChartOptions({
|
|
1730
1848
|
...base,
|
|
@@ -1737,7 +1855,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1737
1855
|
colors: picked < 0 ? colours : colours.map((colour) => ({ dataPointIndex }) => dataPointIndex === picked ? colour : fade(colour, ink)),
|
|
1738
1856
|
series: series.map((item) => ({
|
|
1739
1857
|
name: item.name,
|
|
1740
|
-
data: item.data
|
|
1858
|
+
data: this.concealed() ? item.data.map(() => null) : item.data
|
|
1741
1859
|
})),
|
|
1742
1860
|
plotOptions: { bar: {
|
|
1743
1861
|
horizontal,
|
|
@@ -1754,10 +1872,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1754
1872
|
xaxis: {
|
|
1755
1873
|
...base.xaxis,
|
|
1756
1874
|
categories,
|
|
1757
|
-
labels: horizontal ?
|
|
1758
|
-
...labels,
|
|
1759
|
-
formatter: (value) => format(Number(value))
|
|
1760
|
-
} : labels
|
|
1875
|
+
labels: horizontal ? valueLabels : labels
|
|
1761
1876
|
},
|
|
1762
1877
|
yaxis: {
|
|
1763
1878
|
...base.yaxis,
|
|
@@ -1768,7 +1883,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1768
1883
|
xaxis: { lines: { show: horizontal } },
|
|
1769
1884
|
yaxis: { lines: { show: !horizontal } }
|
|
1770
1885
|
},
|
|
1771
|
-
tooltip: this.stacked() ? {
|
|
1886
|
+
tooltip: this.concealed() ? { enabled: false } : this.stacked() ? {
|
|
1772
1887
|
shared: true,
|
|
1773
1888
|
intersect: false,
|
|
1774
1889
|
custom: ({ dataPointIndex }) => {
|
|
@@ -1780,8 +1895,8 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1780
1895
|
const values = rows.map((row) => row.raw).filter((value) => value !== null);
|
|
1781
1896
|
return chartTooltipHtml(categories[dataPointIndex] ?? "", rows.map((row) => ({
|
|
1782
1897
|
...row,
|
|
1783
|
-
value: this.formatValue(row.raw)
|
|
1784
|
-
})), "", {
|
|
1898
|
+
value: masked ? void 0 : this.formatValue(row.raw)
|
|
1899
|
+
})), "", masked ? void 0 : {
|
|
1785
1900
|
name: "Total",
|
|
1786
1901
|
value: this.formatValue(values.length ? values.reduce((sum, value) => sum + value, 0) : null)
|
|
1787
1902
|
});
|
|
@@ -1792,7 +1907,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1792
1907
|
custom: ({ seriesIndex, dataPointIndex }) => chartTooltipHtml(categories[dataPointIndex] ?? "", [{
|
|
1793
1908
|
colour: colours[seriesIndex],
|
|
1794
1909
|
name: series[seriesIndex]?.name ?? "",
|
|
1795
|
-
value: this.formatValue(series[seriesIndex]?.data[dataPointIndex])
|
|
1910
|
+
value: masked ? void 0 : this.formatValue(series[seriesIndex]?.data[dataPointIndex])
|
|
1796
1911
|
}])
|
|
1797
1912
|
}
|
|
1798
1913
|
}, this.options());
|
|
@@ -1837,7 +1952,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1837
1952
|
host: { classAttribute: "block w-full min-w-0" },
|
|
1838
1953
|
usesInheritance: true,
|
|
1839
1954
|
ngImport: i0,
|
|
1840
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
1955
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n",
|
|
1841
1956
|
dependencies: [{
|
|
1842
1957
|
kind: "component",
|
|
1843
1958
|
type: UiChartFrameComponent,
|
|
@@ -1857,6 +1972,7 @@ var UiBarChartComponent = class UiBarChartComponent extends UiAxisChartBase {
|
|
|
1857
1972
|
"loading",
|
|
1858
1973
|
"empty",
|
|
1859
1974
|
"showTable",
|
|
1975
|
+
"masked",
|
|
1860
1976
|
"showLegend",
|
|
1861
1977
|
"emphasis"
|
|
1862
1978
|
],
|
|
@@ -1875,7 +1991,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1875
1991
|
selector: "ui-bar-chart",
|
|
1876
1992
|
imports: [UiChartFrameComponent],
|
|
1877
1993
|
host: { class: "block w-full min-w-0" },
|
|
1878
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
1994
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n"
|
|
1879
1995
|
}]
|
|
1880
1996
|
}],
|
|
1881
1997
|
propDecorators: {
|
|
@@ -1954,6 +2070,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
1954
2070
|
const colours = this.colours();
|
|
1955
2071
|
const dashed = this.dashed();
|
|
1956
2072
|
const muted = this.isMuted();
|
|
2073
|
+
const masked = this.masked();
|
|
1957
2074
|
const order = series.map((_, index) => index).sort((a, b) => Number(muted[b]) - Number(muted[a]));
|
|
1958
2075
|
return mergeChartOptions({
|
|
1959
2076
|
...base,
|
|
@@ -1966,7 +2083,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
1966
2083
|
colors: order.map((index) => colours[index]),
|
|
1967
2084
|
series: order.map((index) => ({
|
|
1968
2085
|
name: series[index].name,
|
|
1969
|
-
data: series[index].data
|
|
2086
|
+
data: this.concealed() ? series[index].data.map(() => null) : series[index].data
|
|
1970
2087
|
})),
|
|
1971
2088
|
stroke: {
|
|
1972
2089
|
curve: this.curve(),
|
|
@@ -2002,9 +2119,9 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
2002
2119
|
},
|
|
2003
2120
|
yaxis: {
|
|
2004
2121
|
...base.yaxis,
|
|
2005
|
-
labels: {
|
|
2122
|
+
labels: masked ? { show: false } : {
|
|
2006
2123
|
...labels,
|
|
2007
|
-
formatter: this.
|
|
2124
|
+
formatter: this.displayFormatter()
|
|
2008
2125
|
}
|
|
2009
2126
|
},
|
|
2010
2127
|
grid: {
|
|
@@ -2012,7 +2129,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
2012
2129
|
xaxis: { lines: { show: false } },
|
|
2013
2130
|
yaxis: { lines: { show: true } }
|
|
2014
2131
|
},
|
|
2015
|
-
tooltip: {
|
|
2132
|
+
tooltip: this.concealed() ? { enabled: false } : {
|
|
2016
2133
|
shared: true,
|
|
2017
2134
|
intersect: false,
|
|
2018
2135
|
custom: ({ dataPointIndex }) => {
|
|
@@ -2024,7 +2141,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
2024
2141
|
muted: muted[index]
|
|
2025
2142
|
})).filter((row) => !this.hiddenSeries().includes(row.name)).sort((a, b) => this.tooltipOrder(a, b)).map((row) => ({
|
|
2026
2143
|
...row,
|
|
2027
|
-
value: this.formatValue(row.raw)
|
|
2144
|
+
value: masked ? void 0 : this.formatValue(row.raw)
|
|
2028
2145
|
}));
|
|
2029
2146
|
const shown = rows.filter((row) => !row.muted).length + MAX_CONTEXT_ROWS;
|
|
2030
2147
|
const extra = rows.length - shown;
|
|
@@ -2087,7 +2204,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
2087
2204
|
host: { classAttribute: "block w-full min-w-0" },
|
|
2088
2205
|
usesInheritance: true,
|
|
2089
2206
|
ngImport: i0,
|
|
2090
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
2207
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n",
|
|
2091
2208
|
dependencies: [{
|
|
2092
2209
|
kind: "component",
|
|
2093
2210
|
type: UiChartFrameComponent,
|
|
@@ -2107,6 +2224,7 @@ var UiLineChartComponent = class UiLineChartComponent extends UiAxisChartBase {
|
|
|
2107
2224
|
"loading",
|
|
2108
2225
|
"empty",
|
|
2109
2226
|
"showTable",
|
|
2227
|
+
"masked",
|
|
2110
2228
|
"showLegend",
|
|
2111
2229
|
"emphasis"
|
|
2112
2230
|
],
|
|
@@ -2125,7 +2243,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2125
2243
|
selector: "ui-line-chart",
|
|
2126
2244
|
imports: [UiChartFrameComponent],
|
|
2127
2245
|
host: { class: "block w-full min-w-0" },
|
|
2128
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
2246
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n"
|
|
2129
2247
|
}]
|
|
2130
2248
|
}],
|
|
2131
2249
|
propDecorators: {
|
|
@@ -2213,6 +2331,12 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2213
2331
|
const slices = this.slices();
|
|
2214
2332
|
const donut = this.variant() === "donut";
|
|
2215
2333
|
const total = slices.reduce((sum, slice) => sum + slice.value, 0);
|
|
2334
|
+
const concealed = this.concealed();
|
|
2335
|
+
const drawn = concealed ? [{
|
|
2336
|
+
name: "",
|
|
2337
|
+
value: 1,
|
|
2338
|
+
colour: ink.grid
|
|
2339
|
+
}] : slices;
|
|
2216
2340
|
const centreText = {
|
|
2217
2341
|
fontSize: "12px",
|
|
2218
2342
|
color: ink.muted,
|
|
@@ -2225,9 +2349,9 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2225
2349
|
type: donut ? "donut" : "pie",
|
|
2226
2350
|
height: this.apexHeight()
|
|
2227
2351
|
},
|
|
2228
|
-
colors:
|
|
2229
|
-
labels:
|
|
2230
|
-
series:
|
|
2352
|
+
colors: drawn.map((slice) => slice.colour),
|
|
2353
|
+
labels: drawn.map((slice) => slice.name),
|
|
2354
|
+
series: drawn.map((slice) => slice.value),
|
|
2231
2355
|
stroke: {
|
|
2232
2356
|
show: true,
|
|
2233
2357
|
width: 2,
|
|
@@ -2235,7 +2359,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2235
2359
|
},
|
|
2236
2360
|
states: {
|
|
2237
2361
|
...base.states,
|
|
2238
|
-
hover: { filter: { type: "darken" } }
|
|
2362
|
+
hover: { filter: { type: concealed ? "none" : "darken" } }
|
|
2239
2363
|
},
|
|
2240
2364
|
plotOptions: { pie: {
|
|
2241
2365
|
expandOnClick: false,
|
|
@@ -2261,7 +2385,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2261
2385
|
}
|
|
2262
2386
|
}
|
|
2263
2387
|
} },
|
|
2264
|
-
tooltip: {
|
|
2388
|
+
tooltip: concealed ? { enabled: false } : {
|
|
2265
2389
|
theme: "light",
|
|
2266
2390
|
fillSeriesColor: false,
|
|
2267
2391
|
custom: ({ seriesIndex }) => {
|
|
@@ -2269,7 +2393,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2269
2393
|
return slice ? chartTooltipHtml("", [{
|
|
2270
2394
|
colour: slice.colour,
|
|
2271
2395
|
name: slice.name,
|
|
2272
|
-
value: this.formatValue(slice.value)
|
|
2396
|
+
value: this.masked() ? void 0 : this.formatValue(slice.value)
|
|
2273
2397
|
}], total ? `${this.percentFormatter.format(slice.value / total)} of total` : "") : "";
|
|
2274
2398
|
}
|
|
2275
2399
|
}
|
|
@@ -2308,7 +2432,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2308
2432
|
host: { classAttribute: "block w-full min-w-0" },
|
|
2309
2433
|
usesInheritance: true,
|
|
2310
2434
|
ngImport: i0,
|
|
2311
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
2435
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n",
|
|
2312
2436
|
dependencies: [{
|
|
2313
2437
|
kind: "component",
|
|
2314
2438
|
type: UiChartFrameComponent,
|
|
@@ -2328,6 +2452,7 @@ var UiPieChartComponent = class UiPieChartComponent extends UiAxisChartBase {
|
|
|
2328
2452
|
"loading",
|
|
2329
2453
|
"empty",
|
|
2330
2454
|
"showTable",
|
|
2455
|
+
"masked",
|
|
2331
2456
|
"showLegend",
|
|
2332
2457
|
"emphasis"
|
|
2333
2458
|
],
|
|
@@ -2346,7 +2471,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2346
2471
|
selector: "ui-pie-chart",
|
|
2347
2472
|
imports: [UiChartFrameComponent],
|
|
2348
2473
|
host: { class: "block w-full min-w-0" },
|
|
2349
|
-
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"
|
|
2474
|
+
template: "<ui-chart-frame\n [options]=\"chartOptions()\"\n [ariaLabel]=\"ariaLabel()\"\n [categories]=\"categories()\"\n [series]=\"series()\"\n [legendItems]=\"legendItems()\"\n [legendNote]=\"legendNote()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n [(emphasis)]=\"emphasis\"\n [showLegend]=\"legend() === 'auto'\"\n [valueFormatter]=\"displayFormatter()\"\n [masked]=\"masked()\"\n [categoryLabel]=\"categoryLabel()\"\n [height]=\"height()\"\n [emptyText]=\"emptyText()\"\n [loading]=\"loading()\"\n [empty]=\"isEmpty()\"\n [showTable]=\"showTable()\"\n/>\n"
|
|
2350
2475
|
}]
|
|
2351
2476
|
}],
|
|
2352
2477
|
propDecorators: {
|
|
@@ -7892,6 +8017,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7892
8017
|
});
|
|
7893
8018
|
var UiMoneyComponent = class UiMoneyComponent {
|
|
7894
8019
|
defaults = inject(UI_FORMAT);
|
|
8020
|
+
privacy = inject(UI_PRIVACY);
|
|
7895
8021
|
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
7896
8022
|
currency = input(this.defaults.currency, ...ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []);
|
|
7897
8023
|
locale = input(this.defaults.locale, ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
@@ -7913,18 +8039,20 @@ var UiMoneyComponent = class UiMoneyComponent {
|
|
|
7913
8039
|
const value = this.value();
|
|
7914
8040
|
return value === null || Number.isNaN(value) ? null : value || 0;
|
|
7915
8041
|
}, ...ngDevMode ? [{ debugName: "amount" }] : /* istanbul ignore next */ []);
|
|
8042
|
+
masked = computed(() => this.privacy() !== "visible" && this.amount() !== null, ...ngDevMode ? [{ debugName: "masked" }] : /* istanbul ignore next */ []);
|
|
8043
|
+
mask = computed(() => maskMoney(this.currency(), this.locale()), ...ngDevMode ? [{ debugName: "mask" }] : /* istanbul ignore next */ []);
|
|
7916
8044
|
formatted = computed(() => {
|
|
7917
8045
|
const amount = this.amount();
|
|
7918
8046
|
return amount === null ? this.placeholder() : this.format(amount, this.compact());
|
|
7919
8047
|
}, ...ngDevMode ? [{ debugName: "formatted" }] : /* istanbul ignore next */ []);
|
|
7920
8048
|
title = computed(() => {
|
|
7921
8049
|
const amount = this.amount();
|
|
7922
|
-
return this.compact() && amount !== null ? this.format(amount, false) : null;
|
|
8050
|
+
return this.compact() && amount !== null && !this.masked() ? this.format(amount, false) : null;
|
|
7923
8051
|
}, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
7924
8052
|
generatedClasses = computed(() => ["ui-money", this.signClass()].filter(Boolean).join(" "), ...ngDevMode ? [{ debugName: "generatedClasses" }] : /* istanbul ignore next */ []);
|
|
7925
8053
|
signClass = computed(() => {
|
|
7926
8054
|
const amount = this.amount();
|
|
7927
|
-
if (!this.colourBySign() || amount === null) return "";
|
|
8055
|
+
if (!this.colourBySign() || amount === null || this.privacy() === "hidden") return "";
|
|
7928
8056
|
if (amount > 0) return "ui-money--positive";
|
|
7929
8057
|
return amount < 0 ? "ui-money--negative" : "";
|
|
7930
8058
|
}, ...ngDevMode ? [{ debugName: "signClass" }] : /* istanbul ignore next */ []);
|
|
@@ -7949,7 +8077,7 @@ var UiMoneyComponent = class UiMoneyComponent {
|
|
|
7949
8077
|
target: i0.ɵɵFactoryTarget.Component
|
|
7950
8078
|
});
|
|
7951
8079
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
7952
|
-
minVersion: "17.
|
|
8080
|
+
minVersion: "17.0.0",
|
|
7953
8081
|
version: "22.2.1",
|
|
7954
8082
|
type: UiMoneyComponent,
|
|
7955
8083
|
isStandalone: true,
|
|
@@ -8017,7 +8145,7 @@ var UiMoneyComponent = class UiMoneyComponent {
|
|
|
8017
8145
|
"attr.title": "title()"
|
|
8018
8146
|
} },
|
|
8019
8147
|
ngImport: i0,
|
|
8020
|
-
template: "{{ formatted() }}\n",
|
|
8148
|
+
template: "@if (masked()) {\n <span aria-hidden=\"true\">{{ mask() }}</span>\n <span class=\"sr-only\">amount hidden</span>\n} @else {{{ formatted() }}}\n",
|
|
8021
8149
|
styles: ["@layer properties;:host(.ui-money){white-space:nowrap;--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}:host(.ui-money--positive){color:var(--color-success-600, var(--color-teal-600))}:host(.ui-money--negative){color:var(--color-danger-600, var(--color-red-600))}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@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-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
8022
8150
|
});
|
|
8023
8151
|
};
|
|
@@ -8034,7 +8162,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8034
8162
|
"[class]": "generatedClasses()",
|
|
8035
8163
|
"[attr.title]": "title()"
|
|
8036
8164
|
},
|
|
8037
|
-
template: "{{ formatted() }}\n",
|
|
8165
|
+
template: "@if (masked()) {\n <span aria-hidden=\"true\">{{ mask() }}</span>\n <span class=\"sr-only\">amount hidden</span>\n} @else {{{ formatted() }}}\n",
|
|
8038
8166
|
styles: ["@layer properties;:host(.ui-money){white-space:nowrap;--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}:host(.ui-money--positive){color:var(--color-success-600, var(--color-teal-600))}:host(.ui-money--negative){color:var(--color-danger-600, var(--color-red-600))}@property --tw-ordinal{syntax: \"*\"; inherits: false;}@property --tw-slashed-zero{syntax: \"*\"; inherits: false;}@property --tw-numeric-figure{syntax: \"*\"; inherits: false;}@property --tw-numeric-spacing{syntax: \"*\"; inherits: false;}@property --tw-numeric-fraction{syntax: \"*\"; inherits: false;}@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-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
|
|
8039
8167
|
}]
|
|
8040
8168
|
}],
|
|
@@ -9107,6 +9235,7 @@ var UiTableComponent = class UiTableComponent {
|
|
|
9107
9235
|
destroyRef = inject(DestroyRef);
|
|
9108
9236
|
cdr = inject(ChangeDetectorRef);
|
|
9109
9237
|
registry = inject(UiTableRegistry);
|
|
9238
|
+
uiFormat = inject(UI_FORMAT);
|
|
9110
9239
|
loadedQuery = "";
|
|
9111
9240
|
loadedFilters = {};
|
|
9112
9241
|
resizeState = null;
|
|
@@ -9141,15 +9270,15 @@ var UiTableComponent = class UiTableComponent {
|
|
|
9141
9270
|
cellIconValue(column, row) {
|
|
9142
9271
|
return column.accessor(row);
|
|
9143
9272
|
}
|
|
9273
|
+
moneyCellValue(column, row) {
|
|
9274
|
+
const value = column.accessor(row);
|
|
9275
|
+
return value === null || value === void 0 ? null : Number(value);
|
|
9276
|
+
}
|
|
9144
9277
|
formattedCellValue(column, row) {
|
|
9145
9278
|
const value = column.accessor(row);
|
|
9146
9279
|
if (value === null || value === void 0) return "";
|
|
9147
9280
|
switch (column.displayType) {
|
|
9148
9281
|
case "number": return new Intl.NumberFormat().format(Number(value));
|
|
9149
|
-
case "currency": return new Intl.NumberFormat(void 0, {
|
|
9150
|
-
style: "currency",
|
|
9151
|
-
currency: column.currency ?? "USD"
|
|
9152
|
-
}).format(Number(value));
|
|
9153
9282
|
case "date": return new Intl.DateTimeFormat(void 0, { dateStyle: "medium" }).format(new Date(value));
|
|
9154
9283
|
case "time": return new Intl.DateTimeFormat(void 0, { timeStyle: "short" }).format(new Date(value));
|
|
9155
9284
|
default: return String(value);
|
|
@@ -9563,7 +9692,7 @@ var UiTableComponent = class UiTableComponent {
|
|
|
9563
9692
|
heroChevronDown
|
|
9564
9693
|
})],
|
|
9565
9694
|
ngImport: i0,
|
|
9566
|
-
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]=\"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()\">\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 <thead [class.ui-table-sticky]=\"stickyHeader()\">\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 hocus: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 <ng-icon\n [name]=\"sortIcon(column)\"\n class=\"ms-auto size-4 shrink-0\"\n />\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 </thead>\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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 <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 (column.displayType === 'icon') {\n <ng-icon\n [name]=\"cellIconValue(column, row)\"\n class=\"size-4\"\n />\n } @else {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n @for (action of actions(); track action.id) {\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hocus:bg-surface hocus:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n [title]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n }\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",
|
|
9695
|
+
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]=\"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()\">\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 <thead [class.ui-table-sticky]=\"stickyHeader()\">\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 hocus: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 <ng-icon\n [name]=\"sortIcon(column)\"\n class=\"ms-auto size-4 shrink-0\"\n />\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 </thead>\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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 <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 (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 {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n @for (action of actions(); track action.id) {\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hocus:bg-surface hocus:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n [title]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n }\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",
|
|
9567
9696
|
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 thead{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--table-line);background-color:var(--muted)}.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}: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)));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 [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-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-select-cell,.ui-table-actions-cell{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:center}.ui-table-actions-cell{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-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"],
|
|
9568
9697
|
dependencies: [
|
|
9569
9698
|
{
|
|
@@ -9714,6 +9843,21 @@ var UiTableComponent = class UiTableComponent {
|
|
|
9714
9843
|
type: UiLoadingComponent,
|
|
9715
9844
|
selector: "ui-loading",
|
|
9716
9845
|
inputs: ["type"]
|
|
9846
|
+
},
|
|
9847
|
+
{
|
|
9848
|
+
kind: "component",
|
|
9849
|
+
type: UiMoneyComponent,
|
|
9850
|
+
selector: "ui-money",
|
|
9851
|
+
inputs: [
|
|
9852
|
+
"value",
|
|
9853
|
+
"currency",
|
|
9854
|
+
"locale",
|
|
9855
|
+
"signDisplay",
|
|
9856
|
+
"colourBySign",
|
|
9857
|
+
"wholeUnits",
|
|
9858
|
+
"compact",
|
|
9859
|
+
"placeholder"
|
|
9860
|
+
]
|
|
9717
9861
|
}
|
|
9718
9862
|
]
|
|
9719
9863
|
});
|
|
@@ -9735,7 +9879,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9735
9879
|
UiDropdownDirective,
|
|
9736
9880
|
UiInputComponent,
|
|
9737
9881
|
UiSelectComponent,
|
|
9738
|
-
UiLoadingComponent
|
|
9882
|
+
UiLoadingComponent,
|
|
9883
|
+
UiMoneyComponent
|
|
9739
9884
|
],
|
|
9740
9885
|
host: { class: "block" },
|
|
9741
9886
|
providers: [provideIcons({
|
|
@@ -9747,7 +9892,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9747
9892
|
heroChevronUp,
|
|
9748
9893
|
heroChevronDown
|
|
9749
9894
|
})],
|
|
9750
|
-
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]=\"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()\">\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 <thead [class.ui-table-sticky]=\"stickyHeader()\">\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 hocus: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 <ng-icon\n [name]=\"sortIcon(column)\"\n class=\"ms-auto size-4 shrink-0\"\n />\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 </thead>\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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 <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 (column.displayType === 'icon') {\n <ng-icon\n [name]=\"cellIconValue(column, row)\"\n class=\"size-4\"\n />\n } @else {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n @for (action of actions(); track action.id) {\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hocus:bg-surface hocus:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n [title]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n }\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",
|
|
9895
|
+
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]=\"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()\">\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 <thead [class.ui-table-sticky]=\"stickyHeader()\">\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 hocus: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 <ng-icon\n [name]=\"sortIcon(column)\"\n class=\"ms-auto size-4 shrink-0\"\n />\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 </thead>\n\n <tbody class=\"ui-text-body-alt\">\n @if (loading()) {\n <tr>\n <td\n [attr.colspan]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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]=\"renderColumns().length + (selectable() ? 1 : 0) + (hasActions() ? 1 : 0)\"\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 <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 (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 {\n {{ formattedCellValue(column, row) }}\n }\n </td>\n }\n\n @if (hasActions()) {\n <td class=\"ui-table-actions-cell\">\n @for (action of actions(); track action.id) {\n <ui-button\n appearance=\"none\"\n classes=\"p-1.5! border-transparent! rounded-md! text-muted-foreground-1 cursor-pointer hocus:bg-surface hocus:text-foreground disabled:opacity-40! disabled:cursor-not-allowed\"\n [disabled]=\"!!action.disabled?.(row)\"\n [ariaLabel]=\"action.label\"\n [title]=\"action.label\"\n (click)=\"action.onClick(row)\"\n >\n <ng-icon\n [name]=\"action.icon\"\n class=\"size-4\"\n />\n </ui-button>\n }\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",
|
|
9751
9896
|
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 thead{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--table-line);background-color:var(--muted)}.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}: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)));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 [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-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-select-cell,.ui-table-actions-cell{padding-inline:calc(var(--spacing, .25rem) * 3);padding-block:calc(var(--spacing, .25rem) * 2);text-align:center}.ui-table-actions-cell{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-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"]
|
|
9752
9897
|
}]
|
|
9753
9898
|
}],
|
|
@@ -13933,6 +14078,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
13933
14078
|
}]
|
|
13934
14079
|
}
|
|
13935
14080
|
});
|
|
13936
|
-
export { AlertAppearances, AlertIntents, AvatarSizes, BadgeAppearances, BadgeIntents, BadgeSizes, BarChartOrientations, ButtonAppearances, ButtonIntents, ButtonSizes, ButtonTypes, CHART_INK, CHART_INK_DARK, CHART_MAX_LINE_SERIES, CHART_MAX_SERIES, CHART_PALETTE, CHART_PALETTE_DARK, CalendarModes, CardHeadingLevels, CardRadii, FileRejectionReasons, InputAriaAutocompletes, InputAriaHasPopups, InputModes, InputTypes, LineChartCurves, MoneySignDisplays, PieChartVariants, ProgressIntents, ProgressLabelPositions, ProgressOrientations, ProgressShapes, ProgressSizes, SelectLocalDataSource, SelectMultipleDisplays, SelectRemoteDataSource, SkeletonShapes, TableFiltersBreakpoints, TableLocalDataSource, TableRemoteDataSource, TextareaResizeOptions, ToastIntents, ToasterPositions, UI_FORMAT, UI_FORMAT_DEFAULTS, UI_LOADING_TYPES, UI_THEME_CONFIG, UiAlertComponent, UiAvatarComponent, UiBadgeComponent, UiBarChartComponent, UiButtonComponent, UiButtonGroupComponent, UiCalendarComponent, UiCardComponent, UiCardHeaderComponent, UiChartComponent, UiChartFrameComponent, UiChartLegendComponent, UiChartTableComponent, UiCheckboxComponent, UiColourComponent, UiContainerComponent, UiCounterComponent, UiDateRangePickerComponent, UiDatepickerComponent, UiDrawerComponent, UiDropdownButtonComponent, UiDropdownComponent, UiDropdownDirective, UiDropdownMenuComponent, UiDropzoneComponent, UiFieldComponent, UiFileInputComponent, UiInputAddonComponent, UiInputComponent, UiInputGroupComponent, UiKpiComponent, UiLayoutComponent, UiLineChartComponent, UiLoadingComponent, UiModalComponent, UiMoneyComponent, UiOverlayComponent, UiPaginationComponent, UiPieChartComponent, UiProgressComponent, UiRadioComponent, UiSearchComponent, UiSegmentedComponent, UiSelectComponent, UiSidebarComponent, UiSidebarGroupComponent, UiSidebarItemComponent, UiSkeletonComponent, UiStatComponent, UiSwitchComponent, UiTabComponent, UiTabDirective, UiTableComponent, UiTableFiltersComponent, UiTableRegistry, UiTextareaComponent, UiThemeService, UiThemeSwitchComponent, UiTimeSelectComponent, UiToastComponent, UiToastService, UiToasterComponent, UiTooltipComponent, UiUserMenuComponent, WeekStarts, chartColour, chartInk, chartSeriesStyle, defaultDateRangePresets, financialYearPreset, injectMoneyFormatter, lastDaysPreset, monthPreset, provideUiFormat, provideUiTheme, radiusClasses, thisWeekPreset, todayPreset, yearPreset };
|
|
14081
|
+
export { AlertAppearances, AlertIntents, AvatarSizes, BadgeAppearances, BadgeIntents, BadgeSizes, BarChartOrientations, ButtonAppearances, ButtonIntents, ButtonSizes, ButtonTypes, CHART_INK, CHART_INK_DARK, CHART_MAX_LINE_SERIES, CHART_MAX_SERIES, CHART_PALETTE, CHART_PALETTE_DARK, CalendarModes, CardHeadingLevels, CardRadii, FileRejectionReasons, InputAriaAutocompletes, InputAriaHasPopups, InputModes, InputTypes, LineChartCurves, MoneySignDisplays, PieChartVariants, ProgressIntents, ProgressLabelPositions, ProgressOrientations, ProgressShapes, ProgressSizes, SelectLocalDataSource, SelectMultipleDisplays, SelectRemoteDataSource, SkeletonShapes, TableFiltersBreakpoints, TableLocalDataSource, TableRemoteDataSource, TextareaResizeOptions, ToastIntents, ToasterPositions, UI_FORMAT, UI_FORMAT_DEFAULTS, UI_LOADING_TYPES, UI_PRIVACY, UI_THEME_CONFIG, UiAlertComponent, UiAvatarComponent, UiBadgeComponent, UiBarChartComponent, UiButtonComponent, UiButtonGroupComponent, UiCalendarComponent, UiCardComponent, UiCardHeaderComponent, UiChartComponent, UiChartFrameComponent, UiChartLegendComponent, UiChartTableComponent, UiCheckboxComponent, UiColourComponent, UiContainerComponent, UiCounterComponent, UiDateRangePickerComponent, UiDatepickerComponent, UiDrawerComponent, UiDropdownButtonComponent, UiDropdownComponent, UiDropdownDirective, UiDropdownMenuComponent, UiDropzoneComponent, UiFieldComponent, UiFileInputComponent, UiInputAddonComponent, UiInputComponent, UiInputGroupComponent, UiKpiComponent, UiLayoutComponent, UiLineChartComponent, UiLoadingComponent, UiModalComponent, UiMoneyComponent, UiOverlayComponent, UiPaginationComponent, UiPieChartComponent, UiPrivacies, UiProgressComponent, UiRadioComponent, UiSearchComponent, UiSegmentedComponent, UiSelectComponent, UiSidebarComponent, UiSidebarGroupComponent, UiSidebarItemComponent, UiSkeletonComponent, UiStatComponent, UiSwitchComponent, UiTabComponent, UiTabDirective, UiTableComponent, UiTableFiltersComponent, UiTableRegistry, UiTextareaComponent, UiThemeService, UiThemeSwitchComponent, UiTimeSelectComponent, UiToastComponent, UiToastService, UiToasterComponent, UiTooltipComponent, UiUserMenuComponent, WeekStarts, chartColour, chartInk, chartSeriesStyle, defaultDateRangePresets, financialYearPreset, injectMoneyFormatter, lastDaysPreset, maskMoney, moneyFormatterParts, monthPreset, provideUiFormat, provideUiPrivacy, provideUiTheme, radiusClasses, thisWeekPreset, todayPreset, yearPreset };
|
|
13937
14082
|
|
|
13938
14083
|
//# sourceMappingURL=area8975-ui.mjs.map
|