@plumile/backoffice-react 0.1.167 → 0.1.169

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 (73) hide show
  1. package/lib/esm/auth/login/loginPage.css.js +1 -0
  2. package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +50 -49
  3. package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
  4. package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -0
  5. package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +0 -1
  6. package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +7 -7
  7. package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
  8. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +49 -48
  9. package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
  10. package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +0 -1
  11. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js +27 -0
  12. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js.map +1 -0
  13. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js +12 -8
  14. package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.js.map +1 -1
  15. package/lib/esm/hooks/useBackofficeListUrlState.js.map +1 -1
  16. package/lib/esm/i18n/locales/en/backofficeReact.js +13 -3
  17. package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
  18. package/lib/esm/i18n/locales/fr/backofficeReact.js +13 -3
  19. package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
  20. package/lib/esm/pages/BackofficeDashboardPage.helpers.js +9 -1
  21. package/lib/esm/pages/BackofficeDashboardPage.helpers.js.map +1 -1
  22. package/lib/esm/pages/BackofficeDashboardPage.js +85 -48
  23. package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
  24. package/lib/esm/pages/BackofficeDashboardWidgetContent.js +364 -101
  25. package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -1
  26. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +112 -90
  27. package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
  28. package/lib/esm/pages/BackofficeEntityDetailPage.js +158 -155
  29. package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
  30. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +1 -1
  31. package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
  32. package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js.map +1 -1
  33. package/lib/esm/pages/BackofficeEntityListPage.js +91 -90
  34. package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
  35. package/lib/esm/provider/entityRegistry.js.map +1 -1
  36. package/lib/esm/relay/createInlineDataReader.js +2 -2
  37. package/lib/esm/relay/createInlineReader.js +3 -3
  38. package/lib/esm/relay/createInlineReader.js.map +1 -1
  39. package/lib/esm/relay/environment.js +22 -13
  40. package/lib/esm/relay/environment.js.map +1 -1
  41. package/lib/esm/relay/typedRelayHooks.js +7 -0
  42. package/lib/esm/relay/typedRelayHooks.js.map +1 -0
  43. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  44. package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
  45. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts +1 -1
  46. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
  47. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.d.ts +9 -0
  48. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.d.ts.map +1 -0
  49. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.d.ts +6 -1
  50. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.d.ts.map +1 -1
  51. package/lib/types/hooks/useBackofficeListUrlState.d.ts.map +1 -1
  52. package/lib/types/i18n/resources.d.ts +16 -0
  53. package/lib/types/i18n/resources.d.ts.map +1 -1
  54. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  55. package/lib/types/pages/BackofficeDashboardPage.helpers.d.ts.map +1 -1
  56. package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts +6 -2
  57. package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -1
  58. package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
  59. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  60. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +9 -5
  61. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
  62. package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
  63. package/lib/types/provider/entityRegistry.d.ts.map +1 -1
  64. package/lib/types/relay/createInlineDataReader.d.ts +1 -1
  65. package/lib/types/relay/createInlineDataReader.d.ts.map +1 -1
  66. package/lib/types/relay/createInlineReader.d.ts +0 -1
  67. package/lib/types/relay/createInlineReader.d.ts.map +1 -1
  68. package/lib/types/relay/environment.d.ts +1 -0
  69. package/lib/types/relay/environment.d.ts.map +1 -1
  70. package/lib/types/relay/typedRelayHooks.d.ts +11 -0
  71. package/lib/types/relay/typedRelayHooks.d.ts.map +1 -0
  72. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  73. package/package.json +6 -6
@@ -4,68 +4,247 @@ import { BackofficeBillingUsageChart as n } from "../components/backoffice/billi
4
4
  import { buildDataTableColumns as r } from "../components/backoffice/columns/buildDataTableColumns.js";
5
5
  import { resolveLabel as i } from "./BackofficeDashboardPage.helpers.js";
