@object-ui/plugin-view 3.3.2 → 3.4.0

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 ne, DialogHeader as re, DialogTitle as D, 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, Input as N, Label as pe, NavigationOverlay as me, Popover as P, PopoverContent as he, PopoverTrigger as F, Select as I, SelectContent as L, SelectItem as R, SelectTrigger as z, SelectValue as B, SortBuilder as V, Switch as H, Tabs as ge, TabsList as _e, TabsTrigger as ve, 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 ye, ArrowUp as be, Calendar as xe, Check as Se, ChevronDown as Ce, Copy as we, Eye as Te, 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 Y, PinOff as Be, Plus as Ve, Save as He, Search as Ue, Settings as We, Settings2 as Ge, Share2 as Ke, SlidersHorizontal as qe, Star as Je, Table as Ye, Trash2 as Xe, X as Ze, icons as Qe } from "lucide-react";
9
+ import { DndContext as $e, KeyboardSensor as et, PointerSensor as tt, closestCenter as nt, useSensor as rt, useSensors as it } from "@dnd-kit/core";
10
+ import { SortableContext as at, arrayMove as ot, horizontalListSortingStrategy as st, sortableKeyboardCoordinates as ct, useSortable as lt, verticalListSortingStrategy as ut } from "@dnd-kit/sortable";
11
+ import { CSS as dt } 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 ft = (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 pt(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 = pt(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 mt() {
26
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = pt(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 ht = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, gt = mt, _t = (e, t) => (n) => {
32
+ if (t?.variants == null) return gt(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 = ht(t) || ht(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 gt(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
+ }, vt = /* @__PURE__ */ ft(((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__ */ ft(((e, t) => {
75
+ t.exports = vt();
76
+ })))(), yt = {
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
+ }, bt = {
87
+ list: Pe,
88
+ detail: De,
89
+ grid: Ae,
90
+ kanban: Ne,
91
+ calendar: xe,
92
+ timeline: J,
93
+ map: Le,
94
+ gallery: Me,
95
+ gantt: Oe
96
+ }, xt = _t("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
+ }), St = _t("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
+ }), Ct = _t("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
+ }), wt = _t("", {
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 Tt(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 Et = { Home: "House" };
127
+ function Dt(e) {
128
128
  if (!e) return null;
129
- let t = gt(e);
130
- return Ge[_t[t] || t] || null;
129
+ let t = Tt(e);
130
+ return Qe[Et[t] || t] || null;
131
131
  }
132
- function yt(e) {
133
- return e.label ? e.label : ut[e.type] || e.type;
132
+ function Ot(e) {
133
+ return e.label ? e.label : yt[e.type] || e.type;
134
134
  }
135
- function bt(e) {
136
- return e.icon ? vt(e.icon) : dt[e.type] || null;
135
+ function kt(e) {
136
+ return e.icon ? Dt(e.icon) : bt[e.type] || null;
137
137
  }
138
- function xt(e) {
138
+ function At(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 jt = {
142
+ share: Ke,
143
+ settings: We,
144
+ duplicate: we,
145
+ delete: Xe
146
+ }, Mt = {
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
+ }, Nt = ({ 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(() => At(t));
153
153
  e.useEffect(() => {
154
154
  if (t.activeView) {
155
155
  d(t.activeView);
@@ -181,71 +181,71 @@ 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 && Dt(e.icon) || jt[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: Mt[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)(Ve, { 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(St({ 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)(I, {
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)(z, {
211
+ className: q("w-full", y ? "h-10" : "h-9"),
212
+ children: /* @__PURE__ */ (0, X.jsx)(B, { placeholder: "Select view" })
213
+ }), /* @__PURE__ */ (0, X.jsx)(L, { children: t.views.map((e, t) => /* @__PURE__ */ (0, X.jsx)(R, {
214
214
  value: e.type,
215
- children: yt(e)
215
+ children: Ot(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(Ct({ 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 = kt(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: Ot(e) })]
229
229
  }, `${e.type}-${t}`);
230
230
  })
231
231
  }),
232
- v === "tabs" && /* @__PURE__ */ (0, X.jsx)(_e, {
232
+ v === "tabs" && /* @__PURE__ */ (0, X.jsx)(ge, {
233
233
  value: g,
234
234
  onValueChange: (e) => p(e),
235
- children: /* @__PURE__ */ (0, X.jsx)(ve, {
236
- className: z(ht({ orientation: x })),
235
+ children: /* @__PURE__ */ (0, X.jsx)(_e, {
236
+ className: q(wt({ orientation: b })),
237
237
  children: t.views.map((e, t) => {
238
- let n = bt(e);
239
- return /* @__PURE__ */ (0, X.jsxs)(ye, {
238
+ let n = kt(e);
239
+ return /* @__PURE__ */ (0, X.jsxs)(ve, {
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: Ot(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(xt({ 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
+ }, Pt = u, Ft = ({ 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), [ne, 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,
283
+ let [le, ue] = s([]), [de, fe] = s(!1), [N, pe] = s({}), [P, he] = s([]), F = e.listViews, I = F != null && Object.keys(F).length > 0, [L, R] = s(() => e.defaultListView && F?.[e.defaultListView] ? e.defaultListView : F && Object.keys(F)[0] || ""), z = a(() => !I || !L ? null : F[L] || null, [
285
284
  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", [
288
285
  L,
289
- V,
286
+ F
287
+ ]), B = a(() => c && c.length > 0 ? c : null, [c]), V = B != null && B.length > 0, H = u || B?.[0]?.id, U = B?.find((e) => e.id === H) || B?.[0], W = a(() => z?.type ? z.type : U?.type ? U.type : e.defaultViewType || "grid", [
288
+ z,
289
+ U,
290
290
  e.defaultViewType
291
- ]), U = e.navigation;
291
+ ]), G = 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 (!_ && W !== "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 || U?.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 = P.length > 0 ? P.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 || U?.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
+ W,
343
+ N,
344
+ P,
344
345
  M,
345
- O,
346
- L,
347
- V,
346
+ z,
347
+ U,
348
348
  _
349
349
  ]);
350
- let W = e.layout || "drawer", G = e.operations || e.table?.operations || {
350
+ let K = e.layout || "drawer", J = 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
+ }, ye = n(() => {
356
+ K === "page" && e.onNavigate ? e.onNavigate("new", "edit") : (k("create"), j(null), C(!0));
357
+ }, [K, 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 (K === "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
+ K,
368
368
  e,
369
369
  g
370
- ]), we = n((t) => {
371
- if (W === "page" && e.onNavigate) {
370
+ ]), xe = n((t) => {
371
+ if (K === "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
+ }, [K, 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 (G) {
381
+ if (G.mode === "none" || G.preventNavigation) return;
382
+ if (G.mode === "new_window" || G.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 (G.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 (G.mode === "modal") {
392
+ k("view"), j(t), C(!0);
393
393
  return;
394
394
  }
395
- if (U.mode === "page") {
395
+ if (G.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 (G.mode === "split" || G.mode === "popover") {
401
+ k("view"), j(t), C(!0);
402
402
  return;
403
403
  }
404
404
  }
405
- G.read !== !1 && we(t);
405
+ J.read !== !1 && xe(t);
406
406
  }, [
407
407
  m,
408
- U,
409
- G.read,
410
- we,
408
+ G,
409
+ J.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
+ }, []), Ee = 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 De = 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: U?.type || "grid",
431
+ activeView: U?.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
+ U,
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
+ ]), Oe = 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]), ke = 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 Ae = 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 (Ae === !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: P
514
514
  };
515
515
  }, [
516
- x,
517
- M,
518
- je
516
+ b,
517
+ P,
518
+ Ae
519
519
  ]);
520
- let Me = n((t) => {
520
+ let je = n((t) => {
521
521
  let n = {
522
522
  objectName: e.objectName,
523
- fields: L?.columns || V?.columns || e.table?.fields,
523
+ fields: z?.columns || U?.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: U?.showSearch ?? e.showSearch ?? !1,
526
+ showSort: U?.showSort ?? e.showSort ?? !1,
527
+ showFilters: U?.showFilters ?? e.showFilters ?? !1,
528
+ striped: U?.striped ?? !1,
529
+ bordered: U?.bordered ?? !1,
530
+ color: U?.color
531
+ }, r = z?.options || U || {};
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
+ U
587
+ ]), Me = 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 || U?.columns || e.table?.fields,
593
+ columns: z?.columns || U?.columns || e.table?.columns,
594
594
  operations: {
595
- ...G,
595
+ ...J,
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 || U?.filter || e.table?.defaultFilters,
599
+ defaultSort: z?.sort || U?.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: U?.striped ?? e.table?.striped,
603
+ bordered: U?.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
+ J,
608
+ z,
609
+ U
610
+ ]), Ne = () => {
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: ne,
616
616
  recordId: t,
617
617
  title: e.form?.title,
618
618
  description: e.form?.description,
@@ -627,202 +627,202 @@ 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 || ne === "view",
631
631
  className: e.form?.className,
632
- onSuccess: K,
633
- onCancel: q
632
+ onSuccess: Te,
633
+ onCancel: Ee
634
634
  };
635
635
  }, Pe = () => {
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 (ne) {
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
+ }, Fe = a(() => {
645
+ let e = G?.width;
646
646
  return e ? typeof e == "number" ? `max-w-[${e}px]` : `max-w-[${e}]` : "";
647
- }, [U]), Le = () => /* @__PURE__ */ (0, X.jsx)(oe, {
647
+ }, [G]), Ie = () => /* @__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", Fe),
653
+ children: [/* @__PURE__ */ (0, X.jsxs)(oe, { children: [/* @__PURE__ */ (0, X.jsx)(se, { children: Pe() }), 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: Ne(),
657
657
  dataSource: t
658
658
  })
659
659
  })]
660
660
  })
661
- }), Re = () => /* @__PURE__ */ (0, X.jsx)(ne, {
661
+ }), Le = () => /* @__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", Fe),
666
+ children: [/* @__PURE__ */ (0, X.jsxs)(re, { children: [/* @__PURE__ */ (0, X.jsx)(D, { children: Pe() }), e.form?.description && /* @__PURE__ */ (0, X.jsx)(E, { children: e.form.description })] }), /* @__PURE__ */ (0, X.jsx)(p, {
667
+ schema: Ne(),
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
+ }), Re = 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 || U?.filter || e.table?.defaultFilters, [
676
+ N,
677
+ z,
678
+ U,
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
+ ]), ze = a(() => P.length > 0 ? P : z?.sort || U?.sort || e.table?.defaultSort, [
681
+ P,
682
+ z,
683
+ U,
684
684
  e.table?.defaultSort
685
- ]), Ve = () => {
686
- let n = `${e.objectName}-${I || V?.id || "default"}-${H}-${O}`;
685
+ ]), Y = () => {
686
+ let n = `${e.objectName}-${L || U?.id || "default"}-${W}-${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: W,
692
+ fields: z?.columns || U?.columns || e.table?.fields,
693
+ filters: Re,
694
+ sort: ze,
695
+ rowHeight: U?.rowHeight,
696
+ densityMode: U?.densityMode,
697
+ groupBy: U?.groupBy,
698
+ options: z?.options || U,
699
+ showSearch: U?.showSearch ?? e.showSearch,
700
+ showFilters: U?.showFilters ?? e.showFilters,
701
+ showSort: U?.showSort ?? e.showSort,
702
+ showHideFields: U?.showHideFields ?? e.showHideFields,
703
+ showGroup: U?.showGroup ?? e.showGroup,
704
+ showColor: U?.showColor ?? e.showColor,
705
+ showDensity: U?.showDensity ?? e.showDensity,
706
+ allowExport: U?.allowExport ?? e.allowExport,
707
+ striped: U?.striped ?? e.striped,
708
+ bordered: U?.bordered ?? e.bordered,
709
+ color: U?.color ?? e.color,
710
+ inlineEdit: U?.inlineEdit ?? e.inlineEdit,
711
+ wrapHeaders: U?.wrapHeaders ?? e.wrapHeaders,
712
+ clickIntoRecordDetails: U?.clickIntoRecordDetails ?? e.clickIntoRecordDetails,
713
+ addRecordViaForm: U?.addRecordViaForm ?? e.addRecordViaForm,
714
+ addDeleteRecordsInline: U?.addDeleteRecordsInline ?? e.addDeleteRecordsInline,
715
+ collapseAllByDefault: U?.collapseAllByDefault ?? e.collapseAllByDefault,
716
+ fieldTextColor: U?.fieldTextColor ?? e.fieldTextColor,
717
+ prefixField: U?.prefixField ?? e.prefixField,
718
+ showDescription: U?.showDescription ?? e.showDescription,
719
+ navigation: U?.navigation ?? e.navigation,
720
+ selection: U?.selection ?? e.selection,
721
+ pagination: U?.pagination ?? e.pagination,
722
+ searchableFields: U?.searchableFields ?? e.searchableFields,
723
+ filterableFields: U?.filterableFields ?? e.filterableFields,
724
+ resizable: U?.resizable ?? e.resizable,
725
+ hiddenFields: U?.hiddenFields ?? e.hiddenFields,
726
+ rowActions: U?.rowActions ?? e.rowActions,
727
+ bulkActions: U?.bulkActions ?? e.bulkActions,
728
+ sharing: U?.sharing ?? e.sharing,
729
+ addRecord: U?.addRecord ?? e.addRecord,
730
+ conditionalFormatting: U?.conditionalFormatting ?? e.conditionalFormatting,
731
+ quickFilters: U?.quickFilters ?? e.quickFilters,
732
+ userFilters: U?.userFilters ?? e.userFilters,
733
+ showRecordCount: U?.showRecordCount ?? e.showRecordCount,
734
+ allowPrinting: U?.allowPrinting ?? e.allowPrinting,
735
+ virtualScroll: U?.virtualScroll ?? e.virtualScroll,
736
+ emptyState: U?.emptyState ?? e.emptyState,
737
+ aria: U?.aria ?? e.aria,
738
738
  tabs: e.tabs,
739
- refreshTrigger: O
739
+ refreshTrigger: M
740
740
  },
741
741
  dataSource: t,
742
- onEdit: Ce,
743
- onRowClick: Te,
742
+ onEdit: be,
743
+ onRowClick: Se,
744
744
  className: "h-full",
745
- refreshKey: O
745
+ refreshKey: M
746
746
  });
747
- if (H !== "grid") {
748
- let e = Me(H);
749
- if (e && Tt) return /* @__PURE__ */ (0, X.jsx)(Tt, {
747
+ if (W !== "grid") {
748
+ let e = je(W);
749
+ if (e && Pt) return /* @__PURE__ */ (0, X.jsx)(Pt, {
750
750
  schema: e,
751
751
  dataSource: t,
752
- data: fe,
753
- loading: he
752
+ data: le,
753
+ loading: de
754
754
  }, n);
755
- if (!Tt) return /* @__PURE__ */ (0, X.jsx)("div", {
755
+ if (!Pt) return /* @__PURE__ */ (0, X.jsx)("div", {
756
756
  className: "flex items-center justify-center h-40 text-muted-foreground",
757
757
  children: /* @__PURE__ */ (0, X.jsxs)("p", { children: [
758
758
  "SchemaRenderer not available. Install @object-ui/react to render ",
759
- H,
759
+ W,
760
760
  " views."
761
761
  ] })
762
762
  });
763
763
  }
764
764
  return /* @__PURE__ */ (0, X.jsx)(f, {
765
- schema: Ne,
765
+ schema: Me,
766
766
  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
767
+ onRowClick: Se,
768
+ onEdit: J.update === !1 ? void 0 : be,
769
+ onDelete: J.delete === !1 ? void 0 : Ce,
770
+ onBulkDelete: J.delete === !1 ? void 0 : we
771
771
  }, n);
772
- }, He = () => {
773
- if (!F) return null;
774
- let e = Object.entries(P);
775
- return e.length <= 1 ? null : /* @__PURE__ */ (0, X.jsx)(_e, {
776
- value: I,
777
- onValueChange: Ae,
772
+ }, Be = () => {
773
+ if (!I) return null;
774
+ let e = Object.entries(F);
775
+ return e.length <= 1 ? null : /* @__PURE__ */ (0, X.jsx)(ge, {
776
+ value: L,
777
+ onValueChange: ke,
778
778
  className: "w-full",
779
- children: /* @__PURE__ */ (0, X.jsx)(ve, {
779
+ children: /* @__PURE__ */ (0, X.jsx)(_e, {
780
780
  className: "w-auto",
781
- children: e.map(([e, t]) => /* @__PURE__ */ (0, X.jsx)(ye, {
781
+ children: e.map(([e, t]) => /* @__PURE__ */ (0, X.jsx)(ve, {
782
782
  value: e,
783
783
  className: "text-sm",
784
784
  children: t.label || e
785
785
  }, e))
786
786
  })
787
787
  });
788
- }, Ue = () => {
789
- let t = e.showCreate !== !1 && G.create !== !1, n = e.showViewSwitcher === !0, r = He();
788
+ }, He = () => {
789
+ let t = e.showCreate !== !1 && J.create !== !1, n = e.showViewSwitcher === !0, r = Be();
790
790
  return !r && !n && !t && !v ? null : /* @__PURE__ */ (0, X.jsxs)("div", {
791
791
  className: "flex flex-col gap-3",
792
792
  children: [r, (n || t || v) && /* @__PURE__ */ (0, X.jsxs)("div", {
793
793
  className: "flex items-center justify-between gap-4",
794
794
  children: [/* @__PURE__ */ (0, X.jsx)("div", {
795
795
  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,
796
+ children: n && De && /* @__PURE__ */ (0, X.jsx)(Nt, {
797
+ schema: De,
798
+ onViewChange: Oe,
799
+ onCreateView: ee,
800
+ onViewAction: y,
801
801
  className: "overflow-x-auto"
802
802
  })
803
803
  }), /* @__PURE__ */ (0, X.jsxs)("div", {
804
804
  className: "flex items-center gap-2",
805
805
  children: [v, t && /* @__PURE__ */ (0, X.jsxs)(h, {
806
806
  size: "sm",
807
- onClick: Se,
808
- children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4" }), "Create"]
807
+ onClick: ye,
808
+ children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4" }), "Create"]
809
809
  })]
810
810
  })]
811
811
  })]
812
812
  });
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", {
813
+ }, Ue = G?.mode === "modal" ? "modal" : G?.mode === "drawer" ? "drawer" : G?.mode === "split" ? "split" : G?.mode === "popover" ? "popover" : K, We = (e) => /* @__PURE__ */ (0, X.jsx)("div", {
814
814
  className: "space-y-3",
815
815
  children: /* @__PURE__ */ (0, X.jsx)(p, {
816
- schema: J(),
816
+ schema: Ne(),
817
817
  dataSource: t
818
818
  })
819
- }), Ke = n((e) => {
820
- e || q();
821
- }, [q]);
822
- if (We === "split") {
823
- let t = x?.label || e.objectName;
819
+ }), Ge = n((e) => {
820
+ e || Ee();
821
+ }, [Ee]);
822
+ if (Ue === "split") {
823
+ let t = b?.label || e.objectName;
824
824
  return /* @__PURE__ */ (0, X.jsxs)("div", {
825
- className: z("flex flex-col h-full min-w-0 overflow-hidden", r),
825
+ className: q("flex flex-col h-full min-w-0 overflow-hidden", r),
826
826
  children: [
827
827
  (e.title || e.description) && /* @__PURE__ */ (0, X.jsxs)("div", {
828
828
  className: "mb-4 shrink-0",
@@ -836,31 +836,31 @@ var St = {
836
836
  }),
837
837
  /* @__PURE__ */ (0, X.jsx)("div", {
838
838
  className: "mb-4 shrink-0",
839
- children: Ue()
839
+ children: He()
840
840
  }),
841
841
  /* @__PURE__ */ (0, X.jsx)("div", {
842
842
  className: "flex-1 min-h-0 min-w-0 overflow-hidden",
843
- children: S && E ? /* @__PURE__ */ (0, X.jsx)(pe, {
843
+ children: S && A ? /* @__PURE__ */ (0, X.jsx)(me, {
844
844
  isOpen: S,
845
- selectedRecord: E,
845
+ selectedRecord: A,
846
846
  mode: "split",
847
- close: q,
848
- setIsOpen: Ke,
849
- width: U?.width,
847
+ close: Ee,
848
+ setIsOpen: Ge,
849
+ width: G?.width,
850
850
  isOverlay: !0,
851
851
  title: `${t} Detail`,
852
852
  mainContent: /* @__PURE__ */ (0, X.jsx)("div", {
853
853
  className: "h-full overflow-auto",
854
- children: Ve()
854
+ children: Y()
855
855
  }),
856
- children: Ge
857
- }) : Ve()
856
+ children: We
857
+ }) : Y()
858
858
  })
859
859
  ]
860
860
  });
861
861
  }
862
862
  return /* @__PURE__ */ (0, X.jsxs)("div", {
863
- className: z("flex flex-col h-full min-w-0 overflow-hidden", r),
863
+ className: q("flex flex-col h-full min-w-0 overflow-hidden", r),
864
864
  children: [
865
865
  (e.title || e.description) && /* @__PURE__ */ (0, X.jsxs)("div", {
866
866
  className: "mb-4 shrink-0",
@@ -874,35 +874,35 @@ var St = {
874
874
  }),
875
875
  /* @__PURE__ */ (0, X.jsx)("div", {
876
876
  className: "mb-4 shrink-0",
877
- children: Ue()
877
+ children: He()
878
878
  }),
879
879
  /* @__PURE__ */ (0, X.jsx)("div", {
880
880
  className: "flex-1 min-h-0 min-w-0 overflow-hidden",
881
- children: Ve()
881
+ children: Y()
882
882
  }),
883
- We === "drawer" && Le(),
884
- We === "modal" && Re(),
885
- We === "popover" && S && E && /* @__PURE__ */ (0, X.jsx)(pe, {
883
+ Ue === "drawer" && Ie(),
884
+ Ue === "modal" && Le(),
885
+ Ue === "popover" && S && A && /* @__PURE__ */ (0, X.jsx)(me, {
886
886
  isOpen: S,
887
- selectedRecord: E,
887
+ selectedRecord: A,
888
888
  mode: "popover",
889
- close: q,
890
- setIsOpen: Ke,
891
- width: U?.width,
889
+ close: Ee,
890
+ setIsOpen: Ge,
891
+ width: G?.width,
892
892
  isOverlay: !0,
893
893
  title: Pe(),
894
- children: Ge
894
+ children: We
895
895
  })
896
896
  ]
897
897
  });
898
- }, Dt = Y("flex", {
898
+ }, It = _t("flex", {
899
899
  variants: { layout: {
900
900
  inline: "flex-col space-y-4",
901
901
  popover: "items-center",
902
902
  drawer: "items-center"
903
903
  } },
904
904
  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) ? {
905
+ }), Lt = (e) => e == null || e === "" ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.values(e).every((e) => e == null || e === "") : !1, Rt = (e) => Array.isArray(e) ? {
906
906
  start: e[0] || "",
907
907
  end: e[1] || ""
908
908
  } : e && typeof e == "object" ? {
@@ -911,7 +911,7 @@ var St = {
911
911
  } : {
912
912
  start: "",
913
913
  end: ""
914
- }, At = ({ schema: t, className: n, onChange: r }) => {
914
+ }, zt = ({ schema: t, className: n, onChange: r }) => {
915
915
  let [i, a] = e.useState(t.values || {}), [o, s] = e.useState(!1);
916
916
  e.useEffect(() => {
917
917
  t.values && a(t.values);
@@ -937,10 +937,10 @@ var St = {
937
937
  c(e);
938
938
  }, [c, t.showApply]), d = e.useCallback(() => {
939
939
  c(i), s(!1);
940
- }, [c, i]), f = e.useMemo(() => Object.values(i).filter((e) => !Ot(e)).length, [i]), p = (e) => {
940
+ }, [c, i]), f = e.useMemo(() => Object.values(i).filter((e) => !Lt(e)).length, [i]), p = (e) => {
941
941
  let t = e.label || e.field, n = e.placeholder || `Filter by ${t}`;
942
942
  switch (e.type) {
943
- case "number": return /* @__PURE__ */ (0, X.jsx)(k, {
943
+ case "number": return /* @__PURE__ */ (0, X.jsx)(N, {
944
944
  type: "number",
945
945
  value: i[e.field] ?? "",
946
946
  placeholder: n,
@@ -949,13 +949,13 @@ var St = {
949
949
  l(e.field, r);
950
950
  }
951
951
  });
952
- case "select": return /* @__PURE__ */ (0, X.jsxs)(A, {
952
+ case "select": return /* @__PURE__ */ (0, X.jsxs)(I, {
953
953
  value: i[e.field] === void 0 ? "" : String(i[e.field]),
954
954
  onValueChange: (t) => {
955
955
  let n = e.options?.find((e) => String(e.value) === t);
956
956
  l(e.field, n ? n.value : t);
957
957
  },
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, {
958
+ children: [/* @__PURE__ */ (0, X.jsx)(z, { children: /* @__PURE__ */ (0, X.jsx)(B, { placeholder: n }) }), /* @__PURE__ */ (0, X.jsx)(L, { children: e.options?.map((e) => /* @__PURE__ */ (0, X.jsx)(R, {
959
959
  value: String(e.value),
960
960
  children: e.label
961
961
  }, String(e.value))) })]
@@ -967,7 +967,7 @@ var St = {
967
967
  children: e.options?.map((t) => {
968
968
  let r = n.map(String).includes(String(t.value));
969
969
  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"),
970
+ 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
971
  children: [/* @__PURE__ */ (0, X.jsx)(g, {
972
972
  checked: r,
973
973
  onCheckedChange: (r) => {
@@ -982,16 +982,16 @@ var St = {
982
982
  })
983
983
  });
984
984
  }
985
- case "date": return /* @__PURE__ */ (0, X.jsx)(k, {
985
+ case "date": return /* @__PURE__ */ (0, X.jsx)(N, {
986
986
  type: "date",
987
987
  value: i[e.field] ?? "",
988
988
  onChange: (t) => l(e.field, t.target.value)
989
989
  });
990
990
  case "date-range": {
991
- let t = kt(i[e.field]);
991
+ let t = Rt(i[e.field]);
992
992
  return /* @__PURE__ */ (0, X.jsxs)("div", {
993
993
  className: "flex items-center gap-2",
994
- children: [/* @__PURE__ */ (0, X.jsx)(k, {
994
+ children: [/* @__PURE__ */ (0, X.jsx)(N, {
995
995
  type: "date",
996
996
  value: t.start ?? "",
997
997
  onChange: (n) => {
@@ -1000,7 +1000,7 @@ var St = {
1000
1000
  start: n.target.value
1001
1001
  });
1002
1002
  }
1003
- }), /* @__PURE__ */ (0, X.jsx)(k, {
1003
+ }), /* @__PURE__ */ (0, X.jsx)(N, {
1004
1004
  type: "date",
1005
1005
  value: t.end ?? "",
1006
1006
  onChange: (n) => {
@@ -1022,7 +1022,7 @@ var St = {
1022
1022
  children: "Enabled"
1023
1023
  })]
1024
1024
  });
1025
- default: return /* @__PURE__ */ (0, X.jsx)(k, {
1025
+ default: return /* @__PURE__ */ (0, X.jsx)(N, {
1026
1026
  value: i[e.field] ?? "",
1027
1027
  placeholder: n,
1028
1028
  onChange: (t) => l(e.field, t.target.value)
@@ -1034,7 +1034,7 @@ var St = {
1034
1034
  className: "grid gap-4 sm:grid-cols-2",
1035
1035
  children: t.filters.map((e) => /* @__PURE__ */ (0, X.jsxs)("div", {
1036
1036
  className: "space-y-2",
1037
- children: [/* @__PURE__ */ (0, X.jsx)(fe, {
1037
+ children: [/* @__PURE__ */ (0, X.jsx)(pe, {
1038
1038
  className: "text-xs text-muted-foreground",
1039
1039
  children: e.label || e.field
1040
1040
  }), p(e)]
@@ -1056,11 +1056,11 @@ var St = {
1056
1056
  })]
1057
1057
  }), _ = t.layout || "inline";
1058
1058
  return _ === "popover" ? /* @__PURE__ */ (0, X.jsx)("div", {
1059
- className: z(Dt({ layout: _ }), n),
1060
- children: /* @__PURE__ */ (0, X.jsxs)(me, {
1059
+ className: q(It({ layout: _ }), n),
1060
+ children: /* @__PURE__ */ (0, X.jsxs)(P, {
1061
1061
  open: o,
1062
1062
  onOpenChange: s,
1063
- children: [/* @__PURE__ */ (0, X.jsx)(ge, {
1063
+ children: [/* @__PURE__ */ (0, X.jsx)(F, {
1064
1064
  asChild: !0,
1065
1065
  children: /* @__PURE__ */ (0, X.jsxs)(h, {
1066
1066
  type: "button",
@@ -1068,7 +1068,7 @@ var St = {
1068
1068
  size: "sm",
1069
1069
  className: "gap-2",
1070
1070
  children: [
1071
- /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4" }),
1071
+ /* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4" }),
1072
1072
  "Filters",
1073
1073
  f > 0 && /* @__PURE__ */ (0, X.jsx)("span", {
1074
1074
  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",
@@ -1083,7 +1083,7 @@ var St = {
1083
1083
  })]
1084
1084
  })
1085
1085
  }) : _ === "drawer" ? /* @__PURE__ */ (0, X.jsxs)("div", {
1086
- className: z(Dt({ layout: _ }), n),
1086
+ className: q(It({ layout: _ }), n),
1087
1087
  children: [/* @__PURE__ */ (0, X.jsxs)(h, {
1088
1088
  type: "button",
1089
1089
  variant: f > 0 ? "secondary" : "outline",
@@ -1091,54 +1091,54 @@ var St = {
1091
1091
  className: "gap-2",
1092
1092
  onClick: () => s(!0),
1093
1093
  children: [
1094
- /* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4" }),
1094
+ /* @__PURE__ */ (0, X.jsx)(qe, { className: "h-4 w-4" }),
1095
1095
  "Filters",
1096
1096
  f > 0 && /* @__PURE__ */ (0, X.jsx)("span", {
1097
1097
  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
1098
  children: f
1099
1099
  })
1100
1100
  ]
1101
- }), /* @__PURE__ */ (0, X.jsx)(oe, {
1101
+ }), /* @__PURE__ */ (0, X.jsx)(O, {
1102
1102
  open: o,
1103
1103
  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", {
1104
+ 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
1105
  className: "px-4 pb-6",
1106
1106
  children: m
1107
1107
  })] })
1108
1108
  })]
1109
1109
  }) : /* @__PURE__ */ (0, X.jsxs)("div", {
1110
- className: z(Dt({ layout: _ }), n),
1110
+ className: q(It({ layout: _ }), n),
1111
1111
  children: [m, !t.showApply && t.showClear && /* @__PURE__ */ (0, X.jsxs)(h, {
1112
1112
  type: "button",
1113
1113
  variant: "ghost",
1114
1114
  size: "sm",
1115
1115
  className: "gap-2",
1116
1116
  onClick: u,
1117
- children: [/* @__PURE__ */ (0, X.jsx)(We, { className: "h-3.5 w-3.5" }), "Clear filters"]
1117
+ children: [/* @__PURE__ */ (0, X.jsx)(Ze, { className: "h-3.5 w-3.5" }), "Clear filters"]
1118
1118
  })]
1119
1119
  });
1120
- }, jt = Y("", {
1120
+ }, Bt = _t("", {
1121
1121
  variants: { variant: {
1122
1122
  buttons: "flex flex-wrap gap-2",
1123
1123
  dropdown: "flex flex-wrap items-center gap-3",
1124
1124
  builder: "space-y-3"
1125
1125
  } },
1126
1126
  defaultVariants: { variant: "dropdown" }
1127
- }), Mt = (e) => e ? e.map((e) => ({
1127
+ }), Vt = (e) => e ? e.map((e) => ({
1128
1128
  field: e.field,
1129
1129
  direction: e.direction
1130
- })) : [], Nt = (e) => e.map((e) => ({
1130
+ })) : [], Ht = (e) => e.map((e) => ({
1131
1131
  id: `${e.field}-${e.direction}`,
1132
1132
  field: e.field,
1133
1133
  order: e.direction
1134
- })), Pt = (e) => e.filter((e) => e.field).map((e) => ({
1134
+ })), Ut = (e) => e.filter((e) => e.field).map((e) => ({
1135
1135
  field: e.field,
1136
1136
  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)));
1137
+ })), Wt = ({ schema: t, className: n, onChange: r }) => {
1138
+ let [i, a] = e.useState(() => Vt(t.sort)), [o, s] = e.useState(() => Ht(Vt(t.sort)));
1139
1139
  e.useEffect(() => {
1140
- let e = Mt(t.sort);
1141
- a(e), s(Nt(e));
1140
+ let e = Vt(t.sort);
1141
+ a(e), s(Ht(e));
1142
1142
  }, [t.sort]);
1143
1143
  let c = e.useCallback((e) => {
1144
1144
  a(e), r?.(e), t.onChange && typeof window < "u" && window.dispatchEvent(new CustomEvent(t.onChange, { detail: { sort: e } }));
@@ -1168,9 +1168,9 @@ var St = {
1168
1168
  i
1169
1169
  ]);
1170
1170
  if ((t.variant || "dropdown") === "buttons") return /* @__PURE__ */ (0, X.jsx)("div", {
1171
- className: z(jt({ variant: "buttons" }), n),
1171
+ className: q(Bt({ variant: "buttons" }), n),
1172
1172
  children: t.fields.map((e) => {
1173
- let t = i.find((t) => t.field === e.field), n = t?.direction === "asc" ? H : V;
1173
+ let t = i.find((t) => t.field === e.field), n = t?.direction === "asc" ? be : ye;
1174
1174
  return /* @__PURE__ */ (0, X.jsxs)(h, {
1175
1175
  type: "button",
1176
1176
  variant: t ? "secondary" : "outline",
@@ -1182,22 +1182,22 @@ var St = {
1182
1182
  })
1183
1183
  });
1184
1184
  if (t.multiple) return /* @__PURE__ */ (0, X.jsx)("div", {
1185
- className: z(jt({ variant: "builder" }), n),
1186
- children: /* @__PURE__ */ (0, X.jsx)(F, {
1185
+ className: q(Bt({ variant: "builder" }), n),
1186
+ children: /* @__PURE__ */ (0, X.jsx)(V, {
1187
1187
  fields: t.fields.map((e) => ({
1188
1188
  value: e.field,
1189
1189
  label: e.label || e.field
1190
1190
  })),
1191
1191
  value: o,
1192
1192
  onChange: (e) => {
1193
- s(e), c(Pt(e));
1193
+ s(e), c(Ut(e));
1194
1194
  }
1195
1195
  })
1196
1196
  });
1197
1197
  let u = i[0];
1198
1198
  return /* @__PURE__ */ (0, X.jsxs)("div", {
1199
- className: z(jt({ variant: "dropdown" }), n),
1200
- children: [/* @__PURE__ */ (0, X.jsxs)(A, {
1199
+ className: q(Bt({ variant: "dropdown" }), n),
1200
+ children: [/* @__PURE__ */ (0, X.jsxs)(I, {
1201
1201
  value: u?.field || "",
1202
1202
  onValueChange: (e) => {
1203
1203
  if (!e) {
@@ -1209,14 +1209,14 @@ var St = {
1209
1209
  direction: u?.direction || "asc"
1210
1210
  }]);
1211
1211
  },
1212
- children: [/* @__PURE__ */ (0, X.jsx)(N, {
1212
+ children: [/* @__PURE__ */ (0, X.jsx)(z, {
1213
1213
  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, {
1214
+ children: /* @__PURE__ */ (0, X.jsx)(B, { placeholder: "Select field" })
1215
+ }), /* @__PURE__ */ (0, X.jsx)(L, { children: t.fields.map((e) => /* @__PURE__ */ (0, X.jsx)(R, {
1216
1216
  value: e.field,
1217
1217
  children: e.label || e.field
1218
1218
  }, e.field)) })]
1219
- }), /* @__PURE__ */ (0, X.jsxs)(A, {
1219
+ }), /* @__PURE__ */ (0, X.jsxs)(I, {
1220
1220
  value: u?.direction || "asc",
1221
1221
  onValueChange: (e) => {
1222
1222
  u?.field && c([{
@@ -1224,13 +1224,13 @@ var St = {
1224
1224
  direction: e
1225
1225
  }]);
1226
1226
  },
1227
- children: [/* @__PURE__ */ (0, X.jsx)(N, {
1227
+ children: [/* @__PURE__ */ (0, X.jsx)(z, {
1228
1228
  className: "w-36",
1229
- children: /* @__PURE__ */ (0, X.jsx)(P, {})
1230
- }), /* @__PURE__ */ (0, X.jsxs)(j, { children: [/* @__PURE__ */ (0, X.jsx)(M, {
1229
+ children: /* @__PURE__ */ (0, X.jsx)(B, {})
1230
+ }), /* @__PURE__ */ (0, X.jsxs)(L, { children: [/* @__PURE__ */ (0, X.jsx)(R, {
1231
1231
  value: "asc",
1232
1232
  children: "Ascending"
1233
- }), /* @__PURE__ */ (0, X.jsx)(M, {
1233
+ }), /* @__PURE__ */ (0, X.jsx)(R, {
1234
1234
  value: "desc",
1235
1235
  children: "Descending"
1236
1236
  })] })]
@@ -1239,7 +1239,7 @@ var St = {
1239
1239
  };
1240
1240
  //#endregion
1241
1241
  //#region src/SharedViewLink.tsx
1242
- function It() {
1242
+ function Gt() {
1243
1243
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function") return crypto.randomUUID();
1244
1244
  if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
1245
1245
  let e = new Uint8Array(16);
@@ -1247,12 +1247,12 @@ function It() {
1247
1247
  }
1248
1248
  return Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
1249
1249
  }
1250
- function Lt(e, t, n, r) {
1250
+ function Kt(e, t, n, r) {
1251
1251
  return `${e}/share/${t}/${n}?mode=readonly&token=${r}`;
1252
1252
  }
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());
1253
+ var qt = ({ 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 : ""), ee = e.useCallback(() => {
1255
+ let e = Kt(v, t, n, Gt());
1256
1256
  s(e), l(!1);
1257
1257
  let r = g ? new Date(Date.now() + parseInt(g, 10) * 864e5).toISOString() : void 0;
1258
1258
  i?.(e, {
@@ -1266,7 +1266,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1266
1266
  i,
1267
1267
  f,
1268
1268
  g
1269
- ]), b = e.useCallback(async () => {
1269
+ ]), y = e.useCallback(async () => {
1270
1270
  if (o) try {
1271
1271
  await navigator.clipboard.writeText(o), l(!0), setTimeout(() => l(!1), 2e3);
1272
1272
  } catch {
@@ -1274,16 +1274,16 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1274
1274
  e.value = o, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e), l(!0), setTimeout(() => l(!1), 2e3);
1275
1275
  }
1276
1276
  }, [o]);
1277
- return /* @__PURE__ */ (0, X.jsxs)(me, {
1277
+ return /* @__PURE__ */ (0, X.jsxs)(P, {
1278
1278
  open: u,
1279
1279
  onOpenChange: d,
1280
- children: [/* @__PURE__ */ (0, X.jsx)(ge, {
1280
+ children: [/* @__PURE__ */ (0, X.jsx)(F, {
1281
1281
  asChild: !0,
1282
1282
  children: /* @__PURE__ */ (0, X.jsxs)(h, {
1283
1283
  variant: "outline",
1284
1284
  size: "sm",
1285
- className: z("gap-2", a),
1286
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4" }), "Share"]
1285
+ className: q("gap-2", a),
1286
+ children: [/* @__PURE__ */ (0, X.jsx)(Ke, { className: "h-4 w-4" }), "Share"]
1287
1287
  })
1288
1288
  }), /* @__PURE__ */ (0, X.jsxs)(he, {
1289
1289
  className: "w-96 space-y-4",
@@ -1306,7 +1306,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1306
1306
  })]
1307
1307
  }), o ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsxs)("div", {
1308
1308
  className: "flex items-center gap-2",
1309
- children: [/* @__PURE__ */ (0, X.jsx)(k, {
1309
+ children: [/* @__PURE__ */ (0, X.jsx)(N, {
1310
1310
  value: o,
1311
1311
  readOnly: !0,
1312
1312
  className: "h-8 text-xs",
@@ -1314,21 +1314,21 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1314
1314
  }), /* @__PURE__ */ (0, X.jsx)(h, {
1315
1315
  variant: "outline",
1316
1316
  size: "sm",
1317
- onClick: b,
1317
+ onClick: y,
1318
1318
  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" })
1319
+ children: c ? /* @__PURE__ */ (0, X.jsx)(Se, { className: "h-4 w-4 text-green-500" }) : /* @__PURE__ */ (0, X.jsx)(we, { className: "h-4 w-4" })
1320
1320
  })]
1321
1321
  }), (f || g) && /* @__PURE__ */ (0, X.jsxs)("div", {
1322
1322
  className: "flex items-center gap-2 flex-wrap",
1323
1323
  children: [f && /* @__PURE__ */ (0, X.jsxs)(m, {
1324
1324
  variant: "outline",
1325
1325
  className: "text-xs gap-1",
1326
- children: [/* @__PURE__ */ (0, X.jsx)(Ae, { className: "h-3 w-3" }), "Password protected"]
1326
+ children: [/* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3 w-3" }), "Password protected"]
1327
1327
  }), g && /* @__PURE__ */ (0, X.jsxs)(m, {
1328
1328
  variant: "outline",
1329
1329
  className: "text-xs gap-1",
1330
1330
  children: [
1331
- /* @__PURE__ */ (0, X.jsx)(U, { className: "h-3 w-3" }),
1331
+ /* @__PURE__ */ (0, X.jsx)(xe, { className: "h-3 w-3" }),
1332
1332
  "Expires in ",
1333
1333
  g,
1334
1334
  " day",
@@ -1342,8 +1342,8 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1342
1342
  className: "space-y-1.5",
1343
1343
  children: [/* @__PURE__ */ (0, X.jsxs)("label", {
1344
1344
  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, {
1345
+ children: [/* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3.5 w-3.5" }), "Password protection (optional)"]
1346
+ }), /* @__PURE__ */ (0, X.jsx)(N, {
1347
1347
  type: "password",
1348
1348
  value: f,
1349
1349
  onChange: (e) => p(e.target.value),
@@ -1355,7 +1355,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1355
1355
  className: "space-y-1.5",
1356
1356
  children: [/* @__PURE__ */ (0, X.jsxs)("label", {
1357
1357
  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)"]
1358
+ children: [/* @__PURE__ */ (0, X.jsx)(xe, { className: "h-3.5 w-3.5" }), "Expires after (optional)"]
1359
1359
  }), /* @__PURE__ */ (0, X.jsxs)("select", {
1360
1360
  value: g,
1361
1361
  onChange: (e) => _(e.target.value),
@@ -1385,29 +1385,34 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1385
1385
  })]
1386
1386
  }),
1387
1387
  /* @__PURE__ */ (0, X.jsxs)(h, {
1388
- onClick: y,
1388
+ onClick: ee,
1389
1389
  className: "w-full gap-2",
1390
1390
  size: "sm",
1391
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4" }), "Generate Link"]
1391
+ children: [/* @__PURE__ */ (0, X.jsx)(Ke, { className: "h-4 w-4" }), "Generate Link"]
1392
1392
  })
1393
1393
  ]
1394
1394
  })]
1395
1395
  })]
1396
1396
  });
1397
- }, zt = {
1397
+ }, Jt = {
1398
1398
  private: 0,
1399
1399
  team: 1,
1400
1400
  organization: 2,
1401
1401
  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({
1402
+ }, Yt = 8, Xt = ({ id: e, disabled: t, children: n }) => {
1403
+ let { attributes: r, listeners: i, setNodeRef: a, transform: o, transition: s, isDragging: c } = lt({
1404
1404
  id: e,
1405
- disabled: t
1405
+ disabled: t,
1406
+ attributes: {
1407
+ role: "tab",
1408
+ roleDescription: "view tab",
1409
+ tabIndex: 0
1410
+ }
1406
1411
  });
1407
1412
  return /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: n({
1408
1413
  setNodeRef: a,
1409
1414
  style: {
1410
- transform: rt.Transform.toString(o),
1415
+ transform: dt.Transform.toString(o),
1411
1416
  transition: s,
1412
1417
  zIndex: c ? 10 : void 0,
1413
1418
  opacity: c ? .5 : void 0
@@ -1416,155 +1421,239 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1416
1421
  attributes: r,
1417
1422
  isDragging: c
1418
1423
  }) });
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);
1424
+ }, Zt = ({ 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: ne, onConfigView: re, onManageViews: D, availableViewTypes: O, hasUnsavedChanges: ie = !1, onResetChanges: ae, className: oe }) => {
1425
+ let { showAddButton: se = !0, inlineRename: fe = !0, contextMenu: pe = !0, reorderable: me = !1, maxVisibleTabs: P = 6, showIndicators: he = !0, showSaveAsView: F = !0, showPinnedSection: I = !0, showVisibilityGroups: L = !1 } = u, [R, z] = s(null), [B, V] = s(""), H = o(null);
1421
1426
  i(() => {
1422
- M && I.current && (I.current.focus(), I.current.select());
1423
- }, [M]);
1424
- let _e = n((t) => {
1425
- if (!O || !f) return;
1427
+ R && H.current && (H.current.focus(), H.current.select());
1428
+ }, [R]);
1429
+ let ge = n((t) => {
1430
+ if (!fe || !f) return;
1426
1431
  let n = e.find((e) => e.id === t);
1427
- n && (N(t), F(n.label));
1432
+ n && (z(t), V(n.label));
1428
1433
  }, [
1429
- O,
1434
+ fe,
1430
1435
  f,
1431
1436
  e
1432
- ]), ve = n(() => {
1433
- M && P.trim() && f && f(M, P.trim()), N(null), F("");
1437
+ ]), _e = n(() => {
1438
+ R && B.trim() && f && f(R, B.trim()), z(null), V("");
1434
1439
  }, [
1435
- M,
1436
- P,
1440
+ R,
1441
+ B,
1437
1442
  f
1438
- ]), ye = n(() => {
1439
- N(null), F("");
1440
- }, []), B = a(() => {
1443
+ ]), ve = n(() => {
1444
+ z(null), V("");
1445
+ }, []), J = a(() => {
1441
1446
  let t = [...e];
1442
1447
  return t.sort((e, t) => {
1443
- if (A) {
1448
+ if (I) {
1444
1449
  let n = +!!e.isPinned, r = +!!t.isPinned;
1445
1450
  if (n !== r) return r - n;
1446
1451
  }
1447
- if (j) {
1448
- let n = zt[e.visibility || "public"] ?? zt.public, r = zt[t.visibility || "public"] ?? zt.public;
1452
+ if (L) {
1453
+ let n = Jt[e.visibility || "public"] ?? Jt.public, r = Jt[t.visibility || "public"] ?? Jt.public;
1449
1454
  if (n !== r) return n - r;
1450
1455
  }
1451
1456
  return 0;
1452
1457
  }), t;
1453
1458
  }, [
1454
1459
  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) => {
1460
+ I,
1461
+ L
1462
+ ]), { visibleViews: ye, overflowViews: be } = a(() => {
1463
+ let e = J.slice(0, P), t = J.slice(P), n = t.findIndex((e) => e.id === r);
1464
+ if (n === -1) return {
1465
+ visibleViews: e,
1466
+ overflowViews: t
1467
+ };
1468
+ 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);
1469
+ return o && s.unshift(o), {
1470
+ visibleViews: a,
1471
+ overflowViews: s
1472
+ };
1473
+ }, [
1474
+ J,
1475
+ P,
1476
+ r
1477
+ ]), xe = it(rt(tt, { activationConstraint: { distance: Yt } }), rt(et)), Se = n((e) => {
1458
1478
  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";
1479
+ if (!n || t.id === n.id || !E) return;
1480
+ let r = J.findIndex((e) => e.id === t.id), i = J.findIndex((e) => e.id === n.id);
1481
+ r === -1 || i === -1 || E(ot(J, r, i).map((e) => e.id));
1482
+ }, [J, E]), Te = Ye, Ee = n((e) => {
1483
+ if (!L || e === 0) return !1;
1484
+ let t = ye[e - 1], n = ye[e], r = (e) => e.visibility === "private";
1465
1485
  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, {
1486
+ }, [L, ye]), De = (e, n) => {
1487
+ let i = e.id === r, a = l[e.type] || Te, o = R === e.id, s = he && (e.hasActiveFilters || e.hasActiveSort), u = Ee(n), d = ((e) => L ? e.visibility === "private" ? /* @__PURE__ */ (0, X.jsx)(Ie, {
1468
1488
  "data-testid": `view-tab-visibility-${e.id}`,
1469
1489
  className: "h-3 w-3 text-muted-foreground shrink-0"
1470
- }) : e.visibility ? /* @__PURE__ */ (0, X.jsx)(Ee, {
1490
+ }) : e.visibility ? /* @__PURE__ */ (0, X.jsx)(ke, {
1471
1491
  "data-testid": `view-tab-visibility-${e.id}`,
1472
1492
  className: "h-3 w-3 text-muted-foreground shrink-0"
1473
- }) : null : null)(e), h = (t) => /* @__PURE__ */ (0, X.jsxs)("button", {
1493
+ }) : null : null)(e), h = (t) => /* @__PURE__ */ (0, X.jsxs)("div", {
1474
1494
  "data-testid": `view-tab-${e.id}`,
1495
+ role: "tab",
1496
+ tabIndex: 0,
1497
+ "aria-selected": i,
1475
1498
  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"),
1499
+ onDoubleClick: () => ge(e.id),
1500
+ onKeyDown: (t) => {
1501
+ !o && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), c(e.id));
1502
+ },
1503
+ ...t?.listeners ?? {},
1504
+ ...t?.attributes ?? {},
1505
+ 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
1506
  children: [
1479
- pe && w && /* @__PURE__ */ (0, X.jsx)("span", {
1507
+ me && E && /* @__PURE__ */ (0, X.jsx)("span", {
1480
1508
  "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" })
1509
+ "aria-hidden": "true",
1510
+ className: q("text-muted-foreground transition-opacity pointer-events-none", "opacity-0 group-hover/tab:opacity-100", t?.isDragging && "opacity-100"),
1511
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3" })
1485
1512
  }),
1486
- A && e.isPinned && /* @__PURE__ */ (0, X.jsx)(J, {
1513
+ I && e.isPinned && /* @__PURE__ */ (0, X.jsx)(Y, {
1487
1514
  "data-testid": `view-tab-pin-indicator-${e.id}`,
1488
1515
  className: "h-3 w-3 text-primary shrink-0"
1489
1516
  }),
1490
1517
  d,
1491
1518
  /* @__PURE__ */ (0, X.jsx)(a, { className: "h-3.5 w-3.5" }),
1492
- o ? /* @__PURE__ */ (0, X.jsx)(k, {
1493
- ref: I,
1519
+ o ? /* @__PURE__ */ (0, X.jsx)(N, {
1520
+ ref: H,
1494
1521
  "data-testid": `view-tab-rename-input-${e.id}`,
1495
- value: P,
1496
- onChange: (e) => F(e.target.value),
1497
- onBlur: ve,
1522
+ value: B,
1523
+ onChange: (e) => V(e.target.value),
1524
+ onBlur: _e,
1498
1525
  onKeyDown: (e) => {
1499
- e.key === "Enter" && ve(), e.key === "Escape" && ye();
1526
+ e.key === "Enter" && _e(), e.key === "Escape" && ve();
1500
1527
  },
1501
1528
  className: "h-5 w-24 px-1 py-0 text-sm border-none focus-visible:ring-1",
1502
1529
  onClick: (e) => e.stopPropagation()
1503
1530
  }) : /* @__PURE__ */ (0, X.jsx)("span", { children: e.label }),
1504
- s && /* @__PURE__ */ (0, X.jsxs)(be, { children: [/* @__PURE__ */ (0, X.jsx)(xe, {
1531
+ s && /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1505
1532
  asChild: !0,
1506
1533
  children: /* @__PURE__ */ (0, X.jsx)("span", {
1507
1534
  "data-testid": `view-tab-indicator-${e.id}`,
1508
1535
  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
1536
  children: [e.hasActiveFilters && "F", e.hasActiveSort && "S"].filter(Boolean).join("")
1510
1537
  })
1511
- }), /* @__PURE__ */ (0, X.jsx)(L, {
1538
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1512
1539
  side: "bottom",
1513
1540
  className: "text-xs",
1514
1541
  children: [e.hasActiveFilters && "Active filters", e.hasActiveSort && "Active sort"].filter(Boolean).join(", ")
1515
1542
  })] }),
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
- })
1543
+ e.isDefault && /* @__PURE__ */ (0, X.jsx)(Je, { className: "h-3 w-3 text-amber-500 fill-amber-500 shrink-0" }),
1544
+ i && (re || f || p || m) && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1545
+ asChild: !0,
1546
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1547
+ type: "button",
1548
+ "data-testid": `view-tab-actions-${e.id}`,
1549
+ 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",
1550
+ onClick: (e) => e.stopPropagation(),
1551
+ onPointerDown: (e) => e.stopPropagation(),
1552
+ onMouseDown: (e) => e.stopPropagation(),
1553
+ "aria-label": `View actions for ${e.label}`,
1554
+ children: /* @__PURE__ */ (0, X.jsx)(Ce, { className: "h-3 w-3" })
1555
+ })
1556
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1557
+ align: "start",
1558
+ className: "min-w-[180px]",
1559
+ onClick: (e) => e.stopPropagation(),
1560
+ children: [
1561
+ re && /* @__PURE__ */ (0, X.jsxs)(j, {
1562
+ "data-testid": `view-tab-menu-config-${e.id}`,
1563
+ onClick: () => re(e.id),
1564
+ children: [/* @__PURE__ */ (0, X.jsx)(Ge, { className: "h-4 w-4 mr-2" }), " Edit view config"]
1565
+ }),
1566
+ f && /* @__PURE__ */ (0, X.jsxs)(j, {
1567
+ "data-testid": `view-tab-menu-rename-${e.id}`,
1568
+ onClick: () => ge(e.id),
1569
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1570
+ }),
1571
+ p && /* @__PURE__ */ (0, X.jsxs)(j, {
1572
+ "data-testid": `view-tab-menu-duplicate-${e.id}`,
1573
+ onClick: () => p(e.id),
1574
+ children: [/* @__PURE__ */ (0, X.jsx)(we, { className: "h-4 w-4 mr-2" }), " Duplicate view"]
1575
+ }),
1576
+ _ && /* @__PURE__ */ (0, X.jsxs)(j, {
1577
+ "data-testid": `view-tab-menu-share-${e.id}`,
1578
+ onClick: () => _(e.id),
1579
+ children: [/* @__PURE__ */ (0, X.jsx)(Ke, { className: "h-4 w-4 mr-2" }), " Share view"]
1580
+ }),
1581
+ g && /* @__PURE__ */ (0, X.jsxs)(j, {
1582
+ "data-testid": `view-tab-menu-default-${e.id}`,
1583
+ onClick: () => g(e.id),
1584
+ children: [/* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4 mr-2" }), " Set as default"]
1585
+ }),
1586
+ T && /* @__PURE__ */ (0, X.jsx)(j, {
1587
+ "data-testid": `view-tab-menu-pin-${e.id}`,
1588
+ onClick: () => T(e.id, !e.isPinned),
1589
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Unpin view"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Y, { className: "h-4 w-4 mr-2" }), " Pin view"] })
1590
+ }),
1591
+ ne && O && O.length > 0 && /* @__PURE__ */ (0, X.jsxs)(ce, { children: [/* @__PURE__ */ (0, X.jsxs)(ue, {
1592
+ "data-testid": `view-tab-menu-change-type-${e.id}`,
1593
+ children: [/* @__PURE__ */ (0, X.jsx)(Ne, { className: "h-4 w-4 mr-2" }), " Change view type"]
1594
+ }), /* @__PURE__ */ (0, X.jsx)(le, { children: O.map((t) => {
1595
+ let n = l[t.type] || Te;
1596
+ return /* @__PURE__ */ (0, X.jsxs)(j, {
1597
+ "data-testid": `view-tab-menu-type-${e.id}-${t.type}`,
1598
+ disabled: t.type === e.type,
1599
+ onClick: () => ne(e.id, t.type),
1600
+ children: [/* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ (0, X.jsx)("span", { children: t.label })]
1601
+ }, t.type);
1602
+ }) })] }),
1603
+ m && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1604
+ "data-testid": `view-tab-menu-delete-${e.id}`,
1605
+ onClick: () => m(e.id),
1606
+ className: "text-destructive focus:text-destructive",
1607
+ children: [/* @__PURE__ */ (0, X.jsx)(Xe, { className: "h-4 w-4 mr-2" }), " Delete view"]
1608
+ })] }),
1609
+ D && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1610
+ "data-testid": `view-tab-menu-manage-${e.id}`,
1611
+ onClick: D,
1612
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1613
+ })] })
1614
+ ]
1615
+ })] })
1527
1616
  ]
1528
- }), ne = (t) => !fe || o ? t : /* @__PURE__ */ (0, X.jsxs)(v, { children: [/* @__PURE__ */ (0, X.jsx)(C, {
1617
+ }), w = (t) => !pe || o ? t : /* @__PURE__ */ (0, X.jsxs)(v, { children: [/* @__PURE__ */ (0, X.jsx)(C, {
1529
1618
  asChild: !0,
1530
1619
  children: t
1531
- }), /* @__PURE__ */ (0, X.jsxs)(y, { children: [
1532
- f && /* @__PURE__ */ (0, X.jsxs)(b, {
1620
+ }), /* @__PURE__ */ (0, X.jsxs)(ee, { children: [
1621
+ f && /* @__PURE__ */ (0, X.jsxs)(y, {
1533
1622
  "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"]
1623
+ onClick: () => ge(e.id),
1624
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1536
1625
  }),
1537
- p && /* @__PURE__ */ (0, X.jsxs)(b, {
1626
+ p && /* @__PURE__ */ (0, X.jsxs)(y, {
1538
1627
  "data-testid": `context-menu-duplicate-${e.id}`,
1539
1628
  onClick: () => p(e.id),
1540
- children: [/* @__PURE__ */ (0, X.jsx)(G, { className: "h-4 w-4 mr-2" }), " Duplicate View"]
1629
+ children: [/* @__PURE__ */ (0, X.jsx)(we, { className: "h-4 w-4 mr-2" }), " Duplicate View"]
1541
1630
  }),
1542
- _ && /* @__PURE__ */ (0, X.jsxs)(b, {
1631
+ _ && /* @__PURE__ */ (0, X.jsxs)(y, {
1543
1632
  "data-testid": `context-menu-share-${e.id}`,
1544
1633
  onClick: () => _(e.id),
1545
- children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Share View"]
1634
+ children: [/* @__PURE__ */ (0, X.jsx)(Ke, { className: "h-4 w-4 mr-2" }), " Share View"]
1546
1635
  }),
1547
- g && /* @__PURE__ */ (0, X.jsxs)(b, {
1636
+ g && /* @__PURE__ */ (0, X.jsxs)(y, {
1548
1637
  "data-testid": `context-menu-default-${e.id}`,
1549
1638
  onClick: () => g(e.id),
1550
- children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-2" }), " Set as Default"]
1639
+ children: [/* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4 mr-2" }), " Set as Default"]
1551
1640
  }),
1552
- re && /* @__PURE__ */ (0, X.jsx)(b, {
1641
+ T && /* @__PURE__ */ (0, X.jsx)(y, {
1553
1642
  "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"] })
1643
+ onClick: () => T(e.id, !e.isPinned),
1644
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Unpin View"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Y, { className: "h-4 w-4 mr-2" }), " Pin View"] })
1556
1645
  }),
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, {
1646
+ ne && 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
1647
  "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, {
1648
+ children: [/* @__PURE__ */ (0, X.jsx)(Ne, { className: "h-4 w-4 mr-2" }), " Change View Type"]
1649
+ }), /* @__PURE__ */ (0, X.jsx)(x, {
1561
1650
  "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, {
1651
+ children: O.map((t) => {
1652
+ let n = l[t.type] || Te;
1653
+ return /* @__PURE__ */ (0, X.jsxs)(y, {
1565
1654
  "data-testid": `context-menu-type-${e.id}-${t.type}`,
1566
1655
  disabled: t.type === e.type,
1567
- onClick: () => ie(e.id, t.type),
1656
+ onClick: () => ne(e.id, t.type),
1568
1657
  children: [/* @__PURE__ */ (0, X.jsx)(n, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ (0, X.jsxs)("div", {
1569
1658
  className: "flex flex-col",
1570
1659
  children: [/* @__PURE__ */ (0, X.jsx)("span", { children: t.label }), t.description && /* @__PURE__ */ (0, X.jsx)("span", {
@@ -1575,69 +1664,80 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1575
1664
  }, t.type);
1576
1665
  })
1577
1666
  })] })] }),
1578
- m && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(x, {}), /* @__PURE__ */ (0, X.jsxs)(b, {
1667
+ m && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(b, {}), /* @__PURE__ */ (0, X.jsxs)(y, {
1579
1668
  "data-testid": `context-menu-delete-${e.id}`,
1580
1669
  onClick: () => m(e.id),
1581
1670
  className: "text-destructive focus:text-destructive",
1582
- children: [/* @__PURE__ */ (0, X.jsx)(Ue, { className: "h-4 w-4 mr-2" }), " Delete View"]
1671
+ children: [/* @__PURE__ */ (0, X.jsx)(Xe, { className: "h-4 w-4 mr-2" }), " Delete View"]
1672
+ })] }),
1673
+ D && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(b, {}), /* @__PURE__ */ (0, X.jsxs)(y, {
1674
+ "data-testid": `context-menu-manage-${e.id}`,
1675
+ onClick: D,
1676
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1583
1677
  })] })
1584
1678
  ] })] });
1585
- return pe && w ? /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1679
+ return me && E ? /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1586
1680
  "data-testid": "view-tab-visibility-separator",
1587
1681
  className: "w-px h-5 bg-border mx-1 self-center shrink-0"
1588
- }), /* @__PURE__ */ (0, X.jsx)(Vt, {
1682
+ }), /* @__PURE__ */ (0, X.jsx)(Xt, {
1589
1683
  id: e.id,
1590
1684
  children: ({ setNodeRef: e, style: t, listeners: n, attributes: r, isDragging: i }) => /* @__PURE__ */ (0, X.jsx)("div", {
1591
1685
  ref: e,
1592
1686
  style: t,
1593
- className: z("flex", i && "z-10"),
1594
- children: ne(h({
1687
+ className: q("flex", i && "z-10"),
1688
+ children: w(h({
1595
1689
  listeners: n,
1596
- attributes: r
1690
+ attributes: r,
1691
+ isDragging: i
1597
1692
  }))
1598
1693
  })
1599
1694
  })] }, e.id) : /* @__PURE__ */ (0, X.jsxs)(t.Fragment, { children: [u && /* @__PURE__ */ (0, X.jsx)("div", {
1600
1695
  "data-testid": "view-tab-visibility-separator",
1601
1696
  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", {
1697
+ }), w(h())] }, e.id);
1698
+ }, Oe = /* @__PURE__ */ (0, X.jsx)(X.Fragment, { children: ye.map((e, t) => De(e, t)) });
1699
+ return /* @__PURE__ */ (0, X.jsx)(G, { children: /* @__PURE__ */ (0, X.jsxs)("div", {
1605
1700
  "data-testid": "view-tab-bar",
1606
- className: z("flex items-center gap-0.5 -mb-px", le),
1701
+ className: q("flex items-center gap-0.5 -mb-px", oe),
1607
1702
  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,
1703
+ me && E ? /* @__PURE__ */ (0, X.jsx)($e, {
1704
+ sensors: xe,
1705
+ collisionDetection: nt,
1706
+ onDragEnd: Se,
1707
+ children: /* @__PURE__ */ (0, X.jsx)(at, {
1708
+ items: ye.map((e) => e.id),
1709
+ strategy: st,
1615
1710
  children: /* @__PURE__ */ (0, X.jsx)("div", {
1616
1711
  "data-testid": "view-tab-sortable-container",
1617
1712
  className: "flex items-center gap-0.5",
1618
- children: Te
1713
+ children: Oe
1619
1714
  })
1620
1715
  })
1621
- }) : Te,
1622
- H.length > 0 && /* @__PURE__ */ (0, X.jsxs)(de, { children: [/* @__PURE__ */ (0, X.jsx)(D, {
1716
+ }) : Oe,
1717
+ be.length > 0 && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1623
1718
  asChild: !0,
1624
1719
  children: /* @__PURE__ */ (0, X.jsxs)("button", {
1625
1720
  "data-testid": "view-tab-overflow",
1626
1721
  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", {
1722
+ children: [/* @__PURE__ */ (0, X.jsx)(Re, { className: "h-4 w-4" }), /* @__PURE__ */ (0, X.jsxs)("span", {
1628
1723
  className: "text-xs",
1629
- children: [H.length, " more"]
1724
+ children: [be.length, " more"]
1630
1725
  })]
1631
1726
  })
1632
- }), /* @__PURE__ */ (0, X.jsx)(T, {
1727
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1633
1728
  align: "end",
1634
- children: H.map((e) => {
1635
- let t = l[e.type] || Se;
1636
- return /* @__PURE__ */ (0, X.jsxs)(E, {
1729
+ children: [D && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsxs)(j, {
1730
+ "data-testid": "view-tab-overflow-manage",
1731
+ onClick: D,
1732
+ className: "font-medium",
1733
+ children: [/* @__PURE__ */ (0, X.jsx)(Fe, { className: "h-4 w-4 mr-2" }), " Manage all views…"]
1734
+ }), /* @__PURE__ */ (0, X.jsx)(M, {})] }), be.map((e) => {
1735
+ let t = l[e.type] || Te;
1736
+ return /* @__PURE__ */ (0, X.jsxs)(j, {
1637
1737
  "data-testid": `view-tab-overflow-${e.id}`,
1638
1738
  onClick: () => c(e.id),
1639
1739
  children: [
1640
- e.isPinned && /* @__PURE__ */ (0, X.jsx)(J, { className: "h-3 w-3 mr-1 text-primary shrink-0" }),
1740
+ e.isPinned && /* @__PURE__ */ (0, X.jsx)(Y, { className: "h-3 w-3 mr-1 text-primary shrink-0" }),
1641
1741
  /* @__PURE__ */ (0, X.jsx)(t, { className: "h-4 w-4 mr-2" }),
1642
1742
  e.label,
1643
1743
  he && (e.hasActiveFilters || e.hasActiveSort) && /* @__PURE__ */ (0, X.jsx)("span", {
@@ -1646,47 +1746,330 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1646
1746
  })
1647
1747
  ]
1648
1748
  }, e.id);
1649
- })
1749
+ })]
1650
1750
  })] }),
1651
- ue && d && /* @__PURE__ */ (0, X.jsxs)(be, { children: [/* @__PURE__ */ (0, X.jsx)(xe, {
1751
+ se && d && /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1652
1752
  asChild: !0,
1653
1753
  children: /* @__PURE__ */ (0, X.jsx)("button", {
1654
1754
  "data-testid": "view-tab-add",
1655
1755
  onClick: d,
1656
1756
  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" })
1757
+ children: /* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4" })
1658
1758
  })
1659
- }), /* @__PURE__ */ (0, X.jsx)(L, { children: "Add View" })] }),
1660
- ge && se && /* @__PURE__ */ (0, X.jsxs)("div", {
1759
+ }), /* @__PURE__ */ (0, X.jsx)(W, { children: "Add View" })] }),
1760
+ F && ie && /* @__PURE__ */ (0, X.jsxs)("div", {
1661
1761
  "data-testid": "view-tab-save-as",
1662
1762
  className: "flex items-center gap-1 ml-2 text-xs text-amber-600 dark:text-amber-400",
1663
1763
  children: [
1664
- /* @__PURE__ */ (0, X.jsx)(Ie, { className: "h-3.5 w-3.5" }),
1764
+ /* @__PURE__ */ (0, X.jsx)(He, { className: "h-3.5 w-3.5" }),
1665
1765
  /* @__PURE__ */ (0, X.jsx)("span", {
1666
1766
  className: "hidden sm:inline",
1667
1767
  children: "Unsaved changes"
1668
1768
  }),
1669
- ne && /* @__PURE__ */ (0, X.jsx)(h, {
1769
+ w && /* @__PURE__ */ (0, X.jsx)(h, {
1670
1770
  variant: "ghost",
1671
1771
  size: "sm",
1672
1772
  "data-testid": "view-tab-save-as-btn",
1673
1773
  className: "h-6 px-2 text-xs",
1674
- onClick: ne,
1774
+ onClick: w,
1675
1775
  children: "Save as View"
1676
1776
  }),
1677
- ce && /* @__PURE__ */ (0, X.jsx)(h, {
1777
+ ae && /* @__PURE__ */ (0, X.jsx)(h, {
1678
1778
  variant: "ghost",
1679
1779
  size: "sm",
1680
1780
  "data-testid": "view-tab-reset-btn",
1681
1781
  className: "h-6 px-2 text-xs",
1682
- onClick: ce,
1782
+ onClick: ae,
1683
1783
  children: "Reset"
1684
1784
  })
1685
1785
  ]
1686
1786
  })
1687
1787
  ]
1688
1788
  }) });
1689
- }, Ut = {
1789
+ }, Qt = Ye, $t = ({ 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 }) => {
1790
+ let { attributes: _, listeners: v, setNodeRef: ee, transform: y, transition: b, isDragging: te } = lt({ id: e.id }), x = {
1791
+ transform: dt.Transform.toString(y),
1792
+ transition: b,
1793
+ opacity: te ? .5 : 1
1794
+ }, S = o(null), [C, w] = s(e.label);
1795
+ i(() => {
1796
+ a && (w(e.label), requestAnimationFrame(() => {
1797
+ S.current?.focus(), S.current?.select();
1798
+ }));
1799
+ }, [a, e.label]);
1800
+ let T = n(() => {
1801
+ let t = C.trim();
1802
+ t && t !== e.label ? l(e.id, t) : u();
1803
+ }, [
1804
+ C,
1805
+ e.id,
1806
+ e.label,
1807
+ l,
1808
+ u
1809
+ ]);
1810
+ return /* @__PURE__ */ (0, X.jsxs)("li", {
1811
+ ref: ee,
1812
+ style: x,
1813
+ "data-testid": `manage-views-row-${e.id}`,
1814
+ 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"),
1815
+ children: [
1816
+ /* @__PURE__ */ (0, X.jsx)("button", {
1817
+ type: "button",
1818
+ ..._,
1819
+ ...v,
1820
+ "aria-label": "Drag to reorder",
1821
+ "data-testid": `manage-views-drag-${e.id}`,
1822
+ 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",
1823
+ onClick: (e) => e.stopPropagation(),
1824
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-4 w-4" })
1825
+ }),
1826
+ /* @__PURE__ */ (0, X.jsx)(r, { className: "shrink-0 h-4 w-4 text-muted-foreground" }),
1827
+ /* @__PURE__ */ (0, X.jsx)("div", {
1828
+ className: "flex-1 min-w-0",
1829
+ onClick: () => {
1830
+ a || d?.(e.id);
1831
+ },
1832
+ children: a ? /* @__PURE__ */ (0, X.jsx)(N, {
1833
+ ref: S,
1834
+ value: C,
1835
+ onChange: (e) => w(e.target.value),
1836
+ onBlur: T,
1837
+ onKeyDown: (e) => {
1838
+ e.key === "Enter" ? (e.preventDefault(), T()) : e.key === "Escape" && (e.preventDefault(), u());
1839
+ },
1840
+ onClick: (e) => e.stopPropagation(),
1841
+ className: "h-7 text-sm",
1842
+ "data-testid": `manage-views-rename-input-${e.id}`
1843
+ }) : /* @__PURE__ */ (0, X.jsxs)("button", {
1844
+ type: "button",
1845
+ className: "w-full text-left text-sm font-medium truncate cursor-pointer",
1846
+ onDoubleClick: (t) => {
1847
+ t.stopPropagation(), c(e.id);
1848
+ },
1849
+ title: e.label,
1850
+ children: [e.label, e.isDefault && /* @__PURE__ */ (0, X.jsxs)("span", {
1851
+ className: "ml-2 inline-flex items-center text-[10px] uppercase tracking-wide text-muted-foreground",
1852
+ title: "Default view",
1853
+ children: [/* @__PURE__ */ (0, X.jsx)(Je, { className: "h-3 w-3 mr-0.5 fill-current" }), " default"]
1854
+ })]
1855
+ })
1856
+ }),
1857
+ h && !a && /* @__PURE__ */ (0, X.jsx)(G, {
1858
+ delayDuration: 300,
1859
+ children: /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1860
+ asChild: !0,
1861
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1862
+ type: "button",
1863
+ "aria-label": e.isPinned ? "Unpin view" : "Pin view",
1864
+ "data-testid": `manage-views-pin-${e.id}`,
1865
+ onClick: (t) => {
1866
+ t.stopPropagation(), h(e.id, !e.isPinned);
1867
+ },
1868
+ 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"),
1869
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsx)(Y, { className: "h-4 w-4 fill-current" }) : /* @__PURE__ */ (0, X.jsx)(Y, { className: "h-4 w-4" })
1870
+ })
1871
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1872
+ side: "top",
1873
+ children: e.isPinned ? "Unpin view" : "Pin view"
1874
+ })] })
1875
+ }),
1876
+ m && !a && !e.isDefault && /* @__PURE__ */ (0, X.jsx)(G, {
1877
+ delayDuration: 300,
1878
+ children: /* @__PURE__ */ (0, X.jsxs)(U, { children: [/* @__PURE__ */ (0, X.jsx)(K, {
1879
+ asChild: !0,
1880
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1881
+ type: "button",
1882
+ "aria-label": "Set as default",
1883
+ "data-testid": `manage-views-default-${e.id}`,
1884
+ onClick: (t) => {
1885
+ t.stopPropagation(), m(e.id);
1886
+ },
1887
+ 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",
1888
+ children: /* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4" })
1889
+ })
1890
+ }), /* @__PURE__ */ (0, X.jsx)(W, {
1891
+ side: "top",
1892
+ children: "Set as default"
1893
+ })] })
1894
+ }),
1895
+ !a && (f || p || g || m) && /* @__PURE__ */ (0, X.jsxs)(k, { children: [/* @__PURE__ */ (0, X.jsx)(de, {
1896
+ asChild: !0,
1897
+ children: /* @__PURE__ */ (0, X.jsx)("button", {
1898
+ type: "button",
1899
+ "aria-label": `Actions for ${e.label}`,
1900
+ "data-testid": `manage-views-actions-${e.id}`,
1901
+ onClick: (e) => e.stopPropagation(),
1902
+ 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",
1903
+ children: /* @__PURE__ */ (0, X.jsx)(Re, { className: "h-4 w-4" })
1904
+ })
1905
+ }), /* @__PURE__ */ (0, X.jsxs)(A, {
1906
+ align: "end",
1907
+ className: "min-w-[180px]",
1908
+ children: [
1909
+ /* @__PURE__ */ (0, X.jsxs)(j, {
1910
+ "data-testid": `manage-views-action-rename-${e.id}`,
1911
+ onClick: () => c(e.id),
1912
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Rename"]
1913
+ }),
1914
+ p && /* @__PURE__ */ (0, X.jsxs)(j, {
1915
+ "data-testid": `manage-views-action-duplicate-${e.id}`,
1916
+ onClick: () => p(e.id),
1917
+ children: [/* @__PURE__ */ (0, X.jsx)(we, { className: "h-4 w-4 mr-2" }), " Duplicate"]
1918
+ }),
1919
+ g && /* @__PURE__ */ (0, X.jsxs)(j, {
1920
+ "data-testid": `manage-views-action-config-${e.id}`,
1921
+ onClick: () => g(e.id),
1922
+ children: [/* @__PURE__ */ (0, X.jsx)(ze, { className: "h-4 w-4 mr-2" }), " Edit configuration…"]
1923
+ }),
1924
+ m && !e.isDefault && /* @__PURE__ */ (0, X.jsxs)(j, {
1925
+ "data-testid": `manage-views-action-default-${e.id}`,
1926
+ onClick: () => m(e.id),
1927
+ children: [/* @__PURE__ */ (0, X.jsx)(Je, { className: "h-4 w-4 mr-2" }), " Set as default"]
1928
+ }),
1929
+ h && /* @__PURE__ */ (0, X.jsx)(j, {
1930
+ "data-testid": `manage-views-action-pin-${e.id}`,
1931
+ onClick: () => h(e.id, !e.isPinned),
1932
+ children: e.isPinned ? /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Be, { className: "h-4 w-4 mr-2" }), " Unpin"] }) : /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(Y, { className: "h-4 w-4 mr-2" }), " Pin"] })
1933
+ }),
1934
+ f && /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(M, {}), /* @__PURE__ */ (0, X.jsxs)(j, {
1935
+ "data-testid": `manage-views-action-delete-${e.id}`,
1936
+ onClick: () => f(e.id),
1937
+ className: "text-destructive focus:text-destructive",
1938
+ children: [/* @__PURE__ */ (0, X.jsx)(Xe, { className: "h-4 w-4 mr-2" }), " Delete"]
1939
+ })] })
1940
+ ]
1941
+ })] }),
1942
+ a && /* @__PURE__ */ (0, X.jsxs)("div", {
1943
+ className: "flex items-center gap-1 shrink-0",
1944
+ children: [/* @__PURE__ */ (0, X.jsx)("button", {
1945
+ type: "button",
1946
+ "aria-label": "Save name",
1947
+ onMouseDown: (e) => e.preventDefault(),
1948
+ onClick: T,
1949
+ className: "h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-emerald-600",
1950
+ children: /* @__PURE__ */ (0, X.jsx)(Se, { className: "h-4 w-4" })
1951
+ }), /* @__PURE__ */ (0, X.jsx)("button", {
1952
+ type: "button",
1953
+ "aria-label": "Cancel rename",
1954
+ onMouseDown: (e) => e.preventDefault(),
1955
+ onClick: u,
1956
+ className: "h-7 w-7 inline-flex items-center justify-center rounded hover:bg-accent text-muted-foreground",
1957
+ children: /* @__PURE__ */ (0, X.jsx)(Ze, { className: "h-4 w-4" })
1958
+ })]
1959
+ })
1960
+ ]
1961
+ });
1962
+ }, en = ({ 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 }) => {
1963
+ let [_, v] = s(""), [ee, y] = s(null), [b, te] = s(() => n.map((e) => e.id));
1964
+ i(() => {
1965
+ te(n.map((e) => e.id));
1966
+ }, [n]), i(() => {
1967
+ e || (y(null), v(""));
1968
+ }, [e]);
1969
+ let x = a(() => {
1970
+ let e = new Map(n.map((e) => [e.id, e]));
1971
+ return b.map((t) => e.get(t)).filter(Boolean);
1972
+ }, [b, n]), S = a(() => {
1973
+ if (!_.trim()) return x;
1974
+ let e = _.toLowerCase();
1975
+ return x.filter((t) => t.label.toLowerCase().includes(e));
1976
+ }, [x, _]), C = it(rt(tt, { activationConstraint: { distance: 5 } }), rt(et, { coordinateGetter: ct })), O = (e) => {
1977
+ let { active: t, over: n } = e;
1978
+ if (!n || t.id === n.id) return;
1979
+ let r = b.indexOf(String(t.id)), i = b.indexOf(String(n.id));
1980
+ if (r < 0 || i < 0) return;
1981
+ let a = ot(b, r, i);
1982
+ te(a), p?.(a);
1983
+ }, ie = (e) => {
1984
+ t(!1), requestAnimationFrame(() => g?.(e));
1985
+ };
1986
+ return /* @__PURE__ */ (0, X.jsx)(w, {
1987
+ open: e,
1988
+ onOpenChange: t,
1989
+ children: /* @__PURE__ */ (0, X.jsxs)(T, {
1990
+ className: "sm:max-w-[560px] p-0 gap-0 overflow-hidden",
1991
+ "data-testid": "manage-views-dialog",
1992
+ children: [
1993
+ /* @__PURE__ */ (0, X.jsxs)(re, {
1994
+ className: "px-5 pt-5 pb-3",
1995
+ children: [/* @__PURE__ */ (0, X.jsx)(D, {
1996
+ className: "text-base",
1997
+ children: "Manage views"
1998
+ }), /* @__PURE__ */ (0, X.jsx)(E, {
1999
+ className: "text-xs",
2000
+ children: "Reorder, rename, pin, or delete every view in this object."
2001
+ })]
2002
+ }),
2003
+ /* @__PURE__ */ (0, X.jsx)("div", {
2004
+ className: "px-5 pb-3",
2005
+ children: /* @__PURE__ */ (0, X.jsxs)("div", {
2006
+ className: "relative",
2007
+ children: [/* @__PURE__ */ (0, X.jsx)(Ue, { 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)(N, {
2008
+ value: _,
2009
+ onChange: (e) => v(e.target.value),
2010
+ placeholder: "Search views",
2011
+ className: "pl-8 h-9",
2012
+ "data-testid": "manage-views-search"
2013
+ })]
2014
+ })
2015
+ }),
2016
+ /* @__PURE__ */ (0, X.jsx)("div", {
2017
+ className: "px-3 pb-3 max-h-[55vh] overflow-y-auto",
2018
+ "data-testid": "manage-views-list",
2019
+ children: S.length === 0 ? /* @__PURE__ */ (0, X.jsx)("div", {
2020
+ className: "text-center text-sm text-muted-foreground py-10",
2021
+ children: "No views match your search."
2022
+ }) : /* @__PURE__ */ (0, X.jsx)($e, {
2023
+ sensors: C,
2024
+ collisionDetection: nt,
2025
+ onDragEnd: O,
2026
+ children: /* @__PURE__ */ (0, X.jsx)(at, {
2027
+ items: S.map((e) => e.id),
2028
+ strategy: ut,
2029
+ children: /* @__PURE__ */ (0, X.jsx)("ul", {
2030
+ className: "space-y-0.5",
2031
+ children: S.map((e) => /* @__PURE__ */ (0, X.jsx)($t, {
2032
+ view: e,
2033
+ Icon: o[e.type] || Qt,
2034
+ isActive: e.id === r,
2035
+ isRenaming: ee === e.id,
2036
+ onStartRename: (e) => y(e),
2037
+ onCancelRename: () => y(null),
2038
+ onCommitRename: (e, t) => {
2039
+ y(null), c?.(e, t);
2040
+ },
2041
+ onDelete: l,
2042
+ onDuplicate: u,
2043
+ onSetDefault: d,
2044
+ onSetPinned: f,
2045
+ onConfigView: g ? ie : void 0
2046
+ }, e.id))
2047
+ })
2048
+ })
2049
+ })
2050
+ }),
2051
+ /* @__PURE__ */ (0, X.jsxs)(ne, {
2052
+ className: "border-t bg-muted/30 px-5 py-3 flex sm:justify-between gap-2",
2053
+ children: [m ? /* @__PURE__ */ (0, X.jsxs)(h, {
2054
+ variant: "ghost",
2055
+ size: "sm",
2056
+ onClick: () => {
2057
+ t(!1), requestAnimationFrame(() => m());
2058
+ },
2059
+ "data-testid": "manage-views-add",
2060
+ className: "text-sm",
2061
+ children: [/* @__PURE__ */ (0, X.jsx)(Ve, { className: "h-4 w-4 mr-1.5" }), " Add new view"]
2062
+ }) : /* @__PURE__ */ (0, X.jsx)("span", {}), /* @__PURE__ */ (0, X.jsx)(h, {
2063
+ size: "sm",
2064
+ onClick: () => t(!1),
2065
+ "data-testid": "manage-views-done",
2066
+ children: "Done"
2067
+ })]
2068
+ })
2069
+ ]
2070
+ })
2071
+ });
2072
+ }, tn = {
1690
2073
  "=": "equals",
1691
2074
  "==": "equals",
1692
2075
  "!=": "notEquals",
@@ -1715,7 +2098,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1715
2098
  isEmpty: "isEmpty",
1716
2099
  isNotEmpty: "isNotEmpty",
1717
2100
  notIn: "notIn"
1718
- }, Wt = {
2101
+ }, nn = {
1719
2102
  equals: "=",
1720
2103
  notEquals: "!=",
1721
2104
  greaterThan: ">",
@@ -1732,7 +2115,7 @@ var Rt = ({ objectName: t, viewId: n = "default", baseUrl: r, onShare: i, classN
1732
2115
  after: "after",
1733
2116
  between: "between"
1734
2117
  };
1735
- function Gt(e) {
2118
+ function rn(e) {
1736
2119
  let t = (e || "").toLowerCase();
1737
2120
  return [
1738
2121
  "integer",
@@ -1768,39 +2151,39 @@ function Gt(e) {
1768
2151
  "owner"
1769
2152
  ].includes(t) ? "select" : "text";
1770
2153
  }
1771
- function Kt(e) {
2154
+ function an(e) {
1772
2155
  if (!Array.isArray(e) || e.length < 2) return null;
1773
2156
  let [t, n, r] = e;
1774
2157
  return typeof t != "string" || typeof n != "string" ? null : {
1775
2158
  id: crypto.randomUUID(),
1776
2159
  field: t,
1777
- operator: Ut[n] || n,
2160
+ operator: tn[n] || n,
1778
2161
  value: r ?? ""
1779
2162
  };
1780
2163
  }
1781
- function qt(e) {
2164
+ function on(e) {
1782
2165
  if (Array.isArray(e)) {
1783
- let t = Kt(e);
2166
+ let t = an(e);
1784
2167
  return t ? [t] : [];
1785
2168
  }
1786
2169
  return typeof e == "object" && e && e.field ? [{
1787
2170
  id: e.id || crypto.randomUUID(),
1788
2171
  field: e.field,
1789
- operator: Ut[e.operator] || e.operator || "equals",
2172
+ operator: tn[e.operator] || e.operator || "equals",
1790
2173
  value: e.value ?? ""
1791
2174
  }] : [];
1792
2175
  }
1793
- function Jt(e) {
2176
+ function sn(e) {
1794
2177
  if (!Array.isArray(e) || e.length === 0) return {
1795
2178
  logic: "and",
1796
2179
  conditions: []
1797
2180
  };
1798
2181
  if (typeof e[0] == "string" && (e[0] === "and" || e[0] === "or")) return {
1799
2182
  logic: e[0],
1800
- conditions: e.slice(1).flatMap((e) => qt(e))
2183
+ conditions: e.slice(1).flatMap((e) => on(e))
1801
2184
  };
1802
2185
  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);
2186
+ let t = an(e);
1804
2187
  return {
1805
2188
  logic: "and",
1806
2189
  conditions: t ? [t] : []
@@ -1808,29 +2191,29 @@ function Jt(e) {
1808
2191
  }
1809
2192
  if (Array.isArray(e[0]) || typeof e[0] == "object" && e[0] !== null && !Array.isArray(e[0])) return {
1810
2193
  logic: "and",
1811
- conditions: e.flatMap((e) => qt(e))
2194
+ conditions: e.flatMap((e) => on(e))
1812
2195
  };
1813
- let t = Kt(e);
2196
+ let t = an(e);
1814
2197
  return {
1815
2198
  logic: "and",
1816
2199
  conditions: t ? [t] : []
1817
2200
  };
1818
2201
  }
1819
- function Yt(e, t) {
2202
+ function cn(e, t) {
1820
2203
  let n = t.filter((e) => e.field).map((e) => [
1821
2204
  e.field,
1822
- Wt[e.operator] || e.operator,
2205
+ nn[e.operator] || e.operator,
1823
2206
  e.value
1824
2207
  ]);
1825
2208
  return n.length === 0 ? [] : n.length === 1 && e === "and" ? n[0] : e === "or" ? ["or", ...n] : n;
1826
2209
  }
1827
- function Xt(e) {
2210
+ function ln(e) {
1828
2211
  return e.split(",").map((e) => e.trim()).filter(Boolean);
1829
2212
  }
1830
- function Zt(e) {
2213
+ function un(e) {
1831
2214
  return e.split(",").map((e) => Number(e.trim())).filter((e) => !isNaN(e) && e > 0);
1832
2215
  }
1833
- var Qt = {
2216
+ var dn = {
1834
2217
  grid: "Grid",
1835
2218
  kanban: "Kanban",
1836
2219
  calendar: "Calendar",
@@ -1839,7 +2222,7 @@ var Qt = {
1839
2222
  gantt: "Gantt",
1840
2223
  map: "Map",
1841
2224
  chart: "Chart"
1842
- }, $t = Object.keys(Qt), en = [
2225
+ }, fn = Object.keys(dn), pn = [
1843
2226
  {
1844
2227
  value: "compact",
1845
2228
  gapClass: "gap-0"
@@ -1861,23 +2244,23 @@ var Qt = {
1861
2244
  gapClass: "gap-1.5"
1862
2245
  }
1863
2246
  ];
1864
- function tn(e) {
2247
+ function mn(e) {
1865
2248
  return e.fields ? Object.entries(e.fields).map(([e, t]) => ({
1866
2249
  value: e,
1867
2250
  label: t.label || e,
1868
- type: Gt(t.type),
2251
+ type: rn(t.type),
1869
2252
  options: t.options
1870
2253
  })) : [];
1871
2254
  }
1872
- function nn(e) {
1873
- let t = Jt(e);
2255
+ function hn(e) {
2256
+ let t = sn(e);
1874
2257
  return {
1875
2258
  id: "root",
1876
2259
  logic: t.logic,
1877
2260
  conditions: t.conditions
1878
2261
  };
1879
2262
  }
1880
- function rn(e) {
2263
+ function gn(e) {
1881
2264
  return (Array.isArray(e) ? e : []).map((e) => ({
1882
2265
  id: e.id || crypto.randomUUID(),
1883
2266
  field: e.field || "",
@@ -1890,13 +2273,13 @@ function Z({ renderSummary: e, children: n }) {
1890
2273
  let [r, i] = t.useState(!1);
1891
2274
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [e(() => i((e) => !e)), r && n] });
1892
2275
  }
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 });
2276
+ var _n = 5;
2277
+ function vn({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a }) {
2278
+ let { attributes: o, listeners: s, setNodeRef: c, transform: l, transition: u, isDragging: d } = lt({ id: e });
1896
2279
  return /* @__PURE__ */ (0, X.jsxs)("div", {
1897
2280
  ref: c,
1898
2281
  style: {
1899
- transform: rt.Transform.toString(l),
2282
+ transform: dt.Transform.toString(l),
1900
2283
  transition: u,
1901
2284
  zIndex: d ? 10 : void 0,
1902
2285
  opacity: d ? .5 : void 0
@@ -1910,7 +2293,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1910
2293
  ...s,
1911
2294
  className: "shrink-0 cursor-grab touch-none",
1912
2295
  "data-testid": `col-drag-handle-${e}`,
1913
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 text-muted-foreground/50" })
2296
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 text-muted-foreground/50" })
1914
2297
  }),
1915
2298
  /* @__PURE__ */ (0, X.jsx)("button", {
1916
2299
  type: "button",
@@ -1918,7 +2301,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1918
2301
  className: "h-5 w-5 flex items-center justify-center rounded hover:bg-accent shrink-0",
1919
2302
  onClick: () => i(e, !1),
1920
2303
  "aria-label": `Hide ${t}`,
1921
- children: /* @__PURE__ */ (0, X.jsx)(Se, { className: "h-3.5 w-3.5 text-primary" })
2304
+ children: /* @__PURE__ */ (0, X.jsx)(Te, { className: "h-3.5 w-3.5 text-primary" })
1922
2305
  }),
1923
2306
  /* @__PURE__ */ (0, X.jsx)("span", {
1924
2307
  className: "truncate flex-1",
@@ -1931,7 +2314,7 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1931
2314
  disabled: n === 0,
1932
2315
  onClick: () => a(e, "up"),
1933
2316
  "aria-label": `Move ${t} up`,
1934
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 rotate-90" })
2317
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 rotate-90" })
1935
2318
  }),
1936
2319
  /* @__PURE__ */ (0, X.jsx)("button", {
1937
2320
  type: "button",
@@ -1940,25 +2323,25 @@ function on({ colName: e, label: t, idx: n, total: r, onToggle: i, onMove: a })
1940
2323
  disabled: n === r - 1,
1941
2324
  onClick: () => a(e, "down"),
1942
2325
  "aria-label": `Move ${t} down`,
1943
- children: /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 -rotate-90" })
2326
+ children: /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 -rotate-90" })
1944
2327
  })
1945
2328
  ]
1946
2329
  });
1947
2330
  }
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,
2331
+ function yn({ columns: e, fieldOptions: n, onToggle: r, onMove: i, onReorder: a }) {
2332
+ return /* @__PURE__ */ (0, X.jsx)($e, {
2333
+ sensors: it(rt(tt, { activationConstraint: { distance: _n } }), rt(et)),
2334
+ collisionDetection: nt,
1952
2335
  onDragEnd: t.useCallback((t) => {
1953
2336
  let { active: n, over: r } = t;
1954
2337
  if (!r || n.id === r.id) return;
1955
2338
  let i = e.indexOf(String(n.id)), o = e.indexOf(String(r.id));
1956
- i === -1 || o === -1 || a($e(e, i, o));
2339
+ i === -1 || o === -1 || a(ot(e, i, o));
1957
2340
  }, [e, a]),
1958
- children: /* @__PURE__ */ (0, X.jsx)(Qe, {
2341
+ children: /* @__PURE__ */ (0, X.jsx)(at, {
1959
2342
  items: e,
1960
- strategy: nt,
1961
- children: e.map((t, a) => /* @__PURE__ */ (0, X.jsx)(on, {
2343
+ strategy: ut,
2344
+ children: e.map((t, a) => /* @__PURE__ */ (0, X.jsx)(vn, {
1962
2345
  colName: t,
1963
2346
  label: n.find((e) => e.value === t)?.label || t,
1964
2347
  idx: a,
@@ -1969,41 +2352,57 @@ function sn({ columns: e, fieldOptions: n, onToggle: r, onMove: i, onReorder: a
1969
2352
  })
1970
2353
  });
1971
2354
  }
1972
- var Q = (e) => e.type == null || e.type === "grid", cn = (e) => e.type == null || [
2355
+ var bn = [
2356
+ "general",
2357
+ "data",
2358
+ "appearance",
2359
+ "toolbar",
2360
+ "userActions",
2361
+ "navigation",
2362
+ "exportPrint"
2363
+ ], xn = [
2364
+ "general",
2365
+ "data",
2366
+ "appearance"
2367
+ ], Q = (e) => e.type == null || e.type === "grid", Sn = (e) => e.type == null || [
1973
2368
  "grid",
1974
2369
  "kanban",
1975
2370
  "gallery"
1976
- ].includes(e.type), ln = (e) => e.type == null || [
2371
+ ].includes(e.type), Cn = (e) => e.type == null || [
1977
2372
  "grid",
1978
2373
  "calendar",
1979
2374
  "timeline",
1980
2375
  "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) => ({
2376
+ ].includes(e.type), wn = (e) => e.type == null || ["grid", "kanban"].includes(e.type), Tn = (e) => e.type == null || ["grid", "kanban"].includes(e.type), En = (e) => e.type == null || ["grid", "gallery"].includes(e.type);
2377
+ function Dn(e) {
2378
+ let { t, fieldOptions: n, objectDef: r, updateField: i, filterGroupValue: a, sortItemsValue: o, essentialOnly: s = !1 } = e, c = n.map((e) => ({
1984
2379
  value: e.value,
1985
2380
  label: e.label
1986
- })), c = [{
2381
+ })), l = [{
1987
2382
  value: "",
1988
2383
  label: t("console.objectView.none")
1989
- }, ...s];
2384
+ }, ...c], u = [
2385
+ On(t, r),
2386
+ kn(t),
2387
+ An(t, i),
2388
+ jn(t, i),
2389
+ Mn(t, i),
2390
+ Nn(t, n, l, r, i, a, o),
2391
+ Pn(t, n, l, i),
2392
+ Fn(t, i),
2393
+ In(t, i),
2394
+ Ln(t, i)
2395
+ ], d = s ? u.filter((e) => bn.includes(e.key)).map((e) => xn.includes(e.key) ? e : {
2396
+ ...e,
2397
+ collapsible: !0,
2398
+ defaultCollapsed: !0
2399
+ }) : u;
1990
2400
  return {
1991
2401
  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
- ]
2402
+ sections: d
2004
2403
  };
2005
2404
  }
2006
- function mn(e, t) {
2405
+ function On(e, t) {
2007
2406
  return {
2008
2407
  key: "general",
2009
2408
  title: e("console.objectView.general"),
@@ -2015,7 +2414,7 @@ function mn(e, t) {
2015
2414
  type: "custom",
2016
2415
  render: (t, n) => /* @__PURE__ */ (0, X.jsx)(_, {
2017
2416
  label: e("console.objectView.title"),
2018
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2417
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2019
2418
  "data-testid": "view-title-input",
2020
2419
  className: "h-7 text-xs w-32 text-right",
2021
2420
  value: t || "",
@@ -2029,7 +2428,7 @@ function mn(e, t) {
2029
2428
  type: "custom",
2030
2429
  render: (n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2031
2430
  label: e("console.objectView.description"),
2032
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2431
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2033
2432
  "data-testid": "view-description-input",
2034
2433
  className: "h-7 text-xs w-32 text-right",
2035
2434
  value: n ?? "",
@@ -2049,9 +2448,9 @@ function mn(e, t) {
2049
2448
  className: "text-xs h-7 rounded-md border border-input bg-background px-2 text-foreground",
2050
2449
  value: t || "grid",
2051
2450
  onChange: (e) => n(e.target.value),
2052
- children: $t.map((e) => /* @__PURE__ */ (0, X.jsx)("option", {
2451
+ children: fn.map((e) => /* @__PURE__ */ (0, X.jsx)("option", {
2053
2452
  value: e,
2054
- children: Qt[e]
2453
+ children: dn[e]
2055
2454
  }, e))
2056
2455
  })
2057
2456
  })
@@ -2059,7 +2458,7 @@ function mn(e, t) {
2059
2458
  ]
2060
2459
  };
2061
2460
  }
2062
- function hn(e) {
2461
+ function kn(e) {
2063
2462
  let t = [
2064
2463
  "showSearch",
2065
2464
  "showSort",
@@ -2099,13 +2498,13 @@ function hn(e) {
2099
2498
  $("showSort", e("console.objectView.enableSort"), "toggle-showSort", !0),
2100
2499
  $("showFilters", e("console.objectView.enableFilter"), "toggle-showFilters", !0),
2101
2500
  $("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),
2501
+ $("showGroup", e("console.objectView.enableGroup"), "toggle-showGroup", !0, !1, void 0, Sn),
2502
+ $("showColor", e("console.objectView.enableColor"), "toggle-showColor", !0, !1, void 0, Cn),
2104
2503
  $("showDensity", e("console.objectView.enableDensity"), "toggle-showDensity", !0, !1, void 0, Q)
2105
2504
  ]
2106
2505
  };
2107
2506
  }
2108
- function gn(e, t) {
2507
+ function An(e, t) {
2109
2508
  return {
2110
2509
  key: "navigation",
2111
2510
  title: e("console.objectView.navigationSection"),
@@ -2180,7 +2579,7 @@ function gn(e, t) {
2180
2579
  let a = i.navigation?.mode || "page";
2181
2580
  return /* @__PURE__ */ (0, X.jsx)(_, {
2182
2581
  label: e("console.objectView.navigationWidth"),
2183
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2582
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2184
2583
  "data-testid": "input-navigation-width",
2185
2584
  className: "h-7 text-xs w-24 text-right",
2186
2585
  value: i.navigation?.width ?? "",
@@ -2204,7 +2603,7 @@ function gn(e, t) {
2204
2603
  let a = i.navigation?.mode || "page";
2205
2604
  return /* @__PURE__ */ (0, X.jsx)(_, {
2206
2605
  label: e("console.objectView.openNewTab"),
2207
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2606
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2208
2607
  "data-testid": "toggle-navigation-openNewTab",
2209
2608
  checked: i.navigation?.openNewTab === !0,
2210
2609
  onCheckedChange: (e) => t("navigation", {
@@ -2220,7 +2619,7 @@ function gn(e, t) {
2220
2619
  ]
2221
2620
  };
2222
2621
  }
2223
- function _n(e, t) {
2622
+ function jn(e, t) {
2224
2623
  return {
2225
2624
  key: "records",
2226
2625
  title: e("console.objectView.records"),
@@ -2262,7 +2661,7 @@ function _n(e, t) {
2262
2661
  let a = i.addRecordViaForm === !0 || i.addRecord?.enabled === !0;
2263
2662
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(_, {
2264
2663
  label: e("console.objectView.addRecordEnabled"),
2265
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2664
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2266
2665
  "data-testid": "toggle-addRecord-enabled",
2267
2666
  checked: a,
2268
2667
  onCheckedChange: (e) => {
@@ -2323,7 +2722,7 @@ function _n(e, t) {
2323
2722
  }),
2324
2723
  /* @__PURE__ */ (0, X.jsx)(_, {
2325
2724
  label: e("console.objectView.addRecordFormView"),
2326
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2725
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2327
2726
  "data-testid": "input-addRecord-formView",
2328
2727
  className: "h-7 text-xs w-24 text-right",
2329
2728
  value: i.addRecord?.formView ?? "",
@@ -2339,7 +2738,7 @@ function _n(e, t) {
2339
2738
  }]
2340
2739
  };
2341
2740
  }
2342
- function vn(e, t) {
2741
+ function Mn(e, t) {
2343
2742
  return {
2344
2743
  key: "exportPrint",
2345
2744
  title: e("console.objectView.exportPrint"),
@@ -2355,7 +2754,7 @@ function vn(e, t) {
2355
2754
  let a = i.exportOptions != null || i.allowExport === !0;
2356
2755
  return /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [/* @__PURE__ */ (0, X.jsx)(_, {
2357
2756
  label: e("console.objectView.allowExport"),
2358
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2757
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2359
2758
  "data-testid": "toggle-allowExport",
2360
2759
  checked: a,
2361
2760
  onCheckedChange: (e) => t("allowExport", e),
@@ -2391,7 +2790,7 @@ function vn(e, t) {
2391
2790
  }),
2392
2791
  /* @__PURE__ */ (0, X.jsx)(_, {
2393
2792
  label: e("console.objectView.exportMaxRecords"),
2394
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2793
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2395
2794
  "data-testid": "input-export-maxRecords",
2396
2795
  className: "h-7 text-xs w-20 text-right",
2397
2796
  type: "number",
@@ -2405,7 +2804,7 @@ function vn(e, t) {
2405
2804
  }),
2406
2805
  /* @__PURE__ */ (0, X.jsx)(_, {
2407
2806
  label: e("console.objectView.exportIncludeHeaders"),
2408
- children: /* @__PURE__ */ (0, X.jsx)(I, {
2807
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
2409
2808
  "data-testid": "toggle-export-includeHeaders",
2410
2809
  checked: i.exportOptions?.includeHeaders !== !1,
2411
2810
  onCheckedChange: (e) => t("exportOptions", {
@@ -2417,7 +2816,7 @@ function vn(e, t) {
2417
2816
  }),
2418
2817
  /* @__PURE__ */ (0, X.jsx)(_, {
2419
2818
  label: e("console.objectView.exportFileNamePrefix"),
2420
- children: /* @__PURE__ */ (0, X.jsx)(k, {
2819
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2421
2820
  "data-testid": "input-export-fileNamePrefix",
2422
2821
  className: "h-7 text-xs w-24 text-right",
2423
2822
  value: i.exportOptions?.fileNamePrefix ?? "",
@@ -2436,7 +2835,7 @@ function vn(e, t) {
2436
2835
  ]
2437
2836
  };
2438
2837
  }
2439
- function yn(e, t, n, r, i, a, o) {
2838
+ function Nn(e, t, n, r, i, a, o) {
2440
2839
  return {
2441
2840
  key: "data",
2442
2841
  title: e("console.objectView.data"),
@@ -2478,7 +2877,7 @@ function yn(e, t, n, r, i, a, o) {
2478
2877
  children: [/* @__PURE__ */ (0, X.jsxs)("div", {
2479
2878
  className: "flex items-center gap-1 pb-1",
2480
2879
  children: [
2481
- /* @__PURE__ */ (0, X.jsx)(k, {
2880
+ /* @__PURE__ */ (0, X.jsx)(N, {
2482
2881
  "data-testid": "column-search-input",
2483
2882
  className: "h-6 text-xs flex-1",
2484
2883
  placeholder: e("console.objectView.searchFields"),
@@ -2516,7 +2915,7 @@ function yn(e, t, n, r, i, a, o) {
2516
2915
  children: [Array.isArray(a.columns) && a.columns.length > 0 && /* @__PURE__ */ (0, X.jsx)("div", {
2517
2916
  "data-testid": "selected-columns",
2518
2917
  className: "space-y-0.5 pb-1 mb-1 border-b border-border/50",
2519
- children: /* @__PURE__ */ (0, X.jsx)(sn, {
2918
+ children: /* @__PURE__ */ (0, X.jsx)(yn, {
2520
2919
  columns: a.columns,
2521
2920
  fieldOptions: t,
2522
2921
  onToggle: c,
@@ -2533,14 +2932,14 @@ function yn(e, t, n, r, i, a, o) {
2533
2932
  "data-field-label": e.label,
2534
2933
  className: "flex items-center gap-1 text-xs cursor-pointer hover:bg-accent/50 rounded-sm py-0.5 px-1 -mx-1",
2535
2934
  children: [
2536
- /* @__PURE__ */ (0, X.jsx)(K, { className: "h-3 w-3 text-muted-foreground/20 shrink-0" }),
2935
+ /* @__PURE__ */ (0, X.jsx)(je, { className: "h-3 w-3 text-muted-foreground/20 shrink-0" }),
2537
2936
  /* @__PURE__ */ (0, X.jsx)("button", {
2538
2937
  type: "button",
2539
2938
  "data-testid": `col-eye-${e.value}`,
2540
2939
  className: "h-5 w-5 flex items-center justify-center rounded hover:bg-accent shrink-0",
2541
2940
  onClick: () => c(e.value, !0),
2542
2941
  "aria-label": `Show ${e.label}`,
2543
- children: /* @__PURE__ */ (0, X.jsx)(Ce, { className: "h-3.5 w-3.5 text-muted-foreground" })
2942
+ children: /* @__PURE__ */ (0, X.jsx)(Ee, { className: "h-3.5 w-3.5 text-muted-foreground" })
2544
2943
  }),
2545
2944
  /* @__PURE__ */ (0, X.jsx)("span", {
2546
2945
  className: "truncate text-muted-foreground",
@@ -2568,11 +2967,11 @@ function yn(e, t, n, r, i, a, o) {
2568
2967
  children: /* @__PURE__ */ (0, X.jsx)("div", {
2569
2968
  "data-testid": "inline-filter-builder",
2570
2969
  className: "pb-2",
2571
- children: /* @__PURE__ */ (0, X.jsx)(O, {
2970
+ children: /* @__PURE__ */ (0, X.jsx)(fe, {
2572
2971
  fields: t,
2573
2972
  value: a,
2574
2973
  onChange: (e) => {
2575
- i("filter", Yt(e.logic, e.conditions.map((e) => ({
2974
+ i("filter", cn(e.logic, e.conditions.map((e) => ({
2576
2975
  field: e.field,
2577
2976
  operator: e.operator,
2578
2977
  value: e.value
@@ -2600,7 +2999,7 @@ function yn(e, t, n, r, i, a, o) {
2600
2999
  children: /* @__PURE__ */ (0, X.jsx)("div", {
2601
3000
  "data-testid": "inline-sort-builder",
2602
3001
  className: "pb-2",
2603
- children: /* @__PURE__ */ (0, X.jsx)(F, {
3002
+ children: /* @__PURE__ */ (0, X.jsx)(V, {
2604
3003
  fields: t.map((e) => ({
2605
3004
  value: e.value,
2606
3005
  label: e.label
@@ -2623,7 +3022,7 @@ function yn(e, t, n, r, i, a, o) {
2623
3022
  key: "_groupBy",
2624
3023
  label: e("console.objectView.groupBy"),
2625
3024
  type: "custom",
2626
- visibleWhen: fn,
3025
+ visibleWhen: En,
2627
3026
  render: (n, r, a) => {
2628
3027
  let o = a.type || "grid", s = a.kanban?.groupByField || a.kanban?.groupField || a.groupBy || "";
2629
3028
  return /* @__PURE__ */ (0, X.jsx)(_, {
@@ -2655,7 +3054,7 @@ function yn(e, t, n, r, i, a, o) {
2655
3054
  type: "custom",
2656
3055
  render: (t, n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2657
3056
  label: e("console.objectView.pageSize"),
2658
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3057
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2659
3058
  "data-testid": "input-pagination-pageSize",
2660
3059
  className: "h-7 text-xs w-20 text-right",
2661
3060
  type: "number",
@@ -2677,13 +3076,13 @@ function yn(e, t, n, r, i, a, o) {
2677
3076
  type: "custom",
2678
3077
  render: (t, n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
2679
3078
  label: e("console.objectView.pageSizeOptions"),
2680
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3079
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
2681
3080
  "data-testid": "input-pagination-pageSizeOptions",
2682
3081
  className: "h-7 text-xs w-28 text-right",
2683
3082
  value: (r.pagination?.pageSizeOptions || []).join(", "),
2684
3083
  placeholder: "10, 25, 50, 100",
2685
3084
  onChange: (e) => {
2686
- let t = Zt(e.target.value);
3085
+ let t = un(e.target.value);
2687
3086
  i("pagination", {
2688
3087
  ...r.pagination || {},
2689
3088
  pageSizeOptions: t.length ? t : void 0
@@ -2692,9 +3091,9 @@ function yn(e, t, n, r, i, a, o) {
2692
3091
  })
2693
3092
  })
2694
3093
  },
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"),
3094
+ Rn("searchableFields", e("console.objectView.searchableFields"), "searchable-fields-selector", "searchable-field", t, i, "selected"),
3095
+ Rn("filterableFields", e("console.objectView.filterableFields"), "filterable-fields-selector", "filterable-field", t, i, "selected"),
3096
+ Rn("hiddenFields", e("console.objectView.hiddenFields"), "hidden-fields-selector", "hidden-field", t, i, "hidden"),
2698
3097
  {
2699
3098
  key: "_quickFilters",
2700
3099
  label: e("console.objectView.quickFilters"),
@@ -2711,7 +3110,7 @@ function yn(e, t, n, r, i, a, o) {
2711
3110
  children: [(r.quickFilters || []).map((e, t) => /* @__PURE__ */ (0, X.jsxs)("div", {
2712
3111
  className: "flex items-center gap-1 text-xs",
2713
3112
  children: [
2714
- /* @__PURE__ */ (0, X.jsx)(k, {
3113
+ /* @__PURE__ */ (0, X.jsx)(N, {
2715
3114
  "data-testid": `quick-filter-label-${t}`,
2716
3115
  className: "h-6 text-xs flex-1",
2717
3116
  value: e.label || "",
@@ -2873,7 +3272,7 @@ function yn(e, t, n, r, i, a, o) {
2873
3272
  "data-testid": `uf-tab-${n}`,
2874
3273
  className: "flex items-center gap-1 text-xs",
2875
3274
  children: [
2876
- /* @__PURE__ */ (0, X.jsx)(k, {
3275
+ /* @__PURE__ */ (0, X.jsx)(N, {
2877
3276
  "data-testid": `uf-tab-label-${n}`,
2878
3277
  className: "h-6 text-xs flex-1",
2879
3278
  value: t.label || "",
@@ -3148,7 +3547,7 @@ function yn(e, t, n, r, i, a, o) {
3148
3547
  ]
3149
3548
  };
3150
3549
  }
3151
- function bn(e, t, n, r) {
3550
+ function Pn(e, t, n, r) {
3152
3551
  return {
3153
3552
  key: "appearance",
3154
3553
  title: e("console.objectView.appearance"),
@@ -3161,7 +3560,7 @@ function bn(e, t, n, r) {
3161
3560
  key: "color",
3162
3561
  label: e("console.objectView.color"),
3163
3562
  type: "custom",
3164
- visibleWhen: ln,
3563
+ visibleWhen: Cn,
3165
3564
  render: (n, r) => /* @__PURE__ */ (0, X.jsx)(_, {
3166
3565
  label: e("console.objectView.color"),
3167
3566
  children: /* @__PURE__ */ (0, X.jsxs)("select", {
@@ -3194,7 +3593,7 @@ function bn(e, t, n, r) {
3194
3593
  "data-testid": "appearance-rowHeight",
3195
3594
  role: "radiogroup",
3196
3595
  "aria-label": e("console.objectView.rowHeight"),
3197
- children: en.map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
3596
+ children: pn.map((e) => /* @__PURE__ */ (0, X.jsx)("button", {
3198
3597
  type: "button",
3199
3598
  role: "radio",
3200
3599
  "aria-checked": (t || "compact") === e.value,
@@ -3219,7 +3618,7 @@ function bn(e, t, n, r) {
3219
3618
  key: "_conditionalFormatting",
3220
3619
  label: e("console.objectView.conditionalFormatting"),
3221
3620
  type: "custom",
3222
- visibleWhen: un,
3621
+ visibleWhen: wn,
3223
3622
  render: (n, i, a) => /* @__PURE__ */ (0, X.jsx)(Z, {
3224
3623
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3225
3624
  label: e("console.objectView.conditionalFormatting"),
@@ -3289,7 +3688,7 @@ function bn(e, t, n, r) {
3289
3688
  })
3290
3689
  ]
3291
3690
  }),
3292
- /* @__PURE__ */ (0, X.jsx)(k, {
3691
+ /* @__PURE__ */ (0, X.jsx)(N, {
3293
3692
  "data-testid": `cf-value-${n}`,
3294
3693
  className: "h-6 text-xs w-16",
3295
3694
  value: String(e.value ?? ""),
@@ -3335,7 +3734,7 @@ function bn(e, t, n, r) {
3335
3734
  render: (t, n, i) => /* @__PURE__ */ (0, X.jsxs)(X.Fragment, { children: [
3336
3735
  /* @__PURE__ */ (0, X.jsx)(_, {
3337
3736
  label: e("console.objectView.emptyStateTitle"),
3338
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3737
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3339
3738
  "data-testid": "input-emptyState-title",
3340
3739
  className: "h-7 text-xs w-28 text-right",
3341
3740
  value: i.emptyState?.title ?? "",
@@ -3347,7 +3746,7 @@ function bn(e, t, n, r) {
3347
3746
  }),
3348
3747
  /* @__PURE__ */ (0, X.jsx)(_, {
3349
3748
  label: e("console.objectView.emptyStateMessage"),
3350
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3749
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3351
3750
  "data-testid": "input-emptyState-message",
3352
3751
  className: "h-7 text-xs w-28 text-right",
3353
3752
  value: i.emptyState?.message ?? "",
@@ -3359,7 +3758,7 @@ function bn(e, t, n, r) {
3359
3758
  }),
3360
3759
  /* @__PURE__ */ (0, X.jsx)(_, {
3361
3760
  label: e("console.objectView.emptyStateIcon"),
3362
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3761
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3363
3762
  "data-testid": "input-emptyState-icon",
3364
3763
  className: "h-7 text-xs w-28 text-right",
3365
3764
  value: i.emptyState?.icon ?? "",
@@ -3374,7 +3773,7 @@ function bn(e, t, n, r) {
3374
3773
  ]
3375
3774
  };
3376
3775
  }
3377
- function xn(e, t) {
3776
+ function Fn(e, t) {
3378
3777
  return {
3379
3778
  key: "userActions",
3380
3779
  title: e("console.objectView.userActions"),
@@ -3387,7 +3786,7 @@ function xn(e, t) {
3387
3786
  key: "_rowActions",
3388
3787
  label: e("console.objectView.rowActions"),
3389
3788
  type: "custom",
3390
- visibleWhen: dn,
3789
+ visibleWhen: Tn,
3391
3790
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(Z, {
3392
3791
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3393
3792
  label: e("console.objectView.rowActions"),
@@ -3397,13 +3796,13 @@ function xn(e, t) {
3397
3796
  children: /* @__PURE__ */ (0, X.jsx)("div", {
3398
3797
  "data-testid": "row-actions-selector",
3399
3798
  className: "pb-2 space-y-0.5 max-h-36 overflow-auto",
3400
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3799
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3401
3800
  "data-testid": "input-rowActions",
3402
3801
  className: "h-7 text-xs w-full",
3403
3802
  value: (i.rowActions || []).join(", "),
3404
3803
  placeholder: "edit, delete, duplicate",
3405
3804
  onChange: (e) => {
3406
- t("rowActions", Xt(e.target.value));
3805
+ t("rowActions", ln(e.target.value));
3407
3806
  }
3408
3807
  })
3409
3808
  })
@@ -3413,7 +3812,7 @@ function xn(e, t) {
3413
3812
  key: "_bulkActions",
3414
3813
  label: e("console.objectView.bulkActions"),
3415
3814
  type: "custom",
3416
- visibleWhen: dn,
3815
+ visibleWhen: Tn,
3417
3816
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(Z, {
3418
3817
  renderSummary: (t) => /* @__PURE__ */ (0, X.jsx)(_, {
3419
3818
  label: e("console.objectView.bulkActions"),
@@ -3423,13 +3822,13 @@ function xn(e, t) {
3423
3822
  children: /* @__PURE__ */ (0, X.jsx)("div", {
3424
3823
  "data-testid": "bulk-actions-selector",
3425
3824
  className: "pb-2 space-y-0.5 max-h-36 overflow-auto",
3426
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3825
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3427
3826
  "data-testid": "input-bulkActions",
3428
3827
  className: "h-7 text-xs w-full",
3429
3828
  value: (i.bulkActions || []).join(", "),
3430
3829
  placeholder: "delete, export, assign",
3431
3830
  onChange: (e) => {
3432
- t("bulkActions", Xt(e.target.value));
3831
+ t("bulkActions", ln(e.target.value));
3433
3832
  }
3434
3833
  })
3435
3834
  })
@@ -3438,7 +3837,7 @@ function xn(e, t) {
3438
3837
  ]
3439
3838
  };
3440
3839
  }
3441
- function Sn(e, t) {
3840
+ function In(e, t) {
3442
3841
  return {
3443
3842
  key: "sharing",
3444
3843
  title: e("console.objectView.sharing"),
@@ -3450,7 +3849,7 @@ function Sn(e, t) {
3450
3849
  type: "custom",
3451
3850
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3452
3851
  label: e("console.objectView.sharingEnabled"),
3453
- children: /* @__PURE__ */ (0, X.jsx)(I, {
3852
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
3454
3853
  "data-testid": "toggle-sharing-enabled",
3455
3854
  checked: i.sharing?.enabled === !0,
3456
3855
  onCheckedChange: (e) => t("sharing", {
@@ -3499,7 +3898,7 @@ function Sn(e, t) {
3499
3898
  }]
3500
3899
  };
3501
3900
  }
3502
- function Cn(e, t) {
3901
+ function Ln(e, t) {
3503
3902
  return {
3504
3903
  key: "accessibility",
3505
3904
  title: e("console.objectView.accessibility"),
@@ -3512,7 +3911,7 @@ function Cn(e, t) {
3512
3911
  type: "custom",
3513
3912
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3514
3913
  label: e("console.objectView.ariaLabel"),
3515
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3914
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3516
3915
  "data-testid": "input-aria-label",
3517
3916
  className: "h-7 text-xs w-28 text-right",
3518
3917
  value: i.aria?.label ?? "",
@@ -3529,7 +3928,7 @@ function Cn(e, t) {
3529
3928
  type: "custom",
3530
3929
  render: (n, r, i) => /* @__PURE__ */ (0, X.jsx)(_, {
3531
3930
  label: e("console.objectView.ariaDescribedBy"),
3532
- children: /* @__PURE__ */ (0, X.jsx)(k, {
3931
+ children: /* @__PURE__ */ (0, X.jsx)(N, {
3533
3932
  "data-testid": "input-aria-describedBy",
3534
3933
  className: "h-7 text-xs w-28 text-right",
3535
3934
  value: i.aria?.describedBy ?? "",
@@ -3583,7 +3982,7 @@ function $(e, t, n, r = !1, i = !1, a, o) {
3583
3982
  visibleWhen: o,
3584
3983
  render: (e, o, s) => /* @__PURE__ */ (0, X.jsx)(_, {
3585
3984
  label: t,
3586
- children: /* @__PURE__ */ (0, X.jsx)(I, {
3985
+ children: /* @__PURE__ */ (0, X.jsx)(H, {
3587
3986
  "data-testid": n,
3588
3987
  checked: i ? e === !0 : r ? e !== !1 : !!e,
3589
3988
  disabled: a ? a(s) : !1,
@@ -3593,7 +3992,7 @@ function $(e, t, n, r = !1, i = !1, a, o) {
3593
3992
  })
3594
3993
  };
3595
3994
  }
3596
- function wn(e, t, n, r, i, a, o, s) {
3995
+ function Rn(e, t, n, r, i, a, o, s) {
3597
3996
  return {
3598
3997
  key: `_${e}`,
3599
3998
  label: t,
@@ -3629,11 +4028,11 @@ function wn(e, t, n, r, i, a, o, s) {
3629
4028
  }
3630
4029
  //#endregion
3631
4030
  //#region src/index.tsx
3632
- var Tn = d, En = ({ schema: e }) => /* @__PURE__ */ (0, X.jsx)(Et, {
4031
+ var zn = d, Bn = ({ schema: e }) => /* @__PURE__ */ (0, X.jsx)(Ft, {
3633
4032
  schema: e,
3634
- dataSource: r(Tn)?.dataSource ?? null
4033
+ dataSource: r(zn)?.dataSource ?? null
3635
4034
  });
3636
- c.register("object-view", En, {
4035
+ c.register("object-view", Bn, {
3637
4036
  namespace: "plugin-view",
3638
4037
  label: "Object View",
3639
4038
  category: "view",
@@ -3739,11 +4138,11 @@ c.register("object-view", En, {
3739
4138
  showRefresh: !0,
3740
4139
  showViewSwitcher: !0
3741
4140
  }
3742
- }), c.register("view", En, {
4141
+ }), c.register("view", Bn, {
3743
4142
  namespace: "plugin-view",
3744
4143
  label: "View",
3745
4144
  category: "view"
3746
- }), c.register("view-switcher", wt, {
4145
+ }), c.register("view-switcher", Nt, {
3747
4146
  namespace: "view",
3748
4147
  label: "View Switcher",
3749
4148
  category: "view",
@@ -3822,7 +4221,7 @@ c.register("object-view", En, {
3822
4221
  }
3823
4222
  }]
3824
4223
  }
3825
- }), c.register("filter-ui", At, {
4224
+ }), c.register("filter-ui", zt, {
3826
4225
  namespace: "view",
3827
4226
  label: "Filter UI",
3828
4227
  category: "view",
@@ -3895,7 +4294,7 @@ c.register("object-view", En, {
3895
4294
  }
3896
4295
  ]
3897
4296
  }
3898
- }), c.register("sort-ui", Ft, {
4297
+ }), c.register("sort-ui", Wt, {
3899
4298
  namespace: "view",
3900
4299
  label: "Sort UI",
3901
4300
  category: "view",
@@ -3944,7 +4343,7 @@ c.register("object-view", En, {
3944
4343
  direction: "asc"
3945
4344
  }]
3946
4345
  }
3947
- }), c.register("shared-view-link", Rt, {
4346
+ }), c.register("shared-view-link", qt, {
3948
4347
  namespace: "view",
3949
4348
  label: "Shared View Link",
3950
4349
  category: "view",
@@ -3986,4 +4385,4 @@ c.register("object-view", En, {
3986
4385
  category: "view"
3987
4386
  });
3988
4387
  //#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 };
4388
+ export { bn as ESSENTIAL_SECTION_KEYS, zt as FilterUI, en as ManageViewsDialog, Ft as ObjectView, qt as SharedViewLink, Wt as SortUI, dn as VIEW_TYPE_LABELS, fn as VIEW_TYPE_OPTIONS, Nt as ViewSwitcher, Zt as ViewTabBar, Dn as buildViewConfigSchema, mn as deriveFieldOptions, hn as toFilterGroup, gn as toSortItems };