@alfadocs/ui-kit 0.67.0 → 0.68.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/{ai-tools-rail-DfmewPUN.js → ai-tools-rail-CInA_1-E.js} +2 -2
- package/dist/_chunks/{appointment-tray-CQJ3Nbi5.js → appointment-tray-BMl89NPW.js} +2 -2
- package/dist/_chunks/{care-plan-card-CJei-nl9.js → care-plan-card-BwVUyUBb.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-EmfrbHu8.js → care-plan-entry-card-VzdQHcOL.js} +2 -2
- package/dist/_chunks/{color-picker-B7xsn6tX.js → color-picker-FXpItIaF.js} +171 -167
- package/dist/_chunks/{editable-currency-cell-renderer-BVJ04DkB.js → editable-currency-cell-renderer-DHOspPee.js} +906 -881
- package/dist/_chunks/{marketplace-app-shell-Bu-HD3fy.js → marketplace-app-shell-D4-T9Qzz.js} +2 -2
- package/dist/_chunks/{patient-shell-DrV_iekt.js → patient-shell-BfgufL_q.js} +2 -2
- package/dist/_chunks/{patient-summary-card-ByfIU8N0.js → patient-summary-card-hEmr4eTW.js} +2 -2
- package/dist/_chunks/{payment-request-card-yTjzKQCU.js → payment-request-card-CYE5vhZ0.js} +2 -2
- package/dist/_chunks/{rich-text-editor-BOQr5lHx.js → rich-text-editor-VawKN1FI.js} +884 -801
- package/dist/_chunks/{scroll-area-eccd_Uf-.js → scroll-area-5wNK0Cyz.js} +3 -3
- package/dist/_chunks/{sidebar-CGjIk_FQ.js → sidebar-DaB4ulxH.js} +344 -340
- package/dist/_chunks/{transaction-chip-BrW8P50O.js → transaction-chip-DK84XCBU.js} +31 -18
- package/dist/agent-catalog.json +1 -1
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/appointment-card/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +1 -1
- package/dist/components/data-table/filters/date-range-filter.d.ts +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/data-table/toolbar.d.ts +4 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +15 -0
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +6 -1
- package/dist/i18n/locales/ar.js +8 -3
- package/dist/i18n/locales/de.d.ts +6 -1
- package/dist/i18n/locales/de.js +8 -3
- package/dist/i18n/locales/el.d.ts +6 -1
- package/dist/i18n/locales/el.js +8 -3
- package/dist/i18n/locales/en.d.ts +6 -1
- package/dist/i18n/locales/en.js +8 -3
- package/dist/i18n/locales/es.d.ts +6 -1
- package/dist/i18n/locales/es.js +8 -3
- package/dist/i18n/locales/fr.d.ts +6 -1
- package/dist/i18n/locales/fr.js +8 -3
- package/dist/i18n/locales/hi.d.ts +6 -1
- package/dist/i18n/locales/hi.js +8 -3
- package/dist/i18n/locales/it.d.ts +6 -1
- package/dist/i18n/locales/it.js +8 -3
- package/dist/i18n/locales/ja.d.ts +6 -1
- package/dist/i18n/locales/ja.js +8 -3
- package/dist/i18n/locales/nl.d.ts +6 -1
- package/dist/i18n/locales/nl.js +8 -3
- package/dist/i18n/locales/pl.d.ts +6 -1
- package/dist/i18n/locales/pl.js +8 -3
- package/dist/i18n/locales/pt.d.ts +6 -1
- package/dist/i18n/locales/pt.js +8 -3
- package/dist/i18n/locales/ro.d.ts +6 -1
- package/dist/i18n/locales/ro.js +8 -3
- package/dist/i18n/locales/ru.d.ts +6 -1
- package/dist/i18n/locales/ru.js +8 -3
- package/dist/i18n/locales/sq.d.ts +6 -1
- package/dist/i18n/locales/sq.js +8 -3
- package/dist/i18n/locales/sv.d.ts +6 -1
- package/dist/i18n/locales/sv.js +8 -3
- package/dist/i18n/locales/tr.d.ts +6 -1
- package/dist/i18n/locales/tr.js +8 -3
- package/dist/i18n/locales/zh.d.ts +6 -1
- package/dist/i18n/locales/zh.js +8 -3
- package/dist/index.js +14 -14
- package/dist/locales/ar.json +8 -3
- package/dist/locales/de.json +8 -3
- package/dist/locales/el.json +8 -3
- package/dist/locales/en.json +8 -3
- package/dist/locales/es.json +8 -3
- package/dist/locales/fr.json +8 -3
- package/dist/locales/hi.json +8 -3
- package/dist/locales/it.json +8 -3
- package/dist/locales/ja.json +8 -3
- package/dist/locales/nl.json +8 -3
- package/dist/locales/pl.json +8 -3
- package/dist/locales/pt.json +8 -3
- package/dist/locales/ro.json +8 -3
- package/dist/locales/ru.json +8 -3
- package/dist/locales/sq.json +8 -3
- package/dist/locales/sv.json +8 -3
- package/dist/locales/tr.json +8 -3
- package/dist/locales/zh.json +8 -3
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { useMemo as z, forwardRef as
|
|
3
|
-
import { S as
|
|
4
|
-
import { E as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useTranslation as
|
|
7
|
-
import { useGridFilter as Y, AgGridReact as
|
|
8
|
-
import { ModuleRegistry as
|
|
9
|
-
import { B as
|
|
10
|
-
import { I as
|
|
1
|
+
import { jsx as s, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as z, forwardRef as _, useState as R, useCallback as M, useEffect as A, useRef as Z, createContext as Se, useContext as we, isValidElement as Fe, cloneElement as Re, useImperativeHandle as Ct } from "react";
|
|
3
|
+
import { S as xt } from "./skeleton-CZbwyJAA.js";
|
|
4
|
+
import { E as Nt } from "./empty-state-BLy7tigq.js";
|
|
5
|
+
import { c as St } from "./index-D2ZczOXr.js";
|
|
6
|
+
import { useTranslation as F } from "react-i18next";
|
|
7
|
+
import { useGridFilter as Y, AgGridReact as wt } from "ag-grid-react";
|
|
8
|
+
import { ModuleRegistry as Ft, AllCommunityModule as Rt } from "ag-grid-community";
|
|
9
|
+
import { B as G } from "./button-DD_0Xdmr.js";
|
|
10
|
+
import { I as U } from "./icon-button-LqoiKcUN.js";
|
|
11
11
|
import { P as ee } from "./popover-DTbfAuR0.js";
|
|
12
12
|
import { C as De } from "./checkbox-DRcOdmXv.js";
|
|
13
13
|
import { T as pe } from "./text-input-BaClJL8Y.js";
|
|
14
14
|
import { T as J } from "./tag-BQXwuJq1.js";
|
|
15
|
-
import { D as
|
|
15
|
+
import { D as V } from "./dropdown-menu-DwwPovMZ.js";
|
|
16
16
|
import { X as ke } from "./x-CCcI3eJp.js";
|
|
17
|
-
import { R as
|
|
17
|
+
import { R as Dt } from "./refresh-cw-CC8jSKMr.js";
|
|
18
18
|
import { S as me } from "./search-BonnQsHv.js";
|
|
19
|
-
import { C as
|
|
20
|
-
import { G as
|
|
21
|
-
import { P as
|
|
19
|
+
import { C as kt } from "./columns-2-BTOBZbep.js";
|
|
20
|
+
import { G as It } from "./grip-vertical-Dlg0_k5C.js";
|
|
21
|
+
import { P as Et } from "./printer-CeVEWfQq.js";
|
|
22
22
|
import { F as Ie } from "./file-text-DSNuv2B8.js";
|
|
23
23
|
import { D as ne } from "./download-CDF1sbL9.js";
|
|
24
|
-
import { F as
|
|
25
|
-
import
|
|
24
|
+
import { F as zt } from "./file-spreadsheet-zUkY8rJ2.js";
|
|
25
|
+
import At from "i18next";
|
|
26
26
|
import { S as Ee } from "./select-CEtRcon5.js";
|
|
27
|
-
import { u as
|
|
28
|
-
import { u as
|
|
29
|
-
import { u as
|
|
27
|
+
import { u as Pt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
|
|
28
|
+
import { u as Ot } from "./use-theme-CAuo6EYT.js";
|
|
29
|
+
import { u as Mt } from "./registry-nPAVE19X.js";
|
|
30
30
|
import { D as ze } from "./date-range-picker-C5BWfH_T.js";
|
|
31
|
-
import { M as
|
|
31
|
+
import { M as jt } from "./multi-select-BcPylvHR.js";
|
|
32
32
|
import { A as Ae } from "./autocomplete-CcCFlVf-.js";
|
|
33
33
|
import { N as te } from "./number-input-Dj5L3pXK.js";
|
|
34
|
-
import { B as
|
|
34
|
+
import { B as Lt } from "./badge-CqGsX32l.js";
|
|
35
35
|
import { A as Pe } from "./avatar-BNQNhoyL.js";
|
|
36
|
-
import { T as
|
|
36
|
+
import { T as qt } from "./tooltip-DvmfrNvB.js";
|
|
37
37
|
import { T as ve } from "./timestamp-BV2lC-wV.js";
|
|
38
|
-
import { I as
|
|
39
|
-
import { E as
|
|
38
|
+
import { I as $t } from "./icon-button-group-C48khLE0.js";
|
|
39
|
+
import { E as Gt } from "./ellipsis-rgGdiK_9.js";
|
|
40
40
|
import { S as _t } from "./square-check-big-Jr-0202D.js";
|
|
41
41
|
import { S as Bt } from "./square-CZoGU14v.js";
|
|
42
|
-
import { u as
|
|
42
|
+
import { u as Vt } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
|
|
43
43
|
import { c as Oe, a as Me, b as je, d as Le } from "./input-surface-xyERuLU_.js";
|
|
44
|
-
function
|
|
44
|
+
function Ut(t) {
|
|
45
45
|
if (!Fe(t)) return t;
|
|
46
46
|
const e = t, a = e.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} ds:size-4`.trim();
|
|
47
47
|
return Re(e, { className: n, size: e.props.size ?? 16 });
|
|
48
48
|
}
|
|
49
49
|
const qe = Se(null);
|
|
50
|
-
function
|
|
50
|
+
function B(t) {
|
|
51
51
|
const e = we(qe);
|
|
52
52
|
if (!e)
|
|
53
53
|
throw new Error(
|
|
@@ -55,7 +55,7 @@ function _(t) {
|
|
|
55
55
|
);
|
|
56
56
|
return e;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Kt({
|
|
59
59
|
getApi: t,
|
|
60
60
|
selectionCount: e,
|
|
61
61
|
onPrint: a,
|
|
@@ -67,7 +67,7 @@ function Ut({
|
|
|
67
67
|
);
|
|
68
68
|
return /* @__PURE__ */ s(qe.Provider, { value: r, children: n });
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const Wt = [
|
|
71
71
|
"data-table-toolbar",
|
|
72
72
|
// Mobile (<sm) keeps `flex-wrap` so a wide QuickSearch can flow above the
|
|
73
73
|
// Actions cluster on narrow screens. From `sm` (≥640px) we switch to
|
|
@@ -86,20 +86,20 @@ const Kt = [
|
|
|
86
86
|
"ds:border ds:border-[color:var(--card-border)]",
|
|
87
87
|
"ds:shadow-[var(--shadow-sm)]",
|
|
88
88
|
"ds:py-[var(--spacing-sm)] ds:px-[var(--spacing-md)]"
|
|
89
|
-
].join(" "), $e =
|
|
89
|
+
].join(" "), $e = _(
|
|
90
90
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
93
|
ref: n,
|
|
94
94
|
role: "toolbar",
|
|
95
|
-
className: [
|
|
95
|
+
className: [Wt, t ?? ""].join(" ").trim(),
|
|
96
96
|
...a,
|
|
97
97
|
children: e
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
);
|
|
101
101
|
$e.displayName = "DataTable.Toolbar";
|
|
102
|
-
const
|
|
102
|
+
const Ge = _(
|
|
103
103
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
|
|
104
104
|
"div",
|
|
105
105
|
{
|
|
@@ -118,8 +118,8 @@ const _e = $(
|
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
);
|
|
121
|
-
|
|
122
|
-
const
|
|
121
|
+
Ge.displayName = "DataTable.Toolbar.FilterBar";
|
|
122
|
+
const _e = _(
|
|
123
123
|
({ className: t, children: e, ...a }, n) => /* @__PURE__ */ s(
|
|
124
124
|
"div",
|
|
125
125
|
{
|
|
@@ -134,29 +134,29 @@ const Be = $(
|
|
|
134
134
|
}
|
|
135
135
|
)
|
|
136
136
|
);
|
|
137
|
-
|
|
138
|
-
const
|
|
137
|
+
_e.displayName = "DataTable.Toolbar.Actions";
|
|
138
|
+
const Be = _(
|
|
139
139
|
({ label: t, onExport: e, intent: a = "outline", ...n }, r) => {
|
|
140
|
-
const { t: o } =
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
}, [
|
|
140
|
+
const { t: o } = F(), { getApi: l } = B("DataTable.Toolbar.ExportCsv"), f = M(() => {
|
|
141
|
+
const i = l();
|
|
142
|
+
i && (e ? e(i) : i.exportDataAsCsv());
|
|
143
|
+
}, [l, e]);
|
|
144
144
|
return /* @__PURE__ */ s(
|
|
145
|
-
|
|
145
|
+
U,
|
|
146
146
|
{
|
|
147
147
|
ref: r,
|
|
148
148
|
type: "button",
|
|
149
149
|
intent: a,
|
|
150
150
|
icon: /* @__PURE__ */ s(ne, { "aria-hidden": !0 }),
|
|
151
151
|
tooltip: t ?? o("dataTable.exportCsv"),
|
|
152
|
-
onClick:
|
|
152
|
+
onClick: f,
|
|
153
153
|
...n
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
157
|
);
|
|
158
|
-
|
|
159
|
-
function
|
|
158
|
+
Be.displayName = "DataTable.Toolbar.ExportCsv";
|
|
159
|
+
function Q(t, e = [30, 30, 30]) {
|
|
160
160
|
if (typeof document > "u") return e;
|
|
161
161
|
const a = document.createElement("span");
|
|
162
162
|
a.style.color = `hsl(var(${t}))`, a.style.position = "absolute", a.style.visibility = "hidden", document.body.appendChild(a);
|
|
@@ -168,74 +168,74 @@ function H(t, e = [30, 30, 30]) {
|
|
|
168
168
|
async function Ve(t, e) {
|
|
169
169
|
if (!t) return;
|
|
170
170
|
const [{ jsPDF: a }, { default: n }] = await Promise.all([
|
|
171
|
-
import("./jspdf.es.min-DaapWjR1.js").then((
|
|
171
|
+
import("./jspdf.es.min-DaapWjR1.js").then((g) => g.j),
|
|
172
172
|
import("./jspdf.plugin.autotable-CSiDNyPn.js")
|
|
173
|
-
]), o = (t.getColumns() ?? []).filter((
|
|
174
|
-
o.map((
|
|
175
|
-
],
|
|
176
|
-
t.forEachNodeAfterFilterAndSort((
|
|
177
|
-
if (!
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
rowNode:
|
|
173
|
+
]), o = (t.getColumns() ?? []).filter((g) => g.isVisible()), l = [
|
|
174
|
+
o.map((g) => t.getDisplayNameForColumn(g, null) ?? "")
|
|
175
|
+
], f = [];
|
|
176
|
+
t.forEachNodeAfterFilterAndSort((g) => {
|
|
177
|
+
if (!g.data) return;
|
|
178
|
+
const C = o.map((T) => {
|
|
179
|
+
const x = t.getCellValue({
|
|
180
|
+
rowNode: g,
|
|
181
181
|
colKey: T,
|
|
182
182
|
useFormatter: !0
|
|
183
183
|
});
|
|
184
|
-
return
|
|
184
|
+
return x == null ? "" : String(x);
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
f.push(C);
|
|
187
187
|
});
|
|
188
|
-
const
|
|
189
|
-
n(
|
|
190
|
-
head:
|
|
191
|
-
body:
|
|
192
|
-
headStyles: { fillColor:
|
|
193
|
-
bodyStyles: { textColor:
|
|
194
|
-
alternateRowStyles: { fillColor:
|
|
188
|
+
const i = Q("--muted", [240, 240, 240]), d = Q("--foreground", [30, 30, 30]), c = Q("--card-foreground", [30, 30, 30]), u = Q("--card", [250, 250, 250]), v = new a({ orientation: "landscape" });
|
|
189
|
+
n(v, {
|
|
190
|
+
head: l,
|
|
191
|
+
body: f,
|
|
192
|
+
headStyles: { fillColor: i, textColor: d },
|
|
193
|
+
bodyStyles: { textColor: c },
|
|
194
|
+
alternateRowStyles: { fillColor: u },
|
|
195
195
|
styles: {
|
|
196
196
|
font: "helvetica",
|
|
197
197
|
fontSize: 10,
|
|
198
198
|
cellPadding: 4
|
|
199
199
|
}
|
|
200
|
-
}),
|
|
200
|
+
}), v.save(e.fileName);
|
|
201
201
|
}
|
|
202
|
-
const Ue =
|
|
202
|
+
const Ue = _(
|
|
203
203
|
({ label: t, onClick: e, fileName: a, intent: n = "outline", ...r }, o) => {
|
|
204
|
-
const { t:
|
|
205
|
-
const
|
|
204
|
+
const { t: l } = F(), { getApi: f } = B("DataTable.Toolbar.ExportPdf"), i = M(() => {
|
|
205
|
+
const d = f();
|
|
206
206
|
if (e) {
|
|
207
|
-
e(
|
|
207
|
+
e(d);
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
|
-
Ve(
|
|
210
|
+
Ve(d, {
|
|
211
211
|
fileName: a ?? "data-table-export.pdf"
|
|
212
212
|
});
|
|
213
|
-
}, [
|
|
213
|
+
}, [f, e, a]);
|
|
214
214
|
return /* @__PURE__ */ s(
|
|
215
|
-
|
|
215
|
+
U,
|
|
216
216
|
{
|
|
217
217
|
ref: o,
|
|
218
218
|
type: "button",
|
|
219
219
|
intent: n,
|
|
220
220
|
icon: /* @__PURE__ */ s(Ie, { "aria-hidden": !0 }),
|
|
221
|
-
tooltip: t ??
|
|
222
|
-
onClick:
|
|
221
|
+
tooltip: t ?? l("dataTable.exportPdf"),
|
|
222
|
+
onClick: i,
|
|
223
223
|
...r
|
|
224
224
|
}
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
228
|
Ue.displayName = "DataTable.Toolbar.ExportPdf";
|
|
229
|
-
const Ke =
|
|
229
|
+
const Ke = _(
|
|
230
230
|
({ label: t, intent: e = "outline", ...a }, n) => {
|
|
231
|
-
const { t: r } =
|
|
231
|
+
const { t: r } = F(), { onPrint: o } = B("DataTable.Toolbar.Print");
|
|
232
232
|
return /* @__PURE__ */ s(
|
|
233
|
-
|
|
233
|
+
U,
|
|
234
234
|
{
|
|
235
235
|
ref: n,
|
|
236
236
|
type: "button",
|
|
237
237
|
intent: e,
|
|
238
|
-
icon: /* @__PURE__ */ s(
|
|
238
|
+
icon: /* @__PURE__ */ s(Et, { "aria-hidden": !0 }),
|
|
239
239
|
tooltip: t ?? r("dataTable.print"),
|
|
240
240
|
onClick: o,
|
|
241
241
|
...a
|
|
@@ -245,12 +245,12 @@ const Ke = $(
|
|
|
245
245
|
);
|
|
246
246
|
Ke.displayName = "DataTable.Toolbar.Print";
|
|
247
247
|
const We = ({ placeholder: t, debounceMs: e = 150 }) => {
|
|
248
|
-
const { t: a } =
|
|
249
|
-
return
|
|
250
|
-
const
|
|
251
|
-
|
|
248
|
+
const { t: a } = F(), { getApi: n } = B("DataTable.Toolbar.QuickSearch"), [r, o] = R(""), l = Z(void 0);
|
|
249
|
+
return A(() => (l.current && window.clearTimeout(l.current), l.current = window.setTimeout(() => {
|
|
250
|
+
const f = n();
|
|
251
|
+
f && f.setGridOption("quickFilterText", r);
|
|
252
252
|
}, e), () => {
|
|
253
|
-
|
|
253
|
+
l.current && window.clearTimeout(l.current);
|
|
254
254
|
}), [r, e, n]), // Slot wrapper caps the search at a sensible legible width on desktop —
|
|
255
255
|
// without this, TextInput's `w-full` lets the QuickSearch absorb the
|
|
256
256
|
// entire FilterBar row and push trailing Actions onto a second line at
|
|
@@ -264,7 +264,7 @@ const We = ({ placeholder: t, debounceMs: e = 150 }) => {
|
|
|
264
264
|
type: "search",
|
|
265
265
|
size: "sm",
|
|
266
266
|
value: r,
|
|
267
|
-
onChange: (
|
|
267
|
+
onChange: (f) => o(f.target.value),
|
|
268
268
|
placeholder: t ?? a("dataTable.quickSearch.placeholder", "Search…"),
|
|
269
269
|
startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": !0, className: "ds:size-4" }),
|
|
270
270
|
clearable: !0,
|
|
@@ -274,16 +274,16 @@ const We = ({ placeholder: t, debounceMs: e = 150 }) => {
|
|
|
274
274
|
) });
|
|
275
275
|
};
|
|
276
276
|
We.displayName = "DataTable.Toolbar.QuickSearch";
|
|
277
|
-
const He =
|
|
277
|
+
const He = _(
|
|
278
278
|
({ onRefresh: t, label: e, intent: a = "outline", ...n }, r) => {
|
|
279
|
-
const { t: o } =
|
|
279
|
+
const { t: o } = F();
|
|
280
280
|
return /* @__PURE__ */ s(
|
|
281
|
-
|
|
281
|
+
U,
|
|
282
282
|
{
|
|
283
283
|
ref: r,
|
|
284
284
|
type: "button",
|
|
285
285
|
intent: a,
|
|
286
|
-
icon: /* @__PURE__ */ s(
|
|
286
|
+
icon: /* @__PURE__ */ s(Dt, { "aria-hidden": !0 }),
|
|
287
287
|
tooltip: e ?? o("dataTable.refresh", "Refresh"),
|
|
288
288
|
onClick: t,
|
|
289
289
|
...n
|
|
@@ -292,7 +292,7 @@ const He = $(
|
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
He.displayName = "DataTable.Toolbar.Refresh";
|
|
295
|
-
function
|
|
295
|
+
function Ht(t) {
|
|
296
296
|
if (!t || typeof t != "object") return "";
|
|
297
297
|
const e = t;
|
|
298
298
|
if (typeof e.filter == "string" || typeof e.filter == "number") {
|
|
@@ -302,42 +302,42 @@ function Wt(t) {
|
|
|
302
302
|
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(", ") : "";
|
|
303
303
|
}
|
|
304
304
|
const Qe = () => {
|
|
305
|
-
const { t } =
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
305
|
+
const { t } = F(), { getApi: e } = B("DataTable.Toolbar.FilterChips"), [a, n] = R([]), [r, o] = R(""), l = M(() => {
|
|
306
|
+
const c = e();
|
|
307
|
+
if (!c) {
|
|
308
308
|
n([]), o("");
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
|
-
const
|
|
312
|
-
for (const T of Object.keys(
|
|
313
|
-
const
|
|
314
|
-
|
|
311
|
+
const u = c.getFilterModel() ?? {}, v = c.getColumns() ?? [], g = [];
|
|
312
|
+
for (const T of Object.keys(u)) {
|
|
313
|
+
const x = v.find((m) => m.getColId() === T), p = c.getDisplayNameForColumn(x, null) ?? T;
|
|
314
|
+
g.push({
|
|
315
315
|
colId: T,
|
|
316
316
|
headerName: p,
|
|
317
|
-
text:
|
|
317
|
+
text: Ht(u[T])
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
n(
|
|
321
|
-
const
|
|
322
|
-
o(typeof
|
|
320
|
+
n(g);
|
|
321
|
+
const C = c.getGridOption("quickFilterText");
|
|
322
|
+
o(typeof C == "string" ? C : "");
|
|
323
323
|
}, [e]);
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
if (!
|
|
327
|
-
const
|
|
328
|
-
return
|
|
329
|
-
|
|
324
|
+
if (A(() => {
|
|
325
|
+
const c = e();
|
|
326
|
+
if (!c) return;
|
|
327
|
+
const u = (v) => l();
|
|
328
|
+
return c.addEventListener("filterChanged", u), l(), () => {
|
|
329
|
+
c.removeEventListener("filterChanged", u);
|
|
330
330
|
};
|
|
331
|
-
}, [e,
|
|
332
|
-
function
|
|
333
|
-
const
|
|
334
|
-
|
|
331
|
+
}, [e, l]), a.length + (r ? 1 : 0) === 0) return null;
|
|
332
|
+
function i(c) {
|
|
333
|
+
const u = e();
|
|
334
|
+
u && u.destroyFilter(c);
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
const
|
|
338
|
-
|
|
336
|
+
function d() {
|
|
337
|
+
const c = e();
|
|
338
|
+
c && (c.setFilterModel(null), c.setGridOption("quickFilterText", ""), o(""));
|
|
339
339
|
}
|
|
340
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ k(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
role: "group",
|
|
@@ -351,28 +351,28 @@ const Qe = () => {
|
|
|
351
351
|
size: "sm",
|
|
352
352
|
fill: "outline",
|
|
353
353
|
onRemove: () => {
|
|
354
|
-
const
|
|
355
|
-
|
|
354
|
+
const c = e();
|
|
355
|
+
c == null || c.setGridOption("quickFilterText", ""), o("");
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
),
|
|
359
|
-
a.map((
|
|
359
|
+
a.map((c) => /* @__PURE__ */ s(
|
|
360
360
|
J,
|
|
361
361
|
{
|
|
362
|
-
label:
|
|
362
|
+
label: c.text ? `${c.headerName}: ${c.text}` : c.headerName,
|
|
363
363
|
size: "sm",
|
|
364
364
|
fill: "outline",
|
|
365
|
-
onRemove: () =>
|
|
365
|
+
onRemove: () => i(c.colId)
|
|
366
366
|
},
|
|
367
|
-
|
|
367
|
+
c.colId
|
|
368
368
|
)),
|
|
369
369
|
/* @__PURE__ */ s(
|
|
370
|
-
|
|
370
|
+
G,
|
|
371
371
|
{
|
|
372
372
|
type: "button",
|
|
373
373
|
intent: "ghost",
|
|
374
374
|
size: "sm",
|
|
375
|
-
onClick:
|
|
375
|
+
onClick: d,
|
|
376
376
|
startIcon: /* @__PURE__ */ s(ke, { "aria-hidden": !0, className: "ds:size-4" }),
|
|
377
377
|
children: t("dataTable.filterChips.clearAll", "Clear all")
|
|
378
378
|
}
|
|
@@ -387,19 +387,19 @@ const Xe = ({
|
|
|
387
387
|
options: e,
|
|
388
388
|
label: a
|
|
389
389
|
}) => {
|
|
390
|
-
const { t: n } =
|
|
391
|
-
function
|
|
392
|
-
i
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
if (
|
|
396
|
-
|
|
390
|
+
const { t: n } = F(), { getApi: r } = B("DataTable.Toolbar.FacetFilter"), [o, l] = R(null);
|
|
391
|
+
function f(i) {
|
|
392
|
+
l(i);
|
|
393
|
+
const d = r();
|
|
394
|
+
if (d) {
|
|
395
|
+
if (i === null) {
|
|
396
|
+
d.destroyFilter(t);
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
|
|
399
|
+
d.setColumnFilterModel(t, {
|
|
400
400
|
type: "equals",
|
|
401
|
-
filter:
|
|
402
|
-
}),
|
|
401
|
+
filter: i
|
|
402
|
+
}), d.onFilterChanged();
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
405
|
return /* @__PURE__ */ s(
|
|
@@ -408,60 +408,60 @@ const Xe = ({
|
|
|
408
408
|
role: "group",
|
|
409
409
|
"aria-label": a ?? n("dataTable.facetFilter.label", "Filter"),
|
|
410
410
|
className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
411
|
-
children: e.map((
|
|
412
|
-
const
|
|
411
|
+
children: e.map((i) => {
|
|
412
|
+
const d = o === i.value;
|
|
413
413
|
return /* @__PURE__ */ s(
|
|
414
|
-
|
|
414
|
+
G,
|
|
415
415
|
{
|
|
416
416
|
type: "button",
|
|
417
417
|
size: "sm",
|
|
418
|
-
intent:
|
|
419
|
-
"aria-pressed":
|
|
420
|
-
onClick: () =>
|
|
421
|
-
children:
|
|
418
|
+
intent: d ? "primary" : "secondary",
|
|
419
|
+
"aria-pressed": d,
|
|
420
|
+
onClick: () => f(i.value),
|
|
421
|
+
children: i.label
|
|
422
422
|
},
|
|
423
|
-
String(
|
|
423
|
+
String(i.value)
|
|
424
424
|
);
|
|
425
425
|
})
|
|
426
426
|
}
|
|
427
427
|
);
|
|
428
428
|
};
|
|
429
429
|
Xe.displayName = "DataTable.Toolbar.FacetFilter";
|
|
430
|
-
const
|
|
431
|
-
async function
|
|
430
|
+
const Qt = ["csv", "xlsx", "pdf"];
|
|
431
|
+
async function Xt(t, e) {
|
|
432
432
|
if (!t) return;
|
|
433
|
-
const a = await import("./exceljs.min-DUJ-5CGx.js").then((T) => T.e), n = new a.Workbook(), r = n.addWorksheet("Sheet1"),
|
|
433
|
+
const a = await import("./exceljs.min-DUJ-5CGx.js").then((T) => T.e), n = new a.Workbook(), r = n.addWorksheet("Sheet1"), l = (t.getColumns() ?? []).filter((T) => T.isVisible());
|
|
434
434
|
r.addRow(
|
|
435
|
-
|
|
435
|
+
l.map(
|
|
436
436
|
(T) => t.getDisplayNameForColumn(T, null) ?? T.getColId()
|
|
437
437
|
)
|
|
438
438
|
), t.forEachNodeAfterFilterAndSort((T) => {
|
|
439
439
|
T.data && r.addRow(
|
|
440
|
-
|
|
440
|
+
l.map((x) => {
|
|
441
441
|
const p = t.getCellValue({
|
|
442
442
|
rowNode: T,
|
|
443
|
-
colKey:
|
|
443
|
+
colKey: x,
|
|
444
444
|
useFormatter: !0
|
|
445
445
|
});
|
|
446
446
|
return p ?? "";
|
|
447
447
|
})
|
|
448
448
|
);
|
|
449
449
|
});
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
T.font = { bold: !0, color: { argb: `FF${
|
|
450
|
+
const f = Q("--muted", [240, 240, 240]), i = Q("--foreground", [30, 30, 30]), d = r.getRow(1), c = ([T, x, p]) => `${T.toString(16).padStart(2, "0")}${x.toString(16).padStart(2, "0")}${p.toString(16).padStart(2, "0")}`.toUpperCase();
|
|
451
|
+
d.eachCell((T) => {
|
|
452
|
+
T.font = { bold: !0, color: { argb: `FF${c(i)}` } }, T.fill = {
|
|
453
453
|
type: "pattern",
|
|
454
454
|
pattern: "solid",
|
|
455
|
-
fgColor: { argb: `FF${
|
|
455
|
+
fgColor: { argb: `FF${c(f)}` }
|
|
456
456
|
};
|
|
457
457
|
});
|
|
458
|
-
const
|
|
458
|
+
const u = await n.xlsx.writeBuffer(), v = new Blob([u], {
|
|
459
459
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
460
|
-
}),
|
|
461
|
-
|
|
460
|
+
}), g = URL.createObjectURL(v), C = document.createElement("a");
|
|
461
|
+
C.href = g, C.download = e.fileName, document.body.appendChild(C), C.click(), document.body.removeChild(C), URL.revokeObjectURL(g);
|
|
462
462
|
}
|
|
463
463
|
const Je = Se(null);
|
|
464
|
-
function
|
|
464
|
+
function Jt() {
|
|
465
465
|
const t = we(Je);
|
|
466
466
|
if (!t)
|
|
467
467
|
throw new Error(
|
|
@@ -470,10 +470,10 @@ function Xt() {
|
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
472
|
const Ze = ({ children: t, label: e }) => {
|
|
473
|
-
const { t: a } =
|
|
474
|
-
return /* @__PURE__ */ s(Je.Provider, { value: r, children: /* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */ s(
|
|
476
|
-
|
|
473
|
+
const { t: a } = F(), { getApi: n } = B("DataTable.Toolbar.ExportMenu"), r = z(() => ({ getApi: n }), [n]), o = t ?? Qt.map((l) => /* @__PURE__ */ s(ge, { format: l }, l));
|
|
474
|
+
return /* @__PURE__ */ s(Je.Provider, { value: r, children: /* @__PURE__ */ k(V.Root, { children: [
|
|
475
|
+
/* @__PURE__ */ s(V.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
476
|
+
U,
|
|
477
477
|
{
|
|
478
478
|
type: "button",
|
|
479
479
|
intent: "outline",
|
|
@@ -483,15 +483,15 @@ const Ze = ({ children: t, label: e }) => {
|
|
|
483
483
|
"aria-haspopup": "menu"
|
|
484
484
|
}
|
|
485
485
|
) }),
|
|
486
|
-
/* @__PURE__ */ s(
|
|
486
|
+
/* @__PURE__ */ s(V.Content, { align: "end", sideOffset: 4, children: o })
|
|
487
487
|
] }) });
|
|
488
488
|
};
|
|
489
489
|
Ze.displayName = "DataTable.Toolbar.ExportMenu";
|
|
490
|
-
function
|
|
490
|
+
function Zt(t, e) {
|
|
491
491
|
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");
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return t === "csv" ? /* @__PURE__ */ s(ne, { "aria-hidden": !0, className: "ds:size-4" }) : t === "xlsx" ? /* @__PURE__ */ s(
|
|
493
|
+
function Yt(t) {
|
|
494
|
+
return t === "csv" ? /* @__PURE__ */ s(ne, { "aria-hidden": !0, className: "ds:size-4" }) : t === "xlsx" ? /* @__PURE__ */ s(zt, { "aria-hidden": !0, className: "ds:size-4" }) : t === "pdf" ? /* @__PURE__ */ s(Ie, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ s(ne, { "aria-hidden": !0, className: "ds:size-4" });
|
|
495
495
|
}
|
|
496
496
|
const ge = ({
|
|
497
497
|
format: t,
|
|
@@ -499,115 +499,116 @@ const ge = ({
|
|
|
499
499
|
onClick: a,
|
|
500
500
|
fileName: n
|
|
501
501
|
}) => {
|
|
502
|
-
const { t: r } =
|
|
503
|
-
const
|
|
502
|
+
const { t: r } = F(), { getApi: o } = Jt(), l = M(() => {
|
|
503
|
+
const f = o();
|
|
504
504
|
if (t === "csv") {
|
|
505
|
-
|
|
505
|
+
f == null || f.exportDataAsCsv();
|
|
506
506
|
return;
|
|
507
507
|
}
|
|
508
508
|
if (t === "pdf") {
|
|
509
|
-
Ve(
|
|
509
|
+
Ve(f, {
|
|
510
510
|
fileName: n ?? "data-table-export.pdf"
|
|
511
511
|
});
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
514
|
if (t === "xlsx") {
|
|
515
|
-
|
|
515
|
+
Xt(f, {
|
|
516
516
|
fileName: n ?? "data-table-export.xlsx"
|
|
517
517
|
});
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
|
-
a == null || a(
|
|
520
|
+
a == null || a(f);
|
|
521
521
|
}, [t, n, a, o]);
|
|
522
|
-
return /* @__PURE__ */ s(
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */ s("span", { children: e ??
|
|
522
|
+
return /* @__PURE__ */ s(V.Item, { onSelect: l, children: /* @__PURE__ */ k("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
523
|
+
Yt(t),
|
|
524
|
+
/* @__PURE__ */ s("span", { children: e ?? Zt(r, t) })
|
|
525
525
|
] }) });
|
|
526
526
|
};
|
|
527
527
|
ge.displayName = "DataTable.Toolbar.ExportMenu.Item";
|
|
528
|
-
function
|
|
529
|
-
return t ? (t.
|
|
528
|
+
function ea(t) {
|
|
529
|
+
return t ? (t.getAllGridColumns() ?? []).map((a) => a.getColDef().hide === void 0 && a.getColId().startsWith("ag-Grid-") ? null : {
|
|
530
530
|
colId: a.getColId(),
|
|
531
531
|
displayName: t.getDisplayNameForColumn(a, null) || a.getColId(),
|
|
532
532
|
visible: a.isVisible()
|
|
533
533
|
}).filter((a) => a !== null) : [];
|
|
534
534
|
}
|
|
535
|
-
const Ye = ({ label: t, icon: e, footer: a }) => {
|
|
536
|
-
const { t:
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}, [
|
|
540
|
-
const
|
|
541
|
-
(
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
(
|
|
545
|
-
(
|
|
535
|
+
const Ye = ({ label: t, icon: e, footer: a, header: n }) => {
|
|
536
|
+
const { t: r } = F(), { getApi: o } = B("DataTable.Toolbar.ColumnToggle"), [l, f] = R(!1), [i, d] = R([]), [c, u] = R(null), [v, g] = R(null);
|
|
537
|
+
A(() => {
|
|
538
|
+
l && d(ea(o()));
|
|
539
|
+
}, [l, o]);
|
|
540
|
+
const C = M(
|
|
541
|
+
(p, m) => {
|
|
542
|
+
const b = o();
|
|
543
|
+
b && (b.setColumnsVisible([p], m), d(
|
|
544
|
+
(h) => h.map(
|
|
545
|
+
(N) => N.colId === p ? { ...N, visible: m } : N
|
|
546
546
|
)
|
|
547
547
|
));
|
|
548
548
|
},
|
|
549
|
-
[
|
|
550
|
-
),
|
|
551
|
-
(
|
|
552
|
-
if (
|
|
553
|
-
const
|
|
554
|
-
if (!
|
|
555
|
-
d((
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
const
|
|
559
|
-
return
|
|
549
|
+
[o]
|
|
550
|
+
), T = M(
|
|
551
|
+
(p, m) => {
|
|
552
|
+
if (p === m) return;
|
|
553
|
+
const b = o();
|
|
554
|
+
if (!b) return;
|
|
555
|
+
d((N) => {
|
|
556
|
+
const E = N.findIndex((q) => q.colId === p), I = N.findIndex((q) => q.colId === m);
|
|
557
|
+
if (E < 0 || I < 0) return N;
|
|
558
|
+
const L = [...N], [D] = L.splice(E, 1);
|
|
559
|
+
return L.splice(I, 0, D), L;
|
|
560
560
|
});
|
|
561
|
-
const
|
|
562
|
-
|
|
561
|
+
const h = i.findIndex((N) => N.colId === m);
|
|
562
|
+
h >= 0 && b.moveColumns([p], h);
|
|
563
563
|
},
|
|
564
|
-
[
|
|
565
|
-
),
|
|
566
|
-
return /* @__PURE__ */
|
|
564
|
+
[o, i]
|
|
565
|
+
), x = t ?? r("dataTable.columnToggle");
|
|
566
|
+
return /* @__PURE__ */ k(ee.Root, { open: l, onOpenChange: f, children: [
|
|
567
567
|
/* @__PURE__ */ s(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
568
|
-
|
|
568
|
+
U,
|
|
569
569
|
{
|
|
570
570
|
type: "button",
|
|
571
571
|
intent: "outline",
|
|
572
|
-
icon: e ?? /* @__PURE__ */ s(
|
|
573
|
-
"aria-label":
|
|
572
|
+
icon: e ?? /* @__PURE__ */ s(kt, { "aria-hidden": !0 }),
|
|
573
|
+
"aria-label": x,
|
|
574
574
|
"aria-haspopup": "dialog"
|
|
575
575
|
}
|
|
576
576
|
) }),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */ s(ee.Heading, { children:
|
|
577
|
+
/* @__PURE__ */ k(ee.Content, { size: "sm", align: "end", children: [
|
|
578
|
+
/* @__PURE__ */ s(ee.Heading, { children: x }),
|
|
579
|
+
n ? /* @__PURE__ */ s("div", { className: "ds:mb-[var(--spacing-xs)] ds:border-b ds:border-[color:var(--border)] ds:pb-[var(--spacing-sm)]", children: n }) : null,
|
|
579
580
|
/* @__PURE__ */ s(
|
|
580
581
|
"ul",
|
|
581
582
|
{
|
|
582
583
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
583
|
-
"aria-label":
|
|
584
|
-
children:
|
|
585
|
-
const
|
|
586
|
-
return /* @__PURE__ */
|
|
584
|
+
"aria-label": x,
|
|
585
|
+
children: i.map((p) => {
|
|
586
|
+
const m = c === p.colId, b = v === p.colId && c !== p.colId;
|
|
587
|
+
return /* @__PURE__ */ k(
|
|
587
588
|
"li",
|
|
588
589
|
{
|
|
589
590
|
draggable: !0,
|
|
590
|
-
onDragStart: (
|
|
591
|
-
|
|
591
|
+
onDragStart: (h) => {
|
|
592
|
+
u(p.colId), h.dataTransfer.effectAllowed = "move", h.dataTransfer.setData("text/plain", p.colId);
|
|
592
593
|
},
|
|
593
|
-
onDragOver: (
|
|
594
|
-
|
|
594
|
+
onDragOver: (h) => {
|
|
595
|
+
h.preventDefault(), h.dataTransfer.dropEffect = "move", g(p.colId);
|
|
595
596
|
},
|
|
596
597
|
onDragLeave: () => {
|
|
597
|
-
|
|
598
|
+
g((h) => h === p.colId ? null : h);
|
|
598
599
|
},
|
|
599
|
-
onDrop: (
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
600
|
+
onDrop: (h) => {
|
|
601
|
+
h.preventDefault();
|
|
602
|
+
const N = h.dataTransfer.getData("text/plain");
|
|
603
|
+
N && T(N, p.colId), u(null), g(null);
|
|
603
604
|
},
|
|
604
605
|
onDragEnd: () => {
|
|
605
|
-
|
|
606
|
+
u(null), g(null);
|
|
606
607
|
},
|
|
607
608
|
className: [
|
|
608
609
|
"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",
|
|
609
|
-
|
|
610
|
-
|
|
610
|
+
m ? "ds:opacity-50" : "",
|
|
611
|
+
b ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
|
|
611
612
|
].filter(Boolean).join(" "),
|
|
612
613
|
children: [
|
|
613
614
|
/* @__PURE__ */ s(
|
|
@@ -615,20 +616,20 @@ const Ye = ({ label: t, icon: e, footer: a }) => {
|
|
|
615
616
|
{
|
|
616
617
|
"aria-hidden": "true",
|
|
617
618
|
className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
|
|
618
|
-
children: /* @__PURE__ */ s(
|
|
619
|
+
children: /* @__PURE__ */ s(It, { className: "ds:size-4" })
|
|
619
620
|
}
|
|
620
621
|
),
|
|
621
622
|
/* @__PURE__ */ s(
|
|
622
623
|
De,
|
|
623
624
|
{
|
|
624
|
-
label:
|
|
625
|
-
checked:
|
|
626
|
-
onCheckedChange: (
|
|
625
|
+
label: p.displayName,
|
|
626
|
+
checked: p.visible,
|
|
627
|
+
onCheckedChange: (h) => C(p.colId, h === !0)
|
|
627
628
|
}
|
|
628
629
|
)
|
|
629
630
|
]
|
|
630
631
|
},
|
|
631
|
-
|
|
632
|
+
p.colId
|
|
632
633
|
);
|
|
633
634
|
})
|
|
634
635
|
}
|
|
@@ -638,21 +639,21 @@ const Ye = ({ label: t, icon: e, footer: a }) => {
|
|
|
638
639
|
] });
|
|
639
640
|
};
|
|
640
641
|
Ye.displayName = "DataTable.Toolbar.ColumnToggle";
|
|
641
|
-
const et =
|
|
642
|
-
({ label: t, icon: e, onClick: a, variant: n = "default", size: r = "sm", ...o },
|
|
643
|
-
const { t:
|
|
642
|
+
const et = _(
|
|
643
|
+
({ label: t, icon: e, onClick: a, variant: n = "default", size: r = "sm", ...o }, l) => {
|
|
644
|
+
const { t: f } = F(), { getApi: i, selectionCount: d } = B(
|
|
644
645
|
"DataTable.Toolbar.BulkAction"
|
|
645
646
|
);
|
|
646
|
-
return
|
|
647
|
-
|
|
647
|
+
return d === 0 ? null : /* @__PURE__ */ k(
|
|
648
|
+
G,
|
|
648
649
|
{
|
|
649
|
-
ref:
|
|
650
|
+
ref: l,
|
|
650
651
|
type: "button",
|
|
651
652
|
intent: n === "destructive" ? "destructive" : "secondary",
|
|
652
653
|
size: r,
|
|
653
|
-
startIcon:
|
|
654
|
-
onClick: () => a(
|
|
655
|
-
"aria-label": `${t} (${
|
|
654
|
+
startIcon: Ut(e),
|
|
655
|
+
onClick: () => a(i()),
|
|
656
|
+
"aria-label": `${t} (${f("dataTable.bulkAction", { count: d })})`,
|
|
656
657
|
...o,
|
|
657
658
|
children: [
|
|
658
659
|
/* @__PURE__ */ s("span", { children: t }),
|
|
@@ -661,7 +662,7 @@ const et = $(
|
|
|
661
662
|
{
|
|
662
663
|
"aria-hidden": "true",
|
|
663
664
|
className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
|
|
664
|
-
children:
|
|
665
|
+
children: f("dataTable.bulkAction", { count: d })
|
|
665
666
|
}
|
|
666
667
|
)
|
|
667
668
|
]
|
|
@@ -670,13 +671,13 @@ const et = $(
|
|
|
670
671
|
}
|
|
671
672
|
);
|
|
672
673
|
et.displayName = "DataTable.Toolbar.BulkAction";
|
|
673
|
-
const
|
|
674
|
+
const ta = Object.assign(Ze, {
|
|
674
675
|
Item: ge
|
|
675
676
|
}), ae = Object.assign($e, {
|
|
676
|
-
FilterBar:
|
|
677
|
-
Actions:
|
|
677
|
+
FilterBar: Ge,
|
|
678
|
+
Actions: _e,
|
|
678
679
|
/** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
|
|
679
|
-
ExportCsv:
|
|
680
|
+
ExportCsv: Be,
|
|
680
681
|
/** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
|
|
681
682
|
ExportPdf: Ue,
|
|
682
683
|
Print: Ke,
|
|
@@ -686,15 +687,15 @@ const ea = Object.assign(Ze, {
|
|
|
686
687
|
Refresh: He,
|
|
687
688
|
FilterChips: Qe,
|
|
688
689
|
FacetFilter: Xe,
|
|
689
|
-
ExportMenu:
|
|
690
|
-
}),
|
|
690
|
+
ExportMenu: ta
|
|
691
|
+
}), aa = [
|
|
691
692
|
"contains",
|
|
692
693
|
"equals",
|
|
693
694
|
"startsWith",
|
|
694
695
|
"endsWith",
|
|
695
696
|
"notContains"
|
|
696
697
|
];
|
|
697
|
-
function
|
|
698
|
+
function na(t) {
|
|
698
699
|
const e = new Intl.Collator(t, {
|
|
699
700
|
sensitivity: "base",
|
|
700
701
|
usage: "search"
|
|
@@ -717,54 +718,54 @@ function aa(t) {
|
|
|
717
718
|
) === 0
|
|
718
719
|
};
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
+
function ra(t) {
|
|
721
722
|
return t == null ? null : typeof t == "string" ? t : String(t);
|
|
722
723
|
}
|
|
723
|
-
function
|
|
724
|
-
const { model: e, onModelChange: a, getValue: n, placeholder: r, defaultOperator: o } = t, { t:
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
function sa(t) {
|
|
725
|
+
const { model: e, onModelChange: a, getValue: n, placeholder: r, defaultOperator: o } = t, { t: l } = F("ui"), f = (e == null ? void 0 : e.type) ?? o ?? "contains", [i, d] = R(f), [c, u] = R((e == null ? void 0 : e.filter) ?? "");
|
|
726
|
+
A(() => {
|
|
727
|
+
d((e == null ? void 0 : e.type) ?? o ?? "contains"), u((e == null ? void 0 : e.filter) ?? "");
|
|
727
728
|
}, [e, o]);
|
|
728
|
-
const
|
|
729
|
+
const v = z(() => na(At.language), []);
|
|
729
730
|
Y({
|
|
730
731
|
doesFilterPass: (p) => {
|
|
731
|
-
const
|
|
732
|
-
if (!
|
|
733
|
-
const
|
|
734
|
-
if (
|
|
735
|
-
switch (
|
|
732
|
+
const m = e;
|
|
733
|
+
if (!m || m.filter === "") return !0;
|
|
734
|
+
const b = ra(n(p.node));
|
|
735
|
+
if (b === null) return !1;
|
|
736
|
+
switch (m.type) {
|
|
736
737
|
case "equals":
|
|
737
|
-
return
|
|
738
|
+
return v.equals(b, m.filter);
|
|
738
739
|
case "contains":
|
|
739
|
-
return
|
|
740
|
+
return v.contains(b, m.filter);
|
|
740
741
|
case "startsWith":
|
|
741
|
-
return
|
|
742
|
+
return v.startsWith(b, m.filter);
|
|
742
743
|
case "endsWith":
|
|
743
|
-
return
|
|
744
|
+
return v.endsWith(b, m.filter);
|
|
744
745
|
case "notContains":
|
|
745
|
-
return !
|
|
746
|
+
return !v.contains(b, m.filter);
|
|
746
747
|
default:
|
|
747
748
|
return !0;
|
|
748
749
|
}
|
|
749
750
|
}
|
|
750
751
|
});
|
|
751
|
-
function
|
|
752
|
-
if (
|
|
752
|
+
function g() {
|
|
753
|
+
if (c.trim() === "") {
|
|
753
754
|
a(null);
|
|
754
755
|
return;
|
|
755
756
|
}
|
|
756
|
-
a({ type:
|
|
757
|
+
a({ type: i, filter: c });
|
|
757
758
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
759
|
+
function C() {
|
|
760
|
+
u(""), d(o ?? "contains"), a(null);
|
|
760
761
|
}
|
|
761
|
-
const T =
|
|
762
|
+
const T = aa.map(
|
|
762
763
|
(p) => ({
|
|
763
764
|
value: p,
|
|
764
|
-
label:
|
|
765
|
+
label: l(`dataTable.textFilter.operators.${p}`)
|
|
765
766
|
})
|
|
766
|
-
),
|
|
767
|
-
return /* @__PURE__ */
|
|
767
|
+
), x = r ?? l("dataTable.textFilter.placeholder");
|
|
768
|
+
return /* @__PURE__ */ k(
|
|
768
769
|
"div",
|
|
769
770
|
{
|
|
770
771
|
"data-component": "text-filter",
|
|
@@ -775,69 +776,69 @@ function ra(t) {
|
|
|
775
776
|
{
|
|
776
777
|
size: "sm",
|
|
777
778
|
options: T,
|
|
778
|
-
value:
|
|
779
|
+
value: i,
|
|
779
780
|
onValueChange: (p) => {
|
|
780
|
-
p !== "" &&
|
|
781
|
+
p !== "" && d(p);
|
|
781
782
|
},
|
|
782
|
-
"aria-label":
|
|
783
|
+
"aria-label": l("dataTable.textFilter.operators.contains")
|
|
783
784
|
}
|
|
784
785
|
),
|
|
785
786
|
/* @__PURE__ */ s(
|
|
786
787
|
pe,
|
|
787
788
|
{
|
|
788
789
|
size: "sm",
|
|
789
|
-
value:
|
|
790
|
-
onChange: (p) =>
|
|
790
|
+
value: c,
|
|
791
|
+
onChange: (p) => u(p.target.value),
|
|
791
792
|
onKeyDown: (p) => {
|
|
792
|
-
p.key === "Enter" && (p.preventDefault(),
|
|
793
|
+
p.key === "Enter" && (p.preventDefault(), g());
|
|
793
794
|
},
|
|
794
|
-
placeholder:
|
|
795
|
-
"aria-label":
|
|
795
|
+
placeholder: x,
|
|
796
|
+
"aria-label": x,
|
|
796
797
|
startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": "true", className: "ds:size-4" })
|
|
797
798
|
}
|
|
798
799
|
),
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */ s(
|
|
801
|
-
/* @__PURE__ */ s(
|
|
800
|
+
/* @__PURE__ */ k("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: [
|
|
801
|
+
/* @__PURE__ */ s(G, { intent: "ghost", size: "sm", onClick: C, type: "button", children: l("dataTable.textFilter.clear") }),
|
|
802
|
+
/* @__PURE__ */ s(G, { intent: "primary", size: "sm", onClick: g, type: "button", children: l("dataTable.textFilter.apply") })
|
|
802
803
|
] })
|
|
803
804
|
]
|
|
804
805
|
}
|
|
805
806
|
);
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
-
var
|
|
809
|
-
const { model: e, onModelChange: a, column: n } = t, { t: r } =
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
}, [e == null ? void 0 : e.filter]),
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
if (
|
|
808
|
+
function oa(t) {
|
|
809
|
+
var u, v;
|
|
810
|
+
const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), o = ((v = (u = n == null ? void 0 : n.getColDef) == null ? void 0 : u.call(n)) == null ? void 0 : v.filterParams) ?? {}, l = o.defaultOperator ?? "contains", f = o.placeholder ?? r("dataTable.textFilter.placeholder"), [i, d] = R((e == null ? void 0 : e.filter) ?? "");
|
|
811
|
+
A(() => {
|
|
812
|
+
d((e == null ? void 0 : e.filter) ?? "");
|
|
813
|
+
}, [e == null ? void 0 : e.filter]), A(() => {
|
|
814
|
+
if (i === ((e == null ? void 0 : e.filter) ?? "")) return;
|
|
815
|
+
const g = setTimeout(() => {
|
|
816
|
+
if (i === "") {
|
|
816
817
|
e && a(null);
|
|
817
818
|
return;
|
|
818
819
|
}
|
|
819
|
-
a({ type:
|
|
820
|
+
a({ type: l, filter: i });
|
|
820
821
|
}, 200);
|
|
821
|
-
return () => clearTimeout(
|
|
822
|
-
}, [
|
|
823
|
-
function
|
|
824
|
-
|
|
822
|
+
return () => clearTimeout(g);
|
|
823
|
+
}, [i, l, e, a]);
|
|
824
|
+
function c() {
|
|
825
|
+
d(""), e && a(null);
|
|
825
826
|
}
|
|
826
827
|
return /* @__PURE__ */ s("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
|
|
827
828
|
pe,
|
|
828
829
|
{
|
|
829
830
|
size: "sm",
|
|
830
|
-
value:
|
|
831
|
-
onChange: (
|
|
832
|
-
placeholder:
|
|
833
|
-
"aria-label":
|
|
831
|
+
value: i,
|
|
832
|
+
onChange: (g) => d(g.target.value),
|
|
833
|
+
placeholder: f,
|
|
834
|
+
"aria-label": f,
|
|
834
835
|
startAdornment: /* @__PURE__ */ s(me, { "aria-hidden": "true", className: "ds:size-4" }),
|
|
835
|
-
endAdornment:
|
|
836
|
+
endAdornment: i.length > 0 ? /* @__PURE__ */ s(
|
|
836
837
|
"button",
|
|
837
838
|
{
|
|
838
839
|
type: "button",
|
|
839
840
|
"aria-label": r("dataTable.textFilter.clear"),
|
|
840
|
-
onClick:
|
|
841
|
+
onClick: c,
|
|
841
842
|
className: "ds:pointer-events-auto ds:flex ds:items-center ds:text-[var(--muted-foreground)] ds:hover:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
842
843
|
children: /* @__PURE__ */ s(ke, { "aria-hidden": "true", className: "ds:size-4" })
|
|
843
844
|
}
|
|
@@ -953,8 +954,8 @@ const la = {
|
|
|
953
954
|
}
|
|
954
955
|
}
|
|
955
956
|
};
|
|
956
|
-
|
|
957
|
-
const
|
|
957
|
+
Ft.registerModules([Rt]);
|
|
958
|
+
const ia = St("ag-theme-alfadocs ds:w-full", {
|
|
958
959
|
variants: {
|
|
959
960
|
density: {
|
|
960
961
|
default: "",
|
|
@@ -971,8 +972,8 @@ const oa = Nt("ag-theme-alfadocs ds:w-full", {
|
|
|
971
972
|
bordered: !0
|
|
972
973
|
}
|
|
973
974
|
});
|
|
974
|
-
function
|
|
975
|
-
const { t } =
|
|
975
|
+
function ca() {
|
|
976
|
+
const { t } = F();
|
|
976
977
|
return z(
|
|
977
978
|
() => ({
|
|
978
979
|
// Filter strings
|
|
@@ -1005,7 +1006,7 @@ function ia() {
|
|
|
1005
1006
|
[t]
|
|
1006
1007
|
);
|
|
1007
1008
|
}
|
|
1008
|
-
function
|
|
1009
|
+
function da() {
|
|
1009
1010
|
return /* @__PURE__ */ s(
|
|
1010
1011
|
"div",
|
|
1011
1012
|
{
|
|
@@ -1013,7 +1014,7 @@ function ca() {
|
|
|
1013
1014
|
"aria-live": "polite",
|
|
1014
1015
|
className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
|
|
1015
1016
|
children: Array.from({ length: 5 }).map((t, e) => /* @__PURE__ */ s(
|
|
1016
|
-
|
|
1017
|
+
xt,
|
|
1017
1018
|
{
|
|
1018
1019
|
variant: "rectangular",
|
|
1019
1020
|
className: "ds:h-[var(--min-target-size)] ds:w-full"
|
|
@@ -1023,10 +1024,10 @@ function ca() {
|
|
|
1023
1024
|
}
|
|
1024
1025
|
);
|
|
1025
1026
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const { t } =
|
|
1027
|
+
function ua() {
|
|
1028
|
+
const { t } = F();
|
|
1028
1029
|
return /* @__PURE__ */ s(
|
|
1029
|
-
|
|
1030
|
+
Nt,
|
|
1030
1031
|
{
|
|
1031
1032
|
variant: "no-results",
|
|
1032
1033
|
size: "sm",
|
|
@@ -1035,7 +1036,7 @@ function da() {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
);
|
|
1037
1038
|
}
|
|
1038
|
-
function
|
|
1039
|
+
function fa(t) {
|
|
1039
1040
|
try {
|
|
1040
1041
|
const e = localStorage.getItem(`data-table-col-state:${t}`);
|
|
1041
1042
|
return e ? JSON.parse(e) : null;
|
|
@@ -1043,7 +1044,7 @@ function ua(t) {
|
|
|
1043
1044
|
return null;
|
|
1044
1045
|
}
|
|
1045
1046
|
}
|
|
1046
|
-
function
|
|
1047
|
+
function pa(t, e) {
|
|
1047
1048
|
try {
|
|
1048
1049
|
localStorage.setItem(
|
|
1049
1050
|
`data-table-col-state:${t}`,
|
|
@@ -1052,108 +1053,108 @@ function fa(t, e) {
|
|
|
1052
1053
|
} catch {
|
|
1053
1054
|
}
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
+
function ma(t, e) {
|
|
1056
1057
|
const {
|
|
1057
1058
|
columnDefs: a,
|
|
1058
1059
|
rowData: n,
|
|
1059
1060
|
rowSelection: r,
|
|
1060
1061
|
pagination: o = !1,
|
|
1061
|
-
paginationPageSize:
|
|
1062
|
-
paginationPageSizeSelector:
|
|
1063
|
-
gridId:
|
|
1064
|
-
onSelectionChanged:
|
|
1065
|
-
onSortChanged:
|
|
1066
|
-
onFilterChanged:
|
|
1067
|
-
noRowsOverlay:
|
|
1068
|
-
loadingOverlay:
|
|
1069
|
-
gridOptions:
|
|
1062
|
+
paginationPageSize: l = 25,
|
|
1063
|
+
paginationPageSizeSelector: f = [10, 25, 50, 100],
|
|
1064
|
+
gridId: i,
|
|
1065
|
+
onSelectionChanged: d,
|
|
1066
|
+
onSortChanged: c,
|
|
1067
|
+
onFilterChanged: u,
|
|
1068
|
+
noRowsOverlay: v,
|
|
1069
|
+
loadingOverlay: g,
|
|
1070
|
+
gridOptions: C,
|
|
1070
1071
|
density: T,
|
|
1071
|
-
bordered:
|
|
1072
|
+
bordered: x,
|
|
1072
1073
|
heightClass: p = "ds:h-[500px]",
|
|
1073
|
-
className:
|
|
1074
|
-
getRowClass:
|
|
1075
|
-
pinnedBottomRowData:
|
|
1076
|
-
printMode:
|
|
1074
|
+
className: m,
|
|
1075
|
+
getRowClass: b,
|
|
1076
|
+
pinnedBottomRowData: h,
|
|
1077
|
+
printMode: N = !1,
|
|
1077
1078
|
children: E
|
|
1078
|
-
} = t, { t:
|
|
1079
|
+
} = t, { t: I, i18n: L } = F(), D = Z(null), [q, at] = R(0), [se, oe] = R(""), nt = ca(), le = z(
|
|
1079
1080
|
() => ({
|
|
1080
1081
|
getSelection: () => {
|
|
1081
1082
|
var w;
|
|
1082
|
-
const
|
|
1083
|
-
if (!
|
|
1084
|
-
const
|
|
1085
|
-
for (const O of
|
|
1086
|
-
O.id != null &&
|
|
1087
|
-
return
|
|
1083
|
+
const y = (w = D.current) == null ? void 0 : w.api;
|
|
1084
|
+
if (!y) return [];
|
|
1085
|
+
const S = [];
|
|
1086
|
+
for (const O of y.getSelectedNodes())
|
|
1087
|
+
O.id != null && S.push(O.id);
|
|
1088
|
+
return S;
|
|
1088
1089
|
},
|
|
1089
|
-
setSelection: (
|
|
1090
|
+
setSelection: (y) => {
|
|
1090
1091
|
var O;
|
|
1091
|
-
const
|
|
1092
|
-
if (!
|
|
1093
|
-
const w = new Set(
|
|
1094
|
-
|
|
1095
|
-
|
|
1092
|
+
const S = (O = D.current) == null ? void 0 : O.api;
|
|
1093
|
+
if (!S) return;
|
|
1094
|
+
const w = new Set(y);
|
|
1095
|
+
S.forEachNode((P) => {
|
|
1096
|
+
P.id != null && P.setSelected(w.has(P.id));
|
|
1096
1097
|
});
|
|
1097
1098
|
},
|
|
1098
|
-
selectRange: (
|
|
1099
|
+
selectRange: (y, S) => {
|
|
1099
1100
|
var he;
|
|
1100
|
-
const w = (he =
|
|
1101
|
+
const w = (he = D.current) == null ? void 0 : he.api;
|
|
1101
1102
|
if (!w) return;
|
|
1102
1103
|
const O = [];
|
|
1103
|
-
w.forEachNodeAfterFilterAndSort((
|
|
1104
|
-
|
|
1104
|
+
w.forEachNodeAfterFilterAndSort((W) => {
|
|
1105
|
+
W.id != null && O.push(W.id);
|
|
1105
1106
|
});
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
const [
|
|
1109
|
-
w.forEachNode((
|
|
1110
|
-
|
|
1107
|
+
const P = O.indexOf(y), j = O.indexOf(S);
|
|
1108
|
+
if (P < 0 || j < 0) return;
|
|
1109
|
+
const [K, ce] = P <= j ? [P, j] : [j, P], de = new Set(O.slice(K, ce + 1));
|
|
1110
|
+
w.forEachNode((W) => {
|
|
1111
|
+
W.id != null && W.setSelected(de.has(W.id));
|
|
1111
1112
|
});
|
|
1112
1113
|
},
|
|
1113
1114
|
clearSelection: () => {
|
|
1114
|
-
var
|
|
1115
|
-
(
|
|
1115
|
+
var y, S;
|
|
1116
|
+
(S = (y = D.current) == null ? void 0 : y.api) == null || S.deselectAll();
|
|
1116
1117
|
},
|
|
1117
1118
|
getFilter: () => {
|
|
1118
|
-
var
|
|
1119
|
-
return ((
|
|
1119
|
+
var y, S;
|
|
1120
|
+
return ((S = (y = D.current) == null ? void 0 : y.api) == null ? void 0 : S.getFilterModel()) ?? {};
|
|
1120
1121
|
},
|
|
1121
|
-
setFilter: (
|
|
1122
|
-
var
|
|
1123
|
-
(w = (
|
|
1122
|
+
setFilter: (y) => {
|
|
1123
|
+
var S, w;
|
|
1124
|
+
(w = (S = D.current) == null ? void 0 : S.api) == null || w.setFilterModel(y);
|
|
1124
1125
|
},
|
|
1125
1126
|
getSort: () => {
|
|
1126
|
-
var
|
|
1127
|
-
const
|
|
1128
|
-
return
|
|
1127
|
+
var S;
|
|
1128
|
+
const y = (S = D.current) == null ? void 0 : S.api;
|
|
1129
|
+
return y ? y.getColumnState().filter((w) => w.sort === "asc" || w.sort === "desc").map((w) => ({ colId: w.colId, sort: w.sort })) : [];
|
|
1129
1130
|
},
|
|
1130
|
-
setSort: (
|
|
1131
|
+
setSort: (y) => {
|
|
1131
1132
|
var O;
|
|
1132
|
-
const
|
|
1133
|
-
if (!
|
|
1134
|
-
const w =
|
|
1135
|
-
const j =
|
|
1136
|
-
return { ...
|
|
1133
|
+
const S = (O = D.current) == null ? void 0 : O.api;
|
|
1134
|
+
if (!S) return;
|
|
1135
|
+
const w = S.getColumnState().map((P) => {
|
|
1136
|
+
const j = y.find((K) => K.colId === P.colId);
|
|
1137
|
+
return { ...P, sort: j ? j.sort : null };
|
|
1137
1138
|
});
|
|
1138
|
-
|
|
1139
|
+
S.applyColumnState({ state: w, defaultState: { sort: null } });
|
|
1139
1140
|
},
|
|
1140
1141
|
getCurrentPage: () => {
|
|
1141
|
-
var
|
|
1142
|
-
return ((
|
|
1142
|
+
var y, S;
|
|
1143
|
+
return ((S = (y = D.current) == null ? void 0 : y.api) == null ? void 0 : S.paginationGetCurrentPage()) ?? 0;
|
|
1143
1144
|
},
|
|
1144
|
-
goToPage: (
|
|
1145
|
-
var
|
|
1146
|
-
(w = (
|
|
1145
|
+
goToPage: (y) => {
|
|
1146
|
+
var S, w;
|
|
1147
|
+
(w = (S = D.current) == null ? void 0 : S.api) == null || w.paginationGoToPage(y);
|
|
1147
1148
|
},
|
|
1148
1149
|
getRawApi: () => {
|
|
1149
|
-
var
|
|
1150
|
-
return (
|
|
1150
|
+
var y;
|
|
1151
|
+
return (y = D.current) == null ? void 0 : y.api;
|
|
1151
1152
|
}
|
|
1152
1153
|
}),
|
|
1153
1154
|
[]
|
|
1154
1155
|
);
|
|
1155
|
-
|
|
1156
|
-
const rt =
|
|
1156
|
+
Ct(e, () => le, [le]), Mt(la, le, i);
|
|
1157
|
+
const rt = L.dir() === "rtl", st = n === void 0, ot = Pt(), { resolvedTheme: be } = Ot(), lt = (be === "light-accessible" || be === "dark-accessible") && T === "compact" ? "default" : T, it = z(() => {
|
|
1157
1158
|
if (r)
|
|
1158
1159
|
return r === "single" ? { mode: "singleRow" } : {
|
|
1159
1160
|
mode: "multiRow",
|
|
@@ -1161,92 +1162,96 @@ function pa(t, e) {
|
|
|
1161
1162
|
checkboxes: !0
|
|
1162
1163
|
};
|
|
1163
1164
|
}, [r]), ct = M(() => {
|
|
1164
|
-
var
|
|
1165
|
-
if (!
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1168
|
-
state:
|
|
1165
|
+
var S;
|
|
1166
|
+
if (!i || !((S = D.current) != null && S.api)) return;
|
|
1167
|
+
const y = fa(i);
|
|
1168
|
+
y && D.current.api.applyColumnState({
|
|
1169
|
+
state: y,
|
|
1169
1170
|
applyOrder: !0
|
|
1170
1171
|
});
|
|
1171
|
-
}, [
|
|
1172
|
-
var
|
|
1173
|
-
|
|
1174
|
-
}, [
|
|
1175
|
-
var w;
|
|
1176
|
-
const C = (w = F.current) == null ? void 0 : w.api;
|
|
1172
|
+
}, [i]), ie = M(() => {
|
|
1173
|
+
var y;
|
|
1174
|
+
i && ((y = D.current) != null && y.api) && pa(i, D.current.api);
|
|
1175
|
+
}, [i]), dt = z(() => {
|
|
1177
1176
|
if (!C) return;
|
|
1178
|
-
const
|
|
1179
|
-
|
|
1180
|
-
}, [
|
|
1181
|
-
|
|
1177
|
+
const y = { ...C };
|
|
1178
|
+
return delete y.defaultColDef, y;
|
|
1179
|
+
}, [C]), ut = M(() => {
|
|
1180
|
+
var w;
|
|
1181
|
+
const y = (w = D.current) == null ? void 0 : w.api;
|
|
1182
|
+
if (!y) return;
|
|
1183
|
+
const S = y.getSelectedRows();
|
|
1184
|
+
at(S.length), d == null || d(S);
|
|
1185
|
+
}, [d]), ft = M(
|
|
1186
|
+
(y) => {
|
|
1182
1187
|
var w;
|
|
1183
|
-
const
|
|
1184
|
-
if (
|
|
1185
|
-
const
|
|
1186
|
-
if (
|
|
1187
|
-
const j =
|
|
1188
|
-
|
|
1189
|
-
|
|
1188
|
+
const S = (w = D.current) == null ? void 0 : w.api;
|
|
1189
|
+
if (S) {
|
|
1190
|
+
const P = S.getColumnState().find((j) => j.sort);
|
|
1191
|
+
if (P) {
|
|
1192
|
+
const j = P.colId, K = S.getColumnDef(j), ce = (K == null ? void 0 : K.headerName) ?? j, de = P.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
|
|
1193
|
+
oe(
|
|
1194
|
+
I("dataTable.sortAnnounce", {
|
|
1190
1195
|
column: ce,
|
|
1191
|
-
direction:
|
|
1196
|
+
direction: I(de)
|
|
1192
1197
|
})
|
|
1193
1198
|
);
|
|
1194
1199
|
} else
|
|
1195
|
-
|
|
1200
|
+
oe("");
|
|
1196
1201
|
}
|
|
1197
|
-
|
|
1202
|
+
c == null || c(y);
|
|
1198
1203
|
},
|
|
1199
|
-
[
|
|
1200
|
-
),
|
|
1201
|
-
(
|
|
1202
|
-
|
|
1204
|
+
[c, I]
|
|
1205
|
+
), pt = M(
|
|
1206
|
+
(y) => {
|
|
1207
|
+
u == null || u(y);
|
|
1203
1208
|
},
|
|
1204
|
-
[
|
|
1209
|
+
[u]
|
|
1205
1210
|
);
|
|
1206
|
-
|
|
1211
|
+
A(() => {
|
|
1207
1212
|
if (!se) return;
|
|
1208
|
-
const
|
|
1209
|
-
return () => clearTimeout(
|
|
1213
|
+
const y = setTimeout(() => oe(""), 3e3);
|
|
1214
|
+
return () => clearTimeout(y);
|
|
1210
1215
|
}, [se]);
|
|
1211
|
-
const
|
|
1216
|
+
const mt = v ?? ua, gt = g ?? da, bt = M(
|
|
1212
1217
|
() => {
|
|
1213
|
-
var
|
|
1214
|
-
return (
|
|
1218
|
+
var y;
|
|
1219
|
+
return (y = D.current) == null ? void 0 : y.api;
|
|
1215
1220
|
},
|
|
1216
1221
|
[]
|
|
1217
|
-
),
|
|
1222
|
+
), ht = M(() => {
|
|
1218
1223
|
typeof window < "u" && window.print();
|
|
1219
|
-
}, []),
|
|
1220
|
-
density:
|
|
1221
|
-
bordered:
|
|
1222
|
-
className:
|
|
1223
|
-
}),
|
|
1224
|
-
return /* @__PURE__ */
|
|
1224
|
+
}, []), vt = ia({
|
|
1225
|
+
density: lt,
|
|
1226
|
+
bordered: x,
|
|
1227
|
+
className: m
|
|
1228
|
+
}), yt = E ?? /* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(ae.Actions, { children: /* @__PURE__ */ s(ae.ExportMenu, {}) }) }), Tt = N ? !1 : o;
|
|
1229
|
+
return /* @__PURE__ */ k(
|
|
1225
1230
|
"div",
|
|
1226
1231
|
{
|
|
1227
1232
|
className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
1228
1233
|
"aria-busy": st ? "true" : void 0,
|
|
1229
1234
|
"data-component": "data-table",
|
|
1230
|
-
"data-component-id":
|
|
1231
|
-
"data-print-mode":
|
|
1235
|
+
"data-component-id": i,
|
|
1236
|
+
"data-print-mode": N ? "true" : void 0,
|
|
1232
1237
|
children: [
|
|
1233
|
-
!
|
|
1234
|
-
|
|
1238
|
+
!N && /* @__PURE__ */ s(
|
|
1239
|
+
Kt,
|
|
1235
1240
|
{
|
|
1236
|
-
getApi:
|
|
1237
|
-
selectionCount:
|
|
1238
|
-
onPrint:
|
|
1239
|
-
children:
|
|
1241
|
+
getApi: bt,
|
|
1242
|
+
selectionCount: q,
|
|
1243
|
+
onPrint: ht,
|
|
1244
|
+
children: yt
|
|
1240
1245
|
}
|
|
1241
1246
|
),
|
|
1242
1247
|
/* @__PURE__ */ s(
|
|
1243
1248
|
"div",
|
|
1244
1249
|
{
|
|
1245
|
-
className: [
|
|
1250
|
+
className: [vt, N ? "" : p].join(" ").trim(),
|
|
1246
1251
|
children: /* @__PURE__ */ s(
|
|
1247
|
-
|
|
1252
|
+
wt,
|
|
1248
1253
|
{
|
|
1249
|
-
ref:
|
|
1254
|
+
ref: D,
|
|
1250
1255
|
theme: "legacy",
|
|
1251
1256
|
columnDefs: a,
|
|
1252
1257
|
rowData: n,
|
|
@@ -1257,21 +1262,21 @@ function pa(t, e) {
|
|
|
1257
1262
|
// language instead of AG Grid's stock browser-skinned input.
|
|
1258
1263
|
// Number / date / select columns opt into their dedicated
|
|
1259
1264
|
// wrapper per-column.
|
|
1260
|
-
filter:
|
|
1261
|
-
floatingFilterComponent:
|
|
1265
|
+
filter: sa,
|
|
1266
|
+
floatingFilterComponent: oa,
|
|
1262
1267
|
resizable: !0,
|
|
1263
1268
|
floatingFilter: !0,
|
|
1264
1269
|
// §13d — faint sort icon advertises which columns are
|
|
1265
1270
|
// sortable. v33+ moved this from grid-level to defaultColDef.
|
|
1266
1271
|
unSortIcon: !0,
|
|
1267
|
-
...
|
|
1272
|
+
...C == null ? void 0 : C.defaultColDef
|
|
1268
1273
|
},
|
|
1269
1274
|
rowSelection: it,
|
|
1270
|
-
pagination:
|
|
1271
|
-
paginationPageSize:
|
|
1272
|
-
paginationPageSizeSelector:
|
|
1273
|
-
paginationNumberFormatter: (
|
|
1274
|
-
animateRows: !
|
|
1275
|
+
pagination: Tt,
|
|
1276
|
+
paginationPageSize: l,
|
|
1277
|
+
paginationPageSizeSelector: f,
|
|
1278
|
+
paginationNumberFormatter: (y) => new Intl.NumberFormat(L.language).format(y.value),
|
|
1279
|
+
animateRows: !ot,
|
|
1275
1280
|
enableRtl: rt,
|
|
1276
1281
|
ensureDomOrder: !0,
|
|
1277
1282
|
enableCellSpan: !0,
|
|
@@ -1291,42 +1296,42 @@ function pa(t, e) {
|
|
|
1291
1296
|
suppressCellFocus: !1,
|
|
1292
1297
|
rowBuffer: 10,
|
|
1293
1298
|
localeText: nt,
|
|
1294
|
-
noRowsOverlayComponent:
|
|
1295
|
-
loadingOverlayComponent:
|
|
1296
|
-
getRowClass:
|
|
1297
|
-
pinnedBottomRowData:
|
|
1298
|
-
domLayout:
|
|
1299
|
+
noRowsOverlayComponent: mt,
|
|
1300
|
+
loadingOverlayComponent: gt,
|
|
1301
|
+
getRowClass: b,
|
|
1302
|
+
pinnedBottomRowData: h,
|
|
1303
|
+
domLayout: N ? "autoHeight" : void 0,
|
|
1299
1304
|
onGridReady: ct,
|
|
1300
1305
|
onColumnMoved: ie,
|
|
1301
1306
|
onColumnResized: ie,
|
|
1302
1307
|
onColumnPinned: ie,
|
|
1303
|
-
onSortChanged:
|
|
1304
|
-
onFilterChanged:
|
|
1305
|
-
onSelectionChanged:
|
|
1306
|
-
...
|
|
1308
|
+
onSortChanged: ft,
|
|
1309
|
+
onFilterChanged: pt,
|
|
1310
|
+
onSelectionChanged: ut,
|
|
1311
|
+
...dt
|
|
1307
1312
|
}
|
|
1308
1313
|
)
|
|
1309
1314
|
}
|
|
1310
1315
|
),
|
|
1311
|
-
!
|
|
1316
|
+
!N && /* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: q > 0 ? /* @__PURE__ */ s("span", { children: I("dataTable.selected", { count: q }) }) : /* @__PURE__ */ s("span", {}) }),
|
|
1312
1317
|
/* @__PURE__ */ s("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: se })
|
|
1313
1318
|
]
|
|
1314
1319
|
}
|
|
1315
1320
|
);
|
|
1316
1321
|
}
|
|
1317
|
-
const tt =
|
|
1322
|
+
const tt = _(ma);
|
|
1318
1323
|
tt.displayName = "DataTable";
|
|
1319
|
-
const
|
|
1324
|
+
const wn = Object.assign(tt, {
|
|
1320
1325
|
Toolbar: ae
|
|
1321
1326
|
});
|
|
1322
|
-
function
|
|
1327
|
+
function Fn(t, e, a) {
|
|
1323
1328
|
return z(() => {
|
|
1324
1329
|
const n = {};
|
|
1325
1330
|
for (const r of e) {
|
|
1326
1331
|
let o = 0;
|
|
1327
|
-
for (const
|
|
1328
|
-
const
|
|
1329
|
-
Number.isFinite(
|
|
1332
|
+
for (const l of t ?? []) {
|
|
1333
|
+
const f = l[r], i = typeof f == "number" ? f : Number(f);
|
|
1334
|
+
Number.isFinite(i) && (o += i);
|
|
1330
1335
|
}
|
|
1331
1336
|
n[r] = o;
|
|
1332
1337
|
}
|
|
@@ -1336,118 +1341,131 @@ function wn(t, e, a) {
|
|
|
1336
1341
|
function re(t) {
|
|
1337
1342
|
return t ? t.toISOString().slice(0, 10) : null;
|
|
1338
1343
|
}
|
|
1339
|
-
function
|
|
1344
|
+
function $(t) {
|
|
1340
1345
|
if (!t) return;
|
|
1341
1346
|
const e = new Date(t);
|
|
1342
1347
|
return Number.isNaN(e.getTime()) ? void 0 : e;
|
|
1343
1348
|
}
|
|
1344
|
-
function
|
|
1345
|
-
const { model: e, onModelChange: a, getValue: n, doesRowPassOtherFilter: r } = t, o = {
|
|
1346
|
-
from:
|
|
1347
|
-
to:
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1349
|
+
function Rn(t) {
|
|
1350
|
+
const { model: e, onModelChange: a, getValue: n, doesRowPassOtherFilter: r } = t, [o, l] = R(() => ({
|
|
1351
|
+
from: $(e == null ? void 0 : e.dateFrom),
|
|
1352
|
+
to: $(e == null ? void 0 : e.dateTo)
|
|
1353
|
+
}));
|
|
1354
|
+
A(() => {
|
|
1355
|
+
l({
|
|
1356
|
+
from: $(e == null ? void 0 : e.dateFrom),
|
|
1357
|
+
to: $(e == null ? void 0 : e.dateTo)
|
|
1358
|
+
});
|
|
1359
|
+
}, [e == null ? void 0 : e.dateFrom, e == null ? void 0 : e.dateTo]), Y({
|
|
1360
|
+
doesFilterPass: (i) => {
|
|
1361
|
+
const d = $(e == null ? void 0 : e.dateFrom), c = $(e == null ? void 0 : e.dateTo);
|
|
1362
|
+
if (!d && !c) return !0;
|
|
1363
|
+
const u = n(i.node);
|
|
1364
|
+
if (!u) return !1;
|
|
1365
|
+
const v = u instanceof Date ? u : $(String(u));
|
|
1366
|
+
return !(!v || d && v < d || c && v > c);
|
|
1355
1367
|
}
|
|
1356
1368
|
});
|
|
1357
|
-
function
|
|
1358
|
-
if (
|
|
1369
|
+
function f(i) {
|
|
1370
|
+
if (l(i), !i.from && !i.to) {
|
|
1359
1371
|
a(null);
|
|
1360
1372
|
return;
|
|
1361
1373
|
}
|
|
1362
1374
|
a({
|
|
1363
1375
|
type: "inRange",
|
|
1364
|
-
dateFrom: re(
|
|
1365
|
-
dateTo: re(
|
|
1376
|
+
dateFrom: re(i.from),
|
|
1377
|
+
dateTo: re(i.to)
|
|
1366
1378
|
});
|
|
1367
1379
|
}
|
|
1368
|
-
return /* @__PURE__ */ s("div", { className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]", children: /* @__PURE__ */ s(ze, { value:
|
|
1380
|
+
return /* @__PURE__ */ s("div", { className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]", children: /* @__PURE__ */ s(ze, { value: o, onChange: f, size: "sm" }) });
|
|
1369
1381
|
}
|
|
1370
|
-
function
|
|
1371
|
-
var
|
|
1372
|
-
const { model: e, onModelChange: a, column: n } = t, r = ((
|
|
1373
|
-
from:
|
|
1374
|
-
to:
|
|
1375
|
-
});
|
|
1376
|
-
|
|
1377
|
-
|
|
1382
|
+
function Dn(t) {
|
|
1383
|
+
var i, d;
|
|
1384
|
+
const { model: e, onModelChange: a, column: n } = t, r = ((d = (i = n == null ? void 0 : n.getColDef) == null ? void 0 : i.call(n)) == null ? void 0 : d.filterParams) ?? {}, [o, l] = R(() => ({
|
|
1385
|
+
from: $(e == null ? void 0 : e.dateFrom),
|
|
1386
|
+
to: $(e == null ? void 0 : e.dateTo)
|
|
1387
|
+
}));
|
|
1388
|
+
A(() => {
|
|
1389
|
+
l({
|
|
1390
|
+
from: $(e == null ? void 0 : e.dateFrom),
|
|
1391
|
+
to: $(e == null ? void 0 : e.dateTo)
|
|
1392
|
+
});
|
|
1393
|
+
}, [e == null ? void 0 : e.dateFrom, e == null ? void 0 : e.dateTo]);
|
|
1394
|
+
function f(c) {
|
|
1395
|
+
if (l(c), !c.from && !c.to) {
|
|
1378
1396
|
a(null);
|
|
1379
1397
|
return;
|
|
1380
1398
|
}
|
|
1381
1399
|
a({
|
|
1382
1400
|
type: "inRange",
|
|
1383
|
-
dateFrom: re(
|
|
1384
|
-
dateTo: re(
|
|
1401
|
+
dateFrom: re(c.from),
|
|
1402
|
+
dateTo: re(c.to)
|
|
1385
1403
|
});
|
|
1386
1404
|
}
|
|
1387
1405
|
return /* @__PURE__ */ s("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
|
|
1388
1406
|
ze,
|
|
1389
1407
|
{
|
|
1390
1408
|
value: o,
|
|
1391
|
-
onChange:
|
|
1409
|
+
onChange: f,
|
|
1392
1410
|
size: "sm",
|
|
1393
1411
|
placeholder: r.placeholder
|
|
1394
1412
|
}
|
|
1395
1413
|
) });
|
|
1396
1414
|
}
|
|
1397
|
-
function
|
|
1415
|
+
function H(t) {
|
|
1398
1416
|
return typeof t == "number" ? `n:${t}` : `s:${t}`;
|
|
1399
1417
|
}
|
|
1400
|
-
function
|
|
1401
|
-
const { model: e, onModelChange: a, getValue: n, api: r, column: o, options:
|
|
1402
|
-
if (
|
|
1418
|
+
function kn(t) {
|
|
1419
|
+
const { model: e, onModelChange: a, getValue: n, api: r, column: o, options: l, placeholder: f } = t, { t: i } = F("ui"), d = z(() => {
|
|
1420
|
+
if (l && l.length > 0) return l;
|
|
1403
1421
|
if (!r || !o) return [];
|
|
1404
1422
|
const p = /* @__PURE__ */ new Map();
|
|
1405
|
-
return r.forEachNode((
|
|
1406
|
-
const
|
|
1407
|
-
if (
|
|
1408
|
-
const
|
|
1409
|
-
p.has(
|
|
1423
|
+
return r.forEachNode((m) => {
|
|
1424
|
+
const b = n(m);
|
|
1425
|
+
if (b == null) return;
|
|
1426
|
+
const h = typeof b == "string" || typeof b == "number" ? b : String(b), N = H(h);
|
|
1427
|
+
p.has(N) || p.set(N, { value: h, label: String(h) });
|
|
1410
1428
|
}), Array.from(p.values()).sort(
|
|
1411
|
-
(
|
|
1429
|
+
(m, b) => String(m.label).localeCompare(String(b.label))
|
|
1412
1430
|
);
|
|
1413
|
-
}, [
|
|
1414
|
-
const p = /* @__PURE__ */ new Set(),
|
|
1415
|
-
for (const
|
|
1431
|
+
}, [l, r, o, n]), c = z(() => {
|
|
1432
|
+
const p = /* @__PURE__ */ new Set(), m = (e == null ? void 0 : e.values) ?? [];
|
|
1433
|
+
for (const b of m) p.add(H(b));
|
|
1416
1434
|
return p;
|
|
1417
|
-
}, [e]), [
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}, [
|
|
1435
|
+
}, [e]), [u, v] = R(c);
|
|
1436
|
+
A(() => {
|
|
1437
|
+
v(c);
|
|
1438
|
+
}, [c]), Y({
|
|
1421
1439
|
doesFilterPass: (p) => {
|
|
1422
|
-
const
|
|
1423
|
-
if (!
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
const
|
|
1427
|
-
return
|
|
1440
|
+
const m = e == null ? void 0 : e.values;
|
|
1441
|
+
if (!m || m.length === 0) return !0;
|
|
1442
|
+
const b = n(p.node);
|
|
1443
|
+
if (b == null) return !1;
|
|
1444
|
+
const h = typeof b == "string" || typeof b == "number" ? b : String(b), N = H(h);
|
|
1445
|
+
return m.some((E) => H(E) === N);
|
|
1428
1446
|
}
|
|
1429
1447
|
});
|
|
1430
|
-
function
|
|
1431
|
-
|
|
1432
|
-
const
|
|
1433
|
-
return
|
|
1448
|
+
function g(p) {
|
|
1449
|
+
v((m) => {
|
|
1450
|
+
const b = new Set(m);
|
|
1451
|
+
return b.has(p) ? b.delete(p) : b.add(p), b;
|
|
1434
1452
|
});
|
|
1435
1453
|
}
|
|
1436
|
-
function
|
|
1437
|
-
if (
|
|
1454
|
+
function C() {
|
|
1455
|
+
if (u.size === 0) {
|
|
1438
1456
|
a(null);
|
|
1439
1457
|
return;
|
|
1440
1458
|
}
|
|
1441
1459
|
const p = [];
|
|
1442
|
-
for (const
|
|
1443
|
-
|
|
1460
|
+
for (const m of d)
|
|
1461
|
+
u.has(H(m.value)) && p.push(m.value);
|
|
1444
1462
|
a({ type: "set", values: p });
|
|
1445
1463
|
}
|
|
1446
1464
|
function T() {
|
|
1447
|
-
|
|
1465
|
+
v(/* @__PURE__ */ new Set()), a(null);
|
|
1448
1466
|
}
|
|
1449
|
-
const
|
|
1450
|
-
return /* @__PURE__ */
|
|
1467
|
+
const x = f ?? i("dataTable.selectFilter.all");
|
|
1468
|
+
return /* @__PURE__ */ k(
|
|
1451
1469
|
"div",
|
|
1452
1470
|
{
|
|
1453
1471
|
"data-component": "select-filter",
|
|
@@ -1457,126 +1475,126 @@ function Dn(t) {
|
|
|
1457
1475
|
"div",
|
|
1458
1476
|
{
|
|
1459
1477
|
role: "group",
|
|
1460
|
-
"aria-label":
|
|
1478
|
+
"aria-label": x,
|
|
1461
1479
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:max-h-[240px] ds:overflow-y-auto",
|
|
1462
|
-
children:
|
|
1463
|
-
const
|
|
1480
|
+
children: d.length === 0 ? /* @__PURE__ */ s("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: i("dataTable.agGrid.noRowsToShow") }) : d.map((p) => {
|
|
1481
|
+
const m = H(p.value);
|
|
1464
1482
|
return /* @__PURE__ */ s(
|
|
1465
1483
|
De,
|
|
1466
1484
|
{
|
|
1467
1485
|
size: "sm",
|
|
1468
1486
|
label: p.label,
|
|
1469
|
-
checked:
|
|
1470
|
-
onCheckedChange: () =>
|
|
1487
|
+
checked: u.has(m),
|
|
1488
|
+
onCheckedChange: () => g(m)
|
|
1471
1489
|
},
|
|
1472
|
-
|
|
1490
|
+
m
|
|
1473
1491
|
);
|
|
1474
1492
|
})
|
|
1475
1493
|
}
|
|
1476
1494
|
),
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */ s(
|
|
1479
|
-
/* @__PURE__ */ s(
|
|
1495
|
+
/* @__PURE__ */ k("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: [
|
|
1496
|
+
/* @__PURE__ */ s(G, { intent: "ghost", size: "sm", onClick: T, type: "button", children: i("dataTable.selectFilter.clear") }),
|
|
1497
|
+
/* @__PURE__ */ s(G, { intent: "primary", size: "sm", onClick: C, type: "button", children: i("dataTable.selectFilter.apply") })
|
|
1480
1498
|
] })
|
|
1481
1499
|
]
|
|
1482
1500
|
}
|
|
1483
1501
|
);
|
|
1484
1502
|
}
|
|
1485
|
-
function
|
|
1486
|
-
var
|
|
1487
|
-
const { model: e, onModelChange: a, column: n } = t, r = (
|
|
1488
|
-
const
|
|
1489
|
-
for (const
|
|
1490
|
-
return
|
|
1491
|
-
}, [
|
|
1492
|
-
() =>
|
|
1493
|
-
value: String(
|
|
1494
|
-
label:
|
|
1503
|
+
function In(t) {
|
|
1504
|
+
var v;
|
|
1505
|
+
const { model: e, onModelChange: a, column: n } = t, r = (v = n == null ? void 0 : n.getColDef) == null ? void 0 : v.call(n), o = (r == null ? void 0 : r.filterParams) ?? {}, l = o.options ?? [], f = o.placeholder ?? (typeof (r == null ? void 0 : r.headerName) == "string" ? r.headerName : void 0), i = z(() => {
|
|
1506
|
+
const g = /* @__PURE__ */ new Map();
|
|
1507
|
+
for (const C of l) g.set(String(C.value), C.value);
|
|
1508
|
+
return g;
|
|
1509
|
+
}, [l]), d = z(
|
|
1510
|
+
() => l.map((g) => ({
|
|
1511
|
+
value: String(g.value),
|
|
1512
|
+
label: g.label
|
|
1495
1513
|
})),
|
|
1496
|
-
[
|
|
1497
|
-
),
|
|
1498
|
-
() => ((e == null ? void 0 : e.values) ?? []).map((
|
|
1514
|
+
[l]
|
|
1515
|
+
), c = z(
|
|
1516
|
+
() => ((e == null ? void 0 : e.values) ?? []).map((g) => String(g)),
|
|
1499
1517
|
[e]
|
|
1500
1518
|
);
|
|
1501
|
-
function
|
|
1502
|
-
if (
|
|
1519
|
+
function u(g) {
|
|
1520
|
+
if (g.length === 0) {
|
|
1503
1521
|
a(null);
|
|
1504
1522
|
return;
|
|
1505
1523
|
}
|
|
1506
|
-
const
|
|
1507
|
-
for (const T of
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1524
|
+
const C = [];
|
|
1525
|
+
for (const T of g) {
|
|
1526
|
+
const x = i.get(T);
|
|
1527
|
+
x !== void 0 && C.push(x);
|
|
1510
1528
|
}
|
|
1511
|
-
a({ type: "set", values:
|
|
1529
|
+
a({ type: "set", values: C });
|
|
1512
1530
|
}
|
|
1513
1531
|
return /* @__PURE__ */ s("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
|
|
1514
|
-
|
|
1532
|
+
jt,
|
|
1515
1533
|
{
|
|
1516
1534
|
size: "sm",
|
|
1517
|
-
options:
|
|
1518
|
-
value:
|
|
1519
|
-
onChange:
|
|
1535
|
+
options: d,
|
|
1536
|
+
value: c,
|
|
1537
|
+
onChange: u,
|
|
1520
1538
|
placeholder: o.placeholder,
|
|
1521
|
-
"aria-label":
|
|
1539
|
+
"aria-label": f,
|
|
1522
1540
|
allowClear: !0
|
|
1523
1541
|
}
|
|
1524
1542
|
) });
|
|
1525
1543
|
}
|
|
1526
|
-
function
|
|
1544
|
+
function X(t) {
|
|
1527
1545
|
return t.trim().toLocaleLowerCase();
|
|
1528
1546
|
}
|
|
1529
|
-
function
|
|
1547
|
+
function En(t) {
|
|
1530
1548
|
const {
|
|
1531
1549
|
model: e,
|
|
1532
1550
|
onModelChange: a,
|
|
1533
1551
|
getValue: n,
|
|
1534
1552
|
api: r,
|
|
1535
1553
|
column: o,
|
|
1536
|
-
options:
|
|
1537
|
-
loadOptions:
|
|
1538
|
-
placeholder:
|
|
1539
|
-
} = t, { t:
|
|
1540
|
-
if (
|
|
1554
|
+
options: l,
|
|
1555
|
+
loadOptions: f,
|
|
1556
|
+
placeholder: i
|
|
1557
|
+
} = t, { t: d } = F("ui"), c = z(() => {
|
|
1558
|
+
if (l && l.length > 0) return l;
|
|
1541
1559
|
if (!r || !o) return [];
|
|
1542
|
-
const
|
|
1543
|
-
return r.forEachNode((
|
|
1544
|
-
const
|
|
1545
|
-
if (
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1548
|
-
}), Array.from(
|
|
1549
|
-
(
|
|
1560
|
+
const m = /* @__PURE__ */ new Map();
|
|
1561
|
+
return r.forEachNode((b) => {
|
|
1562
|
+
const h = n(b);
|
|
1563
|
+
if (h == null) return;
|
|
1564
|
+
const N = typeof h == "string" ? h : String(h);
|
|
1565
|
+
m.has(N) || m.set(N, { value: N, label: N });
|
|
1566
|
+
}), Array.from(m.values()).sort(
|
|
1567
|
+
(b, h) => b.label.localeCompare(h.label)
|
|
1550
1568
|
);
|
|
1551
|
-
}, [
|
|
1552
|
-
if (
|
|
1553
|
-
return (await
|
|
1554
|
-
const
|
|
1555
|
-
return (
|
|
1556
|
-
}, [
|
|
1557
|
-
|
|
1558
|
-
|
|
1569
|
+
}, [l, r, o, n]), u = z(() => async (m, b) => {
|
|
1570
|
+
if (f)
|
|
1571
|
+
return (await f(m, b)).map((I) => ({ value: I.value, label: I.label }));
|
|
1572
|
+
const h = X(m);
|
|
1573
|
+
return (h ? c.filter((E) => X(E.label).includes(h)) : c).slice(0, 50).map((E) => ({ value: E.value, label: E.label }));
|
|
1574
|
+
}, [f, c]), [v, g] = R((e == null ? void 0 : e.value) ?? "");
|
|
1575
|
+
A(() => {
|
|
1576
|
+
g((e == null ? void 0 : e.value) ?? "");
|
|
1559
1577
|
}, [e == null ? void 0 : e.value]), Y({
|
|
1560
|
-
doesFilterPass: (
|
|
1561
|
-
const
|
|
1562
|
-
if (!
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1565
|
-
const
|
|
1566
|
-
return
|
|
1578
|
+
doesFilterPass: (m) => {
|
|
1579
|
+
const b = e == null ? void 0 : e.value;
|
|
1580
|
+
if (!b) return !0;
|
|
1581
|
+
const h = n(m.node);
|
|
1582
|
+
if (h == null) return !1;
|
|
1583
|
+
const N = typeof h == "string" ? h : String(h);
|
|
1584
|
+
return X(N) === X(b);
|
|
1567
1585
|
}
|
|
1568
1586
|
});
|
|
1569
|
-
function
|
|
1570
|
-
|
|
1587
|
+
function C(m) {
|
|
1588
|
+
g(m.label), a({ type: "equals", value: m.value });
|
|
1571
1589
|
}
|
|
1572
|
-
function T(
|
|
1573
|
-
|
|
1590
|
+
function T(m) {
|
|
1591
|
+
g(m), m === "" && e && a(null);
|
|
1574
1592
|
}
|
|
1575
|
-
function
|
|
1576
|
-
|
|
1593
|
+
function x() {
|
|
1594
|
+
g(""), a(null);
|
|
1577
1595
|
}
|
|
1578
|
-
const p =
|
|
1579
|
-
return /* @__PURE__ */
|
|
1596
|
+
const p = i ?? d("dataTable.typeaheadFilter.placeholder");
|
|
1597
|
+
return /* @__PURE__ */ k(
|
|
1580
1598
|
"div",
|
|
1581
1599
|
{
|
|
1582
1600
|
"data-component": "typeahead-filter",
|
|
@@ -1586,50 +1604,50 @@ function In(t) {
|
|
|
1586
1604
|
Ae,
|
|
1587
1605
|
{
|
|
1588
1606
|
size: "sm",
|
|
1589
|
-
value:
|
|
1607
|
+
value: v,
|
|
1590
1608
|
onChange: T,
|
|
1591
|
-
onSelect:
|
|
1592
|
-
loadOptions:
|
|
1609
|
+
onSelect: C,
|
|
1610
|
+
loadOptions: u,
|
|
1593
1611
|
placeholder: p,
|
|
1594
1612
|
"aria-label": p
|
|
1595
1613
|
}
|
|
1596
1614
|
),
|
|
1597
|
-
/* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ s(
|
|
1615
|
+
/* @__PURE__ */ s("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ s(G, { intent: "ghost", size: "sm", onClick: x, type: "button", children: d("dataTable.typeaheadFilter.clear") }) })
|
|
1598
1616
|
]
|
|
1599
1617
|
}
|
|
1600
1618
|
);
|
|
1601
1619
|
}
|
|
1602
|
-
function
|
|
1603
|
-
var
|
|
1604
|
-
const { model: e, onModelChange: a, column: n } = t, { t: r } =
|
|
1605
|
-
if (
|
|
1606
|
-
return (await
|
|
1607
|
-
const
|
|
1608
|
-
return (
|
|
1609
|
-
}, [
|
|
1610
|
-
|
|
1611
|
-
|
|
1620
|
+
function zn(t) {
|
|
1621
|
+
var C, T;
|
|
1622
|
+
const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), o = ((T = (C = n == null ? void 0 : n.getColDef) == null ? void 0 : C.call(n)) == null ? void 0 : T.filterParams) ?? {}, l = o.options ?? [], f = o.loadOptions, i = o.placeholder ?? r("dataTable.typeaheadFilter.placeholder"), d = z(() => async (x, p) => {
|
|
1623
|
+
if (f)
|
|
1624
|
+
return (await f(x, p)).map((N) => ({ value: N.value, label: N.label }));
|
|
1625
|
+
const m = X(x);
|
|
1626
|
+
return (m ? l.filter((h) => X(h.label).includes(m)) : l).slice(0, 50).map((h) => ({ value: h.value, label: h.label }));
|
|
1627
|
+
}, [f, l]), [c, u] = R((e == null ? void 0 : e.value) ?? "");
|
|
1628
|
+
A(() => {
|
|
1629
|
+
u((e == null ? void 0 : e.value) ?? "");
|
|
1612
1630
|
}, [e == null ? void 0 : e.value]);
|
|
1613
|
-
function
|
|
1614
|
-
|
|
1631
|
+
function v(x) {
|
|
1632
|
+
u(x.label), a({ type: "equals", value: x.value });
|
|
1615
1633
|
}
|
|
1616
|
-
function
|
|
1617
|
-
|
|
1634
|
+
function g(x) {
|
|
1635
|
+
u(x), x === "" && e && a(null);
|
|
1618
1636
|
}
|
|
1619
1637
|
return /* @__PURE__ */ s("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
|
|
1620
1638
|
Ae,
|
|
1621
1639
|
{
|
|
1622
1640
|
size: "sm",
|
|
1623
|
-
value:
|
|
1624
|
-
onChange:
|
|
1625
|
-
onSelect:
|
|
1626
|
-
loadOptions:
|
|
1627
|
-
placeholder:
|
|
1628
|
-
"aria-label":
|
|
1641
|
+
value: c,
|
|
1642
|
+
onChange: g,
|
|
1643
|
+
onSelect: v,
|
|
1644
|
+
loadOptions: d,
|
|
1645
|
+
placeholder: i,
|
|
1646
|
+
"aria-label": i
|
|
1629
1647
|
}
|
|
1630
1648
|
) });
|
|
1631
1649
|
}
|
|
1632
|
-
const
|
|
1650
|
+
const ga = [
|
|
1633
1651
|
"equals",
|
|
1634
1652
|
"notEqual",
|
|
1635
1653
|
"greaterThan",
|
|
@@ -1646,7 +1664,7 @@ function ye(t) {
|
|
|
1646
1664
|
function Te(t) {
|
|
1647
1665
|
return t === "inRange";
|
|
1648
1666
|
}
|
|
1649
|
-
function
|
|
1667
|
+
function ba(t, e, a, n) {
|
|
1650
1668
|
if (t === "blank") return e === null;
|
|
1651
1669
|
if (t === "notBlank") return e !== null;
|
|
1652
1670
|
if (e === null) return !1;
|
|
@@ -1673,73 +1691,73 @@ function ga(t, e, a, n) {
|
|
|
1673
1691
|
return !0;
|
|
1674
1692
|
}
|
|
1675
1693
|
}
|
|
1676
|
-
function
|
|
1694
|
+
function ha(t) {
|
|
1677
1695
|
if (t == null || t === "") return null;
|
|
1678
1696
|
const e = typeof t == "number" ? t : Number(t);
|
|
1679
1697
|
return Number.isNaN(e) ? null : e;
|
|
1680
1698
|
}
|
|
1681
|
-
function
|
|
1699
|
+
function An(t) {
|
|
1682
1700
|
const {
|
|
1683
1701
|
model: e,
|
|
1684
1702
|
onModelChange: a,
|
|
1685
1703
|
getValue: n,
|
|
1686
1704
|
defaultOperator: r,
|
|
1687
1705
|
min: o,
|
|
1688
|
-
max:
|
|
1689
|
-
step:
|
|
1690
|
-
placeholder:
|
|
1691
|
-
} = t, { t:
|
|
1706
|
+
max: l,
|
|
1707
|
+
step: f,
|
|
1708
|
+
placeholder: i
|
|
1709
|
+
} = t, { t: d } = F("ui"), c = (e == null ? void 0 : e.type) ?? r ?? "equals", [u, v] = R(c), [g, C] = R((e == null ? void 0 : e.filter) ?? null), [T, x] = R(
|
|
1692
1710
|
(e == null ? void 0 : e.filterTo) ?? null
|
|
1693
1711
|
);
|
|
1694
|
-
|
|
1712
|
+
A(() => {
|
|
1695
1713
|
if (e === null) {
|
|
1696
|
-
|
|
1714
|
+
v(r ?? "equals"), C(null), x(null);
|
|
1697
1715
|
return;
|
|
1698
1716
|
}
|
|
1699
|
-
|
|
1717
|
+
v(e.type), C(e.filter ?? null), x(e.filterTo ?? null);
|
|
1700
1718
|
}, [e, r]), Y({
|
|
1701
|
-
doesFilterPass: (
|
|
1719
|
+
doesFilterPass: (I) => {
|
|
1702
1720
|
if (!e) return !0;
|
|
1703
|
-
const
|
|
1704
|
-
return
|
|
1721
|
+
const L = ha(n(I.node));
|
|
1722
|
+
return ba(
|
|
1705
1723
|
e.type,
|
|
1706
|
-
|
|
1724
|
+
L,
|
|
1707
1725
|
e.filter ?? null,
|
|
1708
1726
|
e.filterTo ?? null
|
|
1709
1727
|
);
|
|
1710
1728
|
}
|
|
1711
1729
|
});
|
|
1712
1730
|
const p = z(
|
|
1713
|
-
() =>
|
|
1714
|
-
value:
|
|
1715
|
-
label:
|
|
1731
|
+
() => ga.map((I) => ({
|
|
1732
|
+
value: I,
|
|
1733
|
+
label: d(`dataTable.numberFilter.operators.${I}`)
|
|
1716
1734
|
})),
|
|
1717
|
-
[
|
|
1718
|
-
),
|
|
1719
|
-
function
|
|
1720
|
-
if (!ye(
|
|
1721
|
-
a({ type:
|
|
1735
|
+
[d]
|
|
1736
|
+
), m = i ?? d("dataTable.numberFilter.placeholder");
|
|
1737
|
+
function b() {
|
|
1738
|
+
if (!ye(u)) {
|
|
1739
|
+
a({ type: u, filter: 0 });
|
|
1722
1740
|
return;
|
|
1723
1741
|
}
|
|
1724
|
-
if (
|
|
1742
|
+
if (g === null) {
|
|
1725
1743
|
a(null);
|
|
1726
1744
|
return;
|
|
1727
1745
|
}
|
|
1728
|
-
if (Te(
|
|
1746
|
+
if (Te(u)) {
|
|
1729
1747
|
a({
|
|
1730
|
-
type:
|
|
1731
|
-
filter:
|
|
1748
|
+
type: u,
|
|
1749
|
+
filter: g,
|
|
1732
1750
|
filterTo: T ?? void 0
|
|
1733
1751
|
});
|
|
1734
1752
|
return;
|
|
1735
1753
|
}
|
|
1736
|
-
a({ type:
|
|
1754
|
+
a({ type: u, filter: g });
|
|
1737
1755
|
}
|
|
1738
|
-
function
|
|
1739
|
-
|
|
1756
|
+
function h() {
|
|
1757
|
+
v(r ?? "equals"), C(null), x(null), a(null);
|
|
1740
1758
|
}
|
|
1741
|
-
const
|
|
1742
|
-
return /* @__PURE__ */
|
|
1759
|
+
const N = ye(u), E = Te(u);
|
|
1760
|
+
return /* @__PURE__ */ k(
|
|
1743
1761
|
"div",
|
|
1744
1762
|
{
|
|
1745
1763
|
"data-component": "number-filter",
|
|
@@ -1750,38 +1768,38 @@ function zn(t) {
|
|
|
1750
1768
|
{
|
|
1751
1769
|
size: "sm",
|
|
1752
1770
|
options: p,
|
|
1753
|
-
value:
|
|
1754
|
-
onValueChange: (
|
|
1755
|
-
|
|
1771
|
+
value: u,
|
|
1772
|
+
onValueChange: (I) => {
|
|
1773
|
+
I !== "" && v(I);
|
|
1756
1774
|
},
|
|
1757
|
-
"aria-label":
|
|
1775
|
+
"aria-label": d("dataTable.numberFilter.operators.equals")
|
|
1758
1776
|
}
|
|
1759
1777
|
),
|
|
1760
|
-
|
|
1778
|
+
N && !E && /* @__PURE__ */ s(
|
|
1761
1779
|
te,
|
|
1762
1780
|
{
|
|
1763
1781
|
size: "sm",
|
|
1764
|
-
value:
|
|
1765
|
-
onChange:
|
|
1782
|
+
value: g,
|
|
1783
|
+
onChange: C,
|
|
1766
1784
|
min: o,
|
|
1767
|
-
max:
|
|
1768
|
-
step:
|
|
1769
|
-
placeholder:
|
|
1770
|
-
"aria-label":
|
|
1785
|
+
max: l,
|
|
1786
|
+
step: f,
|
|
1787
|
+
placeholder: m,
|
|
1788
|
+
"aria-label": m
|
|
1771
1789
|
}
|
|
1772
1790
|
),
|
|
1773
|
-
E && /* @__PURE__ */
|
|
1791
|
+
E && /* @__PURE__ */ k("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
1774
1792
|
/* @__PURE__ */ s(
|
|
1775
1793
|
te,
|
|
1776
1794
|
{
|
|
1777
1795
|
size: "sm",
|
|
1778
|
-
value:
|
|
1779
|
-
onChange:
|
|
1796
|
+
value: g,
|
|
1797
|
+
onChange: C,
|
|
1780
1798
|
min: o,
|
|
1781
|
-
max:
|
|
1782
|
-
step:
|
|
1783
|
-
placeholder:
|
|
1784
|
-
"aria-label":
|
|
1799
|
+
max: l,
|
|
1800
|
+
step: f,
|
|
1801
|
+
placeholder: d("dataTable.numberFilter.from"),
|
|
1802
|
+
"aria-label": d("dataTable.numberFilter.from")
|
|
1785
1803
|
}
|
|
1786
1804
|
),
|
|
1787
1805
|
/* @__PURE__ */ s(
|
|
@@ -1789,68 +1807,68 @@ function zn(t) {
|
|
|
1789
1807
|
{
|
|
1790
1808
|
size: "sm",
|
|
1791
1809
|
value: T,
|
|
1792
|
-
onChange:
|
|
1810
|
+
onChange: x,
|
|
1793
1811
|
min: o,
|
|
1794
|
-
max:
|
|
1795
|
-
step:
|
|
1796
|
-
placeholder:
|
|
1797
|
-
"aria-label":
|
|
1812
|
+
max: l,
|
|
1813
|
+
step: f,
|
|
1814
|
+
placeholder: d("dataTable.numberFilter.to"),
|
|
1815
|
+
"aria-label": d("dataTable.numberFilter.to")
|
|
1798
1816
|
}
|
|
1799
1817
|
)
|
|
1800
1818
|
] }),
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
/* @__PURE__ */ s(
|
|
1803
|
-
/* @__PURE__ */ s(
|
|
1819
|
+
/* @__PURE__ */ k("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: [
|
|
1820
|
+
/* @__PURE__ */ s(G, { intent: "ghost", size: "sm", onClick: h, type: "button", children: d("dataTable.numberFilter.clear") }),
|
|
1821
|
+
/* @__PURE__ */ s(G, { intent: "primary", size: "sm", onClick: b, type: "button", children: d("dataTable.numberFilter.apply") })
|
|
1804
1822
|
] })
|
|
1805
1823
|
]
|
|
1806
1824
|
}
|
|
1807
1825
|
);
|
|
1808
1826
|
}
|
|
1809
|
-
function
|
|
1810
|
-
var
|
|
1811
|
-
const { model: e, onModelChange: a, column: n } = t, { t: r } =
|
|
1812
|
-
return
|
|
1813
|
-
|
|
1814
|
-
}, [e == null ? void 0 : e.filter]),
|
|
1815
|
-
if (
|
|
1816
|
-
const
|
|
1817
|
-
if (
|
|
1827
|
+
function Pn(t) {
|
|
1828
|
+
var c, u;
|
|
1829
|
+
const { model: e, onModelChange: a, column: n } = t, { t: r } = F("ui"), o = ((u = (c = n == null ? void 0 : n.getColDef) == null ? void 0 : c.call(n)) == null ? void 0 : u.filterParams) ?? {}, l = o.defaultOperator ?? "equals", f = o.placeholder ?? r("dataTable.numberFilter.placeholder"), [i, d] = R((e == null ? void 0 : e.filter) ?? null);
|
|
1830
|
+
return A(() => {
|
|
1831
|
+
d((e == null ? void 0 : e.filter) ?? null);
|
|
1832
|
+
}, [e == null ? void 0 : e.filter]), A(() => {
|
|
1833
|
+
if (i === ((e == null ? void 0 : e.filter) ?? null)) return;
|
|
1834
|
+
const v = setTimeout(() => {
|
|
1835
|
+
if (i === null || Number.isNaN(i)) {
|
|
1818
1836
|
a(null);
|
|
1819
1837
|
return;
|
|
1820
1838
|
}
|
|
1821
|
-
a({ type:
|
|
1839
|
+
a({ type: l, filter: i });
|
|
1822
1840
|
}, 200);
|
|
1823
|
-
return () => clearTimeout(
|
|
1824
|
-
}, [
|
|
1841
|
+
return () => clearTimeout(v);
|
|
1842
|
+
}, [i, l]), /* @__PURE__ */ s("div", { "data-component": "number-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ s(
|
|
1825
1843
|
te,
|
|
1826
1844
|
{
|
|
1827
1845
|
size: "sm",
|
|
1828
|
-
value:
|
|
1829
|
-
onChange:
|
|
1846
|
+
value: i,
|
|
1847
|
+
onChange: d,
|
|
1830
1848
|
min: o.min,
|
|
1831
1849
|
max: o.max,
|
|
1832
1850
|
step: o.step,
|
|
1833
|
-
placeholder:
|
|
1834
|
-
"aria-label":
|
|
1851
|
+
placeholder: f,
|
|
1852
|
+
"aria-label": f
|
|
1835
1853
|
}
|
|
1836
1854
|
) });
|
|
1837
1855
|
}
|
|
1838
|
-
function
|
|
1856
|
+
function On(t) {
|
|
1839
1857
|
const { value: e, variantMap: a } = t, n = (a == null ? void 0 : a[e]) ?? "neutral";
|
|
1840
|
-
return /* @__PURE__ */ s(
|
|
1858
|
+
return /* @__PURE__ */ s(Lt, { variant: n, withDot: !0, size: "sm", children: String(e ?? "") });
|
|
1841
1859
|
}
|
|
1842
|
-
function
|
|
1860
|
+
function Mn(t) {
|
|
1843
1861
|
const { value: e } = t;
|
|
1844
|
-
return e ? /* @__PURE__ */
|
|
1862
|
+
return e ? /* @__PURE__ */ k("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
1845
1863
|
/* @__PURE__ */ s(Pe, { name: e.name, src: e.src, size: "sm" }),
|
|
1846
1864
|
/* @__PURE__ */ s("span", { children: e.name })
|
|
1847
1865
|
] }) : null;
|
|
1848
1866
|
}
|
|
1849
|
-
const
|
|
1867
|
+
const va = {
|
|
1850
1868
|
sm: "ds:size-8",
|
|
1851
1869
|
md: "ds:size-10",
|
|
1852
1870
|
lg: "ds:size-12"
|
|
1853
|
-
},
|
|
1871
|
+
}, ya = {
|
|
1854
1872
|
square: "ds:rounded-none",
|
|
1855
1873
|
rounded: "ds:rounded-[var(--radius-md)]",
|
|
1856
1874
|
circle: "ds:rounded-[var(--radius-full)]"
|
|
@@ -1860,44 +1878,44 @@ function ue(t, e) {
|
|
|
1860
1878
|
const a = t[e];
|
|
1861
1879
|
return typeof a == "string" ? a : void 0;
|
|
1862
1880
|
}
|
|
1863
|
-
const
|
|
1864
|
-
function
|
|
1881
|
+
const Ta = /^(?:https?:|data:image\/)/i;
|
|
1882
|
+
function Ca(t) {
|
|
1865
1883
|
if (!t) return;
|
|
1866
1884
|
const e = t.trim();
|
|
1867
1885
|
if (e.length !== 0)
|
|
1868
|
-
return
|
|
1886
|
+
return Ta.test(e) ? e : void 0;
|
|
1869
1887
|
}
|
|
1870
|
-
function
|
|
1888
|
+
function jn(t) {
|
|
1871
1889
|
const {
|
|
1872
1890
|
data: e,
|
|
1873
1891
|
srcField: a,
|
|
1874
1892
|
altField: n,
|
|
1875
1893
|
fallbackField: r,
|
|
1876
1894
|
size: o = "md",
|
|
1877
|
-
shape:
|
|
1895
|
+
shape: l = "rounded"
|
|
1878
1896
|
} = t;
|
|
1879
1897
|
if (!e) return null;
|
|
1880
|
-
const
|
|
1881
|
-
return
|
|
1898
|
+
const f = ue(e, a), i = Ca(f), d = n ? ue(e, n) ?? "" : "", c = r ? ue(e, r) : void 0;
|
|
1899
|
+
return i ? /* @__PURE__ */ s(
|
|
1882
1900
|
"img",
|
|
1883
1901
|
{
|
|
1884
|
-
src:
|
|
1885
|
-
alt:
|
|
1902
|
+
src: i,
|
|
1903
|
+
alt: d,
|
|
1886
1904
|
loading: "lazy",
|
|
1887
1905
|
decoding: "async",
|
|
1888
|
-
className: ["ds:object-cover",
|
|
1906
|
+
className: ["ds:object-cover", va[o], ya[l]].join(
|
|
1889
1907
|
" "
|
|
1890
1908
|
)
|
|
1891
1909
|
}
|
|
1892
|
-
) :
|
|
1910
|
+
) : c ? /* @__PURE__ */ s(Pe, { name: c, size: o }) : null;
|
|
1893
1911
|
}
|
|
1894
|
-
function
|
|
1895
|
-
const { value: e, maxVisible: a = 3 } = t, { t: n } =
|
|
1912
|
+
function Ln(t) {
|
|
1913
|
+
const { value: e, maxVisible: a = 3 } = t, { t: n } = F();
|
|
1896
1914
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
1897
1915
|
const r = e.slice(0, a), o = e.length - a;
|
|
1898
|
-
return /* @__PURE__ */
|
|
1899
|
-
r.map((
|
|
1900
|
-
o > 0 && /* @__PURE__ */ s(
|
|
1916
|
+
return /* @__PURE__ */ k("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
1917
|
+
r.map((l) => /* @__PURE__ */ s(J, { label: l, size: "sm" }, l)),
|
|
1918
|
+
o > 0 && /* @__PURE__ */ s(qt, { label: e.slice(a).join(", "), children: /* @__PURE__ */ s(
|
|
1901
1919
|
J,
|
|
1902
1920
|
{
|
|
1903
1921
|
label: n("inputs.multiSelect.overflow", { count: o }),
|
|
@@ -1908,7 +1926,7 @@ function jn(t) {
|
|
|
1908
1926
|
) })
|
|
1909
1927
|
] });
|
|
1910
1928
|
}
|
|
1911
|
-
function
|
|
1929
|
+
function xa() {
|
|
1912
1930
|
return /* @__PURE__ */ s(
|
|
1913
1931
|
"svg",
|
|
1914
1932
|
{
|
|
@@ -1924,7 +1942,7 @@ function Ca() {
|
|
|
1924
1942
|
}
|
|
1925
1943
|
);
|
|
1926
1944
|
}
|
|
1927
|
-
function
|
|
1945
|
+
function qn(t) {
|
|
1928
1946
|
const { value: e, maxInlineSize: a = "8rem" } = t;
|
|
1929
1947
|
return !Array.isArray(e) || e.length === 0 ? null : /* @__PURE__ */ s(
|
|
1930
1948
|
J,
|
|
@@ -1932,12 +1950,12 @@ function Ln(t) {
|
|
|
1932
1950
|
label: e.join(", "),
|
|
1933
1951
|
size: "sm",
|
|
1934
1952
|
fill: "outline",
|
|
1935
|
-
leading: /* @__PURE__ */ s(
|
|
1953
|
+
leading: /* @__PURE__ */ s(xa, {}),
|
|
1936
1954
|
maxInlineSize: a
|
|
1937
1955
|
}
|
|
1938
1956
|
);
|
|
1939
1957
|
}
|
|
1940
|
-
const
|
|
1958
|
+
const Na = {
|
|
1941
1959
|
date: { year: "numeric", month: "short", day: "numeric" },
|
|
1942
1960
|
time: { hour: "2-digit", minute: "2-digit" },
|
|
1943
1961
|
datetime: {
|
|
@@ -1948,7 +1966,7 @@ const xa = {
|
|
|
1948
1966
|
minute: "2-digit"
|
|
1949
1967
|
}
|
|
1950
1968
|
};
|
|
1951
|
-
function
|
|
1969
|
+
function $n(t) {
|
|
1952
1970
|
const { value: e, format: a = "date", options: n } = t;
|
|
1953
1971
|
return e == null || e === "" ? null : a === "relative" && !n ? /* @__PURE__ */ s(ve, { value: e, shape: "bare" }) : /* @__PURE__ */ s(
|
|
1954
1972
|
ve,
|
|
@@ -1956,30 +1974,30 @@ function qn(t) {
|
|
|
1956
1974
|
value: e,
|
|
1957
1975
|
format: "absolute",
|
|
1958
1976
|
shape: "bare",
|
|
1959
|
-
absoluteFormat: n ??
|
|
1977
|
+
absoluteFormat: n ?? Na[a === "relative" ? "date" : a]
|
|
1960
1978
|
}
|
|
1961
1979
|
);
|
|
1962
1980
|
}
|
|
1963
|
-
function
|
|
1981
|
+
function Sa(t) {
|
|
1964
1982
|
if (t == null || t === "") return null;
|
|
1965
1983
|
const e = typeof t == "number" ? t : Number(t);
|
|
1966
1984
|
return Number.isFinite(e) ? e : null;
|
|
1967
1985
|
}
|
|
1968
|
-
function
|
|
1986
|
+
function Gn(t) {
|
|
1969
1987
|
const {
|
|
1970
1988
|
value: e,
|
|
1971
1989
|
currency: a = "EUR",
|
|
1972
1990
|
colorNegative: n,
|
|
1973
1991
|
strikethrough: r,
|
|
1974
1992
|
options: o
|
|
1975
|
-
} = t, { i18n:
|
|
1976
|
-
if (
|
|
1977
|
-
const
|
|
1993
|
+
} = t, { i18n: l } = F(), f = Sa(e);
|
|
1994
|
+
if (f === null) return null;
|
|
1995
|
+
const i = l.language || "en", d = new Intl.NumberFormat(i, {
|
|
1978
1996
|
style: "currency",
|
|
1979
1997
|
currency: a,
|
|
1980
1998
|
...o
|
|
1981
|
-
}).format(
|
|
1982
|
-
return n &&
|
|
1999
|
+
}).format(f), c = ["ds:tabular-nums"];
|
|
2000
|
+
return n && f < 0 && c.push("ds:text-[color:var(--destructive)]"), r && c.push("line-through"), /* @__PURE__ */ s("span", { className: c.join(" "), children: d });
|
|
1983
2001
|
}
|
|
1984
2002
|
function Ce(t) {
|
|
1985
2003
|
if (!Fe(t)) return t;
|
|
@@ -1989,65 +2007,72 @@ function Ce(t) {
|
|
|
1989
2007
|
function fe(t, e) {
|
|
1990
2008
|
return typeof t == "function" ? t(e) : !!t;
|
|
1991
2009
|
}
|
|
1992
|
-
const
|
|
2010
|
+
const wa = "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]";
|
|
1993
2011
|
function _n(t) {
|
|
1994
|
-
const { data: e, actions: a, intent: n = "ghost", group: r, label: o, collapsed:
|
|
2012
|
+
const { data: e, actions: a, intent: n = "ghost", group: r, label: o, collapsed: l } = t, { t: f } = F();
|
|
1995
2013
|
if (!e) return null;
|
|
1996
|
-
const
|
|
1997
|
-
if (typeof
|
|
1998
|
-
return /* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */ s(
|
|
2000
|
-
|
|
2014
|
+
const i = a.filter((u) => !fe(u.hidden, e));
|
|
2015
|
+
if (typeof l == "function" ? l() : !!l)
|
|
2016
|
+
return /* @__PURE__ */ k(V.Root, { children: [
|
|
2017
|
+
/* @__PURE__ */ s(V.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
2018
|
+
U,
|
|
2001
2019
|
{
|
|
2002
2020
|
size: "sm",
|
|
2003
2021
|
intent: n,
|
|
2004
|
-
icon: /* @__PURE__ */ s(
|
|
2005
|
-
"aria-label": o ?? "Actions"
|
|
2022
|
+
icon: /* @__PURE__ */ s(Gt, { "aria-hidden": !0 }),
|
|
2023
|
+
"aria-label": o ?? f("dataTable.actions", "Actions")
|
|
2006
2024
|
}
|
|
2007
2025
|
) }),
|
|
2008
|
-
/* @__PURE__ */ s(
|
|
2009
|
-
|
|
2026
|
+
/* @__PURE__ */ s(V.Content, { align: "end", children: i.map((u, v) => /* @__PURE__ */ s(
|
|
2027
|
+
V.Item,
|
|
2010
2028
|
{
|
|
2011
|
-
startIcon: Ce(
|
|
2012
|
-
disabled: fe(
|
|
2013
|
-
onSelect: () =>
|
|
2014
|
-
className:
|
|
2015
|
-
children:
|
|
2029
|
+
startIcon: Ce(u.icon),
|
|
2030
|
+
disabled: fe(u.disabled, e),
|
|
2031
|
+
onSelect: () => u.onClick(e),
|
|
2032
|
+
className: u.variant === "destructive" ? "ds:text-[color:var(--destructive)]" : void 0,
|
|
2033
|
+
children: u.label
|
|
2016
2034
|
},
|
|
2017
|
-
|
|
2035
|
+
v
|
|
2018
2036
|
)) })
|
|
2019
2037
|
] });
|
|
2020
|
-
const c =
|
|
2021
|
-
const
|
|
2038
|
+
const c = i.map((u, v) => {
|
|
2039
|
+
const g = fe(u.disabled, e), C = g && u.disabledReason ? u.disabledReason : u.label;
|
|
2022
2040
|
return /* @__PURE__ */ s(
|
|
2023
|
-
|
|
2041
|
+
U,
|
|
2024
2042
|
{
|
|
2025
2043
|
size: "sm",
|
|
2026
2044
|
intent: n,
|
|
2027
|
-
icon: Ce(
|
|
2028
|
-
tooltip:
|
|
2029
|
-
"aria-label":
|
|
2030
|
-
disabled:
|
|
2031
|
-
onClick: (
|
|
2032
|
-
|
|
2045
|
+
icon: Ce(u.icon),
|
|
2046
|
+
tooltip: C,
|
|
2047
|
+
"aria-label": u.label,
|
|
2048
|
+
disabled: g,
|
|
2049
|
+
onClick: (T) => {
|
|
2050
|
+
T.stopPropagation(), u.onClick(e);
|
|
2033
2051
|
},
|
|
2034
|
-
className:
|
|
2052
|
+
className: u.variant === "destructive" ? wa : void 0
|
|
2035
2053
|
},
|
|
2036
|
-
|
|
2054
|
+
v
|
|
2037
2055
|
);
|
|
2038
2056
|
});
|
|
2039
|
-
return r ? /* @__PURE__ */ s(
|
|
2057
|
+
return r ? /* @__PURE__ */ s(
|
|
2058
|
+
$t,
|
|
2059
|
+
{
|
|
2060
|
+
"aria-label": o ?? f("dataTable.actions", "Actions"),
|
|
2061
|
+
size: "sm",
|
|
2062
|
+
children: c
|
|
2063
|
+
}
|
|
2064
|
+
) : /* @__PURE__ */ s("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: c });
|
|
2040
2065
|
}
|
|
2041
2066
|
function xe(t, e) {
|
|
2042
2067
|
return typeof t == "function" ? t(e) : t;
|
|
2043
2068
|
}
|
|
2044
|
-
function
|
|
2069
|
+
function Fa(t) {
|
|
2045
2070
|
return /^(https?:\/\/|\/|#|mailto:|tel:)/i.test(t) ? t : "#";
|
|
2046
2071
|
}
|
|
2047
2072
|
function Bn(t) {
|
|
2048
2073
|
const { value: e, data: a, href: n, onClick: r, secondary: o } = t;
|
|
2049
2074
|
if (!a) return null;
|
|
2050
|
-
const
|
|
2075
|
+
const l = xe(n, a), f = xe(o, a), i = e == null || e === "" ? "" : String(e), d = [
|
|
2051
2076
|
"ds:text-[color:var(--primary)]",
|
|
2052
2077
|
"ds:hover:underline",
|
|
2053
2078
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)]",
|
|
@@ -2055,58 +2080,58 @@ function Bn(t) {
|
|
|
2055
2080
|
"ds:focus-visible:outline-[color:var(--ring)]",
|
|
2056
2081
|
"ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
2057
2082
|
"ds:rounded-[var(--radius-sm)]"
|
|
2058
|
-
].join(" "),
|
|
2059
|
-
r && (
|
|
2083
|
+
].join(" "), c = (u) => {
|
|
2084
|
+
r && (l || u.preventDefault(), u.stopPropagation(), r(a));
|
|
2060
2085
|
};
|
|
2061
|
-
return /* @__PURE__ */
|
|
2062
|
-
|
|
2086
|
+
return /* @__PURE__ */ k("span", { className: "ds:flex ds:flex-col ds:leading-tight", children: [
|
|
2087
|
+
l ? /* @__PURE__ */ s(
|
|
2063
2088
|
"a",
|
|
2064
2089
|
{
|
|
2065
|
-
href:
|
|
2066
|
-
onClick:
|
|
2067
|
-
className:
|
|
2068
|
-
children:
|
|
2090
|
+
href: Fa(l),
|
|
2091
|
+
onClick: c,
|
|
2092
|
+
className: d,
|
|
2093
|
+
children: i
|
|
2069
2094
|
}
|
|
2070
2095
|
) : /* @__PURE__ */ s(
|
|
2071
2096
|
"button",
|
|
2072
2097
|
{
|
|
2073
2098
|
type: "button",
|
|
2074
|
-
onClick:
|
|
2099
|
+
onClick: c,
|
|
2075
2100
|
className: [
|
|
2076
2101
|
"ds:appearance-none ds:bg-transparent ds:p-0 ds:text-start",
|
|
2077
|
-
|
|
2102
|
+
d
|
|
2078
2103
|
].join(" "),
|
|
2079
|
-
children:
|
|
2104
|
+
children: i
|
|
2080
2105
|
}
|
|
2081
2106
|
),
|
|
2082
|
-
|
|
2107
|
+
f ? /* @__PURE__ */ s("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: f }) : null
|
|
2083
2108
|
] });
|
|
2084
2109
|
}
|
|
2085
|
-
function
|
|
2110
|
+
function Vn(t) {
|
|
2086
2111
|
const {
|
|
2087
2112
|
value: e,
|
|
2088
2113
|
data: a,
|
|
2089
2114
|
onToggle: n,
|
|
2090
2115
|
onError: r,
|
|
2091
2116
|
trueIcon: o,
|
|
2092
|
-
falseIcon:
|
|
2093
|
-
trueClass:
|
|
2094
|
-
falseClass:
|
|
2095
|
-
label:
|
|
2096
|
-
} = t, { t:
|
|
2117
|
+
falseIcon: l,
|
|
2118
|
+
trueClass: f = "ds:text-[color:var(--success)]",
|
|
2119
|
+
falseClass: i = "ds:text-[color:var(--muted-foreground)]",
|
|
2120
|
+
label: d
|
|
2121
|
+
} = t, { t: c } = F(), [u, v] = R(!1);
|
|
2097
2122
|
if (!a) return null;
|
|
2098
|
-
const
|
|
2099
|
-
async function p(
|
|
2100
|
-
if (
|
|
2101
|
-
const
|
|
2102
|
-
if (
|
|
2103
|
-
|
|
2123
|
+
const g = !!e, C = g ? o ?? /* @__PURE__ */ s(_t, { "aria-hidden": !0, className: "ds:size-4" }) : l ?? /* @__PURE__ */ s(Bt, { "aria-hidden": !0, className: "ds:size-4" }), T = g ? f : i, x = d ?? c(g ? "inputs.switch.on" : "inputs.switch.off");
|
|
2124
|
+
async function p(m) {
|
|
2125
|
+
if (m.stopPropagation(), u || !a) return;
|
|
2126
|
+
const h = n(a, !g);
|
|
2127
|
+
if (h && typeof h.then == "function") {
|
|
2128
|
+
v(!0);
|
|
2104
2129
|
try {
|
|
2105
|
-
await
|
|
2106
|
-
} catch (
|
|
2107
|
-
r == null || r(a,
|
|
2130
|
+
await h;
|
|
2131
|
+
} catch (N) {
|
|
2132
|
+
r == null || r(a, N);
|
|
2108
2133
|
} finally {
|
|
2109
|
-
|
|
2134
|
+
v(!1);
|
|
2110
2135
|
}
|
|
2111
2136
|
}
|
|
2112
2137
|
}
|
|
@@ -2115,10 +2140,10 @@ function Gn(t) {
|
|
|
2115
2140
|
{
|
|
2116
2141
|
type: "button",
|
|
2117
2142
|
role: "switch",
|
|
2118
|
-
"aria-checked":
|
|
2119
|
-
"aria-busy":
|
|
2120
|
-
"aria-label":
|
|
2121
|
-
disabled:
|
|
2143
|
+
"aria-checked": g,
|
|
2144
|
+
"aria-busy": u,
|
|
2145
|
+
"aria-label": x,
|
|
2146
|
+
disabled: u,
|
|
2122
2147
|
onClick: p,
|
|
2123
2148
|
className: [
|
|
2124
2149
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
@@ -2132,11 +2157,11 @@ function Gn(t) {
|
|
|
2132
2157
|
"ds:disabled:opacity-50",
|
|
2133
2158
|
T
|
|
2134
2159
|
].join(" "),
|
|
2135
|
-
children:
|
|
2160
|
+
children: C
|
|
2136
2161
|
}
|
|
2137
2162
|
);
|
|
2138
2163
|
}
|
|
2139
|
-
const
|
|
2164
|
+
const Ra = {
|
|
2140
2165
|
sm: "ds:size-[var(--icon-size-sm)]",
|
|
2141
2166
|
md: "ds:size-[var(--icon-size-md)]",
|
|
2142
2167
|
lg: "ds:size-[var(--icon-size-lg)]"
|
|
@@ -2146,19 +2171,19 @@ function Ne(t, e) {
|
|
|
2146
2171
|
const a = t[e];
|
|
2147
2172
|
return typeof a == "string" ? a : void 0;
|
|
2148
2173
|
}
|
|
2149
|
-
const
|
|
2150
|
-
function
|
|
2174
|
+
const Da = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, ka = /^rgba?\(\s*[\d.\s,%/]+\)$/i, Ia = /^hsla?\(\s*[\d.\s,%/]+\)$/i, Ea = /^var\(--[a-z0-9-]+(?:,\s*[^)]+)?\)$/i;
|
|
2175
|
+
function za(t) {
|
|
2151
2176
|
if (!t) return;
|
|
2152
2177
|
const e = t.trim();
|
|
2153
|
-
if (
|
|
2178
|
+
if (Da.test(e) || ka.test(e) || Ia.test(e) || Ea.test(e))
|
|
2154
2179
|
return e;
|
|
2155
2180
|
}
|
|
2156
|
-
function
|
|
2157
|
-
const { data: e, colorField: a, size: n = "md", labelField: r } = t, o = Z(null),
|
|
2158
|
-
return
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
}, [
|
|
2181
|
+
function Un(t) {
|
|
2182
|
+
const { data: e, colorField: a, size: n = "md", labelField: r } = t, o = Z(null), l = e ? Ne(e, a) : void 0, f = za(l), i = e && r ? Ne(e, r) : void 0;
|
|
2183
|
+
return Vt(() => {
|
|
2184
|
+
const d = o.current;
|
|
2185
|
+
d && (f ? d.style.setProperty("--data-table-dot-color", f) : d.style.removeProperty("--data-table-dot-color"));
|
|
2186
|
+
}, [f]), f ? /* @__PURE__ */ k("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
2162
2187
|
/* @__PURE__ */ s(
|
|
2163
2188
|
"span",
|
|
2164
2189
|
{
|
|
@@ -2168,50 +2193,50 @@ function Vn(t) {
|
|
|
2168
2193
|
"ds:inline-block ds:shrink-0 ds:rounded-[var(--radius-full)]",
|
|
2169
2194
|
"ds:bg-[var(--data-table-dot-color)]",
|
|
2170
2195
|
"ds:border ds:border-[color:var(--border)]",
|
|
2171
|
-
|
|
2196
|
+
Ra[n]
|
|
2172
2197
|
].join(" ")
|
|
2173
2198
|
}
|
|
2174
2199
|
),
|
|
2175
|
-
|
|
2200
|
+
i ? /* @__PURE__ */ s("span", { children: i }) : null
|
|
2176
2201
|
] }) : null;
|
|
2177
2202
|
}
|
|
2178
|
-
function
|
|
2203
|
+
function Aa(t, e) {
|
|
2179
2204
|
if (!t || typeof t != "object") return null;
|
|
2180
2205
|
const a = t[e], n = typeof a == "number" ? a : Number(a);
|
|
2181
2206
|
return Number.isFinite(n) ? n : null;
|
|
2182
2207
|
}
|
|
2183
|
-
function
|
|
2184
|
-
const { data: e, lines: a, currency: n = "EUR", highlightNegative: r } = t, { i18n: o } =
|
|
2208
|
+
function Kn(t) {
|
|
2209
|
+
const { data: e, lines: a, currency: n = "EUR", highlightNegative: r } = t, { i18n: o } = F();
|
|
2185
2210
|
if (!e) return null;
|
|
2186
|
-
const
|
|
2187
|
-
const
|
|
2188
|
-
if (
|
|
2189
|
-
let
|
|
2190
|
-
switch (
|
|
2211
|
+
const l = o.language || "en", f = (d) => {
|
|
2212
|
+
const c = Aa(e, d.valueField);
|
|
2213
|
+
if (c === null) return null;
|
|
2214
|
+
let u;
|
|
2215
|
+
switch (d.format ?? "number") {
|
|
2191
2216
|
case "currency":
|
|
2192
|
-
|
|
2217
|
+
u = new Intl.NumberFormat(l, {
|
|
2193
2218
|
style: "currency",
|
|
2194
2219
|
currency: n
|
|
2195
|
-
}).format(
|
|
2220
|
+
}).format(c);
|
|
2196
2221
|
break;
|
|
2197
2222
|
case "percent":
|
|
2198
|
-
|
|
2223
|
+
u = new Intl.NumberFormat(l, {
|
|
2199
2224
|
style: "percent",
|
|
2200
2225
|
maximumFractionDigits: 1
|
|
2201
|
-
}).format(
|
|
2226
|
+
}).format(c / 100);
|
|
2202
2227
|
break;
|
|
2203
2228
|
default:
|
|
2204
|
-
|
|
2229
|
+
u = new Intl.NumberFormat(l).format(c);
|
|
2205
2230
|
}
|
|
2206
2231
|
return {
|
|
2207
|
-
label:
|
|
2208
|
-
formatted:
|
|
2209
|
-
negative: !!r &&
|
|
2232
|
+
label: d.label,
|
|
2233
|
+
formatted: u,
|
|
2234
|
+
negative: !!r && c < 0
|
|
2210
2235
|
};
|
|
2211
|
-
},
|
|
2212
|
-
(
|
|
2236
|
+
}, i = a.map(f).filter(
|
|
2237
|
+
(d) => d !== null
|
|
2213
2238
|
);
|
|
2214
|
-
return
|
|
2239
|
+
return i.length === 0 ? null : /* @__PURE__ */ s(
|
|
2215
2240
|
"div",
|
|
2216
2241
|
{
|
|
2217
2242
|
className: [
|
|
@@ -2223,12 +2248,12 @@ function Un(t) {
|
|
|
2223
2248
|
"type-meta",
|
|
2224
2249
|
"ds:leading-tight"
|
|
2225
2250
|
].join(" "),
|
|
2226
|
-
children:
|
|
2251
|
+
children: i.map((d, c) => /* @__PURE__ */ k(
|
|
2227
2252
|
"span",
|
|
2228
2253
|
{
|
|
2229
2254
|
className: "ds:inline-flex ds:items-baseline ds:gap-x-[var(--spacing-xs)]",
|
|
2230
2255
|
children: [
|
|
2231
|
-
|
|
2256
|
+
c > 0 ? /* @__PURE__ */ s(
|
|
2232
2257
|
"span",
|
|
2233
2258
|
{
|
|
2234
2259
|
"aria-hidden": "true",
|
|
@@ -2236,46 +2261,46 @@ function Un(t) {
|
|
|
2236
2261
|
children: "·"
|
|
2237
2262
|
}
|
|
2238
2263
|
) : null,
|
|
2239
|
-
/* @__PURE__ */ s("span", { className: "ds:text-[color:var(--muted-foreground)]", children:
|
|
2264
|
+
/* @__PURE__ */ s("span", { className: "ds:text-[color:var(--muted-foreground)]", children: d.label }),
|
|
2240
2265
|
/* @__PURE__ */ s(
|
|
2241
2266
|
"span",
|
|
2242
2267
|
{
|
|
2243
2268
|
className: [
|
|
2244
2269
|
"ds:tabular-nums",
|
|
2245
2270
|
"ds:font-medium",
|
|
2246
|
-
|
|
2271
|
+
d.negative ? "ds:text-[color:var(--destructive)]" : ""
|
|
2247
2272
|
].filter(Boolean).join(" "),
|
|
2248
|
-
children:
|
|
2273
|
+
children: d.formatted
|
|
2249
2274
|
}
|
|
2250
2275
|
)
|
|
2251
2276
|
]
|
|
2252
2277
|
},
|
|
2253
|
-
`${
|
|
2278
|
+
`${d.label}-${c}`
|
|
2254
2279
|
))
|
|
2255
2280
|
}
|
|
2256
2281
|
);
|
|
2257
2282
|
}
|
|
2258
|
-
function
|
|
2259
|
-
var
|
|
2260
|
-
const { initialValue: e, onValueChange: a, stopEditing: n, column: r } = t, [o,
|
|
2261
|
-
|
|
2262
|
-
const
|
|
2263
|
-
|
|
2283
|
+
function Wn(t) {
|
|
2284
|
+
var d, c;
|
|
2285
|
+
const { initialValue: e, onValueChange: a, stopEditing: n, column: r } = t, [o, l] = R(e ?? ""), f = Z(null);
|
|
2286
|
+
A(() => {
|
|
2287
|
+
const u = f.current;
|
|
2288
|
+
u && (u.focus(), u.select());
|
|
2264
2289
|
}, []);
|
|
2265
|
-
const
|
|
2290
|
+
const i = ((c = (d = r == null ? void 0 : r.getColDef) == null ? void 0 : d.call(r)) == null ? void 0 : c.headerName) ?? void 0;
|
|
2266
2291
|
return /* @__PURE__ */ s(
|
|
2267
2292
|
"input",
|
|
2268
2293
|
{
|
|
2269
|
-
ref:
|
|
2294
|
+
ref: f,
|
|
2270
2295
|
type: "text",
|
|
2271
2296
|
value: o,
|
|
2272
|
-
"aria-label":
|
|
2273
|
-
onChange: (
|
|
2274
|
-
const
|
|
2275
|
-
|
|
2297
|
+
"aria-label": i,
|
|
2298
|
+
onChange: (u) => {
|
|
2299
|
+
const v = u.target.value;
|
|
2300
|
+
l(v), a(v);
|
|
2276
2301
|
},
|
|
2277
|
-
onKeyDown: (
|
|
2278
|
-
|
|
2302
|
+
onKeyDown: (u) => {
|
|
2303
|
+
u.key === "Enter" && (u.preventDefault(), n());
|
|
2279
2304
|
},
|
|
2280
2305
|
className: [
|
|
2281
2306
|
"ds:block ds:w-full ds:appearance-none",
|
|
@@ -2291,49 +2316,49 @@ function Kn(t) {
|
|
|
2291
2316
|
}
|
|
2292
2317
|
);
|
|
2293
2318
|
}
|
|
2294
|
-
function
|
|
2295
|
-
var T,
|
|
2319
|
+
function Hn(t) {
|
|
2320
|
+
var T, x;
|
|
2296
2321
|
const {
|
|
2297
2322
|
initialValue: e,
|
|
2298
2323
|
onValueChange: a,
|
|
2299
2324
|
stopEditing: n,
|
|
2300
2325
|
column: r,
|
|
2301
2326
|
decimals: o = 2,
|
|
2302
|
-
min:
|
|
2303
|
-
max:
|
|
2304
|
-
} = t, { i18n:
|
|
2305
|
-
|
|
2306
|
-
const p =
|
|
2327
|
+
min: l,
|
|
2328
|
+
max: f
|
|
2329
|
+
} = t, { i18n: i } = F(), d = Z(null), c = ((x = (T = r == null ? void 0 : r.getColDef) == null ? void 0 : T.call(r)) == null ? void 0 : x.headerName) ?? void 0, [u, v] = R(() => e == null || Number.isNaN(e) ? "" : String(e));
|
|
2330
|
+
A(() => {
|
|
2331
|
+
const p = d.current;
|
|
2307
2332
|
p && (p.focus(), p.select());
|
|
2308
2333
|
}, []);
|
|
2309
|
-
function
|
|
2310
|
-
var
|
|
2334
|
+
function g(p) {
|
|
2335
|
+
var L, D;
|
|
2311
2336
|
if (p.trim().length === 0) return null;
|
|
2312
|
-
const
|
|
2313
|
-
return Number.isFinite(
|
|
2337
|
+
const m = i.language || "en", b = new Intl.NumberFormat(m).formatToParts(12345.6), h = ((L = b.find((q) => q.type === "group")) == null ? void 0 : L.value) ?? "", N = ((D = b.find((q) => q.type === "decimal")) == null ? void 0 : D.value) ?? ".", E = p.replace(new RegExp(`\\${h}`, "g"), "").replace(N, ".").replace(/[^\d.-]/g, ""), I = Number(E);
|
|
2338
|
+
return Number.isFinite(I) ? I : null;
|
|
2314
2339
|
}
|
|
2315
|
-
function
|
|
2316
|
-
const
|
|
2317
|
-
if (
|
|
2340
|
+
function C(p) {
|
|
2341
|
+
const m = g(p);
|
|
2342
|
+
if (m == null) {
|
|
2318
2343
|
a(null);
|
|
2319
2344
|
return;
|
|
2320
2345
|
}
|
|
2321
|
-
let
|
|
2322
|
-
typeof
|
|
2323
|
-
const
|
|
2324
|
-
a(Math.round(
|
|
2346
|
+
let b = m;
|
|
2347
|
+
typeof l == "number" && (b = Math.max(l, b)), typeof f == "number" && (b = Math.min(f, b));
|
|
2348
|
+
const h = 10 ** o;
|
|
2349
|
+
a(Math.round(b * h) / h);
|
|
2325
2350
|
}
|
|
2326
2351
|
return /* @__PURE__ */ s(
|
|
2327
2352
|
"input",
|
|
2328
2353
|
{
|
|
2329
|
-
ref:
|
|
2354
|
+
ref: d,
|
|
2330
2355
|
type: "text",
|
|
2331
2356
|
inputMode: "decimal",
|
|
2332
|
-
value:
|
|
2333
|
-
"aria-label":
|
|
2357
|
+
value: u,
|
|
2358
|
+
"aria-label": c,
|
|
2334
2359
|
onChange: (p) => {
|
|
2335
|
-
const
|
|
2336
|
-
|
|
2360
|
+
const m = p.target.value;
|
|
2361
|
+
v(m), C(m);
|
|
2337
2362
|
},
|
|
2338
2363
|
onKeyDown: (p) => {
|
|
2339
2364
|
p.key === "Enter" && (p.preventDefault(), n());
|
|
@@ -2351,34 +2376,34 @@ function Wn(t) {
|
|
|
2351
2376
|
}
|
|
2352
2377
|
export {
|
|
2353
2378
|
_n as A,
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2379
|
+
Kn as B,
|
|
2380
|
+
Un as C,
|
|
2381
|
+
wn as D,
|
|
2382
|
+
Hn as E,
|
|
2383
|
+
jn as I,
|
|
2359
2384
|
Bn as L,
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2385
|
+
An as N,
|
|
2386
|
+
kn as S,
|
|
2387
|
+
Ln as T,
|
|
2388
|
+
Mn as U,
|
|
2389
|
+
Gn as a,
|
|
2390
|
+
$n as b,
|
|
2391
|
+
Rn as c,
|
|
2392
|
+
Dn as d,
|
|
2393
|
+
Wn as e,
|
|
2394
|
+
Pn as f,
|
|
2395
|
+
In as g,
|
|
2396
|
+
On as h,
|
|
2397
|
+
sa as i,
|
|
2398
|
+
oa as j,
|
|
2399
|
+
Vn as k,
|
|
2375
2400
|
ae as l,
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2401
|
+
Kt as m,
|
|
2402
|
+
qn as n,
|
|
2403
|
+
En as o,
|
|
2404
|
+
zn as p,
|
|
2380
2405
|
la as q,
|
|
2381
2406
|
Ve as r,
|
|
2382
|
-
|
|
2407
|
+
Fn as u
|
|
2383
2408
|
};
|
|
2384
|
-
//# sourceMappingURL=editable-currency-cell-renderer-
|
|
2409
|
+
//# sourceMappingURL=editable-currency-cell-renderer-DHOspPee.js.map
|