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