@plumile/backoffice-react 0.1.179 → 0.1.181

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.
Files changed (82) hide show
  1. package/lib/esm/auth/authRefreshNotice.css.js +0 -1
  2. package/lib/esm/auth/login/loginPage.css.js +0 -1
  3. package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +1 -1
  4. package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
  5. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
  6. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
  7. package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -0
  8. package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js +1 -1
  9. package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js.map +1 -1
  10. package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +1 -1
  11. package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js.map +1 -1
  12. package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +2 -0
  13. package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +1 -1
  14. package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
  15. package/lib/esm/components/backoffice/links/BackofficeInlineLink.js +2 -2
  16. package/lib/esm/components/backoffice/links/BackofficeInlineLink.js.map +1 -1
  17. package/lib/esm/components/backoffice/links/BackofficeLink.js +2 -2
  18. package/lib/esm/components/backoffice/links/BackofficeLink.js.map +1 -1
  19. package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +0 -1
  20. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js +1 -1
  21. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js.map +1 -1
  22. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +241 -228
  23. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
  24. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +2 -2
  25. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
  26. package/lib/esm/hooks/useBackofficeListRefetch.js +18 -16
  27. package/lib/esm/hooks/useBackofficeListRefetch.js.map +1 -1
  28. package/lib/esm/hooks/useBackofficeListUrlState.js +23 -21
  29. package/lib/esm/hooks/useBackofficeListUrlState.js.map +1 -1
  30. package/lib/esm/i18n/locales/en/backofficeReact.js +1 -0
  31. package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
  32. package/lib/esm/i18n/locales/fr/backofficeReact.js +1 -0
  33. package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
  34. package/lib/esm/index.js +26 -25
  35. package/lib/esm/pages/BackofficeEntityDetailFramePage.js +4 -4
  36. package/lib/esm/pages/BackofficeEntityDetailFramePage.js.map +1 -1
  37. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +1 -1
  38. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
  39. package/lib/esm/pages/BackofficeEntityDetailPage.js +3 -3
  40. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  41. package/lib/esm/pages/BackofficeEntityListPage.js +2 -2
  42. package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
  43. package/lib/esm/pages/detail/buildTabsItems.js +1 -1
  44. package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
  45. package/lib/esm/provider/BackofficeProvider.js +63 -63
  46. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  47. package/lib/esm/relay/RelayProvider.js +2 -13
  48. package/lib/esm/relay/environment.js +2 -463
  49. package/lib/esm/relay/shortAccessTokenEnvironment.js +2 -15
  50. package/lib/esm/relay/useRelayOperationActivity.js +2 -0
  51. package/lib/esm/router/createBackofficeRoutes.js +11 -6
  52. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  53. package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts +3 -2
  54. package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts.map +1 -1
  55. package/lib/types/components/backoffice/links/BackofficeLink.d.ts +3 -2
  56. package/lib/types/components/backoffice/links/BackofficeLink.d.ts.map +1 -1
  57. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
  58. package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts +1 -0
  59. package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
  60. package/lib/types/hooks/useBackofficeListRefetch.d.ts +5 -4
  61. package/lib/types/hooks/useBackofficeListRefetch.d.ts.map +1 -1
  62. package/lib/types/hooks/useBackofficeListUrlState.d.ts.map +1 -1
  63. package/lib/types/i18n/resources.d.ts +2 -0
  64. package/lib/types/i18n/resources.d.ts.map +1 -1
  65. package/lib/types/index.d.ts +3 -2
  66. package/lib/types/index.d.ts.map +1 -1
  67. package/lib/types/pages/BackofficeEntityDetailFramePage.d.ts +6 -3
  68. package/lib/types/pages/BackofficeEntityDetailFramePage.d.ts.map +1 -1
  69. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  70. package/lib/types/relay/RelayProvider.d.ts +1 -6
  71. package/lib/types/relay/RelayProvider.d.ts.map +1 -1
  72. package/lib/types/relay/environment.d.ts +1 -119
  73. package/lib/types/relay/environment.d.ts.map +1 -1
  74. package/lib/types/relay/shortAccessTokenEnvironment.d.ts +4 -3
  75. package/lib/types/relay/shortAccessTokenEnvironment.d.ts.map +1 -1
  76. package/lib/types/relay/useRelayOperationActivity.d.ts +2 -0
  77. package/lib/types/relay/useRelayOperationActivity.d.ts.map +1 -0
  78. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  79. package/package.json +14 -12
  80. package/lib/esm/relay/RelayProvider.js.map +0 -1
  81. package/lib/esm/relay/environment.js.map +0 -1
  82. 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, tableHost as re } from "./backofficeEntityListScaffold.css.js";
