@plumile/backoffice-react 0.1.188 → 0.1.190

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