@object-ui/plugin-list 4.2.1 → 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,125 +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.bulkActions ? { batchActions: D.bulkActions } : {},
976
- ...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 || {}
977
1182
  };
978
1183
  case "kanban": return {
979
1184
  type: "object-kanban",
980
1185
  ...t,
981
- groupBy: D.kanban?.groupField || D.options?.kanban?.groupField || "status",
982
- groupField: D.kanban?.groupField || D.options?.kanban?.groupField || "status",
983
- ...D.kanban?.titleField || D.options?.kanban?.titleField ? { titleField: D.kanban?.titleField || D.options?.kanban?.titleField } : {},
984
- cardFields: D.kanban?.cardFields || $ || [],
985
- ...q ? { grouping: q } : {},
986
- ...D.options?.kanban || {},
987
- ...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 || {}
988
1193
  };
989
1194
  case "calendar": return {
990
1195
  type: "object-calendar",
991
1196
  ...t,
992
- startDateField: D.calendar?.startDateField || D.options?.calendar?.startDateField || "start_date",
993
- endDateField: D.calendar?.endDateField || D.options?.calendar?.endDateField || "end_date",
994
- ...D.calendar?.titleField || D.options?.calendar?.titleField ? { titleField: D.calendar?.titleField || D.options?.calendar?.titleField } : {},
995
- ...D.calendar?.defaultView ? { defaultView: D.calendar.defaultView } : {},
996
- ...D.options?.calendar || {},
997
- ...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 || {}
998
1203
  };
999
1204
  case "gallery": {
1000
1205
  let e = {
1001
- ...D.options?.gallery || {},
1002
- ...D.gallery || {}
1206
+ ...O.options?.gallery || {},
1207
+ ...O.gallery || {},
1208
+ cardSize: Q
1003
1209
  };
1004
1210
  return {
1005
1211
  type: "object-gallery",
1006
1212
  ...t,
1007
1213
  gallery: Object.keys(e).length > 0 ? e : void 0,
1008
- imageField: D.gallery?.coverField || D.gallery?.imageField || D.options?.gallery?.imageField,
1009
- titleField: D.gallery?.titleField || D.options?.gallery?.titleField || "name",
1010
- subtitleField: D.gallery?.subtitleField || D.options?.gallery?.subtitleField,
1011
- ...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 } : {}
1012
1218
  };
1013
1219
  }
1014
1220
  case "timeline": {
1015
1221
  let e = {
1016
- ...D.options?.timeline || {},
1017
- ...D.timeline || {}
1222
+ ...O.options?.timeline || {},
1223
+ ...O.timeline || {}
1018
1224
  };
1019
1225
  return {
1020
1226
  type: "object-timeline",
1021
1227
  ...t,
1022
1228
  timeline: Object.keys(e).length > 0 ? e : void 0,
1023
- startDateField: D.timeline?.startDateField || D.options?.timeline?.startDateField || D.options?.timeline?.dateField || "created_at",
1024
- titleField: D.timeline?.titleField || D.options?.timeline?.titleField || "name",
1025
- ...D.timeline?.endDateField ? { endDateField: D.timeline.endDateField } : {},
1026
- ...D.timeline?.groupByField ? { groupByField: D.timeline.groupByField } : {},
1027
- ...D.timeline?.colorField ? { colorField: D.timeline.colorField } : {},
1028
- ...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 } : {}
1029
1235
  };
1030
1236
  }
1031
1237
  case "gantt": return {
1032
1238
  type: "object-gantt",
1033
1239
  ...t,
1034
- startDateField: D.gantt?.startDateField || D.options?.gantt?.startDateField || "start_date",
1035
- endDateField: D.gantt?.endDateField || D.options?.gantt?.endDateField || "end_date",
1036
- progressField: D.gantt?.progressField || D.options?.gantt?.progressField || "progress",
1037
- dependenciesField: D.gantt?.dependenciesField || D.options?.gantt?.dependenciesField || "dependencies",
1038
- ...D.gantt?.titleField ? { titleField: D.gantt.titleField } : {},
1039
- ...D.options?.gantt || {},
1040
- ...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 || {}
1041
1247
  };
1042
1248
  case "map": return {
1043
1249
  type: "object-map",
1044
1250
  ...t,
1045
- locationField: D.options?.map?.locationField || "location",
1046
- ...D.options?.map || {}
1251
+ locationField: O.options?.map?.locationField || "location",
1252
+ ...O.options?.map || {}
1047
1253
  };
1048
1254
  default: return t;
1049
1255
  }
