@object-ui/plugin-aggrid 3.3.0 → 3.3.2

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 (96) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +20 -0
  3. package/dist/AddressField-CP-8JJvR.js +98 -0
  4. package/dist/{AgGridImpl-DBqxIsko.js → AgGridImpl-DJWnS8p3.js} +1 -1
  5. package/dist/AutoNumberField-DCL2eUJj.js +14 -0
  6. package/dist/{AvatarField-C5b9biGa.js → AvatarField-CpFxJRdO.js} +4 -3
  7. package/dist/{BooleanField-DRzAZhSq.js → BooleanField-Chphr8cB.js} +2 -1
  8. package/dist/CodeField-BWngVIw1.js +23 -0
  9. package/dist/ColorField-GygyYArR.js +38 -0
  10. package/dist/CurrencyField-O8Pn59RO.js +49 -0
  11. package/dist/DateField-u6U8wmvI.js +22 -0
  12. package/dist/DateTimeField-D1z1Ovvy.js +30 -0
  13. package/dist/EmailField-IOcDmGjJ.js +26 -0
  14. package/dist/FileField-D3mZIrJ1.js +158 -0
  15. package/dist/FormulaField-MuyWzQx0.js +17 -0
  16. package/dist/GeolocationField-BfhC7QLw.js +161 -0
  17. package/dist/GridField-gN34gk4b.js +49 -0
  18. package/dist/ImageField-BZfSFwmJ.js +75 -0
  19. package/dist/LocationField-B-zwfw3h.js +36 -0
  20. package/dist/{LookupField-DoOmbbZF.js → LookupField-Cms1Cu_l.js} +347 -349
  21. package/dist/{MasterDetailField-BnSPGAtS.js → MasterDetailField-DGUmvg2f.js} +5 -4
  22. package/dist/NumberField-BV5sKwZ7.js +27 -0
  23. package/dist/{ObjectAgGridImpl-DrI0aa8t.js → ObjectAgGridImpl-yiHlXYgp.js} +5804 -5804
  24. package/dist/ObjectField-DJ5s3ciA.js +50 -0
  25. package/dist/{PasswordField-k5JeKk9f.js → PasswordField-BJboeBJY.js} +3 -2
  26. package/dist/PercentField-DO3be_bL.js +61 -0
  27. package/dist/PhoneField-CT6XcO6O.js +26 -0
  28. package/dist/{QRCodeField-BIrSW1Zr.js → QRCodeField-COLyc5iQ.js} +31 -30
  29. package/dist/{RatingField-5iMhn2GL.js → RatingField-B2momIna.js} +3 -2
  30. package/dist/RichTextField-C7qzDPJy.js +33 -0
  31. package/dist/SelectField-oo6vnNhQ.js +36 -0
  32. package/dist/{SignatureField-BAMvNrE6.js → SignatureField-DUgoK09r.js} +3 -2
  33. package/dist/{SliderField-C9IhmjbF.js → SliderField-DrggtBSX.js} +2 -1
  34. package/dist/SummaryField-DuMsFoY5.js +22 -0
  35. package/dist/TextAreaField-CLzzmPce.js +37 -0
  36. package/dist/TextField-CZE7SzK4.js +30 -0
  37. package/dist/TimeField-Bha4cayv.js +22 -0
  38. package/dist/UrlField-Dff4WLlN.js +31 -0
  39. package/dist/UserField-eT5njHwQ.js +77 -0
  40. package/dist/VectorField-BHe8lDOH.js +34 -0
  41. package/dist/{image-DlUdeTgT.js → image-DmzU2ETO.js} +1 -1
  42. package/dist/index.js +2 -2
  43. package/dist/index.umd.cjs +77 -77
  44. package/dist/{jsx-runtime-CGDkM_Jn.js → jsx-runtime-CXSCp6pT.js} +30 -39
  45. package/dist/{plus-BwEV_Q5_.js → plus-bvZ2f9T_.js} +1 -1
  46. package/dist/rolldown-runtime-CkxV0rQ3.js +14 -0
  47. package/dist/{upload-DPiohvXv.js → upload-BdzwEMeV.js} +1 -1
  48. package/dist/{useFieldTranslation-C69OtouR.js → useFieldTranslation-CfXaJRC4.js} +2 -2
  49. package/dist/{x-BFq2GeQ5.js → x-98xe-fYG.js} +1 -1
  50. package/package.json +34 -11
  51. package/.turbo/turbo-build.log +0 -71
  52. package/OBJECT_AGGRID_CN.md +0 -483
  53. package/QUICKSTART.md +0 -186
  54. package/dist/AddressField-DKqaE9pD.js +0 -93
  55. package/dist/AutoNumberField-0RU2dNKe.js +0 -13
  56. package/dist/CodeField-RWhnDMyL.js +0 -22
  57. package/dist/ColorField-B-YAFXdz.js +0 -37
  58. package/dist/CurrencyField-Bu80a-sI.js +0 -51
  59. package/dist/DateField-CV-NpLbM.js +0 -21
  60. package/dist/DateTimeField--YTsgTjw.js +0 -32
  61. package/dist/EmailField-B-3fWJsH.js +0 -28
  62. package/dist/FileField-BcGMvBnI.js +0 -160
  63. package/dist/FormulaField-MQXJZOep.js +0 -13
  64. package/dist/GeolocationField-D3BrmwqV.js +0 -156
  65. package/dist/GridField-DHsGo9l2.js +0 -51
  66. package/dist/ImageField-BBqwJEkk.js +0 -77
  67. package/dist/LocationField-DSvhU9Dz.js +0 -35
  68. package/dist/LookupField-KfYQlgUd.js +0 -2
  69. package/dist/NumberField-Kz4_o5DE.js +0 -26
  70. package/dist/ObjectField-C1qkl6s4.js +0 -52
  71. package/dist/PercentField-Dmipqv0I.js +0 -63
  72. package/dist/PhoneField-Dn4h6V9H.js +0 -28
  73. package/dist/RichTextField-CN5BRd_7.js +0 -32
  74. package/dist/SelectField-Bjk_S2zT.js +0 -31
  75. package/dist/SelectField-CcWvzp9g.js +0 -2
  76. package/dist/SummaryField-R9RENAZv.js +0 -18
  77. package/dist/TextAreaField-BY63Nr6-.js +0 -36
  78. package/dist/TextField-SIw8aMzf.js +0 -29
  79. package/dist/TimeField-xxziHPjE.js +0 -21
  80. package/dist/UrlField-Ihk3_ff5.js +0 -33
  81. package/dist/UserField-BHl6mmIH.js +0 -79
  82. package/dist/VectorField-Ci167cxr.js +0 -35
  83. package/src/AgGridImpl.tsx +0 -405
  84. package/src/ObjectAgGridImpl.tsx +0 -509
  85. package/src/VirtualScrolling.ts +0 -74
  86. package/src/ag-grid.d.ts +0 -10
  87. package/src/field-renderers.test.tsx +0 -383
  88. package/src/field-renderers.tsx +0 -224
  89. package/src/index.test.ts +0 -139
  90. package/src/index.tsx +0 -514
  91. package/src/object-aggrid.test.ts +0 -99
  92. package/src/object-aggrid.types.ts +0 -123
  93. package/src/types.ts +0 -184
  94. package/tsconfig.json +0 -17
  95. package/vite.config.ts +0 -64
  96. /package/dist/{createLucideIcon-BjfZYZey.js → createLucideIcon-C_5JZ35b.js} +0 -0
