@plumile/backoffice-react 0.1.187 → 0.1.188

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 (48) hide show
  1. package/lib/esm/auth/authRefreshNotice.css.js +1 -2
  2. package/lib/esm/auth/login/loginPage.css.js +1 -2
  3. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +346 -403
  4. package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
  5. package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +1 -1
  6. package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +1 -1
  7. package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +1 -1
  8. package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +3 -3
  9. package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
  10. package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +10 -10
  11. package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +1 -1
  12. package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -2
  13. package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +2 -1
  14. package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +1 -1
  15. package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +1 -1
  16. package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +2 -1
  17. package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +2 -1
  18. package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +1 -1
  19. package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +4 -4
  20. package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +1 -1
  21. package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
  22. package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +2 -2
  23. package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +1 -1
  24. package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +1 -1
  25. package/lib/esm/components/backoffice/links/backofficeLink.css.js +1 -1
  26. package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -1
  27. package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +1 -1
  28. package/lib/esm/components/backoffice/refs/backofficeEntityIdRef.css.js +1 -1
  29. package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +1 -1
  30. package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +1 -1
  31. package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +1 -1
  32. package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +1 -1
  33. package/lib/esm/components/backoffice/routing/backofficeRouteFallback.css.js +1 -1
  34. package/lib/esm/components/backoffice/routing/backofficeRoutePendingBar.css.js +1 -1
  35. package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +1 -1
  36. package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +3 -3
  37. package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +1 -1
  38. package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +1 -1
  39. package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +4 -4
  40. package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +1 -1
  41. package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +1 -1
  42. package/lib/esm/pages/backofficeDashboardPage.css.js +1 -1
  43. package/lib/esm/pages/backofficeEntityDetailPage.css.js +1 -1
  44. package/lib/esm/pages/backofficeEntityListPage.css.js +1 -1
  45. package/lib/esm/storybook/relay/RelayStory.css.js +1 -1
  46. package/lib/esm/style.css +1 -1
  47. package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
  48. package/package.json +13 -13
@@ -4,31 +4,31 @@ import { useBackofficeConfig as n } from "../../../provider/BackofficeConfigCont
4
4
  import { EntityIdFilterField as r } from "../filters/EntityIdFilterField.js";
5
5
  import { EntityIdPickerDialog as i } from "../pickers/EntityIdPickerDialog.js";
6
6
  import { resolveToastSpec as a, resolveToastViewActions as o } from "./toastViewAction.js";
7
- import { actions as s, checkboxGroup as c, fieldset as l, form as u, legend as ee } from "./backofficeEntityActionFormDialog.css.js";
8
- import { useCallback as d, useContext as f, useEffect as p, useId as te, useMemo as m, useState as h } from "react";
9
- import { Fragment as ne, jsx as g, jsxs as _ } from "react/jsx-runtime";
10
- import { useTranslation as re } from "react-i18next";
11
- import { Button as v } from "@plumile/ui/atomic/atoms/button/Button.js";
12
- import { FormError as ie } from "@plumile/ui/atomic/molecules/form_error/FormError.js";
13
- import { Form as ae } from "@plumile/ui/atomic/molecules/form/Form.js";
14
- import * as y from "react-relay";
15
- import { Input as b } from "@plumile/ui/atomic/atoms/input/Input.js";
16
- import { Label as x } from "@plumile/ui/atomic/atoms/label/Label.js";
17
- import { Modal as oe } from "@plumile/ui/atomic/atoms/modal/Modal.js";
18
- import { Textarea as S } from "@plumile/ui/atomic/atoms/textarea/Textarea.js";
19
- import { CheckboxField as C } from "@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js";
20
- import { FormGroup as w } from "@plumile/ui/atomic/molecules/form/FormGroup.js";
7
+ import { actions as s, checkboxGroup as c, form as l } from "./backofficeEntityActionFormDialog.css.js";
8
+ import { useCallback as u, useContext as d, useEffect as f, useId as ee, useMemo as p, useState as m } from "react";
9
+ import { Fragment as te, jsx as h, jsxs as g } from "react/jsx-runtime";
10
+ import { useTranslation as ne } from "react-i18next";
11
+ import { Button as _ } from "@plumile/ui/atomic/atoms/button/Button.js";
12
+ import { FormError as re } from "@plumile/ui/atomic/molecules/form_error/FormError.js";
13
+ import { Form as ie } from "@plumile/ui/atomic/molecules/form/Form.js";
14
+ import * as v from "react-relay";
15
+ import { Input as y } from "@plumile/ui/atomic/atoms/input/Input.js";
16
+ import { Modal as ae } from "@plumile/ui/atomic/atoms/modal/Modal.js";
17
+ import { Textarea as b } from "@plumile/ui/atomic/atoms/textarea/Textarea.js";
18
+ import { CheckboxField as x } from "@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js";
19
+ import { FormGrid as oe } from "@plumile/ui/atomic/molecules/form_grid/FormGrid.js";
20
+ import { FormFieldLayout as S } from "@plumile/ui/atomic/molecules/form_field_layout/FormFieldLayout.js";
21
21
  import { HighlightCode as se } from "@plumile/ui/atomic/molecules/highlight/HighlightCode.js";
