@plumile/backoffice-react 0.1.205 → 0.2.2

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 (124) hide show
  1. package/README.md +12 -2
  2. package/lib/esm/auth/authRefreshNotice.css.js +1 -1
  3. package/lib/esm/auth/authStoryFixtures.js +29 -0
  4. package/lib/esm/auth/authStoryFixtures.js.map +1 -0
  5. package/lib/esm/auth/login/loginPage.css.js +1 -1
  6. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +1 -1
  7. package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +1 -1
  8. package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +1 -1
  9. package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +1 -1
  10. package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +6 -6
  11. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
  12. package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +13 -13
  13. package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -1
  14. package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -1
  15. package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +1 -1
  16. package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js +1 -1
  17. package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js +1 -1
  18. package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +1 -1
  19. package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +1 -1
  20. package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +1 -1
  21. package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js +2 -16
  22. package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js.map +1 -1
  23. package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +1 -1
  24. package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
  25. package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +1 -1
  26. package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +1 -1
  27. package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +5 -5
  28. package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +1 -1
  29. package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
  30. package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +2 -2
  31. package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +1 -1
  32. package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +1 -1
  33. package/lib/esm/components/backoffice/links/backofficeLink.css.js +1 -1
  34. package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -1
  35. package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js +1 -1
  36. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +123 -70
  37. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
  38. package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +1 -1
  39. package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +1 -1
  40. package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +1 -1
  41. package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +1 -1
  42. package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +1 -1
  43. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js.map +1 -1
  44. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +291 -329
  45. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
  46. package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +6 -11
  47. package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -1
  48. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +1 -1
  49. package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js +1 -1
  50. package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +5 -5
  51. package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +1 -1
  52. package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +2 -26
  53. package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +1 -1
  54. package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +1 -1
  55. package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +1 -1
  56. package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +1 -1
  57. package/lib/esm/hooks/useInfiniteConnection.js +40 -38
  58. package/lib/esm/hooks/useInfiniteConnection.js.map +1 -1
  59. package/lib/esm/i18n/locales/en/backofficeReact.js +2 -5
  60. package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
  61. package/lib/esm/i18n/locales/fr/backofficeReact.js +2 -6
  62. package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
  63. package/lib/esm/index.js +42 -42
  64. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +1 -1
  65. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
  66. package/lib/esm/pages/BackofficeEntityDetailPage.js +158 -158
  67. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  68. package/lib/esm/pages/BackofficeEntityListDataPage.js +77 -71
  69. package/lib/esm/pages/BackofficeEntityListDataPage.js.map +1 -1
  70. package/lib/esm/pages/BackofficeEntityListPage.js +89 -91
  71. package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
  72. package/lib/esm/pages/BackofficeEntityListRouteContext.js.map +1 -1
  73. package/lib/esm/pages/backofficeDashboardPage.css.js +1 -1
  74. package/lib/esm/pages/backofficeEntityDetailPage.css.js +1 -1
  75. package/lib/esm/pages/backofficeEntityListPage.css.js +1 -1
  76. package/lib/esm/pages/detail/BackofficeEntityDetailLayoutContext.js.map +1 -1
  77. package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js +1 -1
  78. package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js.map +1 -1
  79. package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
  80. package/lib/esm/provider/BackofficeProvider.js +79 -80
  81. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  82. package/lib/esm/relay/typedRelayHooks.js.map +1 -1
  83. package/lib/esm/storybook/relay/RelayStory.css.js +1 -1
  84. package/lib/esm/style.css +1 -1
  85. package/lib/types/auth/authStoryFixtures.d.ts +3 -0
  86. package/lib/types/auth/authStoryFixtures.d.ts.map +1 -0
  87. package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts +3 -17
  88. package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts.map +1 -1
  89. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
  90. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.d.ts +2 -6
  91. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.d.ts.map +1 -1
  92. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts +2 -2
  93. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
  94. package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts +2 -2
  95. package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts.map +1 -1
  96. package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +1 -11
  97. package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +1 -1
  98. package/lib/types/hooks/useInfiniteConnection.d.ts +3 -2
  99. package/lib/types/hooks/useInfiniteConnection.d.ts.map +1 -1
  100. package/lib/types/i18n/resources.d.ts +2 -13
  101. package/lib/types/i18n/resources.d.ts.map +1 -1
  102. package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
  103. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  104. package/lib/types/pages/BackofficeEntityListDataPage.d.ts.map +1 -1
  105. package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
  106. package/lib/types/pages/BackofficeEntityListRouteContext.d.ts +0 -2
  107. package/lib/types/pages/BackofficeEntityListRouteContext.d.ts.map +1 -1
  108. package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts +2 -2
  109. package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts.map +1 -1
  110. package/lib/types/pages/detail/buildTabsItems.d.ts +2 -2
  111. package/lib/types/pages/detail/buildTabsItems.d.ts.map +1 -1
  112. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  113. package/lib/types/relay/typedRelayHooks.d.ts +3 -5
  114. package/lib/types/relay/typedRelayHooks.d.ts.map +1 -1
  115. package/package.json +17 -17
  116. package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js.map +0 -1
  117. package/lib/esm/hooks/useBackofficeLoadMore.js +0 -18
  118. package/lib/esm/hooks/useBackofficeLoadMore.js.map +0 -1
  119. package/lib/esm/provider/BackofficeListUiStateContext.js +0 -88
  120. package/lib/esm/provider/BackofficeListUiStateContext.js.map +0 -1
  121. package/lib/types/hooks/useBackofficeLoadMore.d.ts +0 -9
  122. package/lib/types/hooks/useBackofficeLoadMore.d.ts.map +0 -1
  123. package/lib/types/provider/BackofficeListUiStateContext.d.ts +0 -21
  124. package/lib/types/provider/BackofficeListUiStateContext.d.ts.map +0 -1