@@ -1,18 +1,19 @@
1
- import { t as e } from "./jsx-runtime-CGDkM_Jn.js";
2
- import { t } from "./createLucideIcon-BjfZYZey.js";
3
- import { t as n } from "./plus-BwEV_Q5_.js";
4
- import { t as r } from "./x-BFq2GeQ5.js";
5
- import { t as i } from "./useFieldTranslation-C69OtouR.js";
6
- import { useCallback as a, useContext as ee, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
7
- import { Badge as u, Button as d, Checkbox as te, Dialog as ne, DialogContent as re, DialogFooter as f, DialogHeader as p, DialogTitle as m, Input as h, Label as g, Popover as ie, PopoverContent as ae, PopoverTrigger as oe, Select as se, SelectContent as ce, SelectItem as le, SelectTrigger as ue, SelectValue as de, Skeleton as _, Table as fe, TableBody as v, TableCell as pe, TableHead as y, TableHeader as me, TableRow as he, cn as b } from "@object-ui/components";
8
- import { SchemaRendererContext as x } from "@object-ui/react";
9
- var ge = t("arrow-down", [["path", {
1
+ import { n as e } from "./rolldown-runtime-CkxV0rQ3.js";
2
+ import { t } from "./jsx-runtime-CXSCp6pT.js";
3
+ import { t as n } from "./createLucideIcon-C_5JZ35b.js";
4
+ import { t as r } from "./plus-bvZ2f9T_.js";
5
+ import { t as i } from "./x-98xe-fYG.js";
6
+ import { t as ee } from "./useFieldTranslation-CfXaJRC4.js";
7
+ import { useCallback as a, useContext as te, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
8
+ import { Badge as u, Button as d, Checkbox as ne, Dialog as re, DialogContent as ie, DialogFooter as f, DialogHeader as p, DialogTitle as ae, EmptyValue as oe, Input as m, Label as h, Popover as se, PopoverContent as g, PopoverTrigger as _, Select as ce, SelectContent as le, SelectItem as ue, SelectTrigger as de, SelectValue as fe, Skeleton as v, Table as y, TableBody as pe, TableCell as b, TableHead as x, TableHeader as me, TableRow as S, cn as he } from "@object-ui/components";
9
+ import { SchemaRendererContext as C } from "@object-ui/react";
10
+ var w = n("arrow-down", [["path", {
10
11
  d: "M12 5v14",
11
12
  key: "s699le"
12
13
  }], ["path", {
13
14
  d: "m19 12-7 7-7-7",
14
15
  key: "1idqje"
15
- }]]), S = t("arrow-up-down", [
16
+ }]]), T = n("arrow-up-down", [
16
17
  ["path", {
17
18
  d: "m21 16-4 4-4-4",
18
19
  key: "f6ql7i"
@@ -29,22 +30,22 @@ var ge = t("arrow-down", [["path", {
29
30
  d: "M7 4v16",
30
31
  key: "1glfcx"
31
32
  }]
32
- ]), C = t("arrow-up", [["path", {
33
+ ]), E = n("arrow-up", [["path", {
33
34
  d: "m5 12 7-7 7 7",
34
35
  key: "hav0vg"
35
36
  }], ["path", {
36
37
  d: "M12 19V5",
37
38
  key: "x0mq9r"
38
- }]]), w = t("check", [["path", {
39
+ }]]), ge = n("check", [["path", {
39
40
  d: "M20 6 9 17l-5-5",
40
41
  key: "1gmf2c"
41
- }]]), _e = t("chevron-left", [["path", {
42
+ }]]), D = n("chevron-left", [["path", {
42
43
  d: "m15 18-6-6 6-6",
43
44
  key: "1wnfg3"
44
- }]]), T = t("chevron-right", [["path", {
45
+ }]]), O = n("chevron-right", [["path", {
45
46
  d: "m9 18 6-6-6-6",
46
47
  key: "mthhwq"
47
- }]]), ve = t("circle-alert", [
48
+ }]]), _e = n("circle-alert", [
48
49
  ["circle", {
49
50
  cx: "12",
50
51
  cy: "12",
@@ -65,10 +66,10 @@ var ge = t("arrow-down", [["path", {
65
66
  y2: "16",
66
67
  key: "4dfq90"
67
68
  }]
68
- ]), ye = t("loader-circle", [["path", {
69
+ ]), ve = n("loader-circle", [["path", {
69
70
  d: "M21 12a9 9 0 1 1-6.219-8.56",
70
71
  key: "13zald"
71
- }]]), be = t("search", [["path", {
72
+ }]]), ye = n("search", [["path", {
72
73
  d: "m21 21-4.34-4.34",
73
74
  key: "14j7rj"
74
75
  }], ["circle", {
@@ -76,7 +77,7 @@ var ge = t("arrow-down", [["path", {
76
77
  cy: "11",
77
78
  r: "8",
78
79
  key: "4ej97u"
79
- }]]), E = t("sliders-horizontal", [
80
+ }]]), be = n("sliders-horizontal", [
80
81
  ["path", {
81
82
  d: "M10 5H3",
82
83
  key: "1qgfaw"
@@ -113,7 +114,7 @@ var ge = t("arrow-down", [["path", {
113
114
  d: "M8 12H3",
114
115
  key: "a7s4jb"
115
116
  }]
116
- ]), D = t("table-properties", [
117
+ ]), k = n("table-properties", [
117
118
  ["path", {
118
119
  d: "M15 3v18",
119
120
  key: "14nvp0"
@@ -134,14 +135,14 @@ var ge = t("arrow-down", [["path", {
134
135
  d: "M21 15H3",
135
136
  key: "9uk58r"
136
137
  }]
137
- ]), O = e(), xe = 10, k = 60, A = 5;
138
- function j(e) {
138
+ ]), A = t(), j = 10, M = 60, xe = 5;
139
+ function Se(e) {
139
140
  return typeof e == "string" ? { field: e } : e;
140
141
  }
141
- function M(e) {
142
+ function Ce(e) {
142
143
  return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase());
143
144
  }
144
- function Se(e) {
145
+ function we(e) {
145
146
  let t = {};
146
147
  for (let n of e) switch (n.operator) {
147
148
  case "eq":
@@ -174,7 +175,7 @@ function Se(e) {
174
175
  }
175
176
  return t;
176
177
  }
177
- function Ce(e, t) {
178
+ function Te(e, t) {
178
179
  let n = {};
179
180
  for (let r of t) {
180
181
  let t = e[r.field];
@@ -182,17 +183,17 @@ function Ce(e, t) {
182
183
  }
183
184
  return n;
184
185
  }
185
- function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i = !1, dataSource: ee, objectName: u, columns: ie, displayField: ae = "name", idField: oe = "id", pageSize: x = xe, value: D, onSelect: N, onSelectRecords: P, lookupFilters: F, cellRenderer: I, filterColumns: we, renderFilterBar: Te, renderGrid: Ee }) {
186
- let [L, R] = l([]), [z, De] = l(!1), [B, V] = l(null), [H, Oe] = l(0), [ke, Ae] = l(""), [U, W] = l(1), G = c(null), [K, je] = l(null), [q, Me] = l("asc"), [Ne, Pe] = l(/* @__PURE__ */ new Set()), Fe = c(/* @__PURE__ */ new Map()), [J, Ie] = l(-1), Le = c(null), [Re, ze] = l(!1), [Y, Be] = l({}), [Ve, He] = l({}), X = c(null), [Ue, We] = l(""), Ge = s(() => ie && ie.length > 0 ? ie.map(j) : [{
187
- field: ae,
188
- label: M(ae)
189
- }], [ie, ae]), Z = s(() => {
190
- if (we && we.length > 0) return we;
191
- if (F && F.length > 0) return F.map((e) => {
186
+ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: r = !1, dataSource: ee, objectName: te, columns: u, displayField: oe = "name", idField: se = "id", pageSize: g = j, value: _, onSelect: C, onSelectRecords: k, lookupFilters: N, cellRenderer: P, filterColumns: F, renderFilterBar: Ee, renderGrid: I }) {
187
+ let [L, De] = l([]), [R, Oe] = l(!1), [z, B] = l(null), [V, H] = l(0), [U, ke] = l(""), [W, G] = l(1), K = c(null), [q, Ae] = l(null), [J, je] = l("asc"), [Me, Ne] = l(/* @__PURE__ */ new Set()), Pe = c(/* @__PURE__ */ new Map()), [Y, Fe] = l(-1), Ie = c(null), [Le, Re] = l(!1), [X, ze] = l({}), [Be, Ve] = l({}), He = c(null), [Ue, We] = l(""), Ge = s(() => u && u.length > 0 ? u.map(Se) : [{
188
+ field: oe,
189
+ label: Ce(oe)
190
+ }], [u, oe]), Z = s(() => {
191
+ if (F && F.length > 0) return F;
192
+ if (N && N.length > 0) return N.map((e) => {
192
193
  let t = "text";
193
194
  return typeof e.value == "boolean" ? t = "boolean" : Array.isArray(e.value) ? t = "select" : typeof e.value == "number" || e.operator === "gt" || e.operator === "lt" || e.operator === "gte" || e.operator === "lte" ? t = "number" : (e.operator === "in" || e.operator === "notIn") && (t = "select"), {
194
195
  field: e.field,
195
- label: M(e.field),
196
+ label: Ce(e.field),
196
197
  type: t,
197
198
  ...Array.isArray(e.value) ? { options: e.value.map((e) => {
198
199
  if (typeof e == "object" && e) {
@@ -209,126 +210,126 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
209
210
  }) } : {}
210
211
  };
211
212
  });
212
- }, [we, F]), Ke = s(() => {
213
- let e = F?.length ? Se(F) : {}, t = Z?.length ? Ce(Y, Z) : {}, n = {
213
+ }, [F, N]), Ke = s(() => {
214
+ let e = N?.length ? we(N) : {}, t = Z?.length ? Te(X, Z) : {}, n = {
214
215
  ...e,
215
216
  ...t
216
217
  };
217
218
  return Object.keys(n).length > 0 ? n : void 0;
218
219
  }, [
219
- F,
220
+ N,
220
221
  Z,
221
- Y
222
- ]), Q = Math.max(1, Math.ceil(H / x)), qe = a(async (e, t = 1, n, r) => {
223
- if (!(!ee || !u)) {
224
- De(!0), V(null);
222
+ X
223
+ ]), Q = Math.max(1, Math.ceil(V / g)), qe = a(async (e, t = 1, n, r) => {
224
+ if (!(!ee || !te)) {
225
+ Oe(!0), B(null);
225
226
  try {
226
227
  let i = {
227
- $top: x,
228
- $skip: (t - 1) * x
228
+ $top: g,
229
+ $skip: (t - 1) * g
229
230
  };
230
231
  e && e.trim() && (i.$search = e.trim()), n && (i.$orderby = { [n.field]: n.direction });
231
232
  let a = r === void 0 ? Ke : r;
232
233
  a && Object.keys(a).length > 0 && (i.$filter = a);
233
- let o = await ee.find(u, i), s = o?.data ?? o ?? [];
234
- R(s), Oe(o?.total ?? s.length), Ie(-1);
234
+ let o = await ee.find(te, i), s = o?.data ?? o ?? [];
235
+ De(s), H(o?.total ?? s.length), Fe(-1);
235
236
  } catch (e) {
236
- V(e instanceof Error ? e.message : String(e)), R([]);
237
+ B(e instanceof Error ? e.message : String(e)), De([]);
237
238
  } finally {
238
- De(!1);
239
+ Oe(!1);
239
240
  }
240
241
  }
241
242
  }, [
242
243
  ee,
243
- u,
244
- x,
244
+ te,
245
+ g,
245
246
  Ke
246
- ]), Je = s(() => K ? {
247
- field: K,
248
- direction: q
249
- } : null, [K, q]);
247
+ ]), Je = s(() => q ? {
248
+ field: q,
249
+ direction: J
250
+ } : null, [q, J]);
250
251
  o(() => {
251
- e || (Ae(""), W(1), V(null), R([]), je(null), Me("asc"), Ie(-1), ze(!1), Be({}), He({}), We(""), Pe(new Set(i && Array.isArray(D) ? D : [])), Fe.current.clear());
252
+ e || (ke(""), G(1), B(null), De([]), Ae(null), je("asc"), Fe(-1), Re(!1), ze({}), Ve({}), We(""), Ne(new Set(r && Array.isArray(_) ? _ : [])), Pe.current.clear());
252
253
  }, [e]), o(() => {
253
- e && qe(ke || void 0, U, Je);
254
+ e && qe(U || void 0, W, Je);
254
255
  }, [
255
256
  e,
256
- U,
257
+ W,
257
258
  Je,
258
259
  Ke
259
260
  ]), o(() => {
260
- e && i && Pe(new Set(Array.isArray(D) ? D : []));
261
+ e && r && Ne(new Set(Array.isArray(_) ? _ : []));
261
262
  }, [
262
263
  e,
263
- i,
264
- D
264
+ r,
265
+ _
265
266
  ]);
266
267
  let Ye = a((e) => {
267
- Ae(e), W(1), G.current && clearTimeout(G.current), G.current = setTimeout(() => {
268
+ ke(e), G(1), K.current && clearTimeout(K.current), K.current = setTimeout(() => {
268
269
  qe(e || void 0, 1, Je);
269
270
  }, 300);
270
271
  }, [qe, Je]);
271
272
  o(() => () => {
272
- G.current && clearTimeout(G.current);
273
+ K.current && clearTimeout(K.current);
273
274
  }, []);
274
275
  let Xe = a((e) => {
275
- je((t) => t === e ? (Me((e) => e === "asc" ? "desc" : "asc"), e) : (Me("asc"), e)), W(1);
276
- }, []), Ze = a((e) => e[oe] ?? e.id ?? e._id, [oe]), Qe = a((e) => {
276
+ Ae((t) => t === e ? (je((e) => e === "asc" ? "desc" : "asc"), e) : (je("asc"), e)), G(1);
277
+ }, []), Ze = a((e) => e[se] ?? e.id ?? e._id, [se]), Qe = a((e) => {
277
278
  let t = Ze(e);
278
- return i ? Ne.has(t) : D === t;
279
+ return r ? Me.has(t) : _ === t;
279
280
  }, [
280
- i,
281
- D,
282
- Ne,
281
+ r,
282
+ _,
283
+ Me,
283
284
  Ze
284
285
  ]), $e = a((e) => {
285
286
  let n = Ze(e);
286
- i ? Pe((t) => {
287
+ r ? Ne((t) => {
287
288
  let r = new Set(t);
288
- return r.has(n) ? (r.delete(n), Fe.current.delete(n)) : (r.add(n), Fe.current.set(n, e)), r;
289
- }) : (N(n), P?.([e]), t(!1));
289
+ return r.has(n) ? (r.delete(n), Pe.current.delete(n)) : (r.add(n), Pe.current.set(n, e)), r;
290
+ }) : (C(n), k?.([e]), t(!1));
290
291
  }, [
291
- i,
292
+ r,
292
293
  Ze,
293
- N,
294
- P,
294
+ C,
295
+ k,
295
296
  t
296
297
  ]), et = a(() => {
297
- let e = Array.from(Ne);
298
- N(e);
299
- let n = e.map((e) => Fe.current.get(e)).filter(Boolean);
300
- P?.(n), t(!1);
298
+ let e = Array.from(Me);
299
+ C(e);
300
+ let n = e.map((e) => Pe.current.get(e)).filter(Boolean);
301
+ k?.(n), t(!1);
301
302
  }, [
302
- Ne,
303
- N,
304
- P,
303
+ Me,
304
+ C,
305
+ k,
305
306
  t
306
307
  ]), tt = a(() => {
307
- W((e) => Math.max(1, e - 1));
308
+ G((e) => Math.max(1, e - 1));
308
309
  }, []), nt = a(() => {
309
- W((e) => Math.min(Q, e + 1));
310
+ G((e) => Math.min(Q, e + 1));
310
311
  }, [Q]), rt = a((e) => {
311
312
  if (e.key !== "Enter") return;
312
313
  let t = parseInt(Ue, 10);
313
- !isNaN(t) && t >= 1 && t <= Q && W(t), We("");
314
+ !isNaN(t) && t >= 1 && t <= Q && G(t), We("");
314
315
  }, [Ue, Q]), it = a((e) => {
315
- L.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), Ie((e) => Math.min(e + 1, L.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), Ie((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), J >= 0 && J < L.length && $e(L[J])));
316
+ L.length !== 0 && (e.key === "ArrowDown" ? (e.preventDefault(), Fe((e) => Math.min(e + 1, L.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), Fe((e) => Math.max(e - 1, 0))) : (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Y >= 0 && Y < L.length && $e(L[Y])));
316
317
  }, [
317
318
  L,
318
- J,
319
+ Y,
319
320
  $e
320
321
  ]);
321
322
  o(() => {
322
- if (J >= 0 && Le.current) {
323
- let e = Le.current.querySelector(`[data-row-index="${J}"]`);
323
+ if (Y >= 0 && Ie.current) {
324
+ let e = Ie.current.querySelector(`[data-row-index="${Y}"]`);
324
325
  e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ block: "nearest" });
325
326
  }
326
- }, [J]);
327
+ }, [Y]);
327
328
  let at = a((e, t) => {
328
329
  let n = e[t.field];
329
- if (t.type && I) {
330
- let e = I(t.type);
331
- if (e) return /* @__PURE__ */ (0, O.jsx)(e, {
330
+ if (t.type && P) {
331
+ let e = P(t.type);
332
+ if (e) return /* @__PURE__ */ (0, A.jsx)(e, {
332
333
  value: n,
333
334
  field: {
334
335
  name: t.field,
@@ -337,56 +338,56 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
337
338
  });
338
339
  }
339
340
  return n == null ? "" : typeof n == "object" ? n.$numberDecimal ? String(Number(n.$numberDecimal)) : n.$oid ? String(n.$oid) : n.$date ? new Date(n.$date).toLocaleDateString() : n.name || n.label ? String(n.name || n.label) : JSON.stringify(n) : typeof n == "boolean" ? n ? "Yes" : "No" : String(n);
340
- }, [I]), ot = a((e) => K === e ? q === "asc" ? /* @__PURE__ */ (0, O.jsx)(C, { className: "ml-1 size-3" }) : /* @__PURE__ */ (0, O.jsx)(ge, { className: "ml-1 size-3" }) : /* @__PURE__ */ (0, O.jsx)(S, { className: "ml-1 size-3 opacity-40" }), [K, q]), st = a((e, t, n) => {
341
- e.preventDefault(), e.stopPropagation(), X.current = {
341
+ }, [P]), ot = a((e) => q === e ? J === "asc" ? /* @__PURE__ */ (0, A.jsx)(E, { className: "ml-1 size-3" }) : /* @__PURE__ */ (0, A.jsx)(w, { className: "ml-1 size-3" }) : /* @__PURE__ */ (0, A.jsx)(T, { className: "ml-1 size-3 opacity-40" }), [q, J]), st = a((e, t, n) => {
342
+ e.preventDefault(), e.stopPropagation(), He.current = {
342
343
  field: t,
343
344
  startX: e.clientX,
344
345
  startWidth: n
345
346
  };
346
347
  let r = (e) => {
347
- if (!X.current) return;
348
- let t = e.clientX - X.current.startX, n = Math.max(k, X.current.startWidth + t);
349
- He((e) => ({
348
+ if (!He.current) return;
349
+ let t = e.clientX - He.current.startX, n = Math.max(M, He.current.startWidth + t);
350
+ Ve((e) => ({
350
351
  ...e,
351
- [X.current.field]: n
352
+ [He.current.field]: n
352
353
  }));
353
354
  }, i = () => {
354
- X.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
355
+ He.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
355
356
  };
356
357
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
357
358
  }, []), $ = a((e, t) => {
358
- Be((n) => ({
359
+ ze((n) => ({
359
360
  ...n,
360
361
  [e]: t
361
- })), W(1);
362
+ })), G(1);
362
363
  }, []), ct = a(() => {
363
- Be({}), W(1);
364
- }, []), lt = s(() => Object.values(Y).filter((e) => e != null && e !== "").length, [Y]), ut = a((e) => {
365
- let t = Y[e.field], n = e.label || M(e.field);
364
+ ze({}), G(1);
365
+ }, []), lt = s(() => Object.values(X).filter((e) => e != null && e !== "").length, [X]), ut = a((e) => {
366
+ let t = X[e.field], n = e.label || Ce(e.field);
366
367
  switch (e.type) {
367
- case "select": return /* @__PURE__ */ (0, O.jsxs)("div", {
368
+ case "select": return /* @__PURE__ */ (0, A.jsxs)("div", {
368
369
  className: "space-y-1",
369
- children: [/* @__PURE__ */ (0, O.jsx)(g, {
370
+ children: [/* @__PURE__ */ (0, A.jsx)(h, {
370
371
  className: "text-xs text-muted-foreground",
371
372
  children: n
372
- }), /* @__PURE__ */ (0, O.jsxs)(se, {
373
+ }), /* @__PURE__ */ (0, A.jsxs)(ce, {
373
374
  value: t == null ? "" : String(t),
374
375
  onValueChange: (t) => $(e.field, t),
375
- children: [/* @__PURE__ */ (0, O.jsx)(ue, {
376
+ children: [/* @__PURE__ */ (0, A.jsx)(de, {
376
377
  className: "h-8 text-xs",
377
- children: /* @__PURE__ */ (0, O.jsx)(de, { placeholder: `Filter ${n}` })
378
- }), /* @__PURE__ */ (0, O.jsx)(ce, { children: e.options?.map((e) => /* @__PURE__ */ (0, O.jsx)(le, {
378
+ children: /* @__PURE__ */ (0, A.jsx)(fe, { placeholder: `Filter ${n}` })
379
+ }), /* @__PURE__ */ (0, A.jsx)(le, { children: e.options?.map((e) => /* @__PURE__ */ (0, A.jsx)(ue, {
379
380
  value: String(e.value),
380
381
  children: e.label
381
382
  }, String(e.value))) })]
382
383
  })]
383
384
  });
384
- case "number": return /* @__PURE__ */ (0, O.jsxs)("div", {
385
+ case "number": return /* @__PURE__ */ (0, A.jsxs)("div", {
385
386
  className: "space-y-1",
386
- children: [/* @__PURE__ */ (0, O.jsx)(g, {
387
+ children: [/* @__PURE__ */ (0, A.jsx)(h, {
387
388
  className: "text-xs text-muted-foreground",
388
389
  children: n
389
- }), /* @__PURE__ */ (0, O.jsx)(h, {
390
+ }), /* @__PURE__ */ (0, A.jsx)(m, {
390
391
  type: "number",
391
392
  className: "h-8 text-xs",
392
393
  value: t ?? "",
@@ -397,40 +398,40 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
397
398
  }
398
399
  })]
399
400
  });
400
- case "date": return /* @__PURE__ */ (0, O.jsxs)("div", {
401
+ case "date": return /* @__PURE__ */ (0, A.jsxs)("div", {
401
402
  className: "space-y-1",
402
- children: [/* @__PURE__ */ (0, O.jsx)(g, {
403
+ children: [/* @__PURE__ */ (0, A.jsx)(h, {
403
404
  className: "text-xs text-muted-foreground",
404
405
  children: n
405
- }), /* @__PURE__ */ (0, O.jsx)(h, {
406
+ }), /* @__PURE__ */ (0, A.jsx)(m, {
406
407
  type: "date",
407
408
  className: "h-8 text-xs",
408
409
  value: t ?? "",
409
410
  onChange: (t) => $(e.field, t.target.value)
410
411
  })]
411
412
  });
412
- case "boolean": return /* @__PURE__ */ (0, O.jsxs)("div", {
413
+ case "boolean": return /* @__PURE__ */ (0, A.jsxs)("div", {
413
414
  className: "space-y-1",
414
- children: [/* @__PURE__ */ (0, O.jsx)(g, {
415
+ children: [/* @__PURE__ */ (0, A.jsx)(h, {
415
416
  className: "text-xs text-muted-foreground",
416
417
  children: n
417
- }), /* @__PURE__ */ (0, O.jsxs)("div", {
418
+ }), /* @__PURE__ */ (0, A.jsxs)("div", {
418
419
  className: "flex items-center gap-2 h-8",
419
- children: [/* @__PURE__ */ (0, O.jsx)(te, {
420
+ children: [/* @__PURE__ */ (0, A.jsx)(ne, {
420
421
  checked: !!t,
421
422
  onCheckedChange: (t) => $(e.field, !!t)
422
- }), /* @__PURE__ */ (0, O.jsx)("span", {
423
+ }), /* @__PURE__ */ (0, A.jsx)("span", {
423
424
  className: "text-xs text-muted-foreground",
424
425
  children: "Yes"
425
426
  })]
426
427
  })]
427
428
  });
428
- default: return /* @__PURE__ */ (0, O.jsxs)("div", {
429
+ default: return /* @__PURE__ */ (0, A.jsxs)("div", {
429
430
  className: "space-y-1",
430
- children: [/* @__PURE__ */ (0, O.jsx)(g, {
431
+ children: [/* @__PURE__ */ (0, A.jsx)(h, {
431
432
  className: "text-xs text-muted-foreground",
432
433
  children: n
433
- }), /* @__PURE__ */ (0, O.jsx)(h, {
434
+ }), /* @__PURE__ */ (0, A.jsx)(m, {
434
435
  className: "h-8 text-xs",
435
436
  value: t ?? "",
436
437
  placeholder: `Filter ${n}`,
@@ -438,165 +439,165 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
438
439
  })]
439
440
  });
440
441
  }
441
- }, [Y, $]), dt = a((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
442
- return /* @__PURE__ */ (0, O.jsx)(ne, {
442
+ }, [X, $]), dt = a((e, t) => e ? "bg-primary/5 hover:bg-primary/10" : t % 2 == 1 ? "bg-muted/20 hover:bg-accent/30" : "hover:bg-accent/30", []);
443
+ return /* @__PURE__ */ (0, A.jsx)(re, {
443
444
  open: e,
444
445
  onOpenChange: t,
445
- children: /* @__PURE__ */ (0, O.jsxs)(re, {
446
+ children: /* @__PURE__ */ (0, A.jsxs)(ie, {
446
447
  className: "w-[95vw] sm:max-w-3xl lg:max-w-5xl max-h-[85vh] sm:max-h-[80vh] flex flex-col gap-0",
447
448
  "data-testid": "record-picker-dialog",
448
449
  children: [
449
- /* @__PURE__ */ (0, O.jsx)(p, { children: /* @__PURE__ */ (0, O.jsxs)(m, { children: [n, i && /* @__PURE__ */ (0, O.jsx)("span", {
450
+ /* @__PURE__ */ (0, A.jsx)(p, { children: /* @__PURE__ */ (0, A.jsxs)(ae, { children: [n, r && /* @__PURE__ */ (0, A.jsx)("span", {
450
451
  className: "sr-only",
451
452
  children: " (multiple selection)"
452
453
  })] }) }),
453
- /* @__PURE__ */ (0, O.jsxs)("div", {
454
+ /* @__PURE__ */ (0, A.jsxs)("div", {
454
455
  className: "relative rounded-md border bg-muted/30 mb-3",
455
456
  children: [
456
- /* @__PURE__ */ (0, O.jsx)(be, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
457
- /* @__PURE__ */ (0, O.jsx)(h, {
457
+ /* @__PURE__ */ (0, A.jsx)(ye, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
458
+ /* @__PURE__ */ (0, A.jsx)(m, {
458
459
  placeholder: "Search...",
459
- value: ke,
460
+ value: U,
460
461
  onChange: (e) => Ye(e.target.value),
461
462
  className: "pl-9 border-0 bg-transparent shadow-none focus-visible:ring-0",
462
463
  "data-testid": "record-picker-search"
463
464
  }),
464
- z && /* @__PURE__ */ (0, O.jsx)(ye, {
465
+ R && /* @__PURE__ */ (0, A.jsx)(ve, {
465
466
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
466
467
  "data-testid": "record-picker-loading-indicator"
467
468
  })
468
469
  ]
469
470
  }),
470
- Z && Z.length > 0 && /* @__PURE__ */ (0, O.jsx)("div", {
471
+ Z && Z.length > 0 && /* @__PURE__ */ (0, A.jsx)("div", {
471
472
  className: "py-2",
472
- children: Te ? /* @__PURE__ */ (0, O.jsx)("div", {
473
+ children: Ee ? /* @__PURE__ */ (0, A.jsx)("div", {
473
474
  "data-testid": "record-picker-filter-bar",
474
- children: Te({
475
+ children: Ee({
475
476
  filterColumns: Z,
476
- values: Y,
477
+ values: X,
477
478
  onChange: $,
478
479
  onClear: ct,
479
480
  activeCount: lt
480
481
  })
481
- }) : /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsxs)("div", {
482
+ }) : /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsxs)("div", {
482
483
  className: "flex items-center gap-2",
483
484
  "data-testid": "record-picker-filter-bar",
484
- children: [/* @__PURE__ */ (0, O.jsxs)(d, {
485
+ children: [/* @__PURE__ */ (0, A.jsxs)(d, {
485
486
  type: "button",
486
487
  variant: lt > 0 ? "secondary" : "outline",
487
488
  size: "sm",
488
489
  className: "gap-1.5 shrink-0",
489
- onClick: () => ze((e) => !e),
490
+ onClick: () => Re((e) => !e),
490
491
  children: [
491
- /* @__PURE__ */ (0, O.jsx)(E, { className: "size-3.5" }),
492
+ /* @__PURE__ */ (0, A.jsx)(be, { className: "size-3.5" }),
492
493
  "Filters",
493
- lt > 0 && /* @__PURE__ */ (0, O.jsx)("span", {
494
+ lt > 0 && /* @__PURE__ */ (0, A.jsx)("span", {
494
495
  className: "inline-flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary/10 px-1 text-xs font-medium text-primary",
495
496
  children: lt
496
497
  })
497
498
  ]
498
- }), lt > 0 && /* @__PURE__ */ (0, O.jsxs)(d, {
499
+ }), lt > 0 && /* @__PURE__ */ (0, A.jsxs)(d, {
499
500
  type: "button",
500
501
  variant: "ghost",
501
502
  size: "sm",
502
503
  className: "gap-1 text-xs",
503
504
  onClick: ct,
504
- children: [/* @__PURE__ */ (0, O.jsx)(r, { className: "size-3" }), "Clear"]
505
+ children: [/* @__PURE__ */ (0, A.jsx)(i, { className: "size-3" }), "Clear"]
505
506
  })]
506
- }), Re && /* @__PURE__ */ (0, O.jsx)("div", {
507
+ }), Le && /* @__PURE__ */ (0, A.jsx)("div", {
507
508
  className: "mt-2 grid gap-3 sm:grid-cols-2 lg:grid-cols-3 border rounded-md p-3 bg-muted/30",
508
509
  "data-testid": "record-picker-filter-panel",
509
- children: Z.map((e) => /* @__PURE__ */ (0, O.jsx)("div", { children: ut(e) }, e.field))
510
+ children: Z.map((e) => /* @__PURE__ */ (0, A.jsx)("div", { children: ut(e) }, e.field))
510
511
  })] })
511
512
  }),
512
- B && /* @__PURE__ */ (0, O.jsxs)("div", {
513
+ z && /* @__PURE__ */ (0, A.jsxs)("div", {
513
514
  className: "flex flex-col items-center gap-2 py-4",
514
515
  role: "alert",
515
516
  children: [
516
- /* @__PURE__ */ (0, O.jsx)(ve, { className: "size-5 text-destructive" }),
517
- /* @__PURE__ */ (0, O.jsx)("p", {
517
+ /* @__PURE__ */ (0, A.jsx)(_e, { className: "size-5 text-destructive" }),
518
+ /* @__PURE__ */ (0, A.jsx)("p", {
518
519
  className: "text-sm text-destructive",
519
- children: B
520
+ children: z
520
521
  }),
521
- /* @__PURE__ */ (0, O.jsx)(d, {
522
+ /* @__PURE__ */ (0, A.jsx)(d, {
522
523
  variant: "outline",
523
524
  size: "sm",
524
- onClick: () => qe(ke || void 0, U, Je),
525
+ onClick: () => qe(U || void 0, W, Je),
525
526
  type: "button",
526
527
  children: "Retry"
527
528
  })
528
529
  ]
529
530
  }),
530
- Ee ? /* @__PURE__ */ (0, O.jsx)("div", {
531
+ I ? /* @__PURE__ */ (0, A.jsx)("div", {
531
532
  className: "flex-1 min-h-0",
532
533
  "data-testid": "record-picker-grid-slot",
533
- children: Ee({
534
+ children: I({
534
535
  columns: Ge,
535
536
  records: L,
536
- loading: z,
537
- totalCount: H,
538
- currentPage: U,
539
- pageSize: x,
540
- sortField: K,
541
- sortDirection: q,
537
+ loading: R,
538
+ totalCount: V,
539
+ currentPage: W,
540
+ pageSize: g,
541
+ sortField: q,
542
+ sortDirection: J,
542
543
  onSort: Xe,
543
- onPageChange: W,
544
+ onPageChange: G,
544
545
  onRowClick: $e,
545
546
  isSelected: Qe,
546
- multiple: i,
547
- idField: oe,
548
- cellRenderer: I
547
+ multiple: r,
548
+ idField: se,
549
+ cellRenderer: P
549
550
  })
550
- }) : /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [
551
- z && L.length === 0 && !B && /* @__PURE__ */ (0, O.jsx)("div", {
551
+ }) : /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [
552
+ R && L.length === 0 && !z && /* @__PURE__ */ (0, A.jsx)("div", {
552
553
  className: "flex-1 overflow-hidden min-h-0 border rounded-md",
553
554
  role: "status",
554
555
  "aria-live": "polite",
555
556
  "data-testid": "record-picker-skeleton",
556
- children: /* @__PURE__ */ (0, O.jsxs)(fe, { children: [/* @__PURE__ */ (0, O.jsx)(me, { children: /* @__PURE__ */ (0, O.jsxs)(he, {
557
+ children: /* @__PURE__ */ (0, A.jsxs)(y, { children: [/* @__PURE__ */ (0, A.jsx)(me, { children: /* @__PURE__ */ (0, A.jsxs)(S, {
557
558
  className: "bg-muted/40",
558
- children: [i && /* @__PURE__ */ (0, O.jsx)(y, { className: "w-10" }), Ge.map((e) => /* @__PURE__ */ (0, O.jsx)(y, { children: /* @__PURE__ */ (0, O.jsx)(_, { className: "h-4 w-20" }) }, e.field))]
559
- }) }), /* @__PURE__ */ (0, O.jsx)(v, { children: Array.from({ length: A }, (e, t) => /* @__PURE__ */ (0, O.jsxs)(he, { children: [i && /* @__PURE__ */ (0, O.jsx)(pe, {
559
+ children: [r && /* @__PURE__ */ (0, A.jsx)(x, { className: "w-10" }), Ge.map((e) => /* @__PURE__ */ (0, A.jsx)(x, { children: /* @__PURE__ */ (0, A.jsx)(v, { className: "h-4 w-20" }) }, e.field))]
560
+ }) }), /* @__PURE__ */ (0, A.jsx)(pe, { children: Array.from({ length: xe }, (e, t) => /* @__PURE__ */ (0, A.jsxs)(S, { children: [r && /* @__PURE__ */ (0, A.jsx)(b, {
560
561
  className: "w-10",
561
- children: /* @__PURE__ */ (0, O.jsx)(_, { className: "size-4 rounded" })
562
- }), Ge.map((e) => /* @__PURE__ */ (0, O.jsx)(pe, { children: /* @__PURE__ */ (0, O.jsx)(_, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
562
+ children: /* @__PURE__ */ (0, A.jsx)(v, { className: "size-4 rounded" })
563
+ }), Ge.map((e) => /* @__PURE__ */ (0, A.jsx)(b, { children: /* @__PURE__ */ (0, A.jsx)(v, { className: "h-4 w-full" }) }, e.field))] }, t)) })] })
563
564
  }),
564
- !z && !B && L.length === 0 && /* @__PURE__ */ (0, O.jsx)("div", {
565
+ !R && !z && L.length === 0 && /* @__PURE__ */ (0, A.jsx)("div", {
565
566
  className: "py-8 text-center",
566
- children: /* @__PURE__ */ (0, O.jsx)("p", {
567
+ children: /* @__PURE__ */ (0, A.jsx)("p", {
567
568
  className: "text-sm text-muted-foreground",
568
569
  children: "No records found"
569
570
  })
570
571
  }),
571
- !B && L.length > 0 && /* @__PURE__ */ (0, O.jsxs)("div", {
572
+ !z && L.length > 0 && /* @__PURE__ */ (0, A.jsxs)("div", {
572
573
  className: "relative flex-1 overflow-auto min-h-0 border rounded-md",
573
574
  tabIndex: 0,
574
575
  onKeyDown: it,
575
576
  role: "grid",
576
577
  "aria-label": "Records",
577
- children: [z && /* @__PURE__ */ (0, O.jsx)("div", {
578
+ children: [R && /* @__PURE__ */ (0, A.jsx)("div", {
578
579
  className: "absolute inset-0 z-10 flex items-center justify-center bg-background/60",
579
580
  "data-testid": "record-picker-loading-overlay",
580
- children: /* @__PURE__ */ (0, O.jsx)(ye, { className: "size-6 animate-spin text-muted-foreground" })
581
- }), /* @__PURE__ */ (0, O.jsxs)(fe, {
582
- style: Object.keys(Ve).length > 0 ? { tableLayout: "fixed" } : void 0,
583
- children: [/* @__PURE__ */ (0, O.jsx)(me, {
581
+ children: /* @__PURE__ */ (0, A.jsx)(ve, { className: "size-6 animate-spin text-muted-foreground" })
582
+ }), /* @__PURE__ */ (0, A.jsxs)(y, {
583
+ style: Object.keys(Be).length > 0 ? { tableLayout: "fixed" } : void 0,
584
+ children: [/* @__PURE__ */ (0, A.jsx)(me, {
584
585
  className: "sticky top-0 z-[5] bg-muted/50 [&_tr]:border-b",
585
586
  "data-testid": "record-picker-sticky-header",
586
- children: /* @__PURE__ */ (0, O.jsxs)(he, { children: [i && /* @__PURE__ */ (0, O.jsx)(y, { className: "w-10" }), Ge.map((e) => {
587
- let t = Ve[e.field];
588
- return /* @__PURE__ */ (0, O.jsxs)(y, {
587
+ children: /* @__PURE__ */ (0, A.jsxs)(S, { children: [r && /* @__PURE__ */ (0, A.jsx)(x, { className: "w-10" }), Ge.map((e) => {
588
+ let t = Be[e.field];
589
+ return /* @__PURE__ */ (0, A.jsxs)(x, {
589
590
  style: t ? {
590
591
  width: `${t}px`,
591
592
  minWidth: `${t}px`
592
593
  } : e.width ? { width: e.width } : void 0,
593
594
  className: "cursor-pointer select-none relative group text-xs font-semibold uppercase tracking-wider",
594
595
  onClick: () => Xe(e.field),
595
- "aria-sort": K === e.field ? q === "asc" ? "ascending" : "descending" : "none",
596
- children: [/* @__PURE__ */ (0, O.jsxs)("span", {
596
+ "aria-sort": q === e.field ? J === "asc" ? "ascending" : "descending" : "none",
597
+ children: [/* @__PURE__ */ (0, A.jsxs)("span", {
597
598
  className: "inline-flex items-center",
598
- children: [e.label || M(e.field), ot(e.field)]
599
- }), /* @__PURE__ */ (0, O.jsx)("span", {
599
+ children: [e.label || Ce(e.field), ot(e.field)]
600
+ }), /* @__PURE__ */ (0, A.jsx)("span", {
600
601
  role: "separator",
601
602
  "aria-orientation": "vertical",
602
603
  className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize opacity-0 group-hover:opacity-100 bg-border hover:bg-primary/50 transition-opacity",
@@ -609,20 +610,20 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
609
610
  })]
610
611
  }, e.field);
611
612
  })] })
612
- }), /* @__PURE__ */ (0, O.jsx)(v, {
613
- ref: Le,
613
+ }), /* @__PURE__ */ (0, A.jsx)(pe, {
614
+ ref: Ie,
614
615
  children: L.map((e, t) => {
615
- let n = Ze(e), r = Qe(e), a = t === J;
616
- return /* @__PURE__ */ (0, O.jsxs)(he, {
616
+ let n = Ze(e), i = Qe(e), ee = t === Y;
617
+ return /* @__PURE__ */ (0, A.jsxs)(S, {
617
618
  "data-row-index": t,
618
- className: b("cursor-pointer transition-colors", dt(r, t), a && "ring-2 ring-primary ring-inset"),
619
+ className: he("cursor-pointer transition-colors", dt(i, t), ee && "ring-2 ring-primary ring-inset"),
619
620
  onClick: () => $e(e),
620
621
  "data-testid": `record-row-${n}`,
621
- "aria-selected": r,
622
- children: [i && /* @__PURE__ */ (0, O.jsx)(pe, {
622
+ "aria-selected": i,
623
+ children: [r && /* @__PURE__ */ (0, A.jsx)(b, {
623
624
  className: "w-10",
624
- children: r && /* @__PURE__ */ (0, O.jsx)(w, { className: "size-4 text-primary" })
625
- }), Ge.map((t) => /* @__PURE__ */ (0, O.jsx)(pe, {
625
+ children: i && /* @__PURE__ */ (0, A.jsx)(ge, { className: "size-4 text-primary" })
626
+ }), Ge.map((t) => /* @__PURE__ */ (0, A.jsx)(b, {
626
627
  className: "py-2.5",
627
628
  children: at(e, t)
628
629
  }, t.field))]
@@ -631,63 +632,63 @@ function N({ open: e, onOpenChange: t, title: n = "Select Record", multiple: i =
631
632
  })]
632
633
  })]
633
634
  }),
634
- !B && H > 0 && /* @__PURE__ */ (0, O.jsxs)("div", {
635
+ !z && V > 0 && /* @__PURE__ */ (0, A.jsxs)("div", {
635
636
  className: "flex items-center justify-between text-sm text-muted-foreground border-t pt-3 mt-2 px-1",
636
637
  "data-testid": "record-picker-pagination",
637
- children: [/* @__PURE__ */ (0, O.jsxs)("span", { children: [
638
- H,
638
+ children: [/* @__PURE__ */ (0, A.jsxs)("span", { children: [
639
+ V,
639
640
  " ",
640
- H === 1 ? "record" : "records",
641
- Q > 1 && ` · Page ${U} of ${Q}`
642
- ] }), Q > 1 && /* @__PURE__ */ (0, O.jsxs)("div", {
641
+ V === 1 ? "record" : "records",
642
+ Q > 1 && ` · Page ${W} of ${Q}`
643
+ ] }), Q > 1 && /* @__PURE__ */ (0, A.jsxs)("div", {
643
644
  className: "flex items-center gap-1.5",
644
645
  children: [
645
- /* @__PURE__ */ (0, O.jsx)(d, {
646
+ /* @__PURE__ */ (0, A.jsx)(d, {
646
647
  variant: "outline",
647
648
  size: "icon",
648
649
  className: "size-7",
649
650
  onClick: tt,
650
- disabled: U <= 1,
651
+ disabled: W <= 1,
651
652
  type: "button",
652
653
  "aria-label": "Previous page",
653
- children: /* @__PURE__ */ (0, O.jsx)(_e, { className: "size-4" })
654
+ children: /* @__PURE__ */ (0, A.jsx)(D, { className: "size-4" })
654
655
  }),
655
- /* @__PURE__ */ (0, O.jsx)(h, {
656
+ /* @__PURE__ */ (0, A.jsx)(m, {
656
657
  className: "h-7 w-12 text-center text-xs px-1",
657
- placeholder: String(U),
658
+ placeholder: String(W),
658
659
  value: Ue,
659
660
  onChange: (e) => We(e.target.value),
660
661
  onKeyDown: rt,
661
662
  "aria-label": "Jump to page",
662
663
  "data-testid": "record-picker-page-jump"
663
664
  }),
664
- /* @__PURE__ */ (0, O.jsx)(d, {
665
+ /* @__PURE__ */ (0, A.jsx)(d, {
665
666
  variant: "outline",
666
667
  size: "icon",
667
668
  className: "size-7",
668
669
  onClick: nt,
669
- disabled: U >= Q,
670
+ disabled: W >= Q,
670
671
  type: "button",
671
672
  "aria-label": "Next page",
672
- children: /* @__PURE__ */ (0, O.jsx)(T, { className: "size-4" })
673
+ children: /* @__PURE__ */ (0, A.jsx)(O, { className: "size-4" })
673
674
  })
674
675
  ]
675
676
  })]
676
677
  })
677
678
  ] }),
678
- i && /* @__PURE__ */ (0, O.jsx)(f, { children: /* @__PURE__ */ (0, O.jsxs)("div", {
679
+ r && /* @__PURE__ */ (0, A.jsx)(f, { children: /* @__PURE__ */ (0, A.jsxs)("div", {
679
680
  className: "flex items-center gap-2 w-full justify-between",
680
- children: [/* @__PURE__ */ (0, O.jsxs)("span", {
681
+ children: [/* @__PURE__ */ (0, A.jsxs)("span", {
681
682
  className: "text-sm text-muted-foreground",
682
- children: [Ne.size, " selected"]
683
- }), /* @__PURE__ */ (0, O.jsxs)("div", {
683
+ children: [Me.size, " selected"]
684
+ }), /* @__PURE__ */ (0, A.jsxs)("div", {
684
685
  className: "flex gap-2",
685
- children: [/* @__PURE__ */ (0, O.jsx)(d, {
686
+ children: [/* @__PURE__ */ (0, A.jsx)(d, {
686
687
  variant: "outline",
687
688
  type: "button",
688
689
  onClick: () => t(!1),
689
690
  children: "Cancel"
690
- }), /* @__PURE__ */ (0, O.jsx)(d, {
691
+ }), /* @__PURE__ */ (0, A.jsx)(d, {
691
692
  type: "button",
692
693
  onClick: et,
693
694
  children: "Confirm"
@@ -704,22 +705,22 @@ var P;
704
705
  function F(e) {
705
706
  P = e;
706
707
  }
707
- function I() {
708
+ function Ee() {
708
709
  return P;
709
710
  }
710
711
  //#endregion
711
712
  //#region ../fields/src/widgets/LookupField.tsx
712
- var we = 50, Te = x;
713
- function Ee(e, t, n, r) {
714
- let i = e[n] ?? e.id ?? e._id, a = e[t] ?? e.label ?? e.name ?? String(i), ee = r ? e[r] : void 0;
713
+ var I = /* @__PURE__ */ e({ LookupField: () => z }), L = 50, De = C;
714
+ function R(e, t, n, r) {
715
+ let i = e[n] ?? e.id ?? e._id, ee = e[t] ?? e.label ?? e.name ?? String(i), a = r ? e[r] : void 0;
715
716
  return {
716
717
  value: i,
717
- label: String(a),
718
- description: ee,
718
+ label: String(ee),
719
+ description: a,
719
720
  ...e
720
721
  };
721
722
  }
722
- function L(e) {
723
+ function Oe(e) {
723
724
  return {
724
725
  text: "text",
725
726
  number: "number",
@@ -732,12 +733,12 @@ function L(e) {
732
733
  boolean: "boolean"
733
734
  }[e];
734
735
  }
735
- function R({ value: e, onChange: t, field: te, readonly: ne, ...re }) {
736
- let [f, p] = l(!1), [m, g] = l(""), { t: se } = i(), [ce, le] = l([]), [ue, de] = l(!1), [_, fe] = l(null), [v, pe] = l(0), y = c(null), [me, he] = l([]), [b, x] = l(-1), ge = c(null), S = te || re.schema, C = S?.field, w = C && typeof C == "object" && ("reference_to" in C || "reference" in C || "type" in C) ? C : S, _e = w?.options || [], T = w?.multiple || !1, E = w?.display_field || w?.reference_field || "name", xe = w?.description_field, k = w?.id_field || "id", A = w?.reference_to || w?.reference, j = w?.lookup_columns, M = w?.lookup_page_size, Se = w?.lookup_filters, Ce = s(() => {
737
- if (!j) return;
736
+ function z({ value: e, onChange: t, field: n, readonly: ne, ...re }) {
737
+ let [ie, f] = l(!1), [p, ae] = l(""), { t: h } = ee(), [ce, le] = l([]), [ue, de] = l(!1), [fe, v] = l(null), [y, pe] = l(0), b = c(null), [x, me] = l([]), [S, he] = l(-1), C = c(null), w = n || re.schema, T = w?.field, E = T && typeof T == "object" && ("reference_to" in T || "reference" in T || "type" in T) ? T : w, ge = E?.options || [], D = E?.multiple || !1, O = E?.display_field || E?.reference_field || "name", be = E?.description_field, j = E?.id_field || "id", M = E?.reference_to || E?.reference, xe = E?.lookup_columns, Se = E?.lookup_page_size, Ce = E?.lookup_filters, we = s(() => {
738
+ if (!xe) return;
738
739
  let e = [];
739
- for (let t of j) if (typeof t == "object" && t.type) {
740
- let n = L(t.type);
740
+ for (let t of xe) if (typeof t == "object" && t.type) {
741
+ let n = Oe(t.type);
741
742
  n && e.push({
742
743
  field: t.field,
743
744
  label: t.label,
@@ -745,259 +746,256 @@ function R({ value: e, onChange: t, field: te, readonly: ne, ...re }) {
745
746
  });
746
747
  }
747
748
  return e.length > 0 ? e : void 0;
748
- }, [j]), P = ee(Te)?.dataSource ?? null, F = re.dataSource ?? S?.dataSource ?? w?.dataSource ?? P, R = F != null && typeof F.find == "function" && !!A, z = re.onCreateNew ?? S?.onCreateNew, [De, B] = l(!1), V = R ? ce : _e, H = s(() => {
749
- if (R || !m) return V;
750
- let e = m.toLowerCase();
749
+ }, [xe]), Te = te(De)?.dataSource ?? null, P = re.dataSource ?? w?.dataSource ?? E?.dataSource ?? Te, F = P != null && typeof P.find == "function" && !!M, I = re.onCreateNew ?? w?.onCreateNew, [z, B] = l(!1), V = F ? ce : ge, H = s(() => {
750
+ if (F || !p) return V;
751
+ let e = p.toLowerCase();
751
752
  return V.filter((t) => t.label.toLowerCase().includes(e) || t.description && t.description.toLowerCase().includes(e));
752
753
  }, [
753
- R,
754
+ F,
754
755
  V,
755
- m
756
+ p
756
757
  ]);
757
758
  o(() => {
758
- x(-1);
759
+ he(-1);
759
760
  }, [H.length]);
760
- let Oe = a(async (e) => {
761
- if (!(!F || !A)) {
762
- de(!0), fe(null);
761
+ let U = a(async (e) => {
762
+ if (!(!P || !M)) {
763
+ de(!0), v(null);
763
764
  try {
764
- let t = { $top: we };
765
+ let t = { $top: L };
765
766
  e && e.trim() && (t.$search = e.trim());
766
- let n = await F.find(A, t), r = n?.data ?? n ?? [];
767
- le(r.map((e) => Ee(e, E, k, xe))), pe(n?.total ?? r.length);
767
+ let n = await P.find(M, t), r = n?.data ?? n ?? [];
768
+ le(r.map((e) => R(e, O, j, be))), pe(n?.total ?? r.length);
768
769
  } catch (e) {
769
- fe(e instanceof Error ? e.message : String(e)), le([]);
770
+ v(e instanceof Error ? e.message : String(e)), le([]);
770
771
  } finally {
771
772
  de(!1);
772
773
  }
773
774
  }
774
775
  }, [
775
- F,
776
- A,
777
- E,
778
- k,
779
- xe
776
+ P,
777
+ M,
778
+ O,
779
+ j,
780
+ be
780
781
  ]);
781
782
  o(() => {
782
- f && R && Oe(m || void 0), f || (g(""), fe(null), x(-1));
783
- }, [f]);
783
+ ie && F && U(p || void 0), ie || (ae(""), v(null), he(-1));
784
+ }, [ie]);
784
785
  let ke = a((e) => {
785
- g(e), R && (y.current && clearTimeout(y.current), y.current = setTimeout(() => {
786
- Oe(e || void 0);
786
+ ae(e), F && (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
787
+ U(e || void 0);
787
788
  }, 300));
788
- }, [R, Oe]);
789
+ }, [F, U]);
789
790
  o(() => () => {
790
- y.current && clearTimeout(y.current);
791
+ b.current && clearTimeout(b.current);
791
792
  }, []);
792
- let Ae = a((e) => _e.find((t) => t.value === e) ?? ce.find((t) => t.value === e) ?? me.find((t) => t.value === e), [
793
- _e,
793
+ let W = a((e) => ge.find((t) => t.value === e) ?? ce.find((t) => t.value === e) ?? x.find((t) => t.value === e), [
794
+ ge,
794
795
  ce,
795
- me
796
- ]), U = T ? (Array.isArray(e) ? e : []).map(Ae).filter(Boolean) : e ? [Ae(e)].filter(Boolean) : [], W = a((n) => {
797
- if (T) {
796
+ x
797
+ ]), G = D ? (Array.isArray(e) ? e : []).map(W).filter(Boolean) : e ? [W(e)].filter(Boolean) : [], K = a((n) => {
798
+ if (D) {
798
799
  let r = Array.isArray(e) ? e : [];
799
800
  r.includes(n.value) ? t(r.filter((e) => e !== n.value)) : t([...r, n.value]);
800
- } else t(n.value), p(!1);
801
+ } else t(n.value), f(!1);
801
802
  }, [
802
- T,
803
+ D,
803
804
  e,
804
805
  t
805
- ]), G = (n) => {
806
- t(T ? (Array.isArray(e) ? e : []).filter((e) => e !== n) : null);
807
- }, K = a((e) => {
808
- he(e.map((e) => Ee(e, E, k, xe)));
806
+ ]), q = (n) => {
807
+ t(D ? (Array.isArray(e) ? e : []).filter((e) => e !== n) : null);
808
+ }, Ae = a((e) => {
809
+ me(e.map((e) => R(e, O, j, be)));
809
810
  }, [
810
- E,
811
- k,
812
- xe
813
- ]), je = a((e) => {
814
- e.key === "ArrowDown" ? (e.preventDefault(), x((e) => e < H.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), x((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), b >= 0 && b < H.length && W(H[b]));
811
+ O,
812
+ j,
813
+ be
814
+ ]), J = a((e) => {
815
+ e.key === "ArrowDown" ? (e.preventDefault(), he((e) => e < H.length - 1 ? e + 1 : e)) : e.key === "ArrowUp" ? (e.preventDefault(), he((e) => e > 0 ? e - 1 : 0)) : e.key === "Enter" && (e.preventDefault(), S >= 0 && S < H.length && K(H[S]));
815
816
  }, [
816
817
  H,
817
- b,
818
- W
818
+ S,
819
+ K
819
820
  ]);
820
821
  return o(() => {
821
- b >= 0 && ge.current && ge.current.querySelector(`[data-lookup-index="${b}"]`)?.scrollIntoView({ block: "nearest" });
822
- }, [b]), ne ? U.length ? T ? /* @__PURE__ */ (0, O.jsx)("div", {
822
+ S >= 0 && C.current && C.current.querySelector(`[data-lookup-index="${S}"]`)?.scrollIntoView({ block: "nearest" });
823
+ }, [S]), ne ? G.length ? D ? /* @__PURE__ */ (0, A.jsx)("div", {
823
824
  className: "flex flex-wrap gap-1",
824
- children: U.map((e, t) => /* @__PURE__ */ (0, O.jsx)(u, {
825
+ children: G.map((e, t) => /* @__PURE__ */ (0, A.jsx)(u, {
825
826
  variant: "outline",
826
- children: e?.[E] || e?.label
827
+ children: e?.[O] || e?.label
827
828
  }, t))
828
- }) : /* @__PURE__ */ (0, O.jsx)("span", {
829
- className: "text-sm",
830
- children: U[0]?.[E] || U[0]?.label
831
- }) : /* @__PURE__ */ (0, O.jsx)("span", {
829
+ }) : /* @__PURE__ */ (0, A.jsx)("span", {
832
830
  className: "text-sm",
833
- children: "-"
834
- }) : /* @__PURE__ */ (0, O.jsxs)("div", {
831
+ children: G[0]?.[O] || G[0]?.label
832
+ }) : /* @__PURE__ */ (0, A.jsx)(oe, {}) : /* @__PURE__ */ (0, A.jsxs)("div", {
835
833
  className: "space-y-2",
836
834
  children: [
837
- U.length > 0 && /* @__PURE__ */ (0, O.jsx)("div", {
835
+ G.length > 0 && /* @__PURE__ */ (0, A.jsx)("div", {
838
836
  className: "flex flex-wrap gap-1",
839
- children: U.map((e, t) => /* @__PURE__ */ (0, O.jsxs)(u, {
837
+ children: G.map((e, t) => /* @__PURE__ */ (0, A.jsxs)(u, {
840
838
  variant: "outline",
841
839
  className: "gap-1",
842
- children: [e?.[E] || e?.label, /* @__PURE__ */ (0, O.jsx)("button", {
843
- onClick: () => G(e?.value),
840
+ children: [e?.[O] || e?.label, /* @__PURE__ */ (0, A.jsx)("button", {
841
+ onClick: () => q(e?.value),
844
842
  className: "ml-1 hover:text-destructive",
845
843
  type: "button",
846
- "aria-label": `Remove ${e?.[E] || e?.label}`,
847
- children: /* @__PURE__ */ (0, O.jsx)(r, { className: "size-3" })
844
+ "aria-label": `Remove ${e?.[O] || e?.label}`,
845
+ children: /* @__PURE__ */ (0, A.jsx)(i, { className: "size-3" })
848
846
  })]
849
847
  }, t))
850
848
  }),
851
- /* @__PURE__ */ (0, O.jsxs)("div", {
849
+ /* @__PURE__ */ (0, A.jsxs)("div", {
852
850
  className: "flex items-center gap-1.5",
853
- children: [/* @__PURE__ */ (0, O.jsxs)(ie, {
854
- open: f,
855
- onOpenChange: p,
856
- children: [/* @__PURE__ */ (0, O.jsx)(oe, {
851
+ children: [/* @__PURE__ */ (0, A.jsxs)(se, {
852
+ open: ie,
853
+ onOpenChange: f,
854
+ children: [/* @__PURE__ */ (0, A.jsx)(_, {
857
855
  asChild: !0,
858
- children: /* @__PURE__ */ (0, O.jsxs)(d, {
856
+ children: /* @__PURE__ */ (0, A.jsxs)(d, {
859
857
  variant: "outline",
860
858
  className: "min-w-0 flex-1 justify-start text-left font-normal",
861
859
  type: "button",
862
- children: [/* @__PURE__ */ (0, O.jsx)(be, { className: "mr-2 size-4" }), U.length === 0 ? S?.placeholder || se("common.select") : T ? se("table.selected", { count: U.length }) : se("common.select")]
860
+ children: [/* @__PURE__ */ (0, A.jsx)(ye, { className: "mr-2 size-4" }), G.length === 0 ? w?.placeholder || h("common.select") : D ? h("table.selected", { count: G.length }) : h("common.select")]
863
861
  })
864
- }), /* @__PURE__ */ (0, O.jsxs)(ae, {
862
+ }), /* @__PURE__ */ (0, A.jsxs)(g, {
865
863
  className: "w-[var(--radix-popover-trigger-width)] p-0",
866
864
  align: "start",
867
865
  children: [
868
- /* @__PURE__ */ (0, O.jsx)("div", {
866
+ /* @__PURE__ */ (0, A.jsx)("div", {
869
867
  className: "p-2",
870
- children: /* @__PURE__ */ (0, O.jsxs)("div", {
868
+ children: /* @__PURE__ */ (0, A.jsxs)("div", {
871
869
  className: "relative",
872
870
  children: [
873
- /* @__PURE__ */ (0, O.jsx)(be, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
874
- /* @__PURE__ */ (0, O.jsx)(h, {
875
- placeholder: se("common.search") + "...",
876
- value: m,
871
+ /* @__PURE__ */ (0, A.jsx)(ye, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" }),
872
+ /* @__PURE__ */ (0, A.jsx)(m, {
873
+ placeholder: h("common.search") + "...",
874
+ value: p,
877
875
  onChange: (e) => ke(e.target.value),
878
- onKeyDown: je,
876
+ onKeyDown: J,
879
877
  className: "w-full pl-9 h-8 text-sm"
880
878
  }),
881
- ue && /* @__PURE__ */ (0, O.jsx)(ye, {
879
+ ue && /* @__PURE__ */ (0, A.jsx)(ve, {
882
880
  className: "absolute right-3 top-1/2 -translate-y-1/2 size-4 animate-spin text-muted-foreground",
883
881
  "data-testid": "lookup-loading"
884
882
  })
885
883
  ]
886
884
  })
887
885
  }),
888
- _ && /* @__PURE__ */ (0, O.jsxs)("div", {
886
+ fe && /* @__PURE__ */ (0, A.jsxs)("div", {
889
887
  className: "flex flex-col items-center gap-2 py-4 px-2",
890
888
  role: "alert",
891
889
  children: [
892
- /* @__PURE__ */ (0, O.jsx)(ve, { className: "size-5 text-destructive" }),
893
- /* @__PURE__ */ (0, O.jsx)("p", {
890
+ /* @__PURE__ */ (0, A.jsx)(_e, { className: "size-5 text-destructive" }),
891
+ /* @__PURE__ */ (0, A.jsx)("p", {
894
892
  className: "text-sm text-destructive",
895
- children: _
893
+ children: fe
896
894
  }),
897
- /* @__PURE__ */ (0, O.jsx)(d, {
895
+ /* @__PURE__ */ (0, A.jsx)(d, {
898
896
  variant: "outline",
899
897
  size: "sm",
900
- onClick: () => Oe(m || void 0),
898
+ onClick: () => U(p || void 0),
901
899
  type: "button",
902
900
  children: "Retry"
903
901
  })
904
902
  ]
905
903
  }),
906
- ue && H.length === 0 && !_ && /* @__PURE__ */ (0, O.jsxs)("div", {
904
+ ue && H.length === 0 && !fe && /* @__PURE__ */ (0, A.jsxs)("div", {
907
905
  className: "flex flex-col items-center gap-2 py-6",
908
906
  role: "status",
909
907
  "aria-live": "polite",
910
- children: [/* @__PURE__ */ (0, O.jsx)(ye, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ (0, O.jsx)("p", {
908
+ children: [/* @__PURE__ */ (0, A.jsx)(ve, { className: "size-6 animate-spin text-muted-foreground" }), /* @__PURE__ */ (0, A.jsx)("p", {
911
909
  className: "text-sm text-muted-foreground",
912
910
  children: "Loading…"
913
911
  })]
914
912
  }),
915
- !_ && !(ue && H.length === 0) && /* @__PURE__ */ (0, O.jsx)("div", {
916
- ref: ge,
913
+ !fe && !(ue && H.length === 0) && /* @__PURE__ */ (0, A.jsx)("div", {
914
+ ref: C,
917
915
  className: "max-h-64 overflow-y-auto px-1 pb-1",
918
916
  role: "listbox",
919
- children: H.length === 0 ? /* @__PURE__ */ (0, O.jsxs)("div", {
917
+ children: H.length === 0 ? /* @__PURE__ */ (0, A.jsxs)("div", {
920
918
  className: "py-4 text-center",
921
- children: [/* @__PURE__ */ (0, O.jsx)("p", {
919
+ children: [/* @__PURE__ */ (0, A.jsx)("p", {
922
920
  className: "text-sm text-muted-foreground",
923
921
  children: "No options found"
924
- }), z && /* @__PURE__ */ (0, O.jsxs)(d, {
922
+ }), I && /* @__PURE__ */ (0, A.jsxs)(d, {
925
923
  variant: "ghost",
926
924
  size: "sm",
927
925
  className: "mt-2 gap-1",
928
926
  type: "button",
929
927
  onClick: () => {
930
- z(m), p(!1);
928
+ I(p), f(!1);
931
929
  },
932
- children: [/* @__PURE__ */ (0, O.jsx)(n, { className: "size-4" }), "Create new"]
930
+ children: [/* @__PURE__ */ (0, A.jsx)(r, { className: "size-4" }), "Create new"]
933
931
  })]
934
- }) : /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [
932
+ }) : /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [
935
933
  H.map((t, n) => {
936
- let r = T ? (Array.isArray(e) ? e : []).includes(t.value) : e === t.value;
937
- return /* @__PURE__ */ (0, O.jsxs)("button", {
934
+ let r = D ? (Array.isArray(e) ? e : []).includes(t.value) : e === t.value;
935
+ return /* @__PURE__ */ (0, A.jsxs)("button", {
938
936
  "data-lookup-index": n,
939
937
  role: "option",
940
938
  "aria-selected": r,
941
- onClick: () => W(t),
942
- className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === b ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
939
+ onClick: () => K(t),
940
+ className: `w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center justify-between ${n === S ? "bg-accent text-accent-foreground" : r ? "bg-accent/50 text-accent-foreground" : ""}`,
943
941
  type: "button",
944
- children: [/* @__PURE__ */ (0, O.jsxs)("div", {
942
+ children: [/* @__PURE__ */ (0, A.jsxs)("div", {
945
943
  className: "min-w-0 flex-1",
946
- children: [/* @__PURE__ */ (0, O.jsx)("span", {
944
+ children: [/* @__PURE__ */ (0, A.jsx)("span", {
947
945
  className: "block truncate",
948
946
  children: t.label
949
- }), t.description && /* @__PURE__ */ (0, O.jsx)("span", {
947
+ }), t.description && /* @__PURE__ */ (0, A.jsx)("span", {
950
948
  className: "block truncate text-xs text-muted-foreground",
951
949
  children: t.description
952
950
  })]
953
- }), r && /* @__PURE__ */ (0, O.jsx)(u, {
951
+ }), r && /* @__PURE__ */ (0, A.jsx)(u, {
954
952
  variant: "default",
955
953
  className: "ml-2 shrink-0",
956
954
  children: "Selected"
957
955
  })]
958
956
  }, t.value);
959
957
  }),
960
- R && v > H.length && /* @__PURE__ */ (0, O.jsxs)("p", {
958
+ F && y > H.length && /* @__PURE__ */ (0, A.jsxs)("p", {
961
959
  className: "text-xs text-muted-foreground text-center py-2",
962
960
  children: [
963
961
  "Showing ",
964
962
  H.length,
965
963
  " of ",
966
- v,
964
+ y,
967
965
  " results."
968
966
  ]
969
967
  }),
970
- R && v > H.length && /* @__PURE__ */ (0, O.jsxs)("button", {
968
+ F && y > H.length && /* @__PURE__ */ (0, A.jsxs)("button", {
971
969
  type: "button",
972
970
  className: "w-full text-center px-3 py-2 rounded-md text-sm font-medium text-primary hover:bg-accent flex items-center justify-center gap-1.5",
973
971
  onClick: () => {
974
- p(!1), B(!0);
972
+ f(!1), B(!0);
975
973
  },
976
974
  "data-testid": "show-all-results",
977
975
  children: [
978
- /* @__PURE__ */ (0, O.jsx)(D, { className: "size-3.5" }),
976
+ /* @__PURE__ */ (0, A.jsx)(k, { className: "size-3.5" }),
979
977
  "Show All Results (",
980
- v,
978
+ y,
981
979
  ")"
982
980
  ]
983
981
  }),
984
- z && /* @__PURE__ */ (0, O.jsxs)("button", {
982
+ I && /* @__PURE__ */ (0, A.jsxs)("button", {
985
983
  type: "button",
986
984
  className: "w-full text-left px-3 py-2 rounded-md text-sm hover:bg-accent flex items-center gap-1.5 text-muted-foreground",
987
985
  onClick: () => {
988
- z(m), p(!1);
986
+ I(p), f(!1);
989
987
  },
990
988
  children: [
991
- /* @__PURE__ */ (0, O.jsx)(n, { className: "size-3.5" }),
989
+ /* @__PURE__ */ (0, A.jsx)(r, { className: "size-3.5" }),
992
990
  "Create new",
993
- m ? ` "${m}"` : ""
991
+ p ? ` "${p}"` : ""
994
992
  ]
995
993
  })
996
994
  ] })
997
995
  })
998
996
  ]
999
997
  })]
1000
- }), R && /* @__PURE__ */ (0, O.jsx)(d, {
998
+ }), F && /* @__PURE__ */ (0, A.jsx)(d, {
1001
999
  variant: "outline",
1002
1000
  size: "icon",
1003
1001
  className: "shrink-0",
@@ -1006,29 +1004,29 @@ function R({ value: e, onChange: t, field: te, readonly: ne, ...re }) {
1006
1004
  "aria-label": "Browse all records",
1007
1005
  title: "Browse all records",
1008
1006
  "data-testid": "browse-all-records",
1009
- children: /* @__PURE__ */ (0, O.jsx)(D, { className: "size-4" })
1007
+ children: /* @__PURE__ */ (0, A.jsx)(k, { className: "size-4" })
1010
1008
  })]
1011
1009
  }),
1012
- R && F && A && /* @__PURE__ */ (0, O.jsx)(N, {
1013
- open: De,
1010
+ F && P && M && /* @__PURE__ */ (0, A.jsx)(N, {
1011
+ open: z,
1014
1012
  onOpenChange: B,
1015
- title: S?.label || "Select",
1016
- multiple: T,
1017
- dataSource: F,
1018
- objectName: A,
1019
- columns: j,
1020
- displayField: E,
1021
- idField: k,
1022
- pageSize: M,
1013
+ title: w?.label || "Select",
1014
+ multiple: D,
1015
+ dataSource: P,
1016
+ objectName: M,
1017
+ columns: xe,
1018
+ displayField: O,
1019
+ idField: j,
1020
+ pageSize: Se,
1023
1021
  value: e,
1024
1022
  onSelect: t,
1025
- onSelectRecords: K,
1026
- lookupFilters: Se,
1027
- cellRenderer: I(),
1028
- filterColumns: Ce
1023
+ onSelectRecords: Ae,
1024
+ lookupFilters: Ce,
1025
+ cellRenderer: Ee(),
1026
+ filterColumns: we
1029
1027
  })
1030
1028
  ]
1031
1029
  });
1032
1030
  }
1033
1031
  //#endregion
1034
- export { F as n, w as r, R as t };
1032
+ export { ge as i, I as n, F as r, z as t };