@object-ui/plugin-list 4.6.0 → 4.8.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
@@ -1,24 +1,24 @@
1
1
  import { ComponentRegistry as e, buildExpandFields as t, evaluatePlainCondition as n, normalizeQuickFilter as r, normalizeQuickFilters as i } from "@object-ui/core";
2
2
  import * as a from "react";
3
3
  import { useCallback as o, useContext as s, useEffect as c, useMemo as l, useState as u } from "react";
4
- import { Button as d, Card as f, CardContent as p, FilterBuilder as m, GroupingEditor as h, Input as g, LookupValuePicker as _, NavigationOverlay as v, Popover as y, PopoverContent as b, PopoverTrigger as x, SortBuilder as S, cn as C } from "@object-ui/components";
5
- import { Activity as w, ArrowUpDown as T, Calendar as ee, CheckSquare as te, ChevronDown as E, ChevronRight as ne, Download as re, EyeOff as ie, GanttChartSquare as D, Grid as O, Group as ae, Images as k, Inbox as oe, LayoutGrid as A, Map as j, Paintbrush as se, Plus as M, Printer as ce, Rows2 as le, Rows3 as ue, Rows4 as de, Search as fe, Settings2 as pe, Share2 as me, SlidersHorizontal as he, Trash2 as ge, X as _e, icons as ve } from "lucide-react";
6
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
7
- import { useObjectLabel as ye, useObjectTranslation as be, useSafeFieldLabel as xe } from "@object-ui/i18n";
8
- import { SchemaRenderer as Se, SchemaRendererContext as Ce, useDataScope as we, useDensityMode as Te, useNavigationOverlay as Ee, useSafeFieldLabel as De } from "@object-ui/react";
9
- import { usePullToRefresh as Oe } from "@object-ui/mobile";
10
- import { usePermissions as ke } from "@object-ui/permissions";
11
- import { getCellRenderer as I, resolveCellRendererType as Ae } from "@object-ui/fields";
4
+ import { Button as d, Card as f, CardContent as p, DropdownMenu as m, DropdownMenuContent as h, DropdownMenuItem as g, DropdownMenuTrigger as _, FilterBuilder as v, GroupingEditor as ee, Input as y, LookupValuePicker as b, NavigationOverlay as te, Popover as x, PopoverContent as S, PopoverTrigger as C, RefreshIndicator as ne, SortBuilder as re, cn as w } from "@object-ui/components";
5
+ import { Activity as ie, ArrowUpDown as T, Calendar as E, CheckSquare as ae, ChevronDown as D, ChevronRight as O, Download as k, EyeOff as oe, GanttChartSquare as A, Grid as se, Group as ce, Images as j, Inbox as le, LayoutGrid as ue, Map as de, Paintbrush as fe, Plus as pe, Printer as me, Rows2 as he, Rows3 as ge, Rows4 as _e, Search as ve, Settings2 as ye, Share2 as be, SlidersHorizontal as xe, Trash2 as Se, X as Ce, icons as we } from "lucide-react";
6
+ import { Fragment as Te, jsx as M, jsxs as N } from "react/jsx-runtime";
7
+ import { useObjectLabel as Ee, useObjectTranslation as De, useSafeFieldLabel as Oe } from "@object-ui/i18n";
8
+ import { SchemaRenderer as ke, SchemaRendererContext as P, useDataScope as Ae, useDensityMode as je, useNavigationOverlay as Me, useSafeFieldLabel as Ne } from "@object-ui/react";
9
+ import { usePullToRefresh as Pe } from "@object-ui/mobile";
10
+ import { usePermissions as Fe } from "@object-ui/permissions";
11
+ import { getCellRenderer as Ie, resolveCellRendererType as Le } from "@object-ui/fields";
12
12
  //#region src/ViewSwitcher.tsx
