@alfadocs/ui-kit 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +1,69 @@
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";
1
+ import { jsx as o, jsxs as O } from "react/jsx-runtime";
2
+ import { useState as k, useEffect as w, useCallback as H, useMemo as R, useRef as J } from "react";
3
3
  import { useGridFilter as A } from "ag-grid-react";
4
- import { D as H } from "./date-range-picker-BD8P_rJq.js";
5
- import { useTranslation as L } from "react-i18next";
4
+ import { D as $ } from "./date-range-picker-BD8P_rJq.js";
5
+ import { useTranslation as E } from "react-i18next";
6
6
  import { C as Q } from "./checkbox-BuZ1u__2.js";
7
7
  import { B as P } from "./button-nJaPh_HC.js";
8
8
  import { M as W } from "./multi-select-DqL4o0qV.js";
9
9
  import { S as X } from "./scroll-area-BZOvUhwQ.js";
10
- import { A as $ } from "./autocomplete-BrONKN8l.js";
10
+ import { A as G } from "./autocomplete-BrONKN8l.js";
11
11
  import { N as D } from "./number-input-Cgu2TtA8.js";
12
12
  import { S as Y } from "./select-BW5ecXlX.js";
13
13
  import { B as ee } from "./badge-sTusUqZD.js";
14
- import { A as G } from "./avatar-BNQNhoyL.js";
15
- import { T as V } from "./tag-3wgkwwDB.js";
14
+ import { A as V } from "./avatar-BNQNhoyL.js";
15
+ import { T as j } from "./tag-3wgkwwDB.js";
16
16
  import { T as te } from "./tooltip-DvmfrNvB.js";
17
- import { T as j } from "./timestamp-BV2lC-wV.js";
17
+ import { T as B } from "./timestamp-BV2lC-wV.js";
18
18
  function M(t) {
19
19
  return t ? t.toISOString().slice(0, 10) : null;
20
20
  }