1050
1256
  }, [
1051
- j,
1052
- D,
1053
- L,
1257
+ M,
1258
+ O,
1259
+ I,
1054
1260
  $,
1261
+ K,
1055
1262
  q,
1056
- J,
1057
- kt.handleClick,
1058
- Q.mode
1059
- ]), 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(() => {
1060
1267
  let e, t = (e, t) => {
1061
1268
  if (!t) return;
1062
1269
  let n = Array.isArray(t) ? t.map((e) => ({
@@ -1068,17 +1275,17 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1068
1275
  label: t?.label || e,
1069
1276
  ...t
1070
1277
  }));
1071
- return D.objectName ? E(D.objectName, e, n) : n;
1278
+ return O.objectName ? D(O.objectName, e, n) : n;
1072
1279
  };
1073
- if (e = W?.fields ? Object.entries(W.fields).map(([e, n]) => ({
1280
+ if (e = U?.fields ? Object.entries(U.fields).map(([e, n]) => ({
1074
1281
  value: e,
1075
- label: O(e, n.label || e),
1282
+ label: k(e, n.label || e),
1076
1283
  type: n.type || "text",
1077
1284
  options: t(e, n.options),
1078
1285
  referenceTo: n.reference_to || n.reference,
1079
1286
  displayField: n.display_field || n.reference_field,
1080
1287
  idField: n.id_field
1081
- })) : (D.fields || []).map((e) => {
1288
+ })) : (O.fields || []).map((e) => {
1082
1289
  if (typeof e == "string") return {
1083
1290
  value: e,
1084
1291
  label: e,
@@ -1087,32 +1294,32 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1087
1294
  let n = e.name || e.fieldName;
1088
1295
  return {
1089
1296
  value: n,
1090
- label: O(n, e.label || e.name),
1297
+ label: k(n, e.label || e.name),
1091
1298
  type: e.type || "text",
1092
1299
  options: t(n, e.options),
1093
1300
  referenceTo: e.reference_to || e.reference,
1094
1301
  displayField: e.display_field || e.reference_field,
1095
1302
  idField: e.id_field
1096
1303
  };
1097
- }), D.filterableFields && D.filterableFields.length > 0) {
1098
- let t = new Set(D.filterableFields);
1304
+ }), O.filterableFields && O.filterableFields.length > 0) {
1305
+ let t = new Set(O.filterableFields);
1099
1306
  e = e.filter((e) => t.has(e.value));
1100
1307
  }
1101
1308
  return e;
1102
1309
  }, [
1103
- W,
1104
- D.fields,
1105
- D.filterableFields,
1106
- D.objectName,
1107
- O,
1108
- E
1109
- ]), Nt = a.useCallback((e) => {
1110
- 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) => {
1111
1318
  let n = new Set(t);
1112
1319
  return n.has(e) ? n.delete(e) : n.add(e), n;
1113
1320
  });
1114
- }, []), Pt = a.useCallback((e) => {
1115
- 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;
1116
1323
  if (e === "csv") {
1117
1324
  let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
1118
1325
  r && t.push(e.join(",")), a.forEach((n) => {
@@ -1127,69 +1334,69 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1127
1334
  let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
1128
1335
  n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
1129
1336
  }
1130
- bt(!1);
1337
+ Ct(!1);
1131
1338
  }, [
1132
- B,
1339
+ V,
1133
1340
  $,
1134
- Z,
1135
- D.objectName
1136
- ]), Ft = a.useMemo(() => (D.fields || []).map((e) => {
1341
+ X,
1342
+ O.objectName
1343
+ ]), Ht = a.useMemo(() => (O.fields || []).map((e) => {
1137
1344
  if (typeof e == "string") return {
1138
1345
  name: e,
1139
- label: O(e, e)
1346
+ label: k(e, e)
1140
1347
  };
1141
1348
  let t = e.name || e.fieldName || e.field;
1142
1349
  return {
1143
1350
  name: t,
1144
- label: O(t, e.label || e.name || e.field)
1351
+ label: k(t, e.label || e.name || e.field)
1145
1352
  };
1146
- }), [D.fields, O]);
1353
+ }), [O.fields, k]);
1147
1354
  return /* @__PURE__ */ F("div", {
1148
- ref: xt,
1355
+ ref: Dt,
1149
1356
  className: C("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
1150
- ...D.aria?.label ? { "aria-label": D.aria.label } : {},
1151
- ...D.aria?.describedBy ? { "aria-describedby": D.aria.describedBy } : {},
1152
- ...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 } : {},
1153
1360
  role: "region",
1154
1361
  children: [
1155
- Ct > 0 && /* @__PURE__ */ P("div", {
1362
+ kt > 0 && /* @__PURE__ */ P("div", {
1156
1363
  className: "flex items-center justify-center text-xs text-muted-foreground",
1157
- style: { height: Ct },
1158
- children: T(St ? "list.refreshing" : "list.pullToRefresh")
1364
+ style: { height: kt },
1365
+ children: E(Ot ? "list.refreshing" : "list.pullToRefresh")
1159
1366
  }),
1160
1367
  _ && /* @__PURE__ */ P("div", {
1161
1368
  className: "px-4 py-1 flex items-center bg-background",
1162
- children: /* @__PURE__ */ P(Oe, {
1163
- currentView: j,
1164
- availableViews: Et,
1165
- onViewChange: Dt
1369
+ children: /* @__PURE__ */ P(Ae, {
1370
+ currentView: M,
1371
+ availableViews: Mt,
1372
+ onViewChange: Nt
1166
1373
  })
1167
1374
  }),
1168
- D.description && D.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
1375
+ O.description && O.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
1169
1376
  className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
1170
1377
  "data-testid": "view-description",
1171
- children: typeof D.description == "string" ? D.description : ""
1378
+ children: typeof O.description == "string" ? O.description : ""
1172
1379
  }),
1173
1380
  /* @__PURE__ */ F("div", {
1174
1381
  className: "border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background",
1175
1382
  children: [/* @__PURE__ */ F("div", {
1176
1383
  className: "flex items-center gap-2 overflow-x-auto min-w-0",
1177
1384
  children: [
1178
- D.tabs && D.tabs.length > 0 && /* @__PURE__ */ P(je, {
1179
- tabs: D.tabs,
1180
- activeTab: Ie,
1181
- onTabChange: Re,
1385
+ O.tabs && O.tabs.length > 0 && /* @__PURE__ */ P(Ne, {
1386
+ tabs: O.tabs,
1387
+ activeTab: Le,
1388
+ onTabChange: ze,
1182
1389
  className: "!px-0 !py-0 shrink-0"
1183
1390
  }),
1184
- D.tabs && D.tabs.length > 0 && pt && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
1185
- 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", {
1186
1393
  className: "shrink-0 min-w-0",
1187
1394
  "data-testid": "user-filters",
1188
- children: /* @__PURE__ */ P(Pe, {
1189
- config: pt,
1190
- objectDef: W,
1191
- data: B,
1192
- onFilterChange: ft,
1395
+ children: /* @__PURE__ */ P(Ie, {
1396
+ config: gt,
1397
+ objectDef: U,
1398
+ data: V,
1399
+ onFilterChange: ht,
1193
1400
  maxVisible: 3
1194
1401
  })
1195
1402
  })
@@ -1197,24 +1404,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1197
1404
  }), /* @__PURE__ */ F("div", {
1198
1405
  className: "flex items-center gap-0 shrink-0",
1199
1406
  children: [
1200
- A.showHideFields && /* @__PURE__ */ F(y, {
1201
- open: _t,
1202
- onOpenChange: vt,
1407
+ j.showHideFields && !j.compactToolbar && /* @__PURE__ */ F(y, {
1408
+ open: bt,
1409
+ onOpenChange: xt,
1203
1410
  children: [/* @__PURE__ */ P(x, {
1204
1411
  asChild: !0,
1205
1412
  children: /* @__PURE__ */ F(d, {
1206
1413
  variant: "ghost",
1207
1414
  size: "sm",
1208
- 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"),
1209
1416
  children: [
1210
- /* @__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" }),
1211
1418
  /* @__PURE__ */ P("span", {
1212
1419
  className: "hidden sm:inline",
1213
- children: T("list.hideFields")
1420
+ children: E("list.hideFields")
1214
1421
  }),
1215
- Y.size > 0 && /* @__PURE__ */ P("span", {
1422
+ J.size > 0 && /* @__PURE__ */ P("span", {
1216
1423
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1217
- children: Y.size
1424
+ children: J.size
1218
1425
  })
1219
1426
  ]
1220
1427
  })
@@ -1227,24 +1434,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1227
1434
  className: "flex items-center justify-between border-b pb-2",
1228
1435
  children: [/* @__PURE__ */ P("h4", {
1229
1436
  className: "font-medium text-sm",
1230
- children: T("list.hideFieldsTitle")
1231
- }), Y.size > 0 && /* @__PURE__ */ P(d, {
1437
+ children: E("list.hideFieldsTitle")
1438
+ }), J.size > 0 && /* @__PURE__ */ P(d, {
1232
1439
  variant: "ghost",
1233
1440
  size: "sm",
1234
1441
  className: "h-6 px-2 text-xs",
1235
- onClick: () => gt(/* @__PURE__ */ new Set()),
1236
- children: T("list.showAll")
1442
+ onClick: () => yt(/* @__PURE__ */ new Set()),
1443
+ children: E("list.showAll")
1237
1444
  })]
1238
1445
  }), /* @__PURE__ */ P("div", {
1239
1446
  className: "max-h-60 overflow-y-auto space-y-1",
1240
- children: Ft.map((e) => /* @__PURE__ */ F("label", {
1447
+ children: Ht.map((e) => /* @__PURE__ */ F("label", {
1241
1448
  className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
1242
1449
  children: [/* @__PURE__ */ P("input", {
1243
1450
  type: "checkbox",
1244
- checked: !Y.has(e.name),
1451
+ checked: !J.has(e.name),
1245
1452
  onChange: () => {
1246
- let t = new Set(Y);
1247
- 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);
1248
1455
  },
1249
1456
  className: "rounded border-input"
1250
1457
  }), /* @__PURE__ */ P("span", {
@@ -1256,25 +1463,25 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1256
1463
  })
1257
1464
  })]
1258
1465
  }),
1259
- A.showHideFields && (A.showFilters || A.showSort || A.showGroup) && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1260
- 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, {
1261
1468
  open: Me,
1262
- onOpenChange: Ne,
1469
+ onOpenChange: R,
1263
1470
  children: [/* @__PURE__ */ P(x, {
1264
1471
  asChild: !0,
1265
1472
  children: /* @__PURE__ */ F(d, {
1266
1473
  variant: "ghost",
1267
1474
  size: "sm",
1268
- 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"),
1269
1476
  children: [
1270
- /* @__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" }),
1271
1478
  /* @__PURE__ */ P("span", {
1272
1479
  className: "hidden sm:inline",
1273
- children: T("list.filter")
1480
+ children: E("list.filter")
1274
1481
  }),
1275
- jt && /* @__PURE__ */ P("span", {
1482
+ Rt && /* @__PURE__ */ P("span", {
1276
1483
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1277
- children: R.conditions?.length || 0
1484
+ children: z.conditions?.length || 0
1278
1485
  })
1279
1486
  ]
1280
1487
  })
@@ -1287,11 +1494,11 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1287
1494
  className: "flex items-center justify-between border-b pb-2",
1288
1495
  children: /* @__PURE__ */ P("h4", {
1289
1496
  className: "font-medium text-sm",
1290
- children: T("list.filterRecords")
1497
+ children: E("list.filterRecords")
1291
1498
  })
1292
1499
  }), /* @__PURE__ */ P(m, {
1293
- fields: Mt,
1294
- value: R,
1500
+ fields: zt,
1501
+ value: z,
1295
1502
  onChange: (e) => {
1296
1503
  Fe(e), s && s(e);
1297
1504
  }
@@ -1299,24 +1506,24 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1299
1506
  })
1300
1507
  })]
1301
1508
  }),
1302
- A.showGroup && /* @__PURE__ */ F(y, {
1303
- open: et,
1304
- onOpenChange: tt,
1509
+ j.showGroup && !j.compactToolbar && /* @__PURE__ */ F(y, {
1510
+ open: rt,
1511
+ onOpenChange: it,
1305
1512
  children: [/* @__PURE__ */ P(x, {
1306
1513
  asChild: !0,
1307
1514
  children: /* @__PURE__ */ F(d, {
1308
1515
  variant: "ghost",
1309
1516
  size: "sm",
1310
- 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"),
1311
1518
  children: [
1312
- /* @__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" }),
1313
1520
  /* @__PURE__ */ P("span", {
1314
1521
  className: "hidden sm:inline",
1315
- children: T("list.group")
1522
+ children: E("list.group")
1316
1523
  }),
1317
- q && q.fields?.length > 0 && /* @__PURE__ */ P("span", {
1524
+ K && K.fields?.length > 0 && /* @__PURE__ */ P("span", {
1318
1525
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1319
- children: q.fields.length
1526
+ children: K.fields.length
1320
1527
  })
1321
1528
  ]
1322
1529
  })
@@ -1329,53 +1536,53 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1329
1536
  className: "flex items-center justify-between border-b pb-2",
1330
1537
  children: [/* @__PURE__ */ P("h4", {
1331
1538
  className: "font-medium text-sm",
1332
- children: T("list.groupBy")
1333
- }), q && /* @__PURE__ */ P(d, {
1539
+ children: E("list.groupBy")
1540
+ }), K && /* @__PURE__ */ P(d, {
1334
1541
  variant: "ghost",
1335
1542
  size: "sm",
1336
1543
  className: "h-6 px-2 text-xs",
1337
- onClick: () => $e(void 0),
1544
+ onClick: () => nt(void 0),
1338
1545
  "data-testid": "clear-grouping",
1339
- children: T("list.clear")
1546
+ children: E("list.clear")
1340
1547
  })]
1341
1548
  }), /* @__PURE__ */ P("div", {
1342
1549
  "data-testid": "group-field-list",
1343
1550
  children: /* @__PURE__ */ P(h, {
1344
- value: q,
1345
- fieldOptions: Ft.map((e) => ({
1551
+ value: K,
1552
+ fieldOptions: Ht.map((e) => ({
1346
1553
  value: e.name,
1347
1554
  label: e.label || e.name
1348
1555
  })),
1349
1556
  maxLevels: 3,
1350
1557
  labels: {
1351
- addGroup: T("list.addGroup", "Add group field"),
1352
- collapseTitle: T("list.collapsedByDefault", "Collapsed by default"),
1353
- 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")
1354
1561
  },
1355
- onChange: (e) => $e(e)
1562
+ onChange: (e) => nt(e)
1356
1563
  })
1357
1564
  })]
1358
1565
  })
1359
1566
  })]
1360
1567
  }),
1361
- A.showSort && /* @__PURE__ */ F(y, {
1362
- open: Te,
1568
+ j.showSort && /* @__PURE__ */ F(y, {
1569
+ open: we,
1363
1570
  onOpenChange: De,
1364
1571
  children: [/* @__PURE__ */ P(x, {
1365
1572
  asChild: !0,
1366
1573
  children: /* @__PURE__ */ F(d, {
1367
1574
  variant: "ghost",
1368
1575
  size: "sm",
1369
- 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"),
1370
1577
  children: [
1371
- /* @__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" }),
1372
1579
  /* @__PURE__ */ P("span", {
1373
1580
  className: "hidden sm:inline",
1374
- children: T("list.sort")
1581
+ children: E("list.sort")
1375
1582
  }),
1376
- L.length > 0 && /* @__PURE__ */ P("span", {
1583
+ I.length > 0 && /* @__PURE__ */ P("span", {
1377
1584
  className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
1378
- children: L.length
1585
+ children: I.length
1379
1586
  })
1380
1587
  ]
1381
1588
  })
@@ -1388,31 +1595,31 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1388
1595
  className: "flex items-center justify-between border-b pb-2",
1389
1596
  children: /* @__PURE__ */ P("h4", {
1390
1597
  className: "font-medium text-sm",
1391
- children: T("list.sortRecords")
1598
+ children: E("list.sortRecords")
1392
1599
  })
1393
1600
  }), /* @__PURE__ */ P(S, {
1394
- fields: Mt,
1395
- value: L,
1601
+ fields: zt,
1602
+ value: I,
1396
1603
  onChange: (e) => {
1397
- ke(e), c && c(e);
1604
+ L(e), c && c(e);
1398
1605
  }
1399
1606
  })]
1400
1607
  })
1401
1608
  })]
1402
1609
  }),
1403
- (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" }),
1404
- A.showColor && /* @__PURE__ */ F(y, {
1405
- open: it,
1406
- 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,
1407
1614
  children: [/* @__PURE__ */ P(x, {
1408
1615
  asChild: !0,
1409
1616
  children: /* @__PURE__ */ F(d, {
1410
1617
  variant: "ghost",
1411
1618
  size: "sm",
1412
- className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", J && "text-foreground font-medium"),
1413
- 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", {
1414
1621
  className: "hidden sm:inline",
1415
- children: T("list.color")
1622
+ children: E("list.color")
1416
1623
  })]
1417
1624
  })
1418
1625
  }), /* @__PURE__ */ P(b, {
@@ -1424,36 +1631,36 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1424
1631
  className: "flex items-center justify-between border-b pb-2",
1425
1632
  children: [/* @__PURE__ */ P("h4", {
1426
1633
  className: "font-medium text-sm",
1427
- children: T("list.rowColor")
1428
- }), J && /* @__PURE__ */ P(d, {
1634
+ children: E("list.rowColor")
1635
+ }), q && /* @__PURE__ */ P(d, {
1429
1636
  variant: "ghost",
1430
1637
  size: "sm",
1431
1638
  className: "h-6 px-2 text-xs",
1432
- onClick: () => rt(void 0),
1639
+ onClick: () => ot(void 0),
1433
1640
  "data-testid": "clear-row-color",
1434
- children: T("list.clear")
1641
+ children: E("list.clear")
1435
1642
  })]
1436
1643
  }), /* @__PURE__ */ F("div", {
1437
1644
  className: "space-y-2",
1438
1645
  "data-testid": "color-field-list",
1439
1646
  children: [/* @__PURE__ */ P("label", {
1440
1647
  className: "text-xs text-muted-foreground",
1441
- children: T("list.colorByField")
1648
+ children: E("list.colorByField")
1442
1649
  }), /* @__PURE__ */ F("select", {
1443
1650
  className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
1444
- value: J?.field || "",
1651
+ value: q?.field || "",
1445
1652
  onChange: (e) => {
1446
1653
  let t = e.target.value;
1447
- rt(t ? {
1654
+ ot(t ? {
1448
1655
  field: t,
1449
- colors: J?.colors || {}
1656
+ colors: q?.colors || {}
1450
1657
  } : void 0);
1451
1658
  },
1452
1659
  "data-testid": "color-field-select",
1453
1660
  children: [/* @__PURE__ */ P("option", {
1454
1661
  value: "",
1455
- children: T("list.none")
1456
- }), Ft.map((e) => /* @__PURE__ */ P("option", {
1662
+ children: E("list.none")
1663
+ }), Ht.map((e) => /* @__PURE__ */ P("option", {
1457
1664
  value: e.name,
1458
1665
  children: e.label
1459
1666
  }, e.name))]
@@ -1462,31 +1669,64 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1462
1669
  })
1463
1670
  })]
1464
1671
  }),
1465
- A.showDensity && (() => {
1466
- 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
+ });
1467
1677
  return /* @__PURE__ */ P(d, {
1468
1678
  variant: "ghost",
1469
1679
  size: "sm",
1470
- "aria-label": `Density: ${Q.mode}`,
1471
- 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"),
1472
- onClick: Q.cycle,
1473
- 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,
1474
1684
  children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
1475
1685
  });
1476
1686
  })(),
1477
- (A.showColor || A.showDensity) && Z && D.allowExport !== !1 && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-0.5 shrink-0" }),
1478
- Z && D.allowExport !== !1 && /* @__PURE__ */ F(y, {
1479
- open: yt,
1480
- 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,
1481
1721
  children: [/* @__PURE__ */ P(x, {
1482
1722
  asChild: !0,
1483
1723
  children: /* @__PURE__ */ F(d, {
1484
1724
  variant: "ghost",
1485
1725
  size: "sm",
1486
1726
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1487
- 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", {
1488
1728
  className: "hidden sm:inline",
1489
- children: T("list.export")
1729
+ children: E("list.export")
1490
1730
  })]
1491
1731
  })
1492
1732
  }), /* @__PURE__ */ P(b, {
@@ -1494,54 +1734,54 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1494
1734
  className: "w-48 p-2",
1495
1735
  children: /* @__PURE__ */ P("div", {
1496
1736
  className: "space-y-1",
1497
- children: (Z.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
1737
+ children: (X.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
1498
1738
  variant: "ghost",
1499
1739
  size: "sm",
1500
1740
  className: "w-full justify-start h-8 text-xs",
1501
- onClick: () => Pt(e),
1502
- 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() })]
1503
1743
  }, e))
1504
1744
  })
1505
1745
  })]
1506
1746
  }),
1507
- (D.sharing?.enabled || D.sharing?.type) && /* @__PURE__ */ F(d, {
1747
+ (O.sharing?.enabled || O.sharing?.type) && /* @__PURE__ */ F(d, {
1508
1748
  variant: "ghost",
1509
1749
  size: "sm",
1510
1750
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1511
- title: `Sharing: ${D.sharing?.visibility || D.sharing?.type || "private"}`,
1751
+ title: `Sharing: ${O.sharing?.visibility || O.sharing?.type || "private"}`,
1512
1752
  "data-testid": "share-button",
1513
- 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", {
1514
1754
  className: "hidden sm:inline",
1515
- children: T("list.share")
1755
+ children: E("list.share")
1516
1756
  })]
1517
1757
  }),
1518
- D.allowPrinting && /* @__PURE__ */ F(d, {
1758
+ O.allowPrinting && /* @__PURE__ */ F(d, {
1519
1759
  variant: "ghost",
1520
1760
  size: "sm",
1521
1761
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1522
1762
  onClick: () => window.print(),
1523
1763
  "data-testid": "print-button",
1524
- 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", {
1525
1765
  className: "hidden sm:inline",
1526
- children: T("list.print")
1766
+ children: E("list.print")
1527
1767
  })]
1528
1768
  }),
1529
1769
  (() => {
1530
- let e = D.allowPrinting || D.sharing?.enabled || D.sharing?.type || Z && D.allowExport !== !1;
1531
- 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;
1532
1772
  })(),
1533
- A.showSearch && /* @__PURE__ */ F(y, {
1534
- open: xe,
1535
- onOpenChange: Se,
1773
+ j.showSearch && /* @__PURE__ */ F(y, {
1774
+ open: be,
1775
+ onOpenChange: Ce,
1536
1776
  children: [/* @__PURE__ */ P(x, {
1537
1777
  asChild: !0,
1538
1778
  children: /* @__PURE__ */ P(d, {
1539
1779
  variant: "ghost",
1540
1780
  size: "sm",
1541
- 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"),
1542
1782
  "data-testid": "search-icon-button",
1543
- title: T("list.search"),
1544
- 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" })
1545
1785
  })
1546
1786
  }), /* @__PURE__ */ P(b, {
1547
1787
  align: "end",
@@ -1550,89 +1790,89 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1550
1790
  children: /* @__PURE__ */ F("div", {
1551
1791
  className: "relative",
1552
1792
  children: [
1553
- /* @__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" }),
1554
1794
  /* @__PURE__ */ P(g, {
1555
- placeholder: T("list.search") + "...",
1556
- value: I,
1557
- onChange: (e) => Ot(e.target.value),
1795
+ placeholder: E("list.search") + "...",
1796
+ value: N,
1797
+ onChange: (e) => Pt(e.target.value),
1558
1798
  className: "pl-7 h-8 text-xs",
1559
1799
  autoFocus: !0
1560
1800
  }),
1561
- I && /* @__PURE__ */ P(d, {
1801
+ N && /* @__PURE__ */ P(d, {
1562
1802
  variant: "ghost",
1563
1803
  size: "sm",
1564
1804
  className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20",
1565
- onClick: () => Ot(""),
1566
- children: /* @__PURE__ */ P(he, { className: "h-3 w-3" })
1805
+ onClick: () => Pt(""),
1806
+ children: /* @__PURE__ */ P(_e, { className: "h-3 w-3" })
1567
1807
  })
1568
1808
  ]
1569
1809
  })
1570
1810
  })]
1571
1811
  }),
1572
- A.showAddRecord && A.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
1812
+ j.showAddRecord && j.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
1573
1813
  variant: "ghost",
1574
1814
  size: "sm",
1575
1815
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1576
1816
  "data-testid": "add-record-button",
1577
1817
  onClick: () => w.onAddRecord?.(),
1578
- 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", {
1579
1819
  className: "hidden sm:inline",
1580
- children: T("list.addRecord")
1820
+ children: E("list.addRecord")
1581
1821
  })]
1582
1822
  })
1583
1823
  ]
1584
1824
  })]
1585
1825
  }),
1586
- X && X.length > 0 && /* @__PURE__ */ P("div", {
1826
+ Y && Y.length > 0 && /* @__PURE__ */ P("div", {
1587
1827
  className: "border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background",
1588
1828
  "data-testid": "quick-filters",
1589
- children: X.map((e) => {
1590
- 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;
1591
1831
  return /* @__PURE__ */ F(d, {
1592
1832
  variant: t ? "default" : "outline",
1593
1833
  size: "sm",
1594
1834
  className: "h-7 px-3 text-xs",
1595
- onClick: () => Nt(e.id),
1835
+ onClick: () => Bt(e.id),
1596
1836
  children: [n && /* @__PURE__ */ P(n, { className: "h-3 w-3 mr-1.5" }), e.label]
1597
1837
  }, e.id);
1598
1838
  })
1599
1839
  }),
1600
1840
  /* @__PURE__ */ P("div", {
1601
1841
  className: "flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200",
1602
- children: !H && B.length === 0 && (j === "grid" || j === "list") ? (() => {
1603
- let e = D.emptyState?.icon;
1842
+ children: !Ue && V.length === 0 && (M === "grid" || M === "list") ? (() => {
1843
+ let e = O.emptyState?.icon;
1604
1844
  return /* @__PURE__ */ F("div", {
1605
1845
  className: "flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8",
1606
1846
  "data-testid": "empty-state",
1607
1847
  children: [
1608
- /* @__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" }),
1609
1849
  /* @__PURE__ */ P("h3", {
1610
1850
  className: "text-lg font-medium text-foreground mb-1",
1611
- 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")
1612
1852
  }),
1613
1853
  /* @__PURE__ */ P("p", {
1614
1854
  className: "text-sm text-muted-foreground max-w-md",
1615
- 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")
1616
1856
  }),
1617
- A.showAddRecord && /* @__PURE__ */ F(d, {
1857
+ j.showAddRecord && /* @__PURE__ */ F(d, {
1618
1858
  variant: "default",
1619
1859
  size: "sm",
1620
1860
  className: "mt-4",
1621
1861
  "data-testid": "empty-state-add-record",
1622
1862
  onClick: () => w.onAddRecord?.(),
1623
- 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")]
1624
1864
  })
1625
1865
  ]
1626
1866
  });
1627
- })() : /* @__PURE__ */ P(be, {
1628
- schema: At,
1867
+ })() : /* @__PURE__ */ P(Se, {
1868
+ schema: Lt,
1629
1869
  ...w,
1630
- data: B,
1631
- loading: H,
1632
- onRowSelect: st
1870
+ data: V,
1871
+ loading: Ue,
1872
+ onRowSelect: ut
1633
1873
  })
1634
- }, j),
1635
- A.showAddRecord && A.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
1874
+ }, M),
1875
+ j.showAddRecord && j.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
1636
1876
  className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
1637
1877
  children: /* @__PURE__ */ F(d, {
1638
1878
  variant: "ghost",
@@ -1640,39 +1880,39 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1640
1880
  className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
1641
1881
  "data-testid": "add-record-button",
1642
1882
  onClick: () => w.onAddRecord?.(),
1643
- 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", {
1644
1884
  className: "hidden sm:inline",
1645
- children: T("list.addRecord")
1885
+ children: E("list.addRecord")
1646
1886
  })]
1647
1887
  })
1648
1888
  }),
1649
- 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", {
1650
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",
1651
1891
  role: "region",
1652
1892
  "aria-label": "Bulk actions",
1653
1893
  "data-testid": "bulk-actions-bar",
1654
1894
  children: [
1655
- /* @__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" }),
1656
1896
  /* @__PURE__ */ F("span", {
1657
1897
  className: "font-medium",
1658
1898
  children: [
1659
- ot.length,
1899
+ lt.length,
1660
1900
  " ",
1661
- ot.length === 1 ? "item" : "items",
1901
+ lt.length === 1 ? "item" : "items",
1662
1902
  " selected"
1663
1903
  ]
1664
1904
  }),
1665
1905
  /* @__PURE__ */ P("div", {
1666
1906
  className: "flex items-center gap-1.5 ml-3",
1667
- children: D.bulkActions.map((e) => {
1668
- 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;
1669
1909
  return /* @__PURE__ */ F(d, {
1670
1910
  variant: n ? "destructive" : "outline",
1671
1911
  size: "sm",
1672
1912
  className: "h-7 px-2.5 text-xs gap-1.5",
1673
- onClick: () => w.onBulkAction?.(e, ot),
1913
+ onClick: () => w.onBulkAction?.(e, lt),
1674
1914
  "data-testid": `bulk-action-${e}`,
1675
- 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)]
1676
1916
  }, e);
1677
1917
  })
1678
1918
  }),
@@ -1680,35 +1920,35 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1680
1920
  variant: "ghost",
1681
1921
  size: "sm",
1682
1922
  className: "h-7 px-2 text-xs ml-auto gap-1",
1683
- onClick: () => st([]),
1684
- children: [/* @__PURE__ */ P(he, { className: "h-3 w-3" }), "Clear"]
1923
+ onClick: () => ut([]),
1924
+ children: [/* @__PURE__ */ P(_e, { className: "h-3 w-3" }), "Clear"]
1685
1925
  })
1686
1926
  ]
1687
1927
  }),
1688
- !H && B.length > 0 && D.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
1928
+ !Ue && V.length > 0 && O.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
1689
1929
  className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
1690
1930
  "data-testid": "record-count-bar",
1691
1931
  children: [
1692
1932
  /* @__PURE__ */ P("span", {
1693
1933
  className: "font-medium text-foreground/80",
1694
- 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 })
1695
1935
  }),
