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