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