@object-ui/plugin-list 13.1.0 → 14.0.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,26 +1,26 @@
1
- import { ComponentRegistry as e, buildExpandFields as t, evaluatePlainCondition as n, getRecordDisplayName as r } from "@object-ui/core";
2
- import * as i from "react";
3
- import { useCallback as a, useContext as o, useEffect as s, useMemo as c, useState as l } from "react";
4
- import { Button as u, Card as d, CardContent as f, DataEmptyState as p, DropdownMenu as m, DropdownMenuContent as h, DropdownMenuItem as g, DropdownMenuTrigger as _, FilterBuilder as v, GroupingEditor as ee, Input as y, LookupValuePicker as b, NavigationOverlay as x, Popover as S, PopoverContent as C, PopoverTrigger as w, RefreshIndicator as te, SortBuilder as T, cn as E } from "@object-ui/components";
5
- import { Activity as D, AlertTriangle as ne, ArrowUpDown as re, BarChart3 as O, Calendar as ie, Check as k, CheckSquare as ae, ChevronDown as A, ChevronRight as oe, Download as se, EyeOff as ce, GanttChartSquare as j, Grid as M, Group as le, Images as N, Inbox as ue, LayoutGrid as de, ListTree as P, Loader2 as fe, Map as F, Paintbrush as pe, Pencil as me, Plus as he, Printer as ge, RotateCw as _e, Rows2 as ve, Rows3 as ye, Rows4 as be, Search as xe, Settings2 as Se, Share2 as Ce, SlidersHorizontal as we, Trash2 as Te, X as Ee, icons as De } from "lucide-react";
6
- import { Fragment as Oe, jsx as I, jsxs as L } from "react/jsx-runtime";
7
- import { useObjectLabel as R, useObjectTranslation as ke, useSafeFieldLabel as Ae } from "@object-ui/i18n";
8
- import { SchemaRenderer as je, SchemaRendererContext as Me, useDataScope as Ne, useDensityMode as Pe, useNavigationOverlay as Fe, useSafeFieldLabel as Ie } from "@object-ui/react";
9
- import { usePullToRefresh as Le } from "@object-ui/mobile";
10
- import { usePermissions as Re } from "@object-ui/permissions";
11
- import { getCellRenderer as ze, resolveCellRendererType as z } from "@object-ui/fields";
1
+ import { ComponentRegistry as e, buildExpandFields as t, buildExportFileName as n, evaluatePlainCondition as r, getRecordDisplayName as i } from "@object-ui/core";
2
+ import * as a from "react";
3
+ import { useCallback as o, useContext as s, useEffect as c, useMemo as l, useState as u } from "react";
4
+ import { Button as d, Card as f, CardContent as p, DataEmptyState as m, DropdownMenu as h, DropdownMenuContent as g, DropdownMenuItem as _, DropdownMenuTrigger as v, FilterBuilder as ee, GroupingEditor as y, Input as b, LookupValuePicker as x, NavigationOverlay as te, Popover as S, PopoverContent as C, PopoverTrigger as w, RefreshIndicator as T, SortBuilder as ne, cn as E } from "@object-ui/components";
5
+ import { Activity as D, AlertTriangle as re, ArrowUpDown as O, BarChart3 as ie, Calendar as k, Check as A, CheckSquare as ae, ChevronDown as j, ChevronRight as oe, Download as se, EyeOff as ce, GanttChartSquare as le, Grid as ue, Group as de, Images as M, Inbox as fe, LayoutGrid as N, ListTree as pe, Loader2 as me, Map as P, Paintbrush as he, Pencil as ge, Plus as _e, Printer as ve, RotateCw as ye, Rows2 as be, Rows3 as xe, Rows4 as Se, Search as Ce, Settings2 as F, Share2 as we, SlidersHorizontal as Te, Trash2 as Ee, X as De, icons as Oe } from "lucide-react";
6
+ import { Fragment as ke, jsx as I, jsxs as L } from "react/jsx-runtime";
7
+ import { useObjectLabel as Ae, useObjectTranslation as R, useSafeFieldLabel as je } from "@object-ui/i18n";
8
+ import { SchemaRenderer as Me, SchemaRendererContext as Ne, useDataScope as Pe, useDensityMode as Fe, useNavigationOverlay as Ie, useSafeFieldLabel as Le } from "@object-ui/react";
9
+ import { usePullToRefresh as Re } from "@object-ui/mobile";
10
+ import { usePermissions as ze } from "@object-ui/permissions";
11
+ import { getCellRenderer as Be, resolveCellRendererType as Ve } from "@object-ui/fields";
12
12
  //#region src/ViewSwitcher.tsx
13
- var B = {
14
- grid: /* @__PURE__ */ I(M, { className: "h-4 w-4" }),
15
- kanban: /* @__PURE__ */ I(de, { className: "h-4 w-4" }),
16
- gallery: /* @__PURE__ */ I(N, { className: "h-4 w-4" }),
17
- calendar: /* @__PURE__ */ I(ie, { className: "h-4 w-4" }),
13
+ var z = {
14
+ grid: /* @__PURE__ */ I(ue, { className: "h-4 w-4" }),
15
+ kanban: /* @__PURE__ */ I(N, { className: "h-4 w-4" }),
16
+ gallery: /* @__PURE__ */ I(M, { className: "h-4 w-4" }),
17
+ calendar: /* @__PURE__ */ I(k, { className: "h-4 w-4" }),
18
18
  timeline: /* @__PURE__ */ I(D, { className: "h-4 w-4" }),
19
- gantt: /* @__PURE__ */ I(j, { className: "h-4 w-4" }),
20
- map: /* @__PURE__ */ I(F, { className: "h-4 w-4" }),
21
- chart: /* @__PURE__ */ I(O, { className: "h-4 w-4" }),
22
- tree: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
23
- }, V = {
19
+ gantt: /* @__PURE__ */ I(le, { className: "h-4 w-4" }),
20
+ map: /* @__PURE__ */ I(P, { className: "h-4 w-4" }),
21
+ chart: /* @__PURE__ */ I(ie, { className: "h-4 w-4" }),
22
+ tree: /* @__PURE__ */ I(pe, { className: "h-4 w-4" })
23
+ }, B = {
24
24
  grid: "Grid",
25
25
  kanban: "Kanban",
26
26
  gallery: "Gallery",
@@ -30,11 +30,11 @@ var B = {
30
30
  map: "Map",
31
31
  chart: "Chart",
32
32
  tree: "Tree"
33
- }, Be = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: a = !0 }) => {
34
- let [o, s] = i.useState(!1), c = i.useCallback((t) => {
35
- s(!1), t !== e && (a && typeof document < "u" && "startViewTransition" in document ? document.startViewTransition(() => n(t)) : n(t));
33
+ }, He = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
34
+ let [o, s] = a.useState(!1), c = a.useCallback((t) => {
35
+ s(!1), t !== e && (i && typeof document < "u" && "startViewTransition" in document ? document.startViewTransition(() => n(t)) : n(t));
36
36
  }, [
37
- a,
37
+ i,
38
38
  e,
39
39
  n
40
40
  ]);
@@ -48,14 +48,14 @@ var B = {
48
48
  type: "button",
49
49
  role: "tab",
50
50
  "aria-selected": n,
51
- "aria-label": V[t],
52
- title: V[t],
51
+ "aria-label": B[t],
52
+ title: B[t],
53
53
  "data-state": n ? "on" : "off",
54
54
  onClick: () => c(t),
55
55
  className: E("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-[7px] text-xs font-medium transition-all duration-150", n ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"),
56
- children: [B[t], /* @__PURE__ */ I("span", {
56
+ children: [z[t], /* @__PURE__ */ I("span", {
57
57
  className: "hidden sm:inline-block",
58
- children: V[t]
58
+ children: B[t]
59
59
  })]
60
60
  }, t);
61
61
  })
@@ -67,15 +67,15 @@ var B = {
67
67
  children: /* @__PURE__ */ L("button", {
68
68
  type: "button",
69
69
  "data-testid": "view-switcher-dropdown",
70
- "aria-label": V[e],
70
+ "aria-label": B[e],
71
71
  className: E("inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs font-medium transition-colors oui-view-switcher", o ? "text-foreground bg-muted" : "text-muted-foreground hover:text-foreground", r),
72
72
  children: [
73
- B[e],
73
+ z[e],
74
74
  /* @__PURE__ */ I("span", {
75
75
  className: "hidden sm:inline-block",
76
- children: V[e]
76
+ children: B[e]
77
77
  }),
78
- /* @__PURE__ */ I(A, { className: "h-3 w-3 opacity-60" })
78
+ /* @__PURE__ */ I(j, { className: "h-3 w-3 opacity-60" })
79
79
  ]
80
80
  })
81
81
  }), /* @__PURE__ */ I(C, {
@@ -87,25 +87,25 @@ var B = {
87
87
  "data-state": t === e ? "on" : "off",
88
88
  className: E("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs transition-colors hover:bg-muted", t === e ? "text-foreground font-medium" : "text-muted-foreground"),
89
89
  children: [
90
- B[t],
90
+ z[t],
91
91
  /* @__PURE__ */ I("span", {
92
92
  className: "flex-1 text-left",
93
- children: V[t]
93
+ children: B[t]
94
94
  }),
95
- t === e && /* @__PURE__ */ I(k, { className: "h-3.5 w-3.5" })
95
+ t === e && /* @__PURE__ */ I(A, { className: "h-3.5 w-3.5" })
96
96
  ]
97
97
  }, t))
98
98
  })]
99
99
  });
