@object-ui/plugin-list 4.5.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -2,23 +2,23 @@ import { ComponentRegistry as e, buildExpandFields as t, evaluatePlainCondition
|
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import { useCallback as o, useContext as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
4
4
|
import { Button as d, Card as f, CardContent as p, FilterBuilder as m, GroupingEditor as h, Input as g, LookupValuePicker as _, NavigationOverlay as v, Popover as y, PopoverContent as b, PopoverTrigger as x, SortBuilder as S, cn as C } from "@object-ui/components";
|
|
5
|
-
import { Activity as w, ArrowUpDown as T, Calendar as ee, CheckSquare as te, ChevronDown as E, ChevronRight as ne, Download as re, EyeOff as ie, GanttChartSquare as D, Grid as O, Group as ae, Images as k, Inbox as oe, LayoutGrid as A, Map as j, Paintbrush as se, Plus as M, Printer as ce, Rows2 as le, Rows3 as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { useObjectLabel as
|
|
8
|
-
import { SchemaRenderer as
|
|
9
|
-
import { usePullToRefresh as
|
|
10
|
-
import { usePermissions as
|
|
11
|
-
import { getCellRenderer as
|
|
5
|
+
import { Activity as w, ArrowUpDown as T, Calendar as ee, CheckSquare as te, ChevronDown as E, ChevronRight as ne, Download as re, EyeOff as ie, GanttChartSquare as D, Grid as O, Group as ae, Images as k, Inbox as oe, LayoutGrid as A, Map as j, Paintbrush as se, Plus as M, Printer as ce, Rows2 as le, Rows3 as ue, Rows4 as de, Search as fe, Settings2 as pe, Share2 as me, SlidersHorizontal as he, Trash2 as ge, X as _e, icons as ve } from "lucide-react";
|
|
6
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
7
|
+
import { useObjectLabel as ye, useObjectTranslation as be, useSafeFieldLabel as xe } from "@object-ui/i18n";
|
|
8
|
+
import { SchemaRenderer as Se, SchemaRendererContext as Ce, useDataScope as we, useDensityMode as Te, useNavigationOverlay as Ee, useSafeFieldLabel as De } from "@object-ui/react";
|
|
9
|
+
import { usePullToRefresh as Oe } from "@object-ui/mobile";
|
|
10
|
+
import { usePermissions as ke } from "@object-ui/permissions";
|
|
11
|
+
import { getCellRenderer as I, resolveCellRendererType as Ae } from "@object-ui/fields";
|
|
12
12
|
//#region src/ViewSwitcher.tsx
|
|
13
|
-
var
|
|
14
|
-
grid: /* @__PURE__ */
|
|
15
|
-
kanban: /* @__PURE__ */
|
|
16
|
-
gallery: /* @__PURE__ */
|
|
17
|
-
calendar: /* @__PURE__ */
|
|
18
|
-
timeline: /* @__PURE__ */
|
|
19
|
-
gantt: /* @__PURE__ */
|
|
20
|
-
map: /* @__PURE__ */
|
|
21
|
-
},
|
|
13
|
+
var je = {
|
|
14
|
+
grid: /* @__PURE__ */ P(O, { className: "h-4 w-4" }),
|
|
15
|
+
kanban: /* @__PURE__ */ P(A, { className: "h-4 w-4" }),
|
|
16
|
+
gallery: /* @__PURE__ */ P(k, { className: "h-4 w-4" }),
|
|
17
|
+
calendar: /* @__PURE__ */ P(ee, { className: "h-4 w-4" }),
|
|
18
|
+
timeline: /* @__PURE__ */ P(w, { className: "h-4 w-4" }),
|
|
19
|
+
gantt: /* @__PURE__ */ P(D, { className: "h-4 w-4" }),
|
|
20
|
+
map: /* @__PURE__ */ P(j, { className: "h-4 w-4" })
|
|
21
|
+
}, Me = {
|
|
22
22
|
grid: "Grid",
|
|
23
23
|
kanban: "Kanban",
|
|
24
24
|
gallery: "Gallery",
|
|
@@ -26,7 +26,7 @@ var Ae = {
|
|
|
26
26
|
timeline: "Timeline",
|
|
27
27
|
gantt: "Gantt",
|
|
28
28
|
map: "Map"
|
|
29
|
-
},
|
|
29
|
+
}, Ne = ({ currentView: e, availableViews: t = ["grid", "kanban"], onViewChange: n, className: r, animated: i = !0 }) => {
|
|
30
30
|
let o = a.useCallback((t) => {
|
|
31
31
|
if (!i || t === e) {
|
|
32
32
|
n(t);
|
|
@@ -38,21 +38,21 @@ var Ae = {
|
|
|
38
38
|
e,
|
|
39
39
|
n
|
|
40
40
|
]);
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ P("div", {
|
|
42
42
|
className: C("flex items-center gap-1 bg-transparent oui-view-switcher", r),
|
|
43
43
|
children: t.map((t) => {
|
|
44
44
|
let n = e === t;
|
|
45
|
-
return /* @__PURE__ */
|
|
45
|
+
return /* @__PURE__ */ F("button", {
|
|
46
46
|
type: "button",
|
|
47
47
|
onClick: () => o(t),
|
|
48
|
-
"aria-label":
|
|
49
|
-
title:
|
|
48
|
+
"aria-label": Me[t],
|
|
49
|
+
title: Me[t],
|
|
50
50
|
"aria-pressed": n,
|
|
51
51
|
"data-state": n ? "on" : "off",
|
|
52
52
|
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"),
|
|
53
|
-
children: [
|
|
53
|
+
children: [je[t], /* @__PURE__ */ P("span", {
|
|
54
54
|
className: "hidden sm:inline-block text-xs font-medium",
|
|
55
|
-
children:
|
|
55
|
+
children: Me[t]
|
|
56
56
|
})]
|
|
57
57
|
}, t);
|
|
58
58
|
})
|
|
@@ -60,23 +60,23 @@ var Ae = {
|
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region src/components/TabBar.tsx
|
|
63
|
-
function
|
|
64
|
-
return e ?
|
|
63
|
+
function Pe(e) {
|
|
64
|
+
return e ? ve[e.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function L(e) {
|
|
67
67
|
return e.filter((e) => e.pinned || e.visible !== "false" && e.visible !== !1).sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
let i = a.useMemo(() =>
|
|
69
|
+
var Fe = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
|
|
70
|
+
let i = a.useMemo(() => L(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) => {
|
|
71
71
|
c(e.name), n?.(e);
|
|
72
72
|
}, [n]);
|
|
73
|
-
return i.length === 0 ? null : /* @__PURE__ */
|
|
73
|
+
return i.length === 0 ? null : /* @__PURE__ */ P("div", {
|
|
74
74
|
className: C("px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background", r),
|
|
75
75
|
"data-testid": "view-tabs",
|
|
76
76
|
role: "tablist",
|
|
77
77
|
children: i.map((e) => {
|
|
78
|
-
let t =
|
|
79
|
-
return /* @__PURE__ */
|
|
78
|
+
let t = Pe(e.icon), n = l === e.name;
|
|
79
|
+
return /* @__PURE__ */ F(d, {
|
|
80
80
|
variant: "ghost",
|
|
81
81
|
size: "sm",
|
|
82
82
|
className: C("h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150", n ? "font-medium text-foreground bg-muted" : "text-muted-foreground hover:text-foreground hover:bg-transparent"),
|
|
@@ -84,56 +84,56 @@ var Pe = ({ tabs: e, activeTab: t, onTabChange: n, className: r }) => {
|
|
|
84
84
|
role: "tab",
|
|
85
85
|
"aria-selected": n,
|
|
86
86
|
onClick: () => u(e),
|
|
87
|
-
children: [t && /* @__PURE__ */
|
|
87
|
+
children: [t && /* @__PURE__ */ P(t, { className: "h-3 w-3 mr-1.5" }), e.label]
|
|
88
88
|
}, e.name);
|
|
89
89
|
})
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/components/ViewSettingsPopover.tsx
|
|
94
|
-
function
|
|
94
|
+
function R({ title: e, badge: t, onClear: n, clearLabel: r, defaultOpen: i = !0, children: o }) {
|
|
95
95
|
let [s, c] = a.useState(i);
|
|
96
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ F("div", {
|
|
97
97
|
className: "border-b last:border-b-0",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ F("div", {
|
|
99
99
|
className: "flex items-center justify-between px-3 py-2",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
100
|
+
children: [/* @__PURE__ */ F("button", {
|
|
101
101
|
type: "button",
|
|
102
102
|
onClick: () => c((e) => !e),
|
|
103
103
|
className: "flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground",
|
|
104
104
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ P(E, { className: C("h-3.5 w-3.5 transition-transform", !s && "-rotate-90") }),
|
|
106
106
|
e,
|
|
107
|
-
typeof t == "number" && t > 0 && /* @__PURE__ */
|
|
107
|
+
typeof t == "number" && t > 0 && /* @__PURE__ */ P("span", {
|
|
108
108
|
className: "ml-1 inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] text-primary tabular-nums",
|
|
109
109
|
children: t
|
|
110
110
|
})
|
|
111
111
|
]
|
|
112
|
-
}), n && /* @__PURE__ */
|
|
112
|
+
}), n && /* @__PURE__ */ P("button", {
|
|
113
113
|
type: "button",
|
|
114
114
|
onClick: n,
|
|
115
115
|
className: "text-[11px] text-muted-foreground hover:text-foreground",
|
|
116
116
|
children: r
|
|
117
117
|
})]
|
|
118
|
-
}), s && /* @__PURE__ */
|
|
118
|
+
}), s && /* @__PURE__ */ P("div", {
|
|
119
119
|
className: "px-3 pb-3",
|
|
120
120
|
children: o
|
|
121
121
|
})]
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Ie(e) {
|
|
125
125
|
let { t, allFields: n, showGroup: r, groupingConfig: i, setGroupingConfig: o, showColor: s, rowColorConfig: c, setRowColorConfig: l, showDensity: u, density: f, showHideFields: p, hiddenFields: m, updateHiddenFields: g } = e, [_, v] = a.useState(!1), S = [
|
|
126
126
|
!!i?.fields?.length,
|
|
127
127
|
!!c?.field,
|
|
128
128
|
f && f.mode !== "compact",
|
|
129
129
|
(m?.size ?? 0) > 0
|
|
130
|
-
].filter(Boolean).length, w = f?.mode === "compact" ?
|
|
131
|
-
return /* @__PURE__ */
|
|
130
|
+
].filter(Boolean).length, w = f?.mode === "compact" ? de : f?.mode === "comfortable" ? ue : le, T = t("list.viewSettings", { defaultValue: "View settings" });
|
|
131
|
+
return /* @__PURE__ */ F(y, {
|
|
132
132
|
open: _,
|
|
133
133
|
onOpenChange: v,
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ P(x, {
|
|
135
135
|
asChild: !0,
|
|
136
|
-
children: /* @__PURE__ */
|
|
136
|
+
children: /* @__PURE__ */ F(d, {
|
|
137
137
|
variant: "ghost",
|
|
138
138
|
size: "sm",
|
|
139
139
|
"aria-label": T,
|
|
@@ -141,38 +141,38 @@ function Fe(e) {
|
|
|
141
141
|
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", S > 0 && "text-foreground font-medium"),
|
|
142
142
|
"data-testid": "view-settings-trigger",
|
|
143
143
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ P(pe, { className: "h-3.5 w-3.5 sm:mr-1.5" }),
|
|
145
|
+
/* @__PURE__ */ P("span", {
|
|
146
146
|
className: "hidden sm:inline",
|
|
147
147
|
children: T
|
|
148
148
|
}),
|
|
149
|
-
S > 0 && /* @__PURE__ */
|
|
149
|
+
S > 0 && /* @__PURE__ */ P("span", {
|
|
150
150
|
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
151
151
|
children: S
|
|
152
152
|
})
|
|
153
153
|
]
|
|
154
154
|
})
|
|
155
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ F(b, {
|
|
156
156
|
align: "end",
|
|
157
157
|
className: "w-80 p-0",
|
|
158
158
|
"data-testid": "view-settings-content",
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ F("div", {
|
|
161
161
|
className: "px-3 py-2 border-b",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ P("div", {
|
|
163
163
|
className: "text-sm font-semibold",
|
|
164
164
|
children: T
|
|
165
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ P("div", {
|
|
166
166
|
className: "text-[11px] text-muted-foreground",
|
|
167
167
|
children: t("list.viewSettingsHint", { defaultValue: "Grouping, color, density, and visible fields." })
|
|
168
168
|
})]
|
|
169
169
|
}),
|
|
170
|
-
r && o && /* @__PURE__ */
|
|
170
|
+
r && o && /* @__PURE__ */ P(R, {
|
|
171
171
|
title: t("list.group", { defaultValue: "Group" }),
|
|
172
172
|
badge: i?.fields?.length || 0,
|
|
173
173
|
onClear: i ? () => o(void 0) : void 0,
|
|
174
174
|
clearLabel: t("list.clear", { defaultValue: "Clear" }),
|
|
175
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ P(h, {
|
|
176
176
|
value: i,
|
|
177
177
|
fieldOptions: n.map((e) => ({
|
|
178
178
|
value: e.name,
|
|
@@ -187,15 +187,15 @@ function Fe(e) {
|
|
|
187
187
|
onChange: (e) => o(e)
|
|
188
188
|
})
|
|
189
189
|
}),
|
|
190
|
-
s && l && /* @__PURE__ */
|
|
190
|
+
s && l && /* @__PURE__ */ F(R, {
|
|
191
191
|
title: t("list.color", { defaultValue: "Row color" }),
|
|
192
192
|
onClear: c ? () => l(void 0) : void 0,
|
|
193
193
|
clearLabel: t("list.clear", { defaultValue: "Clear" }),
|
|
194
194
|
defaultOpen: !!c,
|
|
195
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ P("label", {
|
|
196
196
|
className: "block text-[11px] text-muted-foreground mb-1",
|
|
197
197
|
children: t("list.colorByField", { defaultValue: "Color by field" })
|
|
198
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ F("select", {
|
|
199
199
|
className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
|
|
200
200
|
value: c?.field || "",
|
|
201
201
|
onChange: (e) => {
|
|
@@ -206,47 +206,47 @@ function Fe(e) {
|
|
|
206
206
|
} : void 0);
|
|
207
207
|
},
|
|
208
208
|
"data-testid": "color-field-select",
|
|
209
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ P("option", {
|
|
210
210
|
value: "",
|
|
211
211
|
children: t("list.none", { defaultValue: "None" })
|
|
212
|
-
}), n.map((e) => /* @__PURE__ */
|
|
212
|
+
}), n.map((e) => /* @__PURE__ */ P("option", {
|
|
213
213
|
value: e.name,
|
|
214
214
|
children: e.label || e.name
|
|
215
215
|
}, e.name))]
|
|
216
216
|
})]
|
|
217
217
|
}),
|
|
218
|
-
u && f && /* @__PURE__ */
|
|
218
|
+
u && f && /* @__PURE__ */ P(R, {
|
|
219
219
|
title: t("grid.toolbar.densityMode", { defaultValue: "Density" }),
|
|
220
220
|
defaultOpen: f.mode !== "compact",
|
|
221
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ F("div", {
|
|
222
222
|
className: "flex items-center gap-2",
|
|
223
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ F(d, {
|
|
224
224
|
variant: "outline",
|
|
225
225
|
size: "sm",
|
|
226
226
|
className: "h-7 gap-1.5",
|
|
227
227
|
onClick: f.cycle,
|
|
228
228
|
"data-testid": "view-settings-density-cycle",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ P(w, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ P("span", {
|
|
230
230
|
className: "text-xs",
|
|
231
231
|
children: f.mode === "compact" ? t("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : f.mode === "comfortable" ? t("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : t("grid.toolbar.densitySpacious", { defaultValue: "Spacious" })
|
|
232
232
|
})]
|
|
233
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ P("span", {
|
|
234
234
|
className: "text-[11px] text-muted-foreground",
|
|
235
235
|
children: t("grid.toolbar.densityCycleShortHint", { defaultValue: "Click to cycle" })
|
|
236
236
|
})]
|
|
237
237
|
})
|
|
238
238
|
}),
|
|
239
|
-
p && m && g && /* @__PURE__ */
|
|
239
|
+
p && m && g && /* @__PURE__ */ P(R, {
|
|
240
240
|
title: t("list.hideFieldsTitle", { defaultValue: "Hide fields" }),
|
|
241
241
|
badge: m.size,
|
|
242
242
|
onClear: m.size > 0 ? () => g(/* @__PURE__ */ new Set()) : void 0,
|
|
243
243
|
clearLabel: t("list.showAll", { defaultValue: "Show all" }),
|
|
244
244
|
defaultOpen: m.size > 0,
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ P("div", {
|
|
246
246
|
className: "max-h-48 overflow-y-auto space-y-0.5",
|
|
247
|
-
children: n.map((e) => /* @__PURE__ */
|
|
247
|
+
children: n.map((e) => /* @__PURE__ */ F("label", {
|
|
248
248
|
className: "flex items-center gap-2 text-xs py-1 px-1 rounded hover:bg-muted cursor-pointer",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ P("input", {
|
|
250
250
|
type: "checkbox",
|
|
251
251
|
checked: !m.has(e.name),
|
|
252
252
|
onChange: () => {
|
|
@@ -254,7 +254,7 @@ function Fe(e) {
|
|
|
254
254
|
t.has(e.name) ? t.delete(e.name) : t.add(e.name), g(t);
|
|
255
255
|
},
|
|
256
256
|
className: "rounded border-input"
|
|
257
|
-
}), /* @__PURE__ */
|
|
257
|
+
}), /* @__PURE__ */ P("span", {
|
|
258
258
|
className: "truncate",
|
|
259
259
|
children: e.label || e.name
|
|
260
260
|
})]
|
|
@@ -267,23 +267,23 @@ function Fe(e) {
|
|
|
267
267
|
}
|
|
268
268
|
//#endregion
|
|
269
269
|
//#region src/UserFilters.tsx
|
|
270
|
-
function
|
|
270
|
+
function Le() {
|
|
271
271
|
try {
|
|
272
|
-
let { t: e } =
|
|
272
|
+
let { t: e } = be(), t = e("common.more");
|
|
273
273
|
return !t || t === "common.more" ? "More" : t;
|
|
274
274
|
} catch {
|
|
275
275
|
return "More";
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
var
|
|
278
|
+
var Re = new Set([
|
|
279
279
|
"lookup",
|
|
280
280
|
"master_detail",
|
|
281
281
|
"user",
|
|
282
282
|
"owner"
|
|
283
283
|
]);
|
|
284
|
-
function
|
|
284
|
+
function ze({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisible: i, className: a }) {
|
|
285
285
|
switch (e.element) {
|
|
286
|
-
case "dropdown": return /* @__PURE__ */
|
|
286
|
+
case "dropdown": return /* @__PURE__ */ P(z, {
|
|
287
287
|
fields: e.fields || [],
|
|
288
288
|
objectDef: t,
|
|
289
289
|
data: n,
|
|
@@ -291,14 +291,14 @@ function Re({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
|
|
|
291
291
|
maxVisible: i,
|
|
292
292
|
className: a
|
|
293
293
|
});
|
|
294
|
-
case "tabs": return /* @__PURE__ */
|
|
294
|
+
case "tabs": return /* @__PURE__ */ P(B, {
|
|
295
295
|
tabs: e.tabs || [],
|
|
296
296
|
showAllRecords: e.showAllRecords !== !1,
|
|
297
297
|
allowAddTab: e.allowAddTab,
|
|
298
298
|
onFilterChange: r,
|
|
299
299
|
className: a
|
|
300
300
|
});
|
|
301
|
-
case "toggle": return /* @__PURE__ */
|
|
301
|
+
case "toggle": return /* @__PURE__ */ P(Ve, {
|
|
302
302
|
fields: e.fields || [],
|
|
303
303
|
onFilterChange: r,
|
|
304
304
|
className: a
|
|
@@ -306,7 +306,7 @@ function Re({ config: e, objectDef: t, data: n = [], onFilterChange: r, maxVisib
|
|
|
306
306
|
default: return null;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Be(e, t, n, r) {
|
|
310
310
|
return e.map((e) => {
|
|
311
311
|
let i = e.options ? [...e.options] : [], a = e.type, o, s, c;
|
|
312
312
|
if (t?.fields) {
|
|
@@ -343,13 +343,13 @@ function ze(e, t, n, r) {
|
|
|
343
343
|
};
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
let { fieldLabel: s, translateOptions: c } =
|
|
346
|
+
function z({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i, className: o }) {
|
|
347
|
+
let { fieldLabel: s, translateOptions: c } = xe(), l = Le(), u = t?.name, [d, f] = a.useState(() => {
|
|
348
348
|
let t = {};
|
|
349
349
|
return e.forEach((e) => {
|
|
350
350
|
e.defaultValues && e.defaultValues.length > 0 && (t[e.field] = e.defaultValues);
|
|
351
351
|
}), t;
|
|
352
|
-
}), p = a.useMemo(() =>
|
|
352
|
+
}), p = a.useMemo(() => Be(e, t, n, {
|
|
353
353
|
objectName: u,
|
|
354
354
|
fieldLabel: s,
|
|
355
355
|
translateOptions: c
|
|
@@ -377,36 +377,36 @@ function B({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
|
|
|
377
377
|
Object.values(d).some((e) => e.length > 0) && m(d);
|
|
378
378
|
}, []);
|
|
379
379
|
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) => {
|
|
380
|
-
let t = d[e.field] || [], n = t.length > 0, r =
|
|
381
|
-
return /* @__PURE__ */
|
|
380
|
+
let t = d[e.field] || [], n = t.length > 0, r = Re.has(e.type || "") && e.options.length === 0 && (e.referenceTo || e.type === "user" || e.type === "owner"), i = r ? "w-72" : "w-56";
|
|
381
|
+
return /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
|
|
382
382
|
asChild: !0,
|
|
383
|
-
children: /* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ F("button", {
|
|
384
384
|
"data-testid": `filter-badge-${e.field}`,
|
|
385
385
|
className: C("inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md", n ? "text-foreground font-medium" : "text-muted-foreground hover:text-foreground"),
|
|
386
386
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ P("span", {
|
|
388
388
|
className: "truncate max-w-[100px]",
|
|
389
389
|
children: e.label || e.field
|
|
390
390
|
}),
|
|
391
|
-
n && /* @__PURE__ */
|
|
391
|
+
n && /* @__PURE__ */ P("span", {
|
|
392
392
|
className: "text-[10px] text-muted-foreground/80 tabular-nums",
|
|
393
393
|
children: t.length
|
|
394
394
|
}),
|
|
395
|
-
n ? /* @__PURE__ */
|
|
395
|
+
n ? /* @__PURE__ */ P(_e, {
|
|
396
396
|
className: "h-3 w-3 opacity-60 hover:opacity-100",
|
|
397
397
|
"data-testid": `filter-clear-${e.field}`,
|
|
398
398
|
onClick: (t) => {
|
|
399
399
|
t.stopPropagation(), h(e.field, []);
|
|
400
400
|
}
|
|
401
|
-
}) : /* @__PURE__ */
|
|
401
|
+
}) : /* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
|
|
402
402
|
]
|
|
403
403
|
})
|
|
404
|
-
}), /* @__PURE__ */
|
|
404
|
+
}), /* @__PURE__ */ P(b, {
|
|
405
405
|
align: "start",
|
|
406
406
|
className: C(i, "p-2"),
|
|
407
|
-
children: r ? /* @__PURE__ */
|
|
407
|
+
children: r ? /* @__PURE__ */ P("div", {
|
|
408
408
|
"data-testid": `filter-lookup-${e.field}`,
|
|
409
|
-
children: /* @__PURE__ */
|
|
409
|
+
children: /* @__PURE__ */ P(_, {
|
|
410
410
|
field: {
|
|
411
411
|
value: e.field,
|
|
412
412
|
label: e.label || e.field,
|
|
@@ -422,16 +422,16 @@ function B({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
|
|
|
422
422
|
h(e.field, n);
|
|
423
423
|
}
|
|
424
424
|
})
|
|
425
|
-
}) : /* @__PURE__ */
|
|
425
|
+
}) : /* @__PURE__ */ P("div", {
|
|
426
426
|
className: "max-h-60 overflow-y-auto space-y-0.5",
|
|
427
427
|
"data-testid": `filter-options-${e.field}`,
|
|
428
|
-
children: e.options.length === 0 ? /* @__PURE__ */
|
|
428
|
+
children: e.options.length === 0 ? /* @__PURE__ */ P("div", {
|
|
429
429
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
430
430
|
children: "No options"
|
|
431
|
-
}) : e.options.map((n) => /* @__PURE__ */
|
|
431
|
+
}) : e.options.map((n) => /* @__PURE__ */ F("label", {
|
|
432
432
|
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"),
|
|
433
433
|
children: [
|
|
434
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ P("input", {
|
|
435
435
|
type: "checkbox",
|
|
436
436
|
checked: t.includes(n.value),
|
|
437
437
|
onChange: () => {
|
|
@@ -440,15 +440,15 @@ function B({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
|
|
|
440
440
|
},
|
|
441
441
|
className: "rounded border-input"
|
|
442
442
|
}),
|
|
443
|
-
n.color && /* @__PURE__ */
|
|
443
|
+
n.color && /* @__PURE__ */ P("span", {
|
|
444
444
|
className: "h-2.5 w-2.5 rounded-full shrink-0",
|
|
445
445
|
style: { backgroundColor: n.color }
|
|
446
446
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ P("span", {
|
|
448
448
|
className: "truncate flex-1",
|
|
449
449
|
children: n.label
|
|
450
450
|
}),
|
|
451
|
-
n.count !== void 0 && /* @__PURE__ */
|
|
451
|
+
n.count !== void 0 && /* @__PURE__ */ P("span", {
|
|
452
452
|
className: "text-xs text-muted-foreground",
|
|
453
453
|
children: n.count
|
|
454
454
|
})
|
|
@@ -457,39 +457,39 @@ function B({ fields: e, objectDef: t, data: n, onFilterChange: r, maxVisible: i,
|
|
|
457
457
|
})
|
|
458
458
|
})] }, e.field);
|
|
459
459
|
};
|
|
460
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ P("div", {
|
|
461
461
|
className: C("flex items-center gap-0.5 overflow-x-auto", o),
|
|
462
462
|
"data-testid": "user-filters-dropdown",
|
|
463
|
-
children: p.length === 0 ? /* @__PURE__ */
|
|
463
|
+
children: p.length === 0 ? /* @__PURE__ */ P("span", {
|
|
464
464
|
className: "text-xs text-muted-foreground",
|
|
465
465
|
"data-testid": "user-filters-empty",
|
|
466
466
|
children: "No filter fields"
|
|
467
|
-
}) : /* @__PURE__ */
|
|
467
|
+
}) : /* @__PURE__ */ F(N, { children: [g.map(S), v.length > 0 && /* @__PURE__ */ F(y, { children: [/* @__PURE__ */ P(x, {
|
|
468
468
|
asChild: !0,
|
|
469
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ F("button", {
|
|
470
470
|
"data-testid": "user-filters-more",
|
|
471
471
|
className: "inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md",
|
|
472
472
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ P("span", { children: l }),
|
|
474
|
+
/* @__PURE__ */ P("span", {
|
|
475
475
|
className: "text-[10px] text-muted-foreground/80 tabular-nums",
|
|
476
476
|
children: v.length
|
|
477
477
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ P(E, { className: "h-3 w-3 opacity-60" })
|
|
479
479
|
]
|
|
480
480
|
})
|
|
481
|
-
}), /* @__PURE__ */
|
|
481
|
+
}), /* @__PURE__ */ P(b, {
|
|
482
482
|
align: "start",
|
|
483
483
|
className: "w-64 p-2",
|
|
484
484
|
"data-testid": "user-filters-more-content",
|
|
485
|
-
children: /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ P("div", {
|
|
486
486
|
className: "space-y-1",
|
|
487
487
|
children: v.map(S)
|
|
488
488
|
})
|
|
489
489
|
})] })] })
|
|
490
490
|
});
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function B({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, className: i }) {
|
|
493
493
|
let [o, s] = a.useState(() => e.find((e) => e.default)?.id || (t ? "__all__" : e[0]?.id || "")), c = a.useCallback((t) => {
|
|
494
494
|
s(t), r(t === "__all__" ? [] : e.find((e) => e.id === t)?.filters || []);
|
|
495
495
|
}, [e, r]), l = a.useMemo(() => {
|
|
@@ -503,23 +503,23 @@ function V({ tabs: e, showAllRecords: t, allowAddTab: n, onFilterChange: r, clas
|
|
|
503
503
|
return a.useEffect(() => {
|
|
504
504
|
let t = e.find((e) => e.default);
|
|
505
505
|
t && r(t.filters || []);
|
|
506
|
-
}, []), /* @__PURE__ */
|
|
506
|
+
}, []), /* @__PURE__ */ F("div", {
|
|
507
507
|
className: C("flex items-center gap-0.5 overflow-x-auto", i),
|
|
508
508
|
"data-testid": "user-filters-tabs",
|
|
509
|
-
children: [l.map((e) => /* @__PURE__ */
|
|
509
|
+
children: [l.map((e) => /* @__PURE__ */ P("button", {
|
|
510
510
|
"data-testid": `filter-tab-${e.id}`,
|
|
511
511
|
onClick: () => c(e.id),
|
|
512
512
|
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"),
|
|
513
513
|
children: e.label
|
|
514
|
-
}, e.id)), n && /* @__PURE__ */
|
|
514
|
+
}, e.id)), n && /* @__PURE__ */ P("button", {
|
|
515
515
|
className: "inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0",
|
|
516
516
|
"data-testid": "filter-tab-add",
|
|
517
517
|
title: "Add filter tab",
|
|
518
|
-
children: /* @__PURE__ */
|
|
518
|
+
children: /* @__PURE__ */ P(M, { className: "h-3.5 w-3.5" })
|
|
519
519
|
})]
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Ve({ fields: e, onFilterChange: t, className: n }) {
|
|
523
523
|
let [r, i] = a.useState(() => {
|
|
524
524
|
let t = /* @__PURE__ */ new Set();
|
|
525
525
|
return e.forEach((e) => {
|
|
@@ -546,10 +546,10 @@ function Be({ fields: e, onFilterChange: t, className: n }) {
|
|
|
546
546
|
};
|
|
547
547
|
return a.useEffect(() => {
|
|
548
548
|
r.size > 0 && o(r);
|
|
549
|
-
}, []), /* @__PURE__ */
|
|
549
|
+
}, []), /* @__PURE__ */ P("div", {
|
|
550
550
|
className: C("flex items-center gap-1 overflow-x-auto", n),
|
|
551
551
|
"data-testid": "user-filters-toggle",
|
|
552
|
-
children: e.map((e) => /* @__PURE__ */
|
|
552
|
+
children: e.map((e) => /* @__PURE__ */ P(d, {
|
|
553
553
|
variant: r.has(e.field) ? "default" : "outline",
|
|
554
554
|
size: "sm",
|
|
555
555
|
className: "h-7 px-3 text-xs shrink-0",
|
|
@@ -561,7 +561,7 @@ function Be({ fields: e, onFilterChange: t, className: n }) {
|
|
|
561
561
|
}
|
|
562
562
|
//#endregion
|
|
563
563
|
//#region src/ListView.tsx
|
|
564
|
-
function
|
|
564
|
+
function He(e) {
|
|
565
565
|
switch (e) {
|
|
566
566
|
case "equals":
|
|
567
567
|
case "eq": return "=";
|
|
@@ -585,10 +585,10 @@ function Ve(e) {
|
|
|
585
585
|
default: return e;
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function V(e) {
|
|
589
589
|
if (!Array.isArray(e) || e.length < 3) return e;
|
|
590
590
|
let [t, n, r] = e;
|
|
591
|
-
return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ?
|
|
591
|
+
return typeof t == "string" && (t === "and" || t === "or") ? [t, ...e.slice(1).map((e) => Array.isArray(e) ? V(e) : e)] : n === "in" && Array.isArray(r) ? r.length === 0 ? [] : r.length === 1 ? [
|
|
592
592
|
t,
|
|
593
593
|
"=",
|
|
594
594
|
r[0]
|
|
@@ -606,15 +606,15 @@ function H(e) {
|
|
|
606
606
|
e
|
|
607
607
|
])] : e;
|
|
608
608
|
}
|
|
609
|
-
function He(e) {
|
|
610
|
-
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
611
|
-
}
|
|
612
609
|
function Ue(e) {
|
|
613
|
-
return
|
|
610
|
+
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
614
611
|
}
|
|
615
612
|
function We(e) {
|
|
613
|
+
return !Array.isArray(e) || e.length === 0 ? [] : e.map((e) => Array.isArray(e) ? V(e) : e).filter((e) => Array.isArray(e) && e.length > 0);
|
|
614
|
+
}
|
|
615
|
+
function Ge(e) {
|
|
616
616
|
if (!e || !e.conditions || e.conditions.length === 0) return [];
|
|
617
|
-
let t =
|
|
617
|
+
let t = We(e.conditions.map((e) => e.operator === "isEmpty" ? [
|
|
618
618
|
e.field,
|
|
619
619
|
"=",
|
|
620
620
|
null
|
|
@@ -624,12 +624,12 @@ function We(e) {
|
|
|
624
624
|
null
|
|
625
625
|
] : [
|
|
626
626
|
e.field,
|
|
627
|
-
|
|
627
|
+
He(e.operator),
|
|
628
628
|
e.value
|
|
629
629
|
]));
|
|
630
630
|
return t.length === 0 ? [] : t.length === 1 ? t[0] : [e.logic, ...t];
|
|
631
631
|
}
|
|
632
|
-
function
|
|
632
|
+
function H(e, t) {
|
|
633
633
|
if (!t || t.length === 0) return {};
|
|
634
634
|
for (let r of t) {
|
|
635
635
|
let t = !1, i = ("condition" in r ? r.condition : void 0) || ("expression" in r ? r.expression : void 0) || void 0;
|
|
@@ -664,7 +664,7 @@ function U(e, t) {
|
|
|
664
664
|
}
|
|
665
665
|
return {};
|
|
666
666
|
}
|
|
667
|
-
var
|
|
667
|
+
var Ke = {
|
|
668
668
|
"list.recordCount": "{{count}} records",
|
|
669
669
|
"list.recordCountOne": "{{count}} record",
|
|
670
670
|
"list.noItems": "No items found",
|
|
@@ -703,29 +703,29 @@ var Ge = {
|
|
|
703
703
|
"grid.toolbar.densityCycleShortHint": "Click to cycle",
|
|
704
704
|
"list.viewSettings": "View settings",
|
|
705
705
|
"list.viewSettingsHint": "Grouping, color, density, and visible fields."
|
|
706
|
-
},
|
|
707
|
-
let n =
|
|
706
|
+
}, qe = (e, t, n) => n, U = (e, t) => {
|
|
707
|
+
let n = Ke[e] || e;
|
|
708
708
|
if (t) for (let [e, r] of Object.entries(t)) n = n.replace(`{{${e}}}`, String(r));
|
|
709
709
|
return n;
|
|
710
710
|
};
|
|
711
|
-
function
|
|
711
|
+
function Je() {
|
|
712
712
|
try {
|
|
713
|
-
let e =
|
|
714
|
-
return e.t("list.recordCount") === "list.recordCount" ? { t:
|
|
713
|
+
let e = be();
|
|
714
|
+
return e.t("list.recordCount") === "list.recordCount" ? { t: U } : { t: e.t };
|
|
715
715
|
} catch {
|
|
716
|
-
return { t:
|
|
716
|
+
return { t: U };
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Ye() {
|
|
720
720
|
try {
|
|
721
|
-
let { fieldLabel: e } =
|
|
721
|
+
let { fieldLabel: e } = ye();
|
|
722
722
|
return { fieldLabel: e };
|
|
723
723
|
} catch {
|
|
724
|
-
return { fieldLabel:
|
|
724
|
+
return { fieldLabel: qe };
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
|
-
var
|
|
728
|
-
let { t: E } =
|
|
727
|
+
var Xe = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange: s, onSortChange: c, onSearchChange: l, onHiddenFieldsChange: u, onColumnStateChange: f, onRowClick: p, showViewSwitcher: _ = !1, ...w }, ee) => {
|
|
728
|
+
let { t: E } = Je(), { fieldLabel: ne } = Ye(), { translateOptions: D } = xe(), O = a.useMemo(() => e.viewType ? e : {
|
|
729
729
|
...e,
|
|
730
730
|
viewType: "grid"
|
|
731
731
|
}, [e]), k = a.useCallback((e, t) => O.objectName ? ne(O.objectName, e, t) : t, [O.objectName, ne]), A = a.useMemo(() => {
|
|
@@ -754,7 +754,7 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
754
754
|
O.compactToolbar,
|
|
755
755
|
O.addRecord,
|
|
756
756
|
O.userActions?.addRecordForm
|
|
757
|
-
]), [j,
|
|
757
|
+
]), [j, pe] = a.useState(O.viewType), [N, ye] = a.useState(""), [be, Ce] = a.useState(!1), [we, De] = a.useState(!1), [I, Ae] = a.useState(() => O.sort && O.sort.length > 0 ? O.sort.map((e) => {
|
|
758
758
|
if (typeof e == "string") {
|
|
759
759
|
let t = e.trim().split(/\s+/);
|
|
760
760
|
return {
|
|
@@ -768,9 +768,9 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
768
768
|
field: e.field,
|
|
769
769
|
order: e.order || "asc"
|
|
770
770
|
};
|
|
771
|
-
}) : []),
|
|
771
|
+
}) : []), je = a.useMemo(() => JSON.stringify(O.sort || []), [O.sort]);
|
|
772
772
|
a.useEffect(() => {
|
|
773
|
-
O.sort && O.sort.length > 0 ?
|
|
773
|
+
O.sort && O.sort.length > 0 ? Ae(O.sort.map((e) => {
|
|
774
774
|
if (typeof e == "string") {
|
|
775
775
|
let t = e.trim().split(/\s+/);
|
|
776
776
|
return {
|
|
@@ -784,41 +784,41 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
784
784
|
field: e.field,
|
|
785
785
|
order: e.order || "asc"
|
|
786
786
|
};
|
|
787
|
-
})) :
|
|
788
|
-
}, [
|
|
789
|
-
let [
|
|
787
|
+
})) : Ae([]);
|
|
788
|
+
}, [je]);
|
|
789
|
+
let [Me, Pe] = a.useState(!1), [L, R] = a.useState({
|
|
790
790
|
id: "root",
|
|
791
791
|
logic: "and",
|
|
792
792
|
conditions: []
|
|
793
|
-
}), [
|
|
793
|
+
}), [Le, Re] = a.useState(() => {
|
|
794
794
|
if (!(!O.tabs || O.tabs.length === 0)) return O.tabs.find((e) => e.isDefault)?.name ?? O.tabs[0]?.name;
|
|
795
|
-
}),
|
|
796
|
-
if (
|
|
795
|
+
}), Be = a.useCallback((e) => {
|
|
796
|
+
if (Re(e.name), e.filter) {
|
|
797
797
|
let t = {
|
|
798
798
|
id: `tab-filter-${e.name}`,
|
|
799
799
|
logic: e.filter.logic || "and",
|
|
800
800
|
conditions: e.filter.conditions || []
|
|
801
801
|
};
|
|
802
|
-
|
|
802
|
+
R(t), s?.(t);
|
|
803
803
|
} else {
|
|
804
804
|
let e = {
|
|
805
805
|
id: "root",
|
|
806
806
|
logic: "and",
|
|
807
807
|
conditions: []
|
|
808
808
|
};
|
|
809
|
-
|
|
809
|
+
R(e), s?.(e);
|
|
810
810
|
}
|
|
811
|
-
}, [s]),
|
|
812
|
-
a.useImperativeHandle(ee, () => ({ refresh: () =>
|
|
813
|
-
if (!(!
|
|
814
|
-
e.resource === O.objectName &&
|
|
811
|
+
}, [s]), z = w.dataSource, [B, Ve] = a.useState([]), [He, V] = a.useState(!1), [H, Ke] = a.useState(null), [qe, U] = a.useState(!1), [Xe, Ze] = a.useState(0), [Qe, $e] = a.useState(!1);
|
|
812
|
+
a.useImperativeHandle(ee, () => ({ refresh: () => Ze((e) => e + 1) }), []), a.useEffect(() => {
|
|
813
|
+
if (!(!z?.onMutation || !O.objectName || O.refreshTrigger)) return z.onMutation((e) => {
|
|
814
|
+
e.resource === O.objectName && Ze((e) => e + 1);
|
|
815
815
|
});
|
|
816
816
|
}, [
|
|
817
|
-
|
|
817
|
+
z,
|
|
818
818
|
O.objectName,
|
|
819
819
|
O.refreshTrigger
|
|
820
820
|
]);
|
|
821
|
-
let [
|
|
821
|
+
let [et, tt] = a.useState(void 0), nt = et ?? O.pagination?.pageSize ?? 100, W = a.useMemo(() => {
|
|
822
822
|
if (O.grouping?.fields?.length) return O.grouping;
|
|
823
823
|
let e = typeof O.groupBy == "string" ? O.groupBy.trim() : "", t = typeof O.groupBy2 == "string" ? O.groupBy2.trim() : "", n = [];
|
|
824
824
|
return e && n.push({
|
|
@@ -834,24 +834,24 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
834
834
|
O.grouping,
|
|
835
835
|
O.groupBy,
|
|
836
836
|
O.groupBy2
|
|
837
|
-
]), [
|
|
837
|
+
]), [G, rt] = a.useState(W), [it, at] = a.useState(!1), ot = a.useRef(W);
|
|
838
838
|
a.useEffect(() => {
|
|
839
|
-
|
|
840
|
-
}, [
|
|
841
|
-
let [
|
|
839
|
+
ot.current !== W && (ot.current = W, rt(W));
|
|
840
|
+
}, [W]);
|
|
841
|
+
let [K, st] = a.useState(O.rowColor), [ct, lt] = a.useState(!1), [ut, dt] = a.useState([]), ft = a.useRef(0), [pt, mt] = a.useState(() => {
|
|
842
842
|
let e = /* @__PURE__ */ new Set();
|
|
843
843
|
return O.quickFilters?.forEach((t) => {
|
|
844
844
|
let n = r(t);
|
|
845
845
|
n.defaultActive && e.add(n.id);
|
|
846
846
|
}), e;
|
|
847
|
-
}), [
|
|
847
|
+
}), [ht, gt] = a.useState([]), _t = a.useMemo(() => {
|
|
848
848
|
if (O.userFilters) return O.userFilters;
|
|
849
|
-
if (!
|
|
849
|
+
if (!H?.fields) return;
|
|
850
850
|
let e = new Set([
|
|
851
851
|
"select",
|
|
852
852
|
"multi-select",
|
|
853
853
|
"boolean"
|
|
854
|
-
]), t = [], n = Array.isArray(
|
|
854
|
+
]), t = [], n = Array.isArray(H.fields) ? H.fields.map((e) => [e.name, e]) : Object.entries(H.fields);
|
|
855
855
|
for (let [r, i] of n) (e.has(i.type) || i.options && !i.type) && t.push({
|
|
856
856
|
field: r,
|
|
857
857
|
label: k(r, i.label || r),
|
|
@@ -861,65 +861,65 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
861
861
|
element: "dropdown",
|
|
862
862
|
fields: t
|
|
863
863
|
};
|
|
864
|
-
}, [O.userFilters,
|
|
864
|
+
}, [O.userFilters, H]), [q, vt] = a.useState(() => new Set(O.hiddenFields || [])), yt = a.useMemo(() => JSON.stringify(O.hiddenFields || []), [O.hiddenFields]);
|
|
865
865
|
a.useEffect(() => {
|
|
866
|
-
|
|
867
|
-
}, [
|
|
868
|
-
let
|
|
869
|
-
|
|
870
|
-
}, [u]), [
|
|
866
|
+
vt(new Set(O.hiddenFields || []));
|
|
867
|
+
}, [yt]);
|
|
868
|
+
let bt = a.useCallback((e) => {
|
|
869
|
+
vt(e), u?.(Array.from(e));
|
|
870
|
+
}, [u]), [xt, St] = a.useState(!1), [Ct, wt] = a.useState(!1), J = a.useMemo(() => i(O.quickFilters), [O.quickFilters]), Y = a.useMemo(() => {
|
|
871
871
|
if (O.exportOptions) return Array.isArray(O.exportOptions) ? { formats: O.exportOptions } : O.exportOptions;
|
|
872
|
-
}, [O.exportOptions]),
|
|
872
|
+
}, [O.exportOptions]), X = Te(a.useMemo(() => O.densityMode ? O.densityMode : O.rowHeight ? {
|
|
873
873
|
compact: "compact",
|
|
874
874
|
short: "compact",
|
|
875
875
|
medium: "comfortable",
|
|
876
876
|
tall: "spacious",
|
|
877
877
|
extra_tall: "spacious"
|
|
878
|
-
}[O.rowHeight] || "comfortable" : "compact", [O.densityMode, O.rowHeight]), { onChange: O.onDensityChange }),
|
|
878
|
+
}[O.rowHeight] || "comfortable" : "compact", [O.densityMode, O.rowHeight]), { onChange: O.onDensityChange }), Tt = a.useMemo(() => `objectui:gallery:density:${O.objectName ?? "default"}`, [O.objectName]), [Z, Et] = a.useState(() => {
|
|
879
879
|
if (typeof window > "u") return O.gallery?.cardSize ?? "medium";
|
|
880
880
|
try {
|
|
881
|
-
let e = window.localStorage.getItem(
|
|
881
|
+
let e = window.localStorage.getItem(Tt);
|
|
882
882
|
if (e === "small" || e === "medium" || e === "large") return e;
|
|
883
883
|
} catch {}
|
|
884
884
|
return O.gallery?.cardSize ?? "medium";
|
|
885
|
-
}),
|
|
886
|
-
|
|
885
|
+
}), Dt = a.useCallback(() => {
|
|
886
|
+
Et((e) => {
|
|
887
887
|
let t = e === "large" ? "medium" : e === "medium" ? "small" : "large";
|
|
888
888
|
try {
|
|
889
|
-
window.localStorage.setItem(
|
|
889
|
+
window.localStorage.setItem(Tt, t);
|
|
890
890
|
} catch {}
|
|
891
891
|
return t;
|
|
892
892
|
});
|
|
893
|
-
}, [
|
|
893
|
+
}, [Tt]), { ref: Ot, isRefreshing: kt, pullDistance: At } = Oe({
|
|
894
894
|
onRefresh: a.useCallback(async () => {
|
|
895
|
-
|
|
895
|
+
Ze((e) => e + 1);
|
|
896
896
|
}, []),
|
|
897
|
-
enabled: !!
|
|
898
|
-
}),
|
|
897
|
+
enabled: !!z && !!O.objectName
|
|
898
|
+
}), jt = a.useMemo(() => O.id ? `listview-${O.objectName}-${O.id}-view` : `listview-${O.objectName}-view`, [O.objectName, O.id]);
|
|
899
899
|
a.useEffect(() => {
|
|
900
900
|
let e = !0;
|
|
901
|
-
return
|
|
902
|
-
if (!
|
|
903
|
-
|
|
901
|
+
return U(!1), Ke(null), (async () => {
|
|
902
|
+
if (!z || !O.objectName) {
|
|
903
|
+
U(!0);
|
|
904
904
|
return;
|
|
905
905
|
}
|
|
906
|
-
if (typeof
|
|
907
|
-
|
|
906
|
+
if (typeof z.getObjectSchema != "function") {
|
|
907
|
+
U(!0);
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
910
|
try {
|
|
911
|
-
let t = await
|
|
912
|
-
e &&
|
|
911
|
+
let t = await z.getObjectSchema(O.objectName);
|
|
912
|
+
e && Ke(t);
|
|
913
913
|
} catch (e) {
|
|
914
914
|
console.warn("Failed to fetch object schema for ListView:", e);
|
|
915
915
|
} finally {
|
|
916
|
-
e &&
|
|
916
|
+
e && U(!0);
|
|
917
917
|
}
|
|
918
918
|
})(), () => {
|
|
919
919
|
e = !1;
|
|
920
920
|
};
|
|
921
|
-
}, [O.objectName,
|
|
922
|
-
let
|
|
921
|
+
}, [O.objectName, z]);
|
|
922
|
+
let Mt = a.useMemo(() => {
|
|
923
923
|
let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], n = new Set(e), r = (e) => {
|
|
924
924
|
if (!e) return;
|
|
925
925
|
let t = [
|
|
@@ -946,9 +946,9 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
946
946
|
};
|
|
947
947
|
r(O.kanban), r(O.options?.kanban), r(O.calendar), r(O.options?.calendar), r(O.gallery), r(O.options?.gallery), r(O.timeline), r(O.options?.timeline), r(O.gantt), r(O.options?.gantt);
|
|
948
948
|
let i = n.size > 0 ? Array.from(n) : void 0;
|
|
949
|
-
return t(
|
|
949
|
+
return t(H?.fields, i);
|
|
950
950
|
}, [
|
|
951
|
-
|
|
951
|
+
H?.fields,
|
|
952
952
|
O.fields,
|
|
953
953
|
O.kanban,
|
|
954
954
|
O.calendar,
|
|
@@ -956,57 +956,57 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
956
956
|
O.timeline,
|
|
957
957
|
O.gantt,
|
|
958
958
|
O.options
|
|
959
|
-
]);
|
|
959
|
+
]), Q = ke();
|
|
960
960
|
a.useEffect(() => {
|
|
961
|
-
let e = !0, t = ++
|
|
961
|
+
let e = !0, t = ++ft.current;
|
|
962
962
|
if (O.data && typeof O.data == "object" && !Array.isArray(O.data)) {
|
|
963
963
|
let e = O.data;
|
|
964
964
|
if (e.provider === "value" && Array.isArray(e.items)) {
|
|
965
965
|
let t = e.items;
|
|
966
|
-
if (
|
|
967
|
-
let e =
|
|
966
|
+
if (N) {
|
|
967
|
+
let e = N.toLowerCase();
|
|
968
968
|
t = t.filter((t) => Object.values(t).some((t) => t != null && String(t).toLowerCase().includes(e)));
|
|
969
969
|
}
|
|
970
|
-
|
|
970
|
+
Ve(t), V(!1), $e(!1);
|
|
971
971
|
return;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
if (Array.isArray(O.data)) {
|
|
975
975
|
let e = O.data;
|
|
976
|
-
if (
|
|
977
|
-
let t =
|
|
976
|
+
if (N) {
|
|
977
|
+
let t = N.toLowerCase();
|
|
978
978
|
e = e.filter((e) => Object.values(e).some((e) => e != null && String(e).toLowerCase().includes(t)));
|
|
979
979
|
}
|
|
980
|
-
|
|
980
|
+
Ve(e), V(!1), $e(!1);
|
|
981
981
|
return;
|
|
982
982
|
}
|
|
983
|
-
return
|
|
984
|
-
if (!(!
|
|
985
|
-
|
|
983
|
+
return qe ? ((async () => {
|
|
984
|
+
if (!(!z || !O.objectName)) {
|
|
985
|
+
V(!0);
|
|
986
986
|
try {
|
|
987
|
-
let n = [], r = O.filters || [], i =
|
|
988
|
-
|
|
989
|
-
|
|
987
|
+
let n = [], r = O.filters || [], i = Ge(L), a = [];
|
|
988
|
+
J && pt.size > 0 && J.forEach((e) => {
|
|
989
|
+
pt.has(e.id) && e.filters && e.filters.length > 0 && a.push(e.filters);
|
|
990
990
|
});
|
|
991
|
-
let o =
|
|
991
|
+
let o = We(ht), s = [
|
|
992
992
|
...r.length > 0 ? [r] : [],
|
|
993
993
|
...i.length > 0 ? [i] : [],
|
|
994
994
|
...a,
|
|
995
995
|
...o
|
|
996
996
|
].filter((e) => Array.isArray(e) && e.length > 0);
|
|
997
997
|
s.length > 1 ? n = ["and", ...s] : s.length === 1 && (n = s[0]);
|
|
998
|
-
let c =
|
|
998
|
+
let c = I.length > 0 ? I.filter((e) => e.field).map((e) => ({
|
|
999
999
|
field: e.field,
|
|
1000
1000
|
order: e.order
|
|
1001
1001
|
})) : void 0, l = (() => {
|
|
1002
|
-
let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [];
|
|
1003
|
-
if (
|
|
1004
|
-
let
|
|
1005
|
-
for (let
|
|
1006
|
-
for (let e of
|
|
1007
|
-
let
|
|
1002
|
+
let e = Array.isArray(O.fields) ? O.fields.map((e) => typeof e == "string" ? e : e?.field).filter((e) => typeof e == "string" && e.length > 0) : [], t = Q?.isLoaded && O.objectName ? e.filter((e) => Q.checkField(O.objectName, e, "read")) : e;
|
|
1003
|
+
if (t.length === 0) return;
|
|
1004
|
+
let n = new Set(["id"]);
|
|
1005
|
+
for (let e of t) n.add(e);
|
|
1006
|
+
for (let e of Mt) n.add(e);
|
|
1007
|
+
let r = (e) => {
|
|
1008
1008
|
if (!e) return;
|
|
1009
|
-
let
|
|
1009
|
+
let t = [
|
|
1010
1010
|
e.groupField,
|
|
1011
1011
|
e.groupBy,
|
|
1012
1012
|
e.titleField,
|
|
@@ -1026,32 +1026,32 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1026
1026
|
...Array.isArray(e.visibleFields) ? e.visibleFields : [],
|
|
1027
1027
|
...Array.isArray(e.metaFields) ? e.metaFields : []
|
|
1028
1028
|
];
|
|
1029
|
-
for (let e of
|
|
1029
|
+
for (let e of t) typeof e == "string" && e && n.add(e);
|
|
1030
1030
|
};
|
|
1031
|
-
|
|
1031
|
+
r(O.kanban), r(O.options?.kanban), r(O.calendar), r(O.options?.calendar), r(O.gallery), r(O.options?.gallery), r(O.timeline), r(O.options?.timeline);
|
|
1032
1032
|
{
|
|
1033
1033
|
let e = O.timeline ?? O.options?.timeline;
|
|
1034
|
-
e && !Array.isArray(e.metaFields) && (
|
|
1034
|
+
e && !Array.isArray(e.metaFields) && (n.add("status"), n.add("priority"));
|
|
1035
1035
|
}
|
|
1036
|
-
return
|
|
1037
|
-
})(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await
|
|
1036
|
+
return r(O.gantt), r(O.options?.gantt), Array.from(n);
|
|
1037
|
+
})(), u = Array.isArray(n) ? n.length > 0 : !!n && Object.keys(n).length > 0, d = await z.find(O.objectName, {
|
|
1038
1038
|
...u ? { $filter: n } : {},
|
|
1039
1039
|
$orderby: c,
|
|
1040
|
-
$top:
|
|
1040
|
+
$top: nt,
|
|
1041
1041
|
...l ? { $select: l } : {},
|
|
1042
|
-
...
|
|
1043
|
-
...
|
|
1044
|
-
$search:
|
|
1042
|
+
...Mt.length > 0 ? { $expand: Mt } : {},
|
|
1043
|
+
...N ? {
|
|
1044
|
+
$search: N,
|
|
1045
1045
|
...O.searchableFields && O.searchableFields.length > 0 ? { $searchFields: O.searchableFields } : {}
|
|
1046
1046
|
} : {}
|
|
1047
1047
|
});
|
|
1048
|
-
if (!e || t !==
|
|
1048
|
+
if (!e || t !== ft.current) return;
|
|
1049
1049
|
let f = [];
|
|
1050
|
-
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)),
|
|
1050
|
+
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)), Ve(f), $e(f.length >= nt);
|
|
1051
1051
|
} catch (e) {
|
|
1052
|
-
t ===
|
|
1052
|
+
t === ft.current && console.error("ListView data fetch error:", e);
|
|
1053
1053
|
} finally {
|
|
1054
|
-
e && t ===
|
|
1054
|
+
e && t === ft.current && V(!1);
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
})(), () => {
|
|
@@ -1060,22 +1060,23 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1060
1060
|
}, [
|
|
1061
1061
|
O.objectName,
|
|
1062
1062
|
O.data,
|
|
1063
|
-
|
|
1063
|
+
z,
|
|
1064
1064
|
O.filters,
|
|
1065
|
-
|
|
1065
|
+
nt,
|
|
1066
|
+
I,
|
|
1066
1067
|
L,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
P,
|
|
1068
|
+
pt,
|
|
1069
|
+
J,
|
|
1070
|
+
ht,
|
|
1071
|
+
Xe,
|
|
1072
|
+
N,
|
|
1073
1073
|
O.searchableFields,
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
O.refreshTrigger
|
|
1074
|
+
Mt,
|
|
1075
|
+
qe,
|
|
1076
|
+
O.refreshTrigger,
|
|
1077
|
+
Q
|
|
1077
1078
|
]);
|
|
1078
|
-
let
|
|
1079
|
+
let Nt = a.useMemo(() => {
|
|
1079
1080
|
if (O.appearance?.allowedVisualizations && O.appearance.allowedVisualizations.length > 0) return O.appearance.allowedVisualizations.filter((e) => [
|
|
1080
1081
|
"grid",
|
|
1081
1082
|
"kanban",
|
|
@@ -1106,31 +1107,31 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1106
1107
|
O.appearance?.allowedVisualizations
|
|
1107
1108
|
]);
|
|
1108
1109
|
a.useEffect(() => {
|
|
1109
|
-
O.viewType &&
|
|
1110
|
+
O.viewType && pe(O.viewType);
|
|
1110
1111
|
}, [O.viewType]);
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1112
|
+
let Pt = a.useCallback((e) => {
|
|
1113
|
+
pe(e);
|
|
1113
1114
|
try {
|
|
1114
|
-
localStorage.setItem(
|
|
1115
|
+
localStorage.setItem(jt, e);
|
|
1115
1116
|
} catch (e) {
|
|
1116
1117
|
console.warn("Failed to save view preference to localStorage:", e);
|
|
1117
1118
|
}
|
|
1118
1119
|
o?.(e);
|
|
1119
|
-
}, [
|
|
1120
|
-
|
|
1121
|
-
}, [l]),
|
|
1120
|
+
}, [jt, o]), Ft = a.useCallback((e) => {
|
|
1121
|
+
ye(e), l?.(e);
|
|
1122
|
+
}, [l]), It = Ee({
|
|
1122
1123
|
navigation: O.navigation,
|
|
1123
1124
|
objectName: O.objectName,
|
|
1124
1125
|
onNavigate: O.onNavigate,
|
|
1125
1126
|
onRowClick: p
|
|
1126
|
-
}),
|
|
1127
|
+
}), $ = a.useMemo(() => {
|
|
1127
1128
|
let e = O.fields || [];
|
|
1128
|
-
if (Array.isArray(e) || (e = []),
|
|
1129
|
+
if (Array.isArray(e) || (e = []), Q?.isLoaded && O.objectName && (e = e.filter((e) => {
|
|
1129
1130
|
let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
|
|
1130
|
-
return t ?
|
|
1131
|
-
})),
|
|
1131
|
+
return t ? Q.checkField(O.objectName, t, "read") : !0;
|
|
1132
|
+
})), q.size > 0 && (e = e.filter((e) => {
|
|
1132
1133
|
let t = typeof e == "string" ? e : e?.name || e?.fieldName || e?.field;
|
|
1133
|
-
return t != null && !
|
|
1134
|
+
return t != null && !q.has(t);
|
|
1134
1135
|
})), O.fieldOrder && O.fieldOrder.length > 0) {
|
|
1135
1136
|
let t = new Map(O.fieldOrder.map((e, t) => [e, t]));
|
|
1136
1137
|
e = [...e].sort((e, n) => {
|
|
@@ -1142,18 +1143,18 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1142
1143
|
}, [
|
|
1143
1144
|
O.fields,
|
|
1144
1145
|
O.objectName,
|
|
1145
|
-
|
|
1146
|
+
q,
|
|
1146
1147
|
O.fieldOrder,
|
|
1147
|
-
|
|
1148
|
+
Q
|
|
1148
1149
|
]), Lt = a.useMemo(() => {
|
|
1149
|
-
let e =
|
|
1150
|
+
let e = X.mode === "compact" ? "compact" : X.mode === "spacious" ? "tall" : "medium", t = {
|
|
1150
1151
|
objectName: O.objectName,
|
|
1151
1152
|
fields: $,
|
|
1152
1153
|
filters: O.filters,
|
|
1153
|
-
sort:
|
|
1154
|
+
sort: I,
|
|
1154
1155
|
className: "h-full w-full",
|
|
1155
1156
|
showSearch: !1,
|
|
1156
|
-
onRowClick:
|
|
1157
|
+
onRowClick: It.handleClick,
|
|
1157
1158
|
rowHeight: e,
|
|
1158
1159
|
hideRowHeightToggle: !0,
|
|
1159
1160
|
...O.striped == null ? {} : { striped: O.striped },
|
|
@@ -1173,8 +1174,8 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1173
1174
|
...O.resizable == null ? {} : { resizable: O.resizable },
|
|
1174
1175
|
...O.selection ? { selection: O.selection } : {},
|
|
1175
1176
|
...O.pagination ? { pagination: O.pagination } : {},
|
|
1176
|
-
...
|
|
1177
|
-
...
|
|
1177
|
+
...G ? { grouping: G } : {},
|
|
1178
|
+
...K ? { rowColor: K } : {},
|
|
1178
1179
|
...O.rowActions ? { rowActions: O.rowActions } : {},
|
|
1179
1180
|
...O.rowActionDefs ? { rowActionDefs: O.rowActionDefs } : {},
|
|
1180
1181
|
...O.bulkActions ? { batchActions: O.bulkActions } : {},
|
|
@@ -1188,7 +1189,7 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1188
1189
|
groupField: O.kanban?.groupField || O.options?.kanban?.groupField || "status",
|
|
1189
1190
|
...O.kanban?.titleField || O.options?.kanban?.titleField ? { titleField: O.kanban?.titleField || O.options?.kanban?.titleField } : {},
|
|
1190
1191
|
cardFields: O.kanban?.cardFields || $ || [],
|
|
1191
|
-
...
|
|
1192
|
+
...G ? { grouping: G } : {},
|
|
1192
1193
|
...O.options?.kanban || {},
|
|
1193
1194
|
...O.kanban || {}
|
|
1194
1195
|
};
|
|
@@ -1206,7 +1207,7 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1206
1207
|
let e = {
|
|
1207
1208
|
...O.options?.gallery || {},
|
|
1208
1209
|
...O.gallery || {},
|
|
1209
|
-
cardSize:
|
|
1210
|
+
cardSize: Z
|
|
1210
1211
|
};
|
|
1211
1212
|
return {
|
|
1212
1213
|
type: "object-gallery",
|
|
@@ -1215,7 +1216,7 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1215
1216
|
imageField: O.gallery?.coverField || O.gallery?.imageField || O.options?.gallery?.imageField,
|
|
1216
1217
|
titleField: O.gallery?.titleField || O.options?.gallery?.titleField || "name",
|
|
1217
1218
|
subtitleField: O.gallery?.subtitleField || O.options?.gallery?.subtitleField,
|
|
1218
|
-
...
|
|
1219
|
+
...G ? { grouping: G } : {}
|
|
1219
1220
|
};
|
|
1220
1221
|
}
|
|
1221
1222
|
case "timeline": {
|
|
@@ -1257,14 +1258,14 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1257
1258
|
}, [
|
|
1258
1259
|
j,
|
|
1259
1260
|
O,
|
|
1260
|
-
|
|
1261
|
+
I,
|
|
1261
1262
|
$,
|
|
1263
|
+
G,
|
|
1262
1264
|
K,
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
Z
|
|
1266
|
-
|
|
1267
|
-
]), Rt = R.conditions && R.conditions.length > 0, zt = a.useMemo(() => {
|
|
1265
|
+
It.handleClick,
|
|
1266
|
+
X.mode,
|
|
1267
|
+
Z
|
|
1268
|
+
]), Rt = L.conditions && L.conditions.length > 0, zt = a.useMemo(() => {
|
|
1268
1269
|
let e, t = (e, t) => {
|
|
1269
1270
|
if (!t) return;
|
|
1270
1271
|
let n = Array.isArray(t) ? t.map((e) => ({
|
|
@@ -1278,7 +1279,7 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1278
1279
|
}));
|
|
1279
1280
|
return O.objectName ? D(O.objectName, e, n) : n;
|
|
1280
1281
|
};
|
|
1281
|
-
if (e =
|
|
1282
|
+
if (e = H?.fields ? Object.entries(H.fields).map(([e, n]) => ({
|
|
1282
1283
|
value: e,
|
|
1283
1284
|
label: k(e, n.label || e),
|
|
1284
1285
|
type: n.type || "text",
|
|
@@ -1308,19 +1309,19 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1308
1309
|
}
|
|
1309
1310
|
return e;
|
|
1310
1311
|
}, [
|
|
1311
|
-
|
|
1312
|
+
H,
|
|
1312
1313
|
O.fields,
|
|
1313
1314
|
O.filterableFields,
|
|
1314
1315
|
O.objectName,
|
|
1315
1316
|
k,
|
|
1316
1317
|
D
|
|
1317
1318
|
]), Bt = a.useCallback((e) => {
|
|
1318
|
-
|
|
1319
|
+
mt((t) => {
|
|
1319
1320
|
let n = new Set(t);
|
|
1320
1321
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
1321
1322
|
});
|
|
1322
1323
|
}, []), Vt = a.useCallback((e) => {
|
|
1323
|
-
let t =
|
|
1324
|
+
let t = Y, n = t?.maxRecords || 0, r = t?.includeHeaders !== !1, i = t?.fileNamePrefix || O.objectName || "export", a = n > 0 ? B.slice(0, n) : B;
|
|
1324
1325
|
if (e === "csv") {
|
|
1325
1326
|
let e = $.map((e) => typeof e == "string" ? e : e.name || e.fieldName || e.field), t = [];
|
|
1326
1327
|
r && t.push(e.join(",")), a.forEach((n) => {
|
|
@@ -1335,11 +1336,11 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1335
1336
|
let e = new Blob([JSON.stringify(a, null, 2)], { type: "application/json" }), t = URL.createObjectURL(e), n = document.createElement("a");
|
|
1336
1337
|
n.href = t, n.download = `${i}.json`, n.click(), URL.revokeObjectURL(t);
|
|
1337
1338
|
}
|
|
1338
|
-
|
|
1339
|
+
wt(!1);
|
|
1339
1340
|
}, [
|
|
1340
|
-
|
|
1341
|
+
B,
|
|
1341
1342
|
$,
|
|
1342
|
-
|
|
1343
|
+
Y,
|
|
1343
1344
|
O.objectName
|
|
1344
1345
|
]), Ht = a.useMemo(() => (O.fields || []).map((e) => {
|
|
1345
1346
|
if (typeof e == "string") return {
|
|
@@ -1352,110 +1353,110 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1352
1353
|
label: k(t, e.label || e.name || e.field)
|
|
1353
1354
|
};
|
|
1354
1355
|
}), [O.fields, k]);
|
|
1355
|
-
return /* @__PURE__ */
|
|
1356
|
-
ref:
|
|
1356
|
+
return /* @__PURE__ */ F("div", {
|
|
1357
|
+
ref: Ot,
|
|
1357
1358
|
className: C("flex flex-col h-full bg-background relative min-w-0 overflow-hidden", n),
|
|
1358
1359
|
...O.aria?.label ? { "aria-label": O.aria.label } : {},
|
|
1359
1360
|
...O.aria?.describedBy ? { "aria-describedby": O.aria.describedBy } : {},
|
|
1360
1361
|
...O.aria?.live ? { "aria-live": O.aria.live } : {},
|
|
1361
1362
|
role: "region",
|
|
1362
1363
|
children: [
|
|
1363
|
-
|
|
1364
|
+
At > 0 && /* @__PURE__ */ P("div", {
|
|
1364
1365
|
className: "flex items-center justify-center text-xs text-muted-foreground",
|
|
1365
|
-
style: { height:
|
|
1366
|
-
children: E(
|
|
1366
|
+
style: { height: At },
|
|
1367
|
+
children: E(kt ? "list.refreshing" : "list.pullToRefresh")
|
|
1367
1368
|
}),
|
|
1368
|
-
_ && /* @__PURE__ */
|
|
1369
|
+
_ && /* @__PURE__ */ P("div", {
|
|
1369
1370
|
className: "px-4 py-1 flex items-center bg-background",
|
|
1370
|
-
children: /* @__PURE__ */
|
|
1371
|
+
children: /* @__PURE__ */ P(Ne, {
|
|
1371
1372
|
currentView: j,
|
|
1372
|
-
availableViews:
|
|
1373
|
-
onViewChange:
|
|
1373
|
+
availableViews: Nt,
|
|
1374
|
+
onViewChange: Pt
|
|
1374
1375
|
})
|
|
1375
1376
|
}),
|
|
1376
|
-
O.description && O.appearance?.showDescription !== !1 && /* @__PURE__ */
|
|
1377
|
+
O.description && O.appearance?.showDescription !== !1 && /* @__PURE__ */ P("div", {
|
|
1377
1378
|
className: "px-4 pt-1.5 text-xs text-muted-foreground bg-background",
|
|
1378
1379
|
"data-testid": "view-description",
|
|
1379
1380
|
children: typeof O.description == "string" ? O.description : ""
|
|
1380
1381
|
}),
|
|
1381
|
-
/* @__PURE__ */
|
|
1382
|
-
className: "border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background",
|
|
1383
|
-
children: [/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ F("div", {
|
|
1383
|
+
className: "border-b px-2 sm:px-4 py-1.5 flex items-center justify-between gap-1 sm:gap-2 bg-background",
|
|
1384
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1384
1385
|
className: "flex items-center gap-2 overflow-x-auto min-w-0",
|
|
1385
1386
|
children: [
|
|
1386
|
-
O.tabs && O.tabs.length > 0 && /* @__PURE__ */
|
|
1387
|
+
O.tabs && O.tabs.length > 0 && /* @__PURE__ */ P(Fe, {
|
|
1387
1388
|
tabs: O.tabs,
|
|
1388
|
-
activeTab:
|
|
1389
|
-
onTabChange:
|
|
1389
|
+
activeTab: Le,
|
|
1390
|
+
onTabChange: Be,
|
|
1390
1391
|
className: "!px-0 !py-0 shrink-0"
|
|
1391
1392
|
}),
|
|
1392
|
-
O.tabs && O.tabs.length > 0 &&
|
|
1393
|
-
|
|
1393
|
+
O.tabs && O.tabs.length > 0 && _t && /* @__PURE__ */ P("div", { className: "h-4 w-px bg-border/60 mx-1 shrink-0" }),
|
|
1394
|
+
_t && /* @__PURE__ */ P("div", {
|
|
1394
1395
|
className: "shrink-0 min-w-0",
|
|
1395
1396
|
"data-testid": "user-filters",
|
|
1396
|
-
children: /* @__PURE__ */
|
|
1397
|
-
config:
|
|
1398
|
-
objectDef:
|
|
1399
|
-
data:
|
|
1400
|
-
onFilterChange:
|
|
1397
|
+
children: /* @__PURE__ */ P(ze, {
|
|
1398
|
+
config: _t,
|
|
1399
|
+
objectDef: H,
|
|
1400
|
+
data: B,
|
|
1401
|
+
onFilterChange: gt,
|
|
1401
1402
|
maxVisible: 3
|
|
1402
1403
|
})
|
|
1403
1404
|
})
|
|
1404
1405
|
]
|
|
1405
|
-
}), /* @__PURE__ */
|
|
1406
|
-
className: "flex items-center gap-0 shrink-0",
|
|
1406
|
+
}), /* @__PURE__ */ F("div", {
|
|
1407
|
+
className: "flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm",
|
|
1407
1408
|
children: [
|
|
1408
|
-
A.showHideFields && !A.compactToolbar && /* @__PURE__ */
|
|
1409
|
-
open:
|
|
1410
|
-
onOpenChange:
|
|
1411
|
-
children: [/* @__PURE__ */
|
|
1409
|
+
A.showHideFields && !A.compactToolbar && /* @__PURE__ */ F(y, {
|
|
1410
|
+
open: xt,
|
|
1411
|
+
onOpenChange: St,
|
|
1412
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1412
1413
|
asChild: !0,
|
|
1413
|
-
children: /* @__PURE__ */
|
|
1414
|
+
children: /* @__PURE__ */ F(d, {
|
|
1414
1415
|
variant: "ghost",
|
|
1415
1416
|
size: "sm",
|
|
1416
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1417
|
+
className: C("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", q.size > 0 && "text-primary"),
|
|
1417
1418
|
children: [
|
|
1418
|
-
/* @__PURE__ */
|
|
1419
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ P(ie, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1420
|
+
/* @__PURE__ */ P("span", {
|
|
1420
1421
|
className: "hidden sm:inline",
|
|
1421
1422
|
children: E("list.hideFields")
|
|
1422
1423
|
}),
|
|
1423
|
-
|
|
1424
|
+
q.size > 0 && /* @__PURE__ */ P("span", {
|
|
1424
1425
|
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1425
|
-
children:
|
|
1426
|
+
children: q.size
|
|
1426
1427
|
})
|
|
1427
1428
|
]
|
|
1428
1429
|
})
|
|
1429
|
-
}), /* @__PURE__ */
|
|
1430
|
+
}), /* @__PURE__ */ P(b, {
|
|
1430
1431
|
align: "start",
|
|
1431
1432
|
className: "w-64 p-3",
|
|
1432
|
-
children: /* @__PURE__ */
|
|
1433
|
+
children: /* @__PURE__ */ F("div", {
|
|
1433
1434
|
className: "space-y-2",
|
|
1434
|
-
children: [/* @__PURE__ */
|
|
1435
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1435
1436
|
className: "flex items-center justify-between border-b pb-2",
|
|
1436
|
-
children: [/* @__PURE__ */
|
|
1437
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
1437
1438
|
className: "font-medium text-sm",
|
|
1438
1439
|
children: E("list.hideFieldsTitle")
|
|
1439
|
-
}),
|
|
1440
|
+
}), q.size > 0 && /* @__PURE__ */ P(d, {
|
|
1440
1441
|
variant: "ghost",
|
|
1441
1442
|
size: "sm",
|
|
1442
1443
|
className: "h-6 px-2 text-xs",
|
|
1443
|
-
onClick: () =>
|
|
1444
|
+
onClick: () => bt(/* @__PURE__ */ new Set()),
|
|
1444
1445
|
children: E("list.showAll")
|
|
1445
1446
|
})]
|
|
1446
|
-
}), /* @__PURE__ */
|
|
1447
|
+
}), /* @__PURE__ */ P("div", {
|
|
1447
1448
|
className: "max-h-60 overflow-y-auto space-y-1",
|
|
1448
|
-
children: Ht.map((e) => /* @__PURE__ */
|
|
1449
|
+
children: Ht.map((e) => /* @__PURE__ */ F("label", {
|
|
1449
1450
|
className: "flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer",
|
|
1450
|
-
children: [/* @__PURE__ */
|
|
1451
|
+
children: [/* @__PURE__ */ P("input", {
|
|
1451
1452
|
type: "checkbox",
|
|
1452
|
-
checked: !
|
|
1453
|
+
checked: !q.has(e.name),
|
|
1453
1454
|
onChange: () => {
|
|
1454
|
-
let t = new Set(
|
|
1455
|
-
t.has(e.name) ? t.delete(e.name) : t.add(e.name),
|
|
1455
|
+
let t = new Set(q);
|
|
1456
|
+
t.has(e.name) ? t.delete(e.name) : t.add(e.name), bt(t);
|
|
1456
1457
|
},
|
|
1457
1458
|
className: "rounded border-input"
|
|
1458
|
-
}), /* @__PURE__ */
|
|
1459
|
+
}), /* @__PURE__ */ P("span", {
|
|
1459
1460
|
className: "truncate",
|
|
1460
1461
|
children: e.label
|
|
1461
1462
|
})]
|
|
@@ -1464,92 +1465,92 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1464
1465
|
})
|
|
1465
1466
|
})]
|
|
1466
1467
|
}),
|
|
1467
|
-
A.showHideFields && !A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && /* @__PURE__ */
|
|
1468
|
-
A.showFilters && /* @__PURE__ */
|
|
1469
|
-
open:
|
|
1470
|
-
onOpenChange:
|
|
1471
|
-
children: [/* @__PURE__ */
|
|
1468
|
+
A.showHideFields && !A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && /* @__PURE__ */ P("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
|
|
1469
|
+
A.showFilters && /* @__PURE__ */ F(y, {
|
|
1470
|
+
open: Me,
|
|
1471
|
+
onOpenChange: Pe,
|
|
1472
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1472
1473
|
asChild: !0,
|
|
1473
|
-
children: /* @__PURE__ */
|
|
1474
|
+
children: /* @__PURE__ */ F(d, {
|
|
1474
1475
|
variant: "ghost",
|
|
1475
1476
|
size: "sm",
|
|
1476
1477
|
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", Rt && "text-foreground font-medium"),
|
|
1477
1478
|
children: [
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1479
|
+
/* @__PURE__ */ P(he, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1480
|
+
/* @__PURE__ */ P("span", {
|
|
1480
1481
|
className: "hidden sm:inline",
|
|
1481
1482
|
children: E("list.filter")
|
|
1482
1483
|
}),
|
|
1483
|
-
Rt && /* @__PURE__ */
|
|
1484
|
+
Rt && /* @__PURE__ */ P("span", {
|
|
1484
1485
|
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1485
|
-
children:
|
|
1486
|
+
children: L.conditions?.length || 0
|
|
1486
1487
|
})
|
|
1487
1488
|
]
|
|
1488
1489
|
})
|
|
1489
|
-
}), /* @__PURE__ */
|
|
1490
|
+
}), /* @__PURE__ */ P(b, {
|
|
1490
1491
|
align: "start",
|
|
1491
1492
|
className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
|
|
1492
|
-
children: /* @__PURE__ */
|
|
1493
|
+
children: /* @__PURE__ */ F("div", {
|
|
1493
1494
|
className: "space-y-4",
|
|
1494
|
-
children: [/* @__PURE__ */
|
|
1495
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1495
1496
|
className: "flex items-center justify-between border-b pb-2",
|
|
1496
|
-
children: /* @__PURE__ */
|
|
1497
|
+
children: /* @__PURE__ */ P("h4", {
|
|
1497
1498
|
className: "font-medium text-sm",
|
|
1498
1499
|
children: E("list.filterRecords")
|
|
1499
1500
|
})
|
|
1500
|
-
}), /* @__PURE__ */
|
|
1501
|
+
}), /* @__PURE__ */ P(m, {
|
|
1501
1502
|
fields: zt,
|
|
1502
|
-
value:
|
|
1503
|
+
value: L,
|
|
1503
1504
|
onChange: (e) => {
|
|
1504
|
-
|
|
1505
|
+
R(e), s && s(e);
|
|
1505
1506
|
}
|
|
1506
1507
|
})]
|
|
1507
1508
|
})
|
|
1508
1509
|
})]
|
|
1509
1510
|
}),
|
|
1510
|
-
A.showGroup && !A.compactToolbar && /* @__PURE__ */
|
|
1511
|
-
open:
|
|
1512
|
-
onOpenChange:
|
|
1513
|
-
children: [/* @__PURE__ */
|
|
1511
|
+
A.showGroup && !A.compactToolbar && /* @__PURE__ */ F(y, {
|
|
1512
|
+
open: it,
|
|
1513
|
+
onOpenChange: at,
|
|
1514
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1514
1515
|
asChild: !0,
|
|
1515
|
-
children: /* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ F(d, {
|
|
1516
1517
|
variant: "ghost",
|
|
1517
1518
|
size: "sm",
|
|
1518
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1519
|
+
className: C("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", G && "text-foreground font-medium"),
|
|
1519
1520
|
children: [
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ P(ae, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1522
|
+
/* @__PURE__ */ P("span", {
|
|
1522
1523
|
className: "hidden sm:inline",
|
|
1523
1524
|
children: E("list.group")
|
|
1524
1525
|
}),
|
|
1525
|
-
|
|
1526
|
+
G && G.fields?.length > 0 && /* @__PURE__ */ P("span", {
|
|
1526
1527
|
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1527
|
-
children:
|
|
1528
|
+
children: G.fields.length
|
|
1528
1529
|
})
|
|
1529
1530
|
]
|
|
1530
1531
|
})
|
|
1531
|
-
}), /* @__PURE__ */
|
|
1532
|
+
}), /* @__PURE__ */ P(b, {
|
|
1532
1533
|
align: "start",
|
|
1533
1534
|
className: "w-72 p-3",
|
|
1534
|
-
children: /* @__PURE__ */
|
|
1535
|
+
children: /* @__PURE__ */ F("div", {
|
|
1535
1536
|
className: "space-y-2",
|
|
1536
|
-
children: [/* @__PURE__ */
|
|
1537
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1537
1538
|
className: "flex items-center justify-between border-b pb-2",
|
|
1538
|
-
children: [/* @__PURE__ */
|
|
1539
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
1539
1540
|
className: "font-medium text-sm",
|
|
1540
1541
|
children: E("list.groupBy")
|
|
1541
|
-
}),
|
|
1542
|
+
}), G && /* @__PURE__ */ P(d, {
|
|
1542
1543
|
variant: "ghost",
|
|
1543
1544
|
size: "sm",
|
|
1544
1545
|
className: "h-6 px-2 text-xs",
|
|
1545
|
-
onClick: () =>
|
|
1546
|
+
onClick: () => rt(void 0),
|
|
1546
1547
|
"data-testid": "clear-grouping",
|
|
1547
1548
|
children: E("list.clear")
|
|
1548
1549
|
})]
|
|
1549
|
-
}), /* @__PURE__ */
|
|
1550
|
+
}), /* @__PURE__ */ P("div", {
|
|
1550
1551
|
"data-testid": "group-field-list",
|
|
1551
|
-
children: /* @__PURE__ */
|
|
1552
|
-
value:
|
|
1552
|
+
children: /* @__PURE__ */ P(h, {
|
|
1553
|
+
value: G,
|
|
1553
1554
|
fieldOptions: Ht.map((e) => ({
|
|
1554
1555
|
value: e.name,
|
|
1555
1556
|
label: e.label || e.name
|
|
@@ -1560,108 +1561,108 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1560
1561
|
collapseTitle: E("list.collapsedByDefault", { defaultValue: "Collapsed by default" }),
|
|
1561
1562
|
removeTitle: E("list.removeGroup", { defaultValue: "Remove" })
|
|
1562
1563
|
},
|
|
1563
|
-
onChange: (e) =>
|
|
1564
|
+
onChange: (e) => rt(e)
|
|
1564
1565
|
})
|
|
1565
1566
|
})]
|
|
1566
1567
|
})
|
|
1567
1568
|
})]
|
|
1568
1569
|
}),
|
|
1569
|
-
A.showSort && /* @__PURE__ */
|
|
1570
|
-
open:
|
|
1571
|
-
onOpenChange:
|
|
1572
|
-
children: [/* @__PURE__ */
|
|
1570
|
+
A.showSort && /* @__PURE__ */ F(y, {
|
|
1571
|
+
open: we,
|
|
1572
|
+
onOpenChange: De,
|
|
1573
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1573
1574
|
asChild: !0,
|
|
1574
|
-
children: /* @__PURE__ */
|
|
1575
|
+
children: /* @__PURE__ */ F(d, {
|
|
1575
1576
|
variant: "ghost",
|
|
1576
1577
|
size: "sm",
|
|
1577
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1578
|
+
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", I.length > 0 && "text-foreground font-medium"),
|
|
1578
1579
|
children: [
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ P(T, { className: "h-3.5 w-3.5 mr-1.5" }),
|
|
1581
|
+
/* @__PURE__ */ P("span", {
|
|
1581
1582
|
className: "hidden sm:inline",
|
|
1582
1583
|
children: E("list.sort")
|
|
1583
1584
|
}),
|
|
1584
|
-
|
|
1585
|
+
I.length > 0 && /* @__PURE__ */ P("span", {
|
|
1585
1586
|
className: "ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums",
|
|
1586
|
-
children:
|
|
1587
|
+
children: I.length
|
|
1587
1588
|
})
|
|
1588
1589
|
]
|
|
1589
1590
|
})
|
|
1590
|
-
}), /* @__PURE__ */
|
|
1591
|
+
}), /* @__PURE__ */ P(b, {
|
|
1591
1592
|
align: "start",
|
|
1592
1593
|
className: "w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4",
|
|
1593
|
-
children: /* @__PURE__ */
|
|
1594
|
+
children: /* @__PURE__ */ F("div", {
|
|
1594
1595
|
className: "space-y-4",
|
|
1595
|
-
children: [/* @__PURE__ */
|
|
1596
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1596
1597
|
className: "flex items-center justify-between border-b pb-2",
|
|
1597
|
-
children: /* @__PURE__ */
|
|
1598
|
+
children: /* @__PURE__ */ P("h4", {
|
|
1598
1599
|
className: "font-medium text-sm",
|
|
1599
1600
|
children: E("list.sortRecords")
|
|
1600
1601
|
})
|
|
1601
|
-
}), /* @__PURE__ */
|
|
1602
|
+
}), /* @__PURE__ */ P(S, {
|
|
1602
1603
|
fields: zt,
|
|
1603
|
-
value:
|
|
1604
|
+
value: I,
|
|
1604
1605
|
onChange: (e) => {
|
|
1605
|
-
|
|
1606
|
+
Ae(e), c && c(e);
|
|
1606
1607
|
}
|
|
1607
1608
|
})]
|
|
1608
1609
|
})
|
|
1609
1610
|
})]
|
|
1610
1611
|
}),
|
|
1611
|
-
!A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && (A.showColor || A.showDensity) && /* @__PURE__ */
|
|
1612
|
-
A.showColor && !A.compactToolbar && /* @__PURE__ */
|
|
1613
|
-
open:
|
|
1614
|
-
onOpenChange:
|
|
1615
|
-
children: [/* @__PURE__ */
|
|
1612
|
+
!A.compactToolbar && (A.showFilters || A.showSort || A.showGroup) && (A.showColor || A.showDensity) && /* @__PURE__ */ P("div", { className: "hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0" }),
|
|
1613
|
+
A.showColor && !A.compactToolbar && /* @__PURE__ */ F(y, {
|
|
1614
|
+
open: ct,
|
|
1615
|
+
onOpenChange: lt,
|
|
1616
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1616
1617
|
asChild: !0,
|
|
1617
|
-
children: /* @__PURE__ */
|
|
1618
|
+
children: /* @__PURE__ */ F(d, {
|
|
1618
1619
|
variant: "ghost",
|
|
1619
1620
|
size: "sm",
|
|
1620
|
-
className: C("h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1621
|
-
children: [/* @__PURE__ */
|
|
1621
|
+
className: C("hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", K && "text-foreground font-medium"),
|
|
1622
|
+
children: [/* @__PURE__ */ P(se, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1622
1623
|
className: "hidden sm:inline",
|
|
1623
1624
|
children: E("list.color")
|
|
1624
1625
|
})]
|
|
1625
1626
|
})
|
|
1626
|
-
}), /* @__PURE__ */
|
|
1627
|
+
}), /* @__PURE__ */ P(b, {
|
|
1627
1628
|
align: "start",
|
|
1628
1629
|
className: "w-64 p-3",
|
|
1629
|
-
children: /* @__PURE__ */
|
|
1630
|
+
children: /* @__PURE__ */ F("div", {
|
|
1630
1631
|
className: "space-y-2",
|
|
1631
|
-
children: [/* @__PURE__ */
|
|
1632
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1632
1633
|
className: "flex items-center justify-between border-b pb-2",
|
|
1633
|
-
children: [/* @__PURE__ */
|
|
1634
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
1634
1635
|
className: "font-medium text-sm",
|
|
1635
1636
|
children: E("list.rowColor")
|
|
1636
|
-
}),
|
|
1637
|
+
}), K && /* @__PURE__ */ P(d, {
|
|
1637
1638
|
variant: "ghost",
|
|
1638
1639
|
size: "sm",
|
|
1639
1640
|
className: "h-6 px-2 text-xs",
|
|
1640
|
-
onClick: () =>
|
|
1641
|
+
onClick: () => st(void 0),
|
|
1641
1642
|
"data-testid": "clear-row-color",
|
|
1642
1643
|
children: E("list.clear")
|
|
1643
1644
|
})]
|
|
1644
|
-
}), /* @__PURE__ */
|
|
1645
|
+
}), /* @__PURE__ */ F("div", {
|
|
1645
1646
|
className: "space-y-2",
|
|
1646
1647
|
"data-testid": "color-field-list",
|
|
1647
|
-
children: [/* @__PURE__ */
|
|
1648
|
+
children: [/* @__PURE__ */ P("label", {
|
|
1648
1649
|
className: "text-xs text-muted-foreground",
|
|
1649
1650
|
children: E("list.colorByField")
|
|
1650
|
-
}), /* @__PURE__ */
|
|
1651
|
+
}), /* @__PURE__ */ F("select", {
|
|
1651
1652
|
className: "w-full h-8 rounded border border-input bg-background px-2 text-xs",
|
|
1652
|
-
value:
|
|
1653
|
+
value: K?.field || "",
|
|
1653
1654
|
onChange: (e) => {
|
|
1654
1655
|
let t = e.target.value;
|
|
1655
|
-
|
|
1656
|
+
st(t ? {
|
|
1656
1657
|
field: t,
|
|
1657
|
-
colors:
|
|
1658
|
+
colors: K?.colors || {}
|
|
1658
1659
|
} : void 0);
|
|
1659
1660
|
},
|
|
1660
1661
|
"data-testid": "color-field-select",
|
|
1661
|
-
children: [/* @__PURE__ */
|
|
1662
|
+
children: [/* @__PURE__ */ P("option", {
|
|
1662
1663
|
value: "",
|
|
1663
1664
|
children: E("list.none")
|
|
1664
|
-
}), Ht.map((e) => /* @__PURE__ */
|
|
1665
|
+
}), Ht.map((e) => /* @__PURE__ */ P("option", {
|
|
1665
1666
|
value: e.name,
|
|
1666
1667
|
children: e.label
|
|
1667
1668
|
}, e.name))]
|
|
@@ -1671,152 +1672,170 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1671
1672
|
})]
|
|
1672
1673
|
}),
|
|
1673
1674
|
A.showDensity && !A.compactToolbar && j !== "gallery" && (() => {
|
|
1674
|
-
let e =
|
|
1675
|
+
let e = X.mode === "compact" ? de : X.mode === "comfortable" ? ue : le, t = X.mode === "compact" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : X.mode === "comfortable" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
|
|
1675
1676
|
defaultValue: "{{label}} (click to cycle)",
|
|
1676
1677
|
label: n
|
|
1677
1678
|
});
|
|
1678
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ P(d, {
|
|
1679
1680
|
variant: "ghost",
|
|
1680
1681
|
size: "sm",
|
|
1681
1682
|
"aria-label": n,
|
|
1682
|
-
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150",
|
|
1683
|
-
onClick:
|
|
1683
|
+
className: C("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", X.mode !== "compact" && "text-foreground font-medium"),
|
|
1684
|
+
onClick: X.cycle,
|
|
1684
1685
|
title: r,
|
|
1685
|
-
children: /* @__PURE__ */
|
|
1686
|
+
children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
|
|
1686
1687
|
});
|
|
1687
1688
|
})(),
|
|
1688
1689
|
A.showDensity && !A.compactToolbar && j === "gallery" && (() => {
|
|
1689
|
-
let e =
|
|
1690
|
+
let e = Z === "small" ? de : Z === "medium" ? ue : le, t = Z === "small" ? E("grid.toolbar.densityCompact", { defaultValue: "Compact" }) : Z === "medium" ? E("grid.toolbar.densityComfortable", { defaultValue: "Comfortable" }) : E("grid.toolbar.densitySpacious", { defaultValue: "Spacious" }), n = `${E("grid.toolbar.densityMode", { defaultValue: "Density" })}: ${t}`, r = E("grid.toolbar.densityCycleHint", {
|
|
1690
1691
|
defaultValue: "{{label}} (click to cycle)",
|
|
1691
1692
|
label: n
|
|
1692
1693
|
});
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ P(d, {
|
|
1694
1695
|
variant: "ghost",
|
|
1695
1696
|
size: "sm",
|
|
1696
1697
|
"aria-label": n,
|
|
1697
|
-
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150",
|
|
1698
|
-
onClick:
|
|
1698
|
+
className: C("hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150", Z !== "small" && "text-foreground font-medium"),
|
|
1699
|
+
onClick: Dt,
|
|
1699
1700
|
title: r,
|
|
1700
|
-
children: /* @__PURE__ */
|
|
1701
|
+
children: /* @__PURE__ */ P(e, { className: "h-3.5 w-3.5" })
|
|
1701
1702
|
});
|
|
1702
1703
|
})(),
|
|
1703
|
-
A.compactToolbar && (A.showGroup || A.showColor || A.showDensity || A.showHideFields) && /* @__PURE__ */
|
|
1704
|
+
!A.compactToolbar && (A.showGroup || A.showColor || A.showDensity || A.showHideFields) && /* @__PURE__ */ P("div", {
|
|
1705
|
+
className: "sm:hidden",
|
|
1706
|
+
children: /* @__PURE__ */ P(Ie, {
|
|
1707
|
+
t: E,
|
|
1708
|
+
allFields: Ht,
|
|
1709
|
+
showGroup: A.showGroup,
|
|
1710
|
+
groupingConfig: G,
|
|
1711
|
+
setGroupingConfig: rt,
|
|
1712
|
+
showColor: A.showColor,
|
|
1713
|
+
rowColorConfig: K,
|
|
1714
|
+
setRowColorConfig: st,
|
|
1715
|
+
showDensity: A.showDensity,
|
|
1716
|
+
density: X,
|
|
1717
|
+
showHideFields: A.showHideFields,
|
|
1718
|
+
hiddenFields: q,
|
|
1719
|
+
updateHiddenFields: bt
|
|
1720
|
+
})
|
|
1721
|
+
}),
|
|
1722
|
+
A.compactToolbar && (A.showGroup || A.showColor || A.showDensity || A.showHideFields) && /* @__PURE__ */ P(Ie, {
|
|
1704
1723
|
t: E,
|
|
1705
1724
|
allFields: Ht,
|
|
1706
1725
|
showGroup: A.showGroup,
|
|
1707
|
-
groupingConfig:
|
|
1708
|
-
setGroupingConfig:
|
|
1726
|
+
groupingConfig: G,
|
|
1727
|
+
setGroupingConfig: rt,
|
|
1709
1728
|
showColor: A.showColor,
|
|
1710
|
-
rowColorConfig:
|
|
1711
|
-
setRowColorConfig:
|
|
1729
|
+
rowColorConfig: K,
|
|
1730
|
+
setRowColorConfig: st,
|
|
1712
1731
|
showDensity: A.showDensity,
|
|
1713
|
-
density:
|
|
1732
|
+
density: X,
|
|
1714
1733
|
showHideFields: A.showHideFields,
|
|
1715
|
-
hiddenFields:
|
|
1716
|
-
updateHiddenFields:
|
|
1734
|
+
hiddenFields: q,
|
|
1735
|
+
updateHiddenFields: bt
|
|
1717
1736
|
}),
|
|
1718
|
-
(A.showColor || A.showDensity || A.compactToolbar) &&
|
|
1719
|
-
|
|
1720
|
-
open:
|
|
1721
|
-
onOpenChange:
|
|
1722
|
-
children: [/* @__PURE__ */
|
|
1737
|
+
(A.showColor || A.showDensity || A.compactToolbar) && Y && O.allowExport !== !1 && /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }),
|
|
1738
|
+
Y && O.allowExport !== !1 && /* @__PURE__ */ F(y, {
|
|
1739
|
+
open: Ct,
|
|
1740
|
+
onOpenChange: wt,
|
|
1741
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1723
1742
|
asChild: !0,
|
|
1724
|
-
children: /* @__PURE__ */
|
|
1743
|
+
children: /* @__PURE__ */ F(d, {
|
|
1725
1744
|
variant: "ghost",
|
|
1726
1745
|
size: "sm",
|
|
1727
1746
|
className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1728
|
-
children: [/* @__PURE__ */
|
|
1747
|
+
children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1729
1748
|
className: "hidden sm:inline",
|
|
1730
1749
|
children: E("list.export")
|
|
1731
1750
|
})]
|
|
1732
1751
|
})
|
|
1733
|
-
}), /* @__PURE__ */
|
|
1752
|
+
}), /* @__PURE__ */ P(b, {
|
|
1734
1753
|
align: "start",
|
|
1735
1754
|
className: "w-48 p-2",
|
|
1736
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ P("div", {
|
|
1737
1756
|
className: "space-y-1",
|
|
1738
|
-
children: (
|
|
1757
|
+
children: (Y.formats || ["csv", "json"]).map((e) => /* @__PURE__ */ F(d, {
|
|
1739
1758
|
variant: "ghost",
|
|
1740
1759
|
size: "sm",
|
|
1741
1760
|
className: "w-full justify-start h-8 text-xs",
|
|
1742
1761
|
onClick: () => Vt(e),
|
|
1743
|
-
children: [/* @__PURE__ */
|
|
1762
|
+
children: [/* @__PURE__ */ P(re, { className: "h-3.5 w-3.5 mr-2" }), E("list.exportAs", { format: e.toUpperCase() })]
|
|
1744
1763
|
}, e))
|
|
1745
1764
|
})
|
|
1746
1765
|
})]
|
|
1747
1766
|
}),
|
|
1748
|
-
(O.sharing?.enabled || O.sharing?.type) && /* @__PURE__ */
|
|
1767
|
+
(O.sharing?.enabled || O.sharing?.type) && /* @__PURE__ */ F(d, {
|
|
1749
1768
|
variant: "ghost",
|
|
1750
1769
|
size: "sm",
|
|
1751
1770
|
className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1752
1771
|
title: `Sharing: ${O.sharing?.visibility || O.sharing?.type || "private"}`,
|
|
1753
1772
|
"data-testid": "share-button",
|
|
1754
|
-
children: [/* @__PURE__ */
|
|
1773
|
+
children: [/* @__PURE__ */ P(me, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1755
1774
|
className: "hidden sm:inline",
|
|
1756
1775
|
children: E("list.share")
|
|
1757
1776
|
})]
|
|
1758
1777
|
}),
|
|
1759
|
-
O.allowPrinting && /* @__PURE__ */
|
|
1778
|
+
O.allowPrinting && /* @__PURE__ */ F(d, {
|
|
1760
1779
|
variant: "ghost",
|
|
1761
1780
|
size: "sm",
|
|
1762
1781
|
className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1763
1782
|
onClick: () => window.print(),
|
|
1764
1783
|
"data-testid": "print-button",
|
|
1765
|
-
children: [/* @__PURE__ */
|
|
1784
|
+
children: [/* @__PURE__ */ P(ce, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1766
1785
|
className: "hidden sm:inline",
|
|
1767
1786
|
children: E("list.print")
|
|
1768
1787
|
})]
|
|
1769
1788
|
}),
|
|
1770
1789
|
(() => {
|
|
1771
|
-
let e = O.allowPrinting || O.sharing?.enabled || O.sharing?.type ||
|
|
1772
|
-
return A.showSearch && e ? /* @__PURE__ */
|
|
1790
|
+
let e = O.allowPrinting || O.sharing?.enabled || O.sharing?.type || Y && O.allowExport !== !1;
|
|
1791
|
+
return A.showSearch && e ? /* @__PURE__ */ P("div", { className: "h-5 w-px bg-border/50 mx-1 shrink-0" }) : null;
|
|
1773
1792
|
})(),
|
|
1774
|
-
A.showSearch && /* @__PURE__ */
|
|
1775
|
-
open:
|
|
1776
|
-
onOpenChange:
|
|
1777
|
-
children: [/* @__PURE__ */
|
|
1793
|
+
A.showSearch && /* @__PURE__ */ F(y, {
|
|
1794
|
+
open: be,
|
|
1795
|
+
onOpenChange: Ce,
|
|
1796
|
+
children: [/* @__PURE__ */ P(x, {
|
|
1778
1797
|
asChild: !0,
|
|
1779
|
-
children: /* @__PURE__ */
|
|
1798
|
+
children: /* @__PURE__ */ P(d, {
|
|
1780
1799
|
variant: "ghost",
|
|
1781
1800
|
size: "sm",
|
|
1782
|
-
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1801
|
+
className: C("h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150", N && "text-foreground font-medium"),
|
|
1783
1802
|
"data-testid": "search-icon-button",
|
|
1784
1803
|
title: E("list.search"),
|
|
1785
|
-
children: /* @__PURE__ */
|
|
1804
|
+
children: /* @__PURE__ */ P(fe, { className: "h-3.5 w-3.5" })
|
|
1786
1805
|
})
|
|
1787
|
-
}), /* @__PURE__ */
|
|
1806
|
+
}), /* @__PURE__ */ P(b, {
|
|
1788
1807
|
align: "end",
|
|
1789
1808
|
className: "w-[calc(100vw-2rem)] sm:w-64 p-2",
|
|
1790
1809
|
"data-testid": "search-popover",
|
|
1791
|
-
children: /* @__PURE__ */
|
|
1810
|
+
children: /* @__PURE__ */ F("div", {
|
|
1792
1811
|
className: "relative",
|
|
1793
1812
|
children: [
|
|
1794
|
-
/* @__PURE__ */
|
|
1795
|
-
/* @__PURE__ */
|
|
1813
|
+
/* @__PURE__ */ P(fe, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
1814
|
+
/* @__PURE__ */ P(g, {
|
|
1796
1815
|
placeholder: E("list.search") + "...",
|
|
1797
|
-
value:
|
|
1798
|
-
onChange: (e) =>
|
|
1816
|
+
value: N,
|
|
1817
|
+
onChange: (e) => Ft(e.target.value),
|
|
1799
1818
|
className: "pl-7 h-8 text-xs",
|
|
1800
1819
|
autoFocus: !0
|
|
1801
1820
|
}),
|
|
1802
|
-
|
|
1821
|
+
N && /* @__PURE__ */ P(d, {
|
|
1803
1822
|
variant: "ghost",
|
|
1804
1823
|
size: "sm",
|
|
1805
1824
|
className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20",
|
|
1806
|
-
onClick: () =>
|
|
1807
|
-
children: /* @__PURE__ */
|
|
1825
|
+
onClick: () => Ft(""),
|
|
1826
|
+
children: /* @__PURE__ */ P(_e, { className: "h-3 w-3" })
|
|
1808
1827
|
})
|
|
1809
1828
|
]
|
|
1810
1829
|
})
|
|
1811
1830
|
})]
|
|
1812
1831
|
}),
|
|
1813
|
-
A.showAddRecord && A.addRecordPosition === "top" && /* @__PURE__ */
|
|
1832
|
+
A.showAddRecord && A.addRecordPosition === "top" && /* @__PURE__ */ F(d, {
|
|
1814
1833
|
variant: "ghost",
|
|
1815
1834
|
size: "sm",
|
|
1816
1835
|
className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1817
1836
|
"data-testid": "add-record-button",
|
|
1818
1837
|
onClick: () => w.onAddRecord?.(),
|
|
1819
|
-
children: [/* @__PURE__ */
|
|
1838
|
+
children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1820
1839
|
className: "hidden sm:inline",
|
|
1821
1840
|
children: E("list.addRecord")
|
|
1822
1841
|
})]
|
|
@@ -1824,132 +1843,132 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1824
1843
|
]
|
|
1825
1844
|
})]
|
|
1826
1845
|
}),
|
|
1827
|
-
|
|
1846
|
+
J && J.length > 0 && /* @__PURE__ */ P("div", {
|
|
1828
1847
|
className: "border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background",
|
|
1829
1848
|
"data-testid": "quick-filters",
|
|
1830
|
-
children:
|
|
1831
|
-
let t =
|
|
1832
|
-
return /* @__PURE__ */
|
|
1849
|
+
children: J.map((e) => {
|
|
1850
|
+
let t = pt.has(e.id), n = e.icon ? ve[e.icon.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] ?? null : null;
|
|
1851
|
+
return /* @__PURE__ */ F(d, {
|
|
1833
1852
|
variant: t ? "default" : "outline",
|
|
1834
1853
|
size: "sm",
|
|
1835
1854
|
className: "h-7 px-3 text-xs",
|
|
1836
1855
|
onClick: () => Bt(e.id),
|
|
1837
|
-
children: [n && /* @__PURE__ */
|
|
1856
|
+
children: [n && /* @__PURE__ */ P(n, { className: "h-3 w-3 mr-1.5" }), e.label]
|
|
1838
1857
|
}, e.id);
|
|
1839
1858
|
})
|
|
1840
1859
|
}),
|
|
1841
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ P("div", {
|
|
1842
1861
|
className: "flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200",
|
|
1843
|
-
children: !
|
|
1862
|
+
children: !He && B.length === 0 && j === "grid" ? (() => {
|
|
1844
1863
|
let e = O.emptyState?.icon;
|
|
1845
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ F("div", {
|
|
1846
1865
|
className: "flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8",
|
|
1847
1866
|
"data-testid": "empty-state",
|
|
1848
1867
|
children: [
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ P(e ? ve[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" }),
|
|
1869
|
+
/* @__PURE__ */ P("h3", {
|
|
1851
1870
|
className: "text-lg font-medium text-foreground mb-1",
|
|
1852
1871
|
children: (typeof O.emptyState?.title == "string" ? O.emptyState.title : void 0) ?? E("list.noItems")
|
|
1853
1872
|
}),
|
|
1854
|
-
/* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ P("p", {
|
|
1855
1874
|
className: "text-sm text-muted-foreground max-w-md",
|
|
1856
1875
|
children: (typeof O.emptyState?.message == "string" ? O.emptyState.message : void 0) ?? E("list.noItemsMessage")
|
|
1857
1876
|
}),
|
|
1858
|
-
A.showAddRecord && /* @__PURE__ */
|
|
1877
|
+
A.showAddRecord && /* @__PURE__ */ F(d, {
|
|
1859
1878
|
variant: "default",
|
|
1860
1879
|
size: "sm",
|
|
1861
1880
|
className: "mt-4",
|
|
1862
1881
|
"data-testid": "empty-state-add-record",
|
|
1863
1882
|
onClick: () => w.onAddRecord?.(),
|
|
1864
|
-
children: [/* @__PURE__ */
|
|
1883
|
+
children: [/* @__PURE__ */ P(M, { className: "h-4 w-4 mr-1.5" }), E("list.addRecord")]
|
|
1865
1884
|
})
|
|
1866
1885
|
]
|
|
1867
1886
|
});
|
|
1868
|
-
})() : /* @__PURE__ */
|
|
1887
|
+
})() : /* @__PURE__ */ P(Se, {
|
|
1869
1888
|
schema: Lt,
|
|
1870
1889
|
...w,
|
|
1871
|
-
data:
|
|
1872
|
-
loading:
|
|
1873
|
-
onRowSelect:
|
|
1890
|
+
data: B,
|
|
1891
|
+
loading: He,
|
|
1892
|
+
onRowSelect: dt
|
|
1874
1893
|
})
|
|
1875
1894
|
}, j),
|
|
1876
|
-
A.showAddRecord && A.addRecordPosition === "bottom" && /* @__PURE__ */
|
|
1895
|
+
A.showAddRecord && A.addRecordPosition === "bottom" && /* @__PURE__ */ P("div", {
|
|
1877
1896
|
className: "border-t px-2 sm:px-4 py-1 bg-background shrink-0",
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1897
|
+
children: /* @__PURE__ */ F(d, {
|
|
1879
1898
|
variant: "ghost",
|
|
1880
1899
|
size: "sm",
|
|
1881
1900
|
className: "h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150",
|
|
1882
1901
|
"data-testid": "add-record-button",
|
|
1883
1902
|
onClick: () => w.onAddRecord?.(),
|
|
1884
|
-
children: [/* @__PURE__ */
|
|
1903
|
+
children: [/* @__PURE__ */ P(M, { className: "h-3.5 w-3.5 mr-1.5" }), /* @__PURE__ */ P("span", {
|
|
1885
1904
|
className: "hidden sm:inline",
|
|
1886
1905
|
children: E("list.addRecord")
|
|
1887
1906
|
})]
|
|
1888
1907
|
})
|
|
1889
1908
|
}),
|
|
1890
|
-
O.bulkActions && O.bulkActions.length > 0 &&
|
|
1909
|
+
O.bulkActions && O.bulkActions.length > 0 && ut.length > 0 && j !== "grid" && /* @__PURE__ */ F("div", {
|
|
1891
1910
|
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",
|
|
1892
1911
|
role: "region",
|
|
1893
1912
|
"aria-label": "Bulk actions",
|
|
1894
1913
|
"data-testid": "bulk-actions-bar",
|
|
1895
1914
|
children: [
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ P(te, { className: "h-3.5 w-3.5 text-primary shrink-0" }),
|
|
1916
|
+
/* @__PURE__ */ F("span", {
|
|
1898
1917
|
className: "font-medium",
|
|
1899
1918
|
children: [
|
|
1900
|
-
|
|
1919
|
+
ut.length,
|
|
1901
1920
|
" ",
|
|
1902
|
-
|
|
1921
|
+
ut.length === 1 ? "item" : "items",
|
|
1903
1922
|
" selected"
|
|
1904
1923
|
]
|
|
1905
1924
|
}),
|
|
1906
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ P("div", {
|
|
1907
1926
|
className: "flex items-center gap-1.5 ml-3",
|
|
1908
1927
|
children: O.bulkActions.map((e) => {
|
|
1909
|
-
let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ?
|
|
1910
|
-
return /* @__PURE__ */
|
|
1928
|
+
let t = String(e).toLowerCase(), n = t.includes("delete") || t.includes("remove") || t.includes("destroy"), r = n ? ge : null;
|
|
1929
|
+
return /* @__PURE__ */ F(d, {
|
|
1911
1930
|
variant: n ? "destructive" : "outline",
|
|
1912
1931
|
size: "sm",
|
|
1913
1932
|
className: "h-7 px-2.5 text-xs gap-1.5",
|
|
1914
|
-
onClick: () => w.onBulkAction?.(e,
|
|
1933
|
+
onClick: () => w.onBulkAction?.(e, ut),
|
|
1915
1934
|
"data-testid": `bulk-action-${e}`,
|
|
1916
|
-
children: [r && /* @__PURE__ */
|
|
1935
|
+
children: [r && /* @__PURE__ */ P(r, { className: "h-3 w-3" }), Ue(e)]
|
|
1917
1936
|
}, e);
|
|
1918
1937
|
})
|
|
1919
1938
|
}),
|
|
1920
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ F(d, {
|
|
1921
1940
|
variant: "ghost",
|
|
1922
1941
|
size: "sm",
|
|
1923
1942
|
className: "h-7 px-2 text-xs ml-auto gap-1",
|
|
1924
|
-
onClick: () =>
|
|
1925
|
-
children: [/* @__PURE__ */
|
|
1943
|
+
onClick: () => dt([]),
|
|
1944
|
+
children: [/* @__PURE__ */ P(_e, { className: "h-3 w-3" }), "Clear"]
|
|
1926
1945
|
})
|
|
1927
1946
|
]
|
|
1928
1947
|
}),
|
|
1929
|
-
!
|
|
1948
|
+
!He && B.length > 0 && O.showRecordCount !== !1 && /* @__PURE__ */ F("div", {
|
|
1930
1949
|
className: "border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0",
|
|
1931
1950
|
"data-testid": "record-count-bar",
|
|
1932
1951
|
children: [
|
|
1933
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ P("span", {
|
|
1934
1953
|
className: "font-medium text-foreground/80",
|
|
1935
|
-
children:
|
|
1954
|
+
children: B.length === 1 ? E("list.recordCountOne", { count: B.length }) : E("list.recordCount", { count: B.length })
|
|
1936
1955
|
}),
|
|
1937
|
-
|
|
1956
|
+
Qe && /* @__PURE__ */ P("span", {
|
|
1938
1957
|
className: "text-amber-600",
|
|
1939
1958
|
"data-testid": "data-limit-warning",
|
|
1940
|
-
children: E("list.dataLimitReached", { limit:
|
|
1959
|
+
children: E("list.dataLimitReached", { limit: nt })
|
|
1941
1960
|
}),
|
|
1942
|
-
O.pagination?.pageSizeOptions && O.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */
|
|
1961
|
+
O.pagination?.pageSizeOptions && O.pagination.pageSizeOptions.length > 0 && /* @__PURE__ */ F("div", {
|
|
1943
1962
|
className: "ml-auto flex items-center gap-2",
|
|
1944
|
-
children: [/* @__PURE__ */
|
|
1963
|
+
children: [/* @__PURE__ */ P("span", { children: E("table.rowsPerPage", { defaultValue: "Rows per page" }) }), /* @__PURE__ */ P("select", {
|
|
1945
1964
|
"data-testid": "page-size-selector",
|
|
1946
1965
|
className: "h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background",
|
|
1947
|
-
value: String(
|
|
1966
|
+
value: String(nt),
|
|
1948
1967
|
onChange: (e) => {
|
|
1949
1968
|
let t = Number(e.target.value);
|
|
1950
|
-
|
|
1969
|
+
tt(t), w.onPageSizeChange && w.onPageSizeChange(t);
|
|
1951
1970
|
},
|
|
1952
|
-
children: O.pagination.pageSizeOptions.map((e) => /* @__PURE__ */
|
|
1971
|
+
children: O.pagination.pageSizeOptions.map((e) => /* @__PURE__ */ P("option", {
|
|
1953
1972
|
value: String(e),
|
|
1954
1973
|
children: e
|
|
1955
1974
|
}, e))
|
|
@@ -1957,17 +1976,17 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1957
1976
|
})
|
|
1958
1977
|
]
|
|
1959
1978
|
}),
|
|
1960
|
-
|
|
1961
|
-
...
|
|
1979
|
+
It.isOverlay && /* @__PURE__ */ P(v, {
|
|
1980
|
+
...It,
|
|
1962
1981
|
title: O.label ? `${O.label} Detail` : O.objectName ? `${O.objectName.charAt(0).toUpperCase() + O.objectName.slice(1)} Detail` : "Record Detail",
|
|
1963
|
-
children: (e) => /* @__PURE__ */
|
|
1982
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
1964
1983
|
className: "space-y-3",
|
|
1965
|
-
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */
|
|
1984
|
+
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
|
|
1966
1985
|
className: "flex flex-col",
|
|
1967
|
-
children: [/* @__PURE__ */
|
|
1986
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1968
1987
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
1969
1988
|
children: e.replace(/_/g, " ")
|
|
1970
|
-
}), /* @__PURE__ */
|
|
1989
|
+
}), /* @__PURE__ */ P("span", {
|
|
1971
1990
|
className: "text-sm",
|
|
1972
1991
|
children: String(t ?? "—")
|
|
1973
1992
|
})]
|
|
@@ -1977,23 +1996,60 @@ var Ye = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChang
|
|
|
1977
1996
|
]
|
|
1978
1997
|
});
|
|
1979
1998
|
});
|
|
1980
|
-
|
|
1999
|
+
Xe.displayName = "ListView";
|
|
1981
2000
|
//#endregion
|
|
1982
2001
|
//#region src/ObjectGallery.tsx
|
|
1983
|
-
var
|
|
2002
|
+
var Ze = {
|
|
1984
2003
|
small: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",
|
|
1985
2004
|
medium: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
|
|
1986
2005
|
large: "grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
1987
|
-
},
|
|
2006
|
+
}, Qe = {
|
|
1988
2007
|
small: "aspect-square",
|
|
1989
2008
|
medium: "aspect-[4/3]",
|
|
1990
2009
|
large: "aspect-[16/10]"
|
|
1991
|
-
},
|
|
1992
|
-
|
|
2010
|
+
}, $e = [
|
|
2011
|
+
{
|
|
2012
|
+
bg: "from-indigo-500/15 via-indigo-500/5 to-purple-500/10",
|
|
2013
|
+
ring: "ring-indigo-500/15",
|
|
2014
|
+
text: "text-indigo-600/70 dark:text-indigo-300/70"
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
bg: "from-sky-500/15 via-sky-500/5 to-cyan-500/10",
|
|
2018
|
+
ring: "ring-sky-500/15",
|
|
2019
|
+
text: "text-sky-600/70 dark:text-sky-300/70"
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
bg: "from-emerald-500/15 via-emerald-500/5 to-teal-500/10",
|
|
2023
|
+
ring: "ring-emerald-500/15",
|
|
2024
|
+
text: "text-emerald-600/70 dark:text-emerald-300/70"
|
|
2025
|
+
},
|
|
2026
|
+
{
|
|
2027
|
+
bg: "from-amber-500/15 via-amber-500/5 to-orange-500/10",
|
|
2028
|
+
ring: "ring-amber-500/15",
|
|
2029
|
+
text: "text-amber-600/70 dark:text-amber-300/70"
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
bg: "from-rose-500/15 via-rose-500/5 to-pink-500/10",
|
|
2033
|
+
ring: "ring-rose-500/15",
|
|
2034
|
+
text: "text-rose-600/70 dark:text-rose-300/70"
|
|
2035
|
+
},
|
|
2036
|
+
{
|
|
2037
|
+
bg: "from-violet-500/15 via-violet-500/5 to-fuchsia-500/10",
|
|
2038
|
+
ring: "ring-violet-500/15",
|
|
2039
|
+
text: "text-violet-600/70 dark:text-violet-300/70"
|
|
2040
|
+
}
|
|
2041
|
+
];
|
|
2042
|
+
function et(e) {
|
|
2043
|
+
let t = 5381;
|
|
2044
|
+
for (let n = 0; n < e.length; n++) t = (t << 5) + t + e.charCodeAt(n);
|
|
2045
|
+
return $e[Math.abs(t) % $e.length];
|
|
2046
|
+
}
|
|
2047
|
+
var tt = (e) => {
|
|
2048
|
+
let { schema: n } = e, r = s(Ce), i = e.dataSource || r?.dataSource, a = we(n.bind), [d, m] = u([]), [h, g] = u(!1), [_, y] = u(null), b = Ee({
|
|
1993
2049
|
navigation: n.navigation,
|
|
1994
2050
|
objectName: n.objectName,
|
|
1995
2051
|
onRowClick: e.onRowClick ?? e.onCardClick
|
|
1996
|
-
}), x = n.gallery, S = x?.coverField ?? n.imageField ?? "image", w = x?.coverFit ?? "cover", T = x?.cardSize ?? "medium", ee = x?.titleField ?? n.titleField ?? "name", te = x?.visibleFields, { fieldOptionLabel: re } =
|
|
2052
|
+
}), x = n.gallery, S = x?.coverField ?? n.imageField ?? "image", w = x?.coverFit ?? "cover", T = x?.cardSize ?? "medium", ee = x?.titleField ?? n.titleField ?? "name", te = x?.visibleFields, { fieldOptionLabel: re } = De(), ie = o((e) => {
|
|
1997
2053
|
let t = _?.fields?.[e], r = { name: e };
|
|
1998
2054
|
if (t) {
|
|
1999
2055
|
t.type && (r.type = t.type), t.label && (r.label = t.label), t.options && (r.options = t.options), t.currency && (r.currency = t.currency), t.precision !== void 0 && (r.precision = t.precision), t.format && (r.format = t.format);
|
|
@@ -2108,94 +2164,101 @@ var Xe = {
|
|
|
2108
2164
|
A,
|
|
2109
2165
|
se
|
|
2110
2166
|
]);
|
|
2111
|
-
if (h && !D.length) return /* @__PURE__ */
|
|
2167
|
+
if (h && !D.length) return /* @__PURE__ */ P("div", {
|
|
2112
2168
|
className: "p-4 text-sm text-muted-foreground",
|
|
2113
2169
|
children: "Loading Gallery..."
|
|
2114
2170
|
});
|
|
2115
|
-
if (!D.length) return /* @__PURE__ */
|
|
2171
|
+
if (!D.length) return /* @__PURE__ */ P("div", {
|
|
2116
2172
|
className: "p-4 text-sm text-muted-foreground",
|
|
2117
2173
|
children: "No items to display"
|
|
2118
2174
|
});
|
|
2119
2175
|
let le = (t, r) => {
|
|
2120
|
-
let i = t.id ?? t._id ?? r, a = String(t[ee] ?? "Untitled"), o = t[S];
|
|
2121
|
-
return /* @__PURE__ */
|
|
2176
|
+
let i = t.id ?? t._id ?? r, a = String(t[ee] ?? "Untitled"), o = t[S], s = et(String(i) + "|" + a);
|
|
2177
|
+
return /* @__PURE__ */ F(f, {
|
|
2122
2178
|
role: "listitem",
|
|
2123
|
-
className: C("group overflow-hidden transition-all hover:shadow-
|
|
2124
|
-
onClick: () => b.handleClick(t),
|
|
2125
|
-
children: [
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
className: C("
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2179
|
+
className: C("group relative overflow-hidden border-border/60 bg-card", "transition-all duration-200 ease-out", "hover:shadow-lg hover:border-border hover:-translate-y-0.5", (e.onCardClick || e.onRowClick || n.navigation) && "cursor-pointer"),
|
|
2180
|
+
onClick: (e) => b.handleClick(t, e),
|
|
2181
|
+
children: [
|
|
2182
|
+
!ae && /* @__PURE__ */ P("div", {
|
|
2183
|
+
"aria-hidden": !0,
|
|
2184
|
+
className: C("absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r", s.bg)
|
|
2185
|
+
}),
|
|
2186
|
+
/* @__PURE__ */ P("div", {
|
|
2187
|
+
className: C("w-full overflow-hidden relative", Qe[T]),
|
|
2188
|
+
hidden: !ae,
|
|
2189
|
+
children: o ? /* @__PURE__ */ P("img", {
|
|
2190
|
+
src: o,
|
|
2191
|
+
alt: a,
|
|
2192
|
+
className: C("h-full w-full transition-transform duration-300 ease-out group-hover:scale-[1.04]", w === "cover" && "object-cover", w === "contain" && "object-contain")
|
|
2193
|
+
}) : /* @__PURE__ */ P("div", {
|
|
2194
|
+
className: C("flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset", s.bg, s.ring),
|
|
2195
|
+
children: /* @__PURE__ */ P("span", {
|
|
2196
|
+
className: C("text-5xl font-semibold tracking-tight opacity-90", s.text),
|
|
2197
|
+
children: a[0]?.toUpperCase()
|
|
2198
|
+
})
|
|
2137
2199
|
})
|
|
2200
|
+
}),
|
|
2201
|
+
/* @__PURE__ */ F(p, {
|
|
2202
|
+
className: C("p-3", ae && "border-t border-border/60"),
|
|
2203
|
+
children: [/* @__PURE__ */ P("h3", {
|
|
2204
|
+
className: "font-semibold tracking-tight truncate text-sm leading-tight text-foreground",
|
|
2205
|
+
title: a,
|
|
2206
|
+
children: a
|
|
2207
|
+
}), te && te.length > 0 && /* @__PURE__ */ P("div", {
|
|
2208
|
+
className: "mt-1.5 space-y-1",
|
|
2209
|
+
children: te.map((e) => {
|
|
2210
|
+
let n = t[e];
|
|
2211
|
+
if (n == null || n === "") return null;
|
|
2212
|
+
let r = ie(e);
|
|
2213
|
+
return /* @__PURE__ */ P("div", {
|
|
2214
|
+
className: "text-xs text-muted-foreground truncate [&_*]:!text-xs",
|
|
2215
|
+
onClick: (e) => {
|
|
2216
|
+
e.target.closest("a,button") && e.stopPropagation();
|
|
2217
|
+
},
|
|
2218
|
+
children: /* @__PURE__ */ P(I(Ae(r) || r.type || "text"), {
|
|
2219
|
+
value: n,
|
|
2220
|
+
field: r
|
|
2221
|
+
})
|
|
2222
|
+
}, e);
|
|
2223
|
+
})
|
|
2224
|
+
})]
|
|
2138
2225
|
})
|
|
2139
|
-
|
|
2140
|
-
className: C("p-3", ae && "border-t"),
|
|
2141
|
-
children: [/* @__PURE__ */ F("h3", {
|
|
2142
|
-
className: "font-medium truncate text-sm",
|
|
2143
|
-
title: a,
|
|
2144
|
-
children: a
|
|
2145
|
-
}), te && te.length > 0 && /* @__PURE__ */ F("div", {
|
|
2146
|
-
className: "mt-1 space-y-1",
|
|
2147
|
-
children: te.map((e) => {
|
|
2148
|
-
let n = t[e];
|
|
2149
|
-
if (n == null || n === "") return null;
|
|
2150
|
-
let r = ie(e);
|
|
2151
|
-
return /* @__PURE__ */ F("div", {
|
|
2152
|
-
className: "text-xs text-muted-foreground truncate [&_*]:!text-xs",
|
|
2153
|
-
onClick: (e) => {
|
|
2154
|
-
e.target.closest("a,button") && e.stopPropagation();
|
|
2155
|
-
},
|
|
2156
|
-
children: /* @__PURE__ */ F(L(ke(r) || r.type || "text"), {
|
|
2157
|
-
value: n,
|
|
2158
|
-
field: r
|
|
2159
|
-
})
|
|
2160
|
-
}, e);
|
|
2161
|
-
})
|
|
2162
|
-
})]
|
|
2163
|
-
})]
|
|
2226
|
+
]
|
|
2164
2227
|
}, i);
|
|
2165
|
-
},
|
|
2166
|
-
className: C("grid gap-4 p-4 auto-rows-min content-start",
|
|
2228
|
+
}, ue = (e) => /* @__PURE__ */ P("div", {
|
|
2229
|
+
className: C("grid gap-4 p-4 auto-rows-min content-start", Ze[T], n.className),
|
|
2167
2230
|
role: "list",
|
|
2168
2231
|
children: e.map((e, t) => le(e, t))
|
|
2169
2232
|
});
|
|
2170
|
-
return /* @__PURE__ */
|
|
2233
|
+
return /* @__PURE__ */ F(N, { children: [oe ? /* @__PURE__ */ P("div", {
|
|
2171
2234
|
className: "space-y-2",
|
|
2172
|
-
children: ce.map((e) => /* @__PURE__ */
|
|
2235
|
+
children: ce.map((e) => /* @__PURE__ */ F("div", {
|
|
2173
2236
|
className: "border rounded-md",
|
|
2174
|
-
children: [/* @__PURE__ */
|
|
2237
|
+
children: [/* @__PURE__ */ F("button", {
|
|
2175
2238
|
type: "button",
|
|
2176
2239
|
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",
|
|
2177
2240
|
onClick: () => M(e.key),
|
|
2178
2241
|
children: [
|
|
2179
|
-
e.collapsed ? /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */
|
|
2242
|
+
e.collapsed ? /* @__PURE__ */ P(ne, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ P(E, { className: "h-4 w-4 shrink-0" }),
|
|
2243
|
+
/* @__PURE__ */ P("span", { children: e.label }),
|
|
2244
|
+
/* @__PURE__ */ P("span", {
|
|
2182
2245
|
className: "ml-auto text-xs text-muted-foreground",
|
|
2183
2246
|
children: e.items.length
|
|
2184
2247
|
})
|
|
2185
2248
|
]
|
|
2186
|
-
}), !e.collapsed &&
|
|
2249
|
+
}), !e.collapsed && ue(e.items)]
|
|
2187
2250
|
}, e.key))
|
|
2188
|
-
}) :
|
|
2251
|
+
}) : ue(D), b.isOverlay && /* @__PURE__ */ P(v, {
|
|
2189
2252
|
...b,
|
|
2190
2253
|
title: "Gallery Item",
|
|
2191
|
-
children: (e) => /* @__PURE__ */
|
|
2254
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
2192
2255
|
className: "space-y-3",
|
|
2193
|
-
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */
|
|
2256
|
+
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ F("div", {
|
|
2194
2257
|
className: "flex flex-col",
|
|
2195
|
-
children: [/* @__PURE__ */
|
|
2258
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2196
2259
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wide",
|
|
2197
2260
|
children: e.replace(/_/g, " ")
|
|
2198
|
-
}), /* @__PURE__ */
|
|
2261
|
+
}), /* @__PURE__ */ P("span", {
|
|
2199
2262
|
className: "text-sm",
|
|
2200
2263
|
children: String(t ?? "—")
|
|
2201
2264
|
})]
|
|
@@ -2203,11 +2266,11 @@ var Xe = {
|
|
|
2203
2266
|
})
|
|
2204
2267
|
})] });
|
|
2205
2268
|
};
|
|
2206
|
-
e.register("object-gallery",
|
|
2269
|
+
e.register("object-gallery", tt, {
|
|
2207
2270
|
namespace: "plugin-list",
|
|
2208
2271
|
label: "Gallery View",
|
|
2209
2272
|
category: "view"
|
|
2210
|
-
}), e.register("list-view",
|
|
2273
|
+
}), e.register("list-view", Xe, {
|
|
2211
2274
|
namespace: "plugin-list",
|
|
2212
2275
|
label: "List View",
|
|
2213
2276
|
category: "Views",
|
|
@@ -2284,7 +2347,7 @@ e.register("object-gallery", Qe, {
|
|
|
2284
2347
|
sort: [],
|
|
2285
2348
|
options: {}
|
|
2286
2349
|
}
|
|
2287
|
-
}), e.register("list",
|
|
2350
|
+
}), e.register("list", Xe, {
|
|
2288
2351
|
namespace: "view",
|
|
2289
2352
|
category: "view",
|
|
2290
2353
|
label: "List",
|
|
@@ -2355,4 +2418,4 @@ e.register("object-gallery", Qe, {
|
|
|
2355
2418
|
]
|
|
2356
2419
|
});
|
|
2357
2420
|
//#endregion
|
|
2358
|
-
export {
|
|
2421
|
+
export { Xe as ListView, tt as ObjectGallery, Fe as TabBar, ze as UserFilters, Ne as ViewSwitcher, H as evaluateConditionalFormatting, V as normalizeFilterCondition, We as normalizeFilters };
|