22
22
  import { useToast as ce } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
23
23
  import { BackofficeFormSection as le } from "@plumile/ui/backoffice/molecules/backoffice_form_section/BackofficeFormSection.js";
24
24
  import { SimpleSelect as ue } from "@plumile/ui/components/select/SimpleSelect.js";
25
25
  import de from "@plumile/router/routing/RoutingContext.js";
26
26
  //#region src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx
27
- var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E = (e) => typeof e == "object" && !!e && !Array.isArray(e), me = (e) => {
28
- if (!E(e)) return null;
29
- for (let t of Object.values(e)) if (E(t) && ("status" in t || "result" in t)) return t;
27
+ var { commitMutation: fe, useRelayEnvironment: pe } = v, C = (e, t) => e(t), w = (e) => typeof e == "object" && !!e && !Array.isArray(e), me = (e) => {
28
+ if (!w(e)) return null;
29
+ for (let t of Object.values(e)) if (w(t) && ("status" in t || "result" in t)) return t;
30
30
  return null;
31
- }, D = (e) => {
31
+ }, T = (e) => {
32
32
  let t = {};
33
33
  return e.forEach((e) => {
34
34
  if (e.kind === "boolean") {
@@ -45,45 +45,45 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
45
45
  }
46
46
  t[e.id] = "";
47
47
  }), t;
48
- }, O = (e, t) => e.kind === "number" ? typeof t == "number" ? String(t) : typeof t == "string" ? t : "" : e.kind === "multiEnum" ? Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [] : e.kind === "boolean" ? t === !0 : typeof t == "string" ? t : t ?? "", he = (e, t) => {
49
- let n = D(e.fields);
48
+ }, E = (e, t) => e.kind === "number" ? typeof t == "number" ? String(t) : typeof t == "string" ? t : "" : e.kind === "multiEnum" ? Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim() !== "") : [] : e.kind === "boolean" ? t === !0 : typeof t == "string" ? t : t ?? "", he = (e, t) => {
49
+ let n = T(e.fields);
50
50
  if (e.getInitialValues == null) return n;
51
51
  let r = e.getInitialValues(t);
52
- if (!E(r)) return n;
52
+ if (!w(r)) return n;
53
53
  let i = { ...n };
54
54
  return e.fields.forEach((e) => {
55
- e.id in r && (i[e.id] = O(e, r[e.id]));
55
+ e.id in r && (i[e.id] = E(e, r[e.id]));
56
56
  }), i;
57
- }, k = ({ isOpen: y, action: D, node: O, onClose: k, onSuccess: A }) => {
58
- let { t: j } = re(), { t: M } = e(), { entities: N } = n(), P = f(de), F = pe(), I = ce(), ge = te(), [L, R] = h({}), [_e, z] = h(null), [ve, B] = h({}), [V, H] = h(!1), [U, W] = h(null), [G, K] = h(null), [q, J] = h(null);
59
- p(() => {
60
- y && (R(he(D, O)), z(null), B({}), W(null), K(null));
57
+ }, D = ({ isOpen: v, action: T, node: E, onClose: D, onSuccess: O }) => {
58
+ let { t: k } = ne(), { t: A } = e(), { entities: j } = n(), M = d(de), N = pe(), P = ce(), ge = ee(), [F, I] = m({}), [_e, L] = m(null), [ve, R] = m({}), [z, B] = m(!1), [V, H] = m(null), [U, W] = m(null), [G, K] = m(null);
59
+ f(() => {
60
+ v && (I(he(T, E)), L(null), R({}), H(null), W(null));
61
61
  }, [
62
- D,
63
- y,
64
- O
62
+ T,
63
+ v,
64
+ E
65
65
  ]);
66
- let ye = d(() => {
67
- V || k();
68
- }, [V, k]), Y = d((e, t) => {
69
- R((n) => ({
66
+ let q = u(() => {
67
+ z || D();
68
+ }, [z, D]), J = u((e, t) => {
69
+ I((n) => ({
70
70
  ...n,
71
71
  [e]: t
72
- })), B((t) => {
72
+ })), R((t) => {
73
73
  if (t[e] == null) return t;
74
74
  let { [e]: n, ...r } = t;
75
75
  return r;
76
76
  });
77
- }, []), be = T(D.label, j), X = d((e) => M("actions.form.errors.required", { label: e }), [M]), xe = d((e) => M("actions.form.errors.invalidNumber", { label: e }), [M]), Se = d((e) => M("actions.form.errors.invalidJson", { label: e }), [M]), Ce = d((e) => M("actions.form.errors.invalidJsonObject", { label: e }), [M]), we = d((e) => M("actions.form.errors.invalidJsonArray", { label: e }), [M]), Te = d(() => {
77
+ }, []), ye = C(T.label, k), Y = u((e) => A("actions.form.errors.required", { label: e }), [A]), X = u((e) => A("actions.form.errors.invalidNumber", { label: e }), [A]), be = u((e) => A("actions.form.errors.invalidJson", { label: e }), [A]), xe = u((e) => A("actions.form.errors.invalidJsonObject", { label: e }), [A]), Se = u((e) => A("actions.form.errors.invalidJsonArray", { label: e }), [A]), Ce = u(() => {
78
78
  let e = {};
79
- for (let t of D.fields) {
80
- let n = T(t.label, j), r = L[t.id];
79
+ for (let t of T.fields) {
80
+ let n = C(t.label, k), r = F[t.id];
81
81
  switch (t.kind) {
82
82
  case "text": {
83
83
  let i = "";
84
84
  if (typeof r == "string" && (i = r.trim()), i === "") {
85
85
  if (t.required) return {
86
- error: X(n),
86
+ error: Y(n),
87
87
  fieldId: t.id
88
88
  };
89
89
  break;
@@ -95,7 +95,7 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
95
95
  let i = "";
96
96
  if (typeof r == "string" && (i = r.trim()), i === "") {
97
97
  if (t.required) return {
98
- error: X(n),
98
+ error: Y(n),
99
99
  fieldId: t.id
100
100
  };
101
101
  break;
@@ -107,14 +107,14 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
107
107
  let i = "";
108
108
  if (typeof r == "string" ? i = r.trim() : typeof r == "number" && Number.isFinite(r) && (i = String(r)), i === "") {
109
109
  if (t.required) return {
110
- error: X(n),
110
+ error: Y(n),
111
111
  fieldId: t.id
112
112
  };
113
113
  break;
114
114
  }
115
115
  let a = Number(i);
116
116
  if (!Number.isFinite(a)) return {
117
- error: xe(n),
117
+ error: X(n),
118
118
  fieldId: t.id
119
119
  };
120
120
  e[t.id] = a;
@@ -124,7 +124,7 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
124
124
  let i = "";
125
125
  if (typeof r == "string" && (i = r.trim()), i === "") {
126
126
  if (t.required) return {
127
- error: X(n),
127
+ error: Y(n),
128
128
  fieldId: t.id
129
129
  };
130
130
  break;
@@ -134,17 +134,17 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
134
134
  a = JSON.parse(i);
135
135
  } catch {
136
136
  return {
137
- error: Se(n),
137
+ error: be(n),
138
138
  fieldId: t.id
139
139
  };
140
140
  }
141
141
  let o = t.jsonType ?? "object";
142
- if (o === "object" && !E(a)) return {
143
- error: Ce(n),
142
+ if (o === "object" && !w(a)) return {
143
+ error: xe(n),
144
144
  fieldId: t.id
145
145
  };
146
146
  if (o === "array" && !Array.isArray(a)) return {
147
- error: we(n),
147
+ error: Se(n),
148
148
  fieldId: t.id
149
149
  };
150
150
  e[t.id] = a;
@@ -154,7 +154,7 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
154
154
  let i = "";
155
155
  if (typeof r == "string" && (i = r.trim()), i === "") {
156
156
  if (t.required) return {
157
- error: X(n),
157
+ error: Y(n),
158
158
  fieldId: t.id
159
159
  };
160
160
  break;
@@ -169,7 +169,7 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
169
169
  let i = "";
170
170
  if (typeof r == "string" && (i = r.trim()), i === "") {
171
171
  if (t.required) return {
172
- error: X(n),
172
+ error: Y(n),
173
173
  fieldId: t.id
174
174
  };
175
175
  break;
@@ -181,7 +181,7 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
181
181
  let i = [];
182
182
  if (Array.isArray(r) && (i = r.filter((e) => typeof e == "string" && e.trim() !== "")), i.length === 0) {
183
183
  if (t.required) return {
184
- error: X(n),
184
+ error: Y(n),
185
185
  fieldId: t.id
186
186
  };
187
187
  break;
@@ -194,461 +194,404 @@ var { commitMutation: fe, useRelayEnvironment: pe } = y, T = (e, t) => e(t), E =
194
194
  }
195
195
  return { values: e };
196
196
  }, [
197
- D.fields,
198
- we,
197
+ T.fields,
199
198
  Se,
200
- Ce,
199
+ be,
201
200
  xe,
202
201
  X,
203
- j,
204
- L
205
- ]), Z = d(() => {
206
- if (V) return;
207
- z(null), B({});
208
- let e = Te();
202
+ Y,
203
+ k,
204
+ F
205
+ ]), Z = u(() => {
206
+ if (z) return;
207
+ L(null), R({});
208
+ let e = Ce();
209
209
  if ("error" in e) {
210
- z(e.error), e.fieldId != null && B({ [e.fieldId]: e.error });
210
+ L(e.error), e.fieldId != null && R({ [e.fieldId]: e.error });
211
211
  return;
212
212
  }
213
213
  let n;
214
214
  try {
215
- n = D.getVariables(O, e.values);
215
+ n = T.getVariables(E, e.values);
216
216
  } catch {
217
- z(M("actions.form.errors.invalidPayload"));
217
+ L(A("actions.form.errors.invalidPayload"));
218
218
  return;
219
219
  }
220
- H(!0), fe(F, {
221
- mutation: D.mutation,
220
+ B(!0), fe(N, {
221
+ mutation: T.mutation,
222
222
  variables: n,
223
223
  updater: (e) => {
224
- D.updater?.(e, O);
224
+ T.updater?.(e, E);
225
225
  },
226
226
  onCompleted: (e) => {
227
- H(!1);
227
+ B(!1);
228
228
  let n = me(e);
229
229
  if (n != null) {
230
- let e = M("actions.form.errors.invalidPayload");
231
- D.toasts?.error?.message == null ? D.toasts?.error?.title != null && (e = T(D.toasts.error.title, j)) : e = T(D.toasts.error.message, j);
230
+ let e = A("actions.form.errors.invalidPayload");
231
+ T.toasts?.error?.message == null ? T.toasts?.error?.title != null && (e = C(T.toasts.error.title, k)) : e = C(T.toasts.error.message, k);
232
232
  let r = t(n, {
233
233
  defaultErrorMessage: e,
234
234
  mapReason: (e) => {
235
- let t = D.mapErrorReason?.(e, O);
236
- return t == null ? null : typeof t == "function" ? T(t, j) : String(t);
235
+ let t = T.mapErrorReason?.(e, E);
236
+ return t == null ? null : typeof t == "function" ? C(t, k) : String(t);
237
237
  }
238
238
  });
239
239
  if (!r.ok) {
240
240
  let e = Error(r.message);
241
- if (z(r.message), D.onError?.(e, O), D.toasts?.error != null) {
242
- let e = T(D.toasts.error.title, j), t;
243
- D.toasts.error.message != null && (t = T(D.toasts.error.message, j)), I.error(e, t);
241
+ if (L(r.message), T.onError?.(e, E), T.toasts?.error != null) {
242
+ let e = C(T.toasts.error.title, k), t;
243
+ T.toasts.error.message != null && (t = C(T.toasts.error.message, k)), P.error(e, t);
244
244
  }
245
245
  return;
246
246
  }
247
247
  }
248
- D.onCompleted?.(e, O);
248
+ T.onCompleted?.(e, E);
249
249
  let r = !1;
250
- if (D.result?.render != null && D.result.render(e, O) != null && (r = !0, K(e)), D.toasts?.success != null) {
251
- let t = a(D.toasts.success, j), n = o({
252
- toast: D.toasts.success,
250
+ if (T.result?.render != null && T.result.render(e, E) != null && (r = !0, W(e)), T.toasts?.success != null) {
251
+ let t = a(T.toasts.success, k), n = o({
252
+ toast: T.toasts.success,
253
253
  response: e,
254
- node: O,
255
- tApp: j,
256
- entities: N,
257
- defaultLabel: M("actions.view"),
254
+ node: E,
255
+ tApp: k,
256
+ entities: j,
257
+ defaultLabel: A("actions.view"),
258
258
  navigateTo: (e) => {
259
- P?.history.push({ pathname: e });
259
+ M?.history.push({ pathname: e });
260
260
  }
261
261
  });
262
- I.push({
262
+ P.push({
263
263
  kind: "info",
264
264
  title: t.title,
265
265
  message: t.message,
266
266
  actions: n
267
267
  });
268
268
  }
269
- if (D.result != null) {
270
- let t = D.result.getValue(e, O);
269
+ if (T.result != null) {
270
+ let t = T.result.getValue(e, E);
271
271
  if (typeof t == "string" && t.trim() !== "") {
272
- W(t), A?.();
272
+ H(t), O?.();
273
273
  return;
274
274
  }
275
275
  }
276
276
  if (r) {
277
- A?.();
277
+ O?.();
278
278
  return;
279
279
  }
280
- A?.(), k();
280
+ O?.(), D();
281
281
  },
282
282
  onError: (e) => {
283
- if (H(!1), z(M("actions.form.errors.submitFailed")), D.onError?.(e, O), D.toasts?.error != null) {
284
- let e = T(D.toasts.error.title, j), t;
285
- D.toasts.error.message != null && (t = T(D.toasts.error.message, j)), I.error(e, t);
283
+ if (B(!1), L(A("actions.form.errors.submitFailed")), T.onError?.(e, E), T.toasts?.error != null) {
284
+ let e = C(T.toasts.error.title, k), t;
285
+ T.toasts.error.message != null && (t = C(T.toasts.error.message, k)), P.error(e, t);
286
286
  }
287
287
  }
288
288
  });
289
289
  }, [
290
- D,
291
- Te,
290
+ T,
291
+ Ce,
292
+ j,
292
293
  N,
293
- F,
294
- V,
294
+ z,
295
+ E,
296
+ D,
295
297
  O,
296
- k,
298
+ M?.history,
297
299
  A,
298
- P?.history,
299
- M,
300
- j,
301
- I
302
- ]), Ee = d((e) => {
300
+ k,
301
+ P
302
+ ]), we = u((e) => {
303
303
  e.preventDefault(), Z();
304
- }, [Z]), Q = m(() => D.result == null ? null : T(D.result.label, j), [D.result, j]), De = m(() => D.result?.render == null || G == null ? null : D.result.render(G, O), [
305
- D.result,
306
- O,
307
- G
308
- ]), $ = U != null && Q != null || De != null, Oe = T(D.label, j);
309
- return y ? /* @__PURE__ */ _(ne, { children: [/* @__PURE__ */ g(oe, {
310
- isOpen: y,
311
- onClose: ye,
312
- title: be,
304
+ }, [Z]), Q = p(() => T.result == null ? null : C(T.result.label, k), [T.result, k]), Te = p(() => T.result?.render == null || U == null ? null : T.result.render(U, E), [
305
+ T.result,
306
+ E,
307
+ U
308
+ ]), $ = V != null && Q != null || Te != null, Ee = C(T.label, k);
309
+ return v ? /* @__PURE__ */ g(te, { children: [/* @__PURE__ */ h(ae, {
310
+ isOpen: v,
311
+ onClose: q,
312
+ title: ye,
313
313
  initialFocus: "first-form-control",
314
- footer: /* @__PURE__ */ _("div", {
314
+ footer: /* @__PURE__ */ g("div", {
315
315
  className: s,
316
- children: [/* @__PURE__ */ g(v, {
316
+ children: [/* @__PURE__ */ h(_, {
317
317
  type: "button",
318
318
  variant: "secondary",
319
319
  size: "small",
320
- disabled: V,
321
- onClick: ye,
322
- children: M("actions.form.cancel")
323
- }), !$ && /* @__PURE__ */ g(v, {
320
+ disabled: z,
321
+ onClick: q,
322
+ children: A("actions.form.cancel")
323
+ }), !$ && /* @__PURE__ */ h(_, {
324
324
  type: "submit",
325
325
  variant: "primary",
326
326
  size: "small",
327
- disabled: V,
328
- isLoading: V,
329
- loadingLabel: M("actions.form.submitting"),
327
+ disabled: z,
328
+ isLoading: z,
329
+ loadingLabel: A("actions.form.submitting"),
330
330
  onClick: Z,
331
- children: Oe
331
+ children: Ee
332
332
  })]
333
333
  }),
334
- children: /* @__PURE__ */ _(ae, {
335
- onSubmit: Ee,
336
- className: u,
334
+ children: /* @__PURE__ */ g(ie, {
335
+ onSubmit: we,
336
+ className: l,
337
337
  children: [
338
- /* @__PURE__ */ g(ie, { message: _e }),
339
- /* @__PURE__ */ g(le, { children: D.fields.map((e) => {
340
- let t = T(e.label, j), n = null;
341
- e.description != null && (n = T(e.description, j));
342
- let i = `${ge}-${e.id}`, a = `${i}-description`, o = `${i}-error`, s = ve[e.id] ?? null, u = s != null, d, f = "default";
343
- u && (d = "error", f = "error");
344
- let p;
345
- switch (n != null && s != null ? p = `${a} ${o}` : n == null ? s != null && (p = o) : p = a, e.kind) {
346
- case "text": {
347
- let r = L[e.id], c = "";
348
- typeof r == "string" && (c = r);
349
- let l;
350
- return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
351
- /* @__PURE__ */ g(x, {
352
- htmlFor: i,
338
+ /* @__PURE__ */ h(re, { message: _e }),
339
+ /* @__PURE__ */ h(le, { children: /* @__PURE__ */ h(oe, {
340
+ layout: "vertical",
341
+ children: T.fields.map((e) => {
342
+ let t = C(e.label, k), n = null;
343
+ e.description != null && (n = C(e.description, k));
344
+ let i = `${ge}-${e.id}`, a = `${i}-description`, o = `${i}-error`, s = ve[e.id] ?? null, l = s != null, u, d = "default";
345
+ l && (u = "error", d = "error");
346
+ let f;
347
+ switch (n != null && s != null ? f = `${a} ${o}` : n == null ? s != null && (f = o) : f = a, e.kind) {
348
+ case "text": {
349
+ let r = F[e.id], c = "";
350
+ typeof r == "string" && (c = r);
351
+ let d;
352
+ return e.placeholder != null && (d = C(e.placeholder, k)), /* @__PURE__ */ h(S, {
353
+ label: t,
354
+ labelFor: i,
353
355
  required: e.required,
354
- children: t
355
- }),
356
- n != null && /* @__PURE__ */ g("span", {
357
- id: a,
358
- className: "txvbqb96 txvbqb1bff",
359
- children: n
360
- }),
361
- /* @__PURE__ */ g(b, {
362
- id: i,
363
- type: "text",
364
- value: c,
365
- placeholder: l,
366
- "aria-describedby": p,
367
- "aria-invalid": u,
368
- disabled: V,
369
- variant: d,
370
- onChange: (t) => {
371
- Y(e.id, t.target.value);
372
- },
373
- fullWidth: !0
374
- }),
375
- s != null && /* @__PURE__ */ g("span", {
376
- id: o,
377
- className: "txvbqb96 txvbqb1bij",
378
- children: s
379
- })
380
- ] }, e.id);
381
- }
382
- case "textarea": {
383
- let r = L[e.id], c = "";
384
- typeof r == "string" && (c = r);
385
- let l;
386
- return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
387
- /* @__PURE__ */ g(x, {
388
- htmlFor: i,
356
+ description: n,
357
+ descriptionId: a,
358
+ error: s,
359
+ errorId: o,
360
+ children: /* @__PURE__ */ h(y, {
361
+ id: i,
362
+ type: "text",
363
+ value: c,
364
+ placeholder: d,
365
+ "aria-describedby": f,
366
+ "aria-invalid": l,
367
+ disabled: z,
368
+ variant: u,
369
+ onChange: (t) => {
370
+ J(e.id, t.target.value);
371
+ },
372
+ fullWidth: !0
373
+ })
374
+ }, e.id);
375
+ }
376
+ case "textarea": {
377
+ let r = F[e.id], c = "";
378
+ typeof r == "string" && (c = r);
379
+ let d;
380
+ return e.placeholder != null && (d = C(e.placeholder, k)), /* @__PURE__ */ h(S, {
381
+ label: t,
382
+ labelFor: i,
389
383
  required: e.required,
390
- children: t
391
- }),
392
- n != null && /* @__PURE__ */ g("span", {
393
- id: a,
394
- className: "txvbqb96 txvbqb1bff",
395
- children: n
396
- }),
397
- /* @__PURE__ */ g(S, {
398
- id: i,
399
- value: c,
400
- placeholder: l,
401
- rows: e.rows ?? 8,
402
- "aria-describedby": p,
403
- "aria-invalid": u,
404
- disabled: V,
405
- variant: d,
406
- onChange: (t) => {
407
- Y(e.id, t.target.value);
408
- },
409
- fullWidth: !0
410
- }),
411
- s != null && /* @__PURE__ */ g("span", {
412
- id: o,
413
- className: "txvbqb96 txvbqb1bij",
414
- children: s
415
- })
416
- ] }, e.id);
417
- }
418
- case "number": {
419
- let r = L[e.id], c = "";
420
- typeof r == "string" && (c = r);
421
- let l;
422
- return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
423
- /* @__PURE__ */ g(x, {
424
- htmlFor: i,
384
+ description: n,
385
+ descriptionId: a,
386
+ error: s,
387
+ errorId: o,
388
+ children: /* @__PURE__ */ h(b, {
389
+ id: i,
390
+ value: c,
391
+ placeholder: d,
392
+ rows: e.rows ?? 8,
393
+ "aria-describedby": f,
394
+ "aria-invalid": l,
395
+ disabled: z,
396
+ variant: u,
397
+ onChange: (t) => {
398
+ J(e.id, t.target.value);
399
+ },
400
+ fullWidth: !0
401
+ })
402
+ }, e.id);
403
+ }
404
+ case "number": {
405
+ let r = F[e.id], c = "";
406
+ typeof r == "string" && (c = r);
407
+ let d;
408
+ return e.placeholder != null && (d = C(e.placeholder, k)), /* @__PURE__ */ h(S, {
409
+ label: t,
410
+ labelFor: i,
425
411
  required: e.required,
426
- children: t
427
- }),
428
- n != null && /* @__PURE__ */ g("span", {
429
- id: a,
430
- className: "txvbqb96 txvbqb1bff",
431
- children: n
432
- }),
433
- /* @__PURE__ */ g(b, {
434
- id: i,
435
- type: "number",
436
- value: c,
437
- placeholder: l,
438
- "aria-describedby": p,
439
- "aria-invalid": u,
440
- disabled: V,
441
- variant: d,
442
- onChange: (t) => {
443
- Y(e.id, t.target.value);
444
- },
445
- fullWidth: !0
446
- }),
447
- s != null && /* @__PURE__ */ g("span", {
448
- id: o,
449
- className: "txvbqb96 txvbqb1bij",
450
- children: s
451
- })
452
- ] }, e.id);
453
- }
454
- case "json": {
455
- let r = L[e.id], c = "";
456
- typeof r == "string" && (c = r);
457
- let l;
458
- return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
459
- /* @__PURE__ */ g(x, {
460
- htmlFor: i,
412
+ description: n,
413
+ descriptionId: a,
414
+ error: s,
415
+ errorId: o,
416
+ children: /* @__PURE__ */ h(y, {
417
+ id: i,
418
+ type: "number",
419
+ value: c,
420
+ placeholder: d,
421
+ "aria-describedby": f,
422
+ "aria-invalid": l,
423
+ disabled: z,
424
+ variant: u,
425
+ onChange: (t) => {
426
+ J(e.id, t.target.value);
427
+ },
428
+ fullWidth: !0
429
+ })
430
+ }, e.id);
431
+ }
432
+ case "json": {
433
+ let r = F[e.id], c = "";
434
+ typeof r == "string" && (c = r);
435
+ let d;
436
+ return e.placeholder != null && (d = C(e.placeholder, k)), /* @__PURE__ */ h(S, {
437
+ label: t,
438
+ labelFor: i,
461
439
  required: e.required,
462
- children: t
463
- }),
464
- n != null && /* @__PURE__ */ g("span", {
465
- id: a,
466
- className: "txvbqb96 txvbqb1bff",
467
- children: n
468
- }),
469
- /* @__PURE__ */ g(S, {
470
- id: i,
471
- value: c,
472
- placeholder: l,
473
- rows: 8,
474
- "aria-describedby": p,
475
- "aria-invalid": u,
476
- disabled: V,
477
- variant: d,
478
- onChange: (t) => {
479
- Y(e.id, t.target.value);
480
- },
481
- fullWidth: !0
482
- }),
483
- s != null && /* @__PURE__ */ g("span", {
484
- id: o,
485
- className: "txvbqb96 txvbqb1bij",
486
- children: s
487
- })
488
- ] }, e.id);
489
- }
490
- case "enum": {
491
- let r = L[e.id], c = "";
492
- typeof r == "string" && (c = r);
493
- let l = e.options.map((e) => ({
494
- id: e.value,
495
- value: e.value,
496
- label: T(e.label, j)
497
- }));
498
- return /* @__PURE__ */ _(w, { children: [
499
- /* @__PURE__ */ g(x, {
500
- id: `${i}-label`,
440
+ description: n,
441
+ descriptionId: a,
442
+ error: s,
443
+ errorId: o,
444
+ children: /* @__PURE__ */ h(b, {
445
+ id: i,
446
+ value: c,
447
+ placeholder: d,
448
+ rows: 8,
449
+ "aria-describedby": f,
450
+ "aria-invalid": l,
451
+ disabled: z,
452
+ variant: u,
453
+ onChange: (t) => {
454
+ J(e.id, t.target.value);
455
+ },
456
+ fullWidth: !0
457
+ })
458
+ }, e.id);
459
+ }
460
+ case "enum": {
461
+ let r = F[e.id], c = "";
462
+ typeof r == "string" && (c = r);
463
+ let u = e.options.map((e) => ({
464
+ id: e.value,
465
+ value: e.value,
466
+ label: C(e.label, k)
467
+ }));
468
+ return /* @__PURE__ */ h(S, {
469
+ label: t,
470
+ labelId: `${i}-label`,
501
471
  required: e.required,
502
- children: t
503
- }),
504
- n != null && /* @__PURE__ */ g("span", {
505
- id: a,
506
- className: "txvbqb96 txvbqb1bff",
507
- children: n
508
- }),
509
- /* @__PURE__ */ g(ue, {
510
- options: l,
511
- value: c,
512
- placeholder: t,
513
- ariaDescribedBy: p,
514
- ariaInvalid: u,
515
- ariaLabelledBy: `${i}-label`,
516
- isDisabled: V,
517
- state: f,
472
+ description: n,
473
+ descriptionId: a,
474
+ error: s,
475
+ errorId: o,
476
+ children: /* @__PURE__ */ h(ue, {
477
+ options: u,
478
+ value: c,
479
+ placeholder: t,
480
+ ariaDescribedBy: f,
481
+ ariaInvalid: l,
482
+ ariaLabelledBy: `${i}-label`,
483
+ isDisabled: z,
484
+ state: d,
485
+ onChange: (t) => {
486
+ J(e.id, t);
487
+ }
488
+ })
489
+ }, e.id);
490
+ }
491
+ case "boolean": {
492
+ let r = F[e.id] === !0;
493
+ return /* @__PURE__ */ h(S, { children: /* @__PURE__ */ h(x, {
494
+ id: i,
495
+ label: t,
496
+ helperText: n ?? void 0,
497
+ error: s ?? void 0,
498
+ checked: r,
499
+ disabled: z,
518
500
  onChange: (t) => {
519
- Y(e.id, t);
501
+ J(e.id, t.target.checked);
520
502
  }
521
- }),
522
- s != null && /* @__PURE__ */ g("span", {
523
- id: o,
524
- className: "txvbqb96 txvbqb1bij",
525
- children: s
526
- })
527
- ] }, e.id);
528
- }
529
- case "boolean": {
530
- let r = L[e.id] === !0;
531
- return /* @__PURE__ */ g(w, { children: /* @__PURE__ */ g(C, {
532
- id: i,
533
- label: t,
534
- helperText: n ?? void 0,
535
- error: s ?? void 0,
536
- checked: r,
537
- disabled: V,
538
- onChange: (t) => {
539
- Y(e.id, t.target.checked);
540
- }
541
- }) }, e.id);
542
- }
543
- case "entityId": {
544
- let c = L[e.id], l = "";
545
- return typeof c == "string" && (l = c), /* @__PURE__ */ _(w, { children: [
546
- /* @__PURE__ */ g(x, {
547
- htmlFor: i,
503
+ }) }, e.id);
504
+ }
505
+ case "entityId": {
506
+ let c = F[e.id], u = "";
507
+ return typeof c == "string" && (u = c), /* @__PURE__ */ h(S, {
508
+ label: t,
509
+ labelFor: i,
548
510
  required: e.required,
549
- children: t
550
- }),
551
- n != null && /* @__PURE__ */ g("span", {
552
- id: a,
553
- className: "txvbqb96 txvbqb1bff",
554
- children: n
555
- }),
556
- /* @__PURE__ */ g(r, {
557
- id: i,
511
+ description: n,
512
+ descriptionId: a,
513
+ error: s,
514
+ errorId: o,
515
+ children: /* @__PURE__ */ h(r, {
516
+ id: i,
517
+ label: t,
518
+ value: u,
519
+ ariaDescribedBy: f,
520
+ ariaInvalid: l,
521
+ disabled: z,
522
+ onPick: () => {
523
+ K({
524
+ fieldId: e.id,
525
+ entity: e.entity,
526
+ label: t
527
+ });
528
+ },
529
+ onClear: () => {
530
+ J(e.id, "");
531
+ }
532
+ })
533
+ }, e.id);
534
+ }
535
+ case "multiEnum": {
536
+ let r = F[e.id], u = `${i}-legend`, d = [];
537
+ return Array.isArray(r) && (d = r.filter((e) => typeof e == "string")), /* @__PURE__ */ h(S, {
538
+ as: "fieldset",
558
539
  label: t,
559
- value: l,
560
- ariaDescribedBy: p,
561
- ariaInvalid: u,
562
- disabled: V,
563
- onPick: () => {
564
- J({
565
- fieldId: e.id,
566
- entity: e.entity,
567
- label: t
568
- });
569
- },
570
- onClear: () => {
571
- Y(e.id, "");
572
- }
573
- }),
574
- s != null && /* @__PURE__ */ g("span", {
575
- id: o,
576
- className: "txvbqb96 txvbqb1bij",
577
- children: s
578
- })
579
- ] }, e.id);
580
- }
581
- case "multiEnum": {
582
- let r = L[e.id], d = `${i}-legend`, f = [];
583
- return Array.isArray(r) && (f = r.filter((e) => typeof e == "string")), /* @__PURE__ */ _(w, { children: [/* @__PURE__ */ _("fieldset", {
584
- className: l,
585
- children: [
586
- /* @__PURE__ */ _("legend", {
587
- id: d,
588
- className: ee,
589
- children: [t, e.required && /* @__PURE__ */ g("span", {
590
- className: "txvbqbq3e txvbqb1bij",
591
- children: "*"
592
- })]
593
- }),
594
- n != null && /* @__PURE__ */ g("span", {
595
- id: a,
596
- className: "txvbqb96 txvbqb1bff",
597
- children: n
598
- }),
599
- /* @__PURE__ */ g("div", {
540
+ labelId: u,
541
+ required: e.required,
542
+ description: n,
543
+ descriptionId: a,
544
+ error: s,
545
+ errorId: o,
546
+ children: /* @__PURE__ */ h("div", {
600
547
  className: c,
601
548
  role: "group",
602
- "aria-labelledby": d,
603
- "aria-describedby": p,
604
- "aria-invalid": u,
549
+ "aria-labelledby": u,
550
+ "aria-describedby": f,
551
+ "aria-invalid": l,
605
552
  children: e.options.map((t, n) => {
606
- let r = T(t.label, j), a = f.includes(t.value);
607
- return /* @__PURE__ */ g(C, {
553
+ let r = C(t.label, k), a = d.includes(t.value);
554
+ return /* @__PURE__ */ h(x, {
608
555
  id: `${i}-${n}`,
609
556
  label: r,
610
557
  checked: a,
611
- disabled: V,
558
+ disabled: z,
612
559
  onChange: (n) => {
613
- let r = f;
614
- n.target.checked ? f.includes(t.value) || (r = [...f, t.value]) : r = f.filter((e) => e !== t.value), Y(e.id, r);
560
+ let r = d;
561
+ n.target.checked ? d.includes(t.value) || (r = [...d, t.value]) : r = d.filter((e) => e !== t.value), J(e.id, r);
615
562
  }
616
563
  }, `${t.value}-${n}`);
617
564
  })
618
565
  })
619
- ]
620
- }), s != null && /* @__PURE__ */ g("span", {
621
- id: o,
622
- className: "txvbqb96 txvbqb1bij",
623
- children: s
624
- })] }, e.id);
566
+ }, e.id);
567
+ }
568
+ default: return null;
625
569
  }
626
- default: return null;
627
- }
570
+ })
628
571
  }) }),
629
- $ && /* @__PURE__ */ _("div", {
572
+ $ && /* @__PURE__ */ g("div", {
630
573
  className: "txvbqbfpn txvbqbh4x txvbqbhdl",
631
- children: [U != null && Q != null && /* @__PURE__ */ g(se, {
574
+ children: [V != null && Q != null && /* @__PURE__ */ h(se, {
632
575
  badgeLabel: Q,
633
- copyCode: U,
634
- fallbackCodeText: U
635
- }), De]
576
+ copyCode: V,
577
+ fallbackCodeText: V
578
+ }), Te]
636
579
  })
637
580
  ]
638
581
  })
639
- }), /* @__PURE__ */ g(i, {
640
- isOpen: q != null,
641
- entity: q?.entity ?? "",
642
- title: q?.label ?? "",
582
+ }), /* @__PURE__ */ h(i, {
583
+ isOpen: G != null,
584
+ entity: G?.entity ?? "",
585
+ title: G?.label ?? "",
643
586
  onClose: () => {
644
- J(null);
587
+ K(null);
645
588
  },
646
589
  onSelectId: (e) => {
647
- q != null && (Y(q.fieldId, e), J(null));
590
+ G != null && (J(G.fieldId, e), K(null));
648
591
  }
649
592
  })] }) : null;
650
593
  };
651
594
  //#endregion
652
- export { k as BackofficeEntityActionFormDialog, k as default };
595
+ export { D as BackofficeEntityActionFormDialog, D as default };
653
596
 
654
597
  //# sourceMappingURL=BackofficeEntityActionFormDialog.js.map