@object-ui/plugin-list 11.2.0 → 11.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -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,21 @@ 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)) return V.onMutation((e) => {
892
+ e.resource === j.objectName && rt((e) => e + 1);
878
893
  });
879
- }, [
880
- B,
881
- A.objectName,
882
- A.refreshTrigger
883
- ]);
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 = [];
894
+ }, [V, j.objectName]);
895
+ 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(() => {
896
+ if (j.grouping?.fields?.length) return j.grouping;
897
+ let e = typeof j.groupBy == "string" ? j.groupBy.trim() : "", t = typeof j.groupBy2 == "string" ? j.groupBy2.trim() : "", n = [];
887
898
  return e && n.push({
888
899
  field: e,
889
900
  order: "asc",
@@ -894,25 +905,25 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
894
905
  collapsed: !1
895
906
  }), n.length > 0 ? { fields: n } : void 0;
896
907
  }, [
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;
908
+ j.grouping,
909
+ j.groupBy,
910
+ j.groupBy2
911
+ ]), [q, mt] = i.useState(K), [ht, gt] = i.useState(!1), _t = i.useRef(K);
912
+ i.useEffect(() => {
913
+ _t.current !== K && (_t.current = K, mt(K));
914
+ }, [K]);
915
+ 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(() => {
916
+ let e = j.userFilters;
906
917
  if (!e) return;
907
918
  if (e.element === "tabs" || e.fields && e.fields.length > 0 || !W?.fields) return e;
908
- let t = new Set([
919
+ let t = /* @__PURE__ */ new Set([
909
920
  "select",
910
921
  "multi-select",
911
922
  "boolean"
912
923
  ]), n = [], r = Array.isArray(W.fields) ? W.fields.map((e) => [e.name, e]) : Object.entries(W.fields);
913
924
  for (let [e, i] of r) (t.has(i.type) || i.options && !i.type) && n.push({
914
925
  field: e,
915
- label: j(e, i.label || e),
926
+ label: M(e, i.label || e),
916
927
  type: i.type === "boolean" ? "boolean" : i.type === "multi-select" ? "multi-select" : "select"
917
928
  });
918
929
  return n.length === 0 ? e : {
@@ -920,69 +931,75 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
920
931
  fields: n
921
932
  };
922
933
  }, [
923
- A.userFilters,
934
+ j.userFilters,
924
935
  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 ? {
936
+ M
937
+ ]), [X, Et] = i.useState(() => new Set(j.hiddenFields || [])), Dt = i.useMemo(() => JSON.stringify(j.hiddenFields || []), [j.hiddenFields]);
938
+ i.useEffect(() => {
939
+ Et(new Set(j.hiddenFields || []));
940
+ }, [Dt]);
941
+ let Ot = i.useCallback((e) => {
942
+ Et(e), c?.(Array.from(e));
943
+ }, [c]), [kt, At] = i.useState(!1), [jt, Mt] = i.useState(() => !!j.inlineEdit);
944
+ i.useEffect(() => {
945
+ Mt(!!j.inlineEdit);
946
+ }, [j.inlineEdit]);
947
+ let Nt = i.useCallback((e) => {
948
+ Mt(e), l?.(e);
949
+ }, [l]), [Pt, Ft] = i.useState(!1), [It, Lt] = i.useState(!1), [Rt, zt] = i.useState(null), Bt = j.allowExport !== !1 && j.operations?.export !== !1, Vt = i.useMemo(() => {
950
+ if (j.exportOptions) return Array.isArray(j.exportOptions) ? { formats: j.exportOptions } : j.exportOptions;
951
+ }, [j.exportOptions]), Z = Fe(i.useMemo(() => j.densityMode ? j.densityMode : j.rowHeight ? {
935
952
  compact: "compact",
936
953
  short: "compact",
937
954
  medium: "comfortable",
938
955
  tall: "spacious",
939
956
  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";
957
+ }[j.rowHeight] || "comfortable" : "compact", [j.densityMode, j.rowHeight]), { onChange: j.onDensityChange }), Ht = i.useMemo(() => `objectui:gallery:density:${j.objectName ?? "default"}`, [j.objectName]), [Q, Ut] = i.useState(() => {
958
+ if (typeof window > "u") return j.gallery?.cardSize ?? "medium";
942
959
  try {
943
- let e = window.localStorage.getItem(jt);
960
+ let e = window.localStorage.getItem(Ht);
944
961
  if (e === "small" || e === "medium" || e === "large") return e;
945
962
  } catch {}
946
- return A.gallery?.cardSize ?? "medium";
947
- }), Nt = r.useCallback(() => {
948
- Mt((e) => {
963
+ return j.gallery?.cardSize ?? "medium";
964
+ }), Wt = i.useCallback(() => {
965
+ Ut((e) => {
949
966
  let t = e === "large" ? "medium" : e === "medium" ? "small" : "large";
950
967
  try {
951
- window.localStorage.setItem(jt, t);
968
+ window.localStorage.setItem(Ht, t);
952
969
  } catch {}
953
970
  return t;
954
971
  });
955
- }, [jt]), { ref: Pt, isRefreshing: Ft, pullDistance: It } = Fe({
956
- onRefresh: r.useCallback(async () => {
957
- G((e) => e + 1);
972
+ }, [Ht]), { ref: Gt, isRefreshing: Kt, pullDistance: qt } = Le({
973
+ onRefresh: i.useCallback(async () => {
974
+ rt((e) => e + 1);
958
975
  }, []),
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(() => {
976
+ enabled: !!V && !!j.objectName
977
+ }), Jt = i.useMemo(() => j.id ? `listview-${j.objectName}-${j.id}-view` : `listview-${j.objectName}-view`, [j.objectName, j.id]);
978
+ i.useEffect(() => {
962
979
  let e = !0;
963
- return Qe(!1), qe(null), (async () => {
964
- if (!B || !A.objectName) {
965
- Qe(!0);
980
+ return tt(!1), Xe(null), (async () => {
981
+ if (!V || !j.objectName) {
982
+ tt(!0);
966
983
  return;
967
984
  }
968
- if (typeof B.getObjectSchema != "function") {
969
- Qe(!0);
985
+ if (typeof V.getObjectSchema != "function") {
986
+ tt(!0);
970
987
  return;
971
988
  }
972
989
  try {
973
- let t = await B.getObjectSchema(A.objectName);
974
- e && qe(t);
990
+ let t = await V.getObjectSchema(j.objectName);
991
+ e && Xe(t);
975
992
  } catch (e) {
976
993
  console.warn("Failed to fetch object schema for ListView:", e);
977
994
  } finally {
978
- e && Qe(!0);
995
+ e && tt(!0);
979
996
  }
980
997
  })(), () => {
981
998
  e = !1;
982
999
  };
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) => {
1000
+ }, [j.objectName, V]);
1001
+ let Yt = i.useMemo(() => {
1002
+ 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
1003
  if (!e) return;
987
1004
  let t = [
988
1005
  e.groupField,
@@ -1006,64 +1023,64 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1006
1023
  ];
1007
1024
  for (let e of t) typeof e == "string" && e && n.add(e);
1008
1025
  };
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);
1026
+ 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
1027
  let i = n.size > 0 ? Array.from(n) : void 0;
1011
1028
  return t(W?.fields, i);
1012
1029
  }, [
1013
1030
  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;
1031
+ j.fields,
1032
+ j.kanban,
1033
+ j.calendar,
1034
+ j.gallery,
1035
+ j.timeline,
1036
+ j.gantt,
1037
+ j.options
1038
+ ]), Xt = Re();
1039
+ i.useEffect(() => {
1040
+ let e = !0, t = ++Ct.current;
1041
+ if (j.data && typeof j.data == "object" && !Array.isArray(j.data)) {
1042
+ let e = j.data;
1026
1043
  if (e.provider === "value" && Array.isArray(e.items)) {
1027
1044
  let t = e.items;
1028
- if (P) {
1029
- let e = P.toLowerCase();
1045
+ if (F) {
1046
+ let e = F.toLowerCase();
1030
1047
  t = t.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
1031
1048
  }
1032
- Ue(t), U(!1), rt(!1);
1049
+ Ge(t), Ye(!1), st(!1);
1033
1050
  return;
1034
1051
  }
1035
1052
  }
1036
- if (Array.isArray(A.data)) {
1037
- let e = A.data;
1038
- if (P) {
1039
- let t = P.toLowerCase();
1053
+ if (Array.isArray(j.data)) {
1054
+ let e = j.data;
1055
+ if (F) {
1056
+ let t = F.toLowerCase();
1040
1057
  e = e.filter((e) => Object.values(e).some((e) => e != null && String(e).toLowerCase().includes(t)));
1041
1058
  }
1042
- Ue(e), U(!1), rt(!1);
1059
+ Ge(e), Ye(!1), st(!1);
1043
1060
  return;
1044
1061
  }
1045
- return Ze ? ((async () => {
1046
- if (!B || !A.objectName) {
1047
- U(!1);
1062
+ return et ? ((async () => {
1063
+ if (!V || !j.objectName) {
1064
+ Ye(!1);
1048
1065
  return;
1049
1066
  }
1050
- U(!0), Ke(null);
1067
+ Ye(!0), Je(null);
1051
1068
  try {
1052
- let n = [], r = A.filters || [], i = Xe(z), a = Ye(bt), o = [
1069
+ let n = [], r = j.filters || [], i = $e(B), a = Qe(Y), o = [
1053
1070
  ...r.length > 0 ? [r] : [],
1054
1071
  ...i.length > 0 ? [i] : [],
1055
1072
  ...a
1056
1073
  ].filter((e) => Array.isArray(e) && e.length > 0);
1057
1074
  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) => ({
1075
+ let s = R.length > 0 ? R.filter((e) => e.field).map((e) => ({
1059
1076
  field: e.field,
1060
1077
  order: e.order
1061
1078
  })) : 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;
1079
+ 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 = Xt?.isLoaded && j.objectName ? e.filter((e) => Xt.checkField(j.objectName, e, "read")) : e;
1063
1080
  if (t.length === 0) return;
1064
- let n = new Set(["id"]);
1081
+ let n = /* @__PURE__ */ new Set(["id"]);
1065
1082
  for (let e of t) n.add(e);
1066
- for (let e of Rt) n.add(e);
1083
+ for (let e of Yt) n.add(e);
1067
1084
  let r = (() => {
1068
1085
  let e = W?.fields;
1069
1086
  if (!e) return null;
@@ -1095,74 +1112,74 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1095
1112
  ];
1096
1113
  for (let e of t) i(e);
1097
1114
  };
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);
1115
+ 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
1116
  {
1100
- let e = A.timeline ?? A.options?.timeline;
1117
+ let e = j.timeline ?? j.options?.timeline;
1101
1118
  e && !Array.isArray(e.metaFields) && (i("status"), i("priority"));
1102
1119
  }
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, {
1120
+ return a(j.gantt), a(j.options?.gantt), Array.from(n);
1121
+ })(), 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
1122
  ...l ? { $filter: n } : {},
1106
1123
  $orderby: s,
1107
- $top: K,
1124
+ $top: G,
1108
1125
  ...d > 0 ? { $skip: d } : {},
1109
1126
  ...c ? { $select: c } : {},
1110
- ...Rt.length > 0 ? { $expand: Rt } : {},
1111
- ...P ? {
1112
- $search: P,
1113
- ...A.searchableFields && A.searchableFields.length > 0 ? { $searchFields: A.searchableFields } : {}
1127
+ ...Yt.length > 0 ? { $expand: Yt } : {},
1128
+ ...F ? {
1129
+ $search: F,
1130
+ ...j.searchableFields && j.searchableFields.length > 0 ? { $searchFields: j.searchableFields } : {}
1114
1131
  } : {}
1115
1132
  });
1116
- if (!e || t !== yt.current) return;
1133
+ if (!e || t !== Ct.current) return;
1117
1134
  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);
1135
+ 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
1136
  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);
1137
+ pt(u ? h : null), st(!(u && h != null) && p.length >= G);
1121
1138
  } catch (e) {
1122
- t === yt.current && (console.error("ListView data fetch error:", e), Ue([]), Ke(e?.message ? String(e.message) : String(e ?? "Unknown error")));
1139
+ t === Ct.current && (console.error("ListView data fetch error:", e), Ge([]), Je(e?.message ? String(e.message) : String(e ?? "Unknown error")));
1123
1140
  } finally {
1124
- e && t === yt.current && U(!1);
1141
+ e && t === Ct.current && Ye(!1);
1125
1142
  }
1126
1143
  })(), () => {
1127
1144
  e = !1;
1128
1145
  }) : void 0;
1129
1146
  }, [
1130
- A.objectName,
1131
- A.data,
1147
+ j.objectName,
1148
+ j.data,
1149
+ V,
1150
+ j.filters,
1151
+ G,
1152
+ R,
1132
1153
  B,
1133
- A.filters,
1134
- K,
1135
- L,
1136
- z,
1137
- bt,
1138
- $e,
1154
+ Y,
1155
+ nt,
1156
+ F,
1157
+ j.searchableFields,
1158
+ Yt,
1159
+ et,
1160
+ j.refreshTrigger,
1161
+ Xt,
1162
+ ut,
1139
1163
  P,
1140
- A.searchableFields,
1141
- Rt,
1142
- Ze,
1143
- A.refreshTrigger,
1144
- zt,
1145
- ot,
1146
- N,
1147
- J
1164
+ q
1148
1165
  ]);
1149
- let Bt = JSON.stringify([
1150
- A.objectName,
1151
- A.filters,
1152
- K,
1153
- L,
1154
- z,
1155
- bt,
1166
+ let Zt = JSON.stringify([
1167
+ j.objectName,
1168
+ j.filters,
1169
+ G,
1170
+ R,
1171
+ B,
1172
+ Y,
1173
+ F,
1156
1174
  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(() => {
1175
+ q
1176
+ ]), Qt = i.useRef(Zt);
1177
+ i.useEffect(() => {
1178
+ Qt.current !== Zt && (Qt.current = Zt, dt(1));
1179
+ }, [Zt]);
1180
+ let $t = i.useMemo(() => {
1164
1181
  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) && [
1182
+ (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
1183
  "grid",
1167
1184
  "kanban",
1168
1185
  "calendar",
@@ -1172,52 +1189,52 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1172
1189
  "gallery",
1173
1190
  "chart",
1174
1191
  "tree"
1175
- ].includes(A.viewType) && e.push(A.viewType);
1176
- let t = A.appearance?.allowedVisualizations;
1192
+ ].includes(j.viewType) && e.push(j.viewType);
1193
+ let t = j.appearance?.allowedVisualizations;
1177
1194
  if (Array.isArray(t) && t.length > 0) {
1178
1195
  let n = t.filter((t) => e.includes(t));
1179
1196
  return n.length > 0 ? n : ["grid"];
1180
1197
  }
1181
1198
  return e;
1182
1199
  }, [
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
1200
+ j.options,
1201
+ j.viewType,
1202
+ j.kanban,
1203
+ j.calendar,
1204
+ j.gantt,
1205
+ j.gallery,
1206
+ j.timeline,
1207
+ j.tree,
1208
+ j.appearance?.allowedVisualizations
1192
1209
  ]);
1193
- r.useEffect(() => {
1194
- A.viewType && de(A.viewType);
1195
- }, [A.viewType]);
1196
- let Ut = r.useCallback((e) => {
1210
+ i.useEffect(() => {
1211
+ j.viewType && de(j.viewType);
1212
+ }, [j.viewType]);
1213
+ let en = i.useCallback((e) => {
1197
1214
  de(e);
1198
1215
  try {
1199
- localStorage.setItem(Lt, e);
1216
+ localStorage.setItem(Jt, e);
1200
1217
  } catch (e) {
1201
1218
  console.warn("Failed to save view preference to localStorage:", e);
1202
1219
  }
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) => {
1220
+ r?.(e);
1221
+ }, [Jt, r]), tn = i.useCallback((e) => {
1222
+ Se(e), s?.(e);
1223
+ }, [s]), nn = Ie({
1224
+ navigation: j.navigation,
1225
+ objectName: j.objectName,
1226
+ onNavigate: j.onNavigate,
1227
+ onRowClick: f
1228
+ }), $ = i.useMemo(() => {
1229
+ let e = j.fields || [];
1230
+ if (Array.isArray(e) || (e = []), Xt?.isLoaded && j.objectName && (e = e.filter((e) => {
1214
1231
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1215
- return t ? zt.checkField(A.objectName, t, "read") : !0;
1232
+ return t ? Xt.checkField(j.objectName, t, "read") : !0;
1216
1233
  })), X.size > 0 && (e = e.filter((e) => {
1217
1234
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1218
1235
  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]));
1236
+ })), j.fieldOrder && j.fieldOrder.length > 0) {
1237
+ let t = new Map(j.fieldOrder.map((e, t) => [e, t]));
1221
1238
  e = [...e].sort((e, n) => {
1222
1239
  let r = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field, i = typeof n == "string" ? n : n?.name || n?.fieldName || n?.field;
1223
1240
  return (t.get(r) ?? Infinity) - (t.get(i) ?? Infinity);
@@ -1225,121 +1242,121 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1225
1242
  }
1226
1243
  return e;
1227
1244
  }, [
1228
- A.fields,
1229
- A.objectName,
1245
+ j.fields,
1246
+ j.objectName,
1230
1247
  X,
1231
- A.fieldOrder,
1232
- zt
1233
- ]), Kt = r.useMemo(() => {
1248
+ j.fieldOrder,
1249
+ Xt
1250
+ ]), rn = i.useMemo(() => {
1234
1251
  let e = Z.mode === "compact" ? "compact" : Z.mode === "spacious" ? "tall" : "medium", t = {
1235
- objectName: A.objectName,
1252
+ objectName: j.objectName,
1236
1253
  fields: $,
1237
- filters: A.filters,
1238
- sort: L,
1254
+ filters: j.filters,
1255
+ sort: R,
1239
1256
  className: "h-full w-full",
1240
1257
  showSearch: !1,
1241
- onRowClick: Gt.handleClick,
1258
+ onRowClick: nn.handleClick,
1242
1259
  rowHeight: e,
1243
1260
  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 } : {}
1261
+ ...j.striped == null ? {} : { striped: j.striped },
1262
+ ...j.bordered == null ? {} : { bordered: j.bordered },
1263
+ ...d ? { onColumnStateChange: d } : {},
1264
+ ...j.columnState ? { columnState: j.columnState } : {}
1248
1265
  };
1249
- switch (N) {
1266
+ switch (P) {
1250
1267
  default:
1251
1268
  case "grid": return {
1252
1269
  type: "object-grid",
1253
1270
  ...t,
1254
1271
  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 || {}
1272
+ ...j.conditionalFormatting ? { conditionalFormatting: j.conditionalFormatting } : {},
1273
+ editable: jt,
1274
+ ...j.wrapHeaders == null ? {} : { wrapHeaders: j.wrapHeaders },
1275
+ ...j.virtualScroll == null ? {} : { virtualScroll: j.virtualScroll },
1276
+ ...j.resizable == null ? {} : { resizable: j.resizable },
1277
+ ...j.selection ? { selection: j.selection } : {},
1278
+ ...j.pagination ? { pagination: j.pagination } : {},
1279
+ ...q ? { grouping: q } : {},
1280
+ ...J ? { rowColor: J } : {},
1281
+ ...j.rowActions ? { rowActions: j.rowActions } : {},
1282
+ ...j.rowActionDefs ? { rowActionDefs: j.rowActionDefs } : {},
1283
+ ...j.bulkActions ? { batchActions: j.bulkActions } : {},
1284
+ ...j.bulkActionDefs ? { bulkActionDefs: j.bulkActionDefs } : {},
1285
+ ...j.options?.grid || {}
1269
1286
  };
1270
1287
  case "kanban": return {
1271
1288
  type: "object-kanban",
1272
1289
  ...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 || {}
1290
+ groupBy: j.kanban?.groupField || j.options?.kanban?.groupField || "status",
1291
+ groupField: j.kanban?.groupField || j.options?.kanban?.groupField || "status",
1292
+ ...j.kanban?.titleField || j.options?.kanban?.titleField ? { titleField: j.kanban?.titleField || j.options?.kanban?.titleField } : {},
1293
+ cardFields: j.kanban?.cardFields || $ || [],
1294
+ ...q ? { grouping: q } : {},
1295
+ ...j.options?.kanban || {},
1296
+ ...j.kanban || {}
1280
1297
  };
1281
1298
  case "calendar": return {
1282
1299
  type: "object-calendar",
1283
1300
  ...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 || {}
1301
+ startDateField: j.calendar?.startDateField || j.options?.calendar?.startDateField || "start_date",
1302
+ endDateField: j.calendar?.endDateField || j.options?.calendar?.endDateField || "end_date",
1303
+ ...j.calendar?.titleField || j.options?.calendar?.titleField ? { titleField: j.calendar?.titleField || j.options?.calendar?.titleField } : {},
1304
+ ...j.calendar?.defaultView ? { defaultView: j.calendar.defaultView } : {},
1305
+ ...j.options?.calendar || {},
1306
+ ...j.calendar || {}
1290
1307
  };
1291
1308
  case "gallery": {
1292
1309
  let e = {
1293
- ...A.options?.gallery || {},
1294
- ...A.gallery || {},
1310
+ ...j.options?.gallery || {},
1311
+ ...j.gallery || {},
1295
1312
  cardSize: Q
1296
1313
  };
1297
1314
  return {
1298
1315
  type: "object-gallery",
1299
1316
  ...t,
1300
1317
  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 } : {}
1318
+ imageField: j.gallery?.coverField || j.gallery?.imageField || j.options?.gallery?.imageField,
1319
+ titleField: j.gallery?.titleField || j.options?.gallery?.titleField || "name",
1320
+ subtitleField: j.gallery?.subtitleField || j.options?.gallery?.subtitleField,
1321
+ ...q ? { grouping: q } : {}
1305
1322
  };
1306
1323
  }
1307
1324
  case "timeline": {
1308
1325
  let e = {
1309
- ...A.options?.timeline || {},
1310
- ...A.timeline || {}
1326
+ ...j.options?.timeline || {},
1327
+ ...j.timeline || {}
1311
1328
  };
1312
1329
  return {
1313
1330
  type: "object-timeline",
1314
1331
  ...t,
1315
1332
  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 } : {}
1333
+ startDateField: j.timeline?.startDateField || j.options?.timeline?.startDateField || j.options?.timeline?.dateField || "created_at",
1334
+ titleField: j.timeline?.titleField || j.options?.timeline?.titleField || "name",
1335
+ ...j.timeline?.endDateField ? { endDateField: j.timeline.endDateField } : {},
1336
+ ...j.timeline?.groupByField ? { groupByField: j.timeline.groupByField } : {},
1337
+ ...j.timeline?.colorField ? { colorField: j.timeline.colorField } : {},
1338
+ ...j.timeline?.scale ? { scale: j.timeline.scale } : {}
1322
1339
  };
1323
1340
  }
1324
1341
  case "gantt": return {
1325
1342
  type: "object-gantt",
1326
1343
  ...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 || {}
1344
+ startDateField: j.gantt?.startDateField || j.options?.gantt?.startDateField || "start_date",
1345
+ endDateField: j.gantt?.endDateField || j.options?.gantt?.endDateField || "end_date",
1346
+ progressField: j.gantt?.progressField || j.options?.gantt?.progressField || "progress",
1347
+ dependenciesField: j.gantt?.dependenciesField || j.options?.gantt?.dependenciesField || "dependencies",
1348
+ ...j.gantt?.titleField ? { titleField: j.gantt.titleField } : {},
1349
+ ...j.options?.gantt || {},
1350
+ ...j.gantt || {}
1334
1351
  };
1335
1352
  case "map": return {
1336
1353
  type: "object-map",
1337
1354
  ...t,
1338
- locationField: A.options?.map?.locationField || "location",
1339
- ...A.options?.map || {}
1355
+ locationField: j.options?.map?.locationField || "location",
1356
+ ...j.options?.map || {}
1340
1357
  };
1341
1358
  case "tree": {
1342
- let e = A.tree || A.options?.tree || {};
1359
+ let e = j.tree || j.options?.tree || {};
1343
1360
  return {
1344
1361
  type: "object-tree",
1345
1362
  ...t,
@@ -1351,7 +1368,7 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1351
1368
  };
1352
1369
  }
1353
1370
  case "chart": {
1354
- let e = A.chart || A.options?.chart || {};
1371
+ let e = j.chart || j.options?.chart || {};
1355
1372
  if (e.dataset) {
1356
1373
  let t = Array.isArray(e.dimensions) ? e.dimensions : [], n = Array.isArray(e.values) ? e.values : [];
1357
1374
  return {
@@ -1371,9 +1388,9 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1371
1388
  let t = Array.isArray(e.yAxisFields) && e.yAxisFields[0] || e.valueField || "value", n = e.xAxisField || e.categoryField || "name";
1372
1389
  return {
1373
1390
  type: "object-chart",
1374
- objectName: A.objectName,
1391
+ objectName: j.objectName,
1375
1392
  chartType: e.chartType || "bar",
1376
- filters: A.filters,
1393
+ filters: j.filters,
1377
1394
  aggregate: {
1378
1395
  field: t,
1379
1396
  function: e.aggregation || "count",
@@ -1389,16 +1406,17 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1389
1406
  }
1390
1407
  }
1391
1408
  }, [
1392
- N,
1393
- A,
1394
- L,
1409
+ P,
1410
+ j,
1411
+ R,
1395
1412
  $,
1413
+ q,
1396
1414
  J,
1397
- Y,
1398
- Gt.handleClick,
1415
+ nn.handleClick,
1399
1416
  Z.mode,
1400
- Q
1401
- ]), qt = z.conditions && z.conditions.length > 0, Jt = r.useMemo(() => {
1417
+ Q,
1418
+ jt
1419
+ ]), an = B.conditions && B.conditions.length > 0, on = i.useMemo(() => {
1402
1420
  let e, t = (e, t) => {
1403
1421
  if (!t) return;
1404
1422
  let n = Array.isArray(t) ? t.map((e) => ({
@@ -1410,17 +1428,17 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1410
1428
  label: t?.label || e,
1411
1429
  ...t
1412
1430
  }));
1413
- return A.objectName ? k(A.objectName, e, n) : n;
1431
+ return j.objectName ? A(j.objectName, e, n) : n;
1414
1432
  };
1415
1433
  if (e = W?.fields ? Object.entries(W.fields).map(([e, n]) => ({
1416
1434
  value: e,
1417
- label: j(e, n.label || e),
1435
+ label: M(e, n.label || e),
1418
1436
  type: n.type || "text",
1419
1437
  options: t(e, n.options),
1420
1438
  referenceTo: n.reference_to || n.reference,
1421
1439
  displayField: n.display_field || n.reference_field,
1422
1440
  idField: n.id_field
1423
- })) : (A.fields || []).map((e) => {
1441
+ })) : (j.fields || []).map((e) => {
1424
1442
  if (typeof e == "string") return {
1425
1443
  value: e,
1426
1444
  label: e,
@@ -1429,27 +1447,57 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1429
1447
  let n = e.name || e.fieldName;
1430
1448
  return {
1431
1449
  value: n,
1432
- label: j(n, e.label || e.name),
1450
+ label: M(n, e.label || e.name),
1433
1451
  type: e.type || "text",
1434
1452
  options: t(n, e.options),
1435
1453
  referenceTo: e.reference_to || e.reference,
1436
1454
  displayField: e.display_field || e.reference_field,
1437
1455
  idField: e.id_field
1438
1456
  };
1439
- }), A.filterableFields && A.filterableFields.length > 0) {
1440
- let t = new Set(A.filterableFields);
1457
+ }), j.filterableFields && j.filterableFields.length > 0) {
1458
+ let t = new Set(j.filterableFields);
1441
1459
  e = e.filter((e) => t.has(e.value));
1442
1460
  }
1443
1461
  return e;
1444
1462
  }, [
1445
1463
  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;
1464
+ j.fields,
1465
+ j.filterableFields,
1466
+ j.objectName,
1467
+ M,
1468
+ A
1469
+ ]), sn = i.useCallback((e) => {
1470
+ if (!Bt) return;
1471
+ let t = Vt, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || j.objectName || "export";
1472
+ if ((e === "csv" || e === "xlsx" || e === "json") && typeof V?.exportDownload == "function" && j.objectName && t?.streaming !== !1) {
1473
+ 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 = [
1474
+ ...a.length > 0 ? [a] : [],
1475
+ ...o.length > 0 ? [o] : [],
1476
+ ...s
1477
+ ].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) => ({
1478
+ field: e.field,
1479
+ direction: e.order
1480
+ })) : void 0;
1481
+ zt(null), Lt(!0), (async () => {
1482
+ try {
1483
+ let a = await V.exportDownload(j.objectName, {
1484
+ format: e,
1485
+ fields: t.length ? t : void 0,
1486
+ filter: l,
1487
+ sort: u,
1488
+ includeHeaders: r,
1489
+ limit: n > 0 ? n : void 0
1490
+ }), o = URL.createObjectURL(a), s = document.createElement("a");
1491
+ s.href = o, s.download = `${i}.${e}`, s.rel = "noopener", document.body.appendChild(s), s.click(), s.remove(), URL.revokeObjectURL(o), Ft(!1);
1492
+ } catch (e) {
1493
+ console.error("ListView export failed:", e), zt(e instanceof Error ? e.message : String(e));
1494
+ } finally {
1495
+ Lt(!1);
1496
+ }
1497
+ })();
1498
+ return;
1499
+ }
1500
+ let a = n > 0 ? H.slice(0, n) : H;
1453
1501
  if (e === "csv") {
1454
1502
  let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1455
1503
  r && t.push(e.join(",")), a.forEach((n) => {
@@ -1464,119 +1512,137 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1464
1512
  let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1465
1513
  n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
1466
1514
  }
1467
- kt(!1);
1515
+ Ft(!1);
1468
1516
  }, [
1469
- V,
1517
+ H,
1470
1518
  $,
1471
- At,
1472
- A.objectName
1473
- ]), Xt = r.useMemo(() => (A.fields || []).map((e) => {
1519
+ Vt,
1520
+ j.objectName,
1521
+ j.filters,
1522
+ Bt,
1523
+ V,
1524
+ B,
1525
+ Y,
1526
+ R
1527
+ ]), cn = i.useMemo(() => (j.fields || []).map((e) => {
1474
1528
  if (typeof e == "string") return {
1475
1529
  name: e,
1476
- label: j(e, e)
1530
+ label: M(e, e)
1477
1531
  };
1478
1532
  let t = e.name || e.fieldName || e.field;
1479
1533
  return {
1480
1534
  name: t,
1481
- label: j(t, e.label || e.name || e.field)
1535
+ label: M(t, e.label || e.name || e.field)
1482
1536
  };
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 } : {},
1537
+ }), [j.fields, M]);
1538
+ return /* @__PURE__ */ L("div", {
1539
+ ref: Gt,
1540
+ className: E("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1541
+ ...j.aria?.label ? { "aria-label": j.aria.label } : {},
1542
+ ...j.aria?.describedBy ? { "aria-describedby": j.aria.describedBy } : {},
1543
+ ...j.aria?.live ? { "aria-live": j.aria.live } : {},
1490
1544
  role: "region",
1491
- "aria-busy": H || void 0,
1492
- "data-state": H ? "loading" : "idle",
1545
+ "aria-busy": U || void 0,
1546
+ "data-state": U ? "loading" : "idle",
1493
1547
  children: [
1494
- It > 0 && /* @__PURE__ */ F("div", {
1548
+ qt > 0 && /* @__PURE__ */ I("div", {
1495
1549
  className: "flex items-center justify-center text-xs text-muted-foreground",
1496
- style: { height: It },
1497
- children: E(Ft ? "list.refreshing" : "list.pullToRefresh")
1550
+ style: { height: qt },
1551
+ children: D(Kt ? "list.refreshing" : "list.pullToRefresh")
1498
1552
  }),
1499
- A.description && A.appearance?.showDescription !== !1 && /* @__PURE__ */ F("div", {
1553
+ j.description && j.appearance?.showDescription !== !1 && /* @__PURE__ */ I("div", {
1500
1554
  className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
1501
1555
  "data-testid": "view-description",
1502
- children: typeof A.description == "string" ? A.description : ""
1556
+ children: typeof j.description == "string" ? j.description : ""
1503
1557
  }),
1504
- /* @__PURE__ */ I("div", {
1558
+ /* @__PURE__ */ L("div", {
1505
1559
  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", {
1560
+ children: [/* @__PURE__ */ I("div", {
1507
1561
  className: "flex items-center gap-2 overflow-x-auto min-w-0",
1508
- children: St && /* @__PURE__ */ F("div", {
1562
+ children: Tt && /* @__PURE__ */ I("div", {
1509
1563
  className: "shrink-0 min-w-0 overflow-x-auto",
1510
1564
  "data-testid": "user-filters",
1511
- children: /* @__PURE__ */ F(Ge, {
1512
- config: St,
1565
+ children: /* @__PURE__ */ I(qe, {
1566
+ config: Tt,
1513
1567
  objectDef: W,
1514
- data: V,
1515
- onFilterChange: xt,
1568
+ data: H,
1569
+ onFilterChange: wt,
1516
1570
  maxVisible: 3,
1517
- initialSelections: m,
1518
- onSelectionsChange: h
1571
+ initialSelections: h,
1572
+ onSelectionsChange: g
1519
1573
  })
1520
1574
  })
1521
- }), /* @__PURE__ */ I("div", {
1575
+ }), /* @__PURE__ */ L("div", {
1522
1576
  className: "flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm",
1523
1577
  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, {
1578
+ ne && /* @__PURE__ */ L(Oe, { children: [/* @__PURE__ */ I(He, {
1579
+ currentView: P,
1580
+ availableViews: $t,
1581
+ onViewChange: en
1582
+ }), /* @__PURE__ */ I("div", { className: "h-4 w-px bg-border/60 mx-0.5" })] }),
1583
+ P === "grid" && l && !N.compactToolbar && /* @__PURE__ */ L(u, {
1584
+ variant: "ghost",
1585
+ size: "sm",
1586
+ onClick: () => Nt(!jt),
1587
+ className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", jt && "text-primary"),
1588
+ title: D("list.inlineEditLabel", { defaultValue: "Edit records inline (click a cell to edit)" }),
1589
+ "data-testid": "toolbar-inline-edit-toggle",
1590
+ children: [/* @__PURE__ */ I(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1591
+ className: "hidden sm:inline",
1592
+ children: D("list.inlineEditShort", { defaultValue: "Edit inline" })
1593
+ })]
1594
+ }),
1595
+ N.showHideFields && !N.compactToolbar && /* @__PURE__ */ L(S, {
1596
+ open: kt,
1597
+ onOpenChange: At,
1598
+ children: [/* @__PURE__ */ I(w, {
1533
1599
  asChild: !0,
1534
- children: /* @__PURE__ */ I(l, {
1600
+ children: /* @__PURE__ */ L(u, {
1535
1601
  variant: "ghost",
1536
1602
  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"),
1603
+ 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
1604
  children: [
1539
- /* @__PURE__ */ F(se, { className: "h-3.5 w-3.5 mr-1.5" }),
1540
- /* @__PURE__ */ F("span", {
1605
+ /* @__PURE__ */ I(se, { className: "h-3.5 w-3.5 mr-1.5" }),
1606
+ /* @__PURE__ */ I("span", {
1541
1607
  className: "hidden sm:inline",
1542
- children: E("list.hideFields")
1608
+ children: D("list.hideFields")
1543
1609
  }),
1544
- X.size > 0 && /* @__PURE__ */ F("span", {
1610
+ X.size > 0 && /* @__PURE__ */ I("span", {
1545
1611
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1546
1612
  children: X.size
1547
1613
  })
1548
1614
  ]
1549
1615
  })
1550
- }), /* @__PURE__ */ F(C, {
1616
+ }), /* @__PURE__ */ I(C, {
1551
1617
  align: "start",
1552
1618
  className: "w-64 p-3",
1553
- children: /* @__PURE__ */ I("div", {
1619
+ children: /* @__PURE__ */ L("div", {
1554
1620
  className: "space-y-2",
1555
- children: [/* @__PURE__ */ I("div", {
1621
+ children: [/* @__PURE__ */ L("div", {
1556
1622
  className: "flex items-center justify-between border-b pb-2",
1557
- children: [/* @__PURE__ */ F("h4", {
1623
+ children: [/* @__PURE__ */ I("h4", {
1558
1624
  className: "font-medium text-sm",
1559
- children: E("list.hideFieldsTitle")
1560
- }), X.size > 0 && /* @__PURE__ */ F(l, {
1625
+ children: D("list.hideFieldsTitle")
1626
+ }), X.size > 0 && /* @__PURE__ */ I(u, {
1561
1627
  variant: "ghost",
1562
1628
  size: "sm",
1563
1629
  className: "h-6 px-2 text-xs",
1564
- onClick: () => Tt(/* @__PURE__ */ new Set()),
1565
- children: E("list.showAll")
1630
+ onClick: () => Ot(/* @__PURE__ */ new Set()),
1631
+ children: D("list.showAll")
1566
1632
  })]
1567
- }), /* @__PURE__ */ F("div", {
1633
+ }), /* @__PURE__ */ I("div", {
1568
1634
  className: "max-h-60 overflow-y-auto space-y-1",
1569
- children: Xt.map((e) => /* @__PURE__ */ I("label", {
1635
+ children: cn.map((e) => /* @__PURE__ */ L("label", {
1570
1636
  className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
1571
- children: [/* @__PURE__ */ F("input", {
1637
+ children: [/* @__PURE__ */ I("input", {
1572
1638
  type: "checkbox",
1573
1639
  checked: !X.has(e.name),
1574
1640
  onChange: () => {
1575
1641
  let t = new Set(X);
1576
- t.has(e.name) ? t.delete(e.name) : t.add(e.name), Tt(t);
1642
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), Ot(t);
1577
1643
  },
1578
1644
  className: "rounded border-input"
1579
- }), /* @__PURE__ */ F("span", {
1645
+ }), /* @__PURE__ */ I("span", {
1580
1646
  className: "truncate",
1581
1647
  children: e.label
1582
1648
  })]
@@ -1585,204 +1651,204 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1585
1651
  })
1586
1652
  })]
1587
1653
  }),
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, {
1654
+ 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" }),
1655
+ N.showFilters && /* @__PURE__ */ L(S, {
1656
+ open: Ve,
1657
+ onOpenChange: z,
1658
+ children: [/* @__PURE__ */ I(w, {
1593
1659
  asChild: !0,
1594
- children: /* @__PURE__ */ I(l, {
1660
+ children: /* @__PURE__ */ L(u, {
1595
1661
  variant: "ghost",
1596
1662
  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"),
1663
+ className: E("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", an && "text-foreground font-medium"),
1598
1664
  children: [
1599
- /* @__PURE__ */ F(Se, { className: "h-3.5 w-3.5 mr-1.5" }),
1600
- /* @__PURE__ */ F("span", {
1665
+ /* @__PURE__ */ I(we, { className: "h-3.5 w-3.5 mr-1.5" }),
1666
+ /* @__PURE__ */ I("span", {
1601
1667
  className: "hidden sm:inline",
1602
- children: E("list.filter")
1668
+ children: D("list.filter")
1603
1669
  }),
1604
- qt && /* @__PURE__ */ F("span", {
1670
+ an && /* @__PURE__ */ I("span", {
1605
1671
  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
1672
+ children: B.conditions?.length || 0
1607
1673
  })
1608
1674
  ]
1609
1675
  })
1610
- }), /* @__PURE__ */ F(C, {
1676
+ }), /* @__PURE__ */ I(C, {
1611
1677
  align: "start",
1612
1678
  className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
1613
- children: /* @__PURE__ */ I("div", {
1679
+ children: /* @__PURE__ */ L("div", {
1614
1680
  className: "space-y-4",
1615
- children: [/* @__PURE__ */ F("div", {
1681
+ children: [/* @__PURE__ */ I("div", {
1616
1682
  className: "flex items-center justify-between border-b pb-2",
1617
- children: /* @__PURE__ */ F("h4", {
1683
+ children: /* @__PURE__ */ I("h4", {
1618
1684
  className: "font-medium text-sm",
1619
- children: E("list.filterRecords")
1685
+ children: D("list.filterRecords")
1620
1686
  })
1621
- }), /* @__PURE__ */ F(_, {
1622
- fields: Jt,
1623
- value: z,
1687
+ }), /* @__PURE__ */ I(v, {
1688
+ fields: on,
1689
+ value: B,
1624
1690
  onChange: (e) => {
1625
- Ve(e), a && a(e);
1691
+ Ue(e), a && a(e);
1626
1692
  }
1627
1693
  })]
1628
1694
  })
1629
1695
  })]
1630
1696
  }),
1631
- M.showGroup && !M.compactToolbar && /* @__PURE__ */ I(S, {
1632
- open: dt,
1633
- onOpenChange: ft,
1634
- children: [/* @__PURE__ */ F(w, {
1697
+ N.showGroup && !N.compactToolbar && /* @__PURE__ */ L(S, {
1698
+ open: ht,
1699
+ onOpenChange: gt,
1700
+ children: [/* @__PURE__ */ I(w, {
1635
1701
  asChild: !0,
1636
- children: /* @__PURE__ */ I(l, {
1702
+ children: /* @__PURE__ */ L(u, {
1637
1703
  variant: "ghost",
1638
1704
  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"),
1705
+ 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
1706
  children: [
1641
- /* @__PURE__ */ F(le, { className: "h-3.5 w-3.5 mr-1.5" }),
1642
- /* @__PURE__ */ F("span", {
1707
+ /* @__PURE__ */ I(le, { className: "h-3.5 w-3.5 mr-1.5" }),
1708
+ /* @__PURE__ */ I("span", {
1643
1709
  className: "hidden sm:inline",
1644
- children: E("list.group")
1710
+ children: D("list.group")
1645
1711
  }),
1646
- J && J.fields?.length > 0 && /* @__PURE__ */ F("span", {
1712
+ q && q.fields?.length > 0 && /* @__PURE__ */ I("span", {
1647
1713
  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
1714
+ children: q.fields.length
1649
1715
  })
1650
1716
  ]
1651
1717
  })
1652
- }), /* @__PURE__ */ F(C, {
1718
+ }), /* @__PURE__ */ I(C, {
1653
1719
  align: "start",
1654
1720
  className: "w-72 p-3",
1655
- children: /* @__PURE__ */ I("div", {
1721
+ children: /* @__PURE__ */ L("div", {
1656
1722
  className: "space-y-2",
1657
- children: [/* @__PURE__ */ I("div", {
1723
+ children: [/* @__PURE__ */ L("div", {
1658
1724
  className: "flex items-center justify-between border-b pb-2",
1659
- children: [/* @__PURE__ */ F("h4", {
1725
+ children: [/* @__PURE__ */ I("h4", {
1660
1726
  className: "font-medium text-sm",
1661
- children: E("list.groupBy")
1662
- }), J && /* @__PURE__ */ F(l, {
1727
+ children: D("list.groupBy")
1728
+ }), q && /* @__PURE__ */ I(u, {
1663
1729
  variant: "ghost",
1664
1730
  size: "sm",
1665
1731
  className: "h-6 px-2 text-xs",
1666
- onClick: () => ut(void 0),
1732
+ onClick: () => mt(void 0),
1667
1733
  "data-testid": "clear-grouping",
1668
- children: E("list.clear")
1734
+ children: D("list.clear")
1669
1735
  })]
1670
- }), /* @__PURE__ */ F("div", {
1736
+ }), /* @__PURE__ */ I("div", {
1671
1737
  "data-testid": "group-field-list",
1672
- children: /* @__PURE__ */ F(v, {
1673
- value: J,
1674
- fieldOptions: Xt.map((e) => ({
1738
+ children: /* @__PURE__ */ I(ee, {
1739
+ value: q,
1740
+ fieldOptions: cn.map((e) => ({
1675
1741
  value: e.name,
1676
1742
  label: e.label || e.name
1677
1743
  })),
1678
1744
  maxLevels: 3,
1679
1745
  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" })
1746
+ addGroup: D("list.addGroup", { defaultValue: "Add group field" }),
1747
+ collapseTitle: D("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
1748
+ removeTitle: D("list.removeGroup", { defaultValue: "Remove" })
1683
1749
  },
1684
- onChange: (e) => ut(e)
1750
+ onChange: (e) => mt(e)
1685
1751
  })
1686
1752
  })]
1687
1753
  })
1688
1754
  })]
1689
1755
  }),
1690
- M.showSort && /* @__PURE__ */ I(S, {
1691
- open: je,
1692
- onOpenChange: Me,
1693
- children: [/* @__PURE__ */ F(w, {
1756
+ N.showSort && /* @__PURE__ */ L(S, {
1757
+ open: Ne,
1758
+ onOpenChange: Pe,
1759
+ children: [/* @__PURE__ */ I(w, {
1694
1760
  asChild: !0,
1695
- children: /* @__PURE__ */ I(l, {
1761
+ children: /* @__PURE__ */ L(u, {
1696
1762
  variant: "ghost",
1697
1763
  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"),
1764
+ 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
1765
  children: [
1700
- /* @__PURE__ */ F(ie, { className: "h-3.5 w-3.5 mr-1.5" }),
1701
- /* @__PURE__ */ F("span", {
1766
+ /* @__PURE__ */ I(ie, { className: "h-3.5 w-3.5 mr-1.5" }),
1767
+ /* @__PURE__ */ I("span", {
1702
1768
  className: "hidden sm:inline",
1703
- children: E("list.sort")
1769
+ children: D("list.sort")
1704
1770
  }),
1705
- L.length > 0 && /* @__PURE__ */ F("span", {
1771
+ R.length > 0 && /* @__PURE__ */ I("span", {
1706
1772
  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
1773
+ children: R.length
1708
1774
  })
1709
1775
  ]
1710
1776
  })
1711
- }), /* @__PURE__ */ F(C, {
1777
+ }), /* @__PURE__ */ I(C, {
1712
1778
  align: "start",
1713
1779
  className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
1714
- children: /* @__PURE__ */ I("div", {
1780
+ children: /* @__PURE__ */ L("div", {
1715
1781
  className: "space-y-4",
1716
- children: [/* @__PURE__ */ F("div", {
1782
+ children: [/* @__PURE__ */ I("div", {
1717
1783
  className: "flex items-center justify-between border-b pb-2",
1718
- children: /* @__PURE__ */ F("h4", {
1784
+ children: /* @__PURE__ */ I("h4", {
1719
1785
  className: "font-medium text-sm",
1720
- children: E("list.sortRecords")
1786
+ children: D("list.sortRecords")
1721
1787
  })
1722
- }), /* @__PURE__ */ F(te, {
1723
- fields: Jt,
1724
- value: L,
1788
+ }), /* @__PURE__ */ I(T, {
1789
+ fields: on,
1790
+ value: R,
1725
1791
  onChange: (e) => {
1726
- Le(e), o && o(e);
1792
+ ze(e), o && o(e);
1727
1793
  }
1728
1794
  })]
1729
1795
  })
1730
1796
  })]
1731
1797
  }),
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, {
1798
+ !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" }),
1799
+ N.showColor && !N.compactToolbar && /* @__PURE__ */ L(S, {
1800
+ open: yt,
1801
+ onOpenChange: bt,
1802
+ children: [/* @__PURE__ */ I(w, {
1737
1803
  asChild: !0,
1738
- children: /* @__PURE__ */ I(l, {
1804
+ children: /* @__PURE__ */ L(u, {
1739
1805
  variant: "ghost",
1740
1806
  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", {
1807
+ 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"),
1808
+ children: [/* @__PURE__ */ I(pe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1743
1809
  className: "hidden sm:inline",
1744
- children: E("list.color")
1810
+ children: D("list.color")
1745
1811
  })]
1746
1812
  })
1747
- }), /* @__PURE__ */ F(C, {
1813
+ }), /* @__PURE__ */ I(C, {
1748
1814
  align: "start",
1749
1815
  className: "w-64 p-3",
1750
- children: /* @__PURE__ */ I("div", {
1816
+ children: /* @__PURE__ */ L("div", {
1751
1817
  className: "space-y-2",
1752
- children: [/* @__PURE__ */ I("div", {
1818
+ children: [/* @__PURE__ */ L("div", {
1753
1819
  className: "flex items-center justify-between border-b pb-2",
1754
- children: [/* @__PURE__ */ F("h4", {
1820
+ children: [/* @__PURE__ */ I("h4", {
1755
1821
  className: "font-medium text-sm",
1756
- children: E("list.rowColor")
1757
- }), Y && /* @__PURE__ */ F(l, {
1822
+ children: D("list.rowColor")
1823
+ }), J && /* @__PURE__ */ I(u, {
1758
1824
  variant: "ghost",
1759
1825
  size: "sm",
1760
1826
  className: "h-6 px-2 text-xs",
1761
- onClick: () => mt(void 0),
1827
+ onClick: () => vt(void 0),
1762
1828
  "data-testid": "clear-row-color",
1763
- children: E("list.clear")
1829
+ children: D("list.clear")
1764
1830
  })]
1765
- }), /* @__PURE__ */ I("div", {
1831
+ }), /* @__PURE__ */ L("div", {
1766
1832
  className: "space-y-2",
1767
1833
  "data-testid": "color-field-list",
1768
- children: [/* @__PURE__ */ F("label", {
1834
+ children: [/* @__PURE__ */ I("label", {
1769
1835
  className: "text-xs text-muted-foreground",
1770
- children: E("list.colorByField")
1771
- }), /* @__PURE__ */ I("select", {
1836
+ children: D("list.colorByField")
1837
+ }), /* @__PURE__ */ L("select", {
1772
1838
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
1773
- value: Y?.field || "",
1839
+ value: J?.field || "",
1774
1840
  onChange: (e) => {
1775
1841
  let t = e.target.value;
1776
- mt(t ? {
1842
+ vt(t ? {
1777
1843
  field: t,
1778
- colors: Y?.colors || {}
1844
+ colors: J?.colors || {}
1779
1845
  } : void 0);
1780
1846
  },
1781
1847
  "data-testid": "color-field-select",
1782
- children: [/* @__PURE__ */ F("option", {
1848
+ children: [/* @__PURE__ */ I("option", {
1783
1849
  value: "",
1784
- children: E("list.none")
1785
- }), Xt.map((e) => /* @__PURE__ */ F("option", {
1850
+ children: D("list.none")
1851
+ }), cn.map((e) => /* @__PURE__ */ I("option", {
1786
1852
  value: e.name,
1787
1853
  children: e.label
1788
1854
  }, e.name))]
@@ -1791,185 +1857,194 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1791
1857
  })
1792
1858
  })]
1793
1859
  }),
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", {
1860
+ N.showDensity && !N.compactToolbar && P !== "gallery" && (() => {
1861
+ 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
1862
  defaultValue: "{{label}} (click to cycle)",
1797
1863
  label: n
1798
1864
  });
1799
- return /* @__PURE__ */ F(l, {
1865
+ return /* @__PURE__ */ I(u, {
1800
1866
  variant: "ghost",
1801
1867
  size: "sm",
1802
1868
  "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"),
1869
+ 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
1870
  onClick: Z.cycle,
1805
1871
  title: r,
1806
- children: /* @__PURE__ */ F(e, { className: "h-3.5 w-3.5" })
1872
+ children: /* @__PURE__ */ I(e, { className: "h-3.5 w-3.5" })
1807
1873
  });
1808
1874
  })(),
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", {
1875
+ N.showDensity && !N.compactToolbar && P === "gallery" && (() => {
1876
+ 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
1877
  defaultValue: "{{label}} (click to cycle)",
1812
1878
  label: n
1813
1879
  });
1814
- return /* @__PURE__ */ F(l, {
1880
+ return /* @__PURE__ */ I(u, {
1815
1881
  variant: "ghost",
1816
1882
  size: "sm",
1817
1883
  "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,
1884
+ 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"),
1885
+ onClick: Wt,
1820
1886
  title: r,
1821
- children: /* @__PURE__ */ F(e, { className: "h-3.5 w-3.5" })
1887
+ children: /* @__PURE__ */ I(e, { className: "h-3.5 w-3.5" })
1822
1888
  });
1823
1889
  })(),
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,
1890
+ N.compactToolbar && (N.showGroup || N.showColor || N.showDensity || N.showHideFields) && /* @__PURE__ */ I(We, {
1891
+ t: D,
1892
+ allFields: cn,
1893
+ showGroup: N.showGroup,
1894
+ groupingConfig: q,
1895
+ setGroupingConfig: mt,
1896
+ showColor: N.showColor,
1897
+ rowColorConfig: J,
1898
+ setRowColorConfig: vt,
1899
+ showDensity: N.showDensity,
1834
1900
  density: Z,
1835
- showHideFields: M.showHideFields,
1901
+ showHideFields: N.showHideFields,
1836
1902
  hiddenFields: X,
1837
- updateHiddenFields: Tt
1903
+ updateHiddenFields: Ot,
1904
+ showInlineEdit: P === "grid",
1905
+ inlineEdit: jt,
1906
+ setInlineEdit: Nt
1838
1907
  }),
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, {
1908
+ (N.showColor || N.showDensity || N.compactToolbar) && Vt && Bt && /* @__PURE__ */ I("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1909
+ Vt && Bt && /* @__PURE__ */ L(S, {
1910
+ open: Pt,
1911
+ onOpenChange: Ft,
1912
+ children: [/* @__PURE__ */ I(w, {
1844
1913
  asChild: !0,
1845
- children: /* @__PURE__ */ I(l, {
1914
+ children: /* @__PURE__ */ L(u, {
1846
1915
  variant: "ghost",
1847
1916
  size: "sm",
1848
1917
  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", {
1918
+ children: [/* @__PURE__ */ I(oe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1850
1919
  className: "hidden sm:inline",
1851
- children: E("list.export")
1920
+ children: D("list.export")
1852
1921
  })]
1853
1922
  })
1854
- }), /* @__PURE__ */ F(C, {
1923
+ }), /* @__PURE__ */ I(C, {
1855
1924
  align: "start",
1856
1925
  className: "w-48 p-2",
1857
- children: /* @__PURE__ */ F("div", {
1926
+ children: /* @__PURE__ */ L("div", {
1858
1927
  className: "space-y-1",
1859
- children: (At.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ I(l, {
1928
+ children: [(Vt.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ L(u, {
1860
1929
  variant: "ghost",
1861
1930
  size: "sm",
1862
1931
  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))
1932
+ disabled: It,
1933
+ onClick: () => sn(e),
1934
+ children: [It ? /* @__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() })]
1935
+ }, e)), Rt && /* @__PURE__ */ I("div", {
1936
+ className: "px-2 py-1 text-xs",
1937
+ style: { color: "var(--destructive, #ef4444)" },
1938
+ role: "alert",
1939
+ children: Rt
1940
+ })]
1866
1941
  })
1867
1942
  })]
1868
1943
  }),
1869
- (A.sharing?.enabled || A.sharing?.type) && /* @__PURE__ */ I(l, {
1944
+ (j.sharing?.enabled || j.sharing?.type) && /* @__PURE__ */ L(u, {
1870
1945
  variant: "ghost",
1871
1946
  size: "sm",
1872
1947
  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"}`,
1948
+ title: `Sharing: ${j.sharing?.visibility || j.sharing?.type || "private"}`,
1874
1949
  "data-testid": "share-button",
1875
- children: [/* @__PURE__ */ F(xe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ F("span", {
1950
+ children: [/* @__PURE__ */ I(Ce, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1876
1951
  className: "hidden sm:inline",
1877
- children: E("list.share")
1952
+ children: D("list.share")
1878
1953
  })]
1879
1954
  }),
1880
- A.allowPrinting && /* @__PURE__ */ I(l, {
1955
+ j.allowPrinting && /* @__PURE__ */ L(u, {
1881
1956
  variant: "ghost",
1882
1957
  size: "sm",
1883
1958
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1884
1959
  onClick: () => window.print(),
1885
1960
  "data-testid": "print-button",
1886
- children: [/* @__PURE__ */ F(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ F("span", {
1961
+ children: [/* @__PURE__ */ I(ge, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1887
1962
  className: "hidden sm:inline",
1888
- children: E("list.print")
1963
+ children: D("list.print")
1889
1964
  })]
1890
1965
  }),
1891
1966
  (() => {
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;
1967
+ let e = j.allowPrinting || j.sharing?.enabled || j.sharing?.type || Vt && Bt;
1968
+ return N.showSearch && e ? /* @__PURE__ */ I("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }) : null;
1894
1969
  })(),
1895
- M.showSearch && /* @__PURE__ */ I(S, {
1896
- open: De,
1897
- onOpenChange: Oe,
1898
- children: [/* @__PURE__ */ F(w, {
1970
+ N.showSearch && /* @__PURE__ */ L(S, {
1971
+ open: ke,
1972
+ onOpenChange: Ae,
1973
+ children: [/* @__PURE__ */ I(w, {
1899
1974
  asChild: !0,
1900
- children: /* @__PURE__ */ F(l, {
1975
+ children: /* @__PURE__ */ I(u, {
1901
1976
  variant: "ghost",
1902
1977
  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"),
1978
+ 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
1979
  "data-testid": "search-icon-button",
1905
- title: E("list.search"),
1906
- children: /* @__PURE__ */ F(ye, { className: "h-3.5 w-3.5" })
1980
+ title: D("list.search"),
1981
+ children: /* @__PURE__ */ I(xe, { className: "h-3.5 w-3.5" })
1907
1982
  })
1908
- }), /* @__PURE__ */ F(C, {
1983
+ }), /* @__PURE__ */ I(C, {
1909
1984
  align: "end",
1910
1985
  className: "w-[calc(100vw-2rem)] sm:w-64 p-2",
1911
1986
  "data-testid": "search-popover",
1912
- children: /* @__PURE__ */ I("div", {
1987
+ children: /* @__PURE__ */ L("div", {
1913
1988
  className: "relative",
1914
1989
  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),
1990
+ /* @__PURE__ */ I(xe, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1991
+ /* @__PURE__ */ I(y, {
1992
+ placeholder: D("list.search") + "...",
1993
+ value: F,
1994
+ onChange: (e) => tn(e.target.value),
1920
1995
  className: "pl-7 h-8 text-xs",
1921
1996
  autoFocus: !0
1922
1997
  }),
1923
- P && /* @__PURE__ */ F(l, {
1998
+ F && /* @__PURE__ */ I(u, {
1924
1999
  variant: "ghost",
1925
2000
  size: "sm",
1926
2001
  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" })
2002
+ onClick: () => tn(""),
2003
+ children: /* @__PURE__ */ I(Ee, { className: "h-3 w-3" })
1929
2004
  })
1930
2005
  ]
1931
2006
  })
1932
2007
  })]
1933
2008
  }),
1934
- M.showAddRecord && M.addRecordPosition === "top" && /* @__PURE__ */ I(l, {
2009
+ N.showAddRecord && N.addRecordPosition === "top" && /* @__PURE__ */ L(u, {
1935
2010
  variant: "ghost",
1936
2011
  size: "sm",
1937
2012
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1938
2013
  "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", {
2014
+ onClick: () => _.onAddRecord?.(),
2015
+ children: [/* @__PURE__ */ I(he, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1941
2016
  className: "hidden sm:inline",
1942
- children: E("list.addRecord")
2017
+ children: D("list.addRecord")
1943
2018
  })]
1944
2019
  })
1945
2020
  ]
1946
2021
  })]
1947
2022
  }),
1948
- /* @__PURE__ */ I("div", {
2023
+ /* @__PURE__ */ L("div", {
1949
2024
  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, {
2025
+ children: [/* @__PURE__ */ I(te, { active: U && H.length > 0 }), Ke && H.length === 0 ? /* @__PURE__ */ I(p, {
1951
2026
  "data-testid": "list-error-state",
1952
2027
  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" }),
2028
+ icon: /* @__PURE__ */ I(re, { className: "h-12 w-12 text-destructive/60" }),
1954
2029
  iconWrapperClassName: "mb-3",
1955
- title: E("list.loadErrorTitle"),
1956
- description: E("list.loadErrorMessage"),
1957
- action: /* @__PURE__ */ I(l, {
2030
+ title: D("list.loadErrorTitle"),
2031
+ description: D("list.loadErrorMessage"),
2032
+ action: /* @__PURE__ */ L(u, {
1958
2033
  variant: "outline",
1959
2034
  size: "sm",
1960
2035
  "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")]
2036
+ onClick: () => rt((e) => e + 1),
2037
+ children: [/* @__PURE__ */ I(_e, { className: "h-4 w-4 mr-1.5" }), D("list.retry")]
1963
2038
  })
1964
- }) : H && V.length === 0 ? /* @__PURE__ */ I("div", {
2039
+ }) : U && H.length === 0 ? /* @__PURE__ */ L("div", {
1965
2040
  className: "flex flex-col h-full min-h-[200px] p-4 gap-2",
1966
2041
  "data-testid": "list-loading",
1967
2042
  role: "status",
1968
2043
  "aria-live": "polite",
1969
2044
  "aria-busy": "true",
1970
- children: [/* @__PURE__ */ F("span", {
2045
+ children: [/* @__PURE__ */ I("span", {
1971
2046
  className: "sr-only",
1972
- children: E("list.loading")
2047
+ children: D("list.loading")
1973
2048
  }), [
1974
2049
  0,
1975
2050
  1,
@@ -1977,122 +2052,122 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
1977
2052
  3,
1978
2053
  4,
1979
2054
  5
1980
- ].map((e) => /* @__PURE__ */ F("div", {
2055
+ ].map((e) => /* @__PURE__ */ I("div", {
1981
2056
  className: "h-9 rounded bg-muted/60 animate-pulse",
1982
2057
  style: { opacity: Math.max(.25, 1 - e * .12) }
1983
2058
  }, 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, {
2059
+ }) : !U && H.length === 0 && P === "grid" ? (() => {
2060
+ 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");
2061
+ return /* @__PURE__ */ I(p, {
1987
2062
  "data-testid": "empty-state",
1988
2063
  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" }),
2064
+ icon: /* @__PURE__ */ I(t, { className: "h-12 w-12 text-muted-foreground/50" }),
1990
2065
  iconWrapperClassName: "mb-3",
1991
2066
  title: r,
1992
2067
  description: i,
1993
- action: M.showAddRecord ? /* @__PURE__ */ I(l, {
2068
+ action: N.showAddRecord ? /* @__PURE__ */ L(u, {
1994
2069
  variant: "default",
1995
2070
  size: "sm",
1996
2071
  "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")]
2072
+ onClick: () => _.onAddRecord?.(),
2073
+ children: [/* @__PURE__ */ I(he, { className: "h-4 w-4 mr-1.5" }), D("list.addRecord")]
1999
2074
  }) : void 0
2000
2075
  });
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 ? {
2076
+ })() : /* @__PURE__ */ I(Me, {
2077
+ schema: rn,
2078
+ ..._,
2079
+ data: H,
2080
+ loading: U,
2081
+ onRowSelect: St,
2082
+ ...P === "grid" && !q?.fields?.length && ft != null ? {
2008
2083
  manualPagination: !0,
2009
- rowCount: ct,
2010
- page: ot,
2011
- pageSize: K,
2012
- onPageChange: (e) => st(e),
2084
+ rowCount: ft,
2085
+ page: ut,
2086
+ pageSize: G,
2087
+ onPageChange: (e) => dt(e),
2013
2088
  onPageSizeChange: (e) => {
2014
- at(e), st(1);
2089
+ lt(e), dt(1);
2015
2090
  }
2016
2091
  } : {}
2017
2092
  })]
2018
- }, N),
2019
- M.showAddRecord && M.addRecordPosition === "bottom" && /* @__PURE__ */ F("div", {
2093
+ }, P),
2094
+ N.showAddRecord && N.addRecordPosition === "bottom" && /* @__PURE__ */ I("div", {
2020
2095
  className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
2021
- children: /* @__PURE__ */ I(l, {
2096
+ children: /* @__PURE__ */ L(u, {
2022
2097
  variant: "ghost",
2023
2098
  size: "sm",
2024
2099
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
2025
2100
  "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", {
2101
+ onClick: () => _.onAddRecord?.(),
2102
+ children: [/* @__PURE__ */ I(he, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
2028
2103
  className: "hidden sm:inline",
2029
- children: E("list.addRecord")
2104
+ children: D("list.addRecord")
2030
2105
  })]
2031
2106
  })
2032
2107
  }),
2033
- A.bulkActions && A.bulkActions.length > 0 && _t.length > 0 && N !== "grid" && /* @__PURE__ */ I("div", {
2108
+ j.bulkActions && j.bulkActions.length > 0 && xt.length > 0 && P !== "grid" && /* @__PURE__ */ L("div", {
2034
2109
  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
2110
  role: "region",
2036
2111
  "aria-label": "Bulk actions",
2037
2112
  "data-testid": "bulk-actions-bar",
2038
2113
  children: [
2039
- /* @__PURE__ */ F(ae, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
2040
- /* @__PURE__ */ I("span", {
2114
+ /* @__PURE__ */ I(ae, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
2115
+ /* @__PURE__ */ L("span", {
2041
2116
  className: "font-medium",
2042
2117
  children: [
2043
- _t.length,
2118
+ xt.length,
2044
2119
  " ",
2045
- _t.length === 1 ? "item" : "items",
2120
+ xt.length === 1 ? "item" : "items",
2046
2121
  " selected"
2047
2122
  ]
2048
2123
  }),
2049
- /* @__PURE__ */ F("div", {
2124
+ /* @__PURE__ */ I("div", {
2050
2125
  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, {
2126
+ children: j.bulkActions.map((e) => {
2127
+ let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? Te : null;
2128
+ return /* @__PURE__ */ L(u, {
2054
2129
  variant: n ? "destructive" : "outline",
2055
2130
  size: "sm",
2056
2131
  className: "h-7 px-2.5 text-xs gap-1.5",
2057
- onClick: () => g.onBulkAction?.(e, _t),
2132
+ onClick: () => _.onBulkAction?.(e, xt),
2058
2133
  "data-testid": `bulk-action-${e}`,
2059
- children: [r && /* @__PURE__ */ F(r, { className: "h-3 w-3" }), ce(e)]
2134
+ children: [r && /* @__PURE__ */ I(r, { className: "h-3 w-3" }), ce(e)]
2060
2135
  }, e);
2061
2136
  })
2062
2137
  }),
2063
- /* @__PURE__ */ I(l, {
2138
+ /* @__PURE__ */ L(u, {
2064
2139
  variant: "ghost",
2065
2140
  size: "sm",
2066
2141
  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"]
2142
+ onClick: () => St([]),
2143
+ children: [/* @__PURE__ */ I(Ee, { className: "h-3 w-3" }), "Clear"]
2069
2144
  })
2070
2145
  ]
2071
2146
  }),
2072
- !H && V.length > 0 && A.showRecordCount !== !1 && /* @__PURE__ */ I("div", {
2147
+ !U && H.length > 0 && j.showRecordCount !== !1 && /* @__PURE__ */ L("div", {
2073
2148
  className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
2074
2149
  "data-testid": "record-count-bar",
2075
2150
  children: [
2076
- /* @__PURE__ */ F("span", {
2151
+ /* @__PURE__ */ I("span", {
2077
2152
  className: "font-medium text-foreground/80",
2078
- children: V.length === 1 ? E("list.recordCountOne", { count: V.length }) : E("list.recordCount", { count: V.length })
2153
+ children: H.length === 1 ? D("list.recordCountOne", { count: H.length }) : D("list.recordCount", { count: H.length })
2079
2154
  }),
2080
- nt && /* @__PURE__ */ F("span", {
2155
+ ot && /* @__PURE__ */ I("span", {
2081
2156
  className: "text-amber-600",
2082
2157
  "data-testid": "data-limit-warning",
2083
- children: E("list.dataLimitReached", { limit: K })
2158
+ children: D("list.dataLimitReached", { limit: G })
2084
2159
  }),
2085
- N !== "grid" && A.pagination?.pageSizeOptions && A.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ I("div", {
2160
+ P !== "grid" && j.pagination?.pageSizeOptions && j.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ L("div", {
2086
2161
  className: "ml-auto flex items-center gap-2",
2087
- children: [/* @__PURE__ */ F("span", { children: E("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ F("select", {
2162
+ children: [/* @__PURE__ */ I("span", { children: D("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ I("select", {
2088
2163
  "data-testid": "page-size-selector",
2089
2164
  className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
2090
- value: String(K),
2165
+ value: String(G),
2091
2166
  onChange: (e) => {
2092
2167
  let t = Number(e.target.value);
2093
- at(t), g.onPageSizeChange && g.onPageSizeChange(t);
2168
+ lt(t), _.onPageSizeChange && _.onPageSizeChange(t);
2094
2169
  },
2095
- children: A.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ F("option", {
2170
+ children: j.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ I("option", {
2096
2171
  value: String(e),
2097
2172
  children: e
2098
2173
  }, e))
@@ -2100,17 +2175,17 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
2100
2175
  })
2101
2176
  ]
2102
2177
  }),
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", {
2178
+ nn.isOverlay && /* @__PURE__ */ I(x, {
2179
+ ...nn,
2180
+ title: j.label ? `${j.label} Detail` : j.objectName ? `${j.objectName.charAt(0).toUpperCase() + j.objectName.slice(1)} Detail` : "Record Detail",
2181
+ children: (e) => /* @__PURE__ */ I("div", {
2107
2182
  className: "space-y-3",
2108
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ I("div", {
2183
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ L("div", {
2109
2184
  className: "flex flex-col",
2110
- children: [/* @__PURE__ */ F("span", {
2185
+ children: [/* @__PURE__ */ I("span", {
2111
2186
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
2112
2187
  children: e.replace(/_/g, " ")
2113
- }), /* @__PURE__ */ F("span", {
2188
+ }), /* @__PURE__ */ I("span", {
2114
2189
  className: "text-sm",
2115
2190
  children: String(t ?? "—")
2116
2191
  })]
@@ -2120,24 +2195,24 @@ var nt = r.forwardRef(({ schema: e, className: n, onViewChange: i, onFilterChang
2120
2195
  ]
2121
2196
  });
2122
2197
  });
2123
- nt.displayName = "ListView";
2198
+ ot.displayName = "ListView";
2124
2199
  //#endregion
2125
2200
  //#region src/ObjectGallery.tsx
2126
- var rt = {
2201
+ var st = {
2127
2202
  small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
2128
2203
  medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
2129
2204
  large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
2130
- }, it = {
2205
+ }, ct = {
2131
2206
  small: "aspect-square",
2132
2207
  medium: "aspect-[4/3]",
2133
2208
  large: "aspect-[16/10]"
2134
- }, at = new Set([
2209
+ }, lt = /* @__PURE__ */ new Set([
2135
2210
  "number",
2136
2211
  "currency",
2137
2212
  "percent",
2138
2213
  "integer",
2139
2214
  "decimal"
2140
- ]), K = [
2215
+ ]), G = [
2141
2216
  {
2142
2217
  bg: "from-indigo-500/15 via-indigo-500/5 to-purple-500/10",
2143
2218
  ring: "ring-indigo-500/15",
@@ -2169,61 +2244,61 @@ var rt = {
2169
2244
  text: "text-violet-600/70 dark:text-violet-300/70"
2170
2245
  }
2171
2246
  ];
2172
- function ot(e) {
2247
+ function ut(e) {
2173
2248
  let t = 5381;
2174
2249
  for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n);
2175
- return K[Math.abs(t) % K.length];
2250
+ return G[Math.abs(t) % G.length];
2176
2251
  }
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),
2252
+ var dt = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, hidden: a }) => {
2253
+ let [o, s] = l(!1), c = !!e && !o;
2254
+ return /* @__PURE__ */ I("div", {
2255
+ className: E("w-full overflow-hidden relative", r),
2181
2256
  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", {
2257
+ children: c ? n === "contain" ? /* @__PURE__ */ I("div", {
2258
+ className: E("flex h-full w-full items-center justify-center bg-gradient-to-br", i.bg),
2259
+ children: /* @__PURE__ */ I("img", {
2185
2260
  src: e,
2186
2261
  alt: t,
2187
2262
  loading: "lazy",
2188
2263
  onError: () => s(!0),
2189
2264
  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
2265
  })
2191
- }) : /* @__PURE__ */ F("img", {
2266
+ }) : /* @__PURE__ */ I("img", {
2192
2267
  src: e,
2193
2268
  alt: t,
2194
2269
  loading: "lazy",
2195
2270
  onError: () => s(!0),
2196
2271
  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),
2272
+ }) : /* @__PURE__ */ I("div", {
2273
+ className: E("flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset", i.bg, i.ring),
2274
+ children: /* @__PURE__ */ I("span", {
2275
+ className: E("text-5xl font-semibold tracking-tight opacity-90", i.text),
2201
2276
  children: t[0]?.toUpperCase()
2202
2277
  })
2203
2278
  })
2204
2279
  });
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", {
2280
+ }, ft = ({ imageUrl: e, title: t, placeholder: n }) => {
2281
+ let [r, i] = l(!1), a = !!e && !r;
2282
+ return /* @__PURE__ */ I("div", {
2283
+ 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),
2284
+ children: a ? /* @__PURE__ */ I("img", {
2210
2285
  src: e,
2211
2286
  alt: t,
2212
2287
  loading: "lazy",
2213
2288
  onError: () => i(!0),
2214
2289
  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),
2290
+ }) : /* @__PURE__ */ I("span", {
2291
+ className: E("text-base font-semibold", n.text),
2217
2292
  children: t[0]?.toUpperCase()
2218
2293
  })
2219
2294
  });
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({
2295
+ }, pt = (e) => {
2296
+ 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
2297
  navigation: n.navigation,
2223
2298
  objectName: n.objectName,
2224
2299
  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 };
2300
+ }), 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) => {
2301
+ let t = v?.fields?.[e], r = { name: e };
2227
2302
  if (t) {
2228
2303
  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
2304
  let e = t.reference_to || t.reference;
@@ -2242,34 +2317,34 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2242
2317
  };
2243
2318
  })), r;
2244
2319
  }, [
2245
- _,
2320
+ v,
2246
2321
  n.objectName,
2247
2322
  ne,
2248
2323
  re
2249
2324
  ]);
2250
- o(() => {
2325
+ s(() => {
2251
2326
  let e = !0;
2252
2327
  return (async () => {
2253
- if (!(!l || typeof l.getObjectSchema != "function" || !n.objectName)) try {
2254
- let t = await l.getObjectSchema(n.objectName);
2255
- e && v(t);
2328
+ if (!(!u || typeof u.getObjectSchema != "function" || !n.objectName)) try {
2329
+ let t = await u.getObjectSchema(n.objectName);
2330
+ e && ee(t);
2256
2331
  } catch (e) {
2257
2332
  console.warn("Failed to fetch object def for ObjectGallery", e);
2258
2333
  }
2259
2334
  })(), () => {
2260
2335
  e = !1;
2261
2336
  };
2262
- }, [n.objectName, l]), o(() => {
2337
+ }, [n.objectName, u]), s(() => {
2263
2338
  let r = !0;
2264
2339
  if (e.data && Array.isArray(e.data)) {
2265
- m(e.data);
2340
+ h(e.data);
2266
2341
  return;
2267
2342
  }
2268
- return n.objectName && !f && !n.data && !e.data && (async () => {
2269
- if (!(!l || typeof l.find != "function" || !n.objectName)) {
2270
- r && g(!0);
2343
+ return n.objectName && !p && !n.data && !e.data && (async () => {
2344
+ if (!(!u || typeof u.find != "function" || !n.objectName)) {
2345
+ r && _(!0);
2271
2346
  try {
2272
- let e = t(_?.fields), i = await l.find(n.objectName, {
2347
+ let e = t(v?.fields), i = await u.find(n.objectName, {
2273
2348
  $filter: n.filter,
2274
2349
  ...e.length > 0 ? { $expand: e } : {}
2275
2350
  }), a = [];
@@ -2278,11 +2353,11 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2278
2353
  let e = i;
2279
2354
  Array.isArray(e.records) ? a = e.records : Array.isArray(e.data) && (a = e.data);
2280
2355
  }
2281
- r && m(a);
2356
+ r && h(a);
2282
2357
  } catch (e) {
2283
2358
  console.error("[ObjectGallery] Fetch error:", e);
2284
2359
  } finally {
2285
- r && g(!1);
2360
+ r && _(!1);
2286
2361
  }
2287
2362
  }
2288
2363
  })(), () => {
@@ -2290,25 +2365,25 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2290
2365
  };
2291
2366
  }, [
2292
2367
  n.objectName,
2293
- l,
2294
- f,
2368
+ u,
2369
+ p,
2295
2370
  n.data,
2296
2371
  n.filter,
2297
2372
  e.data,
2298
- _
2373
+ v
2299
2374
  ]);
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) => {
2375
+ 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
2376
  se((t) => ({
2302
2377
  ...t,
2303
- [e]: t[e] === void 0 ? !j : !t[e]
2378
+ [e]: t[e] === void 0 ? !M : !t[e]
2304
2379
  }));
2305
- }, [j]), le = s(() => {
2306
- if (!ae || !O) return [];
2380
+ }, [M]), le = c(() => {
2381
+ if (!ae || !k) return [];
2307
2382
  let e = /* @__PURE__ */ new Map(), t = [];
2308
- for (let n of E) {
2309
- let r = O.map((e) => String(n[e.field] ?? "")).join(" / ");
2383
+ for (let n of D) {
2384
+ let r = k.map((e) => String(n[e.field] ?? "")).join(" / ");
2310
2385
  if (!e.has(r)) {
2311
- let i = O.map((e) => {
2386
+ let i = k.map((e) => {
2312
2387
  let t = n[e.field];
2313
2388
  return t != null && t !== "" ? String(t) : "(empty)";
2314
2389
  }).join(" / ");
@@ -2319,7 +2394,7 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2319
2394
  }
2320
2395
  e.get(r).items.push(n);
2321
2396
  }
2322
- let n = O[0]?.order ?? "asc";
2397
+ let n = k[0]?.order ?? "asc";
2323
2398
  return t.sort((e, t) => {
2324
2399
  let r = e.localeCompare(t, void 0, {
2325
2400
  numeric: !0,
@@ -2327,7 +2402,7 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2327
2402
  });
2328
2403
  return n === "desc" ? -r : r;
2329
2404
  }), t.map((t) => {
2330
- let n = e.get(t), r = t in oe ? oe[t] : j;
2405
+ let n = e.get(t), r = t in oe ? oe[t] : M;
2331
2406
  return {
2332
2407
  key: t,
2333
2408
  label: n.label,
@@ -2336,128 +2411,128 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2336
2411
  };
2337
2412
  });
2338
2413
  }, [
2339
- E,
2340
- O,
2414
+ D,
2415
+ k,
2341
2416
  ae,
2342
2417
  oe,
2343
- j
2418
+ M
2344
2419
  ]);
2345
- if (h && !E.length) return /* @__PURE__ */ F("div", {
2420
+ if (g && !D.length) return /* @__PURE__ */ I("div", {
2346
2421
  className: "p-4 text-sm text-muted-foreground",
2347
2422
  children: "Loading Gallery..."
2348
2423
  });
2349
- if (!E.length) return /* @__PURE__ */ F("div", {
2424
+ if (!D.length) return /* @__PURE__ */ I("div", {
2350
2425
  className: "p-4 text-sm text-muted-foreground",
2351
2426
  children: "No items to display"
2352
2427
  });
2353
- let M = (e) => !te || te.length === 0 ? null : /* @__PURE__ */ F("div", {
2428
+ let N = (e) => !T || T.length === 0 ? null : /* @__PURE__ */ I("div", {
2354
2429
  className: "mt-1.5 space-y-1",
2355
- children: te.map((t) => {
2430
+ children: T.map((t) => {
2356
2431
  let n = e[t];
2357
2432
  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"),
2433
+ 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);
2434
+ return /* @__PURE__ */ L("div", {
2435
+ className: E("text-xs text-muted-foreground truncate [&_*]:!text-xs", s && "flex items-baseline gap-1.5"),
2361
2436
  onClick: (e) => {
2362
2437
  e.target.closest("a,button") && e.stopPropagation();
2363
2438
  },
2364
- children: [s && /* @__PURE__ */ F("span", {
2439
+ children: [s && /* @__PURE__ */ I("span", {
2365
2440
  className: "shrink-0 text-muted-foreground/70 tabular-nums",
2366
2441
  children: o
2367
- }), /* @__PURE__ */ F(a, {
2442
+ }), /* @__PURE__ */ I(a, {
2368
2443
  value: n,
2369
2444
  field: r
2370
2445
  })]
2371
2446
  }, t);
2372
2447
  })
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, {
2448
+ }), ue = (t, i) => {
2449
+ 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");
2450
+ return O && C === "contain" ? /* @__PURE__ */ L(d, {
2376
2451
  role: "listitem",
2377
- className: c,
2452
+ className: l,
2378
2453
  onClick: (e) => y.handleClick(t, e),
2379
- children: [/* @__PURE__ */ F("div", {
2454
+ children: [/* @__PURE__ */ I("div", {
2380
2455
  "aria-hidden": !0,
2381
- className: T("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", s.bg)
2382
- }), /* @__PURE__ */ F(d, {
2456
+ className: E("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", c.bg)
2457
+ }), /* @__PURE__ */ I(f, {
2383
2458
  className: "p-4",
2384
- children: /* @__PURE__ */ I("div", {
2459
+ children: /* @__PURE__ */ L("div", {
2385
2460
  className: "flex items-start gap-3",
2386
- children: [/* @__PURE__ */ F(ct, {
2387
- imageUrl: o,
2388
- title: a,
2389
- placeholder: s
2390
- }), /* @__PURE__ */ I("div", {
2461
+ children: [/* @__PURE__ */ I(ft, {
2462
+ imageUrl: s,
2463
+ title: o,
2464
+ placeholder: c
2465
+ }), /* @__PURE__ */ L("div", {
2391
2466
  className: "min-w-0 flex-1",
2392
- children: [/* @__PURE__ */ F("h3", {
2467
+ children: [/* @__PURE__ */ I("h3", {
2393
2468
  className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
2394
- title: a,
2395
- children: a
2396
- }), M(t)]
2469
+ title: o,
2470
+ children: o
2471
+ }), N(t)]
2397
2472
  })]
2398
2473
  })
2399
2474
  })]
2400
- }, i) : /* @__PURE__ */ I(u, {
2475
+ }, a) : /* @__PURE__ */ L(d, {
2401
2476
  role: "listitem",
2402
- className: c,
2477
+ className: l,
2403
2478
  onClick: (e) => y.handleClick(t, e),
2404
2479
  children: [
2405
- !D && /* @__PURE__ */ F("div", {
2480
+ !O && /* @__PURE__ */ I("div", {
2406
2481
  "aria-hidden": !0,
2407
- className: T("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", s.bg)
2482
+ className: E("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", c.bg)
2408
2483
  }),
2409
- /* @__PURE__ */ F(st, {
2410
- imageUrl: o,
2411
- title: a,
2484
+ /* @__PURE__ */ I(dt, {
2485
+ imageUrl: s,
2486
+ title: o,
2412
2487
  coverFit: C,
2413
- aspectClass: it[w],
2414
- placeholder: s,
2415
- hidden: !D
2488
+ aspectClass: ct[w],
2489
+ placeholder: c,
2490
+ hidden: !O
2416
2491
  }),
2417
- /* @__PURE__ */ I(d, {
2418
- className: T("p-3", D && "border-t border-border/60"),
2419
- children: [/* @__PURE__ */ F("h3", {
2492
+ /* @__PURE__ */ L(f, {
2493
+ className: E("p-3", O && "border-t border-border/60"),
2494
+ children: [/* @__PURE__ */ I("h3", {
2420
2495
  className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
2421
- title: a,
2422
- children: a
2423
- }), M(t)]
2496
+ title: o,
2497
+ children: o
2498
+ }), N(t)]
2424
2499
  })
2425
2500
  ]
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),
2501
+ }, a);
2502
+ }, P = (e) => /* @__PURE__ */ I("div", {
2503
+ className: E("grid gap-4 p-4 auto-rows-min content-start", st[w], n.className),
2429
2504
  role: "list",
2430
2505
  children: e.map((e, t) => ue(e, t))
2431
2506
  });
2432
- return /* @__PURE__ */ I(Ee, { children: [ae ? /* @__PURE__ */ F("div", {
2507
+ return /* @__PURE__ */ L(Oe, { children: [ae ? /* @__PURE__ */ I("div", {
2433
2508
  className: "space-y-2",
2434
- children: le.map((e) => /* @__PURE__ */ I("div", {
2509
+ children: le.map((e) => /* @__PURE__ */ L("div", {
2435
2510
  className: "border rounded-md",
2436
- children: [/* @__PURE__ */ I("button", {
2511
+ children: [/* @__PURE__ */ L("button", {
2437
2512
  type: "button",
2438
2513
  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
2514
  onClick: () => ce(e.key),
2440
2515
  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", {
2516
+ e.collapsed ? /* @__PURE__ */ I(j, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ I(A, { className: "h-4 w-4 shrink-0" }),
2517
+ /* @__PURE__ */ I("span", { children: e.label }),
2518
+ /* @__PURE__ */ I("span", {
2444
2519
  className: "ml-auto text-xs text-muted-foreground",
2445
2520
  children: e.items.length
2446
2521
  })
2447
2522
  ]
2448
- }), !e.collapsed && N(e.items)]
2523
+ }), !e.collapsed && P(e.items)]
2449
2524
  }, e.key))
2450
- }) : N(E), y.isOverlay && /* @__PURE__ */ F(x, {
2525
+ }) : P(D), y.isOverlay && /* @__PURE__ */ I(x, {
2451
2526
  ...y,
2452
2527
  title: "Gallery Item",
2453
- children: (e) => /* @__PURE__ */ F("div", {
2528
+ children: (e) => /* @__PURE__ */ I("div", {
2454
2529
  className: "space-y-3",
2455
- children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ I("div", {
2530
+ children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ L("div", {
2456
2531
  className: "flex flex-col",
2457
- children: [/* @__PURE__ */ F("span", {
2532
+ children: [/* @__PURE__ */ I("span", {
2458
2533
  className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
2459
2534
  children: e.replace(/_/g, " ")
2460
- }), /* @__PURE__ */ F("span", {
2535
+ }), /* @__PURE__ */ I("span", {
2461
2536
  className: "text-sm",
2462
2537
  children: String(t ?? "—")
2463
2538
  })]
@@ -2465,76 +2540,76 @@ var st = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i,
2465
2540
  })
2466
2541
  })] });
2467
2542
  };
2468
- e.register("object-gallery", lt, {
2543
+ e.register("object-gallery", pt, {
2469
2544
  namespace: "plugin-list",
2470
2545
  label: "Gallery View",
2471
2546
  category: "view"
2472
2547
  });
2473
2548
  //#endregion
2474
2549
  //#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;
2550
+ function K(e) {
2551
+ return e ? De[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
2477
2552
  }
2478
- function J(e) {
2553
+ function q(e) {
2479
2554
  return e.filter((e) => e.pinned || e.visible !== "false" && e.visible !== !1).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
2480
2555
  }
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) => {
2556
+ var mt = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2557
+ 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
2558
  c(e.name), n?.(e);
2484
2559
  }, [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),
2560
+ return a.length === 0 ? null : /* @__PURE__ */ I("div", {
2561
+ className: E("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
2487
2562
  "data-testid": "view-tabs",
2488
2563
  role: "tablist",
2489
2564
  children: a.map((e) => {
2490
- let t = q(e.icon), n = u === e.name;
2491
- return /* @__PURE__ */ I(l, {
2565
+ let t = K(e.icon), n = l === e.name;
2566
+ return /* @__PURE__ */ L(u, {
2492
2567
  variant: "ghost",
2493
2568
  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"),
2569
+ 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
2570
  "data-testid": `view-tab-${e.name}`,
2496
2571
  role: "tab",
2497
2572
  "aria-selected": n,
2498
2573
  onClick: () => d(e),
2499
- children: [t && /* @__PURE__ */ F(t, { className: "h-3 w-3 mr-1.5" }), e.label]
2574
+ children: [t && /* @__PURE__ */ I(t, { className: "h-3 w-3 mr-1.5" }), e.label]
2500
2575
  }, e.name);
2501
2576
  })
2502
2577
  });
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) => {
2578
+ }, ht = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2579
+ 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
2580
  c(e.name), n?.(e);
2506
2581
  }, [n]);
2507
2582
  if (a.length === 0) return null;
2508
- let _ = q(d?.icon);
2509
- return /* @__PURE__ */ F("div", {
2510
- className: T("px-2 py-1", i),
2583
+ let p = K(d?.icon);
2584
+ return /* @__PURE__ */ I("div", {
2585
+ className: E("px-2 py-1", r),
2511
2586
  "data-testid": "view-tabs-select",
2512
- children: /* @__PURE__ */ I(p, { children: [/* @__PURE__ */ F(g, {
2587
+ children: /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I(_, {
2513
2588
  asChild: !0,
2514
- children: /* @__PURE__ */ I(l, {
2589
+ children: /* @__PURE__ */ L(u, {
2515
2590
  variant: "ghost",
2516
2591
  size: "sm",
2517
2592
  className: "h-7 px-2 text-xs font-medium text-foreground gap-1.5 max-w-[60vw] truncate",
2518
2593
  "aria-label": "Switch view",
2519
2594
  children: [
2520
- _ && /* @__PURE__ */ F(_, { className: "h-3.5 w-3.5 shrink-0" }),
2521
- /* @__PURE__ */ F("span", {
2595
+ p && /* @__PURE__ */ I(p, { className: "h-3.5 w-3.5 shrink-0" }),
2596
+ /* @__PURE__ */ I("span", {
2522
2597
  className: "truncate",
2523
2598
  children: d?.label ?? ""
2524
2599
  }),
2525
- /* @__PURE__ */ F(k, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
2600
+ /* @__PURE__ */ I(A, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
2526
2601
  ]
2527
2602
  })
2528
- }), /* @__PURE__ */ F(m, {
2603
+ }), /* @__PURE__ */ I(h, {
2529
2604
  align: "start",
2530
2605
  className: "w-56 max-h-72 overflow-y-auto",
2531
2606
  children: a.map((e) => {
2532
- let t = q(e.icon);
2533
- return /* @__PURE__ */ I(h, {
2607
+ let t = K(e.icon);
2608
+ return /* @__PURE__ */ L(g, {
2534
2609
  onClick: () => f(e),
2535
- className: T("text-sm", u === e.name && "font-medium bg-muted"),
2610
+ className: E("text-sm", l === e.name && "font-medium bg-muted"),
2536
2611
  "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", {
2612
+ children: [t && /* @__PURE__ */ I(t, { className: "h-3.5 w-3.5 mr-2 shrink-0" }), /* @__PURE__ */ I("span", {
2538
2613
  className: "truncate",
2539
2614
  children: e.label
2540
2615
  })]
@@ -2543,7 +2618,7 @@ var ut = ({ tabs: e, activeTab: t, onTabChange: n, className: i }) => {
2543
2618
  })] })
2544
2619
  });
2545
2620
  };
2546
- e.register("list-view", nt, {
2621
+ e.register("list-view", ot, {
2547
2622
  namespace: "plugin-list",
2548
2623
  label: "List View",
2549
2624
  category: "Views",
@@ -2620,7 +2695,7 @@ e.register("list-view", nt, {
2620
2695
  sort: [],
2621
2696
  options: {}
2622
2697
  }
2623
- }), e.register("list", nt, {
2698
+ }), e.register("list", ot, {
2624
2699
  namespace: "view",
2625
2700
  skipFallback: !0,
2626
2701
  category: "view",
@@ -2692,4 +2767,4 @@ e.register("list-view", nt, {
2692
2767
  ]
2693
2768
  });
2694
2769
  //#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 };
2770
+ 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 };