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