@object-ui/plugin-view 3.3.2 → 4.0.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.
package/dist/index.js CHANGED
@@ -4,42 +4,42 @@ import { ComponentRegistry as c, buildExpandFields as l } from "@object-ui/core"
4
4
  import { SchemaRenderer as u, SchemaRendererContext as d } from "@object-ui/react";
5
5
  import { ObjectGrid as f } from "@object-ui/plugin-grid";
6
6
  import { ObjectForm as p } from "@object-ui/plugin-form";
7
- import { Badge as m, Button as h, Checkbox as g, ConfigRow as _, ContextMenu as v, ContextMenuContent as y, ContextMenuItem as b, ContextMenuSeparator as x, ContextMenuSub as ee, ContextMenuSubContent as te, ContextMenuSubTrigger as S, ContextMenuTrigger as C, Dialog as ne, DialogContent as re, DialogDescription as w, DialogHeader as ie, DialogTitle as ae, Drawer as oe, DrawerContent as se, DrawerDescription as ce, DrawerHeader as le, DrawerTitle as ue, DropdownMenu as de, DropdownMenuContent as T, DropdownMenuItem as E, DropdownMenuTrigger as D, FilterBuilder as O, Input as k, Label as fe, NavigationOverlay as pe, Popover as me, PopoverContent as he, PopoverTrigger as ge, Select as A, SelectContent as j, SelectItem as M, SelectTrigger as N, SelectValue as P, SortBuilder as F, Switch as I, Tabs as _e, TabsList as ve, TabsTrigger as ye, Tooltip as be, TooltipContent as L, TooltipProvider as R, TooltipTrigger as xe, cn as z } from "@object-ui/components";
8
- import { Activity as B, ArrowDown as V, ArrowUp as H, Calendar as U, Check as W, Copy as G, Eye as Se, EyeOff as Ce, FileText as we, GanttChartSquare as Te, Globe as Ee, Grid as De, GripVertical as K, Images as q, LayoutGrid as Oe, List as ke, Lock as Ae, Map as je, MoreHorizontal as Me, Pencil as Ne, Pin as J, PinOff as Pe, Plus as Fe, Save as Ie, Settings as Le, Settings2 as Re, Share2 as ze, SlidersHorizontal as Be, Star as Ve, Table as He, Trash2 as Ue, X as We, icons as Ge } from "lucide-react";
9
- import { DndContext as Ke, KeyboardSensor as qe, PointerSensor as Je, closestCenter as Ye, useSensor as Xe, useSensors as Ze } from "@dnd-kit/core";
10
- import { SortableContext as Qe, arrayMove as $e, horizontalListSortingStrategy as et, useSortable as tt, verticalListSortingStrategy as nt } from "@dnd-kit/sortable";
11
- import { CSS as rt } from "@dnd-kit/utilities";
7
+ import { Badge as m, Button as h, Checkbox as g, ConfigRow as _, ContextMenu as v, ContextMenuContent as ee, ContextMenuItem as y, ContextMenuSeparator as b, ContextMenuSub as te, ContextMenuSubContent as x, ContextMenuSubTrigger as S, ContextMenuTrigger as C, Dialog as w, DialogContent as T, DialogDescription as E, DialogFooter as D, DialogHeader as ne, DialogTitle as re, Drawer as O, DrawerContent as ie, DrawerDescription as ae, DrawerHeader as oe, DrawerTitle as se, DropdownMenu as k, DropdownMenuContent as A, DropdownMenuItem as j, DropdownMenuSeparator as M, DropdownMenuSub as ce, DropdownMenuSubContent as le, DropdownMenuSubTrigger as ue, DropdownMenuTrigger as de, FilterBuilder as fe, GroupingEditor as N, Input as P, Label as F, NavigationOverlay as pe, Popover as me, PopoverContent as I, PopoverTrigger as he, Select as L, SelectContent as R, SelectItem as z, SelectTrigger as B, SelectValue as V, SortBuilder as ge, Switch as H, Tabs as _e, TabsList as ve, TabsTrigger as ye, Tooltip as U, TooltipContent as W, TooltipProvider as G, TooltipTrigger as K, cn as q } from "@object-ui/components";
8
+ import { Activity as J, ArrowDown as be, ArrowUp as xe, Calendar as Se, Check as Ce, ChevronDown as we, Copy as Te, Eye as Y, EyeOff as Ee, FileText as De, GanttChartSquare as Oe, Globe as ke, Grid as Ae, GripVertical as je, Images as Me, LayoutGrid as Ne, List as Pe, ListOrdered as Fe, Lock as Ie, Map as Le, MoreHorizontal as Re, Pencil as ze, Pin as Be, PinOff as Ve, Plus as He, Save as Ue, Search as We, Settings as Ge, Settings2 as Ke, Share2 as qe, SlidersHorizontal as Je, Star as Ye, Table as Xe, Trash2 as Ze, X as Qe, icons as $e } from "lucide-react";
9
+ import { DndContext as et, KeyboardSensor as tt, PointerSensor as nt, closestCenter as rt, useSensor as it, useSensors as at } from "@dnd-kit/core";
10
+ import { SortableContext as ot, arrayMove as st, horizontalListSortingStrategy as ct, sortableKeyboardCoordinates as lt, useSortable as ut, verticalListSortingStrategy as dt } from "@dnd-kit/sortable";
11
+ import { CSS as ft } from "@dnd-kit/utilities";
12
12
  //#region \0rolldown/runtime.js
13
- var it = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
13
+ var pt = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports);
14
14
  //#endregion
15
15
  //#region ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
16
- function at(e) {
16
+ function mt(e) {
17
17
  var t, n, r = "";
18
18
  if (typeof e == "string" || typeof e == "number") r += e;
19
19
  else if (typeof e == "object") if (Array.isArray(e)) {
20
20
  var i = e.length;
21
- for (t = 0; t < i; t++) e[t] && (n = at(e[t])) && (r && (r += " "), r += n);
21
+ for (t = 0; t < i; t++) e[t] && (n = mt(e[t])) && (r && (r += " "), r += n);
22
22
  } else for (n in e) e[n] && (r && (r += " "), r += n);
23
23
  return r;
24
24
  }
25
- function ot() {
26
- for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = at(e)) && (r && (r += " "), r += t);
25
+ function ht() {
26
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = mt(e)) && (r && (r += " "), r += t);
27
27
  return r;
28
28
  }
29
29
  //#endregion
30
30
  //#region ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
31
- var st = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ct = ot, Y = (e, t) => (n) => {
32
- if (t?.variants == null) return ct(e, n?.class, n?.className);
31
+ var gt = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, _t = ht, vt = (e, t) => (n) => {
32
+ if (t?.variants == null) return _t(e, n?.class, n?.className);
33
33
  let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
34
34
  let t = n?.[e], a = i?.[e];
35
35
  if (t === null) return null;
36
- let o = st(t) || st(a);
36
+ let o = gt(t) || gt(a);
37
37
  return r[e][o];
38
38
  }), o = n && Object.entries(n).reduce((e, t) => {
39
39
  let [n, r] = t;
40
40
  return r === void 0 || (e[n] = r), e;
41
41
  }, {});