21
- function S(t) {
21
+ function F(t) {
22
22
  if (!t) return;
23
23
  const e = new Date(t);
24
24
  return Number.isNaN(e.getTime()) ? void 0 : e;
25
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)
26
+ function Le(t) {
27
+ var c;
28
+ const { model: e, onModelChange: n, getValue: a, doesRowPassOtherFilter: l } = t, r = ((c = t.colDef) == null ? void 0 : c.filterParams) ?? {}, [s, f] = k(() => ({
29
+ from: F(e == null ? void 0 : e.dateFrom),
30
+ to: F(e == null ? void 0 : e.dateTo)
31
31
  }));
32
32
  w(() => {
33
- d({
34
- from: S(e == null ? void 0 : e.dateFrom),
35
- to: S(e == null ? void 0 : e.dateTo)
33
+ f({
34
+ from: F(e == null ? void 0 : e.dateFrom),
35
+ to: F(e == null ? void 0 : e.dateTo)
36
36
  });
37
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);
38
+ doesFilterPass: (i) => {
39
+ const p = F(e == null ? void 0 : e.dateFrom), C = F(e == null ? void 0 : e.dateTo);
40
40
  if (!p && !C) return !0;
41
- const y = a(s.node);
41
+ const y = a(i.node);
42
42
  if (!y) return !1;
43
- const T = y instanceof Date ? y : S(String(y));
43
+ const T = y instanceof Date ? y : F(String(y));
44
44
  return !(!T || p && T < p || C && T > C);
45
45
  }
46
46
  });
47
- function u(s) {
48
- if (d(s), !s.from && !s.to) {
47
+ function u(i) {
48
+ if (f(i), !i.from && !i.to) {
49
49
  n(null);
50
50
  return;
51
51
  }
52
52
  n({
53
53
  type: "inRange",
54
- dateFrom: M(s.from),
55
- dateTo: M(s.to)
54
+ dateFrom: M(i.from),
55
+ dateTo: M(i.to)
56
56
  });
57
57
  }
58
- return /* @__PURE__ */ c(
58
+ return /* @__PURE__ */ o(
59
59
  "div",
60
60
  {
61
61
  "data-component": "date-range-filter",
62
62
  className: "ds:p-[var(--spacing-sm)] ds:min-w-[280px]",
63
- children: /* @__PURE__ */ c(
64
- H,
63
+ children: /* @__PURE__ */ o(
64
+ $,
65
65
  {
66
- value: o,
66
+ value: s,
67
67
  onChange: u,
68
68
  commitMode: r.commitMode,
69
69
  size: "sm"
@@ -72,41 +72,41 @@ function Ee(t) {
72
72
  }
73
73
  );
74
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)
75
+ function Ee(t) {
76
+ var u, c;
77
+ const { model: e, onModelChange: n, column: a } = t, l = ((c = (u = a == null ? void 0 : a.getColDef) == null ? void 0 : u.call(a)) == null ? void 0 : c.filterParams) ?? {}, [r, s] = k(() => ({
78
+ from: F(e == null ? void 0 : e.dateFrom),
79
+ to: F(e == null ? void 0 : e.dateTo)
80
80
  }));
81
81
  w(() => {
82
- o({
83
- from: S(e == null ? void 0 : e.dateFrom),
84
- to: S(e == null ? void 0 : e.dateTo)
82
+ s({
83
+ from: F(e == null ? void 0 : e.dateFrom),
84
+ to: F(e == null ? void 0 : e.dateTo)
85
85
  });
86
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) {
87
+ function f(i) {
88
+ if (s(i), !i.from && !i.to) {
89
89
  n(null);
90
90
  return;
91
91
  }
92
92
  n({
93
93
  type: "inRange",
94
- dateFrom: M(s.from),
95
- dateTo: M(s.to)
94
+ dateFrom: M(i.from),
95
+ dateTo: M(i.to)
96
96
  });
97
97
  }
98
- return /* @__PURE__ */ c("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
99
- H,
98
+ return /* @__PURE__ */ o("div", { "data-component": "date-range-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
99
+ $,
100
100
  {
101
101
  value: r,
102
- onChange: d,
102
+ onChange: f,
103
103
  commitMode: l.commitMode,
104
104
  size: "sm",
105
105
  placeholder: l.placeholder
106
106
  }
107
107
  ) });
108
108
  }
109
- function R(t) {
109
+ function z(t) {
110
110
  return typeof t == "number" ? `n:${t}` : `s:${t}`;
111
111
  }
112
112
  const ne = new Intl.Collator(void 0, { numeric: !0 });
@@ -116,27 +116,27 @@ function ae(t, e) {
116
116
  return t.forEachNode((a) => {
117
117
  const l = e(a);
118
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) });
119
+ const r = typeof l == "string" || typeof l == "number" ? l : String(l), s = z(r);
120
+ n.has(s) || n.set(s, { value: r, label: String(r) });
121
121
  }), Array.from(n.values()).sort(
122
122
  (a, l) => ne.compare(String(a.label), String(l.label))
123
123
  );
124
124
  }
125
125
  function re(t, e) {
126
126
  return t.length !== e.length ? !1 : t.every(
127
- (n, a) => R(n.value) === R(e[a].value) && n.label === e[a].label
127
+ (n, a) => z(n.value) === z(e[a].value) && n.label === e[a].label
128
128
  );
129
129
  }
130
130
  function K(t, e, n) {
131
- const a = e, l = a !== void 0, [r, o] = k([]), d = J(n);
131
+ const a = e, l = a !== void 0, [r, s] = k([]), f = J(n);
132
132
  return w(() => {
133
- d.current = n;
133
+ f.current = n;
134
134
  }), w(() => {
135
135
  if (l || !t) return;
136
136
  const u = () => {
137
- o((i) => {
138
- const s = ae(t, d.current);
139
- return re(i, s) ? i : s;
137
+ s((c) => {
138
+ const i = ae(t, f.current);
139
+ return re(c, i) ? c : i;
140
140
  });
141
141
  };
142
142
  return u(), t.addEventListener("modelUpdated", u), t.addEventListener("cellValueChanged", u), () => {
@@ -144,31 +144,31 @@ function K(t, e, n) {
144
144
  };
145
145
  }, [t, l]), a ?? r;
146
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(
147
+ function Pe(t) {
148
+ const { model: e, onModelChange: n, getValue: a, api: l, options: r, placeholder: s } = t, { t: f } = E("ui"), u = H(
149
149
  (m) => a(m),
150
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));
151
+ ), c = K(l, r, u), i = R(() => {
152
+ const m = /* @__PURE__ */ new Set(), d = (e == null ? void 0 : e.values) ?? [];
153
+ for (const h of d) m.add(z(h));
154
154
  return m;
155
- }, [e]), [p, C] = k(s);
155
+ }, [e]), [p, C] = k(i);
156
156
  w(() => {
157
- C(s);
158
- }, [s]), A({
157
+ C(i);
158
+ }, [i]), A({
159
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);
160
+ const d = e == null ? void 0 : e.values;
161
+ if (!d || d.length === 0) return !0;
162
+ const h = a(m.node);
163
+ if (h == null) return !1;
164
+ const g = typeof h == "string" || typeof h == "number" ? h : String(h), S = z(g);
165
+ return d.some((N) => z(N) === S);
166
166
  }
167
167
  });
168
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;
169
+ C((d) => {
170
+ const h = new Set(d);
171
+ return h.has(m) ? h.delete(m) : h.add(m), h;
172
172
  });
173
173
  }
174
174
  function T() {
@@ -177,8 +177,8 @@ function De(t) {
177
177
  return;
178
178
  }
179
179
  const m = [];
180
- for (const f of i)
181
- p.has(R(f.value)) && m.push(f.value);
180
+ for (const d of c)
181
+ p.has(z(d.value)) && m.push(d.value);
182
182
  if (m.length === 0) {
183
183
  n(null);
184
184
  return;
@@ -188,45 +188,45 @@ function De(t) {
188
188
  function b() {
189
189
  C(/* @__PURE__ */ new Set()), n(null);
190
190
  }
191
- const v = o ?? d("dataTable.selectFilter.all");
191
+ const v = s ?? f("dataTable.selectFilter.all");
192
192
  return /* @__PURE__ */ O(
193
193
  "div",
194
194
  {
195
195
  "data-component": "select-filter",
196
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
197
  children: [
198
- /* @__PURE__ */ c(X, { orientation: "vertical", className: "ds:max-h-[240px]", children: /* @__PURE__ */ c(
198
+ /* @__PURE__ */ o(X, { orientation: "vertical", className: "ds:max-h-[240px]", children: /* @__PURE__ */ o(
199
199
  "div",
200
200
  {
201
201
  role: "group",
202
202
  "aria-label": v,
203
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(
204
+ children: c.length === 0 ? /* @__PURE__ */ o("p", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]", children: f("dataTable.agGrid.noRowsToShow") }) : c.map((m) => {
205
+ const d = z(m.value);
206
+ return /* @__PURE__ */ o(
207
207
  Q,
208
208
  {
209
209
  size: "sm",
210
210
  label: m.label,
211
- checked: p.has(f),
212
- onCheckedChange: () => y(f)
211
+ checked: p.has(d),
212
+ onCheckedChange: () => y(d)
213
213
  },
214
- f
214
+ d
215
215
  );
216
216
  })
217
217
  }
218
218
  ) }),
219
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") })
220
+ /* @__PURE__ */ o(P, { intent: "ghost", size: "sm", onClick: b, type: "button", children: f("dataTable.selectFilter.clear") }),
221
+ /* @__PURE__ */ o(P, { intent: "primary", size: "sm", onClick: T, type: "button", children: f("dataTable.selectFilter.apply") })
222
222
  ] })
223
223
  ]
224
224
  }
225
225
  );
226
226
  }
227
- function Me(t) {
227
+ function De(t) {
228
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(
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), s = (r == null ? void 0 : r.filterParams) ?? {}, f = H(
230
230
  (b) => l && a ? l.getCellValue({
231
231
  rowNode: b,
232
232
  colKey: a
@@ -234,19 +234,19 @@ function Me(t) {
234
234
  [l, a]
235
235
  ), u = K(
236
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(() => {
237
+ s.options,
238
+ f
239
+ ), c = s.placeholder ?? (typeof (r == null ? void 0 : r.headerName) == "string" ? r.headerName : void 0), i = R(() => {
240
240
  const b = /* @__PURE__ */ new Map();
241
241
  for (const v of u) b.set(String(v.value), v.value);
242
242
  return b;
243
- }, [u]), p = z(
243
+ }, [u]), p = R(
244
244
  () => u.map((b) => ({
245
245
  value: String(b.value),
246
246
  label: b.label
247
247
  })),
248
248
  [u]
249
- ), C = z(
249
+ ), C = R(
250
250
  () => ((e == null ? void 0 : e.values) ?? []).map((b) => String(b)),
251
251
  [e]
252
252
  );
@@ -257,8 +257,8 @@ function Me(t) {
257
257
  }
258
258
  const v = [];
259
259
  for (const m of b) {
260
- const f = s.get(m);
261
- f !== void 0 && v.push(f);
260
+ const d = i.get(m);
261
+ d !== void 0 && v.push(d);
262
262
  }
263
263
  if (v.length === 0) {
264
264
  n(null);
@@ -266,80 +266,80 @@ function Me(t) {
266
266
  }
267
267
  n({ type: "set", values: v });
268
268
  }
269
- return /* @__PURE__ */ c("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
269
+ return /* @__PURE__ */ o("div", { "data-component": "select-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
270
270
  W,
271
271
  {
272
272
  size: "sm",
273
273
  options: p,
274
274
  value: C,
275
275
  onChange: y,
276
- placeholder: o.placeholder,
277
- "aria-label": i,
276
+ placeholder: s.placeholder,
277
+ "aria-label": c,
278
278
  allowClear: !0
279
279
  }
280
280
  ) });
281
281
  }
282
- function E(t) {
282
+ function L(t) {
283
283
  return t.trim().toLocaleLowerCase();
284
284
  }
285
- function Ae(t) {
285
+ function Me(t) {
286
286
  const {
287
287
  model: e,
288
288
  onModelChange: n,
289
289
  getValue: a,
290
290
  api: l,
291
291
  column: r,
292
- options: o,
293
- loadOptions: d,
292
+ options: s,
293
+ loadOptions: f,
294
294
  placeholder: u
295
- } = t, { t: i } = L("ui"), s = z(() => {
296
- if (o && o.length > 0) return o;
295
+ } = t, { t: c } = E("ui"), i = R(() => {
296
+ if (s && s.length > 0) return s;
297
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)
298
+ const d = /* @__PURE__ */ new Map();
299
+ return l.forEachNode((h) => {
300
+ const g = a(h);
301
+ if (g == null) return;
302
+ const S = typeof g == "string" ? g : String(g);
303
+ d.has(S) || d.set(S, { value: S, label: S });
304
+ }), Array.from(d.values()).sort(
305
+ (h, g) => h.label.localeCompare(g.label)
306
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) ?? "");
307
+ }, [s, l, r, a]), p = R(() => async (d, h) => {
308
+ if (f)
309
+ return (await f(d, h)).map((x) => ({ value: x.value, label: x.label }));
310
+ const g = L(d);
311
+ return (g ? i.filter((N) => L(N.label).includes(g)) : i).slice(0, 50).map((N) => ({ value: N.value, label: N.label }));
312
+ }, [f, i]), [C, y] = k((e == null ? void 0 : e.value) ?? "");
313
313
  w(() => {
314
314
  y((e == null ? void 0 : e.value) ?? "");
315
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);
316
+ doesFilterPass: (d) => {
317
+ const h = e == null ? void 0 : e.value;
318
+ if (!h) return !0;
319
+ const g = a(d.node);
320
+ if (g == null) return !1;
321
+ const S = typeof g == "string" ? g : String(g);
322
+ return L(S) === L(h);
323
323
  }
324
324
  });
325
- function T(f) {
326
- y(f.label), n({ type: "equals", value: f.value });
325
+ function T(d) {
326
+ y(d.label), n({ type: "equals", value: d.value });
327
327
  }
328
- function b(f) {
329
- y(f), f === "" && e && n(null);
328
+ function b(d) {
329
+ y(d), d === "" && e && n(null);
330
330
  }
331
331
  function v() {
332
332
  y(""), n(null);
333
333
  }
334
- const m = u ?? i("dataTable.typeaheadFilter.placeholder");
334
+ const m = u ?? c("dataTable.typeaheadFilter.placeholder");
335
335
  return /* @__PURE__ */ O(
336
336
  "div",
337
337
  {
338
338
  "data-component": "typeahead-filter",
339
339
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
340
340
  children: [
341
- /* @__PURE__ */ c(
342
- $,
341
+ /* @__PURE__ */ o(
342
+ G,
343
343
  {
344
344
  size: "sm",
345
345
  value: C,
@@ -350,19 +350,19 @@ function Ae(t) {
350
350
  "aria-label": m
351
351
  }
352
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") }) })
353
+ /* @__PURE__ */ o("div", { className: "ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]", children: /* @__PURE__ */ o(P, { intent: "ghost", size: "sm", onClick: v, type: "button", children: c("dataTable.typeaheadFilter.clear") }) })
354
354
  ]
355
355
  }
356
356
  );
357
357
  }
358
- function qe(t) {
358
+ function Ae(t) {
359
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) ?? "");
360
+ const { model: e, onModelChange: n, column: a } = t, { t: l } = E("ui"), r = ((b = (T = a == null ? void 0 : a.getColDef) == null ? void 0 : T.call(a)) == null ? void 0 : b.filterParams) ?? {}, s = r.options ?? [], f = r.loadOptions, u = r.placeholder ?? l("dataTable.typeaheadFilter.placeholder"), c = R(() => async (v, m) => {
361
+ if (f)
362
+ return (await f(v, m)).map((S) => ({ value: S.value, label: S.label }));
363
+ const d = L(v);
364
+ return (d ? s.filter((g) => L(g.label).includes(d)) : s).slice(0, 50).map((g) => ({ value: g.value, label: g.label }));
365
+ }, [f, s]), [i, p] = k((e == null ? void 0 : e.value) ?? "");
366
366
  w(() => {
367
367
  p((e == null ? void 0 : e.value) ?? "");
368
368
  }, [e == null ? void 0 : e.value]);
@@ -372,14 +372,14 @@ function qe(t) {
372
372
  function y(v) {
373
373
  p(v), v === "" && e && n(null);
374
374
  }
375
- return /* @__PURE__ */ c("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
376
- $,
375
+ return /* @__PURE__ */ o("div", { "data-component": "typeahead-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
376
+ G,
377
377
  {
378
378
  size: "sm",
379
- value: s,
379
+ value: i,
380
380
  onChange: y,
381
381
  onSelect: C,
382
- loadOptions: i,
382
+ loadOptions: c,
383
383
  placeholder: u,
384
384
  "aria-label": u
385
385
  }
@@ -396,10 +396,10 @@ const le = [
396
396
  "blank",
397
397
  "notBlank"
398
398
  ];
399
- function B(t) {
399
+ function I(t) {
400
400
  return t !== "blank" && t !== "notBlank";
401
401
  }
402
- function I(t) {
402
+ function _(t) {
403
403
  return t === "inRange";
404
404
  }
405
405
  function se(t, e, n, a) {
@@ -429,22 +429,22 @@ function se(t, e, n, a) {
429
429
  return !0;
430
430
  }
431
431
  }
432
- function oe(t) {
432
+ function ie(t) {
433
433
  if (t == null || t === "") return null;
434
434
  const e = typeof t == "number" ? t : Number(t);
435
435
  return Number.isNaN(e) ? null : e;
436
436
  }
437
- function Ve(t) {
437
+ function qe(t) {
438
438
  const {
439
439
  model: e,
440
440
  onModelChange: n,
441
441
  getValue: a,
442
442
  defaultOperator: l,
443
443
  min: r,
444
- max: o,
445
- step: d,
444
+ max: s,
445
+ step: f,
446
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(
447
+ } = t, { t: c } = E("ui"), i = (e == null ? void 0 : e.type) ?? l ?? "equals", [p, C] = k(i), [y, T] = k((e == null ? void 0 : e.filter) ?? null), [b, v] = k(
448
448
  (e == null ? void 0 : e.filterTo) ?? null
449
449
  );
450
450
  w(() => {
@@ -456,7 +456,7 @@ function Ve(t) {
456
456
  }, [e, l]), A({
457
457
  doesFilterPass: (x) => {
458
458
  if (!e) return !0;
459
- const Z = oe(a(x.node));
459
+ const Z = ie(a(x.node));
460
460
  return se(
461
461
  e.type,
462
462
  Z,
@@ -465,15 +465,15 @@ function Ve(t) {
465
465
  );
466
466
  }
467
467
  });
468
- const m = z(
468
+ const m = R(
469
469
  () => le.map((x) => ({
470
470
  value: x,
471
- label: i(`dataTable.numberFilter.operators.${x}`)
471
+ label: c(`dataTable.numberFilter.operators.${x}`)
472
472
  })),
473
- [i]
474
- ), f = u ?? i("dataTable.numberFilter.placeholder");
475
- function g() {
476
- if (!B(p)) {
473
+ [c]
474
+ ), d = u ?? c("dataTable.numberFilter.placeholder");
475
+ function h() {
476
+ if (!I(p)) {
477
477
  n({ type: p, filter: 0 });
478
478
  return;
479
479
  }
@@ -481,7 +481,7 @@ function Ve(t) {
481
481
  n(null);
482
482
  return;
483
483
  }
484
- if (I(p)) {
484
+ if (_(p)) {
485
485
  n({
486
486
  type: p,
487
487
  filter: y,
@@ -491,17 +491,17 @@ function Ve(t) {
491
491
  }
492
492
  n({ type: p, filter: y });
493
493
  }
494
- function h() {
494
+ function g() {
495
495
  C(l ?? "equals"), T(null), v(null), n(null);
496
496
  }
497
- const F = B(p), N = I(p);
497
+ const S = I(p), N = _(p);
498
498
  return /* @__PURE__ */ O(
499
499
  "div",
500
500
  {
501
501
  "data-component": "number-filter",
502
502
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]",
503
503
  children: [
504
- /* @__PURE__ */ c(
504
+ /* @__PURE__ */ o(
505
505
  Y,
506
506
  {
507
507
  size: "sm",
@@ -510,63 +510,63 @@ function Ve(t) {
510
510
  onValueChange: (x) => {
511
511
  x !== "" && C(x);
512
512
  },
513
- "aria-label": i("dataTable.numberFilter.operators.equals")
513
+ "aria-label": c("dataTable.numberFilter.operators.equals")
514
514
  }
515
515
  ),
516
- F && !N && /* @__PURE__ */ c(
516
+ S && !N && /* @__PURE__ */ o(
517
517
  D,
518
518
  {
519
519
  size: "sm",
520
520
  value: y,
521
521
  onChange: T,
522
522
  min: r,
523
- max: o,
524
- step: d,
525
- placeholder: f,
526
- "aria-label": f
523
+ max: s,
524
+ step: f,
525
+ placeholder: d,
526
+ "aria-label": d
527
527
  }
528
528
  ),
529
529
  N && /* @__PURE__ */ O("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
530
- /* @__PURE__ */ c(
530
+ /* @__PURE__ */ o(
531
531
  D,
532
532
  {
533
533
  size: "sm",
534
534
  value: y,
535
535
  onChange: T,
536
536
  min: r,
537
- max: o,
538
- step: d,
539
- placeholder: i("dataTable.numberFilter.from"),
540
- "aria-label": i("dataTable.numberFilter.from")
537
+ max: s,
538
+ step: f,
539
+ placeholder: c("dataTable.numberFilter.from"),
540
+ "aria-label": c("dataTable.numberFilter.from")
541
541
  }
542
542
  ),
543
- /* @__PURE__ */ c(
543
+ /* @__PURE__ */ o(
544
544
  D,
545
545
  {
546
546
  size: "sm",
547
547
  value: b,
548
548
  onChange: v,
549
549
  min: r,
550
- max: o,
551
- step: d,
552
- placeholder: i("dataTable.numberFilter.to"),
553
- "aria-label": i("dataTable.numberFilter.to")
550
+ max: s,
551
+ step: f,
552
+ placeholder: c("dataTable.numberFilter.to"),
553
+ "aria-label": c("dataTable.numberFilter.to")
554
554
  }
555
555
  )
556
556
  ] }),
557
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") })
558
+ /* @__PURE__ */ o(P, { intent: "ghost", size: "sm", onClick: g, type: "button", children: c("dataTable.numberFilter.clear") }),
559
+ /* @__PURE__ */ o(P, { intent: "primary", size: "sm", onClick: h, type: "button", children: c("dataTable.numberFilter.apply") })
560
560
  ] })
561
561
  ]
562
562
  }
563
563
  );
564
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);
565
+ function Ve(t) {
566
+ var i, p;
567
+ const { model: e, onModelChange: n, column: a } = t, { t: l } = E("ui"), r = ((p = (i = a == null ? void 0 : a.getColDef) == null ? void 0 : i.call(a)) == null ? void 0 : p.filterParams) ?? {}, s = r.defaultOperator ?? "equals", f = r.placeholder ?? l("dataTable.numberFilter.placeholder"), [u, c] = k((e == null ? void 0 : e.filter) ?? null);
568
568
  return w(() => {
569
- i((e == null ? void 0 : e.filter) ?? null);
569
+ c((e == null ? void 0 : e.filter) ?? null);
570
570
  }, [e == null ? void 0 : e.filter]), w(() => {
571
571
  if (u === ((e == null ? void 0 : e.filter) ?? null)) return;
572
572
  const C = setTimeout(() => {
@@ -574,35 +574,35 @@ function je(t) {
574
574
  n(null);
575
575
  return;
576
576
  }
577
- n({ type: o, filter: u });
577
+ n({ type: s, filter: u });
578
578
  }, 200);
579
579
  return () => clearTimeout(C);
580
- }, [u, o]), /* @__PURE__ */ c("div", { "data-component": "number-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ c(
580
+ }, [u, s]), /* @__PURE__ */ o("div", { "data-component": "number-floating-filter", className: "ds:w-full", children: /* @__PURE__ */ o(
581
581
  D,
582
582
  {
583
583
  size: "sm",
584
584
  value: u,
585
- onChange: i,
585
+ onChange: c,
586
586
  min: r.min,
587
587
  max: r.max,
588
588
  step: r.step,
589
- placeholder: d,
590
- "aria-label": d
589
+ placeholder: f,
590
+ "aria-label": f
591
591
  }
592
592
  ) });
593
593
  }
594
- function Be(t) {
594
+ function je(t) {
595
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 ?? "") });
596
+ return /* @__PURE__ */ o(ee, { variant: a, withDot: !0, size: "sm", children: String(e ?? "") });
597
597
  }
598
- function Ie(t) {
598
+ function Be(t) {
599
599
  const { value: e } = t;
600
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 })
601
+ /* @__PURE__ */ o(V, { name: e.name, src: e.src, size: "sm" }),
602
+ /* @__PURE__ */ o("span", { children: e.name })
603
603
  ] }) : null;
604
604
  }
605
- const ie = {
605
+ const oe = {
606
606
  sm: "ds:size-8",
607
607
  md: "ds:size-10",
608
608
  lg: "ds:size-12"
@@ -623,38 +623,38 @@ function de(t) {
623
623
  if (e.length !== 0)
624
624
  return ce.test(e) ? e : void 0;
625
625
  }
626
- function _e(t) {
626
+ function Ie(t) {
627
627
  const {
628
628
  data: e,
629
629
  srcField: n,
630
630
  altField: a,
631
631
  fallbackField: l,
632
632
  size: r = "md",
633
- shape: o = "rounded"
633
+ shape: s = "rounded"
634
634
  } = t;
635
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(
636
+ const f = q(e, n), u = de(f), c = a ? q(e, a) ?? "" : "", i = l ? q(e, l) : void 0;
637
+ return s === "circle" && i ? /* @__PURE__ */ o(V, { src: u, name: i, size: r }) : u ? /* @__PURE__ */ o(
638
638
  "img",
639
639
  {
640
640
  src: u,
641
- alt: i,
641
+ alt: c,
642
642
  loading: "lazy",
643
643
  decoding: "async",
644
- className: ["ds:object-cover", ie[r], ue[o]].join(
644
+ className: ["ds:object-cover", oe[r], ue[s]].join(
645
645
  " "
646
646
  )
647
647
  }
648
- ) : s ? /* @__PURE__ */ c(G, { name: s, size: r }) : null;
648
+ ) : i ? /* @__PURE__ */ o(V, { name: i, size: r }) : null;
649
649
  }
650
- function Ue(t) {
651
- const { value: e, maxVisible: n = 3 } = t, { t: a } = L();
650
+ function _e(t) {
651
+ const { value: e, maxVisible: n = 3 } = t, { t: a } = E();
652
652
  if (!Array.isArray(e) || e.length === 0) return null;
653
653
  const l = e.slice(0, n), r = e.length - n;
654
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,
655
+ l.map((s) => /* @__PURE__ */ o(j, { label: s, size: "sm" }, s)),
656
+ r > 0 && /* @__PURE__ */ o(te, { label: e.slice(n).join(", "), children: /* @__PURE__ */ o(
657
+ j,
658
658
  {
659
659
  label: a("inputs.multiSelect.overflow", { count: r }),
660
660
  size: "sm",
@@ -675,10 +675,10 @@ const fe = {
675
675
  minute: "2-digit"
676
676
  }
677
677
  };
678
- function He(t) {
678
+ function Ue(t) {
679
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,
680
+ return e == null || e === "" ? null : n === "relative" && !a ? /* @__PURE__ */ o(B, { value: e, shape: "bare" }) : /* @__PURE__ */ o(
681
+ B,
682
682
  {
683
683
  value: e,
684
684
  format: "absolute",
@@ -687,37 +687,16 @@ function He(t) {
687
687
  }
688
688
  );
689
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) {
690
+ function U(t, e) {
712
691
  return typeof t == "function" ? t(e) : t;
713
692
  }
714
- function me(t) {
693
+ function pe(t) {
715
694
  return /^(https?:\/\/|\/|#|mailto:|tel:)/i.test(t) ? t : "#";
716
695
  }
717
- function Ge(t) {
696
+ function He(t) {
718
697
  const { value: e, data: n, href: a, onClick: l, secondary: r } = t;
719
698
  if (!n) return null;
720
- const o = _(a, n), d = _(r, n), u = e == null || e === "" ? "" : String(e), i = [
699
+ const s = U(a, n), f = U(r, n), u = e == null || e === "" ? "" : String(e), c = [
721
700
  "ds:text-[color:var(--primary)]",
722
701
  "ds:hover:underline",
723
702
  "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
@@ -725,48 +704,47 @@ function Ge(t) {
725
704
  "ds:focus-visible:outline-[color:var(--ring)]",
726
705
  "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
727
706
  "ds:rounded-[var(--radius-sm)]"
728
- ].join(" "), s = (p) => {
729
- l && (o || p.preventDefault(), p.stopPropagation(), l(n));
707
+ ].join(" "), i = (p) => {
708
+ l && (s || p.preventDefault(), p.stopPropagation(), l(n));
730
709
  };
731
710
  return /* @__PURE__ */ O("span", { className: "ds:flex ds:flex-col ds:leading-tight", children: [
732
- o ? /* @__PURE__ */ c(
711
+ s ? /* @__PURE__ */ o(
733
712
  "a",
734
713
  {
735
- href: me(o),
736
- onClick: s,
737
- className: i,
714
+ href: pe(s),
715
+ onClick: i,
716
+ className: c,
738
717
  children: u
739
718
  }
740
- ) : /* @__PURE__ */ c(
719
+ ) : /* @__PURE__ */ o(
741
720
  "button",
742
721
  {
743
722
  type: "button",
744
- onClick: s,
723
+ onClick: i,
745
724
  className: [
746
725
  "ds:appearance-none ds:bg-transparent ds:p-0 ds:text-start",
747
- i
726
+ c
748
727
  ].join(" "),
749
728
  children: u
750
729
  }
751
730
  ),
752
- d ? /* @__PURE__ */ c("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: d }) : null
731
+ f ? /* @__PURE__ */ o("span", { className: "type-meta ds:text-[color:var(--muted-foreground)]", children: f }) : null
753
732
  ] });
754
733
  }
755
734
  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
735
+ Ue as D,
736
+ Ie as I,
737
+ He as L,
738
+ qe as N,
739
+ Pe as S,
740
+ _e as T,
741
+ Be as U,
742
+ Le as a,
743
+ Ee as b,
744
+ Ve as c,
745
+ De as d,
746
+ je as e,
747
+ Me as f,
748
+ Ae as g
771
749
  };
772
- //# sourceMappingURL=link-cell-renderer-BqO66pIA.js.map
750
+ //# sourceMappingURL=link-cell-renderer-Cp2MSlJl.js.map