@@ -8,43 +8,41 @@ 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 { controlsRow as u, embeddedContainer as d, embeddedHeader as ee, entityIdListFilter as te, entityIdListTags as ne, filterInput as f, refreshingIndicator as re, tableHost as ie } from "./backofficeEntityListScaffold.css.js";
11
- import { useCallback as p, useEffect as ae, useMemo as m, useState as h } from "react";
12
- import { InlineBanner as oe } from "@plumile/ui/components/feedback/InlineBanner.js";
13
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
14
- import { useTranslation as se } from "react-i18next";
15
- import { Button as y } from "@plumile/ui/atomic/atoms/button/Button.js";
16
- import { SimpleSelect as b } from "@plumile/ui/components/select/SimpleSelect.js";
17
- import { Spinner as ce } from "@plumile/ui/backoffice/atoms/spinner/Spinner.js";
18
- import { BackofficeEmptyState as le } from "@plumile/ui/backoffice/molecules/backoffice_empty_state/BackofficeEmptyState.js";
19
- import { Tag as ue } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
20
- import { readWhereValue as x, setWhereValue as S } from "@plumile/backoffice-core/filters/where.js";
21
- import { BackofficeFilterDrawer as de } from "@plumile/ui/backoffice/molecules/backoffice_filter_drawer/BackofficeFilterDrawer.js";
11
+ import { useCallback as ae, useEffect as oe, useMemo as p, useState as se } from "react";
12
+ import { InlineBanner as ce } from "@plumile/ui/components/feedback/InlineBanner.js";
13
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ import { useTranslation as le } from "react-i18next";
15
+ import { Button as _ } from "@plumile/ui/atomic/atoms/button/Button.js";
16
+ import { SimpleSelect as v } from "@plumile/ui/components/select/SimpleSelect.js";
17
+ import { Spinner as ue } from "@plumile/ui/backoffice/atoms/spinner/Spinner.js";
18
+ import { BackofficeEmptyState as y } from "@plumile/ui/backoffice/molecules/backoffice_empty_state/BackofficeEmptyState.js";
19
+ import { Tag as de } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
20
+ import { readWhereValue as b, setWhereValue as x } from "@plumile/backoffice-core/filters/where.js";
22
21
  import { BackofficeFilterField as fe } from "@plumile/ui/backoffice/molecules/backoffice_filter_field/BackofficeFilterField.js";
23
22
  import { BackofficeListFooter as pe } from "@plumile/ui/backoffice/molecules/backoffice_list_footer/BackofficeListFooter.js";
24
23
  import { BackofficePageHeader as me } from "@plumile/ui/backoffice/molecules/backoffice_page_header/BackofficePageHeader.js";
25
- import { BackofficeToolbar as he } from "@plumile/ui/backoffice/molecules/backoffice_toolbar/BackofficeToolbar.js";
26
- import { BackofficeTableSkeleton as ge } from "@plumile/ui/backoffice/molecules/backoffice_table_skeleton/BackofficeTableSkeleton.js";
27
- import { FilterChipRow as _e } from "@plumile/ui/backoffice/molecules/filter_chip_row/FilterChipRow.js";
28
- import { ListPageTemplate as ve } from "@plumile/ui/backoffice/templates/list_page_template/ListPageTemplate.js";
29
- import { ResponsiveRecordList as ye } from "@plumile/ui/components/data-table/ResponsiveRecordList.js";
30
- import { VirtualizedConnectionTable as be } from "@plumile/ui/components/data-table/VirtualizedConnectionTable.js";
31
- import { denseTableClass as xe } from "@plumile/ui/shared/backofficeTableDensity.css.js";
32
- import { resolveBackofficeListRuntimeConfig as Se } from "@plumile/backoffice-core/config/listRuntime.js";
33
- import { isDevEnv as Ce } from "@plumile/relay/envHelpers.js";
24
+ import { BackofficeTableSkeleton as he } from "@plumile/ui/backoffice/molecules/backoffice_table_skeleton/BackofficeTableSkeleton.js";
25
+ import { BackofficeListFilterToolbar as ge } from "@plumile/ui/backoffice/organisms/backoffice_list_filter_toolbar/BackofficeListFilterToolbar.js";
26
+ import { ListPageTemplate as _e } from "@plumile/ui/backoffice/templates/list_page_template/ListPageTemplate.js";
27
+ import { ResponsiveRecordList as ve } from "@plumile/ui/components/data-table/ResponsiveRecordList.js";
28
+ import { VirtualizedConnectionTable as ye } from "@plumile/ui/components/data-table/VirtualizedConnectionTable.js";
29
+ import { denseTableClass as be } from "@plumile/ui/shared/backofficeTableDensity.css.js";
30
+ import { resolveBackofficeListRuntimeConfig as xe } from "@plumile/backoffice-core/config/listRuntime.js";
31
+ import { isDevEnv as Se } from "@plumile/relay/envHelpers.js";
34
32
  //#region src/components/backoffice/scaffolds/BackofficeEntityListScaffold.tsx
