@object-ui/plugin-view 3.0.2 → 3.0.3

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.
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import * as T from "react";
2
- import Ue, { useState as B, useMemo as W, useEffect as Re, useCallback as z, useContext as mt } from "react";
1
+ import * as R from "react";
2
+ import Ue, { useState as W, useMemo as q, useEffect as Re, useCallback as M, useContext as mt } from "react";
3
3
  import { ComponentRegistry as te } from "@object-ui/core";
4
4
  import { ObjectGrid as bt } from "@object-ui/plugin-grid";
5
5
  import { ObjectForm as ke } from "@object-ui/plugin-form";
6
- import { Select as be, SelectTrigger as we, SelectValue as ve, cn as A, SelectContent as ye, SelectItem as ce, Button as G, Tabs as Ye, TabsList as Be, TabsTrigger as We, Drawer as qe, DrawerContent as Ge, DrawerHeader as Ke, DrawerTitle as He, DrawerDescription as Je, Dialog as wt, DialogContent as vt, DialogHeader as yt, DialogTitle as gt, DialogDescription as xt, Label as jt, Popover as ht, PopoverTrigger as Nt, PopoverContent as Ct, Input as ie, Checkbox as St, SortBuilder as Ft } from "@object-ui/components";
7
- import { Map as Vt, Activity as Et, Calendar as _t, LayoutGrid as Tt, Grid as Rt, FileText as kt, List as At, icons as Ot, Plus as Dt, SlidersHorizontal as Ae, X as Pt, ArrowUp as $t, ArrowDown as It } from "lucide-react";
8
- import { SchemaRenderer as Oe } from "@object-ui/react";
6
+ import { Select as be, SelectTrigger as we, SelectValue as ve, cn as A, SelectContent as ye, SelectItem as ce, Button as K, Tabs as Ye, TabsList as Be, TabsTrigger as We, Drawer as qe, DrawerContent as Ge, DrawerHeader as Ke, DrawerTitle as Je, DrawerDescription as He, Dialog as wt, DialogContent as vt, DialogHeader as yt, DialogTitle as gt, DialogDescription as xt, Label as jt, Popover as ht, PopoverTrigger as Nt, PopoverContent as Ct, Input as ie, Checkbox as St, SortBuilder as Vt } from "@object-ui/components";
7
+ import { Map as Ft, Activity as Et, Calendar as _t, LayoutGrid as Tt, Grid as Rt, FileText as kt, List as Ot, icons as At, Plus as Dt, SlidersHorizontal as Oe, X as Pt, ArrowUp as $t, ArrowDown as It } from "lucide-react";
8
+ import { SchemaRenderer as Ae } from "@object-ui/react";
9
9
  var pe = { exports: {} }, se = {};
10
10
  var De;
