@object-ui/plugin-aggrid 3.1.5 → 3.3.1

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