@object-ui/plugin-list 5.0.2 → 5.2.1

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