@object-ui/plugin-list 4.3.0 → 4.4.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
@@ -2,20 +2,21 @@ import { ComponentRegistry as e, buildExpandFields as t, evaluatePlainCondition
2
2
  import * as a from "react";
3
3
  import { useCallback as o, useContext as s, useEffect as c, useMemo as l, useState as u } from "react";
4
4
  import { Button as d, Card as f, CardContent as p, FilterBuilder as m, GroupingEditor as h, Input as g, LookupValuePicker as _, NavigationOverlay as v, Popover as y, PopoverContent as b, PopoverTrigger as x, SortBuilder as S, cn as C } from "@object-ui/components";
5
- import { Activity as w, ArrowUpDown as ee, Calendar as te, CheckSquare as ne, ChevronDown as T, ChevronRight as re, Download as ie, EyeOff as ae, GanttChartSquare as E, Grid as D, Group as oe, Images as O, Inbox as k, LayoutGrid as A, Map as j, Paintbrush as M, Plus as N, Printer as se, Rows2 as ce, Rows3 as le, Rows4 as ue, Search as de, Share2 as fe, SlidersHorizontal as pe, Trash2 as me, X as he, icons as ge } from "lucide-react";
6
- import { Fragment as _e, jsx as P, jsxs as F } from "react/jsx-runtime";
7
- import { useObjectLabel as I, useObjectTranslation as ve, useSafeFieldLabel as ye } from "@object-ui/i18n";
8
- import { SchemaRenderer as be, SchemaRendererContext as xe, useDataScope as Se, useDensityMode as Ce, useNavigationOverlay as we, useSafeFieldLabel as Te } from "@object-ui/react";
9
- import { usePullToRefresh as Ee } from "@object-ui/mobile";
5
+ import { Activity as w, ArrowUpDown as T, Calendar as ee, CheckSquare as te, ChevronDown as E, ChevronRight as ne, Download as re, EyeOff as ie, GanttChartSquare as D, Grid as O, Group as ae, Images as k, Inbox as A, LayoutGrid as j, Map as M, Paintbrush as oe, Plus as se, Printer as ce, Rows2 as le, Rows3 as ue, Rows4 as de, Search as fe, Settings2 as pe, Share2 as me, SlidersHorizontal as he, Trash2 as ge, X as _e, icons as ve } from "lucide-react";
6
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
7
+ import { useObjectLabel as ye, useObjectTranslation as be, useSafeFieldLabel as xe } from "@object-ui/i18n";
8
+ import { SchemaRenderer as Se, SchemaRendererContext as Ce, useDataScope as we, useDensityMode as Te, useNavigationOverlay as Ee, useSafeFieldLabel as De } from "@object-ui/react";
9
+ import { usePullToRefresh as Oe } from "@object-ui/mobile";
10
+ import { usePermissions as ke } from "@object-ui/permissions";
10
11
  //#region src/ViewSwitcher.tsx
11
- var De = {
12
- grid: /* @__PURE__ */ P(D, { className: "h-4 w-4" }),
13
- kanban: /* @__PURE__ */ P(A, { className: "h-4 w-4" }),
14
- gallery: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
15
- calendar: /* @__PURE__ */ P(te, { className: "h-4 w-4" }),
12
+ var I = {
13
+ grid: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
14
+ kanban: /* @__PURE__ */ P(j, { className: "h-4 w-4" }),
15
+ gallery: /* @__PURE__ */ P(k, { className: "h-4 w-4" }),
16
+ calendar: /* @__PURE__ */ P(ee, { className: "h-4 w-4" }),
16
17
  timeline: /* @__PURE__ */ P(w, { className: "h-4 w-4" }),
17
- gantt: /* @__PURE__ */ P(E, { className: "h-4 w-4" }),
18
- map: /* @__PURE__ */ P(j, { className: "h-4 w-4" })
18
+ gantt: /* @__PURE__ */ P(D, { className: "h-4 w-4" }),
19
+ map: /* @__PURE__ */ P(M, { className: "h-4 w-4" })
19
20
  }, L = {
20
21
  grid: "Grid",
21
22
  kanban: "Kanban",
@@ -24,7 +25,7 @@ var De = {
24
25
  timeline: "Timeline",
25
26
  gantt: "Gantt",
26
27
  map: "Map"
27
- }, Oe = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
28
+ }, Ae = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
28
29
  let o = a.useCallback((t) => {
29
30
  if (!i || t === e) {
30
31
  n(t);
@@ -48,7 +49,7 @@ var De = {
48
49
  "aria-pressed": n,
49
50
  "data-state": n ? "on" : "off",
50
51
  className: C("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"),
51
- children: [De[t], /* @__PURE__ */ P("span", {
52
+ children: [I[t], /* @__PURE__ */ P("span", {
52
53
  className: "hidden sm:inline-block text-xs font-medium",
53
54
  children: L[t]
54
55
  })]
@@ -58,14 +59,14 @@ var De = {
58
59
  };
59
60
  //#endregion
60
61
  //#region src/components/TabBar.tsx
61
- function ke(e) {
62
- return e ? ge[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
62
+ function je(e) {
63
+ return e ? ve[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
63
64
  }
64
- function Ae(e) {
65
+ function Me(e) {
65
66
  return e.filter((e) => e.pinned || e.visible !== "false" && e.visible !== !1).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
66
67
  }
67
- var je = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
68
- let i = a.useMemo(() => Ae(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) => {
68
+ var Ne = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
69
+ let i = a.useMemo(() => Me(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) => {
69
70
  c(e.name), n?.(e);
70
71
  }, [n]);
71
72
  return i.length === 0 ? null : /* @__PURE__ */ P("div", {
@@ -73,7 +74,7 @@ var je = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
73
74
  "data-testid": "view-tabs",
74
75
  role: "tablist",
75
76
  children: i.map((e) => {
76
- let t = ke(e.icon), n = l === e.name;
77
+ let t = je(e.icon), n = l === e.name;
77
78
  return /* @__PURE__ */ F(d, {
78
79
  variant: "ghost",
79
80
  size: "sm",
@@ -88,24 +89,200 @@ var je = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
88
89
  });
89
90
  };
90
91
  //#endregion
92
+ //#region src/components/ViewSettingsPopover.tsx
93
+ function R({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: i = !0, children: o }) {
94
+ let [s, c] = a.useState(i);
95
+ return /* @__PURE__ */ F("div", {
96
+ className: "border-b last:border-b-0",
97
+ children: [/* @__PURE__ */ F("div", {
98
+ className: "flex items-center justify-between px-3 py-2",
99
+ children: [/* @__PURE__ */ F("button", {
100
+ type: "button",
101
+ onClick: () => c((e) => !e),
102
+ className: "flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground",
103
+ children: [
104
+ /* @__PURE__ */ P(E, { className: C("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
105
+ e,
106
+ typeof t == "number" && t > 0 && /* @__PURE__ */ P("span", {
107
+ 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",
108
+ children: t
109
+ })
110
+ ]
111
+ }), n && /* @__PURE__ */ P("button", {
112
+ type: "button",
113
+ onClick: n,
114
+ className: "text-[11px] text-muted-foreground hover:text-foreground",
115
+ children: r
116
+ })]
117
+ }), s && /* @__PURE__ */ P("div", {
118
+ className: "px-3 pb-3",
119
+ children: o
120
+ })]
121
+ });
122
+ }
123
+ function Pe(e) {
124
+ 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: g } = e, [_, v] = a.useState(!1), S = [
125
+ !!i?.fields?.length,
126
+ !!c?.field,
127
+ f && f.mode !== "compact",
128
+ (m?.size ?? 0) > 0
129
+ ].filter(Boolean).length, w = f?.mode === "compact" ? de : f?.mode === "comfortable" ? ue : le, T = t("list.viewSettings", { defaultValue: "View settings" });
130
+ return /* @__PURE__ */ F(y, {
131
+ open: _,
132
+ onOpenChange: v,
133
+ children: [/* @__PURE__ */ P(x, {
134
+ asChild: !0,
135
+ children: /* @__PURE__ */ F(d, {
136
+ variant: "ghost",
137
+ size: "sm",
138
+ "aria-label": T,
139
+ title: T,
140
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", S > 0 && "text-foreground font-medium"),
141
+ "data-testid": "view-settings-trigger",
142
+ children: [
143
+ /* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
144
+ /* @__PURE__ */ P("span", {
145
+ className: "hidden sm:inline",
146
+ children: T
147
+ }),
148
+ S > 0 && /* @__PURE__ */ P("span", {
149
+ className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
150
+ children: S
151
+ })
152
+ ]
153
+ })
154
+ }), /* @__PURE__ */ F(b, {
155
+ align: "end",
156
+ className: "w-80 p-0",
157
+ "data-testid": "view-settings-content",
158
+ children: [
159
+ /* @__PURE__ */ F("div", {
160
+ className: "px-3 py-2 border-b",
161
+ children: [/* @__PURE__ */ P("div", {
162
+ className: "text-sm font-semibold",
163
+ children: T
164
+ }), /* @__PURE__ */ P("div", {
165
+ className: "text-[11px] text-muted-foreground",
166
+ children: t("list.viewSettingsHint", { defaultValue: "Grouping, color, density, and visible fields." })
167
+ })]
168
+ }),
169
+ r && o && /* @__PURE__ */ P(R, {
170
+ title: t("list.group", { defaultValue: "Group" }),
171
+ badge: i?.fields?.length || 0,
172
+ onClear: i ? () => o(void 0) : void 0,
173
+ clearLabel: t("list.clear", { defaultValue: "Clear" }),
174
+ children: /* @__PURE__ */ P(h, {
175
+ value: i,
176
+ fieldOptions: n.map((e) => ({
177
+ value: e.name,
178
+ label: e.label || e.name
179
+ })),
180
+ maxLevels: 3,
181
+ labels: {
182
+ addGroup: t("list.addGroup", "Add group field"),
183
+ collapseTitle: t("list.collapsedByDefault", "Collapsed by default"),
184
+ removeTitle: t("list.removeGroup", "Remove")
185
+ },
186
+ onChange: (e) => o(e)
187
+ })
188
+ }),
189
+ s && l && /* @__PURE__ */ F(R, {
190
+ title: t("list.color", { defaultValue: "Row color" }),
191
+ onClear: c ? () => l(void 0) : void 0,
192
+ clearLabel: t("list.clear", { defaultValue: "Clear" }),
193
+ defaultOpen: !!c,
194
+ children: [/* @__PURE__ */ P("label", {
195
+ className: "block text-[11px] text-muted-foreground mb-1",
196
+ children: t("list.colorByField", { defaultValue: "Color by field" })
197
+ }), /* @__PURE__ */ F("select", {
198
+ className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
199
+ value: c?.field || "",
200
+ onChange: (e) => {
201
+ let t = e.target.value;
202
+ l(t ? {
203
+ field: t,
204
+ colors: c?.colors || {}
205
+ } : void 0);
206
+ },
207
+ "data-testid": "color-field-select",
208
+ children: [/* @__PURE__ */ P("option", {
209
+ value: "",
210
+ children: t("list.none", { defaultValue: "None" })
211
+ }), n.map((e) => /* @__PURE__ */ P("option", {
212
+ value: e.name,
213
+ children: e.label || e.name
214
+ }, e.name))]
215
+ })]
216
+ }),
217
+ u && f && /* @__PURE__ */ P(R, {
218
+ title: t("grid.toolbar.densityMode", { defaultValue: "Density" }),
219
+ defaultOpen: f.mode !== "compact",
220
+ children: /* @__PURE__ */ F("div", {
221
+ className: "flex items-center gap-2",
222
+ children: [/* @__PURE__ */ F(d, {
223
+ variant: "outline",
224
+ size: "sm",
225
+ className: "h-7 gap-1.5",
226
+ onClick: f.cycle,
227
+ "data-testid": "view-settings-density-cycle",
228
+ children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
229
+ className: "text-xs",
230
+ children: f.mode === "compact" ? t("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : f.mode === "comfortable" ? t("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : t("grid.toolbar.densitySpacious", { defaultValue: "Spacious" })
231
+ })]
232
+ }), /* @__PURE__ */ P("span", {
233
+ className: "text-[11px] text-muted-foreground",
234
+ children: t("grid.toolbar.densityCycleShortHint", { defaultValue: "Click to cycle" })
235
+ })]
236
+ })
237
+ }),
238
+ p && m && g && /* @__PURE__ */ P(R, {
239
+ title: t("list.hideFieldsTitle", { defaultValue: "Hide fields" }),
240
+ badge: m.size,
241
+ onClear: m.size > 0 ? () => g(/* @__PURE__ */ new Set()) : void 0,
242
+ clearLabel: t("list.showAll", { defaultValue: "Show all" }),
243
+ defaultOpen: m.size > 0,
244
+ children: /* @__PURE__ */ P("div", {
245
+ className: "max-h-48 overflow-y-auto space-y-0.5",
246
+ children: n.map((e) => /* @__PURE__ */ F("label", {
247
+ className: "flex items-center gap-2 text-xs py-1 px-1 rounded hover:bg-muted cursor-pointer",
248
+ children: [/* @__PURE__ */ P("input", {
249
+ type: "checkbox",
250
+ checked: !m.has(e.name),
251
+ onChange: () => {
252
+ let t = new Set(m);
253
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), g(t);
254
+ },
255
+ className: "rounded border-input"
256
+ }), /* @__PURE__ */ P("span", {
257
+ className: "truncate",
258
+ children: e.label || e.name
259
+ })]
260
+ }, e.name))
261
+ })
262
+ })
263
+ ]
264
+ })]
265
+ });
266
+ }
267
+ //#endregion
91
268
  //#region src/UserFilters.tsx
92
- function Me() {
269
+ function z() {
93
270
  try {
94
- let { t: e } = ve(), t = e("common.more");
271
+ let { t: e } = be(), t = e("common.more");
95
272
  return !t || t === "common.more" ? "More" : t;
96
273
  } catch {
97
274
  return "More";
98
275
  }
99
276
  }
100
- var Ne = new Set([
277
+ var Fe = new Set([
101
278
  "lookup",
102
279
  "master_detail",
103
280
  "user",
104
281
  "owner"
105
282
  ]);
106
- function Pe({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a }) {
283
+ function Ie({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a }) {
107
284
  switch (e.element) {
108
- case "dropdown": return /* @__PURE__ */ P(Fe, {
285
+ case "dropdown": return /* @__PURE__ */ P(Re, {
109
286
  fields: e.fields || [],
110
287
  objectDef: t,
111
288
  data: n,
@@ -113,14 +290,14 @@ function Pe({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
113
290
  maxVisible: i,
114
291
  className: a
115
292
  });
116
- case "tabs": return /* @__PURE__ */ P(Ie, {
293
+ case "tabs": return /* @__PURE__ */ P(ze, {
117
294
  tabs: e.tabs || [],
118
295
  showAllRecords: e.showAllRecords !== !1,
119
296
  allowAddTab: e.allowAddTab,
120
297
  onFilterChange: r,
121
298
  className: a
122
299
  });
123
- case "toggle": return /* @__PURE__ */ P(Le, {
300
+ case "toggle": return /* @__PURE__ */ P(B, {
124
301
  fields: e.fields || [],
125
302
  onFilterChange: r,
126
303
  className: a
@@ -128,7 +305,7 @@ function Pe({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
128
305
  default: return null;
129
306
  }
130
307
  }
131
- function R(e, t, n, r) {
308
+ function Le(e, t, n, r) {
132
309
  return e.map((e) => {
133
310
  let i = e.options ? [...e.options] : [], a = e.type, o, s, c;
134
311
  if (t?.fields) {
@@ -165,13 +342,13 @@ function R(e, t, n, r) {
165
342
  };
166
343
  });
167
344
  }
168
- function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o }) {
169
- let { fieldLabel: s, translateOptions: c } = ye(), l = Me(), u = t?.name, [d, f] = a.useState(() => {
345
+ function Re({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o }) {
346
+ let { fieldLabel: s, translateOptions: c } = xe(), l = z(), u = t?.name, [d, f] = a.useState(() => {
170
347
  let t = {};
171
348
  return e.forEach((e) => {
172
349
  e.defaultValues && e.defaultValues.length > 0 && (t[e.field] = e.defaultValues);
173
350
  }), t;
174
- }), p = a.useMemo(() => R(e, t, n, {
351
+ }), p = a.useMemo(() => Le(e, t, n, {
175
352
  objectName: u,
176
353
  fieldLabel: s,
177
354
  translateOptions: c
@@ -199,7 +376,7 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
199
376
  Object.values(d).some((e) => e.length > 0) && m(d);
200
377
  }, []);
201
378
  let g = i !== void 0 && i < p.length ? p.slice(0, i) : p, v = i !== void 0 && i < p.length ? p.slice(i) : [], S = (e) => {
202
- let t = d[e.field] || [], n = t.length > 0, r = Ne.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
379
+ let t = d[e.field] || [], n = t.length > 0, r = Fe.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
203
380
  return /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
204
381
  asChild: !0,
205
382
  children: /* @__PURE__ */ F("button", {
@@ -214,13 +391,13 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
214
391
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
215
392
  children: t.length
216
393
  }),
217
- n ? /* @__PURE__ */ P(he, {
394
+ n ? /* @__PURE__ */ P(_e, {
218
395
  className: "h-3 w-3 opacity-60 hover:opacity-100",
219
396
  "data-testid": `filter-clear-${e.field}`,
220
397
  onClick: (t) => {
221
398
  t.stopPropagation(), h(e.field, []);
222
399
  }
223
- }) : /* @__PURE__ */ P(T, { className: "h-3 w-3 opacity-60" })
400
+ }) : /* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
224
401
  ]
225
402
  })
226
403
  }), /* @__PURE__ */ P(b, {
@@ -286,7 +463,7 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
286
463
  className: "text-xs text-muted-foreground",
287
464
  "data-testid": "user-filters-empty",
288
465
  children: "No filter fields"
289
- }) : /* @__PURE__ */ F(_e, { children: [g.map(S), v.length > 0 && /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
466
+ }) : /* @__PURE__ */ F(N, { children: [g.map(S), v.length > 0 && /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
290
467
  asChild: !0,
291
468
  children: /* @__PURE__ */ F("button", {
292
469
  "data-testid": "user-filters-more",
@@ -297,7 +474,7 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
297
474
  className: "text-[10px] text-muted-foreground/80 tabular-nums",
298
475
  children: v.length
299
476
  }),
300
- /* @__PURE__ */ P(T, { className: "h-3 w-3 opacity-60" })
477
+ /* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
301
478
  ]
302
479
  })
303
480
  }), /* @__PURE__ */ P(b, {
@@ -311,7 +488,7 @@ function Fe({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i
311
488
  })] })] })
312
489
  });
313
490
  }
314
- function Ie({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
491
+ function ze({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
315
492
  let [o, s] = a.useState(() => e.find((e) => e.default)?.id || (t ? "__all__" : e[0]?.id || "")), c = a.useCallback((t) => {
316
493
  s(t), r(t === "__all__" ? [] : e.find((e) => e.id === t)?.filters || []);
317
494
  }, [e, r]), l = a.useMemo(() => {
@@ -337,11 +514,11 @@ function Ie({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, cla
337
514
  className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",
338
515
  "data-testid": "filter-tab-add",
339
516
  title: "Add filter tab",
340
- children: /* @__PURE__ */ P(N, { className: "h-3.5 w-3.5" })
517
+ children: /* @__PURE__ */ P(se, { className: "h-3.5 w-3.5" })
341
518
  })]
342
519
  });
343
520
  }
344
- function Le({ fields: e, onFilterChange: t, className: n }) {
521
+ function B({ fields: e, onFilterChange: t, className: n }) {
345
522
  let [r, i] = a.useState(() => {
346
523
  let t = /* @__PURE__ */ new Set();
347
524
  return e.forEach((e) => {
@@ -383,7 +560,7 @@ function Le({ fields: e, onFilterChange: t, className: n }) {
383
560
  }
384
561
  //#endregion
385
562
  //#region src/ListView.tsx
386
- function Re(e) {
563
+ function V(e) {
387
564
  switch (e) {
388
565
  case "equals":
389
566
  case "eq": return "=";
@@ -407,10 +584,10 @@ function Re(e) {
407
584
  default: return e;
408
585
  }
409
586
  }
410
- function z(e) {
587
+ function H(e) {
411
588
  if (!Array.isArray(e) || e.length < 3) return e;
412
589
  let [t, n, r] = e;
413
- return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? z(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
590
+ return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? H(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
414
591
  t,
415
592
  "=",
416
593
  r[0]
@@ -428,15 +605,15 @@ function z(e) {
428
605
  e
429
606
  ])] : e;
430
607
  }
431
- function ze(e) {
432
- return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
433
- }
434
608
  function Be(e) {
435
- return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? z(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
609
+ return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
436
610
  }
437
611
  function Ve(e) {
612
+ return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? H(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
613
+ }
614
+ function He(e) {
438
615
  if (!e || !e.conditions || e.conditions.length === 0) return [];
439
- let t = Be(e.conditions.map((e) => e.operator === "isEmpty" ? [
616
+ let t = Ve(e.conditions.map((e) => e.operator === "isEmpty" ? [
440
617
  e.field,
441
618
  "=",
442
619
  null
@@ -446,12 +623,12 @@ function Ve(e) {
446
623
  null
447
624
  ] : [
448
625
  e.field,
449
- Re(e.operator),
626
+ V(e.operator),
450
627
  e.value
451
628
  ]));
452
629
  return t.length === 0 ? [] : t.length === 1 ? t[0] : [e.logic, ...t];
453
630
  }
454
- function B(e, t) {
631
+ function Ue(e, t) {
455
632
  if (!t || t.length === 0) return {};
456
633
  for (let r of t) {
457
634
  let t = !1, i = ("condition" in r ? r.condition : void 0) || ("expression" in r ? r.expression : void 0) || void 0;
@@ -486,7 +663,7 @@ function B(e, t) {
486
663
  }
487
664
  return {};
488
665
  }
489
- var V = {
666
+ var We = {
490
667
  "list.recordCount": "{{count}} records",
491
668
  "list.recordCountOne": "{{count}} record",
492
669
  "list.noItems": "No items found",
@@ -516,61 +693,67 @@ var V = {
516
693
  "list.share": "Share",
517
694
  "list.print": "Print",
518
695
  "list.hideFieldsTitle": "Hide Fields",
519
- "table.rowsPerPage": "Rows per page"
696
+ "table.rowsPerPage": "Rows per page",
697
+ "grid.toolbar.densityMode": "Density",
698
+ "grid.toolbar.densityCompact": "Compact",
699
+ "grid.toolbar.densityComfortable": "Comfortable",
700
+ "grid.toolbar.densitySpacious": "Spacious",
701
+ "grid.toolbar.densityCycleHint": "{{label}} (click to cycle)",
702
+ "grid.toolbar.densityCycleShortHint": "Click to cycle",
703
+ "list.viewSettings": "View settings",
704
+ "list.viewSettingsHint": "Grouping, color, density, and visible fields."
705
+ }, U = (e, t, n) => n, Ge = (e, t) => {
706
+ let n = We[e] || e;
707
+ if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
708
+ return n;
520
709
  };
521
- function He() {
710
+ function Ke() {
522
711
  try {
523
- let e = ve();
524
- return e.t("list.recordCount") === "list.recordCount" ? { t: (e, t) => {
525
- let n = V[e] || e;
526
- if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
527
- return n;
528
- } } : { t: e.t };
712
+ let e = be();
713
+ return e.t("list.recordCount") === "list.recordCount" ? { t: Ge } : { t: e.t };
529
714
  } catch {
530
- return { t: (e, t) => {
531
- let n = V[e] || e;
532
- if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
533
- return n;
534
- } };
715
+ return { t: Ge };
535
716
  }
536
717
  }
537
- function Ue() {
718
+ function qe() {
538
719
  try {
539
- let { fieldLabel: e } = I();
720
+ let { fieldLabel: e } = ye();
540
721
  return { fieldLabel: e };
541
722
  } catch {
542
- return { fieldLabel: (e, t, n) => n };
723
+ return { fieldLabel: U };
543
724
  }
544
725
  }
545
- var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange: s, onSortChange: c, onSearchChange: l, onHiddenFieldsChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: _ = !1, ...w }, te) => {
546
- let { t: T } = He(), { fieldLabel: re } = Ue(), { translateOptions: E } = ye(), D = a.useMemo(() => ({
726
+ var W = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange: s, onSortChange: c, onSearchChange: l, onHiddenFieldsChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: _ = !1, ...w }, ee) => {
727
+ let { t: E } = Ke(), { fieldLabel: ne } = qe(), { translateOptions: D } = xe(), O = a.useMemo(() => e.viewType ? e : {
547
728
  ...e,
548
- viewType: e.viewType || "grid"
549
- }), [e]), O = a.useCallback((e, t) => D.objectName ? re(D.objectName, e, t) : t, [D.objectName, re]), A = a.useMemo(() => {
550
- let e = D.userActions, t = D.addRecord?.enabled === !0 && e?.addRecordForm !== !1;
729
+ viewType: "grid"
730
+ }, [e]), k = a.useCallback((e, t) => O.objectName ? ne(O.objectName, e, t) : t, [O.objectName, ne]), j = a.useMemo(() => {
731
+ let e = O.userActions, t = O.addRecord?.enabled === !0 && e?.addRecordForm !== !1;
551
732
  return {
552
- showSearch: e?.search === void 0 ? D.showSearch !== !1 : e.search,
553
- showSort: e?.sort === void 0 ? D.showSort !== !1 : e.sort,
554
- showFilters: e?.filter === void 0 ? D.showFilters !== !1 : e.filter,
555
- showDensity: e?.rowHeight === void 0 ? D.showDensity !== !1 : e.rowHeight,
556
- showHideFields: D.showHideFields === !0,
557
- showGroup: D.showGroup !== !1,
558
- showColor: D.showColor === !0,
733
+ showSearch: e?.search === void 0 ? O.showSearch !== !1 : e.search,
734
+ showSort: e?.sort === void 0 ? O.showSort !== !1 : e.sort,
735
+ showFilters: e?.filter === void 0 ? O.showFilters !== !1 : e.filter,
736
+ showDensity: e?.rowHeight === void 0 ? O.showDensity !== !1 : e.rowHeight,
737
+ showHideFields: O.showHideFields === !0,
738
+ showGroup: O.showGroup !== !1,
739
+ showColor: O.showColor === !0,
740
+ compactToolbar: O.compactToolbar === !0,
559
741
  showAddRecord: t,
560
- addRecordPosition: D.addRecord?.position === "bottom" ? "bottom" : "top"
742
+ addRecordPosition: O.addRecord?.position === "bottom" ? "bottom" : "top"
561
743
  };
562
744
  }, [
563
- D.userActions,
564
- D.showSearch,
565
- D.showSort,
566
- D.showFilters,
567
- D.showDensity,
568
- D.showHideFields,
569
- D.showGroup,
570
- D.showColor,
571
- D.addRecord,
572
- D.userActions?.addRecordForm
573
- ]), [j, _e] = a.useState(D.viewType), [I, ve] = a.useState(""), [xe, Se] = a.useState(!1), [Te, De] = a.useState(!1), [L, ke] = a.useState(() => D.sort && D.sort.length > 0 ? D.sort.map((e) => {
745
+ O.userActions,
746
+ O.showSearch,
747
+ O.showSort,
748
+ O.showFilters,
749
+ O.showDensity,
750
+ O.showHideFields,
751
+ O.showGroup,
752
+ O.showColor,
753
+ O.compactToolbar,
754
+ O.addRecord,
755
+ O.userActions?.addRecordForm
756
+ ]), [M, pe] = a.useState(O.viewType), [N, ye] = a.useState(""), [be, Ce] = a.useState(!1), [we, De] = a.useState(!1), [I, L] = a.useState(() => O.sort && O.sort.length > 0 ? O.sort.map((e) => {
574
757
  if (typeof e == "string") {
575
758
  let t = e.trim().split(/\s+/);
576
759
  return {
@@ -584,9 +767,9 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
584
767
  field: e.field,
585
768
  order: e.order || "asc"
586
769
  };
587
- }) : []), Ae = a.useMemo(() => JSON.stringify(D.sort || []), [D.sort]);
770
+ }) : []), je = a.useMemo(() => JSON.stringify(O.sort || []), [O.sort]);
588
771
  a.useEffect(() => {
589
- D.sort && D.sort.length > 0 ? ke(D.sort.map((e) => {
772
+ O.sort && O.sort.length > 0 ? L(O.sort.map((e) => {
590
773
  if (typeof e == "string") {
591
774
  let t = e.trim().split(/\s+/);
592
775
  return {
@@ -600,16 +783,16 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
600
783
  field: e.field,
601
784
  order: e.order || "asc"
602
785
  };
603
- })) : ke([]);
604
- }, [Ae]);
605
- let [Me, Ne] = a.useState(!1), [R, Fe] = a.useState({
786
+ })) : L([]);
787
+ }, [je]);
788
+ let [Me, R] = a.useState(!1), [z, Fe] = a.useState({
606
789
  id: "root",
607
790
  logic: "and",
608
791
  conditions: []
609
- }), [Ie, Le] = a.useState(() => {
610
- if (!(!D.tabs || D.tabs.length === 0)) return D.tabs.find((e) => e.isDefault)?.name ?? D.tabs[0]?.name;
611
- }), Re = a.useCallback((e) => {
612
- if (Le(e.name), e.filter) {
792
+ }), [Le, Re] = a.useState(() => {
793
+ if (!(!O.tabs || O.tabs.length === 0)) return O.tabs.find((e) => e.isDefault)?.name ?? O.tabs[0]?.name;
794
+ }), ze = a.useCallback((e) => {
795
+ if (Re(e.name), e.filter) {
613
796
  let t = {
614
797
  id: `tab-filter-${e.name}`,
615
798
  logic: e.filter.logic || "and",
@@ -624,19 +807,19 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
624
807
  };
625
808
  Fe(e), s?.(e);
626
809
  }
627
- }, [s]), z = w.dataSource, [B, V] = a.useState([]), [H, U] = a.useState(!1), [W, We] = a.useState(null), [Ge, Ke] = a.useState(!1), [qe, Je] = a.useState(0), [Ye, Xe] = a.useState(!1);
628
- a.useImperativeHandle(te, () => ({ refresh: () => Je((e) => e + 1) }), []), a.useEffect(() => {
629
- if (!(!z?.onMutation || !D.objectName || D.refreshTrigger)) return z.onMutation((e) => {
630
- e.resource === D.objectName && Je((e) => e + 1);
810
+ }, [s]), B = w.dataSource, [V, H] = a.useState([]), [Ue, We] = a.useState(!1), [U, Ge] = a.useState(null), [W, Je] = a.useState(!1), [Ye, Xe] = a.useState(0), [Ze, Qe] = a.useState(!1);
811
+ a.useImperativeHandle(ee, () => ({ refresh: () => Xe((e) => e + 1) }), []), a.useEffect(() => {
812
+ if (!(!B?.onMutation || !O.objectName || O.refreshTrigger)) return B.onMutation((e) => {
813
+ e.resource === O.objectName && Xe((e) => e + 1);
631
814
  });
632
815
  }, [
633
- z,
634
- D.objectName,
635
- D.refreshTrigger
816
+ B,
817
+ O.objectName,
818
+ O.refreshTrigger
636
819
  ]);
637
- let [Ze, Qe] = a.useState(void 0), G = Ze ?? D.pagination?.pageSize ?? 100, K = a.useMemo(() => {
638
- if (D.grouping?.fields?.length) return D.grouping;
639
- let e = typeof D.groupBy == "string" ? D.groupBy.trim() : "", t = typeof D.groupBy2 == "string" ? D.groupBy2.trim() : "", n = [];
820
+ let [$e, et] = a.useState(void 0), tt = $e ?? O.pagination?.pageSize ?? 100, G = a.useMemo(() => {
821
+ if (O.grouping?.fields?.length) return O.grouping;
822
+ let e = typeof O.groupBy == "string" ? O.groupBy.trim() : "", t = typeof O.groupBy2 == "string" ? O.groupBy2.trim() : "", n = [];
640
823
  return e && n.push({
641
824
  field: e,
642
825
  order: "asc",
@@ -647,81 +830,96 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
647
830
  collapsed: !1
648
831
  }), n.length > 0 ? { fields: n } : void 0;
649
832
  }, [
650
- D.grouping,
651
- D.groupBy,
652
- D.groupBy2
653
- ]), [q, $e] = a.useState(K), [et, tt] = a.useState(!1), nt = a.useRef(K);
833
+ O.grouping,
834
+ O.groupBy,
835
+ O.groupBy2
836
+ ]), [K, nt] = a.useState(G), [rt, it] = a.useState(!1), at = a.useRef(G);
654
837
  a.useEffect(() => {
655
- nt.current !== K && (nt.current = K, $e(K));
656
- }, [K]);
657
- let [J, rt] = a.useState(D.rowColor), [it, at] = a.useState(!1), [ot, st] = a.useState([]), ct = a.useRef(0), [lt, ut] = a.useState(() => {
838
+ at.current !== G && (at.current = G, nt(G));
839
+ }, [G]);
840
+ let [q, ot] = a.useState(O.rowColor), [st, ct] = a.useState(!1), [lt, ut] = a.useState([]), dt = a.useRef(0), [ft, pt] = a.useState(() => {
658
841
  let e = /* @__PURE__ */ new Set();
659
- return D.quickFilters?.forEach((t) => {
842
+ return O.quickFilters?.forEach((t) => {
660
843
  let n = r(t);
661
844
  n.defaultActive && e.add(n.id);
662
845
  }), e;
663
- }), [dt, ft] = a.useState([]), pt = a.useMemo(() => {
664
- if (D.userFilters) return D.userFilters;
665
- if (!W?.fields) return;
846
+ }), [mt, ht] = a.useState([]), gt = a.useMemo(() => {
847
+ if (O.userFilters) return O.userFilters;
848
+ if (!U?.fields) return;
666
849
  let e = new Set([
667
850
  "select",
668
851
  "multi-select",
669
852
  "boolean"
670
- ]), t = [], n = Array.isArray(W.fields) ? W.fields.map((e) => [e.name, e]) : Object.entries(W.fields);
853
+ ]), t = [], n = Array.isArray(U.fields) ? U.fields.map((e) => [e.name, e]) : Object.entries(U.fields);
671
854
  for (let [r, i] of n) (e.has(i.type) || i.options && !i.type) && t.push({
672
855
  field: r,
673
- label: O(r, i.label || r),
856
+ label: k(r, i.label || r),
674
857
  type: i.type === "boolean" ? "boolean" : i.type === "multi-select" ? "multi-select" : "select"
675
858
  });
676
859
  if (t.length !== 0) return {
677
860
  element: "dropdown",
678
861
  fields: t
679
862
  };
680
- }, [D.userFilters, W]), [Y, mt] = a.useState(() => new Set(D.hiddenFields || [])), ht = a.useMemo(() => JSON.stringify(D.hiddenFields || []), [D.hiddenFields]);
863
+ }, [O.userFilters, U]), [J, _t] = a.useState(() => new Set(O.hiddenFields || [])), vt = a.useMemo(() => JSON.stringify(O.hiddenFields || []), [O.hiddenFields]);
681
864
  a.useEffect(() => {
682
- mt(new Set(D.hiddenFields || []));
683
- }, [ht]);
684
- let gt = a.useCallback((e) => {
685
- mt(e), u?.(Array.from(e));
686
- }, [u]), [_t, vt] = a.useState(!1), [yt, bt] = a.useState(!1), X = a.useMemo(() => i(D.quickFilters), [D.quickFilters]), Z = a.useMemo(() => {
687
- if (D.exportOptions) return Array.isArray(D.exportOptions) ? { formats: D.exportOptions } : D.exportOptions;
688
- }, [D.exportOptions]), Q = Ce(a.useMemo(() => D.densityMode ? D.densityMode : D.rowHeight ? {
865
+ _t(new Set(O.hiddenFields || []));
866
+ }, [vt]);
867
+ let yt = a.useCallback((e) => {
868
+ _t(e), u?.(Array.from(e));
869
+ }, [u]), [bt, xt] = a.useState(!1), [St, Ct] = a.useState(!1), Y = a.useMemo(() => i(O.quickFilters), [O.quickFilters]), X = a.useMemo(() => {
870
+ if (O.exportOptions) return Array.isArray(O.exportOptions) ? { formats: O.exportOptions } : O.exportOptions;
871
+ }, [O.exportOptions]), Z = Te(a.useMemo(() => O.densityMode ? O.densityMode : O.rowHeight ? {
689
872
  compact: "compact",
690
873
  short: "compact",
691
874
  medium: "comfortable",
692
875
  tall: "spacious",
693
876
  extra_tall: "spacious"
694
- }[D.rowHeight] || "comfortable" : "compact", [D.densityMode, D.rowHeight]), { onChange: D.onDensityChange }), { ref: xt, isRefreshing: St, pullDistance: Ct } = Ee({
877
+ }[O.rowHeight] || "comfortable" : "compact", [O.densityMode, O.rowHeight]), { onChange: O.onDensityChange }), wt = a.useMemo(() => `objectui:gallery:density:${O.objectName ?? "default"}`, [O.objectName]), [Q, Tt] = a.useState(() => {
878
+ if (typeof window > "u") return O.gallery?.cardSize ?? "medium";
879
+ try {
880
+ let e = window.localStorage.getItem(wt);
881
+ if (e === "small" || e === "medium" || e === "large") return e;
882
+ } catch {}
883
+ return O.gallery?.cardSize ?? "medium";
884
+ }), Et = a.useCallback(() => {
885
+ Tt((e) => {
886
+ let t = e === "large" ? "medium" : e === "medium" ? "small" : "large";
887
+ try {
888
+ window.localStorage.setItem(wt, t);
889
+ } catch {}
890
+ return t;
891
+ });
892
+ }, [wt]), { ref: Dt, isRefreshing: Ot, pullDistance: kt } = Oe({
695
893
  onRefresh: a.useCallback(async () => {
696
- Je((e) => e + 1);
894
+ Xe((e) => e + 1);
697
895
  }, []),
698
- enabled: !!z && !!D.objectName
699
- }), wt = a.useMemo(() => D.id ? `listview-${D.objectName}-${D.id}-view` : `listview-${D.objectName}-view`, [D.objectName, D.id]);
896
+ enabled: !!B && !!O.objectName
897
+ }), At = a.useMemo(() => O.id ? `listview-${O.objectName}-${O.id}-view` : `listview-${O.objectName}-view`, [O.objectName, O.id]);
700
898
  a.useEffect(() => {
701
899
  let e = !0;
702
- return Ke(!1), We(null), (async () => {
703
- if (!z || !D.objectName) {
704
- Ke(!0);
900
+ return Je(!1), Ge(null), (async () => {
901
+ if (!B || !O.objectName) {
902
+ Je(!0);
705
903
  return;
706
904
  }
707
- if (typeof z.getObjectSchema != "function") {
708
- Ke(!0);
905
+ if (typeof B.getObjectSchema != "function") {
906
+ Je(!0);
709
907
  return;
710
908
  }
711
909
  try {
712
- let t = await z.getObjectSchema(D.objectName);
713
- e && We(t);
910
+ let t = await B.getObjectSchema(O.objectName);
911
+ e && Ge(t);
714
912
  } catch (e) {
715
913
  console.warn("Failed to fetch object schema for ListView:", e);
716
914
  } finally {
717
- e && Ke(!0);
915
+ e && Je(!0);
718
916
  }
719
917
  })(), () => {
720
918
  e = !1;
721
919
  };
722
- }, [D.objectName, z]);
723
- let Tt = a.useMemo(() => {
724
- let e = Array.isArray(D.fields) ? D.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
920
+ }, [O.objectName, B]);
921
+ let jt = a.useMemo(() => {
922
+ let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
725
923
  if (!e) return;
726
924
  let t = [
727
925
  e.groupField,
@@ -745,66 +943,66 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
745
943
  ];
746
944
  for (let e of t) typeof e == "string" && e && n.add(e);
747
945
  };
748
- r(D.kanban), r(D.options?.kanban), r(D.calendar), r(D.options?.calendar), r(D.gallery), r(D.options?.gallery), r(D.timeline), r(D.options?.timeline), r(D.gantt), r(D.options?.gantt);
946
+ r(O.kanban), r(O.options?.kanban), r(O.calendar), r(O.options?.calendar), r(O.gallery), r(O.options?.gallery), r(O.timeline), r(O.options?.timeline), r(O.gantt), r(O.options?.gantt);
749
947
  let i = n.size > 0 ? Array.from(n) : void 0;
750
- return t(W?.fields, i);
948
+ return t(U?.fields, i);
751
949
  }, [
752
- W?.fields,
753
- D.fields,
754
- D.kanban,
755
- D.calendar,
756
- D.gallery,
757
- D.timeline,
758
- D.gantt,
759
- D.options
950
+ U?.fields,
951
+ O.fields,
952
+ O.kanban,
953
+ O.calendar,
954
+ O.gallery,
955
+ O.timeline,
956
+ O.gantt,
957
+ O.options
760
958
  ]);
761
959
  a.useEffect(() => {
762
- let e = !0, t = ++ct.current;
763
- if (D.data && typeof D.data == "object" && !Array.isArray(D.data)) {
764
- let e = D.data;
960
+ let e = !0, t = ++dt.current;
961
+ if (O.data && typeof O.data == "object" && !Array.isArray(O.data)) {
962
+ let e = O.data;
765
963
  if (e.provider === "value" && Array.isArray(e.items)) {
766
964
  let t = e.items;
767
- if (I) {
768
- let e = I.toLowerCase();
965
+ if (N) {
966
+ let e = N.toLowerCase();
769
967
  t = t.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
770
968
  }
771
- V(t), U(!1), Xe(!1);
969
+ H(t), We(!1), Qe(!1);
772
970
  return;
773
971
  }
774
972
  }
775
- if (Array.isArray(D.data)) {
776
- let e = D.data;
777
- if (I) {
778
- let t = I.toLowerCase();
973
+ if (Array.isArray(O.data)) {
974
+ let e = O.data;
975
+ if (N) {
976
+ let t = N.toLowerCase();
779
977
  e = e.filter((e) => Object.values(e).some((e) => e != null && String(e).toLowerCase().includes(t)));
780
978
  }
781
- V(e), U(!1), Xe(!1);
979
+ H(e), We(!1), Qe(!1);
782
980
  return;
783
981
  }
784
- return Ge ? ((async () => {
785
- if (!(!z || !D.objectName)) {
786
- U(!0);
982
+ return W ? ((async () => {
983
+ if (!(!B || !O.objectName)) {
984
+ We(!0);
787
985
  try {
788
- let n = [], r = D.filters || [], i = Ve(R), a = [];
789
- X && lt.size > 0 && X.forEach((e) => {
790
- lt.has(e.id) && e.filters && e.filters.length > 0 && a.push(e.filters);
986
+ let n = [], r = O.filters || [], i = He(z), a = [];
987
+ Y && ft.size > 0 && Y.forEach((e) => {
988
+ ft.has(e.id) && e.filters && e.filters.length > 0 && a.push(e.filters);
791
989
  });
792
- let o = Be(dt), s = [
990
+ let o = Ve(mt), s = [
793
991
  ...r.length > 0 ? [r] : [],
794
992
  ...i.length > 0 ? [i] : [],
795
993
  ...a,
796
994
  ...o
797
995
  ].filter((e) => Array.isArray(e) && e.length > 0);
798
996
  s.length > 1 ? n = ["and", ...s] : s.length === 1 && (n = s[0]);
799
- let c = L.length > 0 ? L.filter((e) => e.field).map((e) => ({
997
+ let c = I.length > 0 ? I.filter((e) => e.field).map((e) => ({
800
998
  field: e.field,
801
999
  order: e.order
802
1000
  })) : void 0, l = (() => {
803
- let e = Array.isArray(D.fields) ? D.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [];
1001
+ let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [];
804
1002
  if (e.length === 0) return;
805
1003
  let t = new Set(["id"]);
806
1004
  for (let n of e) t.add(n);
807
- for (let e of Tt) t.add(e);
1005
+ for (let e of jt) t.add(e);
808
1006
  let n = (e) => {
809
1007
  if (!e) return;
810
1008
  let n = [
@@ -829,55 +1027,55 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
829
1027
  ];
830
1028
  for (let e of n) typeof e == "string" && e && t.add(e);
831
1029
  };
832
- n(D.kanban), n(D.options?.kanban), n(D.calendar), n(D.options?.calendar), n(D.gallery), n(D.options?.gallery), n(D.timeline), n(D.options?.timeline);
1030
+ n(O.kanban), n(O.options?.kanban), n(O.calendar), n(O.options?.calendar), n(O.gallery), n(O.options?.gallery), n(O.timeline), n(O.options?.timeline);
833
1031
  {
834
- let e = D.timeline ?? D.options?.timeline;
1032
+ let e = O.timeline ?? O.options?.timeline;
835
1033
  e && !Array.isArray(e.metaFields) && (t.add("status"), t.add("priority"));
836
1034
  }
837
- return n(D.gantt), n(D.options?.gantt), Array.from(t);
838
- })(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await z.find(D.objectName, {
1035
+ return n(O.gantt), n(O.options?.gantt), Array.from(t);
1036
+ })(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await B.find(O.objectName, {
839
1037
  ...u ? { $filter: n } : {},
840
1038
  $orderby: c,
841
- $top: G,
1039
+ $top: tt,
842
1040
  ...l ? { $select: l } : {},
843
- ...Tt.length > 0 ? { $expand: Tt } : {},
844
- ...I ? {
845
- $search: I,
846
- ...D.searchableFields && D.searchableFields.length > 0 ? { $searchFields: D.searchableFields } : {}
1041
+ ...jt.length > 0 ? { $expand: jt } : {},
1042
+ ...N ? {
1043
+ $search: N,
1044
+ ...O.searchableFields && O.searchableFields.length > 0 ? { $searchFields: O.searchableFields } : {}
847
1045
  } : {}
848
1046
  });
849
- if (!e || t !== ct.current) return;
1047
+ if (!e || t !== dt.current) return;
850
1048
  let f = [];
851
- Array.isArray(d) ? f = d : d && typeof d == "object" && (Array.isArray(d.data) ? f = d.data : Array.isArray(d.records) ? f = d.records : Array.isArray(d.value) && (f = d.value)), V(f), Xe(f.length >= G);
1049
+ Array.isArray(d) ? f = d : d && typeof d == "object" && (Array.isArray(d.data) ? f = d.data : Array.isArray(d.records) ? f = d.records : Array.isArray(d.value) && (f = d.value)), H(f), Qe(f.length >= tt);
852
1050
  } catch (e) {
853
- t === ct.current && console.error("ListView data fetch error:", e);
1051
+ t === dt.current && console.error("ListView data fetch error:", e);
854
1052
  } finally {
855
- e && t === ct.current && U(!1);
1053
+ e && t === dt.current && We(!1);
856
1054
  }
857
1055
  }
858
1056
  })(), () => {
859
1057
  e = !1;
860
1058
  }) : void 0;
861
1059
  }, [
862
- D.objectName,
863
- D.data,
864
- z,
865
- D.filters,
866
- G,
867
- L,
868
- R,
869
- lt,
870
- X,
871
- dt,
872
- qe,
1060
+ O.objectName,
1061
+ O.data,
1062
+ B,
1063
+ O.filters,
1064
+ tt,
873
1065
  I,
874
- D.searchableFields,
875
- Tt,
876
- Ge,
877
- D.refreshTrigger
1066
+ z,
1067
+ ft,
1068
+ Y,
1069
+ mt,
1070
+ Ye,
1071
+ N,
1072
+ O.searchableFields,
1073
+ jt,
1074
+ W,
1075
+ O.refreshTrigger
878
1076
  ]);
879
- let Et = a.useMemo(() => {
880
- if (D.appearance?.allowedVisualizations && D.appearance.allowedVisualizations.length > 0) return D.appearance.allowedVisualizations.filter((e) => [
1077
+ let Mt = a.useMemo(() => {
1078
+ if (O.appearance?.allowedVisualizations && O.appearance.allowedVisualizations.length > 0) return O.appearance.allowedVisualizations.filter((e) => [
881
1079
  "grid",
882
1080
  "kanban",
883
1081
  "gallery",
@@ -887,7 +1085,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
887
1085
  "map"
888
1086
  ].includes(e));
889
1087
  let e = ["grid"];
890
- return (D.kanban?.groupField || D.options?.kanban?.groupField) && e.push("kanban"), (D.gallery?.coverField || D.gallery?.imageField || D.options?.gallery?.imageField) && e.push("gallery"), (D.calendar?.startDateField || D.options?.calendar?.startDateField) && e.push("calendar"), (D.timeline?.startDateField || D.options?.timeline?.startDateField || D.options?.timeline?.dateField || D.options?.calendar?.startDateField) && e.push("timeline"), (D.gantt?.startDateField || D.options?.gantt?.startDateField) && e.push("gantt"), (D.options?.map?.locationField || D.options?.map?.latitudeField && D.options?.map?.longitudeField) && e.push("map"), D.viewType && !e.includes(D.viewType) && [
1088
+ return (O.kanban?.groupField || O.options?.kanban?.groupField) && e.push("kanban"), (O.gallery?.coverField || O.gallery?.imageField || O.options?.gallery?.imageField) && e.push("gallery"), (O.calendar?.startDateField || O.options?.calendar?.startDateField) && e.push("calendar"), (O.timeline?.startDateField || O.options?.timeline?.startDateField || O.options?.timeline?.dateField || O.options?.calendar?.startDateField) && e.push("timeline"), (O.gantt?.startDateField || O.options?.gantt?.startDateField) && e.push("gantt"), (O.options?.map?.locationField || O.options?.map?.latitudeField && O.options?.map?.longitudeField) && e.push("map"), O.viewType && !e.includes(O.viewType) && [
891
1089
  "grid",
892
1090
  "kanban",
893
1091
  "calendar",
@@ -895,42 +1093,45 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
895
1093
  "gantt",
896
1094
  "map",
897
1095
  "gallery"
898
- ].includes(D.viewType) && e.push(D.viewType), e;
1096
+ ].includes(O.viewType) && e.push(O.viewType), e;
899
1097
  }, [
900
- D.options,
901
- D.viewType,
902
- D.kanban,
903
- D.calendar,
904
- D.gantt,
905
- D.gallery,
906
- D.timeline,
907
- D.appearance?.allowedVisualizations
1098
+ O.options,
1099
+ O.viewType,
1100
+ O.kanban,
1101
+ O.calendar,
1102
+ O.gantt,
1103
+ O.gallery,
1104
+ O.timeline,
1105
+ O.appearance?.allowedVisualizations
908
1106
  ]);
909
1107
  a.useEffect(() => {
910
- D.viewType && _e(D.viewType);
911
- }, [D.viewType]);
912
- let Dt = a.useCallback((e) => {
913
- _e(e);
1108
+ O.viewType && pe(O.viewType);
1109
+ }, [O.viewType]);
1110
+ let Nt = a.useCallback((e) => {
1111
+ pe(e);
914
1112
  try {
915
- localStorage.setItem(wt, e);
1113
+ localStorage.setItem(At, e);
916
1114
  } catch (e) {
917
1115
  console.warn("Failed to save view preference to localStorage:", e);
918
1116
  }
919
1117
  o?.(e);
920
- }, [wt, o]), Ot = a.useCallback((e) => {
921
- ve(e), l?.(e);
922
- }, [l]), kt = we({
923
- navigation: D.navigation,
924
- objectName: D.objectName,
925
- onNavigate: D.onNavigate,
1118
+ }, [At, o]), Pt = a.useCallback((e) => {
1119
+ ye(e), l?.(e);
1120
+ }, [l]), Ft = Ee({
1121
+ navigation: O.navigation,
1122
+ objectName: O.objectName,
1123
+ onNavigate: O.onNavigate,
926
1124
  onRowClick: p
927
- }), $ = a.useMemo(() => {
928
- let e = D.fields || [];
929
- if (Array.isArray(e) || (e = []), Y.size > 0 && (e = e.filter((e) => {
1125
+ }), It = ke(), $ = a.useMemo(() => {
1126
+ let e = O.fields || [];
1127
+ if (Array.isArray(e) || (e = []), It?.isLoaded && O.objectName && (e = e.filter((e) => {
930
1128
  let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
931
- return t != null && !Y.has(t);
932
- })), D.fieldOrder && D.fieldOrder.length > 0) {
933
- let t = new Map(D.fieldOrder.map((e, t) => [e, t]));
1129
+ return t ? It.checkField(O.objectName, t, "read") : !0;
1130
+ })), J.size > 0 && (e = e.filter((e) => {
1131
+ let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
1132
+ return t != null && !J.has(t);
1133
+ })), O.fieldOrder && O.fieldOrder.length > 0) {
1134
+ let t = new Map(O.fieldOrder.map((e, t) => [e, t]));
934
1135
  e = [...e].sort((e, n) => {
935
1136
  let r = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field, i = typeof n == "string" ? n : n?.name || n?.fieldName || n?.field;
936
1137
  return (t.get(r) ?? Infinity) - (t.get(i) ?? Infinity);
@@ -938,126 +1139,131 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
938
1139
  }
939
1140
  return e;
940
1141
  }, [
941
- D.fields,
942
- Y,
943
- D.fieldOrder
944
- ]), At = a.useMemo(() => {
945
- let e = Q.mode === "compact" ? "compact" : Q.mode === "spacious" ? "tall" : "medium", t = {
946
- objectName: D.objectName,
1142
+ O.fields,
1143
+ O.objectName,
1144
+ J,
1145
+ O.fieldOrder,
1146
+ It
1147
+ ]), Lt = a.useMemo(() => {
1148
+ let e = Z.mode === "compact" ? "compact" : Z.mode === "spacious" ? "tall" : "medium", t = {
1149
+ objectName: O.objectName,
947
1150
  fields: $,
948
- filters: D.filters,
949
- sort: L,
1151
+ filters: O.filters,
1152
+ sort: I,
950
1153
  className: "h-full w-full",
951
1154
  showSearch: !1,
952
- onRowClick: kt.handleClick,
1155
+ onRowClick: Ft.handleClick,
953
1156
  rowHeight: e,
954
1157
  hideRowHeightToggle: !0,
955
- ...D.striped == null ? {} : { striped: D.striped },
956
- ...D.bordered == null ? {} : { bordered: D.bordered },
1158
+ ...O.striped == null ? {} : { striped: O.striped },
1159
+ ...O.bordered == null ? {} : { bordered: O.bordered },
957
1160
  ...f ? { onColumnStateChange: f } : {},
958
- ...D.columnState ? { columnState: D.columnState } : {}
1161
+ ...O.columnState ? { columnState: O.columnState } : {}
959
1162
  };
960
- switch (j) {
1163
+ switch (M) {
961
1164
  case "grid": return {
962
1165
  type: "object-grid",
963
1166
  ...t,
964
1167
  columns: $,
965
- ...D.conditionalFormatting ? { conditionalFormatting: D.conditionalFormatting } : {},
966
- ...D.inlineEdit == null ? {} : { editable: D.inlineEdit },
967
- ...D.wrapHeaders == null ? {} : { wrapHeaders: D.wrapHeaders },
968
- ...D.virtualScroll == null ? {} : { virtualScroll: D.virtualScroll },
969
- ...D.resizable == null ? {} : { resizable: D.resizable },
970
- ...D.selection ? { selection: D.selection } : {},
971
- ...D.pagination ? { pagination: D.pagination } : {},
972
- ...q ? { grouping: q } : {},
973
- ...J ? { rowColor: J } : {},
974
- ...D.rowActions ? { rowActions: D.rowActions } : {},
975
- ...D.rowActionDefs ? { rowActionDefs: D.rowActionDefs } : {},
976
- ...D.bulkActions ? { batchActions: D.bulkActions } : {},
977
- ...D.options?.grid || {}
1168
+ ...O.conditionalFormatting ? { conditionalFormatting: O.conditionalFormatting } : {},
1169
+ ...O.inlineEdit == null ? {} : { editable: O.inlineEdit },
1170
+ ...O.wrapHeaders == null ? {} : { wrapHeaders: O.wrapHeaders },
1171
+ ...O.virtualScroll == null ? {} : { virtualScroll: O.virtualScroll },
1172
+ ...O.resizable == null ? {} : { resizable: O.resizable },
1173
+ ...O.selection ? { selection: O.selection } : {},
1174
+ ...O.pagination ? { pagination: O.pagination } : {},
1175
+ ...K ? { grouping: K } : {},
1176
+ ...q ? { rowColor: q } : {},
1177
+ ...O.rowActions ? { rowActions: O.rowActions } : {},
1178
+ ...O.rowActionDefs ? { rowActionDefs: O.rowActionDefs } : {},
1179
+ ...O.bulkActions ? { batchActions: O.bulkActions } : {},
1180
+ ...O.bulkActionDefs ? { bulkActionDefs: O.bulkActionDefs } : {},
1181
+ ...O.options?.grid || {}
978
1182
  };
979
1183
  case "kanban": return {
980
1184
  type: "object-kanban",
981
1185
  ...t,
982
- groupBy: D.kanban?.groupField || D.options?.kanban?.groupField || "status",
983
- groupField: D.kanban?.groupField || D.options?.kanban?.groupField || "status",
984
- ...D.kanban?.titleField || D.options?.kanban?.titleField ? { titleField: D.kanban?.titleField || D.options?.kanban?.titleField } : {},
985
- cardFields: D.kanban?.cardFields || $ || [],
986
- ...q ? { grouping: q } : {},
987
- ...D.options?.kanban || {},
988
- ...D.kanban || {}
1186
+ groupBy: O.kanban?.groupField || O.options?.kanban?.groupField || "status",
1187
+ groupField: O.kanban?.groupField || O.options?.kanban?.groupField || "status",
1188
+ ...O.kanban?.titleField || O.options?.kanban?.titleField ? { titleField: O.kanban?.titleField || O.options?.kanban?.titleField } : {},
1189
+ cardFields: O.kanban?.cardFields || $ || [],
1190
+ ...K ? { grouping: K } : {},
1191
+ ...O.options?.kanban || {},
1192
+ ...O.kanban || {}
989
1193
  };
990
1194
  case "calendar": return {
991
1195
  type: "object-calendar",
992
1196
  ...t,
993
- startDateField: D.calendar?.startDateField || D.options?.calendar?.startDateField || "start_date",
994
- endDateField: D.calendar?.endDateField || D.options?.calendar?.endDateField || "end_date",
995
- ...D.calendar?.titleField || D.options?.calendar?.titleField ? { titleField: D.calendar?.titleField || D.options?.calendar?.titleField } : {},
996
- ...D.calendar?.defaultView ? { defaultView: D.calendar.defaultView } : {},
997
- ...D.options?.calendar || {},
998
- ...D.calendar || {}
1197
+ startDateField: O.calendar?.startDateField || O.options?.calendar?.startDateField || "start_date",
1198
+ endDateField: O.calendar?.endDateField || O.options?.calendar?.endDateField || "end_date",
1199
+ ...O.calendar?.titleField || O.options?.calendar?.titleField ? { titleField: O.calendar?.titleField || O.options?.calendar?.titleField } : {},
1200
+ ...O.calendar?.defaultView ? { defaultView: O.calendar.defaultView } : {},
1201
+ ...O.options?.calendar || {},
1202
+ ...O.calendar || {}
999
1203
  };
1000
1204
  case "gallery": {
1001
1205
  let e = {
1002
- ...D.options?.gallery || {},
1003
- ...D.gallery || {}
1206
+ ...O.options?.gallery || {},
1207
+ ...O.gallery || {},
1208
+ cardSize: Q
1004
1209
  };
1005
1210
  return {
1006
1211
  type: "object-gallery",
1007
1212
  ...t,
1008
1213
  gallery: Object.keys(e).length > 0 ? e : void 0,
1009
- imageField: D.gallery?.coverField || D.gallery?.imageField || D.options?.gallery?.imageField,
1010
- titleField: D.gallery?.titleField || D.options?.gallery?.titleField || "name",
1011
- subtitleField: D.gallery?.subtitleField || D.options?.gallery?.subtitleField,
1012
- ...q ? { grouping: q } : {}
1214
+ imageField: O.gallery?.coverField || O.gallery?.imageField || O.options?.gallery?.imageField,
1215
+ titleField: O.gallery?.titleField || O.options?.gallery?.titleField || "name",
1216
+ subtitleField: O.gallery?.subtitleField || O.options?.gallery?.subtitleField,
1217
+ ...K ? { grouping: K } : {}
1013
1218
  };
1014
1219
  }
1015
1220
  case "timeline": {
1016
1221
  let e = {
1017
- ...D.options?.timeline || {},
1018
- ...D.timeline || {}
1222
+ ...O.options?.timeline || {},
1223
+ ...O.timeline || {}
1019
1224
  };
1020
1225
  return {
1021
1226
  type: "object-timeline",
1022
1227
  ...t,
1023
1228
  timeline: Object.keys(e).length > 0 ? e : void 0,
1024
- startDateField: D.timeline?.startDateField || D.options?.timeline?.startDateField || D.options?.timeline?.dateField || "created_at",
1025
- titleField: D.timeline?.titleField || D.options?.timeline?.titleField || "name",
1026
- ...D.timeline?.endDateField ? { endDateField: D.timeline.endDateField } : {},
1027
- ...D.timeline?.groupByField ? { groupByField: D.timeline.groupByField } : {},
1028
- ...D.timeline?.colorField ? { colorField: D.timeline.colorField } : {},
1029
- ...D.timeline?.scale ? { scale: D.timeline.scale } : {}
1229
+ startDateField: O.timeline?.startDateField || O.options?.timeline?.startDateField || O.options?.timeline?.dateField || "created_at",
1230
+ titleField: O.timeline?.titleField || O.options?.timeline?.titleField || "name",
1231
+ ...O.timeline?.endDateField ? { endDateField: O.timeline.endDateField } : {},
1232
+ ...O.timeline?.groupByField ? { groupByField: O.timeline.groupByField } : {},
1233
+ ...O.timeline?.colorField ? { colorField: O.timeline.colorField } : {},
1234
+ ...O.timeline?.scale ? { scale: O.timeline.scale } : {}
1030
1235
  };
1031
1236
  }
1032
1237
  case "gantt": return {
1033
1238
  type: "object-gantt",
1034
1239
  ...t,
1035
- startDateField: D.gantt?.startDateField || D.options?.gantt?.startDateField || "start_date",
1036
- endDateField: D.gantt?.endDateField || D.options?.gantt?.endDateField || "end_date",
1037
- progressField: D.gantt?.progressField || D.options?.gantt?.progressField || "progress",
1038
- dependenciesField: D.gantt?.dependenciesField || D.options?.gantt?.dependenciesField || "dependencies",
1039
- ...D.gantt?.titleField ? { titleField: D.gantt.titleField } : {},
1040
- ...D.options?.gantt || {},
1041
- ...D.gantt || {}
1240
+ startDateField: O.gantt?.startDateField || O.options?.gantt?.startDateField || "start_date",
1241
+ endDateField: O.gantt?.endDateField || O.options?.gantt?.endDateField || "end_date",
1242
+ progressField: O.gantt?.progressField || O.options?.gantt?.progressField || "progress",
1243
+ dependenciesField: O.gantt?.dependenciesField || O.options?.gantt?.dependenciesField || "dependencies",
1244
+ ...O.gantt?.titleField ? { titleField: O.gantt.titleField } : {},
1245
+ ...O.options?.gantt || {},
1246
+ ...O.gantt || {}
1042
1247
  };
1043
1248
  case "map": return {
1044
1249
  type: "object-map",
1045
1250
  ...t,
1046
- locationField: D.options?.map?.locationField || "location",
1047
- ...D.options?.map || {}
1251
+ locationField: O.options?.map?.locationField || "location",
1252
+ ...O.options?.map || {}
1048
1253
  };
1049
1254
  default: return t;
1050
1255
  }
1051
1256
  }, [
1052
- j,
1053
- D,
1054
- L,
1257
+ M,
1258
+ O,
1259
+ I,
1055
1260
  $,
1261
+ K,
1056
1262
  q,
1057
- J,
1058
- kt.handleClick,
1059
- Q.mode
1060
- ]), jt = R.conditions && R.conditions.length > 0, Mt = a.useMemo(() => {
1263
+ Ft.handleClick,
1264
+ Z.mode,
1265
+ Q
1266
+ ]), Rt = z.conditions && z.conditions.length > 0, zt = a.useMemo(() => {
1061
1267
  let e, t = (e, t) => {
1062
1268
  if (!t) return;
1063
1269
  let n = Array.isArray(t) ? t.map((e) => ({
@@ -1069,17 +1275,17 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1069
1275
  label: t?.label || e,
1070
1276
  ...t
1071
1277
  }));
1072
- return D.objectName ? E(D.objectName, e, n) : n;
1278
+ return O.objectName ? D(O.objectName, e, n) : n;
1073
1279
  };
1074
- if (e = W?.fields ? Object.entries(W.fields).map(([e, n]) => ({
1280
+ if (e = U?.fields ? Object.entries(U.fields).map(([e, n]) => ({
1075
1281
  value: e,
1076
- label: O(e, n.label || e),
1282
+ label: k(e, n.label || e),
1077
1283
  type: n.type || "text",
1078
1284
  options: t(e, n.options),
1079
1285
  referenceTo: n.reference_to || n.reference,
1080
1286
  displayField: n.display_field || n.reference_field,
1081
1287
  idField: n.id_field
1082
- })) : (D.fields || []).map((e) => {
1288
+ })) : (O.fields || []).map((e) => {
1083
1289
  if (typeof e == "string") return {
1084
1290
  value: e,
1085
1291
  label: e,
@@ -1088,32 +1294,32 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1088
1294
  let n = e.name || e.fieldName;
1089
1295
  return {
1090
1296
  value: n,
1091
- label: O(n, e.label || e.name),
1297
+ label: k(n, e.label || e.name),
1092
1298
  type: e.type || "text",
1093
1299
  options: t(n, e.options),
1094
1300
  referenceTo: e.reference_to || e.reference,
1095
1301
  displayField: e.display_field || e.reference_field,
1096
1302
  idField: e.id_field
1097
1303
  };
1098
- }), D.filterableFields && D.filterableFields.length > 0) {
1099
- let t = new Set(D.filterableFields);
1304
+ }), O.filterableFields && O.filterableFields.length > 0) {
1305
+ let t = new Set(O.filterableFields);
1100
1306
  e = e.filter((e) => t.has(e.value));
1101
1307
  }
1102
1308
  return e;
1103
1309
  }, [
1104
- W,
1105
- D.fields,
1106
- D.filterableFields,
1107
- D.objectName,
1108
- O,
1109
- E
1110
- ]), Nt = a.useCallback((e) => {
1111
- ut((t) => {
1310
+ U,
1311
+ O.fields,
1312
+ O.filterableFields,
1313
+ O.objectName,
1314
+ k,
1315
+ D
1316
+ ]), Bt = a.useCallback((e) => {
1317
+ pt((t) => {
1112
1318
  let n = new Set(t);
1113
1319
  return n.has(e) ? n.delete(e) : n.add(e), n;
1114
1320
  });
1115
- }, []), Pt = a.useCallback((e) => {
1116
- let t = Z, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || D.objectName || "export", a = n > 0 ? B.slice(0, n) : B;
1321
+ }, []), Vt = a.useCallback((e) => {
1322
+ let t = X, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || O.objectName || "export", a = n > 0 ? V.slice(0, n) : V;
1117
1323
  if (e === "csv") {
1118
1324
  let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1119
1325
  r && t.push(e.join(",")), a.forEach((n) => {
@@ -1128,69 +1334,69 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1128
1334
  let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1129
1335
  n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
1130
1336
  }
1131
- bt(!1);
1337
+ Ct(!1);
1132
1338
  }, [
1133
- B,
1339
+ V,
1134
1340
  $,
1135
- Z,
1136
- D.objectName
1137
- ]), Ft = a.useMemo(() => (D.fields || []).map((e) => {
1341
+ X,
1342
+ O.objectName
1343
+ ]), Ht = a.useMemo(() => (O.fields || []).map((e) => {
1138
1344
  if (typeof e == "string") return {
1139
1345
  name: e,
1140
- label: O(e, e)
1346
+ label: k(e, e)
1141
1347
  };
1142
1348
  let t = e.name || e.fieldName || e.field;
1143
1349
  return {
1144
1350
  name: t,
1145
- label: O(t, e.label || e.name || e.field)
1351
+ label: k(t, e.label || e.name || e.field)
1146
1352
  };
1147
- }), [D.fields, O]);
1353
+ }), [O.fields, k]);
1148
1354
  return /* @__PURE__ */ F("div", {
1149
- ref: xt,
1355
+ ref: Dt,
1150
1356
  className: C("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1151
- ...D.aria?.label ? { "aria-label": D.aria.label } : {},
1152
- ...D.aria?.describedBy ? { "aria-describedby": D.aria.describedBy } : {},
1153
- ...D.aria?.live ? { "aria-live": D.aria.live } : {},
1357
+ ...O.aria?.label ? { "aria-label": O.aria.label } : {},
1358
+ ...O.aria?.describedBy ? { "aria-describedby": O.aria.describedBy } : {},
1359
+ ...O.aria?.live ? { "aria-live": O.aria.live } : {},
1154
1360
  role: "region",
1155
1361
  children: [
1156
- Ct > 0 && /* @__PURE__ */ P("div", {
1362
+ kt > 0 && /* @__PURE__ */ P("div", {
1157
1363
  className: "flex items-center justify-center text-xs text-muted-foreground",
1158
- style: { height: Ct },
1159
- children: T(St ? "list.refreshing" : "list.pullToRefresh")
1364
+ style: { height: kt },
1365
+ children: E(Ot ? "list.refreshing" : "list.pullToRefresh")
1160
1366
  }),
1161
1367
  _ && /* @__PURE__ */ P("div", {
1162
1368
  className: "px-4 py-1 flex items-center bg-background",
1163
- children: /* @__PURE__ */ P(Oe, {
1164
- currentView: j,
1165
- availableViews: Et,
1166
- onViewChange: Dt
1369
+ children: /* @__PURE__ */ P(Ae, {
1370
+ currentView: M,
1371
+ availableViews: Mt,
1372
+ onViewChange: Nt
1167
1373
  })
1168
1374
  }),
1169
- D.description && D.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
1375
+ O.description && O.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
1170
1376
  className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
1171
1377
  "data-testid": "view-description",
1172
- children: typeof D.description == "string" ? D.description : ""
1378
+ children: typeof O.description == "string" ? O.description : ""
1173
1379
  }),
1174
1380
  /* @__PURE__ */ F("div", {
1175
1381
  className: "border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background",
1176
1382
  children: [/* @__PURE__ */ F("div", {
1177
1383
  className: "flex items-center gap-2 overflow-x-auto min-w-0",
1178
1384
  children: [
1179
- D.tabs && D.tabs.length > 0 && /* @__PURE__ */ P(je, {
1180
- tabs: D.tabs,
1181
- activeTab: Ie,
1182
- onTabChange: Re,
1385
+ O.tabs && O.tabs.length > 0 && /* @__PURE__ */ P(Ne, {
1386
+ tabs: O.tabs,
1387
+ activeTab: Le,
1388
+ onTabChange: ze,
1183
1389
  className: "!px-0 !py-0 shrink-0"
1184
1390
  }),
1185
- D.tabs && D.tabs.length > 0 && pt && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
1186
- pt && /* @__PURE__ */ P("div", {
1391
+ O.tabs && O.tabs.length > 0 && gt && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
1392
+ gt && /* @__PURE__ */ P("div", {
1187
1393
  className: "shrink-0 min-w-0",
1188
1394
  "data-testid": "user-filters",
1189
- children: /* @__PURE__ */ P(Pe, {
1190
- config: pt,
1191
- objectDef: W,
1192
- data: B,
1193
- onFilterChange: ft,
1395
+ children: /* @__PURE__ */ P(Ie, {
1396
+ config: gt,
1397
+ objectDef: U,
1398
+ data: V,
1399
+ onFilterChange: ht,
1194
1400
  maxVisible: 3
1195
1401
  })
1196
1402
  })
@@ -1198,24 +1404,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1198
1404
  }), /* @__PURE__ */ F("div", {
1199
1405
  className: "flex items-center gap-0 shrink-0",
1200
1406
  children: [
1201
- A.showHideFields && /* @__PURE__ */ F(y, {
1202
- open: _t,
1203
- onOpenChange: vt,
1407
+ j.showHideFields && !j.compactToolbar && /* @__PURE__ */ F(y, {
1408
+ open: bt,
1409
+ onOpenChange: xt,
1204
1410
  children: [/* @__PURE__ */ P(x, {
1205
1411
  asChild: !0,
1206
1412
  children: /* @__PURE__ */ F(d, {
1207
1413
  variant: "ghost",
1208
1414
  size: "sm",
1209
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Y.size > 0 && "text-primary"),
1415
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J.size > 0 && "text-primary"),
1210
1416
  children: [
1211
- /* @__PURE__ */ P(ae, { className: "h-3.5 w-3.5 mr-1.5" }),
1417
+ /* @__PURE__ */ P(ie, { className: "h-3.5 w-3.5 mr-1.5" }),
1212
1418
  /* @__PURE__ */ P("span", {
1213
1419
  className: "hidden sm:inline",
1214
- children: T("list.hideFields")
1420
+ children: E("list.hideFields")
1215
1421
  }),
1216
- Y.size > 0 && /* @__PURE__ */ P("span", {
1422
+ J.size > 0 && /* @__PURE__ */ P("span", {
1217
1423
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1218
- children: Y.size
1424
+ children: J.size
1219
1425
  })
1220
1426
  ]
1221
1427
  })
@@ -1228,24 +1434,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1228
1434
  className: "flex items-center justify-between border-b pb-2",
1229
1435
  children: [/* @__PURE__ */ P("h4", {
1230
1436
  className: "font-medium text-sm",
1231
- children: T("list.hideFieldsTitle")
1232
- }), Y.size > 0 && /* @__PURE__ */ P(d, {
1437
+ children: E("list.hideFieldsTitle")
1438
+ }), J.size > 0 && /* @__PURE__ */ P(d, {
1233
1439
  variant: "ghost",
1234
1440
  size: "sm",
1235
1441
  className: "h-6 px-2 text-xs",
1236
- onClick: () => gt(/* @__PURE__ */ new Set()),
1237
- children: T("list.showAll")
1442
+ onClick: () => yt(/* @__PURE__ */ new Set()),
1443
+ children: E("list.showAll")
1238
1444
  })]
1239
1445
  }), /* @__PURE__ */ P("div", {
1240
1446
  className: "max-h-60 overflow-y-auto space-y-1",
1241
- children: Ft.map((e) => /* @__PURE__ */ F("label", {
1447
+ children: Ht.map((e) => /* @__PURE__ */ F("label", {
1242
1448
  className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
1243
1449
  children: [/* @__PURE__ */ P("input", {
1244
1450
  type: "checkbox",
1245
- checked: !Y.has(e.name),
1451
+ checked: !J.has(e.name),
1246
1452
  onChange: () => {
1247
- let t = new Set(Y);
1248
- t.has(e.name) ? t.delete(e.name) : t.add(e.name), gt(t);
1453
+ let t = new Set(J);
1454
+ t.has(e.name) ? t.delete(e.name) : t.add(e.name), yt(t);
1249
1455
  },
1250
1456
  className: "rounded border-input"
1251
1457
  }), /* @__PURE__ */ P("span", {
@@ -1257,25 +1463,25 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1257
1463
  })
1258
1464
  })]
1259
1465
  }),
1260
- A.showHideFields && (A.showFilters || A.showSort || A.showGroup) && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1261
- A.showFilters && /* @__PURE__ */ F(y, {
1466
+ j.showHideFields && !j.compactToolbar && (j.showFilters || j.showSort || j.showGroup) && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1467
+ j.showFilters && /* @__PURE__ */ F(y, {
1262
1468
  open: Me,
1263
- onOpenChange: Ne,
1469
+ onOpenChange: R,
1264
1470
  children: [/* @__PURE__ */ P(x, {
1265
1471
  asChild: !0,
1266
1472
  children: /* @__PURE__ */ F(d, {
1267
1473
  variant: "ghost",
1268
1474
  size: "sm",
1269
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", jt && "text-foreground font-medium"),
1475
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Rt && "text-foreground font-medium"),
1270
1476
  children: [
1271
- /* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5 mr-1.5" }),
1477
+ /* @__PURE__ */ P(he, { className: "h-3.5 w-3.5 mr-1.5" }),
1272
1478
  /* @__PURE__ */ P("span", {
1273
1479
  className: "hidden sm:inline",
1274
- children: T("list.filter")
1480
+ children: E("list.filter")
1275
1481
  }),
1276
- jt && /* @__PURE__ */ P("span", {
1482
+ Rt && /* @__PURE__ */ P("span", {
1277
1483
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1278
- children: R.conditions?.length || 0
1484
+ children: z.conditions?.length || 0
1279
1485
  })
1280
1486
  ]
1281
1487
  })
@@ -1288,11 +1494,11 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1288
1494
  className: "flex items-center justify-between border-b pb-2",
1289
1495
  children: /* @__PURE__ */ P("h4", {
1290
1496
  className: "font-medium text-sm",
1291
- children: T("list.filterRecords")
1497
+ children: E("list.filterRecords")
1292
1498
  })
1293
1499
  }), /* @__PURE__ */ P(m, {
1294
- fields: Mt,
1295
- value: R,
1500
+ fields: zt,
1501
+ value: z,
1296
1502
  onChange: (e) => {
1297
1503
  Fe(e), s && s(e);
1298
1504
  }
@@ -1300,24 +1506,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1300
1506
  })
1301
1507
  })]
1302
1508
  }),
1303
- A.showGroup && /* @__PURE__ */ F(y, {
1304
- open: et,
1305
- onOpenChange: tt,
1509
+ j.showGroup && !j.compactToolbar && /* @__PURE__ */ F(y, {
1510
+ open: rt,
1511
+ onOpenChange: it,
1306
1512
  children: [/* @__PURE__ */ P(x, {
1307
1513
  asChild: !0,
1308
1514
  children: /* @__PURE__ */ F(d, {
1309
1515
  variant: "ghost",
1310
1516
  size: "sm",
1311
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q && "text-foreground font-medium"),
1517
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", K && "text-foreground font-medium"),
1312
1518
  children: [
1313
- /* @__PURE__ */ P(oe, { className: "h-3.5 w-3.5 mr-1.5" }),
1519
+ /* @__PURE__ */ P(ae, { className: "h-3.5 w-3.5 mr-1.5" }),
1314
1520
  /* @__PURE__ */ P("span", {
1315
1521
  className: "hidden sm:inline",
1316
- children: T("list.group")
1522
+ children: E("list.group")
1317
1523
  }),
1318
- q && q.fields?.length > 0 && /* @__PURE__ */ P("span", {
1524
+ K && K.fields?.length > 0 && /* @__PURE__ */ P("span", {
1319
1525
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1320
- children: q.fields.length
1526
+ children: K.fields.length
1321
1527
  })
1322
1528
  ]
1323
1529
  })
@@ -1330,53 +1536,53 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1330
1536
  className: "flex items-center justify-between border-b pb-2",
1331
1537
  children: [/* @__PURE__ */ P("h4", {
1332
1538
  className: "font-medium text-sm",
1333
- children: T("list.groupBy")
1334
- }), q && /* @__PURE__ */ P(d, {
1539
+ children: E("list.groupBy")
1540
+ }), K && /* @__PURE__ */ P(d, {
1335
1541
  variant: "ghost",
1336
1542
  size: "sm",
1337
1543
  className: "h-6 px-2 text-xs",
1338
- onClick: () => $e(void 0),
1544
+ onClick: () => nt(void 0),
1339
1545
  "data-testid": "clear-grouping",
1340
- children: T("list.clear")
1546
+ children: E("list.clear")
1341
1547
  })]
1342
1548
  }), /* @__PURE__ */ P("div", {
1343
1549
  "data-testid": "group-field-list",
1344
1550
  children: /* @__PURE__ */ P(h, {
1345
- value: q,
1346
- fieldOptions: Ft.map((e) => ({
1551
+ value: K,
1552
+ fieldOptions: Ht.map((e) => ({
1347
1553
  value: e.name,
1348
1554
  label: e.label || e.name
1349
1555
  })),
1350
1556
  maxLevels: 3,
1351
1557
  labels: {
1352
- addGroup: T("list.addGroup", "Add group field"),
1353
- collapseTitle: T("list.collapsedByDefault", "Collapsed by default"),
1354
- removeTitle: T("list.removeGroup", "Remove")
1558
+ addGroup: E("list.addGroup", "Add group field"),
1559
+ collapseTitle: E("list.collapsedByDefault", "Collapsed by default"),
1560
+ removeTitle: E("list.removeGroup", "Remove")
1355
1561
  },
1356
- onChange: (e) => $e(e)
1562
+ onChange: (e) => nt(e)
1357
1563
  })
1358
1564
  })]
1359
1565
  })
1360
1566
  })]
1361
1567
  }),
1362
- A.showSort && /* @__PURE__ */ F(y, {
1363
- open: Te,
1568
+ j.showSort && /* @__PURE__ */ F(y, {
1569
+ open: we,
1364
1570
  onOpenChange: De,
1365
1571
  children: [/* @__PURE__ */ P(x, {
1366
1572
  asChild: !0,
1367
1573
  children: /* @__PURE__ */ F(d, {
1368
1574
  variant: "ghost",
1369
1575
  size: "sm",
1370
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", L.length > 0 && "text-foreground font-medium"),
1576
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I.length > 0 && "text-foreground font-medium"),
1371
1577
  children: [
1372
- /* @__PURE__ */ P(ee, { className: "h-3.5 w-3.5 mr-1.5" }),
1578
+ /* @__PURE__ */ P(T, { className: "h-3.5 w-3.5 mr-1.5" }),
1373
1579
  /* @__PURE__ */ P("span", {
1374
1580
  className: "hidden sm:inline",
1375
- children: T("list.sort")
1581
+ children: E("list.sort")
1376
1582
  }),
1377
- L.length > 0 && /* @__PURE__ */ P("span", {
1583
+ I.length > 0 && /* @__PURE__ */ P("span", {
1378
1584
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1379
- children: L.length
1585
+ children: I.length
1380
1586
  })
1381
1587
  ]
1382
1588
  })
@@ -1389,31 +1595,31 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1389
1595
  className: "flex items-center justify-between border-b pb-2",
1390
1596
  children: /* @__PURE__ */ P("h4", {
1391
1597
  className: "font-medium text-sm",
1392
- children: T("list.sortRecords")
1598
+ children: E("list.sortRecords")
1393
1599
  })
1394
1600
  }), /* @__PURE__ */ P(S, {
1395
- fields: Mt,
1396
- value: L,
1601
+ fields: zt,
1602
+ value: I,
1397
1603
  onChange: (e) => {
1398
- ke(e), c && c(e);
1604
+ L(e), c && c(e);
1399
1605
  }
1400
1606
  })]
1401
1607
  })
1402
1608
  })]
1403
1609
  }),
1404
- (A.showFilters || A.showSort || A.showGroup) && (A.showColor || A.showDensity) && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1405
- A.showColor && /* @__PURE__ */ F(y, {
1406
- open: it,
1407
- onOpenChange: at,
1610
+ !j.compactToolbar && (j.showFilters || j.showSort || j.showGroup) && (j.showColor || j.showDensity) && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1611
+ j.showColor && !j.compactToolbar && /* @__PURE__ */ F(y, {
1612
+ open: st,
1613
+ onOpenChange: ct,
1408
1614
  children: [/* @__PURE__ */ P(x, {
1409
1615
  asChild: !0,
1410
1616
  children: /* @__PURE__ */ F(d, {
1411
1617
  variant: "ghost",
1412
1618
  size: "sm",
1413
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J && "text-foreground font-medium"),
1414
- children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1619
+ className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q && "text-foreground font-medium"),
1620
+ children: [/* @__PURE__ */ P(oe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1415
1621
  className: "hidden sm:inline",
1416
- children: T("list.color")
1622
+ children: E("list.color")
1417
1623
  })]
1418
1624
  })
1419
1625
  }), /* @__PURE__ */ P(b, {
@@ -1425,36 +1631,36 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1425
1631
  className: "flex items-center justify-between border-b pb-2",
1426
1632
  children: [/* @__PURE__ */ P("h4", {
1427
1633
  className: "font-medium text-sm",
1428
- children: T("list.rowColor")
1429
- }), J && /* @__PURE__ */ P(d, {
1634
+ children: E("list.rowColor")
1635
+ }), q && /* @__PURE__ */ P(d, {
1430
1636
  variant: "ghost",
1431
1637
  size: "sm",
1432
1638
  className: "h-6 px-2 text-xs",
1433
- onClick: () => rt(void 0),
1639
+ onClick: () => ot(void 0),
1434
1640
  "data-testid": "clear-row-color",
1435
- children: T("list.clear")
1641
+ children: E("list.clear")
1436
1642
  })]
1437
1643
  }), /* @__PURE__ */ F("div", {
1438
1644
  className: "space-y-2",
1439
1645
  "data-testid": "color-field-list",
1440
1646
  children: [/* @__PURE__ */ P("label", {
1441
1647
  className: "text-xs text-muted-foreground",
1442
- children: T("list.colorByField")
1648
+ children: E("list.colorByField")
1443
1649
  }), /* @__PURE__ */ F("select", {
1444
1650
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
1445
- value: J?.field || "",
1651
+ value: q?.field || "",
1446
1652
  onChange: (e) => {
1447
1653
  let t = e.target.value;
1448
- rt(t ? {
1654
+ ot(t ? {
1449
1655
  field: t,
1450
- colors: J?.colors || {}
1656
+ colors: q?.colors || {}
1451
1657
  } : void 0);
1452
1658
  },
1453
1659
  "data-testid": "color-field-select",
1454
1660
  children: [/* @__PURE__ */ P("option", {
1455
1661
  value: "",
1456
- children: T("list.none")
1457
- }), Ft.map((e) => /* @__PURE__ */ P("option", {
1662
+ children: E("list.none")
1663
+ }), Ht.map((e) => /* @__PURE__ */ P("option", {
1458
1664
  value: e.name,
1459
1665
  children: e.label
1460
1666
  }, e.name))]
@@ -1463,31 +1669,64 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1463
1669
  })
1464
1670
  })]
1465
1671
  }),
1466
- A.showDensity && (() => {
1467
- let e = Q.mode === "compact" ? ue : Q.mode === "comfortable" ? le : ce;
1672
+ j.showDensity && !j.compactToolbar && M !== "gallery" && (() => {
1673
+ let e = Z.mode === "compact" ? de : Z.mode === "comfortable" ? ue : le, t = Z.mode === "compact" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Z.mode === "comfortable" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
1674
+ defaultValue: "{{label}} (click to cycle)",
1675
+ label: n
1676
+ });
1468
1677
  return /* @__PURE__ */ P(d, {
1469
1678
  variant: "ghost",
1470
1679
  size: "sm",
1471
- "aria-label": `Density: ${Q.mode}`,
1472
- className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Q.mode !== "compact" && "text-foreground font-medium"),
1473
- onClick: Q.cycle,
1474
- title: `Density: ${Q.mode} (click to cycle)`,
1680
+ "aria-label": n,
1681
+ className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Z.mode !== "compact" && "text-foreground font-medium"),
1682
+ onClick: Z.cycle,
1683
+ title: r,
1475
1684
  children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
1476
1685
  });
1477
1686
  })(),
1478
- (A.showColor || A.showDensity) && Z && D.allowExport !== !1 && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1479
- Z && D.allowExport !== !1 && /* @__PURE__ */ F(y, {
1480
- open: yt,
1481
- onOpenChange: bt,
1687
+ j.showDensity && !j.compactToolbar && M === "gallery" && (() => {
1688
+ let e = Q === "small" ? de : Q === "medium" ? ue : le, t = Q === "small" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Q === "medium" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
1689
+ defaultValue: "{{label}} (click to cycle)",
1690
+ label: n
1691
+ });
1692
+ return /* @__PURE__ */ P(d, {
1693
+ variant: "ghost",
1694
+ size: "sm",
1695
+ "aria-label": n,
1696
+ className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Q !== "small" && "text-foreground font-medium"),
1697
+ onClick: Et,
1698
+ title: r,
1699
+ children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
1700
+ });
1701
+ })(),
1702
+ j.compactToolbar && (j.showGroup || j.showColor || j.showDensity || j.showHideFields) && /* @__PURE__ */ P(Pe, {
1703
+ t: E,
1704
+ allFields: Ht,
1705
+ showGroup: j.showGroup,
1706
+ groupingConfig: K,
1707
+ setGroupingConfig: nt,
1708
+ showColor: j.showColor,
1709
+ rowColorConfig: q,
1710
+ setRowColorConfig: ot,
1711
+ showDensity: j.showDensity,
1712
+ density: Z,
1713
+ showHideFields: j.showHideFields,
1714
+ hiddenFields: J,
1715
+ updateHiddenFields: yt
1716
+ }),
1717
+ (j.showColor || j.showDensity || j.compactToolbar) && X && O.allowExport !== !1 && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1718
+ X && O.allowExport !== !1 && /* @__PURE__ */ F(y, {
1719
+ open: St,
1720
+ onOpenChange: Ct,
1482
1721
  children: [/* @__PURE__ */ P(x, {
1483
1722
  asChild: !0,
1484
1723
  children: /* @__PURE__ */ F(d, {
1485
1724
  variant: "ghost",
1486
1725
  size: "sm",
1487
1726
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1488
- children: [/* @__PURE__ */ P(ie, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1727
+ children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1489
1728
  className: "hidden sm:inline",
1490
- children: T("list.export")
1729
+ children: E("list.export")
1491
1730
  })]
1492
1731
  })
1493
1732
  }), /* @__PURE__ */ P(b, {
@@ -1495,54 +1734,54 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1495
1734
  className: "w-48 p-2",
1496
1735
  children: /* @__PURE__ */ P("div", {
1497
1736
  className: "space-y-1",
1498
- children: (Z.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
1737
+ children: (X.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
1499
1738
  variant: "ghost",
1500
1739
  size: "sm",
1501
1740
  className: "w-full justify-start h-8 text-xs",
1502
- onClick: () => Pt(e),
1503
- children: [/* @__PURE__ */ P(ie, { className: "h-3.5 w-3.5 mr-2" }), T("list.exportAs", { format: e.toUpperCase() })]
1741
+ onClick: () => Vt(e),
1742
+ children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-2" }), E("list.exportAs", { format: e.toUpperCase() })]
1504
1743
  }, e))
1505
1744
  })
1506
1745
  })]
1507
1746
  }),
1508
- (D.sharing?.enabled || D.sharing?.type) && /* @__PURE__ */ F(d, {
1747
+ (O.sharing?.enabled || O.sharing?.type) && /* @__PURE__ */ F(d, {
1509
1748
  variant: "ghost",
1510
1749
  size: "sm",
1511
1750
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1512
- title: `Sharing: ${D.sharing?.visibility || D.sharing?.type || "private"}`,
1751
+ title: `Sharing: ${O.sharing?.visibility || O.sharing?.type || "private"}`,
1513
1752
  "data-testid": "share-button",
1514
- children: [/* @__PURE__ */ P(fe, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1753
+ children: [/* @__PURE__ */ P(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1515
1754
  className: "hidden sm:inline",
1516
- children: T("list.share")
1755
+ children: E("list.share")
1517
1756
  })]
1518
1757
  }),
1519
- D.allowPrinting && /* @__PURE__ */ F(d, {
1758
+ O.allowPrinting && /* @__PURE__ */ F(d, {
1520
1759
  variant: "ghost",
1521
1760
  size: "sm",
1522
1761
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1523
1762
  onClick: () => window.print(),
1524
1763
  "data-testid": "print-button",
1525
- children: [/* @__PURE__ */ P(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1764
+ children: [/* @__PURE__ */ P(ce, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1526
1765
  className: "hidden sm:inline",
1527
- children: T("list.print")
1766
+ children: E("list.print")
1528
1767
  })]
1529
1768
  }),
1530
1769
  (() => {
1531
- let e = D.allowPrinting || D.sharing?.enabled || D.sharing?.type || Z && D.allowExport !== !1;
1532
- return A.showSearch && e ? /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }) : null;
1770
+ let e = O.allowPrinting || O.sharing?.enabled || O.sharing?.type || X && O.allowExport !== !1;
1771
+ return j.showSearch && e ? /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }) : null;
1533
1772
  })(),
1534
- A.showSearch && /* @__PURE__ */ F(y, {
1535
- open: xe,
1536
- onOpenChange: Se,
1773
+ j.showSearch && /* @__PURE__ */ F(y, {
1774
+ open: be,
1775
+ onOpenChange: Ce,
1537
1776
  children: [/* @__PURE__ */ P(x, {
1538
1777
  asChild: !0,
1539
1778
  children: /* @__PURE__ */ P(d, {
1540
1779
  variant: "ghost",
1541
1780
  size: "sm",
1542
- className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I && "text-foreground font-medium"),
1781
+ className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", N && "text-foreground font-medium"),
1543
1782
  "data-testid": "search-icon-button",
1544
- title: T("list.search"),
1545
- children: /* @__PURE__ */ P(de, { className: "h-3.5 w-3.5" })
1783
+ title: E("list.search"),
1784
+ children: /* @__PURE__ */ P(fe, { className: "h-3.5 w-3.5" })
1546
1785
  })
1547
1786
  }), /* @__PURE__ */ P(b, {
1548
1787
  align: "end",
@@ -1551,89 +1790,89 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1551
1790
  children: /* @__PURE__ */ F("div", {
1552
1791
  className: "relative",
1553
1792
  children: [
1554
- /* @__PURE__ */ P(de, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1793
+ /* @__PURE__ */ P(fe, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
1555
1794
  /* @__PURE__ */ P(g, {
1556
- placeholder: T("list.search") + "...",
1557
- value: I,
1558
- onChange: (e) => Ot(e.target.value),
1795
+ placeholder: E("list.search") + "...",
1796
+ value: N,
1797
+ onChange: (e) => Pt(e.target.value),
1559
1798
  className: "pl-7 h-8 text-xs",
1560
1799
  autoFocus: !0
1561
1800
  }),
1562
- I && /* @__PURE__ */ P(d, {
1801
+ N && /* @__PURE__ */ P(d, {
1563
1802
  variant: "ghost",
1564
1803
  size: "sm",
1565
1804
  className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20",
1566
- onClick: () => Ot(""),
1567
- children: /* @__PURE__ */ P(he, { className: "h-3 w-3" })
1805
+ onClick: () => Pt(""),
1806
+ children: /* @__PURE__ */ P(_e, { className: "h-3 w-3" })
1568
1807
  })
1569
1808
  ]
1570
1809
  })
1571
1810
  })]
1572
1811
  }),
1573
- A.showAddRecord && A.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
1812
+ j.showAddRecord && j.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
1574
1813
  variant: "ghost",
1575
1814
  size: "sm",
1576
1815
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1577
1816
  "data-testid": "add-record-button",
1578
1817
  onClick: () => w.onAddRecord?.(),
1579
- children: [/* @__PURE__ */ P(N, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1818
+ children: [/* @__PURE__ */ P(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1580
1819
  className: "hidden sm:inline",
1581
- children: T("list.addRecord")
1820
+ children: E("list.addRecord")
1582
1821
  })]
1583
1822
  })
1584
1823
  ]
1585
1824
  })]
1586
1825
  }),
1587
- X && X.length > 0 && /* @__PURE__ */ P("div", {
1826
+ Y && Y.length > 0 && /* @__PURE__ */ P("div", {
1588
1827
  className: "border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background",
1589
1828
  "data-testid": "quick-filters",
1590
- children: X.map((e) => {
1591
- let t = lt.has(e.id), n = e.icon ? ge[e.icon.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
1829
+ children: Y.map((e) => {
1830
+ let t = ft.has(e.id), n = e.icon ? ve[e.icon.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
1592
1831
  return /* @__PURE__ */ F(d, {
1593
1832
  variant: t ? "default" : "outline",
1594
1833
  size: "sm",
1595
1834
  className: "h-7 px-3 text-xs",
1596
- onClick: () => Nt(e.id),
1835
+ onClick: () => Bt(e.id),
1597
1836
  children: [n && /* @__PURE__ */ P(n, { className: "h-3 w-3 mr-1.5" }), e.label]
1598
1837
  }, e.id);
1599
1838
  })
1600
1839
  }),
1601
1840
  /* @__PURE__ */ P("div", {
1602
1841
  className: "flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200",
1603
- children: !H && B.length === 0 && (j === "grid" || j === "list") ? (() => {
1604
- let e = D.emptyState?.icon;
1842
+ children: !Ue && V.length === 0 && (M === "grid" || M === "list") ? (() => {
1843
+ let e = O.emptyState?.icon;
1605
1844
  return /* @__PURE__ */ F("div", {
1606
1845
  className: "flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8",
1607
1846
  "data-testid": "empty-state",
1608
1847
  children: [
1609
- /* @__PURE__ */ P(e ? ge[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? k : k, { className: "h-12 w-12 text-muted-foreground/50 mb-4" }),
1848
+ /* @__PURE__ */ P(e ? ve[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? A : A, { className: "h-12 w-12 text-muted-foreground/50 mb-4" }),
1610
1849
  /* @__PURE__ */ P("h3", {
1611
1850
  className: "text-lg font-medium text-foreground mb-1",
1612
- children: (typeof D.emptyState?.title == "string" ? D.emptyState.title : void 0) ?? T("list.noItems")
1851
+ children: (typeof O.emptyState?.title == "string" ? O.emptyState.title : void 0) ?? E("list.noItems")
1613
1852
  }),
1614
1853
  /* @__PURE__ */ P("p", {
1615
1854
  className: "text-sm text-muted-foreground max-w-md",
1616
- children: (typeof D.emptyState?.message == "string" ? D.emptyState.message : void 0) ?? T("list.noItemsMessage")
1855
+ children: (typeof O.emptyState?.message == "string" ? O.emptyState.message : void 0) ?? E("list.noItemsMessage")
1617
1856
  }),
1618
- A.showAddRecord && /* @__PURE__ */ F(d, {
1857
+ j.showAddRecord && /* @__PURE__ */ F(d, {
1619
1858
  variant: "default",
1620
1859
  size: "sm",
1621
1860
  className: "mt-4",
1622
1861
  "data-testid": "empty-state-add-record",
1623
1862
  onClick: () => w.onAddRecord?.(),
1624
- children: [/* @__PURE__ */ P(N, { className: "h-4 w-4 mr-1.5" }), T("list.addRecord")]
1863
+ children: [/* @__PURE__ */ P(se, { className: "h-4 w-4 mr-1.5" }), E("list.addRecord")]
1625
1864
  })
1626
1865
  ]
1627
1866
  });
1628
- })() : /* @__PURE__ */ P(be, {
1629
- schema: At,
1867
+ })() : /* @__PURE__ */ P(Se, {
1868
+ schema: Lt,
1630
1869
  ...w,
1631
- data: B,
1632
- loading: H,
1633
- onRowSelect: st
1870
+ data: V,
1871
+ loading: Ue,
1872
+ onRowSelect: ut
1634
1873
  })
1635
- }, j),
1636
- A.showAddRecord && A.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
1874
+ }, M),
1875
+ j.showAddRecord && j.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
1637
1876
  className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
1638
1877
  children: /* @__PURE__ */ F(d, {
1639
1878
  variant: "ghost",
@@ -1641,39 +1880,39 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1641
1880
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1642
1881
  "data-testid": "add-record-button",
1643
1882
  onClick: () => w.onAddRecord?.(),
1644
- children: [/* @__PURE__ */ P(N, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1883
+ children: [/* @__PURE__ */ P(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
1645
1884
  className: "hidden sm:inline",
1646
- children: T("list.addRecord")
1885
+ children: E("list.addRecord")
1647
1886
  })]
1648
1887
  })
1649
1888
  }),
1650
- D.bulkActions && D.bulkActions.length > 0 && ot.length > 0 && j !== "grid" && /* @__PURE__ */ F("div", {
1889
+ O.bulkActions && O.bulkActions.length > 0 && lt.length > 0 && M !== "grid" && /* @__PURE__ */ F("div", {
1651
1890
  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",
1652
1891
  role: "region",
1653
1892
  "aria-label": "Bulk actions",
1654
1893
  "data-testid": "bulk-actions-bar",
1655
1894
  children: [
1656
- /* @__PURE__ */ P(ne, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
1895
+ /* @__PURE__ */ P(te, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
1657
1896
  /* @__PURE__ */ F("span", {
1658
1897
  className: "font-medium",
1659
1898
  children: [
1660
- ot.length,
1899
+ lt.length,
1661
1900
  " ",
1662
- ot.length === 1 ? "item" : "items",
1901
+ lt.length === 1 ? "item" : "items",
1663
1902
  " selected"
1664
1903
  ]
1665
1904
  }),
1666
1905
  /* @__PURE__ */ P("div", {
1667
1906
  className: "flex items-center gap-1.5 ml-3",
1668
- children: D.bulkActions.map((e) => {
1669
- let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? me : null;
1907
+ children: O.bulkActions.map((e) => {
1908
+ let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? ge : null;
1670
1909
  return /* @__PURE__ */ F(d, {
1671
1910
  variant: n ? "destructive" : "outline",
1672
1911
  size: "sm",
1673
1912
  className: "h-7 px-2.5 text-xs gap-1.5",
1674
- onClick: () => w.onBulkAction?.(e, ot),
1913
+ onClick: () => w.onBulkAction?.(e, lt),
1675
1914
  "data-testid": `bulk-action-${e}`,
1676
- children: [r && /* @__PURE__ */ P(r, { className: "h-3 w-3" }), ze(e)]
1915
+ children: [r && /* @__PURE__ */ P(r, { className: "h-3 w-3" }), Be(e)]
1677
1916
  }, e);
1678
1917
  })
1679
1918
  }),
@@ -1681,35 +1920,35 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1681
1920
  variant: "ghost",
1682
1921
  size: "sm",
1683
1922
  className: "h-7 px-2 text-xs ml-auto gap-1",
1684
- onClick: () => st([]),
1685
- children: [/* @__PURE__ */ P(he, { className: "h-3 w-3" }), "Clear"]
1923
+ onClick: () => ut([]),
1924
+ children: [/* @__PURE__ */ P(_e, { className: "h-3 w-3" }), "Clear"]
1686
1925
  })
1687
1926
  ]
1688
1927
  }),
1689
- !H && B.length > 0 && D.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
1928
+ !Ue && V.length > 0 && O.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
1690
1929
  className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
1691
1930
  "data-testid": "record-count-bar",
1692
1931
  children: [
1693
1932
  /* @__PURE__ */ P("span", {
1694
1933
  className: "font-medium text-foreground/80",
1695
- children: B.length === 1 ? T("list.recordCountOne", { count: B.length }) : T("list.recordCount", { count: B.length })
1934
+ children: V.length === 1 ? E("list.recordCountOne", { count: V.length }) : E("list.recordCount", { count: V.length })
1696
1935
  }),
1697
- Ye && /* @__PURE__ */ P("span", {
1936
+ Ze && /* @__PURE__ */ P("span", {
1698
1937
  className: "text-amber-600",
1699
1938
  "data-testid": "data-limit-warning",
1700
- children: T("list.dataLimitReached", { limit: G })
1939
+ children: E("list.dataLimitReached", { limit: tt })
1701
1940
  }),
1702
- D.pagination?.pageSizeOptions && D.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
1941
+ O.pagination?.pageSizeOptions && O.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
1703
1942
  className: "ml-auto flex items-center gap-2",
1704
- children: [/* @__PURE__ */ P("span", { children: T("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ P("select", {
1943
+ children: [/* @__PURE__ */ P("span", { children: E("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ P("select", {
1705
1944
  "data-testid": "page-size-selector",
1706
1945
  className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
1707
- value: String(G),
1946
+ value: String(tt),
1708
1947
  onChange: (e) => {
1709
1948
  let t = Number(e.target.value);
1710
- Qe(t), w.onPageSizeChange && w.onPageSizeChange(t);
1949
+ et(t), w.onPageSizeChange && w.onPageSizeChange(t);
1711
1950
  },
1712
- children: D.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
1951
+ children: O.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
1713
1952
  value: String(e),
1714
1953
  children: e
1715
1954
  }, e))
@@ -1717,9 +1956,9 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1717
1956
  })
1718
1957
  ]
1719
1958
  }),
1720
- kt.isOverlay && /* @__PURE__ */ P(v, {
1721
- ...kt,
1722
- title: D.label ? `${D.label} Detail` : D.objectName ? `${D.objectName.charAt(0).toUpperCase() + D.objectName.slice(1)} Detail` : "Record Detail",
1959
+ Ft.isOverlay && /* @__PURE__ */ P(v, {
1960
+ ...Ft,
1961
+ title: O.label ? `${O.label} Detail` : O.objectName ? `${O.objectName.charAt(0).toUpperCase() + O.objectName.slice(1)} Detail` : "Record Detail",
1723
1962
  children: (e) => /* @__PURE__ */ P("div", {
1724
1963
  className: "space-y-3",
1725
1964
  children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
@@ -1737,23 +1976,23 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1737
1976
  ]
1738
1977
  });
1739
1978
  });
1740
- H.displayName = "ListView";
1979
+ W.displayName = "ListView";
1741
1980
  //#endregion
1742
1981
  //#region src/ObjectGallery.tsx
1743
- var U = {
1982
+ var Je = {
1744
1983
  small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
1745
1984
  medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
1746
1985
  large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
1747
- }, W = {
1986
+ }, Ye = {
1748
1987
  small: "aspect-square",
1749
1988
  medium: "aspect-[4/3]",
1750
1989
  large: "aspect-[16/10]"
1751
- }, We = (e) => {
1752
- let { schema: n } = e, r = s(xe), i = e.dataSource || r?.dataSource, a = Se(n.bind), [d, m] = u([]), [h, g] = u(!1), [_, y] = u(null), b = we({
1990
+ }, Xe = (e) => {
1991
+ let { schema: n } = e, r = s(Ce), i = e.dataSource || r?.dataSource, a = we(n.bind), [d, m] = u([]), [h, g] = u(!1), [_, y] = u(null), b = Ee({
1753
1992
  navigation: n.navigation,
1754
1993
  objectName: n.objectName,
1755
1994
  onRowClick: e.onRowClick ?? e.onCardClick
1756
- }), x = n.gallery, S = x?.coverField ?? n.imageField ?? "image", w = x?.coverFit ?? "cover", ee = x?.cardSize ?? "medium", te = x?.titleField ?? n.titleField ?? "name", ne = x?.visibleFields, { fieldOptionLabel: ie } = Te(), ae = o((e, t) => {
1995
+ }), x = n.gallery, S = x?.coverField ?? n.imageField ?? "image", w = x?.coverFit ?? "cover", T = x?.cardSize ?? "medium", ee = x?.titleField ?? n.titleField ?? "name", te = x?.visibleFields, { fieldOptionLabel: re } = De(), ie = o((e, t) => {
1757
1996
  if (t == null || t === "") return "";
1758
1997
  if (typeof t == "object") return t.label ?? t.name ?? t.id ?? JSON.stringify(t);
1759
1998
  let r = _?.fields?.[e], i = r?.type;
@@ -1766,7 +2005,7 @@ var U = {
1766
2005
  let e = r.options[String(t)];
1767
2006
  e && (i = e.label ?? i);
1768
2007
  }
1769
- return ie(n.objectName, e, String(t), i);
2008
+ return re(n.objectName, e, String(t), i);
1770
2009
  }
1771
2010
  let a = typeof t == "number" ? t : Number(t);
1772
2011
  if (Number.isFinite(a)) {
@@ -1792,7 +2031,7 @@ var U = {
1792
2031
  }, [
1793
2032
  _,
1794
2033
  n.objectName,
1795
- ie
2034
+ re
1796
2035
  ]);
1797
2036
  c(() => {
1798
2037
  let e = !0;
@@ -1844,18 +2083,18 @@ var U = {
1844
2083
  e.data,
1845
2084
  _
1846
2085
  ]);
1847
- let E = e.data || a || n.data || d || [], D = l(() => E.some((e) => typeof e[S] == "string" && !!e[S]), [E, S]), oe = !!x?.coverField || D, O = n.grouping?.fields, k = !!(O && O.length > 0), [A, j] = u({}), M = l(() => O ? O.some((e) => e.collapsed) : !1, [O]), N = o((e) => {
1848
- j((t) => ({
2086
+ let D = e.data || a || n.data || d || [], O = l(() => D.some((e) => typeof e[S] == "string" && !!e[S]), [D, S]), ae = !!x?.coverField || O, k = n.grouping?.fields, A = !!(k && k.length > 0), [j, M] = u({}), oe = l(() => k ? k.some((e) => e.collapsed) : !1, [k]), se = o((e) => {
2087
+ M((t) => ({
1849
2088
  ...t,
1850
- [e]: t[e] === void 0 ? !M : !t[e]
2089
+ [e]: t[e] === void 0 ? !oe : !t[e]
1851
2090
  }));
1852
- }, [M]), se = l(() => {
1853
- if (!k || !O) return [];
2091
+ }, [oe]), ce = l(() => {
2092
+ if (!A || !k) return [];
1854
2093
  let e = /* @__PURE__ */ new Map(), t = [];
1855
- for (let n of E) {
1856
- let r = O.map((e) => String(n[e.field] ?? "")).join(" / ");
2094
+ for (let n of D) {
2095
+ let r = k.map((e) => String(n[e.field] ?? "")).join(" / ");
1857
2096
  if (!e.has(r)) {
1858
- let i = O.map((e) => {
2097
+ let i = k.map((e) => {
1859
2098
  let t = n[e.field];
1860
2099
  return t != null && t !== "" ? String(t) : "(empty)";
1861
2100
  }).join(" / ");
@@ -1866,7 +2105,7 @@ var U = {
1866
2105
  }
1867
2106
  e.get(r).items.push(n);
1868
2107
  }
1869
- let n = O[0]?.order ?? "asc";
2108
+ let n = k[0]?.order ?? "asc";
1870
2109
  return t.sort((e, t) => {
1871
2110
  let r = e.localeCompare(t, void 0, {
1872
2111
  numeric: !0,
@@ -1874,7 +2113,7 @@ var U = {
1874
2113
  });
1875
2114
  return n === "desc" ? -r : r;
1876
2115
  }), t.map((t) => {
1877
- let n = e.get(t), r = t in A ? A[t] : M;
2116
+ let n = e.get(t), r = t in j ? j[t] : oe;
1878
2117
  return {
1879
2118
  key: t,
1880
2119
  label: n.label,
@@ -1883,29 +2122,29 @@ var U = {
1883
2122
  };
1884
2123
  });
1885
2124
  }, [
1886
- E,
1887
- O,
2125
+ D,
1888
2126
  k,
1889
2127
  A,
1890
- M
2128
+ j,
2129
+ oe
1891
2130
  ]);
1892
- if (h && !E.length) return /* @__PURE__ */ P("div", {
2131
+ if (h && !D.length) return /* @__PURE__ */ P("div", {
1893
2132
  className: "p-4 text-sm text-muted-foreground",
1894
2133
  children: "Loading Gallery..."
1895
2134
  });
1896
- if (!E.length) return /* @__PURE__ */ P("div", {
2135
+ if (!D.length) return /* @__PURE__ */ P("div", {
1897
2136
  className: "p-4 text-sm text-muted-foreground",
1898
2137
  children: "No items to display"
1899
2138
  });
1900
- let ce = (t, r) => {
1901
- let i = t.id ?? t._id ?? r, a = String(t[te] ?? "Untitled"), o = t[S];
2139
+ let le = (t, r) => {
2140
+ let i = t.id ?? t._id ?? r, a = String(t[ee] ?? "Untitled"), o = t[S];
1902
2141
  return /* @__PURE__ */ F(f, {
1903
2142
  role: "listitem",
1904
2143
  className: C("group overflow-hidden transition-all hover:shadow-md", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer"),
1905
2144
  onClick: () => b.handleClick(t),
1906
2145
  children: [/* @__PURE__ */ P("div", {
1907
- className: C("w-full overflow-hidden bg-muted relative", W[ee]),
1908
- hidden: !oe,
2146
+ className: C("w-full overflow-hidden bg-muted relative", Ye[T]),
2147
+ hidden: !ae,
1909
2148
  children: o ? /* @__PURE__ */ P("img", {
1910
2149
  src: o,
1911
2150
  alt: a,
@@ -1918,47 +2157,47 @@ var U = {
1918
2157
  })
1919
2158
  })
1920
2159
  }), /* @__PURE__ */ F(p, {
1921
- className: C("p-3", oe && "border-t"),
2160
+ className: C("p-3", ae && "border-t"),
1922
2161
  children: [/* @__PURE__ */ P("h3", {
1923
2162
  className: "font-medium truncate text-sm",
1924
2163
  title: a,
1925
2164
  children: a
1926
- }), ne && ne.length > 0 && /* @__PURE__ */ P("div", {
2165
+ }), te && te.length > 0 && /* @__PURE__ */ P("div", {
1927
2166
  className: "mt-1 space-y-0.5",
1928
- children: ne.map((e) => {
2167
+ children: te.map((e) => {
1929
2168
  let n = t[e];
1930
2169
  return n == null || n === "" ? null : /* @__PURE__ */ P("p", {
1931
2170
  className: "text-xs text-muted-foreground truncate",
1932
- children: ae(e, n)
2171
+ children: ie(e, n)
1933
2172
  }, e);
1934
2173
  })
1935
2174
  })]
1936
2175
  })]
1937
2176
  }, i);
1938
- }, le = (e) => /* @__PURE__ */ P("div", {
1939
- className: C("grid gap-4 p-4 auto-rows-min content-start", U[ee], n.className),
2177
+ }, ue = (e) => /* @__PURE__ */ P("div", {
2178
+ className: C("grid gap-4 p-4 auto-rows-min content-start", Je[T], n.className),
1940
2179
  role: "list",
1941
- children: e.map((e, t) => ce(e, t))
2180
+ children: e.map((e, t) => le(e, t))
1942
2181
  });
1943
- return /* @__PURE__ */ F(_e, { children: [k ? /* @__PURE__ */ P("div", {
2182
+ return /* @__PURE__ */ F(N, { children: [A ? /* @__PURE__ */ P("div", {
1944
2183
  className: "space-y-2",
1945
- children: se.map((e) => /* @__PURE__ */ F("div", {
2184
+ children: ce.map((e) => /* @__PURE__ */ F("div", {
1946
2185
  className: "border rounded-md",
1947
2186
  children: [/* @__PURE__ */ F("button", {
1948
2187
  type: "button",
1949
2188
  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",
1950
- onClick: () => N(e.key),
2189
+ onClick: () => se(e.key),
1951
2190
  children: [
1952
- e.collapsed ? /* @__PURE__ */ P(re, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ P(T, { className: "h-4 w-4 shrink-0" }),
2191
+ e.collapsed ? /* @__PURE__ */ P(ne, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ P(E, { className: "h-4 w-4 shrink-0" }),
1953
2192
  /* @__PURE__ */ P("span", { children: e.label }),
1954
2193
  /* @__PURE__ */ P("span", {
1955
2194
  className: "ml-auto text-xs text-muted-foreground",
1956
2195
  children: e.items.length
1957
2196
  })
1958
2197
  ]
1959
- }), !e.collapsed && le(e.items)]
2198
+ }), !e.collapsed && ue(e.items)]
1960
2199
  }, e.key))
1961
- }) : le(E), b.isOverlay && /* @__PURE__ */ P(v, {
2200
+ }) : ue(D), b.isOverlay && /* @__PURE__ */ P(v, {
1962
2201
  ...b,
1963
2202
  title: "Gallery Item",
1964
2203
  children: (e) => /* @__PURE__ */ P("div", {
@@ -1976,11 +2215,11 @@ var U = {
1976
2215
  })
1977
2216
  })] });
1978
2217
  };
1979
- e.register("object-gallery", We, {
2218
+ e.register("object-gallery", Xe, {
1980
2219
  namespace: "plugin-list",
1981
2220
  label: "Gallery View",
1982
2221
  category: "view"
1983
- }), e.register("list-view", H, {
2222
+ }), e.register("list-view", W, {
1984
2223
  namespace: "plugin-list",
1985
2224
  label: "List View",
1986
2225
  category: "Views",
@@ -2057,7 +2296,7 @@ e.register("object-gallery", We, {
2057
2296
  sort: [],
2058
2297
  options: {}
2059
2298
  }
2060
- }), e.register("list", H, {
2299
+ }), e.register("list", W, {
2061
2300
  namespace: "view",
2062
2301
  category: "view",
2063
2302
  label: "List",
@@ -2128,4 +2367,4 @@ e.register("object-gallery", We, {
2128
2367
  ]
2129
2368
  });
2130
2369
  //#endregion
2131
- export { H as ListView, We as ObjectGallery, je as TabBar, Pe as UserFilters, Oe as ViewSwitcher, B as evaluateConditionalFormatting, z as normalizeFilterCondition, Be as normalizeFilters };
2370
+ export { W as ListView, Xe as ObjectGallery, Ne as TabBar, Ie as UserFilters, Ae as ViewSwitcher, Ue as evaluateConditionalFormatting, H as normalizeFilterCondition, Ve as normalizeFilters };