@object-ui/plugin-list 4.0.7 → 4.0.8

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