@alfadocs/ui-kit 1.9.4 → 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,1795 +0,0 @@
1
- import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
- import { useMemo as L, forwardRef as B, useState as M, useCallback as N, useEffect as $, useRef as V, createContext as ye, useContext as ve, isValidElement as Ge, cloneElement as Le, 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 je } from "./icon-button-group-D6SVMteH.js";
10
- import { B as ie } from "./button-nJaPh_HC.js";
11
- import { I as X } from "./icon-button-DA2CAGHZ.js";
12
- import { P as de } from "./popover-Cqcjx-Ny.js";
13
- import { C as Gt } from "./checkbox-BuZ1u__2.js";
14
- import { T as Te } from "./text-input-CUvCb6ST.js";
15
- import { T as ze } from "./tag-3wgkwwDB.js";
16
- import { D as U } from "./dropdown-menu-DU-Hrf33.js";
17
- import { X as qe } from "./x-B5YnXwCz.js";
18
- import { R as Lt } from "./refresh-cw-DnI0cLFC.js";
19
- import { S as we } 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 Be } from "./file-text-5yv6r2ls.js";
24
- import { D as pe } 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 (!Ge(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 Le(t, { className: n, size: t.props.size ?? 16 });
56
- }
57
- const We = ye(null);
58
- function H(e) {
59
- const t = ve(We);
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 = L(
73
- () => ({ getApi: e, selectionCount: t, onPrint: a }),
74
- [e, t, a]
75
- );
76
- return /* @__PURE__ */ o(We.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(" "), $e = B(
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
- $e.displayName = "DataTable.Toolbar";
103
- const Ke = B(
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
- Ke.displayName = "DataTable.Toolbar.FilterBar";
123
- const He = B(
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
- He.displayName = "DataTable.Toolbar.Actions";
139
- const Ce = B(
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(pe, { "aria-hidden": !0 }),
152
- tooltip: e ?? d("dataTable.exportCsv"),
153
- onClick: m,
154
- ...n
155
- }
156
- );
157
- }
158
- );
159
- Ce.displayName = "DataTable.Toolbar.ExportCsv";
160
- function te(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 Ve(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 w = e.getCellValue({
181
- rowNode: x,
182
- colKey: p,
183
- useFormatter: !0
184
- });
185
- return w == null ? "" : String(w);
186
- });
187
- m.push(l);
188
- });
189
- const c = te("--muted", [240, 240, 240]), g = te("--foreground", [30, 30, 30]), u = te("--card-foreground", [30, 30, 30]), b = te("--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 Re = B(
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
- Ve(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(Be, { "aria-hidden": !0 }),
222
- tooltip: e ?? f("dataTable.exportPdf"),
223
- onClick: c,
224
- ...i
225
- }
226
- );
227
- }
228
- );
229
- Re.displayName = "DataTable.Toolbar.ExportPdf";
230
- const Se = B(
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
- Se.displayName = "DataTable.Toolbar.Print";
248
- const Ue = ({ placeholder: e, debounceMs: t = 150 }) => {
249
- const { t: a } = D(), { getApi: n } = H("DataTable.Toolbar.QuickSearch"), [i, d] = M(""), f = V(void 0);
250
- return $(() => (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
- Te,
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(we, { "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
- Ue.displayName = "DataTable.Toolbar.QuickSearch";
278
- const Ie = B(
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
- Ie.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 Xe = () => {
306
- const { t: e } = D(), { getApi: t } = H("DataTable.Toolbar.FilterChips"), [a, n] = M([]), [i, d] = M(""), 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 w = v.find((R) => R.getColId() === p), y = u.getDisplayNameForColumn(w, 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 ($(() => {
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__ */ _(
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
- ze,
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
- ze,
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
- ie,
380
- {
381
- type: "button",
382
- intent: "ghost",
383
- size: "sm",
384
- onClick: g,
385
- startIcon: /* @__PURE__ */ o(qe, { "aria-hidden": !0, className: "ds:size-4" }),
386
- children: e("dataTable.filterChips.clearAll", "Clear all")
387
- }
388
- )
389
- ]
390
- }
391
- );
392
- };
393
- Xe.displayName = "DataTable.Toolbar.FilterChips";
394
- const Qe = ({
395
- field: e,
396
- options: t,
397
- label: a
398
- }) => {
399
- const { t: n } = D(), { getApi: i } = H("DataTable.Toolbar.FacetFilter"), [d, f] = M(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
- ie,
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
- Qe.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((w) => {
450
- const y = e.getCellValue({
451
- rowNode: p,
452
- colKey: w,
453
- useFormatter: !0
454
- });
455
- return y ?? "";
456
- })
457
- );
458
- });
459
- const m = te("--muted", [240, 240, 240]), c = te("--foreground", [30, 30, 30]), g = i.getRow(1), u = ([p, w, y]) => `${p.toString(16).padStart(2, "0")}${w.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 Je = ye(null);
473
- function nr() {
474
- const e = ve(Je);
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 Ee = B(
482
- ({ children: e, label: t, intent: a = "outline", ...n }, i) => {
483
- const { t: d } = D(), { getApi: f } = H("DataTable.Toolbar.ExportMenu"), m = L(() => ({ getApi: f }), [f]), c = e ?? rr.map((g) => /* @__PURE__ */ o(Ne, { format: g }, g));
484
- return /* @__PURE__ */ o(Je.Provider, { value: m, children: /* @__PURE__ */ _(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(pe, { "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
- Ee.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(pe, { "aria-hidden": !0, className: "ds:size-4" }) : e === "xlsx" ? /* @__PURE__ */ o(Wt, { "aria-hidden": !0, className: "ds:size-4" }) : e === "pdf" ? /* @__PURE__ */ o(Be, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ o(pe, { "aria-hidden": !0, className: "ds:size-4" });
508
- }
509
- const Ne = ({
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
- Ve(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__ */ _("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
- Ne.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 De = B(
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] = M(!1), [v, x] = M([]), [l, p] = M(null), [w, y] = M(null);
551
- $(() => {
552
- u && x(ir(g()));
553
- }, [u, g]);
554
- const R = N(
555
- (T, F) => {
556
- const z = g();
557
- z && (z.setColumnsVisible([T], F), x(
558
- (I) => I.map(
559
- (j) => j.colId === T ? { ...j, visible: F } : j
560
- )
561
- ));
562
- },
563
- [g]
564
- ), C = N(
565
- (T, F) => {
566
- if (T === F) return;
567
- const z = g();
568
- if (!z) return;
569
- x((A) => {
570
- const ae = A.findIndex((oe) => oe.colId === T), S = A.findIndex((oe) => oe.colId === F);
571
- if (ae < 0 || S < 0) return A;
572
- const Y = [...A], [ne] = Y.splice(ae, 1);
573
- return Y.splice(S, 0, ne), Y;
574
- });
575
- const I = z.getAllGridColumns(), j = I.find((A) => A.getColId() === T), P = I.find((A) => A.getColId() === F);
576
- if (!j || !P) return;
577
- j.getPinned() !== P.getPinned() && z.setColumnsPinned([T], P.getPinned() ?? null);
578
- const W = z.getAllGridColumns().findIndex((A) => A.getColId() === F);
579
- W >= 0 && z.moveColumns([T], W);
580
- },
581
- [g]
582
- ), K = t ?? c("dataTable.columnToggle");
583
- return /* @__PURE__ */ _(de.Root, { open: u, onOpenChange: b, children: [
584
- /* @__PURE__ */ o(de.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
585
- X,
586
- {
587
- ref: m,
588
- type: "button",
589
- intent: d,
590
- icon: a ?? /* @__PURE__ */ o(Jt, { "aria-hidden": !0 }),
591
- tooltip: K,
592
- "aria-label": K,
593
- "aria-haspopup": "dialog",
594
- ...f
595
- }
596
- ) }),
597
- /* @__PURE__ */ _(
598
- de.Content,
599
- {
600
- size: "sm",
601
- align: "end",
602
- className: "ds:flex ds:max-h-[var(--radix-popover-content-available-height)] ds:flex-col",
603
- children: [
604
- /* @__PURE__ */ o(de.Heading, { children: K }),
605
- 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,
606
- /* @__PURE__ */ o(
607
- "ul",
608
- {
609
- className: "ds:flex ds:min-h-0 ds:flex-col ds:gap-[var(--spacing-xs)] ds:overflow-y-auto",
610
- "aria-label": K,
611
- children: v.map((T) => {
612
- const F = l === T.colId, z = w === T.colId && l !== T.colId;
613
- return /* @__PURE__ */ _(
614
- "li",
615
- {
616
- draggable: !0,
617
- onDragStart: (I) => {
618
- p(T.colId), I.dataTransfer.effectAllowed = "move", I.dataTransfer.setData("text/plain", T.colId);
619
- },
620
- onDragOver: (I) => {
621
- I.preventDefault(), I.dataTransfer.dropEffect = "move", y(T.colId);
622
- },
623
- onDragLeave: () => {
624
- y(
625
- (I) => I === T.colId ? null : I
626
- );
627
- },
628
- onDrop: (I) => {
629
- I.preventDefault();
630
- const j = I.dataTransfer.getData("text/plain");
631
- j && C(j, T.colId), p(null), y(null);
632
- },
633
- onDragEnd: () => {
634
- p(null), y(null);
635
- },
636
- className: [
637
- "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",
638
- F ? "ds:opacity-50" : "",
639
- z ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
640
- ].filter(Boolean).join(" "),
641
- children: [
642
- /* @__PURE__ */ o(
643
- "span",
644
- {
645
- "aria-hidden": "true",
646
- className: "ds:cursor-grab ds:text-[color:var(--muted-foreground)] ds:active:cursor-grabbing",
647
- children: /* @__PURE__ */ o(qt, { className: "ds:size-4" })
648
- }
649
- ),
650
- /* @__PURE__ */ o(
651
- Gt,
652
- {
653
- label: T.displayName,
654
- checked: T.visible,
655
- onCheckedChange: (I) => R(T.colId, I === !0)
656
- }
657
- )
658
- ]
659
- },
660
- T.colId
661
- );
662
- })
663
- }
664
- ),
665
- 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
666
- ]
667
- }
668
- )
669
- ] });
670
- }
671
- );
672
- De.displayName = "DataTable.Toolbar.ColumnToggle";
673
- const Ze = B(
674
- ({ label: e, icon: t, onClick: a, variant: n = "default", size: i = "sm", ...d }, f) => {
675
- const { t: m } = D(), { getApi: c, selectionCount: g } = H(
676
- "DataTable.Toolbar.BulkAction"
677
- );
678
- return g === 0 ? null : /* @__PURE__ */ _(
679
- ie,
680
- {
681
- ref: f,
682
- type: "button",
683
- intent: n === "destructive" ? "destructive" : "secondary",
684
- size: i,
685
- startIcon: Zt(t),
686
- onClick: () => a(c()),
687
- "aria-label": `${e} (${m("dataTable.bulkAction", { count: g })})`,
688
- ...d,
689
- children: [
690
- /* @__PURE__ */ o("span", { children: e }),
691
- /* @__PURE__ */ o(
692
- "span",
693
- {
694
- "aria-hidden": "true",
695
- className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
696
- children: m("dataTable.bulkAction", { count: g })
697
- }
698
- )
699
- ]
700
- }
701
- );
702
- }
703
- );
704
- Ze.displayName = "DataTable.Toolbar.BulkAction";
705
- for (const e of [
706
- Ce,
707
- Re,
708
- Se,
709
- Ie,
710
- Ee,
711
- De
712
- ])
713
- e.rendersIconButton = !0;
714
- const lr = Object.assign(Ee, {
715
- Item: Ne
716
- }), ue = Object.assign($e, {
717
- FilterBar: Ke,
718
- Actions: He,
719
- /** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
720
- ExportCsv: Ce,
721
- /** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
722
- ExportPdf: Re,
723
- Print: Se,
724
- ColumnToggle: De,
725
- BulkAction: Ze,
726
- QuickSearch: Ue,
727
- Refresh: Ie,
728
- FilterChips: Xe,
729
- FacetFilter: Qe,
730
- ExportMenu: lr
731
- }), dr = [
732
- "contains",
733
- "equals",
734
- "startsWith",
735
- "endsWith",
736
- "notContains"
737
- ];
738
- function cr(e) {
739
- const t = new Intl.Collator(e, {
740
- sensitivity: "base",
741
- usage: "search"
742
- });
743
- function a(n, i) {
744
- if (i.length === 0) return 0;
745
- if (i.length > n.length) return -1;
746
- for (let d = 0; d <= n.length - i.length; d += 1)
747
- if (t.compare(n.slice(d, d + i.length), i) === 0)
748
- return d;
749
- return -1;
750
- }
751
- return {
752
- equals: (n, i) => t.compare(n, i) === 0,
753
- contains: (n, i) => a(n, i) !== -1,
754
- startsWith: (n, i) => i.length <= n.length && t.compare(n.slice(0, i.length), i) === 0,
755
- endsWith: (n, i) => i.length <= n.length && t.compare(
756
- n.slice(n.length - i.length),
757
- i
758
- ) === 0
759
- };
760
- }
761
- function ur(e) {
762
- return e == null ? null : typeof e == "string" ? e : String(e);
763
- }
764
- function pr(e) {
765
- 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] = M(m), [u, b] = M((t == null ? void 0 : t.filter) ?? "");
766
- $(() => {
767
- g((t == null ? void 0 : t.type) ?? d ?? "contains"), b((t == null ? void 0 : t.filter) ?? "");
768
- }, [t, d]);
769
- const v = L(() => cr($t.language), []);
770
- Ot({
771
- doesFilterPass: (y) => {
772
- const R = t;
773
- if (!R || R.filter === "") return !0;
774
- const C = ur(n(y.node));
775
- if (C === null) return !1;
776
- switch (R.type) {
777
- case "equals":
778
- return v.equals(C, R.filter);
779
- case "contains":
780
- return v.contains(C, R.filter);
781
- case "startsWith":
782
- return v.startsWith(C, R.filter);
783
- case "endsWith":
784
- return v.endsWith(C, R.filter);
785
- case "notContains":
786
- return !v.contains(C, R.filter);
787
- default:
788
- return !0;
789
- }
790
- }
791
- });
792
- function x() {
793
- if (u.trim() === "") {
794
- a(null);
795
- return;
796
- }
797
- a({ type: c, filter: u });
798
- }
799
- function l() {
800
- b(""), g(d ?? "contains"), a(null);
801
- }
802
- const p = dr.map(
803
- (y) => ({
804
- value: y,
805
- label: f(`dataTable.textFilter.operators.${y}`)
806
- })
807
- ), w = i ?? f("dataTable.textFilter.placeholder");
808
- return /* @__PURE__ */ _(
809
- "div",
810
- {
811
- "data-component": "text-filter",
812
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
813
- children: [
814
- /* @__PURE__ */ o(
815
- Kt,
816
- {
817
- size: "sm",
818
- options: p,
819
- value: c,
820
- onValueChange: (y) => {
821
- y !== "" && g(y);
822
- },
823
- "aria-label": f("dataTable.textFilter.operators.contains")
824
- }
825
- ),
826
- /* @__PURE__ */ o(
827
- Te,
828
- {
829
- size: "sm",
830
- value: u,
831
- onChange: (y) => b(y.target.value),
832
- onKeyDown: (y) => {
833
- y.key === "Enter" && (y.preventDefault(), x());
834
- },
835
- placeholder: w,
836
- "aria-label": w,
837
- startAdornment: /* @__PURE__ */ o(we, { "aria-hidden": "true", className: "ds:size-4" })
838
- }
839
- ),
840
- /* @__PURE__ */ _("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: [
841
- /* @__PURE__ */ o(ie, { intent: "ghost", size: "sm", onClick: l, type: "button", children: f("dataTable.textFilter.clear") }),
842
- /* @__PURE__ */ o(ie, { intent: "primary", size: "sm", onClick: x, type: "button", children: f("dataTable.textFilter.apply") })
843
- ] })
844
- ]
845
- }
846
- );
847
- }
848
- function fr(e) {
849
- var b, v;
850
- 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] = M((t == null ? void 0 : t.filter) ?? "");
851
- $(() => {
852
- g((t == null ? void 0 : t.filter) ?? "");
853
- }, [t == null ? void 0 : t.filter]), $(() => {
854
- if (c === ((t == null ? void 0 : t.filter) ?? "")) return;
855
- const x = setTimeout(() => {
856
- if (c === "") {
857
- t && a(null);
858
- return;
859
- }
860
- a({ type: f, filter: c });
861
- }, 200);
862
- return () => clearTimeout(x);
863
- }, [c, f, t, a]);
864
- function u() {
865
- g(""), t && a(null);
866
- }
867
- return /* @__PURE__ */ o("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
868
- Te,
869
- {
870
- size: "sm",
871
- value: c,
872
- onChange: (x) => g(x.target.value),
873
- placeholder: m,
874
- "aria-label": m,
875
- startAdornment: /* @__PURE__ */ o(we, { "aria-hidden": "true", className: "ds:size-4" }),
876
- endAdornment: c.length > 0 ? /* @__PURE__ */ o(
877
- "button",
878
- {
879
- type: "button",
880
- "aria-label": i("dataTable.textFilter.clear"),
881
- onClick: u,
882
- 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",
883
- children: /* @__PURE__ */ o(qe, { "aria-hidden": "true", className: "ds:size-4" })
884
- }
885
- ) : void 0
886
- }
887
- ) });
888
- }
889
- const mr = /* @__PURE__ */ new Set(["presentation", "none"]), Me = '[role="presentation"][aria-hidden], [role="none"][aria-hidden]';
890
- function ce(e) {
891
- const t = e.getAttribute("role");
892
- t === null || !mr.has(t) || e.getAttribute("aria-hidden") === "false" && e.removeAttribute("aria-hidden");
893
- }
894
- function gr(e, t = !0) {
895
- $(() => {
896
- const a = e.current;
897
- if (!t || !a || typeof MutationObserver > "u") return;
898
- (() => {
899
- for (const d of a.querySelectorAll(Me)) ce(d);
900
- })();
901
- const i = new MutationObserver((d) => {
902
- for (const f of d)
903
- if (f.type === "attributes")
904
- ce(f.target);
905
- else
906
- for (const m of f.addedNodes)
907
- if (m instanceof Element) {
908
- ce(m);
909
- for (const c of m.querySelectorAll(Me))
910
- ce(c);
911
- }
912
- });
913
- return i.observe(a, {
914
- subtree: !0,
915
- childList: !0,
916
- attributes: !0,
917
- attributeFilter: ["aria-hidden"]
918
- }), () => i.disconnect();
919
- }, [e, t]);
920
- }
921
- const re = "__dsDetailOf", br = "ds-data-table-expanded-row", Ye = "::detail", hr = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
922
- function q(e) {
923
- return typeof e == "object" && e !== null && typeof e[re] == "string";
924
- }
925
- function xr(e) {
926
- return `${e}${Ye}`;
927
- }
928
- function da(e) {
929
- return e.endsWith(Ye);
930
- }
931
- function yr(e, t) {
932
- return { ...e, [re]: t };
933
- }
934
- const et = ye(
935
- null
936
- );
937
- function vr(e) {
938
- var l;
939
- const t = ve(
940
- et
941
- ), { t: a } = D(), n = V(null), { data: i, node: d, api: f } = e, m = q(i), c = t == null ? void 0 : t.heights, g = d.id, u = V(t);
942
- if (u.current = t, $(() => {
943
- const p = n.current;
944
- if (!p || !m || !c || g == null) return;
945
- let w = c.get(g) ?? 0;
946
- const y = () => {
947
- const C = Math.ceil(p.getBoundingClientRect().height);
948
- C <= 0 || C === w || (w = C, c.set(g, C), d.setRowHeight(C), f.onRowHeightChanged());
949
- };
950
- y();
951
- const R = new ResizeObserver(y);
952
- return R.observe(p), () => R.disconnect();
953
- }, [f, g, c, m, d]), $(() => {
954
- const p = n.current, w = p == null ? void 0 : p.parentElement;
955
- if (!p || !w || !m) return;
956
- const y = (R) => {
957
- var C, K;
958
- R.target !== w || R.defaultPrevented || (R.key === "Escape" ? (R.stopPropagation(), (K = (C = u.current) == null ? void 0 : C.onExpandedRowChange) == null || K.call(C, null)) : R.key === "Enter" && (R.preventDefault(), (p.querySelector(hr) ?? p).focus()));
959
- };
960
- return w.addEventListener("keydown", y), () => w.removeEventListener("keydown", y);
961
- }, [m]), !m) {
962
- const p = t == null ? void 0 : t.fallbackRenderer;
963
- return p ? /* @__PURE__ */ o(p, { ...e }) : null;
964
- }
965
- const b = i[re];
966
- let v;
967
- if (t != null && t.expanded && t.expanded.id === b)
968
- v = t.expanded.row;
969
- else {
970
- const { [re]: p, ...w } = i;
971
- v = w;
972
- }
973
- return /* @__PURE__ */ _(
974
- "div",
975
- {
976
- ref: n,
977
- role: "gridcell",
978
- tabIndex: -1,
979
- "data-component": "data-table-expanded-row",
980
- "data-expanded-row-of": b,
981
- className: "ds-data-table-expanded-row-surface",
982
- onKeyDown: (p) => {
983
- var w;
984
- p.key !== "Escape" || p.defaultPrevented || (p.stopPropagation(), (w = t == null ? void 0 : t.onExpandedRowChange) == null || w.call(t, null));
985
- },
986
- children: [
987
- /* @__PURE__ */ o("span", { className: "ds:sr-only", children: a("dataTable.expandedRow") }),
988
- (l = t == null ? void 0 : t.renderExpandedRow) == null ? void 0 : l.call(t, v)
989
- ]
990
- }
991
- );
992
- }
993
- const Tr = {
994
- id: "data-table",
995
- capabilities: [
996
- "select_single",
997
- "select_multiple",
998
- "range_pick",
999
- "filter",
1000
- "sort",
1001
- "paginate"
1002
- ],
1003
- state: {
1004
- selection: {
1005
- type: "string[]",
1006
- descriptionKey: "ui.agent.dataTable.state.selection",
1007
- description: "Row ids of currently-selected rows.",
1008
- read: (e) => e.getSelection()
1009
- },
1010
- filter: {
1011
- type: "object",
1012
- descriptionKey: "ui.agent.dataTable.state.filter",
1013
- description: "Current ag-grid filter model, keyed by column id.",
1014
- read: (e) => e.getFilter()
1015
- },
1016
- sort: {
1017
- type: "Array<{ colId, sort }>",
1018
- descriptionKey: "ui.agent.dataTable.state.sort",
1019
- description: "Active sort, in priority order.",
1020
- read: (e) => e.getSort()
1021
- },
1022
- currentPage: {
1023
- type: "number",
1024
- descriptionKey: "ui.agent.dataTable.state.currentPage",
1025
- description: "Zero-indexed page number.",
1026
- read: (e) => e.getCurrentPage()
1027
- },
1028
- expandedRowId: {
1029
- type: "string | null",
1030
- descriptionKey: "ui.agent.dataTable.state.expandedRowId",
1031
- description: "Id of the row whose inline detail is open (expandable row), or null.",
1032
- read: (e) => e.getExpandedRowId()
1033
- }
1034
- },
1035
- actions: {
1036
- select_rows: {
1037
- // Transient grid selection (data-table convention) — stays read.
1038
- safety: "read",
1039
- argsType: "{ ids: string[] }",
1040
- argsSchema: {
1041
- type: "object",
1042
- properties: {
1043
- ids: {
1044
- type: "array",
1045
- items: { type: "string" },
1046
- description: "Row ids to select (replaces the current selection)."
1047
- }
1048
- },
1049
- required: ["ids"]
1050
- },
1051
- idempotent: !0,
1052
- descriptionKey: "ui.agent.dataTable.actions.selectRows",
1053
- description: "Replace the current selection with the given row ids.",
1054
- examples: [
1055
- { args: { ids: ["r-1", "r-2"] }, note: "Select the first two rows." }
1056
- ],
1057
- invoke: (e, t) => {
1058
- e.setSelection(t.ids);
1059
- }
1060
- },
1061
- select_range: {
1062
- safety: "read",
1063
- argsType: "{ fromId: string, toId: string }",
1064
- argsSchema: {
1065
- type: "object",
1066
- properties: {
1067
- fromId: { type: "string", description: "Start row id (inclusive)." },
1068
- toId: { type: "string", description: "End row id (inclusive)." }
1069
- },
1070
- required: ["fromId", "toId"]
1071
- },
1072
- idempotent: !0,
1073
- descriptionKey: "ui.agent.dataTable.actions.selectRange",
1074
- description: "Select every row between fromId and toId, inclusive, in current sort order.",
1075
- invoke: (e, t) => {
1076
- e.selectRange(t.fromId, t.toId);
1077
- }
1078
- },
1079
- clear_selection: {
1080
- safety: "read",
1081
- idempotent: !0,
1082
- descriptionKey: "ui.agent.dataTable.actions.clearSelection",
1083
- description: "Deselect all rows.",
1084
- invoke: (e) => {
1085
- e.clearSelection();
1086
- }
1087
- },
1088
- get_selection: {
1089
- safety: "read",
1090
- returns: "string[]",
1091
- returnsSchema: { type: "array", items: { type: "string" } },
1092
- idempotent: !0,
1093
- descriptionKey: "ui.agent.dataTable.actions.getSelection",
1094
- description: "Return the row ids of the currently-selected rows.",
1095
- invoke: (e) => e.getSelection()
1096
- },
1097
- apply_filter: {
1098
- safety: "read",
1099
- argsType: "{ model: Record<string, unknown> }",
1100
- argsSchema: {
1101
- type: "object",
1102
- properties: {
1103
- model: {
1104
- type: "object",
1105
- description: "ag-grid filter model keyed by column id. Opaque per-column filter shapes; replaces the current model.",
1106
- additionalProperties: !0
1107
- }
1108
- },
1109
- required: ["model"]
1110
- },
1111
- idempotent: !0,
1112
- descriptionKey: "ui.agent.dataTable.actions.applyFilter",
1113
- description: "Replace the filter model with the given object.",
1114
- invoke: (e, t) => {
1115
- e.setFilter(t.model);
1116
- }
1117
- },
1118
- sort_by: {
1119
- safety: "read",
1120
- argsType: "{ model: DataTableSortEntry[] }",
1121
- argsSchema: {
1122
- type: "object",
1123
- properties: {
1124
- model: {
1125
- type: "array",
1126
- description: "Sort entries in priority order.",
1127
- items: {
1128
- type: "object",
1129
- properties: {
1130
- colId: { type: "string", description: "Column id to sort by." },
1131
- sort: { enum: ["asc", "desc"], description: "Sort direction." }
1132
- },
1133
- required: ["colId", "sort"]
1134
- }
1135
- }
1136
- },
1137
- required: ["model"]
1138
- },
1139
- idempotent: !0,
1140
- descriptionKey: "ui.agent.dataTable.actions.sortBy",
1141
- description: "Replace the active sort with the given list (priority order).",
1142
- examples: [
1143
- {
1144
- args: { model: [{ colId: "name", sort: "asc" }] },
1145
- note: "Sort by name ascending."
1146
- }
1147
- ],
1148
- invoke: (e, t) => {
1149
- e.setSort(t.model);
1150
- }
1151
- },
1152
- go_to_page: {
1153
- safety: "read",
1154
- argsType: "{ page: number }",
1155
- argsSchema: {
1156
- type: "object",
1157
- properties: {
1158
- page: {
1159
- type: "integer",
1160
- minimum: 0,
1161
- description: "Zero-indexed page number."
1162
- }
1163
- },
1164
- required: ["page"]
1165
- },
1166
- idempotent: !0,
1167
- descriptionKey: "ui.agent.dataTable.actions.goToPage",
1168
- description: "Navigate to the given zero-indexed page.",
1169
- invoke: (e, t) => {
1170
- e.goToPage(t.page);
1171
- }
1172
- }
1173
- },
1174
- domHooks: {
1175
- root: {
1176
- attr: "data-component",
1177
- value: "data-table",
1178
- description: "Marks the DataTable wrapper."
1179
- },
1180
- instanceId: {
1181
- attr: "data-component-id",
1182
- sourceProp: "gridId",
1183
- description: "Sourced from the gridId prop. Required to address a specific table from the agent."
1184
- },
1185
- item: {
1186
- attr: "row-id",
1187
- 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.'
1188
- }
1189
- }
1190
- };
1191
- Mt.registerModules([_t]);
1192
- const wr = Pt("ag-theme-alfadocs ds:w-full", {
1193
- variants: {
1194
- density: {
1195
- default: "",
1196
- compact: "data-table-compact",
1197
- expanded: "data-table-expanded"
1198
- },
1199
- bordered: {
1200
- true: "",
1201
- false: "ds:[--ag-borders:none]"
1202
- }
1203
- },
1204
- defaultVariants: {
1205
- density: "default",
1206
- bordered: !0
1207
- }
1208
- });
1209
- function Cr() {
1210
- const { t: e } = D();
1211
- return L(
1212
- () => ({
1213
- // Filter strings
1214
- contains: e("dataTable.agGrid.contains"),
1215
- notContains: e("dataTable.agGrid.notContains"),
1216
- equals: e("dataTable.agGrid.equals"),
1217
- notEqual: e("dataTable.agGrid.notEqual"),
1218
- startsWith: e("dataTable.agGrid.startsWith"),
1219
- endsWith: e("dataTable.agGrid.endsWith"),
1220
- lessThan: e("dataTable.agGrid.lessThan"),
1221
- greaterThan: e("dataTable.agGrid.greaterThan"),
1222
- inRange: e("dataTable.agGrid.inRange"),
1223
- blank: e("dataTable.agGrid.blank"),
1224
- notBlank: e("dataTable.agGrid.notBlank"),
1225
- filterOoo: e("dataTable.agGrid.filterOoo"),
1226
- applyFilter: e("dataTable.agGrid.applyFilter"),
1227
- resetFilter: e("dataTable.agGrid.resetFilter"),
1228
- noRowsToShow: e("dataTable.agGrid.noRowsToShow"),
1229
- selectAll: e("dataTable.agGrid.selectAll"),
1230
- // Pagination
1231
- page: e("dataTable.page"),
1232
- of: e("dataTable.of"),
1233
- to: e("dataTable.to"),
1234
- nextPage: e("dataTable.nextPage"),
1235
- previousPage: e("dataTable.previousPage"),
1236
- firstPage: e("dataTable.firstPage"),
1237
- lastPage: e("dataTable.lastPage"),
1238
- pageSize: e("dataTable.pageSize")
1239
- }),
1240
- [e]
1241
- );
1242
- }
1243
- function Rr() {
1244
- return /* @__PURE__ */ o(
1245
- "div",
1246
- {
1247
- role: "status",
1248
- "aria-live": "polite",
1249
- className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
1250
- children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ o(
1251
- kt,
1252
- {
1253
- variant: "rectangular",
1254
- className: "ds:h-[var(--min-target-size)] ds:w-full"
1255
- },
1256
- t
1257
- ))
1258
- }
1259
- );
1260
- }
1261
- function Sr() {
1262
- const { t: e } = D();
1263
- return /* @__PURE__ */ o(
1264
- At,
1265
- {
1266
- variant: "no-results",
1267
- size: "sm",
1268
- title: e("dataTable.noRows"),
1269
- description: e("dataTable.noRowsDescription")
1270
- }
1271
- );
1272
- }
1273
- function tt(e) {
1274
- return e.map(({ hide: t, pinned: a, ...n }) => n);
1275
- }
1276
- function Ir(e) {
1277
- try {
1278
- const t = localStorage.getItem(`data-table-col-state:${e}`);
1279
- if (!t) return null;
1280
- const a = JSON.parse(t);
1281
- return Array.isArray(a) ? tt(a) : null;
1282
- } catch {
1283
- return null;
1284
- }
1285
- }
1286
- function Er(e, t) {
1287
- try {
1288
- localStorage.setItem(
1289
- `data-table-col-state:${e}`,
1290
- JSON.stringify(tt(t.getColumnState()))
1291
- );
1292
- } catch {
1293
- }
1294
- }
1295
- const Nr = /* @__PURE__ */ new Set([
1296
- "api",
1297
- "flex",
1298
- "gridInitializing",
1299
- "gridOptionsChanged",
1300
- "autosizeColumns",
1301
- "sizeColumnsToFit"
1302
- ]);
1303
- function Dr(e, t) {
1304
- const {
1305
- columnDefs: a,
1306
- rowData: n,
1307
- rowSelection: i,
1308
- pagination: d = !1,
1309
- paginationPageSize: f = 25,
1310
- paginationPageSizeSelector: m = [10, 25, 50, 100],
1311
- gridId: c,
1312
- onSelectionChanged: g,
1313
- onSortChanged: u,
1314
- onFilterChanged: b,
1315
- noRowsOverlay: v,
1316
- loadingOverlay: x,
1317
- gridOptions: l,
1318
- density: p,
1319
- bordered: w,
1320
- heightClass: y = "ds:h-[500px]",
1321
- className: R,
1322
- getRowClass: C,
1323
- pinnedBottomRowData: K,
1324
- printMode: T = !1,
1325
- expandedRowId: F,
1326
- renderExpandedRow: z,
1327
- onExpandedRowChange: I,
1328
- children: j
1329
- } = e, P = F !== void 0 || z !== void 0, W = l == null ? void 0 : l.getRowId;
1330
- if (P && !W)
1331
- throw new Error(
1332
- "DataTable: `expandedRowId` / `renderExpandedRow` require `gridOptions.getRowId` — the expanded row is addressed by row id, not by index."
1333
- );
1334
- const { t: A, i18n: ae } = D(), S = V(null), Y = V(null);
1335
- gr(Y);
1336
- const [ne, oe] = M(0), [fe, me] = M(""), at = Cr(), Fe = V(F);
1337
- Fe.current = F;
1338
- const ge = L(
1339
- () => ({
1340
- getSelection: () => {
1341
- var h;
1342
- const r = (h = S.current) == null ? void 0 : h.api;
1343
- if (!r) return [];
1344
- const s = [];
1345
- for (const E of r.getSelectedNodes())
1346
- E.id != null && !q(E.data) && s.push(E.id);
1347
- return s;
1348
- },
1349
- setSelection: (r) => {
1350
- var E;
1351
- const s = (E = S.current) == null ? void 0 : E.api;
1352
- if (!s) return;
1353
- const h = new Set(r);
1354
- s.forEachNode((k) => {
1355
- k.id != null && k.setSelected(h.has(k.id));
1356
- });
1357
- },
1358
- selectRange: (r, s) => {
1359
- var Oe;
1360
- const h = (Oe = S.current) == null ? void 0 : Oe.api;
1361
- if (!h) return;
1362
- const E = [];
1363
- h.forEachNodeAfterFilterAndSort((Z) => {
1364
- Z.id != null && !q(Z.data) && E.push(Z.id);
1365
- });
1366
- const k = E.indexOf(r), O = E.indexOf(s);
1367
- if (k < 0 || O < 0) return;
1368
- const [G, ee] = k <= O ? [k, O] : [O, k], J = new Set(E.slice(G, ee + 1));
1369
- h.forEachNode((Z) => {
1370
- Z.id != null && Z.setSelected(J.has(Z.id));
1371
- });
1372
- },
1373
- clearSelection: () => {
1374
- var r, s;
1375
- (s = (r = S.current) == null ? void 0 : r.api) == null || s.deselectAll();
1376
- },
1377
- getFilter: () => {
1378
- var r, s;
1379
- return ((s = (r = S.current) == null ? void 0 : r.api) == null ? void 0 : s.getFilterModel()) ?? {};
1380
- },
1381
- setFilter: (r) => {
1382
- var s, h;
1383
- (h = (s = S.current) == null ? void 0 : s.api) == null || h.setFilterModel(r);
1384
- },
1385
- getSort: () => {
1386
- var s;
1387
- const r = (s = S.current) == null ? void 0 : s.api;
1388
- return r ? r.getColumnState().filter((h) => h.sort === "asc" || h.sort === "desc").map((h) => ({ colId: h.colId, sort: h.sort })) : [];
1389
- },
1390
- setSort: (r) => {
1391
- var E;
1392
- const s = (E = S.current) == null ? void 0 : E.api;
1393
- if (!s) return;
1394
- const h = s.getColumnState().map((k) => {
1395
- const O = r.find((G) => G.colId === k.colId);
1396
- return { ...k, sort: O ? O.sort : null };
1397
- });
1398
- s.applyColumnState({ state: h, defaultState: { sort: null } });
1399
- },
1400
- getCurrentPage: () => {
1401
- var r, s;
1402
- return ((s = (r = S.current) == null ? void 0 : r.api) == null ? void 0 : s.paginationGetCurrentPage()) ?? 0;
1403
- },
1404
- goToPage: (r) => {
1405
- var s, h;
1406
- (h = (s = S.current) == null ? void 0 : s.api) == null || h.paginationGoToPage(r);
1407
- },
1408
- getExpandedRowId: () => Fe.current ?? null,
1409
- getRawApi: () => {
1410
- var r;
1411
- return (r = S.current) == null ? void 0 : r.api;
1412
- }
1413
- }),
1414
- []
1415
- );
1416
- Ft(t, () => ge, [ge]), Ht(Tr, ge, c);
1417
- const nt = ae.dir() === "rtl", ot = n === void 0, st = Vt(), { resolvedTheme: ke } = Ut(), it = (ke === "light-accessible" || ke === "dark-accessible") && p === "compact" ? "default" : p, lt = L(() => {
1418
- if (!i) return;
1419
- const r = (s) => !q(s.data);
1420
- return i === "single" ? { mode: "singleRow", isRowSelectable: r } : {
1421
- mode: "multiRow",
1422
- headerCheckbox: !0,
1423
- checkboxes: !0,
1424
- isRowSelectable: r
1425
- };
1426
- }, [i]), dt = N(() => {
1427
- var s;
1428
- if (!c || !((s = S.current) != null && s.api)) return;
1429
- const r = Ir(c);
1430
- r && S.current.api.applyColumnState({
1431
- state: r,
1432
- applyOrder: !0
1433
- });
1434
- }, [c]), be = N(
1435
- (r) => {
1436
- var s;
1437
- r.source && Nr.has(r.source) || c && ((s = S.current) != null && s.api) && Er(c, S.current.api);
1438
- },
1439
- [c]
1440
- ), ct = L(() => {
1441
- if (!l) return;
1442
- const r = { ...l };
1443
- return delete r.defaultColDef, P && (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;
1444
- }, [P, l]), Ae = V(/* @__PURE__ */ new Map()), se = V(l);
1445
- se.current = l;
1446
- const Pe = N(
1447
- (r) => {
1448
- var s;
1449
- return W == null ? void 0 : W({
1450
- data: r,
1451
- level: 0,
1452
- api: (s = S.current) == null ? void 0 : s.api,
1453
- context: l == null ? void 0 : l.context
1454
- });
1455
- },
1456
- [W, l == null ? void 0 : l.context]
1457
- ), Q = L(() => {
1458
- if (!P || F == null || !n) return null;
1459
- const r = n.find((s) => Pe(s) === F);
1460
- return r === void 0 ? null : { id: F, row: r };
1461
- }, [P, F, Pe, n]), ut = L(() => {
1462
- if (!Q || !n) return n;
1463
- const r = n.indexOf(Q.row), s = yr(Q.row, Q.id);
1464
- return [
1465
- ...n.slice(0, r + 1),
1466
- s,
1467
- ...n.slice(r + 1)
1468
- ];
1469
- }, [Q, n]), pt = N(
1470
- (r) => q(r.data) ? xr(r.data[re]) : W(r),
1471
- [W]
1472
- ), ft = N(
1473
- (r) => {
1474
- var s, h;
1475
- return q(r.rowNode.data) || (((h = (s = se.current) == null ? void 0 : s.isFullWidthRow) == null ? void 0 : h.call(s, r)) ?? !1);
1476
- },
1477
- []
1478
- ), mt = N(
1479
- (r) => {
1480
- var s, h;
1481
- return q(r.data) ? Ae.current.get(r.node.id ?? "") : (h = (s = se.current) == null ? void 0 : s.getRowHeight) == null ? void 0 : h.call(s, r);
1482
- },
1483
- []
1484
- ), gt = N(
1485
- (r) => {
1486
- var G, ee;
1487
- (ee = (G = se.current) == null ? void 0 : G.postSortRows) == null || ee.call(G, r);
1488
- const { nodes: s } = r, h = s.findIndex((J) => q(J.data));
1489
- if (h < 0) return;
1490
- const [E] = s.splice(h, 1), k = E.data[re], O = s.findIndex((J) => J.id === k);
1491
- s.splice(O < 0 ? s.length : O + 1, 0, E);
1492
- },
1493
- []
1494
- ), bt = N(
1495
- (r) => {
1496
- var s, h;
1497
- return q(r.data) ? br : ((h = (s = se.current) == null ? void 0 : s.getRowClass) == null ? void 0 : h.call(s, r)) ?? (C == null ? void 0 : C(r));
1498
- },
1499
- [C]
1500
- ), le = N(
1501
- (r) => q(r.node.data),
1502
- []
1503
- ), ht = L(() => {
1504
- if (!P) return;
1505
- const r = l == null ? void 0 : l.defaultCsvExportParams;
1506
- return {
1507
- ...r,
1508
- shouldRowBeSkipped: (s) => {
1509
- var h;
1510
- return le(s) || (((h = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : h.call(r, s)) ?? !1);
1511
- }
1512
- };
1513
- }, [P, l == null ? void 0 : l.defaultCsvExportParams, le]), xt = L(() => {
1514
- if (!P) return;
1515
- const r = l == null ? void 0 : l.defaultExcelExportParams;
1516
- return {
1517
- ...r,
1518
- shouldRowBeSkipped: (s) => {
1519
- var h;
1520
- return le(s) || (((h = r == null ? void 0 : r.shouldRowBeSkipped) == null ? void 0 : h.call(r, s)) ?? !1);
1521
- }
1522
- };
1523
- }, [P, l == null ? void 0 : l.defaultExcelExportParams, le]), he = l == null ? void 0 : l.fullWidthCellRenderer, yt = L(
1524
- () => ({
1525
- renderExpandedRow: z,
1526
- onExpandedRowChange: I,
1527
- expanded: Q,
1528
- heights: Ae.current,
1529
- fallbackRenderer: typeof he == "function" ? he : void 0
1530
- }),
1531
- [
1532
- he,
1533
- Q,
1534
- I,
1535
- z
1536
- ]
1537
- ), vt = N(() => {
1538
- var h;
1539
- const r = (h = S.current) == null ? void 0 : h.api;
1540
- if (!r) return;
1541
- const s = r.getSelectedRows().filter((E) => !q(E));
1542
- oe(s.length), g == null || g(s);
1543
- }, [g]), Tt = N(
1544
- (r) => {
1545
- var h;
1546
- const s = (h = S.current) == null ? void 0 : h.api;
1547
- if (s) {
1548
- const k = s.getColumnState().find((O) => O.sort);
1549
- if (k) {
1550
- const O = k.colId, G = s.getColumnDef(O), ee = (G == null ? void 0 : G.headerName) ?? O, J = k.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
1551
- me(
1552
- A("dataTable.sortAnnounce", {
1553
- column: ee,
1554
- direction: A(J)
1555
- })
1556
- );
1557
- } else
1558
- me("");
1559
- }
1560
- u == null || u(r);
1561
- },
1562
- [u, A]
1563
- ), wt = N(
1564
- (r) => {
1565
- b == null || b(r);
1566
- },
1567
- [b]
1568
- );
1569
- $(() => {
1570
- if (!fe) return;
1571
- const r = setTimeout(() => me(""), 3e3);
1572
- return () => clearTimeout(r);
1573
- }, [fe]);
1574
- const Ct = v ?? Sr, Rt = x ?? Rr, St = N(
1575
- () => {
1576
- var r;
1577
- return (r = S.current) == null ? void 0 : r.api;
1578
- },
1579
- []
1580
- ), It = N(() => {
1581
- typeof window < "u" && window.print();
1582
- }, []), Et = wr({
1583
- density: it,
1584
- bordered: w,
1585
- className: R
1586
- }), Nt = j ?? /* @__PURE__ */ o("div", { className: "data-table-toolbar ds:flex ds:justify-end", children: /* @__PURE__ */ _(
1587
- je,
1588
- {
1589
- role: "toolbar",
1590
- "aria-label": A("dataTable.tableActions"),
1591
- className: "ds:bg-[var(--background)]",
1592
- children: [
1593
- /* @__PURE__ */ o(ue.ExportMenu, {}),
1594
- /* @__PURE__ */ o(ue.Print, {}),
1595
- /* @__PURE__ */ o(ue.ColumnToggle, {})
1596
- ]
1597
- }
1598
- ) }), Dt = T ? !1 : d;
1599
- return /* @__PURE__ */ _(
1600
- "div",
1601
- {
1602
- className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
1603
- "aria-busy": ot ? "true" : void 0,
1604
- "data-component": "data-table",
1605
- "data-component-id": c,
1606
- "data-print-mode": T ? "true" : void 0,
1607
- children: [
1608
- !T && /* @__PURE__ */ o(
1609
- Yt,
1610
- {
1611
- getApi: St,
1612
- selectionCount: ne,
1613
- onPrint: It,
1614
- children: Nt
1615
- }
1616
- ),
1617
- /* @__PURE__ */ o(
1618
- "div",
1619
- {
1620
- ref: Y,
1621
- className: [Et, T ? "" : y].join(" ").trim(),
1622
- children: /* @__PURE__ */ o(
1623
- et.Provider,
1624
- {
1625
- value: yt,
1626
- children: /* @__PURE__ */ o(
1627
- zt,
1628
- {
1629
- ref: S,
1630
- theme: "legacy",
1631
- columnDefs: a,
1632
- rowData: ut,
1633
- defaultColDef: {
1634
- sortable: !0,
1635
- // Default filter = DS-styled text filter so untyped columns
1636
- // (no explicit `filter:` override) inherit the kit's form
1637
- // language instead of AG Grid's stock browser-skinned input.
1638
- // Number / date / select columns opt into their dedicated
1639
- // wrapper per-column.
1640
- filter: pr,
1641
- floatingFilterComponent: fr,
1642
- resizable: !0,
1643
- floatingFilter: !0,
1644
- // §13d — faint sort icon advertises which columns are
1645
- // sortable. v33+ moved this from grid-level to defaultColDef.
1646
- unSortIcon: !0,
1647
- ...l == null ? void 0 : l.defaultColDef
1648
- },
1649
- rowSelection: lt,
1650
- pagination: Dt,
1651
- paginationPageSize: f,
1652
- paginationPageSizeSelector: m,
1653
- paginationNumberFormatter: (r) => new Intl.NumberFormat(ae.language).format(r.value),
1654
- animateRows: !st,
1655
- enableRtl: nt,
1656
- ensureDomOrder: !0,
1657
- enableCellSpan: !0,
1658
- enableCellTextSelection: !0,
1659
- copyHeadersToClipboard: !0,
1660
- accentedSort: !0,
1661
- multiSortKey: "ctrl",
1662
- suppressDragLeaveHidesColumns: !0,
1663
- suppressRowClickSelection: i ? !0 : void 0,
1664
- tooltipShowDelay: 500,
1665
- tooltipHideDelay: 5e3,
1666
- tooltipInteraction: !0,
1667
- stopEditingWhenCellsLoseFocus: !0,
1668
- maintainColumnOrder: !0,
1669
- undoRedoCellEditing: !0,
1670
- undoRedoCellEditingLimit: 20,
1671
- suppressCellFocus: !1,
1672
- rowBuffer: 10,
1673
- localeText: at,
1674
- noRowsOverlayComponent: Ct,
1675
- loadingOverlayComponent: Rt,
1676
- getRowClass: P ? bt : C,
1677
- pinnedBottomRowData: K,
1678
- domLayout: T ? "autoHeight" : void 0,
1679
- onGridReady: dt,
1680
- onColumnMoved: be,
1681
- onColumnResized: be,
1682
- onColumnPinned: be,
1683
- onSortChanged: Tt,
1684
- onFilterChanged: wt,
1685
- onSelectionChanged: vt,
1686
- ...ct,
1687
- ...P ? {
1688
- getRowId: pt,
1689
- isFullWidthRow: ft,
1690
- fullWidthCellRenderer: vr,
1691
- getRowHeight: mt,
1692
- postSortRows: gt,
1693
- defaultCsvExportParams: ht,
1694
- defaultExcelExportParams: xt
1695
- } : {}
1696
- }
1697
- )
1698
- }
1699
- )
1700
- }
1701
- ),
1702
- !T && /* @__PURE__ */ o("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: ne > 0 ? /* @__PURE__ */ o("span", { children: A("dataTable.selected", { count: ne }) }) : /* @__PURE__ */ o("span", {}) }),
1703
- /* @__PURE__ */ o("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: fe })
1704
- ]
1705
- }
1706
- );
1707
- }
1708
- const rt = B(Dr);
1709
- rt.displayName = "DataTable";
1710
- const ca = Object.assign(rt, {
1711
- Toolbar: ue
1712
- });
1713
- function _e(e) {
1714
- if (!Ge(e)) return e;
1715
- const t = e, a = t.props.className ?? "", n = /\bsize-|\bw-|\bh-/.test(a) ? a : `${a} size-4`.trim();
1716
- return Le(t, { className: n, size: t.props.size ?? 16 });
1717
- }
1718
- function ua(e) {
1719
- return Math.max(1, e) * 32 + 28;
1720
- }
1721
- function xe(e, t) {
1722
- return typeof e == "function" ? e(t) : !!e;
1723
- }
1724
- const Fr = "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]";
1725
- function pa(e) {
1726
- const { data: t, actions: a, intent: n = "ghost", group: i, label: d, collapsed: f } = e, { t: m } = D();
1727
- if (!t) return null;
1728
- const c = a.filter((b) => !xe(b.hidden, t));
1729
- if (typeof f == "function" ? f() : !!f)
1730
- return /* @__PURE__ */ _(U.Root, { children: [
1731
- /* @__PURE__ */ o(U.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
1732
- X,
1733
- {
1734
- size: "sm",
1735
- intent: n,
1736
- icon: /* @__PURE__ */ o(Xt, { "aria-hidden": !0 }),
1737
- "aria-label": d ?? m("dataTable.actions", "Actions")
1738
- }
1739
- ) }),
1740
- /* @__PURE__ */ o(U.Content, { align: "end", children: c.map((b, v) => /* @__PURE__ */ o(
1741
- U.Item,
1742
- {
1743
- startIcon: _e(b.icon),
1744
- disabled: xe(b.disabled, t),
1745
- onSelect: () => b.onClick(t),
1746
- className: b.variant === "destructive" ? "ds:text-[color:var(--destructive)]" : void 0,
1747
- children: b.label
1748
- },
1749
- v
1750
- )) })
1751
- ] });
1752
- const u = c.map((b, v) => {
1753
- const x = xe(b.disabled, t), l = x && b.disabledReason ? b.disabledReason : b.label;
1754
- return /* @__PURE__ */ o(
1755
- X,
1756
- {
1757
- size: "sm",
1758
- intent: n,
1759
- icon: _e(b.icon),
1760
- tooltip: l,
1761
- "aria-label": b.label,
1762
- disabled: x,
1763
- onClick: (p) => {
1764
- p.stopPropagation(), b.onClick(t);
1765
- },
1766
- className: b.variant === "destructive" ? Fr : void 0
1767
- },
1768
- v
1769
- );
1770
- });
1771
- return i ? /* @__PURE__ */ o(
1772
- je,
1773
- {
1774
- "aria-label": d ?? m("dataTable.actions", "Actions"),
1775
- size: "sm",
1776
- children: u
1777
- }
1778
- ) : /* @__PURE__ */ o("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: u });
1779
- }
1780
- export {
1781
- pa as A,
1782
- ca as D,
1783
- br as E,
1784
- pr as T,
1785
- fr as a,
1786
- ue as b,
1787
- Yt as c,
1788
- ua as d,
1789
- Tr as e,
1790
- Ve as f,
1791
- xr as g,
1792
- da as h,
1793
- q as i
1794
- };
1795
- //# sourceMappingURL=actions-cell-renderer-WUTyAes8.js.map