42
- return ct(e, a, t?.compoundVariants?.reduce((e, t) => {
42
+ return _t(e, a, t?.compoundVariants?.reduce((e, t) => {
43
43
  let { class: n, className: r, ...a } = t;
44
44
  return Object.entries(a).every((e) => {
45
45
  let [t, n] = e;
@@ -56,7 +56,7 @@ var st = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ct = ot, Y =
56
56
  r
57
57
  ] : e;
58
58
  }, []), n?.class, n?.className);
59
- }, lt = /* @__PURE__ */ it(((e) => {
59
+ }, yt = /* @__PURE__ */ pt(((e) => {
60
60
  var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
61
61
  function r(e, n, r) {
62
62
  var i = null;
@@ -71,9 +71,9 @@ var st = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ct = ot, Y =
71
71
  };
72
72
  }
73
73
  e.Fragment = n, e.jsx = r, e.jsxs = r;
74
- })), X = (/* @__PURE__ */ it(((e, t) => {
75
- t.exports = lt();
76
- })))(), ut = {
74
+ })), X = (/* @__PURE__ */ pt(((e, t) => {
75
+ t.exports = yt();
76
+ })))(), bt = {
77
77
  list: "List",
78
78
  detail: "Detail",
79
79
  grid: "Grid",
@@ -83,17 +83,17 @@ var st = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ct = ot, Y =
83
83
  map: "Map",
84
84
  gallery: "Gallery",
85
85
  gantt: "Gantt"
86
- }, dt = {
87
- list: ke,
88
- detail: we,
89
- grid: De,
90
- kanban: Oe,
91
- calendar: U,
92
- timeline: B,
93
- map: je,
94
- gallery: q,
95
- gantt: Te
96
- }, ft = Y("flex gap-4", {
86
+ }, xt = {
87
+ list: Pe,
88
+ detail: De,
89
+ grid: Ae,
90
+ kanban: Ne,
91
+ calendar: Se,
92
+ timeline: J,
93
+ map: Le,
94
+ gallery: Me,
95
+ gantt: Oe
96
+ }, St = vt("flex gap-4", {
97
97
  variants: { position: {
98
98
  top: "flex-col",
99
99
  bottom: "flex-col-reverse",
@@ -101,55 +101,55 @@ var st = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, ct = ot, Y =
101
101
  right: "flex-row-reverse"
102
102
  } },
103
103
  defaultVariants: { position: "top" }
104
- }), pt = Y("w-full", {
104
+ }), Ct = vt("w-full", {
105
105
  variants: { orientation: {
106
106
  horizontal: "w-full",
107
107
  vertical: "w-48"
108
108
  } },
109
109
  defaultVariants: { orientation: "horizontal" }
110
- }), mt = Y("flex gap-2", {
110
+ }), wt = vt("flex gap-2", {
111
111
  variants: { orientation: {
112
112
  horizontal: "flex-row flex-wrap",
113
113
  vertical: "flex-col"
114
114
  } },
115
115
  defaultVariants: { orientation: "horizontal" }
116
- }), ht = Y("", {
116
+ }), Tt = vt("", {
117
117
  variants: { orientation: {
118
118
  horizontal: "",
119
119
  vertical: "flex h-auto flex-col items-stretch"
120
120
  } },
121
121
  defaultVariants: { orientation: "horizontal" }
122
122
  });
123
- function gt(e) {
123
+ function Et(e) {
124
124
  return e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
125
125
  }
126
- var _t = { Home: "House" };
127
- function vt(e) {
126
+ var Dt = { Home: "House" };
127
+ function Ot(e) {
128
128
  if (!e) return null;
129
- let t = gt(e);
130
- return Ge[_t[t] || t] || null;
129
+ let t = Et(e);
130
+ return $e[Dt[t] || t] || null;
131
131
  }
132
- function yt(e) {
133
- return e.label ? e.label : ut[e.type] || e.type;
132
+ function kt(e) {
133
+ return e.label ? e.label : bt[e.type] || e.type;
134
134
  }
135
- function bt(e) {
136
- return e.icon ? vt(e.icon) : dt[e.type] || null;
135
+ function At(e) {
136
+ return e.icon ? Ot(e.icon) : xt[e.type] || null;
137
137
  }
138
- function xt(e) {
138
+ function jt(e) {
139
139
  return e.activeView ? e.activeView : e.defaultView ? e.defaultView : e.views?.[0]?.type;
140
140
  }
141
- var St = {
142
- share: ze,
143
- settings: Le,
144
- duplicate: G,
145
- delete: Ue
146
- }, Ct = {
141
+ var Mt = {
142
+ share: qe,
143
+ settings: Ge,
144
+ duplicate: Te,
145
+ delete: Ze
146
+ }, Nt = {
147
147
  share: "Share",
148
148
  settings: "Settings",
149
149
  duplicate: "Duplicate",
150
150
  delete: "Delete"
151
- }, wt = ({ schema: t, className: n, onViewChange: r, onCreateView: i, onViewAction: a, createViewLabel: o = "Create view", ...s }) => {
152
- let c = e.useMemo(() => t.storageKey ? t.storageKey : `view-switcher${t.id ? `-${t.id}` : ""}`, [t.id, t.storageKey]), [l, d] = e.useState(() => xt(t));
151
+ }, Pt = ({ schema: t, className: n, onViewChange: r, onCreateView: i, onViewAction: a, createViewLabel: o = "Create view", ...s }) => {
152
+ let c = e.useMemo(() => t.storageKey ? t.storageKey : `view-switcher${t.id ? `-${t.id}` : ""}`, [t.id, t.storageKey]), [l, d] = e.useState(() => jt(t));
153
153
  e.useEffect(() => {
154
154
  if (t.activeView) {
155
155
  d(t.activeView);
@@ -181,51 +181,51 @@ var St = {
181
181
  r?.(e), t.onViewChange && typeof window < "u" && window.dispatchEvent(new CustomEvent(t.onViewChange, { detail: { view: e } }));
182
182
  }, [r, t.onViewChange]), p = e.useCallback((e) => {
183
183
  d(e), f(e);
184
- }, [f]), m = l || t.views?.[0]?.type, g = m || "", _ = t.views.find((e) => e.type === m) || t.views?.[0], v = t.variant || "tabs", y = t.position || "top", b = y === "left" || y === "right", x = b ? "vertical" : "horizontal", ee = t.viewActions && t.viewActions.length > 0 ? /* @__PURE__ */ (0, X.jsx)("div", {
184
+ }, [f]), m = l || t.views?.[0]?.type, g = m || "", _ = t.views.find((e) => e.type === m) || t.views?.[0], v = t.variant || "tabs", ee = t.position || "top", y = ee === "left" || ee === "right", b = y ? "vertical" : "horizontal", te = t.viewActions && t.viewActions.length > 0 ? /* @__PURE__ */ (0, X.jsx)("div", {
185
185
  className: "flex items-center gap-1",
186
186
  children: t.viewActions.map((e, t) => {
187
- let n = e.icon && vt(e.icon) || St[e.type];
187
+ let n = e.icon && Ot(e.icon) || Mt[e.type];
188
188
  return /* @__PURE__ */ (0, X.jsx)(h, {
189
189
  type: "button",
190
190
  variant: "ghost",
191
191
  size: "icon",
192
192
  onClick: () => a?.(e.type, m),
193
- title: Ct[e.type] || e.type,
193
+ title: Nt[e.type] || e.type,
194
194
  children: n ? /* @__PURE__ */ (0, X.jsx)(n, { className: "h-3.5 w-3.5" }) : null
195
195
  }, `action-${e.type}-${t}`);
196
196
  })
197
- }) : null, te = t.allowCreateView ? /* @__PURE__ */ (0, X.jsx)(h, {
197
+ }) : null, x = t.allowCreateView ? /* @__PURE__ */ (0, X.jsx)(h, {
198
198
  type: "button",
199
199
  variant: "ghost",
200
200
  size: "icon",
201
201
  onClick: () => i?.(),
202
202
  title: o,
203
- children: /* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-3.5 w-3.5" })
203
+ children: /* @__PURE__ */ (0, X.jsx)(He, { className: "h-3.5 w-3.5" })
204
204
  }) : null, S = /* @__PURE__ */ (0, X.jsxs)("div", {
205
- className: z(pt({ orientation: x }), "flex items-center gap-1"),
205
+ className: q(Ct({ orientation: b }), "flex items-center gap-1"),
206
206
  children: [
207
- v === "dropdown" && /* @__PURE__ */ (0, X.jsxs)(A, {
207
+ v === "dropdown" && /* @__PURE__ */ (0, X.jsxs)(L, {
208
208
  value: g,
209
209
  onValueChange: (e) => p(e),
210
- children: [/* @__PURE__ */ (0, X.jsx)(N, {
211
- className: z("w-full", b ? "h-10" : "h-9"),
212
- children: /* @__PURE__ */ (0, X.jsx)(P, { placeholder: "Select view" })
213
- }), /* @__PURE__ */ (0, X.jsx)(j, { children: t.views.map((e, t) => /* @__PURE__ */ (0, X.jsx)(M, {
210
+ children: [/* @__PURE__ */ (0, X.jsx)(B, {
211
+ className: q("w-full", y ? "h-10" : "h-9"),
212
+ children: /* @__PURE__ */ (0, X.jsx)(V, { placeholder: "Select view" })
213
+ }), /* @__PURE__ */ (0, X.jsx)(R, { children: t.views.map((e, t) => /* @__PURE__ */ (0, X.jsx)(z, {
214
214
  value: e.type,
215
- children: yt(e)
215
+ children: kt(e)
216
216
  }, `${e.type}-${t}`)) })]
217
217
  }),
218
218
  v === "buttons" && /* @__PURE__ */ (0, X.jsx)("div", {
219
- className: z(mt({ orientation: x })),
219
+ className: q(wt({ orientation: b })),
220
220
  children: t.views.map((e, t) => {
221
- let n = e.type === m, r = bt(e);
221
+ let n = e.type === m, r = At(e);
222
222
  return /* @__PURE__ */ (0, X.jsxs)(h, {
223
223
  type: "button",
224
224
  size: "sm",
225
225
  variant: n ? "secondary" : "ghost",
226
- className: z("justify-start gap-2", b ? "w-full" : ""),
226
+ className: q("justify-start gap-2", y ? "w-full" : ""),
227
227
  onClick: () => p(e.type),
228
- children: [r ? /* @__PURE__ */ (0, X.jsx)(r, { className: "h-4 w-4" }) : null, /* @__PURE__ */ (0, X.jsx)("span", { children: yt(e) })]
228
+ children: [r ? /* @__PURE__ */ (0, X.jsx)(r, { className: "h-4 w-4" }) : null, /* @__PURE__ */ (0, X.jsx)("span", { children: kt(e) })]
229
229
  }, `${e.type}-${t}`);
230
230
  })
231
231
  }),
@@ -233,19 +233,19 @@ var St = {
233
233
  value: g,
234
234
  onValueChange: (e) => p(e),
235
235
  children: /* @__PURE__ */ (0, X.jsx)(ve, {
236
- className: z(ht({ orientation: x })),
236
+ className: q(Tt({ orientation: b })),
237
237
  children: t.views.map((e, t) => {
238
- let n = bt(e);
238
+ let n = At(e);
239
239
  return /* @__PURE__ */ (0, X.jsxs)(ye, {
240
240
  value: e.type,
241
- className: z("gap-2", b ? "justify-start" : ""),
242
- children: [n ? /* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4" }) : null, /* @__PURE__ */ (0, X.jsx)("span", { children: yt(e) })]
241
+ className: q("gap-2", y ? "justify-start" : ""),
242
+ children: [n ? /* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4" }) : null, /* @__PURE__ */ (0, X.jsx)("span", { children: kt(e) })]
243
243
  }, `${e.type}-${t}`);
244
244
  })
245
245
  })
246
246
  }),
247
- ee,
248
- te
247
+ te,
248
+ x
249
249
  ]
250
250
  }), C = _?.schema ? Array.isArray(_.schema) ? /* @__PURE__ */ (0, X.jsx)("div", {
251
251
  className: "space-y-4",
@@ -258,43 +258,43 @@ var St = {
258
258
  ...s
259
259
  }) : null;
260
260
  return /* @__PURE__ */ (0, X.jsxs)("div", {
261
- className: z(ft({ position: y }), n),
261
+ className: q(St({ position: ee }), n),
262
262
  children: [/* @__PURE__ */ (0, X.jsx)("div", {
263
- className: z("shrink-0", b ? "flex flex-col" : "flex"),
263
+ className: q("shrink-0", y ? "flex flex-col" : "flex"),
264
264
  children: S
265
265
  }), /* @__PURE__ */ (0, X.jsx)("div", {
266
266
  className: "flex-1 min-w-0",
267
267
  children: C
268
268
  })]
269
269
  });
270
- }, Tt = u, Et = ({ schema: e, dataSource: t, className: r, views: c, activeViewId: u, onViewChange: d, onRowClick: m, onEdit: g, renderListView: _, toolbarAddon: v, onCreateView: y, onViewAction: b }) => {
271
- let [x, ee] = s(null), te = o(null);
272
- te.current = x;
273
- let [S, C] = s(!1), [de, T] = s("create"), [E, D] = s(null), [O, k] = s(0);
270
+ }, Ft = u, It = ({ schema: e, dataSource: t, className: r, views: c, activeViewId: u, onViewChange: d, onRowClick: m, onEdit: g, renderListView: _, toolbarAddon: v, onCreateView: ee, onViewAction: y }) => {
271
+ let [b, te] = s(null), x = o(null);
272
+ x.current = b;
273
+ let [S, C] = s(!1), [D, k] = s("create"), [A, j] = s(null), [M, ce] = s(0);
274
274
  i(() => {
275
275
  if (!(!t?.onMutation || !e.objectName) && !_) return t.onMutation((t) => {
276
- t.resource === e.objectName && k((e) => e + 1);
276
+ t.resource === e.objectName && ce((e) => e + 1);
277
277
  });
278
278
  }, [
279
279
  t,
280
280
  e.objectName,
281
281
  _
282
282
  ]);
283
- let [fe, me] = s([]), [he, ge] = s(!1), [A, j] = s({}), [M, N] = s([]), P = e.listViews, F = P != null && Object.keys(P).length > 0, [I, be] = s(() => e.defaultListView && P?.[e.defaultListView] ? e.defaultListView : P && Object.keys(P)[0] || ""), L = a(() => !F || !I ? null : P[I] || null, [
284
- F,
285
- I,
286
- P
287
- ]), R = a(() => c && c.length > 0 ? c : null, [c]), xe = R != null && R.length > 0, B = u || R?.[0]?.id, V = R?.find((e) => e.id === B) || R?.[0], H = a(() => L?.type ? L.type : V?.type ? V.type : e.defaultViewType || "grid", [
283
+ let [le, ue] = s([]), [de, fe] = s(!1), [N, P] = s({}), [F, me] = s([]), I = e.listViews, he = I != null && Object.keys(I).length > 0, [L, R] = s(() => e.defaultListView && I?.[e.defaultListView] ? e.defaultListView : I && Object.keys(I)[0] || ""), z = a(() => !he || !L ? null : I[L] || null, [
284
+ he,
288
285
  L,
289
- V,
286
+ I
287
+ ]), B = a(() => c && c.length > 0 ? c : null, [c]), V = B != null && B.length > 0, ge = u || B?.[0]?.id, H = B?.find((e) => e.id === ge) || B?.[0], U = a(() => z?.type ? z.type : H?.type ? H.type : e.defaultViewType || "grid", [
288
+ z,
289
+ H,
290
290
  e.defaultViewType
291
- ]), U = e.navigation;
291
+ ]), W = e.navigation;
292
292
  i(() => {
293
293
  let n = !0;
294
294
  return e.objectName && t && (async () => {
295
295
  try {
296
296
  let r = await t.getObjectSchema(e.objectName);
297
- n && ee(r);
297
+ n && te(r);
298
298
  } catch (e) {
299
299
  console.error("Failed to fetch object schema:", e);
300
300
  }
@@ -304,10 +304,10 @@ var St = {
304
304
  }, [e.objectName, t]), i(() => {
305
305
  let n = !0;
306
306
  return (async () => {
307
- if (!_ && H !== "grid" && !(!t || !e.objectName)) {
308
- ge(!0);
307
+ if (!_ && U !== "grid" && !(!t || !e.objectName)) {
308
+ fe(!0);
309
309
  try {
310
- let r = L?.filter || V?.filter || e.table?.defaultFilters || [], i = Object.entries(A).filter(([, e]) => e !== void 0 && e !== "" && e !== null).map(([e, t]) => [
310
+ let r = z?.filter || H?.filter || e.table?.defaultFilters || [], i = Object.entries(N).filter(([, e]) => e !== void 0 && e !== "" && e !== null).map(([e, t]) => [
311
311
  e,
312
312
  "=",
313
313
  t
@@ -317,20 +317,20 @@ var St = {
317
317
  ...r,
318
318
  ...i
319
319
  ] : i.length === 1 ? i[0] : i.length > 1 ? ["and", ...i] : r;
320
- let o = M.length > 0 ? M.map((e) => ({
320
+ let o = F.length > 0 ? F.map((e) => ({
321
321
  field: e.field,
322
322
  order: e.direction
323
- })) : L?.sort || V?.sort || e.table?.defaultSort || void 0, s = l(te.current?.fields), c = await t.find(e.objectName, {
323
+ })) : z?.sort || H?.sort || e.table?.defaultSort || void 0, s = l(x.current?.fields), c = await t.find(e.objectName, {
324
324
  $filter: a.length > 0 ? a : void 0,
325
325
  $orderby: o,
326
326
  $top: 100,
327
327
  ...s.length > 0 ? { $expand: s } : {}
328
328
  }), u = [];
329
- Array.isArray(c) ? u = c : c && typeof c == "object" && (Array.isArray(c.data) ? u = c.data : Array.isArray(c.records) ? u = c.records : Array.isArray(c.value) && (u = c.value)), n && me(u);
329
+ Array.isArray(c) ? u = c : c && typeof c == "object" && (Array.isArray(c.data) ? u = c.data : Array.isArray(c.records) ? u = c.records : Array.isArray(c.value) && (u = c.value)), n && ue(u);
330
330
  } catch (e) {
331
331
  console.error("ObjectView data fetch error:", e);
332
332
  } finally {
333
- n && ge(!1);
333
+ n && fe(!1);
334
334
  }
335
335
  }
336
336
  })(), () => {
@@ -339,97 +339,97 @@ var St = {
339
339
  }, [
340
340
  e.objectName,
341
341
  t,
342
- H,
343
- A,
342
+ U,
343
+ N,
344
+ F,
344
345
  M,
345
- O,
346
- L,
347
- V,
346
+ z,
347
+ H,
348
348
  _
349
349
  ]);
350
- let W = e.layout || "drawer", G = e.operations || e.table?.operations || {
350
+ let G = e.layout || "drawer", K = e.operations || e.table?.operations || {
351
351
  create: !0,
352
352
  read: !0,
353
353
  update: !0,
354
354
  delete: !0
355
- }, Se = n(() => {
356
- W === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (T("create"), D(null), C(!0));
357
- }, [W, e]), Ce = n((t) => {
355
+ }, J = n(() => {
356
+ G === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (k("create"), j(null), C(!0));
357
+ }, [G, e]), be = n((t) => {
358
358
  if (g) {
359
359
  g(t);
360
360
  return;
361
361
  }
362
- if (W === "page" && e.onNavigate) {
362
+ if (G === "page" && e.onNavigate) {
363
363
  let n = t.id || t._id;
364
364
  e.onNavigate(n, "edit");
365
- } else T("edit"), D(t), C(!0);
365
+ } else k("edit"), j(t), C(!0);
366
366
  }, [
367
- W,
367
+ G,
368
368
  e,
369
369
  g
370
- ]), we = n((t) => {
371
- if (W === "page" && e.onNavigate) {
370
+ ]), xe = n((t) => {
371
+ if (G === "page" && e.onNavigate) {
372
372
  let n = t.id || t._id;
373
373
  e.onNavigate(n, "view");
374
- } else T("view"), D(t), C(!0);
375
- }, [W, e]), Te = n((t) => {
374
+ } else k("view"), j(t), C(!0);
375
+ }, [G, e]), Se = n((t) => {
376
376
  if (m) {
377
377
  m(t);
378
378
  return;
379
379
  }
380
- if (U) {
381
- if (U.mode === "none" || U.preventNavigation) return;
382
- if (U.mode === "new_window" || U.openNewTab) {
380
+ if (W) {
381
+ if (W.mode === "none" || W.preventNavigation) return;
382
+ if (W.mode === "new_window" || W.openNewTab) {
383
383
  let n = t.id || t._id, r = `/${e.objectName}/${encodeURIComponent(String(n))}`;
384
384
  window.open(r, "_blank");
385
385
  return;
386
386
  }
387
- if (U.mode === "drawer") {
388
- T("view"), D(t), C(!0);
387
+ if (W.mode === "drawer") {
388
+ k("view"), j(t), C(!0);
389
389
  return;
390
390
  }
391
- if (U.mode === "modal") {
392
- T("view"), D(t), C(!0);
391
+ if (W.mode === "modal") {
392
+ k("view"), j(t), C(!0);
393
393
  return;
394
394
  }
395
- if (U.mode === "page") {
395
+ if (W.mode === "page") {
396
396
  let n = t.id || t._id;
397
397
  e.onNavigate && e.onNavigate(n, "view");
398
398
  return;
399
399
  }
400
- if (U.mode === "split" || U.mode === "popover") {
401
- T("view"), D(t), C(!0);
400
+ if (W.mode === "split" || W.mode === "popover") {
401
+ k("view"), j(t), C(!0);
402
402
  return;
403
403
  }
404
404
  }
405
- G.read !== !1 && we(t);
405
+ K.read !== !1 && xe(t);
406
406
  }, [
407
407
  m,
408
- U,
409
- G.read,
410
- we,
408
+ W,
409
+ K.read,
410
+ xe,
411
411
  e
412
- ]), Ee = n((e) => {
413
- k((e) => e + 1);
414
- }, []), De = n((e) => {
415
- k((e) => e + 1);
416
- }, []), K = n(() => {
417
- C(!1), D(null), k((e) => e + 1);
418
- }, []), q = n(() => {
419
- C(!1), D(null);
412
+ ]), Ce = n((e) => {
413
+ ce((e) => e + 1);
414
+ }, []), we = n((e) => {
415
+ ce((e) => e + 1);
416
+ }, []), Te = n(() => {
417
+ C(!1), j(null), ce((e) => e + 1);
418
+ }, []), Y = n(() => {
419
+ C(!1), j(null);
420
420
  }, []);
421
421
  n(() => {
422
- k((e) => e + 1);
422
+ ce((e) => e + 1);
423
423
  }, []);
424
- let Oe = a(() => !xe || !R || R.length <= 1 ? null : {
424
+ let Ee = a(() => !V || !B || B.length <= 1 ? null : {
425
425
  type: "view-switcher",
426
426
  variant: "tabs",
427
427
  position: "top",
428
428
  persistPreference: !0,
429
429
  storageKey: `view-pref-${e.objectName}`,
430
- defaultView: V?.type || "grid",
431
- activeView: V?.type || "grid",
432
- views: R.map((e) => ({
430
+ defaultView: H?.type || "grid",
431
+ activeView: H?.type || "grid",
432
+ views: B.map((e) => ({
433
433
  type: e.type,
434
434
  label: e.label,
435
435
  icon: {
@@ -447,22 +447,22 @@ var St = {
447
447
  allowCreateView: e.allowCreateView,
448
448
  viewActions: e.viewActions
449
449
  }, [
450
- xe,
451
- R,
452
450
  V,
451
+ B,
452
+ H,
453
453
  e.objectName,
454
454
  e.allowCreateView,
455
455
  e.viewActions
456
- ]), ke = n((e) => {
457
- if (!R) return;
458
- let t = R.find((t) => t.type === e);
456
+ ]), De = n((e) => {
457
+ if (!B) return;
458
+ let t = B.find((t) => t.type === e);
459
459
  t && d && d(t.id);
460
- }, [R, d]), Ae = n((e) => {
461
- be(e);
460
+ }, [B, d]), Oe = n((e) => {
461
+ R(e);
462
462
  }, []);
463
463
  a(() => {
464
464
  if (e.showFilters === !1) return null;
465
- let t = e.filterableFields, n = x?.fields || {}, r = (t ? t.map((e) => [e, n[e] || { label: e }]) : Object.entries(n).filter(([, e]) => !e.hidden).slice(0, 8)).map(([e, t]) => {
465
+ let t = e.filterableFields, n = b?.fields || {}, r = (t ? t.map((e) => [e, n[e] || { label: e }]) : Object.entries(n).filter(([, e]) => !e.hidden).slice(0, 8)).map(([e, t]) => {
466
466
  let n = t.type || "text", r = "text", i;
467
467
  return n === "number" || n === "currency" || n === "percent" ? r = "number" : n === "boolean" || n === "toggle" ? r = "boolean" : n === "date" || n === "datetime" ? r = "date" : n === "select" || n === "status" || t.options ? (r = "select", i = (t.options || []).map((e) => typeof e == "string" ? {
468
468
  label: e,
@@ -490,18 +490,18 @@ var St = {
490
490
  showClear: !0,
491
491
  showApply: !0,
492
492
  filters: r,
493
- values: A
493
+ values: N
494
494
  };
495
495
  }, [
496
496
  e.showFilters,
497
497
  e.filterableFields,
498
- x,
499
- A
498
+ b,
499
+ N
500
500
  ]);
501
- let je = e.showSort;
501
+ let ke = e.showSort;
502
502
  a(() => {
503
- if (je === !1) return null;
504
- let e = x?.fields || {}, t = Object.entries(e).filter(([, e]) => !e.hidden).slice(0, 10).map(([e, t]) => ({
503
+ if (ke === !1) return null;
504
+ let e = b?.fields || {}, t = Object.entries(e).filter(([, e]) => !e.hidden).slice(0, 10).map(([e, t]) => ({
505
505
  field: e,
506
506
  label: t.label || e
507
507
  }));
@@ -510,25 +510,25 @@ var St = {
510
510
  variant: "dropdown",
511
511
  multiple: !1,
512
512
  fields: t,
513
- sort: M
513
+ sort: F
514
514
  };
515
515
  }, [
516
- x,
517
- M,
518
- je
516
+ b,
517
+ F,
518
+ ke
519
519
  ]);
520
- let Me = n((t) => {
520
+ let Ae = n((t) => {
521
521
  let n = {
522
522
  objectName: e.objectName,
523
- fields: L?.columns || V?.columns || e.table?.fields,
523
+ fields: z?.columns || H?.columns || e.table?.fields,
524
524
  className: "h-full w-full",
525
- showSearch: V?.showSearch ?? e.showSearch ?? !1,
526
- showSort: V?.showSort ?? e.showSort ?? !1,
527
- showFilters: V?.showFilters ?? e.showFilters ?? !1,
528
- striped: V?.striped ?? !1,
529
- bordered: V?.bordered ?? !1,
530
- color: V?.color
531
- }, r = L?.options || V || {};
525
+ showSearch: H?.showSearch ?? e.showSearch ?? !1,
526
+ showSort: H?.showSort ?? e.showSort ?? !1,
527
+ showFilters: H?.showFilters ?? e.showFilters ?? !1,
528
+ striped: H?.striped ?? !1,
529
+ bordered: H?.bordered ?? !1,
530
+ color: H?.color
531
+ }, r = z?.options || H || {};
532
532
  switch (t) {
533
533
  case "kanban": return {
534
534
  type: "object-kanban",
@@ -582,37 +582,37 @@ var St = {
582
582
  }, [
583
583
  e.objectName,
584
584
  e.table?.fields,
585
- L,
586
- V
587
- ]), Ne = a(() => ({
585
+ z,
586
+ H
587
+ ]), je = a(() => ({
588
588
  type: "object-grid",
589
589
  objectName: e.objectName,
590
590
  title: e.table?.title,
591
591
  description: e.table?.description,
592
- fields: L?.columns || V?.columns || e.table?.fields,
593
- columns: L?.columns || V?.columns || e.table?.columns,
592
+ fields: z?.columns || H?.columns || e.table?.fields,
593
+ columns: z?.columns || H?.columns || e.table?.columns,
594
594
  operations: {
595
- ...G,
595
+ ...K,
596
596
  create: !1
597
597
  },
598
- defaultFilters: L?.filter || V?.filter || e.table?.defaultFilters,
599
- defaultSort: L?.sort || V?.sort || e.table?.defaultSort,
598
+ defaultFilters: z?.filter || H?.filter || e.table?.defaultFilters,
599
+ defaultSort: z?.sort || H?.sort || e.table?.defaultSort,
600
600
  pageSize: e.table?.pageSize,
601
601
  selectable: e.table?.selectable,
602
- striped: V?.striped ?? e.table?.striped,
603
- bordered: V?.bordered ?? e.table?.bordered,
602
+ striped: H?.striped ?? e.table?.striped,
603
+ bordered: H?.bordered ?? e.table?.bordered,
604
604
  className: e.table?.className
605
605
  }), [
606
606
  e,
607
- G,
608
- L,
609
- V
610
- ]), J = () => {
611
- let t = E ? E.id || E._id : void 0;
607
+ K,
608
+ z,
609
+ H
610
+ ]), Me = () => {
611
+ let t = A ? A.id || A._id : void 0;
612
612
  return {
613
613
  type: "object-form",
614
614
  objectName: e.objectName,
615
- mode: de,
615
+ mode: D,
616
616
  recordId: t,
617
617
  title: e.form?.title,
618
618
  description: e.form?.description,
@@ -627,154 +627,156 @@ var St = {
627
627
  cancelText: e.form?.cancelText,
628
628
  showReset: e.form?.showReset,
629
629
  initialValues: e.form?.initialValues,
630
- readOnly: e.form?.readOnly || de === "view",
630
+ readOnly: e.form?.readOnly || D === "view",
631
631
  className: e.form?.className,
632
- onSuccess: K,
633
- onCancel: q
632
+ onSuccess: Te,
633
+ onCancel: Y
634
634
  };
635
- }, Pe = () => {
635
+ }, Ne = () => {
636
636
  if (e.form?.title) return e.form.title;
637
- let t = x?.label || e.objectName;
638
- switch (de) {
637
+ let t = b?.label || e.objectName;
638
+ switch (D) {
639
639
  case "create": return `Create ${t}`;
640
640
  case "edit": return `Edit ${t}`;
641
641
  case "view": return `View ${t}`;
642
642
  default: return t;
643
643
  }
644
- }, Ie = a(() => {
645
- let e = U?.width;
644
+ }, Pe = a(() => {
645
+ let e = W?.width;
646
646
  return e ? typeof e == "number" ? `max-w-[${e}px]` : `max-w-[${e}]` : "";
647
- }, [U]), Le = () => /* @__PURE__ */ (0, X.jsx)(oe, {
647
+ }, [W]), Fe = () => /* @__PURE__ */ (0, X.jsx)(O, {
648
648
  open: S,
649
649
  onOpenChange: C,
650
650
  direction: "right",
651
- children: /* @__PURE__ */ (0, X.jsxs)(se, {
652
- className: z("w-full sm:max-w-2xl", Ie),
653
- children: [/* @__PURE__ */ (0, X.jsxs)(le, { children: [/* @__PURE__ */ (0, X.jsx)(ue, { children: Pe() }), e.form?.description && /* @__PURE__ */ (0, X.jsx)(ce, { children: e.form.description })] }), /* @__PURE__ */ (0, X.jsx)("div", {
651
+ children: /* @__PURE__ */ (0, X.jsxs)(ie, {
652
+ className: q("w-full sm:max-w-2xl", Pe),
653
+ children: [/* @__PURE__ */ (0, X.jsxs)(oe, { children: [/* @__PURE__ */ (0, X.jsx)(se, { children: Ne() }), e.form?.description && /* @__PURE__ */ (0, X.jsx)(ae, { children: e.form.description })] }), /* @__PURE__ */ (0, X.jsx)("div", {
654
654
  className: "flex-1 overflow-y-auto px-4 pb-4",
655
655
  children: /* @__PURE__ */ (0, X.jsx)(p, {
656
- schema: J(),
656
+ schema: Me(),
657
657
  dataSource: t
658
658
  })
659
659
  })]
660
660
  })
661
- }), Re = () => /* @__PURE__ */ (0, X.jsx)(ne, {
661
+ }), Ie = () => /* @__PURE__ */ (0, X.jsx)(w, {
662
662
  open: S,
663
663
  onOpenChange: C,
664
- children: /* @__PURE__ */ (0, X.jsxs)(re, {
665
- className: z("max-w-2xl max-h-[90vh] overflow-y-auto", Ie),
666
- children: [/* @__PURE__ */ (0, X.jsxs)(ie, { children: [/* @__PURE__ */ (0, X.jsx)(ae, { children: Pe() }), e.form?.description && /* @__PURE__ */ (0, X.jsx)(w, { children: e.form.description })] }), /* @__PURE__ */ (0, X.jsx)(p, {
667
- schema: J(),
664
+ children: /* @__PURE__ */ (0, X.jsxs)(T, {
665
+ className: q("max-w-2xl max-h-[90vh] overflow-y-auto", Pe),
666
+ children: [/* @__PURE__ */ (0, X.jsxs)(ne, { children: [/* @__PURE__ */ (0, X.jsx)(re, { children: Ne() }), e.form?.description && /* @__PURE__ */ (0, X.jsx)(E, { children: e.form.description })] }), /* @__PURE__ */ (0, X.jsx)(p, {
667
+ schema: Me(),
668
668
  dataSource: t
669
669
  })]
670
670
  })
671
- }), ze = a(() => Object.keys(A).some((e) => A[e] !== void 0 && A[e] !== "" && A[e] !== null) ? Object.entries(A).filter(([, e]) => e !== void 0 && e !== "" && e !== null).map(([e, t]) => ({
671
+ }), Le = a(() => Object.keys(N).some((e) => N[e] !== void 0 && N[e] !== "" && N[e] !== null) ? Object.entries(N).filter(([, e]) => e !== void 0 && e !== "" && e !== null).map(([e, t]) => ({
672
672
  field: e,
673
673
  operator: "equals",
674
674
  value: t
675
- })) : L?.filter || V?.filter || e.table?.defaultFilters, [
676
- A,
677
- L,
678
- V,
675
+ })) : z?.filter || H?.filter || e.table?.defaultFilters, [
676
+ N,
677
+ z,
678
+ H,
679
679
  e.table?.defaultFilters
680
- ]), Be = a(() => M.length > 0 ? M : L?.sort || V?.sort || e.table?.defaultSort, [
681
- M,
682
- L,
683
- V,
680
+ ]), Re = a(() => F.length > 0 ? F : z?.sort || H?.sort || e.table?.defaultSort, [
681
+ F,
682
+ z,
683
+ H,
684
684
  e.table?.defaultSort
685
- ]), Ve = () => {
686
- let n = `${e.objectName}-${I || V?.id || "default"}-${H}-${O}`;
685
+ ]), ze = () => {
686
+ let n = `${e.objectName}-${L || H?.id || "default"}-${U}-${M}`;
687
687
  if (_) return _({
688
688
  schema: {
689
689
  type: "list-view",
690
690
  objectName: e.objectName,
691
- viewType: H,
692
- fields: L?.columns || V?.columns || e.table?.fields,
693
- filters: ze,
694
- sort: Be,
695
- rowHeight: V?.rowHeight,
696
- densityMode: V?.densityMode,
697
- groupBy: V?.groupBy,
698
- options: L?.options || V,
699
- showSearch: V?.showSearch ?? e.showSearch,
700
- showFilters: V?.showFilters ?? e.showFilters,
701
- showSort: V?.showSort ?? e.showSort,
702
- showHideFields: V?.showHideFields ?? e.showHideFields,
703
- showGroup: V?.showGroup ?? e.showGroup,
704
- showColor: V?.showColor ?? e.showColor,
705
- showDensity: V?.showDensity ?? e.showDensity,
706
- allowExport: V?.allowExport ?? e.allowExport,
707
- striped: V?.striped ?? e.striped,
708
- bordered: V?.bordered ?? e.bordered,
709
- color: V?.color ?? e.color,
710
- inlineEdit: V?.inlineEdit ?? e.inlineEdit,
711
- wrapHeaders: V?.wrapHeaders ?? e.wrapHeaders,
712
- clickIntoRecordDetails: V?.clickIntoRecordDetails ?? e.clickIntoRecordDetails,
713
- addRecordViaForm: V?.addRecordViaForm ?? e.addRecordViaForm,
714
- addDeleteRecordsInline: V?.addDeleteRecordsInline ?? e.addDeleteRecordsInline,
715
- collapseAllByDefault: V?.collapseAllByDefault ?? e.collapseAllByDefault,
716
- fieldTextColor: V?.fieldTextColor ?? e.fieldTextColor,
717
- prefixField: V?.prefixField ?? e.prefixField,
718
- showDescription: V?.showDescription ?? e.showDescription,
719
- navigation: V?.navigation ?? e.navigation,
720
- selection: V?.selection ?? e.selection,
721
- pagination: V?.pagination ?? e.pagination,
722
- searchableFields: V?.searchableFields ?? e.searchableFields,
723
- filterableFields: V?.filterableFields ?? e.filterableFields,
724
- resizable: V?.resizable ?? e.resizable,
725
- hiddenFields: V?.hiddenFields ?? e.hiddenFields,
726
- rowActions: V?.rowActions ?? e.rowActions,
727
- bulkActions: V?.bulkActions ?? e.bulkActions,
728
- sharing: V?.sharing ?? e.sharing,
729
- addRecord: V?.addRecord ?? e.addRecord,
730
- conditionalFormatting: V?.conditionalFormatting ?? e.conditionalFormatting,
731
- quickFilters: V?.quickFilters ?? e.quickFilters,
732
- userFilters: V?.userFilters ?? e.userFilters,
733
- showRecordCount: V?.showRecordCount ?? e.showRecordCount,
734
- allowPrinting: V?.allowPrinting ?? e.allowPrinting,
735
- virtualScroll: V?.virtualScroll ?? e.virtualScroll,
736
- emptyState: V?.emptyState ?? e.emptyState,
737
- aria: V?.aria ?? e.aria,
691
+ viewType: U,
692
+ fields: z?.columns || H?.columns || e.table?.fields,
693
+ filters: Le,
694
+ sort: Re,
695
+ rowHeight: H?.rowHeight,
696
+ densityMode: H?.densityMode,
697
+ groupBy: H?.groupBy,
698
+ groupBy2: H?.groupBy2,
699
+ grouping: H?.grouping,
700
+ options: z?.options || H,
701
+ showSearch: H?.showSearch ?? e.showSearch,
702
+ showFilters: H?.showFilters ?? e.showFilters,
703
+ showSort: H?.showSort ?? e.showSort,
704
+ showHideFields: H?.showHideFields ?? e.showHideFields,
705
+ showGroup: H?.showGroup ?? e.showGroup,
706
+ showColor: H?.showColor ?? e.showColor,
707
+ showDensity: H?.showDensity ?? e.showDensity,
708
+ allowExport: H?.allowExport ?? e.allowExport,
709
+ striped: H?.striped ?? e.striped,
710
+ bordered: H?.bordered ?? e.bordered,
711
+ color: H?.color ?? e.color,
712
+ inlineEdit: H?.inlineEdit ?? e.inlineEdit,
713
+ wrapHeaders: H?.wrapHeaders ?? e.wrapHeaders,
714
+ clickIntoRecordDetails: H?.clickIntoRecordDetails ?? e.clickIntoRecordDetails,
715
+ addRecordViaForm: H?.addRecordViaForm ?? e.addRecordViaForm,
716
+ addDeleteRecordsInline: H?.addDeleteRecordsInline ?? e.addDeleteRecordsInline,
717
+ collapseAllByDefault: H?.collapseAllByDefault ?? e.collapseAllByDefault,
718
+ fieldTextColor: H?.fieldTextColor ?? e.fieldTextColor,
719
+ prefixField: H?.prefixField ?? e.prefixField,
720
+ showDescription: H?.showDescription ?? e.showDescription,
721
+ navigation: H?.navigation ?? e.navigation,
722
+ selection: H?.selection ?? e.selection,
723
+ pagination: H?.pagination ?? e.pagination,
724
+ searchableFields: H?.searchableFields ?? e.searchableFields,
725
+ filterableFields: H?.filterableFields ?? e.filterableFields,
726
+ resizable: H?.resizable ?? e.resizable,
727
+ hiddenFields: H?.hiddenFields ?? e.hiddenFields,
728
+ rowActions: H?.rowActions ?? e.rowActions,
729
+ bulkActions: H?.bulkActions ?? e.bulkActions,
730
+ sharing: H?.sharing ?? e.sharing,
731
+ addRecord: H?.addRecord ?? e.addRecord,
732
+ conditionalFormatting: H?.conditionalFormatting ?? e.conditionalFormatting,
733
+ quickFilters: H?.quickFilters ?? e.quickFilters,
734
+ userFilters: H?.userFilters ?? e.userFilters,
735
+ showRecordCount: H?.showRecordCount ?? e.showRecordCount,
736
+ allowPrinting: H?.allowPrinting ?? e.allowPrinting,
737
+ virtualScroll: H?.virtualScroll ?? e.virtualScroll,
738
+ emptyState: H?.emptyState ?? e.emptyState,
739
+ aria: H?.aria ?? e.aria,
738
740
  tabs: e.tabs,
739
- refreshTrigger: O
741
+ refreshTrigger: M
740
742
  },
741
743
  dataSource: t,
742
- onEdit: Ce,
743
- onRowClick: Te,
744
+ onEdit: be,
745
+ onRowClick: Se,
744
746
  className: "h-full",
745
- refreshKey: O
747
+ refreshKey: M
746
748
  });
747
- if (H !== "grid") {
748
- let e = Me(H);
749
- if (e && Tt) return /* @__PURE__ */ (0, X.jsx)(Tt, {
749
+ if (U !== "grid") {
750
+ let e = Ae(U);
751
+ if (e && Ft) return /* @__PURE__ */ (0, X.jsx)(Ft, {
750
752
  schema: e,
751
753
  dataSource: t,
752
- data: fe,
753
- loading: he
754
+ data: le,
755
+ loading: de
754
756
  }, n);
755
- if (!Tt) return /* @__PURE__ */ (0, X.jsx)("div", {
757
+ if (!Ft) return /* @__PURE__ */ (0, X.jsx)("div", {
756
758
  className: "flex items-center justify-center h-40 text-muted-foreground",
757
759
  children: /* @__PURE__ */ (0, X.jsxs)("p", { children: [
758
760
  "SchemaRenderer not available. Install @object-ui/react to render ",
759
- H,
761
+ U,
760
762
  " views."
761
763
  ] })
762
764
  });
763
765
  }
764
766
  return /* @__PURE__ */ (0, X.jsx)(f, {
765
- schema: Ne,
767
+ schema: je,
766
768
  dataSource: t,
767
- onRowClick: Te,
768
- onEdit: G.update === !1 ? void 0 : Ce,
769
- onDelete: G.delete === !1 ? void 0 : Ee,
770
- onBulkDelete: G.delete === !1 ? void 0 : De
769
+ onRowClick: Se,
770
+ onEdit: K.update === !1 ? void 0 : be,
771
+ onDelete: K.delete === !1 ? void 0 : Ce,
772
+ onBulkDelete: K.delete === !1 ? void 0 : we
771
773
  }, n);
772
- }, He = () => {
773
- if (!F) return null;
774
- let e = Object.entries(P);
774
+ }, Be = () => {
775
+ if (!he) return null;
776
+ let e = Object.entries(I);
775
777
  return e.length <= 1 ? null : /* @__PURE__ */ (0, X.jsx)(_e, {
776
- value: I,
777
- onValueChange: Ae,
778
+ value: L,
779
+ onValueChange: Oe,
778
780
  className: "w-full",
779
781
  children: /* @__PURE__ */ (0, X.jsx)(ve, {
780
782
  className: "w-auto",
@@ -785,44 +787,44 @@ var St = {
785
787
  }, e))
786
788
  })
787
789
  });
788
- }, Ue = () => {
789
- let t = e.showCreate !== !1 && G.create !== !1, n = e.showViewSwitcher === !0, r = He();
790
+ }, Ve = () => {
791
+ let t = e.showCreate !== !1 && K.create !== !1, n = e.showViewSwitcher === !0, r = Be();
790
792
  return !r && !n && !t && !v ? null : /* @__PURE__ */ (0, X.jsxs)("div", {
791
793
  className: "flex flex-col gap-3",
792
794
  children: [r, (n || t || v) && /* @__PURE__ */ (0, X.jsxs)("div", {
793
795
  className: "flex items-center justify-between gap-4",
794
796
  children: [/* @__PURE__ */ (0, X.jsx)("div", {
795
797
  className: "flex items-center gap-2",
796
- children: n && Oe && /* @__PURE__ */ (0, X.jsx)(wt, {
797
- schema: Oe,
798
- onViewChange: ke,
799
- onCreateView: y,
800
- onViewAction: b,
798
+ children: n && Ee && /* @__PURE__ */ (0, X.jsx)(Pt, {
799
+ schema: Ee,
800
+ onViewChange: De,
801
+ onCreateView: ee,
802
+ onViewAction: y,
801
803
  className: "overflow-x-auto"
802
804
  })
803
805
  }), /* @__PURE__ */ (0, X.jsxs)("div", {
804
806
  className: "flex items-center gap-2",
805
807
  children: [v, t && /* @__PURE__ */ (0, X.jsxs)(h, {
806
808
  size: "sm",
807
- onClick: Se,
808
- children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4" }), "Create"]
809
+ onClick: J,
810
+ children: [/* @__PURE__ */ (0, X.jsx)(He, { className: "h-4 w-4" }), "Create"]
809
811
  })]
810
812
  })]
811
813
  })]
812
814
  });
813
- }, We = U?.mode === "modal" ? "modal" : U?.mode === "drawer" ? "drawer" : U?.mode === "split" ? "split" : U?.mode === "popover" ? "popover" : W, Ge = (e) => /* @__PURE__ */ (0, X.jsx)("div", {
815
+ }, Ue = W?.mode === "modal" ? "modal" : W?.mode === "drawer" ? "drawer" : W?.mode === "split" ? "split" : W?.mode === "popover" ? "popover" : G, We = (e) => /* @__PURE__ */ (0, X.jsx)("div", {
814
816
  className: "space-y-3",
815
817
  children: /* @__PURE__ */ (0, X.jsx)(p, {
816
- schema: J(),
818
+ schema: Me(),
817
819
  dataSource: t
818
820
  })
819
- }), Ke = n((e) => {
820
- e || q();
821
- }, [q]);
822
- if (We === "split") {
823
- let t = x?.label || e.objectName;
821
+ }), Ge = n((e) => {
822
+ e || Y();
823
+ }, [Y]);
824
+ if (Ue === "split") {
825
+ let t = b?.label || e.objectName;
824
826
  return /* @__PURE__ */ (0, X.jsxs)("div", {
825
- className: z("flex flex-col h-full min-w-0 overflow-hidden", r),
827
+ className: q("flex flex-col h-full min-w-0 overflow-hidden", r),
826
828
  children: [
827
829
  (e.title || e.description) && /* @__PURE__ */ (0, X.jsxs)("div", {
828
830
  className: "mb-4 shrink-0",
@@ -836,31 +838,31 @@ var St = {
836
838
  }),
837
839
  /* @__PURE__ */ (0, X.jsx)("div", {
838
840
  className: "mb-4 shrink-0",
839
- children: Ue()
841
+ children: Ve()
840
842
  }),
841
843
  /* @__PURE__ */ (0, X.jsx)("div", {
842
844
  className: "flex-1 min-h-0 min-w-0 overflow-hidden",
843
- children: S && E ? /* @__PURE__ */ (0, X.jsx)(pe, {
845
+ children: S && A ? /* @__PURE__ */ (0, X.jsx)(pe, {
844
846
  isOpen: S,
845
- selectedRecord: E,
847
+ selectedRecord: A,
846
848
  mode: "split",
847
- close: q,
848
- setIsOpen: Ke,
849
- width: U?.width,
849
+ close: Y,
850
+ setIsOpen: Ge,
851
+ width: W?.width,
850
852
  isOverlay: !0,
851
853
  title: `${t} Detail`,
852
854
  mainContent: /* @__PURE__ */ (0, X.jsx)("div", {
853
855
  className: "h-full overflow-auto",
854
- children: Ve()
856
+ children: ze()
855
857
  }),
856
- children: Ge
857
- }) : Ve()
858
+ children: We
859
+ }) : ze()
858
860
  })
859
861
  ]
860
862
  });
861
863
  }
862
864
  return /* @__PURE__ */ (0, X.jsxs)("div", {
863
- className: z("flex flex-col h-full min-w-0 overflow-hidden", r),
865
+ className: q("flex flex-col h-full min-w-0 overflow-hidden", r),
864
866
  children: [
865
867
  (e.title || e.description) && /* @__PURE__ */ (0, X.jsxs)("div", {
866
868
  className: "mb-4 shrink-0",
@@ -874,35 +876,35 @@ var St = {
874
876
  }),
875
877
  /* @__PURE__ */ (0, X.jsx)("div", {
876
878
  className: "mb-4 shrink-0",
877
- children: Ue()
879
+ children: Ve()
878
880
  }),
879
881
  /* @__PURE__ */ (0, X.jsx)("div", {
880
882
  className: "flex-1 min-h-0 min-w-0 overflow-hidden",
881
- children: Ve()
883
+ children: ze()
882
884
  }),
883
- We === "drawer" && Le(),
884
- We === "modal" && Re(),
885
- We === "popover" && S && E && /* @__PURE__ */ (0, X.jsx)(pe, {
885
+ Ue === "drawer" && Fe(),
886
+ Ue === "modal" && Ie(),
887
+ Ue === "popover" && S && A && /* @__PURE__ */ (0, X.jsx)(pe, {
886
888
  isOpen: S,
887
- selectedRecord: E,
889
+ selectedRecord: A,
888
890
  mode: "popover",
889
- close: q,
890
- setIsOpen: Ke,
891
- width: U?.width,
891
+ close: Y,
892
+ setIsOpen: Ge,
893
+ width: W?.width,
892
894
  isOverlay: !0,
893
- title: Pe(),
894
- children: Ge
895
+ title: Ne(),
896
+ children: We
895
897
  })
896
898
  ]
897
899
  });
898
- }, Dt = Y("flex", {
900
+ }, Lt = vt("flex", {
899
901
  variants: { layout: {
900
902
  inline: "flex-col space-y-4",
901
903
  popover: "items-center",
902
904
  drawer: "items-center"
903
905
  } },
904
906
  defaultVariants: { layout: "inline" }
905
- }), Ot = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.values(e).every((e) => e == null || e === "") : !1, kt = (e) => Array.isArray(e) ? {
907
+ }), Rt = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.values(e).every((e) => e == null || e === "") : !1, zt = (e) => Array.isArray(e) ? {
906
908
  start: e[0] || "",
907
909
  end: e[1] || ""
908
910
  } : e && typeof e == "object" ? {
@@ -911,7 +913,7 @@ var St = {
911
913
  } : {
912
914
  start: "",
913
915
  end: ""
914
- }, At = ({ schema: t, className: n, onChange: r }) => {
916
+ }, Bt = ({ schema: t, className: n, onChange: r }) => {
915
917
  let [i, a] = e.useState(t.values || {}), [o, s] = e.useState(!1);
916
918
  e.useEffect(() => {
917
919
  t.values && a(t.values);
@@ -937,10 +939,10 @@ var St = {
937
939
  c(e);
938
940
  }, [c, t.showApply]), d = e.useCallback(() => {
939
941
  c(i), s(!1);
940
- }, [c, i]), f = e.useMemo(() => Object.values(i).filter((e) => !Ot(e)).length, [i]), p = (e) => {
942
+ }, [c, i]), f = e.useMemo(() => Object.values(i).filter((e) => !Rt(e)).length, [i]), p = (e) => {
941
943
  let t = e.label || e.field, n = e.placeholder || `Filter by ${t}`;
942
944
  switch (e.type) {
943
- case "number": return /* @__PURE__ */ (0, X.jsx)(k, {
945
+ case "number": return /* @__PURE__ */ (0, X.jsx)(P, {
944
946
  type: "number",
945
947
  value: i[e.field] ?? "",
946
948
  placeholder: n,
@@ -949,13 +951,13 @@ var St = {
949
951
  l(e.field, r);
950
952
  }
951
953
  });
952
- case "select": return /* @__PURE__ */ (0, X.jsxs)(A, {
954
+ case "select": return /* @__PURE__ */ (0, X.jsxs)(L, {
953
955
  value: i[e.field] === void 0 ? "" : String(i[e.field]),
954
956
  onValueChange: (t) => {
955
957
  let n = e.options?.find((e) => String(e.value) === t);
956
958
  l(e.field, n ? n.value : t);
957
959
  },
958
- children: [/* @__PURE__ */ (0, X.jsx)(N, { children: /* @__PURE__ */ (0, X.jsx)(P, { placeholder: n }) }), /* @__PURE__ */ (0, X.jsx)(j, { children: e.options?.map((e) => /* @__PURE__ */ (0, X.jsx)(M, {
960
+ children: [/* @__PURE__ */ (0, X.jsx)(B, { children: /* @__PURE__ */ (0, X.jsx)(V, { placeholder: n }) }), /* @__PURE__ */ (0, X.jsx)(R, { children: e.options?.map((e) => /* @__PURE__ */ (0, X.jsx)(z, {
959
961
  value: String(e.value),
960
962
  children: e.label
961
963
  }, String(e.value))) })]
@@ -967,7 +969,7 @@ var St = {
967
969
  children: e.options?.map((t) => {
968
970
  let r = n.map(String).includes(String(t.value));
969
971
  return /* @__PURE__ */ (0, X.jsxs)("label", {
970
- className: z("flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer", r ? "bg-primary/5 text-primary" : "hover:bg-muted"),
972
+ className: q("flex items-center gap-2 text-sm py-1 px-1.5 rounded cursor-pointer", r ? "bg-primary/5 text-primary" : "hover:bg-muted"),
971
973
  children: [/* @__PURE__ */ (0, X.jsx)(g, {
972
974
  checked: r,
973
975
  onCheckedChange: (r) => {
@@ -982,16 +984,16 @@ var St = {
982
984
  })
983
985
  });
984
986
  }
985
- case "date": return /* @__PURE__ */ (0, X.jsx)(k, {
987
+ case "date": return /* @__PURE__ */ (0, X.jsx)(P, {
986
988
  type: "date",
987
989
  value: i[e.field] ?? "",
988
990
  onChange: (t) => l(e.field, t.target.value)
989
991
  });
990
992
  case "date-range": {
991
- let t = kt(i[e.field]);
993
+ let t = zt(i[e.field]);
992
994
  return /* @__PURE__ */ (0, X.jsxs)("div", {
993
995
  className: "flex items-center gap-2",
994
- children: [/* @__PURE__ */ (0, X.jsx)(k, {
996
+ children: [/* @__PURE__ */ (0, X.jsx)(P, {
995
997
  type: "date",
996
998
  value: t.start ?? "",
997
999
  onChange: (n) => {
@@ -1000,7 +1002,7 @@ var St = {
1000
1002
  start: n.target.value
1001
1003
  });
1002
1004
  }
1003
- }), /* @__PURE__ */ (0, X.jsx)(k, {
1005
+ }), /* @__PURE__ */ (0, X.jsx)(P, {
1004
1006
  type: "date",
1005
1007
  value: t.end ?? "",
1006
1008
  onChange: (n) => {
@@ -1022,7 +1024,7 @@ var St = {
1022
1024
  children: "Enabled"
1023
1025
  })]
1024
1026
  });
1025
- default: return /* @__PURE__ */ (0, X.jsx)(k, {
1027
+ default: return /* @__PURE__ */ (0, X.jsx)(P, {
1026
1028
  value: i[e.field] ?? "",
1027
1029
  placeholder: n,
1028
1030
  onChange: (t) => l(e.field, t.target.value)
@@ -1034,7 +1036,7 @@ var St = {
1034
1036
  className: "grid gap-4 sm:grid-cols-2",
1035
1037
  children: t.filters.map((e) => /* @__PURE__ */ (0, X.jsxs)("div", {
1036
1038
  className: "space-y-2",
1037
- children: [/* @__PURE__ */ (0, X.jsx)(fe, {
1039
+ children: [/* @__PURE__ */ (0, X.jsx)(F, {
1038
1040
  className: "text-xs text-muted-foreground",
1039
1041
  children: e.label || e.field
1040
1042
  }), p(e)]
@@ -1056,11 +1058,11 @@ var St = {
1056
1058
  })]
1057
1059
  }), _ = t.layout || "inline";
1058
1060
  return _ === "popover" ? /* @__PURE__ */ (0, X.jsx)("div", {
1059
- className: z(Dt({ layout: _ }), n),
1061
+ className: q(Lt({ layout: _ }), n),
1060
1062
  children: /* @__PURE__ */ (0, X.jsxs)(me, {
1061
1063
  open: o,
1062
1064
  onOpenChange: s,
1063
- children: [/* @__PURE__ */ (0, X.jsx)(ge, {
1065
+ children: [/* @__PURE__ */ (0, X.jsx)(he, {
1064
1066
  asChild: !0,
1065
1067
  children: /* @__PURE__ */ (0, X.jsxs)(h, {
1066
1068
  type: "button",
@@ -1068,7 +1070,7 @@ var St = {
1068
1070
  size: "sm",
1069
1071
  className: "gap-2",
1070
1072
  children: [
1071
- /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4" }),
1073
+ /* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4" }),
1072
1074
  "Filters",
1073
1075
  f > 0 && /* @__PURE__ */ (0, X.jsx)("span", {
1074
1076
  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",
@@ -1076,14 +1078,14 @@ var St = {
1076
1078
  })
1077
1079
  ]
1078
1080
  })
1079
- }), /* @__PURE__ */ (0, X.jsx)(he, {
1081
+ }), /* @__PURE__ */ (0, X.jsx)(I, {
1080
1082
  align: "start",
1081
1083
  className: "w-[520px] p-4",
1082
1084
  children: m
1083
1085
  })]
1084
1086
  })
1085
1087
  }) : _ === "drawer" ? /* @__PURE__ */ (0, X.jsxs)("div", {
1086
- className: z(Dt({ layout: _ }), n),
1088
+ className: q(Lt({ layout: _ }), n),
1087
1089
  children: [/* @__PURE__ */ (0, X.jsxs)(h, {
1088
1090
  type: "button",
1089
1091
  variant: f > 0 ? "secondary" : "outline",
@@ -1091,54 +1093,54 @@ var St = {
1091
1093
  className: "gap-2",
1092
1094
  onClick: () => s(!0),
1093
1095
  children: [
1094
- /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4" }),
1096
+ /* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4" }),
1095
1097
  "Filters",
1096
1098
  f > 0 && /* @__PURE__ */ (0, X.jsx)("span", {
1097
1099
  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",
1098
1100
  children: f
1099
1101
  })
1100
1102
  ]
1101
- }), /* @__PURE__ */ (0, X.jsx)(oe, {
1103
+ }), /* @__PURE__ */ (0, X.jsx)(O, {
1102
1104
  open: o,
1103
1105
  onOpenChange: s,
1104
- children: /* @__PURE__ */ (0, X.jsxs)(se, { children: [/* @__PURE__ */ (0, X.jsxs)(le, { children: [/* @__PURE__ */ (0, X.jsx)(ue, { children: "Filters" }), /* @__PURE__ */ (0, X.jsx)(ce, { children: "Refine the data with advanced filters." })] }), /* @__PURE__ */ (0, X.jsx)("div", {
1106
+ children: /* @__PURE__ */ (0, X.jsxs)(ie, { children: [/* @__PURE__ */ (0, X.jsxs)(oe, { children: [/* @__PURE__ */ (0, X.jsx)(se, { children: "Filters" }), /* @__PURE__ */ (0, X.jsx)(ae, { children: "Refine the data with advanced filters." })] }), /* @__PURE__ */ (0, X.jsx)("div", {
1105
1107
  className: "px-4 pb-6",
1106
1108
  children: m
1107
1109
  })] })
1108
1110
  })]
1109
1111
  }) : /* @__PURE__ */ (0, X.jsxs)("div", {
1110
- className: z(Dt({ layout: _ }), n),
1112
+ className: q(Lt({ layout: _ }), n),
1111
1113
  children: [m, !t.showApply && t.showClear && /* @__PURE__ */ (0, X.jsxs)(h, {
1112
1114
  type: "button",
1113
1115
  variant: "ghost",
1114
1116
  size: "sm",
1115
1117
  className: "gap-2",
1116
1118
  onClick: u,
1117
- children: [/* @__PURE__ */ (0, X.jsx)(We, { className: "h-3.5 w-3.5" }), "Clear filters"]
1119
+ children: [/* @__PURE__ */ (0, X.jsx)(Qe, { className: "h-3.5 w-3.5" }), "Clear filters"]
1118
1120
  })]
1119
1121
  });
1120
- }, jt = Y("", {
1122
+ }, Vt = vt("", {
1121
1123
  variants: { variant: {
1122
1124
  buttons: "flex flex-wrap gap-2",
1123
1125
  dropdown: "flex flex-wrap items-center gap-3",
1124
1126
  builder: "space-y-3"
1125
1127
  } },
1126
1128
  defaultVariants: { variant: "dropdown" }
1127
- }), Mt = (e) => e ? e.map((e) => ({
1129
+ }), Ht = (e) => e ? e.map((e) => ({
1128
1130
  field: e.field,
1129
1131
  direction: e.direction
1130
- })) : [], Nt = (e) => e.map((e) => ({
1132
+ })) : [], Ut = (e) => e.map((e) => ({
1131
1133
  id: `${e.field}-${e.direction}`,
1132
1134
  field: e.field,
1133
1135
  order: e.direction
1134
- })), Pt = (e) => e.filter((e) => e.field).map((e) => ({
1136
+ })), Wt = (e) => e.filter((e) => e.field).map((e) => ({
1135
1137
  field: e.field,
1136
1138
  direction: e.order
1137
- })), Ft = ({ schema: t, className: n, onChange: r }) => {
1138
- let [i, a] = e.useState(() => Mt(t.sort)), [o, s] = e.useState(() => Nt(Mt(t.sort)));
1139
+ })), Gt = ({ schema: t, className: n, onChange: r }) => {
1140
+ let [i, a] = e.useState(() => Ht(t.sort)), [o, s] = e.useState(() => Ut(Ht(t.sort)));
1139
1141
  e.useEffect(() => {
1140
- let e = Mt(t.sort);
1141
- a(e), s(Nt(e));
1142
+ let e = Ht(t.sort);
1143
+ a(e), s(Ut(e));
1142
1144
  }, [t.sort]);
1143
1145
  let c = e.useCallback((e) => {
1144
1146
  a(e), r?.(e), t.onChange && typeof window < "u" && window.dispatchEvent(new CustomEvent(t.onChange, { detail: { sort: e } }));
@@ -1168,9 +1170,9 @@ var St = {
1168
1170
  i
1169
1171
  ]);
1170
1172
  if ((t.variant || "dropdown") === "buttons") return /* @__PURE__ */ (0, X.jsx)("div", {
1171
- className: z(jt({ variant: "buttons" }), n),
1173
+ className: q(Vt({ variant: "buttons" }), n),
1172
1174
  children: t.fields.map((e) => {
1173
- let t = i.find((t) => t.field === e.field), n = t?.direction === "asc" ? H : V;
1175
+ let t = i.find((t) => t.field === e.field), n = t?.direction === "asc" ? xe : be;
1174
1176
  return /* @__PURE__ */ (0, X.jsxs)(h, {
1175
1177
  type: "button",
1176
1178
  variant: t ? "secondary" : "outline",
@@ -1182,22 +1184,22 @@ var St = {
1182
1184
  })
1183
1185
  });
1184
1186
  if (t.multiple) return /* @__PURE__ */ (0, X.jsx)("div", {
1185
- className: z(jt({ variant: "builder" }), n),
1186
- children: /* @__PURE__ */ (0, X.jsx)(F, {
1187
+ className: q(Vt({ variant: "builder" }), n),
1188
+ children: /* @__PURE__ */ (0, X.jsx)(ge, {
1187
1189
  fields: t.fields.map((e) => ({
1188
1190
  value: e.field,
1189
1191
  label: e.label || e.field
1190
1192
  })),
1191
1193
  value: o,
1192
1194
  onChange: (e) => {
1193
- s(e), c(Pt(e));
1195
+ s(e), c(Wt(e));
1194
1196
  }
1195
1197
  })
1196
1198
  });
1197
1199
  let u = i[0];
1198
1200
  return /* @__PURE__ */ (0, X.jsxs)("div", {
1199
- className: z(jt({ variant: "dropdown" }), n),
1200
- children: [/* @__PURE__ */ (0, X.jsxs)(A, {
1201
+ className: q(Vt({ variant: "dropdown" }), n),
1202
+ children: [/* @__PURE__ */ (0, X.jsxs)(L, {
1201
1203
  value: u?.field || "",
1202
1204
  onValueChange: (e) => {
1203
1205
  if (!e) {
@@ -1209,14 +1211,14 @@ var St = {
1209
1211
  direction: u?.direction || "asc"
1210
1212
  }]);
1211
1213
  },
1212
- children: [/* @__PURE__ */ (0, X.jsx)(N, {
1214
+ children: [/* @__PURE__ */ (0, X.jsx)(B, {
1213
1215
  className: "w-56",
1214
- children: /* @__PURE__ */ (0, X.jsx)(P, { placeholder: "Select field" })
1215
- }), /* @__PURE__ */ (0, X.jsx)(j, { children: t.fields.map((e) => /* @__PURE__ */ (0, X.jsx)(M, {
1216
+ children: /* @__PURE__ */ (0, X.jsx)(V, { placeholder: "Select field" })
1217
+ }), /* @__PURE__ */ (0, X.jsx)(R, { children: t.fields.map((e) => /* @__PURE__ */ (0, X.jsx)(z, {
1216
1218
  value: e.field,
1217
1219
  children: e.label || e.field
1218
1220
  }, e.field)) })]
1219
- }), /* @__PURE__ */ (0, X.jsxs)(A, {
1221
+ }), /* @__PURE__ */ (0, X.jsxs)(L, {
1220
1222
  value: u?.direction || "asc",
1221
1223
  onValueChange: (e) => {
1222
1224
  u?.field && c([{
@@ -1224,13 +1226,13 @@ var St = {
1224
1226
  direction: e
1225
1227
  }]);
1226
1228
  },
1227
- children: [/* @__PURE__ */ (0, X.jsx)(N, {
1229
+ children: [/* @__PURE__ */ (0, X.jsx)(B, {
1228
1230
  className: "w-36",
1229
- children: /* @__PURE__ */ (0, X.jsx)(P, {})
1230
- }), /* @__PURE__ */ (0, X.jsxs)(j, { children: [/* @__PURE__ */ (0, X.jsx)(M, {
1231
+ children: /* @__PURE__ */ (0, X.jsx)(V, {})
1232
+ }), /* @__PURE__ */ (0, X.jsxs)(R, { children: [/* @__PURE__ */ (0, X.jsx)(z, {
1231
1233
  value: "asc",
1232
1234
  children: "Ascending"
1233
- }), /* @__PURE__ */ (0, X.jsx)(M, {
1235
+ }), /* @__PURE__ */ (0, X.jsx)(z, {
1234
1236
  value: "desc",
1235
1237
  children: "Descending"
1236
1238
  })] })]
@@ -1239,7 +1241,7 @@ var St = {
1239
1241
  };
1240
1242
  //#endregion
1241
1243
  //#region src/SharedViewLink.tsx
1242
- function It() {
1244
+ function Kt() {
1243
1245
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function") return crypto.randomUUID();
1244
1246
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
1245
1247
  let e = new Uint8Array(16);
@@ -1247,12 +1249,12 @@ function It() {
1247
1249
  }
1248
1250
  return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
1249
1251
  }
1250
- function Lt(e, t, n, r) {
1252
+ function qt(e, t, n, r) {
1251
1253
  return `${e}/share/${t}/${n}?mode=readonly&token=${r}`;
1252
1254
  }
1253
- var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, className: a }) => {
1254
- let [o, s] = e.useState(null), [c, l] = e.useState(!1), [u, d] = e.useState(!1), [f, p] = e.useState(""), [g, _] = e.useState(""), v = r ?? (typeof window < "u" ? window.location.origin : ""), y = e.useCallback(() => {
1255
- let e = Lt(v, t, n, It());
1255
+ var Jt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, className: a }) => {
1256
+ let [o, s] = e.useState(null), [c, l] = e.useState(!1), [u, d] = e.useState(!1), [f, p] = e.useState(""), [g, _] = e.useState(""), v = r ?? (typeof window < "u" ? window.location.origin : ""), ee = e.useCallback(() => {
1257
+ let e = qt(v, t, n, Kt());
1256
1258
  s(e), l(!1);
1257
1259
  let r = g ? new Date(Date.now() + parseInt(g, 10) * 864e5).toISOString() : void 0;
1258
1260
  i?.(e, {
@@ -1266,7 +1268,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1266
1268
  i,
1267
1269
  f,
1268
1270
  g
1269
- ]), b = e.useCallback(async () => {
1271
+ ]), y = e.useCallback(async () => {
1270
1272
  if (o) try {
1271
1273
  await navigator.clipboard.writeText(o), l(!0), setTimeout(() => l(!1), 2e3);
1272
1274
  } catch {
@@ -1277,15 +1279,15 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1277
1279
  return /* @__PURE__ */ (0, X.jsxs)(me, {
1278
1280
  open: u,
1279
1281
  onOpenChange: d,
1280
- children: [/* @__PURE__ */ (0, X.jsx)(ge, {
1282
+ children: [/* @__PURE__ */ (0, X.jsx)(he, {
1281
1283
  asChild: !0,
1282
1284
  children: /* @__PURE__ */ (0, X.jsxs)(h, {
1283
1285
  variant: "outline",
1284
1286
  size: "sm",
1285
- className: z("gap-2", a),
1286
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4" }), "Share"]
1287
+ className: q("gap-2", a),
1288
+ children: [/* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4" }), "Share"]
1287
1289
  })
1288
- }), /* @__PURE__ */ (0, X.jsxs)(he, {
1290
+ }), /* @__PURE__ */ (0, X.jsxs)(I, {
1289
1291
  className: "w-96 space-y-4",
1290
1292
  align: "end",
1291
1293
  children: [/* @__PURE__ */ (0, X.jsxs)("div", {
@@ -1306,7 +1308,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1306
1308
  })]
1307
1309
  }), o ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsxs)("div", {
1308
1310
  className: "flex items-center gap-2",
1309
- children: [/* @__PURE__ */ (0, X.jsx)(k, {
1311
+ children: [/* @__PURE__ */ (0, X.jsx)(P, {
1310
1312
  value: o,
1311
1313
  readOnly: !0,
1312
1314
  className: "h-8 text-xs",
@@ -1314,21 +1316,21 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1314
1316
  }), /* @__PURE__ */ (0, X.jsx)(h, {
1315
1317
  variant: "outline",
1316
1318
  size: "sm",
1317
- onClick: b,
1319
+ onClick: y,
1318
1320
  className: "shrink-0 gap-1",
1319
- children: c ? /* @__PURE__ */ (0, X.jsx)(W, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ (0, X.jsx)(G, { className: "h-4 w-4" })
1321
+ children: c ? /* @__PURE__ */ (0, X.jsx)(Ce, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ (0, X.jsx)(Te, { className: "h-4 w-4" })
1320
1322
  })]
1321
1323
  }), (f || g) && /* @__PURE__ */ (0, X.jsxs)("div", {
1322
1324
  className: "flex items-center gap-2 flex-wrap",
1323
1325
  children: [f && /* @__PURE__ */ (0, X.jsxs)(m, {
1324
1326
  variant: "outline",
1325
1327
  className: "text-xs gap-1",
1326
- children: [/* @__PURE__ */ (0, X.jsx)(Ae, { className: "h-3 w-3" }), "Password protected"]
1328
+ children: [/* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3 w-3" }), "Password protected"]
1327
1329
  }), g && /* @__PURE__ */ (0, X.jsxs)(m, {
1328
1330
  variant: "outline",
1329
1331
  className: "text-xs gap-1",
1330
1332
  children: [
1331
- /* @__PURE__ */ (0, X.jsx)(U, { className: "h-3 w-3" }),
1333
+ /* @__PURE__ */ (0, X.jsx)(Se, { className: "h-3 w-3" }),
1332
1334
  "Expires in ",
1333
1335
  g,
1334
1336
  " day",
@@ -1342,8 +1344,8 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1342
1344
  className: "space-y-1.5",
1343
1345
  children: [/* @__PURE__ */ (0, X.jsxs)("label", {
1344
1346
  className: "flex items-center gap-1.5 text-xs font-medium text-foreground",
1345
- children: [/* @__PURE__ */ (0, X.jsx)(Ae, { className: "h-3.5 w-3.5" }), "Password protection (optional)"]
1346
- }), /* @__PURE__ */ (0, X.jsx)(k, {
1347
+ children: [/* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3.5 w-3.5" }), "Password protection (optional)"]
1348
+ }), /* @__PURE__ */ (0, X.jsx)(P, {
1347
1349
  type: "password",
1348
1350
  value: f,
1349
1351
  onChange: (e) => p(e.target.value),
@@ -1355,7 +1357,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1355
1357
  className: "space-y-1.5",
1356
1358
  children: [/* @__PURE__ */ (0, X.jsxs)("label", {
1357
1359
  className: "flex items-center gap-1.5 text-xs font-medium text-foreground",
1358
- children: [/* @__PURE__ */ (0, X.jsx)(U, { className: "h-3.5 w-3.5" }), "Expires after (optional)"]
1360
+ children: [/* @__PURE__ */ (0, X.jsx)(Se, { className: "h-3.5 w-3.5" }), "Expires after (optional)"]
1359
1361
  }), /* @__PURE__ */ (0, X.jsxs)("select", {
1360
1362
  value: g,
1361
1363
  onChange: (e) => _(e.target.value),
@@ -1385,29 +1387,34 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1385
1387
  })]
1386
1388
  }),
1387
1389
  /* @__PURE__ */ (0, X.jsxs)(h, {
1388
- onClick: y,
1390
+ onClick: ee,
1389
1391
  className: "w-full gap-2",
1390
1392
  size: "sm",
1391
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4" }), "Generate Link"]
1393
+ children: [/* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4" }), "Generate Link"]
1392
1394
  })
1393
1395
  ]
1394
1396
  })]
1395
1397
  })]
1396
1398
  });
1397
- }, zt = {
1399
+ }, Yt = {
1398
1400
  private: 0,
1399
1401
  team: 1,
1400
1402
  organization: 2,
1401
1403
  public: 3
1402
- }, Bt = 5, Vt = ({ id: e, disabled: t, children: n }) => {
1403
- let { attributes: r, listeners: i, setNodeRef: a, transform: o, transition: s, isDragging: c } = tt({
1404
+ }, Xt = 8, Zt = ({ id: e, disabled: t, children: n }) => {
1405
+ let { attributes: r, listeners: i, setNodeRef: a, transform: o, transition: s, isDragging: c } = ut({
1404
1406
  id: e,
1405
- disabled: t
1407
+ disabled: t,
1408
+ attributes: {
1409
+ role: "tab",
1410
+ roleDescription: "view tab",
1411
+ tabIndex: 0
1412
+ }
1406
1413
  });
1407
1414
  return /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: n({
1408
1415
  setNodeRef: a,
1409
1416
  style: {
1410
- transform: rt.Transform.toString(o),
1417
+ transform: ft.Transform.toString(o),
1411
1418
  transition: s,
1412
1419
  zIndex: c ? 10 : void 0,
1413
1420
  opacity: c ? .5 : void 0
@@ -1416,155 +1423,251 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1416
1423
  attributes: r,
1417
1424
  isDragging: c
1418
1425
  }) });
1419
- }, Ht = ({ views: e, activeViewId: r, onViewChange: c, viewTypeIcons: l = {}, config: u = {}, onAddView: d, onRenameView: f, onDuplicateView: p, onDeleteView: m, onSetDefaultView: g, onShareView: _, onSaveAsView: ne, onPinView: re, onReorderViews: w, onChangeViewType: ie, onConfigView: ae, availableViewTypes: oe, hasUnsavedChanges: se = !1, onResetChanges: ce, className: le }) => {
1420
- let { showAddButton: ue = !0, inlineRename: O = !0, contextMenu: fe = !0, reorderable: pe = !1, maxVisibleTabs: me = 6, showIndicators: he = !0, showSaveAsView: ge = !0, showPinnedSection: A = !0, showVisibilityGroups: j = !1 } = u, [M, N] = s(null), [P, F] = s(""), I = o(null);
1426
+ }, Qt = ({ views: e, activeViewId: r, onViewChange: c, viewTypeIcons: l = {}, config: u = {}, onAddView: d, onRenameView: f, onDuplicateView: p, onDeleteView: m, onSetDefaultView: g, onShareView: _, onSaveAsView: w, onPinView: T, onReorderViews: E, onChangeViewType: D, onConfigView: ne, onManageViews: re, availableViewTypes: O, hasUnsavedChanges: ie = !1, onResetChanges: ae, className: oe }) => {
1427
+ let { showAddButton: se = !0, inlineRename: fe = !0, contextMenu: N = !0, reorderable: F = !1, maxVisibleTabs: pe = 6, showIndicators: me = !0, showSaveAsView: I = !0, showPinnedSection: he = !0, showVisibilityGroups: L = !1 } = u, [R, z] = s(null), [B, V] = s(""), ge = o(null);
1421
1428
  i(() => {
1422
- M && I.current && (I.current.focus(), I.current.select());
1423
- }, [M]);
1424
- let _e = n((t) => {
1425
- if (!O || !f) return;
1429
+ R && ge.current && (ge.current.focus(), ge.current.select());
1430
+ }, [R]);
1431
+ let H = n((t) => {
1432
+ if (!fe || !f) return;
1426
1433
  let n = e.find((e) => e.id === t);
1427
- n && (N(t), F(n.label));
1434
+ n && (n.readonly || (z(t), V(n.label)));
1428
1435
  }, [
1429
- O,
1436
+ fe,
1430
1437
  f,
1431
1438
  e
1432
- ]), ve = n(() => {
1433
- M && P.trim() && f && f(M, P.trim()), N(null), F("");
1439
+ ]), _e = n(() => {
1440
+ R && B.trim() && f && f(R, B.trim()), z(null), V("");
1434
1441
  }, [
1435
- M,
1436
- P,
1442
+ R,
1443
+ B,
1437
1444
  f
1438
- ]), ye = n(() => {
1439
- N(null), F("");
1440
- }, []), B = a(() => {
1445
+ ]), ve = n(() => {
1446
+ z(null), V("");
1447
+ }, []), ye = a(() => e.length > 0 && e.every((e) => !!e.readonly), [e]), J = a(() => {
1441
1448
  let t = [...e];
1442
1449
  return t.sort((e, t) => {
1443
- if (A) {
1450
+ if (he) {
1444
1451
  let n = +!!e.isPinned, r = +!!t.isPinned;
1445
1452
  if (n !== r) return r - n;
1446
1453
  }
1447
- if (j) {
1448
- let n = zt[e.visibility || "public"] ?? zt.public, r = zt[t.visibility || "public"] ?? zt.public;
1454
+ if (L) {
1455
+ let n = Yt[e.visibility || "public"] ?? Yt.public, r = Yt[t.visibility || "public"] ?? Yt.public;
1449
1456
  if (n !== r) return n - r;
1450
1457
  }
1451
1458
  return 0;
1452
1459
  }), t;
1453
1460
  }, [
1454
1461
  e,
1455
- A,
1456
- j
1457
- ]), V = B.slice(0, me), H = B.slice(me), U = Ze(Xe(Je, { activationConstraint: { distance: Bt } }), Xe(qe)), W = n((e) => {
1462
+ he,
1463
+ L
1464
+ ]), { visibleViews: be, overflowViews: xe } = a(() => {
1465
+ let e = J.slice(0, pe), t = J.slice(pe), n = t.findIndex((e) => e.id === r);
1466
+ if (n === -1) return {
1467
+ visibleViews: e,
1468
+ overflowViews: t
1469
+ };
1470
+ let i = t[n], a = e.length > 0 ? [...e.slice(0, -1), i] : [i], o = e.length > 0 ? e[e.length - 1] : null, s = t.filter((e, t) => t !== n);
1471
+ return o && s.unshift(o), {
1472
+ visibleViews: a,
1473
+ overflowViews: s
1474
+ };
1475
+ }, [
1476
+ J,
1477
+ pe,
1478
+ r
1479
+ ]), Se = at(it(nt, { activationConstraint: { distance: Xt } }), it(tt)), Ce = n((e) => {
1458
1480
  let { active: t, over: n } = e;
1459
- if (!n || t.id === n.id || !w) return;
1460
- let r = B.findIndex((e) => e.id === t.id), i = B.findIndex((e) => e.id === n.id);
1461
- r === -1 || i === -1 || w($e(B, r, i).map((e) => e.id));
1462
- }, [B, w]), Se = He, Ce = n((e) => {
1463
- if (!j || e === 0) return !1;
1464
- let t = V[e - 1], n = V[e], r = (e) => e.visibility === "private";
1481
+ if (!n || t.id === n.id || !E) return;
1482
+ let r = J.findIndex((e) => e.id === t.id), i = J.findIndex((e) => e.id === n.id);
1483
+ r === -1 || i === -1 || E(st(J, r, i).map((e) => e.id));
1484
+ }, [J, E]), Y = Xe, Ee = n((e) => {
1485
+ if (!L || e === 0) return !1;
1486
+ let t = be[e - 1], n = be[e], r = (e) => e.visibility === "private";
1465
1487
  return r(t) && !r(n);
1466
- }, [j, V]), we = (e, n) => {
1467
- let i = e.id === r, a = l[e.type] || Se, o = M === e.id, s = he && (e.hasActiveFilters || e.hasActiveSort), u = Ce(n), d = ((e) => j ? e.visibility === "private" ? /* @__PURE__ */ (0, X.jsx)(Ae, {
1488
+ }, [L, be]), De = (e, n) => {
1489
+ let i = e.id === r, a = l[e.type] || Y, o = R === e.id, s = me && (e.hasActiveFilters || e.hasActiveSort), u = Ee(n), d = !!e.readonly, h = ((e) => L ? e.visibility === "private" ? /* @__PURE__ */ (0, X.jsx)(Ie, {
1468
1490
  "data-testid": `view-tab-visibility-${e.id}`,
1469
1491
  className: "h-3 w-3 text-muted-foreground shrink-0"
1470
- }) : e.visibility ? /* @__PURE__ */ (0, X.jsx)(Ee, {
1492
+ }) : e.visibility ? /* @__PURE__ */ (0, X.jsx)(ke, {
1471
1493
  "data-testid": `view-tab-visibility-${e.id}`,
1472
1494
  className: "h-3 w-3 text-muted-foreground shrink-0"
1473
- }) : null : null)(e), h = (t) => /* @__PURE__ */ (0, X.jsxs)("button", {
1495
+ }) : null : null)(e), w = (t) => /* @__PURE__ */ (0, X.jsxs)("div", {
1474
1496
  "data-testid": `view-tab-${e.id}`,
1497
+ role: "tab",
1498
+ tabIndex: 0,
1499
+ "aria-selected": i,
1475
1500
  onClick: () => !o && c(e.id),
1476
- onDoubleClick: () => _e(e.id),
1477
- className: z("inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap relative", i ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"),
1501
+ onDoubleClick: () => H(e.id),
1502
+ onKeyDown: (t) => {
1503
+ !o && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), c(e.id));
1504
+ },
1505
+ ...t?.listeners ?? {},
1506
+ ...t?.attributes ?? {},
1507
+ className: q("group/tab inline-flex items-center gap-1.5 px-3 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap relative outline-none focus-visible:ring-2 focus-visible:ring-ring", t?.isDragging ? "cursor-grabbing" : "cursor-pointer", i ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"),
1478
1508
  children: [
1479
- pe && w && /* @__PURE__ */ (0, X.jsx)("span", {
1509
+ F && E && /* @__PURE__ */ (0, X.jsx)("span", {
1480
1510
  "data-testid": `view-tab-drag-handle-${e.id}`,
1481
- className: "cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground",
1482
- ...t?.listeners ?? {},
1483
- ...t?.attributes ?? {},
1484
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3" })
1511
+ "aria-hidden": "true",
1512
+ className: q("text-muted-foreground transition-opacity pointer-events-none", "opacity-0 group-hover/tab:opacity-100", t?.isDragging && "opacity-100"),
1513
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3" })
1485
1514
  }),
1486
- A && e.isPinned && /* @__PURE__ */ (0, X.jsx)(J, {
1515
+ he && e.isPinned && /* @__PURE__ */ (0, X.jsx)(Be, {
1487
1516
  "data-testid": `view-tab-pin-indicator-${e.id}`,
1488
1517
  className: "h-3 w-3 text-primary shrink-0"
1489
1518
  }),
1490
- d,
1519
+ h,
1491
1520
  /* @__PURE__ */ (0, X.jsx)(a, { className: "h-3.5 w-3.5" }),
1492
- o ? /* @__PURE__ */ (0, X.jsx)(k, {
1493
- ref: I,
1521
+ o ? /* @__PURE__ */ (0, X.jsx)(P, {
1522
+ ref: ge,
1494
1523
  "data-testid": `view-tab-rename-input-${e.id}`,
1495
- value: P,
1496
- onChange: (e) => F(e.target.value),
1497
- onBlur: ve,
1524
+ value: B,
1525
+ onChange: (e) => V(e.target.value),
1526
+ onBlur: _e,
1498
1527
  onKeyDown: (e) => {
1499
- e.key === "Enter" && ve(), e.key === "Escape" && ye();
1528
+ e.key === "Enter" && _e(), e.key === "Escape" && ve();
1500
1529
  },
1501
1530
  className: "h-5 w-24 px-1 py-0 text-sm border-none focus-visible:ring-1",
1502
1531
  onClick: (e) => e.stopPropagation()
1503
1532
  }) : /* @__PURE__ */ (0, X.jsx)("span", { children: e.label }),
1504
- s && /* @__PURE__ */ (0, X.jsxs)(be, { children: [/* @__PURE__ */ (0, X.jsx)(xe, {
1533
+ d && !ye && /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1534
+ asChild: !0,
1535
+ children: /* @__PURE__ */ (0, X.jsx)(Ie, {
1536
+ "data-testid": `view-tab-readonly-${e.id}`,
1537
+ "aria-label": "Read-only view",
1538
+ className: "h-3 w-3 text-muted-foreground shrink-0"
1539
+ })
1540
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1541
+ side: "bottom",
1542
+ className: "text-xs",
1543
+ children: e.readonlyReason || "System view — duplicate to customize."
1544
+ })] }),
1545
+ s && /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1505
1546
  asChild: !0,
1506
1547
  children: /* @__PURE__ */ (0, X.jsx)("span", {
1507
1548
  "data-testid": `view-tab-indicator-${e.id}`,
1508
1549
  className: "ml-1 inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-primary/15 text-[10px] font-medium text-primary px-1 shrink-0",
1509
1550
  children: [e.hasActiveFilters && "F", e.hasActiveSort && "S"].filter(Boolean).join("")
1510
1551
  })
1511
- }), /* @__PURE__ */ (0, X.jsx)(L, {
1552
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1512
1553
  side: "bottom",
1513
1554
  className: "text-xs",
1514
1555
  children: [e.hasActiveFilters && "Active filters", e.hasActiveSort && "Active sort"].filter(Boolean).join(", ")
1515
1556
  })] }),
1516
- e.isDefault && /* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-3 w-3 text-amber-500 fill-amber-500 shrink-0" }),
1517
- i && ae && /* @__PURE__ */ (0, X.jsx)("button", {
1518
- type: "button",
1519
- "data-testid": `view-tab-config-${e.id}`,
1520
- className: "ml-0.5 h-4 w-4 flex items-center justify-center rounded hover:bg-accent shrink-0 opacity-60 hover:opacity-100 transition-opacity",
1521
- onClick: (t) => {
1522
- t.stopPropagation(), ae(e.id);
1523
- },
1524
- "aria-label": `Configure ${e.label}`,
1525
- children: /* @__PURE__ */ (0, X.jsx)(Re, { className: "h-3 w-3" })
1526
- })
1557
+ e.isDefault && /* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-3 w-3 text-amber-500 fill-amber-500 shrink-0" }),
1558
+ i && (ne || f || p || m) && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1559
+ asChild: !0,
1560
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1561
+ type: "button",
1562
+ "data-testid": `view-tab-actions-${e.id}`,
1563
+ className: "ml-0.5 h-4 w-4 flex items-center justify-center rounded hover:bg-accent shrink-0 opacity-70 hover:opacity-100 transition-opacity",
1564
+ onClick: (e) => e.stopPropagation(),
1565
+ onPointerDown: (e) => e.stopPropagation(),
1566
+ onMouseDown: (e) => e.stopPropagation(),
1567
+ "aria-label": `View actions for ${e.label}`,
1568
+ children: /* @__PURE__ */ (0, X.jsx)(we, { className: "h-3 w-3" })
1569
+ })
1570
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1571
+ align: "start",
1572
+ className: "min-w-[180px]",
1573
+ onClick: (e) => e.stopPropagation(),
1574
+ children: [
1575
+ ne && !d && /* @__PURE__ */ (0, X.jsxs)(j, {
1576
+ "data-testid": `view-tab-menu-config-${e.id}`,
1577
+ onClick: () => ne(e.id),
1578
+ children: [/* @__PURE__ */ (0, X.jsx)(Ke, { className: "h-4 w-4 mr-2" }), " Edit view config"]
1579
+ }),
1580
+ f && !d && /* @__PURE__ */ (0, X.jsxs)(j, {
1581
+ "data-testid": `view-tab-menu-rename-${e.id}`,
1582
+ onClick: () => H(e.id),
1583
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1584
+ }),
1585
+ p && /* @__PURE__ */ (0, X.jsxs)(j, {
1586
+ "data-testid": `view-tab-menu-duplicate-${e.id}`,
1587
+ onClick: () => p(e.id),
1588
+ children: [/* @__PURE__ */ (0, X.jsx)(Te, { className: "h-4 w-4 mr-2" }), " Duplicate view"]
1589
+ }),
1590
+ _ && /* @__PURE__ */ (0, X.jsxs)(j, {
1591
+ "data-testid": `view-tab-menu-share-${e.id}`,
1592
+ onClick: () => _(e.id),
1593
+ children: [/* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4 mr-2" }), " Share view"]
1594
+ }),
1595
+ g && !d && /* @__PURE__ */ (0, X.jsxs)(j, {
1596
+ "data-testid": `view-tab-menu-default-${e.id}`,
1597
+ onClick: () => g(e.id),
1598
+ children: [/* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-4 w-4 mr-2" }), " Set as default"]
1599
+ }),
1600
+ T && !d && /* @__PURE__ */ (0, X.jsx)(j, {
1601
+ "data-testid": `view-tab-menu-pin-${e.id}`,
1602
+ onClick: () => T(e.id, !e.isPinned),
1603
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-2" }), " Unpin view"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Pin view"] })
1604
+ }),
1605
+ D && !d && O && O.length > 0 && /* @__PURE__ */ (0, X.jsxs)(ce, { children: [/* @__PURE__ */ (0, X.jsxs)(ue, {
1606
+ "data-testid": `view-tab-menu-change-type-${e.id}`,
1607
+ children: [/* @__PURE__ */ (0, X.jsx)(Ne, { className: "h-4 w-4 mr-2" }), " Change view type"]
1608
+ }), /* @__PURE__ */ (0, X.jsx)(le, { children: O.map((t) => {
1609
+ let n = l[t.type] || Y;
1610
+ return /* @__PURE__ */ (0, X.jsxs)(j, {
1611
+ "data-testid": `view-tab-menu-type-${e.id}-${t.type}`,
1612
+ disabled: t.type === e.type,
1613
+ onClick: () => D(e.id, t.type),
1614
+ children: [/* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ (0, X.jsx)("span", { children: t.label })]
1615
+ }, t.type);
1616
+ }) })] }),
1617
+ m && !d && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1618
+ "data-testid": `view-tab-menu-delete-${e.id}`,
1619
+ onClick: () => m(e.id),
1620
+ className: "text-destructive focus:text-destructive",
1621
+ children: [/* @__PURE__ */ (0, X.jsx)(Ze, { className: "h-4 w-4 mr-2" }), " Delete view"]
1622
+ })] }),
1623
+ re && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1624
+ "data-testid": `view-tab-menu-manage-${e.id}`,
1625
+ onClick: re,
1626
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1627
+ })] })
1628
+ ]
1629
+ })] })
1527
1630
  ]
1528
- }), ne = (t) => !fe || o ? t : /* @__PURE__ */ (0, X.jsxs)(v, { children: [/* @__PURE__ */ (0, X.jsx)(C, {
1631
+ }), ie = (t) => !N || o ? t : /* @__PURE__ */ (0, X.jsxs)(v, { children: [/* @__PURE__ */ (0, X.jsx)(C, {
1529
1632
  asChild: !0,
1530
1633
  children: t
1531
- }), /* @__PURE__ */ (0, X.jsxs)(y, { children: [
1532
- f && /* @__PURE__ */ (0, X.jsxs)(b, {
1634
+ }), /* @__PURE__ */ (0, X.jsxs)(ee, { children: [
1635
+ f && !d && /* @__PURE__ */ (0, X.jsxs)(y, {
1533
1636
  "data-testid": `context-menu-rename-${e.id}`,
1534
- onClick: () => _e(e.id),
1535
- children: [/* @__PURE__ */ (0, X.jsx)(Ne, { className: "h-4 w-4 mr-2" }), " Rename"]
1637
+ onClick: () => H(e.id),
1638
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1536
1639
  }),
1537
- p && /* @__PURE__ */ (0, X.jsxs)(b, {
1640
+ p && /* @__PURE__ */ (0, X.jsxs)(y, {
1538
1641
  "data-testid": `context-menu-duplicate-${e.id}`,
1539
1642
  onClick: () => p(e.id),
1540
- children: [/* @__PURE__ */ (0, X.jsx)(G, { className: "h-4 w-4 mr-2" }), " Duplicate View"]
1643
+ children: [/* @__PURE__ */ (0, X.jsx)(Te, { className: "h-4 w-4 mr-2" }), " Duplicate View"]
1541
1644
  }),
1542
- _ && /* @__PURE__ */ (0, X.jsxs)(b, {
1645
+ _ && /* @__PURE__ */ (0, X.jsxs)(y, {
1543
1646
  "data-testid": `context-menu-share-${e.id}`,
1544
1647
  onClick: () => _(e.id),
1545
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Share View"]
1648
+ children: [/* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4 mr-2" }), " Share View"]
1546
1649
  }),
1547
- g && /* @__PURE__ */ (0, X.jsxs)(b, {
1650
+ g && !d && /* @__PURE__ */ (0, X.jsxs)(y, {
1548
1651
  "data-testid": `context-menu-default-${e.id}`,
1549
1652
  onClick: () => g(e.id),
1550
- children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-2" }), " Set as Default"]
1653
+ children: [/* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-4 w-4 mr-2" }), " Set as Default"]
1551
1654
  }),
1552
- re && /* @__PURE__ */ (0, X.jsx)(b, {
1655
+ T && !d && /* @__PURE__ */ (0, X.jsx)(y, {
1553
1656
  "data-testid": `context-menu-pin-${e.id}`,
1554
- onClick: () => re(e.id, !e.isPinned),
1555
- children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Pe, { className: "h-4 w-4 mr-2" }), " Unpin View"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(J, { className: "h-4 w-4 mr-2" }), " Pin View"] })
1657
+ onClick: () => T(e.id, !e.isPinned),
1658
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-2" }), " Unpin View"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Pin View"] })
1556
1659
  }),
1557
- ie && oe && oe.length > 0 && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(x, {}), /* @__PURE__ */ (0, X.jsxs)(ee, { children: [/* @__PURE__ */ (0, X.jsxs)(S, {
1660
+ D && !d && O && O.length > 0 && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(b, {}), /* @__PURE__ */ (0, X.jsxs)(te, { children: [/* @__PURE__ */ (0, X.jsxs)(S, {
1558
1661
  "data-testid": `context-menu-change-type-${e.id}`,
1559
- children: [/* @__PURE__ */ (0, X.jsx)(Oe, { className: "h-4 w-4 mr-2" }), " Change View Type"]
1560
- }), /* @__PURE__ */ (0, X.jsx)(te, {
1662
+ children: [/* @__PURE__ */ (0, X.jsx)(Ne, { className: "h-4 w-4 mr-2" }), " Change View Type"]
1663
+ }), /* @__PURE__ */ (0, X.jsx)(x, {
1561
1664
  "data-testid": `context-menu-type-submenu-${e.id}`,
1562
- children: oe.map((t) => {
1563
- let n = l[t.type] || Se;
1564
- return /* @__PURE__ */ (0, X.jsxs)(b, {
1665
+ children: O.map((t) => {
1666
+ let n = l[t.type] || Y;
1667
+ return /* @__PURE__ */ (0, X.jsxs)(y, {
1565
1668
  "data-testid": `context-menu-type-${e.id}-${t.type}`,
1566
1669
  disabled: t.type === e.type,
1567
- onClick: () => ie(e.id, t.type),
1670
+ onClick: () => D(e.id, t.type),
1568
1671
  children: [/* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ (0, X.jsxs)("div", {
1569
1672
  className: "flex flex-col",
1570
1673
  children: [/* @__PURE__ */ (0, X.jsx)("span", { children: t.label }), t.description && /* @__PURE__ */ (0, X.jsx)("span", {
@@ -1575,118 +1678,423 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1575
1678
  }, t.type);
1576
1679
  })
1577
1680
  })] })] }),
1578
- m && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(x, {}), /* @__PURE__ */ (0, X.jsxs)(b, {
1681
+ m && !d && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(b, {}), /* @__PURE__ */ (0, X.jsxs)(y, {
1579
1682
  "data-testid": `context-menu-delete-${e.id}`,
1580
1683
  onClick: () => m(e.id),
1581
1684
  className: "text-destructive focus:text-destructive",
1582
- children: [/* @__PURE__ */ (0, X.jsx)(Ue, { className: "h-4 w-4 mr-2" }), " Delete View"]
1685
+ children: [/* @__PURE__ */ (0, X.jsx)(Ze, { className: "h-4 w-4 mr-2" }), " Delete View"]
1686
+ })] }),
1687
+ re && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(b, {}), /* @__PURE__ */ (0, X.jsxs)(y, {
1688
+ "data-testid": `context-menu-manage-${e.id}`,
1689
+ onClick: re,
1690
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1583
1691
  })] })
1584
1692
  ] })] });
1585
- return pe && w ? /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1693
+ return F && E ? /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1586
1694
  "data-testid": "view-tab-visibility-separator",
1587
1695
  className: "w-px h-5 bg-border mx-1 self-center shrink-0"
1588
- }), /* @__PURE__ */ (0, X.jsx)(Vt, {
1696
+ }), /* @__PURE__ */ (0, X.jsx)(Zt, {
1589
1697
  id: e.id,
1590
1698
  children: ({ setNodeRef: e, style: t, listeners: n, attributes: r, isDragging: i }) => /* @__PURE__ */ (0, X.jsx)("div", {
1591
1699
  ref: e,
1592
1700
  style: t,
1593
- className: z("flex", i && "z-10"),
1594
- children: ne(h({
1701
+ className: q("flex", i && "z-10"),
1702
+ children: ie(w({
1595
1703
  listeners: n,
1596
- attributes: r
1704
+ attributes: r,
1705
+ isDragging: i
1597
1706
  }))
1598
1707
  })
1599
1708
  })] }, e.id) : /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1600
1709
  "data-testid": "view-tab-visibility-separator",
1601
1710
  className: "w-px h-5 bg-border mx-1 self-center shrink-0"
1602
- }), ne(h())] }, e.id);
1603
- }, Te = /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: V.map((e, t) => we(e, t)) });
1604
- return /* @__PURE__ */ (0, X.jsx)(R, { children: /* @__PURE__ */ (0, X.jsxs)("div", {
1711
+ }), ie(w())] }, e.id);
1712
+ }, Oe = /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: be.map((e, t) => De(e, t)) });
1713
+ return /* @__PURE__ */ (0, X.jsx)(G, { children: /* @__PURE__ */ (0, X.jsxs)("div", {
1605
1714
  "data-testid": "view-tab-bar",
1606
- className: z("flex items-center gap-0.5 -mb-px", le),
1715
+ className: q("flex items-center gap-0.5 -mb-px", oe),
1607
1716
  children: [
1608
- pe && w ? /* @__PURE__ */ (0, X.jsx)(Ke, {
1609
- sensors: U,
1610
- collisionDetection: Ye,
1611
- onDragEnd: W,
1612
- children: /* @__PURE__ */ (0, X.jsx)(Qe, {
1613
- items: V.map((e) => e.id),
1614
- strategy: et,
1717
+ F && E ? /* @__PURE__ */ (0, X.jsx)(et, {
1718
+ sensors: Se,
1719
+ collisionDetection: rt,
1720
+ onDragEnd: Ce,
1721
+ children: /* @__PURE__ */ (0, X.jsx)(ot, {
1722
+ items: be.map((e) => e.id),
1723
+ strategy: ct,
1615
1724
  children: /* @__PURE__ */ (0, X.jsx)("div", {
1616
1725
  "data-testid": "view-tab-sortable-container",
1617
1726
  className: "flex items-center gap-0.5",
1618
- children: Te
1727
+ children: Oe
1619
1728
  })
1620
1729
  })
1621
- }) : Te,
1622
- H.length > 0 && /* @__PURE__ */ (0, X.jsxs)(de, { children: [/* @__PURE__ */ (0, X.jsx)(D, {
1730
+ }) : Oe,
1731
+ xe.length > 0 && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1623
1732
  asChild: !0,
1624
1733
  children: /* @__PURE__ */ (0, X.jsxs)("button", {
1625
1734
  "data-testid": "view-tab-overflow",
1626
1735
  className: "inline-flex items-center gap-1 px-2 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors",
1627
- children: [/* @__PURE__ */ (0, X.jsx)(Me, { className: "h-4 w-4" }), /* @__PURE__ */ (0, X.jsxs)("span", {
1736
+ children: [/* @__PURE__ */ (0, X.jsx)(Re, { className: "h-4 w-4" }), /* @__PURE__ */ (0, X.jsxs)("span", {
1628
1737
  className: "text-xs",
1629
- children: [H.length, " more"]
1738
+ children: [xe.length, " more"]
1630
1739
  })]
1631
1740
  })
1632
- }), /* @__PURE__ */ (0, X.jsx)(T, {
1741
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1633
1742
  align: "end",
1634
- children: H.map((e) => {
1635
- let t = l[e.type] || Se;
1636
- return /* @__PURE__ */ (0, X.jsxs)(E, {
1743
+ children: [re && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsxs)(j, {
1744
+ "data-testid": "view-tab-overflow-manage",
1745
+ onClick: re,
1746
+ className: "font-medium",
1747
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1748
+ }), /* @__PURE__ */ (0, X.jsx)(M, {})] }), xe.map((e) => {
1749
+ let t = l[e.type] || Y;
1750
+ return /* @__PURE__ */ (0, X.jsxs)(j, {
1637
1751
  "data-testid": `view-tab-overflow-${e.id}`,
1638
1752
  onClick: () => c(e.id),
1639
1753
  children: [
1640
- e.isPinned && /* @__PURE__ */ (0, X.jsx)(J, { className: "h-3 w-3 mr-1 text-primary shrink-0" }),
1754
+ e.isPinned && /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-3 w-3 mr-1 text-primary shrink-0" }),
1641
1755
  /* @__PURE__ */ (0, X.jsx)(t, { className: "h-4 w-4 mr-2" }),
1642
1756
  e.label,
1643
- he && (e.hasActiveFilters || e.hasActiveSort) && /* @__PURE__ */ (0, X.jsx)("span", {
1757
+ me && (e.hasActiveFilters || e.hasActiveSort) && /* @__PURE__ */ (0, X.jsx)("span", {
1644
1758
  className: "ml-auto inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-primary/15 text-[10px] font-medium text-primary px-1",
1645
1759
  children: [e.hasActiveFilters && "F", e.hasActiveSort && "S"].filter(Boolean).join("")
1646
1760
  })
1647
1761
  ]
1648
1762
  }, e.id);
1649
- })
1763
+ })]
1650
1764
  })] }),
1651
- ue && d && /* @__PURE__ */ (0, X.jsxs)(be, { children: [/* @__PURE__ */ (0, X.jsx)(xe, {
1765
+ se && d && /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1652
1766
  asChild: !0,
1653
1767
  children: /* @__PURE__ */ (0, X.jsx)("button", {
1654
1768
  "data-testid": "view-tab-add",
1655
1769
  onClick: d,
1656
1770
  className: "inline-flex items-center px-2 py-2 text-muted-foreground hover:text-foreground transition-colors",
1657
- children: /* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4" })
1771
+ children: /* @__PURE__ */ (0, X.jsx)(He, { className: "h-4 w-4" })
1658
1772
  })
1659
- }), /* @__PURE__ */ (0, X.jsx)(L, { children: "Add View" })] }),
1660
- ge && se && /* @__PURE__ */ (0, X.jsxs)("div", {
1773
+ }), /* @__PURE__ */ (0, X.jsx)(W, { children: "Add View" })] }),
1774
+ I && ie && /* @__PURE__ */ (0, X.jsxs)("div", {
1661
1775
  "data-testid": "view-tab-save-as",
1662
1776
  className: "flex items-center gap-1 ml-2 text-xs text-amber-600 dark:text-amber-400",
1663
1777
  children: [
1664
- /* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3.5 w-3.5" }),
1778
+ /* @__PURE__ */ (0, X.jsx)(Ue, { className: "h-3.5 w-3.5" }),
1665
1779
  /* @__PURE__ */ (0, X.jsx)("span", {
1666
1780
  className: "hidden sm:inline",
1667
1781
  children: "Unsaved changes"
1668
1782
  }),
1669
- ne && /* @__PURE__ */ (0, X.jsx)(h, {
1783
+ w && /* @__PURE__ */ (0, X.jsx)(h, {
1670
1784
  variant: "ghost",
1671
1785
  size: "sm",
1672
1786
  "data-testid": "view-tab-save-as-btn",
1673
1787
  className: "h-6 px-2 text-xs",
1674
- onClick: ne,
1788
+ onClick: w,
1675
1789
  children: "Save as View"
1676
1790
  }),
1677
- ce && /* @__PURE__ */ (0, X.jsx)(h, {
1791
+ ae && /* @__PURE__ */ (0, X.jsx)(h, {
1678
1792
  variant: "ghost",
1679
1793
  size: "sm",
1680
1794
  "data-testid": "view-tab-reset-btn",
1681
1795
  className: "h-6 px-2 text-xs",
1682
- onClick: ce,
1796
+ onClick: ae,
1683
1797
  children: "Reset"
1684
1798
  })
1685
1799
  ]
1686
1800
  })
1687
1801
  ]
1688
1802
  }) });
1689
- }, Ut = {
1803
+ }, $t = Xe, en = ({ view: e, isActive: t, Icon: r, isRenaming: a, onStartRename: c, onCommitRename: l, onCancelRename: u, onRowClick: d, onDelete: f, onDuplicate: p, onSetDefault: m, onSetPinned: h, onConfigView: g }) => {
1804
+ let { attributes: _, listeners: v, setNodeRef: ee, transform: y, transition: b, isDragging: te } = ut({ id: e.id }), x = {
1805
+ transform: ft.Transform.toString(y),
1806
+ transition: b,
1807
+ opacity: te ? .5 : 1
1808
+ }, S = o(null), [C, w] = s(e.label), T = !!e.readonly;
1809
+ i(() => {
1810
+ a && (w(e.label), requestAnimationFrame(() => {
1811
+ S.current?.focus(), S.current?.select();
1812
+ }));
1813
+ }, [a, e.label]);
1814
+ let E = n(() => {
1815
+ let t = C.trim();
1816
+ t && t !== e.label ? l(e.id, t) : u();
1817
+ }, [
1818
+ C,
1819
+ e.id,
1820
+ e.label,
1821
+ l,
1822
+ u
1823
+ ]);
1824
+ return /* @__PURE__ */ (0, X.jsxs)("li", {
1825
+ ref: ee,
1826
+ style: x,
1827
+ "data-testid": `manage-views-row-${e.id}`,
1828
+ className: q("group/row flex items-center gap-2 px-2 py-2 rounded-md border border-transparent", "hover:bg-accent/50 transition-colors", t && "bg-accent/40 border-border", te && "shadow-md bg-background border-border z-10"),
1829
+ children: [
1830
+ /* @__PURE__ */ (0, X.jsx)("button", {
1831
+ type: "button",
1832
+ ..._,
1833
+ ...v,
1834
+ "aria-label": "Drag to reorder",
1835
+ "data-testid": `manage-views-drag-${e.id}`,
1836
+ className: "shrink-0 h-6 w-5 flex items-center justify-center text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing rounded hover:bg-accent",
1837
+ onClick: (e) => e.stopPropagation(),
1838
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-4 w-4" })
1839
+ }),
1840
+ /* @__PURE__ */ (0, X.jsx)(r, { className: "shrink-0 h-4 w-4 text-muted-foreground" }),
1841
+ /* @__PURE__ */ (0, X.jsx)("div", {
1842
+ className: "flex-1 min-w-0",
1843
+ onClick: () => {
1844
+ a || d?.(e.id);
1845
+ },
1846
+ children: a ? /* @__PURE__ */ (0, X.jsx)(P, {
1847
+ ref: S,
1848
+ value: C,
1849
+ onChange: (e) => w(e.target.value),
1850
+ onBlur: E,
1851
+ onKeyDown: (e) => {
1852
+ e.key === "Enter" ? (e.preventDefault(), E()) : e.key === "Escape" && (e.preventDefault(), u());
1853
+ },
1854
+ onClick: (e) => e.stopPropagation(),
1855
+ className: "h-7 text-sm",
1856
+ "data-testid": `manage-views-rename-input-${e.id}`
1857
+ }) : /* @__PURE__ */ (0, X.jsxs)("button", {
1858
+ type: "button",
1859
+ className: "w-full text-left text-sm font-medium truncate cursor-pointer flex items-center gap-1.5",
1860
+ onDoubleClick: (t) => {
1861
+ t.stopPropagation(), T || c(e.id);
1862
+ },
1863
+ title: e.label,
1864
+ children: [
1865
+ /* @__PURE__ */ (0, X.jsx)("span", {
1866
+ className: "truncate",
1867
+ children: e.label
1868
+ }),
1869
+ T && /* @__PURE__ */ (0, X.jsx)(Ie, {
1870
+ "aria-label": "Read-only view",
1871
+ "data-testid": `manage-views-readonly-${e.id}`,
1872
+ className: "h-3 w-3 text-muted-foreground shrink-0"
1873
+ }),
1874
+ e.isDefault && /* @__PURE__ */ (0, X.jsxs)("span", {
1875
+ className: "ml-1 inline-flex items-center text-[10px] uppercase tracking-wide text-muted-foreground",
1876
+ title: "Default view",
1877
+ children: [/* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-3 w-3 mr-0.5 fill-current" }), " default"]
1878
+ })
1879
+ ]
1880
+ })
1881
+ }),
1882
+ h && !a && !T && /* @__PURE__ */ (0, X.jsx)(G, {
1883
+ delayDuration: 300,
1884
+ children: /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1885
+ asChild: !0,
1886
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1887
+ type: "button",
1888
+ "aria-label": e.isPinned ? "Unpin view" : "Pin view",
1889
+ "data-testid": `manage-views-pin-${e.id}`,
1890
+ onClick: (t) => {
1891
+ t.stopPropagation(), h(e.id, !e.isPinned);
1892
+ },
1893
+ className: q("shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent transition-colors", e.isPinned ? "text-amber-500" : "text-muted-foreground/40 opacity-0 group-hover/row:opacity-100"),
1894
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 fill-current" }) : /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4" })
1895
+ })
1896
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1897
+ side: "top",
1898
+ children: e.isPinned ? "Unpin view" : "Pin view"
1899
+ })] })
1900
+ }),
1901
+ m && !a && !e.isDefault && !T && /* @__PURE__ */ (0, X.jsx)(G, {
1902
+ delayDuration: 300,
1903
+ children: /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1904
+ asChild: !0,
1905
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1906
+ type: "button",
1907
+ "aria-label": "Set as default",
1908
+ "data-testid": `manage-views-default-${e.id}`,
1909
+ onClick: (t) => {
1910
+ t.stopPropagation(), m(e.id);
1911
+ },
1912
+ className: "shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground/40 hover:text-foreground opacity-0 group-hover/row:opacity-100 transition-colors",
1913
+ children: /* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-4 w-4" })
1914
+ })
1915
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1916
+ side: "top",
1917
+ children: "Set as default"
1918
+ })] })
1919
+ }),
1920
+ !a && (f || p || g || m) && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1921
+ asChild: !0,
1922
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1923
+ type: "button",
1924
+ "aria-label": `Actions for ${e.label}`,
1925
+ "data-testid": `manage-views-actions-${e.id}`,
1926
+ onClick: (e) => e.stopPropagation(),
1927
+ className: "shrink-0 h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground opacity-60 group-hover/row:opacity-100 transition-opacity",
1928
+ children: /* @__PURE__ */ (0, X.jsx)(Re, { className: "h-4 w-4" })
1929
+ })
1930
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1931
+ align: "end",
1932
+ className: "min-w-[180px]",
1933
+ children: [
1934
+ !T && /* @__PURE__ */ (0, X.jsxs)(j, {
1935
+ "data-testid": `manage-views-action-rename-${e.id}`,
1936
+ onClick: () => c(e.id),
1937
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1938
+ }),
1939
+ p && /* @__PURE__ */ (0, X.jsxs)(j, {
1940
+ "data-testid": `manage-views-action-duplicate-${e.id}`,
1941
+ onClick: () => p(e.id),
1942
+ children: [/* @__PURE__ */ (0, X.jsx)(Te, { className: "h-4 w-4 mr-2" }), " Duplicate"]
1943
+ }),
1944
+ g && !T && /* @__PURE__ */ (0, X.jsxs)(j, {
1945
+ "data-testid": `manage-views-action-config-${e.id}`,
1946
+ onClick: () => g(e.id),
1947
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Edit configuration…"]
1948
+ }),
1949
+ m && !e.isDefault && !T && /* @__PURE__ */ (0, X.jsxs)(j, {
1950
+ "data-testid": `manage-views-action-default-${e.id}`,
1951
+ onClick: () => m(e.id),
1952
+ children: [/* @__PURE__ */ (0, X.jsx)(Ye, { className: "h-4 w-4 mr-2" }), " Set as default"]
1953
+ }),
1954
+ h && !T && /* @__PURE__ */ (0, X.jsx)(j, {
1955
+ "data-testid": `manage-views-action-pin-${e.id}`,
1956
+ onClick: () => h(e.id, !e.isPinned),
1957
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-2" }), " Unpin"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Pin"] })
1958
+ }),
1959
+ f && !T && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1960
+ "data-testid": `manage-views-action-delete-${e.id}`,
1961
+ onClick: () => f(e.id),
1962
+ className: "text-destructive focus:text-destructive",
1963
+ children: [/* @__PURE__ */ (0, X.jsx)(Ze, { className: "h-4 w-4 mr-2" }), " Delete"]
1964
+ })] })
1965
+ ]
1966
+ })] }),
1967
+ a && /* @__PURE__ */ (0, X.jsxs)("div", {
1968
+ className: "flex items-center gap-1 shrink-0",
1969
+ children: [/* @__PURE__ */ (0, X.jsx)("button", {
1970
+ type: "button",
1971
+ "aria-label": "Save name",
1972
+ onMouseDown: (e) => e.preventDefault(),
1973
+ onClick: E,
1974
+ className: "h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-emerald-600",
1975
+ children: /* @__PURE__ */ (0, X.jsx)(Ce, { className: "h-4 w-4" })
1976
+ }), /* @__PURE__ */ (0, X.jsx)("button", {
1977
+ type: "button",
1978
+ "aria-label": "Cancel rename",
1979
+ onMouseDown: (e) => e.preventDefault(),
1980
+ onClick: u,
1981
+ className: "h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground",
1982
+ children: /* @__PURE__ */ (0, X.jsx)(Qe, { className: "h-4 w-4" })
1983
+ })]
1984
+ })
1985
+ ]
1986
+ });
1987
+ }, tn = ({ open: e, onOpenChange: t, views: n, activeViewId: r, viewTypeIcons: o = {}, onRename: c, onDelete: l, onDuplicate: u, onSetDefault: d, onSetPinned: f, onReorder: p, onAddView: m, onConfigView: g }) => {
1988
+ let [_, v] = s(""), [ee, y] = s(null), [b, te] = s(() => n.map((e) => e.id));
1989
+ i(() => {
1990
+ te(n.map((e) => e.id));
1991
+ }, [n]), i(() => {
1992
+ e || (y(null), v(""));
1993
+ }, [e]);
1994
+ let x = a(() => {
1995
+ let e = new Map(n.map((e) => [e.id, e]));
1996
+ return b.map((t) => e.get(t)).filter(Boolean);
1997
+ }, [b, n]), S = a(() => {
1998
+ if (!_.trim()) return x;
1999
+ let e = _.toLowerCase();
2000
+ return x.filter((t) => t.label.toLowerCase().includes(e));
2001
+ }, [x, _]), C = at(it(nt, { activationConstraint: { distance: 5 } }), it(tt, { coordinateGetter: lt })), O = (e) => {
2002
+ let { active: t, over: n } = e;
2003
+ if (!n || t.id === n.id) return;
2004
+ let r = b.indexOf(String(t.id)), i = b.indexOf(String(n.id));
2005
+ if (r < 0 || i < 0) return;
2006
+ let a = st(b, r, i);
2007
+ te(a), p?.(a);
2008
+ }, ie = (e) => {
2009
+ t(!1), requestAnimationFrame(() => g?.(e));
2010
+ };
2011
+ return /* @__PURE__ */ (0, X.jsx)(w, {
2012
+ open: e,
2013
+ onOpenChange: t,
2014
+ children: /* @__PURE__ */ (0, X.jsxs)(T, {
2015
+ className: "sm:max-w-[560px] p-0 gap-0 overflow-hidden",
2016
+ "data-testid": "manage-views-dialog",
2017
+ children: [
2018
+ /* @__PURE__ */ (0, X.jsxs)(ne, {
2019
+ className: "px-5 pt-5 pb-3",
2020
+ children: [/* @__PURE__ */ (0, X.jsx)(re, {
2021
+ className: "text-base",
2022
+ children: "Manage views"
2023
+ }), /* @__PURE__ */ (0, X.jsx)(E, {
2024
+ className: "text-xs",
2025
+ children: "Reorder, rename, pin, or delete every view in this object."
2026
+ })]
2027
+ }),
2028
+ /* @__PURE__ */ (0, X.jsx)("div", {
2029
+ className: "px-5 pb-3",
2030
+ children: /* @__PURE__ */ (0, X.jsxs)("div", {
2031
+ className: "relative",
2032
+ children: [/* @__PURE__ */ (0, X.jsx)(We, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" }), /* @__PURE__ */ (0, X.jsx)(P, {
2033
+ value: _,
2034
+ onChange: (e) => v(e.target.value),
2035
+ placeholder: "Search views",
2036
+ className: "pl-8 h-9",
2037
+ "data-testid": "manage-views-search"
2038
+ })]
2039
+ })
2040
+ }),
2041
+ /* @__PURE__ */ (0, X.jsx)("div", {
2042
+ className: "px-3 pb-3 max-h-[55vh] overflow-y-auto",
2043
+ "data-testid": "manage-views-list",
2044
+ children: S.length === 0 ? /* @__PURE__ */ (0, X.jsx)("div", {
2045
+ className: "text-center text-sm text-muted-foreground py-10",
2046
+ children: "No views match your search."
2047
+ }) : /* @__PURE__ */ (0, X.jsx)(et, {
2048
+ sensors: C,
2049
+ collisionDetection: rt,
2050
+ onDragEnd: O,
2051
+ children: /* @__PURE__ */ (0, X.jsx)(ot, {
2052
+ items: S.map((e) => e.id),
2053
+ strategy: dt,
2054
+ children: /* @__PURE__ */ (0, X.jsx)("ul", {
2055
+ className: "space-y-0.5",
2056
+ children: S.map((e) => /* @__PURE__ */ (0, X.jsx)(en, {
2057
+ view: e,
2058
+ Icon: o[e.type] || $t,
2059
+ isActive: e.id === r,
2060
+ isRenaming: ee === e.id,
2061
+ onStartRename: (e) => y(e),
2062
+ onCancelRename: () => y(null),
2063
+ onCommitRename: (e, t) => {
2064
+ y(null), c?.(e, t);
2065
+ },
2066
+ onDelete: l,
2067
+ onDuplicate: u,
2068
+ onSetDefault: d,
2069
+ onSetPinned: f,
2070
+ onConfigView: g ? ie : void 0
2071
+ }, e.id))
2072
+ })
2073
+ })
2074
+ })
2075
+ }),
2076
+ /* @__PURE__ */ (0, X.jsxs)(D, {
2077
+ className: "border-t bg-muted/30 px-5 py-3 flex sm:justify-between gap-2",
2078
+ children: [m ? /* @__PURE__ */ (0, X.jsxs)(h, {
2079
+ variant: "ghost",
2080
+ size: "sm",
2081
+ onClick: () => {
2082
+ t(!1), requestAnimationFrame(() => m());
2083
+ },
2084
+ "data-testid": "manage-views-add",
2085
+ className: "text-sm",
2086
+ children: [/* @__PURE__ */ (0, X.jsx)(He, { className: "h-4 w-4 mr-1.5" }), " Add new view"]
2087
+ }) : /* @__PURE__ */ (0, X.jsx)("span", {}), /* @__PURE__ */ (0, X.jsx)(h, {
2088
+ size: "sm",
2089
+ onClick: () => t(!1),
2090
+ "data-testid": "manage-views-done",
2091
+ children: "Done"
2092
+ })]
2093
+ })
2094
+ ]
2095
+ })
2096
+ });
2097
+ }, nn = {
1690
2098
  "=": "equals",
1691
2099
  "==": "equals",
1692
2100
  "!=": "notEquals",
@@ -1715,7 +2123,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1715
2123
  isEmpty: "isEmpty",
1716
2124
  isNotEmpty: "isNotEmpty",
1717
2125
  notIn: "notIn"
1718
- }, Wt = {
2126
+ }, rn = {
1719
2127
  equals: "=",
1720
2128
  notEquals: "!=",
1721
2129
  greaterThan: ">",
@@ -1732,7 +2140,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1732
2140
  after: "after",
1733
2141
  between: "between"
1734
2142
  };
1735
- function Gt(e) {
2143
+ function an(e) {
1736
2144
  let t = (e || "").toLowerCase();
1737
2145
  return [
1738
2146
  "integer",
@@ -1768,39 +2176,39 @@ function Gt(e) {
1768
2176
  "owner"
1769
2177
  ].includes(t) ? "select" : "text";
1770
2178
  }
1771
- function Kt(e) {
2179
+ function on(e) {
1772
2180
  if (!Array.isArray(e) || e.length < 2) return null;
1773
2181
  let [t, n, r] = e;
1774
2182
  return typeof t != "string" || typeof n != "string" ? null : {
1775
2183
  id: crypto.randomUUID(),
1776
2184
  field: t,
1777
- operator: Ut[n] || n,
2185
+ operator: nn[n] || n,
1778
2186
  value: r ?? ""
1779
2187
  };
1780
2188
  }
1781
- function qt(e) {
2189
+ function sn(e) {
1782
2190
  if (Array.isArray(e)) {
1783
- let t = Kt(e);
2191
+ let t = on(e);
1784
2192
  return t ? [t] : [];
1785
2193
  }
1786
2194
  return typeof e == "object" && e && e.field ? [{
1787
2195
  id: e.id || crypto.randomUUID(),
1788
2196
  field: e.field,
1789
- operator: Ut[e.operator] || e.operator || "equals",
2197
+ operator: nn[e.operator] || e.operator || "equals",
1790
2198
  value: e.value ?? ""
1791
2199
  }] : [];
1792
2200
  }
1793
- function Jt(e) {
2201
+ function cn(e) {
1794
2202
  if (!Array.isArray(e) || e.length === 0) return {
1795
2203
  logic: "and",
1796
2204
  conditions: []
1797
2205
  };
1798
2206
  if (typeof e[0] == "string" && (e[0] === "and" || e[0] === "or")) return {
1799
2207
  logic: e[0],
1800
- conditions: e.slice(1).flatMap((e) => qt(e))
2208
+ conditions: e.slice(1).flatMap((e) => sn(e))
1801
2209
  };
1802
2210
  if (e.length >= 2 && e.length <= 3 && typeof e[0] == "string" && typeof e[1] == "string" && !Array.isArray(e[0]) && !Array.isArray(e[2])) {
1803
- let t = Kt(e);
2211
+ let t = on(e);
1804
2212
  return {
1805
2213
  logic: "and",
1806
2214
  conditions: t ? [t] : []
@@ -1808,29 +2216,29 @@ function Jt(e) {
1808
2216
  }
1809
2217
  if (Array.isArray(e[0]) || typeof e[0] == "object" && e[0] !== null && !Array.isArray(e[0])) return {
1810
2218
  logic: "and",
1811
- conditions: e.flatMap((e) => qt(e))
2219
+ conditions: e.flatMap((e) => sn(e))
1812
2220
  };
1813
- let t = Kt(e);
2221
+ let t = on(e);
1814
2222
  return {
1815
2223
  logic: "and",
1816
2224
  conditions: t ? [t] : []
1817
2225
  };
1818
2226
  }
1819
- function Yt(e, t) {
2227
+ function ln(e, t) {
1820
2228
  let n = t.filter((e) => e.field).map((e) => [
1821
2229
  e.field,
1822
- Wt[e.operator] || e.operator,
2230
+ rn[e.operator] || e.operator,
1823
2231
  e.value
1824
2232
  ]);
1825
2233
  return n.length === 0 ? [] : n.length === 1 && e === "and" ? n[0] : e === "or" ? ["or", ...n] : n;
1826
2234
  }
1827
- function Xt(e) {
2235
+ function un(e) {
1828
2236
  return e.split(",").map((e) => e.trim()).filter(Boolean);
1829
2237
  }
1830
- function Zt(e) {
2238
+ function dn(e) {
1831
2239
  return e.split(",").map((e) => Number(e.trim())).filter((e) => !isNaN(e) && e > 0);
1832
2240
  }
1833
- var Qt = {
2241
+ var fn = {
1834
2242
  grid: "Grid",
1835
2243
  kanban: "Kanban",
1836
2244
  calendar: "Calendar",
@@ -1839,7 +2247,7 @@ var Qt = {
1839
2247
  gantt: "Gantt",
1840
2248
  map: "Map",
1841
2249
  chart: "Chart"
1842
- }, $t = Object.keys(Qt), en = [
2250
+ }, pn = Object.keys(fn), mn = [
1843
2251
  {
1844
2252
  value: "compact",
1845
2253
  gapClass: "gap-0"
@@ -1861,23 +2269,23 @@ var Qt = {
1861
2269
  gapClass: "gap-1.5"
1862
2270
  }
1863
2271
  ];
1864
- function tn(e) {
2272
+ function hn(e) {
1865
2273
  return e.fields ? Object.entries(e.fields).map(([e, t]) => ({
1866
2274
  value: e,
1867
2275
  label: t.label || e,
1868
- type: Gt(t.type),
2276
+ type: an(t.type),
1869
2277
  options: t.options
1870
2278
  })) : [];
1871
2279
  }
1872
- function nn(e) {
1873
- let t = Jt(e);
2280
+ function gn(e) {
2281
+ let t = cn(e);
1874
2282
  return {
1875
2283
  id: "root",
1876
2284
  logic: t.logic,
1877
2285
  conditions: t.conditions
1878
2286
  };
1879
2287
  }
1880
- function rn(e) {
2288
+ function _n(e) {
1881
2289
  return (Array.isArray(e) ? e : []).map((e) => ({
1882
2290
  id: e.id || crypto.randomUUID(),
1883
2291
  field: e.field || "",
@@ -1890,13 +2298,13 @@ function Z({ renderSummary: e, children: n }) {
1890
2298
  let [r, i] = t.useState(!1);
1891
2299
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [e(() => i((e) => !e)), r && n] });
1892
2300
  }
1893
- var an = 5;
1894
- function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a }) {
1895
- let { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = tt({ id: e });
2301
+ var vn = 5;
2302
+ function yn({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a }) {
2303
+ let { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = ut({ id: e });
1896
2304
  return /* @__PURE__ */ (0, X.jsxs)("div", {
1897
2305
  ref: c,
1898
2306
  style: {
1899
- transform: rt.Transform.toString(l),
2307
+ transform: ft.Transform.toString(l),
1900
2308
  transition: u,
1901
2309
  zIndex: d ? 10 : void 0,
1902
2310
  opacity: d ? .5 : void 0
@@ -1910,7 +2318,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1910
2318
  ...s,
1911
2319
  className: "shrink-0 cursor-grab touch-none",
1912
2320
  "data-testid": `col-drag-handle-${e}`,
1913
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 text-muted-foreground/50" })
2321
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 text-muted-foreground/50" })
1914
2322
  }),
1915
2323
  /* @__PURE__ */ (0, X.jsx)("button", {
1916
2324
  type: "button",
@@ -1918,7 +2326,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1918
2326
  className: "h-5 w-5 flex items-center justify-center rounded hover:bg-accent shrink-0",
1919
2327
  onClick: () => i(e, !1),
1920
2328
  "aria-label": `Hide ${t}`,
1921
- children: /* @__PURE__ */ (0, X.jsx)(Se, { className: "h-3.5 w-3.5 text-primary" })
2329
+ children: /* @__PURE__ */ (0, X.jsx)(Y, { className: "h-3.5 w-3.5 text-primary" })
1922
2330
  }),
1923
2331
  /* @__PURE__ */ (0, X.jsx)("span", {
1924
2332
  className: "truncate flex-1",
@@ -1931,7 +2339,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1931
2339
  disabled: n === 0,
1932
2340
  onClick: () => a(e, "up"),
1933
2341
  "aria-label": `Move ${t} up`,
1934
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 rotate-90" })
2342
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 rotate-90" })
1935
2343
  }),
1936
2344
  /* @__PURE__ */ (0, X.jsx)("button", {
1937
2345
  type: "button",
@@ -1940,25 +2348,25 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1940
2348
  disabled: n === r - 1,
1941
2349
  onClick: () => a(e, "down"),
1942
2350
  "aria-label": `Move ${t} down`,
1943
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 -rotate-90" })
2351
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 -rotate-90" })
1944
2352
  })
1945
2353
  ]
1946
2354
  });
1947
2355
  }
1948
- function sn({ columns: e, fieldOptions: n, onToggle: r, onMove: i, onReorder: a }) {
1949
- return /* @__PURE__ */ (0, X.jsx)(Ke, {
1950
- sensors: Ze(Xe(Je, { activationConstraint: { distance: an } }), Xe(qe)),
1951
- collisionDetection: Ye,
2356
+ function bn({ columns: e, fieldOptions: n, onToggle: r, onMove: i, onReorder: a }) {
2357
+ return /* @__PURE__ */ (0, X.jsx)(et, {
2358
+ sensors: at(it(nt, { activationConstraint: { distance: vn } }), it(tt)),
2359
+ collisionDetection: rt,
1952
2360
  onDragEnd: t.useCallback((t) => {
1953
2361
  let { active: n, over: r } = t;
1954
2362
  if (!r || n.id === r.id) return;
1955
2363
  let i = e.indexOf(String(n.id)), o = e.indexOf(String(r.id));
1956
- i === -1 || o === -1 || a($e(e, i, o));
2364
+ i === -1 || o === -1 || a(st(e, i, o));
1957
2365
  }, [e, a]),
1958
- children: /* @__PURE__ */ (0, X.jsx)(Qe, {
2366
+ children: /* @__PURE__ */ (0, X.jsx)(ot, {
1959
2367
  items: e,
1960
- strategy: nt,
1961
- children: e.map((t, a) => /* @__PURE__ */ (0, X.jsx)(on, {
2368
+ strategy: dt,
2369
+ children: e.map((t, a) => /* @__PURE__ */ (0, X.jsx)(yn, {
1962
2370
  colName: t,
1963
2371
  label: n.find((e) => e.value === t)?.label || t,
1964
2372
  idx: a,
@@ -1969,41 +2377,57 @@ function sn({ columns: e, fieldOptions: n, onToggle: r, onMove: i, onReorder: a
1969
2377
  })
1970
2378
  });
1971
2379
  }
1972
- var Q = (e) => e.type == null || e.type === "grid", cn = (e) => e.type == null || [
2380
+ var xn = [
2381
+ "general",
2382
+ "data",
2383
+ "appearance",
2384
+ "toolbar",
2385
+ "userActions",
2386
+ "navigation",
2387
+ "exportPrint"
2388
+ ], Sn = [
2389
+ "general",
2390
+ "data",
2391
+ "appearance"
2392
+ ], Q = (e) => e.type == null || e.type === "grid", Cn = (e) => e.type == null || [
1973
2393
  "grid",
1974
2394
  "kanban",
1975
2395
  "gallery"
1976
- ].includes(e.type), ln = (e) => e.type == null || [
2396
+ ].includes(e.type), wn = (e) => e.type == null || [
1977
2397
  "grid",
1978
2398
  "calendar",
1979
2399
  "timeline",
1980
2400
  "gantt"
1981
- ].includes(e.type), un = (e) => e.type == null || ["grid", "kanban"].includes(e.type), dn = (e) => e.type == null || ["grid", "kanban"].includes(e.type), fn = (e) => e.type == null || ["grid", "gallery"].includes(e.type);
1982
- function pn(e) {
1983
- let { t, fieldOptions: n, objectDef: r, updateField: i, filterGroupValue: a, sortItemsValue: o } = e, s = n.map((e) => ({
2401
+ ].includes(e.type), Tn = (e) => e.type == null || ["grid", "kanban"].includes(e.type), En = (e) => e.type == null || ["grid", "kanban"].includes(e.type), Dn = (e) => e.type == null || ["grid", "gallery"].includes(e.type);
2402
+ function On(e) {
2403
+ let { t, fieldOptions: n, objectDef: r, updateField: i, filterGroupValue: a, sortItemsValue: o, essentialOnly: s = !1 } = e, c = n.map((e) => ({
1984
2404
  value: e.value,
1985
2405
  label: e.label
1986
- })), c = [{
2406
+ })), l = [{
1987
2407
  value: "",
1988
2408
  label: t("console.objectView.none")
1989
- }, ...s];
2409
+ }, ...c], u = [
2410
+ kn(t, r),
2411
+ An(t),
2412
+ jn(t, i),
2413
+ Mn(t, i),
2414
+ Nn(t, i),
2415
+ Pn(t, n, l, r, i, a, o),
2416
+ Fn(t, n, l, i),
2417
+ In(t, i),
2418
+ Ln(t, i),
2419
+ Rn(t, i)
2420
+ ], d = s ? u.filter((e) => xn.includes(e.key)).map((e) => Sn.includes(e.key) ? e : {
2421
+ ...e,
2422
+ collapsible: !0,
2423
+ defaultCollapsed: !0
2424
+ }) : u;
1990
2425
  return {
1991
2426
  breadcrumb: [t("console.objectView.page")],
1992
- sections: [
1993
- mn(t, r),
1994
- hn(t),
1995
- gn(t, i),
1996
- _n(t, i),
1997
- vn(t, i),
1998
- yn(t, n, c, r, i, a, o),
1999
- bn(t, n, c, i),
2000
- xn(t, i),
2001
- Sn(t, i),
2002
- Cn(t, i)
2003
- ]
2427
+ sections: d
2004
2428
  };
2005
2429
  }
2006
- function mn(e, t) {
2430
+ function kn(e, t) {
2007
2431
  return {
2008
2432
  key: "general",
2009
2433
  title: e("console.objectView.general"),
@@ -2015,7 +2439,7 @@ function mn(e, t) {
2015
2439
  type: "custom",
2016
2440
  render: (t, n) => /* @__PURE__ */ (0, X.jsx)(_, {
2017
2441
  label: e("console.objectView.title"),
2018
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2442
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2019
2443
  "data-testid": "view-title-input",
2020
2444
  className: "h-7 text-xs w-32 text-right",
2021
2445
  value: t || "",
@@ -2029,7 +2453,7 @@ function mn(e, t) {
2029
2453
  type: "custom",
2030
2454
  render: (n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2031
2455
  label: e("console.objectView.description"),
2032
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2456
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2033
2457
  "data-testid": "view-description-input",
2034
2458
  className: "h-7 text-xs w-32 text-right",
2035
2459
  value: n ?? "",
@@ -2049,9 +2473,9 @@ function mn(e, t) {
2049
2473
  className: "text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground",
2050
2474
  value: t || "grid",
2051
2475
  onChange: (e) => n(e.target.value),
2052
- children: $t.map((e) => /* @__PURE__ */ (0, X.jsx)("option", {
2476
+ children: pn.map((e) => /* @__PURE__ */ (0, X.jsx)("option", {
2053
2477
  value: e,
2054
- children: Qt[e]
2478
+ children: fn[e]
2055
2479
  }, e))
2056
2480
  })
2057
2481
  })
@@ -2059,7 +2483,7 @@ function mn(e, t) {
2059
2483
  ]
2060
2484
  };
2061
2485
  }
2062
- function hn(e) {
2486
+ function An(e) {
2063
2487
  let t = [
2064
2488
  "showSearch",
2065
2489
  "showSort",
@@ -2099,13 +2523,13 @@ function hn(e) {
2099
2523
  $("showSort", e("console.objectView.enableSort"), "toggle-showSort", !0),
2100
2524
  $("showFilters", e("console.objectView.enableFilter"), "toggle-showFilters", !0),
2101
2525
  $("showHideFields", e("console.objectView.enableHideFields"), "toggle-showHideFields", !0),
2102
- $("showGroup", e("console.objectView.enableGroup"), "toggle-showGroup", !0, !1, void 0, cn),
2103
- $("showColor", e("console.objectView.enableColor"), "toggle-showColor", !0, !1, void 0, ln),
2526
+ $("showGroup", e("console.objectView.enableGroup"), "toggle-showGroup", !0, !1, void 0, Cn),
2527
+ $("showColor", e("console.objectView.enableColor"), "toggle-showColor", !0, !1, void 0, wn),
2104
2528
  $("showDensity", e("console.objectView.enableDensity"), "toggle-showDensity", !0, !1, void 0, Q)
2105
2529
  ]
2106
2530
  };
2107
2531
  }
2108
- function gn(e, t) {
2532
+ function jn(e, t) {
2109
2533
  return {
2110
2534
  key: "navigation",
2111
2535
  title: e("console.objectView.navigationSection"),
@@ -2180,7 +2604,7 @@ function gn(e, t) {
2180
2604
  let a = i.navigation?.mode || "page";
2181
2605
  return /* @__PURE__ */ (0, X.jsx)(_, {
2182
2606
  label: e("console.objectView.navigationWidth"),
2183
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2607
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2184
2608
  "data-testid": "input-navigation-width",
2185
2609
  className: "h-7 text-xs w-24 text-right",
2186
2610
  value: i.navigation?.width ?? "",
@@ -2204,7 +2628,7 @@ function gn(e, t) {
2204
2628
  let a = i.navigation?.mode || "page";
2205
2629
  return /* @__PURE__ */ (0, X.jsx)(_, {
2206
2630
  label: e("console.objectView.openNewTab"),
2207
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2631
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2208
2632
  "data-testid": "toggle-navigation-openNewTab",
2209
2633
  checked: i.navigation?.openNewTab === !0,
2210
2634
  onCheckedChange: (e) => t("navigation", {
@@ -2220,7 +2644,7 @@ function gn(e, t) {
2220
2644
  ]
2221
2645
  };
2222
2646
  }
2223
- function _n(e, t) {
2647
+ function Mn(e, t) {
2224
2648
  return {
2225
2649
  key: "records",
2226
2650
  title: e("console.objectView.records"),
@@ -2262,7 +2686,7 @@ function _n(e, t) {
2262
2686
  let a = i.addRecordViaForm === !0 || i.addRecord?.enabled === !0;
2263
2687
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(_, {
2264
2688
  label: e("console.objectView.addRecordEnabled"),
2265
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2689
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2266
2690
  "data-testid": "toggle-addRecord-enabled",
2267
2691
  checked: a,
2268
2692
  onCheckedChange: (e) => {
@@ -2323,7 +2747,7 @@ function _n(e, t) {
2323
2747
  }),
2324
2748
  /* @__PURE__ */ (0, X.jsx)(_, {
2325
2749
  label: e("console.objectView.addRecordFormView"),
2326
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2750
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2327
2751
  "data-testid": "input-addRecord-formView",
2328
2752
  className: "h-7 text-xs w-24 text-right",
2329
2753
  value: i.addRecord?.formView ?? "",
@@ -2339,7 +2763,7 @@ function _n(e, t) {
2339
2763
  }]
2340
2764
  };
2341
2765
  }
2342
- function vn(e, t) {
2766
+ function Nn(e, t) {
2343
2767
  return {
2344
2768
  key: "exportPrint",
2345
2769
  title: e("console.objectView.exportPrint"),
@@ -2355,7 +2779,7 @@ function vn(e, t) {
2355
2779
  let a = i.exportOptions != null || i.allowExport === !0;
2356
2780
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(_, {
2357
2781
  label: e("console.objectView.allowExport"),
2358
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2782
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2359
2783
  "data-testid": "toggle-allowExport",
2360
2784
  checked: a,
2361
2785
  onCheckedChange: (e) => t("allowExport", e),
@@ -2391,7 +2815,7 @@ function vn(e, t) {
2391
2815
  }),
2392
2816
  /* @__PURE__ */ (0, X.jsx)(_, {
2393
2817
  label: e("console.objectView.exportMaxRecords"),
2394
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2818
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2395
2819
  "data-testid": "input-export-maxRecords",
2396
2820
  className: "h-7 text-xs w-20 text-right",
2397
2821
  type: "number",
@@ -2405,7 +2829,7 @@ function vn(e, t) {
2405
2829
  }),
2406
2830
  /* @__PURE__ */ (0, X.jsx)(_, {
2407
2831
  label: e("console.objectView.exportIncludeHeaders"),
2408
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2832
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2409
2833
  "data-testid": "toggle-export-includeHeaders",
2410
2834
  checked: i.exportOptions?.includeHeaders !== !1,
2411
2835
  onCheckedChange: (e) => t("exportOptions", {
@@ -2417,7 +2841,7 @@ function vn(e, t) {
2417
2841
  }),
2418
2842
  /* @__PURE__ */ (0, X.jsx)(_, {
2419
2843
  label: e("console.objectView.exportFileNamePrefix"),
2420
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2844
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2421
2845
  "data-testid": "input-export-fileNamePrefix",
2422
2846
  className: "h-7 text-xs w-24 text-right",
2423
2847
  value: i.exportOptions?.fileNamePrefix ?? "",
@@ -2436,7 +2860,7 @@ function vn(e, t) {
2436
2860
  ]
2437
2861
  };
2438
2862
  }
2439
- function yn(e, t, n, r, i, a, o) {
2863
+ function Pn(e, t, n, r, i, a, o) {
2440
2864
  return {
2441
2865
  key: "data",
2442
2866
  title: e("console.objectView.data"),
@@ -2478,7 +2902,7 @@ function yn(e, t, n, r, i, a, o) {
2478
2902
  children: [/* @__PURE__ */ (0, X.jsxs)("div", {
2479
2903
  className: "flex items-center gap-1 pb-1",
2480
2904
  children: [
2481
- /* @__PURE__ */ (0, X.jsx)(k, {
2905
+ /* @__PURE__ */ (0, X.jsx)(P, {
2482
2906
  "data-testid": "column-search-input",
2483
2907
  className: "h-6 text-xs flex-1",
2484
2908
  placeholder: e("console.objectView.searchFields"),
@@ -2516,7 +2940,7 @@ function yn(e, t, n, r, i, a, o) {
2516
2940
  children: [Array.isArray(a.columns) && a.columns.length > 0 && /* @__PURE__ */ (0, X.jsx)("div", {
2517
2941
  "data-testid": "selected-columns",
2518
2942
  className: "space-y-0.5 pb-1 mb-1 border-b border-border/50",
2519
- children: /* @__PURE__ */ (0, X.jsx)(sn, {
2943
+ children: /* @__PURE__ */ (0, X.jsx)(bn, {
2520
2944
  columns: a.columns,
2521
2945
  fieldOptions: t,
2522
2946
  onToggle: c,
@@ -2533,14 +2957,14 @@ function yn(e, t, n, r, i, a, o) {
2533
2957
  "data-field-label": e.label,
2534
2958
  className: "flex items-center gap-1 text-xs cursor-pointer hover:bg-accent/50 rounded-sm py-0.5 px-1 -mx-1",
2535
2959
  children: [
2536
- /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 text-muted-foreground/20 shrink-0" }),
2960
+ /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 text-muted-foreground/20 shrink-0" }),
2537
2961
  /* @__PURE__ */ (0, X.jsx)("button", {
2538
2962
  type: "button",
2539
2963
  "data-testid": `col-eye-${e.value}`,
2540
2964
  className: "h-5 w-5 flex items-center justify-center rounded hover:bg-accent shrink-0",
2541
2965
  onClick: () => c(e.value, !0),
2542
2966
  "aria-label": `Show ${e.label}`,
2543
- children: /* @__PURE__ */ (0, X.jsx)(Ce, { className: "h-3.5 w-3.5 text-muted-foreground" })
2967
+ children: /* @__PURE__ */ (0, X.jsx)(Ee, { className: "h-3.5 w-3.5 text-muted-foreground" })
2544
2968
  }),
2545
2969
  /* @__PURE__ */ (0, X.jsx)("span", {
2546
2970
  className: "truncate text-muted-foreground",
@@ -2568,11 +2992,11 @@ function yn(e, t, n, r, i, a, o) {
2568
2992
  children: /* @__PURE__ */ (0, X.jsx)("div", {
2569
2993
  "data-testid": "inline-filter-builder",
2570
2994
  className: "pb-2",
2571
- children: /* @__PURE__ */ (0, X.jsx)(O, {
2995
+ children: /* @__PURE__ */ (0, X.jsx)(fe, {
2572
2996
  fields: t,
2573
2997
  value: a,
2574
2998
  onChange: (e) => {
2575
- i("filter", Yt(e.logic, e.conditions.map((e) => ({
2999
+ i("filter", ln(e.logic, e.conditions.map((e) => ({
2576
3000
  field: e.field,
2577
3001
  operator: e.operator,
2578
3002
  value: e.value
@@ -2600,7 +3024,7 @@ function yn(e, t, n, r, i, a, o) {
2600
3024
  children: /* @__PURE__ */ (0, X.jsx)("div", {
2601
3025
  "data-testid": "inline-sort-builder",
2602
3026
  className: "pb-2",
2603
- children: /* @__PURE__ */ (0, X.jsx)(F, {
3027
+ children: /* @__PURE__ */ (0, X.jsx)(ge, {
2604
3028
  fields: t.map((e) => ({
2605
3029
  value: e.value,
2606
3030
  label: e.label
@@ -2620,31 +3044,38 @@ function yn(e, t, n, r, i, a, o) {
2620
3044
  }
2621
3045
  },
2622
3046
  {
2623
- key: "_groupBy",
3047
+ key: "_grouping",
2624
3048
  label: e("console.objectView.groupBy"),
2625
3049
  type: "custom",
2626
- visibleWhen: fn,
3050
+ visibleWhen: Dn,
2627
3051
  render: (n, r, a) => {
2628
- let o = a.type || "grid", s = a.kanban?.groupByField || a.kanban?.groupField || a.groupBy || "";
3052
+ let o = Array.isArray(a.grouping?.fields) && a.grouping.fields.length ? { fields: a.grouping.fields.map((e) => ({
3053
+ field: e.field,
3054
+ order: e.order === "desc" ? "desc" : "asc",
3055
+ collapsed: !!e.collapsed
3056
+ })) } : a.groupBy || a.groupBy2 ? { fields: [a.groupBy && {
3057
+ field: a.groupBy,
3058
+ order: "asc",
3059
+ collapsed: !1
3060
+ }, a.groupBy2 && {
3061
+ field: a.groupBy2,
3062
+ order: "asc",
3063
+ collapsed: !1
3064
+ }].filter(Boolean) } : void 0;
2629
3065
  return /* @__PURE__ */ (0, X.jsx)(_, {
2630
3066
  label: e("console.objectView.groupBy"),
2631
- children: /* @__PURE__ */ (0, X.jsxs)("select", {
2632
- "data-testid": "data-groupBy",
2633
- className: "text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground max-w-[120px]",
2634
- value: s,
2635
- onChange: (e) => {
2636
- i("groupBy", e.target.value), o === "kanban" && i("kanban", {
2637
- ...a.kanban || {},
2638
- groupByField: e.target.value
2639
- });
3067
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3068
+ value: o,
3069
+ fieldOptions: t,
3070
+ maxLevels: 3,
3071
+ labels: {
3072
+ addGroup: e("console.objectView.addGroup", "Add group field"),
3073
+ collapseTitle: e("console.objectView.collapsedByDefault", "Collapsed by default"),
3074
+ removeTitle: e("console.objectView.removeGroup", "Remove")
2640
3075
  },
2641
- children: [/* @__PURE__ */ (0, X.jsx)("option", {
2642
- value: "",
2643
- children: e("console.objectView.none")
2644
- }), t.map((e) => /* @__PURE__ */ (0, X.jsx)("option", {
2645
- value: e.value,
2646
- children: e.label
2647
- }, e.value))]
3076
+ onChange: (e) => {
3077
+ i("grouping", e), i("groupBy", e?.fields?.[0]?.field || void 0), i("groupBy2", e?.fields?.[1]?.field || void 0);
3078
+ }
2648
3079
  })
2649
3080
  });
2650
3081
  }
@@ -2655,7 +3086,7 @@ function yn(e, t, n, r, i, a, o) {
2655
3086
  type: "custom",
2656
3087
  render: (t, n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2657
3088
  label: e("console.objectView.pageSize"),
2658
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3089
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2659
3090
  "data-testid": "input-pagination-pageSize",
2660
3091
  className: "h-7 text-xs w-20 text-right",
2661
3092
  type: "number",
@@ -2677,13 +3108,13 @@ function yn(e, t, n, r, i, a, o) {
2677
3108
  type: "custom",
2678
3109
  render: (t, n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2679
3110
  label: e("console.objectView.pageSizeOptions"),
2680
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3111
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
2681
3112
  "data-testid": "input-pagination-pageSizeOptions",
2682
3113
  className: "h-7 text-xs w-28 text-right",
2683
3114
  value: (r.pagination?.pageSizeOptions || []).join(", "),
2684
3115
  placeholder: "10, 25, 50, 100",
2685
3116
  onChange: (e) => {
2686
- let t = Zt(e.target.value);
3117
+ let t = dn(e.target.value);
2687
3118
  i("pagination", {
2688
3119
  ...r.pagination || {},
2689
3120
  pageSizeOptions: t.length ? t : void 0
@@ -2692,9 +3123,9 @@ function yn(e, t, n, r, i, a, o) {
2692
3123
  })
2693
3124
  })
2694
3125
  },
2695
- wn("searchableFields", e("console.objectView.searchableFields"), "searchable-fields-selector", "searchable-field", t, i, "selected"),
2696
- wn("filterableFields", e("console.objectView.filterableFields"), "filterable-fields-selector", "filterable-field", t, i, "selected"),
2697
- wn("hiddenFields", e("console.objectView.hiddenFields"), "hidden-fields-selector", "hidden-field", t, i, "hidden"),
3126
+ zn("searchableFields", e("console.objectView.searchableFields"), "searchable-fields-selector", "searchable-field", t, i, "selected"),
3127
+ zn("filterableFields", e("console.objectView.filterableFields"), "filterable-fields-selector", "filterable-field", t, i, "selected"),
3128
+ zn("hiddenFields", e("console.objectView.hiddenFields"), "hidden-fields-selector", "hidden-field", t, i, "hidden"),
2698
3129
  {
2699
3130
  key: "_quickFilters",
2700
3131
  label: e("console.objectView.quickFilters"),
@@ -2711,7 +3142,7 @@ function yn(e, t, n, r, i, a, o) {
2711
3142
  children: [(r.quickFilters || []).map((e, t) => /* @__PURE__ */ (0, X.jsxs)("div", {
2712
3143
  className: "flex items-center gap-1 text-xs",
2713
3144
  children: [
2714
- /* @__PURE__ */ (0, X.jsx)(k, {
3145
+ /* @__PURE__ */ (0, X.jsx)(P, {
2715
3146
  "data-testid": `quick-filter-label-${t}`,
2716
3147
  className: "h-6 text-xs flex-1",
2717
3148
  value: e.label || "",
@@ -2873,7 +3304,7 @@ function yn(e, t, n, r, i, a, o) {
2873
3304
  "data-testid": `uf-tab-${n}`,
2874
3305
  className: "flex items-center gap-1 text-xs",
2875
3306
  children: [
2876
- /* @__PURE__ */ (0, X.jsx)(k, {
3307
+ /* @__PURE__ */ (0, X.jsx)(P, {
2877
3308
  "data-testid": `uf-tab-label-${n}`,
2878
3309
  className: "h-6 text-xs flex-1",
2879
3310
  value: t.label || "",
@@ -3148,7 +3579,7 @@ function yn(e, t, n, r, i, a, o) {
3148
3579
  ]
3149
3580
  };
3150
3581
  }
3151
- function bn(e, t, n, r) {
3582
+ function Fn(e, t, n, r) {
3152
3583
  return {
3153
3584
  key: "appearance",
3154
3585
  title: e("console.objectView.appearance"),
@@ -3161,7 +3592,7 @@ function bn(e, t, n, r) {
3161
3592
  key: "color",
3162
3593
  label: e("console.objectView.color"),
3163
3594
  type: "custom",
3164
- visibleWhen: ln,
3595
+ visibleWhen: wn,
3165
3596
  render: (n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
3166
3597
  label: e("console.objectView.color"),
3167
3598
  children: /* @__PURE__ */ (0, X.jsxs)("select", {
@@ -3194,7 +3625,7 @@ function bn(e, t, n, r) {
3194
3625
  "data-testid": "appearance-rowHeight",
3195
3626
  role: "radiogroup",
3196
3627
  "aria-label": e("console.objectView.rowHeight"),
3197
- children: en.map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
3628
+ children: mn.map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
3198
3629
  type: "button",
3199
3630
  role: "radio",
3200
3631
  "aria-checked": (t || "compact") === e.value,
@@ -3219,7 +3650,7 @@ function bn(e, t, n, r) {
3219
3650
  key: "_conditionalFormatting",
3220
3651
  label: e("console.objectView.conditionalFormatting"),
3221
3652
  type: "custom",
3222
- visibleWhen: un,
3653
+ visibleWhen: Tn,
3223
3654
  render: (n, i, a) => /* @__PURE__ */ (0, X.jsx)(Z, {
3224
3655
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3225
3656
  label: e("console.objectView.conditionalFormatting"),
@@ -3289,7 +3720,7 @@ function bn(e, t, n, r) {
3289
3720
  })
3290
3721
  ]
3291
3722
  }),
3292
- /* @__PURE__ */ (0, X.jsx)(k, {
3723
+ /* @__PURE__ */ (0, X.jsx)(P, {
3293
3724
  "data-testid": `cf-value-${n}`,
3294
3725
  className: "h-6 text-xs w-16",
3295
3726
  value: String(e.value ?? ""),
@@ -3335,7 +3766,7 @@ function bn(e, t, n, r) {
3335
3766
  render: (t, n, i) => /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [
3336
3767
  /* @__PURE__ */ (0, X.jsx)(_, {
3337
3768
  label: e("console.objectView.emptyStateTitle"),
3338
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3769
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3339
3770
  "data-testid": "input-emptyState-title",
3340
3771
  className: "h-7 text-xs w-28 text-right",
3341
3772
  value: i.emptyState?.title ?? "",
@@ -3347,7 +3778,7 @@ function bn(e, t, n, r) {
3347
3778
  }),
3348
3779
  /* @__PURE__ */ (0, X.jsx)(_, {
3349
3780
  label: e("console.objectView.emptyStateMessage"),
3350
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3781
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3351
3782
  "data-testid": "input-emptyState-message",
3352
3783
  className: "h-7 text-xs w-28 text-right",
3353
3784
  value: i.emptyState?.message ?? "",
@@ -3359,7 +3790,7 @@ function bn(e, t, n, r) {
3359
3790
  }),
3360
3791
  /* @__PURE__ */ (0, X.jsx)(_, {
3361
3792
  label: e("console.objectView.emptyStateIcon"),
3362
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3793
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3363
3794
  "data-testid": "input-emptyState-icon",
3364
3795
  className: "h-7 text-xs w-28 text-right",
3365
3796
  value: i.emptyState?.icon ?? "",
@@ -3374,7 +3805,7 @@ function bn(e, t, n, r) {
3374
3805
  ]
3375
3806
  };
3376
3807
  }
3377
- function xn(e, t) {
3808
+ function In(e, t) {
3378
3809
  return {
3379
3810
  key: "userActions",
3380
3811
  title: e("console.objectView.userActions"),
@@ -3387,7 +3818,7 @@ function xn(e, t) {
3387
3818
  key: "_rowActions",
3388
3819
  label: e("console.objectView.rowActions"),
3389
3820
  type: "custom",
3390
- visibleWhen: dn,
3821
+ visibleWhen: En,
3391
3822
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(Z, {
3392
3823
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3393
3824
  label: e("console.objectView.rowActions"),
@@ -3397,13 +3828,13 @@ function xn(e, t) {
3397
3828
  children: /* @__PURE__ */ (0, X.jsx)("div", {
3398
3829
  "data-testid": "row-actions-selector",
3399
3830
  className: "pb-2 space-y-0.5 max-h-36 overflow-auto",
3400
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3831
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3401
3832
  "data-testid": "input-rowActions",
3402
3833
  className: "h-7 text-xs w-full",
3403
3834
  value: (i.rowActions || []).join(", "),
3404
3835
  placeholder: "edit, delete, duplicate",
3405
3836
  onChange: (e) => {
3406
- t("rowActions", Xt(e.target.value));
3837
+ t("rowActions", un(e.target.value));
3407
3838
  }
3408
3839
  })
3409
3840
  })
@@ -3413,7 +3844,7 @@ function xn(e, t) {
3413
3844
  key: "_bulkActions",
3414
3845
  label: e("console.objectView.bulkActions"),
3415
3846
  type: "custom",
3416
- visibleWhen: dn,
3847
+ visibleWhen: En,
3417
3848
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(Z, {
3418
3849
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3419
3850
  label: e("console.objectView.bulkActions"),
@@ -3423,13 +3854,13 @@ function xn(e, t) {
3423
3854
  children: /* @__PURE__ */ (0, X.jsx)("div", {
3424
3855
  "data-testid": "bulk-actions-selector",
3425
3856
  className: "pb-2 space-y-0.5 max-h-36 overflow-auto",
3426
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3857
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3427
3858
  "data-testid": "input-bulkActions",
3428
3859
  className: "h-7 text-xs w-full",
3429
3860
  value: (i.bulkActions || []).join(", "),
3430
3861
  placeholder: "delete, export, assign",
3431
3862
  onChange: (e) => {
3432
- t("bulkActions", Xt(e.target.value));
3863
+ t("bulkActions", un(e.target.value));
3433
3864
  }
3434
3865
  })
3435
3866
  })
@@ -3438,7 +3869,7 @@ function xn(e, t) {
3438
3869
  ]
3439
3870
  };
3440
3871
  }
3441
- function Sn(e, t) {
3872
+ function Ln(e, t) {
3442
3873
  return {
3443
3874
  key: "sharing",
3444
3875
  title: e("console.objectView.sharing"),
@@ -3450,7 +3881,7 @@ function Sn(e, t) {
3450
3881
  type: "custom",
3451
3882
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3452
3883
  label: e("console.objectView.sharingEnabled"),
3453
- children: /* @__PURE__ */ (0, X.jsx)(I, {
3884
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
3454
3885
  "data-testid": "toggle-sharing-enabled",
3455
3886
  checked: i.sharing?.enabled === !0,
3456
3887
  onCheckedChange: (e) => t("sharing", {
@@ -3499,7 +3930,7 @@ function Sn(e, t) {
3499
3930
  }]
3500
3931
  };
3501
3932
  }
3502
- function Cn(e, t) {
3933
+ function Rn(e, t) {
3503
3934
  return {
3504
3935
  key: "accessibility",
3505
3936
  title: e("console.objectView.accessibility"),
@@ -3512,7 +3943,7 @@ function Cn(e, t) {
3512
3943
  type: "custom",
3513
3944
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3514
3945
  label: e("console.objectView.ariaLabel"),
3515
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3946
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3516
3947
  "data-testid": "input-aria-label",
3517
3948
  className: "h-7 text-xs w-28 text-right",
3518
3949
  value: i.aria?.label ?? "",
@@ -3529,7 +3960,7 @@ function Cn(e, t) {
3529
3960
  type: "custom",
3530
3961
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3531
3962
  label: e("console.objectView.ariaDescribedBy"),
3532
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3963
+ children: /* @__PURE__ */ (0, X.jsx)(P, {
3533
3964
  "data-testid": "input-aria-describedBy",
3534
3965
  className: "h-7 text-xs w-28 text-right",
3535
3966
  value: i.aria?.describedBy ?? "",
@@ -3583,7 +4014,7 @@ function $(e, t, n, r = !1, i = !1, a, o) {
3583
4014
  visibleWhen: o,
3584
4015
  render: (e, o, s) => /* @__PURE__ */ (0, X.jsx)(_, {
3585
4016
  label: t,
3586
- children: /* @__PURE__ */ (0, X.jsx)(I, {
4017
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
3587
4018
  "data-testid": n,
3588
4019
  checked: i ? e === !0 : r ? e !== !1 : !!e,
3589
4020
  disabled: a ? a(s) : !1,
@@ -3593,7 +4024,7 @@ function $(e, t, n, r = !1, i = !1, a, o) {
3593
4024
  })
3594
4025
  };
3595
4026
  }
3596
- function wn(e, t, n, r, i, a, o, s) {
4027
+ function zn(e, t, n, r, i, a, o, s) {
3597
4028
  return {
3598
4029
  key: `_${e}`,
3599
4030
  label: t,
@@ -3629,11 +4060,11 @@ function wn(e, t, n, r, i, a, o, s) {
3629
4060
  }
3630
4061
  //#endregion
3631
4062
  //#region src/index.tsx
3632
- var Tn = d, En = ({ schema: e }) => /* @__PURE__ */ (0, X.jsx)(Et, {
4063
+ var Bn = d, Vn = ({ schema: e }) => /* @__PURE__ */ (0, X.jsx)(It, {
3633
4064
  schema: e,
3634
- dataSource: r(Tn)?.dataSource ?? null
4065
+ dataSource: r(Bn)?.dataSource ?? null
3635
4066
  });
3636
- c.register("object-view", En, {
4067
+ c.register("object-view", Vn, {
3637
4068
  namespace: "plugin-view",
3638
4069
  label: "Object View",
3639
4070
  category: "view",
@@ -3739,11 +4170,11 @@ c.register("object-view", En, {
3739
4170
  showRefresh: !0,
3740
4171
  showViewSwitcher: !0
3741
4172
  }
3742
- }), c.register("view", En, {
4173
+ }), c.register("view", Vn, {
3743
4174
  namespace: "plugin-view",
3744
4175
  label: "View",
3745
4176
  category: "view"
3746
- }), c.register("view-switcher", wt, {
4177
+ }), c.register("view-switcher", Pt, {
3747
4178
  namespace: "view",
3748
4179
  label: "View Switcher",
3749
4180
  category: "view",
@@ -3822,7 +4253,7 @@ c.register("object-view", En, {
3822
4253
  }
3823
4254
  }]
3824
4255
  }
3825
- }), c.register("filter-ui", At, {
4256
+ }), c.register("filter-ui", Bt, {
3826
4257
  namespace: "view",
3827
4258
  label: "Filter UI",
3828
4259
  category: "view",
@@ -3895,7 +4326,7 @@ c.register("object-view", En, {
3895
4326
  }
3896
4327
  ]
3897
4328
  }
3898
- }), c.register("sort-ui", Ft, {
4329
+ }), c.register("sort-ui", Gt, {
3899
4330
  namespace: "view",
3900
4331
  label: "Sort UI",
3901
4332
  category: "view",
@@ -3944,7 +4375,7 @@ c.register("object-view", En, {
3944
4375
  direction: "asc"
3945
4376
  }]
3946
4377
  }
3947
- }), c.register("shared-view-link", Rt, {
4378
+ }), c.register("shared-view-link", Jt, {
3948
4379
  namespace: "view",
3949
4380
  label: "Shared View Link",
3950
4381
  category: "view",
@@ -3986,4 +4417,4 @@ c.register("object-view", En, {
3986
4417
  category: "view"
3987
4418
  });
3988
4419
  //#endregion
3989
- export { At as FilterUI, Et as ObjectView, Rt as SharedViewLink, Ft as SortUI, Qt as VIEW_TYPE_LABELS, wt as ViewSwitcher, Ht as ViewTabBar, pn as buildViewConfigSchema, tn as deriveFieldOptions, nn as toFilterGroup, rn as toSortItems };
4420
+ export { xn as ESSENTIAL_SECTION_KEYS, Bt as FilterUI, tn as ManageViewsDialog, It as ObjectView, Jt as SharedViewLink, Gt as SortUI, fn as VIEW_TYPE_LABELS, pn as VIEW_TYPE_OPTIONS, Pt as ViewSwitcher, Qt as ViewTabBar, On as buildViewConfigSchema, hn as deriveFieldOptions, gn as toFilterGroup, _n as toSortItems };