1696
- Ye && /* @__PURE__ */ P("span", {
1936
+ Ze && /* @__PURE__ */ P("span", {
1697
1937
  className: "text-amber-600",
1698
1938
  "data-testid": "data-limit-warning",
1699
- children: T("list.dataLimitReached", { limit: G })
1939
+ children: E("list.dataLimitReached", { limit: tt })
1700
1940
  }),
1701
- D.pagination?.pageSizeOptions && D.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
1941
+ O.pagination?.pageSizeOptions && O.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
1702
1942
  className: "ml-auto flex items-center gap-2",
1703
- 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", {
1704
1944
  "data-testid": "page-size-selector",
1705
1945
  className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
1706
- value: String(G),
1946
+ value: String(tt),
1707
1947
  onChange: (e) => {
1708
1948
  let t = Number(e.target.value);
1709
- Qe(t), w.onPageSizeChange && w.onPageSizeChange(t);
1949
+ et(t), w.onPageSizeChange && w.onPageSizeChange(t);
1710
1950
  },
1711
- children: D.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
1951
+ children: O.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
1712
1952
  value: String(e),
1713
1953
  children: e
1714
1954
  }, e))
@@ -1716,9 +1956,9 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1716
1956
  })
1717
1957
  ]
1718
1958
  }),