13
- var je = {
14
- grid: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
15
- kanban: /* @__PURE__ */ P(A, { className: "h-4 w-4" }),
16
- gallery: /* @__PURE__ */ P(k, { className: "h-4 w-4" }),
17
- calendar: /* @__PURE__ */ P(ee, { className: "h-4 w-4" }),
18
- timeline: /* @__PURE__ */ P(w, { className: "h-4 w-4" }),
19
- gantt: /* @__PURE__ */ P(D, { className: "h-4 w-4" }),
20
- map: /* @__PURE__ */ P(j, { className: "h-4 w-4" })
21
- }, Me = {
13
+ var F = {
14
+ grid: /* @__PURE__ */ M(se, { className: "h-4 w-4" }),
15
+ kanban: /* @__PURE__ */ M(ue, { className: "h-4 w-4" }),
16
+ gallery: /* @__PURE__ */ M(j, { className: "h-4 w-4" }),
17
+ calendar: /* @__PURE__ */ M(E, { className: "h-4 w-4" }),
18
+ timeline: /* @__PURE__ */ M(ie, { className: "h-4 w-4" }),
19
+ gantt: /* @__PURE__ */ M(A, { className: "h-4 w-4" }),
20
+ map: /* @__PURE__ */ M(de, { className: "h-4 w-4" })
21
+ }, I = {
22
22
  grid: "Grid",
23
23
  kanban: "Kanban",
24
24
  gallery: "Gallery",
@@ -26,7 +26,7 @@ var je = {
26
26
  timeline: "Timeline",
27
27
  gantt: "Gantt",
28
28
  map: "Map"
29
- }, Ne = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
29
+ }, Re = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
30
30
  let o = a.useCallback((t) => {
31
31
  if (!i || t === e) {
32
32
  n(t);
@@ -38,21 +38,21 @@ var je = {
38
38
  e,
39
39
  n
40
40
  ]);
41
- return /* @__PURE__ */ P("div", {
42
- className: C("flex items-center gap-1 bg-transparent oui-view-switcher", r),
41
+ return /* @__PURE__ */ M("div", {
42
+ className: w("flex items-center gap-1 bg-transparent oui-view-switcher", r),
43
43
  children: t.map((t) => {
44
44
  let n = e === t;
45
- return /* @__PURE__ */ F("button", {
45
+ return /* @__PURE__ */ N("button", {
46
46
  type: "button",
47
47
  onClick: () => o(t),
48
- "aria-label": Me[t],
49
- title: Me[t],
48
+ "aria-label": I[t],
49
+ title: I[t],
50
50
  "aria-pressed": n,
51
51
  "data-state": n ? "on" : "off",
52
- className: C("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", "hover:bg-muted hover:text-muted-foreground", "gap-2 px-3 py-2", "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50"),
53
- children: [je[t], /* @__PURE__ */ P("span", {
52
+ className: w("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", "hover:bg-muted hover:text-muted-foreground", "gap-2 px-3 py-2", "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50"),
53
+ children: [F[t], /* @__PURE__ */ M("span", {
54
54
  className: "hidden sm:inline-block text-xs font-medium",
55
- children: Me[t]
55
+ children: I[t]
56
56
  })]
57
57
  }, t);
58
58
  })
@@ -60,119 +60,161 @@ var je = {
60
60
  };
61
61
  //#endregion
62
62
  //#region src/components/TabBar.tsx
63
- function Pe(e) {
64
- return e ? ve[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
63
+ function ze(e) {
64
+ return e ? we[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
65
65
  }
66
- function L(e) {
66
+ function Be(e) {
67
67
  return e.filter((e) => e.pinned || e.visible !== "false" && e.visible !== !1).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
68
68
  }
69
- var Fe = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
70
- let i = a.useMemo(() => L(e), [e]), o = a.useMemo(() => i.find((e) => e.isDefault)?.name ?? i[0]?.name, [i]), [s, c] = a.useState(o), l = t ?? s, u = a.useCallback((e) => {
69
+ var Ve = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
70
+ let i = a.useMemo(() => Be(e), [e]), o = a.useMemo(() => i.find((e) => e.isDefault)?.name ?? i[0]?.name, [i]), [s, c] = a.useState(o), l = t ?? s, u = a.useCallback((e) => {
71
71
  c(e.name), n?.(e);
72
72
  }, [n]);
73
- return i.length === 0 ? null : /* @__PURE__ */ P("div", {
74
- className: C("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
73
+ return i.length === 0 ? null : /* @__PURE__ */ M("div", {
74
+ className: w("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
75
75
  "data-testid": "view-tabs",
76
76
  role: "tablist",
77
77
  children: i.map((e) => {
78
- let t = Pe(e.icon), n = l === e.name;
79
- return /* @__PURE__ */ F(d, {
78
+ let t = ze(e.icon), n = l === e.name;
79
+ return /* @__PURE__ */ N(d, {
80
80
  variant: "ghost",
81
81
  size: "sm",
82
- className: C("h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150", n ? "font-medium text-foreground bg-muted" : "text-muted-foreground hover:text-foreground hover:bg-transparent"),
82
+ className: w("h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150", n ? "font-medium text-foreground bg-muted" : "text-muted-foreground hover:text-foreground hover:bg-transparent"),
83
83
  "data-testid": `view-tab-${e.name}`,
84
84
  role: "tab",
85
85
  "aria-selected": n,
86
86
  onClick: () => u(e),
87
- children: [t && /* @__PURE__ */ P(t, { className: "h-3 w-3 mr-1.5" }), e.label]
87
+ children: [t && /* @__PURE__ */ M(t, { className: "h-3 w-3 mr-1.5" }), e.label]
88
88
  }, e.name);
89
89
  })
90
90
  });
91
+ }, He = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
92
+ let i = a.useMemo(() => Be(e), [e]), o = a.useMemo(() => i.find((e) => e.isDefault)?.name ?? i[0]?.name, [i]), [s, c] = a.useState(o), l = t ?? s, u = a.useMemo(() => i.find((e) => e.name === l) ?? i[0], [i, l]), f = a.useCallback((e) => {
93
+ c(e.name), n?.(e);
94
+ }, [n]);
95
+ if (i.length === 0) return null;
96
+ let p = ze(u?.icon);
97
+ return /* @__PURE__ */ M("div", {
98
+ className: w("px-2 py-1", r),
99
+ "data-testid": "view-tabs-select",
100
+ children: /* @__PURE__ */ N(m, { children: [/* @__PURE__ */ M(_, {
101
+ asChild: !0,
102
+ children: /* @__PURE__ */ N(d, {
103
+ variant: "ghost",
104
+ size: "sm",
105
+ className: "h-7 px-2 text-xs font-medium text-foreground gap-1.5 max-w-[60vw] truncate",
106
+ "aria-label": "Switch view",
107
+ children: [
108
+ p && /* @__PURE__ */ M(p, { className: "h-3.5 w-3.5 shrink-0" }),
109
+ /* @__PURE__ */ M("span", {
110
+ className: "truncate",
111
+ children: u?.label ?? ""
112
+ }),
113
+ /* @__PURE__ */ M(D, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
114
+ ]
115
+ })
116
+ }), /* @__PURE__ */ M(h, {
117
+ align: "start",
118
+ className: "w-56 max-h-72 overflow-y-auto",
119
+ children: i.map((e) => {
120
+ let t = ze(e.icon);
121
+ return /* @__PURE__ */ N(g, {
122
+ onClick: () => f(e),
123
+ className: w("text-sm", l === e.name && "font-medium bg-muted"),
124
+ "data-testid": `view-tab-select-${e.name}`,
125
+ children: [t && /* @__PURE__ */ M(t, { className: "h-3.5 w-3.5 mr-2 shrink-0" }), /* @__PURE__ */ M("span", {
126
+ className: "truncate",
127
+ children: e.label
128
+ })]
129
+ }, e.name);
130
+ })
131
+ })] })
132
+ });
91
133
  };
92
134
  //#endregion
93
135
  //#region src/components/ViewSettingsPopover.tsx
94
- function R({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: i = !0, children: o }) {
136
+ function L({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: i = !0, children: o }) {
95
137
  let [s, c] = a.useState(i);
96
- return /* @__PURE__ */ F("div", {
138
+ return /* @__PURE__ */ N("div", {
97
139
  className: "border-b last:border-b-0",
98
- children: [/* @__PURE__ */ F("div", {
140
+ children: [/* @__PURE__ */ N("div", {
99
141
  className: "flex items-center justify-between px-3 py-2",
100
- children: [/* @__PURE__ */ F("button", {
142
+ children: [/* @__PURE__ */ N("button", {
101
143
  type: "button",
102
144
  onClick: () => c((e) => !e),
103
145
  className: "flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground",
104
146
  children: [
105
- /* @__PURE__ */ P(E, { className: C("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
147
+ /* @__PURE__ */ M(D, { className: w("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
106
148
  e,
107
- typeof t == "number" && t > 0 && /* @__PURE__ */ P("span", {
149
+ typeof t == "number" && t > 0 && /* @__PURE__ */ M("span", {
108
150
  className: "ml-1 inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] text-primary tabular-nums",
109
151
  children: t
110
152
  })
111
153
  ]
112
- }), n && /* @__PURE__ */ P("button", {
154
+ }), n && /* @__PURE__ */ M("button", {
113
155
  type: "button",
114
156
  onClick: n,
115
157
  className: "text-[11px] text-muted-foreground hover:text-foreground",
116
158
  children: r
117
159
  })]
118
- }), s && /* @__PURE__ */ P("div", {
160
+ }), s && /* @__PURE__ */ M("div", {
119
161
  className: "px-3 pb-3",
120
162
  children: o
121
163
  })]
122
164
  });
123
165
  }
124
- function Ie(e) {
125
- let { t, allFields: n, showGroup: r, groupingConfig: i, setGroupingConfig: o, showColor: s, rowColorConfig: c, setRowColorConfig: l, showDensity: u, density: f, showHideFields: p, hiddenFields: m, updateHiddenFields: g } = e, [_, v] = a.useState(!1), S = [
166
+ function Ue(e) {
167
+ let { t, allFields: n, showGroup: r, groupingConfig: i, setGroupingConfig: o, showColor: s, rowColorConfig: c, setRowColorConfig: l, showDensity: u, density: f, showHideFields: p, hiddenFields: m, updateHiddenFields: h } = e, [g, _] = a.useState(!1), v = [
126
168
  !!i?.fields?.length,
127
169
  !!c?.field,
128
170
  f && f.mode !== "compact",
129
171
  (m?.size ?? 0) > 0
130
- ].filter(Boolean).length, w = f?.mode === "compact" ? de : f?.mode === "comfortable" ? ue : le, T = t("list.viewSettings", { defaultValue: "View settings" });
131
- return /* @__PURE__ */ F(y, {
132
- open: _,
133
- onOpenChange: v,
134
- children: [/* @__PURE__ */ P(x, {
172
+ ].filter(Boolean).length, y = f?.mode === "compact" ? _e : f?.mode === "comfortable" ? ge : he, b = t("list.viewSettings", { defaultValue: "View settings" });
173
+ return /* @__PURE__ */ N(x, {
174
+ open: g,
175
+ onOpenChange: _,
176
+ children: [/* @__PURE__ */ M(C, {
135
177
  asChild: !0,
136
- children: /* @__PURE__ */ F(d, {
178
+ children: /* @__PURE__ */ N(d, {
137
179
  variant: "ghost",
138
180
  size: "sm",
139
- "aria-label": T,
140
- title: T,
141
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", S > 0 && "text-foreground font-medium"),
181
+ "aria-label": b,
182
+ title: b,
183
+ className: w("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", v > 0 && "text-foreground font-medium"),
142
184
  "data-testid": "view-settings-trigger",
143
185
  children: [
144
- /* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
145
- /* @__PURE__ */ P("span", {
186
+ /* @__PURE__ */ M(ye, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
187
+ /* @__PURE__ */ M("span", {
146
188
  className: "hidden sm:inline",
147
- children: T
189
+ children: b
148
190
  }),
149
- S > 0 && /* @__PURE__ */ P("span", {
191
+ v > 0 && /* @__PURE__ */ M("span", {
150
192
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
151
- children: S
193
+ children: v
152
194
  })
153
195
  ]
154
196
  })
155
- }), /* @__PURE__ */ F(b, {
197
+ }), /* @__PURE__ */ N(S, {
156
198
  align: "end",
157
199
  className: "w-80 p-0",
158
200
  "data-testid": "view-settings-content",
159
201
  children: [
160
- /* @__PURE__ */ F("div", {
202
+ /* @__PURE__ */ N("div", {
161
203
  className: "px-3 py-2 border-b",
162
- children: [/* @__PURE__ */ P("div", {
204
+ children: [/* @__PURE__ */ M("div", {
163
205
  className: "text-sm font-semibold",
164
- children: T
165
- }), /* @__PURE__ */ P("div", {
206
+ children: b
207
+ }), /* @__PURE__ */ M("div", {
166
208
  className: "text-[11px] text-muted-foreground",
167
209
  children: t("list.viewSettingsHint", { defaultValue: "Grouping, color, density, and visible fields." })
168
210
  })]
169
211
  }),
170
- r && o && /* @__PURE__ */ P(R, {
212
+ r && o && /* @__PURE__ */ M(L, {
171
213
  title: t("list.group", { defaultValue: "Group" }),
172
214
  badge: i?.fields?.length || 0,
173
215
  onClear: i ? () => o(void 0) : void 0,
174
216
  clearLabel: t("list.clear", { defaultValue: "Clear" }),
175
- children: /* @__PURE__ */ P(h, {
217
+ children: /* @__PURE__ */ M(ee, {
176
218
  value: i,
177
219
  fieldOptions: n.map((e) => ({
178
220
  value: e.name,
@@ -187,15 +229,15 @@ function Ie(e) {
187
229
  onChange: (e) => o(e)
188
230
  })
189
231
  }),
190
- s && l && /* @__PURE__ */ F(R, {
232
+ s && l && /* @__PURE__ */ N(L, {
191
233
  title: t("list.color", { defaultValue: "Row color" }),
192
234
  onClear: c ? () => l(void 0) : void 0,
193
235
  clearLabel: t("list.clear", { defaultValue: "Clear" }),
194
236
  defaultOpen: !!c,
195
- children: [/* @__PURE__ */ P("label", {
237
+ children: [/* @__PURE__ */ M("label", {
196
238
  className: "block text-[11px] text-muted-foreground mb-1",
197
239
  children: t("list.colorByField", { defaultValue: "Color by field" })
198
- }), /* @__PURE__ */ F("select", {
240
+ }), /* @__PURE__ */ N("select", {
199
241
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
200
242
  value: c?.field || "",
201
243
  onChange: (e) => {
@@ -206,55 +248,55 @@ function Ie(e) {
206
248
  } : void 0);
207
249
  },
208
250
  "data-testid": "color-field-select",
209
- children: [/* @__PURE__ */ P("option", {
251
+ children: [/* @__PURE__ */ M("option", {
210
252
  value: "",
211
253
  children: t("list.none", { defaultValue: "None" })
212
- }), n.map((e) => /* @__PURE__ */ P("option", {
254
+ }), n.map((e) => /* @__PURE__ */ M("option", {
213
255
  value: e.name,
214
256
  children: e.label || e.name
215
257
  }, e.name))]
216
258
  })]
217
259
  }),
218
- u && f && /* @__PURE__ */ P(R, {
260
+ u && f && /* @__PURE__ */ M(L, {
219
261
  title: t("grid.toolbar.densityMode", { defaultValue: "Density" }),
220
262
  defaultOpen: f.mode !== "compact",
221
- children: /* @__PURE__ */ F("div", {
263
+ children: /* @__PURE__ */ N("div", {
222
264
  className: "flex items-center gap-2",
223
- children: [/* @__PURE__ */ F(d, {
265
+ children: [/* @__PURE__ */ N(d, {
224
266
  variant: "outline",
225
267
  size: "sm",
226
268
  className: "h-7 gap-1.5",
227
269
  onClick: f.cycle,
228
270
  "data-testid": "view-settings-density-cycle",
229
- children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
271
+ children: [/* @__PURE__ */ M(y, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ M("span", {
230
272
  className: "text-xs",
231
273
  children: f.mode === "compact" ? t("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : f.mode === "comfortable" ? t("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : t("grid.toolbar.densitySpacious", { defaultValue: "Spacious" })
232
274
  })]
233
- }), /* @__PURE__ */ P("span", {
275
+ }), /* @__PURE__ */ M("span", {
234
276
  className: "text-[11px] text-muted-foreground",
235
277
  children: t("grid.toolbar.densityCycleShortHint", { defaultValue: "Click to cycle" })
236
278
  })]
237
279
  })
238
280
  }),
239
- p && m && g && /* @__PURE__ */ P(R, {
281
+ p && m && h && /* @__PURE__ */ M(L, {
240
282
  title: t("list.hideFieldsTitle", { defaultValue: "Hide fields" }),
241
283
  badge: m.size,
242
- onClear: m.size > 0 ? () => g(/* @__PURE__ */ new Set()) : void 0,
284
+ onClear: m.size > 0 ? () => h(/* @__PURE__ */ new Set()) : void 0,
243
285
  clearLabel: t("list.showAll", { defaultValue: "Show all" }),
244
286
  defaultOpen: m.size > 0,
245
- children: /* @__PURE__ */ P("div", {
287
+ children: /* @__PURE__ */ M("div", {
246
288
  className: "max-h-48 overflow-y-auto space-y-0.5",
247
- children: n.map((e) => /* @__PURE__ */ F("label", {
289
+ children: n.map((e) => /* @__PURE__ */ N("label", {
248
290
  className: "flex items-center gap-2 text-xs py-1 px-1 rounded hover:bg-muted cursor-pointer",
249
- children: [/* @__PURE__ */ P("input", {
291
+ children: [/* @__PURE__ */ M("input", {
250
292
  type: "checkbox",
251
293
  checked: !m.has(e.name),
252
294
  onChange: () => {
253
295
  let t = new Set(m);
254
- t.has(e.name) ? t.delete(e.name) : t.add(e.name), g(t);
296
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), h(t);
255
297
  },
256
298
  className: "rounded border-input"
257
- }), /* @__PURE__ */ P("span", {
299
+ }), /* @__PURE__ */ M("span", {
258
300
  className: "truncate",
259
301
  children: e.label || e.name
260
302
  })]
@@ -267,23 +309,23 @@ function Ie(e) {
267
309
  }
268
310
  //#endregion
269
311
  //#region src/UserFilters.tsx
270
- function Le() {
312
+ function R() {
271
313
  try {
272
- let { t: e } = be(), t = e("common.more");
314
+ let { t: e } = De(), t = e("common.more");
273
315
  return !t || t === "common.more" ? "More" : t;
274
316
  } catch {
275
317
  return "More";
276
318
  }
277
319
  }
278
- var Re = new Set([
320
+ var z = new Set([
279
321
  "lookup",
280
322
  "master_detail",
281
323
  "user",
282
324
  "owner"
283
325
  ]);
284
- function ze({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a }) {
326
+ function We({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a }) {
285
327
  switch (e.element) {
286
- case "dropdown": return /* @__PURE__ */ P(z, {
328
+ case "dropdown": return /* @__PURE__ */ M(B, {
287
329
  fields: e.fields || [],
288
330
  objectDef: t,
289
331
  data: n,
@@ -291,14 +333,14 @@ function ze({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
291
333
  maxVisible: i,
292
334
  className: a
293
335
  });
294
- case "tabs": return /* @__PURE__ */ P(B, {
336
+ case "tabs": return /* @__PURE__ */ M(V, {
295
337
  tabs: e.tabs || [],
296
338
  showAllRecords: e.showAllRecords !== !1,
297
339
  allowAddTab: e.allowAddTab,
298
340
  onFilterChange: r,
299
341
  className: a
300
342
  });
301
- case "toggle": return /* @__PURE__ */ P(Ve, {
343
+ case "toggle": return /* @__PURE__ */ M(H, {
302
344
  fields: e.fields || [],
303
345
  onFilterChange: r,
304
346
  className: a
@@ -306,7 +348,7 @@ function ze({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
306
348
  default: return null;
307
349
  }
308
350
  }
309
- function Be(e, t, n, r) {
351
+ function Ge(e, t, n, r) {
310
352
  return e.map((e) => {
311
353
  let i = e.options ? [...e.options] : [], a = e.type, o, s, c;
312
354
  if (t?.fields) {
@@ -343,13 +385,13 @@ function Be(e, t, n, r) {
343
385
  };
344
386
  });
345
387
  }
346
- function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o }) {
347
- let { fieldLabel: s, translateOptions: c } = xe(), l = Le(), u = t?.name, [d, f] = a.useState(() => {
388
+ function B({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o }) {
389
+ let { fieldLabel: s, translateOptions: c } = Oe(), l = R(), u = t?.name, [d, f] = a.useState(() => {
348
390
  let t = {};
349
391
  return e.forEach((e) => {
350
392
  e.defaultValues && e.defaultValues.length > 0 && (t[e.field] = e.defaultValues);
351
393
  }), t;
352
- }), p = a.useMemo(() => Be(e, t, n, {
394
+ }), p = a.useMemo(() => Ge(e, t, n, {
353
395
  objectName: u,
354
396
  fieldLabel: s,
355
397
  translateOptions: c
@@ -376,37 +418,37 @@ function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
376
418
  a.useEffect(() => {
377
419
  Object.values(d).some((e) => e.length > 0) && m(d);
378
420
  }, []);
379
- let g = i !== void 0 && i < p.length ? p.slice(0, i) : p, v = i !== void 0 && i < p.length ? p.slice(i) : [], S = (e) => {
380
- let t = d[e.field] || [], n = t.length > 0, r = Re.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
381
- return /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
421
+ let g = i !== void 0 && i < p.length ? p.slice(0, i) : p, _ = i !== void 0 && i < p.length ? p.slice(i) : [], v = (e) => {
422
+ let t = d[e.field] || [], n = t.length > 0, r = z.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
423
+ return /* @__PURE__ */ N(x, { children: [/* @__PURE__ */ M(C, {
382
424
  asChild: !0,
383
- children: /* @__PURE__ */ F("button", {
425
+ children: /* @__PURE__ */ N("button", {
384
426
  "data-testid": `filter-badge-${e.field}`,
385
- className: C("inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md", n ? "text-foreground font-medium" : "text-muted-foreground hover:text-foreground"),
427
+ className: w("inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md", n ? "text-foreground font-medium" : "text-muted-foreground hover:text-foreground"),
386
428
  children: [
387
- /* @__PURE__ */ P("span", {
429
+ /* @__PURE__ */ M("span", {
388
430
  className: "truncate max-w-[100px]",
389
431
  children: e.label || e.field
390
432
  }),
391
- n && /* @__PURE__ */ P("span", {
433
+ n && /* @__PURE__ */ M("span", {
392
434
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
393
435
  children: t.length
394
436
  }),
395
- n ? /* @__PURE__ */ P(_e, {
437
+ n ? /* @__PURE__ */ M(Ce, {
396
438
  className: "h-3 w-3 opacity-60 hover:opacity-100",
397
439
  "data-testid": `filter-clear-${e.field}`,
398
440
  onClick: (t) => {
399
441
  t.stopPropagation(), h(e.field, []);
400
442
  }
401
- }) : /* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
443
+ }) : /* @__PURE__ */ M(D, { className: "h-3 w-3 opacity-60" })
402
444
  ]
403
445
  })
404
- }), /* @__PURE__ */ P(b, {
446
+ }), /* @__PURE__ */ M(S, {
405
447
  align: "start",
406
- className: C(i, "p-2"),
407
- children: r ? /* @__PURE__ */ P("div", {
448
+ className: w(i, "p-2"),
449
+ children: r ? /* @__PURE__ */ M("div", {
408
450
  "data-testid": `filter-lookup-${e.field}`,
409
- children: /* @__PURE__ */ P(_, {
451
+ children: /* @__PURE__ */ M(b, {
410
452
  field: {
411
453
  value: e.field,
412
454
  label: e.label || e.field,
@@ -422,16 +464,16 @@ function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
422
464
  h(e.field, n);
423
465
  }
424
466
  })
425
- }) : /* @__PURE__ */ P("div", {
467
+ }) : /* @__PURE__ */ M("div", {
426
468
  className: "max-h-60 overflow-y-auto space-y-0.5",
427
469
  "data-testid": `filter-options-${e.field}`,
428
- children: e.options.length === 0 ? /* @__PURE__ */ P("div", {
470
+ children: e.options.length === 0 ? /* @__PURE__ */ M("div", {
429
471
  className: "px-2 py-3 text-center text-xs text-muted-foreground",
430
472
  children: "No options"
431
- }) : e.options.map((n) => /* @__PURE__ */ F("label", {
432
- className: C("flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer", t.includes(n.value) ? "bg-primary/5 text-primary" : "hover:bg-muted"),
473
+ }) : e.options.map((n) => /* @__PURE__ */ N("label", {
474
+ className: w("flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer", t.includes(n.value) ? "bg-primary/5 text-primary" : "hover:bg-muted"),
433
475
  children: [
434
- /* @__PURE__ */ P("input", {
476
+ /* @__PURE__ */ M("input", {
435
477
  type: "checkbox",
436
478
  checked: t.includes(n.value),
437
479
  onChange: () => {
@@ -440,15 +482,15 @@ function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
440
482
  },
441
483
  className: "rounded border-input"
442
484
  }),
443
- n.color && /* @__PURE__ */ P("span", {
485
+ n.color && /* @__PURE__ */ M("span", {
444
486
  className: "h-2.5 w-2.5 rounded-full shrink-0",
445
487
  style: { backgroundColor: n.color }
446
488
  }),
447
- /* @__PURE__ */ P("span", {
489
+ /* @__PURE__ */ M("span", {
448
490
  className: "truncate flex-1",
449
491
  children: n.label
450
492
  }),
451
- n.count !== void 0 && /* @__PURE__ */ P("span", {
493
+ n.count !== void 0 && /* @__PURE__ */ M("span", {
452
494
  className: "text-xs text-muted-foreground",
453
495
  children: n.count
454
496
  })
@@ -457,39 +499,39 @@ function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
457
499
  })
458
500
  })] }, e.field);
459
501
  };
460
- return /* @__PURE__ */ P("div", {
461
- className: C("flex items-center gap-0.5 overflow-x-auto", o),
502
+ return /* @__PURE__ */ M("div", {
503
+ className: w("flex items-center gap-0.5 overflow-x-auto", o),
462
504
  "data-testid": "user-filters-dropdown",
463
- children: p.length === 0 ? /* @__PURE__ */ P("span", {
505
+ children: p.length === 0 ? /* @__PURE__ */ M("span", {
464
506
  className: "text-xs text-muted-foreground",
465
507
  "data-testid": "user-filters-empty",
466
508
  children: "No filter fields"
467
- }) : /* @__PURE__ */ F(N, { children: [g.map(S), v.length > 0 && /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
509
+ }) : /* @__PURE__ */ N(Te, { children: [g.map(v), _.length > 0 && /* @__PURE__ */ N(x, { children: [/* @__PURE__ */ M(C, {
468
510
  asChild: !0,
469
- children: /* @__PURE__ */ F("button", {
511
+ children: /* @__PURE__ */ N("button", {
470
512
  "data-testid": "user-filters-more",
471
513
  className: "inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md",
472
514
  children: [
473
- /* @__PURE__ */ P("span", { children: l }),
474
- /* @__PURE__ */ P("span", {
515
+ /* @__PURE__ */ M("span", { children: l }),
516
+ /* @__PURE__ */ M("span", {
475
517
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
476
- children: v.length
518
+ children: _.length
477
519
  }),
478
- /* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
520
+ /* @__PURE__ */ M(D, { className: "h-3 w-3 opacity-60" })
479
521
  ]
480
522
  })
481
- }), /* @__PURE__ */ P(b, {
523
+ }), /* @__PURE__ */ M(S, {
482
524
  align: "start",
483
525
  className: "w-64 p-2",
484
526
  "data-testid": "user-filters-more-content",
485
- children: /* @__PURE__ */ P("div", {
527
+ children: /* @__PURE__ */ M("div", {
486
528
  className: "space-y-1",
487
- children: v.map(S)
529
+ children: _.map(v)
488
530
  })
489
531
  })] })] })
490
532
  });
491
533
  }
492
- function B({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
534
+ function V({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
493
535
  let [o, s] = a.useState(() => e.find((e) => e.default)?.id || (t ? "__all__" : e[0]?.id || "")), c = a.useCallback((t) => {
494
536
  s(t), r(t === "__all__" ? [] : e.find((e) => e.id === t)?.filters || []);
495
537
  }, [e, r]), l = a.useMemo(() => {
@@ -503,23 +545,23 @@ function B({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, clas
503
545
  return a.useEffect(() => {
504
546
  let t = e.find((e) => e.default);
505
547
  t && r(t.filters || []);
506
- }, []), /* @__PURE__ */ F("div", {
507
- className: C("flex items-center gap-0.5 overflow-x-auto", i),
548
+ }, []), /* @__PURE__ */ N("div", {
549
+ className: w("flex items-center gap-0.5 overflow-x-auto", i),
508
550
  "data-testid": "user-filters-tabs",
509
- children: [l.map((e) => /* @__PURE__ */ P("button", {
551
+ children: [l.map((e) => /* @__PURE__ */ M("button", {
510
552
  "data-testid": `filter-tab-${e.id}`,
511
553
  onClick: () => c(e.id),
512
- className: C("inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0", o === e.id ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"),
554
+ className: w("inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0", o === e.id ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"),
513
555
  children: e.label
514
- }, e.id)), n && /* @__PURE__ */ P("button", {
556
+ }, e.id)), n && /* @__PURE__ */ M("button", {
515
557
  className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",
516
558
  "data-testid": "filter-tab-add",
517
559
  title: "Add filter tab",
518
- children: /* @__PURE__ */ P(M, { className: "h-3.5 w-3.5" })
560
+ children: /* @__PURE__ */ M(pe, { className: "h-3.5 w-3.5" })
519
561
  })]
520
562
  });
521
563
  }
522
- function Ve({ fields: e, onFilterChange: t, className: n }) {
564
+ function H({ fields: e, onFilterChange: t, className: n }) {
523
565
  let [r, i] = a.useState(() => {
524
566
  let t = /* @__PURE__ */ new Set();
525
567
  return e.forEach((e) => {
@@ -546,10 +588,10 @@ function Ve({ fields: e, onFilterChange: t, className: n }) {
546
588
  };
547
589
  return a.useEffect(() => {
548
590
  r.size > 0 && o(r);
549
- }, []), /* @__PURE__ */ P("div", {
550
- className: C("flex items-center gap-1 overflow-x-auto", n),
591
+ }, []), /* @__PURE__ */ M("div", {
592
+ className: w("flex items-center gap-1 overflow-x-auto", n),
551
593
  "data-testid": "user-filters-toggle",
552
- children: e.map((e) => /* @__PURE__ */ P(d, {
594
+ children: e.map((e) => /* @__PURE__ */ M(d, {
553
595
  variant: r.has(e.field) ? "default" : "outline",
554
596
  size: "sm",
555
597
  className: "h-7 px-3 text-xs shrink-0",
@@ -561,7 +603,7 @@ function Ve({ fields: e, onFilterChange: t, className: n }) {
561
603
  }
562
604
  //#endregion
563
605
  //#region src/ListView.tsx
564
- function He(e) {
606
+ function Ke(e) {
565
607
  switch (e) {
566
608
  case "equals":
567
609
  case "eq": return "=";
@@ -585,10 +627,10 @@ function He(e) {
585
627
  default: return e;
586
628
  }
587
629
  }
588
- function V(e) {
630
+ function qe(e) {
589
631
  if (!Array.isArray(e) || e.length < 3) return e;
590
632
  let [t, n, r] = e;
591
- return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? V(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
633
+ return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? qe(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
592
634
  t,
593
635
  "=",
594
636
  r[0]
@@ -606,15 +648,15 @@ function V(e) {
606
648
  e
607
649
  ])] : e;
608
650
  }
609
- function Ue(e) {
651
+ function Je(e) {
610
652
  return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
611
653
  }
612
- function We(e) {
613
- return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? V(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
654
+ function Ye(e) {
655
+ return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? qe(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
614
656
  }
615
- function Ge(e) {
657
+ function Xe(e) {
616
658
  if (!e || !e.conditions || e.conditions.length === 0) return [];
617
- let t = We(e.conditions.map((e) => e.operator === "isEmpty" ? [
659
+ let t = Ye(e.conditions.map((e) => e.operator === "isEmpty" ? [
618
660
  e.field,
619
661
  "=",
620
662
  null
@@ -624,12 +666,12 @@ function Ge(e) {
624
666
  null
625
667
  ] : [
626
668
  e.field,
627
- He(e.operator),
669
+ Ke(e.operator),
628
670
  e.value
629
671
  ]));
630
672
  return t.length === 0 ? [] : t.length === 1 ? t[0] : [e.logic, ...t];
631
673
  }
632
- function H(e, t) {
674
+ function Ze(e, t) {
633
675
  if (!t || t.length === 0) return {};
634
676
  for (let r of t) {
635
677
  let t = !1, i = ("condition" in r ? r.condition : void 0) || ("expression" in r ? r.expression : void 0) || void 0;
@@ -664,11 +706,12 @@ function H(e, t) {
664
706
  }
665
707
  return {};
666
708
  }
667
- var Ke = {
709
+ var Qe = {
668
710
  "list.recordCount": "{{count}} records",
669
711
  "list.recordCountOne": "{{count}} record",
670
712
  "list.noItems": "No items found",
671
713
  "list.noItemsMessage": "There are no records to display. Try adjusting your filters or adding new data.",
714
+ "list.loading": "Loading records…",
672
715
  "list.search": "Search",
673
716
  "list.filter": "Filter",
674
717
  "list.filterRecords": "Filter Records",
@@ -703,58 +746,58 @@ var Ke = {
703
746
  "grid.toolbar.densityCycleShortHint": "Click to cycle",
704
747
  "list.viewSettings": "View settings",
705
748
  "list.viewSettingsHint": "Grouping, color, density, and visible fields."
706
- }, qe = (e, t, n) => n, U = (e, t) => {
707
- let n = Ke[e] || e;
749
+ }, $e = (e, t, n) => n, et = (e, t) => {
750
+ let n = Qe[e] || e;
708
751
  if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
709
752
  return n;
710
753
  };
711
- function Je() {
754
+ function tt() {
712
755
  try {
713
- let e = be();
714
- return e.t("list.recordCount") === "list.recordCount" ? { t: U } : { t: e.t };
756
+ let e = De();
757
+ return e.t("list.recordCount") === "list.recordCount" ? { t: et } : { t: e.t };
715
758
  } catch {
716
- return { t: U };
759
+ return { t: et };
717
760
  }
718
761
  }
719
- function Ye() {
762
+ function nt() {
720
763
  try {
721
- let { fieldLabel: e } = ye();
764
+ let { fieldLabel: e } = Ee();
722
765
  return { fieldLabel: e };
723
766
  } catch {
724
- return { fieldLabel: qe };
767
+ return { fieldLabel: $e };
725
768
  }
726
769
  }
727
- var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange: s, onSortChange: c, onSearchChange: l, onHiddenFieldsChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: _ = !1, ...w }, ee) => {
728
- let { t: E } = Je(), { fieldLabel: ne } = Ye(), { translateOptions: D } = xe(), O = a.useMemo(() => e.viewType ? e : {
770
+ var U = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange: s, onSortChange: c, onSearchChange: l, onHiddenFieldsChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: m = !1, ...h }, g) => {
771
+ let { t: _ } = tt(), { fieldLabel: b } = nt(), { translateOptions: ie } = Oe(), E = a.useMemo(() => e.viewType ? e : {
729
772
  ...e,
730
773
  viewType: "grid"
731
- }, [e]), k = a.useCallback((e, t) => O.objectName ? ne(O.objectName, e, t) : t, [O.objectName, ne]), A = a.useMemo(() => {
732
- let e = O.userActions, t = O.addRecord?.enabled === !0 && e?.addRecordForm !== !1;
774
+ }, [e]), D = a.useCallback((e, t) => E.objectName ? b(E.objectName, e, t) : t, [E.objectName, b]), O = a.useMemo(() => {
775
+ let e = E.userActions, t = E.addRecord?.enabled === !0 && e?.addRecordForm !== !1;
733
776
  return {
734
- showSearch: e?.search === void 0 ? O.showSearch !== !1 : e.search,
735
- showSort: e?.sort === void 0 ? O.showSort !== !1 : e.sort,
736
- showFilters: e?.filter === void 0 ? O.showFilters !== !1 : e.filter,
737
- showDensity: e?.rowHeight === void 0 ? O.showDensity !== !1 : e.rowHeight,
738
- showHideFields: O.showHideFields === !0,
739
- showGroup: O.showGroup !== !1,
740
- showColor: O.showColor === !0,
741
- compactToolbar: O.compactToolbar === !0,
777
+ showSearch: e?.search === void 0 ? E.showSearch !== !1 : e.search,
778
+ showSort: e?.sort === void 0 ? E.showSort !== !1 : e.sort,
779
+ showFilters: e?.filter === void 0 ? E.showFilters !== !1 : e.filter,
780
+ showDensity: e?.rowHeight === void 0 ? E.showDensity !== !1 : e.rowHeight,
781
+ showHideFields: E.showHideFields === !0,
782
+ showGroup: E.showGroup !== !1,
783
+ showColor: E.showColor === !0,
784
+ compactToolbar: E.compactToolbar === !0,
742
785
  showAddRecord: t,
743
- addRecordPosition: O.addRecord?.position === "bottom" ? "bottom" : "top"
786
+ addRecordPosition: E.addRecord?.position === "bottom" ? "bottom" : "top"
744
787
  };
745
788
  }, [
746
- O.userActions,
747
- O.showSearch,
748
- O.showSort,
749
- O.showFilters,
750
- O.showDensity,
751
- O.showHideFields,
752
- O.showGroup,
753
- O.showColor,
754
- O.compactToolbar,
755
- O.addRecord,
756
- O.userActions?.addRecordForm
757
- ]), [j, pe] = a.useState(O.viewType), [N, ye] = a.useState(""), [be, Ce] = a.useState(!1), [we, De] = a.useState(!1), [I, Ae] = a.useState(() => O.sort && O.sort.length > 0 ? O.sort.map((e) => {
789
+ E.userActions,
790
+ E.showSearch,
791
+ E.showSort,
792
+ E.showFilters,
793
+ E.showDensity,
794
+ E.showHideFields,
795
+ E.showGroup,
796
+ E.showColor,
797
+ E.compactToolbar,
798
+ E.addRecord,
799
+ E.userActions?.addRecordForm
800
+ ]), [A, se] = a.useState(E.viewType), [j, ue] = a.useState(""), [de, ye] = a.useState(!1), [Ee, De] = a.useState(!1), [P, Ae] = a.useState(() => E.sort && E.sort.length > 0 ? E.sort.map((e) => {
758
801
  if (typeof e == "string") {
759
802
  let t = e.trim().split(/\s+/);
760
803
  return {
@@ -768,9 +811,9 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
768
811
  field: e.field,
769
812
  order: e.order || "asc"
770
813
  };
771
- }) : []), je = a.useMemo(() => JSON.stringify(O.sort || []), [O.sort]);
814
+ }) : []), Ne = a.useMemo(() => JSON.stringify(E.sort || []), [E.sort]);
772
815
  a.useEffect(() => {
773
- O.sort && O.sort.length > 0 ? Ae(O.sort.map((e) => {
816
+ E.sort && E.sort.length > 0 ? Ae(E.sort.map((e) => {
774
817
  if (typeof e == "string") {
775
818
  let t = e.trim().split(/\s+/);
776
819
  return {
@@ -785,42 +828,42 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
785
828
  order: e.order || "asc"
786
829
  };
787
830
  })) : Ae([]);
788
- }, [je]);
789
- let [Me, Pe] = a.useState(!1), [L, R] = a.useState({
831
+ }, [Ne]);
832
+ let [Ie, Le] = a.useState(!1), [F, I] = a.useState({
790
833
  id: "root",
791
834
  logic: "and",
792
835
  conditions: []
793
- }), [Le, Re] = a.useState(() => {
794
- if (!(!O.tabs || O.tabs.length === 0)) return O.tabs.find((e) => e.isDefault)?.name ?? O.tabs[0]?.name;
795
- }), Be = a.useCallback((e) => {
796
- if (Re(e.name), e.filter) {
836
+ }), [ze, Be] = a.useState(() => {
837
+ if (!(!E.tabs || E.tabs.length === 0)) return E.tabs.find((e) => e.isDefault)?.name ?? E.tabs[0]?.name;
838
+ }), L = a.useCallback((e) => {
839
+ if (Be(e.name), e.filter) {
797
840
  let t = {
798
841
  id: `tab-filter-${e.name}`,
799
842
  logic: e.filter.logic || "and",
800
843
  conditions: e.filter.conditions || []
801
844
  };
802
- R(t), s?.(t);
845
+ I(t), s?.(t);
803
846
  } else {
804
847
  let e = {
805
848
  id: "root",
806
849
  logic: "and",
807
850
  conditions: []
808
851
  };
809
- R(e), s?.(e);
852
+ I(e), s?.(e);
810
853
  }
811
- }, [s]), z = w.dataSource, [B, Ve] = a.useState([]), [He, V] = a.useState(!1), [H, Ke] = a.useState(null), [qe, U] = a.useState(!1), [Xe, Ze] = a.useState(0), [Qe, $e] = a.useState(!1);
812
- a.useImperativeHandle(ee, () => ({ refresh: () => Ze((e) => e + 1) }), []), a.useEffect(() => {
813
- if (!(!z?.onMutation || !O.objectName || O.refreshTrigger)) return z.onMutation((e) => {
814
- e.resource === O.objectName && Ze((e) => e + 1);
854
+ }, [s]), R = h.dataSource, [z, Ge] = a.useState([]), [B, V] = a.useState(() => !(Array.isArray(E.data) || E.data && typeof E.data == "object" && E.data.provider === "value" && Array.isArray(E.data.items))), [H, Ke] = a.useState(null), [qe, Ze] = a.useState(!1), [Qe, $e] = a.useState(0), [et, U] = a.useState(!1);
855
+ a.useImperativeHandle(g, () => ({ refresh: () => $e((e) => e + 1) }), []), a.useEffect(() => {
856
+ if (!(!R?.onMutation || !E.objectName || E.refreshTrigger)) return R.onMutation((e) => {
857
+ e.resource === E.objectName && $e((e) => e + 1);
815
858
  });
816
859
  }, [
817
- z,
818
- O.objectName,
819
- O.refreshTrigger
860
+ R,
861
+ E.objectName,
862
+ E.refreshTrigger
820
863
  ]);
821
- let [et, tt] = a.useState(void 0), nt = et ?? O.pagination?.pageSize ?? 100, W = a.useMemo(() => {
822
- if (O.grouping?.fields?.length) return O.grouping;
823
- let e = typeof O.groupBy == "string" ? O.groupBy.trim() : "", t = typeof O.groupBy2 == "string" ? O.groupBy2.trim() : "", n = [];
864
+ let [rt, it] = a.useState(void 0), W = rt ?? E.pagination?.pageSize ?? 100, G = a.useMemo(() => {
865
+ if (E.grouping?.fields?.length) return E.grouping;
866
+ let e = typeof E.groupBy == "string" ? E.groupBy.trim() : "", t = typeof E.groupBy2 == "string" ? E.groupBy2.trim() : "", n = [];
824
867
  return e && n.push({
825
868
  field: e,
826
869
  order: "asc",
@@ -831,21 +874,21 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
831
874
  collapsed: !1
832
875
  }), n.length > 0 ? { fields: n } : void 0;
833
876
  }, [
834
- O.grouping,
835
- O.groupBy,
836
- O.groupBy2
837
- ]), [G, rt] = a.useState(W), [it, at] = a.useState(!1), ot = a.useRef(W);
877
+ E.grouping,
878
+ E.groupBy,
879
+ E.groupBy2
880
+ ]), [K, at] = a.useState(G), [ot, st] = a.useState(!1), ct = a.useRef(G);
838
881
  a.useEffect(() => {
839
- ot.current !== W && (ot.current = W, rt(W));
840
- }, [W]);
841
- let [K, st] = a.useState(O.rowColor), [ct, lt] = a.useState(!1), [ut, dt] = a.useState([]), ft = a.useRef(0), [pt, mt] = a.useState(() => {
882
+ ct.current !== G && (ct.current = G, at(G));
883
+ }, [G]);
884
+ let [q, lt] = a.useState(E.rowColor), [ut, dt] = a.useState(!1), [ft, pt] = a.useState([]), mt = a.useRef(0), [ht, gt] = a.useState(() => {
842
885
  let e = /* @__PURE__ */ new Set();
843
- return O.quickFilters?.forEach((t) => {
886
+ return E.quickFilters?.forEach((t) => {
844
887
  let n = r(t);
845
888
  n.defaultActive && e.add(n.id);
846
889
  }), e;
847
- }), [ht, gt] = a.useState([]), _t = a.useMemo(() => {
848
- if (O.userFilters) return O.userFilters;
890
+ }), [_t, vt] = a.useState([]), yt = a.useMemo(() => {
891
+ if (E.userFilters) return E.userFilters;
849
892
  if (!H?.fields) return;
850
893
  let e = new Set([
851
894
  "select",
@@ -854,73 +897,73 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
854
897
  ]), t = [], n = Array.isArray(H.fields) ? H.fields.map((e) => [e.name, e]) : Object.entries(H.fields);
855
898
  for (let [r, i] of n) (e.has(i.type) || i.options && !i.type) && t.push({
856
899
  field: r,
857
- label: k(r, i.label || r),
900
+ label: D(r, i.label || r),
858
901
  type: i.type === "boolean" ? "boolean" : i.type === "multi-select" ? "multi-select" : "select"
859
902
  });
860
903
  if (t.length !== 0) return {
861
904
  element: "dropdown",
862
905
  fields: t
863
906
  };
864
- }, [O.userFilters, H]), [q, vt] = a.useState(() => new Set(O.hiddenFields || [])), yt = a.useMemo(() => JSON.stringify(O.hiddenFields || []), [O.hiddenFields]);
907
+ }, [E.userFilters, H]), [J, bt] = a.useState(() => new Set(E.hiddenFields || [])), xt = a.useMemo(() => JSON.stringify(E.hiddenFields || []), [E.hiddenFields]);
865
908
  a.useEffect(() => {
866
- vt(new Set(O.hiddenFields || []));
867
- }, [yt]);
868
- let bt = a.useCallback((e) => {
869
- vt(e), u?.(Array.from(e));
870
- }, [u]), [xt, St] = a.useState(!1), [Ct, wt] = a.useState(!1), J = a.useMemo(() => i(O.quickFilters), [O.quickFilters]), Y = a.useMemo(() => {
871
- if (O.exportOptions) return Array.isArray(O.exportOptions) ? { formats: O.exportOptions } : O.exportOptions;
872
- }, [O.exportOptions]), X = Te(a.useMemo(() => O.densityMode ? O.densityMode : O.rowHeight ? {
909
+ bt(new Set(E.hiddenFields || []));
910
+ }, [xt]);
911
+ let St = a.useCallback((e) => {
912
+ bt(e), u?.(Array.from(e));
913
+ }, [u]), [Ct, wt] = a.useState(!1), [Tt, Et] = a.useState(!1), Y = a.useMemo(() => i(E.quickFilters), [E.quickFilters]), X = a.useMemo(() => {
914
+ if (E.exportOptions) return Array.isArray(E.exportOptions) ? { formats: E.exportOptions } : E.exportOptions;
915
+ }, [E.exportOptions]), Z = je(a.useMemo(() => E.densityMode ? E.densityMode : E.rowHeight ? {
873
916
  compact: "compact",
874
917
  short: "compact",
875
918
  medium: "comfortable",
876
919
  tall: "spacious",
877
920
  extra_tall: "spacious"
878
- }[O.rowHeight] || "comfortable" : "compact", [O.densityMode, O.rowHeight]), { onChange: O.onDensityChange }), Tt = a.useMemo(() => `objectui:gallery:density:${O.objectName ?? "default"}`, [O.objectName]), [Z, Et] = a.useState(() => {
879
- if (typeof window > "u") return O.gallery?.cardSize ?? "medium";
921
+ }[E.rowHeight] || "comfortable" : "compact", [E.densityMode, E.rowHeight]), { onChange: E.onDensityChange }), Dt = a.useMemo(() => `objectui:gallery:density:${E.objectName ?? "default"}`, [E.objectName]), [Q, Ot] = a.useState(() => {
922
+ if (typeof window > "u") return E.gallery?.cardSize ?? "medium";
880
923
  try {
881
- let e = window.localStorage.getItem(Tt);
924
+ let e = window.localStorage.getItem(Dt);
882
925
  if (e === "small" || e === "medium" || e === "large") return e;
883
926
  } catch {}
884
- return O.gallery?.cardSize ?? "medium";
885
- }), Dt = a.useCallback(() => {
886
- Et((e) => {
927
+ return E.gallery?.cardSize ?? "medium";
928
+ }), kt = a.useCallback(() => {
929
+ Ot((e) => {
887
930
  let t = e === "large" ? "medium" : e === "medium" ? "small" : "large";
888
931
  try {
889
- window.localStorage.setItem(Tt, t);
932
+ window.localStorage.setItem(Dt, t);
890
933
  } catch {}
891
934
  return t;
892
935
  });
893
- }, [Tt]), { ref: Ot, isRefreshing: kt, pullDistance: At } = Oe({
936
+ }, [Dt]), { ref: At, isRefreshing: jt, pullDistance: Mt } = Pe({
894
937
  onRefresh: a.useCallback(async () => {
895
- Ze((e) => e + 1);
938
+ $e((e) => e + 1);
896
939
  }, []),
897
- enabled: !!z && !!O.objectName
898
- }), jt = a.useMemo(() => O.id ? `listview-${O.objectName}-${O.id}-view` : `listview-${O.objectName}-view`, [O.objectName, O.id]);
940
+ enabled: !!R && !!E.objectName
941
+ }), Nt = a.useMemo(() => E.id ? `listview-${E.objectName}-${E.id}-view` : `listview-${E.objectName}-view`, [E.objectName, E.id]);
899
942
  a.useEffect(() => {
900
943
  let e = !0;
901
- return U(!1), Ke(null), (async () => {
902
- if (!z || !O.objectName) {
903
- U(!0);
944
+ return Ze(!1), Ke(null), (async () => {
945
+ if (!R || !E.objectName) {
946
+ Ze(!0);
904
947
  return;
905
948
  }
906
- if (typeof z.getObjectSchema != "function") {
907
- U(!0);
949
+ if (typeof R.getObjectSchema != "function") {
950
+ Ze(!0);
908
951
  return;
909
952
  }
910
953
  try {
911
- let t = await z.getObjectSchema(O.objectName);
954
+ let t = await R.getObjectSchema(E.objectName);
912
955
  e && Ke(t);
913
956
  } catch (e) {
914
957
  console.warn("Failed to fetch object schema for ListView:", e);
915
958
  } finally {
916
- e && U(!0);
959
+ e && Ze(!0);
917
960
  }
918
961
  })(), () => {
919
962
  e = !1;
920
963
  };
921
- }, [O.objectName, z]);
922
- let Mt = a.useMemo(() => {
923
- let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
964
+ }, [E.objectName, R]);
965
+ let Pt = a.useMemo(() => {
966
+ let e = Array.isArray(E.fields) ? E.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
924
967
  if (!e) return;
925
968
  let t = [
926
969
  e.groupField,
@@ -944,140 +987,142 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
944
987
  ];
945
988
  for (let e of t) typeof e == "string" && e && n.add(e);
946
989
  };
947
- r(O.kanban), r(O.options?.kanban), r(O.calendar), r(O.options?.calendar), r(O.gallery), r(O.options?.gallery), r(O.timeline), r(O.options?.timeline), r(O.gantt), r(O.options?.gantt);
990
+ r(E.kanban), r(E.options?.kanban), r(E.calendar), r(E.options?.calendar), r(E.gallery), r(E.options?.gallery), r(E.timeline), r(E.options?.timeline), r(E.gantt), r(E.options?.gantt);
948
991
  let i = n.size > 0 ? Array.from(n) : void 0;
949
992
  return t(H?.fields, i);
950
993
  }, [
951
994
  H?.fields,
952
- O.fields,
953
- O.kanban,
954
- O.calendar,
955
- O.gallery,
956
- O.timeline,
957
- O.gantt,
958
- O.options
959
- ]), Q = ke();
995
+ E.fields,
996
+ E.kanban,
997
+ E.calendar,
998
+ E.gallery,
999
+ E.timeline,
1000
+ E.gantt,
1001
+ E.options
1002
+ ]), $ = Fe();
960
1003
  a.useEffect(() => {
961
- let e = !0, t = ++ft.current;
962
- if (O.data && typeof O.data == "object" && !Array.isArray(O.data)) {
963
- let e = O.data;
1004
+ let e = !0, t = ++mt.current;
1005
+ if (E.data && typeof E.data == "object" && !Array.isArray(E.data)) {
1006
+ let e = E.data;
964
1007
  if (e.provider === "value" && Array.isArray(e.items)) {
965
1008
  let t = e.items;
966
- if (N) {
967
- let e = N.toLowerCase();
1009
+ if (j) {
1010
+ let e = j.toLowerCase();
968
1011
  t = t.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
969
1012
  }
970
- Ve(t), V(!1), $e(!1);
1013
+ Ge(t), V(!1), U(!1);
971
1014
  return;
972
1015
  }
973
1016
  }
974
- if (Array.isArray(O.data)) {
975
- let e = O.data;
976
- if (N) {
977
- let t = N.toLowerCase();
1017
+ if (Array.isArray(E.data)) {
1018
+ let e = E.data;
1019
+ if (j) {
1020
+ let t = j.toLowerCase();
978
1021
  e = e.filter((e) => Object.values(e).some((e) => e != null && String(e).toLowerCase().includes(t)));
979
1022
  }
980
- Ve(e), V(!1), $e(!1);
1023
+ Ge(e), V(!1), U(!1);
981
1024
  return;
982
1025
  }
983
1026
  return qe ? ((async () => {
984
- if (!(!z || !O.objectName)) {
985
- V(!0);
986
- try {
987
- let n = [], r = O.filters || [], i = Ge(L), a = [];
988
- J && pt.size > 0 && J.forEach((e) => {
989
- pt.has(e.id) && e.filters && e.filters.length > 0 && a.push(e.filters);
990
- });
991
- let o = We(ht), s = [
992
- ...r.length > 0 ? [r] : [],
993
- ...i.length > 0 ? [i] : [],
994
- ...a,
995
- ...o
996
- ].filter((e) => Array.isArray(e) && e.length > 0);
997
- s.length > 1 ? n = ["and", ...s] : s.length === 1 && (n = s[0]);
998
- let c = I.length > 0 ? I.filter((e) => e.field).map((e) => ({
999
- field: e.field,
1000
- order: e.order
1001
- })) : void 0, l = (() => {
1002
- let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], t = Q?.isLoaded && O.objectName ? e.filter((e) => Q.checkField(O.objectName, e, "read")) : e;
1003
- if (t.length === 0) return;
1004
- let n = new Set(["id"]);
1005
- for (let e of t) n.add(e);
1006
- for (let e of Mt) n.add(e);
1007
- let r = (e) => {
1008
- if (!e) return;
1009
- let t = [
1010
- e.groupField,
1011
- e.groupBy,
1012
- e.titleField,
1013
- e.cardTitle,
1014
- e.startDateField,
1015
- e.endDateField,
1016
- e.dateField,
1017
- e.endField,
1018
- e.colorField,
1019
- e.allDayField,
1020
- e.coverField,
1021
- e.imageField,
1022
- e.subtitleField,
1023
- e.swimlaneField,
1024
- e.valueField,
1025
- ...Array.isArray(e.cardFields) ? e.cardFields : [],
1026
- ...Array.isArray(e.visibleFields) ? e.visibleFields : [],
1027
- ...Array.isArray(e.metaFields) ? e.metaFields : []
1028
- ];
1029
- for (let e of t) typeof e == "string" && e && n.add(e);
1030
- };
1031
- r(O.kanban), r(O.options?.kanban), r(O.calendar), r(O.options?.calendar), r(O.gallery), r(O.options?.gallery), r(O.timeline), r(O.options?.timeline);
1032
- {
1033
- let e = O.timeline ?? O.options?.timeline;
1034
- e && !Array.isArray(e.metaFields) && (n.add("status"), n.add("priority"));
1035
- }
1036
- return r(O.gantt), r(O.options?.gantt), Array.from(n);
1037
- })(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await z.find(O.objectName, {
1038
- ...u ? { $filter: n } : {},
1039
- $orderby: c,
1040
- $top: nt,
1041
- ...l ? { $select: l } : {},
1042
- ...Mt.length > 0 ? { $expand: Mt } : {},
1043
- ...N ? {
1044
- $search: N,
1045
- ...O.searchableFields && O.searchableFields.length > 0 ? { $searchFields: O.searchableFields } : {}
1046
- } : {}
1047
- });
1048
- if (!e || t !== ft.current) return;
1049
- let f = [];
1050
- Array.isArray(d) ? f = d : d && typeof d == "object" && (Array.isArray(d.data) ? f = d.data : Array.isArray(d.records) ? f = d.records : Array.isArray(d.value) && (f = d.value)), Ve(f), $e(f.length >= nt);
1051
- } catch (e) {
1052
- t === ft.current && console.error("ListView data fetch error:", e);
1053
- } finally {
1054
- e && t === ft.current && V(!1);
1055
- }
1027
+ if (!R || !E.objectName) {
1028
+ V(!1);
1029
+ return;
1030
+ }
1031
+ V(!0);
1032
+ try {
1033
+ let n = [], r = E.filters || [], i = Xe(F), a = [];
1034
+ Y && ht.size > 0 && Y.forEach((e) => {
1035
+ ht.has(e.id) && e.filters && e.filters.length > 0 && a.push(e.filters);
1036
+ });
1037
+ let o = Ye(_t), s = [
1038
+ ...r.length > 0 ? [r] : [],
1039
+ ...i.length > 0 ? [i] : [],
1040
+ ...a,
1041
+ ...o
1042
+ ].filter((e) => Array.isArray(e) && e.length > 0);
1043
+ s.length > 1 ? n = ["and", ...s] : s.length === 1 && (n = s[0]);
1044
+ let c = P.length > 0 ? P.filter((e) => e.field).map((e) => ({
1045
+ field: e.field,
1046
+ order: e.order
1047
+ })) : void 0, l = (() => {
1048
+ let e = Array.isArray(E.fields) ? E.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], t = $?.isLoaded && E.objectName ? e.filter((e) => $.checkField(E.objectName, e, "read")) : e;
1049
+ if (t.length === 0) return;
1050
+ let n = new Set(["id"]);
1051
+ for (let e of t) n.add(e);
1052
+ for (let e of Pt) n.add(e);
1053
+ let r = (e) => {
1054
+ if (!e) return;
1055
+ let t = [
1056
+ e.groupField,
1057
+ e.groupBy,
1058
+ e.titleField,
1059
+ e.cardTitle,
1060
+ e.startDateField,
1061
+ e.endDateField,
1062
+ e.dateField,
1063
+ e.endField,
1064
+ e.colorField,
1065
+ e.allDayField,
1066
+ e.coverField,
1067
+ e.imageField,
1068
+ e.subtitleField,
1069
+ e.swimlaneField,
1070
+ e.valueField,
1071
+ ...Array.isArray(e.cardFields) ? e.cardFields : [],
1072
+ ...Array.isArray(e.visibleFields) ? e.visibleFields : [],
1073
+ ...Array.isArray(e.metaFields) ? e.metaFields : []
1074
+ ];
1075
+ for (let e of t) typeof e == "string" && e && n.add(e);
1076
+ };
1077
+ r(E.kanban), r(E.options?.kanban), r(E.calendar), r(E.options?.calendar), r(E.gallery), r(E.options?.gallery), r(E.timeline), r(E.options?.timeline);
1078
+ {
1079
+ let e = E.timeline ?? E.options?.timeline;
1080
+ e && !Array.isArray(e.metaFields) && (n.add("status"), n.add("priority"));
1081
+ }
1082
+ return r(E.gantt), r(E.options?.gantt), Array.from(n);
1083
+ })(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await R.find(E.objectName, {
1084
+ ...u ? { $filter: n } : {},
1085
+ $orderby: c,
1086
+ $top: W,
1087
+ ...l ? { $select: l } : {},
1088
+ ...Pt.length > 0 ? { $expand: Pt } : {},
1089
+ ...j ? {
1090
+ $search: j,
1091
+ ...E.searchableFields && E.searchableFields.length > 0 ? { $searchFields: E.searchableFields } : {}
1092
+ } : {}
1093
+ });
1094
+ if (!e || t !== mt.current) return;
1095
+ let f = [];
1096
+ Array.isArray(d) ? f = d : d && typeof d == "object" && (Array.isArray(d.data) ? f = d.data : Array.isArray(d.records) ? f = d.records : Array.isArray(d.value) && (f = d.value)), Ge(f), U(f.length >= W);
1097
+ } catch (e) {
1098
+ t === mt.current && console.error("ListView data fetch error:", e);
1099
+ } finally {
1100
+ e && t === mt.current && V(!1);
1056
1101
  }
1057
1102
  })(), () => {
1058
1103
  e = !1;
1059
1104
  }) : void 0;
1060
1105
  }, [
1061
- O.objectName,
1062
- O.data,
1063
- z,
1064
- O.filters,
1065
- nt,
1066
- I,
1067
- L,
1068
- pt,
1069
- J,
1106
+ E.objectName,
1107
+ E.data,
1108
+ R,
1109
+ E.filters,
1110
+ W,
1111
+ P,
1112
+ F,
1070
1113
  ht,
1071
- Xe,
1072
- N,
1073
- O.searchableFields,
1074
- Mt,
1114
+ Y,
1115
+ _t,
1116
+ Qe,
1117
+ j,
1118
+ E.searchableFields,
1119
+ Pt,
1075
1120
  qe,
1076
- O.refreshTrigger,
1077
- Q
1121
+ E.refreshTrigger,
1122
+ $
1078
1123
  ]);
1079
- let Nt = a.useMemo(() => {
1080
- if (O.appearance?.allowedVisualizations && O.appearance.allowedVisualizations.length > 0) return O.appearance.allowedVisualizations.filter((e) => [
1124
+ let Ft = a.useMemo(() => {
1125
+ if (E.appearance?.allowedVisualizations && E.appearance.allowedVisualizations.length > 0) return E.appearance.allowedVisualizations.filter((e) => [
1081
1126
  "grid",
1082
1127
  "kanban",
1083
1128
  "gallery",
@@ -1087,7 +1132,7 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1087
1132
  "map"
1088
1133
  ].includes(e));
1089
1134
  let e = ["grid"];
1090
- return (O.kanban?.groupField || O.options?.kanban?.groupField) && e.push("kanban"), (O.gallery?.coverField || O.gallery?.imageField || O.options?.gallery?.imageField) && e.push("gallery"), (O.calendar?.startDateField || O.options?.calendar?.startDateField) && e.push("calendar"), (O.timeline?.startDateField || O.options?.timeline?.startDateField || O.options?.timeline?.dateField || O.options?.calendar?.startDateField) && e.push("timeline"), (O.gantt?.startDateField || O.options?.gantt?.startDateField) && e.push("gantt"), (O.options?.map?.locationField || O.options?.map?.latitudeField && O.options?.map?.longitudeField) && e.push("map"), O.viewType && !e.includes(O.viewType) && [
1135
+ return (E.kanban?.groupField || E.options?.kanban?.groupField) && e.push("kanban"), (E.gallery?.coverField || E.gallery?.imageField || E.options?.gallery?.imageField) && e.push("gallery"), (E.calendar?.startDateField || E.options?.calendar?.startDateField) && e.push("calendar"), (E.timeline?.startDateField || E.options?.timeline?.startDateField || E.options?.timeline?.dateField || E.options?.calendar?.startDateField) && e.push("timeline"), (E.gantt?.startDateField || E.options?.gantt?.startDateField) && e.push("gantt"), (E.options?.map?.locationField || E.options?.map?.latitudeField && E.options?.map?.longitudeField) && e.push("map"), E.viewType && !e.includes(E.viewType) && [
1091
1136
  "grid",
1092
1137
  "kanban",
1093
1138
  "calendar",
@@ -1095,45 +1140,45 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1095
1140
  "gantt",
1096
1141
  "map",
1097
1142
  "gallery"
1098
- ].includes(O.viewType) && e.push(O.viewType), e;
1143
+ ].includes(E.viewType) && e.push(E.viewType), e;
1099
1144
  }, [
1100
- O.options,
1101
- O.viewType,
1102
- O.kanban,
1103
- O.calendar,
1104
- O.gantt,
1105
- O.gallery,
1106
- O.timeline,
1107
- O.appearance?.allowedVisualizations
1145
+ E.options,
1146
+ E.viewType,
1147
+ E.kanban,
1148
+ E.calendar,
1149
+ E.gantt,
1150
+ E.gallery,
1151
+ E.timeline,
1152
+ E.appearance?.allowedVisualizations
1108
1153
  ]);
1109
1154
  a.useEffect(() => {
1110
- O.viewType && pe(O.viewType);
1111
- }, [O.viewType]);
1112
- let Pt = a.useCallback((e) => {
1113
- pe(e);
1155
+ E.viewType && se(E.viewType);
1156
+ }, [E.viewType]);
1157
+ let It = a.useCallback((e) => {
1158
+ se(e);
1114
1159
  try {
1115
- localStorage.setItem(jt, e);
1160
+ localStorage.setItem(Nt, e);
1116
1161
  } catch (e) {
1117
1162
  console.warn("Failed to save view preference to localStorage:", e);
1118
1163
  }
1119
1164
  o?.(e);
1120
- }, [jt, o]), Ft = a.useCallback((e) => {
1121
- ye(e), l?.(e);
1122
- }, [l]), It = Ee({
1123
- navigation: O.navigation,
1124
- objectName: O.objectName,
1125
- onNavigate: O.onNavigate,
1165
+ }, [Nt, o]), Lt = a.useCallback((e) => {
1166
+ ue(e), l?.(e);
1167
+ }, [l]), Rt = Me({
1168
+ navigation: E.navigation,
1169
+ objectName: E.objectName,
1170
+ onNavigate: E.onNavigate,
1126
1171
  onRowClick: p
1127
- }), $ = a.useMemo(() => {
1128
- let e = O.fields || [];
1129
- if (Array.isArray(e) || (e = []), Q?.isLoaded && O.objectName && (e = e.filter((e) => {
1172
+ }), zt = a.useMemo(() => {
1173
+ let e = E.fields || [];
1174
+ if (Array.isArray(e) || (e = []), $?.isLoaded && E.objectName && (e = e.filter((e) => {
1130
1175
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1131
- return t ? Q.checkField(O.objectName, t, "read") : !0;
1132
- })), q.size > 0 && (e = e.filter((e) => {
1176
+ return t ? $.checkField(E.objectName, t, "read") : !0;
1177
+ })), J.size > 0 && (e = e.filter((e) => {
1133
1178
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1134
- return t != null && !q.has(t);
1135
- })), O.fieldOrder && O.fieldOrder.length > 0) {
1136
- let t = new Map(O.fieldOrder.map((e, t) => [e, t]));
1179
+ return t != null && !J.has(t);
1180
+ })), E.fieldOrder && E.fieldOrder.length > 0) {
1181
+ let t = new Map(E.fieldOrder.map((e, t) => [e, t]));
1137
1182
  e = [...e].sort((e, n) => {
1138
1183
  let r = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field, i = typeof n == "string" ? n : n?.name || n?.fieldName || n?.field;
1139
1184
  return (t.get(r) ?? Infinity) - (t.get(i) ?? Infinity);
@@ -1141,131 +1186,131 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1141
1186
  }
1142
1187
  return e;
1143
1188
  }, [
1144
- O.fields,
1145
- O.objectName,
1146
- q,
1147
- O.fieldOrder,
1148
- Q
1149
- ]), Lt = a.useMemo(() => {
1150
- let e = X.mode === "compact" ? "compact" : X.mode === "spacious" ? "tall" : "medium", t = {
1151
- objectName: O.objectName,
1152
- fields: $,
1153
- filters: O.filters,
1154
- sort: I,
1189
+ E.fields,
1190
+ E.objectName,
1191
+ J,
1192
+ E.fieldOrder,
1193
+ $
1194
+ ]), Bt = a.useMemo(() => {
1195
+ let e = Z.mode === "compact" ? "compact" : Z.mode === "spacious" ? "tall" : "medium", t = {
1196
+ objectName: E.objectName,
1197
+ fields: zt,
1198
+ filters: E.filters,
1199
+ sort: P,
1155
1200
  className: "h-full w-full",
1156
1201
  showSearch: !1,
1157
- onRowClick: It.handleClick,
1202
+ onRowClick: Rt.handleClick,
1158
1203
  rowHeight: e,
1159
1204
  hideRowHeightToggle: !0,
1160
- ...O.striped == null ? {} : { striped: O.striped },
1161
- ...O.bordered == null ? {} : { bordered: O.bordered },
1205
+ ...E.striped == null ? {} : { striped: E.striped },
1206
+ ...E.bordered == null ? {} : { bordered: E.bordered },
1162
1207
  ...f ? { onColumnStateChange: f } : {},
1163
- ...O.columnState ? { columnState: O.columnState } : {}
1208
+ ...E.columnState ? { columnState: E.columnState } : {}
1164
1209
  };
1165
- switch (j) {
1210
+ switch (A) {
1166
1211
  case "grid": return {
1167
1212
  type: "object-grid",
1168
1213
  ...t,
1169
- columns: $,
1170
- ...O.conditionalFormatting ? { conditionalFormatting: O.conditionalFormatting } : {},
1171
- ...O.inlineEdit == null ? {} : { editable: O.inlineEdit },
1172
- ...O.wrapHeaders == null ? {} : { wrapHeaders: O.wrapHeaders },
1173
- ...O.virtualScroll == null ? {} : { virtualScroll: O.virtualScroll },
1174
- ...O.resizable == null ? {} : { resizable: O.resizable },
1175
- ...O.selection ? { selection: O.selection } : {},
1176
- ...O.pagination ? { pagination: O.pagination } : {},
1177
- ...G ? { grouping: G } : {},
1178
- ...K ? { rowColor: K } : {},
1179
- ...O.rowActions ? { rowActions: O.rowActions } : {},
1180
- ...O.rowActionDefs ? { rowActionDefs: O.rowActionDefs } : {},
1181
- ...O.bulkActions ? { batchActions: O.bulkActions } : {},
1182
- ...O.bulkActionDefs ? { bulkActionDefs: O.bulkActionDefs } : {},
1183
- ...O.options?.grid || {}
1214
+ columns: zt,
1215
+ ...E.conditionalFormatting ? { conditionalFormatting: E.conditionalFormatting } : {},
1216
+ ...E.inlineEdit == null ? {} : { editable: E.inlineEdit },
1217
+ ...E.wrapHeaders == null ? {} : { wrapHeaders: E.wrapHeaders },
1218
+ ...E.virtualScroll == null ? {} : { virtualScroll: E.virtualScroll },
1219
+ ...E.resizable == null ? {} : { resizable: E.resizable },
1220
+ ...E.selection ? { selection: E.selection } : {},
1221
+ ...E.pagination ? { pagination: E.pagination } : {},
1222
+ ...K ? { grouping: K } : {},
1223
+ ...q ? { rowColor: q } : {},
1224
+ ...E.rowActions ? { rowActions: E.rowActions } : {},
1225
+ ...E.rowActionDefs ? { rowActionDefs: E.rowActionDefs } : {},
1226
+ ...E.bulkActions ? { batchActions: E.bulkActions } : {},
1227
+ ...E.bulkActionDefs ? { bulkActionDefs: E.bulkActionDefs } : {},
1228
+ ...E.options?.grid || {}
1184
1229
  };
1185
1230
  case "kanban": return {
1186
1231
  type: "object-kanban",
1187
1232
  ...t,
1188
- groupBy: O.kanban?.groupField || O.options?.kanban?.groupField || "status",
1189
- groupField: O.kanban?.groupField || O.options?.kanban?.groupField || "status",
1190
- ...O.kanban?.titleField || O.options?.kanban?.titleField ? { titleField: O.kanban?.titleField || O.options?.kanban?.titleField } : {},
1191
- cardFields: O.kanban?.cardFields || $ || [],
1192
- ...G ? { grouping: G } : {},
1193
- ...O.options?.kanban || {},
1194
- ...O.kanban || {}
1233
+ groupBy: E.kanban?.groupField || E.options?.kanban?.groupField || "status",
1234
+ groupField: E.kanban?.groupField || E.options?.kanban?.groupField || "status",
1235
+ ...E.kanban?.titleField || E.options?.kanban?.titleField ? { titleField: E.kanban?.titleField || E.options?.kanban?.titleField } : {},
1236
+ cardFields: E.kanban?.cardFields || zt || [],
1237
+ ...K ? { grouping: K } : {},
1238
+ ...E.options?.kanban || {},
1239
+ ...E.kanban || {}
1195
1240
  };
1196
1241
  case "calendar": return {
1197
1242
  type: "object-calendar",
1198
1243
  ...t,
1199
- startDateField: O.calendar?.startDateField || O.options?.calendar?.startDateField || "start_date",
1200
- endDateField: O.calendar?.endDateField || O.options?.calendar?.endDateField || "end_date",
1201
- ...O.calendar?.titleField || O.options?.calendar?.titleField ? { titleField: O.calendar?.titleField || O.options?.calendar?.titleField } : {},
1202
- ...O.calendar?.defaultView ? { defaultView: O.calendar.defaultView } : {},
1203
- ...O.options?.calendar || {},
1204
- ...O.calendar || {}
1244
+ startDateField: E.calendar?.startDateField || E.options?.calendar?.startDateField || "start_date",
1245
+ endDateField: E.calendar?.endDateField || E.options?.calendar?.endDateField || "end_date",
1246
+ ...E.calendar?.titleField || E.options?.calendar?.titleField ? { titleField: E.calendar?.titleField || E.options?.calendar?.titleField } : {},
1247
+ ...E.calendar?.defaultView ? { defaultView: E.calendar.defaultView } : {},
1248
+ ...E.options?.calendar || {},
1249
+ ...E.calendar || {}
1205
1250
  };
1206
1251
  case "gallery": {
1207
1252
  let e = {
1208
- ...O.options?.gallery || {},
1209
- ...O.gallery || {},
1210
- cardSize: Z
1253
+ ...E.options?.gallery || {},
1254
+ ...E.gallery || {},
1255
+ cardSize: Q
1211
1256
  };
1212
1257
  return {
1213
1258
  type: "object-gallery",
1214
1259
  ...t,
1215
1260
  gallery: Object.keys(e).length > 0 ? e : void 0,
1216
- imageField: O.gallery?.coverField || O.gallery?.imageField || O.options?.gallery?.imageField,
1217
- titleField: O.gallery?.titleField || O.options?.gallery?.titleField || "name",
1218
- subtitleField: O.gallery?.subtitleField || O.options?.gallery?.subtitleField,
1219
- ...G ? { grouping: G } : {}
1261
+ imageField: E.gallery?.coverField || E.gallery?.imageField || E.options?.gallery?.imageField,
1262
+ titleField: E.gallery?.titleField || E.options?.gallery?.titleField || "name",
1263
+ subtitleField: E.gallery?.subtitleField || E.options?.gallery?.subtitleField,
1264
+ ...K ? { grouping: K } : {}
1220
1265
  };
1221
1266
  }
1222
1267
  case "timeline": {
1223
1268
  let e = {
1224
- ...O.options?.timeline || {},
1225
- ...O.timeline || {}
1269
+ ...E.options?.timeline || {},
1270
+ ...E.timeline || {}
1226
1271
  };
1227
1272
  return {
1228
1273
  type: "object-timeline",
1229
1274
  ...t,
1230
1275
  timeline: Object.keys(e).length > 0 ? e : void 0,
1231
- startDateField: O.timeline?.startDateField || O.options?.timeline?.startDateField || O.options?.timeline?.dateField || "created_at",
1232
- titleField: O.timeline?.titleField || O.options?.timeline?.titleField || "name",
1233
- ...O.timeline?.endDateField ? { endDateField: O.timeline.endDateField } : {},
1234
- ...O.timeline?.groupByField ? { groupByField: O.timeline.groupByField } : {},
1235
- ...O.timeline?.colorField ? { colorField: O.timeline.colorField } : {},
1236
- ...O.timeline?.scale ? { scale: O.timeline.scale } : {}
1276
+ startDateField: E.timeline?.startDateField || E.options?.timeline?.startDateField || E.options?.timeline?.dateField || "created_at",
1277
+ titleField: E.timeline?.titleField || E.options?.timeline?.titleField || "name",
1278
+ ...E.timeline?.endDateField ? { endDateField: E.timeline.endDateField } : {},
1279
+ ...E.timeline?.groupByField ? { groupByField: E.timeline.groupByField } : {},
1280
+ ...E.timeline?.colorField ? { colorField: E.timeline.colorField } : {},
1281
+ ...E.timeline?.scale ? { scale: E.timeline.scale } : {}
1237
1282
  };
1238
1283
  }
1239
1284
  case "gantt": return {
1240
1285
  type: "object-gantt",
1241
1286
  ...t,
1242
- startDateField: O.gantt?.startDateField || O.options?.gantt?.startDateField || "start_date",
1243
- endDateField: O.gantt?.endDateField || O.options?.gantt?.endDateField || "end_date",
1244
- progressField: O.gantt?.progressField || O.options?.gantt?.progressField || "progress",
1245
- dependenciesField: O.gantt?.dependenciesField || O.options?.gantt?.dependenciesField || "dependencies",
1246
- ...O.gantt?.titleField ? { titleField: O.gantt.titleField } : {},
1247
- ...O.options?.gantt || {},
1248
- ...O.gantt || {}
1287
+ startDateField: E.gantt?.startDateField || E.options?.gantt?.startDateField || "start_date",
1288
+ endDateField: E.gantt?.endDateField || E.options?.gantt?.endDateField || "end_date",
1289
+ progressField: E.gantt?.progressField || E.options?.gantt?.progressField || "progress",
1290
+ dependenciesField: E.gantt?.dependenciesField || E.options?.gantt?.dependenciesField || "dependencies",
1291
+ ...E.gantt?.titleField ? { titleField: E.gantt.titleField } : {},
1292
+ ...E.options?.gantt || {},
1293
+ ...E.gantt || {}
1249
1294
  };
1250
1295
  case "map": return {
1251
1296
  type: "object-map",
1252
1297
  ...t,
1253
- locationField: O.options?.map?.locationField || "location",
1254
- ...O.options?.map || {}
1298
+ locationField: E.options?.map?.locationField || "location",
1299
+ ...E.options?.map || {}
1255
1300
  };
1256
1301
  default: return t;
1257
1302
  }
1258
1303
  }, [
1259
- j,
1260
- O,
1261
- I,
1262
- $,
1263
- G,
1304
+ A,
1305
+ E,
1306
+ P,
1307
+ zt,
1264
1308
  K,
1265
- It.handleClick,
1266
- X.mode,
1267
- Z
1268
- ]), Rt = L.conditions && L.conditions.length > 0, zt = a.useMemo(() => {
1309
+ q,
1310
+ Rt.handleClick,
1311
+ Z.mode,
1312
+ Q
1313
+ ]), Vt = F.conditions && F.conditions.length > 0, Ht = a.useMemo(() => {
1269
1314
  let e, t = (e, t) => {
1270
1315
  if (!t) return;
1271
1316
  let n = Array.isArray(t) ? t.map((e) => ({
@@ -1277,17 +1322,17 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1277
1322
  label: t?.label || e,
1278
1323
  ...t
1279
1324
  }));
1280
- return O.objectName ? D(O.objectName, e, n) : n;
1325
+ return E.objectName ? ie(E.objectName, e, n) : n;
1281
1326
  };
1282
1327
  if (e = H?.fields ? Object.entries(H.fields).map(([e, n]) => ({
1283
1328
  value: e,
1284
- label: k(e, n.label || e),
1329
+ label: D(e, n.label || e),
1285
1330
  type: n.type || "text",
1286
1331
  options: t(e, n.options),
1287
1332
  referenceTo: n.reference_to || n.reference,
1288
1333
  displayField: n.display_field || n.reference_field,
1289
1334
  idField: n.id_field
1290
- })) : (O.fields || []).map((e) => {
1335
+ })) : (E.fields || []).map((e) => {
1291
1336
  if (typeof e == "string") return {
1292
1337
  value: e,
1293
1338
  label: e,
@@ -1296,34 +1341,34 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1296
1341
  let n = e.name || e.fieldName;
1297
1342
  return {
1298
1343
  value: n,
1299
- label: k(n, e.label || e.name),
1344
+ label: D(n, e.label || e.name),
1300
1345
  type: e.type || "text",
1301
1346
  options: t(n, e.options),
1302
1347
  referenceTo: e.reference_to || e.reference,
1303
1348
  displayField: e.display_field || e.reference_field,
1304
1349
  idField: e.id_field
1305
1350
  };
1306
- }), O.filterableFields && O.filterableFields.length > 0) {
1307
- let t = new Set(O.filterableFields);
1351
+ }), E.filterableFields && E.filterableFields.length > 0) {
1352
+ let t = new Set(E.filterableFields);
1308
1353
  e = e.filter((e) => t.has(e.value));
1309
1354
  }
1310
1355
  return e;
1311
1356
  }, [
1312
1357
  H,
1313
- O.fields,
1314
- O.filterableFields,
1315
- O.objectName,
1316
- k,
1317
- D
1318
- ]), Bt = a.useCallback((e) => {
1319
- mt((t) => {
1358
+ E.fields,
1359
+ E.filterableFields,
1360
+ E.objectName,
1361
+ D,
1362
+ ie
1363
+ ]), Ut = a.useCallback((e) => {
1364
+ gt((t) => {
1320
1365
  let n = new Set(t);
1321
1366
  return n.has(e) ? n.delete(e) : n.add(e), n;
1322
1367
  });
1323
- }, []), Vt = a.useCallback((e) => {
1324
- let t = Y, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || O.objectName || "export", a = n > 0 ? B.slice(0, n) : B;
1368
+ }, []), Wt = a.useCallback((e) => {
1369
+ let t = X, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || E.objectName || "export", a = n > 0 ? z.slice(0, n) : z;
1325
1370
  if (e === "csv") {
1326
- let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1371
+ let e = zt.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1327
1372
  r && t.push(e.join(",")), a.forEach((n) => {
1328
1373
  t.push(e.map((e) => {
1329
1374
  let t = n[e], r;
@@ -1336,127 +1381,138 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1336
1381
  let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1337
1382
  n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
1338
1383
  }
1339
- wt(!1);
1384
+ Et(!1);
1340
1385
  }, [
1341
- B,
1342
- $,
1343
- Y,
1344
- O.objectName
1345
- ]), Ht = a.useMemo(() => (O.fields || []).map((e) => {
1386
+ z,
1387
+ zt,
1388
+ X,
1389
+ E.objectName
1390
+ ]), Gt = a.useMemo(() => (E.fields || []).map((e) => {
1346
1391
  if (typeof e == "string") return {
1347
1392
  name: e,
1348
- label: k(e, e)
1393
+ label: D(e, e)
1349
1394
  };
1350
1395
  let t = e.name || e.fieldName || e.field;
1351
1396
  return {
1352
1397
  name: t,
1353
- label: k(t, e.label || e.name || e.field)
1398
+ label: D(t, e.label || e.name || e.field)
1354
1399
  };
1355
- }), [O.fields, k]);
1356
- return /* @__PURE__ */ F("div", {
1357
- ref: Ot,
1358
- className: C("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1359
- ...O.aria?.label ? { "aria-label": O.aria.label } : {},
1360
- ...O.aria?.describedBy ? { "aria-describedby": O.aria.describedBy } : {},
1361
- ...O.aria?.live ? { "aria-live": O.aria.live } : {},
1400
+ }), [E.fields, D]);
1401
+ return /* @__PURE__ */ N("div", {
1402
+ ref: At,
1403
+ className: w("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1404
+ ...E.aria?.label ? { "aria-label": E.aria.label } : {},
1405
+ ...E.aria?.describedBy ? { "aria-describedby": E.aria.describedBy } : {},
1406
+ ...E.aria?.live ? { "aria-live": E.aria.live } : {},
1362
1407
  role: "region",
1363
1408
  children: [
1364
- At > 0 && /* @__PURE__ */ P("div", {
1409
+ Mt > 0 && /* @__PURE__ */ M("div", {
1365
1410
  className: "flex items-center justify-center text-xs text-muted-foreground",
1366
- style: { height: At },
1367
- children: E(kt ? "list.refreshing" : "list.pullToRefresh")
1411
+ style: { height: Mt },
1412
+ children: _(jt ? "list.refreshing" : "list.pullToRefresh")
1368
1413
  }),
1369
- _ && /* @__PURE__ */ P("div", {
1414
+ m && /* @__PURE__ */ M("div", {
1370
1415
  className: "px-4 py-1 flex items-center bg-background",
1371
- children: /* @__PURE__ */ P(Ne, {
1372
- currentView: j,
1373
- availableViews: Nt,
1374
- onViewChange: Pt
1416
+ children: /* @__PURE__ */ M(Re, {
1417
+ currentView: A,
1418
+ availableViews: Ft,
1419
+ onViewChange: It
1375
1420
  })
1376
1421
  }),
1377
- O.description && O.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
1422
+ E.description && E.appearance?.showDescription !== !1 && /* @__PURE__ */ M("div", {
1378
1423
  className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
1379
1424
  "data-testid": "view-description",
1380
- children: typeof O.description == "string" ? O.description : ""
1425
+ children: typeof E.description == "string" ? E.description : ""
1381
1426
  }),
1382
- /* @__PURE__ */ F("div", {
1427
+ /* @__PURE__ */ N("div", {
1383
1428
  className: "border-b px-2 sm:px-4 py-1.5 flex items-center justify-between gap-1 sm:gap-2 bg-background",
1384
- children: [/* @__PURE__ */ F("div", {
1429
+ children: [/* @__PURE__ */ N("div", {
1385
1430
  className: "flex items-center gap-2 overflow-x-auto min-w-0",
1386
1431
  children: [
1387
- O.tabs && O.tabs.length > 0 && /* @__PURE__ */ P(Fe, {
1388
- tabs: O.tabs,
1389
- activeTab: Le,
1390
- onTabChange: Be,
1391
- className: "!px-0 !py-0 shrink-0"
1392
- }),
1393
- O.tabs && O.tabs.length > 0 && _t && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
1394
- _t && /* @__PURE__ */ P("div", {
1395
- className: "shrink-0 min-w-0",
1432
+ E.tabs && E.tabs.length > 0 && /* @__PURE__ */ N(Te, { children: [/* @__PURE__ */ M("div", {
1433
+ className: "hidden sm:block shrink-0",
1434
+ children: /* @__PURE__ */ M(Ve, {
1435
+ tabs: E.tabs,
1436
+ activeTab: ze,
1437
+ onTabChange: L,
1438
+ className: "!px-0 !py-0"
1439
+ })
1440
+ }), /* @__PURE__ */ M("div", {
1441
+ className: "sm:hidden shrink-0",
1442
+ children: /* @__PURE__ */ M(He, {
1443
+ tabs: E.tabs,
1444
+ activeTab: ze,
1445
+ onTabChange: L,
1446
+ className: "!px-0 !py-0"
1447
+ })
1448
+ })] }),
1449
+ E.tabs && E.tabs.length > 0 && yt && /* @__PURE__ */ M("div", { className: "hidden sm:block h-4 w-px bg-border/60 mx-1 shrink-0" }),
1450
+ yt && /* @__PURE__ */ M("div", {
1451
+ className: "shrink-0 min-w-0 overflow-x-auto",
1396
1452
  "data-testid": "user-filters",
1397
- children: /* @__PURE__ */ P(ze, {
1398
- config: _t,
1453
+ children: /* @__PURE__ */ M(We, {
1454
+ config: yt,
1399
1455
  objectDef: H,
1400
- data: B,
1401
- onFilterChange: gt,
1456
+ data: z,
1457
+ onFilterChange: vt,
1402
1458
  maxVisible: 3
1403
1459
  })
1404
1460
  })
1405
1461
  ]
1406
- }), /* @__PURE__ */ F("div", {
1462
+ }), /* @__PURE__ */ N("div", {
1407
1463
  className: "flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm",
1408
1464
  children: [
1409
- A.showHideFields && !A.compactToolbar && /* @__PURE__ */ F(y, {
1410
- open: xt,
1411
- onOpenChange: St,
1412
- children: [/* @__PURE__ */ P(x, {
1465
+ O.showHideFields && !O.compactToolbar && /* @__PURE__ */ N(x, {
1466
+ open: Ct,
1467
+ onOpenChange: wt,
1468
+ children: [/* @__PURE__ */ M(C, {
1413
1469
  asChild: !0,
1414
- children: /* @__PURE__ */ F(d, {
1470
+ children: /* @__PURE__ */ N(d, {
1415
1471
  variant: "ghost",
1416
1472
  size: "sm",
1417
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q.size > 0 && "text-primary"),
1473
+ className: w("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J.size > 0 && "text-primary"),
1418
1474
  children: [
1419
- /* @__PURE__ */ P(ie, { className: "h-3.5 w-3.5 mr-1.5" }),
1420
- /* @__PURE__ */ P("span", {
1475
+ /* @__PURE__ */ M(oe, { className: "h-3.5 w-3.5 mr-1.5" }),
1476
+ /* @__PURE__ */ M("span", {
1421
1477
  className: "hidden sm:inline",
1422
- children: E("list.hideFields")
1478
+ children: _("list.hideFields")
1423
1479
  }),
1424
- q.size > 0 && /* @__PURE__ */ P("span", {
1480
+ J.size > 0 && /* @__PURE__ */ M("span", {
1425
1481
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1426
- children: q.size
1482
+ children: J.size
1427
1483
  })
1428
1484
  ]
1429
1485
  })
1430
- }), /* @__PURE__ */ P(b, {
1486
+ }), /* @__PURE__ */ M(S, {
1431
1487
  align: "start",
1432
1488
  className: "w-64 p-3",
1433
- children: /* @__PURE__ */ F("div", {
1489
+ children: /* @__PURE__ */ N("div", {
1434
1490
  className: "space-y-2",
1435
- children: [/* @__PURE__ */ F("div", {
1491
+ children: [/* @__PURE__ */ N("div", {
1436
1492
  className: "flex items-center justify-between border-b pb-2",
1437
- children: [/* @__PURE__ */ P("h4", {
1493
+ children: [/* @__PURE__ */ M("h4", {
1438
1494
  className: "font-medium text-sm",
1439
- children: E("list.hideFieldsTitle")
1440
- }), q.size > 0 && /* @__PURE__ */ P(d, {
1495
+ children: _("list.hideFieldsTitle")
1496
+ }), J.size > 0 && /* @__PURE__ */ M(d, {
1441
1497
  variant: "ghost",
1442
1498
  size: "sm",
1443
1499
  className: "h-6 px-2 text-xs",
1444
- onClick: () => bt(/* @__PURE__ */ new Set()),
1445
- children: E("list.showAll")
1500
+ onClick: () => St(/* @__PURE__ */ new Set()),
1501
+ children: _("list.showAll")
1446
1502
  })]
1447
- }), /* @__PURE__ */ P("div", {
1503
+ }), /* @__PURE__ */ M("div", {
1448
1504
  className: "max-h-60 overflow-y-auto space-y-1",
1449
- children: Ht.map((e) => /* @__PURE__ */ F("label", {
1505
+ children: Gt.map((e) => /* @__PURE__ */ N("label", {
1450
1506
  className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
1451
- children: [/* @__PURE__ */ P("input", {
1507
+ children: [/* @__PURE__ */ M("input", {
1452
1508
  type: "checkbox",
1453
- checked: !q.has(e.name),
1509
+ checked: !J.has(e.name),
1454
1510
  onChange: () => {
1455
- let t = new Set(q);
1456
- t.has(e.name) ? t.delete(e.name) : t.add(e.name), bt(t);
1511
+ let t = new Set(J);
1512
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), St(t);
1457
1513
  },
1458
1514
  className: "rounded border-input"
1459
- }), /* @__PURE__ */ P("span", {
1515
+ }), /* @__PURE__ */ M("span", {
1460
1516
  className: "truncate",
1461
1517
  children: e.label
1462
1518
  })]
@@ -1465,143 +1521,143 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1465
1521
  })
1466
1522
  })]
1467
1523
  }),
1468
- A.showHideFields && !A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1469
- A.showFilters && /* @__PURE__ */ F(y, {
1470
- open: Me,
1471
- onOpenChange: Pe,
1472
- children: [/* @__PURE__ */ P(x, {
1524
+ O.showHideFields && !O.compactToolbar && (O.showFilters || O.showSort || O.showGroup) && /* @__PURE__ */ M("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
1525
+ O.showFilters && /* @__PURE__ */ N(x, {
1526
+ open: Ie,
1527
+ onOpenChange: Le,
1528
+ children: [/* @__PURE__ */ M(C, {
1473
1529
  asChild: !0,
1474
- children: /* @__PURE__ */ F(d, {
1530
+ children: /* @__PURE__ */ N(d, {
1475
1531
  variant: "ghost",
1476
1532
  size: "sm",
1477
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Rt && "text-foreground font-medium"),
1533
+ className: w("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Vt && "text-foreground font-medium"),
1478
1534
  children: [
1479
- /* @__PURE__ */ P(he, { className: "h-3.5 w-3.5 mr-1.5" }),
1480
- /* @__PURE__ */ P("span", {
1535
+ /* @__PURE__ */ M(xe, { className: "h-3.5 w-3.5 mr-1.5" }),
1536
+ /* @__PURE__ */ M("span", {
1481
1537
  className: "hidden sm:inline",
1482
- children: E("list.filter")
1538
+ children: _("list.filter")
1483
1539
  }),
1484
- Rt && /* @__PURE__ */ P("span", {
1540
+ Vt && /* @__PURE__ */ M("span", {
1485
1541
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1486
- children: L.conditions?.length || 0
1542
+ children: F.conditions?.length || 0
1487
1543
  })
1488
1544
  ]
1489
1545
  })
1490
- }), /* @__PURE__ */ P(b, {
1546
+ }), /* @__PURE__ */ M(S, {
1491
1547
  align: "start",
1492
1548
  className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
1493
- children: /* @__PURE__ */ F("div", {
1549
+ children: /* @__PURE__ */ N("div", {
1494
1550
  className: "space-y-4",
1495
- children: [/* @__PURE__ */ P("div", {
1551
+ children: [/* @__PURE__ */ M("div", {
1496
1552
  className: "flex items-center justify-between border-b pb-2",
1497
- children: /* @__PURE__ */ P("h4", {
1553
+ children: /* @__PURE__ */ M("h4", {
1498
1554
  className: "font-medium text-sm",
1499
- children: E("list.filterRecords")
1555
+ children: _("list.filterRecords")
1500
1556
  })
1501
- }), /* @__PURE__ */ P(m, {
1502
- fields: zt,
1503
- value: L,
1557
+ }), /* @__PURE__ */ M(v, {
1558
+ fields: Ht,
1559
+ value: F,
1504
1560
  onChange: (e) => {
1505
- R(e), s && s(e);
1561
+ I(e), s && s(e);
1506
1562
  }
1507
1563
  })]
1508
1564
  })
1509
1565
  })]
1510
1566
  }),
1511
- A.showGroup && !A.compactToolbar && /* @__PURE__ */ F(y, {
1512
- open: it,
1513
- onOpenChange: at,
1514
- children: [/* @__PURE__ */ P(x, {
1567
+ O.showGroup && !O.compactToolbar && /* @__PURE__ */ N(x, {
1568
+ open: ot,
1569
+ onOpenChange: st,
1570
+ children: [/* @__PURE__ */ M(C, {
1515
1571
  asChild: !0,
1516
- children: /* @__PURE__ */ F(d, {
1572
+ children: /* @__PURE__ */ N(d, {
1517
1573
  variant: "ghost",
1518
1574
  size: "sm",
1519
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", G && "text-foreground font-medium"),
1575
+ className: w("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", K && "text-foreground font-medium"),
1520
1576
  children: [
1521
- /* @__PURE__ */ P(ae, { className: "h-3.5 w-3.5 mr-1.5" }),
1522
- /* @__PURE__ */ P("span", {
1577
+ /* @__PURE__ */ M(ce, { className: "h-3.5 w-3.5 mr-1.5" }),
1578
+ /* @__PURE__ */ M("span", {
1523
1579
  className: "hidden sm:inline",
1524
- children: E("list.group")
1580
+ children: _("list.group")
1525
1581
  }),
1526
- G && G.fields?.length > 0 && /* @__PURE__ */ P("span", {
1582
+ K && K.fields?.length > 0 && /* @__PURE__ */ M("span", {
1527
1583
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1528
- children: G.fields.length
1584
+ children: K.fields.length
1529
1585
  })
1530
1586
  ]
1531
1587
  })
1532
- }), /* @__PURE__ */ P(b, {
1588
+ }), /* @__PURE__ */ M(S, {
1533
1589
  align: "start",
1534
1590
  className: "w-72 p-3",
1535
- children: /* @__PURE__ */ F("div", {
1591
+ children: /* @__PURE__ */ N("div", {
1536
1592
  className: "space-y-2",
1537
- children: [/* @__PURE__ */ F("div", {
1593
+ children: [/* @__PURE__ */ N("div", {
1538
1594
  className: "flex items-center justify-between border-b pb-2",
1539
- children: [/* @__PURE__ */ P("h4", {
1595
+ children: [/* @__PURE__ */ M("h4", {
1540
1596
  className: "font-medium text-sm",
1541
- children: E("list.groupBy")
1542
- }), G && /* @__PURE__ */ P(d, {
1597
+ children: _("list.groupBy")
1598
+ }), K && /* @__PURE__ */ M(d, {
1543
1599
  variant: "ghost",
1544
1600
  size: "sm",
1545
1601
  className: "h-6 px-2 text-xs",
1546
- onClick: () => rt(void 0),
1602
+ onClick: () => at(void 0),
1547
1603
  "data-testid": "clear-grouping",
1548
- children: E("list.clear")
1604
+ children: _("list.clear")
1549
1605
  })]
1550
- }), /* @__PURE__ */ P("div", {
1606
+ }), /* @__PURE__ */ M("div", {
1551
1607
  "data-testid": "group-field-list",
1552
- children: /* @__PURE__ */ P(h, {
1553
- value: G,
1554
- fieldOptions: Ht.map((e) => ({
1608
+ children: /* @__PURE__ */ M(ee, {
1609
+ value: K,
1610
+ fieldOptions: Gt.map((e) => ({
1555
1611
  value: e.name,
1556
1612
  label: e.label || e.name
1557
1613
  })),
1558
1614
  maxLevels: 3,
1559
1615
  labels: {
1560
- addGroup: E("list.addGroup", { defaultValue: "Add group field" }),
1561
- collapseTitle: E("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
1562
- removeTitle: E("list.removeGroup", { defaultValue: "Remove" })
1616
+ addGroup: _("list.addGroup", { defaultValue: "Add group field" }),
1617
+ collapseTitle: _("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
1618
+ removeTitle: _("list.removeGroup", { defaultValue: "Remove" })
1563
1619
  },
1564
- onChange: (e) => rt(e)
1620
+ onChange: (e) => at(e)
1565
1621
  })
1566
1622
  })]
1567
1623
  })
1568
1624
  })]
1569
1625
  }),
1570
- A.showSort && /* @__PURE__ */ F(y, {
1571
- open: we,
1626
+ O.showSort && /* @__PURE__ */ N(x, {
1627
+ open: Ee,
1572
1628
  onOpenChange: De,
1573
- children: [/* @__PURE__ */ P(x, {
1629
+ children: [/* @__PURE__ */ M(C, {
1574
1630
  asChild: !0,
1575
- children: /* @__PURE__ */ F(d, {
1631
+ children: /* @__PURE__ */ N(d, {
1576
1632
  variant: "ghost",
1577
1633
  size: "sm",
1578
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I.length > 0 && "text-foreground font-medium"),
1634
+ className: w("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", P.length > 0 && "text-foreground font-medium"),
1579
1635
  children: [
1580
- /* @__PURE__ */ P(T, { className: "h-3.5 w-3.5 mr-1.5" }),
1581
- /* @__PURE__ */ P("span", {
1636
+ /* @__PURE__ */ M(T, { className: "h-3.5 w-3.5 mr-1.5" }),
1637
+ /* @__PURE__ */ M("span", {
1582
1638
  className: "hidden sm:inline",
1583
- children: E("list.sort")
1639
+ children: _("list.sort")
1584
1640
  }),
1585
- I.length > 0 && /* @__PURE__ */ P("span", {
1641
+ P.length > 0 && /* @__PURE__ */ M("span", {
1586
1642
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1587
- children: I.length
1643
+ children: P.length
1588
1644
  })
1589
1645
  ]
1590
1646
  })
1591
- }), /* @__PURE__ */ P(b, {
1647
+ }), /* @__PURE__ */ M(S, {
1592
1648
  align: "start",
1593
1649
  className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
1594
- children: /* @__PURE__ */ F("div", {
1650
+ children: /* @__PURE__ */ N("div", {
1595
1651
  className: "space-y-4",
1596
- children: [/* @__PURE__ */ P("div", {
1652
+ children: [/* @__PURE__ */ M("div", {
1597
1653
  className: "flex items-center justify-between border-b pb-2",
1598
- children: /* @__PURE__ */ P("h4", {
1654
+ children: /* @__PURE__ */ M("h4", {
1599
1655
  className: "font-medium text-sm",
1600
- children: E("list.sortRecords")
1656
+ children: _("list.sortRecords")
1601
1657
  })
1602
- }), /* @__PURE__ */ P(S, {
1603
- fields: zt,
1604
- value: I,
1658
+ }), /* @__PURE__ */ M(re, {
1659
+ fields: Ht,
1660
+ value: P,
1605
1661
  onChange: (e) => {
1606
1662
  Ae(e), c && c(e);
1607
1663
  }
@@ -1609,60 +1665,60 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1609
1665
  })
1610
1666
  })]
1611
1667
  }),
1612
- !A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && (A.showColor || A.showDensity) && /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1613
- A.showColor && !A.compactToolbar && /* @__PURE__ */ F(y, {
1614
- open: ct,
1615
- onOpenChange: lt,
1616
- children: [/* @__PURE__ */ P(x, {
1668
+ !O.compactToolbar && (O.showFilters || O.showSort || O.showGroup) && (O.showColor || O.showDensity) && /* @__PURE__ */ M("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
1669
+ O.showColor && !O.compactToolbar && /* @__PURE__ */ N(x, {
1670
+ open: ut,
1671
+ onOpenChange: dt,
1672
+ children: [/* @__PURE__ */ M(C, {
1617
1673
  asChild: !0,
1618
- children: /* @__PURE__ */ F(d, {
1674
+ children: /* @__PURE__ */ N(d, {
1619
1675
  variant: "ghost",
1620
1676
  size: "sm",
1621
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", K && "text-foreground font-medium"),
1622
- children: [/* @__PURE__ */ P(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1677
+ className: w("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q && "text-foreground font-medium"),
1678
+ children: [/* @__PURE__ */ M(fe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1623
1679
  className: "hidden sm:inline",
1624
- children: E("list.color")
1680
+ children: _("list.color")
1625
1681
  })]
1626
1682
  })
1627
- }), /* @__PURE__ */ P(b, {
1683
+ }), /* @__PURE__ */ M(S, {
1628
1684
  align: "start",
1629
1685
  className: "w-64 p-3",
1630
- children: /* @__PURE__ */ F("div", {
1686
+ children: /* @__PURE__ */ N("div", {
1631
1687
  className: "space-y-2",
1632
- children: [/* @__PURE__ */ F("div", {
1688
+ children: [/* @__PURE__ */ N("div", {
1633
1689
  className: "flex items-center justify-between border-b pb-2",
1634
- children: [/* @__PURE__ */ P("h4", {
1690
+ children: [/* @__PURE__ */ M("h4", {
1635
1691
  className: "font-medium text-sm",
1636
- children: E("list.rowColor")
1637
- }), K && /* @__PURE__ */ P(d, {
1692
+ children: _("list.rowColor")
1693
+ }), q && /* @__PURE__ */ M(d, {
1638
1694
  variant: "ghost",
1639
1695
  size: "sm",
1640
1696
  className: "h-6 px-2 text-xs",
1641
- onClick: () => st(void 0),
1697
+ onClick: () => lt(void 0),
1642
1698
  "data-testid": "clear-row-color",
1643
- children: E("list.clear")
1699
+ children: _("list.clear")
1644
1700
  })]
1645
- }), /* @__PURE__ */ F("div", {
1701
+ }), /* @__PURE__ */ N("div", {
1646
1702
  className: "space-y-2",
1647
1703
  "data-testid": "color-field-list",
1648
- children: [/* @__PURE__ */ P("label", {
1704
+ children: [/* @__PURE__ */ M("label", {
1649
1705
  className: "text-xs text-muted-foreground",
1650
- children: E("list.colorByField")
1651
- }), /* @__PURE__ */ F("select", {
1706
+ children: _("list.colorByField")
1707
+ }), /* @__PURE__ */ N("select", {
1652
1708
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
1653
- value: K?.field || "",
1709
+ value: q?.field || "",
1654
1710
  onChange: (e) => {
1655
1711
  let t = e.target.value;
1656
- st(t ? {
1712
+ lt(t ? {
1657
1713
  field: t,
1658
- colors: K?.colors || {}
1714
+ colors: q?.colors || {}
1659
1715
  } : void 0);
1660
1716
  },
1661
1717
  "data-testid": "color-field-select",
1662
- children: [/* @__PURE__ */ P("option", {
1718
+ children: [/* @__PURE__ */ M("option", {
1663
1719
  value: "",
1664
- children: E("list.none")
1665
- }), Ht.map((e) => /* @__PURE__ */ P("option", {
1720
+ children: _("list.none")
1721
+ }), Gt.map((e) => /* @__PURE__ */ M("option", {
1666
1722
  value: e.name,
1667
1723
  children: e.label
1668
1724
  }, e.name))]
@@ -1671,286 +1727,306 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1671
1727
  })
1672
1728
  })]
1673
1729
  }),
1674
- A.showDensity && !A.compactToolbar && j !== "gallery" && (() => {
1675
- let e = X.mode === "compact" ? de : X.mode === "comfortable" ? ue : le, t = X.mode === "compact" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : X.mode === "comfortable" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
1730
+ O.showDensity && !O.compactToolbar && A !== "gallery" && (() => {
1731
+ let e = Z.mode === "compact" ? _e : Z.mode === "comfortable" ? ge : he, t = Z.mode === "compact" ? _("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Z.mode === "comfortable" ? _("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : _("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${_("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = _("grid.toolbar.densityCycleHint", {
1676
1732
  defaultValue: "{{label}} (click to cycle)",
1677
1733
  label: n
1678
1734
  });
1679
- return /* @__PURE__ */ P(d, {
1735
+ return /* @__PURE__ */ M(d, {
1680
1736
  variant: "ghost",
1681
1737
  size: "sm",
1682
1738
  "aria-label": n,
1683
- className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", X.mode !== "compact" && "text-foreground font-medium"),
1684
- onClick: X.cycle,
1739
+ className: w("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Z.mode !== "compact" && "text-foreground font-medium"),
1740
+ onClick: Z.cycle,
1685
1741
  title: r,
1686
- children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
1742
+ children: /* @__PURE__ */ M(e, { className: "h-3.5 w-3.5" })
1687
1743
  });
1688
1744
  })(),
1689
- A.showDensity && !A.compactToolbar && j === "gallery" && (() => {
1690
- let e = Z === "small" ? de : Z === "medium" ? ue : le, t = Z === "small" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Z === "medium" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
1745
+ O.showDensity && !O.compactToolbar && A === "gallery" && (() => {
1746
+ let e = Q === "small" ? _e : Q === "medium" ? ge : he, t = Q === "small" ? _("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Q === "medium" ? _("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : _("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${_("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = _("grid.toolbar.densityCycleHint", {
1691
1747
  defaultValue: "{{label}} (click to cycle)",
1692
1748
  label: n
1693
1749
  });
1694
- return /* @__PURE__ */ P(d, {
1750
+ return /* @__PURE__ */ M(d, {
1695
1751
  variant: "ghost",
1696
1752
  size: "sm",
1697
1753
  "aria-label": n,
1698
- className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Z !== "small" && "text-foreground font-medium"),
1699
- onClick: Dt,
1754
+ className: w("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Q !== "small" && "text-foreground font-medium"),
1755
+ onClick: kt,
1700
1756
  title: r,
1701
- children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
1757
+ children: /* @__PURE__ */ M(e, { className: "h-3.5 w-3.5" })
1702
1758
  });
1703
1759
  })(),
1704
- A.compactToolbar && (A.showGroup || A.showColor || A.showDensity || A.showHideFields) && /* @__PURE__ */ P(Ie, {
1705
- t: E,
1706
- allFields: Ht,
1707
- showGroup: A.showGroup,
1708
- groupingConfig: G,
1709
- setGroupingConfig: rt,
1710
- showColor: A.showColor,
1711
- rowColorConfig: K,
1712
- setRowColorConfig: st,
1713
- showDensity: A.showDensity,
1714
- density: X,
1715
- showHideFields: A.showHideFields,
1716
- hiddenFields: q,
1717
- updateHiddenFields: bt
1760
+ O.compactToolbar && (O.showGroup || O.showColor || O.showDensity || O.showHideFields) && /* @__PURE__ */ M(Ue, {
1761
+ t: _,
1762
+ allFields: Gt,
1763
+ showGroup: O.showGroup,
1764
+ groupingConfig: K,
1765
+ setGroupingConfig: at,
1766
+ showColor: O.showColor,
1767
+ rowColorConfig: q,
1768
+ setRowColorConfig: lt,
1769
+ showDensity: O.showDensity,
1770
+ density: Z,
1771
+ showHideFields: O.showHideFields,
1772
+ hiddenFields: J,
1773
+ updateHiddenFields: St
1718
1774
  }),
1719
- (A.showColor || A.showDensity || A.compactToolbar) && Y && O.allowExport !== !1 && /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1720
- Y && O.allowExport !== !1 && /* @__PURE__ */ F(y, {
1721
- open: Ct,
1722
- onOpenChange: wt,
1723
- children: [/* @__PURE__ */ P(x, {
1775
+ (O.showColor || O.showDensity || O.compactToolbar) && X && E.allowExport !== !1 && /* @__PURE__ */ M("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1776
+ X && E.allowExport !== !1 && /* @__PURE__ */ N(x, {
1777
+ open: Tt,
1778
+ onOpenChange: Et,
1779
+ children: [/* @__PURE__ */ M(C, {
1724
1780
  asChild: !0,
1725
- children: /* @__PURE__ */ F(d, {
1781
+ children: /* @__PURE__ */ N(d, {
1726
1782
  variant: "ghost",
1727
1783
  size: "sm",
1728
1784
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1729
- children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1785
+ children: [/* @__PURE__ */ M(k, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1730
1786
  className: "hidden sm:inline",
1731
- children: E("list.export")
1787
+ children: _("list.export")
1732
1788
  })]
1733
1789
  })
1734
- }), /* @__PURE__ */ P(b, {
1790
+ }), /* @__PURE__ */ M(S, {
1735
1791
  align: "start",
1736
1792
  className: "w-48 p-2",
1737
- children: /* @__PURE__ */ P("div", {
1793
+ children: /* @__PURE__ */ M("div", {
1738
1794
  className: "space-y-1",
1739
- children: (Y.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
1795
+ children: (X.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ N(d, {
1740
1796
  variant: "ghost",
1741
1797
  size: "sm",
1742
1798
  className: "w-full justify-start h-8 text-xs",
1743
- onClick: () => Vt(e),
1744
- children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-2" }), E("list.exportAs", { format: e.toUpperCase() })]
1799
+ onClick: () => Wt(e),
1800
+ children: [/* @__PURE__ */ M(k, { className: "h-3.5 w-3.5 mr-2" }), _("list.exportAs", { format: e.toUpperCase() })]
1745
1801
  }, e))
1746
1802
  })
1747
1803
  })]
1748
1804
  }),
1749
- (O.sharing?.enabled || O.sharing?.type) && /* @__PURE__ */ F(d, {
1805
+ (E.sharing?.enabled || E.sharing?.type) && /* @__PURE__ */ N(d, {
1750
1806
  variant: "ghost",
1751
1807
  size: "sm",
1752
1808
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1753
- title: `Sharing: ${O.sharing?.visibility || O.sharing?.type || "private"}`,
1809
+ title: `Sharing: ${E.sharing?.visibility || E.sharing?.type || "private"}`,
1754
1810
  "data-testid": "share-button",
1755
- children: [/* @__PURE__ */ P(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1811
+ children: [/* @__PURE__ */ M(be, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1756
1812
  className: "hidden sm:inline",
1757
- children: E("list.share")
1813
+ children: _("list.share")
1758
1814
  })]
1759
1815
  }),
1760
- O.allowPrinting && /* @__PURE__ */ F(d, {
1816
+ E.allowPrinting && /* @__PURE__ */ N(d, {
1761
1817
  variant: "ghost",
1762
1818
  size: "sm",
1763
1819
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1764
1820
  onClick: () => window.print(),
1765
1821
  "data-testid": "print-button",
1766
- children: [/* @__PURE__ */ P(ce, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1822
+ children: [/* @__PURE__ */ M(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1767
1823
  className: "hidden sm:inline",
1768
- children: E("list.print")
1824
+ children: _("list.print")
1769
1825
  })]
1770
1826
  }),
1771
1827
  (() => {
1772
- let e = O.allowPrinting || O.sharing?.enabled || O.sharing?.type || Y && O.allowExport !== !1;
1773
- return A.showSearch && e ? /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }) : null;
1828
+ let e = E.allowPrinting || E.sharing?.enabled || E.sharing?.type || X && E.allowExport !== !1;
1829
+ return O.showSearch && e ? /* @__PURE__ */ M("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }) : null;
1774
1830
  })(),
1775
- A.showSearch && /* @__PURE__ */ F(y, {
1776
- open: be,
1777
- onOpenChange: Ce,
1778
- children: [/* @__PURE__ */ P(x, {
1831
+ O.showSearch && /* @__PURE__ */ N(x, {
1832
+ open: de,
1833
+ onOpenChange: ye,
1834
+ children: [/* @__PURE__ */ M(C, {
1779
1835
  asChild: !0,
1780
- children: /* @__PURE__ */ P(d, {
1836
+ children: /* @__PURE__ */ M(d, {
1781
1837
  variant: "ghost",
1782
1838
  size: "sm",
1783
- className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", N && "text-foreground font-medium"),
1839
+ className: w("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", j && "text-foreground font-medium"),
1784
1840
  "data-testid": "search-icon-button",
1785
- title: E("list.search"),
1786
- children: /* @__PURE__ */ P(fe, { className: "h-3.5 w-3.5" })
1841
+ title: _("list.search"),
1842
+ children: /* @__PURE__ */ M(ve, { className: "h-3.5 w-3.5" })
1787
1843
  })
1788
- }), /* @__PURE__ */ P(b, {
1844
+ }), /* @__PURE__ */ M(S, {
1789
1845
  align: "end",
1790
1846
  className: "w-[calc(100vw-2rem)] sm:w-64 p-2",
1791
1847
  "data-testid": "search-popover",
1792
- children: /* @__PURE__ */ F("div", {
1848
+ children: /* @__PURE__ */ N("div", {
1793
1849
  className: "relative",
1794
1850
  children: [
1795
- /* @__PURE__ */ P(fe, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1796
- /* @__PURE__ */ P(g, {
1797
- placeholder: E("list.search") + "...",
1798
- value: N,
1799
- onChange: (e) => Ft(e.target.value),
1851
+ /* @__PURE__ */ M(ve, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1852
+ /* @__PURE__ */ M(y, {
1853
+ placeholder: _("list.search") + "...",
1854
+ value: j,
1855
+ onChange: (e) => Lt(e.target.value),
1800
1856
  className: "pl-7 h-8 text-xs",
1801
1857
  autoFocus: !0
1802
1858
  }),
1803
- N && /* @__PURE__ */ P(d, {
1859
+ j && /* @__PURE__ */ M(d, {
1804
1860
  variant: "ghost",
1805
1861
  size: "sm",
1806
1862
  className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20",
1807
- onClick: () => Ft(""),
1808
- children: /* @__PURE__ */ P(_e, { className: "h-3 w-3" })
1863
+ onClick: () => Lt(""),
1864
+ children: /* @__PURE__ */ M(Ce, { className: "h-3 w-3" })
1809
1865
  })
1810
1866
  ]
1811
1867
  })
1812
1868
  })]
1813
1869
  }),
1814
- A.showAddRecord && A.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
1870
+ O.showAddRecord && O.addRecordPosition === "top" && /* @__PURE__ */ N(d, {
1815
1871
  variant: "ghost",
1816
1872
  size: "sm",
1817
1873
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1818
1874
  "data-testid": "add-record-button",
1819
- onClick: () => w.onAddRecord?.(),
1820
- children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1875
+ onClick: () => h.onAddRecord?.(),
1876
+ children: [/* @__PURE__ */ M(pe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1821
1877
  className: "hidden sm:inline",
1822
- children: E("list.addRecord")
1878
+ children: _("list.addRecord")
1823
1879
  })]
1824
1880
  })
1825
1881
  ]
1826
1882
  })]
1827
1883
  }),
1828
- J && J.length > 0 && /* @__PURE__ */ P("div", {
1829
- className: "border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background",
1884
+ Y && Y.length > 0 && /* @__PURE__ */ M("div", {
1885
+ className: "hidden sm:flex border-b px-2 sm:px-4 py-1 items-center gap-1 flex-wrap bg-background",
1830
1886
  "data-testid": "quick-filters",
1831
- children: J.map((e) => {
1832
- let t = pt.has(e.id), n = e.icon ? ve[e.icon.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
1833
- return /* @__PURE__ */ F(d, {
1887
+ children: Y.map((e) => {
1888
+ let t = ht.has(e.id), n = e.icon ? we[e.icon.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
1889
+ return /* @__PURE__ */ N(d, {
1834
1890
  variant: t ? "default" : "outline",
1835
1891
  size: "sm",
1836
1892
  className: "h-7 px-3 text-xs",
1837
- onClick: () => Bt(e.id),
1838
- children: [n && /* @__PURE__ */ P(n, { className: "h-3 w-3 mr-1.5" }), e.label]
1893
+ onClick: () => Ut(e.id),
1894
+ children: [n && /* @__PURE__ */ M(n, { className: "h-3 w-3 mr-1.5" }), e.label]
1839
1895
  }, e.id);
1840
1896
  })
1841
1897
  }),
1842
- /* @__PURE__ */ P("div", {
1898
+ /* @__PURE__ */ N("div", {
1843
1899
  className: "flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200",
1844
- children: !He && B.length === 0 && j === "grid" ? (() => {
1845
- let e = O.emptyState?.icon;
1846
- return /* @__PURE__ */ F("div", {
1900
+ children: [/* @__PURE__ */ M(ne, { active: B && z.length > 0 }), B && z.length === 0 ? /* @__PURE__ */ N("div", {
1901
+ className: "flex flex-col h-full min-h-[200px] p-4 gap-2",
1902
+ "data-testid": "list-loading",
1903
+ role: "status",
1904
+ "aria-live": "polite",
1905
+ "aria-busy": "true",
1906
+ children: [/* @__PURE__ */ M("span", {
1907
+ className: "sr-only",
1908
+ children: _("list.loading")
1909
+ }), [
1910
+ 0,
1911
+ 1,
1912
+ 2,
1913
+ 3,
1914
+ 4,
1915
+ 5
1916
+ ].map((e) => /* @__PURE__ */ M("div", {
1917
+ className: "h-9 rounded bg-muted/60 animate-pulse",
1918
+ style: { opacity: Math.max(.25, 1 - e * .12) }
1919
+ }, e))]
1920
+ }) : !B && z.length === 0 && A === "grid" ? (() => {
1921
+ let e = E.emptyState?.icon;
1922
+ return /* @__PURE__ */ N("div", {
1847
1923
  className: "flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8",
1848
1924
  "data-testid": "empty-state",
1849
1925
  children: [
1850
- /* @__PURE__ */ P(e ? ve[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? oe : oe, { className: "h-12 w-12 text-muted-foreground/50 mb-4" }),
1851
- /* @__PURE__ */ P("h3", {
1926
+ /* @__PURE__ */ M(e ? we[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? le : le, { className: "h-12 w-12 text-muted-foreground/50 mb-4" }),
1927
+ /* @__PURE__ */ M("h3", {
1852
1928
  className: "text-lg font-medium text-foreground mb-1",
1853
- children: (typeof O.emptyState?.title == "string" ? O.emptyState.title : void 0) ?? E("list.noItems")
1929
+ children: (typeof E.emptyState?.title == "string" ? E.emptyState.title : void 0) ?? _("list.noItems")
1854
1930
  }),
1855
- /* @__PURE__ */ P("p", {
1931
+ /* @__PURE__ */ M("p", {
1856
1932
  className: "text-sm text-muted-foreground max-w-md",
1857
- children: (typeof O.emptyState?.message == "string" ? O.emptyState.message : void 0) ?? E("list.noItemsMessage")
1933
+ children: (typeof E.emptyState?.message == "string" ? E.emptyState.message : void 0) ?? _("list.noItemsMessage")
1858
1934
  }),
1859
- A.showAddRecord && /* @__PURE__ */ F(d, {
1935
+ O.showAddRecord && /* @__PURE__ */ N(d, {
1860
1936
  variant: "default",
1861
1937
  size: "sm",
1862
1938
  className: "mt-4",
1863
1939
  "data-testid": "empty-state-add-record",
1864
- onClick: () => w.onAddRecord?.(),
1865
- children: [/* @__PURE__ */ P(M, { className: "h-4 w-4 mr-1.5" }), E("list.addRecord")]
1940
+ onClick: () => h.onAddRecord?.(),
1941
+ children: [/* @__PURE__ */ M(pe, { className: "h-4 w-4 mr-1.5" }), _("list.addRecord")]
1866
1942
  })
1867
1943
  ]
1868
1944
  });
1869
- })() : /* @__PURE__ */ P(Se, {
1870
- schema: Lt,
1871
- ...w,
1872
- data: B,
1873
- loading: He,
1874
- onRowSelect: dt
1875
- })
1876
- }, j),
1877
- A.showAddRecord && A.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
1945
+ })() : /* @__PURE__ */ M(ke, {
1946
+ schema: Bt,
1947
+ ...h,
1948
+ data: z,
1949
+ loading: B,
1950
+ onRowSelect: pt
1951
+ })]
1952
+ }, A),
1953
+ O.showAddRecord && O.addRecordPosition === "bottom" && /* @__PURE__ */ M("div", {
1878
1954
  className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
1879
- children: /* @__PURE__ */ F(d, {
1955
+ children: /* @__PURE__ */ N(d, {
1880
1956
  variant: "ghost",
1881
1957
  size: "sm",
1882
1958
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1883
1959
  "data-testid": "add-record-button",
1884
- onClick: () => w.onAddRecord?.(),
1885
- children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1960
+ onClick: () => h.onAddRecord?.(),
1961
+ children: [/* @__PURE__ */ M(pe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ M("span", {
1886
1962
  className: "hidden sm:inline",
1887
- children: E("list.addRecord")
1963
+ children: _("list.addRecord")
1888
1964
  })]
1889
1965
  })
1890
1966
  }),
1891
- O.bulkActions && O.bulkActions.length > 0 && ut.length > 0 && j !== "grid" && /* @__PURE__ */ F("div", {
1967
+ E.bulkActions && E.bulkActions.length > 0 && ft.length > 0 && A !== "grid" && /* @__PURE__ */ N("div", {
1892
1968
  className: "border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm",
1893
1969
  role: "region",
1894
1970
  "aria-label": "Bulk actions",
1895
1971
  "data-testid": "bulk-actions-bar",
1896
1972
  children: [
1897
- /* @__PURE__ */ P(te, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
1898
- /* @__PURE__ */ F("span", {
1973
+ /* @__PURE__ */ M(ae, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
1974
+ /* @__PURE__ */ N("span", {
1899
1975
  className: "font-medium",
1900
1976
  children: [
1901
- ut.length,
1977
+ ft.length,
1902
1978
  " ",
1903
- ut.length === 1 ? "item" : "items",
1979
+ ft.length === 1 ? "item" : "items",
1904
1980
  " selected"
1905
1981
  ]
1906
1982
  }),
1907
- /* @__PURE__ */ P("div", {
1983
+ /* @__PURE__ */ M("div", {
1908
1984
  className: "flex items-center gap-1.5 ml-3",
1909
- children: O.bulkActions.map((e) => {
1910
- let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? ge : null;
1911
- return /* @__PURE__ */ F(d, {
1985
+ children: E.bulkActions.map((e) => {
1986
+ let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? Se : null;
1987
+ return /* @__PURE__ */ N(d, {
1912
1988
  variant: n ? "destructive" : "outline",
1913
1989
  size: "sm",
1914
1990
  className: "h-7 px-2.5 text-xs gap-1.5",
1915
- onClick: () => w.onBulkAction?.(e, ut),
1991
+ onClick: () => h.onBulkAction?.(e, ft),
1916
1992
  "data-testid": `bulk-action-${e}`,
1917
- children: [r && /* @__PURE__ */ P(r, { className: "h-3 w-3" }), Ue(e)]
1993
+ children: [r && /* @__PURE__ */ M(r, { className: "h-3 w-3" }), Je(e)]
1918
1994
  }, e);
1919
1995
  })
1920
1996
  }),
1921
- /* @__PURE__ */ F(d, {
1997
+ /* @__PURE__ */ N(d, {
1922
1998
  variant: "ghost",
1923
1999
  size: "sm",
1924
2000
  className: "h-7 px-2 text-xs ml-auto gap-1",
1925
- onClick: () => dt([]),
1926
- children: [/* @__PURE__ */ P(_e, { className: "h-3 w-3" }), "Clear"]
2001
+ onClick: () => pt([]),
2002
+ children: [/* @__PURE__ */ M(Ce, { className: "h-3 w-3" }), "Clear"]
1927
2003
  })
1928
2004
  ]
1929
2005
  }),
1930
- !He && B.length > 0 && O.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
2006
+ !B && z.length > 0 && E.showRecordCount !== !1 && /* @__PURE__ */ N("div", {
1931
2007
  className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
1932
2008
  "data-testid": "record-count-bar",
1933
2009
  children: [
1934
- /* @__PURE__ */ P("span", {
2010
+ /* @__PURE__ */ M("span", {
1935
2011
  className: "font-medium text-foreground/80",
1936
- children: B.length === 1 ? E("list.recordCountOne", { count: B.length }) : E("list.recordCount", { count: B.length })
2012
+ children: z.length === 1 ? _("list.recordCountOne", { count: z.length }) : _("list.recordCount", { count: z.length })
1937
2013
  }),
1938
- Qe && /* @__PURE__ */ P("span", {
2014
+ et && /* @__PURE__ */ M("span", {
1939
2015
  className: "text-amber-600",
1940
2016
  "data-testid": "data-limit-warning",
1941
- children: E("list.dataLimitReached", { limit: nt })
2017
+ children: _("list.dataLimitReached", { limit: W })
1942
2018
  }),
1943
- O.pagination?.pageSizeOptions && O.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
2019
+ E.pagination?.pageSizeOptions && E.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ N("div", {
1944
2020
  className: "ml-auto flex items-center gap-2",
1945
- children: [/* @__PURE__ */ P("span", { children: E("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ P("select", {
2021
+ children: [/* @__PURE__ */ M("span", { children: _("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ M("select", {
1946
2022
  "data-testid": "page-size-selector",
1947
2023
  className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
1948
- value: String(nt),
2024
+ value: String(W),
1949
2025
  onChange: (e) => {
1950
2026
  let t = Number(e.target.value);
1951
- tt(t), w.onPageSizeChange && w.onPageSizeChange(t);
2027
+ it(t), h.onPageSizeChange && h.onPageSizeChange(t);
1952
2028
  },
1953
- children: O.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
2029
+ children: E.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ M("option", {
1954
2030
  value: String(e),
1955
2031
  children: e
1956
2032
  }, e))
@@ -1958,17 +2034,17 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1958
2034
  })
1959
2035
  ]
1960
2036
  }),
1961
- It.isOverlay && /* @__PURE__ */ P(v, {
1962
- ...It,
1963
- title: O.label ? `${O.label} Detail` : O.objectName ? `${O.objectName.charAt(0).toUpperCase() + O.objectName.slice(1)} Detail` : "Record Detail",
1964
- children: (e) => /* @__PURE__ */ P("div", {
2037
+ Rt.isOverlay && /* @__PURE__ */ M(te, {
2038
+ ...Rt,
2039
+ title: E.label ? `${E.label} Detail` : E.objectName ? `${E.objectName.charAt(0).toUpperCase() + E.objectName.slice(1)} Detail` : "Record Detail",
2040
+ children: (e) => /* @__PURE__ */ M("div", {
1965
2041
  className: "space-y-3",
1966
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
2042
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ N("div", {
1967
2043
  className: "flex flex-col",
1968
- children: [/* @__PURE__ */ P("span", {
2044
+ children: [/* @__PURE__ */ M("span", {
1969
2045
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
1970
2046
  children: e.replace(/_/g, " ")
1971
- }), /* @__PURE__ */ P("span", {
2047
+ }), /* @__PURE__ */ M("span", {
1972
2048
  className: "text-sm",
1973
2049
  children: String(t ?? "—")
1974
2050
  })]
@@ -1978,18 +2054,18 @@ var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
1978
2054
  ]
1979
2055
  });
1980
2056
  });
1981
- Xe.displayName = "ListView";
2057
+ U.displayName = "ListView";
1982
2058
  //#endregion
1983
2059
  //#region src/ObjectGallery.tsx
1984
- var Ze = {
2060
+ var rt = {
1985
2061
  small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
1986
2062
  medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
1987
2063
  large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
1988
- }, Qe = {
2064
+ }, it = {
1989
2065
  small: "aspect-square",
1990
2066
  medium: "aspect-[4/3]",
1991
2067
  large: "aspect-[16/10]"
1992
- }, $e = [
2068
+ }, W = [
1993
2069
  {
1994
2070
  bg: "from-indigo-500/15 via-indigo-500/5 to-purple-500/10",
1995
2071
  ring: "ring-indigo-500/15",
@@ -2021,17 +2097,17 @@ var Ze = {
2021
2097
  text: "text-violet-600/70 dark:text-violet-300/70"
2022
2098
  }
2023
2099
  ];
2024
- function et(e) {
2100
+ function G(e) {
2025
2101
  let t = 5381;
2026
2102
  for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n);
2027
- return $e[Math.abs(t) % $e.length];
2103
+ return W[Math.abs(t) % W.length];
2028
2104
  }
2029
- var tt = (e) => {
2030
- let { schema: n } = e, r = s(Ce), i = e.dataSource || r?.dataSource, a = we(n.bind), [d, m] = u([]), [h, g] = u(!1), [_, y] = u(null), b = Ee({
2105
+ var K = (e) => {
2106
+ let { schema: n } = e, r = s(P), i = e.dataSource || r?.dataSource, a = Ae(n.bind), [d, m] = u([]), [h, g] = u(!1), [_, v] = u(null), ee = Me({
2031
2107
  navigation: n.navigation,
2032
2108
  objectName: n.objectName,
2033
2109
  onRowClick: e.onRowClick ?? e.onCardClick
2034
- }), x = n.gallery, S = x?.coverField ?? n.imageField ?? "image", w = x?.coverFit ?? "cover", T = x?.cardSize ?? "medium", ee = x?.titleField ?? n.titleField ?? "name", te = x?.visibleFields, { fieldOptionLabel: re } = De(), ie = o((e) => {
2110
+ }), y = n.gallery, b = y?.coverField ?? n.imageField ?? "image", x = y?.coverFit ?? "cover", S = y?.cardSize ?? "medium", C = y?.titleField ?? n.titleField ?? "name", ne = y?.visibleFields, { fieldOptionLabel: re } = Ne(), ie = o((e) => {
2035
2111
  let t = _?.fields?.[e], r = { name: e };
2036
2112
  if (t) {
2037
2113
  t.type && (r.type = t.type), t.label && (r.label = t.label), t.options && (r.options = t.options), t.currency && (r.currency = t.currency), t.precision !== void 0 && (r.precision = t.precision), t.format && (r.format = t.format);
@@ -2056,7 +2132,7 @@ var tt = (e) => {
2056
2132
  return (async () => {
2057
2133
  if (!(!i || typeof i.getObjectSchema != "function" || !n.objectName)) try {
2058
2134
  let t = await i.getObjectSchema(n.objectName);
2059
- e && y(t);
2135
+ e && v(t);
2060
2136
  } catch (e) {
2061
2137
  console.warn("Failed to fetch object def for ObjectGallery", e);
2062
2138
  }
@@ -2101,15 +2177,15 @@ var tt = (e) => {
2101
2177
  e.data,
2102
2178
  _
2103
2179
  ]);
2104
- let D = e.data || a || n.data || d || [], O = l(() => D.some((e) => typeof e[S] == "string" && !!e[S]), [D, S]), ae = !!x?.coverField || O, k = n.grouping?.fields, oe = !!(k && k.length > 0), [A, j] = u({}), se = l(() => k ? k.some((e) => e.collapsed) : !1, [k]), M = o((e) => {
2105
- j((t) => ({
2180
+ let T = e.data || a || n.data || d || [], E = l(() => T.some((e) => typeof e[b] == "string" && !!e[b]), [T, b]), ae = !!y?.coverField || E, k = n.grouping?.fields, oe = !!(k && k.length > 0), [A, se] = u({}), ce = l(() => k ? k.some((e) => e.collapsed) : !1, [k]), j = o((e) => {
2181
+ se((t) => ({
2106
2182
  ...t,
2107
- [e]: t[e] === void 0 ? !se : !t[e]
2183
+ [e]: t[e] === void 0 ? !ce : !t[e]
2108
2184
  }));
2109
- }, [se]), ce = l(() => {
2185
+ }, [ce]), le = l(() => {
2110
2186
  if (!oe || !k) return [];
2111
2187
  let e = /* @__PURE__ */ new Map(), t = [];
2112
- for (let n of D) {
2188
+ for (let n of T) {
2113
2189
  let r = k.map((e) => String(n[e.field] ?? "")).join(" / ");
2114
2190
  if (!e.has(r)) {
2115
2191
  let i = k.map((e) => {
@@ -2131,7 +2207,7 @@ var tt = (e) => {
2131
2207
  });
2132
2208
  return n === "desc" ? -r : r;
2133
2209
  }), t.map((t) => {
2134
- let n = e.get(t), r = t in A ? A[t] : se;
2210
+ let n = e.get(t), r = t in A ? A[t] : ce;
2135
2211
  return {
2136
2212
  key: t,
2137
2213
  label: n.label,
@@ -2140,64 +2216,64 @@ var tt = (e) => {
2140
2216
  };
2141
2217
  });
2142
2218
  }, [
2143
- D,
2219
+ T,
2144
2220
  k,
2145
2221
  oe,
2146
2222
  A,
2147
- se
2223
+ ce
2148
2224
  ]);
2149
- if (h && !D.length) return /* @__PURE__ */ P("div", {
2225
+ if (h && !T.length) return /* @__PURE__ */ M("div", {
2150
2226
  className: "p-4 text-sm text-muted-foreground",
2151
2227
  children: "Loading Gallery..."
2152
2228
  });
2153
- if (!D.length) return /* @__PURE__ */ P("div", {
2229
+ if (!T.length) return /* @__PURE__ */ M("div", {
2154
2230
  className: "p-4 text-sm text-muted-foreground",
2155
2231
  children: "No items to display"
2156
2232
  });
2157
- let le = (t, r) => {
2158
- let i = t.id ?? t._id ?? r, a = String(t[ee] ?? "Untitled"), o = t[S], s = et(String(i) + "|" + a);
2159
- return /* @__PURE__ */ F(f, {
2233
+ let ue = (t, r) => {
2234
+ let i = t.id ?? t._id ?? r, a = String(t[C] ?? "Untitled"), o = t[b], s = G(String(i) + "|" + a);
2235
+ return /* @__PURE__ */ N(f, {
2160
2236
  role: "listitem",
2161
- className: C("group relative overflow-hidden border-border/60 bg-card", "transition-all duration-200 ease-out", "hover:shadow-lg hover:border-border hover:-translate-y-0.5", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer"),
2162
- onClick: (e) => b.handleClick(t, e),
2237
+ className: w("group relative overflow-hidden border-border/60 bg-card", "transition-all duration-200 ease-out", "hover:shadow-lg hover:border-border hover:-translate-y-0.5", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer"),
2238
+ onClick: (e) => ee.handleClick(t, e),
2163
2239
  children: [
2164
- !ae && /* @__PURE__ */ P("div", {
2240
+ !ae && /* @__PURE__ */ M("div", {
2165
2241
  "aria-hidden": !0,
2166
- className: C("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", s.bg)
2242
+ className: w("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", s.bg)
2167
2243
  }),
2168
- /* @__PURE__ */ P("div", {
2169
- className: C("w-full overflow-hidden relative", Qe[T]),
2244
+ /* @__PURE__ */ M("div", {
2245
+ className: w("w-full overflow-hidden relative", it[S]),
2170
2246
  hidden: !ae,
2171
- children: o ? /* @__PURE__ */ P("img", {
2247
+ children: o ? /* @__PURE__ */ M("img", {
2172
2248
  src: o,
2173
2249
  alt: a,
2174
- className: C("h-full w-full transition-transform duration-300 ease-out group-hover:scale-[1.04]", w === "cover" && "object-cover", w === "contain" && "object-contain")
2175
- }) : /* @__PURE__ */ P("div", {
2176
- className: C("flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset", s.bg, s.ring),
2177
- children: /* @__PURE__ */ P("span", {
2178
- className: C("text-5xl font-semibold tracking-tight opacity-90", s.text),
2250
+ className: w("h-full w-full transition-transform duration-300 ease-out group-hover:scale-[1.04]", x === "cover" && "object-cover", x === "contain" && "object-contain")
2251
+ }) : /* @__PURE__ */ M("div", {
2252
+ className: w("flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset", s.bg, s.ring),
2253
+ children: /* @__PURE__ */ M("span", {
2254
+ className: w("text-5xl font-semibold tracking-tight opacity-90", s.text),
2179
2255
  children: a[0]?.toUpperCase()
2180
2256
  })
2181
2257
  })
2182
2258
  }),
2183
- /* @__PURE__ */ F(p, {
2184
- className: C("p-3", ae && "border-t border-border/60"),
2185
- children: [/* @__PURE__ */ P("h3", {
2259
+ /* @__PURE__ */ N(p, {
2260
+ className: w("p-3", ae && "border-t border-border/60"),
2261
+ children: [/* @__PURE__ */ M("h3", {
2186
2262
  className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
2187
2263
  title: a,
2188
2264
  children: a
2189
- }), te && te.length > 0 && /* @__PURE__ */ P("div", {
2265
+ }), ne && ne.length > 0 && /* @__PURE__ */ M("div", {
2190
2266
  className: "mt-1.5 space-y-1",
2191
- children: te.map((e) => {
2267
+ children: ne.map((e) => {
2192
2268
  let n = t[e];
2193
2269
  if (n == null || n === "") return null;
2194
2270
  let r = ie(e);
2195
- return /* @__PURE__ */ P("div", {
2271
+ return /* @__PURE__ */ M("div", {
2196
2272
  className: "text-xs text-muted-foreground truncate [&_*]:!text-xs",
2197
2273
  onClick: (e) => {
2198
2274
  e.target.closest("a,button") && e.stopPropagation();
2199
2275
  },
2200
- children: /* @__PURE__ */ P(I(Ae(r) || r.type || "text"), {
2276
+ children: /* @__PURE__ */ M(Ie(Le(r) || r.type || "text"), {
2201
2277
  value: n,
2202
2278
  field: r
2203
2279
  })
@@ -2207,40 +2283,40 @@ var tt = (e) => {
2207
2283
  })
2208
2284
  ]
2209
2285
  }, i);
2210
- }, ue = (e) => /* @__PURE__ */ P("div", {
2211
- className: C("grid gap-4 p-4 auto-rows-min content-start", Ze[T], n.className),
2286
+ }, de = (e) => /* @__PURE__ */ M("div", {
2287
+ className: w("grid gap-4 p-4 auto-rows-min content-start", rt[S], n.className),
2212
2288
  role: "list",
2213
- children: e.map((e, t) => le(e, t))
2289
+ children: e.map((e, t) => ue(e, t))
2214
2290
  });
2215
- return /* @__PURE__ */ F(N, { children: [oe ? /* @__PURE__ */ P("div", {
2291
+ return /* @__PURE__ */ N(Te, { children: [oe ? /* @__PURE__ */ M("div", {
2216
2292
  className: "space-y-2",
2217
- children: ce.map((e) => /* @__PURE__ */ F("div", {
2293
+ children: le.map((e) => /* @__PURE__ */ N("div", {
2218
2294
  className: "border rounded-md",
2219
- children: [/* @__PURE__ */ F("button", {
2295
+ children: [/* @__PURE__ */ N("button", {
2220
2296
  type: "button",
2221
2297
  className: "flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-left bg-muted/50 hover:bg-muted transition-colors",
2222
- onClick: () => M(e.key),
2298
+ onClick: () => j(e.key),
2223
2299
  children: [
2224
- e.collapsed ? /* @__PURE__ */ P(ne, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ P(E, { className: "h-4 w-4 shrink-0" }),
2225
- /* @__PURE__ */ P("span", { children: e.label }),
2226
- /* @__PURE__ */ P("span", {
2300
+ e.collapsed ? /* @__PURE__ */ M(O, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ M(D, { className: "h-4 w-4 shrink-0" }),
2301
+ /* @__PURE__ */ M("span", { children: e.label }),
2302
+ /* @__PURE__ */ M("span", {
2227
2303
  className: "ml-auto text-xs text-muted-foreground",
2228
2304
  children: e.items.length
2229
2305
  })
2230
2306
  ]
2231
- }), !e.collapsed && ue(e.items)]
2307
+ }), !e.collapsed && de(e.items)]
2232
2308
  }, e.key))
2233
- }) : ue(D), b.isOverlay && /* @__PURE__ */ P(v, {
2234
- ...b,
2309
+ }) : de(T), ee.isOverlay && /* @__PURE__ */ M(te, {
2310
+ ...ee,
2235
2311
  title: "Gallery Item",
2236
- children: (e) => /* @__PURE__ */ P("div", {
2312
+ children: (e) => /* @__PURE__ */ M("div", {
2237
2313
  className: "space-y-3",
2238
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
2314
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ N("div", {
2239
2315
  className: "flex flex-col",
2240
- children: [/* @__PURE__ */ P("span", {
2316
+ children: [/* @__PURE__ */ M("span", {
2241
2317
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
2242
2318
  children: e.replace(/_/g, " ")
2243
- }), /* @__PURE__ */ P("span", {
2319
+ }), /* @__PURE__ */ M("span", {
2244
2320
  className: "text-sm",
2245
2321
  children: String(t ?? "—")
2246
2322
  })]
@@ -2248,11 +2324,11 @@ var tt = (e) => {
2248
2324
  })
2249
2325
  })] });
2250
2326
  };
2251
- e.register("object-gallery", tt, {
2327
+ e.register("object-gallery", K, {
2252
2328
  namespace: "plugin-list",
2253
2329
  label: "Gallery View",
2254
2330
  category: "view"
2255
- }), e.register("list-view", Xe, {
2331
+ }), e.register("list-view", U, {
2256
2332
  namespace: "plugin-list",
2257
2333
  label: "List View",
2258
2334
  category: "Views",
@@ -2329,7 +2405,7 @@ e.register("object-gallery", tt, {
2329
2405
  sort: [],
2330
2406
  options: {}
2331
2407
  }
2332
- }), e.register("list", Xe, {
2408
+ }), e.register("list", U, {
2333
2409
  namespace: "view",
2334
2410
  category: "view",
2335
2411
  label: "List",
@@ -2400,4 +2476,4 @@ e.register("object-gallery", tt, {
2400
2476
  ]
2401
2477
  });
2402
2478
  //#endregion
2403
- export { Xe as ListView, tt as ObjectGallery, Fe as TabBar, ze as UserFilters, Ne as ViewSwitcher, H as evaluateConditionalFormatting, V as normalizeFilterCondition, We as normalizeFilters };
2479
+ export { U as ListView, K as ObjectGallery, Ve as TabBar, He as TabBarSelect, We as UserFilters, Re as ViewSwitcher, Ze as evaluateConditionalFormatting, qe as normalizeFilterCondition, Ye as normalizeFilters };