@plumile/backoffice-react 0.1.115 → 0.1.116
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/lib/esm/auth/authRefreshNotice.css.js +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js +0 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +271 -263
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +2 -2
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js +6 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js.map +1 -0
- package/lib/esm/pages/BackofficeLayoutPage.js +1 -0
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts +1 -0
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts +2 -0
- package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts.map +1 -0
- package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -6,30 +6,31 @@ import { EntityFilterValue as i, EntityFilterValueText as a } from "../filters/E
|
|
|
6
6
|
import { DeferredFilterSearchInput as o } from "../filters/DeferredFilterSearchInput.js";
|
|
7
7
|
import { BackofficeListToolbar as s } from "../lists/BackofficeListToolbar.js";
|
|
8
8
|
import { BackofficeListFilterProvider as c } from "./BackofficeListFilterContext.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { BACKOFFICE_LIST_BODY_SCROLL_MODE as l } from "./backofficeListScrollMode.js";
|
|
10
|
+
import { useBackofficeInfiniteScrollSentinel as u } from "../../../hooks/useBackofficeInfiniteScrollSentinel.js";
|
|
11
|
+
import { isDevEnv as ee } from "../../../relay/envHelpers.js";
|
|
12
|
+
import { controlsRow as te, embeddedContainer as ne, embeddedHeader as re, filterInput as d, tableHost as ie } from "./backofficeEntityListScaffold.css.js";
|
|
13
|
+
import { useCallback as f, useEffect as ae, useMemo as p, useState as m } from "react";
|
|
13
14
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
-
import { useTranslation as
|
|
15
|
+
import { useTranslation as oe } from "react-i18next";
|
|
15
16
|
import { Button as v } from "@plumile/ui/atomic/atoms/button/Button.js";
|
|
16
17
|
import { SimpleSelect as y } from "@plumile/ui/components/select/SimpleSelect.js";
|
|
17
|
-
import { BackofficeEmptyState as
|
|
18
|
-
import { InlineBanner as
|
|
19
|
-
import { BackofficePageHeader as
|
|
20
|
-
import { readWhereValue as
|
|
21
|
-
import { BackofficeTableSkeleton as
|
|
22
|
-
import { BackofficeFilterDrawer as
|
|
23
|
-
import { BackofficeFilterField as
|
|
24
|
-
import { BackofficeInfiniteListStatus as
|
|
25
|
-
import { FilterChipRow as
|
|
26
|
-
import { BackofficeVirtualizedConnectionTable as
|
|
27
|
-
import { ListPageTemplate as
|
|
28
|
-
import { ResponsiveRecordList as
|
|
29
|
-
import { denseTableClass as
|
|
30
|
-
import { resolveBackofficeListRuntimeConfig as
|
|
18
|
+
import { BackofficeEmptyState as se } from "@plumile/ui/backoffice/molecules/backoffice_empty_state/BackofficeEmptyState.js";
|
|
19
|
+
import { InlineBanner as ce } from "@plumile/ui/backoffice/molecules/inline_banner/InlineBanner.js";
|
|
20
|
+
import { BackofficePageHeader as le } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
|
|
21
|
+
import { readWhereValue as b, setWhereValue as x } from "@plumile/backoffice-core/filters/where.js";
|
|
22
|
+
import { BackofficeTableSkeleton as ue } from "@plumile/ui/backoffice/molecules/backoffice_table_skeleton/BackofficeTableSkeleton.js";
|
|
23
|
+
import { BackofficeFilterDrawer as de } from "@plumile/ui/backoffice/molecules/backoffice_filter_drawer/BackofficeFilterDrawer.js";
|
|
24
|
+
import { BackofficeFilterField as fe } from "@plumile/ui/backoffice/molecules/backoffice_filter_field/BackofficeFilterField.js";
|
|
25
|
+
import { BackofficeInfiniteListStatus as pe } from "@plumile/ui/backoffice/molecules/backoffice_infinite_list_status/BackofficeInfiniteListStatus.js";
|
|
26
|
+
import { FilterChipRow as me } from "@plumile/ui/backoffice/molecules/filter_chip_row/FilterChipRow.js";
|
|
27
|
+
import { BackofficeVirtualizedConnectionTable as he } from "@plumile/ui/backoffice/organisms/backoffice_virtualized_connection_table/BackofficeVirtualizedConnectionTable.js";
|
|
28
|
+
import { ListPageTemplate as ge } from "@plumile/ui/backoffice/templates/list_page_template/ListPageTemplate.js";
|
|
29
|
+
import { ResponsiveRecordList as _e } from "@plumile/ui/components/data-table/ResponsiveRecordList.js";
|
|
30
|
+
import { denseTableClass as S } from "@plumile/ui/shared/backofficeTableDensity.css.js";
|
|
31
|
+
import { resolveBackofficeListRuntimeConfig as ve } from "@plumile/backoffice-core/config/listRuntime.js";
|
|
31
32
|
//#region src/components/backoffice/scaffolds/BackofficeEntityListScaffold.tsx
|
|
32
|
-
var C = (e, t) => e(t),
|
|
33
|
+
var C = (e, t) => e(t), w = (e, t) => e.fromGraphQL != null && t != null ? e.fromGraphQL(t) : b(t, e.whereKey ?? e.id, e.path), ye = (e, t, n) => {
|
|
33
34
|
if (t == null) return null;
|
|
34
35
|
if (Array.isArray(t)) {
|
|
35
36
|
let e = t.map((e) => {
|
|
@@ -46,21 +47,21 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
46
47
|
entityId: e.entity,
|
|
47
48
|
id: r
|
|
48
49
|
}) : e.kind === "enum" ? n.enumLabel(r) : r;
|
|
49
|
-
},
|
|
50
|
+
}, be = (e) => {
|
|
50
51
|
let t = new Date(e);
|
|
51
52
|
if (Number.isNaN(t.getTime())) return e;
|
|
52
53
|
let n = t.getTimezoneOffset() * 6e4;
|
|
53
54
|
return new Date(t.getTime() - n).toISOString().slice(0, 16);
|
|
54
|
-
},
|
|
55
|
+
}, xe = (e) => {
|
|
55
56
|
let t = e.trim();
|
|
56
57
|
if (t === "") return "";
|
|
57
58
|
let n = new Date(t);
|
|
58
59
|
return Number.isNaN(n.getTime()) ? t : n.toISOString();
|
|
59
|
-
},
|
|
60
|
-
let { t:
|
|
60
|
+
}, T = (i) => {
|
|
61
|
+
let { t: b } = oe(), { t: T } = e(), { config: E, state: D, pushState: O, rows: k, getRowId: A, columns: j, gridTemplateColumns: M, hasNextPage: N, isLoadingMore: P, isRefreshing: Se = !1, onLoadMore: F, onRefresh: I, totalCount: L, emptyState: R, statusBanner: z, header: B, headerActions: Ce, isLoadingInitial: we = !1, variant: Te = "page", showFilters: Ee = !0 } = i, V = E.list, De = E.listDefaults ?? V.defaultState ?? {
|
|
61
62
|
where: null,
|
|
62
63
|
sort: null
|
|
63
|
-
},
|
|
64
|
+
}, H = p(() => j.some((e) => e.isPrimary === !0) || j.length === 0 ? j : j.map((e, t) => {
|
|
64
65
|
let { header: n } = e;
|
|
65
66
|
return t === 0 ? {
|
|
66
67
|
...e,
|
|
@@ -70,32 +71,32 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
70
71
|
...e,
|
|
71
72
|
header: n
|
|
72
73
|
};
|
|
73
|
-
}), [
|
|
74
|
+
}), [j]), U = p(() => {
|
|
74
75
|
let e = [];
|
|
75
|
-
for (let t of
|
|
76
|
-
let n =
|
|
76
|
+
for (let t of V.filters) {
|
|
77
|
+
let n = w(t, D.where), r = ye(t, n, {
|
|
77
78
|
enumLabel: (e) => {
|
|
78
79
|
if (t.kind !== "enum") return e;
|
|
79
80
|
let n = t.options.find((t) => t.value === e);
|
|
80
|
-
return n == null ? e : C(n.label,
|
|
81
|
+
return n == null ? e : C(n.label, b);
|
|
81
82
|
},
|
|
82
83
|
booleanLabel: (e) => {
|
|
83
84
|
if (t.kind === "boolean") {
|
|
84
|
-
if (e && t.trueLabel != null) return C(t.trueLabel,
|
|
85
|
-
if (!e && t.falseLabel != null) return C(t.falseLabel,
|
|
85
|
+
if (e && t.trueLabel != null) return C(t.trueLabel, b);
|
|
86
|
+
if (!e && t.falseLabel != null) return C(t.falseLabel, b);
|
|
86
87
|
}
|
|
87
|
-
return
|
|
88
|
+
return T(e ? "filters.boolean.yes" : "filters.boolean.no");
|
|
88
89
|
},
|
|
89
90
|
fallbackBooleanLabels: {
|
|
90
|
-
yes:
|
|
91
|
-
no:
|
|
91
|
+
yes: T("filters.boolean.yes"),
|
|
92
|
+
no: T("filters.boolean.no")
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
if (r != null) {
|
|
95
96
|
let i = String(n);
|
|
96
97
|
Array.isArray(n) && (i = n.join(","));
|
|
97
98
|
let a = /* @__PURE__ */ _("span", { children: [
|
|
98
|
-
C(t.label,
|
|
99
|
+
C(t.label, b),
|
|
99
100
|
": ",
|
|
100
101
|
r
|
|
101
102
|
] });
|
|
@@ -103,9 +104,9 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
103
104
|
id: `${t.id}:${i}`,
|
|
104
105
|
label: a,
|
|
105
106
|
onRemove: () => {
|
|
106
|
-
let e = t.whereKey ?? t.id, n =
|
|
107
|
-
|
|
108
|
-
...
|
|
107
|
+
let e = t.whereKey ?? t.id, n = x(D.where, e, null, t.path);
|
|
108
|
+
O({
|
|
109
|
+
...D,
|
|
109
110
|
where: n
|
|
110
111
|
});
|
|
111
112
|
}
|
|
@@ -114,25 +115,25 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
114
115
|
}
|
|
115
116
|
return e;
|
|
116
117
|
}, [
|
|
117
|
-
|
|
118
|
+
V.filters,
|
|
119
|
+
O,
|
|
118
120
|
D,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
let n = e.whereKey ?? e.id, r = _e(e, E.where), i = "";
|
|
121
|
+
T,
|
|
122
|
+
b
|
|
123
|
+
]), W = f(() => {
|
|
124
|
+
O({ ...De });
|
|
125
|
+
}, [De, O]), [Oe, ke] = m(!1), [G, Ae] = m(""), [K, je] = m(null), q = f((e) => {
|
|
126
|
+
let n = e.whereKey ?? e.id, r = w(e, D.where), i = "";
|
|
126
127
|
typeof r == "string" && (i = r), typeof r == "number" && Number.isFinite(r) && (i = String(r));
|
|
127
|
-
let s = C(e.label,
|
|
128
|
+
let s = C(e.label, b);
|
|
128
129
|
if (e.kind === "text") {
|
|
129
|
-
let t =
|
|
130
|
-
return e.placeholderText != null && (t = C(e.placeholderText,
|
|
131
|
-
value:
|
|
130
|
+
let t = T("filters.placeholders.search", { label: e.placeholderLabel == null ? s : C(e.placeholderLabel, b) });
|
|
131
|
+
return e.placeholderText != null && (t = C(e.placeholderText, b)), /* @__PURE__ */ g(o, {
|
|
132
|
+
value: be(i),
|
|
132
133
|
onApply: (t) => {
|
|
133
|
-
let r =
|
|
134
|
-
|
|
135
|
-
...
|
|
134
|
+
let r = xe(t), i = x(D.where, n, r, e.path);
|
|
135
|
+
O({
|
|
136
|
+
...D,
|
|
136
137
|
where: i
|
|
137
138
|
});
|
|
138
139
|
},
|
|
@@ -142,13 +143,13 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
145
|
if (e.kind === "datetime") {
|
|
145
|
-
let t =
|
|
146
|
-
return e.placeholderText != null && (t = C(e.placeholderText,
|
|
146
|
+
let t = T("filters.placeholders.search", { label: e.placeholderLabel == null ? s : C(e.placeholderLabel, b) });
|
|
147
|
+
return e.placeholderText != null && (t = C(e.placeholderText, b)), /* @__PURE__ */ g(o, {
|
|
147
148
|
value: i,
|
|
148
149
|
onApply: (t) => {
|
|
149
|
-
let r =
|
|
150
|
-
|
|
151
|
-
...
|
|
150
|
+
let r = x(D.where, n, t, e.path);
|
|
151
|
+
O({
|
|
152
|
+
...D,
|
|
152
153
|
where: r
|
|
153
154
|
});
|
|
154
155
|
},
|
|
@@ -159,13 +160,13 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
159
160
|
});
|
|
160
161
|
}
|
|
161
162
|
if (e.kind === "number") {
|
|
162
|
-
let t =
|
|
163
|
-
return e.placeholderText != null && (t = C(e.placeholderText,
|
|
163
|
+
let t = T("filters.placeholders.search", { label: e.placeholderLabel == null ? s : C(e.placeholderLabel, b) });
|
|
164
|
+
return e.placeholderText != null && (t = C(e.placeholderText, b)), /* @__PURE__ */ g(o, {
|
|
164
165
|
value: i,
|
|
165
166
|
onApply: (t) => {
|
|
166
|
-
let r = t.trim(), i = r === "" ? null : Number(r), a =
|
|
167
|
-
|
|
168
|
-
...
|
|
167
|
+
let r = t.trim(), i = r === "" ? null : Number(r), a = x(D.where, n, Number.isFinite(i) ? i : null, e.path);
|
|
168
|
+
O({
|
|
169
|
+
...D,
|
|
169
170
|
where: a
|
|
170
171
|
});
|
|
171
172
|
},
|
|
@@ -180,19 +181,19 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
180
181
|
options: [{
|
|
181
182
|
id: "any",
|
|
182
183
|
value: "",
|
|
183
|
-
label:
|
|
184
|
+
label: T("filters.all", { label: s })
|
|
184
185
|
}, ...e.options.map((e) => ({
|
|
185
186
|
id: e.value,
|
|
186
187
|
value: e.value,
|
|
187
|
-
label: C(e.label,
|
|
188
|
+
label: C(e.label, b)
|
|
188
189
|
}))],
|
|
189
190
|
value: i,
|
|
190
191
|
size: "small",
|
|
191
192
|
ariaLabel: s,
|
|
192
193
|
onChange: (t) => {
|
|
193
|
-
let r =
|
|
194
|
-
|
|
195
|
-
...
|
|
194
|
+
let r = x(D.where, n, t, e.path);
|
|
195
|
+
O({
|
|
196
|
+
...D,
|
|
196
197
|
where: r
|
|
197
198
|
});
|
|
198
199
|
}
|
|
@@ -202,13 +203,13 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
202
203
|
typeof r == "boolean" && (t = r);
|
|
203
204
|
let i = "";
|
|
204
205
|
t === !0 && (i = "true"), t === !1 && (i = "false");
|
|
205
|
-
let a = e.trueLabel == null ?
|
|
206
|
+
let a = e.trueLabel == null ? T("filters.boolean.yes") : C(e.trueLabel, b), o = e.falseLabel == null ? T("filters.boolean.no") : C(e.falseLabel, b);
|
|
206
207
|
return /* @__PURE__ */ g(y, {
|
|
207
208
|
options: [
|
|
208
209
|
{
|
|
209
210
|
id: "any",
|
|
210
211
|
value: "",
|
|
211
|
-
label:
|
|
212
|
+
label: T("filters.all", { label: s })
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
215
|
id: "true",
|
|
@@ -227,16 +228,16 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
227
228
|
onChange: (t) => {
|
|
228
229
|
let r = null;
|
|
229
230
|
t === "true" && (r = !0), t === "false" && (r = !1);
|
|
230
|
-
let i =
|
|
231
|
-
|
|
232
|
-
...
|
|
231
|
+
let i = x(D.where, n, r, e.path);
|
|
232
|
+
O({
|
|
233
|
+
...D,
|
|
233
234
|
where: i
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
237
|
});
|
|
237
238
|
}
|
|
238
239
|
let c = (() => {
|
|
239
|
-
if (e.pickerScope != null) return typeof e.pickerScope == "function" ? e.pickerScope(
|
|
240
|
+
if (e.pickerScope != null) return typeof e.pickerScope == "function" ? e.pickerScope(D.where) : e.pickerScope;
|
|
240
241
|
})(), l = null;
|
|
241
242
|
typeof r == "string" && (l = r);
|
|
242
243
|
let u = (r = null, i = !1) => {
|
|
@@ -246,7 +247,7 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
246
247
|
value: l,
|
|
247
248
|
displayValue: a,
|
|
248
249
|
isResolving: i,
|
|
249
|
-
placeholder:
|
|
250
|
+
placeholder: T("filters.placeholders.anyEntity", { label: s }),
|
|
250
251
|
onPick: () => {
|
|
251
252
|
je({
|
|
252
253
|
entity: e.entity,
|
|
@@ -257,9 +258,9 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
257
258
|
});
|
|
258
259
|
},
|
|
259
260
|
onClear: () => {
|
|
260
|
-
let t =
|
|
261
|
-
|
|
262
|
-
...
|
|
261
|
+
let t = x(D.where, n, null, e.path);
|
|
262
|
+
O({
|
|
263
|
+
...D,
|
|
263
264
|
where: t
|
|
264
265
|
});
|
|
265
266
|
}
|
|
@@ -270,88 +271,88 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
270
271
|
id: l,
|
|
271
272
|
children: (e, t) => {
|
|
272
273
|
let n = t?.status === "loading";
|
|
273
|
-
return u(n ?
|
|
274
|
+
return u(n ? T("common.loading") : e, n);
|
|
274
275
|
}
|
|
275
276
|
});
|
|
276
277
|
}, [
|
|
278
|
+
O,
|
|
277
279
|
D,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return Me ? z.filters.filter((e) => e.placement === "quick" || e.placement === "both") : z.filters.slice(0, e);
|
|
280
|
+
T,
|
|
281
|
+
b
|
|
282
|
+
]), Me = p(() => V.filters.some((e) => e.placement != null), [V.filters]), J = p(() => {
|
|
283
|
+
if (V.filters.length === 0) return [];
|
|
284
|
+
let e = V.ui?.toolbar?.maxPromotedFilters ?? 3;
|
|
285
|
+
return Me ? V.filters.filter((e) => e.placement === "quick" || e.placement === "both") : V.filters.slice(0, e);
|
|
285
286
|
}, [
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
V.filters,
|
|
288
|
+
V.ui?.toolbar,
|
|
288
289
|
Me
|
|
289
|
-
]),
|
|
290
|
-
let e =
|
|
290
|
+
]), Y = p(() => V.filters.filter((e) => e.placement == null ? !0 : e.placement === "drawer" || e.placement === "both"), [V.filters]), X = p(() => J.find((e) => e.kind === "text"), [J]), Ne = p(() => {
|
|
291
|
+
let e = J.filter((e) => e !== X);
|
|
291
292
|
return e.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
292
|
-
className:
|
|
293
|
-
children: e.map((e) => /* @__PURE__ */ g("span", { children:
|
|
293
|
+
className: te,
|
|
294
|
+
children: e.map((e) => /* @__PURE__ */ g("span", { children: q(e) }, e.id))
|
|
294
295
|
});
|
|
295
296
|
}, [
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
]), Pe = p(() =>
|
|
300
|
-
if (
|
|
301
|
-
let e =
|
|
297
|
+
J,
|
|
298
|
+
q,
|
|
299
|
+
X
|
|
300
|
+
]), Pe = p(() => X == null ? null : q(X), [q, X]), Fe = p(() => {
|
|
301
|
+
if (V.sorts.length === 0) return null;
|
|
302
|
+
let e = V.sorts[0];
|
|
302
303
|
return e == null ? null : /* @__PURE__ */ g(y, {
|
|
303
|
-
options:
|
|
304
|
+
options: V.sorts.map((e) => ({
|
|
304
305
|
id: e.id,
|
|
305
306
|
value: e.id,
|
|
306
|
-
label: C(e.label,
|
|
307
|
+
label: C(e.label, b)
|
|
307
308
|
})),
|
|
308
|
-
value:
|
|
309
|
+
value: D.sort ?? e.id,
|
|
309
310
|
size: "small",
|
|
310
|
-
ariaLabel:
|
|
311
|
+
ariaLabel: T("list.sort.label"),
|
|
311
312
|
onChange: (e) => {
|
|
312
|
-
|
|
313
|
-
...
|
|
313
|
+
O({
|
|
314
|
+
...D,
|
|
314
315
|
sort: e
|
|
315
316
|
});
|
|
316
317
|
}
|
|
317
318
|
});
|
|
318
319
|
}, [
|
|
319
|
-
|
|
320
|
+
V.sorts,
|
|
321
|
+
O,
|
|
320
322
|
D,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
let
|
|
330
|
-
|
|
331
|
-
let r = C(n.label, x);
|
|
323
|
+
T,
|
|
324
|
+
b
|
|
325
|
+
]), Ie = p(() => U.length === 0 ? null : /* @__PURE__ */ g(me, {
|
|
326
|
+
chips: U,
|
|
327
|
+
onClearAll: W
|
|
328
|
+
}), [U, W]), Le = p(() => {
|
|
329
|
+
if (Y.length === 0) return [];
|
|
330
|
+
let e = G.trim().toLowerCase(), t = [];
|
|
331
|
+
for (let n of Y) {
|
|
332
|
+
let r = C(n.label, b);
|
|
332
333
|
(e === "" || r.toLowerCase().includes(e)) && t.push({
|
|
333
334
|
id: n.id,
|
|
334
|
-
node: /* @__PURE__ */ g(
|
|
335
|
+
node: /* @__PURE__ */ g(fe, {
|
|
335
336
|
label: r,
|
|
336
|
-
children:
|
|
337
|
+
children: q(n)
|
|
337
338
|
})
|
|
338
339
|
});
|
|
339
340
|
}
|
|
340
341
|
return t.length === 0 ? [] : [{
|
|
341
342
|
id: "backoffice.filters.sections.default",
|
|
342
|
-
title:
|
|
343
|
+
title: T("filters.sections.default"),
|
|
343
344
|
items: t
|
|
344
345
|
}];
|
|
345
346
|
}, [
|
|
346
|
-
|
|
347
|
-
U,
|
|
347
|
+
Y,
|
|
348
348
|
G,
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
q,
|
|
350
|
+
T,
|
|
351
|
+
b
|
|
351
352
|
]), Re = p(() => {
|
|
352
|
-
if (
|
|
353
|
-
let e =
|
|
354
|
-
return e > 0 && (t =
|
|
353
|
+
if (Y.length === 0) return null;
|
|
354
|
+
let e = U.length, t = T("filters.trigger");
|
|
355
|
+
return e > 0 && (t = T("filters.triggerWithCount", { count: e })), /* @__PURE__ */ g(v, {
|
|
355
356
|
type: "button",
|
|
356
357
|
variant: "secondary",
|
|
357
358
|
size: "small",
|
|
@@ -361,209 +362,216 @@ var C = (e, t) => e(t), _e = (e, t) => e.fromGraphQL != null && t != null ? e.fr
|
|
|
361
362
|
children: t
|
|
362
363
|
});
|
|
363
364
|
}, [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
]), ze = /* @__PURE__ */ g(
|
|
365
|
+
U.length,
|
|
366
|
+
Y.length,
|
|
367
|
+
T
|
|
368
|
+
]), ze = /* @__PURE__ */ g(de, {
|
|
368
369
|
isOpen: Oe,
|
|
369
370
|
onClose: () => {
|
|
370
371
|
ke(!1), Ae("");
|
|
371
372
|
},
|
|
372
373
|
sections: Le,
|
|
373
|
-
searchValue:
|
|
374
|
+
searchValue: G,
|
|
374
375
|
onSearchChange: (e) => {
|
|
375
376
|
Ae(e);
|
|
376
377
|
},
|
|
377
|
-
onReset:
|
|
378
|
-
emptyLabel:
|
|
379
|
-
}), Be = p(() =>
|
|
378
|
+
onReset: W,
|
|
379
|
+
emptyLabel: G.trim() === "" ? void 0 : T("filters.drawer.emptySearchResults")
|
|
380
|
+
}), Be = p(() => R ?? (we ? /* @__PURE__ */ g(ue, {
|
|
380
381
|
variant: "embedded",
|
|
381
|
-
ariaLabel:
|
|
382
|
-
}) :
|
|
383
|
-
title:
|
|
384
|
-
description:
|
|
382
|
+
ariaLabel: T("common.loading")
|
|
383
|
+
}) : U.length > 0 ? /* @__PURE__ */ g(se, {
|
|
384
|
+
title: T("emptyState.listEmpty.title"),
|
|
385
|
+
description: T("emptyState.listEmptyFiltered.description"),
|
|
385
386
|
actions: /* @__PURE__ */ g(v, {
|
|
386
387
|
type: "button",
|
|
387
388
|
variant: "secondary",
|
|
388
389
|
size: "small",
|
|
389
|
-
onClick:
|
|
390
|
-
children:
|
|
390
|
+
onClick: W,
|
|
391
|
+
children: T("emptyState.listEmptyFiltered.actions.reset")
|
|
391
392
|
})
|
|
392
|
-
}) : /* @__PURE__ */ g(
|
|
393
|
-
title:
|
|
394
|
-
description:
|
|
393
|
+
}) : /* @__PURE__ */ g(se, {
|
|
394
|
+
title: T("emptyState.listEmpty.title"),
|
|
395
|
+
description: T("emptyState.listEmpty.description")
|
|
395
396
|
})), [
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
397
|
+
U.length,
|
|
398
|
+
R,
|
|
399
|
+
W,
|
|
399
400
|
we,
|
|
400
|
-
|
|
401
|
-
]), Ve = p(() => typeof
|
|
402
|
-
shown:
|
|
403
|
-
total:
|
|
404
|
-
}) }) :
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
]),
|
|
409
|
-
let e =
|
|
410
|
-
return
|
|
411
|
-
kind:
|
|
401
|
+
T
|
|
402
|
+
]), Ve = p(() => typeof L == "number" ? /* @__PURE__ */ g("span", { children: T("list.showing", {
|
|
403
|
+
shown: k.length,
|
|
404
|
+
total: L
|
|
405
|
+
}) }) : k.length === 0 ? null : /* @__PURE__ */ g("span", { children: T("list.loaded", { count: k.length }) }), [
|
|
406
|
+
k.length,
|
|
407
|
+
T,
|
|
408
|
+
L
|
|
409
|
+
]), Z = p(() => {
|
|
410
|
+
let e = V.ui?.displayMode ?? V.responsive?.mode ?? "auto";
|
|
411
|
+
return ve({
|
|
412
|
+
kind: V.kind,
|
|
412
413
|
displayMode: e,
|
|
413
|
-
ui:
|
|
414
|
+
ui: V.ui
|
|
414
415
|
});
|
|
415
416
|
}, [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
]),
|
|
420
|
-
|
|
421
|
-
!
|
|
422
|
-
entityId:
|
|
423
|
-
loadedCount:
|
|
424
|
-
totalCount:
|
|
417
|
+
V.kind,
|
|
418
|
+
V.responsive?.mode,
|
|
419
|
+
V.ui
|
|
420
|
+
]), Q = typeof L == "number" && k.length < L && !N;
|
|
421
|
+
ae(() => {
|
|
422
|
+
!Q || !Z.infiniteScroll.showInconsistentPageInfo || !ee() || console.warn("Backoffice list received inconsistent pageInfo: loaded rows are lower than totalCount but hasNextPage is false.", {
|
|
423
|
+
entityId: E.id,
|
|
424
|
+
loadedCount: k.length,
|
|
425
|
+
totalCount: L
|
|
425
426
|
});
|
|
426
427
|
}, [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
E.id,
|
|
429
|
+
Q,
|
|
430
|
+
k.length,
|
|
431
|
+
Z.infiniteScroll.showInconsistentPageInfo,
|
|
432
|
+
L
|
|
432
433
|
]);
|
|
433
|
-
let
|
|
434
|
-
enabled: !
|
|
435
|
-
hasNextPage:
|
|
436
|
-
isLoading:
|
|
437
|
-
onIntersect:
|
|
438
|
-
rootMargin:
|
|
439
|
-
threshold:
|
|
440
|
-
}),
|
|
434
|
+
let He = i.virtualize === !0 || Z.virtualization.enabled, { sentinelRef: Ue } = u({
|
|
435
|
+
enabled: !He && Z.infiniteScroll.enabled,
|
|
436
|
+
hasNextPage: N,
|
|
437
|
+
isLoading: P,
|
|
438
|
+
onIntersect: F,
|
|
439
|
+
rootMargin: Z.infiniteScroll.rootMargin,
|
|
440
|
+
threshold: Z.infiniteScroll.threshold
|
|
441
|
+
}), We = B?.title ?? C(V.title, b), Ge = B?.subtitle, Ke = H.find((e) => e.mobileRole === "action" || e.id === "actions"), qe = V.ui?.displayMode ?? V.responsive?.mode ?? "auto", Je = V.ui?.density ?? V.responsive?.density ?? "compact", Ye = /* @__PURE__ */ g(n, {
|
|
441
442
|
fallback: (e) => {
|
|
442
443
|
let { reset: t } = e;
|
|
443
|
-
return /* @__PURE__ */ g(
|
|
444
|
+
return /* @__PURE__ */ g(ce, {
|
|
444
445
|
tone: "danger",
|
|
445
|
-
title:
|
|
446
|
+
title: T("list.errors.title"),
|
|
446
447
|
actions: /* @__PURE__ */ g(v, {
|
|
447
448
|
type: "button",
|
|
448
449
|
variant: "secondary",
|
|
449
450
|
size: "small",
|
|
450
451
|
onClick: () => {
|
|
451
|
-
t(),
|
|
452
|
+
t(), I?.();
|
|
452
453
|
},
|
|
453
|
-
children:
|
|
454
|
+
children: T("list.actions.retry")
|
|
454
455
|
}),
|
|
455
|
-
children:
|
|
456
|
+
children: T("list.errors.tableFailed")
|
|
456
457
|
});
|
|
457
458
|
},
|
|
458
|
-
children:
|
|
459
|
-
columns:
|
|
460
|
-
rows:
|
|
461
|
-
getRowId:
|
|
459
|
+
children: He ? /* @__PURE__ */ g(he, {
|
|
460
|
+
columns: H,
|
|
461
|
+
rows: k,
|
|
462
|
+
getRowId: A,
|
|
462
463
|
emptyState: Be,
|
|
463
|
-
className:
|
|
464
|
-
gridTemplateColumns:
|
|
465
|
-
virtualization:
|
|
464
|
+
className: S,
|
|
465
|
+
gridTemplateColumns: M,
|
|
466
|
+
virtualization: Z.virtualization,
|
|
466
467
|
infiniteScroll: {
|
|
467
|
-
enabled:
|
|
468
|
-
thresholdPx:
|
|
469
|
-
autoLoad:
|
|
468
|
+
enabled: Z.infiniteScroll.enabled,
|
|
469
|
+
thresholdPx: Z.infiniteScroll.thresholdPx,
|
|
470
|
+
autoLoad: Z.infiniteScroll.autoLoad
|
|
470
471
|
},
|
|
471
|
-
hasNextPage:
|
|
472
|
-
isLoadingMore:
|
|
473
|
-
onLoadMore:
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
472
|
+
hasNextPage: N,
|
|
473
|
+
isLoadingMore: P,
|
|
474
|
+
onLoadMore: F,
|
|
475
|
+
bodyScrollMode: l
|
|
476
|
+
}) : /* @__PURE__ */ g(_e, {
|
|
477
|
+
columns: H,
|
|
478
|
+
rows: k,
|
|
479
|
+
getRowId: A,
|
|
478
480
|
emptyState: Be,
|
|
479
|
-
className:
|
|
480
|
-
gridTemplateColumns:
|
|
481
|
-
mode:
|
|
482
|
-
density:
|
|
483
|
-
|
|
481
|
+
className: S,
|
|
482
|
+
gridTemplateColumns: M,
|
|
483
|
+
mode: qe,
|
|
484
|
+
density: Je,
|
|
485
|
+
bodyScrollMode: l,
|
|
486
|
+
bodyFooterNode: Z.infiniteScroll.enabled ? /* @__PURE__ */ g("div", {
|
|
487
|
+
ref: Ue,
|
|
488
|
+
"aria-hidden": "true"
|
|
489
|
+
}) : null,
|
|
490
|
+
renderAction: (e) => Ke?.cell(e) ?? null
|
|
484
491
|
})
|
|
485
|
-
}),
|
|
492
|
+
}), Xe = Ee ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(s, {
|
|
486
493
|
primaryFilters: Pe != null || Ne != null ? /* @__PURE__ */ _(h, { children: [Pe, Ne] }) : null,
|
|
487
494
|
filterDrawerTrigger: Re,
|
|
488
495
|
sortControl: Fe,
|
|
489
|
-
utilityActions:
|
|
496
|
+
utilityActions: I == null ? null : /* @__PURE__ */ g(v, {
|
|
490
497
|
type: "button",
|
|
491
498
|
variant: "secondary",
|
|
492
499
|
size: "small",
|
|
493
|
-
isLoading:
|
|
494
|
-
loadingLabel:
|
|
500
|
+
isLoading: Se,
|
|
501
|
+
loadingLabel: T("list.actions.refreshing"),
|
|
495
502
|
onClick: () => {
|
|
496
|
-
|
|
503
|
+
I();
|
|
497
504
|
},
|
|
498
|
-
children:
|
|
505
|
+
children: T("list.actions.refresh")
|
|
499
506
|
}),
|
|
500
507
|
activeFilters: Ie,
|
|
501
508
|
density: "compact"
|
|
502
|
-
}), ze] }) : null,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}), /* @__PURE__ */ g(
|
|
522
|
-
loadedCount:
|
|
523
|
-
totalCount:
|
|
524
|
-
hasNextPage:
|
|
525
|
-
isLoading:
|
|
526
|
-
pageInfoState:
|
|
509
|
+
}), ze] }) : null, Ze = /* @__PURE__ */ _("div", {
|
|
510
|
+
className: ie,
|
|
511
|
+
children: [Ye, /* @__PURE__ */ g(r, {
|
|
512
|
+
isOpen: K != null,
|
|
513
|
+
entity: K?.entity ?? E.id,
|
|
514
|
+
title: K?.label ?? T("picker.title"),
|
|
515
|
+
scope: K?.scope,
|
|
516
|
+
onClose: () => {
|
|
517
|
+
je(null);
|
|
518
|
+
},
|
|
519
|
+
onSelectId: (e) => {
|
|
520
|
+
if (K == null) return;
|
|
521
|
+
let t = x(D.where, K.whereKey, e, K.path);
|
|
522
|
+
O({
|
|
523
|
+
...D,
|
|
524
|
+
where: t
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
})]
|
|
528
|
+
}), $ = k.length > 0 || P || N ? /* @__PURE__ */ g(h, { children: /* @__PURE__ */ g(pe, {
|
|
529
|
+
loadedCount: k.length,
|
|
530
|
+
totalCount: L,
|
|
531
|
+
hasNextPage: N,
|
|
532
|
+
isLoading: P,
|
|
533
|
+
pageInfoState: Q ? "inconsistent" : P ? "loading" : N ? "ready" : "complete",
|
|
527
534
|
loadedLabel: Ve,
|
|
528
|
-
loadingLabel:
|
|
529
|
-
endLabel:
|
|
530
|
-
})
|
|
535
|
+
loadingLabel: T("list.loadMore.loading"),
|
|
536
|
+
endLabel: T("list.loadMore.end")
|
|
537
|
+
}) }) : null;
|
|
531
538
|
return Te === "embedded" ? /* @__PURE__ */ g(c, {
|
|
532
|
-
config:
|
|
533
|
-
state:
|
|
534
|
-
pushState:
|
|
539
|
+
config: E,
|
|
540
|
+
state: D,
|
|
541
|
+
pushState: O,
|
|
535
542
|
children: /* @__PURE__ */ _("div", {
|
|
536
|
-
className:
|
|
543
|
+
className: ne,
|
|
537
544
|
children: [
|
|
538
545
|
/* @__PURE__ */ g("div", {
|
|
539
|
-
className:
|
|
540
|
-
children:
|
|
546
|
+
className: re,
|
|
547
|
+
children: We
|
|
541
548
|
}),
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
549
|
+
Xe,
|
|
550
|
+
z,
|
|
551
|
+
Ze,
|
|
545
552
|
$
|
|
546
553
|
]
|
|
547
554
|
})
|
|
548
555
|
}) : /* @__PURE__ */ g(c, {
|
|
549
|
-
config:
|
|
550
|
-
state:
|
|
551
|
-
pushState:
|
|
552
|
-
children: /* @__PURE__ */ g(
|
|
553
|
-
headerNode: /* @__PURE__ */ g(
|
|
554
|
-
title:
|
|
555
|
-
subtitle:
|
|
556
|
+
config: E,
|
|
557
|
+
state: D,
|
|
558
|
+
pushState: O,
|
|
559
|
+
children: /* @__PURE__ */ g(ge, {
|
|
560
|
+
headerNode: /* @__PURE__ */ g(le, {
|
|
561
|
+
title: We,
|
|
562
|
+
subtitle: Ge,
|
|
556
563
|
actions: Ce
|
|
557
564
|
}),
|
|
558
|
-
toolbarNode:
|
|
559
|
-
statusNode:
|
|
560
|
-
tableNode:
|
|
565
|
+
toolbarNode: Xe,
|
|
566
|
+
statusNode: z,
|
|
567
|
+
tableNode: Ze,
|
|
561
568
|
tableFooterNode: $,
|
|
562
|
-
presentation: "flat"
|
|
569
|
+
presentation: "flat",
|
|
570
|
+
bodyScrollMode: l
|
|
563
571
|
})
|
|
564
572
|
});
|
|
565
573
|
};
|
|
566
574
|
//#endregion
|
|
567
|
-
export {
|
|
575
|
+
export { T as BackofficeEntityListScaffold, T as default };
|
|
568
576
|
|
|
569
577
|
//# sourceMappingURL=BackofficeEntityListScaffold.js.map
|