1719
- kt.isOverlay && /* @__PURE__ */ P(v, {
1720
- ...kt,
1721
- 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",
1722
1962
  children: (e) => /* @__PURE__ */ P("div", {
1723
1963
  className: "space-y-3",
1724
1964
  children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
@@ -1736,23 +1976,23 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
1736
1976
  ]
1737
1977
  });
1738
1978
  });
1739
- H.displayName = "ListView";
1979
+ W.displayName = "ListView";
1740
1980
  //#endregion
1741
1981
  //#region src/ObjectGallery.tsx
1742
- var U = {
1982
+ var Je = {
1743
1983
  small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
1744
1984
  medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
1745
1985
  large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
1746
- }, W = {
1986
+ }, Ye = {
1747
1987
  small: "aspect-square",
1748
1988
  medium: "aspect-[4/3]",
1749
1989
  large: "aspect-[16/10]"
1750
- }, We = (e) => {
1751
- 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({
1752
1992
  navigation: n.navigation,
1753
1993
  objectName: n.objectName,
1754
1994
  onRowClick: e.onRowClick ?? e.onCardClick
1755
- }), 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) => {
1756
1996
  if (t == null || t === "") return "";
1757
1997
  if (typeof t == "object") return t.label ?? t.name ?? t.id ?? JSON.stringify(t);
1758
1998
  let r = _?.fields?.[e], i = r?.type;
@@ -1765,7 +2005,7 @@ var U = {
1765
2005
  let e = r.options[String(t)];
1766
2006
  e && (i = e.label ?? i);
1767
2007
  }
1768
- return ie(n.objectName, e, String(t), i);
2008
+ return re(n.objectName, e, String(t), i);
1769
2009
  }
1770
2010
  let a = typeof t == "number" ? t : Number(t);
1771
2011
  if (Number.isFinite(a)) {
@@ -1791,7 +2031,7 @@ var U = {
1791
2031
  }, [
1792
2032
  _,
1793
2033
  n.objectName,
1794
- ie
2034
+ re
1795
2035
  ]);
1796
2036
  c(() => {
1797
2037
  let e = !0;
@@ -1843,18 +2083,18 @@ var U = {
1843
2083
  e.data,
1844
2084
  _
1845
2085
  ]);
1846
- 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) => {
1847
- 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) => ({
1848
2088
  ...t,
1849
- [e]: t[e] === void 0 ? !M : !t[e]
2089
+ [e]: t[e] === void 0 ? !oe : !t[e]
1850
2090
  }));
