@object-ui/plugin-list 17.3.0 → 17.6.0

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