@alfadocs/ui-kit 0.20.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-CsCm7hQv.js → agenda-card-BmpaUG1h.js} +2 -2
- package/dist/_chunks/{agenda-tray-B8QZ3wEp.js → agenda-tray-DiInnVqk.js} +2 -2
- package/dist/_chunks/{alia-sidebar-Bof6TlFx.js → alia-sidebar-CUi2UCbY.js} +3 -3
- package/dist/_chunks/{avatar-I10iCDs8.js → avatar-BpFohgWG.js} +24 -16
- package/dist/_chunks/{chat-message-ChOnwqf_.js → chat-message-W3k8rLOA.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-Dn3-ANF5.js → editable-currency-cell-renderer-1t42gENX.js} +757 -717
- package/dist/_chunks/key-value-pair-DBuOCtIc.js +98 -0
- package/dist/_chunks/{message-card-c6R0-qXq.js → message-card-i61k1TGc.js} +2 -2
- package/dist/_chunks/{message-tray-BNAS8al4.js → message-tray-DrV7G-wR.js} +2 -2
- package/dist/_chunks/{timeline-rmls7dIh.js → timeline-Czeqr3HF.js} +2 -2
- package/dist/_chunks/{whatsapp-button-Bj5FIhpC.js → whatsapp-button-CtlLwM3M.js} +14 -3
- package/dist/_chunks/{workflow-map-BkLglexk.js → workflow-map-712GL-8u.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/data-table/filters/date-range-filter.d.ts +7 -4
- package/dist/components/data-table/filters/select-filter.d.ts +9 -15
- package/dist/components/data-table/filters/typeahead-filter.d.ts +7 -4
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/key-value-pair/key-value-pair.d.ts +19 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/config.d.ts +1 -1
- package/dist/i18n/config.js +18356 -2114
- package/dist/i18n/locales/ar.d.ts +1081 -0
- package/dist/i18n/locales/de.d.ts +1081 -0
- package/dist/i18n/locales/el.d.ts +1078 -0
- package/dist/i18n/locales/es.d.ts +1078 -0
- package/dist/i18n/locales/fr.d.ts +1078 -0
- package/dist/i18n/locales/hi.d.ts +1078 -0
- package/dist/i18n/locales/ja.d.ts +1078 -0
- package/dist/i18n/locales/nl.d.ts +1078 -0
- package/dist/i18n/locales/pl.d.ts +1078 -0
- package/dist/i18n/locales/pt.d.ts +1079 -0
- package/dist/i18n/locales/ro.d.ts +1078 -0
- package/dist/i18n/locales/ru.d.ts +1078 -0
- package/dist/i18n/locales/sq.d.ts +1078 -0
- package/dist/i18n/locales/sv.d.ts +1078 -0
- package/dist/i18n/locales/tr.d.ts +1078 -0
- package/dist/i18n/locales/zh.d.ts +1078 -0
- package/dist/i18n/resources.d.ts +48 -1034
- package/dist/index.js +12 -12
- package/dist/locales/ar.json +1073 -1
- package/dist/locales/de.json +58 -8
- package/dist/locales/el.json +1073 -0
- package/dist/locales/es.json +1073 -0
- package/dist/locales/fr.json +1073 -0
- package/dist/locales/hi.json +1073 -0
- package/dist/locales/it.json +31 -0
- package/dist/locales/ja.json +1073 -0
- package/dist/locales/nl.json +1073 -0
- package/dist/locales/pl.json +1073 -0
- package/dist/locales/pt.json +1073 -0
- package/dist/locales/ro.json +1073 -0
- package/dist/locales/ru.json +1073 -0
- package/dist/locales/sq.json +1073 -0
- package/dist/locales/sv.json +1073 -0
- package/dist/locales/tr.json +1073 -0
- package/dist/locales/zh.json +1073 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/tokens.css +2 -2
- package/package.json +4 -1
- package/dist/_chunks/key-value-pair-AbrRwesr.js +0 -76
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { S as
|
|
4
|
-
import { E as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { AgGridReact as
|
|
8
|
-
import { ModuleRegistry as
|
|
9
|
-
import { B as
|
|
1
|
+
import { jsx as r, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as k, forwardRef as _, useState as D, useCallback as O, useEffect as j, useRef as X, createContext as ve, useContext as ye, isValidElement as Te, cloneElement as Ce, useImperativeHandle as pt, useLayoutEffect as ft } from "react";
|
|
3
|
+
import { S as mt } from "./skeleton-CZbwyJAA.js";
|
|
4
|
+
import { E as gt } from "./empty-state-3CLJIXSj.js";
|
|
5
|
+
import { c as bt } from "./index-D2ZczOXr.js";
|
|
6
|
+
import { useTranslation as R } from "react-i18next";
|
|
7
|
+
import { AgGridReact as ht, useGridFilter as de } from "ag-grid-react";
|
|
8
|
+
import { ModuleRegistry as vt, AllCommunityModule as yt } from "ag-grid-community";
|
|
9
|
+
import { B as K } from "./button-DD_0Xdmr.js";
|
|
10
10
|
import { I as B } from "./icon-button-C4CGcYuz.js";
|
|
11
|
-
import { P as
|
|
12
|
-
import { C as
|
|
13
|
-
import { T as
|
|
14
|
-
import { T as
|
|
15
|
-
import { D as
|
|
16
|
-
import { X as
|
|
17
|
-
import { c as
|
|
18
|
-
import { S as
|
|
19
|
-
import { G as
|
|
20
|
-
import { P as
|
|
21
|
-
import { F as
|
|
22
|
-
import { F as
|
|
23
|
-
import { u as
|
|
24
|
-
import { D as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
11
|
+
import { P as J } from "./popover--derJ_wq.js";
|
|
12
|
+
import { C as xe } from "./checkbox-mwbrPZDY.js";
|
|
13
|
+
import { T as Tt } from "./text-input-CakysYnD.js";
|
|
14
|
+
import { T as ee } from "./tag-CQmHRM4Y.js";
|
|
15
|
+
import { D as Z } from "./dropdown-menu-DZxwF23X.js";
|
|
16
|
+
import { X as Ct } from "./x-CCcI3eJp.js";
|
|
17
|
+
import { c as ue } from "./createLucideIcon-CrFbzy84.js";
|
|
18
|
+
import { S as xt } from "./search-BonnQsHv.js";
|
|
19
|
+
import { G as St } from "./grip-vertical-Dlg0_k5C.js";
|
|
20
|
+
import { P as wt } from "./printer-CeVEWfQq.js";
|
|
21
|
+
import { F as Se } from "./file-text-DSNuv2B8.js";
|
|
22
|
+
import { F as Nt } from "./file-spreadsheet-zUkY8rJ2.js";
|
|
23
|
+
import { u as Ft } from "./registry-C9nwlNyL.js";
|
|
24
|
+
import { D as we } from "./date-range-picker-9gANFNG9.js";
|
|
25
|
+
import { M as Rt } from "./multi-select-CyspR5ZF.js";
|
|
26
|
+
import { A as Ne } from "./autocomplete-BxfabhZ8.js";
|
|
27
|
+
import { B as Dt } from "./badge-cLYVGlMh.js";
|
|
28
|
+
import { A as Fe } from "./avatar-BpFohgWG.js";
|
|
28
29
|
import { T as kt } from "./tooltip-DHik5yRI.js";
|
|
29
|
-
import { T as
|
|
30
|
-
import { S as
|
|
31
|
-
import { S as
|
|
32
|
-
import { c as
|
|
30
|
+
import { T as me } from "./timestamp-BV2lC-wV.js";
|
|
31
|
+
import { S as It } from "./square-check-big-Jr-0202D.js";
|
|
32
|
+
import { S as Et } from "./square-CZoGU14v.js";
|
|
33
|
+
import { c as Re, a as De, b as ke, d as Ie } from "./input-surface-xyERuLU_.js";
|
|
33
34
|
/**
|
|
34
35
|
* @license lucide-react v1.8.0 - ISC
|
|
35
36
|
*
|
|
36
37
|
* This source code is licensed under the ISC license.
|
|
37
38
|
* See the LICENSE file in the root directory of this source tree.
|
|
38
39
|
*/
|
|
39
|
-
const
|
|
40
|
+
const At = [
|
|
40
41
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
41
42
|
["path", { d: "M12 3v18", key: "108xh3" }]
|
|
42
|
-
],
|
|
43
|
+
], zt = ue("columns-2", At);
|
|
43
44
|
/**
|
|
44
45
|
* @license lucide-react v1.8.0 - ISC
|
|
45
46
|
*
|
|
46
47
|
* This source code is licensed under the ISC license.
|
|
47
48
|
* See the LICENSE file in the root directory of this source tree.
|
|
48
49
|
*/
|
|
49
|
-
const
|
|
50
|
+
const Pt = [
|
|
50
51
|
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
51
52
|
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
52
53
|
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
53
|
-
],
|
|
54
|
+
], te = ue("download", Pt);
|
|
54
55
|
/**
|
|
55
56
|
* @license lucide-react v1.8.0 - ISC
|
|
56
57
|
*
|
|
57
58
|
* This source code is licensed under the ISC license.
|
|
58
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
59
60
|
*/
|
|
60
|
-
const
|
|
61
|
+
const Ot = [
|
|
61
62
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
62
63
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
63
64
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
64
65
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
65
|
-
],
|
|
66
|
-
function
|
|
66
|
+
], Mt = ue("refresh-cw", Ot);
|
|
67
|
+
function _t(t) {
|
|
67
68
|
if (!Te(t)) return t;
|
|
68
69
|
const e = t, a = e.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} ds:size-4`.trim();
|
|
69
|
-
return
|
|
70
|
+
return Ce(e, { className: n, size: e.props.size ?? 16 });
|
|
70
71
|
}
|
|
71
|
-
const
|
|
72
|
-
function
|
|
73
|
-
const e = ye(
|
|
72
|
+
const Ee = ve(null);
|
|
73
|
+
function L(t) {
|
|
74
|
+
const e = ye(Ee);
|
|
74
75
|
if (!e)
|
|
75
76
|
throw new Error(
|
|
76
77
|
`${t} must be rendered inside <DataTable.Toolbar> as a descendant of <DataTable>.`
|
|
77
78
|
);
|
|
78
79
|
return e;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function jt({
|
|
81
82
|
getApi: t,
|
|
82
83
|
selectionCount: e,
|
|
83
84
|
onPrint: a,
|
|
84
85
|
children: n
|
|
85
86
|
}) {
|
|
86
|
-
const
|
|
87
|
+
const o = k(
|
|
87
88
|
() => ({ getApi: t, selectionCount: e, onPrint: a }),
|
|
88
89
|
[t, e, a]
|
|
89
90
|
);
|
|
90
|
-
return /* @__PURE__ */ r(
|
|
91
|
+
return /* @__PURE__ */ r(Ee.Provider, { value: o, children: n });
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
+
const Lt = [
|
|
93
94
|
"data-table-toolbar",
|
|
94
95
|
// Mobile (<sm) keeps `flex-wrap` so a wide QuickSearch can flow above the
|
|
95
96
|
// Actions cluster on narrow screens. From `sm` (≥640px) we switch to
|
|
@@ -108,20 +109,20 @@ const jt = [
|
|
|
108
109
|
"ds:border ds:border-[color:var(--card-border)]",
|
|
109
110
|
"ds:shadow-[var(--shadow-sm)]",
|
|
110
111
|
"ds:py-[var(--spacing-sm)] ds:px-[var(--spacing-md)]"
|
|
111
|
-
].join(" "),
|
|
112
|
+
].join(" "), Ae = _(
|
|
112
113
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ r(
|
|
113
114
|
"div",
|
|
114
115
|
{
|
|
115
116
|
ref: n,
|
|
116
117
|
role: "toolbar",
|
|
117
|
-
className: [
|
|
118
|
+
className: [Lt, t ?? ""].join(" ").trim(),
|
|
118
119
|
...a,
|
|
119
120
|
children: e
|
|
120
121
|
}
|
|
121
122
|
)
|
|
122
123
|
);
|
|
123
|
-
|
|
124
|
-
const
|
|
124
|
+
Ae.displayName = "DataTable.Toolbar";
|
|
125
|
+
const ze = _(
|
|
125
126
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ r(
|
|
126
127
|
"div",
|
|
127
128
|
{
|
|
@@ -140,8 +141,8 @@ const Ee = M(
|
|
|
140
141
|
}
|
|
141
142
|
)
|
|
142
143
|
);
|
|
143
|
-
|
|
144
|
-
const
|
|
144
|
+
ze.displayName = "DataTable.Toolbar.FilterBar";
|
|
145
|
+
const Pe = _(
|
|
145
146
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ r(
|
|
146
147
|
"div",
|
|
147
148
|
{
|
|
@@ -156,20 +157,20 @@ const Ae = M(
|
|
|
156
157
|
}
|
|
157
158
|
)
|
|
158
159
|
);
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
({ label: t, onExport: e, intent: a = "outline", ...n },
|
|
162
|
-
const { t: i } =
|
|
163
|
-
const u =
|
|
160
|
+
Pe.displayName = "DataTable.Toolbar.Actions";
|
|
161
|
+
const Oe = _(
|
|
162
|
+
({ label: t, onExport: e, intent: a = "outline", ...n }, o) => {
|
|
163
|
+
const { t: i } = R(), { getApi: s } = L("DataTable.Toolbar.ExportCsv"), c = O(() => {
|
|
164
|
+
const u = s();
|
|
164
165
|
u && (e ? e(u) : u.exportDataAsCsv());
|
|
165
|
-
}, [
|
|
166
|
+
}, [s, e]);
|
|
166
167
|
return /* @__PURE__ */ r(
|
|
167
168
|
B,
|
|
168
169
|
{
|
|
169
|
-
ref:
|
|
170
|
+
ref: o,
|
|
170
171
|
type: "button",
|
|
171
172
|
intent: a,
|
|
172
|
-
icon: /* @__PURE__ */ r(
|
|
173
|
+
icon: /* @__PURE__ */ r(te, { "aria-hidden": !0 }),
|
|
173
174
|
tooltip: t ?? i("dataTable.exportCsv"),
|
|
174
175
|
onClick: c,
|
|
175
176
|
...n
|
|
@@ -177,39 +178,39 @@ const ze = M(
|
|
|
177
178
|
);
|
|
178
179
|
}
|
|
179
180
|
);
|
|
180
|
-
|
|
181
|
+
Oe.displayName = "DataTable.Toolbar.ExportCsv";
|
|
181
182
|
function U(t, e = [30, 30, 30]) {
|
|
182
183
|
if (typeof document > "u") return e;
|
|
183
184
|
const a = document.createElement("span");
|
|
184
185
|
a.style.color = `hsl(var(${t}))`, a.style.position = "absolute", a.style.visibility = "hidden", document.body.appendChild(a);
|
|
185
186
|
const n = getComputedStyle(a).color;
|
|
186
187
|
document.body.removeChild(a);
|
|
187
|
-
const
|
|
188
|
-
return
|
|
188
|
+
const o = n.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
|
|
189
|
+
return o ? [Number(o[1]), Number(o[2]), Number(o[3])] : e;
|
|
189
190
|
}
|
|
190
|
-
async function
|
|
191
|
+
async function Me(t, e) {
|
|
191
192
|
if (!t) return;
|
|
192
193
|
const [{ jsPDF: a }, { default: n }] = await Promise.all([
|
|
193
|
-
import("./jspdf.es.min-DaapWjR1.js").then((
|
|
194
|
+
import("./jspdf.es.min-DaapWjR1.js").then((y) => y.j),
|
|
194
195
|
import("./jspdf.plugin.autotable-CSiDNyPn.js")
|
|
195
|
-
]), i = (t.getColumns() ?? []).filter((
|
|
196
|
-
i.map((
|
|
196
|
+
]), i = (t.getColumns() ?? []).filter((y) => y.isVisible()), s = [
|
|
197
|
+
i.map((y) => t.getDisplayNameForColumn(y, null) ?? "")
|
|
197
198
|
], c = [];
|
|
198
|
-
t.forEachNodeAfterFilterAndSort((
|
|
199
|
-
if (!
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
rowNode:
|
|
203
|
-
colKey:
|
|
199
|
+
t.forEachNodeAfterFilterAndSort((y) => {
|
|
200
|
+
if (!y.data) return;
|
|
201
|
+
const g = i.map((b) => {
|
|
202
|
+
const S = t.getCellValue({
|
|
203
|
+
rowNode: y,
|
|
204
|
+
colKey: b,
|
|
204
205
|
useFormatter: !0
|
|
205
206
|
});
|
|
206
|
-
return
|
|
207
|
+
return S == null ? "" : String(S);
|
|
207
208
|
});
|
|
208
|
-
c.push(
|
|
209
|
+
c.push(g);
|
|
209
210
|
});
|
|
210
|
-
const u = U("--muted", [240, 240, 240]), d = U("--foreground", [30, 30, 30]), l = U("--card-foreground", [30, 30, 30]), m = U("--card", [250, 250, 250]),
|
|
211
|
-
n(
|
|
212
|
-
head:
|
|
211
|
+
const u = U("--muted", [240, 240, 240]), d = U("--foreground", [30, 30, 30]), l = U("--card-foreground", [30, 30, 30]), m = U("--card", [250, 250, 250]), x = new a({ orientation: "landscape" });
|
|
212
|
+
n(x, {
|
|
213
|
+
head: s,
|
|
213
214
|
body: c,
|
|
214
215
|
headStyles: { fillColor: u, textColor: d },
|
|
215
216
|
bodyStyles: { textColor: l },
|
|
@@ -219,17 +220,17 @@ async function Pe(t, e) {
|
|
|
219
220
|
fontSize: 10,
|
|
220
221
|
cellPadding: 4
|
|
221
222
|
}
|
|
222
|
-
}),
|
|
223
|
+
}), x.save(e.fileName);
|
|
223
224
|
}
|
|
224
|
-
const _e =
|
|
225
|
-
({ label: t, onClick: e, fileName: a, intent: n = "outline", ...
|
|
226
|
-
const { t:
|
|
225
|
+
const _e = _(
|
|
226
|
+
({ label: t, onClick: e, fileName: a, intent: n = "outline", ...o }, i) => {
|
|
227
|
+
const { t: s } = R(), { getApi: c } = L("DataTable.Toolbar.ExportPdf"), u = O(() => {
|
|
227
228
|
const d = c();
|
|
228
229
|
if (e) {
|
|
229
230
|
e(d);
|
|
230
231
|
return;
|
|
231
232
|
}
|
|
232
|
-
|
|
233
|
+
Me(d, {
|
|
233
234
|
fileName: a ?? "data-table-export.pdf"
|
|
234
235
|
});
|
|
235
236
|
}, [c, e, a]);
|
|
@@ -239,41 +240,41 @@ const _e = M(
|
|
|
239
240
|
ref: i,
|
|
240
241
|
type: "button",
|
|
241
242
|
intent: n,
|
|
242
|
-
icon: /* @__PURE__ */ r(
|
|
243
|
-
tooltip: t ??
|
|
243
|
+
icon: /* @__PURE__ */ r(Se, { "aria-hidden": !0 }),
|
|
244
|
+
tooltip: t ?? s("dataTable.exportPdf"),
|
|
244
245
|
onClick: u,
|
|
245
|
-
...
|
|
246
|
+
...o
|
|
246
247
|
}
|
|
247
248
|
);
|
|
248
249
|
}
|
|
249
250
|
);
|
|
250
251
|
_e.displayName = "DataTable.Toolbar.ExportPdf";
|
|
251
|
-
const
|
|
252
|
+
const je = _(
|
|
252
253
|
({ label: t, intent: e = "outline", ...a }, n) => {
|
|
253
|
-
const { t:
|
|
254
|
+
const { t: o } = R(), { onPrint: i } = L("DataTable.Toolbar.Print");
|
|
254
255
|
return /* @__PURE__ */ r(
|
|
255
256
|
B,
|
|
256
257
|
{
|
|
257
258
|
ref: n,
|
|
258
259
|
type: "button",
|
|
259
260
|
intent: e,
|
|
260
|
-
icon: /* @__PURE__ */ r(
|
|
261
|
-
tooltip: t ??
|
|
261
|
+
icon: /* @__PURE__ */ r(wt, { "aria-hidden": !0 }),
|
|
262
|
+
tooltip: t ?? o("dataTable.print"),
|
|
262
263
|
onClick: i,
|
|
263
264
|
...a
|
|
264
265
|
}
|
|
265
266
|
);
|
|
266
267
|
}
|
|
267
268
|
);
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
const { t: a } =
|
|
271
|
-
return
|
|
269
|
+
je.displayName = "DataTable.Toolbar.Print";
|
|
270
|
+
const Le = ({ placeholder: t, debounceMs: e = 150 }) => {
|
|
271
|
+
const { t: a } = R(), { getApi: n } = L("DataTable.Toolbar.QuickSearch"), [o, i] = D(""), s = X(void 0);
|
|
272
|
+
return j(() => (s.current && window.clearTimeout(s.current), s.current = window.setTimeout(() => {
|
|
272
273
|
const c = n();
|
|
273
|
-
c && c.setGridOption("quickFilterText",
|
|
274
|
+
c && c.setGridOption("quickFilterText", o);
|
|
274
275
|
}, e), () => {
|
|
275
|
-
|
|
276
|
-
}), [
|
|
276
|
+
s.current && window.clearTimeout(s.current);
|
|
277
|
+
}), [o, e, n]), // Slot wrapper caps the search at a sensible legible width on desktop —
|
|
277
278
|
// without this, TextInput's `w-full` lets the QuickSearch absorb the
|
|
278
279
|
// entire FilterBar row and push trailing Actions onto a second line at
|
|
279
280
|
// 1024 / 1280 / 1440. `min-w-0` lets the slot shrink below `24rem` when
|
|
@@ -281,31 +282,31 @@ const Me = ({ placeholder: t, debounceMs: e = 150 }) => {
|
|
|
281
282
|
// `--toolbar-search-max` token in the kit yet — see this component's
|
|
282
283
|
// summary for a follow-up note recommending we add one.
|
|
283
284
|
/* @__PURE__ */ r("div", { className: "ds:w-full ds:max-w-[24rem] ds:min-w-0", children: /* @__PURE__ */ r(
|
|
284
|
-
|
|
285
|
+
Tt,
|
|
285
286
|
{
|
|
286
287
|
type: "search",
|
|
287
288
|
size: "sm",
|
|
288
|
-
value:
|
|
289
|
+
value: o,
|
|
289
290
|
onChange: (c) => i(c.target.value),
|
|
290
291
|
placeholder: t ?? a("dataTable.quickSearch.placeholder", "Search…"),
|
|
291
|
-
startAdornment: /* @__PURE__ */ r(
|
|
292
|
+
startAdornment: /* @__PURE__ */ r(xt, { "aria-hidden": !0, className: "ds:size-4" }),
|
|
292
293
|
clearable: !0,
|
|
293
294
|
onClear: () => i(""),
|
|
294
295
|
"aria-label": a("dataTable.quickSearch.label", "Quick search")
|
|
295
296
|
}
|
|
296
297
|
) });
|
|
297
298
|
};
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
({ onRefresh: t, label: e, intent: a = "outline", ...n },
|
|
301
|
-
const { t: i } =
|
|
299
|
+
Le.displayName = "DataTable.Toolbar.QuickSearch";
|
|
300
|
+
const $e = _(
|
|
301
|
+
({ onRefresh: t, label: e, intent: a = "outline", ...n }, o) => {
|
|
302
|
+
const { t: i } = R();
|
|
302
303
|
return /* @__PURE__ */ r(
|
|
303
304
|
B,
|
|
304
305
|
{
|
|
305
|
-
ref:
|
|
306
|
+
ref: o,
|
|
306
307
|
type: "button",
|
|
307
308
|
intent: a,
|
|
308
|
-
icon: /* @__PURE__ */ r(
|
|
309
|
+
icon: /* @__PURE__ */ r(Mt, { "aria-hidden": !0 }),
|
|
309
310
|
tooltip: e ?? i("dataTable.refresh", "Refresh"),
|
|
310
311
|
onClick: t,
|
|
311
312
|
...n
|
|
@@ -313,7 +314,7 @@ const je = M(
|
|
|
313
314
|
);
|
|
314
315
|
}
|
|
315
316
|
);
|
|
316
|
-
|
|
317
|
+
$e.displayName = "DataTable.Toolbar.Refresh";
|
|
317
318
|
function $t(t) {
|
|
318
319
|
if (!t || typeof t != "object") return "";
|
|
319
320
|
const e = t;
|
|
@@ -323,34 +324,34 @@ function $t(t) {
|
|
|
323
324
|
}
|
|
324
325
|
return typeof e.dateFrom == "string" ? typeof e.dateTo == "string" && e.dateTo ? `${e.dateFrom} – ${e.dateTo}` : String(e.dateFrom) : Array.isArray(e.values) ? e.values.map(String).join(", ") : "";
|
|
325
326
|
}
|
|
326
|
-
const
|
|
327
|
-
const { t } =
|
|
327
|
+
const Ge = () => {
|
|
328
|
+
const { t } = R(), { getApi: e } = L("DataTable.Toolbar.FilterChips"), [a, n] = D([]), [o, i] = D(""), s = O(() => {
|
|
328
329
|
const l = e();
|
|
329
330
|
if (!l) {
|
|
330
331
|
n([]), i("");
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
|
-
const m = l.getFilterModel() ?? {},
|
|
334
|
-
for (const
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
colId:
|
|
338
|
-
headerName:
|
|
339
|
-
text: $t(m[
|
|
334
|
+
const m = l.getFilterModel() ?? {}, x = l.getColumns() ?? [], y = [];
|
|
335
|
+
for (const b of Object.keys(m)) {
|
|
336
|
+
const S = x.find((f) => f.getColId() === b), p = l.getDisplayNameForColumn(S, null) ?? b;
|
|
337
|
+
y.push({
|
|
338
|
+
colId: b,
|
|
339
|
+
headerName: p,
|
|
340
|
+
text: $t(m[b])
|
|
340
341
|
});
|
|
341
342
|
}
|
|
342
|
-
n(
|
|
343
|
-
const
|
|
344
|
-
i(typeof
|
|
343
|
+
n(y);
|
|
344
|
+
const g = l.getGridOption("quickFilterText");
|
|
345
|
+
i(typeof g == "string" ? g : "");
|
|
345
346
|
}, [e]);
|
|
346
|
-
if (
|
|
347
|
+
if (j(() => {
|
|
347
348
|
const l = e();
|
|
348
349
|
if (!l) return;
|
|
349
|
-
const m = (
|
|
350
|
-
return l.addEventListener("filterChanged", m),
|
|
350
|
+
const m = (x) => s();
|
|
351
|
+
return l.addEventListener("filterChanged", m), s(), () => {
|
|
351
352
|
l.removeEventListener("filterChanged", m);
|
|
352
353
|
};
|
|
353
|
-
}, [e,
|
|
354
|
+
}, [e, s]), a.length + (o ? 1 : 0) === 0) return null;
|
|
354
355
|
function u(l) {
|
|
355
356
|
const m = e();
|
|
356
357
|
m && m.destroyFilter(l);
|
|
@@ -359,17 +360,17 @@ const $e = () => {
|
|
|
359
360
|
const l = e();
|
|
360
361
|
l && (l.setFilterModel(null), l.setGridOption("quickFilterText", ""), i(""));
|
|
361
362
|
}
|
|
362
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ I(
|
|
363
364
|
"div",
|
|
364
365
|
{
|
|
365
366
|
role: "group",
|
|
366
367
|
"aria-label": t("dataTable.filterChips.label", "Active filters"),
|
|
367
368
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
368
369
|
children: [
|
|
369
|
-
|
|
370
|
-
|
|
370
|
+
o && /* @__PURE__ */ r(
|
|
371
|
+
ee,
|
|
371
372
|
{
|
|
372
|
-
label: `${t("dataTable.quickSearch.label", "Quick search")}: ${
|
|
373
|
+
label: `${t("dataTable.quickSearch.label", "Quick search")}: ${o}`,
|
|
373
374
|
size: "sm",
|
|
374
375
|
fill: "outline",
|
|
375
376
|
onRemove: () => {
|
|
@@ -379,7 +380,7 @@ const $e = () => {
|
|
|
379
380
|
}
|
|
380
381
|
),
|
|
381
382
|
a.map((l) => /* @__PURE__ */ r(
|
|
382
|
-
|
|
383
|
+
ee,
|
|
383
384
|
{
|
|
384
385
|
label: l.text ? `${l.headerName}: ${l.text}` : l.headerName,
|
|
385
386
|
size: "sm",
|
|
@@ -389,13 +390,13 @@ const $e = () => {
|
|
|
389
390
|
l.colId
|
|
390
391
|
)),
|
|
391
392
|
/* @__PURE__ */ r(
|
|
392
|
-
|
|
393
|
+
K,
|
|
393
394
|
{
|
|
394
395
|
type: "button",
|
|
395
396
|
intent: "ghost",
|
|
396
397
|
size: "sm",
|
|
397
398
|
onClick: d,
|
|
398
|
-
startIcon: /* @__PURE__ */ r(
|
|
399
|
+
startIcon: /* @__PURE__ */ r(Ct, { "aria-hidden": !0, className: "ds:size-4" }),
|
|
399
400
|
children: t("dataTable.filterChips.clearAll", "Clear all")
|
|
400
401
|
}
|
|
401
402
|
)
|
|
@@ -403,16 +404,16 @@ const $e = () => {
|
|
|
403
404
|
}
|
|
404
405
|
);
|
|
405
406
|
};
|
|
406
|
-
|
|
407
|
-
const
|
|
407
|
+
Ge.displayName = "DataTable.Toolbar.FilterChips";
|
|
408
|
+
const Be = ({
|
|
408
409
|
field: t,
|
|
409
410
|
options: e,
|
|
410
411
|
label: a
|
|
411
412
|
}) => {
|
|
412
|
-
const { t: n } =
|
|
413
|
+
const { t: n } = R(), { getApi: o } = L("DataTable.Toolbar.FacetFilter"), [i, s] = D(null);
|
|
413
414
|
function c(u) {
|
|
414
|
-
|
|
415
|
-
const d =
|
|
415
|
+
s(u);
|
|
416
|
+
const d = o();
|
|
416
417
|
if (d) {
|
|
417
418
|
if (u === null) {
|
|
418
419
|
d.destroyFilter(t);
|
|
@@ -433,7 +434,7 @@ const Le = ({
|
|
|
433
434
|
children: e.map((u) => {
|
|
434
435
|
const d = i === u.value;
|
|
435
436
|
return /* @__PURE__ */ r(
|
|
436
|
-
|
|
437
|
+
K,
|
|
437
438
|
{
|
|
438
439
|
type: "button",
|
|
439
440
|
size: "sm",
|
|
@@ -448,188 +449,188 @@ const Le = ({
|
|
|
448
449
|
}
|
|
449
450
|
);
|
|
450
451
|
};
|
|
451
|
-
|
|
452
|
-
const
|
|
453
|
-
async function
|
|
452
|
+
Be.displayName = "DataTable.Toolbar.FacetFilter";
|
|
453
|
+
const Gt = ["csv", "xlsx", "pdf"];
|
|
454
|
+
async function Bt(t, e) {
|
|
454
455
|
if (!t) return;
|
|
455
|
-
const a = await import("./exceljs.min-DUJ-5CGx.js").then((
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
(
|
|
456
|
+
const a = await import("./exceljs.min-DUJ-5CGx.js").then((b) => b.e), n = new a.Workbook(), o = n.addWorksheet("Sheet1"), s = (t.getColumns() ?? []).filter((b) => b.isVisible());
|
|
457
|
+
o.addRow(
|
|
458
|
+
s.map(
|
|
459
|
+
(b) => t.getDisplayNameForColumn(b, null) ?? b.getColId()
|
|
459
460
|
)
|
|
460
|
-
), t.forEachNodeAfterFilterAndSort((
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
rowNode:
|
|
465
|
-
colKey:
|
|
461
|
+
), t.forEachNodeAfterFilterAndSort((b) => {
|
|
462
|
+
b.data && o.addRow(
|
|
463
|
+
s.map((S) => {
|
|
464
|
+
const p = t.getCellValue({
|
|
465
|
+
rowNode: b,
|
|
466
|
+
colKey: S,
|
|
466
467
|
useFormatter: !0
|
|
467
468
|
});
|
|
468
|
-
return
|
|
469
|
+
return p ?? "";
|
|
469
470
|
})
|
|
470
471
|
);
|
|
471
472
|
});
|
|
472
|
-
const c = U("--muted", [240, 240, 240]), u = U("--foreground", [30, 30, 30]), d =
|
|
473
|
-
d.eachCell((
|
|
474
|
-
|
|
473
|
+
const c = U("--muted", [240, 240, 240]), u = U("--foreground", [30, 30, 30]), d = o.getRow(1), l = ([b, S, p]) => `${b.toString(16).padStart(2, "0")}${S.toString(16).padStart(2, "0")}${p.toString(16).padStart(2, "0")}`.toUpperCase();
|
|
474
|
+
d.eachCell((b) => {
|
|
475
|
+
b.font = { bold: !0, color: { argb: `FF${l(u)}` } }, b.fill = {
|
|
475
476
|
type: "pattern",
|
|
476
477
|
pattern: "solid",
|
|
477
478
|
fgColor: { argb: `FF${l(c)}` }
|
|
478
479
|
};
|
|
479
480
|
});
|
|
480
|
-
const m = await n.xlsx.writeBuffer(),
|
|
481
|
+
const m = await n.xlsx.writeBuffer(), x = new Blob([m], {
|
|
481
482
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
482
|
-
}),
|
|
483
|
-
|
|
483
|
+
}), y = URL.createObjectURL(x), g = document.createElement("a");
|
|
484
|
+
g.href = y, g.download = e.fileName, document.body.appendChild(g), g.click(), document.body.removeChild(g), URL.revokeObjectURL(y);
|
|
484
485
|
}
|
|
485
|
-
const
|
|
486
|
-
function
|
|
487
|
-
const t = ye(
|
|
486
|
+
const Ve = ve(null);
|
|
487
|
+
function Vt() {
|
|
488
|
+
const t = ye(Ve);
|
|
488
489
|
if (!t)
|
|
489
490
|
throw new Error(
|
|
490
491
|
"DataTable.Toolbar.ExportMenu.Item must be rendered inside DataTable.Toolbar.ExportMenu."
|
|
491
492
|
);
|
|
492
493
|
return t;
|
|
493
494
|
}
|
|
494
|
-
const
|
|
495
|
-
const { t: a } =
|
|
496
|
-
return /* @__PURE__ */ r(
|
|
497
|
-
/* @__PURE__ */ r(
|
|
495
|
+
const qe = ({ children: t, label: e }) => {
|
|
496
|
+
const { t: a } = R(), { getApi: n } = L("DataTable.Toolbar.ExportMenu"), o = k(() => ({ getApi: n }), [n]), i = t ?? Gt.map((s) => /* @__PURE__ */ r(pe, { format: s }, s));
|
|
497
|
+
return /* @__PURE__ */ r(Ve.Provider, { value: o, children: /* @__PURE__ */ I(Z.Root, { children: [
|
|
498
|
+
/* @__PURE__ */ r(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
498
499
|
B,
|
|
499
500
|
{
|
|
500
501
|
type: "button",
|
|
501
502
|
intent: "outline",
|
|
502
|
-
icon: /* @__PURE__ */ r(
|
|
503
|
+
icon: /* @__PURE__ */ r(te, { "aria-hidden": !0 }),
|
|
503
504
|
tooltip: e ?? a("dataTable.export.menu", "Export"),
|
|
504
505
|
"aria-label": e ?? a("dataTable.export.menu", "Export"),
|
|
505
506
|
"aria-haspopup": "menu"
|
|
506
507
|
}
|
|
507
508
|
) }),
|
|
508
|
-
/* @__PURE__ */ r(
|
|
509
|
+
/* @__PURE__ */ r(Z.Content, { align: "end", sideOffset: 4, children: i })
|
|
509
510
|
] }) });
|
|
510
511
|
};
|
|
511
|
-
|
|
512
|
-
function
|
|
512
|
+
qe.displayName = "DataTable.Toolbar.ExportMenu";
|
|
513
|
+
function qt(t, e) {
|
|
513
514
|
return e === "csv" ? t("dataTable.export.csv", "Export CSV") : e === "xlsx" ? t("dataTable.export.xlsx", "Export Excel") : e === "pdf" ? t("dataTable.export.pdf", "Export PDF") : t("dataTable.export.custom", "Export");
|
|
514
515
|
}
|
|
515
|
-
function
|
|
516
|
-
return t === "csv" ? /* @__PURE__ */ r(
|
|
516
|
+
function Ut(t) {
|
|
517
|
+
return t === "csv" ? /* @__PURE__ */ r(te, { "aria-hidden": !0, className: "ds:size-4" }) : t === "xlsx" ? /* @__PURE__ */ r(Nt, { "aria-hidden": !0, className: "ds:size-4" }) : t === "pdf" ? /* @__PURE__ */ r(Se, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ r(te, { "aria-hidden": !0, className: "ds:size-4" });
|
|
517
518
|
}
|
|
518
|
-
const
|
|
519
|
+
const pe = ({
|
|
519
520
|
format: t,
|
|
520
521
|
label: e,
|
|
521
522
|
onClick: a,
|
|
522
523
|
fileName: n
|
|
523
524
|
}) => {
|
|
524
|
-
const { t:
|
|
525
|
+
const { t: o } = R(), { getApi: i } = Vt(), s = O(() => {
|
|
525
526
|
const c = i();
|
|
526
527
|
if (t === "csv") {
|
|
527
528
|
c == null || c.exportDataAsCsv();
|
|
528
529
|
return;
|
|
529
530
|
}
|
|
530
531
|
if (t === "pdf") {
|
|
531
|
-
|
|
532
|
+
Me(c, {
|
|
532
533
|
fileName: n ?? "data-table-export.pdf"
|
|
533
534
|
});
|
|
534
535
|
return;
|
|
535
536
|
}
|
|
536
537
|
if (t === "xlsx") {
|
|
537
|
-
|
|
538
|
+
Bt(c, {
|
|
538
539
|
fileName: n ?? "data-table-export.xlsx"
|
|
539
540
|
});
|
|
540
541
|
return;
|
|
541
542
|
}
|
|
542
543
|
a == null || a(c);
|
|
543
544
|
}, [t, n, a, i]);
|
|
544
|
-
return /* @__PURE__ */ r(
|
|
545
|
-
|
|
546
|
-
/* @__PURE__ */ r("span", { children: e ??
|
|
545
|
+
return /* @__PURE__ */ r(Z.Item, { onSelect: s, children: /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
546
|
+
Ut(t),
|
|
547
|
+
/* @__PURE__ */ r("span", { children: e ?? qt(o, t) })
|
|
547
548
|
] }) });
|
|
548
549
|
};
|
|
549
|
-
|
|
550
|
-
function
|
|
550
|
+
pe.displayName = "DataTable.Toolbar.ExportMenu.Item";
|
|
551
|
+
function Ht(t) {
|
|
551
552
|
return t ? (t.getColumns() ?? []).map((a) => a.getColDef().hide === void 0 && a.getColId().startsWith("ag-Grid-") ? null : {
|
|
552
553
|
colId: a.getColId(),
|
|
553
554
|
displayName: t.getDisplayNameForColumn(a, null) || a.getColId(),
|
|
554
555
|
visible: a.isVisible()
|
|
555
556
|
}).filter((a) => a !== null) : [];
|
|
556
557
|
}
|
|
557
|
-
const
|
|
558
|
-
const { t: e } =
|
|
559
|
-
|
|
560
|
-
n &&
|
|
558
|
+
const Ue = ({ label: t }) => {
|
|
559
|
+
const { t: e } = R(), { getApi: a } = L("DataTable.Toolbar.ColumnToggle"), [n, o] = D(!1), [i, s] = D([]), [c, u] = D(null), [d, l] = D(null);
|
|
560
|
+
j(() => {
|
|
561
|
+
n && s(Ht(a()));
|
|
561
562
|
}, [n, a]);
|
|
562
|
-
const m =
|
|
563
|
-
(
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
(
|
|
567
|
-
(
|
|
563
|
+
const m = O(
|
|
564
|
+
(g, b) => {
|
|
565
|
+
const S = a();
|
|
566
|
+
S && (S.setColumnsVisible([g], b), s(
|
|
567
|
+
(p) => p.map(
|
|
568
|
+
(f) => f.colId === g ? { ...f, visible: b } : f
|
|
568
569
|
)
|
|
569
570
|
));
|
|
570
571
|
},
|
|
571
572
|
[a]
|
|
572
|
-
),
|
|
573
|
-
(
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
const
|
|
581
|
-
return
|
|
573
|
+
), x = O(
|
|
574
|
+
(g, b) => {
|
|
575
|
+
if (g === b) return;
|
|
576
|
+
const S = a();
|
|
577
|
+
if (!S) return;
|
|
578
|
+
s((f) => {
|
|
579
|
+
const h = f.findIndex((A) => A.colId === g), T = f.findIndex((A) => A.colId === b);
|
|
580
|
+
if (h < 0 || T < 0) return f;
|
|
581
|
+
const w = [...f], [P] = w.splice(h, 1);
|
|
582
|
+
return w.splice(T, 0, P), w;
|
|
582
583
|
});
|
|
583
|
-
const
|
|
584
|
-
|
|
584
|
+
const p = i.findIndex((f) => f.colId === b);
|
|
585
|
+
p >= 0 && S.moveColumns([g], p);
|
|
585
586
|
},
|
|
586
587
|
[a, i]
|
|
587
|
-
),
|
|
588
|
-
return /* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */ r(
|
|
588
|
+
), y = t ?? e("dataTable.columnToggle");
|
|
589
|
+
return /* @__PURE__ */ I(J.Root, { open: n, onOpenChange: o, children: [
|
|
590
|
+
/* @__PURE__ */ r(J.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
590
591
|
B,
|
|
591
592
|
{
|
|
592
593
|
type: "button",
|
|
593
594
|
intent: "outline",
|
|
594
|
-
icon: /* @__PURE__ */ r(
|
|
595
|
-
"aria-label":
|
|
595
|
+
icon: /* @__PURE__ */ r(zt, { "aria-hidden": !0 }),
|
|
596
|
+
"aria-label": y,
|
|
596
597
|
"aria-haspopup": "dialog"
|
|
597
598
|
}
|
|
598
599
|
) }),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */ r(
|
|
600
|
+
/* @__PURE__ */ I(J.Content, { size: "sm", align: "end", children: [
|
|
601
|
+
/* @__PURE__ */ r(J.Heading, { children: y }),
|
|
601
602
|
/* @__PURE__ */ r(
|
|
602
603
|
"ul",
|
|
603
604
|
{
|
|
604
605
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
605
|
-
"aria-label":
|
|
606
|
-
children: i.map((
|
|
607
|
-
const
|
|
608
|
-
return /* @__PURE__ */
|
|
606
|
+
"aria-label": y,
|
|
607
|
+
children: i.map((g) => {
|
|
608
|
+
const b = c === g.colId, S = d === g.colId && c !== g.colId;
|
|
609
|
+
return /* @__PURE__ */ I(
|
|
609
610
|
"li",
|
|
610
611
|
{
|
|
611
612
|
draggable: !0,
|
|
612
|
-
onDragStart: (
|
|
613
|
-
u(
|
|
613
|
+
onDragStart: (p) => {
|
|
614
|
+
u(g.colId), p.dataTransfer.effectAllowed = "move", p.dataTransfer.setData("text/plain", g.colId);
|
|
614
615
|
},
|
|
615
|
-
onDragOver: (
|
|
616
|
-
|
|
616
|
+
onDragOver: (p) => {
|
|
617
|
+
p.preventDefault(), p.dataTransfer.dropEffect = "move", l(g.colId);
|
|
617
618
|
},
|
|
618
619
|
onDragLeave: () => {
|
|
619
|
-
l((
|
|
620
|
+
l((p) => p === g.colId ? null : p);
|
|
620
621
|
},
|
|
621
|
-
onDrop: (
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
|
|
622
|
+
onDrop: (p) => {
|
|
623
|
+
p.preventDefault();
|
|
624
|
+
const f = p.dataTransfer.getData("text/plain");
|
|
625
|
+
f && x(f, g.colId), u(null), l(null);
|
|
625
626
|
},
|
|
626
627
|
onDragEnd: () => {
|
|
627
628
|
u(null), l(null);
|
|
628
629
|
},
|
|
629
630
|
className: [
|
|
630
631
|
"ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-xs)] ds:py-[var(--spacing-2xs,var(--spacing-xs))] ds:transition-colors",
|
|
631
|
-
|
|
632
|
-
|
|
632
|
+
b ? "ds:opacity-50" : "",
|
|
633
|
+
S ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
|
|
633
634
|
].filter(Boolean).join(" "),
|
|
634
635
|
children: [
|
|
635
636
|
/* @__PURE__ */ r(
|
|
@@ -637,20 +638,20 @@ const Ve = ({ label: t }) => {
|
|
|
637
638
|
{
|
|
638
639
|
"aria-hidden": "true",
|
|
639
640
|
className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
|
|
640
|
-
children: /* @__PURE__ */ r(
|
|
641
|
+
children: /* @__PURE__ */ r(St, { className: "ds:size-4" })
|
|
641
642
|
}
|
|
642
643
|
),
|
|
643
644
|
/* @__PURE__ */ r(
|
|
644
|
-
|
|
645
|
+
xe,
|
|
645
646
|
{
|
|
646
|
-
label:
|
|
647
|
-
checked:
|
|
648
|
-
onCheckedChange: (
|
|
647
|
+
label: g.displayName,
|
|
648
|
+
checked: g.visible,
|
|
649
|
+
onCheckedChange: (p) => m(g.colId, p === !0)
|
|
649
650
|
}
|
|
650
651
|
)
|
|
651
652
|
]
|
|
652
653
|
},
|
|
653
|
-
|
|
654
|
+
g.colId
|
|
654
655
|
);
|
|
655
656
|
})
|
|
656
657
|
}
|
|
@@ -658,20 +659,20 @@ const Ve = ({ label: t }) => {
|
|
|
658
659
|
] })
|
|
659
660
|
] });
|
|
660
661
|
};
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
({ label: t, icon: e, onClick: a, variant: n = "default", size:
|
|
664
|
-
const { t: c } =
|
|
662
|
+
Ue.displayName = "DataTable.Toolbar.ColumnToggle";
|
|
663
|
+
const He = _(
|
|
664
|
+
({ label: t, icon: e, onClick: a, variant: n = "default", size: o = "sm", ...i }, s) => {
|
|
665
|
+
const { t: c } = R(), { getApi: u, selectionCount: d } = L(
|
|
665
666
|
"DataTable.Toolbar.BulkAction"
|
|
666
667
|
);
|
|
667
|
-
return d === 0 ? null : /* @__PURE__ */
|
|
668
|
-
|
|
668
|
+
return d === 0 ? null : /* @__PURE__ */ I(
|
|
669
|
+
K,
|
|
669
670
|
{
|
|
670
|
-
ref:
|
|
671
|
+
ref: s,
|
|
671
672
|
type: "button",
|
|
672
673
|
intent: n === "destructive" ? "destructive" : "secondary",
|
|
673
|
-
size:
|
|
674
|
-
startIcon:
|
|
674
|
+
size: o,
|
|
675
|
+
startIcon: _t(e),
|
|
675
676
|
onClick: () => a(u()),
|
|
676
677
|
"aria-label": `${t} (${c("dataTable.bulkAction", { count: d })})`,
|
|
677
678
|
...i,
|
|
@@ -690,25 +691,25 @@ const qe = M(
|
|
|
690
691
|
);
|
|
691
692
|
}
|
|
692
693
|
);
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
Item:
|
|
696
|
-
}),
|
|
697
|
-
FilterBar:
|
|
698
|
-
Actions:
|
|
694
|
+
He.displayName = "DataTable.Toolbar.BulkAction";
|
|
695
|
+
const Kt = Object.assign(qe, {
|
|
696
|
+
Item: pe
|
|
697
|
+
}), Y = Object.assign(Ae, {
|
|
698
|
+
FilterBar: ze,
|
|
699
|
+
Actions: Pe,
|
|
699
700
|
/** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
|
|
700
|
-
ExportCsv:
|
|
701
|
+
ExportCsv: Oe,
|
|
701
702
|
/** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
|
|
702
703
|
ExportPdf: _e,
|
|
703
|
-
Print:
|
|
704
|
-
ColumnToggle:
|
|
705
|
-
BulkAction:
|
|
706
|
-
QuickSearch:
|
|
707
|
-
Refresh:
|
|
708
|
-
FilterChips:
|
|
709
|
-
FacetFilter:
|
|
710
|
-
ExportMenu:
|
|
711
|
-
}),
|
|
704
|
+
Print: je,
|
|
705
|
+
ColumnToggle: Ue,
|
|
706
|
+
BulkAction: He,
|
|
707
|
+
QuickSearch: Le,
|
|
708
|
+
Refresh: $e,
|
|
709
|
+
FilterChips: Ge,
|
|
710
|
+
FacetFilter: Be,
|
|
711
|
+
ExportMenu: Kt
|
|
712
|
+
}), Wt = {
|
|
712
713
|
id: "data-table",
|
|
713
714
|
capabilities: [
|
|
714
715
|
"select_single",
|
|
@@ -816,8 +817,8 @@ const Ht = Object.assign(Be, {
|
|
|
816
817
|
}
|
|
817
818
|
}
|
|
818
819
|
};
|
|
819
|
-
|
|
820
|
-
const
|
|
820
|
+
vt.registerModules([yt]);
|
|
821
|
+
const Qt = bt("ag-theme-alfadocs ds:w-full", {
|
|
821
822
|
variants: {
|
|
822
823
|
density: {
|
|
823
824
|
default: "",
|
|
@@ -834,9 +835,9 @@ const Wt = mt("ag-theme-alfadocs ds:w-full", {
|
|
|
834
835
|
bordered: !0
|
|
835
836
|
}
|
|
836
837
|
});
|
|
837
|
-
function
|
|
838
|
-
const { t } =
|
|
839
|
-
return
|
|
838
|
+
function Xt() {
|
|
839
|
+
const { t } = R();
|
|
840
|
+
return k(
|
|
840
841
|
() => ({
|
|
841
842
|
// Filter strings
|
|
842
843
|
contains: t("dataTable.agGrid.contains"),
|
|
@@ -868,7 +869,7 @@ function Qt() {
|
|
|
868
869
|
[t]
|
|
869
870
|
);
|
|
870
871
|
}
|
|
871
|
-
function
|
|
872
|
+
function Jt() {
|
|
872
873
|
return /* @__PURE__ */ r(
|
|
873
874
|
"div",
|
|
874
875
|
{
|
|
@@ -876,7 +877,7 @@ function Xt() {
|
|
|
876
877
|
"aria-live": "polite",
|
|
877
878
|
className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
|
|
878
879
|
children: Array.from({ length: 5 }).map((t, e) => /* @__PURE__ */ r(
|
|
879
|
-
|
|
880
|
+
mt,
|
|
880
881
|
{
|
|
881
882
|
variant: "rectangular",
|
|
882
883
|
className: "ds:h-[var(--min-target-size)] ds:w-full"
|
|
@@ -886,10 +887,10 @@ function Xt() {
|
|
|
886
887
|
}
|
|
887
888
|
);
|
|
888
889
|
}
|
|
889
|
-
function
|
|
890
|
-
const { t } =
|
|
890
|
+
function Zt() {
|
|
891
|
+
const { t } = R();
|
|
891
892
|
return /* @__PURE__ */ r(
|
|
892
|
-
|
|
893
|
+
gt,
|
|
893
894
|
{
|
|
894
895
|
variant: "no-results",
|
|
895
896
|
size: "sm",
|
|
@@ -898,7 +899,7 @@ function Jt() {
|
|
|
898
899
|
}
|
|
899
900
|
);
|
|
900
901
|
}
|
|
901
|
-
function
|
|
902
|
+
function Yt(t) {
|
|
902
903
|
try {
|
|
903
904
|
const e = localStorage.getItem(`data-table-col-state:${t}`);
|
|
904
905
|
return e ? JSON.parse(e) : null;
|
|
@@ -906,7 +907,7 @@ function Zt(t) {
|
|
|
906
907
|
return null;
|
|
907
908
|
}
|
|
908
909
|
}
|
|
909
|
-
function
|
|
910
|
+
function ea(t, e) {
|
|
910
911
|
try {
|
|
911
912
|
localStorage.setItem(
|
|
912
913
|
`data-table-col-state:${t}`,
|
|
@@ -915,207 +916,207 @@ function Yt(t, e) {
|
|
|
915
916
|
} catch {
|
|
916
917
|
}
|
|
917
918
|
}
|
|
918
|
-
function
|
|
919
|
+
function ta(t, e) {
|
|
919
920
|
const {
|
|
920
921
|
columnDefs: a,
|
|
921
922
|
rowData: n,
|
|
922
|
-
rowSelection:
|
|
923
|
+
rowSelection: o,
|
|
923
924
|
pagination: i = !1,
|
|
924
|
-
paginationPageSize:
|
|
925
|
+
paginationPageSize: s = 25,
|
|
925
926
|
paginationPageSizeSelector: c = [10, 25, 50, 100],
|
|
926
927
|
gridId: u,
|
|
927
928
|
onSelectionChanged: d,
|
|
928
929
|
onSortChanged: l,
|
|
929
930
|
onFilterChanged: m,
|
|
930
|
-
noRowsOverlay:
|
|
931
|
-
loadingOverlay:
|
|
932
|
-
gridOptions:
|
|
933
|
-
density:
|
|
934
|
-
bordered:
|
|
935
|
-
heightClass:
|
|
936
|
-
className:
|
|
937
|
-
getRowClass:
|
|
931
|
+
noRowsOverlay: x,
|
|
932
|
+
loadingOverlay: y,
|
|
933
|
+
gridOptions: g,
|
|
934
|
+
density: b,
|
|
935
|
+
bordered: S,
|
|
936
|
+
heightClass: p = "ds:h-[500px]",
|
|
937
|
+
className: f,
|
|
938
|
+
getRowClass: h,
|
|
938
939
|
pinnedBottomRowData: T,
|
|
939
|
-
printMode:
|
|
940
|
-
children:
|
|
941
|
-
} = t, { t:
|
|
940
|
+
printMode: w = !1,
|
|
941
|
+
children: P
|
|
942
|
+
} = t, { t: A, i18n: W } = R(), F = X(null), [$, We] = D(0), [ne, re] = D(""), Qe = Xt(), oe = k(
|
|
942
943
|
() => ({
|
|
943
944
|
getSelection: () => {
|
|
944
|
-
var
|
|
945
|
-
const
|
|
946
|
-
if (!
|
|
947
|
-
const
|
|
948
|
-
for (const
|
|
949
|
-
|
|
950
|
-
return
|
|
945
|
+
var N;
|
|
946
|
+
const v = (N = F.current) == null ? void 0 : N.api;
|
|
947
|
+
if (!v) return [];
|
|
948
|
+
const C = [];
|
|
949
|
+
for (const z of v.getSelectedNodes())
|
|
950
|
+
z.id != null && C.push(z.id);
|
|
951
|
+
return C;
|
|
951
952
|
},
|
|
952
|
-
setSelection: (
|
|
953
|
-
var
|
|
954
|
-
const
|
|
955
|
-
if (!
|
|
956
|
-
const
|
|
957
|
-
|
|
958
|
-
|
|
953
|
+
setSelection: (v) => {
|
|
954
|
+
var z;
|
|
955
|
+
const C = (z = F.current) == null ? void 0 : z.api;
|
|
956
|
+
if (!C) return;
|
|
957
|
+
const N = new Set(v);
|
|
958
|
+
C.forEachNode((E) => {
|
|
959
|
+
E.id != null && E.setSelected(N.has(E.id));
|
|
959
960
|
});
|
|
960
961
|
},
|
|
961
|
-
selectRange: (
|
|
962
|
+
selectRange: (v, C) => {
|
|
962
963
|
var fe;
|
|
963
|
-
const
|
|
964
|
-
if (!
|
|
965
|
-
const
|
|
966
|
-
|
|
967
|
-
V.id != null &&
|
|
964
|
+
const N = (fe = F.current) == null ? void 0 : fe.api;
|
|
965
|
+
if (!N) return;
|
|
966
|
+
const z = [];
|
|
967
|
+
N.forEachNodeAfterFilterAndSort((V) => {
|
|
968
|
+
V.id != null && z.push(V.id);
|
|
968
969
|
});
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
const [G,
|
|
972
|
-
|
|
973
|
-
V.id != null && V.setSelected(
|
|
970
|
+
const E = z.indexOf(v), M = z.indexOf(C);
|
|
971
|
+
if (E < 0 || M < 0) return;
|
|
972
|
+
const [G, le] = E <= M ? [E, M] : [M, E], ie = new Set(z.slice(G, le + 1));
|
|
973
|
+
N.forEachNode((V) => {
|
|
974
|
+
V.id != null && V.setSelected(ie.has(V.id));
|
|
974
975
|
});
|
|
975
976
|
},
|
|
976
977
|
clearSelection: () => {
|
|
977
|
-
var
|
|
978
|
-
(
|
|
978
|
+
var v, C;
|
|
979
|
+
(C = (v = F.current) == null ? void 0 : v.api) == null || C.deselectAll();
|
|
979
980
|
},
|
|
980
981
|
getFilter: () => {
|
|
981
|
-
var
|
|
982
|
-
return ((
|
|
982
|
+
var v, C;
|
|
983
|
+
return ((C = (v = F.current) == null ? void 0 : v.api) == null ? void 0 : C.getFilterModel()) ?? {};
|
|
983
984
|
},
|
|
984
|
-
setFilter: (
|
|
985
|
-
var
|
|
986
|
-
(
|
|
985
|
+
setFilter: (v) => {
|
|
986
|
+
var C, N;
|
|
987
|
+
(N = (C = F.current) == null ? void 0 : C.api) == null || N.setFilterModel(v);
|
|
987
988
|
},
|
|
988
989
|
getSort: () => {
|
|
989
|
-
var
|
|
990
|
-
const
|
|
991
|
-
return
|
|
990
|
+
var C;
|
|
991
|
+
const v = (C = F.current) == null ? void 0 : C.api;
|
|
992
|
+
return v ? v.getColumnState().filter((N) => N.sort === "asc" || N.sort === "desc").map((N) => ({ colId: N.colId, sort: N.sort })) : [];
|
|
992
993
|
},
|
|
993
|
-
setSort: (
|
|
994
|
-
var
|
|
995
|
-
const
|
|
996
|
-
if (!
|
|
997
|
-
const
|
|
998
|
-
const
|
|
999
|
-
return { ...
|
|
994
|
+
setSort: (v) => {
|
|
995
|
+
var z;
|
|
996
|
+
const C = (z = F.current) == null ? void 0 : z.api;
|
|
997
|
+
if (!C) return;
|
|
998
|
+
const N = C.getColumnState().map((E) => {
|
|
999
|
+
const M = v.find((G) => G.colId === E.colId);
|
|
1000
|
+
return { ...E, sort: M ? M.sort : null };
|
|
1000
1001
|
});
|
|
1001
|
-
|
|
1002
|
+
C.applyColumnState({ state: N, defaultState: { sort: null } });
|
|
1002
1003
|
},
|
|
1003
1004
|
getCurrentPage: () => {
|
|
1004
|
-
var
|
|
1005
|
-
return ((
|
|
1005
|
+
var v, C;
|
|
1006
|
+
return ((C = (v = F.current) == null ? void 0 : v.api) == null ? void 0 : C.paginationGetCurrentPage()) ?? 0;
|
|
1006
1007
|
},
|
|
1007
|
-
goToPage: (
|
|
1008
|
-
var
|
|
1009
|
-
(
|
|
1008
|
+
goToPage: (v) => {
|
|
1009
|
+
var C, N;
|
|
1010
|
+
(N = (C = F.current) == null ? void 0 : C.api) == null || N.paginationGoToPage(v);
|
|
1010
1011
|
},
|
|
1011
1012
|
getRawApi: () => {
|
|
1012
|
-
var
|
|
1013
|
-
return (
|
|
1013
|
+
var v;
|
|
1014
|
+
return (v = F.current) == null ? void 0 : v.api;
|
|
1014
1015
|
}
|
|
1015
1016
|
}),
|
|
1016
1017
|
[]
|
|
1017
1018
|
);
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1019
|
+
pt(e, () => oe, [oe]), Ft(Wt, oe, u);
|
|
1020
|
+
const Xe = W.dir() === "rtl", Je = n === void 0, Ze = k(
|
|
1020
1021
|
() => window.matchMedia("(prefers-reduced-motion: reduce)").matches,
|
|
1021
1022
|
[]
|
|
1022
|
-
),
|
|
1023
|
+
), Ye = k(
|
|
1023
1024
|
() => document.documentElement.classList.contains("theme-accessible"),
|
|
1024
1025
|
[]
|
|
1025
|
-
) &&
|
|
1026
|
-
if (
|
|
1027
|
-
return
|
|
1026
|
+
) && b === "compact" ? "default" : b, et = k(() => {
|
|
1027
|
+
if (o)
|
|
1028
|
+
return o === "single" ? { mode: "singleRow" } : {
|
|
1028
1029
|
mode: "multiRow",
|
|
1029
1030
|
headerCheckbox: !0,
|
|
1030
1031
|
checkboxes: !0
|
|
1031
1032
|
};
|
|
1032
|
-
}, [
|
|
1033
|
-
var
|
|
1034
|
-
if (!u || !((
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
state:
|
|
1033
|
+
}, [o]), tt = O(() => {
|
|
1034
|
+
var C;
|
|
1035
|
+
if (!u || !((C = F.current) != null && C.api)) return;
|
|
1036
|
+
const v = Yt(u);
|
|
1037
|
+
v && F.current.api.applyColumnState({
|
|
1038
|
+
state: v,
|
|
1038
1039
|
applyOrder: !0
|
|
1039
1040
|
});
|
|
1040
|
-
}, [u]),
|
|
1041
|
-
var
|
|
1042
|
-
u && ((
|
|
1043
|
-
}, [u]),
|
|
1044
|
-
var
|
|
1045
|
-
const
|
|
1046
|
-
if (!
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
}, [d]),
|
|
1050
|
-
(
|
|
1051
|
-
var
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1054
|
-
const
|
|
1055
|
-
if (
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
column:
|
|
1060
|
-
direction:
|
|
1041
|
+
}, [u]), se = O(() => {
|
|
1042
|
+
var v;
|
|
1043
|
+
u && ((v = F.current) != null && v.api) && ea(u, F.current.api);
|
|
1044
|
+
}, [u]), at = O(() => {
|
|
1045
|
+
var N;
|
|
1046
|
+
const v = (N = F.current) == null ? void 0 : N.api;
|
|
1047
|
+
if (!v) return;
|
|
1048
|
+
const C = v.getSelectedRows();
|
|
1049
|
+
We(C.length), d == null || d(C);
|
|
1050
|
+
}, [d]), nt = O(
|
|
1051
|
+
(v) => {
|
|
1052
|
+
var N;
|
|
1053
|
+
const C = (N = F.current) == null ? void 0 : N.api;
|
|
1054
|
+
if (C) {
|
|
1055
|
+
const E = C.getColumnState().find((M) => M.sort);
|
|
1056
|
+
if (E) {
|
|
1057
|
+
const M = E.colId, G = C.getColumnDef(M), le = (G == null ? void 0 : G.headerName) ?? M, ie = E.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
|
|
1058
|
+
re(
|
|
1059
|
+
A("dataTable.sortAnnounce", {
|
|
1060
|
+
column: le,
|
|
1061
|
+
direction: A(ie)
|
|
1061
1062
|
})
|
|
1062
1063
|
);
|
|
1063
1064
|
} else
|
|
1064
|
-
|
|
1065
|
+
re("");
|
|
1065
1066
|
}
|
|
1066
|
-
l == null || l(
|
|
1067
|
+
l == null || l(v);
|
|
1067
1068
|
},
|
|
1068
|
-
[l,
|
|
1069
|
-
),
|
|
1070
|
-
(
|
|
1071
|
-
m == null || m(
|
|
1069
|
+
[l, A]
|
|
1070
|
+
), rt = O(
|
|
1071
|
+
(v) => {
|
|
1072
|
+
m == null || m(v);
|
|
1072
1073
|
},
|
|
1073
1074
|
[m]
|
|
1074
1075
|
);
|
|
1075
|
-
|
|
1076
|
-
if (!
|
|
1077
|
-
const
|
|
1078
|
-
return () => clearTimeout(
|
|
1079
|
-
}, [
|
|
1080
|
-
const
|
|
1076
|
+
j(() => {
|
|
1077
|
+
if (!ne) return;
|
|
1078
|
+
const v = setTimeout(() => re(""), 3e3);
|
|
1079
|
+
return () => clearTimeout(v);
|
|
1080
|
+
}, [ne]);
|
|
1081
|
+
const ot = x ?? Zt, st = y ?? Jt, lt = O(
|
|
1081
1082
|
() => {
|
|
1082
|
-
var
|
|
1083
|
-
return (
|
|
1083
|
+
var v;
|
|
1084
|
+
return (v = F.current) == null ? void 0 : v.api;
|
|
1084
1085
|
},
|
|
1085
1086
|
[]
|
|
1086
|
-
),
|
|
1087
|
+
), it = O(() => {
|
|
1087
1088
|
typeof window < "u" && window.print();
|
|
1088
|
-
}, []),
|
|
1089
|
-
density:
|
|
1090
|
-
bordered:
|
|
1091
|
-
className:
|
|
1092
|
-
}),
|
|
1093
|
-
return /* @__PURE__ */
|
|
1089
|
+
}, []), ct = Qt({
|
|
1090
|
+
density: Ye,
|
|
1091
|
+
bordered: S,
|
|
1092
|
+
className: f
|
|
1093
|
+
}), dt = P ?? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(Y.Actions, { children: /* @__PURE__ */ r(Y.ExportMenu, {}) }) }), ut = w ? !1 : i;
|
|
1094
|
+
return /* @__PURE__ */ I(
|
|
1094
1095
|
"div",
|
|
1095
1096
|
{
|
|
1096
1097
|
className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1097
|
-
"aria-busy":
|
|
1098
|
+
"aria-busy": Je ? "true" : void 0,
|
|
1098
1099
|
"data-component": "data-table",
|
|
1099
1100
|
"data-component-id": u,
|
|
1100
|
-
"data-print-mode":
|
|
1101
|
+
"data-print-mode": w ? "true" : void 0,
|
|
1101
1102
|
children: [
|
|
1102
|
-
!
|
|
1103
|
-
|
|
1103
|
+
!w && /* @__PURE__ */ r(
|
|
1104
|
+
jt,
|
|
1104
1105
|
{
|
|
1105
|
-
getApi:
|
|
1106
|
-
selectionCount:
|
|
1107
|
-
onPrint:
|
|
1108
|
-
children:
|
|
1106
|
+
getApi: lt,
|
|
1107
|
+
selectionCount: $,
|
|
1108
|
+
onPrint: it,
|
|
1109
|
+
children: dt
|
|
1109
1110
|
}
|
|
1110
1111
|
),
|
|
1111
1112
|
/* @__PURE__ */ r(
|
|
1112
1113
|
"div",
|
|
1113
1114
|
{
|
|
1114
|
-
className: [
|
|
1115
|
+
className: [ct, w ? "" : p].join(" ").trim(),
|
|
1115
1116
|
children: /* @__PURE__ */ r(
|
|
1116
|
-
|
|
1117
|
+
ht,
|
|
1117
1118
|
{
|
|
1118
|
-
ref:
|
|
1119
|
+
ref: F,
|
|
1119
1120
|
theme: "legacy",
|
|
1120
1121
|
columnDefs: a,
|
|
1121
1122
|
rowData: n,
|
|
@@ -1127,15 +1128,15 @@ function ea(t, e) {
|
|
|
1127
1128
|
// §13d — faint sort icon advertises which columns are
|
|
1128
1129
|
// sortable. v33+ moved this from grid-level to defaultColDef.
|
|
1129
1130
|
unSortIcon: !0,
|
|
1130
|
-
...
|
|
1131
|
+
...g == null ? void 0 : g.defaultColDef
|
|
1131
1132
|
},
|
|
1132
|
-
rowSelection:
|
|
1133
|
-
pagination:
|
|
1134
|
-
paginationPageSize:
|
|
1133
|
+
rowSelection: et,
|
|
1134
|
+
pagination: ut,
|
|
1135
|
+
paginationPageSize: s,
|
|
1135
1136
|
paginationPageSizeSelector: c,
|
|
1136
|
-
paginationNumberFormatter: (
|
|
1137
|
-
animateRows: !
|
|
1138
|
-
enableRtl:
|
|
1137
|
+
paginationNumberFormatter: (v) => new Intl.NumberFormat(W.language).format(v.value),
|
|
1138
|
+
animateRows: !Ze,
|
|
1139
|
+
enableRtl: Xe,
|
|
1139
1140
|
ensureDomOrder: !0,
|
|
1140
1141
|
enableCellSpan: !0,
|
|
1141
1142
|
enableCellTextSelection: !0,
|
|
@@ -1143,7 +1144,7 @@ function ea(t, e) {
|
|
|
1143
1144
|
accentedSort: !0,
|
|
1144
1145
|
multiSortKey: "ctrl",
|
|
1145
1146
|
suppressDragLeaveHidesColumns: !0,
|
|
1146
|
-
suppressRowClickSelection:
|
|
1147
|
+
suppressRowClickSelection: o ? !0 : void 0,
|
|
1147
1148
|
tooltipShowDelay: 500,
|
|
1148
1149
|
tooltipHideDelay: 5e3,
|
|
1149
1150
|
tooltipInteraction: !0,
|
|
@@ -1153,68 +1154,68 @@ function ea(t, e) {
|
|
|
1153
1154
|
undoRedoCellEditingLimit: 20,
|
|
1154
1155
|
suppressCellFocus: !1,
|
|
1155
1156
|
rowBuffer: 10,
|
|
1156
|
-
localeText:
|
|
1157
|
-
noRowsOverlayComponent:
|
|
1158
|
-
loadingOverlayComponent:
|
|
1159
|
-
getRowClass:
|
|
1157
|
+
localeText: Qe,
|
|
1158
|
+
noRowsOverlayComponent: ot,
|
|
1159
|
+
loadingOverlayComponent: st,
|
|
1160
|
+
getRowClass: h,
|
|
1160
1161
|
pinnedBottomRowData: T,
|
|
1161
|
-
domLayout:
|
|
1162
|
-
onGridReady:
|
|
1163
|
-
onColumnMoved:
|
|
1164
|
-
onColumnResized:
|
|
1165
|
-
onColumnPinned:
|
|
1166
|
-
onSortChanged:
|
|
1167
|
-
onFilterChanged:
|
|
1168
|
-
onSelectionChanged:
|
|
1169
|
-
...
|
|
1162
|
+
domLayout: w ? "autoHeight" : void 0,
|
|
1163
|
+
onGridReady: tt,
|
|
1164
|
+
onColumnMoved: se,
|
|
1165
|
+
onColumnResized: se,
|
|
1166
|
+
onColumnPinned: se,
|
|
1167
|
+
onSortChanged: nt,
|
|
1168
|
+
onFilterChanged: rt,
|
|
1169
|
+
onSelectionChanged: at,
|
|
1170
|
+
...g
|
|
1170
1171
|
}
|
|
1171
1172
|
)
|
|
1172
1173
|
}
|
|
1173
1174
|
),
|
|
1174
|
-
!
|
|
1175
|
-
/* @__PURE__ */ r("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children:
|
|
1175
|
+
!w && /* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: $ > 0 ? /* @__PURE__ */ r("span", { children: A("dataTable.selected", { count: $ }) }) : /* @__PURE__ */ r("span", {}) }),
|
|
1176
|
+
/* @__PURE__ */ r("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: ne })
|
|
1176
1177
|
]
|
|
1177
1178
|
}
|
|
1178
1179
|
);
|
|
1179
1180
|
}
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1183
|
-
Toolbar:
|
|
1181
|
+
const Ke = _(ta);
|
|
1182
|
+
Ke.displayName = "DataTable";
|
|
1183
|
+
const Ja = Object.assign(Ke, {
|
|
1184
|
+
Toolbar: Y
|
|
1184
1185
|
});
|
|
1185
|
-
function
|
|
1186
|
-
return
|
|
1186
|
+
function Za(t, e, a) {
|
|
1187
|
+
return k(() => {
|
|
1187
1188
|
const n = {};
|
|
1188
|
-
for (const
|
|
1189
|
+
for (const o of e) {
|
|
1189
1190
|
let i = 0;
|
|
1190
|
-
for (const
|
|
1191
|
-
const c = o
|
|
1191
|
+
for (const s of t ?? []) {
|
|
1192
|
+
const c = s[o], u = typeof c == "number" ? c : Number(c);
|
|
1192
1193
|
Number.isFinite(u) && (i += u);
|
|
1193
1194
|
}
|
|
1194
|
-
n[
|
|
1195
|
+
n[o] = i;
|
|
1195
1196
|
}
|
|
1196
1197
|
return a != null && a.labelField && a.labelValue !== void 0 && (n[a.labelField] = a.labelValue), n;
|
|
1197
1198
|
}, [t, e, a == null ? void 0 : a.labelField, a == null ? void 0 : a.labelValue]);
|
|
1198
1199
|
}
|
|
1199
|
-
function
|
|
1200
|
+
function ae(t) {
|
|
1200
1201
|
return t ? t.toISOString().slice(0, 10) : null;
|
|
1201
1202
|
}
|
|
1202
|
-
function
|
|
1203
|
+
function Q(t) {
|
|
1203
1204
|
if (!t) return;
|
|
1204
1205
|
const e = new Date(t);
|
|
1205
1206
|
return Number.isNaN(e.getTime()) ? void 0 : e;
|
|
1206
1207
|
}
|
|
1207
|
-
function
|
|
1208
|
-
const { model: e, onModelChange: a, getValue: n, doesRowPassOtherFilter:
|
|
1209
|
-
from:
|
|
1210
|
-
to:
|
|
1211
|
-
}, [
|
|
1208
|
+
function Ya(t) {
|
|
1209
|
+
const { model: e, onModelChange: a, getValue: n, doesRowPassOtherFilter: o } = t, i = {
|
|
1210
|
+
from: Q(e == null ? void 0 : e.dateFrom),
|
|
1211
|
+
to: Q(e == null ? void 0 : e.dateTo)
|
|
1212
|
+
}, [s, c] = D(i);
|
|
1212
1213
|
de({
|
|
1213
1214
|
doesFilterPass: (d) => {
|
|
1214
1215
|
const l = n(d.node);
|
|
1215
1216
|
if (!l) return !1;
|
|
1216
|
-
const m = l instanceof Date ? l :
|
|
1217
|
-
return !(!m ||
|
|
1217
|
+
const m = l instanceof Date ? l : Q(String(l));
|
|
1218
|
+
return !(!m || s.from && m < s.from || s.to && m > s.to);
|
|
1218
1219
|
}
|
|
1219
1220
|
});
|
|
1220
1221
|
function u(d) {
|
|
@@ -1224,88 +1225,84 @@ function Ja(t) {
|
|
|
1224
1225
|
}
|
|
1225
1226
|
a({
|
|
1226
1227
|
type: "inRange",
|
|
1227
|
-
dateFrom:
|
|
1228
|
-
dateTo:
|
|
1228
|
+
dateFrom: ae(d.from),
|
|
1229
|
+
dateTo: ae(d.to)
|
|
1229
1230
|
});
|
|
1230
1231
|
}
|
|
1231
|
-
return /* @__PURE__ */ r("div", { className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]", children: /* @__PURE__ */ r(
|
|
1232
|
+
return /* @__PURE__ */ r("div", { className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]", children: /* @__PURE__ */ r(we, { value: s, onChange: u, size: "sm" }) });
|
|
1232
1233
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const { model: e,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
}
|
|
1243
|
-
const o = (e == null ? void 0 : e.dateFrom) || (e == null ? void 0 : e.dateTo), c = o ? `${i(e.dateFrom)} – ${i(e.dateTo)}` : n("dataTable.selectFilter.all");
|
|
1244
|
-
return /* @__PURE__ */ r(
|
|
1245
|
-
"button",
|
|
1246
|
-
{
|
|
1247
|
-
type: "button",
|
|
1248
|
-
onClick: a,
|
|
1249
|
-
"data-component": "date-range-floating-filter",
|
|
1250
|
-
className: "ds:flex ds:w-full ds:items-center ds:justify-between ds:gap-[var(--spacing-xs)] ds:rounded-[var(--radius-sm)] ds:border ds:border-[var(--border)] ds:bg-[var(--background)] ds:px-[var(--spacing-sm)] ds:text-[length:var(--font-size-sm)] ds:text-[var(--foreground)] ds:[block-size:calc(var(--min-target-size)_-_var(--spacing-sm))] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-[color:var(--ring)]",
|
|
1251
|
-
children: /* @__PURE__ */ r("span", { className: o ? "" : "ds:text-[var(--muted-foreground)]", children: c })
|
|
1234
|
+
function en(t) {
|
|
1235
|
+
const { model: e, onModelChange: a } = t, [n, o] = D({
|
|
1236
|
+
from: Q(e == null ? void 0 : e.dateFrom),
|
|
1237
|
+
to: Q(e == null ? void 0 : e.dateTo)
|
|
1238
|
+
});
|
|
1239
|
+
function i(s) {
|
|
1240
|
+
if (o(s), !s.from && !s.to) {
|
|
1241
|
+
a(null);
|
|
1242
|
+
return;
|
|
1252
1243
|
}
|
|
1253
|
-
|
|
1244
|
+
a({
|
|
1245
|
+
type: "inRange",
|
|
1246
|
+
dateFrom: ae(s.from),
|
|
1247
|
+
dateTo: ae(s.to)
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
return /* @__PURE__ */ r("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ r(we, { value: n, onChange: i, size: "sm" }) });
|
|
1254
1251
|
}
|
|
1255
1252
|
function q(t) {
|
|
1256
1253
|
return typeof t == "number" ? `n:${t}` : `s:${t}`;
|
|
1257
1254
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const { model: e, onModelChange: a, getValue: n, api:
|
|
1260
|
-
if (
|
|
1261
|
-
if (!
|
|
1262
|
-
const
|
|
1263
|
-
return
|
|
1264
|
-
const
|
|
1265
|
-
if (
|
|
1266
|
-
const T = typeof
|
|
1267
|
-
|
|
1268
|
-
}), Array.from(
|
|
1269
|
-
(
|
|
1255
|
+
function tn(t) {
|
|
1256
|
+
const { model: e, onModelChange: a, getValue: n, api: o, column: i, options: s, placeholder: c } = t, { t: u } = R("ui"), d = k(() => {
|
|
1257
|
+
if (s && s.length > 0) return s;
|
|
1258
|
+
if (!o || !i) return [];
|
|
1259
|
+
const p = /* @__PURE__ */ new Map();
|
|
1260
|
+
return o.forEachNode((f) => {
|
|
1261
|
+
const h = n(f);
|
|
1262
|
+
if (h == null) return;
|
|
1263
|
+
const T = typeof h == "string" || typeof h == "number" ? h : String(h), w = q(T);
|
|
1264
|
+
p.has(w) || p.set(w, { value: T, label: String(T) });
|
|
1265
|
+
}), Array.from(p.values()).sort(
|
|
1266
|
+
(f, h) => String(f.label).localeCompare(String(h.label))
|
|
1270
1267
|
);
|
|
1271
|
-
}, [
|
|
1272
|
-
const
|
|
1273
|
-
for (const
|
|
1274
|
-
return
|
|
1275
|
-
}, [e]), [m,
|
|
1276
|
-
|
|
1277
|
-
|
|
1268
|
+
}, [s, o, i, n]), l = k(() => {
|
|
1269
|
+
const p = /* @__PURE__ */ new Set(), f = (e == null ? void 0 : e.values) ?? [];
|
|
1270
|
+
for (const h of f) p.add(q(h));
|
|
1271
|
+
return p;
|
|
1272
|
+
}, [e]), [m, x] = D(l);
|
|
1273
|
+
j(() => {
|
|
1274
|
+
x(l);
|
|
1278
1275
|
}, [l]), de({
|
|
1279
|
-
doesFilterPass: (
|
|
1280
|
-
const
|
|
1281
|
-
if (!
|
|
1282
|
-
const
|
|
1283
|
-
if (
|
|
1284
|
-
const T = typeof
|
|
1285
|
-
return
|
|
1276
|
+
doesFilterPass: (p) => {
|
|
1277
|
+
const f = e == null ? void 0 : e.values;
|
|
1278
|
+
if (!f || f.length === 0) return !0;
|
|
1279
|
+
const h = n(p.node);
|
|
1280
|
+
if (h == null) return !1;
|
|
1281
|
+
const T = typeof h == "string" || typeof h == "number" ? h : String(h), w = q(T);
|
|
1282
|
+
return f.some((P) => q(P) === w);
|
|
1286
1283
|
}
|
|
1287
1284
|
});
|
|
1288
|
-
function
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1291
|
-
return
|
|
1285
|
+
function y(p) {
|
|
1286
|
+
x((f) => {
|
|
1287
|
+
const h = new Set(f);
|
|
1288
|
+
return h.has(p) ? h.delete(p) : h.add(p), h;
|
|
1292
1289
|
});
|
|
1293
1290
|
}
|
|
1294
|
-
function
|
|
1291
|
+
function g() {
|
|
1295
1292
|
if (m.size === 0) {
|
|
1296
1293
|
a(null);
|
|
1297
1294
|
return;
|
|
1298
1295
|
}
|
|
1299
|
-
const
|
|
1300
|
-
for (const
|
|
1301
|
-
m.has(q(
|
|
1302
|
-
a({ type: "set", values:
|
|
1296
|
+
const p = [];
|
|
1297
|
+
for (const f of d)
|
|
1298
|
+
m.has(q(f.value)) && p.push(f.value);
|
|
1299
|
+
a({ type: "set", values: p });
|
|
1303
1300
|
}
|
|
1304
|
-
function
|
|
1305
|
-
|
|
1301
|
+
function b() {
|
|
1302
|
+
x(/* @__PURE__ */ new Set()), a(null);
|
|
1306
1303
|
}
|
|
1307
|
-
const
|
|
1308
|
-
return /* @__PURE__ */
|
|
1304
|
+
const S = c ?? u("dataTable.selectFilter.all");
|
|
1305
|
+
return /* @__PURE__ */ I(
|
|
1309
1306
|
"div",
|
|
1310
1307
|
{
|
|
1311
1308
|
"data-component": "select-filter",
|
|
@@ -1315,177 +1312,220 @@ function Ya(t) {
|
|
|
1315
1312
|
"div",
|
|
1316
1313
|
{
|
|
1317
1314
|
role: "group",
|
|
1318
|
-
"aria-label":
|
|
1315
|
+
"aria-label": S,
|
|
1319
1316
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:max-h-[240px] ds:overflow-y-auto",
|
|
1320
|
-
children: d.length === 0 ? /* @__PURE__ */ r("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: u("dataTable.agGrid.noRowsToShow") }) : d.map((
|
|
1321
|
-
const
|
|
1317
|
+
children: d.length === 0 ? /* @__PURE__ */ r("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: u("dataTable.agGrid.noRowsToShow") }) : d.map((p) => {
|
|
1318
|
+
const f = q(p.value);
|
|
1322
1319
|
return /* @__PURE__ */ r(
|
|
1323
|
-
|
|
1320
|
+
xe,
|
|
1324
1321
|
{
|
|
1325
1322
|
size: "sm",
|
|
1326
|
-
label:
|
|
1327
|
-
checked: m.has(
|
|
1328
|
-
onCheckedChange: () =>
|
|
1323
|
+
label: p.label,
|
|
1324
|
+
checked: m.has(f),
|
|
1325
|
+
onCheckedChange: () => y(f)
|
|
1329
1326
|
},
|
|
1330
|
-
|
|
1327
|
+
f
|
|
1331
1328
|
);
|
|
1332
1329
|
})
|
|
1333
1330
|
}
|
|
1334
1331
|
),
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */ r(
|
|
1337
|
-
/* @__PURE__ */ r(
|
|
1332
|
+
/* @__PURE__ */ I("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: [
|
|
1333
|
+
/* @__PURE__ */ r(K, { intent: "ghost", size: "sm", onClick: b, type: "button", children: u("dataTable.selectFilter.clear") }),
|
|
1334
|
+
/* @__PURE__ */ r(K, { intent: "primary", size: "sm", onClick: g, type: "button", children: u("dataTable.selectFilter.apply") })
|
|
1338
1335
|
] })
|
|
1339
1336
|
]
|
|
1340
1337
|
}
|
|
1341
1338
|
);
|
|
1342
1339
|
}
|
|
1343
|
-
function
|
|
1344
|
-
var
|
|
1345
|
-
const { model: e,
|
|
1346
|
-
|
|
1347
|
-
|
|
1340
|
+
function an(t) {
|
|
1341
|
+
var l, m;
|
|
1342
|
+
const { model: e, onModelChange: a, column: n } = t, o = ((m = (l = n == null ? void 0 : n.getColDef) == null ? void 0 : l.call(n)) == null ? void 0 : m.filterParams) ?? {}, i = o.options ?? [], s = k(() => {
|
|
1343
|
+
const x = /* @__PURE__ */ new Map();
|
|
1344
|
+
for (const y of i) x.set(String(y.value), y.value);
|
|
1345
|
+
return x;
|
|
1346
|
+
}, [i]), c = k(
|
|
1347
|
+
() => i.map((x) => ({
|
|
1348
|
+
value: String(x.value),
|
|
1349
|
+
label: x.label
|
|
1350
|
+
})),
|
|
1351
|
+
[i]
|
|
1352
|
+
), u = k(
|
|
1353
|
+
() => ((e == null ? void 0 : e.values) ?? []).map((x) => String(x)),
|
|
1354
|
+
[e]
|
|
1355
|
+
);
|
|
1356
|
+
function d(x) {
|
|
1357
|
+
if (x.length === 0) {
|
|
1358
|
+
a(null);
|
|
1359
|
+
return;
|
|
1360
|
+
}
|
|
1361
|
+
const y = [];
|
|
1362
|
+
for (const g of x) {
|
|
1363
|
+
const b = s.get(g);
|
|
1364
|
+
b !== void 0 && y.push(b);
|
|
1365
|
+
}
|
|
1366
|
+
a({ type: "set", values: y });
|
|
1367
|
+
}
|
|
1368
|
+
return /* @__PURE__ */ r("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ r(
|
|
1369
|
+
Rt,
|
|
1348
1370
|
{
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1371
|
+
size: "sm",
|
|
1372
|
+
options: c,
|
|
1373
|
+
value: u,
|
|
1374
|
+
onChange: d,
|
|
1375
|
+
placeholder: o.placeholder,
|
|
1376
|
+
allowClear: !0
|
|
1354
1377
|
}
|
|
1355
|
-
);
|
|
1378
|
+
) });
|
|
1356
1379
|
}
|
|
1357
|
-
function
|
|
1380
|
+
function H(t) {
|
|
1358
1381
|
return t.trim().toLocaleLowerCase();
|
|
1359
1382
|
}
|
|
1360
|
-
function
|
|
1383
|
+
function nn(t) {
|
|
1361
1384
|
const {
|
|
1362
1385
|
model: e,
|
|
1363
1386
|
onModelChange: a,
|
|
1364
1387
|
getValue: n,
|
|
1365
|
-
api:
|
|
1388
|
+
api: o,
|
|
1366
1389
|
column: i,
|
|
1367
|
-
options:
|
|
1390
|
+
options: s,
|
|
1368
1391
|
loadOptions: c,
|
|
1369
1392
|
placeholder: u
|
|
1370
|
-
} = t, { t: d } =
|
|
1371
|
-
if (
|
|
1372
|
-
if (!
|
|
1373
|
-
const
|
|
1374
|
-
return
|
|
1375
|
-
const T = n(
|
|
1393
|
+
} = t, { t: d } = R("ui"), l = k(() => {
|
|
1394
|
+
if (s && s.length > 0) return s;
|
|
1395
|
+
if (!o || !i) return [];
|
|
1396
|
+
const f = /* @__PURE__ */ new Map();
|
|
1397
|
+
return o.forEachNode((h) => {
|
|
1398
|
+
const T = n(h);
|
|
1376
1399
|
if (T == null) return;
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
}), Array.from(
|
|
1380
|
-
(
|
|
1400
|
+
const w = typeof T == "string" ? T : String(T);
|
|
1401
|
+
f.has(w) || f.set(w, { value: w, label: w });
|
|
1402
|
+
}), Array.from(f.values()).sort(
|
|
1403
|
+
(h, T) => h.label.localeCompare(T.label)
|
|
1381
1404
|
);
|
|
1382
|
-
}, [
|
|
1405
|
+
}, [s, o, i, n]), m = k(() => async (f, h) => {
|
|
1383
1406
|
if (c)
|
|
1384
|
-
return (await c(
|
|
1385
|
-
const T =
|
|
1386
|
-
return (T ? l.filter((
|
|
1387
|
-
}, [c, l]), [
|
|
1388
|
-
|
|
1389
|
-
|
|
1407
|
+
return (await c(f, h)).map((A) => ({ value: A.value, label: A.label }));
|
|
1408
|
+
const T = H(f);
|
|
1409
|
+
return (T ? l.filter((P) => H(P.label).includes(T)) : l).slice(0, 50).map((P) => ({ value: P.value, label: P.label }));
|
|
1410
|
+
}, [c, l]), [x, y] = D((e == null ? void 0 : e.value) ?? "");
|
|
1411
|
+
j(() => {
|
|
1412
|
+
y((e == null ? void 0 : e.value) ?? "");
|
|
1390
1413
|
}, [e == null ? void 0 : e.value]), de({
|
|
1391
|
-
doesFilterPass: (
|
|
1392
|
-
const
|
|
1393
|
-
if (!
|
|
1394
|
-
const T = n(
|
|
1414
|
+
doesFilterPass: (f) => {
|
|
1415
|
+
const h = e == null ? void 0 : e.value;
|
|
1416
|
+
if (!h) return !0;
|
|
1417
|
+
const T = n(f.node);
|
|
1395
1418
|
if (T == null) return !1;
|
|
1396
|
-
const
|
|
1397
|
-
return
|
|
1419
|
+
const w = typeof T == "string" ? T : String(T);
|
|
1420
|
+
return H(w) === H(h);
|
|
1398
1421
|
}
|
|
1399
1422
|
});
|
|
1400
|
-
function
|
|
1401
|
-
|
|
1423
|
+
function g(f) {
|
|
1424
|
+
y(f.label), a({ type: "equals", value: f.value });
|
|
1402
1425
|
}
|
|
1403
|
-
function
|
|
1404
|
-
|
|
1426
|
+
function b(f) {
|
|
1427
|
+
y(f), f === "" && e && a(null);
|
|
1405
1428
|
}
|
|
1406
|
-
function
|
|
1407
|
-
|
|
1429
|
+
function S() {
|
|
1430
|
+
y(""), a(null);
|
|
1408
1431
|
}
|
|
1409
|
-
const
|
|
1410
|
-
return /* @__PURE__ */
|
|
1432
|
+
const p = u ?? d("dataTable.typeaheadFilter.placeholder");
|
|
1433
|
+
return /* @__PURE__ */ I(
|
|
1411
1434
|
"div",
|
|
1412
1435
|
{
|
|
1413
1436
|
"data-component": "typeahead-filter",
|
|
1414
1437
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
|
|
1415
1438
|
children: [
|
|
1416
1439
|
/* @__PURE__ */ r(
|
|
1417
|
-
|
|
1440
|
+
Ne,
|
|
1418
1441
|
{
|
|
1419
1442
|
size: "sm",
|
|
1420
|
-
value:
|
|
1421
|
-
onChange:
|
|
1422
|
-
onSelect:
|
|
1443
|
+
value: x,
|
|
1444
|
+
onChange: b,
|
|
1445
|
+
onSelect: g,
|
|
1423
1446
|
loadOptions: m,
|
|
1424
|
-
placeholder:
|
|
1425
|
-
"aria-label":
|
|
1447
|
+
placeholder: p,
|
|
1448
|
+
"aria-label": p
|
|
1426
1449
|
}
|
|
1427
1450
|
),
|
|
1428
|
-
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ r(
|
|
1451
|
+
/* @__PURE__ */ r("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ r(K, { intent: "ghost", size: "sm", onClick: S, type: "button", children: d("dataTable.typeaheadFilter.clear") }) })
|
|
1429
1452
|
]
|
|
1430
1453
|
}
|
|
1431
1454
|
);
|
|
1432
1455
|
}
|
|
1433
|
-
function
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1456
|
+
function rn(t) {
|
|
1457
|
+
var g, b;
|
|
1458
|
+
const { model: e, onModelChange: a, column: n } = t, { t: o } = R("ui"), i = ((b = (g = n == null ? void 0 : n.getColDef) == null ? void 0 : g.call(n)) == null ? void 0 : b.filterParams) ?? {}, s = i.options ?? [], c = i.loadOptions, u = i.placeholder ?? o("dataTable.typeaheadFilter.placeholder"), d = k(() => async (S, p) => {
|
|
1459
|
+
if (c)
|
|
1460
|
+
return (await c(S, p)).map((w) => ({ value: w.value, label: w.label }));
|
|
1461
|
+
const f = H(S);
|
|
1462
|
+
return (f ? s.filter((T) => H(T.label).includes(f)) : s).slice(0, 50).map((T) => ({ value: T.value, label: T.label }));
|
|
1463
|
+
}, [c, s]), [l, m] = D((e == null ? void 0 : e.value) ?? "");
|
|
1464
|
+
j(() => {
|
|
1465
|
+
m((e == null ? void 0 : e.value) ?? "");
|
|
1466
|
+
}, [e == null ? void 0 : e.value]);
|
|
1467
|
+
function x(S) {
|
|
1468
|
+
m(S.label), a({ type: "equals", value: S.value });
|
|
1469
|
+
}
|
|
1470
|
+
function y(S) {
|
|
1471
|
+
m(S), S === "" && e && a(null);
|
|
1472
|
+
}
|
|
1473
|
+
return /* @__PURE__ */ r("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ r(
|
|
1474
|
+
Ne,
|
|
1437
1475
|
{
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1476
|
+
size: "sm",
|
|
1477
|
+
value: l,
|
|
1478
|
+
onChange: y,
|
|
1479
|
+
onSelect: x,
|
|
1480
|
+
loadOptions: d,
|
|
1481
|
+
placeholder: u,
|
|
1482
|
+
"aria-label": u
|
|
1443
1483
|
}
|
|
1444
|
-
);
|
|
1484
|
+
) });
|
|
1445
1485
|
}
|
|
1446
|
-
function
|
|
1486
|
+
function on(t) {
|
|
1447
1487
|
const { value: e, variantMap: a } = t, n = (a == null ? void 0 : a[e]) ?? "neutral";
|
|
1448
|
-
return /* @__PURE__ */ r(
|
|
1488
|
+
return /* @__PURE__ */ r(Dt, { variant: n, withDot: !0, size: "sm", children: String(e ?? "") });
|
|
1449
1489
|
}
|
|
1450
|
-
function
|
|
1490
|
+
function sn(t) {
|
|
1451
1491
|
const { value: e } = t;
|
|
1452
|
-
return e ? /* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */ r(
|
|
1492
|
+
return e ? /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
1493
|
+
/* @__PURE__ */ r(Fe, { name: e.name, src: e.src, size: "sm" }),
|
|
1454
1494
|
/* @__PURE__ */ r("span", { children: e.name })
|
|
1455
1495
|
] }) : null;
|
|
1456
1496
|
}
|
|
1457
|
-
const
|
|
1497
|
+
const aa = {
|
|
1458
1498
|
sm: "ds:size-8",
|
|
1459
1499
|
md: "ds:size-10",
|
|
1460
1500
|
lg: "ds:size-12"
|
|
1461
|
-
},
|
|
1501
|
+
}, na = {
|
|
1462
1502
|
square: "ds:rounded-none",
|
|
1463
1503
|
rounded: "ds:rounded-[var(--radius-md)]",
|
|
1464
1504
|
circle: "ds:rounded-[var(--radius-full)]"
|
|
1465
1505
|
};
|
|
1466
|
-
function
|
|
1506
|
+
function ce(t, e) {
|
|
1467
1507
|
if (!t || typeof t != "object") return;
|
|
1468
1508
|
const a = t[e];
|
|
1469
1509
|
return typeof a == "string" ? a : void 0;
|
|
1470
1510
|
}
|
|
1471
|
-
const
|
|
1472
|
-
function
|
|
1511
|
+
const ra = /^(?:https?:|data:image\/)/i;
|
|
1512
|
+
function oa(t) {
|
|
1473
1513
|
if (!t) return;
|
|
1474
1514
|
const e = t.trim();
|
|
1475
1515
|
if (e.length !== 0)
|
|
1476
|
-
return
|
|
1516
|
+
return ra.test(e) ? e : void 0;
|
|
1477
1517
|
}
|
|
1478
|
-
function
|
|
1518
|
+
function ln(t) {
|
|
1479
1519
|
const {
|
|
1480
1520
|
data: e,
|
|
1481
1521
|
srcField: a,
|
|
1482
1522
|
altField: n,
|
|
1483
|
-
fallbackField:
|
|
1523
|
+
fallbackField: o,
|
|
1484
1524
|
size: i = "md",
|
|
1485
|
-
shape:
|
|
1525
|
+
shape: s = "rounded"
|
|
1486
1526
|
} = t;
|
|
1487
1527
|
if (!e) return null;
|
|
1488
|
-
const c =
|
|
1528
|
+
const c = ce(e, a), u = oa(c), d = n ? ce(e, n) ?? "" : "", l = o ? ce(e, o) : void 0;
|
|
1489
1529
|
return u ? /* @__PURE__ */ r(
|
|
1490
1530
|
"img",
|
|
1491
1531
|
{
|
|
@@ -1493,20 +1533,20 @@ function sn(t) {
|
|
|
1493
1533
|
alt: d,
|
|
1494
1534
|
loading: "lazy",
|
|
1495
1535
|
decoding: "async",
|
|
1496
|
-
className: ["ds:object-cover",
|
|
1536
|
+
className: ["ds:object-cover", aa[i], na[s]].join(
|
|
1497
1537
|
" "
|
|
1498
1538
|
)
|
|
1499
1539
|
}
|
|
1500
|
-
) : l ? /* @__PURE__ */ r(
|
|
1540
|
+
) : l ? /* @__PURE__ */ r(Fe, { name: l, size: i }) : null;
|
|
1501
1541
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const { value: e, maxVisible: a = 3 } = t, { t: n } =
|
|
1542
|
+
function cn(t) {
|
|
1543
|
+
const { value: e, maxVisible: a = 3 } = t, { t: n } = R();
|
|
1504
1544
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
1505
|
-
const
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
|
|
1545
|
+
const o = e.slice(0, a), i = e.length - a;
|
|
1546
|
+
return /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
1547
|
+
o.map((s) => /* @__PURE__ */ r(ee, { label: s, size: "sm" }, s)),
|
|
1508
1548
|
i > 0 && /* @__PURE__ */ r(kt, { label: e.slice(a).join(", "), children: /* @__PURE__ */ r(
|
|
1509
|
-
|
|
1549
|
+
ee,
|
|
1510
1550
|
{
|
|
1511
1551
|
label: n("inputs.multiSelect.overflow", { count: i }),
|
|
1512
1552
|
size: "sm",
|
|
@@ -1527,10 +1567,10 @@ const sa = {
|
|
|
1527
1567
|
minute: "2-digit"
|
|
1528
1568
|
}
|
|
1529
1569
|
};
|
|
1530
|
-
function
|
|
1570
|
+
function dn(t) {
|
|
1531
1571
|
const { value: e, format: a = "date", options: n } = t;
|
|
1532
|
-
return e == null || e === "" ? null : a === "relative" && !n ? /* @__PURE__ */ r(
|
|
1533
|
-
|
|
1572
|
+
return e == null || e === "" ? null : a === "relative" && !n ? /* @__PURE__ */ r(me, { value: e, shape: "bare" }) : /* @__PURE__ */ r(
|
|
1573
|
+
me,
|
|
1534
1574
|
{
|
|
1535
1575
|
value: e,
|
|
1536
1576
|
format: "absolute",
|
|
@@ -1539,47 +1579,47 @@ function ln(t) {
|
|
|
1539
1579
|
}
|
|
1540
1580
|
);
|
|
1541
1581
|
}
|
|
1542
|
-
function
|
|
1582
|
+
function la(t) {
|
|
1543
1583
|
if (t == null || t === "") return null;
|
|
1544
1584
|
const e = typeof t == "number" ? t : Number(t);
|
|
1545
1585
|
return Number.isFinite(e) ? e : null;
|
|
1546
1586
|
}
|
|
1547
|
-
function
|
|
1587
|
+
function un(t) {
|
|
1548
1588
|
const {
|
|
1549
1589
|
value: e,
|
|
1550
1590
|
currency: a = "EUR",
|
|
1551
1591
|
colorNegative: n,
|
|
1552
|
-
strikethrough:
|
|
1592
|
+
strikethrough: o,
|
|
1553
1593
|
options: i
|
|
1554
|
-
} = t, { i18n:
|
|
1594
|
+
} = t, { i18n: s } = R(), c = la(e);
|
|
1555
1595
|
if (c === null) return null;
|
|
1556
|
-
const u =
|
|
1596
|
+
const u = s.language || "en", d = new Intl.NumberFormat(u, {
|
|
1557
1597
|
style: "currency",
|
|
1558
1598
|
currency: a,
|
|
1559
1599
|
...i
|
|
1560
1600
|
}).format(c), l = ["ds:tabular-nums"];
|
|
1561
|
-
return n && c < 0 && l.push("ds:text-[color:var(--destructive)]"),
|
|
1601
|
+
return n && c < 0 && l.push("ds:text-[color:var(--destructive)]"), o && l.push("line-through"), /* @__PURE__ */ r("span", { className: l.join(" "), children: d });
|
|
1562
1602
|
}
|
|
1563
|
-
function
|
|
1603
|
+
function ia(t) {
|
|
1564
1604
|
if (!Te(t)) return t;
|
|
1565
1605
|
const e = t, a = e.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} size-4`.trim();
|
|
1566
|
-
return
|
|
1606
|
+
return Ce(e, { className: n, size: e.props.size ?? 16 });
|
|
1567
1607
|
}
|
|
1568
1608
|
function ge(t, e) {
|
|
1569
1609
|
return typeof t == "function" ? t(e) : !!t;
|
|
1570
1610
|
}
|
|
1571
|
-
function
|
|
1611
|
+
function pn(t) {
|
|
1572
1612
|
const { data: e, actions: a } = t;
|
|
1573
|
-
return e ? /* @__PURE__ */ r("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: a.map((n,
|
|
1613
|
+
return e ? /* @__PURE__ */ r("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: a.map((n, o) => {
|
|
1574
1614
|
if (ge(n.hidden, e)) return null;
|
|
1575
|
-
const i = ge(n.disabled, e),
|
|
1615
|
+
const i = ge(n.disabled, e), s = i && n.disabledReason ? n.disabledReason : n.label, c = n.variant === "destructive";
|
|
1576
1616
|
return /* @__PURE__ */ r(
|
|
1577
1617
|
B,
|
|
1578
1618
|
{
|
|
1579
1619
|
size: "sm",
|
|
1580
1620
|
intent: "ghost",
|
|
1581
|
-
icon:
|
|
1582
|
-
tooltip:
|
|
1621
|
+
icon: ia(n.icon),
|
|
1622
|
+
tooltip: s,
|
|
1583
1623
|
"aria-label": n.label,
|
|
1584
1624
|
disabled: i,
|
|
1585
1625
|
onClick: (u) => {
|
|
@@ -1587,20 +1627,20 @@ function cn(t) {
|
|
|
1587
1627
|
},
|
|
1588
1628
|
className: c ? "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]" : void 0
|
|
1589
1629
|
},
|
|
1590
|
-
|
|
1630
|
+
o
|
|
1591
1631
|
);
|
|
1592
1632
|
}) }) : null;
|
|
1593
1633
|
}
|
|
1594
1634
|
function be(t, e) {
|
|
1595
1635
|
return typeof t == "function" ? t(e) : t;
|
|
1596
1636
|
}
|
|
1597
|
-
function
|
|
1637
|
+
function ca(t) {
|
|
1598
1638
|
return /^(https?:\/\/|\/|#|mailto:|tel:)/i.test(t) ? t : "#";
|
|
1599
1639
|
}
|
|
1600
|
-
function
|
|
1601
|
-
const { value: e, data: a, href: n, onClick:
|
|
1640
|
+
function fn(t) {
|
|
1641
|
+
const { value: e, data: a, href: n, onClick: o, secondary: i } = t;
|
|
1602
1642
|
if (!a) return null;
|
|
1603
|
-
const
|
|
1643
|
+
const s = be(n, a), c = be(i, a), u = e == null || e === "" ? "" : String(e), d = [
|
|
1604
1644
|
"ds:text-[color:var(--primary)]",
|
|
1605
1645
|
"ds:hover:underline",
|
|
1606
1646
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
@@ -1609,13 +1649,13 @@ function un(t) {
|
|
|
1609
1649
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1610
1650
|
"ds:rounded-[var(--radius-sm)]"
|
|
1611
1651
|
].join(" "), l = (m) => {
|
|
1612
|
-
|
|
1652
|
+
o && (s || m.preventDefault(), m.stopPropagation(), o(a));
|
|
1613
1653
|
};
|
|
1614
|
-
return /* @__PURE__ */
|
|
1615
|
-
|
|
1654
|
+
return /* @__PURE__ */ I("span", { className: "ds:flex ds:flex-col ds:leading-tight", children: [
|
|
1655
|
+
s ? /* @__PURE__ */ r(
|
|
1616
1656
|
"a",
|
|
1617
1657
|
{
|
|
1618
|
-
href:
|
|
1658
|
+
href: ca(s),
|
|
1619
1659
|
onClick: l,
|
|
1620
1660
|
className: d,
|
|
1621
1661
|
children: u
|
|
@@ -1635,31 +1675,31 @@ function un(t) {
|
|
|
1635
1675
|
c ? /* @__PURE__ */ r("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: c }) : null
|
|
1636
1676
|
] });
|
|
1637
1677
|
}
|
|
1638
|
-
function
|
|
1678
|
+
function mn(t) {
|
|
1639
1679
|
const {
|
|
1640
1680
|
value: e,
|
|
1641
1681
|
data: a,
|
|
1642
1682
|
onToggle: n,
|
|
1643
|
-
onError:
|
|
1683
|
+
onError: o,
|
|
1644
1684
|
trueIcon: i,
|
|
1645
|
-
falseIcon:
|
|
1685
|
+
falseIcon: s,
|
|
1646
1686
|
trueClass: c = "ds:text-[color:var(--success)]",
|
|
1647
1687
|
falseClass: u = "ds:text-[color:var(--muted-foreground)]",
|
|
1648
1688
|
label: d
|
|
1649
|
-
} = t, { t: l } =
|
|
1689
|
+
} = t, { t: l } = R(), [m, x] = D(!1);
|
|
1650
1690
|
if (!a) return null;
|
|
1651
|
-
const
|
|
1652
|
-
async function f
|
|
1653
|
-
if (
|
|
1654
|
-
const T = n(a, !
|
|
1691
|
+
const y = !!e, g = y ? i ?? /* @__PURE__ */ r(It, { "aria-hidden": !0, className: "ds:size-4" }) : s ?? /* @__PURE__ */ r(Et, { "aria-hidden": !0, className: "ds:size-4" }), b = y ? c : u, S = d ?? l(y ? "inputs.switch.on" : "inputs.switch.off");
|
|
1692
|
+
async function p(f) {
|
|
1693
|
+
if (f.stopPropagation(), m || !a) return;
|
|
1694
|
+
const T = n(a, !y);
|
|
1655
1695
|
if (T && typeof T.then == "function") {
|
|
1656
|
-
|
|
1696
|
+
x(!0);
|
|
1657
1697
|
try {
|
|
1658
1698
|
await T;
|
|
1659
|
-
} catch (
|
|
1660
|
-
|
|
1699
|
+
} catch (w) {
|
|
1700
|
+
o == null || o(a, w);
|
|
1661
1701
|
} finally {
|
|
1662
|
-
|
|
1702
|
+
x(!1);
|
|
1663
1703
|
}
|
|
1664
1704
|
}
|
|
1665
1705
|
}
|
|
@@ -1668,11 +1708,11 @@ function fn(t) {
|
|
|
1668
1708
|
{
|
|
1669
1709
|
type: "button",
|
|
1670
1710
|
role: "switch",
|
|
1671
|
-
"aria-checked":
|
|
1711
|
+
"aria-checked": y,
|
|
1672
1712
|
"aria-busy": m,
|
|
1673
|
-
"aria-label":
|
|
1713
|
+
"aria-label": S,
|
|
1674
1714
|
disabled: m,
|
|
1675
|
-
onClick:
|
|
1715
|
+
onClick: p,
|
|
1676
1716
|
className: [
|
|
1677
1717
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
1678
1718
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
@@ -1683,9 +1723,9 @@ function fn(t) {
|
|
|
1683
1723
|
"ds:focus-visible:outline-[color:var(--ring)]",
|
|
1684
1724
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
1685
1725
|
"ds:disabled:opacity-50",
|
|
1686
|
-
|
|
1726
|
+
b
|
|
1687
1727
|
].join(" "),
|
|
1688
|
-
children:
|
|
1728
|
+
children: g
|
|
1689
1729
|
}
|
|
1690
1730
|
);
|
|
1691
1731
|
}
|
|
@@ -1699,19 +1739,19 @@ function he(t, e) {
|
|
|
1699
1739
|
const a = t[e];
|
|
1700
1740
|
return typeof a == "string" ? a : void 0;
|
|
1701
1741
|
}
|
|
1702
|
-
const
|
|
1703
|
-
function
|
|
1742
|
+
const ua = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, pa = /^rgba?\(\s*[\d.\s,%/]+\)$/i, fa = /^hsla?\(\s*[\d.\s,%/]+\)$/i, ma = /^var\(--[a-z0-9-]+(?:,\s*[^)]+)?\)$/i;
|
|
1743
|
+
function ga(t) {
|
|
1704
1744
|
if (!t) return;
|
|
1705
1745
|
const e = t.trim();
|
|
1706
|
-
if (
|
|
1746
|
+
if (ua.test(e) || pa.test(e) || fa.test(e) || ma.test(e))
|
|
1707
1747
|
return e;
|
|
1708
1748
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const { data: e, colorField: a, size: n = "md", labelField:
|
|
1711
|
-
return
|
|
1749
|
+
function gn(t) {
|
|
1750
|
+
const { data: e, colorField: a, size: n = "md", labelField: o } = t, i = X(null), s = e ? he(e, a) : void 0, c = ga(s), u = e && o ? he(e, o) : void 0;
|
|
1751
|
+
return ft(() => {
|
|
1712
1752
|
const d = i.current;
|
|
1713
1753
|
d && (c ? d.style.setProperty("--data-table-dot-color", c) : d.style.removeProperty("--data-table-dot-color"));
|
|
1714
|
-
}, [c]), c ? /* @__PURE__ */
|
|
1754
|
+
}, [c]), c ? /* @__PURE__ */ I("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
1715
1755
|
/* @__PURE__ */ r(
|
|
1716
1756
|
"span",
|
|
1717
1757
|
{
|
|
@@ -1728,38 +1768,38 @@ function pn(t) {
|
|
|
1728
1768
|
u ? /* @__PURE__ */ r("span", { children: u }) : null
|
|
1729
1769
|
] }) : null;
|
|
1730
1770
|
}
|
|
1731
|
-
function
|
|
1771
|
+
function ba(t, e) {
|
|
1732
1772
|
if (!t || typeof t != "object") return null;
|
|
1733
1773
|
const a = t[e], n = typeof a == "number" ? a : Number(a);
|
|
1734
1774
|
return Number.isFinite(n) ? n : null;
|
|
1735
1775
|
}
|
|
1736
|
-
function
|
|
1737
|
-
const { data: e, lines: a, currency: n = "EUR", highlightNegative:
|
|
1776
|
+
function bn(t) {
|
|
1777
|
+
const { data: e, lines: a, currency: n = "EUR", highlightNegative: o } = t, { i18n: i } = R();
|
|
1738
1778
|
if (!e) return null;
|
|
1739
|
-
const
|
|
1740
|
-
const l =
|
|
1779
|
+
const s = i.language || "en", c = (d) => {
|
|
1780
|
+
const l = ba(e, d.valueField);
|
|
1741
1781
|
if (l === null) return null;
|
|
1742
1782
|
let m;
|
|
1743
1783
|
switch (d.format ?? "number") {
|
|
1744
1784
|
case "currency":
|
|
1745
|
-
m = new Intl.NumberFormat(
|
|
1785
|
+
m = new Intl.NumberFormat(s, {
|
|
1746
1786
|
style: "currency",
|
|
1747
1787
|
currency: n
|
|
1748
1788
|
}).format(l);
|
|
1749
1789
|
break;
|
|
1750
1790
|
case "percent":
|
|
1751
|
-
m = new Intl.NumberFormat(
|
|
1791
|
+
m = new Intl.NumberFormat(s, {
|
|
1752
1792
|
style: "percent",
|
|
1753
1793
|
maximumFractionDigits: 1
|
|
1754
1794
|
}).format(l / 100);
|
|
1755
1795
|
break;
|
|
1756
1796
|
default:
|
|
1757
|
-
m = new Intl.NumberFormat(
|
|
1797
|
+
m = new Intl.NumberFormat(s).format(l);
|
|
1758
1798
|
}
|
|
1759
1799
|
return {
|
|
1760
1800
|
label: d.label,
|
|
1761
1801
|
formatted: m,
|
|
1762
|
-
negative: !!
|
|
1802
|
+
negative: !!o && l < 0
|
|
1763
1803
|
};
|
|
1764
1804
|
}, u = a.map(c).filter(
|
|
1765
1805
|
(d) => d !== null
|
|
@@ -1776,7 +1816,7 @@ function mn(t) {
|
|
|
1776
1816
|
"type-meta",
|
|
1777
1817
|
"ds:leading-tight"
|
|
1778
1818
|
].join(" "),
|
|
1779
|
-
children: u.map((d, l) => /* @__PURE__ */
|
|
1819
|
+
children: u.map((d, l) => /* @__PURE__ */ I(
|
|
1780
1820
|
"span",
|
|
1781
1821
|
{
|
|
1782
1822
|
className: "ds:inline-flex ds:items-baseline ds:gap-x-[var(--spacing-xs)]",
|
|
@@ -1808,14 +1848,14 @@ function mn(t) {
|
|
|
1808
1848
|
}
|
|
1809
1849
|
);
|
|
1810
1850
|
}
|
|
1811
|
-
function
|
|
1851
|
+
function hn(t) {
|
|
1812
1852
|
var d, l;
|
|
1813
|
-
const { initialValue: e, onValueChange: a, stopEditing: n, column:
|
|
1814
|
-
|
|
1853
|
+
const { initialValue: e, onValueChange: a, stopEditing: n, column: o } = t, [i, s] = D(e ?? ""), c = X(null);
|
|
1854
|
+
j(() => {
|
|
1815
1855
|
const m = c.current;
|
|
1816
1856
|
m && (m.focus(), m.select());
|
|
1817
1857
|
}, []);
|
|
1818
|
-
const u = ((l = (d =
|
|
1858
|
+
const u = ((l = (d = o == null ? void 0 : o.getColDef) == null ? void 0 : d.call(o)) == null ? void 0 : l.headerName) ?? void 0;
|
|
1819
1859
|
return /* @__PURE__ */ r(
|
|
1820
1860
|
"input",
|
|
1821
1861
|
{
|
|
@@ -1824,8 +1864,8 @@ function gn(t) {
|
|
|
1824
1864
|
value: i,
|
|
1825
1865
|
"aria-label": u,
|
|
1826
1866
|
onChange: (m) => {
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1867
|
+
const x = m.target.value;
|
|
1868
|
+
s(x), a(x);
|
|
1829
1869
|
},
|
|
1830
1870
|
onKeyDown: (m) => {
|
|
1831
1871
|
m.key === "Enter" && (m.preventDefault(), n());
|
|
@@ -1833,48 +1873,48 @@ function gn(t) {
|
|
|
1833
1873
|
className: [
|
|
1834
1874
|
"ds:block ds:w-full ds:appearance-none",
|
|
1835
1875
|
// Input surface chrome: rounded border + bg + focus halo.
|
|
1836
|
-
|
|
1876
|
+
Re,
|
|
1837
1877
|
// Use the `md` height (`--min-target-size`) so the input
|
|
1838
1878
|
// auto-lifts to 48px under `.theme-accessible` to satisfy
|
|
1839
1879
|
// WCAG 2.5.5 target size.
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1880
|
+
De.md,
|
|
1881
|
+
ke.sm,
|
|
1882
|
+
Ie.sm
|
|
1843
1883
|
].join(" ")
|
|
1844
1884
|
}
|
|
1845
1885
|
);
|
|
1846
1886
|
}
|
|
1847
|
-
function
|
|
1848
|
-
var
|
|
1887
|
+
function vn(t) {
|
|
1888
|
+
var b, S;
|
|
1849
1889
|
const {
|
|
1850
1890
|
initialValue: e,
|
|
1851
1891
|
onValueChange: a,
|
|
1852
1892
|
stopEditing: n,
|
|
1853
|
-
column:
|
|
1893
|
+
column: o,
|
|
1854
1894
|
decimals: i = 2,
|
|
1855
|
-
min:
|
|
1895
|
+
min: s,
|
|
1856
1896
|
max: c
|
|
1857
|
-
} = t, { i18n: u } =
|
|
1858
|
-
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1897
|
+
} = t, { i18n: u } = R(), d = X(null), l = ((S = (b = o == null ? void 0 : o.getColDef) == null ? void 0 : b.call(o)) == null ? void 0 : S.headerName) ?? void 0, [m, x] = D(() => e == null || Number.isNaN(e) ? "" : String(e));
|
|
1898
|
+
j(() => {
|
|
1899
|
+
const p = d.current;
|
|
1900
|
+
p && (p.focus(), p.select());
|
|
1861
1901
|
}, []);
|
|
1862
|
-
function
|
|
1863
|
-
var
|
|
1864
|
-
if (
|
|
1865
|
-
const
|
|
1866
|
-
return Number.isFinite(
|
|
1902
|
+
function y(p) {
|
|
1903
|
+
var W, F;
|
|
1904
|
+
if (p.trim().length === 0) return null;
|
|
1905
|
+
const f = u.language || "en", h = new Intl.NumberFormat(f).formatToParts(12345.6), T = ((W = h.find(($) => $.type === "group")) == null ? void 0 : W.value) ?? "", w = ((F = h.find(($) => $.type === "decimal")) == null ? void 0 : F.value) ?? ".", P = p.replace(new RegExp(`\\${T}`, "g"), "").replace(w, ".").replace(/[^\d.-]/g, ""), A = Number(P);
|
|
1906
|
+
return Number.isFinite(A) ? A : null;
|
|
1867
1907
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const
|
|
1870
|
-
if (
|
|
1908
|
+
function g(p) {
|
|
1909
|
+
const f = y(p);
|
|
1910
|
+
if (f == null) {
|
|
1871
1911
|
a(null);
|
|
1872
1912
|
return;
|
|
1873
1913
|
}
|
|
1874
|
-
let
|
|
1875
|
-
typeof
|
|
1914
|
+
let h = f;
|
|
1915
|
+
typeof s == "number" && (h = Math.max(s, h)), typeof c == "number" && (h = Math.min(c, h));
|
|
1876
1916
|
const T = 10 ** i;
|
|
1877
|
-
a(Math.round(
|
|
1917
|
+
a(Math.round(h * T) / T);
|
|
1878
1918
|
}
|
|
1879
1919
|
return /* @__PURE__ */ r(
|
|
1880
1920
|
"input",
|
|
@@ -1884,49 +1924,49 @@ function bn(t) {
|
|
|
1884
1924
|
inputMode: "decimal",
|
|
1885
1925
|
value: m,
|
|
1886
1926
|
"aria-label": l,
|
|
1887
|
-
onChange: (
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1927
|
+
onChange: (p) => {
|
|
1928
|
+
const f = p.target.value;
|
|
1929
|
+
x(f), g(f);
|
|
1890
1930
|
},
|
|
1891
|
-
onKeyDown: (
|
|
1892
|
-
|
|
1931
|
+
onKeyDown: (p) => {
|
|
1932
|
+
p.key === "Enter" && (p.preventDefault(), n());
|
|
1893
1933
|
},
|
|
1894
1934
|
className: [
|
|
1895
1935
|
"ds:block ds:w-full ds:appearance-none ds:text-end ds:tabular-nums",
|
|
1896
|
-
|
|
1936
|
+
Re,
|
|
1897
1937
|
// Use `md` height — see editable-text-cell-renderer for rationale.
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1938
|
+
De.md,
|
|
1939
|
+
ke.sm,
|
|
1940
|
+
Ie.sm
|
|
1901
1941
|
].join(" ")
|
|
1902
1942
|
}
|
|
1903
1943
|
);
|
|
1904
1944
|
}
|
|
1905
1945
|
export {
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1946
|
+
pn as A,
|
|
1947
|
+
bn as B,
|
|
1948
|
+
gn as C,
|
|
1949
|
+
Ja as D,
|
|
1950
|
+
vn as E,
|
|
1951
|
+
ln as I,
|
|
1952
|
+
fn as L,
|
|
1953
|
+
tn as S,
|
|
1954
|
+
cn as T,
|
|
1955
|
+
sn as U,
|
|
1956
|
+
un as a,
|
|
1957
|
+
dn as b,
|
|
1958
|
+
Ya as c,
|
|
1959
|
+
en as d,
|
|
1960
|
+
hn as e,
|
|
1961
|
+
an as f,
|
|
1962
|
+
on as g,
|
|
1963
|
+
mn as h,
|
|
1964
|
+
Y as i,
|
|
1965
|
+
jt as j,
|
|
1966
|
+
nn as k,
|
|
1967
|
+
rn as l,
|
|
1968
|
+
Wt as m,
|
|
1969
|
+
Me as n,
|
|
1970
|
+
Za as u
|
|
1931
1971
|
};
|
|
1932
|
-
//# sourceMappingURL=editable-currency-cell-renderer-
|
|
1972
|
+
//# sourceMappingURL=editable-currency-cell-renderer-1t42gENX.js.map
|