6
6
  import { tileBody as a, tileCount as o } from "./backofficeDashboardPage.css.js";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { useTranslation as l } from "react-i18next";
9
- import * as u from "react-relay";
10
- import { BackofficeEmptyState as d } from "@plumile/ui/backoffice/molecules/backoffice_empty_state/BackofficeEmptyState.js";
11
- import { DashboardPanel as f } from "@plumile/ui/components/dashboard/dashboard_panel/DashboardPanel.js";
12
- import { DashboardQuickActions as p } from "@plumile/ui/components/dashboard/dashboard_quick_actions/DashboardQuickActions.js";
13
- import { DashboardMetricGroup as m } from "@plumile/ui/components/dashboard/dashboard_metric_group/DashboardMetricGroup.js";
14
- import { DashboardStatusList as h } from "@plumile/ui/components/dashboard/dashboard_status_list/DashboardStatusList.js";
15
- import { DataTable as g } from "@plumile/ui/components/data-table/DataTable.js";
7
+ import { useEffect as s, useMemo as c, useState as l } from "react";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { useTranslation as f } from "react-i18next";
10
+ import * as p from "react-relay";
11
+ import { BackofficeEmptyState as m } from "@plumile/ui/backoffice/molecules/backoffice_empty_state/BackofficeEmptyState.js";
12
+ import { buildBackofficeFallbackListHref as h, buildBackofficeListHref as g } from "@plumile/backoffice-core/state/buildListHref.js";
13
+ import { DashboardPanel as _ } from "@plumile/ui/components/dashboard/dashboard_panel/DashboardPanel.js";
14
+ import { DashboardQuickActions as v } from "@plumile/ui/components/dashboard/dashboard_quick_actions/DashboardQuickActions.js";
15
+ import { DashboardMetricGroup as y } from "@plumile/ui/components/dashboard/dashboard_metric_group/DashboardMetricGroup.js";
16
+ import { DashboardStatusList as b } from "@plumile/ui/components/dashboard/dashboard_status_list/DashboardStatusList.js";
17
+ import { DashboardBreakdownList as x } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardBreakdownList.js";
18
+ import { DashboardEntitySpotlight as S } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardEntitySpotlight.js";
19
+ import { DashboardHealthMatrix as C } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardHealthMatrix.js";
20
+ import { DashboardRiskQueue as w } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardRiskQueue.js";
21
+ import { DashboardSlaGauge as T } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardSlaGauge.js";
22
+ import { DashboardTimelineChart as E } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardTimelineChart.js";
23
+ import { DashboardTrendMetric as D } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardTrendMetric.js";
24
+ import { DashboardWindowControl as O } from "@plumile/ui/components/dashboard/dashboard_operational/DashboardWindowControl.js";
25
+ import { DataTable as k } from "@plumile/ui/components/data-table/DataTable.js";
16
26
  //#region src/pages/BackofficeDashboardWidgetContent.tsx
