@alfadocs/ui-kit 1.9.3 → 1.10.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.
@@ -1,1784 +0,0 @@
1
- import { jsx as o, jsxs as M } from "react/jsx-runtime";
2
- import { useMemo as G, forwardRef as q, useState as z, useCallback as N, useEffect as W, useRef as V, createContext as he, useContext as xe, isValidElement as _e, cloneElement as Ge, useImperativeHandle as Ft } from "react";
3
- import { S as kt } from "./skeleton-CZbwyJAA.js";
4
- import { E as At } from "./empty-state-X0sVPfVo.js";
5
- import { c as Pt } from "./index-D2ZczOXr.js";
6
- import { useTranslation as D } from "react-i18next";
7
- import { useGridFilter as Ot, AgGridReact as zt } from "ag-grid-react";
8
- import { ModuleRegistry as Mt, AllCommunityModule as _t } from "ag-grid-community";
9
- import { I as Le } from "./icon-button-group-D6SVMteH.js";
10
- import { B as ae } from "./button-nJaPh_HC.js";
11
- import { I as X } from "./icon-button-DA2CAGHZ.js";
12
- import { P as se } from "./popover-Cqcjx-Ny.js";
13
- import { C as Gt } from "./checkbox-BuZ1u__2.js";
14
- import { T as ye } from "./text-input-CUvCb6ST.js";
15
- import { T as Oe } from "./tag-3wgkwwDB.js";
16
- import { D as U } from "./dropdown-menu-DU-Hrf33.js";
17
- import { X as je } from "./x-B5YnXwCz.js";
18
- import { R as Lt } from "./refresh-cw-DnI0cLFC.js";
19
- import { S as ve } from "./search-QbWPlY5f.js";
20
- import { c as jt } from "./createLucideIcon-DhHxpK9K.js";
21
- import { G as qt } from "./grip-vertical-onSb1JXO.js";
22
- import { P as Bt } from "./printer-rkK0T1gi.js";
23
- import { F as qe } from "./file-text-5yv6r2ls.js";
24
- import { D as de } from "./download-CfYKJO_j.js";
25
- import { F as Wt } from "./file-spreadsheet-DmwyfV4O.js";
26
- import $t from "i18next";
27
- import { S as Kt } from "./select-BW5ecXlX.js";
28
- import { u as Ht } from "./registry-DvAUVLHh.js";
29
- import { u as Vt } from "./use-prefers-reduced-motion-BMwIQRjB.js";
30
- import { u as Ut } from "./use-theme-CAuo6EYT.js";
31
- import { E as Xt } from "./ellipsis-dRo9ouSU.js";
32
- /**
33
- * @license lucide-react v1.22.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */
38
- const Qt = [
39
- ["path", { d: "M10.5 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v5.5", key: "1g2yzs" }],
40
- ["path", { d: "m14.3 19.6 1-.4", key: "11sv9r" }],
41
- ["path", { d: "M15 3v7.5", key: "7lm50a" }],
42
- ["path", { d: "m15.2 16.9-.9-.3", key: "1t7mvx" }],
43
- ["path", { d: "m16.6 21.7.3-.9", key: "1j67ps" }],
44
- ["path", { d: "m16.8 15.3-.4-1", key: "1ei7r6" }],
45
- ["path", { d: "m19.1 15.2.3-.9", key: "18r7jp" }],
46
- ["path", { d: "m19.6 21.7-.4-1", key: "z2vh2" }],
47
- ["path", { d: "m20.7 16.8 1-.4", key: "19m87a" }],
48
- ["path", { d: "m21.7 19.4-.9-.3", key: "1qgwi9" }],
49
- ["path", { d: "M9 3v18", key: "fh3hqa" }],
50
- ["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }]
51
- ], Jt = jt("columns-3-cog", Qt);
52
- function Zt(e) {
53
- if (!_e(e)) return e;
54
- const t = e, a = t.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} ds:size-4`.trim();
55
- return Ge(t, { className: n, size: t.props.size ?? 16 });
56
- }
57
- const Be = he(null);
58
- function H(e) {
59
- const t = xe(Be);
60
- if (!t)
61
- throw new Error(
62
- `${e} must be rendered inside <DataTable.Toolbar> as a descendant of <DataTable>.`
63
- );
64
- return t;
65
- }
66
- function Yt({
67
- getApi: e,
68
- selectionCount: t,
69
- onPrint: a,
70
- children: n
71
- }) {
72
- const i = G(
73
- () => ({ getApi: e, selectionCount: t, onPrint: a }),
74
- [e, t, a]
75
- );
76
- return /* @__PURE__ */ o(Be.Provider, { value: i, children: n });
77
- }
78
- const er = [
79
- "data-table-toolbar",
80
- // Mobile (<sm) keeps `flex-wrap` so a wide QuickSearch can flow above the
81
- // Actions cluster on narrow screens. From `sm` (≥640px) we switch to
82
- // `flex-nowrap` + `min-w-0` so the row stays single-line at every common
83
- // desktop width (1024 / 1280 / 1440) — the QuickSearch slot shrinks via
84
- // its own `min-w-0` instead of pushing the trailing Actions to a new row.
85
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
86
- "ds:sm:flex-nowrap ds:min-w-0"
87
- // No card surface: the toolbar sits directly on the page background,
88
- // matching the header-tools layout the Patients / Care Plan List
89
- // patterns established (the old bg-card + border + shadow bar is gone).
90
- ].join(" "), We = q(
91
- ({ className: e, children: t, ...a }, n) => /* @__PURE__ */ o(
92
- "div",
93
- {
94
- ref: n,
95
- role: "toolbar",
96
- className: [er, e ?? ""].join(" ").trim(),
97
- ...a,
98
- children: t
99
- }
100
- )
101
- );
102
- We.displayName = "DataTable.Toolbar";
103
- const $e = q(
104
- ({ className: e, children: t, ...a }, n) => /* @__PURE__ */ o(
105
- "div",
106
- {
107
- ref: n,
108
- className: [
109
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
110
- // `grow` lets FilterBar absorb the free space; `min-w-0` lets the
111
- // QuickSearch slot inside shrink below its intrinsic width when the
112
- // toolbar runs `flex-nowrap` at `sm` and above, so the trailing
113
- // Actions cluster stays pinned on a single row.
114
- "ds:grow ds:min-w-0",
115
- e ?? ""
116
- ].join(" ").trim(),
117
- ...a,
118
- children: t
119
- }
120
- )
121
- );
122
- $e.displayName = "DataTable.Toolbar.FilterBar";
123
- const Ke = q(
124
- ({ className: e, children: t, ...a }, n) => /* @__PURE__ */ o(
125
- "div",
126
- {
127
- ref: n,
128
- className: [
129
- "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
130
- "ds:ms-auto",
131
- e ?? ""
132
- ].join(" ").trim(),
133
- ...a,
134
- children: t
135
- }
136
- )
137
- );
138
- Ke.displayName = "DataTable.Toolbar.Actions";
139
- const Te = q(
140
- ({ label: e, onExport: t, intent: a = "outline", ...n }, i) => {
141
- const { t: d } = D(), { getApi: f } = H("DataTable.Toolbar.ExportCsv"), m = N(() => {
142
- const c = f();
143
- c && (t ? t(c) : c.exportDataAsCsv());
144
- }, [f, t]);
145
- return /* @__PURE__ */ o(
146
- X,
147
- {
148
- ref: i,
149
- type: "button",
150
- intent: a,
151
- icon: /* @__PURE__ */ o(de, { "aria-hidden": !0 }),
152
- tooltip: e ?? d("dataTable.exportCsv"),
153
- onClick: m,
154
- ...n
155
- }
156
- );
157
- }
158
- );
159
- Te.displayName = "DataTable.Toolbar.ExportCsv";
160
- function ee(e, t = [30, 30, 30]) {
161
- if (typeof document > "u") return t;
162
- const a = document.createElement("span");
163
- a.style.color = `hsl(var(${e}))`, a.style.position = "absolute", a.style.visibility = "hidden", document.body.appendChild(a);
164
- const n = getComputedStyle(a).color;
165
- document.body.removeChild(a);
166
- const i = n.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
167
- return i ? [Number(i[1]), Number(i[2]), Number(i[3])] : t;
168
- }
169
- async function He(e, t) {
170
- if (!e) return;
171
- const [{ jsPDF: a }, { default: n }] = await Promise.all([
172
- import("./jspdf.es.min-DaapWjR1.js").then((x) => x.j),
173
- import("./jspdf.plugin.autotable-CSiDNyPn.js")
174
- ]), d = (e.getColumns() ?? []).filter((x) => x.isVisible()), f = [
175
- d.map((x) => e.getDisplayNameForColumn(x, null) ?? "")
176
- ], m = [];
177
- e.forEachNodeAfterFilterAndSort((x) => {
178
- if (!x.data) return;
179
- const l = d.map((p) => {
180
- const T = e.getCellValue({
181
- rowNode: x,
182
- colKey: p,
183
- useFormatter: !0
184
- });
185
- return T == null ? "" : String(T);
186
- });
187
- m.push(l);
188
- });
189
- const c = ee("--muted", [240, 240, 240]), g = ee("--foreground", [30, 30, 30]), u = ee("--card-foreground", [30, 30, 30]), b = ee("--card", [250, 250, 250]), v = new a({ orientation: "landscape" });
190
- n(v, {
191
- head: f,
192
- body: m,
193
- headStyles: { fillColor: c, textColor: g },
194
- bodyStyles: { textColor: u },
195
- alternateRowStyles: { fillColor: b },
196
- styles: {
197
- font: "helvetica",
198
- fontSize: 10,
199
- cellPadding: 4
200
- }
201
- }), v.save(t.fileName);
202
- }
203
- const we = q(
204
- ({ label: e, onClick: t, fileName: a, intent: n = "outline", ...i }, d) => {
205
- const { t: f } = D(), { getApi: m } = H("DataTable.Toolbar.ExportPdf"), c = N(() => {
206
- const g = m();
207
- if (t) {
208
- t(g);
209
- return;
210
- }
211
- He(g, {
212
- fileName: a ?? "data-table-export.pdf"
213
- });
214
- }, [m, t, a]);
215
- return /* @__PURE__ */ o(
216
- X,
217
- {
218
- ref: d,
219
- type: "button",
220
- intent: n,
221
- icon: /* @__PURE__ */ o(qe, { "aria-hidden": !0 }),
222
- tooltip: e ?? f("dataTable.exportPdf"),
223
- onClick: c,
224
- ...i
225
- }
226
- );
227
- }
228
- );
229
- we.displayName = "DataTable.Toolbar.ExportPdf";
230
- const Ce = q(
231
- ({ label: e, intent: t = "outline", ...a }, n) => {
232
- const { t: i } = D(), { onPrint: d } = H("DataTable.Toolbar.Print");
233
- return /* @__PURE__ */ o(
234
- X,
235
- {
236
- ref: n,
237
- type: "button",
238
- intent: t,
239
- icon: /* @__PURE__ */ o(Bt, { "aria-hidden": !0 }),
240
- tooltip: e ?? i("dataTable.print"),
241
- onClick: d,
242
- ...a
243
- }
244
- );
245
- }
246
- );
247
- Ce.displayName = "DataTable.Toolbar.Print";
248
- const Ve = ({ placeholder: e, debounceMs: t = 150 }) => {
249
- const { t: a } = D(), { getApi: n } = H("DataTable.Toolbar.QuickSearch"), [i, d] = z(""), f = V(void 0);
250
- return W(() => (f.current && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
251
- const m = n();
252
- m && m.setGridOption("quickFilterText", i);
253
- }, t), () => {
254
- f.current && window.clearTimeout(f.current);
255
- }), [i, t, n]), // Slot wrapper caps the search at a sensible legible width on desktop —
256
- // without this, TextInput's `w-full` lets the QuickSearch absorb the
257
- // entire FilterBar row and push trailing Actions onto a second line at
258
- // 1024 / 1280 / 1440. `min-w-0` lets the slot shrink below `24rem` when
259
- // the toolbar is squeezed on narrow viewports. There is no
260
- // `--toolbar-search-max` token in the kit yet — see this component's
261
- // summary for a follow-up note recommending we add one.
262
- /* @__PURE__ */ o("div", { className: "ds:w-full ds:max-w-[24rem] ds:min-w-0", children: /* @__PURE__ */ o(
263
- ye,
264
- {
265
- type: "search",
266
- size: "sm",
267
- value: i,
268
- onChange: (m) => d(m.target.value),
269
- placeholder: e ?? a("dataTable.quickSearch.placeholder", "Search…"),
270
- startAdornment: /* @__PURE__ */ o(ve, { "aria-hidden": !0, className: "ds:size-4" }),
271
- clearable: !0,
272
- onClear: () => d(""),
273
- "aria-label": a("dataTable.quickSearch.label", "Quick search")
274
- }
275
- ) });
276
- };
277
- Ve.displayName = "DataTable.Toolbar.QuickSearch";
278
- const Re = q(
279
- ({ onRefresh: e, label: t, intent: a = "outline", ...n }, i) => {
280
- const { t: d } = D();
281
- return /* @__PURE__ */ o(
282
- X,
283
- {
284
- ref: i,
285
- type: "button",
286
- intent: a,
287
- icon: /* @__PURE__ */ o(Lt, { "aria-hidden": !0 }),
288
- tooltip: t ?? d("dataTable.refresh", "Refresh"),
289
- onClick: e,
290
- ...n
291
- }
292
- );
293
- }
294
- );
295
- Re.displayName = "DataTable.Toolbar.Refresh";
296
- function tr(e) {
297
- if (!e || typeof e != "object") return "";
298
- const t = e;
299
- if (typeof t.filter == "string" || typeof t.filter == "number") {
300
- const a = typeof t.type == "string" ? t.type : "", n = typeof t.filterTo == "string" || typeof t.filterTo == "number" ? String(t.filterTo) : "";
301
- return a === "inRange" && n ? `${t.filter} – ${n}` : a ? `${a} ${t.filter}` : String(t.filter);
302
- }
303
- return typeof t.dateFrom == "string" ? typeof t.dateTo == "string" && t.dateTo ? `${t.dateFrom} – ${t.dateTo}` : String(t.dateFrom) : Array.isArray(t.values) ? t.values.map(String).join(", ") : "";
304
- }
305
- const Ue = () => {
306
- const { t: e } = D(), { getApi: t } = H("DataTable.Toolbar.FilterChips"), [a, n] = z([]), [i, d] = z(""), f = N(() => {
307
- const u = t();
308
- if (!u) {
309
- n([]), d("");
310
- return;
311
- }
312
- const b = u.getFilterModel() ?? {}, v = u.getColumns() ?? [], x = [];
313
- for (const p of Object.keys(b)) {
314
- const T = v.find((R) => R.getColId() === p), y = u.getDisplayNameForColumn(T, null) ?? p;
315
- x.push({
316
- colId: p,
317
- headerName: y,
318
- text: tr(b[p])
319
- });
320
- }
321
- n(x);
322
- const l = u.getGridOption("quickFilterText");
323
- d(typeof l == "string" ? l : "");
324
- }, [t]);
325
- if (W(() => {
326
- let u;
327
- const b = (l) => f(), v = (l) => {
328
- l.addEventListener("filterChanged", b), f(), u = () => l.removeEventListener("filterChanged", b);
329
- }, x = t();
330
- if (x)
331
- v(x);
332
- else {
333
- const l = window.setInterval(() => {
334
- const p = t();
335
- p && (window.clearInterval(l), v(p));
336
- }, 50);
337
- u = () => window.clearInterval(l);
338
- }
339
- return () => u == null ? void 0 : u();
340
- }, [t, f]), a.length + (i ? 1 : 0) === 0) return null;
341
- function c(u) {
342
- const b = t();
343
- b && b.destroyFilter(u);
344
- }
345
- function g() {
346
- const u = t();
347
- u && (u.setFilterModel(null), u.setGridOption("quickFilterText", ""), d(""));
348
- }
349
- return /* @__PURE__ */ M(
350
- "div",
351
- {
352
- role: "group",
353
- "aria-label": e("dataTable.filterChips.label", "Active filters"),
354
- className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
355
- children: [
356
- i && /* @__PURE__ */ o(
357
- Oe,
358
- {
359
- label: `${e("dataTable.quickSearch.label", "Quick search")}: ${i}`,
360
- size: "sm",
361
- fill: "outline",
362
- onRemove: () => {
363
- const u = t();
364
- u == null || u.setGridOption("quickFilterText", ""), d("");
365
- }
366
- }
367
- ),
368
- a.map((u) => /* @__PURE__ */ o(
369
- Oe,
370
- {
371
- label: u.text ? `${u.headerName}: ${u.text}` : u.headerName,
372
- size: "sm",
373
- fill: "outline",
374
- onRemove: () => c(u.colId)
375
- },
376
- u.colId
377
- )),
378
- /* @__PURE__ */ o(
379
- ae,
380
- {
381
- type: "button",
382
- intent: "ghost",
383
- size: "sm",
384
- onClick: g,
385
- startIcon: /* @__PURE__ */ o(je, { "aria-hidden": !0, className: "ds:size-4" }),
386
- children: e("dataTable.filterChips.clearAll", "Clear all")
387
- }
388
- )
389
- ]
390
- }
391
- );
392
- };
393
- Ue.displayName = "DataTable.Toolbar.FilterChips";
394
- const Xe = ({
395
- field: e,
396
- options: t,
397
- label: a
398
- }) => {
399
- const { t: n } = D(), { getApi: i } = H("DataTable.Toolbar.FacetFilter"), [d, f] = z(null);
400
- function m(c) {
401
- f(c);
402
- const g = i();
403
- if (g) {
404
- if (c === null) {
405
- g.destroyFilter(e);
406
- return;
407
- }
408
- g.setColumnFilterModel(e, {
409
- type: "equals",
410
- filter: c
411
- }), g.onFilterChanged();
412
- }
413
- }
414
- return /* @__PURE__ */ o(
415
- "div",
416
- {
417
- role: "group",
418
- "aria-label": a ?? n("dataTable.facetFilter.label", "Filter"),
419
- className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
420
- children: t.map((c) => {
421
- const g = d === c.value;
422
- return /* @__PURE__ */ o(
423
- ae,
424
- {
425
- type: "button",
426
- size: "sm",
427
- intent: g ? "primary" : "secondary",
428
- "aria-pressed": g,
429
- onClick: () => m(c.value),
430
- children: c.label
431
- },
432
- String(c.value)
433
- );
434
- })
435
- }
436
- );
437
- };
438
- Xe.displayName = "DataTable.Toolbar.FacetFilter";
439
- const rr = ["csv", "xlsx", "pdf"];
440
- async function ar(e, t) {
441
- if (!e) return;
442
- const a = await import("./exceljs.min-D2MHbJsF.js").then((p) => p.e), n = new a.Workbook(), i = n.addWorksheet("Sheet1"), f = (e.getColumns() ?? []).filter((p) => p.isVisible());
443
- i.addRow(
444
- f.map(
445
- (p) => e.getDisplayNameForColumn(p, null) ?? p.getColId()
446
- )
447
- ), e.forEachNodeAfterFilterAndSort((p) => {
448
- p.data && i.addRow(
449
- f.map((T) => {
450
- const y = e.getCellValue({
451
- rowNode: p,
452
- colKey: T,
453
- useFormatter: !0
454
- });
455
- return y ?? "";
456
- })
457
- );
458
- });
459
- const m = ee("--muted", [240, 240, 240]), c = ee("--foreground", [30, 30, 30]), g = i.getRow(1), u = ([p, T, y]) => `${p.toString(16).padStart(2, "0")}${T.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}`.toUpperCase();
460
- g.eachCell((p) => {
461
- p.font = { bold: !0, color: { argb: `FF${u(c)}` } }, p.fill = {
462
- type: "pattern",
463
- pattern: "solid",
464
- fgColor: { argb: `FF${u(m)}` }
465
- };
466
- });
467
- const b = await n.xlsx.writeBuffer(), v = new Blob([b], {
468
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
469
- }), x = URL.createObjectURL(v), l = document.createElement("a");
470
- l.href = x, l.download = t.fileName, document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(x);
471
- }
472
- const Qe = he(null);
473
- function nr() {
474
- const e = xe(Qe);
475
- if (!e)
476
- throw new Error(
477
- "DataTable.Toolbar.ExportMenu.Item must be rendered inside DataTable.Toolbar.ExportMenu."
478
- );
479
- return e;
480
- }
481
- const Se = q(
482
- ({ children: e, label: t, intent: a = "outline", ...n }, i) => {
483
- const { t: d } = D(), { getApi: f } = H("DataTable.Toolbar.ExportMenu"), m = G(() => ({ getApi: f }), [f]), c = e ?? rr.map((g) => /* @__PURE__ */ o(Ie, { format: g }, g));
484
- return /* @__PURE__ */ o(Qe.Provider, { value: m, children: /* @__PURE__ */ M(U.Root, { children: [
485
- /* @__PURE__ */ o(U.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
486
- X,
487
- {
488
- ref: i,
489
- type: "button",
490
- intent: a,
491
- icon: /* @__PURE__ */ o(de, { "aria-hidden": !0 }),
492
- tooltip: t ?? d("dataTable.export.menu", "Export"),
493
- "aria-label": t ?? d("dataTable.export.menu", "Export"),
494
- "aria-haspopup": "menu",
495
- ...n
496
- }
497
- ) }),
498
- /* @__PURE__ */ o(U.Content, { align: "end", sideOffset: 4, children: c })
499
- ] }) });
500
- }
501
- );
502
- Se.displayName = "DataTable.Toolbar.ExportMenu";
503
- function or(e, t) {
504
- return t === "csv" ? e("dataTable.export.csv", "Export CSV") : t === "xlsx" ? e("dataTable.export.xlsx", "Export Excel") : t === "pdf" ? e("dataTable.export.pdf", "Export PDF") : e("dataTable.export.custom", "Export");
505
- }
506
- function sr(e) {
507
- return e === "csv" ? /* @__PURE__ */ o(de, { "aria-hidden": !0, className: "ds:size-4" }) : e === "xlsx" ? /* @__PURE__ */ o(Wt, { "aria-hidden": !0, className: "ds:size-4" }) : e === "pdf" ? /* @__PURE__ */ o(qe, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ o(de, { "aria-hidden": !0, className: "ds:size-4" });
508
- }
509
- const Ie = ({
510
- format: e,
511
- label: t,
512
- onClick: a,
513
- fileName: n
514
- }) => {
515
- const { t: i } = D(), { getApi: d } = nr(), f = N(() => {
516
- const m = d();
517
- if (e === "csv") {
518
- m == null || m.exportDataAsCsv();
519
- return;
520
- }
521
- if (e === "pdf") {
522
- He(m, {
523
- fileName: n ?? "data-table-export.pdf"
524
- });
525
- return;
526
- }
527
- if (e === "xlsx") {
528
- ar(m, {
529
- fileName: n ?? "data-table-export.xlsx"
530
- });
531
- return;
532
- }
533
- a == null || a(m);
534
- }, [e, n, a, d]);
535
- return /* @__PURE__ */ o(U.Item, { onSelect: f, children: /* @__PURE__ */ M("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
536
- sr(e),
537
- /* @__PURE__ */ o("span", { children: t ?? or(i, e) })
538
- ] }) });
539
- };
540
- Ie.displayName = "DataTable.Toolbar.ExportMenu.Item";
541
- function ir(e) {
542
- return e ? (e.getAllGridColumns() ?? []).map((a) => a.getColDef().hide === void 0 && a.getColId().startsWith("ag-Grid-") ? null : {
543
- colId: a.getColId(),
544
- displayName: e.getDisplayNameForColumn(a, null) || a.getColId(),
545
- visible: a.isVisible()
546
- }).filter((a) => a !== null) : [];
547
- }
548
- const Ee = q(
549
- function({ label: t, icon: a, footer: n, header: i, intent: d = "outline", ...f }, m) {
550
- const { t: c } = D(), { getApi: g } = H("DataTable.Toolbar.ColumnToggle"), [u, b] = z(!1), [v, x] = z([]), [l, p] = z(null), [T, y] = z(null);
551
- W(() => {
552
- u && x(ir(g()));
553
- }, [u, g]);
554
- const R = N(
555
- (w, k) => {
556
- const L = g();
557
- L && (L.setColumnsVisible([w], k), x(
558
- (I) => I.map(
559
- (A) => A.colId === w ? { ...A, visible: k } : A
560
- )
561
- ));
562
- },
563
- [g]
564
- ), C = N(
565
- (w, k) => {
566
- if (w === k) return;
567
- const L = g();
568
- if (!L) return;
569
- x((A) => {
570
- const O = A.findIndex((S) => S.colId === w), B = A.findIndex((S) => S.colId === k);
571
- if (O < 0 || B < 0) return A;
572
- const K = [...A], [ne] = K.splice(O, 1);
573
- return K.splice(B, 0, ne), K;
574
- });
575
- const I = v.findIndex((A) => A.colId === k);
576
- I >= 0 && L.moveColumns([w], I);
577
- },
578
- [g, v]
579
- ), $ = t ?? c("dataTable.columnToggle");
580
- return /* @__PURE__ */ M(se.Root, { open: u, onOpenChange: b, children: [
581
- /* @__PURE__ */ o(se.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
582
- X,
583
- {
584
- ref: m,
585
- type: "button",
586
- intent: d,
587
- icon: a ?? /* @__PURE__ */ o(Jt, { "aria-hidden": !0 }),
588
- tooltip: $,
589
- "aria-label": $,
590
- "aria-haspopup": "dialog",
591
- ...f
592
- }
593
- ) }),
594
- /* @__PURE__ */ M(se.Content, { size: "sm", align: "end", children: [
595
- /* @__PURE__ */ o(se.Heading, { children: $ }),
596
- i ? /* @__PURE__ */ o("div", { className: "ds:mb-[var(--spacing-xs)] ds:border-b ds:border-[color:var(--border)] ds:pb-[var(--spacing-sm)]", children: i }) : null,
597
- /* @__PURE__ */ o(
598
- "ul",
599
- {
600
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
601
- "aria-label": $,
602
- children: v.map((w) => {
603
- const k = l === w.colId, L = T === w.colId && l !== w.colId;
604
- return /* @__PURE__ */ M(
605
- "li",
606
- {
607
- draggable: !0,
608
- onDragStart: (I) => {
609
- p(w.colId), I.dataTransfer.effectAllowed = "move", I.dataTransfer.setData("text/plain", w.colId);
610
- },
611
- onDragOver: (I) => {
612
- I.preventDefault(), I.dataTransfer.dropEffect = "move", y(w.colId);
613
- },
614
- onDragLeave: () => {
615
- y(
616
- (I) => I === w.colId ? null : I
617
- );
618
- },
619
- onDrop: (I) => {
620
- I.preventDefault();
621
- const A = I.dataTransfer.getData("text/plain");
622
- A && C(A, w.colId), p(null), y(null);
623
- },
624
- onDragEnd: () => {
625
- p(null), y(null);
626
- },
627
- className: [
628
- "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",
629
- k ? "ds:opacity-50" : "",
630
- L ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
631
- ].filter(Boolean).join(" "),
632
- children: [
633
- /* @__PURE__ */ o(
634
- "span",
635
- {
636
- "aria-hidden": "true",
637
- className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
638
- children: /* @__PURE__ */ o(qt, { className: "ds:size-4" })
639
- }
640
- ),
641
- /* @__PURE__ */ o(
642
- Gt,
643
- {
644
- label: w.displayName,
645
- checked: w.visible,
646
- onCheckedChange: (I) => R(w.colId, I === !0)
647
- }
648
- )
649
- ]
650
- },
651
- w.colId
652
- );
653
- })
654
- }
655
- ),
656
- n ? /* @__PURE__ */ o("div", { className: "ds:mt-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-sm)]", children: n }) : null
657
- ] })
658
- ] });
659
- }
660
- );
661
- Ee.displayName = "DataTable.Toolbar.ColumnToggle";
662
- const Je = q(
663
- ({ label: e, icon: t, onClick: a, variant: n = "default", size: i = "sm", ...d }, f) => {
664
- const { t: m } = D(), { getApi: c, selectionCount: g } = H(
665
- "DataTable.Toolbar.BulkAction"
666
- );
667
- return g === 0 ? null : /* @__PURE__ */ M(
668
- ae,
669
- {
670
- ref: f,
671
- type: "button",
672
- intent: n === "destructive" ? "destructive" : "secondary",
673
- size: i,
674
- startIcon: Zt(t),
675
- onClick: () => a(c()),
676
- "aria-label": `${e} (${m("dataTable.bulkAction", { count: g })})`,
677
- ...d,
678
- children: [
679
- /* @__PURE__ */ o("span", { children: e }),
680
- /* @__PURE__ */ o(
681
- "span",
682
- {
683
- "aria-hidden": "true",
684
- className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
685
- children: m("dataTable.bulkAction", { count: g })
686
- }
687
- )
688
- ]
689
- }
690
- );
691
- }
692
- );
693
- Je.displayName = "DataTable.Toolbar.BulkAction";
694
- for (const e of [
695
- Te,
696
- we,
697
- Ce,
698
- Re,
699
- Se,
700
- Ee
701
- ])
702
- e.rendersIconButton = !0;
703
- const lr = Object.assign(Se, {
704
- Item: Ie
705
- }), le = Object.assign(We, {
706
- FilterBar: $e,
707
- Actions: Ke,
708
- /** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
709
- ExportCsv: Te,
710
- /** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
711
- ExportPdf: we,
712
- Print: Ce,
713
- ColumnToggle: Ee,
714
- BulkAction: Je,
715
- QuickSearch: Ve,
716
- Refresh: Re,
717
- FilterChips: Ue,
718
- FacetFilter: Xe,
719
- ExportMenu: lr
720
- }), dr = [
721
- "contains",
722
- "equals",
723
- "startsWith",
724
- "endsWith",
725
- "notContains"
726
- ];
727
- function cr(e) {
728
- const t = new Intl.Collator(e, {
729
- sensitivity: "base",
730
- usage: "search"
731
- });
732
- function a(n, i) {
733
- if (i.length === 0) return 0;
734
- if (i.length > n.length) return -1;
735
- for (let d = 0; d <= n.length - i.length; d += 1)
736
- if (t.compare(n.slice(d, d + i.length), i) === 0)
737
- return d;
738
- return -1;
739
- }
740
- return {
741
- equals: (n, i) => t.compare(n, i) === 0,
742
- contains: (n, i) => a(n, i) !== -1,
743
- startsWith: (n, i) => i.length <= n.length && t.compare(n.slice(0, i.length), i) === 0,
744
- endsWith: (n, i) => i.length <= n.length && t.compare(
745
- n.slice(n.length - i.length),
746
- i
747
- ) === 0
748
- };
749
- }
750
- function ur(e) {
751
- return e == null ? null : typeof e == "string" ? e : String(e);
752
- }
753
- function pr(e) {
754
- const { model: t, onModelChange: a, getValue: n, placeholder: i, defaultOperator: d } = e, { t: f } = D("ui"), m = (t == null ? void 0 : t.type) ?? d ?? "contains", [c, g] = z(m), [u, b] = z((t == null ? void 0 : t.filter) ?? "");
755
- W(() => {
756
- g((t == null ? void 0 : t.type) ?? d ?? "contains"), b((t == null ? void 0 : t.filter) ?? "");
757
- }, [t, d]);
758
- const v = G(() => cr($t.language), []);
759
- Ot({
760
- doesFilterPass: (y) => {
761
- const R = t;
762
- if (!R || R.filter === "") return !0;
763
- const C = ur(n(y.node));
764
- if (C === null) return !1;
765
- switch (R.type) {
766
- case "equals":
767
- return v.equals(C, R.filter);
768
- case "contains":
769
- return v.contains(C, R.filter);
770
- case "startsWith":
771
- return v.startsWith(C, R.filter);
772
- case "endsWith":
773
- return v.endsWith(C, R.filter);
774
- case "notContains":
775
- return !v.contains(C, R.filter);
776
- default:
777
- return !0;
778
- }
779
- }
780
- });
781
- function x() {
782
- if (u.trim() === "") {
783
- a(null);
784
- return;
785
- }
786
- a({ type: c, filter: u });
787
- }
788
- function l() {
789
- b(""), g(d ?? "contains"), a(null);
790
- }
791
- const p = dr.map(
792
- (y) => ({
793
- value: y,
794
- label: f(`dataTable.textFilter.operators.${y}`)
795
- })
796
- ), T = i ?? f("dataTable.textFilter.placeholder");
797
- return /* @__PURE__ */ M(
798
- "div",
799
- {
800
- "data-component": "text-filter",
801
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
802
- children: [
803
- /* @__PURE__ */ o(
804
- Kt,
805
- {
806
- size: "sm",
807
- options: p,
808
- value: c,
809
- onValueChange: (y) => {
810
- y !== "" && g(y);
811
- },
812
- "aria-label": f("dataTable.textFilter.operators.contains")
813
- }
814
- ),
815
- /* @__PURE__ */ o(
816
- ye,
817
- {
818
- size: "sm",
819
- value: u,
820
- onChange: (y) => b(y.target.value),
821
- onKeyDown: (y) => {
822
- y.key === "Enter" && (y.preventDefault(), x());
823
- },
824
- placeholder: T,
825
- "aria-label": T,
826
- startAdornment: /* @__PURE__ */ o(ve, { "aria-hidden": "true", className: "ds:size-4" })
827
- }
828
- ),
829
- /* @__PURE__ */ M("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: [
830
- /* @__PURE__ */ o(ae, { intent: "ghost", size: "sm", onClick: l, type: "button", children: f("dataTable.textFilter.clear") }),
831
- /* @__PURE__ */ o(ae, { intent: "primary", size: "sm", onClick: x, type: "button", children: f("dataTable.textFilter.apply") })
832
- ] })
833
- ]
834
- }
835
- );
836
- }
837
- function fr(e) {
838
- var b, v;
839
- const { model: t, onModelChange: a, column: n } = e, { t: i } = D("ui"), d = ((v = (b = n == null ? void 0 : n.getColDef) == null ? void 0 : b.call(n)) == null ? void 0 : v.filterParams) ?? {}, f = d.defaultOperator ?? "contains", m = d.placeholder ?? i("dataTable.textFilter.placeholder"), [c, g] = z((t == null ? void 0 : t.filter) ?? "");
840
- W(() => {
841
- g((t == null ? void 0 : t.filter) ?? "");
842
- }, [t == null ? void 0 : t.filter]), W(() => {
843
- if (c === ((t == null ? void 0 : t.filter) ?? "")) return;
844
- const x = setTimeout(() => {
845
- if (c === "") {
846
- t && a(null);
847
- return;
848
- }
849
- a({ type: f, filter: c });
850
- }, 200);
851
- return () => clearTimeout(x);
852
- }, [c, f, t, a]);
853
- function u() {
854
- g(""), t && a(null);
855
- }
856
- return /* @__PURE__ */ o("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
857
- ye,
858
- {
859
- size: "sm",
860
- value: c,
861
- onChange: (x) => g(x.target.value),
862
- placeholder: m,
863
- "aria-label": m,
864
- startAdornment: /* @__PURE__ */ o(ve, { "aria-hidden": "true", className: "ds:size-4" }),
865
- endAdornment: c.length > 0 ? /* @__PURE__ */ o(
866
- "button",
867
- {
868
- type: "button",
869
- "aria-label": i("dataTable.textFilter.clear"),
870
- onClick: u,
871
- 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",
872
- children: /* @__PURE__ */ o(je, { "aria-hidden": "true", className: "ds:size-4" })
873
- }
874
- ) : void 0
875
- }
876
- ) });
877
- }
878
- const mr = /* @__PURE__ */ new Set(["presentation", "none"]), ze = '[role="presentation"][aria-hidden], [role="none"][aria-hidden]';
879
- function ie(e) {
880
- const t = e.getAttribute("role");
881
- t === null || !mr.has(t) || e.getAttribute("aria-hidden") === "false" && e.removeAttribute("aria-hidden");
882
- }
883
- function gr(e, t = !0) {
884
- W(() => {
885
- const a = e.current;
886
- if (!t || !a || typeof MutationObserver > "u") return;
887
- (() => {
888
- for (const d of a.querySelectorAll(ze)) ie(d);
889
- })();
890
- const i = new MutationObserver((d) => {
891
- for (const f of d)
892
- if (f.type === "attributes")
893
- ie(f.target);
894
- else
895
- for (const m of f.addedNodes)
896
- if (m instanceof Element) {
897
- ie(m);
898
- for (const c of m.querySelectorAll(ze))
899
- ie(c);
900
- }
901
- });
902
- return i.observe(a, {
903
- subtree: !0,
904
- childList: !0,
905
- attributes: !0,
906
- attributeFilter: ["aria-hidden"]
907
- }), () => i.disconnect();
908
- }, [e, t]);
909
- }
910
- const te = "__dsDetailOf", br = "ds-data-table-expanded-row", Ze = "::detail", hr = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
911
- function j(e) {
912
- return typeof e == "object" && e !== null && typeof e[te] == "string";
913
- }
914
- function xr(e) {
915
- return `${e}${Ze}`;
916
- }
917
- function da(e) {
918
- return e.endsWith(Ze);
919
- }
920
- function yr(e, t) {
921
- return { ...e, [te]: t };
922
- }
923
- const Ye = he(
924
- null
925
- );
926
- function vr(e) {
927
- var l;
928
- const t = xe(
929
- Ye
930
- ), { t: a } = D(), n = V(null), { data: i, node: d, api: f } = e, m = j(i), c = t == null ? void 0 : t.heights, g = d.id, u = V(t);
931
- if (u.current = t, W(() => {
932
- const p = n.current;
933
- if (!p || !m || !c || g == null) return;
934
- let T = c.get(g) ?? 0;
935
- const y = () => {
936
- const C = Math.ceil(p.getBoundingClientRect().height);
937
- C <= 0 || C === T || (T = C, c.set(g, C), d.setRowHeight(C), f.onRowHeightChanged());
938
- };
939
- y();
940
- const R = new ResizeObserver(y);
941
- return R.observe(p), () => R.disconnect();
942
- }, [f, g, c, m, d]), W(() => {
943
- const p = n.current, T = p == null ? void 0 : p.parentElement;
944
- if (!p || !T || !m) return;
945
- const y = (R) => {
946
- var C, $;
947
- R.target !== T || R.defaultPrevented || (R.key === "Escape" ? (R.stopPropagation(), ($ = (C = u.current) == null ? void 0 : C.onExpandedRowChange) == null || $.call(C, null)) : R.key === "Enter" && (R.preventDefault(), (p.querySelector(hr) ?? p).focus()));
948
- };
949
- return T.addEventListener("keydown", y), () => T.removeEventListener("keydown", y);
950
- }, [m]), !m) {
951
- const p = t == null ? void 0 : t.fallbackRenderer;
952
- return p ? /* @__PURE__ */ o(p, { ...e }) : null;
953
- }
954
- const b = i[te];
955
- let v;
956
- if (t != null && t.expanded && t.expanded.id === b)
957
- v = t.expanded.row;
958
- else {
959
- const { [te]: p, ...T } = i;
960
- v = T;
961
- }
962
- return /* @__PURE__ */ M(
963
- "div",
964
- {
965
- ref: n,
966
- role: "gridcell",
967
- tabIndex: -1,
968
- "data-component": "data-table-expanded-row",
969
- "data-expanded-row-of": b,
970
- className: "ds-data-table-expanded-row-surface",
971
- onKeyDown: (p) => {
972
- var T;
973
- p.key !== "Escape" || p.defaultPrevented || (p.stopPropagation(), (T = t == null ? void 0 : t.onExpandedRowChange) == null || T.call(t, null));
974
- },
975
- children: [
976
- /* @__PURE__ */ o("span", { className: "ds:sr-only", children: a("dataTable.expandedRow") }),
977
- (l = t == null ? void 0 : t.renderExpandedRow) == null ? void 0 : l.call(t, v)
978
- ]
979
- }
980
- );
981
- }
982
- const Tr = {
983
- id: "data-table",
984
- capabilities: [
985
- "select_single",
986
- "select_multiple",
987
- "range_pick",
988
- "filter",
989
- "sort",
990
- "paginate"
991
- ],
992
- state: {
993
- selection: {
994
- type: "string[]",
995
- descriptionKey: "ui.agent.dataTable.state.selection",
996
- description: "Row ids of currently-selected rows.",
997
- read: (e) => e.getSelection()
998
- },
999
- filter: {
1000
- type: "object",
1001
- descriptionKey: "ui.agent.dataTable.state.filter",
1002
- description: "Current ag-grid filter model, keyed by column id.",
1003
- read: (e) => e.getFilter()
1004
- },
1005
- sort: {
1006
- type: "Array<{ colId, sort }>",
1007
- descriptionKey: "ui.agent.dataTable.state.sort",
1008
- description: "Active sort, in priority order.",
1009
- read: (e) => e.getSort()
1010
- },
1011
- currentPage: {
1012
- type: "number",
1013
- descriptionKey: "ui.agent.dataTable.state.currentPage",
1014
- description: "Zero-indexed page number.",
1015
- read: (e) => e.getCurrentPage()
1016
- },
1017
- expandedRowId: {
1018
- type: "string | null",
1019
- descriptionKey: "ui.agent.dataTable.state.expandedRowId",
1020
- description: "Id of the row whose inline detail is open (expandable row), or null.",
1021
- read: (e) => e.getExpandedRowId()
1022
- }
1023
- },
1024
- actions: {
1025
- select_rows: {
1026
- // Transient grid selection (data-table convention) — stays read.
1027
- safety: "read",
1028
- argsType: "{ ids: string[] }",
1029
- argsSchema: {
1030
- type: "object",
1031
- properties: {
1032
- ids: {
1033
- type: "array",
1034
- items: { type: "string" },
1035
- description: "Row ids to select (replaces the current selection)."
1036
- }
1037
- },
1038
- required: ["ids"]
1039
- },
1040
- idempotent: !0,
1041
- descriptionKey: "ui.agent.dataTable.actions.selectRows",
1042
- description: "Replace the current selection with the given row ids.",
1043
- examples: [
1044
- { args: { ids: ["r-1", "r-2"] }, note: "Select the first two rows." }
1045
- ],
1046
- invoke: (e, t) => {
1047
- e.setSelection(t.ids);
1048
- }
1049
- },
1050
- select_range: {
1051
- safety: "read",
1052
- argsType: "{ fromId: string, toId: string }",
1053
- argsSchema: {
1054
- type: "object",
1055
- properties: {
1056
- fromId: { type: "string", description: "Start row id (inclusive)." },
1057
- toId: { type: "string", description: "End row id (inclusive)." }
1058
- },
1059
- required: ["fromId", "toId"]
1060
- },
1061
- idempotent: !0,
1062
- descriptionKey: "ui.agent.dataTable.actions.selectRange",
1063
- description: "Select every row between fromId and toId, inclusive, in current sort order.",
1064
- invoke: (e, t) => {
1065
- e.selectRange(t.fromId, t.toId);
1066
- }
1067
- },
1068
- clear_selection: {
1069
- safety: "read",
1070
- idempotent: !0,
1071
- descriptionKey: "ui.agent.dataTable.actions.clearSelection",
1072
- description: "Deselect all rows.",
1073
- invoke: (e) => {
1074
- e.clearSelection();
1075
- }
1076
- },
1077
- get_selection: {
1078
- safety: "read",
1079
- returns: "string[]",
1080
- returnsSchema: { type: "array", items: { type: "string" } },
1081
- idempotent: !0,
1082
- descriptionKey: "ui.agent.dataTable.actions.getSelection",
1083
- description: "Return the row ids of the currently-selected rows.",
1084
- invoke: (e) => e.getSelection()
1085
- },
1086
- apply_filter: {
1087
- safety: "read",
1088
- argsType: "{ model: Record<string, unknown> }",
1089
- argsSchema: {
1090
- type: "object",
1091
- properties: {
1092
- model: {
1093
- type: "object",
1094
- description: "ag-grid filter model keyed by column id. Opaque per-column filter shapes; replaces the current model.",
1095
- additionalProperties: !0
1096
- }
1097
- },
1098
- required: ["model"]
1099
- },
1100
- idempotent: !0,
1101
- descriptionKey: "ui.agent.dataTable.actions.applyFilter",
1102
- description: "Replace the filter model with the given object.",
1103
- invoke: (e, t) => {
1104
- e.setFilter(t.model);
1105
- }
1106
- },
1107
- sort_by: {
1108
- safety: "read",
1109
- argsType: "{ model: DataTableSortEntry[] }",
1110
- argsSchema: {
1111
- type: "object",
1112
- properties: {
1113
- model: {
1114
- type: "array",
1115
- description: "Sort entries in priority order.",
1116
- items: {
1117
- type: "object",
1118
- properties: {
1119
- colId: { type: "string", description: "Column id to sort by." },
1120
- sort: { enum: ["asc", "desc"], description: "Sort direction." }
1121
- },
1122
- required: ["colId", "sort"]
1123
- }
1124
- }
1125
- },
1126
- required: ["model"]
1127
- },
1128
- idempotent: !0,
1129
- descriptionKey: "ui.agent.dataTable.actions.sortBy",
1130
- description: "Replace the active sort with the given list (priority order).",
1131
- examples: [
1132
- {
1133
- args: { model: [{ colId: "name", sort: "asc" }] },
1134
- note: "Sort by name ascending."
1135
- }
1136
- ],
1137
- invoke: (e, t) => {
1138
- e.setSort(t.model);
1139
- }
1140
- },
1141
- go_to_page: {
1142
- safety: "read",
1143
- argsType: "{ page: number }",
1144
- argsSchema: {
1145
- type: "object",
1146
- properties: {
1147
- page: {
1148
- type: "integer",
1149
- minimum: 0,
1150
- description: "Zero-indexed page number."
1151
- }
1152
- },
1153
- required: ["page"]
1154
- },
1155
- idempotent: !0,
1156
- descriptionKey: "ui.agent.dataTable.actions.goToPage",
1157
- description: "Navigate to the given zero-indexed page.",
1158
- invoke: (e, t) => {
1159
- e.goToPage(t.page);
1160
- }
1161
- }
1162
- },
1163
- domHooks: {
1164
- root: {
1165
- attr: "data-component",
1166
- value: "data-table",
1167
- description: "Marks the DataTable wrapper."
1168
- },
1169
- instanceId: {
1170
- attr: "data-component-id",
1171
- sourceProp: "gridId",
1172
- description: "Sourced from the gridId prop. Required to address a specific table from the agent."
1173
- },
1174
- item: {
1175
- attr: "row-id",
1176
- description: 'Native ag-grid row-id attribute on each rendered record row. When an expandable row is open, one extra full-width row with row-id `<parentId>::detail` is the accordion detail, not a record — its cell carries data-component="data-table-expanded-row" and data-expanded-row-of="<parentId>"; skip it when enumerating rows (isExpandedRowDetailId). Selection is performed via the curated handle, not by DOM mutation.'
1177
- }
1178
- }
1179
- };
1180
- Mt.registerModules([_t]);
1181
- const wr = Pt("ag-theme-alfadocs ds:w-full", {
1182
- variants: {
1183
- density: {
1184
- default: "",
1185
- compact: "data-table-compact",
1186
- expanded: "data-table-expanded"
1187
- },
1188
- bordered: {
1189
- true: "",
1190
- false: "ds:[--ag-borders:none]"
1191
- }
1192
- },
1193
- defaultVariants: {
1194
- density: "default",
1195
- bordered: !0
1196
- }
1197
- });
1198
- function Cr() {
1199
- const { t: e } = D();
1200
- return G(
1201
- () => ({
1202
- // Filter strings
1203
- contains: e("dataTable.agGrid.contains"),
1204
- notContains: e("dataTable.agGrid.notContains"),
1205
- equals: e("dataTable.agGrid.equals"),
1206
- notEqual: e("dataTable.agGrid.notEqual"),
1207
- startsWith: e("dataTable.agGrid.startsWith"),
1208
- endsWith: e("dataTable.agGrid.endsWith"),
1209
- lessThan: e("dataTable.agGrid.lessThan"),
1210
- greaterThan: e("dataTable.agGrid.greaterThan"),
1211
- inRange: e("dataTable.agGrid.inRange"),
1212
- blank: e("dataTable.agGrid.blank"),
1213
- notBlank: e("dataTable.agGrid.notBlank"),
1214
- filterOoo: e("dataTable.agGrid.filterOoo"),
1215
- applyFilter: e("dataTable.agGrid.applyFilter"),
1216
- resetFilter: e("dataTable.agGrid.resetFilter"),
1217
- noRowsToShow: e("dataTable.agGrid.noRowsToShow"),
1218
- selectAll: e("dataTable.agGrid.selectAll"),
1219
- // Pagination
1220
- page: e("dataTable.page"),
1221
- of: e("dataTable.of"),
1222
- to: e("dataTable.to"),
1223
- nextPage: e("dataTable.nextPage"),
1224
- previousPage: e("dataTable.previousPage"),
1225
- firstPage: e("dataTable.firstPage"),
1226
- lastPage: e("dataTable.lastPage"),
1227
- pageSize: e("dataTable.pageSize")
1228
- }),
1229
- [e]
1230
- );
1231
- }
1232
- function Rr() {
1233
- return /* @__PURE__ */ o(
1234
- "div",
1235
- {
1236
- role: "status",
1237
- "aria-live": "polite",
1238
- className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
1239
- children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ o(
1240
- kt,
1241
- {
1242
- variant: "rectangular",
1243
- className: "ds:h-[var(--min-target-size)] ds:w-full"
1244
- },
1245
- t
1246
- ))
1247
- }
1248
- );
1249
- }
1250
- function Sr() {
1251
- const { t: e } = D();
1252
- return /* @__PURE__ */ o(
1253
- At,
1254
- {
1255
- variant: "no-results",
1256
- size: "sm",
1257
- title: e("dataTable.noRows"),
1258
- description: e("dataTable.noRowsDescription")
1259
- }
1260
- );
1261
- }
1262
- function et(e) {
1263
- return e.map(({ hide: t, pinned: a, ...n }) => n);
1264
- }
1265
- function Ir(e) {
1266
- try {
1267
- const t = localStorage.getItem(`data-table-col-state:${e}`);
1268
- if (!t) return null;
1269
- const a = JSON.parse(t);
1270
- return Array.isArray(a) ? et(a) : null;
1271
- } catch {
1272
- return null;
1273
- }
1274
- }
1275
- function Er(e, t) {
1276
- try {
1277
- localStorage.setItem(
1278
- `data-table-col-state:${e}`,
1279
- JSON.stringify(et(t.getColumnState()))
1280
- );
1281
- } catch {
1282
- }
1283
- }
1284
- const Nr = /* @__PURE__ */ new Set([
1285
- "api",
1286
- "flex",
1287
- "gridInitializing",
1288
- "gridOptionsChanged",
1289
- "autosizeColumns",
1290
- "sizeColumnsToFit"
1291
- ]);
1292
- function Dr(e, t) {
1293
- const {
1294
- columnDefs: a,
1295
- rowData: n,
1296
- rowSelection: i,
1297
- pagination: d = !1,
1298
- paginationPageSize: f = 25,
1299
- paginationPageSizeSelector: m = [10, 25, 50, 100],
1300
- gridId: c,
1301
- onSelectionChanged: g,
1302
- onSortChanged: u,
1303
- onFilterChanged: b,
1304
- noRowsOverlay: v,
1305
- loadingOverlay: x,
1306
- gridOptions: l,
1307
- density: p,
1308
- bordered: T,
1309
- heightClass: y = "ds:h-[500px]",
1310
- className: R,
1311
- getRowClass: C,
1312
- pinnedBottomRowData: $,
1313
- printMode: w = !1,
1314
- expandedRowId: k,
1315
- renderExpandedRow: L,
1316
- onExpandedRowChange: I,
1317
- children: A
1318
- } = e, O = k !== void 0 || L !== void 0, B = l == null ? void 0 : l.getRowId;
1319
- if (O && !B)
1320
- throw new Error(
1321
- "DataTable: `expandedRowId` / `renderExpandedRow` require `gridOptions.getRowId` — the expanded row is addressed by row id, not by index."
1322
- );
1323
- const { t: K, i18n: ne } = D(), S = V(null), Ne = V(null);
1324
- gr(Ne);
1325
- const [ce, rt] = z(0), [ue, pe] = z(""), at = Cr(), De = V(k);
1326
- De.current = k;
1327
- const fe = G(
1328
- () => ({
1329
- getSelection: () => {
1330
- var h;
1331
- const r = (h = S.current) == null ? void 0 : h.api;
1332
- if (!r) return [];
1333
- const s = [];
1334
- for (const E of r.getSelectedNodes())
1335
- E.id != null && !j(E.data) && s.push(E.id);
1336
- return s;
1337
- },
1338
- setSelection: (r) => {
1339
- var E;
1340
- const s = (E = S.current) == null ? void 0 : E.api;
1341
- if (!s) return;
1342
- const h = new Set(r);
1343
- s.forEachNode((F) => {
1344
- F.id != null && F.setSelected(h.has(F.id));
1345
- });
1346
- },
1347
- selectRange: (r, s) => {
1348
- var Pe;
1349
- const h = (Pe = S.current) == null ? void 0 : Pe.api;
1350
- if (!h) return;
1351
- const E = [];
1352
- h.forEachNodeAfterFilterAndSort((Z) => {
1353
- Z.id != null && !j(Z.data) && E.push(Z.id);
1354
- });
1355
- const F = E.indexOf(r), P = E.indexOf(s);
1356
- if (F < 0 || P < 0) return;
1357
- const [_, Y] = F <= P ? [F, P] : [P, F], J = new Set(E.slice(_, Y + 1));
1358
- h.forEachNode((Z) => {
1359
- Z.id != null && Z.setSelected(J.has(Z.id));
1360
- });
1361
- },
1362
- clearSelection: () => {
1363
- var r, s;
1364
- (s = (r = S.current) == null ? void 0 : r.api) == null || s.deselectAll();
1365
- },
1366
- getFilter: () => {
1367
- var r, s;
1368
- return ((s = (r = S.current) == null ? void 0 : r.api) == null ? void 0 : s.getFilterModel()) ?? {};
1369
- },
1370
- setFilter: (r) => {
1371
- var s, h;
1372
- (h = (s = S.current) == null ? void 0 : s.api) == null || h.setFilterModel(r);
1373
- },
1374
- getSort: () => {
1375
- var s;
1376
- const r = (s = S.current) == null ? void 0 : s.api;
1377
- return r ? r.getColumnState().filter((h) => h.sort === "asc" || h.sort === "desc").map((h) => ({ colId: h.colId, sort: h.sort })) : [];
1378
- },
1379
- setSort: (r) => {
1380
- var E;
1381
- const s = (E = S.current) == null ? void 0 : E.api;
1382
- if (!s) return;
1383
- const h = s.getColumnState().map((F) => {
1384
- const P = r.find((_) => _.colId === F.colId);
1385
- return { ...F, sort: P ? P.sort : null };
1386
- });
1387
- s.applyColumnState({ state: h, defaultState: { sort: null } });
1388
- },
1389
- getCurrentPage: () => {
1390
- var r, s;
1391
- return ((s = (r = S.current) == null ? void 0 : r.api) == null ? void 0 : s.paginationGetCurrentPage()) ?? 0;
1392
- },
1393
- goToPage: (r) => {
1394
- var s, h;
1395
- (h = (s = S.current) == null ? void 0 : s.api) == null || h.paginationGoToPage(r);
1396
- },
1397
- getExpandedRowId: () => De.current ?? null,
1398
- getRawApi: () => {
1399
- var r;
1400
- return (r = S.current) == null ? void 0 : r.api;
1401
- }
1402
- }),
1403
- []
1404
- );
1405
- Ft(t, () => fe, [fe]), Ht(Tr, fe, c);
1406
- const nt = ne.dir() === "rtl", ot = n === void 0, st = Vt(), { resolvedTheme: Fe } = Ut(), it = (Fe === "light-accessible" || Fe === "dark-accessible") && p === "compact" ? "default" : p, lt = G(() => {
1407
- if (!i) return;
1408
- const r = (s) => !j(s.data);
1409
- return i === "single" ? { mode: "singleRow", isRowSelectable: r } : {
1410
- mode: "multiRow",
1411
- headerCheckbox: !0,
1412
- checkboxes: !0,
1413
- isRowSelectable: r
1414
- };
1415
- }, [i]), dt = N(() => {
1416
- var s;
1417
- if (!c || !((s = S.current) != null && s.api)) return;
1418
- const r = Ir(c);
1419
- r && S.current.api.applyColumnState({
1420
- state: r,
1421
- applyOrder: !0
1422
- });
1423
- }, [c]), me = N(
1424
- (r) => {
1425
- var s;
1426
- r.source && Nr.has(r.source) || c && ((s = S.current) != null && s.api) && Er(c, S.current.api);
1427
- },
1428
- [c]
1429
- ), ct = G(() => {
1430
- if (!l) return;
1431
- const r = { ...l };
1432
- return delete r.defaultColDef, O && (delete r.getRowId, delete r.isFullWidthRow, delete r.fullWidthCellRenderer, delete r.getRowHeight, delete r.postSortRows, delete r.getRowClass, delete r.defaultCsvExportParams, delete r.defaultExcelExportParams), r;
1433
- }, [O, l]), ke = V(/* @__PURE__ */ new Map()), re = V(l);
1434
- re.current = l;
1435
- const Ae = N(
1436
- (r) => {
1437
- var s;
1438
- return B == null ? void 0 : B({
1439
- data: r,
1440
- level: 0,
1441
- api: (s = S.current) == null ? void 0 : s.api,
1442
- context: l == null ? void 0 : l.context
1443
- });
1444
- },
1445
- [B, l == null ? void 0 : l.context]
1446
- ), Q = G(() => {
1447
- if (!O || k == null || !n) return null;
1448
- const r = n.find((s) => Ae(s) === k);
1449
- return r === void 0 ? null : { id: k, row: r };
1450
- }, [O, k, Ae, n]), ut = G(() => {
1451
- if (!Q || !n) return n;
1452
- const r = n.indexOf(Q.row), s = yr(Q.row, Q.id);
1453
- return [
1454
- ...n.slice(0, r + 1),
1455
- s,
1456
- ...n.slice(r + 1)
1457
- ];
1458
- }, [Q, n]), pt = N(
1459
- (r) => j(r.data) ? xr(r.data[te]) : B(r),
1460
- [B]
1461
- ), ft = N(
1462
- (r) => {
1463
- var s, h;
1464
- return j(r.rowNode.data) || (((h = (s = re.current) == null ? void 0 : s.isFullWidthRow) == null ? void 0 : h.call(s, r)) ?? !1);
1465
- },
1466
- []
1467
- ), mt = N(
1468
- (r) => {
1469
- var s, h;
1470
- return j(r.data) ? ke.current.get(r.node.id ?? "") : (h = (s = re.current) == null ? void 0 : s.getRowHeight) == null ? void 0 : h.call(s, r);
1471
- },
1472
- []
1473
- ), gt = N(
1474
- (r) => {
1475
- var _, Y;
1476
- (Y = (_ = re.current) == null ? void 0 : _.postSortRows) == null || Y.call(_, r);
1477
- const { nodes: s } = r, h = s.findIndex((J) => j(J.data));
1478
- if (h < 0) return;
1479
- const [E] = s.splice(h, 1), F = E.data[te], P = s.findIndex((J) => J.id === F);
1480
- s.splice(P < 0 ? s.length : P + 1, 0, E);
1481
- },
1482
- []
1483
- ), bt = N(
1484
- (r) => {
1485
- var s, h;
1486
- return j(r.data) ? br : ((h = (s = re.current) == null ? void 0 : s.getRowClass) == null ? void 0 : h.call(s, r)) ?? (C == null ? void 0 : C(r));
1487
- },
1488
- [C]
1489
- ), oe = N(
1490
- (r) => j(r.node.data),
1491
- []
1492
- ), ht = G(() => {
1493
- if (!O) return;
1494
- const r = l == null ? void 0 : l.defaultCsvExportParams;
1495
- return {
1496
- ...r,
1497
- shouldRowBeSkipped: (s) => {
1498
- var h;
1499
- return oe(s) || (((h = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : h.call(r, s)) ?? !1);
1500
- }
1501
- };
1502
- }, [O, l == null ? void 0 : l.defaultCsvExportParams, oe]), xt = G(() => {
1503
- if (!O) return;
1504
- const r = l == null ? void 0 : l.defaultExcelExportParams;
1505
- return {
1506
- ...r,
1507
- shouldRowBeSkipped: (s) => {
1508
- var h;
1509
- return oe(s) || (((h = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : h.call(r, s)) ?? !1);
1510
- }
1511
- };
1512
- }, [O, l == null ? void 0 : l.defaultExcelExportParams, oe]), ge = l == null ? void 0 : l.fullWidthCellRenderer, yt = G(
1513
- () => ({
1514
- renderExpandedRow: L,
1515
- onExpandedRowChange: I,
1516
- expanded: Q,
1517
- heights: ke.current,
1518
- fallbackRenderer: typeof ge == "function" ? ge : void 0
1519
- }),
1520
- [
1521
- ge,
1522
- Q,
1523
- I,
1524
- L
1525
- ]
1526
- ), vt = N(() => {
1527
- var h;
1528
- const r = (h = S.current) == null ? void 0 : h.api;
1529
- if (!r) return;
1530
- const s = r.getSelectedRows().filter((E) => !j(E));
1531
- rt(s.length), g == null || g(s);
1532
- }, [g]), Tt = N(
1533
- (r) => {
1534
- var h;
1535
- const s = (h = S.current) == null ? void 0 : h.api;
1536
- if (s) {
1537
- const F = s.getColumnState().find((P) => P.sort);
1538
- if (F) {
1539
- const P = F.colId, _ = s.getColumnDef(P), Y = (_ == null ? void 0 : _.headerName) ?? P, J = F.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
1540
- pe(
1541
- K("dataTable.sortAnnounce", {
1542
- column: Y,
1543
- direction: K(J)
1544
- })
1545
- );
1546
- } else
1547
- pe("");
1548
- }
1549
- u == null || u(r);
1550
- },
1551
- [u, K]
1552
- ), wt = N(
1553
- (r) => {
1554
- b == null || b(r);
1555
- },
1556
- [b]
1557
- );
1558
- W(() => {
1559
- if (!ue) return;
1560
- const r = setTimeout(() => pe(""), 3e3);
1561
- return () => clearTimeout(r);
1562
- }, [ue]);
1563
- const Ct = v ?? Sr, Rt = x ?? Rr, St = N(
1564
- () => {
1565
- var r;
1566
- return (r = S.current) == null ? void 0 : r.api;
1567
- },
1568
- []
1569
- ), It = N(() => {
1570
- typeof window < "u" && window.print();
1571
- }, []), Et = wr({
1572
- density: it,
1573
- bordered: T,
1574
- className: R
1575
- }), Nt = A ?? /* @__PURE__ */ o("div", { className: "data-table-toolbar ds:flex ds:justify-end", children: /* @__PURE__ */ M(
1576
- Le,
1577
- {
1578
- role: "toolbar",
1579
- "aria-label": K("dataTable.tableActions"),
1580
- className: "ds:bg-[var(--background)]",
1581
- children: [
1582
- /* @__PURE__ */ o(le.ExportMenu, {}),
1583
- /* @__PURE__ */ o(le.Print, {}),
1584
- /* @__PURE__ */ o(le.ColumnToggle, {})
1585
- ]
1586
- }
1587
- ) }), Dt = w ? !1 : d;
1588
- return /* @__PURE__ */ M(
1589
- "div",
1590
- {
1591
- className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
1592
- "aria-busy": ot ? "true" : void 0,
1593
- "data-component": "data-table",
1594
- "data-component-id": c,
1595
- "data-print-mode": w ? "true" : void 0,
1596
- children: [
1597
- !w && /* @__PURE__ */ o(
1598
- Yt,
1599
- {
1600
- getApi: St,
1601
- selectionCount: ce,
1602
- onPrint: It,
1603
- children: Nt
1604
- }
1605
- ),
1606
- /* @__PURE__ */ o(
1607
- "div",
1608
- {
1609
- ref: Ne,
1610
- className: [Et, w ? "" : y].join(" ").trim(),
1611
- children: /* @__PURE__ */ o(
1612
- Ye.Provider,
1613
- {
1614
- value: yt,
1615
- children: /* @__PURE__ */ o(
1616
- zt,
1617
- {
1618
- ref: S,
1619
- theme: "legacy",
1620
- columnDefs: a,
1621
- rowData: ut,
1622
- defaultColDef: {
1623
- sortable: !0,
1624
- // Default filter = DS-styled text filter so untyped columns
1625
- // (no explicit `filter:` override) inherit the kit's form
1626
- // language instead of AG Grid's stock browser-skinned input.
1627
- // Number / date / select columns opt into their dedicated
1628
- // wrapper per-column.
1629
- filter: pr,
1630
- floatingFilterComponent: fr,
1631
- resizable: !0,
1632
- floatingFilter: !0,
1633
- // §13d — faint sort icon advertises which columns are
1634
- // sortable. v33+ moved this from grid-level to defaultColDef.
1635
- unSortIcon: !0,
1636
- ...l == null ? void 0 : l.defaultColDef
1637
- },
1638
- rowSelection: lt,
1639
- pagination: Dt,
1640
- paginationPageSize: f,
1641
- paginationPageSizeSelector: m,
1642
- paginationNumberFormatter: (r) => new Intl.NumberFormat(ne.language).format(r.value),
1643
- animateRows: !st,
1644
- enableRtl: nt,
1645
- ensureDomOrder: !0,
1646
- enableCellSpan: !0,
1647
- enableCellTextSelection: !0,
1648
- copyHeadersToClipboard: !0,
1649
- accentedSort: !0,
1650
- multiSortKey: "ctrl",
1651
- suppressDragLeaveHidesColumns: !0,
1652
- suppressRowClickSelection: i ? !0 : void 0,
1653
- tooltipShowDelay: 500,
1654
- tooltipHideDelay: 5e3,
1655
- tooltipInteraction: !0,
1656
- stopEditingWhenCellsLoseFocus: !0,
1657
- maintainColumnOrder: !0,
1658
- undoRedoCellEditing: !0,
1659
- undoRedoCellEditingLimit: 20,
1660
- suppressCellFocus: !1,
1661
- rowBuffer: 10,
1662
- localeText: at,
1663
- noRowsOverlayComponent: Ct,
1664
- loadingOverlayComponent: Rt,
1665
- getRowClass: O ? bt : C,
1666
- pinnedBottomRowData: $,
1667
- domLayout: w ? "autoHeight" : void 0,
1668
- onGridReady: dt,
1669
- onColumnMoved: me,
1670
- onColumnResized: me,
1671
- onColumnPinned: me,
1672
- onSortChanged: Tt,
1673
- onFilterChanged: wt,
1674
- onSelectionChanged: vt,
1675
- ...ct,
1676
- ...O ? {
1677
- getRowId: pt,
1678
- isFullWidthRow: ft,
1679
- fullWidthCellRenderer: vr,
1680
- getRowHeight: mt,
1681
- postSortRows: gt,
1682
- defaultCsvExportParams: ht,
1683
- defaultExcelExportParams: xt
1684
- } : {}
1685
- }
1686
- )
1687
- }
1688
- )
1689
- }
1690
- ),
1691
- !w && /* @__PURE__ */ o("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: ce > 0 ? /* @__PURE__ */ o("span", { children: K("dataTable.selected", { count: ce }) }) : /* @__PURE__ */ o("span", {}) }),
1692
- /* @__PURE__ */ o("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: ue })
1693
- ]
1694
- }
1695
- );
1696
- }
1697
- const tt = q(Dr);
1698
- tt.displayName = "DataTable";
1699
- const ca = Object.assign(tt, {
1700
- Toolbar: le
1701
- });
1702
- function Me(e) {
1703
- if (!_e(e)) return e;
1704
- const t = e, a = t.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} size-4`.trim();
1705
- return Ge(t, { className: n, size: t.props.size ?? 16 });
1706
- }
1707
- function ua(e) {
1708
- return Math.max(1, e) * 32 + 28;
1709
- }
1710
- function be(e, t) {
1711
- return typeof e == "function" ? e(t) : !!e;
1712
- }
1713
- const Fr = "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]";
1714
- function pa(e) {
1715
- const { data: t, actions: a, intent: n = "ghost", group: i, label: d, collapsed: f } = e, { t: m } = D();
1716
- if (!t) return null;
1717
- const c = a.filter((b) => !be(b.hidden, t));
1718
- if (typeof f == "function" ? f() : !!f)
1719
- return /* @__PURE__ */ M(U.Root, { children: [
1720
- /* @__PURE__ */ o(U.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
1721
- X,
1722
- {
1723
- size: "sm",
1724
- intent: n,
1725
- icon: /* @__PURE__ */ o(Xt, { "aria-hidden": !0 }),
1726
- "aria-label": d ?? m("dataTable.actions", "Actions")
1727
- }
1728
- ) }),
1729
- /* @__PURE__ */ o(U.Content, { align: "end", children: c.map((b, v) => /* @__PURE__ */ o(
1730
- U.Item,
1731
- {
1732
- startIcon: Me(b.icon),
1733
- disabled: be(b.disabled, t),
1734
- onSelect: () => b.onClick(t),
1735
- className: b.variant === "destructive" ? "ds:text-[color:var(--destructive)]" : void 0,
1736
- children: b.label
1737
- },
1738
- v
1739
- )) })
1740
- ] });
1741
- const u = c.map((b, v) => {
1742
- const x = be(b.disabled, t), l = x && b.disabledReason ? b.disabledReason : b.label;
1743
- return /* @__PURE__ */ o(
1744
- X,
1745
- {
1746
- size: "sm",
1747
- intent: n,
1748
- icon: Me(b.icon),
1749
- tooltip: l,
1750
- "aria-label": b.label,
1751
- disabled: x,
1752
- onClick: (p) => {
1753
- p.stopPropagation(), b.onClick(t);
1754
- },
1755
- className: b.variant === "destructive" ? Fr : void 0
1756
- },
1757
- v
1758
- );
1759
- });
1760
- return i ? /* @__PURE__ */ o(
1761
- Le,
1762
- {
1763
- "aria-label": d ?? m("dataTable.actions", "Actions"),
1764
- size: "sm",
1765
- children: u
1766
- }
1767
- ) : /* @__PURE__ */ o("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: u });
1768
- }
1769
- export {
1770
- pa as A,
1771
- ca as D,
1772
- br as E,
1773
- pr as T,
1774
- fr as a,
1775
- le as b,
1776
- Yt as c,
1777
- ua as d,
1778
- Tr as e,
1779
- He as f,
1780
- xr as g,
1781
- da as h,
1782
- j as i
1783
- };
1784
- //# sourceMappingURL=actions-cell-renderer-B2pw6iH8.js.map