100
- }, Ve = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: a = !0 }) => {
101
- let o = i.useCallback((t) => {
102
- if (!a || t === e) {
100
+ }, Ue = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
101
+ let o = a.useCallback((t) => {
102
+ if (!i || t === e) {
103
103
  n(t);
104
104
  return;
105
105
  }
106
106
  typeof document < "u" && "startViewTransition" in document ? document.startViewTransition(() => n(t)) : n(t);
107
107
  }, [
108
- a,
108
+ i,
109
109
  e,
110
110
  n
111
111
  ]);
@@ -116,14 +116,14 @@ var B = {
116
116
  return /* @__PURE__ */ L("button", {
117
117
  type: "button",
118
118
  onClick: () => o(t),
119
- "aria-label": V[t],
120
- title: V[t],
119
+ "aria-label": B[t],
120
+ title: B[t],
121
121
  "aria-pressed": n,
122
122
  "data-state": n ? "on" : "off",
123
123
  className: E("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", "hover:bg-muted hover:text-muted-foreground", "gap-2 px-3 py-2", "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50"),
124
- children: [B[t], /* @__PURE__ */ I("span", {
124
+ children: [z[t], /* @__PURE__ */ I("span", {
125
125
  className: "hidden sm:inline-block text-xs font-medium",
126
- children: V[t]
126
+ children: B[t]
127
127
  })]
128
128
  }, t);
129
129
  })
@@ -131,8 +131,8 @@ var B = {
131
131
  };
132
132
  //#endregion
133
133
  //#region src/components/ViewSettingsPopover.tsx
134
- function He({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: a = !0, children: o }) {
135
- let [s, c] = i.useState(a);
134
+ function We({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: i = !0, children: o }) {
135
+ let [s, c] = a.useState(i);
136
136
  return /* @__PURE__ */ L("div", {
137
137
  className: "border-b last:border-b-0",
138
138
  children: [/* @__PURE__ */ L("div", {
@@ -142,7 +142,7 @@ function He({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: a = !0
142
142
  onClick: () => c((e) => !e),
143
143
  className: "flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground",
144
144
  children: [
145
- /* @__PURE__ */ I(A, { className: E("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
145
+ /* @__PURE__ */ I(j, { className: E("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
146
146
  e,
147
147
  typeof t == "number" && t > 0 && /* @__PURE__ */ I("span", {
148
148
  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",
@@ -161,20 +161,20 @@ function He({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: a = !0
161
161
  })]
162
162
  });
163
163
  }
164
- function Ue(e) {
165
- let { t, allFields: n, showGroup: r, groupingConfig: a, setGroupingConfig: o, showColor: s, rowColorConfig: c, setRowColorConfig: l, showDensity: d, density: f, showHideFields: p, hiddenFields: m, updateHiddenFields: h, showInlineEdit: g, inlineEdit: _, setInlineEdit: v } = e, [y, b] = i.useState(!1), x = [
166
- !!a?.fields?.length,
164
+ function Ge(e) {
165
+ let { t, allFields: n, showGroup: r, groupingConfig: i, setGroupingConfig: o, showColor: s, rowColorConfig: c, setRowColorConfig: l, showDensity: u, density: f, showHideFields: p, hiddenFields: m, updateHiddenFields: h, showInlineEdit: g, inlineEdit: _, setInlineEdit: v } = e, [ee, b] = a.useState(!1), x = [
166
+ !!i?.fields?.length,
167
167
  !!c?.field,
168
168
  f && f.mode !== "compact",
169
169
  (m?.size ?? 0) > 0,
170
170
  !!_
171
- ].filter(Boolean).length, te = f?.mode === "compact" ? be : f?.mode === "comfortable" ? ye : ve, T = t("list.viewSettings", { defaultValue: "View settings" });
171
+ ].filter(Boolean).length, te = f?.mode === "compact" ? Se : f?.mode === "comfortable" ? xe : be, T = t("list.viewSettings", { defaultValue: "View settings" });
172
172
  return /* @__PURE__ */ L(S, {
173
- open: y,
173
+ open: ee,
174
174
  onOpenChange: b,
175
175
  children: [/* @__PURE__ */ I(w, {
176
176
  asChild: !0,
177
- children: /* @__PURE__ */ L(u, {
177
+ children: /* @__PURE__ */ L(d, {
178
178
  variant: "ghost",
179
179
  size: "sm",
180
180
  "aria-label": T,
@@ -182,7 +182,7 @@ function Ue(e) {
182
182
  className: E("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", x > 0 && "text-foreground font-medium"),
183
183
  "data-testid": "view-settings-trigger",
184
184
  children: [
185
- /* @__PURE__ */ I(Se, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
185
+ /* @__PURE__ */ I(F, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
186
186
  /* @__PURE__ */ I("span", {
187
187
  className: "hidden sm:inline",
188
188
  children: T
@@ -208,13 +208,13 @@ function Ue(e) {
208
208
  children: t("list.viewSettingsHint", { defaultValue: "Grouping, color, density, and visible fields." })
209
209
  })]
210
210
  }),
211
- r && o && /* @__PURE__ */ I(He, {
211
+ r && o && /* @__PURE__ */ I(We, {
212
212
  title: t("list.group", { defaultValue: "Group" }),
213
- badge: a?.fields?.length || 0,
214
- onClear: a ? () => o(void 0) : void 0,
213
+ badge: i?.fields?.length || 0,
214
+ onClear: i ? () => o(void 0) : void 0,
215
215
  clearLabel: t("list.clear", { defaultValue: "Clear" }),
216
- children: /* @__PURE__ */ I(ee, {
217
- value: a,
216
+ children: /* @__PURE__ */ I(y, {
217
+ value: i,
218
218
  fieldOptions: n.map((e) => ({
219
219
  value: e.name,
220
220
  label: e.label || e.name
@@ -228,7 +228,7 @@ function Ue(e) {
228
228
  onChange: (e) => o(e)
229
229
  })
230
230
  }),
231
- s && l && /* @__PURE__ */ L(He, {
231
+ s && l && /* @__PURE__ */ L(We, {
232
232
  title: t("list.color", { defaultValue: "Row color" }),
233
233
  onClear: c ? () => l(void 0) : void 0,
234
234
  clearLabel: t("list.clear", { defaultValue: "Clear" }),
@@ -256,12 +256,12 @@ function Ue(e) {
256
256
  }, e.name))]
257
257
  })]
258
258
  }),
259
- d && f && /* @__PURE__ */ I(He, {
259
+ u && f && /* @__PURE__ */ I(We, {
260
260
  title: t("grid.toolbar.densityMode", { defaultValue: "Density" }),
261
261
  defaultOpen: f.mode !== "compact",
262
262
  children: /* @__PURE__ */ L("div", {
263
263
  className: "flex items-center gap-2",
264
- children: [/* @__PURE__ */ L(u, {
264
+ children: [/* @__PURE__ */ L(d, {
265
265
  variant: "outline",
266
266
  size: "sm",
267
267
  className: "h-7 gap-1.5",
@@ -277,7 +277,7 @@ function Ue(e) {
277
277
  })]
278
278
  })
279
279
  }),
280
- g && v && /* @__PURE__ */ I(He, {
280
+ g && v && /* @__PURE__ */ I(We, {
281
281
  title: t("list.recordEditingTitle", { defaultValue: "Record editing" }),
282
282
  defaultOpen: !!_,
283
283
  children: /* @__PURE__ */ L("label", {
@@ -291,7 +291,7 @@ function Ue(e) {
291
291
  }), /* @__PURE__ */ I("span", { children: t("list.inlineEditLabel", { defaultValue: "Edit records inline (click a cell to edit)" }) })]
292
292
  })
293
293
  }),
294
- p && m && h && /* @__PURE__ */ I(He, {
294
+ p && m && h && /* @__PURE__ */ I(We, {
295
295
  title: t("list.hideFieldsTitle", { defaultValue: "Hide fields" }),
296
296
  badge: m.size,
297
297
  onClear: m.size > 0 ? () => h(/* @__PURE__ */ new Set()) : void 0,
@@ -322,21 +322,21 @@ function Ue(e) {
322
322
  }
323
323
  //#endregion
324
324
  //#region src/UserFilters.tsx
325
- function H() {
325
+ function Ke() {
326
326
  try {
327
- let { t: e } = ke(), t = e("common.more");
327
+ let { t: e } = R(), t = e("common.more");
328
328
  return !t || t === "common.more" ? "More" : t;
329
329
  } catch {
330
330
  return "More";
331
331
  }
332
332
  }
333
- var We = /* @__PURE__ */ new Set([
333
+ var V = /* @__PURE__ */ new Set([
334
334
  "lookup",
335
335
  "master_detail",
336
336
  "user",
337
337
  "owner"
338
338
  ]);
339
- function U(e) {
339
+ function qe(e) {
340
340
  switch (e) {
341
341
  case void 0:
342
342
  case "equals":
@@ -353,21 +353,21 @@ function U(e) {
353
353
  default: return e;
354
354
  }
355
355
  }
356
- function W(e) {
356
+ function H(e) {
357
357
  return (e || []).filter((e) => e && (e.id || e.name)).map((e) => ({
358
358
  id: e.id ?? e.name,
359
359
  label: typeof e.label == "string" ? e.label : e.label?.toString?.() ?? e.id ?? e.name,
360
360
  filters: Array.isArray(e.filters) ? e.filters : Array.isArray(e.filter) ? e.filter.filter((e) => e && typeof e.field == "string").map((e) => [
361
361
  e.field,
362
- U(e.operator),
362
+ qe(e.operator),
363
363
  e.value
364
364
  ]) : [],
365
365
  default: e.default ?? e.isDefault
366
366
  }));
367
367
  }
368
- function Ge({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a, initialSelections: o, onSelectionsChange: s }) {
368
+ function Je({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a, initialSelections: o, onSelectionsChange: s }) {
369
369
  switch (e.element) {
370
- case "dropdown": return /* @__PURE__ */ I(qe, {
370
+ case "dropdown": return /* @__PURE__ */ I(Ye, {
371
371
  fields: e.fields || [],
372
372
  objectDef: t,
373
373
  data: n,
@@ -377,8 +377,8 @@ function Ge({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
377
377
  initialSelections: o,
378
378
  onSelectionsChange: s
379
379
  });
380
- case "tabs": return /* @__PURE__ */ I(Je, {
381
- tabs: W(e.tabs || []),
380
+ case "tabs": return /* @__PURE__ */ I(Xe, {
381
+ tabs: H(e.tabs || []),
382
382
  showAllRecords: e.showAllRecords !== !1,
383
383
  allowAddTab: e.allowAddTab,
384
384
  onFilterChange: r,
@@ -389,7 +389,7 @@ function Ge({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
389
389
  default: return null;
390
390
  }
391
391
  }
392
- function Ke(e, t, n, r) {
392
+ function U(e, t, n, r) {
393
393
  return e.map((e) => {
394
394
  let i = e.options ? [...e.options] : [], a = e.type, o, s, c;
395
395
  if (t?.fields) {
@@ -426,15 +426,15 @@ function Ke(e, t, n, r) {
426
426
  };
427
427
  });
428
428
  }
429
- function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a, className: o, initialSelections: s, onSelectionsChange: c }) {
430
- let { fieldLabel: l, translateOptions: u } = Ae(), d = H(), f = t?.name, [p, m] = i.useState(() => {
429
+ function Ye({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o, initialSelections: s, onSelectionsChange: c }) {
430
+ let { fieldLabel: l, translateOptions: u } = je(), d = Ke(), f = t?.name, [p, m] = a.useState(() => {
431
431
  let t = {};
432
432
  return e.forEach((e) => {
433
433
  e.defaultValues && e.defaultValues.length > 0 && (t[e.field] = e.defaultValues);
434
434
  let n = s?.[e.field];
435
435
  n && n.length > 0 && (t[e.field] = n);
436
436
  }), t;
437
- }), h = i.useRef({}), g = i.useMemo(() => Ke(e, t, n, {
437
+ }), h = a.useRef({}), g = a.useMemo(() => U(e, t, n, {
438
438
  objectName: f,
439
439
  fieldLabel: l,
440
440
  translateOptions: u
@@ -457,7 +457,7 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
457
457
  l,
458
458
  u,
459
459
  p
460
- ]), _ = i.useCallback((e) => {
460
+ ]), _ = a.useCallback((e) => {
461
461
  r(Object.entries(e).filter(([, e]) => e.length > 0).map(([e, t]) => [
462
462
  e,
463
463
  "in",
@@ -470,7 +470,7 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
470
470
  };
471
471
  m(n), _(n), c?.(n);
472
472
  };
473
- i.useEffect(() => {
473
+ a.useEffect(() => {
474
474
  let e = p, t = {}, n = !1;
475
475
  for (let [r, i] of Object.entries(e)) {
476
476
  let e = g.find((e) => e.field === r), a = i.map((t) => {
@@ -482,8 +482,8 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
482
482
  }
483
483
  n && (m(t), e = t), Object.values(e).some((e) => e.length > 0) && _(e);
484
484
  }, []);
485
- let ee = a !== void 0 && a < g.length ? g.slice(0, a) : g, y = a !== void 0 && a < g.length ? g.slice(a) : [], x = (e) => {
486
- let t = p[e.field] || [], n = t.length > 0, r = We.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
485
+ let ee = i !== void 0 && i < g.length ? g.slice(0, i) : g, y = i !== void 0 && i < g.length ? g.slice(i) : [], b = (e) => {
486
+ let t = p[e.field] || [], n = t.length > 0, r = V.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
487
487
  return /* @__PURE__ */ L(S, { children: [/* @__PURE__ */ I(w, {
488
488
  asChild: !0,
489
489
  children: /* @__PURE__ */ L("button", {
@@ -498,13 +498,13 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
498
498
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
499
499
  children: t.length
500
500
  }),
501
- n ? /* @__PURE__ */ I(Ee, {
501
+ n ? /* @__PURE__ */ I(De, {
502
502
  className: "h-3 w-3 opacity-60 hover:opacity-100",
503
503
  "data-testid": `filter-clear-${e.field}`,
504
504
  onClick: (t) => {
505
505
  t.stopPropagation(), v(e.field, []);
506
506
  }
507
- }) : /* @__PURE__ */ I(A, { className: "h-3 w-3 opacity-60" })
507
+ }) : /* @__PURE__ */ I(j, { className: "h-3 w-3 opacity-60" })
508
508
  ]
509
509
  })
510
510
  }), /* @__PURE__ */ I(C, {
@@ -512,7 +512,7 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
512
512
  className: E(i, "p-2"),
513
513
  children: r ? /* @__PURE__ */ I("div", {
514
514
  "data-testid": `filter-lookup-${e.field}`,
515
- children: /* @__PURE__ */ I(b, {
515
+ children: /* @__PURE__ */ I(x, {
516
516
  field: {
517
517
  value: e.field,
518
518
  label: e.label || e.field,
@@ -570,7 +570,7 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
570
570
  className: "text-xs text-muted-foreground",
571
571
  "data-testid": "user-filters-empty",
572
572
  children: "No filter fields"
573
- }) : /* @__PURE__ */ L(Oe, { children: [ee.map(x), y.length > 0 && /* @__PURE__ */ L(S, { children: [/* @__PURE__ */ I(w, {
573
+ }) : /* @__PURE__ */ L(ke, { children: [ee.map(b), y.length > 0 && /* @__PURE__ */ L(S, { children: [/* @__PURE__ */ I(w, {
574
574
  asChild: !0,
575
575
  children: /* @__PURE__ */ L("button", {
576
576
  "data-testid": "user-filters-more",
@@ -581,7 +581,7 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
581
581
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
582
582
  children: y.length
583
583
  }),
584
- /* @__PURE__ */ I(A, { className: "h-3 w-3 opacity-60" })
584
+ /* @__PURE__ */ I(j, { className: "h-3 w-3 opacity-60" })
585
585
  ]
586
586
  })
587
587
  }), /* @__PURE__ */ I(C, {
@@ -590,19 +590,19 @@ function qe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: a
590
590
  "data-testid": "user-filters-more-content",
591
591
  children: /* @__PURE__ */ I("div", {
592
592
  className: "space-y-1",
593
- children: y.map(x)
593
+ children: y.map(b)
594
594
  })
595
595
  })] })] })
596
596
  });
597
597
  }
598
- function Je({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: a, initialTab: o, onSelectionsChange: s }) {
599
- let [c, l] = i.useState(() => o && (o === "__all__" || e.some((e) => e.id === o)) ? o : e.find((e) => e.default)?.id || (t ? "__all__" : e[0]?.id || "")), u = i.useCallback((t) => {
598
+ function Xe({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i, initialTab: o, onSelectionsChange: s }) {
599
+ let [c, l] = a.useState(() => o && (o === "__all__" || e.some((e) => e.id === o)) ? o : e.find((e) => e.default)?.id || (t ? "__all__" : e[0]?.id || "")), u = a.useCallback((t) => {
600
600
  l(t), r(t === "__all__" ? [] : e.find((e) => e.id === t)?.filters || []), s?.({ _tab: [t] });
601
601
  }, [
602
602
  e,
603
603
  r,
604
604
  s
605
- ]), d = i.useMemo(() => {
605
+ ]), d = a.useMemo(() => {
606
606
  let n = [...e];
607
607
  return t && n.push({
608
608
  id: "__all__",
@@ -610,13 +610,13 @@ function Je({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, cla
610
610
  filters: []
611
611
  }), n;
612
612
  }, [e, t]);
613
- return i.useEffect(() => {
613
+ return a.useEffect(() => {
614
614
  if (c && c !== "__all__") {
615
615
  let t = e.find((e) => e.id === c);
616
616
  t && r(t.filters || []);
617
617
  }
618
618
  }, []), /* @__PURE__ */ L("div", {
619
- className: E("flex items-center gap-0.5 overflow-x-auto", a),
619
+ className: E("flex items-center gap-0.5 overflow-x-auto", i),
620
620
  "data-testid": "user-filters-tabs",
621
621
  children: [d.map((e) => {
622
622
  let t = e.id ?? e.name ?? "";
@@ -630,13 +630,13 @@ function Je({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, cla
630
630
  className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",
631
631
  "data-testid": "filter-tab-add",
632
632
  title: "Add filter tab",
633
- children: /* @__PURE__ */ I(he, { className: "h-3.5 w-3.5" })
633
+ children: /* @__PURE__ */ I(_e, { className: "h-3.5 w-3.5" })
634
634
  })]
635
635
  });
636
636
  }
637
637
  //#endregion
638
638
  //#region src/ListView.tsx
639
- function G(e) {
639
+ function Ze(e) {
640
640
  switch (e) {
641
641
  case "equals":
642
642
  case "eq": return "=";
@@ -664,10 +664,10 @@ function G(e) {
664
664
  default: return e;
665
665
  }
666
666
  }
667
- function K(e) {
667
+ function W(e) {
668
668
  if (!Array.isArray(e) || e.length < 3) return e;
669
669
  let [t, n, r] = e;
670
- 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 ? [
670
+ return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? W(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
671
671
  t,
672
672
  "=",
673
673
  r[0]
@@ -685,15 +685,15 @@ function K(e) {
685
685
  e
686
686
  ])] : e;
687
687
  }
688
- function Ye(e) {
688
+ function Qe(e) {
689
689
  return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
690
690
  }
691
- function Xe(e) {
692
- return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? K(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
691
+ function $e(e) {
692
+ return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? W(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
693
693
  }
694
- function Ze(e) {
694
+ function et(e) {
695
695
  if (!e || !e.conditions || e.conditions.length === 0) return [];
696
- let t = Xe(e.conditions.filter((e) => {
696
+ let t = $e(e.conditions.filter((e) => {
697
697
  if (e.operator === "isEmpty" || e.operator === "isNotEmpty") return !0;
698
698
  let t = e.value;
699
699
  return !(t == null || t === "" || Array.isArray(t) && t.length === 0);
@@ -707,47 +707,47 @@ function Ze(e) {
707
707
  null
708
708
  ] : [
709
709
  e.field,
710
- G(e.operator),
710
+ Ze(e.operator),
711
711
  e.value
712
712
  ]));
713
713
  return t.length === 0 ? [] : t.length === 1 ? t[0] : [e.logic, ...t];
714
714
  }
715
- function q(e, t) {
715
+ function tt(e, t) {
716
716
  if (!t || t.length === 0) return {};
717
- for (let r of t) {
718
- let t = !1, i = ("condition" in r ? r.condition : void 0) || ("expression" in r ? r.expression : void 0) || void 0;
719
- if (i) t = n(i, e);
720
- else if ("field" in r && "operator" in r && r.field && r.operator) {
721
- let n = e[r.field];
722
- switch (r.operator) {
717
+ for (let n of t) {
718
+ let t = !1, i = ("condition" in n ? n.condition : void 0) || ("expression" in n ? n.expression : void 0) || void 0;
719
+ if (i) t = r(i, e);
720
+ else if ("field" in n && "operator" in n && n.field && n.operator) {
721
+ let r = e[n.field];
722
+ switch (n.operator) {
723
723
  case "equals":
724
- t = n === r.value;
724
+ t = r === n.value;
725
725
  break;
726
726
  case "not_equals":
727
- t = n !== r.value;
727
+ t = r !== n.value;
728
728
  break;
729
729
  case "contains":
730
- t = typeof n == "string" && typeof r.value == "string" && n.includes(r.value);
730
+ t = typeof r == "string" && typeof n.value == "string" && r.includes(n.value);
731
731
  break;
732
732
  case "greater_than":
733
- t = typeof n == "number" && typeof r.value == "number" && n > r.value;
733
+ t = typeof r == "number" && typeof n.value == "number" && r > n.value;
734
734
  break;
735
735
  case "less_than":
736
- t = typeof n == "number" && typeof r.value == "number" && n < r.value;
736
+ t = typeof r == "number" && typeof n.value == "number" && r < n.value;
737
737
  break;
738
738
  case "in":
739
- t = Array.isArray(r.value) && r.value.includes(n);
739
+ t = Array.isArray(n.value) && n.value.includes(r);
740
740
  break;
741
741
  }
742
742
  }
743
743
  if (t) {
744
744
  let e = {};
745
- return "style" in r && r.style && Object.assign(e, r.style), "backgroundColor" in r && r.backgroundColor && (e.backgroundColor = r.backgroundColor), "textColor" in r && r.textColor && (e.color = r.textColor), "borderColor" in r && r.borderColor && (e.borderColor = r.borderColor), e;
745
+ return "style" in n && n.style && Object.assign(e, n.style), "backgroundColor" in n && n.backgroundColor && (e.backgroundColor = n.backgroundColor), "textColor" in n && n.textColor && (e.color = n.textColor), "borderColor" in n && n.borderColor && (e.borderColor = n.borderColor), e;
746
746
  }
747
747
  }
748
748
  return {};
749
749
  }
750
- var Qe = {
750
+ var G = {
751
751
  "list.recordCount": "{{count}} records",
752
752
  "list.recordCountOne": "{{count}} record",
753
753
  "list.noItems": "No items found",
@@ -794,41 +794,43 @@ var Qe = {
794
794
  "grid.toolbar.densityCycleShortHint": "Click to cycle",
795
795
  "list.viewSettings": "View settings",
796
796
  "list.viewSettingsHint": "Grouping, color, density, and visible fields."
797
- }, $e = (e, t, n) => n, et = (e, t) => {
798
- let n = Qe[e] || e;
797
+ }, nt = (e, t, n) => n, rt = (e, t) => {
798
+ let n = G[e] || e;
799
799
  if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
800
800
  return n;
801
801
  };
802
- function tt() {
802
+ function it() {
803
803
  try {
804
- let e = ke();
805
- return e.t("list.recordCount") === "list.recordCount" ? { t: et } : { t: e.t };
804
+ let e = R();
805
+ return e.t("list.recordCount") === "list.recordCount" ? { t: rt } : { t: e.t };
806
806
  } catch {
807
- return { t: et };
807
+ return { t: rt };
808
808
  }
809
809
  }
810
- function nt() {
810
+ function at() {
811
811
  try {
812
- let { fieldLabel: e, actionLabel: t } = R();
812
+ let { fieldLabel: e, actionLabel: t, objectLabel: n } = Ae();
813
813
  return {
814
814
  fieldLabel: e,
815
- actionLabel: t
815
+ actionLabel: t,
816
+ objectLabel: n
816
817
  };
817
818
  } catch {
818
819
  return {
819
- fieldLabel: $e,
820
- actionLabel: void 0
820
+ fieldLabel: nt,
821
+ actionLabel: void 0,
822
+ objectLabel: void 0
821
823
  };
822
824
  }
823
825
  }
824
- var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChange: a, onSortChange: o, onSearchChange: s, onHiddenFieldsChange: c, onInlineEditChange: l, onColumnStateChange: d, onRowClick: f, showViewSwitcher: m, userFilterSelections: h, onUserFilterSelectionsChange: g, initialFilters: _, initialSearchTerm: b, ...D }, O) => {
825
- let ie = m ?? e?.showViewSwitcher ?? !1, { t: k } = tt(), { fieldLabel: A, actionLabel: oe } = nt(), { translateOptions: j } = Ae(), M = i.useMemo(() => e.viewType && e.viewType !== "list" ? e : {
826
+ var K = a.forwardRef(({ schema: e, className: r, onViewChange: i, onFilterChange: o, onSortChange: s, onSearchChange: c, onHiddenFieldsChange: l, onInlineEditChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: h, userFilterSelections: g, onUserFilterSelectionsChange: _, initialFilters: v, initialSearchTerm: x, ...D }, ie) => {
827
+ let k = h ?? e?.showViewSwitcher ?? !1, { t: A } = it(), { fieldLabel: j, actionLabel: oe, objectLabel: le } = at(), { translateOptions: ue } = je(), M = a.useMemo(() => e.viewType && e.viewType !== "list" ? e : {
826
828
  ...e,
827
829
  viewType: "grid"
828
- }, [e]), N = i.useCallback((e, t) => M.objectName ? A(M.objectName, e, t) : t, [M.objectName, A]), de = i.useCallback((e) => {
829
- let t = Ye(e);
830
+ }, [e]), N = a.useCallback((e, t) => M.objectName ? j(M.objectName, e, t) : t, [M.objectName, j]), pe = a.useCallback((e) => {
831
+ let t = Qe(e);
830
832
  return M.objectName && typeof oe == "function" ? oe(M.objectName, e, t) : t;
831
- }, [M.objectName, oe]), P = i.useMemo(() => {
833
+ }, [M.objectName, oe]), P = a.useMemo(() => {
832
834
  let e = M.userActions, t = M.addRecord?.enabled === !0 && e?.addRecordForm !== !1;
833
835
  return {
834
836
  showSearch: e?.search === void 0 ? M.showSearch !== !1 : e.search,
@@ -854,7 +856,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
854
856
  M.compactToolbar,
855
857
  M.addRecord,
856
858
  M.userActions?.addRecordForm
857
- ]), [F, Se] = i.useState(M.viewType), [R, ke] = i.useState(() => b ?? ""), [Me, Ne] = i.useState(!1), [Ie, ze] = i.useState(!1), [z, B] = i.useState(() => M.sort && M.sort.length > 0 ? M.sort.map((e) => {
859
+ ]), [F, Ae] = a.useState(M.viewType), [R, Ne] = a.useState(() => x ?? ""), [Pe, Le] = a.useState(!1), [Be, Ve] = a.useState(!1), [z, B] = a.useState(() => M.sort && M.sort.length > 0 ? M.sort.map((e) => {
858
860
  if (typeof e == "string") {
859
861
  let t = e.trim().split(/\s+/);
860
862
  return {
@@ -868,8 +870,8 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
868
870
  field: e.field,
869
871
  order: e.order || "asc"
870
872
  };
871
- }) : []), V = i.useMemo(() => JSON.stringify(M.sort || []), [M.sort]);
872
- i.useEffect(() => {
873
+ }) : []), Ue = a.useMemo(() => JSON.stringify(M.sort || []), [M.sort]);
874
+ a.useEffect(() => {
873
875
  M.sort && M.sort.length > 0 ? B(M.sort.map((e) => {
874
876
  if (typeof e == "string") {
875
877
  let t = e.trim().split(/\s+/);
@@ -885,18 +887,18 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
885
887
  order: e.order || "asc"
886
888
  };
887
889
  })) : B([]);
888
- }, [V]);
889
- let [Ve, He] = i.useState(!1), [H, We] = i.useState(() => _ && Array.isArray(_.conditions) ? _ : {
890
+ }, [Ue]);
891
+ let [We, Ke] = a.useState(!1), [V, qe] = a.useState(() => v && Array.isArray(v.conditions) ? v : {
890
892
  id: "root",
891
893
  logic: "and",
892
894
  conditions: []
893
- }), U = D.dataSource, [W, Ke] = i.useState([]), [qe, Je] = i.useState(null), [G, K] = i.useState(() => !(Array.isArray(M.data) || M.data && typeof M.data == "object" && M.data.provider === "value" && Array.isArray(M.data.items))), [q, Qe] = i.useState(null), [$e, et] = i.useState(!1), [rt, it] = i.useState(0), [at, ot] = i.useState(!1);
894
- i.useImperativeHandle(O, () => ({ refresh: () => it((e) => e + 1) }), []), i.useEffect(() => {
895
- if (!(!U?.onMutation || !M.objectName)) return U.onMutation((e) => {
896
- e.resource === M.objectName && it((e) => e + 1);
895
+ }), H = D.dataSource, [U, Ye] = a.useState([]), [Xe, Ze] = a.useState(null), [W, tt] = a.useState(() => !(Array.isArray(M.data) || M.data && typeof M.data == "object" && M.data.provider === "value" && Array.isArray(M.data.items) || M.viewType === "gantt" && M.data && typeof M.data == "object" && !Array.isArray(M.data) && M.data.provider === "api")), [G, nt] = a.useState(null), [rt, K] = a.useState(!1), [ot, st] = a.useState(0), [ct, lt] = a.useState(!1);
896
+ a.useImperativeHandle(ie, () => ({ refresh: () => st((e) => e + 1) }), []), a.useEffect(() => {
897
+ if (!(!H?.onMutation || !M.objectName)) return H.onMutation((e) => {
898
+ e.resource === M.objectName && st((e) => e + 1);
897
899
  });
898
- }, [U, M.objectName]);
899
- let [st, ct] = i.useState(void 0), J = st ?? M.pagination?.pageSize ?? 100, [lt, ut] = i.useState(1), [dt, ft] = i.useState(null), pt = i.useMemo(() => {
900
+ }, [H, M.objectName]);
901
+ let [ut, dt] = a.useState(void 0), q = ut ?? M.pagination?.pageSize ?? 100, [ft, pt] = a.useState(1), [mt, ht] = a.useState(null), gt = a.useMemo(() => {
900
902
  if (M.grouping?.fields?.length) return M.grouping;
901
903
  let e = typeof M.groupBy == "string" ? M.groupBy.trim() : "", t = typeof M.groupBy2 == "string" ? M.groupBy2.trim() : "", n = [];
902
904
  return e && n.push({
@@ -912,19 +914,19 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
912
914
  M.grouping,
913
915
  M.groupBy,
914
916
  M.groupBy2
915
- ]), [Y, mt] = i.useState(pt), [ht, gt] = i.useState(!1), _t = i.useRef(pt);
916
- i.useEffect(() => {
917
- _t.current !== pt && (_t.current = pt, mt(pt));
918
- }, [pt]);
919
- let [X, vt] = i.useState(M.rowColor), [yt, bt] = i.useState(!1), [xt, St] = i.useState([]), Ct = i.useRef(0), [wt, Tt] = i.useState([]), Et = i.useMemo(() => {
917
+ ]), [J, _t] = a.useState(gt), [vt, yt] = a.useState(!1), bt = a.useRef(gt);
918
+ a.useEffect(() => {
919
+ bt.current !== gt && (bt.current = gt, _t(gt));
920
+ }, [gt]);
921
+ let [Y, xt] = a.useState(M.rowColor), [St, Ct] = a.useState(!1), [wt, Tt] = a.useState([]), Et = a.useRef(0), [X, Dt] = a.useState([]), Ot = a.useMemo(() => {
920
922
  let e = M.userFilters;
921
923
  if (!e) return;
922
- if (e.element === "tabs" || e.fields && e.fields.length > 0 || !q?.fields) return e;
924
+ if (e.element === "tabs" || e.fields && e.fields.length > 0 || !G?.fields) return e;
923
925
  let t = /* @__PURE__ */ new Set([
924
926
  "select",
925
927
  "multi-select",
926
928
  "boolean"
927
- ]), n = [], r = Array.isArray(q.fields) ? q.fields.map((e) => [e.name, e]) : Object.entries(q.fields);
929
+ ]), n = [], r = Array.isArray(G.fields) ? G.fields.map((e) => [e.name, e]) : Object.entries(G.fields);
928
930
  for (let [e, i] of r) (t.has(i.type) || i.options && !i.type) && n.push({
929
931
  field: e,
930
932
  label: N(e, i.label || e),
@@ -936,73 +938,73 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
936
938
  };
937
939
  }, [
938
940
  M.userFilters,
939
- q,
941
+ G,
940
942
  N
941
- ]), [Z, Dt] = i.useState(() => new Set(M.hiddenFields || [])), Ot = i.useMemo(() => JSON.stringify(M.hiddenFields || []), [M.hiddenFields]);
942
- i.useEffect(() => {
943
- Dt(new Set(M.hiddenFields || []));
944
- }, [Ot]);
945
- let kt = i.useCallback((e) => {
946
- Dt(e), c?.(Array.from(e));
947
- }, [c]), [At, jt] = i.useState(!1), [Mt, Nt] = i.useState(() => !!M.inlineEdit);
948
- i.useEffect(() => {
949
- Nt(!!M.inlineEdit);
943
+ ]), [Z, kt] = a.useState(() => new Set(M.hiddenFields || [])), At = a.useMemo(() => JSON.stringify(M.hiddenFields || []), [M.hiddenFields]);
944
+ a.useEffect(() => {
945
+ kt(new Set(M.hiddenFields || []));
946
+ }, [At]);
947
+ let jt = a.useCallback((e) => {
948
+ kt(e), l?.(Array.from(e));
949
+ }, [l]), [Mt, Nt] = a.useState(!1), [Pt, Ft] = a.useState(() => !!M.inlineEdit);
950
+ a.useEffect(() => {
951
+ Ft(!!M.inlineEdit);
950
952
  }, [M.inlineEdit]);
951
- let Pt = i.useCallback((e) => {
952
- Nt(e), l?.(e);
953
- }, [l]), [Ft, It] = i.useState(!1), [Lt, Rt] = i.useState(!1), [zt, Bt] = i.useState(null), Vt = M.allowExport !== !1 && M.operations?.export !== !1, Ht = i.useMemo(() => {
953
+ let It = a.useCallback((e) => {
954
+ Ft(e), u?.(e);
955
+ }, [u]), [Lt, Rt] = a.useState(!1), [zt, Bt] = a.useState(!1), [Vt, Ht] = a.useState(null), Ut = M.allowExport !== !1 && M.operations?.export !== !1, Wt = a.useMemo(() => {
954
956
  if (M.exportOptions) return Array.isArray(M.exportOptions) ? { formats: M.exportOptions } : M.exportOptions;
955
- }, [M.exportOptions]), Q = Pe(i.useMemo(() => M.densityMode ? M.densityMode : M.rowHeight ? {
957
+ }, [M.exportOptions]), Q = Fe(a.useMemo(() => M.densityMode ? M.densityMode : M.rowHeight ? {
956
958
  compact: "compact",
957
959
  short: "compact",
958
960
  medium: "comfortable",
959
961
  tall: "spacious",
960
962
  extra_tall: "spacious"
961
- }[M.rowHeight] || "comfortable" : "compact", [M.densityMode, M.rowHeight]), { onChange: M.onDensityChange }), Ut = i.useMemo(() => `objectui:gallery:density:${M.objectName ?? "default"}`, [M.objectName]), [Wt, Gt] = i.useState(() => {
963
+ }[M.rowHeight] || "comfortable" : "compact", [M.densityMode, M.rowHeight]), { onChange: M.onDensityChange }), Gt = a.useMemo(() => `objectui:gallery:density:${M.objectName ?? "default"}`, [M.objectName]), [Kt, qt] = a.useState(() => {
962
964
  if (typeof window > "u") return M.gallery?.cardSize ?? "medium";
963
965
  try {
964
- let e = window.localStorage.getItem(Ut);
966
+ let e = window.localStorage.getItem(Gt);
965
967
  if (e === "small" || e === "medium" || e === "large") return e;
966
968
  } catch {}
967
969
  return M.gallery?.cardSize ?? "medium";
968
- }), Kt = i.useCallback(() => {
969
- Gt((e) => {
970
+ }), Jt = a.useCallback(() => {
971
+ qt((e) => {
970
972
  let t = e === "large" ? "medium" : e === "medium" ? "small" : "large";
971
973
  try {
972
- window.localStorage.setItem(Ut, t);
974
+ window.localStorage.setItem(Gt, t);
973
975
  } catch {}
974
976
  return t;
975
977
  });
976
- }, [Ut]), { ref: qt, isRefreshing: Jt, pullDistance: Yt } = Le({
977
- onRefresh: i.useCallback(async () => {
978
- it((e) => e + 1);
978
+ }, [Gt]), { ref: Yt, isRefreshing: Xt, pullDistance: Zt } = Re({
979
+ onRefresh: a.useCallback(async () => {
980
+ st((e) => e + 1);
979
981
  }, []),
980
- enabled: !!U && !!M.objectName
981
- }), Xt = i.useMemo(() => M.id ? `listview-${M.objectName}-${M.id}-view` : `listview-${M.objectName}-view`, [M.objectName, M.id]);
982
- i.useEffect(() => {
982
+ enabled: !!H && !!M.objectName
983
+ }), Qt = a.useMemo(() => M.id ? `listview-${M.objectName}-${M.id}-view` : `listview-${M.objectName}-view`, [M.objectName, M.id]);
984
+ a.useEffect(() => {
983
985
  let e = !0;
984
- return et(!1), Qe(null), (async () => {
985
- if (!U || !M.objectName) {
986
- et(!0);
986
+ return K(!1), nt(null), (async () => {
987
+ if (!H || !M.objectName) {
988
+ K(!0);
987
989
  return;
988
990
  }
989
- if (typeof U.getObjectSchema != "function") {
990
- et(!0);
991
+ if (typeof H.getObjectSchema != "function") {
992
+ K(!0);
991
993
  return;
992
994
  }
993
995
  try {
994
- let t = await U.getObjectSchema(M.objectName);
995
- e && Qe(t);
996
+ let t = await H.getObjectSchema(M.objectName);
997
+ e && nt(t);
996
998
  } catch (e) {
997
999
  console.warn("Failed to fetch object schema for ListView:", e);
998
1000
  } finally {
999
- e && et(!0);
1001
+ e && K(!0);
1000
1002
  }
1001
1003
  })(), () => {
1002
1004
  e = !1;
1003
1005
  };
1004
- }, [M.objectName, U]);
1005
- let Zt = i.useMemo(() => {
1006
+ }, [M.objectName, H]);
1007
+ let $t = a.useMemo(() => {
1006
1008
  let e = Array.isArray(M.fields) ? M.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
1007
1009
  if (!e) return;
1008
1010
  let t = [
@@ -1029,9 +1031,9 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1029
1031
  };
1030
1032
  r(M.kanban), r(M.options?.kanban), r(M.calendar), r(M.options?.calendar), r(M.gallery), r(M.options?.gallery), r(M.timeline), r(M.options?.timeline), r(M.gantt), r(M.options?.gantt);
1031
1033
  let i = n.size > 0 ? Array.from(n) : void 0;
1032
- return t(q?.fields, i);
1034
+ return t(G?.fields, i);
1033
1035
  }, [
1034
- q?.fields,
1036
+ G?.fields,
1035
1037
  M.fields,
1036
1038
  M.kanban,
1037
1039
  M.calendar,
@@ -1039,9 +1041,9 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1039
1041
  M.timeline,
1040
1042
  M.gantt,
1041
1043
  M.options
1042
- ]), Qt = Re();
1043
- i.useEffect(() => {
1044
- let e = !0, t = ++Ct.current;
1044
+ ]), en = ze(), tn = F === "gantt" && !!M.data && typeof M.data == "object" && !Array.isArray(M.data) && M.data.provider === "api";
1045
+ a.useEffect(() => {
1046
+ let e = !0, t = ++Et.current;
1045
1047
  if (M.data && typeof M.data == "object" && !Array.isArray(M.data)) {
1046
1048
  let e = M.data;
1047
1049
  if (e.provider === "value" && Array.isArray(e.items)) {
@@ -1050,7 +1052,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1050
1052
  let e = R.toLowerCase();
1051
1053
  t = t.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
1052
1054
  }
1053
- Ke(t), K(!1), ot(!1);
1055
+ Ye(t), tt(!1), lt(!1);
1054
1056
  return;
1055
1057
  }
1056
1058
  }
@@ -1060,17 +1062,21 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1060
1062
  let t = R.toLowerCase();
1061
1063
  e = e.filter((e) => Object.values(e).some((e) => e != null && String(e).toLowerCase().includes(t)));
1062
1064
  }
1063
- Ke(e), K(!1), ot(!1);
1065
+ Ye(e), tt(!1), lt(!1);
1064
1066
  return;
1065
1067
  }
1066
- return $e ? ((async () => {
1067
- if (!U || !M.objectName) {
1068
- K(!1);
1068
+ if (tn) {
1069
+ tt(!1), lt(!1);
1070
+ return;
1071
+ }
1072
+ return rt ? ((async () => {
1073
+ if (!H || !M.objectName) {
1074
+ tt(!1);
1069
1075
  return;
1070
1076
  }
1071
- K(!0), Je(null);
1077
+ tt(!0), Ze(null);
1072
1078
  try {
1073
- let n = [], r = M.filters || [], i = Ze(H), a = Xe(wt), o = [
1079
+ let n = [], r = M.filters || [], i = et(V), a = $e(X), o = [
1074
1080
  ...r.length > 0 ? [r] : [],
1075
1081
  ...i.length > 0 ? [i] : [],
1076
1082
  ...a
@@ -1080,13 +1086,13 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1080
1086
  field: e.field,
1081
1087
  order: e.order
1082
1088
  })) : void 0, c = (() => {
1083
- let e = Array.isArray(M.fields) ? M.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], t = Qt?.isLoaded && M.objectName ? e.filter((e) => Qt.checkField(M.objectName, e, "read")) : e;
1089
+ let e = Array.isArray(M.fields) ? M.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], t = en?.isLoaded && M.objectName ? e.filter((e) => en.checkField(M.objectName, e, "read")) : e;
1084
1090
  if (t.length === 0) return;
1085
1091
  let n = /* @__PURE__ */ new Set(["id"]);
1086
1092
  for (let e of t) n.add(e);
1087
- for (let e of Zt) n.add(e);
1093
+ for (let e of $t) n.add(e);
1088
1094
  let r = (() => {
1089
- let e = q?.fields;
1095
+ let e = G?.fields;
1090
1096
  if (!e) return null;
1091
1097
  let t = Array.isArray(e) ? e.map((e) => e?.name).filter((e) => typeof e == "string") : Object.keys(e), n = new Set(t);
1092
1098
  return n.add("id"), n.add("created_at"), n.add("updated_at"), n;
@@ -1122,27 +1128,27 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1122
1128
  e && !Array.isArray(e.metaFields) && (i("status"), i("priority"));
1123
1129
  }
1124
1130
  return a(M.gantt), a(M.options?.gantt), Array.from(n);
1125
- })(), l = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, u = F === "grid" && !Y?.fields?.length, d = u ? (lt - 1) * J : 0, f = await U.find(M.objectName, {
1131
+ })(), l = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, u = F === "grid" && !J?.fields?.length, d = u ? (ft - 1) * q : 0, f = await H.find(M.objectName, {
1126
1132
  ...l ? { $filter: n } : {},
1127
1133
  $orderby: s,
1128
- $top: J,
1134
+ $top: q,
1129
1135
  ...d > 0 ? { $skip: d } : {},
1130
1136
  ...c ? { $select: c } : {},
1131
- ...Zt.length > 0 ? { $expand: Zt } : {},
1137
+ ...$t.length > 0 ? { $expand: $t } : {},
1132
1138
  ...R ? {
1133
1139
  $search: R,
1134
1140
  ...M.searchableFields && M.searchableFields.length > 0 ? { $searchFields: M.searchableFields } : {}
1135
1141
  } : {}
1136
1142
  });
1137
- if (!e || t !== Ct.current) return;
1143
+ if (!e || t !== Et.current) return;
1138
1144
  let p = [];
1139
- Array.isArray(f) ? p = f : f && typeof f == "object" && (Array.isArray(f.data) ? p = f.data : Array.isArray(f.records) ? p = f.records : Array.isArray(f.value) && (p = f.value)), Ke(p);
1145
+ Array.isArray(f) ? p = f : f && typeof f == "object" && (Array.isArray(f.data) ? p = f.data : Array.isArray(f.records) ? p = f.records : Array.isArray(f.value) && (p = f.value)), Ye(p);
1140
1146
  let m = f && typeof f == "object" ? f.total ?? f.count : void 0, h = typeof m == "number" ? m : null;
1141
- ft(u ? h : null), ot(!(u && h != null) && p.length >= J);
1147
+ ht(u ? h : null), lt(!(u && h != null) && p.length >= q);
1142
1148
  } catch (e) {
1143
- t === Ct.current && (console.error("ListView data fetch error:", e), Ke([]), Je(e?.message ? String(e.message) : String(e ?? "Unknown error")));
1149
+ t === Et.current && (console.error("ListView data fetch error:", e), Ye([]), Ze(e?.message ? String(e.message) : String(e ?? "Unknown error")));
1144
1150
  } finally {
1145
- e && t === Ct.current && K(!1);
1151
+ e && t === Et.current && tt(!1);
1146
1152
  }
1147
1153
  })(), () => {
1148
1154
  e = !1;
@@ -1150,38 +1156,39 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1150
1156
  }, [
1151
1157
  M.objectName,
1152
1158
  M.data,
1153
- U,
1159
+ H,
1154
1160
  M.filters,
1155
- J,
1161
+ q,
1156
1162
  z,
1157
- H,
1158
- wt,
1159
- rt,
1163
+ V,
1164
+ X,
1165
+ ot,
1160
1166
  R,
1161
1167
  M.searchableFields,
1162
- Zt,
1163
- $e,
1168
+ $t,
1169
+ rt,
1164
1170
  M.refreshTrigger,
1165
- Qt,
1166
- lt,
1171
+ en,
1172
+ ft,
1167
1173
  F,
1168
- Y
1174
+ J,
1175
+ tn
1169
1176
  ]);
1170
- let $t = JSON.stringify([
1177
+ let nn = JSON.stringify([
1171
1178
  M.objectName,
1172
1179
  M.filters,
1173
- J,
1180
+ q,
1174
1181
  z,
1175
- H,
1176
- wt,
1182
+ V,
1183
+ X,
1177
1184
  R,
1178
1185
  F,
1179
- Y
1180
- ]), en = i.useRef($t);
1181
- i.useEffect(() => {
1182
- en.current !== $t && (en.current = $t, ut(1));
1183
- }, [$t]);
1184
- let tn = i.useMemo(() => {
1186
+ J
1187
+ ]), rn = a.useRef(nn);
1188
+ a.useEffect(() => {
1189
+ rn.current !== nn && (rn.current = nn, pt(1));
1190
+ }, [nn]);
1191
+ let an = a.useMemo(() => {
1185
1192
  let e = ["grid"];
1186
1193
  (M.kanban?.groupByField || M.kanban?.groupField || M.options?.kanban?.groupField) && e.push("kanban"), (M.gallery?.coverField || M.gallery?.imageField || M.options?.gallery?.imageField) && e.push("gallery"), (M.calendar?.startDateField || M.options?.calendar?.startDateField) && e.push("calendar"), (M.timeline?.startDateField || M.options?.timeline?.startDateField || M.options?.timeline?.dateField || M.options?.calendar?.startDateField) && e.push("timeline"), (M.gantt?.startDateField || M.options?.gantt?.startDateField) && e.push("gantt"), (M.options?.map?.locationField || M.options?.map?.latitudeField && M.options?.map?.longitudeField) && e.push("map"), (M.tree?.parentField || M.options?.tree?.parentField || M.viewType === "tree") && e.push("tree"), M.viewType && !e.includes(M.viewType) && [
1187
1194
  "grid",
@@ -1211,29 +1218,29 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1211
1218
  M.tree,
1212
1219
  M.appearance?.allowedVisualizations
1213
1220
  ]);
1214
- i.useEffect(() => {
1215
- M.viewType && Se(M.viewType);
1221
+ a.useEffect(() => {
1222
+ M.viewType && Ae(M.viewType);
1216
1223
  }, [M.viewType]);
1217
- let nn = i.useCallback((e) => {
1218
- Se(e);
1224
+ let on = a.useCallback((e) => {
1225
+ Ae(e);
1219
1226
  try {
1220
- localStorage.setItem(Xt, e);
1227
+ localStorage.setItem(Qt, e);
1221
1228
  } catch (e) {
1222
1229
  console.warn("Failed to save view preference to localStorage:", e);
1223
1230
  }
1224
- r?.(e);
1225
- }, [Xt, r]), rn = i.useCallback((e) => {
1226
- ke(e), s?.(e);
1227
- }, [s]), an = Fe({
1231
+ i?.(e);
1232
+ }, [Qt, i]), sn = a.useCallback((e) => {
1233
+ Ne(e), c?.(e);
1234
+ }, [c]), cn = Ie({
1228
1235
  navigation: M.navigation,
1229
1236
  objectName: M.objectName,
1230
1237
  onNavigate: M.onNavigate,
1231
- onRowClick: f
1232
- }), $ = i.useMemo(() => {
1238
+ onRowClick: p
1239
+ }), $ = a.useMemo(() => {
1233
1240
  let e = M.fields || [];
1234
- if (Array.isArray(e) || (e = []), Qt?.isLoaded && M.objectName && (e = e.filter((e) => {
1241
+ if (Array.isArray(e) || (e = []), en?.isLoaded && M.objectName && (e = e.filter((e) => {
1235
1242
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1236
- return t ? Qt.checkField(M.objectName, t, "read") : !0;
1243
+ return !t || en.checkField(M.objectName, t, "read");
1237
1244
  })), Z.size > 0 && (e = e.filter((e) => {
1238
1245
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1239
1246
  return t != null && !Z.has(t);
@@ -1250,8 +1257,8 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1250
1257
  M.objectName,
1251
1258
  Z,
1252
1259
  M.fieldOrder,
1253
- Qt
1254
- ]), on = i.useMemo(() => {
1260
+ en
1261
+ ]), ln = a.useMemo(() => {
1255
1262
  let e = Q.mode === "compact" ? "compact" : Q.mode === "spacious" ? "tall" : "medium", t = {
1256
1263
  objectName: M.objectName,
1257
1264
  fields: $,
@@ -1259,12 +1266,12 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1259
1266
  sort: z,
1260
1267
  className: "h-full w-full",
1261
1268
  showSearch: !1,
1262
- onRowClick: an.handleClick,
1269
+ onRowClick: cn.handleClick,
1263
1270
  rowHeight: e,
1264
1271
  hideRowHeightToggle: !0,
1265
1272
  ...M.striped == null ? {} : { striped: M.striped },
1266
1273
  ...M.bordered == null ? {} : { bordered: M.bordered },
1267
- ...d ? { onColumnStateChange: d } : {},
1274
+ ...f ? { onColumnStateChange: f } : {},
1268
1275
  ...M.columnState ? { columnState: M.columnState } : {}
1269
1276
  };
1270
1277
  switch (F) {
@@ -1274,14 +1281,14 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1274
1281
  ...t,
1275
1282
  columns: $,
1276
1283
  ...M.conditionalFormatting ? { conditionalFormatting: M.conditionalFormatting } : {},
1277
- editable: Mt,
1284
+ editable: Pt,
1278
1285
  ...M.wrapHeaders == null ? {} : { wrapHeaders: M.wrapHeaders },
1279
1286
  ...M.virtualScroll == null ? {} : { virtualScroll: M.virtualScroll },
1280
1287
  ...M.resizable == null ? {} : { resizable: M.resizable },
1281
1288
  ...M.selection ? { selection: M.selection } : {},
1282
1289
  ...M.pagination ? { pagination: M.pagination } : {},
1283
- ...Y ? { grouping: Y } : {},
1284
- ...X ? { rowColor: X } : {},
1290
+ ...J ? { grouping: J } : {},
1291
+ ...Y ? { rowColor: Y } : {},
1285
1292
  ...M.rowActions ? { rowActions: M.rowActions } : {},
1286
1293
  ...M.rowActionDefs ? { rowActionDefs: M.rowActionDefs } : {},
1287
1294
  ...M.bulkActions ? { batchActions: M.bulkActions } : {},
@@ -1295,7 +1302,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1295
1302
  groupField: M.kanban?.groupField || M.options?.kanban?.groupField || "status",
1296
1303
  ...M.kanban?.titleField || M.options?.kanban?.titleField ? { titleField: M.kanban?.titleField || M.options?.kanban?.titleField } : {},
1297
1304
  cardFields: M.kanban?.cardFields || $ || [],
1298
- ...Y ? { grouping: Y } : {},
1305
+ ...J ? { grouping: J } : {},
1299
1306
  ...M.options?.kanban || {},
1300
1307
  ...M.kanban || {}
1301
1308
  };
@@ -1313,7 +1320,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1313
1320
  let e = {
1314
1321
  ...M.options?.gallery || {},
1315
1322
  ...M.gallery || {},
1316
- cardSize: Wt
1323
+ cardSize: Kt
1317
1324
  };
1318
1325
  return {
1319
1326
  type: "object-gallery",
@@ -1322,7 +1329,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1322
1329
  imageField: M.gallery?.coverField || M.gallery?.imageField || M.options?.gallery?.imageField,
1323
1330
  titleField: M.gallery?.titleField || M.options?.gallery?.titleField || "name",
1324
1331
  subtitleField: M.gallery?.subtitleField || M.options?.gallery?.subtitleField,
1325
- ...Y ? { grouping: Y } : {}
1332
+ ...J ? { grouping: J } : {}
1326
1333
  };
1327
1334
  }
1328
1335
  case "timeline": {
@@ -1345,6 +1352,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1345
1352
  case "gantt": return {
1346
1353
  type: "object-gantt",
1347
1354
  ...t,
1355
+ ...M.data ? { data: M.data } : {},
1348
1356
  startDateField: M.gantt?.startDateField || M.options?.gantt?.startDateField || "start_date",
1349
1357
  endDateField: M.gantt?.endDateField || M.options?.gantt?.endDateField || "end_date",
1350
1358
  progressField: M.gantt?.progressField || M.options?.gantt?.progressField || "progress",
@@ -1414,13 +1422,13 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1414
1422
  M,
1415
1423
  z,
1416
1424
  $,
1425
+ J,
1417
1426
  Y,
1418
- X,
1419
- an.handleClick,
1427
+ cn.handleClick,
1420
1428
  Q.mode,
1421
- Wt,
1422
- Mt
1423
- ]), sn = H.conditions && H.conditions.length > 0, cn = i.useMemo(() => {
1429
+ Kt,
1430
+ Pt
1431
+ ]), un = V.conditions && V.conditions.length > 0, dn = a.useMemo(() => {
1424
1432
  let e, t = (e, t) => {
1425
1433
  if (!t) return;
1426
1434
  let n = Array.isArray(t) ? t.map((e) => ({
@@ -1432,9 +1440,9 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1432
1440
  label: t?.label || e,
1433
1441
  ...t
1434
1442
  }));
1435
- return M.objectName ? j(M.objectName, e, n) : n;
1443
+ return M.objectName ? ue(M.objectName, e, n) : n;
1436
1444
  };
1437
- if (e = q?.fields ? Object.entries(q.fields).map(([e, n]) => ({
1445
+ if (e = G?.fields ? Object.entries(G.fields).map(([e, n]) => ({
1438
1446
  value: e,
1439
1447
  label: N(e, n.label || e),
1440
1448
  type: n.type || "text",
@@ -1464,71 +1472,78 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1464
1472
  }
1465
1473
  return e;
1466
1474
  }, [
1467
- q,
1475
+ G,
1468
1476
  M.fields,
1469
1477
  M.filterableFields,
1470
1478
  M.objectName,
1471
1479
  N,
1472
- j
1473
- ]), ln = i.useCallback((e) => {
1474
- if (!Vt) return;
1475
- let t = Ht, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || M.objectName || "export";
1476
- if ((e === "csv" || e === "xlsx" || e === "json") && typeof U?.exportDownload == "function" && M.objectName && t?.streaming !== !1) {
1477
- let t = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field).filter(Boolean), a = M.filters || [], o = Ze(H), s = Xe(wt), c = [
1480
+ ue
1481
+ ]), fn = a.useCallback((e) => {
1482
+ if (!Ut) return;
1483
+ let t = Wt, r = t?.maxRecords || 0, i = t?.includeHeaders !== !1, a = G?.label && G?.name && typeof le == "function" ? le(G) : G?.label, o = (e) => n(e, {
1484
+ prefix: t?.fileNamePrefix,
1485
+ label: a,
1486
+ objectName: M.objectName,
1487
+ viewLabel: M.label || M.title
1488
+ });
1489
+ if ((e === "csv" || e === "xlsx" || e === "json") && typeof H?.exportDownload == "function" && M.objectName && t?.streaming !== !1) {
1490
+ let t = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field).filter(Boolean), n = M.filters || [], a = et(V), s = $e(X), c = [
1491
+ ...n.length > 0 ? [n] : [],
1478
1492
  ...a.length > 0 ? [a] : [],
1479
- ...o.length > 0 ? [o] : [],
1480
1493
  ...s
1481
1494
  ].filter((e) => Array.isArray(e) && e.length > 0), l = c.length > 1 ? ["and", ...c] : c.length === 1 ? c[0] : void 0, u = z.length > 0 ? z.filter((e) => e.field).map((e) => ({
1482
1495
  field: e.field,
1483
1496
  direction: e.order
1484
1497
  })) : void 0;
1485
- Bt(null), Rt(!0), (async () => {
1498
+ Ht(null), Bt(!0), (async () => {
1486
1499
  try {
1487
- let a = await U.exportDownload(M.objectName, {
1500
+ let n = await H.exportDownload(M.objectName, {
1488
1501
  format: e,
1489
1502
  fields: t.length ? t : void 0,
1490
1503
  filter: l,
1491
1504
  sort: u,
1492
- includeHeaders: r,
1493
- limit: n > 0 ? n : void 0
1494
- }), o = URL.createObjectURL(a), s = document.createElement("a");
1495
- s.href = o, s.download = `${i}.${e}`, s.rel = "noopener", document.body.appendChild(s), s.click(), s.remove(), URL.revokeObjectURL(o), It(!1);
1505
+ includeHeaders: i,
1506
+ limit: r > 0 ? r : void 0
1507
+ }), a = URL.createObjectURL(n), s = document.createElement("a");
1508
+ s.href = a, s.download = o(e), s.rel = "noopener", document.body.appendChild(s), s.click(), s.remove(), URL.revokeObjectURL(a), Rt(!1);
1496
1509
  } catch (e) {
1497
- console.error("ListView export failed:", e), Bt(e instanceof Error ? e.message : String(e));
1510
+ console.error("ListView export failed:", e), Ht(e instanceof Error ? e.message : String(e));
1498
1511
  } finally {
1499
- Rt(!1);
1512
+ Bt(!1);
1500
1513
  }
1501
1514
  })();
1502
1515
  return;
1503
1516
  }
1504
- let a = n > 0 ? W.slice(0, n) : W;
1517
+ let s = r > 0 ? U.slice(0, r) : U;
1505
1518
  if (e === "csv") {
1506
1519
  let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1507
- r && t.push(e.join(",")), a.forEach((n) => {
1520
+ i && t.push(e.join(",")), s.forEach((n) => {
1508
1521
  t.push(e.map((e) => {
1509
1522
  let t = n[e], r;
1510
1523
  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;
1511
1524
  }).join(","));
1512
1525
  });
1513
- let n = new Blob([t.join("\n")], { type: "text/csv;charset=utf-8;" }), o = URL.createObjectURL(n), s = document.createElement("a");
1514
- s.href = o, s.download = `${i}.csv`, s.click(), URL.revokeObjectURL(o);
1526
+ let n = new Blob([t.join("\n")], { type: "text/csv;charset=utf-8;" }), r = URL.createObjectURL(n), a = document.createElement("a");
1527
+ a.href = r, a.download = o("csv"), a.click(), URL.revokeObjectURL(r);
1515
1528
  } else if (e === "json") {
1516
- let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1517
- n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
1529
+ let e = new Blob([JSON.stringify(s, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1530
+ n.href = t, n.download = o("json"), n.click(), URL.revokeObjectURL(t);
1518
1531
  }
1519
- It(!1);
1532
+ Rt(!1);
1520
1533
  }, [
1521
- W,
1534
+ U,
1522
1535
  $,
1523
- Ht,
1536
+ Wt,
1524
1537
  M.objectName,
1525
1538
  M.filters,
1526
- Vt,
1527
- U,
1539
+ Ut,
1528
1540
  H,
1529
- wt,
1530
- z
1531
- ]), un = i.useMemo(() => (M.fields || []).map((e) => {
1541
+ V,
1542
+ X,
1543
+ z,
1544
+ G,
1545
+ le
1546
+ ]), pn = a.useMemo(() => (M.fields || []).map((e) => {
1532
1547
  if (typeof e == "string") return {
1533
1548
  name: e,
1534
1549
  label: N(e, e)
@@ -1540,19 +1555,19 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1540
1555
  };
1541
1556
  }), [M.fields, N]);
1542
1557
  return /* @__PURE__ */ L("div", {
1543
- ref: qt,
1544
- className: E("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1558
+ ref: Yt,
1559
+ className: E("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", r),
1545
1560
  ...M.aria?.label ? { "aria-label": M.aria.label } : {},
1546
1561
  ...M.aria?.describedBy ? { "aria-describedby": M.aria.describedBy } : {},
1547
1562
  ...M.aria?.live ? { "aria-live": M.aria.live } : {},
1548
1563
  role: "region",
1549
- "aria-busy": G || void 0,
1550
- "data-state": G ? "loading" : "idle",
1564
+ "aria-busy": W || void 0,
1565
+ "data-state": W ? "loading" : "idle",
1551
1566
  children: [
1552
- Yt > 0 && /* @__PURE__ */ I("div", {
1567
+ Zt > 0 && /* @__PURE__ */ I("div", {
1553
1568
  className: "flex items-center justify-center text-xs text-muted-foreground",
1554
- style: { height: Yt },
1555
- children: k(Jt ? "list.refreshing" : "list.pullToRefresh")
1569
+ style: { height: Zt },
1570
+ children: A(Xt ? "list.refreshing" : "list.pullToRefresh")
1556
1571
  }),
1557
1572
  M.description && M.appearance?.showDescription !== !1 && /* @__PURE__ */ I("div", {
1558
1573
  className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
@@ -1563,45 +1578,45 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1563
1578
  className: "border-b px-2 sm:px-4 py-1.5 flex items-center justify-between gap-1 sm:gap-2 bg-background",
1564
1579
  children: [/* @__PURE__ */ I("div", {
1565
1580
  className: "flex items-center gap-2 overflow-x-auto min-w-0",
1566
- children: Et && /* @__PURE__ */ I("div", {
1581
+ children: Ot && /* @__PURE__ */ I("div", {
1567
1582
  className: "shrink-0 min-w-0 overflow-x-auto",
1568
1583
  "data-testid": "user-filters",
1569
- children: /* @__PURE__ */ I(Ge, {
1570
- config: Et,
1571
- objectDef: q,
1572
- data: W,
1573
- onFilterChange: Tt,
1584
+ children: /* @__PURE__ */ I(Je, {
1585
+ config: Ot,
1586
+ objectDef: G,
1587
+ data: U,
1588
+ onFilterChange: Dt,
1574
1589
  maxVisible: 3,
1575
- initialSelections: h,
1576
- onSelectionsChange: g
1590
+ initialSelections: g,
1591
+ onSelectionsChange: _
1577
1592
  })
1578
1593
  })
1579
1594
  }), /* @__PURE__ */ L("div", {
1580
1595
  className: "flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm",
1581
1596
  children: [
1582
- ie && /* @__PURE__ */ L(Oe, { children: [/* @__PURE__ */ I(Be, {
1597
+ k && /* @__PURE__ */ L(ke, { children: [/* @__PURE__ */ I(He, {
1583
1598
  currentView: F,
1584
- availableViews: tn,
1585
- onViewChange: nn
1599
+ availableViews: an,
1600
+ onViewChange: on
1586
1601
  }), /* @__PURE__ */ I("div", { className: "h-4 w-px bg-border/60 mx-0.5" })] }),
1587
- F === "grid" && l && !P.compactToolbar && /* @__PURE__ */ L(u, {
1602
+ F === "grid" && u && !P.compactToolbar && /* @__PURE__ */ L(d, {
1588
1603
  variant: "ghost",
1589
1604
  size: "sm",
1590
- onClick: () => Pt(!Mt),
1591
- className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Mt && "text-primary"),
1592
- title: k("list.inlineEditLabel", { defaultValue: "Edit records inline (click a cell to edit)" }),
1605
+ onClick: () => It(!Pt),
1606
+ className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Pt && "text-primary"),
1607
+ title: A("list.inlineEditLabel", { defaultValue: "Edit records inline (click a cell to edit)" }),
1593
1608
  "data-testid": "toolbar-inline-edit-toggle",
1594
- children: [/* @__PURE__ */ I(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1609
+ children: [/* @__PURE__ */ I(ge, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1595
1610
  className: "hidden sm:inline",
1596
- children: k("list.inlineEditShort", { defaultValue: "Edit inline" })
1611
+ children: A("list.inlineEditShort", { defaultValue: "Edit inline" })
1597
1612
  })]
1598
1613
  }),
1599
1614
  P.showHideFields && !P.compactToolbar && /* @__PURE__ */ L(S, {
1600
- open: At,
1601
- onOpenChange: jt,
1615
+ open: Mt,
1616
+ onOpenChange: Nt,
1602
1617
  children: [/* @__PURE__ */ I(w, {
1603
1618
  asChild: !0,
1604
- children: /* @__PURE__ */ L(u, {
1619
+ children: /* @__PURE__ */ L(d, {
1605
1620
  variant: "ghost",
1606
1621
  size: "sm",
1607
1622
  className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Z.size > 0 && "text-primary"),
@@ -1609,7 +1624,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1609
1624
  /* @__PURE__ */ I(ce, { className: "h-3.5 w-3.5 mr-1.5" }),
1610
1625
  /* @__PURE__ */ I("span", {
1611
1626
  className: "hidden sm:inline",
1612
- children: k("list.hideFields")
1627
+ children: A("list.hideFields")
1613
1628
  }),
1614
1629
  Z.size > 0 && /* @__PURE__ */ I("span", {
1615
1630
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
@@ -1626,24 +1641,24 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1626
1641
  className: "flex items-center justify-between border-b pb-2",
1627
1642
  children: [/* @__PURE__ */ I("h4", {
1628
1643
  className: "font-medium text-sm",
1629
- children: k("list.hideFieldsTitle")
1630
- }), Z.size > 0 && /* @__PURE__ */ I(u, {
1644
+ children: A("list.hideFieldsTitle")
1645
+ }), Z.size > 0 && /* @__PURE__ */ I(d, {
1631
1646
  variant: "ghost",
1632
1647
  size: "sm",
1633
1648
  className: "h-6 px-2 text-xs",
1634
- onClick: () => kt(/* @__PURE__ */ new Set()),
1635
- children: k("list.showAll")
1649
+ onClick: () => jt(/* @__PURE__ */ new Set()),
1650
+ children: A("list.showAll")
1636
1651
  })]
1637
1652
  }), /* @__PURE__ */ I("div", {
1638
1653
  className: "max-h-60 overflow-y-auto space-y-1",
1639
- children: un.map((e) => /* @__PURE__ */ L("label", {
1654
+ children: pn.map((e) => /* @__PURE__ */ L("label", {
1640
1655
  className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
1641
1656
  children: [/* @__PURE__ */ I("input", {
1642
1657
  type: "checkbox",
1643
1658
  checked: !Z.has(e.name),
1644
1659
  onChange: () => {
1645
1660
  let t = new Set(Z);
1646
- t.has(e.name) ? t.delete(e.name) : t.add(e.name), kt(t);
1661
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), jt(t);
1647
1662
  },
1648
1663
  className: "rounded border-input"
1649
1664
  }), /* @__PURE__ */ I("span", {
@@ -1657,23 +1672,23 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1657
1672
  }),
1658
1673
  P.showHideFields && !P.compactToolbar && (P.showFilters || P.showSort || P.showGroup) && /* @__PURE__ */ I("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
1659
1674
  P.showFilters && /* @__PURE__ */ L(S, {
1660
- open: Ve,
1661
- onOpenChange: He,
1675
+ open: We,
1676
+ onOpenChange: Ke,
1662
1677
  children: [/* @__PURE__ */ I(w, {
1663
1678
  asChild: !0,
1664
- children: /* @__PURE__ */ L(u, {
1679
+ children: /* @__PURE__ */ L(d, {
1665
1680
  variant: "ghost",
1666
1681
  size: "sm",
1667
- className: E("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", sn && "text-foreground font-medium"),
1682
+ className: E("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", un && "text-foreground font-medium"),
1668
1683
  children: [
1669
- /* @__PURE__ */ I(we, { className: "h-3.5 w-3.5 mr-1.5" }),
1684
+ /* @__PURE__ */ I(Te, { className: "h-3.5 w-3.5 mr-1.5" }),
1670
1685
  /* @__PURE__ */ I("span", {
1671
1686
  className: "hidden sm:inline",
1672
- children: k("list.filter")
1687
+ children: A("list.filter")
1673
1688
  }),
1674
- sn && /* @__PURE__ */ I("span", {
1689
+ un && /* @__PURE__ */ I("span", {
1675
1690
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1676
- children: H.conditions?.length || 0
1691
+ children: V.conditions?.length || 0
1677
1692
  })
1678
1693
  ]
1679
1694
  })
@@ -1686,36 +1701,36 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1686
1701
  className: "flex items-center justify-between border-b pb-2",
1687
1702
  children: /* @__PURE__ */ I("h4", {
1688
1703
  className: "font-medium text-sm",
1689
- children: k("list.filterRecords")
1704
+ children: A("list.filterRecords")
1690
1705
  })
1691
- }), /* @__PURE__ */ I(v, {
1692
- fields: cn,
1693
- value: H,
1706
+ }), /* @__PURE__ */ I(ee, {
1707
+ fields: dn,
1708
+ value: V,
1694
1709
  onChange: (e) => {
1695
- We(e), a && a(e);
1710
+ qe(e), o && o(e);
1696
1711
  }
1697
1712
  })]
1698
1713
  })
1699
1714
  })]
1700
1715
  }),
1701
1716
  P.showGroup && !P.compactToolbar && /* @__PURE__ */ L(S, {
1702
- open: ht,
1703
- onOpenChange: gt,
1717
+ open: vt,
1718
+ onOpenChange: yt,
1704
1719
  children: [/* @__PURE__ */ I(w, {
1705
1720
  asChild: !0,
1706
- children: /* @__PURE__ */ L(u, {
1721
+ children: /* @__PURE__ */ L(d, {
1707
1722
  variant: "ghost",
1708
1723
  size: "sm",
1709
- className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Y && "text-foreground font-medium"),
1724
+ className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J && "text-foreground font-medium"),
1710
1725
  children: [
1711
- /* @__PURE__ */ I(le, { className: "h-3.5 w-3.5 mr-1.5" }),
1726
+ /* @__PURE__ */ I(de, { className: "h-3.5 w-3.5 mr-1.5" }),
1712
1727
  /* @__PURE__ */ I("span", {
1713
1728
  className: "hidden sm:inline",
1714
- children: k("list.group")
1729
+ children: A("list.group")
1715
1730
  }),
1716
- Y && Y.fields?.length > 0 && /* @__PURE__ */ I("span", {
1731
+ J && J.fields?.length > 0 && /* @__PURE__ */ I("span", {
1717
1732
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1718
- children: Y.fields.length
1733
+ children: J.fields.length
1719
1734
  })
1720
1735
  ]
1721
1736
  })
@@ -1728,49 +1743,49 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1728
1743
  className: "flex items-center justify-between border-b pb-2",
1729
1744
  children: [/* @__PURE__ */ I("h4", {
1730
1745
  className: "font-medium text-sm",
1731
- children: k("list.groupBy")
1732
- }), Y && /* @__PURE__ */ I(u, {
1746
+ children: A("list.groupBy")
1747
+ }), J && /* @__PURE__ */ I(d, {
1733
1748
  variant: "ghost",
1734
1749
  size: "sm",
1735
1750
  className: "h-6 px-2 text-xs",
1736
- onClick: () => mt(void 0),
1751
+ onClick: () => _t(void 0),
1737
1752
  "data-testid": "clear-grouping",
1738
- children: k("list.clear")
1753
+ children: A("list.clear")
1739
1754
  })]
1740
1755
  }), /* @__PURE__ */ I("div", {
1741
1756
  "data-testid": "group-field-list",
1742
- children: /* @__PURE__ */ I(ee, {
1743
- value: Y,
1744
- fieldOptions: un.map((e) => ({
1757
+ children: /* @__PURE__ */ I(y, {
1758
+ value: J,
1759
+ fieldOptions: pn.map((e) => ({
1745
1760
  value: e.name,
1746
1761
  label: e.label || e.name
1747
1762
  })),
1748
1763
  maxLevels: 3,
1749
1764
  labels: {
1750
- addGroup: k("list.addGroup", { defaultValue: "Add group field" }),
1751
- collapseTitle: k("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
1752
- removeTitle: k("list.removeGroup", { defaultValue: "Remove" })
1765
+ addGroup: A("list.addGroup", { defaultValue: "Add group field" }),
1766
+ collapseTitle: A("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
1767
+ removeTitle: A("list.removeGroup", { defaultValue: "Remove" })
1753
1768
  },
1754
- onChange: (e) => mt(e)
1769
+ onChange: (e) => _t(e)
1755
1770
  })
1756
1771
  })]
1757
1772
  })
1758
1773
  })]
1759
1774
  }),
1760
1775
  P.showSort && /* @__PURE__ */ L(S, {
1761
- open: Ie,
1762
- onOpenChange: ze,
1776
+ open: Be,
1777
+ onOpenChange: Ve,
1763
1778
  children: [/* @__PURE__ */ I(w, {
1764
1779
  asChild: !0,
1765
- children: /* @__PURE__ */ L(u, {
1780
+ children: /* @__PURE__ */ L(d, {
1766
1781
  variant: "ghost",
1767
1782
  size: "sm",
1768
1783
  className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", z.length > 0 && "text-foreground font-medium"),
1769
1784
  children: [
1770
- /* @__PURE__ */ I(re, { className: "h-3.5 w-3.5 mr-1.5" }),
1785
+ /* @__PURE__ */ I(O, { className: "h-3.5 w-3.5 mr-1.5" }),
1771
1786
  /* @__PURE__ */ I("span", {
1772
1787
  className: "hidden sm:inline",
1773
- children: k("list.sort")
1788
+ children: A("list.sort")
1774
1789
  }),
1775
1790
  z.length > 0 && /* @__PURE__ */ I("span", {
1776
1791
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
@@ -1787,13 +1802,13 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1787
1802
  className: "flex items-center justify-between border-b pb-2",
1788
1803
  children: /* @__PURE__ */ I("h4", {
1789
1804
  className: "font-medium text-sm",
1790
- children: k("list.sortRecords")
1805
+ children: A("list.sortRecords")
1791
1806
  })
1792
- }), /* @__PURE__ */ I(T, {
1793
- fields: cn,
1807
+ }), /* @__PURE__ */ I(ne, {
1808
+ fields: dn,
1794
1809
  value: z,
1795
1810
  onChange: (e) => {
1796
- B(e), o && o(e);
1811
+ B(e), s && s(e);
1797
1812
  }
1798
1813
  })]
1799
1814
  })
@@ -1801,17 +1816,17 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1801
1816
  }),
1802
1817
  !P.compactToolbar && (P.showFilters || P.showSort || P.showGroup) && (P.showColor || P.showDensity) && /* @__PURE__ */ I("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
1803
1818
  P.showColor && !P.compactToolbar && /* @__PURE__ */ L(S, {
1804
- open: yt,
1805
- onOpenChange: bt,
1819
+ open: St,
1820
+ onOpenChange: Ct,
1806
1821
  children: [/* @__PURE__ */ I(w, {
1807
1822
  asChild: !0,
1808
- children: /* @__PURE__ */ L(u, {
1823
+ children: /* @__PURE__ */ L(d, {
1809
1824
  variant: "ghost",
1810
1825
  size: "sm",
1811
- className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", X && "text-foreground font-medium"),
1812
- children: [/* @__PURE__ */ I(pe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1826
+ className: E("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Y && "text-foreground font-medium"),
1827
+ children: [/* @__PURE__ */ I(he, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1813
1828
  className: "hidden sm:inline",
1814
- children: k("list.color")
1829
+ children: A("list.color")
1815
1830
  })]
1816
1831
  })
1817
1832
  }), /* @__PURE__ */ I(C, {
@@ -1823,36 +1838,36 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1823
1838
  className: "flex items-center justify-between border-b pb-2",
1824
1839
  children: [/* @__PURE__ */ I("h4", {
1825
1840
  className: "font-medium text-sm",
1826
- children: k("list.rowColor")
1827
- }), X && /* @__PURE__ */ I(u, {
1841
+ children: A("list.rowColor")
1842
+ }), Y && /* @__PURE__ */ I(d, {
1828
1843
  variant: "ghost",
1829
1844
  size: "sm",
1830
1845
  className: "h-6 px-2 text-xs",
1831
- onClick: () => vt(void 0),
1846
+ onClick: () => xt(void 0),
1832
1847
  "data-testid": "clear-row-color",
1833
- children: k("list.clear")
1848
+ children: A("list.clear")
1834
1849
  })]
1835
1850
  }), /* @__PURE__ */ L("div", {
1836
1851
  className: "space-y-2",
1837
1852
  "data-testid": "color-field-list",
1838
1853
  children: [/* @__PURE__ */ I("label", {
1839
1854
  className: "text-xs text-muted-foreground",
1840
- children: k("list.colorByField")
1855
+ children: A("list.colorByField")
1841
1856
  }), /* @__PURE__ */ L("select", {
1842
1857
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
1843
- value: X?.field || "",
1858
+ value: Y?.field || "",
1844
1859
  onChange: (e) => {
1845
1860
  let t = e.target.value;
1846
- vt(t ? {
1861
+ xt(t ? {
1847
1862
  field: t,
1848
- colors: X?.colors || {}
1863
+ colors: Y?.colors || {}
1849
1864
  } : void 0);
1850
1865
  },
1851
1866
  "data-testid": "color-field-select",
1852
1867
  children: [/* @__PURE__ */ I("option", {
1853
1868
  value: "",
1854
- children: k("list.none")
1855
- }), un.map((e) => /* @__PURE__ */ I("option", {
1869
+ children: A("list.none")
1870
+ }), pn.map((e) => /* @__PURE__ */ I("option", {
1856
1871
  value: e.name,
1857
1872
  children: e.label
1858
1873
  }, e.name))]
@@ -1862,11 +1877,11 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1862
1877
  })]
1863
1878
  }),
1864
1879
  P.showDensity && !P.compactToolbar && F !== "gallery" && (() => {
1865
- let e = Q.mode === "compact" ? be : Q.mode === "comfortable" ? ye : ve, t = Q.mode === "compact" ? k("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Q.mode === "comfortable" ? k("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : k("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${k("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = k("grid.toolbar.densityCycleHint", {
1880
+ let e = Q.mode === "compact" ? Se : Q.mode === "comfortable" ? xe : be, t = Q.mode === "compact" ? A("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Q.mode === "comfortable" ? A("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : A("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${A("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = A("grid.toolbar.densityCycleHint", {
1866
1881
  defaultValue: "{{label}} (click to cycle)",
1867
1882
  label: n
1868
1883
  });
1869
- return /* @__PURE__ */ I(u, {
1884
+ return /* @__PURE__ */ I(d, {
1870
1885
  variant: "ghost",
1871
1886
  size: "sm",
1872
1887
  "aria-label": n,
@@ -1877,51 +1892,51 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1877
1892
  });
1878
1893
  })(),
1879
1894
  P.showDensity && !P.compactToolbar && F === "gallery" && (() => {
1880
- let e = Wt === "small" ? be : Wt === "medium" ? ye : ve, t = Wt === "small" ? k("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Wt === "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", {
1895
+ let e = Kt === "small" ? Se : Kt === "medium" ? xe : be, t = Kt === "small" ? A("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Kt === "medium" ? A("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : A("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${A("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = A("grid.toolbar.densityCycleHint", {
1881
1896
  defaultValue: "{{label}} (click to cycle)",
1882
1897
  label: n
1883
1898
  });
1884
- return /* @__PURE__ */ I(u, {
1899
+ return /* @__PURE__ */ I(d, {
1885
1900
  variant: "ghost",
1886
1901
  size: "sm",
1887
1902
  "aria-label": n,
1888
- className: E("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Wt !== "small" && "text-foreground font-medium"),
1889
- onClick: Kt,
1903
+ className: E("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Kt !== "small" && "text-foreground font-medium"),
1904
+ onClick: Jt,
1890
1905
  title: r,
1891
1906
  children: /* @__PURE__ */ I(e, { className: "h-3.5 w-3.5" })
1892
1907
  });
1893
1908
  })(),
1894
- P.compactToolbar && (P.showGroup || P.showColor || P.showDensity || P.showHideFields) && /* @__PURE__ */ I(Ue, {
1895
- t: k,
1896
- allFields: un,
1909
+ P.compactToolbar && (P.showGroup || P.showColor || P.showDensity || P.showHideFields) && /* @__PURE__ */ I(Ge, {
1910
+ t: A,
1911
+ allFields: pn,
1897
1912
  showGroup: P.showGroup,
1898
- groupingConfig: Y,
1899
- setGroupingConfig: mt,
1913
+ groupingConfig: J,
1914
+ setGroupingConfig: _t,
1900
1915
  showColor: P.showColor,
1901
- rowColorConfig: X,
1902
- setRowColorConfig: vt,
1916
+ rowColorConfig: Y,
1917
+ setRowColorConfig: xt,
1903
1918
  showDensity: P.showDensity,
1904
1919
  density: Q,
1905
1920
  showHideFields: P.showHideFields,
1906
1921
  hiddenFields: Z,
1907
- updateHiddenFields: kt,
1922
+ updateHiddenFields: jt,
1908
1923
  showInlineEdit: F === "grid",
1909
- inlineEdit: Mt,
1910
- setInlineEdit: Pt
1924
+ inlineEdit: Pt,
1925
+ setInlineEdit: It
1911
1926
  }),
1912
- (P.showColor || P.showDensity || P.compactToolbar) && Ht && Vt && /* @__PURE__ */ I("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1913
- Ht && Vt && /* @__PURE__ */ L(S, {
1914
- open: Ft,
1915
- onOpenChange: It,
1927
+ (P.showColor || P.showDensity || P.compactToolbar) && Wt && Ut && /* @__PURE__ */ I("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
1928
+ Wt && Ut && /* @__PURE__ */ L(S, {
1929
+ open: Lt,
1930
+ onOpenChange: Rt,
1916
1931
  children: [/* @__PURE__ */ I(w, {
1917
1932
  asChild: !0,
1918
- children: /* @__PURE__ */ L(u, {
1933
+ children: /* @__PURE__ */ L(d, {
1919
1934
  variant: "ghost",
1920
1935
  size: "sm",
1921
1936
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1922
1937
  children: [/* @__PURE__ */ I(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1923
1938
  className: "hidden sm:inline",
1924
- children: k("list.export")
1939
+ children: A("list.export")
1925
1940
  })]
1926
1941
  })
1927
1942
  }), /* @__PURE__ */ I(C, {
@@ -1929,60 +1944,64 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1929
1944
  className: "w-48 p-2",
1930
1945
  children: /* @__PURE__ */ L("div", {
1931
1946
  className: "space-y-1",
1932
- children: [(Ht.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ L(u, {
1947
+ children: [(Wt.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ L(d, {
1933
1948
  variant: "ghost",
1934
1949
  size: "sm",
1935
1950
  className: "w-full justify-start h-8 text-xs",
1936
- disabled: Lt,
1937
- onClick: () => ln(e),
1938
- children: [Lt ? /* @__PURE__ */ I(fe, { className: "h-3.5 w-3.5 mr-2 animate-spin" }) : /* @__PURE__ */ I(se, { className: "h-3.5 w-3.5 mr-2" }), k("list.exportAs", { format: e.toUpperCase() })]
1939
- }, e)), zt && /* @__PURE__ */ I("div", {
1951
+ disabled: zt,
1952
+ onClick: () => fn(e),
1953
+ children: [zt ? /* @__PURE__ */ I(me, { className: "h-3.5 w-3.5 mr-2 animate-spin" }) : /* @__PURE__ */ I(se, { className: "h-3.5 w-3.5 mr-2" }), A("list.exportAs", { format: e.toUpperCase() })]
1954
+ }, e)), Vt && /* @__PURE__ */ I("div", {
1940
1955
  className: "px-2 py-1 text-xs",
1941
1956
  style: { color: "var(--destructive, #ef4444)" },
1942
1957
  role: "alert",
1943
- children: zt
1958
+ children: Vt
1944
1959
  })]
1945
1960
  })
1946
1961
  })]
1947
1962
  }),
1948
- (M.sharing?.enabled || M.sharing?.type) && /* @__PURE__ */ L(u, {
1963
+ (M.sharing?.enabled || M.sharing?.type) && /* @__PURE__ */ L(d, {
1949
1964
  variant: "ghost",
1950
1965
  size: "sm",
1951
1966
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1952
1967
  title: `Sharing: ${M.sharing?.visibility || M.sharing?.type || "private"}`,
1953
1968
  "data-testid": "share-button",
1954
- children: [/* @__PURE__ */ I(Ce, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1969
+ children: [/* @__PURE__ */ I(we, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1955
1970
  className: "hidden sm:inline",
1956
- children: k("list.share")
1971
+ children: A("list.share")
1957
1972
  })]
1958
1973
  }),
1959
- M.allowPrinting && /* @__PURE__ */ L(u, {
1974
+ M.allowPrinting && /* @__PURE__ */ L(d, {
1960
1975
  variant: "ghost",
1961
1976
  size: "sm",
1962
1977
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1963
1978
  onClick: () => window.print(),
1964
1979
  "data-testid": "print-button",
1965
- children: [/* @__PURE__ */ I(ge, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1980
+ children: [/* @__PURE__ */ I(ve, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
1966
1981
  className: "hidden sm:inline",
1967
- children: k("list.print")
1982
+ children: A("list.print")
1968
1983
  })]
1969
1984
  }),
1970
1985
  (() => {
1971
- let e = M.allowPrinting || M.sharing?.enabled || M.sharing?.type || Ht && Vt;
1986
+ let e = M.allowPrinting || M.sharing?.enabled || M.sharing?.type || Wt && Ut;
1972
1987
  return P.showSearch && e ? /* @__PURE__ */ I("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }) : null;
1973
1988
  })(),
1974
1989
  P.showSearch && /* @__PURE__ */ L(S, {
1975
- open: Me,
1976
- onOpenChange: Ne,
1990
+ open: Pe,
1991
+ onOpenChange: Le,
1977
1992
  children: [/* @__PURE__ */ I(w, {
1978
1993
  asChild: !0,
1979
- children: /* @__PURE__ */ I(u, {
1994
+ children: /* @__PURE__ */ L(d, {
1980
1995
  variant: "ghost",
1981
1996
  size: "sm",
1982
- className: E("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", R && "text-foreground font-medium"),
1997
+ className: E("hidden sm:inline-flex h-7 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", R ? "px-2 text-foreground font-medium" : "w-7 p-0"),
1983
1998
  "data-testid": "search-icon-button",
1984
- title: k("list.search"),
1985
- children: /* @__PURE__ */ I(xe, { className: "h-3.5 w-3.5" })
1999
+ title: R ? `${A("list.search")}: ${R}` : A("list.search"),
2000
+ children: [/* @__PURE__ */ I(Ce, { className: "h-3.5 w-3.5" }), R && /* @__PURE__ */ I("span", {
2001
+ className: "ml-1.5 max-w-[8rem] truncate text-[11px]",
2002
+ "data-testid": "search-active-keyword",
2003
+ children: R
2004
+ })]
1986
2005
  })
1987
2006
  }), /* @__PURE__ */ I(C, {
1988
2007
  align: "end",
@@ -1991,34 +2010,34 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
1991
2010
  children: /* @__PURE__ */ L("div", {
1992
2011
  className: "relative",
1993
2012
  children: [
1994
- /* @__PURE__ */ I(xe, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1995
- /* @__PURE__ */ I(y, {
1996
- placeholder: k("list.search") + "...",
2013
+ /* @__PURE__ */ I(Ce, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
2014
+ /* @__PURE__ */ I(b, {
2015
+ placeholder: A("list.search") + "...",
1997
2016
  value: R,
1998
- onChange: (e) => rn(e.target.value),
2017
+ onChange: (e) => sn(e.target.value),
1999
2018
  className: "pl-7 h-8 text-xs",
2000
2019
  autoFocus: !0
2001
2020
  }),
2002
- R && /* @__PURE__ */ I(u, {
2021
+ R && /* @__PURE__ */ I(d, {
2003
2022
  variant: "ghost",
2004
2023
  size: "sm",
2005
2024
  className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20",
2006
- onClick: () => rn(""),
2007
- children: /* @__PURE__ */ I(Ee, { className: "h-3 w-3" })
2025
+ onClick: () => sn(""),
2026
+ children: /* @__PURE__ */ I(De, { className: "h-3 w-3" })
2008
2027
  })
2009
2028
  ]
2010
2029
  })
2011
2030
  })]
2012
2031
  }),
2013
- P.showAddRecord && P.addRecordPosition === "top" && /* @__PURE__ */ L(u, {
2032
+ P.showAddRecord && P.addRecordPosition === "top" && /* @__PURE__ */ L(d, {
2014
2033
  variant: "ghost",
2015
2034
  size: "sm",
2016
2035
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
2017
2036
  "data-testid": "add-record-button",
2018
2037
  onClick: () => D.onAddRecord?.(),
2019
- children: [/* @__PURE__ */ I(he, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
2038
+ children: [/* @__PURE__ */ I(_e, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
2020
2039
  className: "hidden sm:inline",
2021
- children: k("list.addRecord")
2040
+ children: A("list.addRecord")
2022
2041
  })]
2023
2042
  })
2024
2043
  ]
@@ -2026,21 +2045,21 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2026
2045
  }),
2027
2046
  /* @__PURE__ */ L("div", {
2028
2047
  className: "flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200",
2029
- children: [/* @__PURE__ */ I(te, { active: G && W.length > 0 }), qe && W.length === 0 ? /* @__PURE__ */ I(p, {
2048
+ children: [/* @__PURE__ */ I(T, { active: W && U.length > 0 }), Xe && U.length === 0 ? /* @__PURE__ */ I(m, {
2030
2049
  "data-testid": "list-error-state",
2031
2050
  className: "h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md",
2032
- icon: /* @__PURE__ */ I(ne, { className: "h-12 w-12 text-destructive/60" }),
2051
+ icon: /* @__PURE__ */ I(re, { className: "h-12 w-12 text-destructive/60" }),
2033
2052
  iconWrapperClassName: "mb-3",
2034
- title: k("list.loadErrorTitle"),
2035
- description: k("list.loadErrorMessage"),
2036
- action: /* @__PURE__ */ L(u, {
2053
+ title: A("list.loadErrorTitle"),
2054
+ description: A("list.loadErrorMessage"),
2055
+ action: /* @__PURE__ */ L(d, {
2037
2056
  variant: "outline",
2038
2057
  size: "sm",
2039
2058
  "data-testid": "list-error-retry",
2040
- onClick: () => it((e) => e + 1),
2041
- children: [/* @__PURE__ */ I(_e, { className: "h-4 w-4 mr-1.5" }), k("list.retry")]
2059
+ onClick: () => st((e) => e + 1),
2060
+ children: [/* @__PURE__ */ I(ye, { className: "h-4 w-4 mr-1.5" }), A("list.retry")]
2042
2061
  })
2043
- }) : G && W.length === 0 ? /* @__PURE__ */ L("div", {
2062
+ }) : W && U.length === 0 ? /* @__PURE__ */ L("div", {
2044
2063
  className: "flex flex-col h-full min-h-[200px] p-4 gap-2",
2045
2064
  "data-testid": "list-loading",
2046
2065
  role: "status",
@@ -2048,7 +2067,7 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2048
2067
  "aria-busy": "true",
2049
2068
  children: [/* @__PURE__ */ I("span", {
2050
2069
  className: "sr-only",
2051
- children: k("list.loading")
2070
+ children: A("list.loading")
2052
2071
  }), [
2053
2072
  0,
2054
2073
  1,
@@ -2060,56 +2079,56 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2060
2079
  className: "h-9 rounded bg-muted/60 animate-pulse",
2061
2080
  style: { opacity: Math.max(.25, 1 - e * .12) }
2062
2081
  }, e))]
2063
- }) : !G && W.length === 0 && F === "grid" ? (() => {
2064
- let e = M.emptyState?.icon, t = e ? De[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? ue : ue, n = !!(R && R.trim()) || Array.isArray(wt) && wt.length > 0 || Array.isArray(H?.conditions) && H.conditions.length > 0, r = (typeof M.emptyState?.title == "string" ? M.emptyState.title : void 0) ?? k(n ? "list.noMatches" : "list.firstRunTitle"), i = (typeof M.emptyState?.message == "string" ? M.emptyState.message : void 0) ?? k(n ? "list.noMatchesMessage" : "list.firstRunMessage");
2065
- return /* @__PURE__ */ I(p, {
2082
+ }) : !W && U.length === 0 && F === "grid" ? (() => {
2083
+ let e = M.emptyState?.icon, t = e ? Oe[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? fe : fe, n = !!(R && R.trim()) || Array.isArray(X) && X.length > 0 || Array.isArray(V?.conditions) && V.conditions.length > 0, r = (typeof M.emptyState?.title == "string" ? M.emptyState.title : void 0) ?? A(n ? "list.noMatches" : "list.firstRunTitle"), i = (typeof M.emptyState?.message == "string" ? M.emptyState.message : void 0) ?? A(n ? "list.noMatchesMessage" : "list.firstRunMessage");
2084
+ return /* @__PURE__ */ I(m, {
2066
2085
  "data-testid": "empty-state",
2067
2086
  className: "h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md",
2068
2087
  icon: /* @__PURE__ */ I(t, { className: "h-12 w-12 text-muted-foreground/50" }),
2069
2088
  iconWrapperClassName: "mb-3",
2070
2089
  title: r,
2071
2090
  description: i,
2072
- action: P.showAddRecord ? /* @__PURE__ */ L(u, {
2091
+ action: P.showAddRecord ? /* @__PURE__ */ L(d, {
2073
2092
  variant: "default",
2074
2093
  size: "sm",
2075
2094
  "data-testid": "empty-state-add-record",
2076
2095
  onClick: () => D.onAddRecord?.(),
2077
- children: [/* @__PURE__ */ I(he, { className: "h-4 w-4 mr-1.5" }), k("list.addRecord")]
2096
+ children: [/* @__PURE__ */ I(_e, { className: "h-4 w-4 mr-1.5" }), A("list.addRecord")]
2078
2097
  }) : void 0
2079
2098
  });
2080
- })() : /* @__PURE__ */ I(je, {
2081
- schema: on,
2099
+ })() : /* @__PURE__ */ I(Me, {
2100
+ schema: ln,
2082
2101
  ...D,
2083
- data: W,
2084
- loading: G,
2085
- onRowSelect: St,
2086
- ...F === "grid" && !Y?.fields?.length && dt != null ? {
2102
+ ...tn ? {} : { data: U },
2103
+ loading: W,
2104
+ onRowSelect: Tt,
2105
+ ...F === "grid" && !J?.fields?.length && mt != null ? {
2087
2106
  manualPagination: !0,
2088
- rowCount: dt,
2089
- page: lt,
2090
- pageSize: J,
2091
- onPageChange: (e) => ut(e),
2107
+ rowCount: mt,
2108
+ page: ft,
2109
+ pageSize: q,
2110
+ onPageChange: (e) => pt(e),
2092
2111
  onPageSizeChange: (e) => {
2093
- ct(e), ut(1);
2112
+ dt(e), pt(1);
2094
2113
  }
2095
2114
  } : {}
2096
2115
  })]
2097
2116
  }, F),
2098
2117
  P.showAddRecord && P.addRecordPosition === "bottom" && /* @__PURE__ */ I("div", {
2099
2118
  className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
2100
- children: /* @__PURE__ */ L(u, {
2119
+ children: /* @__PURE__ */ L(d, {
2101
2120
  variant: "ghost",
2102
2121
  size: "sm",
2103
2122
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
2104
2123
  "data-testid": "add-record-button",
2105
2124
  onClick: () => D.onAddRecord?.(),
2106
- children: [/* @__PURE__ */ I(he, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
2125
+ children: [/* @__PURE__ */ I(_e, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ I("span", {
2107
2126
  className: "hidden sm:inline",
2108
- children: k("list.addRecord")
2127
+ children: A("list.addRecord")
2109
2128
  })]
2110
2129
  })
2111
2130
  }),
2112
- M.bulkActions && M.bulkActions.length > 0 && xt.length > 0 && F !== "grid" && /* @__PURE__ */ L("div", {
2131
+ M.bulkActions && M.bulkActions.length > 0 && wt.length > 0 && F !== "grid" && /* @__PURE__ */ L("div", {
2113
2132
  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",
2114
2133
  role: "region",
2115
2134
  "aria-label": "Bulk actions",
@@ -2119,57 +2138,57 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2119
2138
  /* @__PURE__ */ L("span", {
2120
2139
  className: "font-medium",
2121
2140
  children: [
2122
- xt.length,
2141
+ wt.length,
2123
2142
  " ",
2124
- xt.length === 1 ? "item" : "items",
2143
+ wt.length === 1 ? "item" : "items",
2125
2144
  " selected"
2126
2145
  ]
2127
2146
  }),
2128
2147
  /* @__PURE__ */ I("div", {
2129
2148
  className: "flex items-center gap-1.5 ml-3",
2130
2149
  children: M.bulkActions.map((e) => {
2131
- let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? Te : null;
2132
- return /* @__PURE__ */ L(u, {
2150
+ let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? Ee : null;
2151
+ return /* @__PURE__ */ L(d, {
2133
2152
  variant: n ? "destructive" : "outline",
2134
2153
  size: "sm",
2135
2154
  className: "h-7 px-2.5 text-xs gap-1.5",
2136
- onClick: () => D.onBulkAction?.(e, xt),
2155
+ onClick: () => D.onBulkAction?.(e, wt),
2137
2156
  "data-testid": `bulk-action-${e}`,
2138
- children: [r && /* @__PURE__ */ I(r, { className: "h-3 w-3" }), de(e)]
2157
+ children: [r && /* @__PURE__ */ I(r, { className: "h-3 w-3" }), pe(e)]
2139
2158
  }, e);
2140
2159
  })
2141
2160
  }),
2142
- /* @__PURE__ */ L(u, {
2161
+ /* @__PURE__ */ L(d, {
2143
2162
  variant: "ghost",
2144
2163
  size: "sm",
2145
2164
  className: "h-7 px-2 text-xs ml-auto gap-1",
2146
- onClick: () => St([]),
2147
- children: [/* @__PURE__ */ I(Ee, { className: "h-3 w-3" }), "Clear"]
2165
+ onClick: () => Tt([]),
2166
+ children: [/* @__PURE__ */ I(De, { className: "h-3 w-3" }), "Clear"]
2148
2167
  })
2149
2168
  ]
2150
2169
  }),
2151
- !G && W.length > 0 && M.showRecordCount !== !1 && /* @__PURE__ */ L("div", {
2170
+ !W && U.length > 0 && M.showRecordCount !== !1 && /* @__PURE__ */ L("div", {
2152
2171
  className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
2153
2172
  "data-testid": "record-count-bar",
2154
2173
  children: [
2155
2174
  /* @__PURE__ */ I("span", {
2156
2175
  className: "font-medium text-foreground/80",
2157
- children: W.length === 1 ? k("list.recordCountOne", { count: W.length }) : k("list.recordCount", { count: W.length })
2176
+ children: U.length === 1 ? A("list.recordCountOne", { count: U.length }) : A("list.recordCount", { count: U.length })
2158
2177
  }),
2159
- at && /* @__PURE__ */ I("span", {
2178
+ ct && /* @__PURE__ */ I("span", {
2160
2179
  className: "text-amber-600",
2161
2180
  "data-testid": "data-limit-warning",
2162
- children: k("list.dataLimitReached", { limit: J })
2181
+ children: A("list.dataLimitReached", { limit: q })
2163
2182
  }),
2164
2183
  F !== "grid" && M.pagination?.pageSizeOptions && M.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ L("div", {
2165
2184
  className: "ml-auto flex items-center gap-2",
2166
- children: [/* @__PURE__ */ I("span", { children: k("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ I("select", {
2185
+ children: [/* @__PURE__ */ I("span", { children: A("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ I("select", {
2167
2186
  "data-testid": "page-size-selector",
2168
2187
  className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
2169
- value: String(J),
2188
+ value: String(q),
2170
2189
  onChange: (e) => {
2171
2190
  let t = Number(e.target.value);
2172
- ct(t), D.onPageSizeChange && D.onPageSizeChange(t);
2191
+ dt(t), D.onPageSizeChange && D.onPageSizeChange(t);
2173
2192
  },
2174
2193
  children: M.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ I("option", {
2175
2194
  value: String(e),
@@ -2179,8 +2198,8 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2179
2198
  })
2180
2199
  ]
2181
2200
  }),
2182
- an.isOverlay && /* @__PURE__ */ I(x, {
2183
- ...an,
2201
+ cn.isOverlay && /* @__PURE__ */ I(te, {
2202
+ ...cn,
2184
2203
  title: M.label ? `${M.label} Detail` : M.objectName ? `${M.objectName.charAt(0).toUpperCase() + M.objectName.slice(1)} Detail` : "Record Detail",
2185
2204
  children: (e) => /* @__PURE__ */ I("div", {
2186
2205
  className: "space-y-3",
@@ -2199,24 +2218,24 @@ var rt = i.forwardRef(({ schema: e, className: n, onViewChange: r, onFilterChang
2199
2218
  ]
2200
2219
  });
2201
2220
  });
2202
- rt.displayName = "ListView";
2221
+ K.displayName = "ListView";
2203
2222
  //#endregion
2204
2223
  //#region src/ObjectGallery.tsx
2205
- var it = {
2224
+ var ot = {
2206
2225
  small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
2207
2226
  medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
2208
2227
  large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
2209
- }, at = {
2228
+ }, st = {
2210
2229
  small: "aspect-square",
2211
2230
  medium: "aspect-[4/3]",
2212
2231
  large: "aspect-[16/10]"
2213
- }, ot = /* @__PURE__ */ new Set([
2232
+ }, ct = /* @__PURE__ */ new Set([
2214
2233
  "number",
2215
2234
  "currency",
2216
2235
  "percent",
2217
2236
  "integer",
2218
2237
  "decimal"
2219
- ]), st = [
2238
+ ]), lt = [
2220
2239
  {
2221
2240
  bg: "from-indigo-500/15 via-indigo-500/5 to-purple-500/10",
2222
2241
  ring: "ring-indigo-500/15",
@@ -2248,13 +2267,13 @@ var it = {
2248
2267
  text: "text-violet-600/70 dark:text-violet-300/70"
2249
2268
  }
2250
2269
  ];
2251
- function ct(e) {
2270
+ function ut(e) {
2252
2271
  let t = 5381;
2253
2272
  for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n);
2254
- return st[Math.abs(t) % st.length];
2273
+ return lt[Math.abs(t) % lt.length];
2255
2274
  }
2256
- var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, hidden: a }) => {
2257
- let [o, s] = l(!1), c = !!e && !o;
2275
+ var dt = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, hidden: a }) => {
2276
+ let [o, s] = u(!1), c = !!e && !o;
2258
2277
  return /* @__PURE__ */ I("div", {
2259
2278
  className: E("w-full overflow-hidden relative", r),
2260
2279
  hidden: a,
@@ -2281,8 +2300,8 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2281
2300
  })
2282
2301
  })
2283
2302
  });
2284
- }, lt = ({ imageUrl: e, title: t, placeholder: n }) => {
2285
- let [r, i] = l(!1), a = !!e && !r;
2303
+ }, q = ({ imageUrl: e, title: t, placeholder: n }) => {
2304
+ let [r, i] = u(!1), a = !!e && !r;
2286
2305
  return /* @__PURE__ */ I("div", {
2287
2306
  className: E("flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br ring-1 ring-inset", n.bg, n.ring),
2288
2307
  children: a ? /* @__PURE__ */ I("img", {
@@ -2296,12 +2315,12 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2296
2315
  children: t[0]?.toUpperCase()
2297
2316
  })
2298
2317
  });
2299
- }, ut = (e) => {
2300
- let { schema: n } = e, i = o(Me), u = e.dataSource || i?.dataSource, p = Ne(n.bind), [m, h] = l([]), [g, _] = l(!1), [v, ee] = l(null), y = Fe({
2318
+ }, ft = (e) => {
2319
+ let { schema: n } = e, r = s(Ne), a = e.dataSource || r?.dataSource, d = Pe(n.bind), [m, h] = u([]), [g, _] = u(!1), [v, ee] = u(null), y = Ie({
2301
2320
  navigation: n.navigation,
2302
2321
  objectName: n.objectName,
2303
2322
  onRowClick: e.onRowClick ?? e.onCardClick
2304
- }), b = n.gallery, S = b?.coverField ?? n.imageField ?? "image", C = b?.coverFit ?? "cover", w = b?.cardSize ?? "medium", te = b?.titleField ?? n.titleField, T = b?.visibleFields, { fieldLabel: D, fieldOptionLabel: ne } = Ie(), re = a((e) => {
2323
+ }), b = n.gallery, x = b?.coverField ?? n.imageField ?? "image", S = b?.coverFit ?? "cover", C = b?.cardSize ?? "medium", w = b?.titleField ?? n.titleField, T = b?.visibleFields, { fieldLabel: ne, fieldOptionLabel: D } = Le(), re = o((e) => {
2305
2324
  let t = v?.fields?.[e], r = { name: e };
2306
2325
  if (t) {
2307
2326
  t.type && (r.type = t.type), t.label && (r.label = t.label), t.options && (r.options = t.options), t.currency && (r.currency = t.currency), t.precision !== void 0 && (r.precision = t.precision), t.format && (r.format = t.format);
@@ -2310,27 +2329,27 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2310
2329
  }
2311
2330
  if (n.objectName) {
2312
2331
  let t = String(r.label ?? e);
2313
- r.label = D(n.objectName, e, t);
2332
+ r.label = ne(n.objectName, e, t);
2314
2333
  }
2315
2334
  return n.objectName && Array.isArray(r.options) && (r.options = r.options.map((t) => {
2316
2335
  let r = String(t?.value ?? t), i = String(t?.label ?? r);
2317
2336
  return {
2318
2337
  ...t,
2319
2338
  value: r,
2320
- label: ne(n.objectName, e, r, i)
2339
+ label: D(n.objectName, e, r, i)
2321
2340
  };
2322
2341
  })), r;
2323
2342
  }, [
2324
2343
  v,
2325
2344
  n.objectName,
2326
- D,
2327
- ne
2345
+ ne,
2346
+ D
2328
2347
  ]);
2329
- s(() => {
2348
+ c(() => {
2330
2349
  let e = !0;
2331
2350
  return (async () => {
2332
- if (!(!u || typeof u.getObjectSchema != "function" || !n.objectName)) try {
2333
- let t = await u.getObjectSchema(n.objectName);
2351
+ if (!(!a || typeof a.getObjectSchema != "function" || !n.objectName)) try {
2352
+ let t = await a.getObjectSchema(n.objectName);
2334
2353
  e && ee(t);
2335
2354
  } catch (e) {
2336
2355
  console.warn("Failed to fetch object def for ObjectGallery", e);
@@ -2338,26 +2357,26 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2338
2357
  })(), () => {
2339
2358
  e = !1;
2340
2359
  };
2341
- }, [n.objectName, u]), s(() => {
2360
+ }, [n.objectName, a]), c(() => {
2342
2361
  let r = !0;
2343
2362
  if (e.data && Array.isArray(e.data)) {
2344
2363
  h(e.data);
2345
2364
  return;
2346
2365
  }
2347
- return n.objectName && !p && !n.data && !e.data && (async () => {
2348
- if (!(!u || typeof u.find != "function" || !n.objectName)) {
2366
+ return n.objectName && !d && !n.data && !e.data && (async () => {
2367
+ if (!(!a || typeof a.find != "function" || !n.objectName)) {
2349
2368
  r && _(!0);
2350
2369
  try {
2351
- let e = t(v?.fields), i = await u.find(n.objectName, {
2370
+ let e = t(v?.fields), i = await a.find(n.objectName, {
2352
2371
  $filter: n.filter,
2353
2372
  ...e.length > 0 ? { $expand: e } : {}
2354
- }), a = [];
2355
- if (Array.isArray(i)) a = i;
2373
+ }), o = [];
2374
+ if (Array.isArray(i)) o = i;
2356
2375
  else if (i && typeof i == "object") {
2357
2376
  let e = i;
2358
- Array.isArray(e.records) ? a = e.records : Array.isArray(e.data) && (a = e.data);
2377
+ Array.isArray(e.records) ? o = e.records : Array.isArray(e.data) && (o = e.data);
2359
2378
  }
2360
- r && h(a);
2379
+ r && h(o);
2361
2380
  } catch (e) {
2362
2381
  console.error("[ObjectGallery] Fetch error:", e);
2363
2382
  } finally {
@@ -2369,20 +2388,20 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2369
2388
  };
2370
2389
  }, [
2371
2390
  n.objectName,
2372
- u,
2373
- p,
2391
+ a,
2392
+ d,
2374
2393
  n.data,
2375
2394
  n.filter,
2376
2395
  e.data,
2377
2396
  v
2378
2397
  ]);
2379
- let O = e.data || p || n.data || m || [], ie = c(() => O.some((e) => typeof e[S] == "string" && !!e[S]), [O, S]), k = n.grouping?.fields, ae = !!(k && k.length > 0), [se, ce] = l({}), j = c(() => k ? k.some((e) => e.collapsed) : !1, [k]), M = a((e) => {
2380
- ce((t) => ({
2398
+ let O = e.data || d || n.data || m || [], ie = l(() => O.some((e) => typeof e[x] == "string" && !!e[x]), [O, x]), k = n.grouping?.fields, A = !!(k && k.length > 0), [ae, se] = u({}), ce = l(() => k ? k.some((e) => e.collapsed) : !1, [k]), le = o((e) => {
2399
+ se((t) => ({
2381
2400
  ...t,
2382
- [e]: t[e] === void 0 ? !j : !t[e]
2401
+ [e]: t[e] === void 0 ? !ce : !t[e]
2383
2402
  }));
2384
- }, [j]), le = c(() => {
2385
- if (!ae || !k) return [];
2403
+ }, [ce]), ue = l(() => {
2404
+ if (!A || !k) return [];
2386
2405
  let e = /* @__PURE__ */ new Map(), t = [];
2387
2406
  for (let n of O) {
2388
2407
  let r = k.map((e) => String(n[e.field] ?? "")).join(" / ");
@@ -2406,7 +2425,7 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2406
2425
  });
2407
2426
  return n === "desc" ? -r : r;
2408
2427
  }), t.map((t) => {
2409
- let n = e.get(t), r = t in se ? se[t] : j;
2428
+ let n = e.get(t), r = t in ae ? ae[t] : ce;
2410
2429
  return {
2411
2430
  key: t,
2412
2431
  label: n.label,
@@ -2417,9 +2436,9 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2417
2436
  }, [
2418
2437
  O,
2419
2438
  k,
2439
+ A,
2420
2440
  ae,
2421
- se,
2422
- j
2441
+ ce
2423
2442
  ]);
2424
2443
  if (g && !O.length) return /* @__PURE__ */ I("div", {
2425
2444
  className: "p-4 text-sm text-muted-foreground",
@@ -2429,12 +2448,12 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2429
2448
  className: "p-4 text-sm text-muted-foreground",
2430
2449
  children: "No items to display"
2431
2450
  });
2432
- let N = (e) => !T || T.length === 0 ? null : /* @__PURE__ */ I("div", {
2451
+ let de = (e) => !T || T.length === 0 ? null : /* @__PURE__ */ I("div", {
2433
2452
  className: "mt-1.5 space-y-1",
2434
2453
  children: T.map((t) => {
2435
2454
  let n = e[t];
2436
2455
  if (n == null || n === "") return null;
2437
- let r = re(t), i = z(r) || r.type || "text", a = ze(i), o = r?.label && String(r.label).trim() ? String(r.label) : void 0, s = o != null && ot.has(i);
2456
+ let r = re(t), i = Ve(r) || r.type || "text", a = Be(i), o = r?.label && String(r.label).trim() ? String(r.label) : void 0, s = o != null && ct.has(i);
2438
2457
  return /* @__PURE__ */ L("div", {
2439
2458
  className: E("text-xs text-muted-foreground truncate [&_*]:!text-xs", s && "flex items-baseline gap-1.5"),
2440
2459
  onClick: (e) => {
@@ -2449,20 +2468,20 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2449
2468
  })]
2450
2469
  }, t);
2451
2470
  })
2452
- }), ue = (t, i) => {
2453
- let a = t.id ?? t._id ?? i, o = (te != null && t[te] != null && t[te] !== "" ? String(t[te]) : void 0) ?? r(v, t), s = t[S], c = ct(String(a) + "|" + o), l = E("group relative overflow-hidden border-border/60 bg-card", "transition-all duration-200 ease-out", "hover:shadow-lg hover:border-border hover:-translate-y-0.5", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer");
2454
- return ie && C === "contain" ? /* @__PURE__ */ L(d, {
2471
+ }), M = (t, r) => {
2472
+ let a = t.id ?? t._id ?? r, o = (w != null && t[w] != null && t[w] !== "" ? String(t[w]) : void 0) ?? i(v, t), s = t[x], c = ut(String(a) + "|" + o), l = E("group relative overflow-hidden border-border/60 bg-card", "transition-all duration-200 ease-out", "hover:shadow-lg hover:border-border hover:-translate-y-0.5", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer");
2473
+ return ie && S === "contain" ? /* @__PURE__ */ L(f, {
2455
2474
  role: "listitem",
2456
2475
  className: l,
2457
2476
  onClick: (e) => y.handleClick(t, e),
2458
2477
  children: [/* @__PURE__ */ I("div", {
2459
2478
  "aria-hidden": !0,
2460
2479
  className: E("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", c.bg)
2461
- }), /* @__PURE__ */ I(f, {
2480
+ }), /* @__PURE__ */ I(p, {
2462
2481
  className: "p-4",
2463
2482
  children: /* @__PURE__ */ L("div", {
2464
2483
  className: "flex items-start gap-3",
2465
- children: [/* @__PURE__ */ I(lt, {
2484
+ children: [/* @__PURE__ */ I(q, {
2466
2485
  imageUrl: s,
2467
2486
  title: o,
2468
2487
  placeholder: c
@@ -2472,11 +2491,11 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2472
2491
  className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
2473
2492
  title: o,
2474
2493
  children: o
2475
- }), N(t)]
2494
+ }), de(t)]
2476
2495
  })]
2477
2496
  })
2478
2497
  })]
2479
- }, a) : /* @__PURE__ */ L(d, {
2498
+ }, a) : /* @__PURE__ */ L(f, {
2480
2499
  role: "listitem",
2481
2500
  className: l,
2482
2501
  onClick: (e) => y.handleClick(t, e),
@@ -2485,48 +2504,48 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2485
2504
  "aria-hidden": !0,
2486
2505
  className: E("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", c.bg)
2487
2506
  }),
2488
- /* @__PURE__ */ I(J, {
2507
+ /* @__PURE__ */ I(dt, {
2489
2508
  imageUrl: s,
2490
2509
  title: o,
2491
- coverFit: C,
2492
- aspectClass: at[w],
2510
+ coverFit: S,
2511
+ aspectClass: st[C],
2493
2512
  placeholder: c,
2494
2513
  hidden: !ie
2495
2514
  }),
2496
- /* @__PURE__ */ L(f, {
2515
+ /* @__PURE__ */ L(p, {
2497
2516
  className: E("p-3", ie && "border-t border-border/60"),
2498
2517
  children: [/* @__PURE__ */ I("h3", {
2499
2518
  className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
2500
2519
  title: o,
2501
2520
  children: o
2502
- }), N(t)]
2521
+ }), de(t)]
2503
2522
  })
2504
2523
  ]
2505
2524
  }, a);
2506
- }, de = (e) => /* @__PURE__ */ I("div", {
2507
- className: E("grid gap-4 p-4 auto-rows-min content-start", it[w], n.className),
2525
+ }, fe = (e) => /* @__PURE__ */ I("div", {
2526
+ className: E("grid gap-4 p-4 auto-rows-min content-start", ot[C], n.className),
2508
2527
  role: "list",
2509
- children: e.map((e, t) => ue(e, t))
2528
+ children: e.map((e, t) => M(e, t))
2510
2529
  });
2511
- return /* @__PURE__ */ L(Oe, { children: [ae ? /* @__PURE__ */ I("div", {
2530
+ return /* @__PURE__ */ L(ke, { children: [A ? /* @__PURE__ */ I("div", {
2512
2531
  className: "space-y-2",
2513
- children: le.map((e) => /* @__PURE__ */ L("div", {
2532
+ children: ue.map((e) => /* @__PURE__ */ L("div", {
2514
2533
  className: "border rounded-md",
2515
2534
  children: [/* @__PURE__ */ L("button", {
2516
2535
  type: "button",
2517
2536
  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",
2518
- onClick: () => M(e.key),
2537
+ onClick: () => le(e.key),
2519
2538
  children: [
2520
- e.collapsed ? /* @__PURE__ */ I(oe, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ I(A, { className: "h-4 w-4 shrink-0" }),
2539
+ e.collapsed ? /* @__PURE__ */ I(oe, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ I(j, { className: "h-4 w-4 shrink-0" }),
2521
2540
  /* @__PURE__ */ I("span", { children: e.label }),
2522
2541
  /* @__PURE__ */ I("span", {
2523
2542
  className: "ml-auto text-xs text-muted-foreground",
2524
2543
  children: e.items.length
2525
2544
  })
2526
2545
  ]
2527
- }), !e.collapsed && de(e.items)]
2546
+ }), !e.collapsed && fe(e.items)]
2528
2547
  }, e.key))
2529
- }) : de(O), y.isOverlay && /* @__PURE__ */ I(x, {
2548
+ }) : fe(O), y.isOverlay && /* @__PURE__ */ I(te, {
2530
2549
  ...y,
2531
2550
  title: "Gallery Item",
2532
2551
  children: (e) => /* @__PURE__ */ I("div", {
@@ -2544,53 +2563,53 @@ var J = ({ imageUrl: e, title: t, coverFit: n, aspectClass: r, placeholder: i, h
2544
2563
  })
2545
2564
  })] });
2546
2565
  };
2547
- e.register("object-gallery", ut, {
2566
+ e.register("object-gallery", ft, {
2548
2567
  namespace: "plugin-list",
2549
2568
  label: "Gallery View",
2550
2569
  category: "view"
2551
2570
  });
2552
2571
  //#endregion
2553
2572
  //#region src/components/TabBar.tsx
2554
- function dt(e) {
2555
- return e ? De[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
2573
+ function pt(e) {
2574
+ return e ? Oe[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
2556
2575
  }
2557
- function ft(e) {
2576
+ function mt(e) {
2558
2577
  return e.filter((e) => e.pinned || e.visible !== "false" && e.visible !== !1).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
2559
2578
  }
2560
- var pt = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2561
- let a = i.useMemo(() => ft(e), [e]), o = i.useMemo(() => a.find((e) => e.isDefault)?.name ?? a[0]?.name, [a]), [s, c] = i.useState(o), l = t ?? s, d = i.useCallback((e) => {
2579
+ var ht = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2580
+ let i = a.useMemo(() => mt(e), [e]), o = a.useMemo(() => i.find((e) => e.isDefault)?.name ?? i[0]?.name, [i]), [s, c] = a.useState(o), l = t ?? s, u = a.useCallback((e) => {
2562
2581
  c(e.name), n?.(e);
2563
2582
  }, [n]);
2564
- return a.length === 0 ? null : /* @__PURE__ */ I("div", {
2583
+ return i.length === 0 ? null : /* @__PURE__ */ I("div", {
2565
2584
  className: E("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
2566
2585
  "data-testid": "view-tabs",
2567
2586
  role: "tablist",
2568
- children: a.map((e) => {
2569
- let t = dt(e.icon), n = l === e.name;
2570
- return /* @__PURE__ */ L(u, {
2587
+ children: i.map((e) => {
2588
+ let t = pt(e.icon), n = l === e.name;
2589
+ return /* @__PURE__ */ L(d, {
2571
2590
  variant: "ghost",
2572
2591
  size: "sm",
2573
2592
  className: E("h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150", n ? "font-medium text-foreground bg-muted" : "text-muted-foreground hover:text-foreground hover:bg-transparent"),
2574
2593
  "data-testid": `view-tab-${e.name}`,
2575
2594
  role: "tab",
2576
2595
  "aria-selected": n,
2577
- onClick: () => d(e),
2596
+ onClick: () => u(e),
2578
2597
  children: [t && /* @__PURE__ */ I(t, { className: "h-3 w-3 mr-1.5" }), e.label]
2579
2598
  }, e.name);
2580
2599
  })
2581
2600
  });
2582
- }, Y = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2583
- let a = i.useMemo(() => ft(e), [e]), o = i.useMemo(() => a.find((e) => e.isDefault)?.name ?? a[0]?.name, [a]), [s, c] = i.useState(o), l = t ?? s, d = i.useMemo(() => a.find((e) => e.name === l) ?? a[0], [a, l]), f = i.useCallback((e) => {
2601
+ }, gt = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2602
+ let i = a.useMemo(() => mt(e), [e]), o = a.useMemo(() => i.find((e) => e.isDefault)?.name ?? i[0]?.name, [i]), [s, c] = a.useState(o), l = t ?? s, u = a.useMemo(() => i.find((e) => e.name === l) ?? i[0], [i, l]), f = a.useCallback((e) => {
2584
2603
  c(e.name), n?.(e);
2585
2604
  }, [n]);
2586
- if (a.length === 0) return null;
2587
- let p = dt(d?.icon);
2605
+ if (i.length === 0) return null;
2606
+ let p = pt(u?.icon);
2588
2607
  return /* @__PURE__ */ I("div", {
2589
2608
  className: E("px-2 py-1", r),
2590
2609
  "data-testid": "view-tabs-select",
2591
- children: /* @__PURE__ */ L(m, { children: [/* @__PURE__ */ I(_, {
2610
+ children: /* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I(v, {
2592
2611
  asChild: !0,
2593
- children: /* @__PURE__ */ L(u, {
2612
+ children: /* @__PURE__ */ L(d, {
2594
2613
  variant: "ghost",
2595
2614
  size: "sm",
2596
2615
  className: "h-7 px-2 text-xs font-medium text-foreground gap-1.5 max-w-[60vw] truncate",
@@ -2599,17 +2618,17 @@ var pt = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2599
2618
  p && /* @__PURE__ */ I(p, { className: "h-3.5 w-3.5 shrink-0" }),
2600
2619
  /* @__PURE__ */ I("span", {
2601
2620
  className: "truncate",
2602
- children: d?.label ?? ""
2621
+ children: u?.label ?? ""
2603
2622
  }),
2604
- /* @__PURE__ */ I(A, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
2623
+ /* @__PURE__ */ I(j, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
2605
2624
  ]
2606
2625
  })
2607
- }), /* @__PURE__ */ I(h, {
2626
+ }), /* @__PURE__ */ I(g, {
2608
2627
  align: "start",
2609
2628
  className: "w-56 max-h-72 overflow-y-auto",
2610
- children: a.map((e) => {
2611
- let t = dt(e.icon);
2612
- return /* @__PURE__ */ L(g, {
2629
+ children: i.map((e) => {
2630
+ let t = pt(e.icon);
2631
+ return /* @__PURE__ */ L(_, {
2613
2632
  onClick: () => f(e),
2614
2633
  className: E("text-sm", l === e.name && "font-medium bg-muted"),
2615
2634
  "data-testid": `view-tab-select-${e.name}`,
@@ -2622,7 +2641,7 @@ var pt = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
2622
2641
  })] })
2623
2642
  });
2624
2643
  };
2625
- e.register("list-view", rt, {
2644
+ e.register("list-view", K, {
2626
2645
  namespace: "plugin-list",
2627
2646
  label: "List View",
2628
2647
  category: "Views",
@@ -2699,7 +2718,7 @@ e.register("list-view", rt, {
2699
2718
  sort: [],
2700
2719
  options: {}
2701
2720
  }
2702
- }), e.register("list", rt, {
2721
+ }), e.register("list", K, {
2703
2722
  namespace: "view",
2704
2723
  skipFallback: !0,
2705
2724
  category: "view",
@@ -2771,4 +2790,4 @@ e.register("list-view", rt, {
2771
2790
  ]
2772
2791
  });
2773
2792
  //#endregion
2774
- export { rt as ListView, ut as ObjectGallery, pt as TabBar, Y as TabBarSelect, Ge as UserFilters, Ve as ViewSwitcher, Be as ViewSwitcherDropdown, q as evaluateConditionalFormatting, K as normalizeFilterCondition, Xe as normalizeFilters };
2793
+ export { K as ListView, ft as ObjectGallery, ht as TabBar, gt as TabBarSelect, Je as UserFilters, Ue as ViewSwitcher, He as ViewSwitcherDropdown, tt as evaluateConditionalFormatting, W as normalizeFilterCondition, $e as normalizeFilters };