17
- var { useLazyLoadQuery: _ } = u, v = () => {
27
+ var { useLazyLoadQuery: A } = p, j = { window: {
28
+ id: "24h",
29
+ label: (e) => e("common.time.lastDay", "24 h"),
30
+ from: (/* @__PURE__ */ new Date(0)).toISOString(),
31
+ to: (/* @__PURE__ */ new Date(0)).toISOString()
32
+ } }, M = (e, t) => typeof e.variables == "function" ? e.variables(t) : e.variables, N = () => {
18
33
  let { t } = e();
19
- return /* @__PURE__ */ s(d, { title: t("common.notAvailable") });
20
- }, y = ({ widget: u, data: d }) => {
21
- let { t: _ } = l(), { t: y } = e(), { entities: b } = t(), x = u.description == null ? void 0 : i(u.description, _), S = () => u.dataSource === "query" && d != null ? u.resolve(d) : null;
22
- if (u.kind === "textBlock") return /* @__PURE__ */ s(f, {
23
- title: i(u.title, _),
34
+ return /* @__PURE__ */ u(m, { title: t("common.notAvailable") });
35
+ }, P = (e) => e == null ? "" : e.kind === "href" ? `href:${e.href}` : `entity-list:${e.entityId}:${JSON.stringify(e.state ?? null)}`, F = (e) => {
36
+ let { entities: n, entityRegistry: r } = t(), [, i] = l(0);
37
+ return s(() => {
38
+ let t = /* @__PURE__ */ new Set();
39
+ for (let i of e) i?.kind === "entity-list" && n[i.entityId] != null && r.getLoadedListEntity(i.entityId) == null && t.add(i.entityId);
40
+ if (t.size === 0) return;
41
+ let a = !1;
42
+ return Promise.all(Array.from(t).map(async (e) => {
43
+ try {
44
+ await r.loadListEntity(e);
45
+ } catch {
46
+ return null;
47
+ }
48
+ return e;
49
+ })).then(() => {
50
+ a || i((e) => e + 1);
51
+ }, () => {}), () => {
52
+ a = !0;
53
+ };
54
+ }, [
55
+ n,
56
+ r,
57
+ e.map(P).join("|"),
58
+ e
59
+ ]), c(() => (e, t) => {
60
+ if (e == null) return t;
61
+ if (e.kind === "href") return e.href;
62
+ let i = n[e.entityId];
63
+ if (i == null) return t;
64
+ let a = r.getLoadedListEntity(e.entityId);
65
+ return a == null ? h(i.routes.list, e.state?.where ?? null, e.state?.filters) : g(a.config, {
66
+ where: e.state?.where,
67
+ sort: e.state?.sort
68
+ });
69
+ }, [n, r]);
70
+ }, I = ({ metrics: t }) => {
71
+ let { t: n } = f(), { t: r } = e(), a = F(t.map((e) => e.target));
72
+ return /* @__PURE__ */ u(y, {
73
+ emptyState: /* @__PURE__ */ u(N, {}),
74
+ metrics: t.map((e) => ({
75
+ id: e.id,
76
+ href: a(e.target, e.href),
77
+ label: i(e.label, n),
78
+ value: e.value ?? r("common.notAvailable"),
79
+ hint: e.meta == null ? void 0 : i(e.meta, n)
80
+ }))
81
+ });
82
+ }, L = ({ items: t }) => {
83
+ let { t: n } = f(), { t: r } = e(), a = F(t.map((e) => e.target));
84
+ return /* @__PURE__ */ u(b, {
85
+ emptyState: /* @__PURE__ */ u(N, {}),
86
+ items: t.map((e) => ({
87
+ id: e.id,
88
+ href: a(e.target, e.href),
89
+ label: i(e.label, n),
90
+ value: e.value ?? r("common.notAvailable")
91
+ }))
92
+ });
93
+ }, R = ({ actions: e, layout: t }) => {
94
+ let { t: n } = f(), r = F(e.map((e) => e.target));
95
+ return /* @__PURE__ */ u(v, {
96
+ layout: t,
97
+ emptyState: /* @__PURE__ */ u(N, {}),
98
+ actions: e.map((e) => {
99
+ let t;
100
+ return t = typeof e.label == "string" ? e.label : i(e.label, n), {
101
+ id: e.id,
102
+ href: r(e.target, e.href) ?? "#",
103
+ label: t
104
+ };
105
+ })
106
+ });
107
+ }, z = (e) => e.map((e) => e.target), B = ({ metric: t }) => {
108
+ let { t: n } = f(), { t: r } = e(), a = F([t.target]);
109
+ return /* @__PURE__ */ u(D, {
110
+ label: i(t.label, n),
111
+ value: t.value ?? r("common.notAvailable"),
112
+ unit: t.unit,
113
+ href: a(t.target, t.href),
114
+ tone: t.tone,
115
+ delta: t.delta == null ? void 0 : {
116
+ ...t.delta,
117
+ label: t.delta.label == null ? void 0 : i(t.delta.label, n)
118
+ },
119
+ sparkline: t.sparkline,
120
+ sparklineLabel: i(t.label, n)
121
+ });
122
+ }, V = ({ gauge: t }) => {
123
+ let { t: n } = f(), { t: r } = e(), a = F([t.target]);
124
+ return t.value == null ? /* @__PURE__ */ u(m, { title: r("common.notAvailable") }) : /* @__PURE__ */ u(T, {
125
+ label: i(t.label, n),
126
+ value: t.value,
127
+ max: t.max,
128
+ threshold: t.threshold,
129
+ unit: t.unit,
130
+ tone: t.tone,
131
+ href: a(t.target, t.href)
132
+ });
133
+ }, H = ({ items: t }) => {
134
+ let { t: n } = f(), { t: r } = e(), a = F(z(t));
135
+ return /* @__PURE__ */ u(x, {
136
+ emptyState: /* @__PURE__ */ u(N, {}),
137
+ items: t.map((e) => ({
138
+ id: e.id,
139
+ href: a(e.target, e.href),
140
+ label: i(e.label, n),
141
+ meta: e.meta == null ? void 0 : i(e.meta, n),
142
+ tone: e.tone,
143
+ value: e.value ?? r("common.notAvailable")
144
+ }))
145
+ });
146
+ }, U = ({ ariaLabel: e, chart: t, result: n }) => {
147
+ let { t: r } = f();
148
+ return /* @__PURE__ */ u(E, {
149
+ ariaLabel: i(e, r),
150
+ chart: t,
151
+ emptyMessage: n.emptyLabel == null ? "" : i(n.emptyLabel, r),
152
+ series: n.series.map((e) => ({
153
+ ...e,
154
+ label: i(e.label, r)
155
+ }))
156
+ });
157
+ }, W = ({ items: t }) => {
158
+ let { t: n } = f(), { t: r } = e(), a = F(z(t));
159
+ return /* @__PURE__ */ u(w, {
160
+ emptyState: /* @__PURE__ */ u(N, {}),
161
+ items: t.map((e) => ({
162
+ id: e.id,
163
+ href: a(e.target, e.href),
164
+ label: i(e.label, n),
165
+ meta: e.meta == null ? void 0 : i(e.meta, n),
166
+ severity: e.severity,
167
+ value: e.value ?? r("common.notAvailable")
168
+ }))
169
+ });
170
+ }, G = ({ item: e }) => {
171
+ let { t } = f(), n = F([e?.target]);
172
+ return e == null ? /* @__PURE__ */ u(N, {}) : /* @__PURE__ */ u(S, {
173
+ href: n(e.target, e.href),
174
+ label: i(e.label, t),
175
+ title: i(e.title, t),
176
+ tone: e.tone,
177
+ meta: e.meta?.map((e) => ({
178
+ id: e.id,
179
+ label: i(e.label, t),
180
+ value: e.value
181
+ }))
182
+ });
183
+ }, K = ({ rows: t }) => {
184
+ let { t: n } = f(), { t: r } = e(), a = F(t.flatMap((e) => e.cells.map((e) => e.target)));
185
+ return /* @__PURE__ */ u(C, {
186
+ emptyState: /* @__PURE__ */ u(N, {}),
187
+ rows: t.map((e) => ({
188
+ id: e.id,
189
+ label: i(e.label, n),
190
+ cells: e.cells.map((e) => ({
191
+ id: e.id,
192
+ href: a(e.target, e.href),
193
+ label: i(e.label, n),
194
+ tone: e.tone,
195
+ value: e.value ?? r("common.notAvailable")
196
+ }))
197
+ }))
198
+ });
199
+ }, q = ({ activeWindowPresetId: s, context: c = j, widget: l, data: p, onWindowPresetChange: m, windowPresets: h = [] }) => {
200
+ let { t: g } = f(), { t: y } = e(), { entities: b } = t(), x = l.description == null ? void 0 : i(l.description, g), S = () => l.dataSource === "query" && p != null ? l.resolve(p, c) : null;
201
+ if (l.kind === "textBlock") return /* @__PURE__ */ u(_, {
202
+ title: i(l.title, g),
24
203
  subtitle: x,
25
- children: /* @__PURE__ */ s("div", {
204
+ children: /* @__PURE__ */ u("div", {
26
205
  className: a,
27
- children: i(u.body, _)
206
+ children: i(l.body, g)
28
207
  })
29
208
  });
30
- if (u.kind === "shortcut") {
31
- let e = b[u.entityId], t = i(u.label, _);
32
- return e == null ? /* @__PURE__ */ s(f, {
209
+ if (l.kind === "shortcut") {
210
+ let e = b[l.entityId], t = i(l.label, g);
211
+ return e == null ? /* @__PURE__ */ u(_, {
33
212
  title: t,
34
213
  subtitle: x,
35
- children: /* @__PURE__ */ s(v, {})
36
- }) : e.kind === "tool" ? /* @__PURE__ */ s(f, {
214
+ children: /* @__PURE__ */ u(N, {})
215
+ }) : e.kind === "tool" ? /* @__PURE__ */ u(_, {
37
216
  title: t,
38
217
  subtitle: x,
39
- children: /* @__PURE__ */ s(p, { actions: [{
218
+ children: /* @__PURE__ */ u(v, { actions: [{
40
219
  id: e.id,
41
220
  href: e.routes.list,
42
221
  label: y("dashboard.actions.openTool")
43
222
  }] })
44
- }) : /* @__PURE__ */ s(f, {
223
+ }) : /* @__PURE__ */ u(_, {
45
224
  title: t,
46
225
  subtitle: x,
47
- children: /* @__PURE__ */ s(p, { actions: [{
226
+ children: /* @__PURE__ */ u(v, { actions: [{
48
227
  id: e.id,
49
228
  href: e.routes.list,
50
229
  label: y("dashboard.actions.openList")
51
230
  }] })
52
231
  });
53
232
  }
54
- if (u.kind === "tablePreview") {
233
+ if (l.kind === "tablePreview") {
55
234
  let e = S();
56
- if (e == null) return /* @__PURE__ */ s(f, {
57
- title: i(u.title, _),
235
+ if (e == null) return /* @__PURE__ */ u(_, {
236
+ title: i(l.title, g),
58
237
  subtitle: x,
59
- children: /* @__PURE__ */ s(v, {})
238
+ children: /* @__PURE__ */ u(N, {})
60
239
  });
61
240
  let t = r(e.columns, {
62
- tApp: _,
241
+ tApp: g,
63
242
  t: y
64
243
  });
65
- return /* @__PURE__ */ s(f, {
66
- title: i(u.title, _),
244
+ return /* @__PURE__ */ u(_, {
245
+ title: i(l.title, g),
67
246
  subtitle: x,
68
- children: /* @__PURE__ */ s(g, {
247
+ children: /* @__PURE__ */ u(k, {
69
248
  columns: t,
70
249
  rows: e.rows,
71
250
  getRowId: (e, t) => {
@@ -78,113 +257,197 @@ var { useLazyLoadQuery: _ } = u, v = () => {
78
257
  })
79
258
  });
80
259
  }
81
- if (u.kind === "metricGroup") {
260
+ if (l.kind === "metricGroup") {
82
261
  let e = S();
83
- return e == null ? /* @__PURE__ */ s(v, {}) : /* @__PURE__ */ s(m, {
84
- emptyState: /* @__PURE__ */ s(v, {}),
85
- metrics: e.map((e) => ({
86
- id: e.id,
87
- href: e.href,
88
- label: i(e.label, _),
89
- value: e.value ?? y("common.notAvailable"),
90
- hint: e.meta == null ? void 0 : i(e.meta, _)
91
- }))
262
+ return e == null ? /* @__PURE__ */ u(N, {}) : /* @__PURE__ */ u(I, { metrics: e });
263
+ }
264
+ if (l.kind === "trendMetric") {
265
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
266
+ return e == null ? /* @__PURE__ */ u(_, {
267
+ title: t,
268
+ subtitle: x,
269
+ children: /* @__PURE__ */ u(N, {})
270
+ }) : /* @__PURE__ */ u(_, {
271
+ title: t,
272
+ subtitle: x,
273
+ children: /* @__PURE__ */ u(B, { metric: e })
274
+ });
275
+ }
276
+ if (l.kind === "slaGauge") {
277
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
278
+ return e == null ? /* @__PURE__ */ u(_, {
279
+ title: t,
280
+ subtitle: x,
281
+ children: /* @__PURE__ */ u(N, {})
282
+ }) : /* @__PURE__ */ u(_, {
283
+ title: t,
284
+ subtitle: x,
285
+ children: /* @__PURE__ */ u(V, { gauge: e })
92
286
  });
93
287
  }
94
- if (u.kind === "billingUsageChart") {
95
- let e = S(), t = i(u.title, _);
96
- return e == null ? /* @__PURE__ */ s(f, {
288
+ if (l.kind === "breakdownList") {
289
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
290
+ return e == null ? /* @__PURE__ */ u(_, {
97
291
  title: t,
98
292
  subtitle: x,
99
- children: /* @__PURE__ */ s(v, {})
100
- }) : /* @__PURE__ */ s(f, {
293
+ children: /* @__PURE__ */ u(N, {})
294
+ }) : /* @__PURE__ */ u(_, {
295
+ title: t,
296
+ subtitle: x,
297
+ children: /* @__PURE__ */ u(H, { items: e })
298
+ });
299
+ }
300
+ if (l.kind === "timelineChart") {
301
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
302
+ return e == null ? /* @__PURE__ */ u(_, {
101
303
  title: t,
102
304
  subtitle: x,
103
- children: /* @__PURE__ */ s(n, {
104
- ariaLabel: i(u.ariaLabel, _),
305
+ children: /* @__PURE__ */ u(N, {})
306
+ }) : /* @__PURE__ */ u(_, {
307
+ title: t,
308
+ subtitle: x,
309
+ children: /* @__PURE__ */ u(U, {
310
+ ariaLabel: l.ariaLabel,
311
+ chart: l.chart,
312
+ result: e
313
+ })
314
+ });
315
+ }
316
+ if (l.kind === "riskQueue") {
317
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
318
+ return e == null ? /* @__PURE__ */ u(_, {
319
+ title: t,
320
+ subtitle: x,
321
+ children: /* @__PURE__ */ u(N, {})
322
+ }) : /* @__PURE__ */ u(_, {
323
+ title: t,
324
+ subtitle: x,
325
+ children: /* @__PURE__ */ u(W, { items: e })
326
+ });
327
+ }
328
+ if (l.kind === "entitySpotlight") {
329
+ let e = S();
330
+ return /* @__PURE__ */ u(_, {
331
+ title: l.title == null ? void 0 : i(l.title, g),
332
+ subtitle: x,
333
+ children: /* @__PURE__ */ u(G, { item: e })
334
+ });
335
+ }
336
+ if (l.kind === "healthMatrix") {
337
+ let e = S(), t = l.title == null ? void 0 : i(l.title, g);
338
+ return e == null ? /* @__PURE__ */ u(_, {
339
+ title: t,
340
+ subtitle: x,
341
+ children: /* @__PURE__ */ u(N, {})
342
+ }) : /* @__PURE__ */ u(_, {
343
+ title: t,
344
+ subtitle: x,
345
+ children: /* @__PURE__ */ u(K, { rows: e })
346
+ });
347
+ }
348
+ if (l.kind === "billingUsageChart") {
349
+ let e = S(), t = i(l.title, g);
350
+ return e == null ? /* @__PURE__ */ u(_, {
351
+ title: t,
352
+ subtitle: x,
353
+ children: /* @__PURE__ */ u(N, {})
354
+ }) : /* @__PURE__ */ u(_, {
355
+ title: t,
356
+ subtitle: x,
357
+ children: /* @__PURE__ */ u(n, {
358
+ ariaLabel: i(l.ariaLabel, g),
105
359
  buckets: e.buckets,
106
- categories: u.categories.map((e) => ({
360
+ categories: l.categories.map((e) => ({
107
361
  id: e.id,
108
- label: i(e.label, _),
362
+ label: i(e.label, g),
109
363
  color: e.color
110
364
  })),
111
365
  currency: e.currency,
112
- emptyLabel: i(u.emptyLabel, _),
366
+ emptyLabel: i(l.emptyLabel, g),
113
367
  from: e.from,
114
- rangePrefix: i(u.rangePrefix, _),
368
+ rangePrefix: i(l.rangePrefix, g),
115
369
  to: e.to,
116
370
  totalAmount: e.totalAmount
117
371
  })
118
372
  });
119
373
  }
120
- if (u.kind === "quickActions") return /* @__PURE__ */ s(f, {
121
- title: u.title == null ? y("dashboard.actions.openTool") : i(u.title, _),
374
+ if (l.kind === "quickActions") return /* @__PURE__ */ u(_, {
375
+ title: l.title == null ? y("dashboard.actions.openTool") : i(l.title, g),
376
+ subtitle: x,
377
+ children: /* @__PURE__ */ u(R, {
378
+ layout: l.layout?.zone === "aside" ? "stack" : "grid",
379
+ actions: l.actions
380
+ })
381
+ });
382
+ if (l.kind === "windowControl") return /* @__PURE__ */ u(_, {
383
+ title: i(l.title, g),
122
384
  subtitle: x,
123
- children: /* @__PURE__ */ s(p, {
124
- layout: u.layout?.zone === "aside" ? "stack" : "grid",
125
- emptyState: /* @__PURE__ */ s(v, {}),
126
- actions: u.actions.map((e) => ({
385
+ children: /* @__PURE__ */ u(O, {
386
+ activePresetId: s ?? c.window.id,
387
+ onChange: (e) => {
388
+ m?.(e);
389
+ },
390
+ presets: h.map((e) => ({
127
391
  id: e.id,
128
- href: e.href,
129
- label: i(e.label, _)
392
+ label: i(e.label, g)
130
393
  }))
131
394
  })
132
395
  });
133
- if (u.kind === "statusSummary") {
396
+ if (l.kind === "statusSummary") {
134
397
  let e = S();
135
- return e == null ? /* @__PURE__ */ s(f, {
136
- title: u.title == null ? void 0 : i(u.title, _),
398
+ return e == null ? /* @__PURE__ */ u(_, {
399
+ title: l.title == null ? void 0 : i(l.title, g),
137
400
  subtitle: x,
138
- children: /* @__PURE__ */ s(v, {})
139
- }) : /* @__PURE__ */ s(f, {
140
- title: u.title == null ? void 0 : i(u.title, _),
401
+ children: /* @__PURE__ */ u(N, {})
402
+ }) : /* @__PURE__ */ u(_, {
403
+ title: l.title == null ? void 0 : i(l.title, g),
141
404
  subtitle: x,
142
- children: /* @__PURE__ */ s(h, {
143
- emptyState: /* @__PURE__ */ s(v, {}),
144
- items: e.map((e) => ({
145
- id: e.id,
146
- href: e.href,
147
- label: i(e.label, _),
148
- value: e.value ?? y("common.notAvailable")
149
- }))
150
- })
405
+ children: /* @__PURE__ */ u(L, { items: e })
151
406
  });
152
407
  }
153
- if (u.kind === "recentItems") return /* @__PURE__ */ s(f, {
154
- title: u.title == null ? y("dashboard.title") : i(u.title, _),
408
+ if (l.kind === "recentItems") return /* @__PURE__ */ u(_, {
409
+ title: l.title == null ? y("dashboard.title") : i(l.title, g),
155
410
  subtitle: x,
156
- children: /* @__PURE__ */ s(v, {})
411
+ children: /* @__PURE__ */ u(N, {})
157
412
  });
158
- let C = b[u.entityId];
159
- if (C?.kind !== "list-detail") return /* @__PURE__ */ s(f, {
160
- title: i(u.label, _),
413
+ let C = b[l.entityId];
414
+ if (C?.kind !== "list-detail") return /* @__PURE__ */ u(_, {
415
+ title: i(l.label, g),
161
416
  subtitle: x,
162
- children: /* @__PURE__ */ s(v, {})
417
+ children: /* @__PURE__ */ u(N, {})
163
418
  });
164
419
  let w = S(), T = y("common.notAvailable");
165
- return typeof w?.count == "number" && (T = w.count), /* @__PURE__ */ s(f, {
166
- title: i(u.label, _),
420
+ return typeof w?.count == "number" && (T = w.count), /* @__PURE__ */ u(_, {
421
+ title: i(l.label, g),
167
422
  subtitle: x,
168
- children: /* @__PURE__ */ c("div", {
423
+ children: /* @__PURE__ */ d("div", {
169
424
  className: a,
170
- children: [/* @__PURE__ */ s("div", {
425
+ children: [/* @__PURE__ */ u("div", {
171
426
  className: o,
172
427
  children: T
173
- }), /* @__PURE__ */ s(p, {
174
- emptyState: /* @__PURE__ */ s(v, {}),
175
- actions: [{
176
- id: C.id,
177
- href: C.routes.list,
178
- label: y("dashboard.actions.openList")
179
- }]
180
- })]
428
+ }), /* @__PURE__ */ u(R, { actions: [{
429
+ id: C.id,
430
+ href: w?.href ?? C.routes.list,
431
+ target: w?.target,
432
+ label: y("dashboard.actions.openList")
433
+ }] })]
181
434
  })
182
435
  });
183
- }, b = ({ widget: e }) => /* @__PURE__ */ s(y, {
184
- widget: e,
185
- data: _(e.query, e.variables, { fetchPolicy: "store-or-network" })
186
- }), x = ({ widget: e }) => e.dataSource === "query" ? /* @__PURE__ */ s(b, { widget: e }) : /* @__PURE__ */ s(y, { widget: e });
436
+ }, J = ({ activeWindowPresetId: e, context: t = j, onWindowPresetChange: n, widget: r, windowPresets: i }) => /* @__PURE__ */ u(q, {
437
+ activeWindowPresetId: e,
438
+ context: t,
439
+ data: A(r.query, M(r, t), { fetchPolicy: "store-or-network" }),
440
+ onWindowPresetChange: n,
441
+ widget: r,
442
+ windowPresets: i
443
+ }), Y = (e) => {
444
+ let { widget: t } = e;
445
+ return t.dataSource === "query" ? /* @__PURE__ */ u(J, {
446
+ ...e,
447
+ widget: t
448
+ }) : /* @__PURE__ */ u(q, { ...e });
449
+ };
187
450
  //#endregion
188
- export { x as BackofficeDashboardWidgetContent, x as default };
451
+ export { Y as BackofficeDashboardWidgetContent, Y as default };
189
452
 
190
453
  //# sourceMappingURL=BackofficeDashboardWidgetContent.js.map