12
- import { useCallback as f, useEffect as ie, useMemo as p, useState as m } from "react";
13
- import { InlineBanner as ae } from "@plumile/ui/components/feedback/InlineBanner.js";
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 oe } from "react-i18next";
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 { 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
- import { resolveBackofficeListRuntimeConfig as ve } from "@plumile/backoffice-core/config/listRuntime.js";
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), ye = (e, t) => e.fromGraphQL != null && t != null ? e.fromGraphQL(t) : x(t, e.whereKey ?? e.id, e.path), be = (e, t, n) => {
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
- }, xe = (e) => {
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
- }, Se = (e) => {
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
- }, 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 ?? {
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(() => A.some((e) => e.isPrimary === !0) || A.length === 0 ? A : A.map((e, t) => {
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
- }), [A]), U = p(() => {
75
+ }), [j]), U = p(() => {
75
76
  let e = [];
76
77
  for (let t of V.filters) {
77
- let n = ye(t, E.where), r = be(t, 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, x);
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, x);
86
- if (!e && t.falseLabel != null) return C(t.falseLabel, x);
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 w(e ? "filters.boolean.yes" : "filters.boolean.no");
89
+ return T(e ? "filters.boolean.yes" : "filters.boolean.no");
89
90
  },
90
91
  fallbackBooleanLabels: {
91
- yes: w("filters.boolean.yes"),
92
- no: w("filters.boolean.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, x),
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 = S(E.where, e, null, t.path);
108
- D({
109
- ...E,
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
- E,
121
- w,
122
- x
122
+ T,
123
+ b
123
124
  ]), W = f(() => {
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 = "";
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, x);
129
+ let o = C(e.label, b);
129
130
  if (e.kind === "text") {
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),
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 = Se(t), i = S(E.where, n, r, e.path);
135
- D({
136
- ...E,
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 = 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, {
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 = S(E.where, n, t, e.path);
151
- D({
152
- ...E,
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 = 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, {
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 = S(E.where, n, Number.isFinite(i) ? i : null, e.path);
168
- D({
169
- ...E,
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: w("filters.all", { label: o })
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, x)
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 = S(E.where, n, t, e.path);
195
- D({
196
- ...E,
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 ? w("filters.boolean.yes") : C(e.trueLabel, x), s = e.falseLabel == null ? w("filters.boolean.no") : C(e.falseLabel, x);
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: w("filters.all", { label: o })
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 = S(E.where, n, r, e.path);
232
- D({
233
- ...E,
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(E.where) : 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: w("filters.placeholders.anyEntity", { label: o }),
251
+ placeholder: T("filters.placeholders.anyEntity", { label: o }),
251
252
  onPick: () => {
252
- Me({
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 = S(E.where, n, null, e.path);
262
- D({
263
- ...E,
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 ? w("common.loading") : e, n);
275
+ return u(n ? T("common.loading") : e, n);
275
276
  }
276
277
  });
277
278
  }, [
279
+ O,
278
280
  D,
279
- E,
280
- w,
281
- x
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 Ne ? V.filters.filter((e) => e.placement === "quick" || e.placement === "both") : V.filters.slice(0, e);
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
- Ne
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]), Pe = p(() => {
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
- ]), Fe = p(() => X == null ? null : q(X), [q, X]), Ie = p(() => {
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, x)
308
+ label: C(e.label, b)
308
309
  })),
309
- value: E.sort ?? e.id,
310
+ value: D.sort ?? e.id,
310
311
  size: "small",
311
- ariaLabel: w("list.sort.label"),
312
+ ariaLabel: T("list.sort.label"),
312
313
  onChange: (e) => {
313
- D({
314
- ...E,
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
- E,
323
- w,
324
- x
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]), Re = p(() => {
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, x);
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(ce, {
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: w("filters.sections.default"),
344
+ title: T("filters.sections.default"),
344
345
  items: t
345
346
  }];
346
347
  }, [
347
348
  Y,
348
349
  G,
349
350
  q,
350
- w,
351
- x
352
- ]), ze = p(() => {
351
+ T,
352
+ b
353
+ ]), Ve = p(() => {
353
354
  if (Y.length === 0) return null;
354
- let e = U.length, t = w("filters.trigger");
355
- return e > 0 && (t = w("filters.triggerWithCount", { count: e })), /* @__PURE__ */ g(v, {
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
- Ae(!0);
361
+ Me(!0);
361
362
  },
362
363
  children: t
363
364
  });
364
365
  }, [
365
366
  U.length,
366
367
  Y.length,
367
- w
368
- ]), Be = /* @__PURE__ */ g(se, {
369
- isOpen: ke,
368
+ T
369
+ ]), He = /* @__PURE__ */ g(ue, {
370
+ isOpen: je,
370
371
  onClose: () => {
371
- Ae(!1), je("");
372
+ Me(!1), Ne("");
372
373
  },
373
- sections: Re,
374
+ sections: Be,
374
375
  searchValue: G,
375
376
  onSearchChange: (e) => {
376
- je(e);
377
+ Ne(e);
377
378
  },
378
379
  onReset: W,
379
- emptyLabel: G.trim() === "" ? void 0 : w("filters.drawer.emptySearchResults")
380
- }), Ve = p(() => R ?? (Te ? /* @__PURE__ */ g(fe, {
380
+ emptyLabel: G.trim() === "" ? void 0 : T("filters.drawer.emptySearchResults")
381
+ }), Ue = p(() => we ?? (B ? /* @__PURE__ */ g(he, {
381
382
  variant: "embedded",
382
- ariaLabel: w("common.loading")
383
- }) : U.length > 0 ? /* @__PURE__ */ g(b, {
384
- title: w("emptyState.listEmpty.title"),
385
- description: w("emptyState.listEmptyFiltered.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: w("emptyState.listEmptyFiltered.actions.reset")
392
+ children: T("emptyState.listEmptyFiltered.actions.reset")
392
393
  })
393
- }) : /* @__PURE__ */ g(b, {
394
- title: w("emptyState.listEmpty.title"),
395
- description: w("emptyState.listEmpty.description")
394
+ }) : /* @__PURE__ */ g(le, {
395
+ title: T("emptyState.listEmpty.title"),
396
+ description: T("emptyState.listEmpty.description")
396
397
  })), [
397
398
  U.length,
398
- R,
399
+ we,
399
400
  W,
400
- Te,
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
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 ve({
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 I == "number" && O.length < I && !M;
422
- ie(() => {
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: T.id,
425
- loadedCount: O.length,
426
- totalCount: I
425
+ entityId: E.id,
426
+ loadedCount: k.length,
427
+ totalCount: R
427
428
  });
428
429
  }, [
429
- T.id,
430
+ E.id,
430
431
  Q,
431
- O.length,
432
+ k.length,
432
433
  Z.infiniteScroll.showInconsistentPageInfo,
433
- I
434
+ R
434
435
  ]);
435
- let Ue = o.virtualize === !0 || Z.virtualization.enabled, { sentinelRef: We } = l({
436
- enabled: !Ue && Z.infiniteScroll.enabled,
437
- hasNextPage: M,
438
- isLoading: N,
439
- onIntersect: P,
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
- }), 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
+ }), 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(ae, {
446
+ return /* @__PURE__ */ g(oe, {
446
447
  tone: "danger",
447
- title: w("list.errors.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(), F?.();
454
+ t(), L?.();
454
455
  },
455
- children: w("list.actions.retry")
456
+ children: T("list.actions.retry")
456
457
  }),
457
- children: w("list.errors.tableFailed")
458
+ children: T("list.errors.tableFailed")
458
459
  });
459
460
  },
460
- children: Ue ? /* @__PURE__ */ g(ge, {
461
+ children: Ge ? /* @__PURE__ */ g(ye, {
461
462
  columns: H,
462
- rows: O,
463
- getRowId: k,
464
- emptyState: Ve,
465
- className: _e,
466
- gridTemplateColumns: j,
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: M,
474
- isLoadingMore: N,
475
- onLoadMore: P,
474
+ hasNextPage: N,
475
+ isLoadingMore: P,
476
+ onLoadMore: I,
476
477
  bodyScrollMode: c
477
- }) : /* @__PURE__ */ g(he, {
478
+ }) : /* @__PURE__ */ g(ve, {
478
479
  columns: H,
479
- rows: O,
480
- getRowId: k,
481
- emptyState: Ve,
482
- className: _e,
483
- gridTemplateColumns: j,
484
- mode: Je,
485
- density: Ye,
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: We,
489
+ ref: Ke,
489
490
  "aria-hidden": "true"
490
491
  }) : null,
491
- renderAction: (e) => qe?.cell(e) ?? null
492
+ renderAction: (e) => Ye?.cell(e) ?? null
492
493
  })
493
- }), Ze = De ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(de, {
494
- search: Fe,
495
- primaryFilters: Pe,
496
- filterDrawerTrigger: ze,
497
- sort: Ie,
498
- utilityActions: F == null ? null : /* @__PURE__ */ g(v, {
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: Ce,
503
- loadingLabel: w("list.actions.refreshing"),
503
+ isLoading: F,
504
+ loadingLabel: T("list.actions.refreshing"),
504
505
  onClick: () => {
505
- F();
506
+ L();
506
507
  },
507
- children: w("list.actions.refresh")
508
+ children: T("list.actions.refresh")
508
509
  }),
509
- chips: Le,
510
+ chips: ze,
510
511
  density: "compact"
511
- }), Be] }) : null, Qe = /* @__PURE__ */ _("div", {
512
- className: re,
513
- children: [Xe, /* @__PURE__ */ g(r, {
514
- isOpen: K != null,
515
- entity: K?.entity ?? T.id,
516
- title: K?.label ?? w("picker.title"),
517
- scope: K?.scope,
518
- onClose: () => {
519
- Me(null);
520
- },
521
- onSelectId: (e) => {
522
- if (K == null) return;
523
- let t = S(E.where, K.whereKey, e, K.path);
524
- D({
525
- ...E,
526
- where: t
527
- });
528
- }
529
- })]
530
- }), $ = O.length > 0 || N || M ? /* @__PURE__ */ g(h, { children: /* @__PURE__ */ g(le, {
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: O.length,
533
- totalCount: I,
534
- hasNextPage: M,
535
- isLoading: N,
536
- pageInfoState: Q ? "inconsistent" : N ? "loading" : M ? "ready" : "complete",
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: He,
539
- loading: w("list.loadMore.loading"),
540
- end: w("list.loadMore.end")
551
+ loaded: We,
552
+ loading: T("list.loadMore.loading"),
553
+ end: T("list.loadMore.end")
541
554
  }
542
555
  }) }) : null;
543
- return Ee === "embedded" ? /* @__PURE__ */ g(i, {
544
- config: T,
545
- state: E,
546
- pushState: D,
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: Ge
565
+ children: qe
553
566
  }),
554
- Ze,
555
- z,
556
- Qe,
567
+ $e,
568
+ Te,
569
+ et,
557
570
  $
558
571
  ]
559
572
  })
560
573
  }) : /* @__PURE__ */ g(i, {
561
- config: T,
562
- state: E,
563
- pushState: D,
564
- children: /* @__PURE__ */ g(me, {
565
- headerNode: /* @__PURE__ */ g(ue, {
566
- title: Ge,
567
- subtitle: Ke,
568
- actions: we
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: Ze,
571
- statusNode: z,
572
- tableNode: Qe,
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 { w as BackofficeEntityListScaffold, w as default };
593
+ export { T as BackofficeEntityListScaffold, T as default };
581
594
 
582
595
  //# sourceMappingURL=BackofficeEntityListScaffold.js.map