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