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