@alfadocs/ui-kit 1.4.12 → 1.4.14

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.
Files changed (188) hide show
  1. package/dist/_chunks/actions-cell-renderer-BD-jruqA.js +1784 -0
  2. package/dist/_chunks/{address-fields-D-8akw2m.js → address-fields-CZP4Wncx.js} +2 -2
  3. package/dist/_chunks/{agenda-card-BQDs2ZMp.js → agenda-card-pdN49pMu.js} +2 -2
  4. package/dist/_chunks/{agenda-tray-BTyWsVwT.js → agenda-tray-CYR-znfE.js} +2 -2
  5. package/dist/_chunks/{ai-consent-banner-gVcoiXxv.js → ai-consent-banner-DLF6FNXv.js} +2 -2
  6. package/dist/_chunks/{anamnesis-card-Bt0twrML.js → anamnesis-card-BylMLHYj.js} +2 -2
  7. package/dist/_chunks/{anamnesis-summary-card-BKGVcwny.js → anamnesis-summary-card-DGVKBQoq.js} +134 -116
  8. package/dist/_chunks/{anamnesis-summary-rows-DAIpD0Or.js → anamnesis-summary-rows-C73SWVy3.js} +3145 -3007
  9. package/dist/_chunks/{antenatal-schedule-timeline-BSLrOQ3S.js → antenatal-schedule-timeline-BjlF2rTz.js} +2 -2
  10. package/dist/_chunks/{appointment-card-kcUC7vWR.js → appointment-card-BhcPJpXh.js} +2 -2
  11. package/dist/_chunks/{appointment-timeline-BC3dlZu5.js → appointment-timeline-DT1uFp8z.js} +2 -2
  12. package/dist/_chunks/{appointment-tray-BPY5rATW.js → appointment-tray-DvyVK7um.js} +2 -2
  13. package/dist/_chunks/{badge-CIt-UFEx.js → badge-sTusUqZD.js} +23 -18
  14. package/dist/_chunks/{bishop-score-B6iYYO0c.js → bishop-score-BV1JAEMV.js} +3 -3
  15. package/dist/_chunks/{bmi-calculator-CxPn0T0s.js → bmi-calculator-CdR-RLFj.js} +5 -5
  16. package/dist/_chunks/{booking-CmHX15dh.js → booking-CGKof8QU.js} +2 -2
  17. package/dist/_chunks/{care-plan-card-9tLgsDYY.js → care-plan-card-C83Hb9EE.js} +3 -3
  18. package/dist/_chunks/{care-plan-entry-card-CSan4h7A.js → care-plan-entry-card-CHMPSTCz.js} +2 -2
  19. package/dist/_chunks/{care-plan-header-D_BTi77b.js → care-plan-header-_B0TTWT1.js} +2 -2
  20. package/dist/_chunks/{clinical-note-card-ByzQ86uz.js → clinical-note-card-BBgFd2nB.js} +2 -2
  21. package/dist/_chunks/{connection-status-D8mZ4klk.js → connection-status-NT8hUtYl.js} +2 -2
  22. package/dist/_chunks/{contact-profile-card-DuW6VpzY.js → contact-profile-card-BxHiG8e6.js} +2 -2
  23. package/dist/_chunks/{cycle-calculator-D9M7IKfh.js → cycle-calculator-DJZYvNhw.js} +4 -4
  24. package/dist/_chunks/{dependent-selector-BUvrZRi0.js → dependent-selector-cJlJFAKD.js} +2 -2
  25. package/dist/_chunks/{document-preview-Di15VrpQ.js → document-preview-Aae2yKvY.js} +2 -2
  26. package/dist/_chunks/{due-date-calculator-BkqZEvL4.js → due-date-calculator-ajaQ4ya5.js} +6 -6
  27. package/dist/_chunks/{fetal-weight-C7JXGg6E.js → fetal-weight-jon6GIfQ.js} +4 -4
  28. package/dist/_chunks/{field-value-BCFLVBmu.js → field-value-BbiDRyNh.js} +2 -2
  29. package/dist/_chunks/{file-manager-DzWYcRpE.js → file-manager-CML_C6_h.js} +3 -3
  30. package/dist/_chunks/form-field-CahJzTxp.js +131 -0
  31. package/dist/_chunks/{gestational-age-calculator-Ch8vmJAl.js → gestational-age-calculator-dEpQDWcb.js} +5 -5
  32. package/dist/_chunks/{hcg-doubling-CFJlMH7Z.js → hcg-doubling-CC6TLtHd.js} +4 -4
  33. package/dist/_chunks/{link-cell-renderer-DCCca2m3.js → link-cell-renderer-D3IsW_2R.js} +3 -3
  34. package/dist/_chunks/{marketplace-app-shell-BhRH7Zi4.js → marketplace-app-shell-b5hN-Q0m.js} +2 -2
  35. package/dist/_chunks/{notes-panel-Bz83SO4-.js → notes-panel-D6HKLLS-.js} +2 -2
  36. package/dist/_chunks/number-input-Cgu2TtA8.js +423 -0
  37. package/dist/_chunks/{operator-hero-CpJkDNAM.js → operator-hero-CCDnIa1S.js} +2 -2
  38. package/dist/_chunks/{optical-prescription-Brs0CeP3.js → optical-prescription-DtzEqFQm.js} +2 -2
  39. package/dist/_chunks/{patient-details-CGhnfdUB.js → patient-details-rENrE_qY.js} +3 -3
  40. package/dist/_chunks/{patient-summary-card-DfbOtOV6.js → patient-summary-card-DQJgOOrA.js} +3 -3
  41. package/dist/_chunks/{patient-table-D2fhV4mV.js → patient-table-BubxfOWL.js} +4 -4
  42. package/dist/_chunks/{payment-automation-upsell-Ckh3b7Xx.js → payment-automation-upsell-CnaBPt5e.js} +2 -2
  43. package/dist/_chunks/{payment-request-card-Dn6-tH-D.js → payment-request-card-CvhDzDNk.js} +2 -2
  44. package/dist/_chunks/{periodontal-chart-B0yko9Xm.js → periodontal-chart-brakjj0s.js} +2 -2
  45. package/dist/_chunks/{periodontal-chart-card-HbYTmWlo.js → periodontal-chart-card-Bz-ebteE.js} +2 -2
  46. package/dist/_chunks/{periodontal-diagnosis-Qk4F3Wc_.js → periodontal-diagnosis-HrFsVi-C.js} +3 -3
  47. package/dist/_chunks/{periodontal-risk-chart-ByKuM4cF.js → periodontal-risk-chart-0x7KVZjL.js} +2 -2
  48. package/dist/_chunks/{practice-results-C5exrEn0.js → practice-results-DWUZRm2x.js} +2 -2
  49. package/dist/_chunks/{pregnancy-dating-iI6_j2K2.js → pregnancy-dating-DQVpFs_f.js} +6 -6
  50. package/dist/_chunks/{pregnancy-weight-gain-Co-YFMJZ.js → pregnancy-weight-gain-hm3QJALe.js} +5 -5
  51. package/dist/_chunks/radio-group-rXDJADzW.js +175 -0
  52. package/dist/_chunks/{radiograph-panel.agent-Drj0hYVV.js → radiograph-panel.agent-CAXFgCyn.js} +3 -3
  53. package/dist/_chunks/{signature-status-chip-DUcTgQ0E.js → signature-status-chip-DqrPIJtH.js} +17 -15
  54. package/dist/_chunks/{tab-bar-Ddp_ZbnL.js → tab-bar-DvFJIQfL.js} +2 -2
  55. package/dist/_chunks/{tasks-panel-T7vaKJcA.js → tasks-panel-BBkZuejF.js} +2 -2
  56. package/dist/_chunks/{unit-converter-BeTicruA.js → unit-converter-iDxlxKmm.js} +3 -3
  57. package/dist/_chunks/{widget-picker-DqMbjQy_.js → widget-picker-em4xGgv0.js} +2 -2
  58. package/dist/_chunks/{workflow-map-BNBeG2zn.js → workflow-map-BVofnDYh.js} +2 -2
  59. package/dist/agent-catalog.json +14 -8
  60. package/dist/agent-i18n/en.json +3 -2
  61. package/dist/components/address-fields/index.js +1 -1
  62. package/dist/components/agenda-card/index.js +1 -1
  63. package/dist/components/agenda-tray/index.js +1 -1
  64. package/dist/components/ai-consent-banner/index.js +1 -1
  65. package/dist/components/anamnesis-card/index.js +1 -1
  66. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts +2 -2
  67. package/dist/components/anamnesis-summary-card/index.js +1 -1
  68. package/dist/components/appointment-card/index.js +2 -2
  69. package/dist/components/appointment-timeline/index.js +1 -1
  70. package/dist/components/badge/index.js +1 -1
  71. package/dist/components/bishop-score/index.js +1 -1
  72. package/dist/components/bmi-calculator/index.js +1 -1
  73. package/dist/components/booking/index.js +1 -1
  74. package/dist/components/care-plan-card/index.js +1 -1
  75. package/dist/components/care-plan-entry-card/index.js +1 -1
  76. package/dist/components/care-plan-header/index.js +1 -1
  77. package/dist/components/clinical-note-card/index.js +1 -1
  78. package/dist/components/connection-status/index.js +1 -1
  79. package/dist/components/contact-profile-card/index.js +1 -1
  80. package/dist/components/cycle-calculator/index.js +1 -1
  81. package/dist/components/data-table/data-table.d.ts +19 -0
  82. package/dist/components/data-table/expanded-row-renderer.d.ts +47 -0
  83. package/dist/components/data-table/index.d.ts +2 -0
  84. package/dist/components/data-table/index.js +31 -27
  85. package/dist/components/dependent-selector/index.js +1 -1
  86. package/dist/components/document-preview/index.js +1 -1
  87. package/dist/components/due-date-calculator/index.js +2 -2
  88. package/dist/components/fetal-weight/index.js +1 -1
  89. package/dist/components/file-manager/index.js +1 -1
  90. package/dist/components/form-field/form-field.d.ts +8 -0
  91. package/dist/components/form-field/index.js +1 -1
  92. package/dist/components/gestational-age-calculator/index.js +1 -1
  93. package/dist/components/hcg-doubling/index.js +1 -1
  94. package/dist/components/notes-panel/index.js +1 -1
  95. package/dist/components/number-input/index.js +1 -1
  96. package/dist/components/number-input/number-input.d.ts +14 -0
  97. package/dist/components/operator-hero/index.js +1 -1
  98. package/dist/components/optical-prescription/index.js +1 -1
  99. package/dist/components/patient-details/index.js +1 -1
  100. package/dist/components/patient-summary-card/index.js +1 -1
  101. package/dist/components/patient-table/index.js +1 -1
  102. package/dist/components/payment-card/index.js +1 -1
  103. package/dist/components/periodontal-chart/index.js +1 -1
  104. package/dist/components/periodontal-chart-card/index.js +1 -1
  105. package/dist/components/periodontal-diagnosis/index.js +1 -1
  106. package/dist/components/periodontal-risk-chart/index.js +1 -1
  107. package/dist/components/practice-results/index.js +1 -1
  108. package/dist/components/pregnancy-dating/index.js +1 -1
  109. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  110. package/dist/components/radio-group/index.js +1 -1
  111. package/dist/components/radio-group/radio-group.d.ts +5 -0
  112. package/dist/components/radiograph-panel/index.js +1 -1
  113. package/dist/components/signature-status-chip/index.js +1 -1
  114. package/dist/components/tab-bar/index.js +1 -1
  115. package/dist/components/tasks-panel/index.js +1 -1
  116. package/dist/components/unit-converter/index.js +1 -1
  117. package/dist/components/widget-picker/index.js +1 -1
  118. package/dist/components/workflow/index.js +1 -1
  119. package/dist/host-compat.css +7 -1
  120. package/dist/i18n/locales/ar.d.ts +1 -0
  121. package/dist/i18n/locales/ar.js +1 -0
  122. package/dist/i18n/locales/de.d.ts +1 -0
  123. package/dist/i18n/locales/de.js +1 -0
  124. package/dist/i18n/locales/el.d.ts +1 -0
  125. package/dist/i18n/locales/el.js +1 -0
  126. package/dist/i18n/locales/en.d.ts +1 -0
  127. package/dist/i18n/locales/en.js +1 -0
  128. package/dist/i18n/locales/es.d.ts +1 -0
  129. package/dist/i18n/locales/es.js +1 -0
  130. package/dist/i18n/locales/fr.d.ts +1 -0
  131. package/dist/i18n/locales/fr.js +1 -0
  132. package/dist/i18n/locales/hi.d.ts +1 -0
  133. package/dist/i18n/locales/hi.js +1 -0
  134. package/dist/i18n/locales/it.d.ts +1 -0
  135. package/dist/i18n/locales/it.js +1 -0
  136. package/dist/i18n/locales/ja.d.ts +1 -0
  137. package/dist/i18n/locales/ja.js +1 -0
  138. package/dist/i18n/locales/nl.d.ts +1 -0
  139. package/dist/i18n/locales/nl.js +1 -0
  140. package/dist/i18n/locales/pl.d.ts +1 -0
  141. package/dist/i18n/locales/pl.js +1 -0
  142. package/dist/i18n/locales/pt.d.ts +1 -0
  143. package/dist/i18n/locales/pt.js +1 -0
  144. package/dist/i18n/locales/ro.d.ts +1 -0
  145. package/dist/i18n/locales/ro.js +1 -0
  146. package/dist/i18n/locales/ru.d.ts +1 -0
  147. package/dist/i18n/locales/ru.js +1 -0
  148. package/dist/i18n/locales/sq.d.ts +1 -0
  149. package/dist/i18n/locales/sq.js +1 -0
  150. package/dist/i18n/locales/sv.d.ts +1 -0
  151. package/dist/i18n/locales/sv.js +1 -0
  152. package/dist/i18n/locales/tr.d.ts +1 -0
  153. package/dist/i18n/locales/tr.js +1 -0
  154. package/dist/i18n/locales/zh.d.ts +1 -0
  155. package/dist/i18n/locales/zh.js +1 -0
  156. package/dist/index.js +785 -781
  157. package/dist/locales/ar.json +1 -0
  158. package/dist/locales/de.json +1 -0
  159. package/dist/locales/el.json +1 -0
  160. package/dist/locales/en.json +1 -0
  161. package/dist/locales/es.json +1 -0
  162. package/dist/locales/fr.json +1 -0
  163. package/dist/locales/hi.json +1 -0
  164. package/dist/locales/it.json +1 -0
  165. package/dist/locales/ja.json +1 -0
  166. package/dist/locales/nl.json +1 -0
  167. package/dist/locales/pl.json +1 -0
  168. package/dist/locales/pt.json +1 -0
  169. package/dist/locales/ro.json +1 -0
  170. package/dist/locales/ru.json +1 -0
  171. package/dist/locales/sq.json +1 -0
  172. package/dist/locales/sv.json +1 -0
  173. package/dist/locales/tr.json +1 -0
  174. package/dist/locales/zh.json +1 -0
  175. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +7 -1
  176. package/dist/patterns/anamnesis/anamnesis-field.d.ts +15 -1
  177. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +3 -1
  178. package/dist/patterns/anamnesis/anamnesis-intake.d.ts +6 -1
  179. package/dist/patterns/anamnesis/anamnesis-types.d.ts +3 -0
  180. package/dist/patterns/anamnesis/index.js +1 -1
  181. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  182. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  183. package/dist/tokens.css +5 -2
  184. package/package.json +1 -1
  185. package/dist/_chunks/actions-cell-renderer-C67oj7mR.js +0 -1581
  186. package/dist/_chunks/form-field-D1oqYisL.js +0 -127
  187. package/dist/_chunks/number-input-DOe5VYei.js +0 -370
  188. package/dist/_chunks/radio-group-BmIqhIT2.js +0 -171