35
- var C = (e, t) => e(t), we = (e, t) => {
33
+ var S = (e, t) => e(t), Ce = (e, t) => {
36
34
  if (e.fromGraphQL != null && t != null) return e.fromGraphQL(t);
37
35
  let n = e.whereKey ?? e.id;
38
- return x(t, n, e.path);
39
- }, Te = (e) => Array.isArray(e) ? e.map((e) => {
36
+ return b(t, n, e.path);
37
+ }, we = (e) => Array.isArray(e) ? e.map((e) => {
40
38
  if (e == null) return null;
41
39
  let t = String(e).trim();
42
40
  return t === "" ? null : t;
43
- }).filter((e) => e != null) : [], Ee = (e, t, n) => {
41
+ }).filter((e) => e != null) : [], Te = (e, t, n) => {
44
42
  if (t == null) return null;
45
43
  if (Array.isArray(t)) {
46
- let n = Te(t);
47
- return n.length === 0 ? null : e.kind === "entityIdList" ? /* @__PURE__ */ _(g, { children: n.map((t, r) => /* @__PURE__ */ v("span", { children: [/* @__PURE__ */ _(o, {
44
+ let n = we(t);
45
+ return n.length === 0 ? null : e.kind === "entityIdList" ? /* @__PURE__ */ h(m, { children: n.map((t, r) => /* @__PURE__ */ g("span", { children: [/* @__PURE__ */ h(o, {
48
46
  entityId: e.entity,
49
47
  id: t
50
48
  }), r < n.length - 1 ? ", " : null] }, t)) }) : n.join(", ");
@@ -52,22 +50,22 @@ var C = (e, t) => e(t), we = (e, t) => {
52
50
  if (typeof t == "boolean") return e.kind === "boolean" ? n.booleanLabel(t) : t ? n.fallbackBooleanLabels.yes : n.fallbackBooleanLabels.no;
53
51
  if (typeof t != "string" && typeof t != "number") return null;
54
52
  let r = String(t).trim();
55
- return r === "" ? null : e.kind === "entityId" ? /* @__PURE__ */ _(o, {
53
+ return r === "" ? null : e.kind === "entityId" ? /* @__PURE__ */ h(o, {
56
54
  entityId: e.entity,
57
55
  id: r
58
56
  }) : e.kind === "enum" ? n.enumLabel(r) : r;
59
- }, De = (e) => {
57
+ }, Ee = (e) => {
60
58
  let t = new Date(e);
61
59
  if (Number.isNaN(t.getTime())) return e;
62
60
  let n = t.getTimezoneOffset() * 6e4;
63
61
  return new Date(t.getTime() - n).toISOString().slice(0, 16);
64
- }, Oe = (e) => {
62
+ }, De = (e) => {
65
63
  let t = e.trim();
66
64
  if (t === "") return "";
67
65
  let n = new Date(t);
68
66
  return Number.isNaN(n.getTime()) ? t : n.toISOString();
69
- }, w = (x) => {
70
- let { t: w } = se(), { t: T } = e(), { config: E, state: D, pushState: O, rows: k, getRowId: ke, columns: A, gridTemplateColumns: Ae, hasNextPage: j, isLoadingMore: M, isRefreshing: N = !1, onLoadMore: P, onRefresh: F, totalCount: I, loadedCountLabel: je, emptyState: Me, statusBanner: Ne, header: Pe, headerActions: Fe, isLoadingInitial: L = !1, variant: Ie = "page", showFilters: Le = !0 } = x, R = E.list, { listDefaults: Re } = E, z = m(() => A.some((e) => e.isPrimary === !0) || A.length === 0 ? A : A.map((e, t) => {
67
+ }, C = (b) => {
68
+ let { t: C } = le(), { t: w } = e(), { config: T, state: E, pushState: D, rows: O, getRowId: k, columns: A, gridTemplateColumns: j, hasNextPage: M, isLoadingMore: N, incrementalError: P = null, isRefreshing: F = !1, onLoadMore: I, onRetryLoadMore: L, onRefresh: R, totalCount: z, loadedCountLabel: B, emptyState: Oe, statusBanner: ke, header: Ae, headerActions: je, isLoadingInitial: V = !1, variant: Me = "page", showFilters: Ne = !0 } = b, H = T.list, { listDefaults: Pe } = T, U = p(() => A.some((e) => e.isPrimary === !0) || A.length === 0 ? A : A.map((e, t) => {
71
69
  let { header: n } = e;
72
70
  return t === 0 ? {
73
71
  ...e,
@@ -77,32 +75,32 @@ var C = (e, t) => e(t), we = (e, t) => {
77
75
  ...e,
78
76
  header: n
79
77
  };
80
- }), [A]), B = m(() => {
78
+ }), [A]), W = p(() => {
81
79
  let e = [];
82
- for (let t of R.filters) {
83
- let n = we(t, D.where), r = Ee(t, n, {
80
+ for (let t of H.filters) {
81
+ let n = Ce(t, E.where), r = Te(t, n, {
84
82
  enumLabel: (e) => {
85
83
  if (t.kind !== "enum") return e;
86
84
  let n = t.options.find((t) => t.value === e);
87
- return n == null ? e : C(n.label, w);
85
+ return n == null ? e : S(n.label, C);
88
86
  },
89
87
  booleanLabel: (e) => {
90
88
  if (t.kind === "boolean") {
91
- if (e && t.trueLabel != null) return C(t.trueLabel, w);
92
- if (!e && t.falseLabel != null) return C(t.falseLabel, w);
89
+ if (e && t.trueLabel != null) return S(t.trueLabel, C);
90
+ if (!e && t.falseLabel != null) return S(t.falseLabel, C);
93
91
  }
94
- return T(e ? "filters.boolean.yes" : "filters.boolean.no");
92
+ return w(e ? "filters.boolean.yes" : "filters.boolean.no");
95
93
  },
96
94
  fallbackBooleanLabels: {
97
- yes: T("filters.boolean.yes"),
98
- no: T("filters.boolean.no")
95
+ yes: w("filters.boolean.yes"),
96
+ no: w("filters.boolean.no")
99
97
  }
100
98
  });
101
99
  if (r != null) {
102
100
  let i = String(n);
103
101
  Array.isArray(n) && (i = n.join(","));
104
- let a = /* @__PURE__ */ v("span", { children: [
105
- C(t.label, w),
102
+ let a = /* @__PURE__ */ g("span", { children: [
103
+ S(t.label, C),
106
104
  ": ",
107
105
  r
108
106
  ] });
@@ -110,9 +108,9 @@ var C = (e, t) => e(t), we = (e, t) => {
110
108
  id: `${t.id}:${i}`,
111
109
  label: a,
112
110
  onRemove: () => {
113
- let e = t.whereKey ?? t.id, n = S(D.where, e, null, t.path);
114
- O({
115
- ...D,
111
+ let e = t.whereKey ?? t.id, n = x(E.where, e, null, t.path);
112
+ D({
113
+ ...E,
116
114
  where: n
117
115
  });
118
116
  }
@@ -121,33 +119,25 @@ var C = (e, t) => e(t), we = (e, t) => {
121
119
  }
122
120
  return e;
123
121
  }, [
124
- R.filters,
125
- O,
122
+ H.filters,
126
123
  D,
127
- T,
128
- w
129
- ]), V = p(() => {
130
- O({ ...Re });
131
- }, [Re, O]), [ze, H] = h(!1), [Be, Ve] = h(""), U = x.filterDrawerState ?? {
132
- isOpen: ze,
133
- search: Be,
134
- setOpen: H,
135
- setSearch: Ve,
136
- reset: () => {
137
- H(!1), Ve("");
138
- }
139
- }, He = U.isOpen, W = U.search, G = U.setOpen, Ue = U.setSearch, We = U.reset, [K, q] = h(null), J = p((e) => {
140
- let n = e.whereKey ?? e.id, r = we(e, D.where), i = "";
124
+ E,
125
+ w,
126
+ C
127
+ ]), G = ae(() => {
128
+ D({ ...Pe });
129
+ }, [Pe, D]), [K, q] = se(null), J = ae((e) => {
130
+ let n = e.whereKey ?? e.id, r = Ce(e, E.where), i = "";
141
131
  typeof r == "string" && (i = r), typeof r == "number" && Number.isFinite(r) && (i = String(r));
142
- let c = C(e.label, w);
132
+ let c = S(e.label, C);
143
133
  if (e.kind === "text") {
144
- let t = e.placeholderLabel == null ? c : C(e.placeholderLabel, w), r = T("filters.placeholders.search", { label: t });
145
- return e.placeholderText != null && (r = C(e.placeholderText, w)), /* @__PURE__ */ _(a, {
134
+ let t = e.placeholderLabel == null ? c : S(e.placeholderLabel, C), r = w("filters.placeholders.search", { label: t });
135
+ return e.placeholderText != null && (r = S(e.placeholderText, C)), /* @__PURE__ */ h(a, {
146
136
  value: i,
147
137
  onApply: (t) => {
148
- let r = S(D.where, n, t, e.path);
149
- O({
150
- ...D,
138
+ let r = x(E.where, n, t, e.path);
139
+ D({
140
+ ...E,
151
141
  where: r
152
142
  });
153
143
  },
@@ -157,13 +147,13 @@ var C = (e, t) => e(t), we = (e, t) => {
157
147
  });
158
148
  }
159
149
  if (e.kind === "datetime") {
160
- let t = e.placeholderLabel == null ? c : C(e.placeholderLabel, w), r = T("filters.placeholders.search", { label: t });
161
- return e.placeholderText != null && (r = C(e.placeholderText, w)), /* @__PURE__ */ _(a, {
162
- value: De(i),
150
+ let t = e.placeholderLabel == null ? c : S(e.placeholderLabel, C), r = w("filters.placeholders.search", { label: t });
151
+ return e.placeholderText != null && (r = S(e.placeholderText, C)), /* @__PURE__ */ h(a, {
152
+ value: Ee(i),
163
153
  onApply: (t) => {
164
- let r = Oe(t), i = S(D.where, n, r, e.path);
165
- O({
166
- ...D,
154
+ let r = De(t), i = x(E.where, n, r, e.path);
155
+ D({
156
+ ...E,
167
157
  where: i
168
158
  });
169
159
  },
@@ -174,13 +164,13 @@ var C = (e, t) => e(t), we = (e, t) => {
174
164
  });
175
165
  }
176
166
  if (e.kind === "number") {
177
- let t = e.placeholderLabel == null ? c : C(e.placeholderLabel, w), r = T("filters.placeholders.search", { label: t });
178
- return e.placeholderText != null && (r = C(e.placeholderText, w)), /* @__PURE__ */ _(a, {
167
+ let t = e.placeholderLabel == null ? c : S(e.placeholderLabel, C), r = w("filters.placeholders.search", { label: t });
168
+ return e.placeholderText != null && (r = S(e.placeholderText, C)), /* @__PURE__ */ h(a, {
179
169
  value: i,
180
170
  onApply: (t) => {
181
- let r = t.trim(), i = r === "" ? null : Number(r), a = S(D.where, n, Number.isFinite(i) ? i : null, e.path);
182
- O({
183
- ...D,
171
+ let r = t.trim(), i = r === "" ? null : Number(r), a = x(E.where, n, Number.isFinite(i) ? i : null, e.path);
172
+ D({
173
+ ...E,
184
174
  where: a
185
175
  });
186
176
  },
@@ -195,21 +185,21 @@ var C = (e, t) => e(t), we = (e, t) => {
195
185
  let t = [{
196
186
  id: "any",
197
187
  value: "",
198
- label: T("filters.all", { label: c })
188
+ label: w("filters.all", { label: c })
199
189
  }, ...e.options.map((e) => ({
200
190
  id: e.value,
201
191
  value: e.value,
202
- label: C(e.label, w)
192
+ label: S(e.label, C)
203
193
  }))];
204
- return /* @__PURE__ */ _(b, {
194
+ return /* @__PURE__ */ h(v, {
205
195
  options: t,
206
196
  value: i,
207
197
  size: "small",
208
198
  ariaLabel: c,
209
199
  onChange: (t) => {
210
- let r = S(D.where, n, t, e.path);
211
- O({
212
- ...D,
200
+ let r = x(E.where, n, t, e.path);
201
+ D({
202
+ ...E,
213
203
  where: r
214
204
  });
215
205
  }
@@ -220,11 +210,11 @@ var C = (e, t) => e(t), we = (e, t) => {
220
210
  typeof r == "boolean" && (t = r);
221
211
  let i = "";
222
212
  t === !0 && (i = "true"), t === !1 && (i = "false");
223
- let a = e.trueLabel == null ? T("filters.boolean.yes") : C(e.trueLabel, w), o = e.falseLabel == null ? T("filters.boolean.no") : C(e.falseLabel, w), s = [
213
+ let a = e.trueLabel == null ? w("filters.boolean.yes") : S(e.trueLabel, C), o = e.falseLabel == null ? w("filters.boolean.no") : S(e.falseLabel, C), s = [
224
214
  {
225
215
  id: "any",
226
216
  value: "",
227
- label: T("filters.all", { label: c })
217
+ label: w("filters.all", { label: c })
228
218
  },
229
219
  {
230
220
  id: "true",
@@ -237,7 +227,7 @@ var C = (e, t) => e(t), we = (e, t) => {
237
227
  label: o
238
228
  }
239
229
  ];
240
- return /* @__PURE__ */ _(b, {
230
+ return /* @__PURE__ */ h(v, {
241
231
  options: s,
242
232
  value: i,
243
233
  size: "small",
@@ -245,32 +235,32 @@ var C = (e, t) => e(t), we = (e, t) => {
245
235
  onChange: (t) => {
246
236
  let r = null;
247
237
  t === "true" && (r = !0), t === "false" && (r = !1);
248
- let i = S(D.where, n, r, e.path);
249
- O({
250
- ...D,
238
+ let i = x(E.where, n, r, e.path);
239
+ D({
240
+ ...E,
251
241
  where: i
252
242
  });
253
243
  }
254
244
  });
255
245
  }
256
246
  let l = (() => {
257
- if (e.pickerScope != null) return typeof e.pickerScope == "function" ? e.pickerScope(D.where) : e.pickerScope;
247
+ if (e.pickerScope != null) return typeof e.pickerScope == "function" ? e.pickerScope(E.where) : e.pickerScope;
258
248
  })();
259
249
  if (e.kind === "entityIdList") {
260
- let i = Te(r), a = i.length, s = a === 0 ? null : T("filters.selectedEntities", { count: a }), u = (t) => {
261
- let r = i.filter((e) => e !== t), a = S(D.where, n, r.length === 0 ? null : r, e.path);
262
- O({
263
- ...D,
250
+ let i = we(r), a = i.length, s = a === 0 ? null : w("filters.selectedEntities", { count: a }), u = (t) => {
251
+ let r = i.filter((e) => e !== t), a = x(E.where, n, r.length === 0 ? null : r, e.path);
252
+ D({
253
+ ...E,
264
254
  where: a
265
255
  });
266
256
  };
267
- return /* @__PURE__ */ v("div", {
257
+ return /* @__PURE__ */ g("div", {
268
258
  className: te,
269
- children: [/* @__PURE__ */ _(t, {
259
+ children: [/* @__PURE__ */ h(t, {
270
260
  label: c,
271
261
  value: a === 0 ? null : i.join(","),
272
262
  displayValue: s,
273
- placeholder: T("filters.placeholders.anyEntity", { label: c }),
263
+ placeholder: w("filters.placeholders.anyEntity", { label: c }),
274
264
  onPick: () => {
275
265
  q({
276
266
  entity: e.entity,
@@ -283,20 +273,20 @@ var C = (e, t) => e(t), we = (e, t) => {
283
273
  });
284
274
  },
285
275
  onClear: () => {
286
- let t = S(D.where, n, null, e.path);
287
- O({
288
- ...D,
276
+ let t = x(E.where, n, null, e.path);
277
+ D({
278
+ ...E,
289
279
  where: t
290
280
  });
291
281
  }
292
- }), i.length > 0 ? /* @__PURE__ */ _("div", {
282
+ }), i.length > 0 ? /* @__PURE__ */ h("div", {
293
283
  className: ne,
294
- children: i.map((t) => /* @__PURE__ */ _(ue, {
295
- removeLabel: T("filters.actions.removeFilterValue", { label: c }),
284
+ children: i.map((t) => /* @__PURE__ */ h(de, {
285
+ removeLabel: w("filters.actions.removeFilterValue", { label: c }),
296
286
  onRemove: () => {
297
287
  u(t);
298
288
  },
299
- children: /* @__PURE__ */ _(o, {
289
+ children: /* @__PURE__ */ h(o, {
300
290
  entityId: e.entity,
301
291
  id: t
302
292
  })
@@ -305,13 +295,13 @@ var C = (e, t) => e(t), we = (e, t) => {
305
295
  });
306
296
  }
307
297
  if (e.kind === "stringList") {
308
- let t = e.placeholderLabel == null ? c : C(e.placeholderLabel, w), r = T("filters.placeholders.search", { label: t });
309
- return e.placeholderText != null && (r = C(e.placeholderText, w)), /* @__PURE__ */ _(a, {
298
+ let t = e.placeholderLabel == null ? c : S(e.placeholderLabel, C), r = w("filters.placeholders.search", { label: t });
299
+ return e.placeholderText != null && (r = S(e.placeholderText, C)), /* @__PURE__ */ h(a, {
310
300
  value: i,
311
301
  onApply: (t) => {
312
- let r = t.split(/[\n,]+/u).map((e) => e.trim()).filter((e) => e !== ""), i = S(D.where, n, r, e.path);
313
- O({
314
- ...D,
302
+ let r = t.split(/[\n,]+/u).map((e) => e.trim()).filter((e) => e !== ""), i = x(E.where, n, r, e.path);
303
+ D({
304
+ ...E,
315
305
  where: i
316
306
  });
317
307
  },
@@ -324,12 +314,12 @@ var C = (e, t) => e(t), we = (e, t) => {
324
314
  typeof r == "string" && (u = r);
325
315
  let d = (r = null, i = !1) => {
326
316
  let a = r?.trim() ?? "";
327
- return /* @__PURE__ */ _(t, {
317
+ return /* @__PURE__ */ h(t, {
328
318
  label: c,
329
319
  value: u,
330
320
  displayValue: a,
331
321
  isResolving: i,
332
- placeholder: T("filters.placeholders.anyEntity", { label: c }),
322
+ placeholder: w("filters.placeholders.anyEntity", { label: c }),
333
323
  onPick: () => {
334
324
  q({
335
325
  entity: e.entity,
@@ -341,276 +331,246 @@ var C = (e, t) => e(t), we = (e, t) => {
341
331
  });
342
332
  },
343
333
  onClear: () => {
344
- let t = S(D.where, n, null, e.path);
345
- O({
346
- ...D,
334
+ let t = x(E.where, n, null, e.path);
335
+ D({
336
+ ...E,
347
337
  where: t
348
338
  });
349
339
  }
350
340
  });
351
341
  };
352
- return u == null || u.trim() === "" ? d() : /* @__PURE__ */ _(s, {
342
+ return u == null || u.trim() === "" ? d() : /* @__PURE__ */ h(s, {
353
343
  entityId: e.entity,
354
344
  id: u,
355
345
  children: (e, t) => {
356
346
  let n = t?.status === "loading";
357
- return d(n ? T("common.loading") : e, n);
347
+ return d(n ? w("common.loading") : e, n);
358
348
  }
359
349
  });
360
350
  }, [
361
- O,
362
351
  D,
363
- T,
364
- w
365
- ]), Ge = m(() => R.filters.some((e) => e.placement != null), [R.filters]), Y = m(() => {
366
- if (R.filters.length === 0) return [];
367
- let e = R.ui?.toolbar?.maxPromotedFilters ?? 3;
368
- return Ge ? R.filters.filter((e) => e.placement === "quick" || e.placement === "both") : R.filters.slice(0, e);
352
+ E,
353
+ w,
354
+ C
355
+ ]), Fe = p(() => H.filters.some((e) => e.placement != null), [H.filters]), Y = p(() => {
356
+ if (H.filters.length === 0) return [];
357
+ let e = H.ui?.toolbar?.maxPromotedFilters ?? 3;
358
+ return Fe ? H.filters.filter((e) => e.placement === "quick" || e.placement === "both") : H.filters.slice(0, e);
369
359
  }, [
370
- R.filters,
371
- R.ui?.toolbar,
372
- Ge
373
- ]), X = m(() => R.filters.filter((e) => e.placement == null || e.placement === "drawer" || e.placement === "both"), [R.filters]), Z = m(() => Y.find((e) => e.kind === "text"), [Y]), Ke = m(() => {
360
+ H.filters,
361
+ H.ui?.toolbar,
362
+ Fe
363
+ ]), X = p(() => H.filters.filter((e) => e.placement == null || e.placement === "drawer" || e.placement === "both"), [H.filters]), Z = p(() => Y.find((e) => e.kind === "text"), [Y]), Ie = p(() => {
374
364
  let e = Y.filter((e) => e !== Z);
375
- return e.length === 0 ? null : /* @__PURE__ */ _("div", {
365
+ return e.length === 0 ? null : /* @__PURE__ */ h("div", {
376
366
  className: u,
377
- children: e.map((e) => /* @__PURE__ */ _("span", { children: J(e) }, e.id))
367
+ children: e.map((e) => /* @__PURE__ */ h("span", { children: J(e) }, e.id))
378
368
  });
379
369
  }, [
380
370
  Y,
381
371
  J,
382
372
  Z
383
- ]), qe = m(() => Z == null ? null : J(Z), [J, Z]), Je = m(() => {
384
- if (R.sorts.length === 0) return null;
385
- let e = R.sorts[0];
373
+ ]), Le = p(() => Z == null ? null : J(Z), [J, Z]), Re = p(() => {
374
+ if (H.sorts.length === 0) return null;
375
+ let e = H.sorts[0];
386
376
  if (e == null) return null;
387
- let t = R.sorts.map((e) => ({
377
+ let t = H.sorts.map((e) => ({
388
378
  id: e.id,
389
379
  value: e.id,
390
- label: C(e.label, w)
380
+ label: S(e.label, C)
391
381
  }));
392
- return /* @__PURE__ */ _(b, {
382
+ return /* @__PURE__ */ h(v, {
393
383
  options: t,
394
- value: D.sort ?? e.id,
384
+ value: E.sort ?? e.id,
395
385
  size: "small",
396
- ariaLabel: T("list.sort.label"),
386
+ ariaLabel: w("list.sort.label"),
397
387
  onChange: (e) => {
398
- O({
399
- ...D,
388
+ D({
389
+ ...E,
400
390
  sort: e
401
391
  });
402
392
  }
403
393
  });
404
394
  }, [
405
- R.sorts,
406
- O,
395
+ H.sorts,
407
396
  D,
408
- T,
409
- w
410
- ]), Ye = m(() => B.length === 0 ? null : /* @__PURE__ */ _(_e, {
411
- chips: B,
412
- onClearAll: V
413
- }), [B, V]), Xe = m(() => {
397
+ E,
398
+ w,
399
+ C
400
+ ]), ze = p(() => {
414
401
  if (X.length === 0) return [];
415
- let e = W.trim().toLowerCase(), t = [];
416
- for (let n of X) {
417
- let r = C(n.label, w);
418
- (e === "" || r.toLowerCase().includes(e)) && t.push({
419
- id: n.id,
420
- node: /* @__PURE__ */ _(fe, {
421
- label: r,
422
- children: J(n)
402
+ let e = [];
403
+ for (let t of X) {
404
+ let n = S(t.label, C);
405
+ e.push({
406
+ id: t.id,
407
+ searchText: n,
408
+ node: /* @__PURE__ */ h(fe, {
409
+ label: n,
410
+ children: J(t)
423
411
  })
424
412
  });
425
413
  }
426
- return t.length === 0 ? [] : [{
414
+ return e.length === 0 ? [] : [{
427
415
  id: "backoffice.filters.sections.default",
428
- title: T("filters.sections.default"),
429
- items: t
416
+ title: w("filters.sections.default"),
417
+ items: e
430
418
  }];
431
419
  }, [
432
420
  X,
433
- W,
434
421
  J,
435
- T,
436
- w
437
- ]), Ze = m(() => {
438
- if (X.length === 0) return null;
439
- let e = B.length, t = T("filters.trigger");
440
- return e > 0 && (t = T("filters.triggerWithCount", { count: e })), /* @__PURE__ */ _(y, {
441
- type: "button",
442
- variant: "secondary",
443
- size: "small",
444
- onClick: () => {
445
- G(!0);
446
- },
447
- children: t
448
- });
449
- }, [
450
- B.length,
451
- X.length,
452
- G,
453
- T
454
- ]), Qe = W.trim() === "" ? void 0 : T("filters.drawer.emptySearchResults"), $e = /* @__PURE__ */ _(de, {
455
- isOpen: He,
456
- onClose: () => {
457
- We();
458
- },
459
- sections: Xe,
460
- searchValue: W,
461
- onSearchChange: (e) => {
462
- Ue(e);
463
- },
464
- onReset: V,
465
- emptyLabel: Qe
466
- }), et = m(() => Me ?? (L ? /* @__PURE__ */ _(ge, {
422
+ w,
423
+ C
424
+ ]), Be = p(() => Oe ?? (V ? /* @__PURE__ */ h(he, {
467
425
  variant: "embedded",
468
- ariaLabel: T("common.loading")
469
- }) : B.length > 0 ? /* @__PURE__ */ _(le, {
470
- title: T("emptyState.listEmpty.title"),
471
- description: T("emptyState.listEmptyFiltered.description"),
472
- actions: /* @__PURE__ */ _(y, {
426
+ ariaLabel: w("common.loading")
427
+ }) : W.length > 0 ? /* @__PURE__ */ h(y, {
428
+ title: w("emptyState.listEmpty.title"),
429
+ description: w("emptyState.listEmptyFiltered.description"),
430
+ actions: /* @__PURE__ */ h(_, {
473
431
  type: "button",
474
432
  variant: "secondary",
475
433
  size: "small",
476
- onClick: V,
477
- children: T("emptyState.listEmptyFiltered.actions.reset")
434
+ onClick: G,
435
+ children: w("emptyState.listEmptyFiltered.actions.reset")
478
436
  })
479
- }) : /* @__PURE__ */ _(le, {
480
- title: T("emptyState.listEmpty.title"),
481
- description: T("emptyState.listEmpty.description")
437
+ }) : /* @__PURE__ */ h(y, {
438
+ title: w("emptyState.listEmpty.title"),
439
+ description: w("emptyState.listEmpty.description")
482
440
  })), [
483
- B.length,
484
- Me,
441
+ W.length,
442
+ Oe,
443
+ G,
485
444
  V,
486
- L,
487
- T
488
- ]), tt = m(() => je ?? (typeof I == "number" ? /* @__PURE__ */ _("span", { children: T("list.showing", {
489
- shown: k.length,
490
- total: I
491
- }) }) : k.length === 0 ? null : /* @__PURE__ */ _("span", { children: T("list.loaded", { count: k.length }) })), [
492
- je,
493
- k.length,
494
- T,
495
- I
496
- ]), Q = m(() => {
497
- let e = R.ui?.displayMode ?? R.responsive?.mode ?? "auto";
498
- return Se({
499
- kind: R.kind,
445
+ w
446
+ ]), Ve = p(() => B ?? (typeof z == "number" ? /* @__PURE__ */ h("span", { children: w("list.showing", {
447
+ shown: O.length,
448
+ total: z
449
+ }) }) : O.length === 0 ? null : /* @__PURE__ */ h("span", { children: w("list.loaded", { count: O.length }) })), [
450
+ B,
451
+ O.length,
452
+ w,
453
+ z
454
+ ]), Q = p(() => {
455
+ let e = H.ui?.displayMode ?? H.responsive?.mode ?? "auto";
456
+ return xe({
457
+ kind: H.kind,
500
458
  displayMode: e,
501
- ui: R.ui
459
+ ui: H.ui
502
460
  });
503
461
  }, [
504
- R.kind,
505
- R.responsive?.mode,
506
- R.ui
507
- ]), $ = typeof I == "number" && k.length < I && !j;
508
- ae(() => {
509
- !$ || !Q.infiniteScroll.showInconsistentPageInfo || !Ce() || console.warn("Backoffice list received inconsistent pageInfo: loaded rows are lower than totalCount but hasNextPage is false.", {
510
- entityId: E.id,
511
- loadedCount: k.length,
512
- totalCount: I
462
+ H.kind,
463
+ H.responsive?.mode,
464
+ H.ui
465
+ ]), He = typeof z == "number" && O.length < z && !M;
466
+ oe(() => {
467
+ !He || !Q.infiniteScroll.showInconsistentPageInfo || !Se() || console.warn("Backoffice list received inconsistent pageInfo: loaded rows are lower than totalCount but hasNextPage is false.", {
468
+ entityId: T.id,
469
+ loadedCount: O.length,
470
+ totalCount: z
513
471
  });
514
472
  }, [
515
- E.id,
516
- $,
517
- k.length,
473
+ T.id,
474
+ He,
475
+ O.length,
518
476
  Q.infiniteScroll.showInconsistentPageInfo,
519
- I
477
+ z
520
478
  ]);
521
- let nt = x.virtualize === !0 || Q.virtualization.enabled, { sentinelRef: rt } = l({
522
- enabled: !nt && Q.infiniteScroll.enabled,
523
- hasNextPage: j,
524
- isLoading: M,
525
- onIntersect: P,
479
+ let Ue = b.virtualize === !0 || Q.virtualization.enabled, { sentinelRef: We } = l({
480
+ enabled: !Ue && Q.infiniteScroll.enabled && P == null,
481
+ hasNextPage: M,
482
+ isLoading: N,
483
+ onIntersect: I,
526
484
  rootMargin: Q.infiniteScroll.rootMargin,
527
485
  threshold: Q.infiniteScroll.threshold
528
- }), it = Pe?.title ?? C(R.title, w), at = Pe?.subtitle, ot = z.find((e) => e.mobileRole === "action" || e.id === "actions"), st = R.ui?.displayMode ?? R.responsive?.mode ?? "auto", ct = R.ui?.density ?? R.responsive?.density ?? "compact", lt = nt ? /* @__PURE__ */ _(be, {
529
- columns: z,
530
- rows: k,
531
- getRowId: ke,
532
- emptyState: et,
533
- className: xe,
534
- gridTemplateColumns: Ae,
486
+ }), Ge = Ae?.title ?? S(H.title, C), Ke = Ae?.subtitle, qe = U.find((e) => e.mobileRole === "action" || e.id === "actions"), Je = H.ui?.displayMode ?? H.responsive?.mode ?? "auto", Ye = H.ui?.density ?? H.responsive?.density ?? "compact", Xe = Ue ? /* @__PURE__ */ h(ye, {
487
+ columns: U,
488
+ rows: O,
489
+ getRowId: k,
490
+ emptyState: Be,
491
+ className: be,
492
+ gridTemplateColumns: j,
535
493
  virtualization: Q.virtualization,
536
494
  infiniteScroll: {
537
495
  enabled: Q.infiniteScroll.enabled,
538
496
  thresholdPx: Q.infiniteScroll.thresholdPx,
539
497
  autoLoad: Q.infiniteScroll.autoLoad
540
498
  },
541
- hasNextPage: j,
542
- isLoadingMore: M,
543
- onLoadMore: P,
499
+ hasNextPage: M,
500
+ isLoadingMore: N,
501
+ onLoadMore: P == null ? I : () => {},
544
502
  bodyScrollMode: c
545
- }) : /* @__PURE__ */ _(ye, {
546
- columns: z,
547
- rows: k,
548
- getRowId: ke,
549
- emptyState: et,
550
- className: xe,
551
- gridTemplateColumns: Ae,
552
- mode: st,
553
- density: ct,
503
+ }) : /* @__PURE__ */ h(ve, {
504
+ columns: U,
505
+ rows: O,
506
+ getRowId: k,
507
+ emptyState: Be,
508
+ className: be,
509
+ gridTemplateColumns: j,
510
+ mode: Je,
511
+ density: Ye,
554
512
  bodyScrollMode: c,
555
- bodyFooterNode: Q.infiniteScroll.enabled ? /* @__PURE__ */ _("div", {
556
- ref: rt,
513
+ bodyFooterNode: Q.infiniteScroll.enabled ? /* @__PURE__ */ h("div", {
514
+ ref: We,
557
515
  "aria-hidden": "true"
558
516
  }) : null,
559
- renderAction: (e) => ot?.cell(e) ?? null
560
- }), ut = /* @__PURE__ */ _(n, {
517
+ renderAction: (e) => qe?.cell(e) ?? null
518
+ }), Ze = /* @__PURE__ */ h(n, {
561
519
  fallback: (e) => {
562
520
  let { reset: t } = e;
563
- return /* @__PURE__ */ _(oe, {
521
+ return /* @__PURE__ */ h(ce, {
564
522
  tone: "danger",
565
- title: T("list.errors.title"),
566
- actions: /* @__PURE__ */ _(y, {
523
+ title: w("list.errors.title"),
524
+ actions: /* @__PURE__ */ h(_, {
567
525
  type: "button",
568
526
  variant: "secondary",
569
527
  size: "small",
570
528
  onClick: () => {
571
- t(), F?.();
529
+ t(), R?.();
572
530
  },
573
- children: T("list.actions.retry")
531
+ children: w("list.actions.retry")
574
532
  }),
575
- children: T("list.errors.tableFailed")
533
+ children: w("list.errors.tableFailed")
576
534
  });
577
535
  },
578
- children: lt
579
- }), dt = Le ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(he, {
580
- search: qe,
581
- primaryFilters: Ke,
582
- filterDrawerTrigger: Ze,
583
- sort: Je,
584
- utilityActions: F == null ? null : /* @__PURE__ */ _(y, {
536
+ children: Xe
537
+ }), Qe = Ne ? /* @__PURE__ */ h(ge, {
538
+ stateKey: `backoffice:entity:${T.id}`,
539
+ sections: ze,
540
+ activeFilters: W,
541
+ onResetFilters: G,
542
+ search: Le,
543
+ primaryFilters: Ie,
544
+ sort: Re,
545
+ utilityActions: R == null ? null : /* @__PURE__ */ h(_, {
585
546
  type: "button",
586
547
  variant: "secondary",
587
548
  size: "small",
588
- isLoading: N,
589
- loadingLabel: T("list.actions.refreshing"),
549
+ isLoading: F,
550
+ loadingLabel: w("list.actions.refreshing"),
590
551
  onClick: () => {
591
- F();
552
+ R();
592
553
  },
593
- children: T("list.actions.refresh")
554
+ children: w("list.actions.refresh")
594
555
  }),
595
- chips: Ye,
596
556
  density: "compact"
597
- }), $e] }) : null, ft = /* @__PURE__ */ v("div", {
557
+ }) : null, $e = /* @__PURE__ */ g("div", {
598
558
  className: ie,
599
- "aria-busy": N ? "true" : void 0,
559
+ "aria-busy": F ? "true" : void 0,
600
560
  children: [
601
- N && !L ? /* @__PURE__ */ v("div", {
561
+ F && !V ? /* @__PURE__ */ g("div", {
602
562
  className: re,
603
563
  role: "status",
604
- children: [/* @__PURE__ */ _(ce, {
564
+ children: [/* @__PURE__ */ h(ue, {
605
565
  size: 14,
606
- ariaLabel: T("list.refreshingRows")
607
- }), /* @__PURE__ */ _("span", { children: T("list.refreshingRows") })]
566
+ ariaLabel: w("list.refreshingRows")
567
+ }), /* @__PURE__ */ h("span", { children: w("list.refreshingRows") })]
608
568
  }) : null,
609
- ut,
610
- /* @__PURE__ */ _(r, {
569
+ Ze,
570
+ /* @__PURE__ */ h(r, {
611
571
  isOpen: K != null,
612
- entity: K?.entity ?? E.id,
613
- title: K?.label ?? T("picker.title"),
572
+ entity: K?.entity ?? T.id,
573
+ title: K?.label ?? w("picker.title"),
614
574
  scope: K?.scope,
615
575
  onClose: () => {
616
576
  q(null);
@@ -618,71 +578,73 @@ var C = (e, t) => e(t), we = (e, t) => {
618
578
  onSelectId: (e) => {
619
579
  if (K == null) return;
620
580
  if (K.mode === "list") {
621
- let t = K.currentIds ?? [], n = t.includes(e) ? t : [...t, e], r = S(D.where, K.whereKey, n, K.path);
622
- G(!0), O({
623
- ...D,
581
+ let t = K.currentIds ?? [], n = t.includes(e) ? t : [...t, e], r = x(E.where, K.whereKey, n, K.path);
582
+ D({
583
+ ...E,
624
584
  where: r
625
585
  });
626
586
  return;
627
587
  }
628
- let t = S(D.where, K.whereKey, e, K.path);
629
- G(!0), O({
630
- ...D,
588
+ let t = x(E.where, K.whereKey, e, K.path);
589
+ D({
590
+ ...E,
631
591
  where: t
632
592
  });
633
593
  }
634
594
  })
635
595
  ]
636
- }), pt = k.length > 0 || M || j ? /* @__PURE__ */ _(g, { children: /* @__PURE__ */ _(pe, {
637
- mode: "status",
638
- loadedCount: k.length,
639
- totalCount: I,
640
- hasNextPage: j,
641
- isLoading: M,
642
- pageInfoState: $ ? "inconsistent" : M ? "loading" : j ? "ready" : "complete",
596
+ }), $ = O.length > 0 || N || M ? /* @__PURE__ */ h(m, { children: /* @__PURE__ */ h(pe, {
597
+ state: P != null && L != null ? {
598
+ kind: "error",
599
+ message: P.message,
600
+ onRetry: L
601
+ } : N ? { kind: "loading" } : M ? { kind: "idle" } : { kind: "end" },
602
+ loadedCount: O.length,
603
+ totalCount: z,
643
604
  labels: {
644
- loaded: tt,
645
- loading: T("list.loadMore.loading"),
646
- end: T("list.loadMore.end")
605
+ loaded: Ve,
606
+ loading: w("list.loadMore.loading"),
607
+ end: w("list.loadMore.end"),
608
+ retry: w("list.actions.retry")
647
609
  }
648
610
  }) }) : null;
649
- return Ie === "embedded" ? /* @__PURE__ */ _(i, {
650
- config: E,
651
- state: D,
652
- pushState: O,
653
- children: /* @__PURE__ */ v("div", {
611
+ return Me === "embedded" ? /* @__PURE__ */ h(i, {
612
+ config: T,
613
+ state: E,
614
+ pushState: D,
615
+ children: /* @__PURE__ */ g("div", {
654
616
  className: d,
655
617
  children: [
656
- /* @__PURE__ */ _("div", {
618
+ /* @__PURE__ */ h("div", {
657
619
  className: ee,
658
- children: it
620
+ children: Ge
659
621
  }),
660
- dt,
661
- Ne,
662
- ft,
663
- pt
622
+ Qe,
623
+ ke,
624
+ $e,
625
+ $
664
626
  ]
665
627
  })
666
- }) : /* @__PURE__ */ _(i, {
667
- config: E,
668
- state: D,
669
- pushState: O,
670
- children: /* @__PURE__ */ _(ve, {
671
- headerNode: /* @__PURE__ */ _(me, {
672
- title: it,
673
- subtitle: at,
674
- actions: Fe
628
+ }) : /* @__PURE__ */ h(i, {
629
+ config: T,
630
+ state: E,
631
+ pushState: D,
632
+ children: /* @__PURE__ */ h(_e, {
633
+ headerNode: /* @__PURE__ */ h(me, {
634
+ title: Ge,
635
+ subtitle: Ke,
636
+ actions: je
675
637
  }),
676
- toolbarNode: dt,
677
- statusNode: Ne,
678
- tableNode: ft,
679
- tableFooterNode: pt,
638
+ toolbarNode: Qe,
639
+ statusNode: ke,
640
+ tableNode: $e,
641
+ tableFooterNode: $,
680
642
  presentation: "flat",
681
643
  bodyScrollMode: c
682
644
  })
683
645
  });
684
646
  };
685
647
  //#endregion
686
- export { w as BackofficeEntityListScaffold, w as default };
648
+ export { C as BackofficeEntityListScaffold, C as default };
687
649
 
688
650
  //# sourceMappingURL=BackofficeEntityListScaffold.js.map