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