1851
- }, [M]), se = l(() => {
1852
- if (!k || !O) return [];
2091
+ }, [oe]), ce = l(() => {
2092
+ if (!A || !k) return [];
1853
2093
  let e = /* @__PURE__ */ new Map(), t = [];
1854
- for (let n of E) {
1855
- 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(" / ");
1856
2096
  if (!e.has(r)) {
1857
- let i = O.map((e) => {
2097
+ let i = k.map((e) => {
1858
2098
  let t = n[e.field];
1859
2099
  return t != null && t !== "" ? String(t) : "(empty)";
1860
2100
  }).join(" / ");
@@ -1865,7 +2105,7 @@ var U = {
1865
2105
  }
1866
2106
  e.get(r).items.push(n);
1867
2107
  }
1868
- let n = O[0]?.order ?? "asc";
2108
+ let n = k[0]?.order ?? "asc";
1869
2109
  return t.sort((e, t) => {
1870
2110
  let r = e.localeCompare(t, void 0, {
1871
2111
  numeric: !0,
@@ -1873,7 +2113,7 @@ var U = {
1873
2113
  });
1874
2114
  return n === "desc" ? -r : r;
1875
2115
  }), t.map((t) => {
1876
- 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;
1877
2117
  return {
1878
2118
  key: t,
1879
2119
  label: n.label,
@@ -1882,29 +2122,29 @@ var U = {
1882
2122
  };
1883
2123
  });
1884
2124
  }, [
1885
- E,
1886
- O,
2125
+ D,
1887
2126
  k,
1888
2127
  A,
1889
- M
2128
+ j,
2129
+ oe
1890
2130
  ]);
1891
- if (h && !E.length) return /* @__PURE__ */ P("div", {
2131
+ if (h && !D.length) return /* @__PURE__ */ P("div", {
1892
2132
  className: "p-4 text-sm text-muted-foreground",
1893
2133
  children: "Loading Gallery..."
1894
2134
  });
1895
- if (!E.length) return /* @__PURE__ */ P("div", {
2135
+ if (!D.length) return /* @__PURE__ */ P("div", {
1896
2136
  className: "p-4 text-sm text-muted-foreground",
1897
2137
  children: "No items to display"
1898
2138
  });
1899
- let ce = (t, r) => {
1900
- 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];
1901
2141
  return /* @__PURE__ */ F(f, {
1902
2142
  role: "listitem",
1903
2143
  className: C("group overflow-hidden transition-all hover:shadow-md", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer"),
1904
2144
  onClick: () => b.handleClick(t),
1905
2145
  children: [/* @__PURE__ */ P("div", {
1906
- className: C("w-full overflow-hidden bg-muted relative", W[ee]),
1907
- hidden: !oe,
2146
+ className: C("w-full overflow-hidden bg-muted relative", Ye[T]),
2147
+ hidden: !ae,
1908
2148
  children: o ? /* @__PURE__ */ P("img", {
1909
2149
  src: o,
1910
2150
  alt: a,
@@ -1917,47 +2157,47 @@ var U = {
1917
2157
  })
1918
2158
  })
1919
2159
  }), /* @__PURE__ */ F(p, {
1920
- className: C("p-3", oe && "border-t"),
2160
+ className: C("p-3", ae && "border-t"),
1921
2161
  children: [/* @__PURE__ */ P("h3", {
1922
2162
  className: "font-medium truncate text-sm",
1923
2163
  title: a,
1924
2164
  children: a
1925
- }), ne && ne.length > 0 && /* @__PURE__ */ P("div", {
2165
+ }), te && te.length > 0 && /* @__PURE__ */ P("div", {
1926
2166
  className: "mt-1 space-y-0.5",
1927
- children: ne.map((e) => {
2167
+ children: te.map((e) => {
1928
2168
  let n = t[e];
1929
2169
  return n == null || n === "" ? null : /* @__PURE__ */ P("p", {
1930
2170
  className: "text-xs text-muted-foreground truncate",
1931
- children: ae(e, n)
2171
+ children: ie(e, n)
1932
2172
  }, e);
1933
2173
  })
1934
2174
  })]
1935
2175
  })]
1936
2176
  }, i);
1937
- }, le = (e) => /* @__PURE__ */ P("div", {
1938
- 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),
1939
2179
  role: "list",
1940
- children: e.map((e, t) => ce(e, t))
2180
+ children: e.map((e, t) => le(e, t))
1941
2181
  });
1942
- return /* @__PURE__ */ F(_e, { children: [k ? /* @__PURE__ */ P("div", {
2182
+ return /* @__PURE__ */ F(N, { children: [A ? /* @__PURE__ */ P("div", {
1943
2183
  className: "space-y-2",
1944
- children: se.map((e) => /* @__PURE__ */ F("div", {
2184
+ children: ce.map((e) => /* @__PURE__ */ F("div", {
1945
2185
  className: "border rounded-md",
1946
2186
  children: [/* @__PURE__ */ F("button", {
1947
2187
  type: "button",
1948
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",
1949
- onClick: () => N(e.key),
2189
+ onClick: () => se(e.key),
1950
2190
  children: [
1951
- 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" }),
1952
2192
  /* @__PURE__ */ P("span", { children: e.label }),
1953
2193
  /* @__PURE__ */ P("span", {
1954
2194
  className: "ml-auto text-xs text-muted-foreground",
1955
2195
  children: e.items.length
1956
2196
  })
1957
2197
  ]
1958
- }), !e.collapsed && le(e.items)]
2198
+ }), !e.collapsed && ue(e.items)]
1959
2199
  }, e.key))
1960
- }) : le(E), b.isOverlay && /* @__PURE__ */ P(v, {
2200
+ }) : ue(D), b.isOverlay && /* @__PURE__ */ P(v, {
1961
2201
  ...b,
1962
2202
  title: "Gallery Item",
1963
2203
  children: (e) => /* @__PURE__ */ P("div", {
@@ -1975,11 +2215,11 @@ var U = {
1975
2215
  })
1976
2216
  })] });
1977
2217
  };
1978
- e.register("object-gallery", We, {
2218
+ e.register("object-gallery", Xe, {
1979
2219
  namespace: "plugin-list",
1980
2220
  label: "Gallery View",
1981
2221
  category: "view"
1982
- }), e.register("list-view", H, {
2222
+ }), e.register("list-view", W, {
1983
2223
  namespace: "plugin-list",
1984
2224
  label: "List View",
1985
2225
  category: "Views",
@@ -2056,7 +2296,7 @@ e.register("object-gallery", We, {
2056
2296
  sort: [],
2057
2297
  options: {}
2058
2298
  }
2059
- }), e.register("list", H, {
2299
+ }), e.register("list", W, {
2060
2300
  namespace: "view",
2061
2301
  category: "view",
2062
2302
  label: "List",
@@ -2127,4 +2367,4 @@ e.register("object-gallery", We, {
2127
2367
  ]
2128
2368
  });
2129
2369
  //#endregion
2130
- 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 };