@@ -1,1581 +0,0 @@
1
- import { jsx as n, jsxs as O } from "react/jsx-runtime";
2
- import { useMemo as $, forwardRef as P, useState as k, useCallback as A, useEffect as q, useRef as se, createContext as Ce, useContext as Se, isValidElement as we, cloneElement as Ne, useImperativeHandle as ot } from "react";
3
- import { S as it } from "./skeleton-CZbwyJAA.js";
4
- import { E as st } from "./empty-state-Df0tM6Kn.js";
5
- import { c as lt } from "./index-D2ZczOXr.js";
6
- import { useTranslation as w } from "react-i18next";
7
- import { useGridFilter as dt, AgGridReact as ct } from "ag-grid-react";
8
- import { ModuleRegistry as ut, AllCommunityModule as pt } from "ag-grid-community";
9
- import { I as Ie } from "./icon-button-group-DrvuWPGJ.js";
10
- import { B as X } from "./button-BvNtqHAS.js";
11
- import { I as L } from "./icon-button-9c9Gp41m.js";
12
- import { P as Z } from "./popover-Btj6N25H.js";
13
- import { C as mt } from "./checkbox-BuZ1u__2.js";
14
- import { T as le } from "./text-input-CUvCb6ST.js";
15
- import { T as ye } from "./tag-3wgkwwDB.js";
16
- import { D as j } from "./dropdown-menu-DU-Hrf33.js";
17
- import { X as Fe } from "./x-B5YnXwCz.js";
18
- import { R as ft } from "./refresh-cw-DnI0cLFC.js";
19
- import { S as de } from "./search-QbWPlY5f.js";
20
- import { c as gt } from "./createLucideIcon-DhHxpK9K.js";
21
- import { G as bt } from "./grip-vertical-onSb1JXO.js";
22
- import { P as ht } from "./printer-rkK0T1gi.js";
23
- import { F as De } from "./file-text-5yv6r2ls.js";
24
- import { D as te } from "./download-CfYKJO_j.js";
25
- import { F as Tt } from "./file-spreadsheet-DmwyfV4O.js";
26
- import yt from "i18next";
27
- import { S as vt } from "./select-BW5ecXlX.js";
28
- import { u as xt } from "./registry-DvAUVLHh.js";
29
- import { u as Ct } from "./use-prefers-reduced-motion-BMwIQRjB.js";
30
- import { u as St } from "./use-theme-CAuo6EYT.js";
31
- import { E as wt } 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 Nt = [
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
- ], It = gt("columns-3-cog", Nt);
52
- function Ft(e) {
53
- if (!we(e)) return e;
54
- const t = e, r = t.props.className ?? "", a = /\bsize-|\bw-|\bh-/.test(r) ? r : `${r} ds:size-4`.trim();
55
- return Ne(t, { className: a, size: t.props.size ?? 16 });
56
- }
57
- const Re = Ce(null);
58
- function G(e) {
59
- const t = Se(Re);
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 Dt({
67
- getApi: e,
68
- selectionCount: t,
69
- onPrint: r,
70
- children: a
71
- }) {
72
- const o = $(
73
- () => ({ getApi: e, selectionCount: t, onPrint: r }),
74
- [e, t, r]
75
- );
76
- return /* @__PURE__ */ n(Re.Provider, { value: o, children: a });
77
- }
78
- const Rt = [
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(" "), Ae = P(
91
- ({ className: e, children: t, ...r }, a) => /* @__PURE__ */ n(
92
- "div",
93
- {
94
- ref: a,
95
- role: "toolbar",
96
- className: [Rt, e ?? ""].join(" ").trim(),
97
- ...r,
98
- children: t
99
- }
100
- )
101
- );
102
- Ae.displayName = "DataTable.Toolbar";
103
- const ke = P(
104
- ({ className: e, children: t, ...r }, a) => /* @__PURE__ */ n(
105
- "div",
106
- {
107
- ref: a,
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
- ...r,
118
- children: t
119
- }
120
- )
121
- );
122
- ke.displayName = "DataTable.Toolbar.FilterBar";
123
- const Ee = P(
124
- ({ className: e, children: t, ...r }, a) => /* @__PURE__ */ n(
125
- "div",
126
- {
127
- ref: a,
128
- className: [
129
- "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
130
- "ds:ms-auto",
131
- e ?? ""
132
- ].join(" ").trim(),
133
- ...r,
134
- children: t
135
- }
136
- )
137
- );
138
- Ee.displayName = "DataTable.Toolbar.Actions";
139
- const ce = P(
140
- ({ label: e, onExport: t, intent: r = "outline", ...a }, o) => {
141
- const { t: i } = w(), { getApi: c } = G("DataTable.Toolbar.ExportCsv"), u = A(() => {
142
- const l = c();
143
- l && (t ? t(l) : l.exportDataAsCsv());
144
- }, [c, t]);
145
- return /* @__PURE__ */ n(
146
- L,
147
- {
148
- ref: o,
149
- type: "button",
150
- intent: r,
151
- icon: /* @__PURE__ */ n(te, { "aria-hidden": !0 }),
152
- tooltip: e ?? i("dataTable.exportCsv"),
153
- onClick: u,
154
- ...a
155
- }
156
- );
157
- }
158
- );
159
- ce.displayName = "DataTable.Toolbar.ExportCsv";
160
- function U(e, t = [30, 30, 30]) {
161
- if (typeof document > "u") return t;
162
- const r = document.createElement("span");
163
- r.style.color = `hsl(var(${e}))`, r.style.position = "absolute", r.style.visibility = "hidden", document.body.appendChild(r);
164
- const a = getComputedStyle(r).color;
165
- document.body.removeChild(r);
166
- const o = a.match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/i);
167
- return o ? [Number(o[1]), Number(o[2]), Number(o[3])] : t;
168
- }
169
- async function Oe(e, t) {
170
- if (!e) return;
171
- const [{ jsPDF: r }, { default: a }] = await Promise.all([
172
- import("./jspdf.es.min-DaapWjR1.js").then((b) => b.j),
173
- import("./jspdf.plugin.autotable-CSiDNyPn.js")
174
- ]), i = (e.getColumns() ?? []).filter((b) => b.isVisible()), c = [
175
- i.map((b) => e.getDisplayNameForColumn(b, null) ?? "")
176
- ], u = [];
177
- e.forEachNodeAfterFilterAndSort((b) => {
178
- if (!b.data) return;
179
- const T = i.map((g) => {
180
- const N = e.getCellValue({
181
- rowNode: b,
182
- colKey: g,
183
- useFormatter: !0
184
- });
185
- return N == null ? "" : String(N);
186
- });
187
- u.push(T);
188
- });
189
- const l = U("--muted", [240, 240, 240]), p = U("--foreground", [30, 30, 30]), s = U("--card-foreground", [30, 30, 30]), m = U("--card", [250, 250, 250]), y = new r({ orientation: "landscape" });
190
- a(y, {
191
- head: c,
192
- body: u,
193
- headStyles: { fillColor: l, textColor: p },
194
- bodyStyles: { textColor: s },
195
- alternateRowStyles: { fillColor: m },
196
- styles: {
197
- font: "helvetica",
198
- fontSize: 10,
199
- cellPadding: 4
200
- }
201
- }), y.save(t.fileName);
202
- }
203
- const ue = P(
204
- ({ label: e, onClick: t, fileName: r, intent: a = "outline", ...o }, i) => {
205
- const { t: c } = w(), { getApi: u } = G("DataTable.Toolbar.ExportPdf"), l = A(() => {
206
- const p = u();
207
- if (t) {
208
- t(p);
209
- return;
210
- }
211
- Oe(p, {
212
- fileName: r ?? "data-table-export.pdf"
213
- });
214
- }, [u, t, r]);
215
- return /* @__PURE__ */ n(
216
- L,
217
- {
218
- ref: i,
219
- type: "button",
220
- intent: a,
221
- icon: /* @__PURE__ */ n(De, { "aria-hidden": !0 }),
222
- tooltip: e ?? c("dataTable.exportPdf"),
223
- onClick: l,
224
- ...o
225
- }
226
- );
227
- }
228
- );
229
- ue.displayName = "DataTable.Toolbar.ExportPdf";
230
- const pe = P(
231
- ({ label: e, intent: t = "outline", ...r }, a) => {
232
- const { t: o } = w(), { onPrint: i } = G("DataTable.Toolbar.Print");
233
- return /* @__PURE__ */ n(
234
- L,
235
- {
236
- ref: a,
237
- type: "button",
238
- intent: t,
239
- icon: /* @__PURE__ */ n(ht, { "aria-hidden": !0 }),
240
- tooltip: e ?? o("dataTable.print"),
241
- onClick: i,
242
- ...r
243
- }
244
- );
245
- }
246
- );
247
- pe.displayName = "DataTable.Toolbar.Print";
248
- const Pe = ({ placeholder: e, debounceMs: t = 150 }) => {
249
- const { t: r } = w(), { getApi: a } = G("DataTable.Toolbar.QuickSearch"), [o, i] = k(""), c = se(void 0);
250
- return q(() => (c.current && window.clearTimeout(c.current), c.current = window.setTimeout(() => {
251
- const u = a();
252
- u && u.setGridOption("quickFilterText", o);
253
- }, t), () => {
254
- c.current && window.clearTimeout(c.current);
255
- }), [o, t, a]), // 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__ */ n("div", { className: "ds:w-full ds:max-w-[24rem] ds:min-w-0", children: /* @__PURE__ */ n(
263
- le,
264
- {
265
- type: "search",
266
- size: "sm",
267
- value: o,
268
- onChange: (u) => i(u.target.value),
269
- placeholder: e ?? r("dataTable.quickSearch.placeholder", "Search…"),
270
- startAdornment: /* @__PURE__ */ n(de, { "aria-hidden": !0, className: "ds:size-4" }),
271
- clearable: !0,
272
- onClear: () => i(""),
273
- "aria-label": r("dataTable.quickSearch.label", "Quick search")
274
- }
275
- ) });
276
- };
277
- Pe.displayName = "DataTable.Toolbar.QuickSearch";
278
- const me = P(
279
- ({ onRefresh: e, label: t, intent: r = "outline", ...a }, o) => {
280
- const { t: i } = w();
281
- return /* @__PURE__ */ n(
282
- L,
283
- {
284
- ref: o,
285
- type: "button",
286
- intent: r,
287
- icon: /* @__PURE__ */ n(ft, { "aria-hidden": !0 }),
288
- tooltip: t ?? i("dataTable.refresh", "Refresh"),
289
- onClick: e,
290
- ...a
291
- }
292
- );
293
- }
294
- );
295
- me.displayName = "DataTable.Toolbar.Refresh";
296
- function At(e) {
297
- if (!e || typeof e != "object") return "";
298
- const t = e;
299
- if (typeof t.filter == "string" || typeof t.filter == "number") {
300
- const r = typeof t.type == "string" ? t.type : "", a = typeof t.filterTo == "string" || typeof t.filterTo == "number" ? String(t.filterTo) : "";
301
- return r === "inRange" && a ? `${t.filter} – ${a}` : r ? `${r} ${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 ze = () => {
306
- const { t: e } = w(), { getApi: t } = G("DataTable.Toolbar.FilterChips"), [r, a] = k([]), [o, i] = k(""), c = A(() => {
307
- const s = t();
308
- if (!s) {
309
- a([]), i("");
310
- return;
311
- }
312
- const m = s.getFilterModel() ?? {}, y = s.getColumns() ?? [], b = [];
313
- for (const g of Object.keys(m)) {
314
- const N = y.find((F) => F.getColId() === g), x = s.getDisplayNameForColumn(N, null) ?? g;
315
- b.push({
316
- colId: g,
317
- headerName: x,
318
- text: At(m[g])
319
- });
320
- }
321
- a(b);
322
- const T = s.getGridOption("quickFilterText");
323
- i(typeof T == "string" ? T : "");
324
- }, [t]);
325
- if (q(() => {
326
- let s;
327
- const m = (T) => c(), y = (T) => {
328
- T.addEventListener("filterChanged", m), c(), s = () => T.removeEventListener("filterChanged", m);
329
- }, b = t();
330
- if (b)
331
- y(b);
332
- else {
333
- const T = window.setInterval(() => {
334
- const g = t();
335
- g && (window.clearInterval(T), y(g));
336
- }, 50);
337
- s = () => window.clearInterval(T);
338
- }
339
- return () => s == null ? void 0 : s();
340
- }, [t, c]), r.length + (o ? 1 : 0) === 0) return null;
341
- function l(s) {
342
- const m = t();
343
- m && m.destroyFilter(s);
344
- }
345
- function p() {
346
- const s = t();
347
- s && (s.setFilterModel(null), s.setGridOption("quickFilterText", ""), i(""));
348
- }
349
- return /* @__PURE__ */ O(
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
- o && /* @__PURE__ */ n(
357
- ye,
358
- {
359
- label: `${e("dataTable.quickSearch.label", "Quick search")}: ${o}`,
360
- size: "sm",
361
- fill: "outline",
362
- onRemove: () => {
363
- const s = t();
364
- s == null || s.setGridOption("quickFilterText", ""), i("");
365
- }
366
- }
367
- ),
368
- r.map((s) => /* @__PURE__ */ n(
369
- ye,
370
- {
371
- label: s.text ? `${s.headerName}: ${s.text}` : s.headerName,
372
- size: "sm",
373
- fill: "outline",
374
- onRemove: () => l(s.colId)
375
- },
376
- s.colId
377
- )),
378
- /* @__PURE__ */ n(
379
- X,
380
- {
381
- type: "button",
382
- intent: "ghost",
383
- size: "sm",
384
- onClick: p,
385
- startIcon: /* @__PURE__ */ n(Fe, { "aria-hidden": !0, className: "ds:size-4" }),
386
- children: e("dataTable.filterChips.clearAll", "Clear all")
387
- }
388
- )
389
- ]
390
- }
391
- );
392
- };
393
- ze.displayName = "DataTable.Toolbar.FilterChips";
394
- const Me = ({
395
- field: e,
396
- options: t,
397
- label: r
398
- }) => {
399
- const { t: a } = w(), { getApi: o } = G("DataTable.Toolbar.FacetFilter"), [i, c] = k(null);
400
- function u(l) {
401
- c(l);
402
- const p = o();
403
- if (p) {
404
- if (l === null) {
405
- p.destroyFilter(e);
406
- return;
407
- }
408
- p.setColumnFilterModel(e, {
409
- type: "equals",
410
- filter: l
411
- }), p.onFilterChanged();
412
- }
413
- }
414
- return /* @__PURE__ */ n(
415
- "div",
416
- {
417
- role: "group",
418
- "aria-label": r ?? a("dataTable.facetFilter.label", "Filter"),
419
- className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]",
420
- children: t.map((l) => {
421
- const p = i === l.value;
422
- return /* @__PURE__ */ n(
423
- X,
424
- {
425
- type: "button",
426
- size: "sm",
427
- intent: p ? "primary" : "secondary",
428
- "aria-pressed": p,
429
- onClick: () => u(l.value),
430
- children: l.label
431
- },
432
- String(l.value)
433
- );
434
- })
435
- }
436
- );
437
- };
438
- Me.displayName = "DataTable.Toolbar.FacetFilter";
439
- const kt = ["csv", "xlsx", "pdf"];
440
- async function Et(e, t) {
441
- if (!e) return;
442
- const r = await import("./exceljs.min-D2MHbJsF.js").then((g) => g.e), a = new r.Workbook(), o = a.addWorksheet("Sheet1"), c = (e.getColumns() ?? []).filter((g) => g.isVisible());
443
- o.addRow(
444
- c.map(
445
- (g) => e.getDisplayNameForColumn(g, null) ?? g.getColId()
446
- )
447
- ), e.forEachNodeAfterFilterAndSort((g) => {
448
- g.data && o.addRow(
449
- c.map((N) => {
450
- const x = e.getCellValue({
451
- rowNode: g,
452
- colKey: N,
453
- useFormatter: !0
454
- });
455
- return x ?? "";
456
- })
457
- );
458
- });
459
- const u = U("--muted", [240, 240, 240]), l = U("--foreground", [30, 30, 30]), p = o.getRow(1), s = ([g, N, x]) => `${g.toString(16).padStart(2, "0")}${N.toString(16).padStart(2, "0")}${x.toString(16).padStart(2, "0")}`.toUpperCase();
460
- p.eachCell((g) => {
461
- g.font = { bold: !0, color: { argb: `FF${s(l)}` } }, g.fill = {
462
- type: "pattern",
463
- pattern: "solid",
464
- fgColor: { argb: `FF${s(u)}` }
465
- };
466
- });
467
- const m = await a.xlsx.writeBuffer(), y = new Blob([m], {
468
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
469
- }), b = URL.createObjectURL(y), T = document.createElement("a");
470
- T.href = b, T.download = t.fileName, document.body.appendChild(T), T.click(), document.body.removeChild(T), URL.revokeObjectURL(b);
471
- }
472
- const Ge = Ce(null);
473
- function Ot() {
474
- const e = Se(Ge);
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 fe = P(
482
- ({ children: e, label: t, intent: r = "outline", ...a }, o) => {
483
- const { t: i } = w(), { getApi: c } = G("DataTable.Toolbar.ExportMenu"), u = $(() => ({ getApi: c }), [c]), l = e ?? kt.map((p) => /* @__PURE__ */ n(ge, { format: p }, p));
484
- return /* @__PURE__ */ n(Ge.Provider, { value: u, children: /* @__PURE__ */ O(j.Root, { children: [
485
- /* @__PURE__ */ n(j.Trigger, { asChild: !0, children: /* @__PURE__ */ n(
486
- L,
487
- {
488
- ref: o,
489
- type: "button",
490
- intent: r,
491
- icon: /* @__PURE__ */ n(te, { "aria-hidden": !0 }),
492
- tooltip: t ?? i("dataTable.export.menu", "Export"),
493
- "aria-label": t ?? i("dataTable.export.menu", "Export"),
494
- "aria-haspopup": "menu",
495
- ...a
496
- }
497
- ) }),
498
- /* @__PURE__ */ n(j.Content, { align: "end", sideOffset: 4, children: l })
499
- ] }) });
500
- }
501
- );
502
- fe.displayName = "DataTable.Toolbar.ExportMenu";
503
- function Pt(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 zt(e) {
507
- return e === "csv" ? /* @__PURE__ */ n(te, { "aria-hidden": !0, className: "ds:size-4" }) : e === "xlsx" ? /* @__PURE__ */ n(Tt, { "aria-hidden": !0, className: "ds:size-4" }) : e === "pdf" ? /* @__PURE__ */ n(De, { "aria-hidden": !0, className: "ds:size-4" }) : /* @__PURE__ */ n(te, { "aria-hidden": !0, className: "ds:size-4" });
508
- }
509
- const ge = ({
510
- format: e,
511
- label: t,
512
- onClick: r,
513
- fileName: a
514
- }) => {
515
- const { t: o } = w(), { getApi: i } = Ot(), c = A(() => {
516
- const u = i();
517
- if (e === "csv") {
518
- u == null || u.exportDataAsCsv();
519
- return;
520
- }
521
- if (e === "pdf") {
522
- Oe(u, {
523
- fileName: a ?? "data-table-export.pdf"
524
- });
525
- return;
526
- }
527
- if (e === "xlsx") {
528
- Et(u, {
529
- fileName: a ?? "data-table-export.xlsx"
530
- });
531
- return;
532
- }
533
- r == null || r(u);
534
- }, [e, a, r, i]);
535
- return /* @__PURE__ */ n(j.Item, { onSelect: c, children: /* @__PURE__ */ O("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
536
- zt(e),
537
- /* @__PURE__ */ n("span", { children: t ?? Pt(o, e) })
538
- ] }) });
539
- };
540
- ge.displayName = "DataTable.Toolbar.ExportMenu.Item";
541
- function Mt(e) {
542
- return e ? (e.getAllGridColumns() ?? []).map((r) => r.getColDef().hide === void 0 && r.getColId().startsWith("ag-Grid-") ? null : {
543
- colId: r.getColId(),
544
- displayName: e.getDisplayNameForColumn(r, null) || r.getColId(),
545
- visible: r.isVisible()
546
- }).filter((r) => r !== null) : [];
547
- }
548
- const be = P(
549
- function({ label: t, icon: r, footer: a, header: o, intent: i = "outline", ...c }, u) {
550
- const { t: l } = w(), { getApi: p } = G("DataTable.Toolbar.ColumnToggle"), [s, m] = k(!1), [y, b] = k([]), [T, g] = k(null), [N, x] = k(null);
551
- q(() => {
552
- s && b(Mt(p()));
553
- }, [s, p]);
554
- const F = A(
555
- (C, M) => {
556
- const R = p();
557
- R && (R.setColumnsVisible([C], M), b(
558
- (S) => S.map(
559
- (h) => h.colId === C ? { ...h, visible: M } : h
560
- )
561
- ));
562
- },
563
- [p]
564
- ), z = A(
565
- (C, M) => {
566
- if (C === M) return;
567
- const R = p();
568
- if (!R) return;
569
- b((h) => {
570
- const H = h.findIndex((_) => _.colId === C), K = h.findIndex((_) => _.colId === M);
571
- if (H < 0 || K < 0) return h;
572
- const Q = [...h], [J] = Q.splice(H, 1);
573
- return Q.splice(K, 0, J), Q;
574
- });
575
- const S = y.findIndex((h) => h.colId === M);
576
- S >= 0 && R.moveColumns([C], S);
577
- },
578
- [p, y]
579
- ), W = t ?? l("dataTable.columnToggle");
580
- return /* @__PURE__ */ O(Z.Root, { open: s, onOpenChange: m, children: [
581
- /* @__PURE__ */ n(Z.Trigger, { asChild: !0, children: /* @__PURE__ */ n(
582
- L,
583
- {
584
- ref: u,
585
- type: "button",
586
- intent: i,
587
- icon: r ?? /* @__PURE__ */ n(It, { "aria-hidden": !0 }),
588
- tooltip: W,
589
- "aria-label": W,
590
- "aria-haspopup": "dialog",
591
- ...c
592
- }
593
- ) }),
594
- /* @__PURE__ */ O(Z.Content, { size: "sm", align: "end", children: [
595
- /* @__PURE__ */ n(Z.Heading, { children: W }),
596
- o ? /* @__PURE__ */ n("div", { className: "ds:mb-[var(--spacing-xs)] ds:border-b ds:border-[color:var(--border)] ds:pb-[var(--spacing-sm)]", children: o }) : null,
597
- /* @__PURE__ */ n(
598
- "ul",
599
- {
600
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
601
- "aria-label": W,
602
- children: y.map((C) => {
603
- const M = T === C.colId, R = N === C.colId && T !== C.colId;
604
- return /* @__PURE__ */ O(
605
- "li",
606
- {
607
- draggable: !0,
608
- onDragStart: (S) => {
609
- g(C.colId), S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", C.colId);
610
- },
611
- onDragOver: (S) => {
612
- S.preventDefault(), S.dataTransfer.dropEffect = "move", x(C.colId);
613
- },
614
- onDragLeave: () => {
615
- x(
616
- (S) => S === C.colId ? null : S
617
- );
618
- },
619
- onDrop: (S) => {
620
- S.preventDefault();
621
- const h = S.dataTransfer.getData("text/plain");
622
- h && z(h, C.colId), g(null), x(null);
623
- },
624
- onDragEnd: () => {
625
- g(null), x(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
- M ? "ds:opacity-50" : "",
630
- R ? "ds:bg-[color:color-mix(in_srgb,var(--primary)_8%,transparent)]" : ""
631
- ].filter(Boolean).join(" "),
632
- children: [
633
- /* @__PURE__ */ n(
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__ */ n(bt, { className: "ds:size-4" })
639
- }
640
- ),
641
- /* @__PURE__ */ n(
642
- mt,
643
- {
644
- label: C.displayName,
645
- checked: C.visible,
646
- onCheckedChange: (S) => F(C.colId, S === !0)
647
- }
648
- )
649
- ]
650
- },
651
- C.colId
652
- );
653
- })
654
- }
655
- ),
656
- a ? /* @__PURE__ */ n("div", { className: "ds:mt-[var(--spacing-xs)] ds:border-t ds:border-[color:var(--border)] ds:pt-[var(--spacing-sm)]", children: a }) : null
657
- ] })
658
- ] });
659
- }
660
- );
661
- be.displayName = "DataTable.Toolbar.ColumnToggle";
662
- const je = P(
663
- ({ label: e, icon: t, onClick: r, variant: a = "default", size: o = "sm", ...i }, c) => {
664
- const { t: u } = w(), { getApi: l, selectionCount: p } = G(
665
- "DataTable.Toolbar.BulkAction"
666
- );
667
- return p === 0 ? null : /* @__PURE__ */ O(
668
- X,
669
- {
670
- ref: c,
671
- type: "button",
672
- intent: a === "destructive" ? "destructive" : "secondary",
673
- size: o,
674
- startIcon: Ft(t),
675
- onClick: () => r(l()),
676
- "aria-label": `${e} (${u("dataTable.bulkAction", { count: p })})`,
677
- ...i,
678
- children: [
679
- /* @__PURE__ */ n("span", { children: e }),
680
- /* @__PURE__ */ n(
681
- "span",
682
- {
683
- "aria-hidden": "true",
684
- className: "ds:ms-[var(--spacing-xs)] ds:opacity-80",
685
- children: u("dataTable.bulkAction", { count: p })
686
- }
687
- )
688
- ]
689
- }
690
- );
691
- }
692
- );
693
- je.displayName = "DataTable.Toolbar.BulkAction";
694
- for (const e of [
695
- ce,
696
- ue,
697
- pe,
698
- me,
699
- fe,
700
- be
701
- ])
702
- e.rendersIconButton = !0;
703
- const Gt = Object.assign(fe, {
704
- Item: ge
705
- }), ee = Object.assign(Ae, {
706
- FilterBar: ke,
707
- Actions: Ee,
708
- /** @deprecated Use `Toolbar.ExportMenu` with a `csv` item. */
709
- ExportCsv: ce,
710
- /** @deprecated Use `Toolbar.ExportMenu` with a `pdf` item. */
711
- ExportPdf: ue,
712
- Print: pe,
713
- ColumnToggle: be,
714
- BulkAction: je,
715
- QuickSearch: Pe,
716
- Refresh: me,
717
- FilterChips: ze,
718
- FacetFilter: Me,
719
- ExportMenu: Gt
720
- }), jt = [
721
- "contains",
722
- "equals",
723
- "startsWith",
724
- "endsWith",
725
- "notContains"
726
- ];
727
- function qt(e) {
728
- const t = new Intl.Collator(e, {
729
- sensitivity: "base",
730
- usage: "search"
731
- });
732
- function r(a, o) {
733
- if (o.length === 0) return 0;
734
- if (o.length > a.length) return -1;
735
- for (let i = 0; i <= a.length - o.length; i += 1)
736
- if (t.compare(a.slice(i, i + o.length), o) === 0)
737
- return i;
738
- return -1;
739
- }
740
- return {
741
- equals: (a, o) => t.compare(a, o) === 0,
742
- contains: (a, o) => r(a, o) !== -1,
743
- startsWith: (a, o) => o.length <= a.length && t.compare(a.slice(0, o.length), o) === 0,
744
- endsWith: (a, o) => o.length <= a.length && t.compare(
745
- a.slice(a.length - o.length),
746
- o
747
- ) === 0
748
- };
749
- }
750
- function Lt(e) {
751
- return e == null ? null : typeof e == "string" ? e : String(e);
752
- }
753
- function _t(e) {
754
- const { model: t, onModelChange: r, getValue: a, placeholder: o, defaultOperator: i } = e, { t: c } = w("ui"), u = (t == null ? void 0 : t.type) ?? i ?? "contains", [l, p] = k(u), [s, m] = k((t == null ? void 0 : t.filter) ?? "");
755
- q(() => {
756
- p((t == null ? void 0 : t.type) ?? i ?? "contains"), m((t == null ? void 0 : t.filter) ?? "");
757
- }, [t, i]);
758
- const y = $(() => qt(yt.language), []);
759
- dt({
760
- doesFilterPass: (x) => {
761
- const F = t;
762
- if (!F || F.filter === "") return !0;
763
- const z = Lt(a(x.node));
764
- if (z === null) return !1;
765
- switch (F.type) {
766
- case "equals":
767
- return y.equals(z, F.filter);
768
- case "contains":
769
- return y.contains(z, F.filter);
770
- case "startsWith":
771
- return y.startsWith(z, F.filter);
772
- case "endsWith":
773
- return y.endsWith(z, F.filter);
774
- case "notContains":
775
- return !y.contains(z, F.filter);
776
- default:
777
- return !0;
778
- }
779
- }
780
- });
781
- function b() {
782
- if (s.trim() === "") {
783
- r(null);
784
- return;
785
- }
786
- r({ type: l, filter: s });
787
- }
788
- function T() {
789
- m(""), p(i ?? "contains"), r(null);
790
- }
791
- const g = jt.map(
792
- (x) => ({
793
- value: x,
794
- label: c(`dataTable.textFilter.operators.${x}`)
795
- })
796
- ), N = o ?? c("dataTable.textFilter.placeholder");
797
- return /* @__PURE__ */ O(
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__ */ n(
804
- vt,
805
- {
806
- size: "sm",
807
- options: g,
808
- value: l,
809
- onValueChange: (x) => {
810
- x !== "" && p(x);
811
- },
812
- "aria-label": c("dataTable.textFilter.operators.contains")
813
- }
814
- ),
815
- /* @__PURE__ */ n(
816
- le,
817
- {
818
- size: "sm",
819
- value: s,
820
- onChange: (x) => m(x.target.value),
821
- onKeyDown: (x) => {
822
- x.key === "Enter" && (x.preventDefault(), b());
823
- },
824
- placeholder: N,
825
- "aria-label": N,
826
- startAdornment: /* @__PURE__ */ n(de, { "aria-hidden": "true", className: "ds:size-4" })
827
- }
828
- ),
829
- /* @__PURE__ */ O("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__ */ n(X, { intent: "ghost", size: "sm", onClick: T, type: "button", children: c("dataTable.textFilter.clear") }),
831
- /* @__PURE__ */ n(X, { intent: "primary", size: "sm", onClick: b, type: "button", children: c("dataTable.textFilter.apply") })
832
- ] })
833
- ]
834
- }
835
- );
836
- }
837
- function Bt(e) {
838
- var m, y;
839
- const { model: t, onModelChange: r, column: a } = e, { t: o } = w("ui"), i = ((y = (m = a == null ? void 0 : a.getColDef) == null ? void 0 : m.call(a)) == null ? void 0 : y.filterParams) ?? {}, c = i.defaultOperator ?? "contains", u = i.placeholder ?? o("dataTable.textFilter.placeholder"), [l, p] = k((t == null ? void 0 : t.filter) ?? "");
840
- q(() => {
841
- p((t == null ? void 0 : t.filter) ?? "");
842
- }, [t == null ? void 0 : t.filter]), q(() => {
843
- if (l === ((t == null ? void 0 : t.filter) ?? "")) return;
844
- const b = setTimeout(() => {
845
- if (l === "") {
846
- t && r(null);
847
- return;
848
- }
849
- r({ type: c, filter: l });
850
- }, 200);
851
- return () => clearTimeout(b);
852
- }, [l, c, t, r]);
853
- function s() {
854
- p(""), t && r(null);
855
- }
856
- return /* @__PURE__ */ n("div", { "data-component": "text-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ n(
857
- le,
858
- {
859
- size: "sm",
860
- value: l,
861
- onChange: (b) => p(b.target.value),
862
- placeholder: u,
863
- "aria-label": u,
864
- startAdornment: /* @__PURE__ */ n(de, { "aria-hidden": "true", className: "ds:size-4" }),
865
- endAdornment: l.length > 0 ? /* @__PURE__ */ n(
866
- "button",
867
- {
868
- type: "button",
869
- "aria-label": o("dataTable.textFilter.clear"),
870
- onClick: s,
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__ */ n(Fe, { "aria-hidden": "true", className: "ds:size-4" })
873
- }
874
- ) : void 0
875
- }
876
- ) });
877
- }
878
- const $t = /* @__PURE__ */ new Set(["presentation", "none"]), ve = '[role="presentation"][aria-hidden], [role="none"][aria-hidden]';
879
- function Y(e) {
880
- const t = e.getAttribute("role");
881
- t === null || !$t.has(t) || e.getAttribute("aria-hidden") === "false" && e.removeAttribute("aria-hidden");
882
- }
883
- function Wt(e, t = !0) {
884
- q(() => {
885
- const r = e.current;
886
- if (!t || !r || typeof MutationObserver > "u") return;
887
- (() => {
888
- for (const i of r.querySelectorAll(ve)) Y(i);
889
- })();
890
- const o = new MutationObserver((i) => {
891
- for (const c of i)
892
- if (c.type === "attributes")
893
- Y(c.target);
894
- else
895
- for (const u of c.addedNodes)
896
- if (u instanceof Element) {
897
- Y(u);
898
- for (const l of u.querySelectorAll(ve))
899
- Y(l);
900
- }
901
- });
902
- return o.observe(r, {
903
- subtree: !0,
904
- childList: !0,
905
- attributes: !0,
906
- attributeFilter: ["aria-hidden"]
907
- }), () => o.disconnect();
908
- }, [e, t]);
909
- }
910
- const Kt = {
911
- id: "data-table",
912
- capabilities: [
913
- "select_single",
914
- "select_multiple",
915
- "range_pick",
916
- "filter",
917
- "sort",
918
- "paginate"
919
- ],
920
- state: {
921
- selection: {
922
- type: "string[]",
923
- descriptionKey: "ui.agent.dataTable.state.selection",
924
- description: "Row ids of currently-selected rows.",
925
- read: (e) => e.getSelection()
926
- },
927
- filter: {
928
- type: "object",
929
- descriptionKey: "ui.agent.dataTable.state.filter",
930
- description: "Current ag-grid filter model, keyed by column id.",
931
- read: (e) => e.getFilter()
932
- },
933
- sort: {
934
- type: "Array<{ colId, sort }>",
935
- descriptionKey: "ui.agent.dataTable.state.sort",
936
- description: "Active sort, in priority order.",
937
- read: (e) => e.getSort()
938
- },
939
- currentPage: {
940
- type: "number",
941
- descriptionKey: "ui.agent.dataTable.state.currentPage",
942
- description: "Zero-indexed page number.",
943
- read: (e) => e.getCurrentPage()
944
- }
945
- },
946
- actions: {
947
- select_rows: {
948
- // Transient grid selection (data-table convention) — stays read.
949
- safety: "read",
950
- argsType: "{ ids: string[] }",
951
- argsSchema: {
952
- type: "object",
953
- properties: {
954
- ids: {
955
- type: "array",
956
- items: { type: "string" },
957
- description: "Row ids to select (replaces the current selection)."
958
- }
959
- },
960
- required: ["ids"]
961
- },
962
- idempotent: !0,
963
- descriptionKey: "ui.agent.dataTable.actions.selectRows",
964
- description: "Replace the current selection with the given row ids.",
965
- examples: [
966
- { args: { ids: ["r-1", "r-2"] }, note: "Select the first two rows." }
967
- ],
968
- invoke: (e, t) => {
969
- e.setSelection(t.ids);
970
- }
971
- },
972
- select_range: {
973
- safety: "read",
974
- argsType: "{ fromId: string, toId: string }",
975
- argsSchema: {
976
- type: "object",
977
- properties: {
978
- fromId: { type: "string", description: "Start row id (inclusive)." },
979
- toId: { type: "string", description: "End row id (inclusive)." }
980
- },
981
- required: ["fromId", "toId"]
982
- },
983
- idempotent: !0,
984
- descriptionKey: "ui.agent.dataTable.actions.selectRange",
985
- description: "Select every row between fromId and toId, inclusive, in current sort order.",
986
- invoke: (e, t) => {
987
- e.selectRange(t.fromId, t.toId);
988
- }
989
- },
990
- clear_selection: {
991
- safety: "read",
992
- idempotent: !0,
993
- descriptionKey: "ui.agent.dataTable.actions.clearSelection",
994
- description: "Deselect all rows.",
995
- invoke: (e) => {
996
- e.clearSelection();
997
- }
998
- },
999
- get_selection: {
1000
- safety: "read",
1001
- returns: "string[]",
1002
- returnsSchema: { type: "array", items: { type: "string" } },
1003
- idempotent: !0,
1004
- descriptionKey: "ui.agent.dataTable.actions.getSelection",
1005
- description: "Return the row ids of the currently-selected rows.",
1006
- invoke: (e) => e.getSelection()
1007
- },
1008
- apply_filter: {
1009
- safety: "read",
1010
- argsType: "{ model: Record<string, unknown> }",
1011
- argsSchema: {
1012
- type: "object",
1013
- properties: {
1014
- model: {
1015
- type: "object",
1016
- description: "ag-grid filter model keyed by column id. Opaque per-column filter shapes; replaces the current model.",
1017
- additionalProperties: !0
1018
- }
1019
- },
1020
- required: ["model"]
1021
- },
1022
- idempotent: !0,
1023
- descriptionKey: "ui.agent.dataTable.actions.applyFilter",
1024
- description: "Replace the filter model with the given object.",
1025
- invoke: (e, t) => {
1026
- e.setFilter(t.model);
1027
- }
1028
- },
1029
- sort_by: {
1030
- safety: "read",
1031
- argsType: "{ model: DataTableSortEntry[] }",
1032
- argsSchema: {
1033
- type: "object",
1034
- properties: {
1035
- model: {
1036
- type: "array",
1037
- description: "Sort entries in priority order.",
1038
- items: {
1039
- type: "object",
1040
- properties: {
1041
- colId: { type: "string", description: "Column id to sort by." },
1042
- sort: { enum: ["asc", "desc"], description: "Sort direction." }
1043
- },
1044
- required: ["colId", "sort"]
1045
- }
1046
- }
1047
- },
1048
- required: ["model"]
1049
- },
1050
- idempotent: !0,
1051
- descriptionKey: "ui.agent.dataTable.actions.sortBy",
1052
- description: "Replace the active sort with the given list (priority order).",
1053
- examples: [
1054
- {
1055
- args: { model: [{ colId: "name", sort: "asc" }] },
1056
- note: "Sort by name ascending."
1057
- }
1058
- ],
1059
- invoke: (e, t) => {
1060
- e.setSort(t.model);
1061
- }
1062
- },
1063
- go_to_page: {
1064
- safety: "read",
1065
- argsType: "{ page: number }",
1066
- argsSchema: {
1067
- type: "object",
1068
- properties: {
1069
- page: {
1070
- type: "integer",
1071
- minimum: 0,
1072
- description: "Zero-indexed page number."
1073
- }
1074
- },
1075
- required: ["page"]
1076
- },
1077
- idempotent: !0,
1078
- descriptionKey: "ui.agent.dataTable.actions.goToPage",
1079
- description: "Navigate to the given zero-indexed page.",
1080
- invoke: (e, t) => {
1081
- e.goToPage(t.page);
1082
- }
1083
- }
1084
- },
1085
- domHooks: {
1086
- root: {
1087
- attr: "data-component",
1088
- value: "data-table",
1089
- description: "Marks the DataTable wrapper."
1090
- },
1091
- instanceId: {
1092
- attr: "data-component-id",
1093
- sourceProp: "gridId",
1094
- description: "Sourced from the gridId prop. Required to address a specific table from the agent."
1095
- },
1096
- item: {
1097
- attr: "row-id",
1098
- description: "Native ag-grid row-id attribute on each rendered row. Selection is performed via the curated handle, not by DOM mutation."
1099
- }
1100
- }
1101
- };
1102
- ut.registerModules([pt]);
1103
- const Vt = lt("ag-theme-alfadocs ds:w-full", {
1104
- variants: {
1105
- density: {
1106
- default: "",
1107
- compact: "data-table-compact",
1108
- expanded: "data-table-expanded"
1109
- },
1110
- bordered: {
1111
- true: "",
1112
- false: "ds:[--ag-borders:none]"
1113
- }
1114
- },
1115
- defaultVariants: {
1116
- density: "default",
1117
- bordered: !0
1118
- }
1119
- });
1120
- function Ut() {
1121
- const { t: e } = w();
1122
- return $(
1123
- () => ({
1124
- // Filter strings
1125
- contains: e("dataTable.agGrid.contains"),
1126
- notContains: e("dataTable.agGrid.notContains"),
1127
- equals: e("dataTable.agGrid.equals"),
1128
- notEqual: e("dataTable.agGrid.notEqual"),
1129
- startsWith: e("dataTable.agGrid.startsWith"),
1130
- endsWith: e("dataTable.agGrid.endsWith"),
1131
- lessThan: e("dataTable.agGrid.lessThan"),
1132
- greaterThan: e("dataTable.agGrid.greaterThan"),
1133
- inRange: e("dataTable.agGrid.inRange"),
1134
- blank: e("dataTable.agGrid.blank"),
1135
- notBlank: e("dataTable.agGrid.notBlank"),
1136
- filterOoo: e("dataTable.agGrid.filterOoo"),
1137
- applyFilter: e("dataTable.agGrid.applyFilter"),
1138
- resetFilter: e("dataTable.agGrid.resetFilter"),
1139
- noRowsToShow: e("dataTable.agGrid.noRowsToShow"),
1140
- selectAll: e("dataTable.agGrid.selectAll"),
1141
- // Pagination
1142
- page: e("dataTable.page"),
1143
- of: e("dataTable.of"),
1144
- to: e("dataTable.to"),
1145
- nextPage: e("dataTable.nextPage"),
1146
- previousPage: e("dataTable.previousPage"),
1147
- firstPage: e("dataTable.firstPage"),
1148
- lastPage: e("dataTable.lastPage"),
1149
- pageSize: e("dataTable.pageSize")
1150
- }),
1151
- [e]
1152
- );
1153
- }
1154
- function Ht() {
1155
- return /* @__PURE__ */ n(
1156
- "div",
1157
- {
1158
- role: "status",
1159
- "aria-live": "polite",
1160
- className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]",
1161
- children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ n(
1162
- it,
1163
- {
1164
- variant: "rectangular",
1165
- className: "ds:h-[var(--min-target-size)] ds:w-full"
1166
- },
1167
- t
1168
- ))
1169
- }
1170
- );
1171
- }
1172
- function Qt() {
1173
- const { t: e } = w();
1174
- return /* @__PURE__ */ n(
1175
- st,
1176
- {
1177
- variant: "no-results",
1178
- size: "sm",
1179
- title: e("dataTable.noRows"),
1180
- description: e("dataTable.noRowsDescription")
1181
- }
1182
- );
1183
- }
1184
- function qe(e) {
1185
- return e.map(({ hide: t, pinned: r, ...a }) => a);
1186
- }
1187
- function Jt(e) {
1188
- try {
1189
- const t = localStorage.getItem(`data-table-col-state:${e}`);
1190
- if (!t) return null;
1191
- const r = JSON.parse(t);
1192
- return Array.isArray(r) ? qe(r) : null;
1193
- } catch {
1194
- return null;
1195
- }
1196
- }
1197
- function Xt(e, t) {
1198
- try {
1199
- localStorage.setItem(
1200
- `data-table-col-state:${e}`,
1201
- JSON.stringify(qe(t.getColumnState()))
1202
- );
1203
- } catch {
1204
- }
1205
- }
1206
- const Zt = /* @__PURE__ */ new Set([
1207
- "api",
1208
- "flex",
1209
- "gridInitializing",
1210
- "gridOptionsChanged",
1211
- "autosizeColumns",
1212
- "sizeColumnsToFit"
1213
- ]);
1214
- function Yt(e, t) {
1215
- const {
1216
- columnDefs: r,
1217
- rowData: a,
1218
- rowSelection: o,
1219
- pagination: i = !1,
1220
- paginationPageSize: c = 25,
1221
- paginationPageSizeSelector: u = [10, 25, 50, 100],
1222
- gridId: l,
1223
- onSelectionChanged: p,
1224
- onSortChanged: s,
1225
- onFilterChanged: m,
1226
- noRowsOverlay: y,
1227
- loadingOverlay: b,
1228
- gridOptions: T,
1229
- density: g,
1230
- bordered: N,
1231
- heightClass: x = "ds:h-[500px]",
1232
- className: F,
1233
- getRowClass: z,
1234
- pinnedBottomRowData: W,
1235
- printMode: C = !1,
1236
- children: M
1237
- } = e, { t: R, i18n: S } = w(), h = se(null), H = se(null);
1238
- Wt(H);
1239
- const [K, Q] = k(0), [J, _] = k(""), _e = Ut(), re = $(
1240
- () => ({
1241
- getSelection: () => {
1242
- var v;
1243
- const d = (v = h.current) == null ? void 0 : v.api;
1244
- if (!d) return [];
1245
- const f = [];
1246
- for (const D of d.getSelectedNodes())
1247
- D.id != null && f.push(D.id);
1248
- return f;
1249
- },
1250
- setSelection: (d) => {
1251
- var D;
1252
- const f = (D = h.current) == null ? void 0 : D.api;
1253
- if (!f) return;
1254
- const v = new Set(d);
1255
- f.forEachNode((I) => {
1256
- I.id != null && I.setSelected(v.has(I.id));
1257
- });
1258
- },
1259
- selectRange: (d, f) => {
1260
- var Te;
1261
- const v = (Te = h.current) == null ? void 0 : Te.api;
1262
- if (!v) return;
1263
- const D = [];
1264
- v.forEachNodeAfterFilterAndSort((V) => {
1265
- V.id != null && D.push(V.id);
1266
- });
1267
- const I = D.indexOf(d), E = D.indexOf(f);
1268
- if (I < 0 || E < 0) return;
1269
- const [B, ne] = I <= E ? [I, E] : [E, I], oe = new Set(D.slice(B, ne + 1));
1270
- v.forEachNode((V) => {
1271
- V.id != null && V.setSelected(oe.has(V.id));
1272
- });
1273
- },
1274
- clearSelection: () => {
1275
- var d, f;
1276
- (f = (d = h.current) == null ? void 0 : d.api) == null || f.deselectAll();
1277
- },
1278
- getFilter: () => {
1279
- var d, f;
1280
- return ((f = (d = h.current) == null ? void 0 : d.api) == null ? void 0 : f.getFilterModel()) ?? {};
1281
- },
1282
- setFilter: (d) => {
1283
- var f, v;
1284
- (v = (f = h.current) == null ? void 0 : f.api) == null || v.setFilterModel(d);
1285
- },
1286
- getSort: () => {
1287
- var f;
1288
- const d = (f = h.current) == null ? void 0 : f.api;
1289
- return d ? d.getColumnState().filter((v) => v.sort === "asc" || v.sort === "desc").map((v) => ({ colId: v.colId, sort: v.sort })) : [];
1290
- },
1291
- setSort: (d) => {
1292
- var D;
1293
- const f = (D = h.current) == null ? void 0 : D.api;
1294
- if (!f) return;
1295
- const v = f.getColumnState().map((I) => {
1296
- const E = d.find((B) => B.colId === I.colId);
1297
- return { ...I, sort: E ? E.sort : null };
1298
- });
1299
- f.applyColumnState({ state: v, defaultState: { sort: null } });
1300
- },
1301
- getCurrentPage: () => {
1302
- var d, f;
1303
- return ((f = (d = h.current) == null ? void 0 : d.api) == null ? void 0 : f.paginationGetCurrentPage()) ?? 0;
1304
- },
1305
- goToPage: (d) => {
1306
- var f, v;
1307
- (v = (f = h.current) == null ? void 0 : f.api) == null || v.paginationGoToPage(d);
1308
- },
1309
- getRawApi: () => {
1310
- var d;
1311
- return (d = h.current) == null ? void 0 : d.api;
1312
- }
1313
- }),
1314
- []
1315
- );
1316
- ot(t, () => re, [re]), xt(Kt, re, l);
1317
- const Be = S.dir() === "rtl", $e = a === void 0, We = Ct(), { resolvedTheme: he } = St(), Ke = (he === "light-accessible" || he === "dark-accessible") && g === "compact" ? "default" : g, Ve = $(() => {
1318
- if (o)
1319
- return o === "single" ? { mode: "singleRow" } : {
1320
- mode: "multiRow",
1321
- headerCheckbox: !0,
1322
- checkboxes: !0
1323
- };
1324
- }, [o]), Ue = A(() => {
1325
- var f;
1326
- if (!l || !((f = h.current) != null && f.api)) return;
1327
- const d = Jt(l);
1328
- d && h.current.api.applyColumnState({
1329
- state: d,
1330
- applyOrder: !0
1331
- });
1332
- }, [l]), ae = A(
1333
- (d) => {
1334
- var f;
1335
- d.source && Zt.has(d.source) || l && ((f = h.current) != null && f.api) && Xt(l, h.current.api);
1336
- },
1337
- [l]
1338
- ), He = $(() => {
1339
- if (!T) return;
1340
- const d = { ...T };
1341
- return delete d.defaultColDef, d;
1342
- }, [T]), Qe = A(() => {
1343
- var v;
1344
- const d = (v = h.current) == null ? void 0 : v.api;
1345
- if (!d) return;
1346
- const f = d.getSelectedRows();
1347
- Q(f.length), p == null || p(f);
1348
- }, [p]), Je = A(
1349
- (d) => {
1350
- var v;
1351
- const f = (v = h.current) == null ? void 0 : v.api;
1352
- if (f) {
1353
- const I = f.getColumnState().find((E) => E.sort);
1354
- if (I) {
1355
- const E = I.colId, B = f.getColumnDef(E), ne = (B == null ? void 0 : B.headerName) ?? E, oe = I.sort === "asc" ? "dataTable.sortAscending" : "dataTable.sortDescending";
1356
- _(
1357
- R("dataTable.sortAnnounce", {
1358
- column: ne,
1359
- direction: R(oe)
1360
- })
1361
- );
1362
- } else
1363
- _("");
1364
- }
1365
- s == null || s(d);
1366
- },
1367
- [s, R]
1368
- ), Xe = A(
1369
- (d) => {
1370
- m == null || m(d);
1371
- },
1372
- [m]
1373
- );
1374
- q(() => {
1375
- if (!J) return;
1376
- const d = setTimeout(() => _(""), 3e3);
1377
- return () => clearTimeout(d);
1378
- }, [J]);
1379
- const Ze = y ?? Qt, Ye = b ?? Ht, et = A(
1380
- () => {
1381
- var d;
1382
- return (d = h.current) == null ? void 0 : d.api;
1383
- },
1384
- []
1385
- ), tt = A(() => {
1386
- typeof window < "u" && window.print();
1387
- }, []), rt = Vt({
1388
- density: Ke,
1389
- bordered: N,
1390
- className: F
1391
- }), at = M ?? /* @__PURE__ */ n("div", { className: "data-table-toolbar ds:flex ds:justify-end", children: /* @__PURE__ */ O(
1392
- Ie,
1393
- {
1394
- role: "toolbar",
1395
- "aria-label": R("dataTable.tableActions"),
1396
- className: "ds:bg-[var(--background)]",
1397
- children: [
1398
- /* @__PURE__ */ n(ee.ExportMenu, {}),
1399
- /* @__PURE__ */ n(ee.Print, {}),
1400
- /* @__PURE__ */ n(ee.ColumnToggle, {})
1401
- ]
1402
- }
1403
- ) }), nt = C ? !1 : i;
1404
- return /* @__PURE__ */ O(
1405
- "div",
1406
- {
1407
- className: "ds:flex ds:w-full ds:min-h-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-sm)]",
1408
- "aria-busy": $e ? "true" : void 0,
1409
- "data-component": "data-table",
1410
- "data-component-id": l,
1411
- "data-print-mode": C ? "true" : void 0,
1412
- children: [
1413
- !C && /* @__PURE__ */ n(
1414
- Dt,
1415
- {
1416
- getApi: et,
1417
- selectionCount: K,
1418
- onPrint: tt,
1419
- children: at
1420
- }
1421
- ),
1422
- /* @__PURE__ */ n(
1423
- "div",
1424
- {
1425
- ref: H,
1426
- className: [rt, C ? "" : x].join(" ").trim(),
1427
- children: /* @__PURE__ */ n(
1428
- ct,
1429
- {
1430
- ref: h,
1431
- theme: "legacy",
1432
- columnDefs: r,
1433
- rowData: a,
1434
- defaultColDef: {
1435
- sortable: !0,
1436
- // Default filter = DS-styled text filter so untyped columns
1437
- // (no explicit `filter:` override) inherit the kit's form
1438
- // language instead of AG Grid's stock browser-skinned input.
1439
- // Number / date / select columns opt into their dedicated
1440
- // wrapper per-column.
1441
- filter: _t,
1442
- floatingFilterComponent: Bt,
1443
- resizable: !0,
1444
- floatingFilter: !0,
1445
- // §13d — faint sort icon advertises which columns are
1446
- // sortable. v33+ moved this from grid-level to defaultColDef.
1447
- unSortIcon: !0,
1448
- ...T == null ? void 0 : T.defaultColDef
1449
- },
1450
- rowSelection: Ve,
1451
- pagination: nt,
1452
- paginationPageSize: c,
1453
- paginationPageSizeSelector: u,
1454
- paginationNumberFormatter: (d) => new Intl.NumberFormat(S.language).format(d.value),
1455
- animateRows: !We,
1456
- enableRtl: Be,
1457
- ensureDomOrder: !0,
1458
- enableCellSpan: !0,
1459
- enableCellTextSelection: !0,
1460
- copyHeadersToClipboard: !0,
1461
- accentedSort: !0,
1462
- multiSortKey: "ctrl",
1463
- suppressDragLeaveHidesColumns: !0,
1464
- suppressRowClickSelection: o ? !0 : void 0,
1465
- tooltipShowDelay: 500,
1466
- tooltipHideDelay: 5e3,
1467
- tooltipInteraction: !0,
1468
- stopEditingWhenCellsLoseFocus: !0,
1469
- maintainColumnOrder: !0,
1470
- undoRedoCellEditing: !0,
1471
- undoRedoCellEditingLimit: 20,
1472
- suppressCellFocus: !1,
1473
- rowBuffer: 10,
1474
- localeText: _e,
1475
- noRowsOverlayComponent: Ze,
1476
- loadingOverlayComponent: Ye,
1477
- getRowClass: z,
1478
- pinnedBottomRowData: W,
1479
- domLayout: C ? "autoHeight" : void 0,
1480
- onGridReady: Ue,
1481
- onColumnMoved: ae,
1482
- onColumnResized: ae,
1483
- onColumnPinned: ae,
1484
- onSortChanged: Je,
1485
- onFilterChanged: Xe,
1486
- onSelectionChanged: Qe,
1487
- ...He
1488
- }
1489
- )
1490
- }
1491
- ),
1492
- !C && /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:justify-between type-body-sm ds:text-[color:var(--muted-foreground)]", children: K > 0 ? /* @__PURE__ */ n("span", { children: R("dataTable.selected", { count: K }) }) : /* @__PURE__ */ n("span", {}) }),
1493
- /* @__PURE__ */ n("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: J })
1494
- ]
1495
- }
1496
- );
1497
- }
1498
- const Le = P(Yt);
1499
- Le.displayName = "DataTable";
1500
- const Or = Object.assign(Le, {
1501
- Toolbar: ee
1502
- });
1503
- function xe(e) {
1504
- if (!we(e)) return e;
1505
- const t = e, r = t.props.className ?? "", a = /\bsize-|\bw-|\bh-/.test(r) ? r : `${r} size-4`.trim();
1506
- return Ne(t, { className: a, size: t.props.size ?? 16 });
1507
- }
1508
- function Pr(e) {
1509
- return Math.max(1, e) * 32 + 26;
1510
- }
1511
- function ie(e, t) {
1512
- return typeof e == "function" ? e(t) : !!e;
1513
- }
1514
- const er = "ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]";
1515
- function zr(e) {
1516
- const { data: t, actions: r, intent: a = "ghost", group: o, label: i, collapsed: c } = e, { t: u } = w();
1517
- if (!t) return null;
1518
- const l = r.filter((m) => !ie(m.hidden, t));
1519
- if (typeof c == "function" ? c() : !!c)
1520
- return /* @__PURE__ */ O(j.Root, { children: [
1521
- /* @__PURE__ */ n(j.Trigger, { asChild: !0, children: /* @__PURE__ */ n(
1522
- L,
1523
- {
1524
- size: "sm",
1525
- intent: a,
1526
- icon: /* @__PURE__ */ n(wt, { "aria-hidden": !0 }),
1527
- "aria-label": i ?? u("dataTable.actions", "Actions")
1528
- }
1529
- ) }),
1530
- /* @__PURE__ */ n(j.Content, { align: "end", children: l.map((m, y) => /* @__PURE__ */ n(
1531
- j.Item,
1532
- {
1533
- startIcon: xe(m.icon),
1534
- disabled: ie(m.disabled, t),
1535
- onSelect: () => m.onClick(t),
1536
- className: m.variant === "destructive" ? "ds:text-[color:var(--destructive)]" : void 0,
1537
- children: m.label
1538
- },
1539
- y
1540
- )) })
1541
- ] });
1542
- const s = l.map((m, y) => {
1543
- const b = ie(m.disabled, t), T = b && m.disabledReason ? m.disabledReason : m.label;
1544
- return /* @__PURE__ */ n(
1545
- L,
1546
- {
1547
- size: "sm",
1548
- intent: a,
1549
- icon: xe(m.icon),
1550
- tooltip: T,
1551
- "aria-label": m.label,
1552
- disabled: b,
1553
- onClick: (g) => {
1554
- g.stopPropagation(), m.onClick(t);
1555
- },
1556
- className: m.variant === "destructive" ? er : void 0
1557
- },
1558
- y
1559
- );
1560
- });
1561
- return o ? /* @__PURE__ */ n(
1562
- Ie,
1563
- {
1564
- "aria-label": i ?? u("dataTable.actions", "Actions"),
1565
- size: "sm",
1566
- children: s
1567
- }
1568
- ) : /* @__PURE__ */ n("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: s });
1569
- }
1570
- export {
1571
- zr as A,
1572
- Or as D,
1573
- _t as T,
1574
- Bt as a,
1575
- ee as b,
1576
- Dt as c,
1577
- Pr as d,
1578
- Kt as e,
1579
- Oe as f
1580
- };
1581
- //# sourceMappingURL=actions-cell-renderer-C67oj7mR.js.map