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