@alfadocs/ui-kit 1.0.0 → 1.2.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.
Files changed (137) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DaL80uqL.js → actions-cell-renderer-ClGCSQnA.js} +600 -565
  2. package/dist/_chunks/{ai-consent-banner-BXD7W6FI.js → ai-consent-banner-DKgFfSzc.js} +2 -2
  3. package/dist/_chunks/{alert-Cxaqd-QO.js → alert-DS22ha1n.js} +103 -98
  4. package/dist/_chunks/{annotation-marker-qt5R9WZX.js → annotation-marker-CsUJGZjQ.js} +7 -5
  5. package/dist/_chunks/{audio-recorder-BjnB7V8n.js → audio-recorder-sRsGS-0V.js} +2 -2
  6. package/dist/_chunks/{booking-DSOK-bnR.js → booking-D8fCzcUd.js} +2 -2
  7. package/dist/_chunks/{care-plan-card-BrwhyIJI.js → care-plan-card-DjjVnBYz.js} +2 -2
  8. package/dist/_chunks/{care-plan-entry-card-DWEdCQM3.js → care-plan-entry-card-BVhpvd-P.js} +2 -2
  9. package/dist/_chunks/{collapsible-BrnRiCC6.js → collapsible-CGL9ontS.js} +65 -61
  10. package/dist/_chunks/{document-preview-DXsCEj4U.js → document-preview-DAczwybt.js} +2 -2
  11. package/dist/_chunks/{document-scanner-cS_ispQs.js → document-scanner-BRYIc3A-.js} +2 -2
  12. package/dist/_chunks/{entity-summary-BILN4wEG.js → entity-summary-BS6n7Iah.js} +2 -2
  13. package/dist/_chunks/{face-scheme-CjQAHvSP.js → face-scheme-Cou2efl7.js} +2 -2
  14. package/dist/_chunks/{file-manager-B9LZzT5E.js → file-manager-CNSLiuLo.js} +2 -2
  15. package/dist/_chunks/{freemium-paywall-Dr2342_S.js → freemium-paywall-DsT7MaLd.js} +2 -2
  16. package/dist/_chunks/link-cell-renderer-_DlEZHLI.js +772 -0
  17. package/dist/_chunks/{marketplace-app-shell-pCHBp8bo.js → marketplace-app-shell-DQC9Gpm0.js} +2 -2
  18. package/dist/_chunks/{muscle-scheme-kgCX5qfO.js → muscle-scheme-yfzP_xoJ.js} +2 -2
  19. package/dist/_chunks/notes-panel-CCz0J140.js +370 -0
  20. package/dist/_chunks/{patient-details-UmNcxL0c.js → patient-details-l7pnsUq9.js} +2 -2
  21. package/dist/_chunks/{patient-search-vtRTSdf6.js → patient-search-H54Utav2.js} +2 -2
  22. package/dist/_chunks/{patient-table-QEVsFvwq.js → patient-table-DXk0wW8Q.js} +243 -239
  23. package/dist/_chunks/payment-automation-upsell-C4LIw1iQ.js +305 -0
  24. package/dist/_chunks/{payment-form-BoGxEmGn.js → payment-form-CyKT20xZ.js} +2 -2
  25. package/dist/_chunks/{payment-request-card-CygO1anM.js → payment-request-card-CN30J6yM.js} +107 -138
  26. package/dist/_chunks/{pdf-viewer-CcOuR2wj.js → pdf-viewer-DHg8SfUI.js} +2 -2
  27. package/dist/_chunks/{practice-results-yKbwIxqa.js → practice-results-qvJRkvLn.js} +2 -2
  28. package/dist/_chunks/receipt-euro-C6k4Gzhr.js +36 -0
  29. package/dist/_chunks/{reviews-panel-DmOjvmyH.js → reviews-panel-BfUJhx3m.js} +2 -2
  30. package/dist/_chunks/{sign-document-cH9CboWB.js → sign-document-D70TEUw9.js} +2 -2
  31. package/dist/_chunks/{signature-request-BzXTV_RH.js → signature-request-BlNCXpRN.js} +2 -2
  32. package/dist/_chunks/sparkline-DJtZBe7O.js +501 -0
  33. package/dist/_chunks/{warning-stack-DKeAfj5M.js → warning-stack-IVf0oxh2.js} +2 -2
  34. package/dist/_chunks/{workflow-map-SIfAhmWz.js → workflow-map-ByyBYj6Y.js} +2 -2
  35. package/dist/agent-catalog.json +237 -7
  36. package/dist/agent-i18n/en.json +17 -5
  37. package/dist/components/ai-consent-banner/index.js +1 -1
  38. package/dist/components/alert/alert.d.ts +20 -0
  39. package/dist/components/alert/index.d.ts +1 -1
  40. package/dist/components/alert/index.js +1 -1
  41. package/dist/components/annotation-marker/index.js +1 -1
  42. package/dist/components/audio-recorder/index.js +1 -1
  43. package/dist/components/booking/index.js +1 -1
  44. package/dist/components/care-plan-card/index.js +1 -1
  45. package/dist/components/care-plan-entry-card/index.js +1 -1
  46. package/dist/components/collapsible/index.js +1 -1
  47. package/dist/components/data-table/filters/select-filter.d.ts +6 -0
  48. package/dist/components/data-table/hooks/use-presentational-aria-fix.d.ts +19 -0
  49. package/dist/components/data-table/index.js +2 -2
  50. package/dist/components/document-preview/index.js +1 -1
  51. package/dist/components/document-scanner/index.js +1 -1
  52. package/dist/components/entity-summary/index.js +1 -1
  53. package/dist/components/face-scheme/index.js +1 -1
  54. package/dist/components/file-manager/index.js +1 -1
  55. package/dist/components/freemium-paywall/index.js +1 -1
  56. package/dist/components/muscle-scheme/index.js +1 -1
  57. package/dist/components/notes-panel/index.js +1 -1
  58. package/dist/components/notes-panel/notes-panel.d.ts +45 -2
  59. package/dist/components/patient-details/index.js +1 -1
  60. package/dist/components/patient-search/index.js +1 -1
  61. package/dist/components/patient-table/index.js +1 -1
  62. package/dist/components/payment-card/index.js +1 -1
  63. package/dist/components/payment-form/index.js +1 -1
  64. package/dist/components/pdf-viewer/index.js +1 -1
  65. package/dist/components/practice-results/index.js +1 -1
  66. package/dist/components/reviews-panel/index.js +1 -1
  67. package/dist/components/sign-document/index.js +1 -1
  68. package/dist/components/skeleton-scheme/index.js +1 -1
  69. package/dist/components/sparkline/index.d.ts +1 -1
  70. package/dist/components/sparkline/index.js +1 -1
  71. package/dist/components/sparkline/sparkline.d.ts +60 -3
  72. package/dist/components/warning-stack/index.js +1 -1
  73. package/dist/components/workflow/index.js +1 -1
  74. package/dist/host-compat.css +13 -1
  75. package/dist/i18n/locales/ar.d.ts +3 -0
  76. package/dist/i18n/locales/ar.js +3 -0
  77. package/dist/i18n/locales/de.d.ts +3 -0
  78. package/dist/i18n/locales/de.js +3 -0
  79. package/dist/i18n/locales/el.d.ts +3 -0
  80. package/dist/i18n/locales/el.js +3 -0
  81. package/dist/i18n/locales/en.d.ts +3 -0
  82. package/dist/i18n/locales/en.js +3 -0
  83. package/dist/i18n/locales/es.d.ts +3 -0
  84. package/dist/i18n/locales/es.js +3 -0
  85. package/dist/i18n/locales/fr.d.ts +3 -0
  86. package/dist/i18n/locales/fr.js +3 -0
  87. package/dist/i18n/locales/hi.d.ts +3 -0
  88. package/dist/i18n/locales/hi.js +3 -0
  89. package/dist/i18n/locales/it.d.ts +3 -0
  90. package/dist/i18n/locales/it.js +3 -0
  91. package/dist/i18n/locales/ja.d.ts +3 -0
  92. package/dist/i18n/locales/ja.js +3 -0
  93. package/dist/i18n/locales/nl.d.ts +3 -0
  94. package/dist/i18n/locales/nl.js +3 -0
  95. package/dist/i18n/locales/pl.d.ts +3 -0
  96. package/dist/i18n/locales/pl.js +3 -0
  97. package/dist/i18n/locales/pt.d.ts +3 -0
  98. package/dist/i18n/locales/pt.js +3 -0
  99. package/dist/i18n/locales/ro.d.ts +3 -0
  100. package/dist/i18n/locales/ro.js +3 -0
  101. package/dist/i18n/locales/ru.d.ts +3 -0
  102. package/dist/i18n/locales/ru.js +3 -0
  103. package/dist/i18n/locales/sq.d.ts +3 -0
  104. package/dist/i18n/locales/sq.js +3 -0
  105. package/dist/i18n/locales/sv.d.ts +3 -0
  106. package/dist/i18n/locales/sv.js +3 -0
  107. package/dist/i18n/locales/tr.d.ts +3 -0
  108. package/dist/i18n/locales/tr.js +3 -0
  109. package/dist/i18n/locales/zh.d.ts +3 -0
  110. package/dist/i18n/locales/zh.js +3 -0
  111. package/dist/index.js +974 -1268
  112. package/dist/locales/ar.json +3 -0
  113. package/dist/locales/de.json +3 -0
  114. package/dist/locales/el.json +3 -0
  115. package/dist/locales/en.json +3 -0
  116. package/dist/locales/es.json +3 -0
  117. package/dist/locales/fr.json +3 -0
  118. package/dist/locales/hi.json +3 -0
  119. package/dist/locales/it.json +3 -0
  120. package/dist/locales/ja.json +3 -0
  121. package/dist/locales/nl.json +3 -0
  122. package/dist/locales/pl.json +3 -0
  123. package/dist/locales/pt.json +3 -0
  124. package/dist/locales/ro.json +3 -0
  125. package/dist/locales/ru.json +3 -0
  126. package/dist/locales/sq.json +3 -0
  127. package/dist/locales/sv.json +3 -0
  128. package/dist/locales/tr.json +3 -0
  129. package/dist/locales/zh.json +3 -0
  130. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  131. package/dist/patterns/payment-automation-upsell/index.js +5 -0
  132. package/dist/patterns/signature-request/index.js +1 -1
  133. package/dist/tokens.css +1 -1
  134. package/package.json +5 -1
  135. package/dist/_chunks/link-cell-renderer-Bt-mXeQY.js +0 -728
  136. package/dist/_chunks/notes-panel-CTcOLLVo.js +0 -324
  137. package/dist/_chunks/sparkline-DcXqRZoq.js +0 -283