11
11
  function Lt() {
12
12
  if (De) return se;
13
13
  De = 1;
14
14
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
15
- function f(c, p, m) {
15
+ function f(o, p, m) {
16
16
  var S = null;
17
17
  if (m !== void 0 && (S = "" + m), p.key !== void 0 && (S = "" + p.key), "key" in p) {
18
18
  m = {};
@@ -21,7 +21,7 @@ function Lt() {
21
21
  } else m = p;
22
22
  return p = m.ref, {
23
23
  $$typeof: e,
24
- type: c,
24
+ type: o,
25
25
  key: S,
26
26
  ref: p !== void 0 ? p : null,
27
27
  props: m
@@ -41,9 +41,9 @@ function zt() {
41
41
  switch (r) {
42
42
  case _:
43
43
  return "Fragment";
44
- case o:
44
+ case s:
45
45
  return "Profiler";
46
- case R:
46
+ case k:
47
47
  return "StrictMode";
48
48
  case ge:
49
49
  return "Suspense";
@@ -56,21 +56,21 @@ function zt() {
56
56
  switch (typeof r.tag == "number" && console.error(
57
57
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
58
58
  ), r.$$typeof) {
59
- case s:
59
+ case i:
60
60
  return "Portal";
61
61
  case P:
62
62
  return r.displayName || "Context";
63
63
  case g:
64
64
  return (r._context.displayName || "Context") + ".Consumer";
65
65
  case X:
66
- var u = r.render;
67
- return r = r.displayName, r || (r = u.displayName || u.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
68
- case $:
69
- return u = r.displayName || null, u !== null ? u : e(r.type) || "Memo";
66
+ var d = r.render;
67
+ return r = r.displayName, r || (r = d.displayName || d.name || "", r = r !== "" ? "ForwardRef(" + r + ")" : "ForwardRef"), r;
68
+ case I:
69
+ return d = r.displayName || null, d !== null ? d : e(r.type) || "Memo";
70
70
  case ue:
71
- u = r._payload, r = r._init;
71
+ d = r._payload, r = r._init;
72
72
  try {
73
- return e(r(u));
73
+ return e(r(d));
74
74
  } catch {
75
75
  }
76
76
  }
@@ -82,33 +82,33 @@ function zt() {
82
82
  function f(r) {
83
83
  try {
84
84
  l(r);
85
- var u = !1;
85
+ var d = !1;
86
86
  } catch {
87
- u = !0;
87
+ d = !0;
88
88
  }
89
- if (u) {
90
- u = console;
91
- var w = u.error, y = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
89
+ if (d) {
90
+ d = console;
91
+ var w = d.error, y = typeof Symbol == "function" && Symbol.toStringTag && r[Symbol.toStringTag] || r.constructor.name || "Object";
92
92
  return w.call(
93
- u,
93
+ d,
94
94
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
95
95
  y
96
96
  ), l(r);
97
97
  }
98
98
  }
99
- function c(r) {
99
+ function o(r) {
100
100
  if (r === _) return "<>";
101
101
  if (typeof r == "object" && r !== null && r.$$typeof === ue)
102
102
  return "<...>";
103
103
  try {
104
- var u = e(r);
105
- return u ? "<" + u + ">" : "<...>";
104
+ var d = e(r);
105
+ return d ? "<" + d + ">" : "<...>";
106
106
  } catch {
107
107
  return "<...>";
108
108
  }
109
109
  }
110
110
  function p() {
111
- var r = I.A;
111
+ var r = L.A;
112
112
  return r === null ? null : r.getOwner();
113
113
  }
114
114
  function m() {
@@ -116,16 +116,16 @@ function zt() {
116
116
  }
117
117
  function S(r) {
118
118
  if (Z.call(r, "key")) {
119
- var u = Object.getOwnPropertyDescriptor(r, "key").get;
120
- if (u && u.isReactWarning) return !1;
119
+ var d = Object.getOwnPropertyDescriptor(r, "key").get;
120
+ if (d && d.isReactWarning) return !1;
121
121
  }
122
122
  return r.key !== void 0;
123
123
  }
124
- function b(r, u) {
124
+ function b(r, d) {
125
125
  function w() {
126
- F || (F = !0, console.error(
126
+ V || (V = !0, console.error(
127
127
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
128
- u
128
+ d
129
129
  ));
130
130
  }
131
131
  w.isReactWarning = !0, Object.defineProperty(r, "key", {
@@ -133,23 +133,23 @@ function zt() {
133
133
  configurable: !0
134
134
  });
135
135
  }
136
- function V() {
136
+ function F() {
137
137
  var r = e(this.type);
138
138
  return D[r] || (D[r] = !0, console.error(
139
139
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
140
140
  )), r = this.props.ref, r !== void 0 ? r : null;
141
141
  }
142
- function N(r, u, w, y, Q, ee) {
142
+ function N(r, d, w, y, Q, ee) {
143
143
  var E = w.ref;
144
144
  return r = {
145
145
  $$typeof: C,
146
146
  type: r,
147
- key: u,
147
+ key: d,
148
148
  props: w,
149
149
  _owner: y
150
150
  }, (E !== void 0 ? E : null) !== null ? Object.defineProperty(r, "ref", {
151
151
  enumerable: !1,
152
- get: V
152
+ get: F
153
153
  }) : Object.defineProperty(r, "ref", { enumerable: !1, value: null }), r._store = {}, Object.defineProperty(r._store, "validated", {
154
154
  configurable: !1,
155
155
  enumerable: !1,
@@ -172,25 +172,25 @@ function zt() {
172
172
  value: ee
173
173
  }), Object.freeze && (Object.freeze(r.props), Object.freeze(r)), r;
174
174
  }
175
- function j(r, u, w, y, Q, ee) {
176
- var E = u.children;
175
+ function j(r, d, w, y, Q, ee) {
176
+ var E = d.children;
177
177
  if (E !== void 0)
178
178
  if (y)
179
- if (K(E)) {
179
+ if (J(E)) {
180
180
  for (y = 0; y < E.length; y++)
181
- i(E[y]);
181
+ a(E[y]);
182
182
  Object.freeze && Object.freeze(E);
183
183
  } else
184
184
  console.error(
185
185
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
186
186
  );
187
- else i(E);
188
- if (Z.call(u, "key")) {
187
+ else a(E);
188
+ if (Z.call(d, "key")) {
189
189
  E = e(r);
190
- var q = Object.keys(u).filter(function(xe) {
190
+ var G = Object.keys(d).filter(function(xe) {
191
191
  return xe !== "key";
192
192
  });
193
- y = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", x[E + y] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
193
+ y = 0 < G.length ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}", x[E + y] || (G = 0 < G.length ? "{" + G.join(": ..., ") + ": ...}" : "{}", console.error(
194
194
  `A props object containing a "key" prop is being spread into JSX:
195
195
  let props = %s;
196
196
  <%s {...props} />
@@ -199,15 +199,15 @@ React keys must be passed directly to JSX without using spread:
199
199
  <%s key={someKey} {...props} />`,
200
200
  y,
201
201
  E,
202
- q,
202
+ G,
203
203
  E
204
204
  ), x[E + y] = !0);
205
205
  }
206
- if (E = null, w !== void 0 && (f(w), E = "" + w), S(u) && (f(u.key), E = "" + u.key), "key" in u) {
206
+ if (E = null, w !== void 0 && (f(w), E = "" + w), S(d) && (f(d.key), E = "" + d.key), "key" in d) {
207
207
  w = {};
208
- for (var ae in u)
209
- ae !== "key" && (w[ae] = u[ae]);
210
- } else w = u;
208
+ for (var ae in d)
209
+ ae !== "key" && (w[ae] = d[ae]);
210
+ } else w = d;
211
211
  return E && b(
212
212
  w,
213
213
  typeof r == "function" ? r.displayName || r.name || "Unknown" : r
@@ -220,13 +220,13 @@ React keys must be passed directly to JSX without using spread:
220
220
  ee
221
221
  );
222
222
  }
223
- function i(r) {
223
+ function a(r) {
224
224
  h(r) ? r._store && (r._store.validated = 1) : typeof r == "object" && r !== null && r.$$typeof === ue && (r._payload.status === "fulfilled" ? h(r._payload.value) && r._payload.value._store && (r._payload.value._store.validated = 1) : r._store && (r._store.validated = 1));
225
225
  }
226
226
  function h(r) {
227
227
  return typeof r == "object" && r !== null && r.$$typeof === C;
228
228
  }
229
- var v = Ue, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), R = /* @__PURE__ */ Symbol.for("react.strict_mode"), o = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.consumer"), P = /* @__PURE__ */ Symbol.for("react.context"), X = /* @__PURE__ */ Symbol.for("react.forward_ref"), ge = /* @__PURE__ */ Symbol.for("react.suspense"), de = /* @__PURE__ */ Symbol.for("react.suspense_list"), $ = /* @__PURE__ */ Symbol.for("react.memo"), ue = /* @__PURE__ */ Symbol.for("react.lazy"), U = /* @__PURE__ */ Symbol.for("react.activity"), Se = /* @__PURE__ */ Symbol.for("react.client.reference"), I = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, K = Array.isArray, ne = console.createTask ? console.createTask : function() {
229
+ var v = Ue, C = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), s = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.consumer"), P = /* @__PURE__ */ Symbol.for("react.context"), X = /* @__PURE__ */ Symbol.for("react.forward_ref"), ge = /* @__PURE__ */ Symbol.for("react.suspense"), de = /* @__PURE__ */ Symbol.for("react.suspense_list"), I = /* @__PURE__ */ Symbol.for("react.memo"), ue = /* @__PURE__ */ Symbol.for("react.lazy"), U = /* @__PURE__ */ Symbol.for("react.activity"), Se = /* @__PURE__ */ Symbol.for("react.client.reference"), L = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, J = Array.isArray, ne = console.createTask ? console.createTask : function() {
230
230
  return null;
231
231
  };
232
232
  v = {
@@ -234,29 +234,29 @@ React keys must be passed directly to JSX without using spread:
234
234
  return r();
235
235
  }
236
236
  };
237
- var F, D = {}, le = v.react_stack_bottom_frame.bind(
237
+ var V, D = {}, le = v.react_stack_bottom_frame.bind(
238
238
  v,
239
239
  m
240
- )(), fe = ne(c(m)), x = {};
241
- oe.Fragment = _, oe.jsx = function(r, u, w) {
242
- var y = 1e4 > I.recentlyCreatedOwnerStacks++;
240
+ )(), fe = ne(o(m)), x = {};
241
+ oe.Fragment = _, oe.jsx = function(r, d, w) {
242
+ var y = 1e4 > L.recentlyCreatedOwnerStacks++;
243
243
  return j(
244
244
  r,
245
- u,
245
+ d,
246
246
  w,
247
247
  !1,
248
248
  y ? Error("react-stack-top-frame") : le,
249
- y ? ne(c(r)) : fe
249
+ y ? ne(o(r)) : fe
250
250
  );
251
- }, oe.jsxs = function(r, u, w) {
252
- var y = 1e4 > I.recentlyCreatedOwnerStacks++;
251
+ }, oe.jsxs = function(r, d, w) {
252
+ var y = 1e4 > L.recentlyCreatedOwnerStacks++;
253
253
  return j(
254
254
  r,
255
- u,
255
+ d,
256
256
  w,
257
257
  !0,
258
258
  y ? Error("react-stack-top-frame") : le,
259
- y ? ne(c(r)) : fe
259
+ y ? ne(o(r)) : fe
260
260
  );
261
261
  };
262
262
  })()), oe;
@@ -267,47 +267,47 @@ function Mt() {
267
267
  }
268
268
  var t = Mt();
269
269
  function Xe(e) {
270
- var l, f, c = "";
271
- if (typeof e == "string" || typeof e == "number") c += e;
270
+ var l, f, o = "";
271
+ if (typeof e == "string" || typeof e == "number") o += e;
272
272
  else if (typeof e == "object") if (Array.isArray(e)) {
273
273
  var p = e.length;
274
- for (l = 0; l < p; l++) e[l] && (f = Xe(e[l])) && (c && (c += " "), c += f);
275
- } else for (f in e) e[f] && (c && (c += " "), c += f);
276
- return c;
274
+ for (l = 0; l < p; l++) e[l] && (f = Xe(e[l])) && (o && (o += " "), o += f);
275
+ } else for (f in e) e[f] && (o && (o += " "), o += f);
276
+ return o;
277
277
  }
278
278
  function Ut() {
279
- for (var e, l, f = 0, c = "", p = arguments.length; f < p; f++) (e = arguments[f]) && (l = Xe(e)) && (c && (c += " "), c += l);
280
- return c;
279
+ for (var e, l, f = 0, o = "", p = arguments.length; f < p; f++) (e = arguments[f]) && (l = Xe(e)) && (o && (o += " "), o += l);
280
+ return o;
281
281
  }
282
282
  const Ie = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Le = Ut, re = (e, l) => (f) => {
283
- var c;
283
+ var o;
284
284
  if (l?.variants == null) return Le(e, f?.class, f?.className);
285
285
  const { variants: p, defaultVariants: m } = l, S = Object.keys(p).map((N) => {
286
- const j = f?.[N], i = m?.[N];
286
+ const j = f?.[N], a = m?.[N];
287
287
  if (j === null) return null;
288
- const h = Ie(j) || Ie(i);
288
+ const h = Ie(j) || Ie(a);
289
289
  return p[N][h];
290
290
  }), b = f && Object.entries(f).reduce((N, j) => {
291
- let [i, h] = j;
292
- return h === void 0 || (N[i] = h), N;
293
- }, {}), V = l == null || (c = l.compoundVariants) === null || c === void 0 ? void 0 : c.reduce((N, j) => {
294
- let { class: i, className: h, ...v } = j;
291
+ let [a, h] = j;
292
+ return h === void 0 || (N[a] = h), N;
293
+ }, {}), F = l == null || (o = l.compoundVariants) === null || o === void 0 ? void 0 : o.reduce((N, j) => {
294
+ let { class: a, className: h, ...v } = j;
295
295
  return Object.entries(v).every((C) => {
296
- let [s, _] = C;
296
+ let [i, _] = C;
297
297
  return Array.isArray(_) ? _.includes({
298
298
  ...m,
299
299
  ...b
300
- }[s]) : {
300
+ }[i]) : {
301
301
  ...m,
302
302
  ...b
303
- }[s] === _;
303
+ }[i] === _;
304
304
  }) ? [
305
305
  ...N,
306
- i,
306
+ a,
307
307
  h
308
308
  ] : N;
309
309
  }, []);
310
- return Le(e, S, V, f?.class, f?.className);
310
+ return Le(e, S, F, f?.class, f?.className);
311
311
  }, Yt = {
312
312
  list: "List",
313
313
  detail: "Detail",
@@ -317,13 +317,13 @@ const Ie = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Le = Ut, r
317
317
  timeline: "Timeline",
318
318
  map: "Map"
319
319
  }, Bt = {
320
- list: At,
320
+ list: Ot,
321
321
  detail: kt,
322
322
  grid: Rt,
323
323
  kanban: Tt,
324
324
  calendar: _t,
325
325
  timeline: Et,
326
- map: Vt
326
+ map: Ft
327
327
  }, Wt = re("flex gap-4", {
328
328
  variants: {
329
329
  position: {
@@ -367,16 +367,16 @@ const Ie = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Le = Ut, r
367
367
  orientation: "horizontal"
368
368
  }
369
369
  });
370
- function Ht(e) {
370
+ function Jt(e) {
371
371
  return e.split("-").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join("");
372
372
  }
373
- const Jt = {
373
+ const Ht = {
374
374
  Home: "House"
375
375
  };
376
376
  function Xt(e) {
377
377
  if (!e) return null;
378
- const l = Ht(e), f = Jt[l] || l;
379
- return Ot[f] || null;
378
+ const l = Jt(e), f = Ht[l] || l;
379
+ return At[f] || null;
380
380
  }
381
381
  function je(e) {
382
382
  return e.label ? e.label : Yt[e.type] || e.type;
@@ -391,77 +391,77 @@ const Ze = ({
391
391
  schema: e,
392
392
  className: l,
393
393
  onViewChange: f,
394
- ...c
394
+ ...o
395
395
  }) => {
396
- const p = T.useMemo(() => e.storageKey ? e.storageKey : `view-switcher${e.id ? `-${e.id}` : ""}`, [e.id, e.storageKey]), [m, S] = T.useState(() => Zt(e));
397
- T.useEffect(() => {
396
+ const p = R.useMemo(() => e.storageKey ? e.storageKey : `view-switcher${e.id ? `-${e.id}` : ""}`, [e.id, e.storageKey]), [m, S] = R.useState(() => Zt(e));
397
+ R.useEffect(() => {
398
398
  if (e.activeView) {
399
399
  S(e.activeView);
400
400
  return;
401
401
  }
402
402
  if (e.persistPreference)
403
403
  try {
404
- const o = localStorage.getItem(p);
405
- if (o) {
406
- const g = e.views.find((P) => P.type === o)?.type;
404
+ const s = localStorage.getItem(p);
405
+ if (s) {
406
+ const g = e.views.find((P) => P.type === s)?.type;
407
407
  g && S(g);
408
408
  }
409
409
  } catch {
410
410
  }
411
- }, [e.activeView, e.persistPreference, e.views, p]), T.useEffect(() => {
411
+ }, [e.activeView, e.persistPreference, e.views, p]), R.useEffect(() => {
412
412
  if (!(!e.persistPreference || !m || e.activeView))
413
413
  try {
414
414
  localStorage.setItem(p, m);
415
415
  } catch {
416
416
  }
417
417
  }, [m, e.activeView, e.persistPreference, p]);
418
- const b = T.useCallback((o) => {
419
- f?.(o), e.onViewChange && typeof window < "u" && window.dispatchEvent(
418
+ const b = R.useCallback((s) => {
419
+ f?.(s), e.onViewChange && typeof window < "u" && window.dispatchEvent(
420
420
  new CustomEvent(e.onViewChange, {
421
- detail: { view: o }
421
+ detail: { view: s }
422
422
  })
423
423
  );
424
- }, [f, e.onViewChange]), V = T.useCallback((o) => {
425
- S(o), b(o);
426
- }, [b]), N = m || e.views?.[0]?.type, j = N || "", i = e.views.find((o) => o.type === N) || e.views?.[0], h = e.variant || "tabs", v = e.position || "top", C = v === "left" || v === "right", s = C ? "vertical" : "horizontal", _ = /* @__PURE__ */ t.jsxs("div", { className: A(qt({ orientation: s })), children: [
427
- h === "dropdown" && /* @__PURE__ */ t.jsxs(be, { value: j, onValueChange: (o) => V(o), children: [
424
+ }, [f, e.onViewChange]), F = R.useCallback((s) => {
425
+ S(s), b(s);
426
+ }, [b]), N = m || e.views?.[0]?.type, j = N || "", a = e.views.find((s) => s.type === N) || e.views?.[0], h = e.variant || "tabs", v = e.position || "top", C = v === "left" || v === "right", i = C ? "vertical" : "horizontal", _ = /* @__PURE__ */ t.jsxs("div", { className: A(qt({ orientation: i })), children: [
427
+ h === "dropdown" && /* @__PURE__ */ t.jsxs(be, { value: j, onValueChange: (s) => F(s), children: [
428
428
  /* @__PURE__ */ t.jsx(we, { className: A("w-full", C ? "h-10" : "h-9"), children: /* @__PURE__ */ t.jsx(ve, { placeholder: "Select view" }) }),
429
- /* @__PURE__ */ t.jsx(ye, { children: e.views.map((o, g) => /* @__PURE__ */ t.jsx(ce, { value: o.type, children: je(o) }, `${o.type}-${g}`)) })
429
+ /* @__PURE__ */ t.jsx(ye, { children: e.views.map((s, g) => /* @__PURE__ */ t.jsx(ce, { value: s.type, children: je(s) }, `${s.type}-${g}`)) })
430
430
  ] }),
431
- h === "buttons" && /* @__PURE__ */ t.jsx("div", { className: A(Gt({ orientation: s })), children: e.views.map((o, g) => {
432
- const P = o.type === N, X = ze(o);
431
+ h === "buttons" && /* @__PURE__ */ t.jsx("div", { className: A(Gt({ orientation: i })), children: e.views.map((s, g) => {
432
+ const P = s.type === N, X = ze(s);
433
433
  return /* @__PURE__ */ t.jsxs(
434
- G,
434
+ K,
435
435
  {
436
436
  type: "button",
437
437
  size: "sm",
438
438
  variant: P ? "secondary" : "ghost",
439
439
  className: A("justify-start gap-2", C ? "w-full" : ""),
440
- onClick: () => V(o.type),
440
+ onClick: () => F(s.type),
441
441
  children: [
442
442
  X ? /* @__PURE__ */ t.jsx(X, { className: "h-4 w-4" }) : null,
443
- /* @__PURE__ */ t.jsx("span", { children: je(o) })
443
+ /* @__PURE__ */ t.jsx("span", { children: je(s) })
444
444
  ]
445
445
  },
446
- `${o.type}-${g}`
446
+ `${s.type}-${g}`
447
447
  );
448
448
  }) }),
449
- h === "tabs" && /* @__PURE__ */ t.jsx(Ye, { value: j, onValueChange: (o) => V(o), children: /* @__PURE__ */ t.jsx(Be, { className: A(Kt({ orientation: s })), children: e.views.map((o, g) => {
450
- const P = ze(o);
449
+ h === "tabs" && /* @__PURE__ */ t.jsx(Ye, { value: j, onValueChange: (s) => F(s), children: /* @__PURE__ */ t.jsx(Be, { className: A(Kt({ orientation: i })), children: e.views.map((s, g) => {
450
+ const P = ze(s);
451
451
  return /* @__PURE__ */ t.jsxs(
452
452
  We,
453
453
  {
454
- value: o.type,
454
+ value: s.type,
455
455
  className: A("gap-2", C ? "justify-start" : ""),
456
456
  children: [
457
457
  P ? /* @__PURE__ */ t.jsx(P, { className: "h-4 w-4" }) : null,
458
- /* @__PURE__ */ t.jsx("span", { children: je(o) })
458
+ /* @__PURE__ */ t.jsx("span", { children: je(s) })
459
459
  ]
460
460
  },
461
- `${o.type}-${g}`
461
+ `${s.type}-${g}`
462
462
  );
463
463
  }) }) })
464
- ] }), R = i?.schema ? Array.isArray(i.schema) ? /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: i.schema.map((o, g) => /* @__PURE__ */ t.jsx(Oe, { schema: o, ...c }, `${i.type}-${g}`)) }) : /* @__PURE__ */ t.jsx(Oe, { schema: i.schema, ...c }) : null;
464
+ ] }), k = a?.schema ? Array.isArray(a.schema) ? /* @__PURE__ */ t.jsx("div", { className: "space-y-4", children: a.schema.map((s, g) => /* @__PURE__ */ t.jsx(Ae, { schema: s, ...o }, `${a.type}-${g}`)) }) : /* @__PURE__ */ t.jsx(Ae, { schema: a.schema, ...o }) : null;
465
465
  return /* @__PURE__ */ t.jsxs(
466
466
  "div",
467
467
  {
@@ -471,7 +471,7 @@ const Ze = ({
471
471
  ),
472
472
  children: [
473
473
  /* @__PURE__ */ t.jsx("div", { className: A("shrink-0", C ? "flex flex-col" : "flex"), children: _ }),
474
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: R })
474
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: k })
475
475
  ]
476
476
  }
477
477
  );
@@ -485,46 +485,46 @@ const Qt = ({
485
485
  schema: e,
486
486
  dataSource: l,
487
487
  className: f,
488
- views: c,
488
+ views: o,
489
489
  activeViewId: p,
490
490
  onViewChange: m,
491
491
  onRowClick: S,
492
492
  onEdit: b,
493
- renderListView: V,
493
+ renderListView: F,
494
494
  toolbarAddon: N
495
495
  }) => {
496
- const [j, i] = B(null), [h, v] = B(!1), [C, s] = B("create"), [_, R] = B(null), [o, g] = B(0), [P, X] = B([]), [ge, de] = B(!1), [$, ue] = B({}), [U, Se] = B([]), I = e.listViews, Z = I != null && Object.keys(I).length > 0, [K, ne] = B(() => e.defaultListView && I?.[e.defaultListView] ? e.defaultListView : I && Object.keys(I)[0] || ""), F = W(() => !Z || !K ? null : I[K] || null, [Z, K, I]), D = W(() => c && c.length > 0 ? c : null, [c]), le = D != null && D.length > 0, fe = p || D?.[0]?.id, x = D?.find((n) => n.id === fe) || D?.[0], r = W(() => F?.type ? F.type : x?.type ? x.type : e.defaultViewType || "grid", [F, x, e.defaultViewType]), u = e.navigation;
496
+ const [j, a] = W(null), [h, v] = W(!1), [C, i] = W("create"), [_, k] = W(null), [s, g] = W(0), [P, X] = W([]), [ge, de] = W(!1), [I, ue] = W({}), [U, Se] = W([]), L = e.listViews, Z = L != null && Object.keys(L).length > 0, [J, ne] = W(() => e.defaultListView && L?.[e.defaultListView] ? e.defaultListView : L && Object.keys(L)[0] || ""), V = q(() => !Z || !J ? null : L[J] || null, [Z, J, L]), D = q(() => o && o.length > 0 ? o : null, [o]), le = D != null && D.length > 0, fe = p || D?.[0]?.id, x = D?.find((n) => n.id === fe) || D?.[0], r = q(() => V?.type ? V.type : x?.type ? x.type : e.defaultViewType || "grid", [V, x, e.defaultViewType]), d = e.navigation;
497
497
  Re(() => {
498
498
  let n = !0;
499
- const d = async () => {
499
+ const c = async () => {
500
500
  try {
501
- const a = await l.getObjectSchema(e.objectName);
502
- n && i(a);
503
- } catch (a) {
504
- console.error("Failed to fetch object schema:", a);
501
+ const u = await l.getObjectSchema(e.objectName);
502
+ n && a(u);
503
+ } catch (u) {
504
+ console.error("Failed to fetch object schema:", u);
505
505
  }
506
506
  };
507
- return e.objectName && l && d(), () => {
507
+ return e.objectName && l && c(), () => {
508
508
  n = !1;
509
509
  };
510
510
  }, [e.objectName, l]), Re(() => {
511
511
  let n = !0;
512
512
  return (async () => {
513
- if (!(r === "grid" && !V) && !(!l || !e.objectName)) {
513
+ if (!(r === "grid" && !F) && !(!l || !e.objectName)) {
514
514
  de(!0);
515
515
  try {
516
- const a = F?.filter || x?.filter || e.table?.defaultFilters || [], M = Object.entries($).filter(([, L]) => L !== void 0 && L !== "" && L !== null).map(([L, J]) => [L, "=", J]);
516
+ const u = V?.filter || x?.filter || e.table?.defaultFilters || [], $ = Object.entries(I).filter(([, z]) => z !== void 0 && z !== "" && z !== null).map(([z, H]) => [z, "=", H]);
517
517
  let O = [];
518
- a.length > 0 && M.length > 0 ? O = ["and", ...a, ...M] : M.length === 1 ? O = M[0] : M.length > 1 ? O = ["and", ...M] : O = a;
519
- const H = U.length > 0 ? U.map((L) => ({ field: L.field, order: L.direction })) : F?.sort || x?.sort || e.table?.defaultSort || void 0, k = await l.find(e.objectName, {
518
+ u.length > 0 && $.length > 0 ? O = ["and", ...u, ...$] : $.length === 1 ? O = $[0] : $.length > 1 ? O = ["and", ...$] : O = u;
519
+ const Y = U.length > 0 ? U.map((z) => ({ field: z.field, order: z.direction })) : V?.sort || x?.sort || e.table?.defaultSort || void 0, T = await l.find(e.objectName, {
520
520
  $filter: O.length > 0 ? O : void 0,
521
- $orderby: H,
521
+ $orderby: Y,
522
522
  $top: 100
523
523
  });
524
- let Y = [];
525
- Array.isArray(k) ? Y = k : k && typeof k == "object" && (Array.isArray(k.data) ? Y = k.data : Array.isArray(k.records) && (Y = k.records)), n && X(Y);
526
- } catch (a) {
527
- console.error("ObjectView data fetch error:", a);
524
+ let B = [];
525
+ Array.isArray(T) ? B = T : T && typeof T == "object" && (Array.isArray(T.data) ? B = T.data : Array.isArray(T.records) && (B = T.records)), n && X(B);
526
+ } catch (u) {
527
+ console.error("ObjectView data fetch error:", u);
528
528
  } finally {
529
529
  n && de(!1);
530
530
  }
@@ -532,71 +532,71 @@ const Qt = ({
532
532
  })(), () => {
533
533
  n = !1;
534
534
  };
535
- }, [e.objectName, l, r, $, U, o, F, x, V]);
535
+ }, [e.objectName, l, r, I, U, s, V, x, F]);
536
536
  const w = e.layout || "drawer", y = e.operations || e.table?.operations || {
537
537
  create: !0,
538
538
  read: !0,
539
539
  update: !0,
540
540
  delete: !0
541
- }, Q = z(() => {
542
- w === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (s("create"), R(null), v(!0));
543
- }, [w, e]), ee = z((n) => {
541
+ }, Q = M(() => {
542
+ w === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (i("create"), k(null), v(!0));
543
+ }, [w, e]), ee = M((n) => {
544
544
  if (b) {
545
545
  b(n);
546
546
  return;
547
547
  }
548
548
  if (w === "page" && e.onNavigate) {
549
- const d = n._id || n.id;
550
- e.onNavigate(d, "edit");
549
+ const c = n._id || n.id;
550
+ e.onNavigate(c, "edit");
551
551
  } else
552
- s("edit"), R(n), v(!0);
553
- }, [w, e, b]), E = z((n) => {
552
+ i("edit"), k(n), v(!0);
553
+ }, [w, e, b]), E = M((n) => {
554
554
  if (w === "page" && e.onNavigate) {
555
- const d = n._id || n.id;
556
- e.onNavigate(d, "view");
555
+ const c = n._id || n.id;
556
+ e.onNavigate(c, "view");
557
557
  } else
558
- s("view"), R(n), v(!0);
559
- }, [w, e]), q = z((n) => {
558
+ i("view"), k(n), v(!0);
559
+ }, [w, e]), G = M((n) => {
560
560
  if (S) {
561
561
  S(n);
562
562
  return;
563
563
  }
564
- if (u) {
565
- if (u.mode === "none" || u.preventNavigation)
564
+ if (d) {
565
+ if (d.mode === "none" || d.preventNavigation)
566
566
  return;
567
- if (u.mode === "new_window" || u.openNewTab) {
568
- const d = n._id || n.id, a = `/${e.objectName}/${d}`;
569
- window.open(a, "_blank");
567
+ if (d.mode === "new_window" || d.openNewTab) {
568
+ const c = n._id || n.id, u = `/${e.objectName}/${c}`;
569
+ window.open(u, "_blank");
570
570
  return;
571
571
  }
572
- if (u.mode === "drawer") {
573
- s("view"), R(n), v(!0);
572
+ if (d.mode === "drawer") {
573
+ i("view"), k(n), v(!0);
574
574
  return;
575
575
  }
576
- if (u.mode === "modal") {
577
- s("view"), R(n), v(!0);
576
+ if (d.mode === "modal") {
577
+ i("view"), k(n), v(!0);
578
578
  return;
579
579
  }
580
- if (u.mode === "page") {
581
- const d = n._id || n.id;
582
- e.onNavigate && e.onNavigate(d, "view");
580
+ if (d.mode === "page") {
581
+ const c = n._id || n.id;
582
+ e.onNavigate && e.onNavigate(c, "view");
583
583
  return;
584
584
  }
585
585
  }
586
586
  y.read !== !1 && E(n);
587
- }, [S, u, y.read, E, e]), ae = z((n) => {
588
- g((d) => d + 1);
589
- }, []), xe = z((n) => {
590
- g((d) => d + 1);
591
- }, []), tt = z(() => {
592
- v(!1), R(null), g((n) => n + 1);
593
- }, []), rt = z(() => {
594
- v(!1), R(null);
587
+ }, [S, d, y.read, E, e]), ae = M((n) => {
588
+ g((c) => c + 1);
589
+ }, []), xe = M((n) => {
590
+ g((c) => c + 1);
591
+ }, []), tt = M(() => {
592
+ v(!1), k(null), g((n) => n + 1);
593
+ }, []), rt = M(() => {
594
+ v(!1), k(null);
595
595
  }, []);
596
- z(() => {
596
+ M(() => {
597
597
  g((n) => n + 1);
598
598
  }, []);
599
- const Fe = W(() => !le || !D || D.length <= 1 ? null : {
599
+ const Ve = q(() => !le || !D || D.length <= 1 ? null : {
600
600
  type: "view-switcher",
601
601
  variant: "tabs",
602
602
  position: "top",
@@ -605,7 +605,7 @@ const Qt = ({
605
605
  defaultView: x?.type || "grid",
606
606
  activeView: x?.type || "grid",
607
607
  views: D.map((n) => {
608
- const d = {
608
+ const c = {
609
609
  kanban: "kanban",
610
610
  calendar: "calendar",
611
611
  map: "map",
@@ -619,131 +619,151 @@ const Qt = ({
619
619
  return {
620
620
  type: n.type,
621
621
  label: n.label,
622
- icon: d[n.type] || "table"
622
+ icon: c[n.type] || "table"
623
623
  };
624
624
  })
625
- }, [le, D, x, e.objectName]), nt = z((n) => {
625
+ }, [le, D, x, e.objectName]), nt = M((n) => {
626
626
  if (!D) return;
627
- const d = D.find((a) => a.type === n);
628
- d && m && m(d.id);
629
- }, [D, m]), lt = z((n) => {
627
+ const c = D.find((u) => u.type === n);
628
+ c && m && m(c.id);
629
+ }, [D, m]), lt = M((n) => {
630
630
  ne(n);
631
631
  }, []);
632
- W(() => {
632
+ q(() => {
633
633
  if (e.showFilters === !1) return null;
634
- const n = e.filterableFields, d = j?.fields || {}, M = (n ? n.map((O) => [O, d[O] || { label: O }]) : Object.entries(d).filter(([, O]) => !O.hidden).slice(0, 8)).map(([O, H]) => {
635
- const k = H.type || "text";
636
- let Y = "text", L;
637
- return k === "number" || k === "currency" || k === "percent" ? Y = "number" : k === "boolean" || k === "toggle" ? Y = "boolean" : k === "date" || k === "datetime" ? Y = "date" : (k === "select" || H.options) && (Y = "select", L = (H.options || []).map(
638
- (J) => typeof J == "string" ? { label: J, value: J } : { label: J.label, value: J.value }
634
+ const n = e.filterableFields, c = j?.fields || {}, $ = (n ? n.map((O) => [O, c[O] || { label: O }]) : Object.entries(c).filter(([, O]) => !O.hidden).slice(0, 8)).map(([O, Y]) => {
635
+ const T = Y.type || "text";
636
+ let B = "text", z;
637
+ return T === "number" || T === "currency" || T === "percent" ? B = "number" : T === "boolean" || T === "toggle" ? B = "boolean" : T === "date" || T === "datetime" ? B = "date" : (T === "select" || Y.options) && (B = "select", z = (Y.options || []).map(
638
+ (H) => typeof H == "string" ? { label: H, value: H } : { label: H.label, value: H.value }
639
639
  )), {
640
640
  field: O,
641
- label: H.label || O,
642
- type: Y,
643
- placeholder: `Filter ${H.label || O}...`,
644
- ...L ? { options: L } : {}
641
+ label: Y.label || O,
642
+ type: B,
643
+ placeholder: `Filter ${Y.label || O}...`,
644
+ ...z ? { options: z } : {}
645
645
  };
646
646
  });
647
- return M.length === 0 ? null : {
647
+ return $.length === 0 ? null : {
648
648
  type: "filter-ui",
649
649
  layout: "popover",
650
650
  showClear: !0,
651
651
  showApply: !0,
652
- filters: M,
653
- values: $
652
+ filters: $,
653
+ values: I
654
654
  };
655
- }, [e.showFilters, e.filterableFields, j, $]), W(() => {
656
- const n = j?.fields || {}, d = Object.entries(n).filter(([, a]) => !a.hidden).slice(0, 10).map(([a, M]) => ({ field: a, label: M.label || a }));
657
- return d.length === 0 ? null : {
655
+ }, [e.showFilters, e.filterableFields, j, I]), q(() => {
656
+ const n = j?.fields || {}, c = Object.entries(n).filter(([, u]) => !u.hidden).slice(0, 10).map(([u, $]) => ({ field: u, label: $.label || u }));
657
+ return c.length === 0 ? null : {
658
658
  type: "sort-ui",
659
659
  variant: "dropdown",
660
660
  multiple: !1,
661
- fields: d,
661
+ fields: c,
662
662
  sort: U
663
663
  };
664
664
  }, [j, U]);
665
- const at = z((n) => {
666
- const d = {
665
+ const at = M((n) => {
666
+ const c = {
667
667
  objectName: e.objectName,
668
- fields: F?.columns || x?.columns || e.table?.fields,
668
+ fields: V?.columns || x?.columns || e.table?.fields,
669
669
  className: "h-full w-full",
670
670
  showSearch: !1
671
- }, a = F?.options || x || {};
671
+ }, u = V?.options || x || {};
672
+ if (process.env.NODE_ENV === "development") {
673
+ const $ = [
674
+ "startDateField",
675
+ "endDateField",
676
+ "dateField",
677
+ "groupBy",
678
+ "groupField",
679
+ "locationField",
680
+ "imageField",
681
+ "dependenciesField",
682
+ "progressField",
683
+ "titleField",
684
+ "subtitleField",
685
+ "latitudeField",
686
+ "longitudeField"
687
+ ], O = u[n] || {}, Y = $.filter((T) => T in u && !(T in O));
688
+ Y.length > 0 && console.warn(
689
+ `[Spec Compliance] View options use flat properties ${JSON.stringify(Y)}. Move them under options.${n} per @objectstack/spec protocol.`
690
+ );
691
+ }
672
692
  switch (n) {
673
693
  case "kanban":
674
694
  return {
675
695
  type: "object-kanban",
676
- ...d,
677
- groupBy: a.kanban?.groupField || a.groupBy || a.groupField || "status",
678
- groupField: a.kanban?.groupField || a.groupField || "status",
679
- titleField: a.kanban?.titleField || a.titleField || "name",
680
- cardFields: d.fields || [],
681
- ...a.kanban || {}
696
+ ...c,
697
+ groupBy: u.kanban?.groupField || "status",
698
+ groupField: u.kanban?.groupField || "status",
699
+ titleField: u.kanban?.titleField || "name",
700
+ cardFields: c.fields || [],
701
+ ...u.kanban || {}
682
702
  };
683
703
  case "calendar":
684
704
  return {
685
705
  type: "object-calendar",
686
- ...d,
687
- startDateField: a.calendar?.startDateField || a.startDateField || "start_date",
688
- endDateField: a.calendar?.endDateField || a.endDateField || "end_date",
689
- titleField: a.calendar?.titleField || a.titleField || "name",
690
- ...a.calendar || {}
706
+ ...c,
707
+ startDateField: u.calendar?.startDateField || "start_date",
708
+ endDateField: u.calendar?.endDateField || "end_date",
709
+ titleField: u.calendar?.titleField || "name",
710
+ ...u.calendar || {}
691
711
  };
692
712
  case "gallery":
693
713
  return {
694
714
  type: "object-gallery",
695
- ...d,
696
- imageField: a.gallery?.imageField || a.imageField,
697
- titleField: a.gallery?.titleField || a.titleField || "name",
698
- subtitleField: a.gallery?.subtitleField || a.subtitleField,
699
- ...a.gallery || {}
715
+ ...c,
716
+ imageField: u.gallery?.imageField,
717
+ titleField: u.gallery?.titleField || "name",
718
+ subtitleField: u.gallery?.subtitleField,
719
+ ...u.gallery || {}
700
720
  };
701
721
  case "timeline":
702
722
  return {
703
723
  type: "object-timeline",
704
- ...d,
705
- dateField: a.timeline?.dateField || a.dateField || "created_at",
706
- titleField: a.timeline?.titleField || a.titleField || "name",
707
- ...a.timeline || {}
724
+ ...c,
725
+ dateField: u.timeline?.dateField || "created_at",
726
+ titleField: u.timeline?.titleField || "name",
727
+ ...u.timeline || {}
708
728
  };
709
729
  case "gantt":
710
730
  return {
711
731
  type: "object-gantt",
712
- ...d,
713
- startDateField: a.gantt?.startDateField || a.startDateField || "start_date",
714
- endDateField: a.gantt?.endDateField || a.endDateField || "end_date",
715
- progressField: a.gantt?.progressField || a.progressField || "progress",
716
- dependenciesField: a.gantt?.dependenciesField || a.dependenciesField || "dependencies",
717
- ...a.gantt || {}
732
+ ...c,
733
+ startDateField: u.gantt?.startDateField || "start_date",
734
+ endDateField: u.gantt?.endDateField || "end_date",
735
+ progressField: u.gantt?.progressField || "progress",
736
+ dependenciesField: u.gantt?.dependenciesField || "dependencies",
737
+ ...u.gantt || {}
718
738
  };
719
739
  case "map":
720
740
  return {
721
741
  type: "object-map",
722
- ...d,
723
- locationField: a.map?.locationField || a.locationField || "location",
724
- ...a.map || {}
742
+ ...c,
743
+ locationField: u.map?.locationField || "location",
744
+ ...u.map || {}
725
745
  };
726
746
  default:
727
747
  return null;
728
748
  }
729
- }, [e.objectName, e.table?.fields, F, x]), it = W(() => ({
749
+ }, [e.objectName, e.table?.fields, V, x]), it = q(() => ({
730
750
  type: "object-grid",
731
751
  objectName: e.objectName,
732
752
  title: e.table?.title,
733
753
  description: e.table?.description,
734
- fields: F?.columns || x?.columns || e.table?.fields,
735
- columns: F?.columns || x?.columns || e.table?.columns,
754
+ fields: V?.columns || x?.columns || e.table?.fields,
755
+ columns: V?.columns || x?.columns || e.table?.columns,
736
756
  operations: {
737
757
  ...y,
738
758
  create: !1
739
759
  // Create is handled by the view's create button
740
760
  },
741
- defaultFilters: F?.filter || x?.filter || e.table?.defaultFilters,
742
- defaultSort: F?.sort || x?.sort || e.table?.defaultSort,
761
+ defaultFilters: V?.filter || x?.filter || e.table?.defaultFilters,
762
+ defaultSort: V?.sort || x?.sort || e.table?.defaultSort,
743
763
  pageSize: e.table?.pageSize,
744
764
  selectable: e.table?.selectable,
745
765
  className: e.table?.className
746
- }), [e, y, F, x]), Ve = () => {
766
+ }), [e, y, V, x]), Fe = () => {
747
767
  const n = _ ? _._id || _.id : void 0;
748
768
  return {
749
769
  type: "object-form",
@@ -781,48 +801,48 @@ const Qt = ({
781
801
  default:
782
802
  return n;
783
803
  }
784
- }, _e = W(() => {
785
- const n = u?.width;
804
+ }, _e = q(() => {
805
+ const n = d?.width;
786
806
  return n ? typeof n == "number" ? `max-w-[${n}px]` : `max-w-[${n}]` : "";
787
- }, [u]), st = () => /* @__PURE__ */ t.jsx(qe, { open: h, onOpenChange: v, direction: "right", children: /* @__PURE__ */ t.jsxs(Ge, { className: A("w-full sm:max-w-2xl", _e), children: [
807
+ }, [d]), st = () => /* @__PURE__ */ t.jsx(qe, { open: h, onOpenChange: v, direction: "right", children: /* @__PURE__ */ t.jsxs(Ge, { className: A("w-full sm:max-w-2xl", _e), children: [
788
808
  /* @__PURE__ */ t.jsxs(Ke, { children: [
789
- /* @__PURE__ */ t.jsx(He, { children: Ee() }),
790
- e.form?.description && /* @__PURE__ */ t.jsx(Je, { children: e.form.description })
809
+ /* @__PURE__ */ t.jsx(Je, { children: Ee() }),
810
+ e.form?.description && /* @__PURE__ */ t.jsx(He, { children: e.form.description })
791
811
  ] }),
792
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: /* @__PURE__ */ t.jsx(ke, { schema: Ve(), dataSource: l }) })
812
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: /* @__PURE__ */ t.jsx(ke, { schema: Fe(), dataSource: l }) })
793
813
  ] }) }), ot = () => /* @__PURE__ */ t.jsx(wt, { open: h, onOpenChange: v, children: /* @__PURE__ */ t.jsxs(vt, { className: A("max-w-2xl max-h-[90vh] overflow-y-auto", _e), children: [
794
814
  /* @__PURE__ */ t.jsxs(yt, { children: [
795
815
  /* @__PURE__ */ t.jsx(gt, { children: Ee() }),
796
816
  e.form?.description && /* @__PURE__ */ t.jsx(xt, { children: e.form.description })
797
817
  ] }),
798
- /* @__PURE__ */ t.jsx(ke, { schema: Ve(), dataSource: l })
799
- ] }) }), ct = W(() => Object.keys($).some(
800
- (d) => $[d] !== void 0 && $[d] !== "" && $[d] !== null
801
- ) ? Object.entries($).filter(([, d]) => d !== void 0 && d !== "" && d !== null).map(([d, a]) => ({ field: d, operator: "equals", value: a })) : F?.filter || x?.filter || e.table?.defaultFilters, [$, F, x, e.table?.defaultFilters]), dt = W(() => U.length > 0 ? U : F?.sort || x?.sort || e.table?.defaultSort, [U, F, x, e.table?.defaultSort]), ut = () => {
802
- const n = `${e.objectName}-${K || x?.id || "default"}-${r}-${o}`;
803
- if (V)
804
- return V({
818
+ /* @__PURE__ */ t.jsx(ke, { schema: Fe(), dataSource: l })
819
+ ] }) }), ct = q(() => Object.keys(I).some(
820
+ (c) => I[c] !== void 0 && I[c] !== "" && I[c] !== null
821
+ ) ? Object.entries(I).filter(([, c]) => c !== void 0 && c !== "" && c !== null).map(([c, u]) => ({ field: c, operator: "equals", value: u })) : V?.filter || x?.filter || e.table?.defaultFilters, [I, V, x, e.table?.defaultFilters]), dt = q(() => U.length > 0 ? U : V?.sort || x?.sort || e.table?.defaultSort, [U, V, x, e.table?.defaultSort]), ut = () => {
822
+ const n = `${e.objectName}-${J || x?.id || "default"}-${r}-${s}`;
823
+ if (F)
824
+ return F({
805
825
  schema: {
806
826
  type: "list-view",
807
827
  objectName: e.objectName,
808
828
  viewType: r,
809
- fields: F?.columns || x?.columns || e.table?.fields,
829
+ fields: V?.columns || x?.columns || e.table?.fields,
810
830
  filters: ct,
811
831
  sort: dt,
812
- options: F?.options || x
832
+ options: V?.options || x
813
833
  },
814
834
  dataSource: l,
815
835
  onEdit: ee,
816
- onRowClick: q,
836
+ onRowClick: G,
817
837
  className: "h-full"
818
838
  });
819
839
  if (r !== "grid") {
820
- const d = at(r);
821
- if (d && me)
840
+ const c = at(r);
841
+ if (c && me)
822
842
  return /* @__PURE__ */ t.jsx(
823
843
  me,
824
844
  {
825
- schema: d,
845
+ schema: c,
826
846
  dataSource: l,
827
847
  data: P,
828
848
  loading: ge
@@ -841,7 +861,7 @@ const Qt = ({
841
861
  {
842
862
  schema: it,
843
863
  dataSource: l,
844
- onRowClick: q,
864
+ onRowClick: G,
845
865
  onEdit: y.update !== !1 ? ee : void 0,
846
866
  onDelete: y.delete !== !1 ? ae : void 0,
847
867
  onBulkDelete: y.delete !== !1 ? xe : void 0
@@ -850,31 +870,31 @@ const Qt = ({
850
870
  );
851
871
  }, ft = () => {
852
872
  if (!Z) return null;
853
- const n = Object.entries(I);
854
- return n.length <= 1 ? null : /* @__PURE__ */ t.jsx(Ye, { value: K, onValueChange: lt, className: "w-full", children: /* @__PURE__ */ t.jsx(Be, { className: "w-auto", children: n.map(([d, a]) => /* @__PURE__ */ t.jsx(We, { value: d, className: "text-sm", children: a.label || d }, d)) }) });
873
+ const n = Object.entries(L);
874
+ return n.length <= 1 ? null : /* @__PURE__ */ t.jsx(Ye, { value: J, onValueChange: lt, className: "w-full", children: /* @__PURE__ */ t.jsx(Be, { className: "w-auto", children: n.map(([c, u]) => /* @__PURE__ */ t.jsx(We, { value: c, className: "text-sm", children: u.label || c }, c)) }) });
855
875
  }, pt = () => {
856
- const n = e.showCreate !== !1 && y.create !== !1, d = e.showViewSwitcher === !0, a = ft();
857
- return !a && !d && !n && !N ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-3", children: [
858
- a,
859
- (d || n || N) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
860
- /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-2", children: d && Fe && /* @__PURE__ */ t.jsx(
876
+ const n = e.showCreate !== !1 && y.create !== !1, c = e.showViewSwitcher === !0, u = ft();
877
+ return !u && !c && !n && !N ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-3", children: [
878
+ u,
879
+ (c || n || N) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
880
+ /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-2", children: c && Ve && /* @__PURE__ */ t.jsx(
861
881
  Ze,
862
882
  {
863
- schema: Fe,
883
+ schema: Ve,
864
884
  onViewChange: nt,
865
885
  className: "overflow-x-auto"
866
886
  }
867
887
  ) }),
868
888
  /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
869
889
  N,
870
- n && /* @__PURE__ */ t.jsxs(G, { size: "sm", onClick: Q, children: [
890
+ n && /* @__PURE__ */ t.jsxs(K, { size: "sm", onClick: Q, children: [
871
891
  /* @__PURE__ */ t.jsx(Dt, { className: "h-4 w-4" }),
872
892
  "Create"
873
893
  ] })
874
894
  ] })
875
895
  ] })
876
896
  ] });
877
- }, Te = u?.mode === "modal" ? "modal" : u?.mode === "drawer" ? "drawer" : w;
897
+ }, Te = d?.mode === "modal" ? "modal" : d?.mode === "drawer" ? "drawer" : w;
878
898
  return /* @__PURE__ */ t.jsxs("div", { className: A("flex flex-col h-full", f), children: [
879
899
  (e.title || e.description) && /* @__PURE__ */ t.jsxs("div", { className: "mb-4 shrink-0", children: [
880
900
  e.title && /* @__PURE__ */ t.jsx("h2", { className: "text-2xl font-bold tracking-tight", children: e.title }),
@@ -901,41 +921,41 @@ const Qt = ({
901
921
  className: l,
902
922
  onChange: f
903
923
  }) => {
904
- const [c, p] = T.useState(e.values || {}), [m, S] = T.useState(!1);
905
- T.useEffect(() => {
924
+ const [o, p] = R.useState(e.values || {}), [m, S] = R.useState(!1);
925
+ R.useEffect(() => {
906
926
  e.values && p(e.values);
907
927
  }, [e.values]);
908
- const b = T.useCallback((s) => {
909
- f?.(s), e.onChange && typeof window < "u" && window.dispatchEvent(
928
+ const b = R.useCallback((i) => {
929
+ f?.(i), e.onChange && typeof window < "u" && window.dispatchEvent(
910
930
  new CustomEvent(e.onChange, {
911
- detail: { values: s }
931
+ detail: { values: i }
912
932
  })
913
933
  );
914
- }, [f, e.onChange]), V = T.useCallback((s, _) => {
915
- const R = { ...c, [s]: _ };
916
- p(R), e.showApply || b(R);
917
- }, [b, e.showApply, c]), N = T.useCallback(() => {
918
- const s = {};
919
- if (p(s), e.showApply) {
920
- b(s);
934
+ }, [f, e.onChange]), F = R.useCallback((i, _) => {
935
+ const k = { ...o, [i]: _ };
936
+ p(k), e.showApply || b(k);
937
+ }, [b, e.showApply, o]), N = R.useCallback(() => {
938
+ const i = {};
939
+ if (p(i), e.showApply) {
940
+ b(i);
921
941
  return;
922
942
  }
923
- b(s);
924
- }, [b, e.showApply]), j = T.useCallback(() => {
925
- b(c), S(!1);
926
- }, [b, c]), i = T.useMemo(() => Object.values(c).filter((s) => !er(s)).length, [c]), h = (s) => {
927
- const _ = s.label || s.field, R = s.placeholder || `Filter by ${_}`;
928
- switch (s.type) {
943
+ b(i);
944
+ }, [b, e.showApply]), j = R.useCallback(() => {
945
+ b(o), S(!1);
946
+ }, [b, o]), a = R.useMemo(() => Object.values(o).filter((i) => !er(i)).length, [o]), h = (i) => {
947
+ const _ = i.label || i.field, k = i.placeholder || `Filter by ${_}`;
948
+ switch (i.type) {
929
949
  case "number":
930
950
  return /* @__PURE__ */ t.jsx(
931
951
  ie,
932
952
  {
933
953
  type: "number",
934
- value: c[s.field] ?? "",
935
- placeholder: R,
936
- onChange: (o) => {
937
- const g = o.target.value, P = g === "" ? "" : Number(g);
938
- V(s.field, P);
954
+ value: o[i.field] ?? "",
955
+ placeholder: k,
956
+ onChange: (s) => {
957
+ const g = s.target.value, P = g === "" ? "" : Number(g);
958
+ F(i.field, P);
939
959
  }
940
960
  }
941
961
  );
@@ -943,14 +963,14 @@ const Qt = ({
943
963
  return /* @__PURE__ */ t.jsxs(
944
964
  be,
945
965
  {
946
- value: c[s.field] !== void 0 ? String(c[s.field]) : "",
947
- onValueChange: (o) => {
948
- const g = s.options?.find((P) => String(P.value) === o);
949
- V(s.field, g ? g.value : o);
966
+ value: o[i.field] !== void 0 ? String(o[i.field]) : "",
967
+ onValueChange: (s) => {
968
+ const g = i.options?.find((P) => String(P.value) === s);
969
+ F(i.field, g ? g.value : s);
950
970
  },
951
971
  children: [
952
- /* @__PURE__ */ t.jsx(we, { children: /* @__PURE__ */ t.jsx(ve, { placeholder: R }) }),
953
- /* @__PURE__ */ t.jsx(ye, { children: s.options?.map((o) => /* @__PURE__ */ t.jsx(ce, { value: String(o.value), children: o.label }, String(o.value))) })
972
+ /* @__PURE__ */ t.jsx(we, { children: /* @__PURE__ */ t.jsx(ve, { placeholder: k }) }),
973
+ /* @__PURE__ */ t.jsx(ye, { children: i.options?.map((s) => /* @__PURE__ */ t.jsx(ce, { value: String(s.value), children: s.label }, String(s.value))) })
954
974
  ]
955
975
  }
956
976
  );
@@ -959,20 +979,20 @@ const Qt = ({
959
979
  ie,
960
980
  {
961
981
  type: "date",
962
- value: c[s.field] ?? "",
963
- onChange: (o) => V(s.field, o.target.value)
982
+ value: o[i.field] ?? "",
983
+ onChange: (s) => F(i.field, s.target.value)
964
984
  }
965
985
  );
966
986
  case "date-range": {
967
- const o = tr(c[s.field]);
987
+ const s = tr(o[i.field]);
968
988
  return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
969
989
  /* @__PURE__ */ t.jsx(
970
990
  ie,
971
991
  {
972
992
  type: "date",
973
- value: o.start ?? "",
993
+ value: s.start ?? "",
974
994
  onChange: (g) => {
975
- V(s.field, { ...o, start: g.target.value });
995
+ F(i.field, { ...s, start: g.target.value });
976
996
  }
977
997
  }
978
998
  ),
@@ -980,9 +1000,9 @@ const Qt = ({
980
1000
  ie,
981
1001
  {
982
1002
  type: "date",
983
- value: o.end ?? "",
1003
+ value: s.end ?? "",
984
1004
  onChange: (g) => {
985
- V(s.field, { ...o, end: g.target.value });
1005
+ F(i.field, { ...s, end: g.target.value });
986
1006
  }
987
1007
  }
988
1008
  )
@@ -993,8 +1013,8 @@ const Qt = ({
993
1013
  /* @__PURE__ */ t.jsx(
994
1014
  St,
995
1015
  {
996
- checked: !!c[s.field],
997
- onCheckedChange: (o) => V(s.field, !!o)
1016
+ checked: !!o[i.field],
1017
+ onCheckedChange: (s) => F(i.field, !!s)
998
1018
  }
999
1019
  ),
1000
1020
  /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: "Enabled" })
@@ -1003,45 +1023,45 @@ const Qt = ({
1003
1023
  return /* @__PURE__ */ t.jsx(
1004
1024
  ie,
1005
1025
  {
1006
- value: c[s.field] ?? "",
1007
- placeholder: R,
1008
- onChange: (o) => V(s.field, o.target.value)
1026
+ value: o[i.field] ?? "",
1027
+ placeholder: k,
1028
+ onChange: (s) => F(i.field, s.target.value)
1009
1029
  }
1010
1030
  );
1011
1031
  }
1012
1032
  }, v = /* @__PURE__ */ t.jsxs("div", { className: "space-y-4", children: [
1013
- /* @__PURE__ */ t.jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: e.filters.map((s) => /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1014
- /* @__PURE__ */ t.jsx(jt, { className: "text-xs text-muted-foreground", children: s.label || s.field }),
1015
- h(s)
1016
- ] }, s.field)) }),
1033
+ /* @__PURE__ */ t.jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: e.filters.map((i) => /* @__PURE__ */ t.jsxs("div", { className: "space-y-2", children: [
1034
+ /* @__PURE__ */ t.jsx(jt, { className: "text-xs text-muted-foreground", children: i.label || i.field }),
1035
+ h(i)
1036
+ ] }, i.field)) }),
1017
1037
  (e.showApply || e.showClear) && /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-end gap-2 border-t pt-3", children: [
1018
- e.showClear && /* @__PURE__ */ t.jsx(G, { type: "button", variant: "ghost", size: "sm", onClick: N, children: "Clear" }),
1019
- e.showApply && /* @__PURE__ */ t.jsx(G, { type: "button", size: "sm", onClick: j, children: "Apply" })
1038
+ e.showClear && /* @__PURE__ */ t.jsx(K, { type: "button", variant: "ghost", size: "sm", onClick: N, children: "Clear" }),
1039
+ e.showApply && /* @__PURE__ */ t.jsx(K, { type: "button", size: "sm", onClick: j, children: "Apply" })
1020
1040
  ] })
1021
1041
  ] }), C = e.layout || "inline";
1022
1042
  return C === "popover" ? /* @__PURE__ */ t.jsx("div", { className: A(he({ layout: C }), l), children: /* @__PURE__ */ t.jsxs(ht, { open: m, onOpenChange: S, children: [
1023
- /* @__PURE__ */ t.jsx(Nt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(G, { type: "button", variant: i > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", children: [
1024
- /* @__PURE__ */ t.jsx(Ae, { className: "h-4 w-4" }),
1043
+ /* @__PURE__ */ t.jsx(Nt, { asChild: !0, children: /* @__PURE__ */ t.jsxs(K, { type: "button", variant: a > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", children: [
1044
+ /* @__PURE__ */ t.jsx(Oe, { className: "h-4 w-4" }),
1025
1045
  "Filters",
1026
- i > 0 && /* @__PURE__ */ t.jsx("span", { 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", children: i })
1046
+ a > 0 && /* @__PURE__ */ t.jsx("span", { 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", children: a })
1027
1047
  ] }) }),
1028
1048
  /* @__PURE__ */ t.jsx(Ct, { align: "start", className: "w-[520px] p-4", children: v })
1029
1049
  ] }) }) : C === "drawer" ? /* @__PURE__ */ t.jsxs("div", { className: A(he({ layout: C }), l), children: [
1030
- /* @__PURE__ */ t.jsxs(G, { type: "button", variant: i > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", onClick: () => S(!0), children: [
1031
- /* @__PURE__ */ t.jsx(Ae, { className: "h-4 w-4" }),
1050
+ /* @__PURE__ */ t.jsxs(K, { type: "button", variant: a > 0 ? "secondary" : "outline", size: "sm", className: "gap-2", onClick: () => S(!0), children: [
1051
+ /* @__PURE__ */ t.jsx(Oe, { className: "h-4 w-4" }),
1032
1052
  "Filters",
1033
- i > 0 && /* @__PURE__ */ t.jsx("span", { 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", children: i })
1053
+ a > 0 && /* @__PURE__ */ t.jsx("span", { 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", children: a })
1034
1054
  ] }),
1035
1055
  /* @__PURE__ */ t.jsx(qe, { open: m, onOpenChange: S, children: /* @__PURE__ */ t.jsxs(Ge, { children: [
1036
1056
  /* @__PURE__ */ t.jsxs(Ke, { children: [
1037
- /* @__PURE__ */ t.jsx(He, { children: "Filters" }),
1038
- /* @__PURE__ */ t.jsx(Je, { children: "Refine the data with advanced filters." })
1057
+ /* @__PURE__ */ t.jsx(Je, { children: "Filters" }),
1058
+ /* @__PURE__ */ t.jsx(He, { children: "Refine the data with advanced filters." })
1039
1059
  ] }),
1040
1060
  /* @__PURE__ */ t.jsx("div", { className: "px-4 pb-6", children: v })
1041
1061
  ] }) })
1042
1062
  ] }) : /* @__PURE__ */ t.jsxs("div", { className: A(he({ layout: C }), l), children: [
1043
1063
  v,
1044
- !e.showApply && e.showClear && /* @__PURE__ */ t.jsxs(G, { type: "button", variant: "ghost", size: "sm", className: "gap-2", onClick: N, children: [
1064
+ !e.showApply && e.showClear && /* @__PURE__ */ t.jsxs(K, { type: "button", variant: "ghost", size: "sm", className: "gap-2", onClick: N, children: [
1045
1065
  /* @__PURE__ */ t.jsx(Pt, { className: "h-3.5 w-3.5" }),
1046
1066
  "Clear filters"
1047
1067
  ] })
@@ -1072,80 +1092,80 @@ const Qt = ({
1072
1092
  className: l,
1073
1093
  onChange: f
1074
1094
  }) => {
1075
- const [c, p] = T.useState(() => Ce(e.sort)), [m, S] = T.useState(() => Me(Ce(e.sort)));
1076
- T.useEffect(() => {
1077
- const i = Ce(e.sort);
1078
- p(i), S(Me(i));
1095
+ const [o, p] = R.useState(() => Ce(e.sort)), [m, S] = R.useState(() => Me(Ce(e.sort)));
1096
+ R.useEffect(() => {
1097
+ const a = Ce(e.sort);
1098
+ p(a), S(Me(a));
1079
1099
  }, [e.sort]);
1080
- const b = T.useCallback((i) => {
1081
- p(i), f?.(i), e.onChange && typeof window < "u" && window.dispatchEvent(
1100
+ const b = R.useCallback((a) => {
1101
+ p(a), f?.(a), e.onChange && typeof window < "u" && window.dispatchEvent(
1082
1102
  new CustomEvent(e.onChange, {
1083
- detail: { sort: i }
1103
+ detail: { sort: a }
1084
1104
  })
1085
1105
  );
1086
- }, [f, e.onChange]), V = T.useCallback((i) => {
1087
- const h = c.find((s) => s.field === i), v = !!e.multiple;
1106
+ }, [f, e.onChange]), F = R.useCallback((a) => {
1107
+ const h = o.find((i) => i.field === a), v = !!e.multiple;
1088
1108
  if (!h) {
1089
- const s = v ? [...c, { field: i, direction: "asc" }] : [{ field: i, direction: "asc" }];
1090
- b(s);
1109
+ const i = v ? [...o, { field: a, direction: "asc" }] : [{ field: a, direction: "asc" }];
1110
+ b(i);
1091
1111
  return;
1092
1112
  }
1093
1113
  if (h.direction === "asc") {
1094
- const s = c.map(
1095
- (_) => _.field === i ? { ..._, direction: "desc" } : _
1114
+ const i = o.map(
1115
+ (_) => _.field === a ? { ..._, direction: "desc" } : _
1096
1116
  );
1097
- b(s);
1117
+ b(i);
1098
1118
  return;
1099
1119
  }
1100
- const C = c.filter((s) => s.field !== i);
1120
+ const C = o.filter((i) => i.field !== a);
1101
1121
  b(C);
1102
- }, [b, e.multiple, c]);
1122
+ }, [b, e.multiple, o]);
1103
1123
  if ((e.variant || "dropdown") === "buttons")
1104
- return /* @__PURE__ */ t.jsx("div", { className: A(Ne({ variant: "buttons" }), l), children: e.fields.map((i) => {
1105
- const h = c.find((C) => C.field === i.field), v = h?.direction === "asc" ? $t : It;
1124
+ return /* @__PURE__ */ t.jsx("div", { className: A(Ne({ variant: "buttons" }), l), children: e.fields.map((a) => {
1125
+ const h = o.find((C) => C.field === a.field), v = h?.direction === "asc" ? $t : It;
1106
1126
  return /* @__PURE__ */ t.jsxs(
1107
- G,
1127
+ K,
1108
1128
  {
1109
1129
  type: "button",
1110
1130
  variant: h ? "secondary" : "outline",
1111
1131
  size: "sm",
1112
- onClick: () => V(i.field),
1132
+ onClick: () => F(a.field),
1113
1133
  className: "gap-2",
1114
1134
  children: [
1115
- /* @__PURE__ */ t.jsx("span", { children: i.label || i.field }),
1135
+ /* @__PURE__ */ t.jsx("span", { children: a.label || a.field }),
1116
1136
  h && /* @__PURE__ */ t.jsx(v, { className: "h-3.5 w-3.5" })
1117
1137
  ]
1118
1138
  },
1119
- i.field
1139
+ a.field
1120
1140
  );
1121
1141
  }) });
1122
1142
  if (e.multiple)
1123
1143
  return /* @__PURE__ */ t.jsx("div", { className: A(Ne({ variant: "builder" }), l), children: /* @__PURE__ */ t.jsx(
1124
- Ft,
1144
+ Vt,
1125
1145
  {
1126
- fields: e.fields.map((i) => ({ value: i.field, label: i.label || i.field })),
1146
+ fields: e.fields.map((a) => ({ value: a.field, label: a.label || a.field })),
1127
1147
  value: m,
1128
- onChange: (i) => {
1129
- S(i), b(nr(i));
1148
+ onChange: (a) => {
1149
+ S(a), b(nr(a));
1130
1150
  }
1131
1151
  }
1132
1152
  ) });
1133
- const j = c[0];
1153
+ const j = o[0];
1134
1154
  return /* @__PURE__ */ t.jsxs("div", { className: A(Ne({ variant: "dropdown" }), l), children: [
1135
1155
  /* @__PURE__ */ t.jsxs(
1136
1156
  be,
1137
1157
  {
1138
1158
  value: j?.field || "",
1139
- onValueChange: (i) => {
1140
- if (!i) {
1159
+ onValueChange: (a) => {
1160
+ if (!a) {
1141
1161
  b([]);
1142
1162
  return;
1143
1163
  }
1144
- b([{ field: i, direction: j?.direction || "asc" }]);
1164
+ b([{ field: a, direction: j?.direction || "asc" }]);
1145
1165
  },
1146
1166
  children: [
1147
1167
  /* @__PURE__ */ t.jsx(we, { className: "w-56", children: /* @__PURE__ */ t.jsx(ve, { placeholder: "Select field" }) }),
1148
- /* @__PURE__ */ t.jsx(ye, { children: e.fields.map((i) => /* @__PURE__ */ t.jsx(ce, { value: i.field, children: i.label || i.field }, i.field)) })
1168
+ /* @__PURE__ */ t.jsx(ye, { children: e.fields.map((a) => /* @__PURE__ */ t.jsx(ce, { value: a.field, children: a.label || a.field }, a.field)) })
1149
1169
  ]
1150
1170
  }
1151
1171
  ),
@@ -1153,8 +1173,8 @@ const Qt = ({
1153
1173
  be,
1154
1174
  {
1155
1175
  value: j?.direction || "asc",
1156
- onValueChange: (i) => {
1157
- j?.field && b([{ field: j.field, direction: i }]);
1176
+ onValueChange: (a) => {
1177
+ j?.field && b([{ field: j.field, direction: a }]);
1158
1178
  },
1159
1179
  children: [
1160
1180
  /* @__PURE__ */ t.jsx(we, { className: "w-36", children: /* @__PURE__ */ t.jsx(ve, {}) }),
@@ -1288,7 +1308,7 @@ te.register("sort-ui", lr, {
1288
1308
  sort: [{ field: "name", direction: "asc" }]
1289
1309
  }
1290
1310
  });
1291
- const ir = ({ schema: e, className: l, children: f, dataSource: c, ...p }) => {
1311
+ const ir = ({ schema: e, className: l, children: f, dataSource: o, ...p }) => {
1292
1312
  const m = e.props?.columns ? { display: "grid", gridTemplateColumns: `repeat(${e.props.columns}, 1fr)`, gap: "1rem" } : void 0;
1293
1313
  return /* @__PURE__ */ t.jsx(
1294
1314
  "div",