@object-ui/plugin-list 11.2.0 → 11.3.0

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