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