@plumile/backoffice-react 0.1.115 → 0.1.117

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