@@ -0,0 +1,772 @@
1
+ import { jsx as c, jsxs as O } from "react/jsx-runtime";
2
+ import { useState as k, useEffect as w, useCallback as U, useMemo as z, useRef as J } from "react";
3
+ import { useGridFilter as A } from "ag-grid-react";
4
+ import { D as H } from "./date-range-picker-pEG3Ln3i.js";
5
+ import { useTranslation as L } from "react-i18next";
6
+ import { C as Q } from "./checkbox-BuZ1u__2.js";
7
+ import { B as P } from "./button-CPGiR_bH.js";
8
+ import { M as W } from "./multi-select-CC52Qws6.js";
9
+ import { S as X } from "./scroll-area-BZOvUhwQ.js";
10
+ import { A as $ } from "./autocomplete-BrONKN8l.js";
11
+ import { N as D } from "./number-input-DjWzmlEY.js";
12
+ import { S as Y } from "./select-BW5ecXlX.js";
13
+ import { B as ee } from "./badge-DCOqV9mI.js";
14
+ import { A as G } from "./avatar-BNQNhoyL.js";
15
+ import { T as V } from "./tag-3wgkwwDB.js";
16
+ import { T as te } from "./tooltip-DvmfrNvB.js";
17
+ import { T as j } from "./timestamp-BV2lC-wV.js";
18
+ function M(t) {
19
+ return t ? t.toISOString().slice(0, 10) : null;
20
+ }
21
+ function S(t) {
22
+ if (!t) return;
23
+ const e = new Date(t);
24
+ return Number.isNaN(e.getTime()) ? void 0 : e;
25
+ }
26
+ function Ee(t) {
27
+ var i;
28
+ const { model: e, onModelChange: n, getValue: a, doesRowPassOtherFilter: l } = t, r = ((i = t.colDef) == null ? void 0 : i.filterParams) ?? {}, [o, d] = k(() => ({
29
+ from: S(e == null ? void 0 : e.dateFrom),
30
+ to: S(e == null ? void 0 : e.dateTo)
31
+ }));
32
+ w(() => {
33
+ d({
34
+ from: S(e == null ? void 0 : e.dateFrom),
35
+ to: S(e == null ? void 0 : e.dateTo)
36
+ });
37
+ }, [e == null ? void 0 : e.dateFrom, e == null ? void 0 : e.dateTo]), A({
38
+ doesFilterPass: (s) => {
39
+ const p = S(e == null ? void 0 : e.dateFrom), C = S(e == null ? void 0 : e.dateTo);
40
+ if (!p && !C) return !0;
41
+ const y = a(s.node);
42
+ if (!y) return !1;
43
+ const T = y instanceof Date ? y : S(String(y));
44
+ return !(!T || p && T < p || C && T > C);
45
+ }
46
+ });
47
+ function u(s) {
48
+ if (d(s), !s.from && !s.to) {
49
+ n(null);
50
+ return;
51
+ }
52
+ n({
53
+ type: "inRange",
54
+ dateFrom: M(s.from),
55
+ dateTo: M(s.to)
56
+ });
57
+ }
58
+ return /* @__PURE__ */ c(
59
+ "div",
60
+ {
61
+ "data-component": "date-range-filter",
62
+ className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]",
63
+ children: /* @__PURE__ */ c(
64
+ H,
65
+ {
66
+ value: o,
67
+ onChange: u,
68
+ commitMode: r.commitMode,
69
+ size: "sm"
70
+ }
71
+ )
72
+ }
73
+ );
74
+ }
75
+ function Pe(t) {
76
+ var u, i;
77
+ const { model: e, onModelChange: n, column: a } = t, l = ((i = (u = a == null ? void 0 : a.getColDef) == null ? void 0 : u.call(a)) == null ? void 0 : i.filterParams) ?? {}, [r, o] = k(() => ({
78
+ from: S(e == null ? void 0 : e.dateFrom),
79
+ to: S(e == null ? void 0 : e.dateTo)
80
+ }));
81
+ w(() => {
82
+ o({
83
+ from: S(e == null ? void 0 : e.dateFrom),
84
+ to: S(e == null ? void 0 : e.dateTo)
85
+ });
86
+ }, [e == null ? void 0 : e.dateFrom, e == null ? void 0 : e.dateTo]);
87
+ function d(s) {
88
+ if (o(s), !s.from && !s.to) {
89
+ n(null);
90
+ return;
91
+ }
92
+ n({
93
+ type: "inRange",
94
+ dateFrom: M(s.from),
95
+ dateTo: M(s.to)
96
+ });
97
+ }
98
+ return /* @__PURE__ */ c("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
99
+ H,
100
+ {
101
+ value: r,
102
+ onChange: d,
103
+ commitMode: l.commitMode,
104
+ size: "sm",
105
+ placeholder: l.placeholder
106
+ }
107
+ ) });
108
+ }
109
+ function R(t) {
110
+ return typeof t == "number" ? `n:${t}` : `s:${t}`;
111
+ }
112
+ const ne = new Intl.Collator(void 0, { numeric: !0 });
113
+ function ae(t, e) {
114
+ if (!t) return [];
115
+ const n = /* @__PURE__ */ new Map();
116
+ return t.forEachNode((a) => {
117
+ const l = e(a);
118
+ if (l == null) return;
119
+ const r = typeof l == "string" || typeof l == "number" ? l : String(l), o = R(r);
120
+ n.has(o) || n.set(o, { value: r, label: String(r) });
121
+ }), Array.from(n.values()).sort(
122
+ (a, l) => ne.compare(String(a.label), String(l.label))
123
+ );
124
+ }
125
+ function re(t, e) {
126
+ return t.length !== e.length ? !1 : t.every(
127
+ (n, a) => R(n.value) === R(e[a].value) && n.label === e[a].label
128
+ );
129
+ }
130
+ function K(t, e, n) {
131
+ const a = e, l = a !== void 0, [r, o] = k([]), d = J(n);
132
+ return w(() => {
133
+ d.current = n;
134
+ }), w(() => {
135
+ if (l || !t) return;
136
+ const u = () => {
137
+ o((i) => {
138
+ const s = ae(t, d.current);
139
+ return re(i, s) ? i : s;
140
+ });
141
+ };
142
+ return u(), t.addEventListener("modelUpdated", u), t.addEventListener("cellValueChanged", u), () => {
143
+ t.isDestroyed() || (t.removeEventListener("modelUpdated", u), t.removeEventListener("cellValueChanged", u));
144
+ };
145
+ }, [t, l]), a ?? r;
146
+ }
147
+ function De(t) {
148
+ const { model: e, onModelChange: n, getValue: a, api: l, options: r, placeholder: o } = t, { t: d } = L("ui"), u = U(
149
+ (m) => a(m),
150
+ [a]
151
+ ), i = K(l, r, u), s = z(() => {
152
+ const m = /* @__PURE__ */ new Set(), f = (e == null ? void 0 : e.values) ?? [];
153
+ for (const g of f) m.add(R(g));
154
+ return m;
155
+ }, [e]), [p, C] = k(s);
156
+ w(() => {
157
+ C(s);
158
+ }, [s]), A({
159
+ doesFilterPass: (m) => {
160
+ const f = e == null ? void 0 : e.values;
161
+ if (!f || f.length === 0) return !0;
162
+ const g = a(m.node);
163
+ if (g == null) return !1;
164
+ const h = typeof g == "string" || typeof g == "number" ? g : String(g), F = R(h);
165
+ return f.some((N) => R(N) === F);
166
+ }
167
+ });
168
+ function y(m) {
169
+ C((f) => {
170
+ const g = new Set(f);
171
+ return g.has(m) ? g.delete(m) : g.add(m), g;
172
+ });
173
+ }
174
+ function T() {
175
+ if (p.size === 0) {
176
+ n(null);
177
+ return;
178
+ }
179
+ const m = [];
180
+ for (const f of i)
181
+ p.has(R(f.value)) && m.push(f.value);
182
+ if (m.length === 0) {
183
+ n(null);
184
+ return;
185
+ }
186
+ n({ type: "set", values: m });
187
+ }
188
+ function b() {
189
+ C(/* @__PURE__ */ new Set()), n(null);
190
+ }
191
+ const v = o ?? d("dataTable.selectFilter.all");
192
+ return /* @__PURE__ */ O(
193
+ "div",
194
+ {
195
+ "data-component": "select-filter",
196
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[200px] ds:max-w-[260px]",
197
+ children: [
198
+ /* @__PURE__ */ c(X, { orientation: "vertical", className: "ds:max-h-[240px]", children: /* @__PURE__ */ c(
199
+ "div",
200
+ {
201
+ role: "group",
202
+ "aria-label": v,
203
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
204
+ children: i.length === 0 ? /* @__PURE__ */ c("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: d("dataTable.agGrid.noRowsToShow") }) : i.map((m) => {
205
+ const f = R(m.value);
206
+ return /* @__PURE__ */ c(
207
+ Q,
208
+ {
209
+ size: "sm",
210
+ label: m.label,
211
+ checked: p.has(f),
212
+ onCheckedChange: () => y(f)
213
+ },
214
+ f
215
+ );
216
+ })
217
+ }
218
+ ) }),
219
+ /* @__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: [
220
+ /* @__PURE__ */ c(P, { intent: "ghost", size: "sm", onClick: b, type: "button", children: d("dataTable.selectFilter.clear") }),
221
+ /* @__PURE__ */ c(P, { intent: "primary", size: "sm", onClick: T, type: "button", children: d("dataTable.selectFilter.apply") })
222
+ ] })
223
+ ]
224
+ }
225
+ );
226
+ }
227
+ function Me(t) {
228
+ var T;
229
+ const { model: e, onModelChange: n, column: a, api: l } = t, r = (T = a == null ? void 0 : a.getColDef) == null ? void 0 : T.call(a), o = (r == null ? void 0 : r.filterParams) ?? {}, d = U(
230
+ (b) => l && a ? l.getCellValue({
231
+ rowNode: b,
232
+ colKey: a
233
+ }) : void 0,
234
+ [l, a]
235
+ ), u = K(
236
+ l,
237
+ o.options,
238
+ d
239
+ ), i = o.placeholder ?? (typeof (r == null ? void 0 : r.headerName) == "string" ? r.headerName : void 0), s = z(() => {
240
+ const b = /* @__PURE__ */ new Map();
241
+ for (const v of u) b.set(String(v.value), v.value);
242
+ return b;
243
+ }, [u]), p = z(
244
+ () => u.map((b) => ({
245
+ value: String(b.value),
246
+ label: b.label
247
+ })),
248
+ [u]
249
+ ), C = z(
250
+ () => ((e == null ? void 0 : e.values) ?? []).map((b) => String(b)),
251
+ [e]
252
+ );
253
+ function y(b) {
254
+ if (b.length === 0) {
255
+ n(null);
256
+ return;
257
+ }
258
+ const v = [];
259
+ for (const m of b) {
260
+ const f = s.get(m);
261
+ f !== void 0 && v.push(f);
262
+ }
263
+ if (v.length === 0) {
264
+ n(null);
265
+ return;
266
+ }
267
+ n({ type: "set", values: v });
268
+ }
269
+ return /* @__PURE__ */ c("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
270
+ W,
271
+ {
272
+ size: "sm",
273
+ options: p,
274
+ value: C,
275
+ onChange: y,
276
+ placeholder: o.placeholder,
277
+ "aria-label": i,
278
+ allowClear: !0
279
+ }
280
+ ) });
281
+ }
282
+ function E(t) {
283
+ return t.trim().toLocaleLowerCase();
284
+ }
285
+ function Ae(t) {
286
+ const {
287
+ model: e,
288
+ onModelChange: n,
289
+ getValue: a,
290
+ api: l,
291
+ column: r,
292
+ options: o,
293
+ loadOptions: d,
294
+ placeholder: u
295
+ } = t, { t: i } = L("ui"), s = z(() => {
296
+ if (o && o.length > 0) return o;
297
+ if (!l || !r) return [];
298
+ const f = /* @__PURE__ */ new Map();
299
+ return l.forEachNode((g) => {
300
+ const h = a(g);
301
+ if (h == null) return;
302
+ const F = typeof h == "string" ? h : String(h);
303
+ f.has(F) || f.set(F, { value: F, label: F });
304
+ }), Array.from(f.values()).sort(
305
+ (g, h) => g.label.localeCompare(h.label)
306
+ );
307
+ }, [o, l, r, a]), p = z(() => async (f, g) => {
308
+ if (d)
309
+ return (await d(f, g)).map((x) => ({ value: x.value, label: x.label }));
310
+ const h = E(f);
311
+ return (h ? s.filter((N) => E(N.label).includes(h)) : s).slice(0, 50).map((N) => ({ value: N.value, label: N.label }));
312
+ }, [d, s]), [C, y] = k((e == null ? void 0 : e.value) ?? "");
313
+ w(() => {
314
+ y((e == null ? void 0 : e.value) ?? "");
315
+ }, [e == null ? void 0 : e.value]), A({
316
+ doesFilterPass: (f) => {
317
+ const g = e == null ? void 0 : e.value;
318
+ if (!g) return !0;
319
+ const h = a(f.node);
320
+ if (h == null) return !1;
321
+ const F = typeof h == "string" ? h : String(h);
322
+ return E(F) === E(g);
323
+ }
324
+ });
325
+ function T(f) {
326
+ y(f.label), n({ type: "equals", value: f.value });
327
+ }
328
+ function b(f) {
329
+ y(f), f === "" && e && n(null);
330
+ }
331
+ function v() {
332
+ y(""), n(null);
333
+ }
334
+ const m = u ?? i("dataTable.typeaheadFilter.placeholder");
335
+ return /* @__PURE__ */ O(
336
+ "div",
337
+ {
338
+ "data-component": "typeahead-filter",
339
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
340
+ children: [
341
+ /* @__PURE__ */ c(
342
+ $,
343
+ {
344
+ size: "sm",
345
+ value: C,
346
+ onChange: b,
347
+ onSelect: T,
348
+ loadOptions: p,
349
+ placeholder: m,
350
+ "aria-label": m
351
+ }
352
+ ),
353
+ /* @__PURE__ */ c("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ c(P, { intent: "ghost", size: "sm", onClick: v, type: "button", children: i("dataTable.typeaheadFilter.clear") }) })
354
+ ]
355
+ }
356
+ );
357
+ }
358
+ function qe(t) {
359
+ var T, b;
360
+ const { model: e, onModelChange: n, column: a } = t, { t: l } = L("ui"), r = ((b = (T = a == null ? void 0 : a.getColDef) == null ? void 0 : T.call(a)) == null ? void 0 : b.filterParams) ?? {}, o = r.options ?? [], d = r.loadOptions, u = r.placeholder ?? l("dataTable.typeaheadFilter.placeholder"), i = z(() => async (v, m) => {
361
+ if (d)
362
+ return (await d(v, m)).map((F) => ({ value: F.value, label: F.label }));
363
+ const f = E(v);
364
+ return (f ? o.filter((h) => E(h.label).includes(f)) : o).slice(0, 50).map((h) => ({ value: h.value, label: h.label }));
365
+ }, [d, o]), [s, p] = k((e == null ? void 0 : e.value) ?? "");
366
+ w(() => {
367
+ p((e == null ? void 0 : e.value) ?? "");
368
+ }, [e == null ? void 0 : e.value]);
369
+ function C(v) {
370
+ p(v.label), n({ type: "equals", value: v.value });
371
+ }
372
+ function y(v) {
373
+ p(v), v === "" && e && n(null);
374
+ }
375
+ return /* @__PURE__ */ c("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
376
+ $,
377
+ {
378
+ size: "sm",
379
+ value: s,
380
+ onChange: y,
381
+ onSelect: C,
382
+ loadOptions: i,
383
+ placeholder: u,
384
+ "aria-label": u
385
+ }
386
+ ) });
387
+ }
388
+ const le = [
389
+ "equals",
390
+ "notEqual",
391
+ "greaterThan",
392
+ "greaterThanOrEqual",
393
+ "lessThan",
394
+ "lessThanOrEqual",
395
+ "inRange",
396
+ "blank",
397
+ "notBlank"
398
+ ];
399
+ function B(t) {
400
+ return t !== "blank" && t !== "notBlank";
401
+ }
402
+ function I(t) {
403
+ return t === "inRange";
404
+ }
405
+ function se(t, e, n, a) {
406
+ if (t === "blank") return e === null;
407
+ if (t === "notBlank") return e !== null;
408
+ if (e === null) return !1;
409
+ if (n === null) return !0;
410
+ switch (t) {
411
+ case "equals":
412
+ return e === n;
413
+ case "notEqual":
414
+ return e !== n;
415
+ case "greaterThan":
416
+ return e > n;
417
+ case "greaterThanOrEqual":
418
+ return e >= n;
419
+ case "lessThan":
420
+ return e < n;
421
+ case "lessThanOrEqual":
422
+ return e <= n;
423
+ case "inRange": {
424
+ if (a === null) return e >= n;
425
+ const l = Math.min(n, a), r = Math.max(n, a);
426
+ return e >= l && e <= r;
427
+ }
428
+ default:
429
+ return !0;
430
+ }
431
+ }
432
+ function oe(t) {
433
+ if (t == null || t === "") return null;
434
+ const e = typeof t == "number" ? t : Number(t);
435
+ return Number.isNaN(e) ? null : e;
436
+ }
437
+ function Ve(t) {
438
+ const {
439
+ model: e,
440
+ onModelChange: n,
441
+ getValue: a,
442
+ defaultOperator: l,
443
+ min: r,
444
+ max: o,
445
+ step: d,
446
+ placeholder: u
447
+ } = t, { t: i } = L("ui"), s = (e == null ? void 0 : e.type) ?? l ?? "equals", [p, C] = k(s), [y, T] = k((e == null ? void 0 : e.filter) ?? null), [b, v] = k(
448
+ (e == null ? void 0 : e.filterTo) ?? null
449
+ );
450
+ w(() => {
451
+ if (e == null) {
452
+ C(l ?? "equals"), T(null), v(null);
453
+ return;
454
+ }
455
+ C(e.type), T(e.filter ?? null), v(e.filterTo ?? null);
456
+ }, [e, l]), A({
457
+ doesFilterPass: (x) => {
458
+ if (!e) return !0;
459
+ const Z = oe(a(x.node));
460
+ return se(
461
+ e.type,
462
+ Z,
463
+ e.filter ?? null,
464
+ e.filterTo ?? null
465
+ );
466
+ }
467
+ });
468
+ const m = z(
469
+ () => le.map((x) => ({
470
+ value: x,
471
+ label: i(`dataTable.numberFilter.operators.${x}`)
472
+ })),
473
+ [i]
474
+ ), f = u ?? i("dataTable.numberFilter.placeholder");
475
+ function g() {
476
+ if (!B(p)) {
477
+ n({ type: p, filter: 0 });
478
+ return;
479
+ }
480
+ if (y === null) {
481
+ n(null);
482
+ return;
483
+ }
484
+ if (I(p)) {
485
+ n({
486
+ type: p,
487
+ filter: y,
488
+ filterTo: b ?? void 0
489
+ });
490
+ return;
491
+ }
492
+ n({ type: p, filter: y });
493
+ }
494
+ function h() {
495
+ C(l ?? "equals"), T(null), v(null), n(null);
496
+ }
497
+ const F = B(p), N = I(p);
498
+ return /* @__PURE__ */ O(
499
+ "div",
500
+ {
501
+ "data-component": "number-filter",
502
+ className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
503
+ children: [
504
+ /* @__PURE__ */ c(
505
+ Y,
506
+ {
507
+ size: "sm",
508
+ options: m,
509
+ value: p,
510
+ onValueChange: (x) => {
511
+ x !== "" && C(x);
512
+ },
513
+ "aria-label": i("dataTable.numberFilter.operators.equals")
514
+ }
515
+ ),
516
+ F && !N && /* @__PURE__ */ c(
517
+ D,
518
+ {
519
+ size: "sm",
520
+ value: y,
521
+ onChange: T,
522
+ min: r,
523
+ max: o,
524
+ step: d,
525
+ placeholder: f,
526
+ "aria-label": f
527
+ }
528
+ ),
529
+ N && /* @__PURE__ */ O("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
530
+ /* @__PURE__ */ c(
531
+ D,
532
+ {
533
+ size: "sm",
534
+ value: y,
535
+ onChange: T,
536
+ min: r,
537
+ max: o,
538
+ step: d,
539
+ placeholder: i("dataTable.numberFilter.from"),
540
+ "aria-label": i("dataTable.numberFilter.from")
541
+ }
542
+ ),
543
+ /* @__PURE__ */ c(
544
+ D,
545
+ {
546
+ size: "sm",
547
+ value: b,
548
+ onChange: v,
549
+ min: r,
550
+ max: o,
551
+ step: d,
552
+ placeholder: i("dataTable.numberFilter.to"),
553
+ "aria-label": i("dataTable.numberFilter.to")
554
+ }
555
+ )
556
+ ] }),
557
+ /* @__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: [
558
+ /* @__PURE__ */ c(P, { intent: "ghost", size: "sm", onClick: h, type: "button", children: i("dataTable.numberFilter.clear") }),
559
+ /* @__PURE__ */ c(P, { intent: "primary", size: "sm", onClick: g, type: "button", children: i("dataTable.numberFilter.apply") })
560
+ ] })
561
+ ]
562
+ }
563
+ );
564
+ }
565
+ function je(t) {
566
+ var s, p;
567
+ const { model: e, onModelChange: n, column: a } = t, { t: l } = L("ui"), r = ((p = (s = a == null ? void 0 : a.getColDef) == null ? void 0 : s.call(a)) == null ? void 0 : p.filterParams) ?? {}, o = r.defaultOperator ?? "equals", d = r.placeholder ?? l("dataTable.numberFilter.placeholder"), [u, i] = k((e == null ? void 0 : e.filter) ?? null);
568
+ return w(() => {
569
+ i((e == null ? void 0 : e.filter) ?? null);
570
+ }, [e == null ? void 0 : e.filter]), w(() => {
571
+ if (u === ((e == null ? void 0 : e.filter) ?? null)) return;
572
+ const C = setTimeout(() => {
573
+ if (u === null || Number.isNaN(u)) {
574
+ n(null);
575
+ return;
576
+ }
577
+ n({ type: o, filter: u });
578
+ }, 200);
579
+ return () => clearTimeout(C);
580
+ }, [u, o]), /* @__PURE__ */ c("div", { "data-component": "number-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
581
+ D,
582
+ {
583
+ size: "sm",
584
+ value: u,
585
+ onChange: i,
586
+ min: r.min,
587
+ max: r.max,
588
+ step: r.step,
589
+ placeholder: d,
590
+ "aria-label": d
591
+ }
592
+ ) });
593
+ }
594
+ function Be(t) {
595
+ const { value: e, variantMap: n } = t, a = (n == null ? void 0 : n[e]) ?? "neutral";
596
+ return /* @__PURE__ */ c(ee, { variant: a, withDot: !0, size: "sm", children: String(e ?? "") });
597
+ }
598
+ function Ie(t) {
599
+ const { value: e } = t;
600
+ return e ? /* @__PURE__ */ O("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
601
+ /* @__PURE__ */ c(G, { name: e.name, src: e.src, size: "sm" }),
602
+ /* @__PURE__ */ c("span", { children: e.name })
603
+ ] }) : null;
604
+ }
605
+ const ie = {
606
+ sm: "ds:size-8",
607
+ md: "ds:size-10",
608
+ lg: "ds:size-12"
609
+ }, ue = {
610
+ square: "ds:rounded-none",
611
+ rounded: "ds:rounded-[var(--radius-md)]",
612
+ circle: "ds:rounded-[var(--radius-full)]"
613
+ };
614
+ function q(t, e) {
615
+ if (!t || typeof t != "object") return;
616
+ const n = t[e];
617
+ return typeof n == "string" ? n : void 0;
618
+ }
619
+ const ce = /^(?:https?:|data:image\/)/i;
620
+ function de(t) {
621
+ if (!t) return;
622
+ const e = t.trim();
623
+ if (e.length !== 0)
624
+ return ce.test(e) ? e : void 0;
625
+ }
626
+ function _e(t) {
627
+ const {
628
+ data: e,
629
+ srcField: n,
630
+ altField: a,
631
+ fallbackField: l,
632
+ size: r = "md",
633
+ shape: o = "rounded"
634
+ } = t;
635
+ if (!e) return null;
636
+ const d = q(e, n), u = de(d), i = a ? q(e, a) ?? "" : "", s = l ? q(e, l) : void 0;
637
+ return u ? /* @__PURE__ */ c(
638
+ "img",
639
+ {
640
+ src: u,
641
+ alt: i,
642
+ loading: "lazy",
643
+ decoding: "async",
644
+ className: ["ds:object-cover", ie[r], ue[o]].join(
645
+ " "
646
+ )
647
+ }
648
+ ) : s ? /* @__PURE__ */ c(G, { name: s, size: r }) : null;
649
+ }
650
+ function Ue(t) {
651
+ const { value: e, maxVisible: n = 3 } = t, { t: a } = L();
652
+ if (!Array.isArray(e) || e.length === 0) return null;
653
+ const l = e.slice(0, n), r = e.length - n;
654
+ return /* @__PURE__ */ O("span", { className: "ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
655
+ l.map((o) => /* @__PURE__ */ c(V, { label: o, size: "sm" }, o)),
656
+ r > 0 && /* @__PURE__ */ c(te, { label: e.slice(n).join(", "), children: /* @__PURE__ */ c(
657
+ V,
658
+ {
659
+ label: a("inputs.multiSelect.overflow", { count: r }),
660
+ size: "sm",
661
+ variant: "neutral",
662
+ fill: "outline"
663
+ }
664
+ ) })
665
+ ] });
666
+ }
667
+ const fe = {
668
+ date: { year: "numeric", month: "short", day: "numeric" },
669
+ time: { hour: "2-digit", minute: "2-digit" },
670
+ datetime: {
671
+ year: "numeric",
672
+ month: "short",
673
+ day: "numeric",
674
+ hour: "2-digit",
675
+ minute: "2-digit"
676
+ }
677
+ };
678
+ function He(t) {
679
+ const { value: e, format: n = "date", options: a } = t;
680
+ return e == null || e === "" ? null : n === "relative" && !a ? /* @__PURE__ */ c(j, { value: e, shape: "bare" }) : /* @__PURE__ */ c(
681
+ j,
682
+ {
683
+ value: e,
684
+ format: "absolute",
685
+ shape: "bare",
686
+ absoluteFormat: a ?? fe[n === "relative" ? "date" : n]
687
+ }
688
+ );
689
+ }
690
+ function pe(t) {
691
+ if (t == null || t === "") return null;
692
+ const e = typeof t == "number" ? t : Number(t);
693
+ return Number.isFinite(e) ? e : null;
694
+ }
695
+ function $e(t) {
696
+ const {
697
+ value: e,
698
+ currency: n = "EUR",
699
+ colorNegative: a,
700
+ strikethrough: l,
701
+ options: r
702
+ } = t, { i18n: o } = L(), d = pe(e);
703
+ if (d === null) return null;
704
+ const u = o.language || "en", i = new Intl.NumberFormat(u, {
705
+ style: "currency",
706
+ currency: n,
707
+ ...r
708
+ }).format(d), s = ["ds:tabular-nums"];
709
+ return a && d < 0 && s.push("ds:text-[color:var(--destructive)]"), l && s.push("line-through"), /* @__PURE__ */ c("span", { className: s.join(" "), children: i });
710
+ }
711
+ function _(t, e) {
712
+ return typeof t == "function" ? t(e) : t;
713
+ }
714
+ function me(t) {
715
+ return /^(https?:\/\/|\/|#|mailto:|tel:)/i.test(t) ? t : "#";
716
+ }
717
+ function Ge(t) {
718
+ const { value: e, data: n, href: a, onClick: l, secondary: r } = t;
719
+ if (!n) return null;
720
+ const o = _(a, n), d = _(r, n), u = e == null || e === "" ? "" : String(e), i = [
721
+ "ds:text-[color:var(--primary)]",
722
+ "ds:hover:underline",
723
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
724
+ "ds:focus-visible:outline-solid",
725
+ "ds:focus-visible:outline-[color:var(--ring)]",
726
+ "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
727
+ "ds:rounded-[var(--radius-sm)]"
728
+ ].join(" "), s = (p) => {
729
+ l && (o || p.preventDefault(), p.stopPropagation(), l(n));
730
+ };
731
+ return /* @__PURE__ */ O("span", { className: "ds:flex ds:flex-col ds:leading-tight", children: [
732
+ o ? /* @__PURE__ */ c(
733
+ "a",
734
+ {
735
+ href: me(o),
736
+ onClick: s,
737
+ className: i,
738
+ children: u
739
+ }
740
+ ) : /* @__PURE__ */ c(
741
+ "button",
742
+ {
743
+ type: "button",
744
+ onClick: s,
745
+ className: [
746
+ "ds:appearance-none ds:bg-transparent ds:p-0 ds:text-start",
747
+ i
748
+ ].join(" "),
749
+ children: u
750
+ }
751
+ ),
752
+ d ? /* @__PURE__ */ c("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: d }) : null
753
+ ] });
754
+ }
755
+ export {
756
+ $e as C,
757
+ He as D,
758
+ _e as I,
759
+ Ge as L,
760
+ Ve as N,
761
+ De as S,
762
+ Ue as T,
763
+ Ie as U,
764
+ Ee as a,
765
+ Pe as b,
766
+ je as c,
767
+ Me as d,
768
+ Be as e,
769
+ Ae as f,
770
+ qe as g
771
+ };
772
+ //# sourceMappingURL=link-cell-renderer-_DlEZHLI.js.map