@plumile/backoffice-react 0.1.184 → 0.1.187
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.
- package/lib/esm/auth/authRefreshNotice.css.js +1 -0
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +156 -154
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationLink.css.js +1 -0
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +0 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +0 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts +2 -2
- package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +1 -1
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -8,27 +8,27 @@ import { actions as s, checkboxGroup as c, fieldset as l, form as u, legend as e
|
|
|
8
8
|
import { useCallback as d, useContext as f, useEffect as p, useId as te, useMemo as m, useState as h } from "react";
|
|
9
9
|
import { Fragment as ne, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
10
|
import { useTranslation as re } from "react-i18next";
|
|
11
|
-
import { Button as
|
|
12
|
-
import { FormError as
|
|
13
|
-
import { Form as
|
|
14
|
-
import * as
|
|
15
|
-
import { Input as
|
|
16
|
-
import { Label as
|
|
17
|
-
import { Modal as
|
|
18
|
-
import { Textarea as
|
|
19
|
-
import { CheckboxField as
|
|
20
|
-
import { FormGroup as
|
|
21
|
-
import { HighlightCode as
|
|
22
|
-
import { useToast as
|
|
23
|
-
import { BackofficeFormSection as
|
|
24
|
-
import { SimpleSelect as
|
|
25
|
-
import
|
|
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";
|
|
21
|
+
import { HighlightCode as se } from "@plumile/ui/atomic/molecules/highlight/HighlightCode.js";
|
|
22
|
+
import { useToast as ce } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
|
|
23
|
+
import { BackofficeFormSection as le } from "@plumile/ui/backoffice/molecules/backoffice_form_section/BackofficeFormSection.js";
|
|
24
|
+
import { SimpleSelect as ue } from "@plumile/ui/components/select/SimpleSelect.js";
|
|
25
|
+
import de from "@plumile/router/routing/RoutingContext.js";
|
|
26
26
|
//#region src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx
|
|
27
|
-
var { commitMutation:
|
|
28
|
-
if (!
|
|
29
|
-
for (let t of Object.values(e)) if (
|
|
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;
|
|
30
30
|
return null;
|
|
31
|
-
},
|
|
31
|
+
}, D = (e) => {
|
|
32
32
|
let t = {};
|
|
33
33
|
return e.forEach((e) => {
|
|
34
34
|
if (e.kind === "boolean") {
|
|
@@ -45,37 +45,39 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
45
45
|
}
|
|
46
46
|
t[e.id] = "";
|
|
47
47
|
}), t;
|
|
48
|
-
},
|
|
49
|
-
let n =
|
|
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);
|
|
50
50
|
if (e.getInitialValues == null) return n;
|
|
51
|
-
let r = e.getInitialValues(t)
|
|
51
|
+
let r = e.getInitialValues(t);
|
|
52
|
+
if (!E(r)) return n;
|
|
53
|
+
let i = { ...n };
|
|
52
54
|
return e.fields.forEach((e) => {
|
|
53
|
-
e.id in r && (i[e.id] =
|
|
55
|
+
e.id in r && (i[e.id] = O(e, r[e.id]));
|
|
54
56
|
}), i;
|
|
55
|
-
},
|
|
56
|
-
let { t:
|
|
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);
|
|
57
59
|
p(() => {
|
|
58
|
-
|
|
60
|
+
y && (R(he(D, O)), z(null), B({}), W(null), K(null));
|
|
59
61
|
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
D,
|
|
63
|
+
y,
|
|
64
|
+
O
|
|
63
65
|
]);
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
|
|
66
|
+
let ye = d(() => {
|
|
67
|
+
V || k();
|
|
68
|
+
}, [V, k]), Y = d((e, t) => {
|
|
69
|
+
R((n) => ({
|
|
68
70
|
...n,
|
|
69
71
|
[e]: t
|
|
70
|
-
})),
|
|
72
|
+
})), B((t) => {
|
|
71
73
|
if (t[e] == null) return t;
|
|
72
74
|
let { [e]: n, ...r } = t;
|
|
73
75
|
return r;
|
|
74
76
|
});
|
|
75
|
-
}, []), be =
|
|
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(() => {
|
|
76
78
|
let e = {};
|
|
77
|
-
for (let t of
|
|
78
|
-
let n =
|
|
79
|
+
for (let t of D.fields) {
|
|
80
|
+
let n = T(t.label, j), r = L[t.id];
|
|
79
81
|
switch (t.kind) {
|
|
80
82
|
case "text": {
|
|
81
83
|
let i = "";
|
|
@@ -137,7 +139,7 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
137
139
|
};
|
|
138
140
|
}
|
|
139
141
|
let o = t.jsonType ?? "object";
|
|
140
|
-
if (o === "object" && !
|
|
142
|
+
if (o === "object" && !E(a)) return {
|
|
141
143
|
error: Ce(n),
|
|
142
144
|
fieldId: t.id
|
|
143
145
|
};
|
|
@@ -192,161 +194,161 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
192
194
|
}
|
|
193
195
|
return { values: e };
|
|
194
196
|
}, [
|
|
195
|
-
|
|
197
|
+
D.fields,
|
|
196
198
|
we,
|
|
197
199
|
Se,
|
|
198
200
|
Ce,
|
|
199
201
|
xe,
|
|
200
202
|
X,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
+
j,
|
|
204
|
+
L
|
|
203
205
|
]), Z = d(() => {
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
+
if (V) return;
|
|
207
|
+
z(null), B({});
|
|
206
208
|
let e = Te();
|
|
207
209
|
if ("error" in e) {
|
|
208
|
-
|
|
210
|
+
z(e.error), e.fieldId != null && B({ [e.fieldId]: e.error });
|
|
209
211
|
return;
|
|
210
212
|
}
|
|
211
213
|
let n;
|
|
212
214
|
try {
|
|
213
|
-
n =
|
|
215
|
+
n = D.getVariables(O, e.values);
|
|
214
216
|
} catch {
|
|
215
|
-
|
|
217
|
+
z(M("actions.form.errors.invalidPayload"));
|
|
216
218
|
return;
|
|
217
219
|
}
|
|
218
|
-
|
|
219
|
-
mutation:
|
|
220
|
+
H(!0), fe(F, {
|
|
221
|
+
mutation: D.mutation,
|
|
220
222
|
variables: n,
|
|
221
223
|
updater: (e) => {
|
|
222
|
-
|
|
224
|
+
D.updater?.(e, O);
|
|
223
225
|
},
|
|
224
226
|
onCompleted: (e) => {
|
|
225
|
-
|
|
226
|
-
let n =
|
|
227
|
+
H(!1);
|
|
228
|
+
let n = me(e);
|
|
227
229
|
if (n != null) {
|
|
228
|
-
let e =
|
|
229
|
-
|
|
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
232
|
let r = t(n, {
|
|
231
233
|
defaultErrorMessage: e,
|
|
232
234
|
mapReason: (e) => {
|
|
233
|
-
let t =
|
|
234
|
-
return t == null ? null : typeof t == "function" ?
|
|
235
|
+
let t = D.mapErrorReason?.(e, O);
|
|
236
|
+
return t == null ? null : typeof t == "function" ? T(t, j) : String(t);
|
|
235
237
|
}
|
|
236
238
|
});
|
|
237
239
|
if (!r.ok) {
|
|
238
240
|
let e = Error(r.message);
|
|
239
|
-
if (
|
|
240
|
-
let e =
|
|
241
|
-
|
|
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);
|
|
242
244
|
}
|
|
243
245
|
return;
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
|
-
|
|
248
|
+
D.onCompleted?.(e, O);
|
|
247
249
|
let r = !1;
|
|
248
|
-
if (
|
|
249
|
-
let t = a(
|
|
250
|
-
toast:
|
|
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,
|
|
251
253
|
response: e,
|
|
252
|
-
node:
|
|
253
|
-
tApp:
|
|
254
|
-
entities:
|
|
255
|
-
defaultLabel:
|
|
254
|
+
node: O,
|
|
255
|
+
tApp: j,
|
|
256
|
+
entities: N,
|
|
257
|
+
defaultLabel: M("actions.view"),
|
|
256
258
|
navigateTo: (e) => {
|
|
257
|
-
|
|
259
|
+
P?.history.push({ pathname: e });
|
|
258
260
|
}
|
|
259
261
|
});
|
|
260
|
-
|
|
262
|
+
I.push({
|
|
261
263
|
kind: "info",
|
|
262
264
|
title: t.title,
|
|
263
265
|
message: t.message,
|
|
264
266
|
actions: n
|
|
265
267
|
});
|
|
266
268
|
}
|
|
267
|
-
if (
|
|
268
|
-
let t =
|
|
269
|
+
if (D.result != null) {
|
|
270
|
+
let t = D.result.getValue(e, O);
|
|
269
271
|
if (typeof t == "string" && t.trim() !== "") {
|
|
270
|
-
|
|
272
|
+
W(t), A?.();
|
|
271
273
|
return;
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
if (r) {
|
|
275
|
-
|
|
277
|
+
A?.();
|
|
276
278
|
return;
|
|
277
279
|
}
|
|
278
|
-
|
|
280
|
+
A?.(), k();
|
|
279
281
|
},
|
|
280
282
|
onError: (e) => {
|
|
281
|
-
if (
|
|
282
|
-
let e =
|
|
283
|
-
|
|
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);
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
});
|
|
287
289
|
}, [
|
|
288
|
-
E,
|
|
289
|
-
Te,
|
|
290
|
-
M,
|
|
291
|
-
P,
|
|
292
|
-
B,
|
|
293
290
|
D,
|
|
291
|
+
Te,
|
|
292
|
+
N,
|
|
293
|
+
F,
|
|
294
|
+
V,
|
|
294
295
|
O,
|
|
295
296
|
k,
|
|
296
|
-
N?.history,
|
|
297
|
-
j,
|
|
298
297
|
A,
|
|
299
|
-
|
|
298
|
+
P?.history,
|
|
299
|
+
M,
|
|
300
|
+
j,
|
|
301
|
+
I
|
|
300
302
|
]), Ee = d((e) => {
|
|
301
303
|
e.preventDefault(), Z();
|
|
302
|
-
}, [Z]), Q = m(() =>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
]), $ =
|
|
307
|
-
return
|
|
308
|
-
isOpen:
|
|
309
|
-
onClose:
|
|
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,
|
|
310
312
|
title: be,
|
|
311
313
|
initialFocus: "first-form-control",
|
|
312
314
|
footer: /* @__PURE__ */ _("div", {
|
|
313
315
|
className: s,
|
|
314
|
-
children: [/* @__PURE__ */ g(
|
|
316
|
+
children: [/* @__PURE__ */ g(v, {
|
|
315
317
|
type: "button",
|
|
316
318
|
variant: "secondary",
|
|
317
319
|
size: "small",
|
|
318
|
-
disabled:
|
|
319
|
-
onClick:
|
|
320
|
-
children:
|
|
321
|
-
}), !$ && /* @__PURE__ */ g(
|
|
320
|
+
disabled: V,
|
|
321
|
+
onClick: ye,
|
|
322
|
+
children: M("actions.form.cancel")
|
|
323
|
+
}), !$ && /* @__PURE__ */ g(v, {
|
|
322
324
|
type: "submit",
|
|
323
325
|
variant: "primary",
|
|
324
326
|
size: "small",
|
|
325
|
-
disabled:
|
|
326
|
-
isLoading:
|
|
327
|
-
loadingLabel:
|
|
327
|
+
disabled: V,
|
|
328
|
+
isLoading: V,
|
|
329
|
+
loadingLabel: M("actions.form.submitting"),
|
|
328
330
|
onClick: Z,
|
|
329
331
|
children: Oe
|
|
330
332
|
})]
|
|
331
333
|
}),
|
|
332
|
-
children: /* @__PURE__ */ _(
|
|
334
|
+
children: /* @__PURE__ */ _(ae, {
|
|
333
335
|
onSubmit: Ee,
|
|
334
336
|
className: u,
|
|
335
337
|
children: [
|
|
336
|
-
/* @__PURE__ */ g(
|
|
337
|
-
/* @__PURE__ */ g(
|
|
338
|
-
let t =
|
|
339
|
-
e.description != null && (n =
|
|
340
|
-
let i = `${
|
|
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";
|
|
341
343
|
u && (d = "error", f = "error");
|
|
342
344
|
let p;
|
|
343
345
|
switch (n != null && s != null ? p = `${a} ${o}` : n == null ? s != null && (p = o) : p = a, e.kind) {
|
|
344
346
|
case "text": {
|
|
345
|
-
let r =
|
|
347
|
+
let r = L[e.id], c = "";
|
|
346
348
|
typeof r == "string" && (c = r);
|
|
347
349
|
let l;
|
|
348
|
-
return e.placeholder != null && (l =
|
|
349
|
-
/* @__PURE__ */ g(
|
|
350
|
+
return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
|
|
351
|
+
/* @__PURE__ */ g(x, {
|
|
350
352
|
htmlFor: i,
|
|
351
353
|
required: e.required,
|
|
352
354
|
children: t
|
|
@@ -356,14 +358,14 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
356
358
|
className: "txvbqb96 txvbqb1bff",
|
|
357
359
|
children: n
|
|
358
360
|
}),
|
|
359
|
-
/* @__PURE__ */ g(
|
|
361
|
+
/* @__PURE__ */ g(b, {
|
|
360
362
|
id: i,
|
|
361
363
|
type: "text",
|
|
362
364
|
value: c,
|
|
363
365
|
placeholder: l,
|
|
364
366
|
"aria-describedby": p,
|
|
365
367
|
"aria-invalid": u,
|
|
366
|
-
disabled:
|
|
368
|
+
disabled: V,
|
|
367
369
|
variant: d,
|
|
368
370
|
onChange: (t) => {
|
|
369
371
|
Y(e.id, t.target.value);
|
|
@@ -378,11 +380,11 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
378
380
|
] }, e.id);
|
|
379
381
|
}
|
|
380
382
|
case "textarea": {
|
|
381
|
-
let r =
|
|
383
|
+
let r = L[e.id], c = "";
|
|
382
384
|
typeof r == "string" && (c = r);
|
|
383
385
|
let l;
|
|
384
|
-
return e.placeholder != null && (l =
|
|
385
|
-
/* @__PURE__ */ g(
|
|
386
|
+
return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
|
|
387
|
+
/* @__PURE__ */ g(x, {
|
|
386
388
|
htmlFor: i,
|
|
387
389
|
required: e.required,
|
|
388
390
|
children: t
|
|
@@ -392,14 +394,14 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
392
394
|
className: "txvbqb96 txvbqb1bff",
|
|
393
395
|
children: n
|
|
394
396
|
}),
|
|
395
|
-
/* @__PURE__ */ g(
|
|
397
|
+
/* @__PURE__ */ g(S, {
|
|
396
398
|
id: i,
|
|
397
399
|
value: c,
|
|
398
400
|
placeholder: l,
|
|
399
401
|
rows: e.rows ?? 8,
|
|
400
402
|
"aria-describedby": p,
|
|
401
403
|
"aria-invalid": u,
|
|
402
|
-
disabled:
|
|
404
|
+
disabled: V,
|
|
403
405
|
variant: d,
|
|
404
406
|
onChange: (t) => {
|
|
405
407
|
Y(e.id, t.target.value);
|
|
@@ -414,11 +416,11 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
414
416
|
] }, e.id);
|
|
415
417
|
}
|
|
416
418
|
case "number": {
|
|
417
|
-
let r =
|
|
419
|
+
let r = L[e.id], c = "";
|
|
418
420
|
typeof r == "string" && (c = r);
|
|
419
421
|
let l;
|
|
420
|
-
return e.placeholder != null && (l =
|
|
421
|
-
/* @__PURE__ */ g(
|
|
422
|
+
return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
|
|
423
|
+
/* @__PURE__ */ g(x, {
|
|
422
424
|
htmlFor: i,
|
|
423
425
|
required: e.required,
|
|
424
426
|
children: t
|
|
@@ -428,14 +430,14 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
428
430
|
className: "txvbqb96 txvbqb1bff",
|
|
429
431
|
children: n
|
|
430
432
|
}),
|
|
431
|
-
/* @__PURE__ */ g(
|
|
433
|
+
/* @__PURE__ */ g(b, {
|
|
432
434
|
id: i,
|
|
433
435
|
type: "number",
|
|
434
436
|
value: c,
|
|
435
437
|
placeholder: l,
|
|
436
438
|
"aria-describedby": p,
|
|
437
439
|
"aria-invalid": u,
|
|
438
|
-
disabled:
|
|
440
|
+
disabled: V,
|
|
439
441
|
variant: d,
|
|
440
442
|
onChange: (t) => {
|
|
441
443
|
Y(e.id, t.target.value);
|
|
@@ -450,11 +452,11 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
450
452
|
] }, e.id);
|
|
451
453
|
}
|
|
452
454
|
case "json": {
|
|
453
|
-
let r =
|
|
455
|
+
let r = L[e.id], c = "";
|
|
454
456
|
typeof r == "string" && (c = r);
|
|
455
457
|
let l;
|
|
456
|
-
return e.placeholder != null && (l =
|
|
457
|
-
/* @__PURE__ */ g(
|
|
458
|
+
return e.placeholder != null && (l = T(e.placeholder, j)), /* @__PURE__ */ _(w, { children: [
|
|
459
|
+
/* @__PURE__ */ g(x, {
|
|
458
460
|
htmlFor: i,
|
|
459
461
|
required: e.required,
|
|
460
462
|
children: t
|
|
@@ -464,14 +466,14 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
464
466
|
className: "txvbqb96 txvbqb1bff",
|
|
465
467
|
children: n
|
|
466
468
|
}),
|
|
467
|
-
/* @__PURE__ */ g(
|
|
469
|
+
/* @__PURE__ */ g(S, {
|
|
468
470
|
id: i,
|
|
469
471
|
value: c,
|
|
470
472
|
placeholder: l,
|
|
471
473
|
rows: 8,
|
|
472
474
|
"aria-describedby": p,
|
|
473
475
|
"aria-invalid": u,
|
|
474
|
-
disabled:
|
|
476
|
+
disabled: V,
|
|
475
477
|
variant: d,
|
|
476
478
|
onChange: (t) => {
|
|
477
479
|
Y(e.id, t.target.value);
|
|
@@ -486,15 +488,15 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
486
488
|
] }, e.id);
|
|
487
489
|
}
|
|
488
490
|
case "enum": {
|
|
489
|
-
let r =
|
|
491
|
+
let r = L[e.id], c = "";
|
|
490
492
|
typeof r == "string" && (c = r);
|
|
491
493
|
let l = e.options.map((e) => ({
|
|
492
494
|
id: e.value,
|
|
493
495
|
value: e.value,
|
|
494
|
-
label:
|
|
496
|
+
label: T(e.label, j)
|
|
495
497
|
}));
|
|
496
|
-
return /* @__PURE__ */ _(
|
|
497
|
-
/* @__PURE__ */ g(
|
|
498
|
+
return /* @__PURE__ */ _(w, { children: [
|
|
499
|
+
/* @__PURE__ */ g(x, {
|
|
498
500
|
id: `${i}-label`,
|
|
499
501
|
required: e.required,
|
|
500
502
|
children: t
|
|
@@ -504,14 +506,14 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
504
506
|
className: "txvbqb96 txvbqb1bff",
|
|
505
507
|
children: n
|
|
506
508
|
}),
|
|
507
|
-
/* @__PURE__ */ g(
|
|
509
|
+
/* @__PURE__ */ g(ue, {
|
|
508
510
|
options: l,
|
|
509
511
|
value: c,
|
|
510
512
|
placeholder: t,
|
|
511
513
|
ariaDescribedBy: p,
|
|
512
514
|
ariaInvalid: u,
|
|
513
515
|
ariaLabelledBy: `${i}-label`,
|
|
514
|
-
isDisabled:
|
|
516
|
+
isDisabled: V,
|
|
515
517
|
state: f,
|
|
516
518
|
onChange: (t) => {
|
|
517
519
|
Y(e.id, t);
|
|
@@ -525,23 +527,23 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
525
527
|
] }, e.id);
|
|
526
528
|
}
|
|
527
529
|
case "boolean": {
|
|
528
|
-
let r =
|
|
529
|
-
return /* @__PURE__ */ g(
|
|
530
|
+
let r = L[e.id] === !0;
|
|
531
|
+
return /* @__PURE__ */ g(w, { children: /* @__PURE__ */ g(C, {
|
|
530
532
|
id: i,
|
|
531
533
|
label: t,
|
|
532
534
|
helperText: n ?? void 0,
|
|
533
535
|
error: s ?? void 0,
|
|
534
536
|
checked: r,
|
|
535
|
-
disabled:
|
|
537
|
+
disabled: V,
|
|
536
538
|
onChange: (t) => {
|
|
537
539
|
Y(e.id, t.target.checked);
|
|
538
540
|
}
|
|
539
541
|
}) }, e.id);
|
|
540
542
|
}
|
|
541
543
|
case "entityId": {
|
|
542
|
-
let c =
|
|
543
|
-
return typeof c == "string" && (l = c), /* @__PURE__ */ _(
|
|
544
|
-
/* @__PURE__ */ g(
|
|
544
|
+
let c = L[e.id], l = "";
|
|
545
|
+
return typeof c == "string" && (l = c), /* @__PURE__ */ _(w, { children: [
|
|
546
|
+
/* @__PURE__ */ g(x, {
|
|
545
547
|
htmlFor: i,
|
|
546
548
|
required: e.required,
|
|
547
549
|
children: t
|
|
@@ -557,9 +559,9 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
557
559
|
value: l,
|
|
558
560
|
ariaDescribedBy: p,
|
|
559
561
|
ariaInvalid: u,
|
|
560
|
-
disabled:
|
|
562
|
+
disabled: V,
|
|
561
563
|
onPick: () => {
|
|
562
|
-
|
|
564
|
+
J({
|
|
563
565
|
fieldId: e.id,
|
|
564
566
|
entity: e.entity,
|
|
565
567
|
label: t
|
|
@@ -577,8 +579,8 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
577
579
|
] }, e.id);
|
|
578
580
|
}
|
|
579
581
|
case "multiEnum": {
|
|
580
|
-
let r =
|
|
581
|
-
return Array.isArray(r) && (f = r.filter((e) => typeof e == "string")), /* @__PURE__ */ _(
|
|
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", {
|
|
582
584
|
className: l,
|
|
583
585
|
children: [
|
|
584
586
|
/* @__PURE__ */ _("legend", {
|
|
@@ -601,12 +603,12 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
601
603
|
"aria-describedby": p,
|
|
602
604
|
"aria-invalid": u,
|
|
603
605
|
children: e.options.map((t, n) => {
|
|
604
|
-
let r =
|
|
605
|
-
return /* @__PURE__ */ g(
|
|
606
|
+
let r = T(t.label, j), a = f.includes(t.value);
|
|
607
|
+
return /* @__PURE__ */ g(C, {
|
|
606
608
|
id: `${i}-${n}`,
|
|
607
609
|
label: r,
|
|
608
610
|
checked: a,
|
|
609
|
-
disabled:
|
|
611
|
+
disabled: V,
|
|
610
612
|
onChange: (n) => {
|
|
611
613
|
let r = f;
|
|
612
614
|
n.target.checked ? f.includes(t.value) || (r = [...f, t.value]) : r = f.filter((e) => e !== t.value), Y(e.id, r);
|
|
@@ -626,27 +628,27 @@ var { commitMutation: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T =
|
|
|
626
628
|
}) }),
|
|
627
629
|
$ && /* @__PURE__ */ _("div", {
|
|
628
630
|
className: "txvbqbfpn txvbqbh4x txvbqbhdl",
|
|
629
|
-
children: [
|
|
631
|
+
children: [U != null && Q != null && /* @__PURE__ */ g(se, {
|
|
630
632
|
badgeLabel: Q,
|
|
631
|
-
copyCode:
|
|
632
|
-
fallbackCodeText:
|
|
633
|
+
copyCode: U,
|
|
634
|
+
fallbackCodeText: U
|
|
633
635
|
}), De]
|
|
634
636
|
})
|
|
635
637
|
]
|
|
636
638
|
})
|
|
637
639
|
}), /* @__PURE__ */ g(i, {
|
|
638
|
-
isOpen:
|
|
639
|
-
entity:
|
|
640
|
-
title:
|
|
640
|
+
isOpen: q != null,
|
|
641
|
+
entity: q?.entity ?? "",
|
|
642
|
+
title: q?.label ?? "",
|
|
641
643
|
onClose: () => {
|
|
642
|
-
|
|
644
|
+
J(null);
|
|
643
645
|
},
|
|
644
646
|
onSelectId: (e) => {
|
|
645
|
-
|
|
647
|
+
q != null && (Y(q.fieldId, e), J(null));
|
|
646
648
|
}
|
|
647
649
|
})] }) : null;
|
|
648
650
|
};
|
|
649
651
|
//#endregion
|
|
650
|
-
export {
|
|
652
|
+
export { k as BackofficeEntityActionFormDialog, k as default };
|
|
651
653
|
|
|
652
654
|
//# sourceMappingURL=BackofficeEntityActionFormDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityActionFormDialog.js","names":[],"sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"sourcesContent":["import {\n type FormEvent,\n type JSX,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport type { TFunction } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport * as ReactRelay from 'react-relay';\nimport {\n type MutationPayloadBase,\n resolveMutationOutcome,\n} from '../../../relay/mutationResult.js';\nimport { Button } from '@plumile/ui/atomic/atoms/button/Button.js';\nimport { Input } from '@plumile/ui/atomic/atoms/input/Input.js';\nimport { Label } from '@plumile/ui/atomic/atoms/label/Label.js';\nimport { Modal } from '@plumile/ui/atomic/atoms/modal/Modal.js';\nimport { Textarea } from '@plumile/ui/atomic/atoms/textarea/Textarea.js';\nimport { CheckboxField } from '@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js';\nimport { Form } from '@plumile/ui/atomic/molecules/form/Form.js';\nimport { FormError } from '@plumile/ui/atomic/molecules/form_error/FormError.js';\nimport { FormGroup } from '@plumile/ui/atomic/molecules/form/FormGroup.js';\nimport { HighlightCode } from '@plumile/ui/atomic/molecules/highlight/HighlightCode.js';\nimport { useToast } from '@plumile/ui/atomic/molecules/toast/ToastProvider.js';\nimport { BackofficeFormSection } from '@plumile/ui/backoffice/molecules/backoffice_form_section/BackofficeFormSection.js';\nimport { SimpleSelect } from '@plumile/ui/components/select/SimpleSelect.js';\nimport type {\n BackofficeEntityActionFormFieldSpec,\n BackofficeEntityFormMutationActionSpec,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../../../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../../../provider/BackofficeConfigContext.js';\nimport { EntityIdFilterField } from '../filters/EntityIdFilterField.js';\nimport { EntityIdPickerDialog } from '../pickers/EntityIdPickerDialog.js';\nimport {\n resolveToastSpec,\n resolveToastViewActions,\n} from './toastViewAction.js';\n\nconst { commitMutation, useRelayEnvironment } = ReactRelay;\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\n\nimport * as styles from './backofficeEntityActionFormDialog.css.js';\n\nexport type BackofficeEntityActionFormDialogProps<Node> = {\n isOpen: boolean;\n action: BackofficeEntityFormMutationActionSpec<Node>;\n node: Node;\n onClose: () => void;\n onSuccess?: () => void;\n};\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === 'object' && value != null && !Array.isArray(value);\n};\n\nconst extractMutationPayload = (\n response: unknown,\n): MutationPayloadBase | null => {\n if (!isPlainObject(response)) {\n return null;\n }\n\n for (const value of Object.values(response)) {\n if (isPlainObject(value) && ('status' in value || 'result' in value)) {\n return value;\n }\n }\n\n return null;\n};\n\nconst buildDefaultValues = (\n fields: readonly BackofficeEntityActionFormFieldSpec[],\n): Record<string, unknown> => {\n const output: Record<string, unknown> = {};\n fields.forEach((field) => {\n if (field.kind === 'boolean') {\n output[field.id] = field.defaultValue ?? false;\n return;\n }\n if (field.kind === 'multiEnum') {\n output[field.id] = field.defaultValue ?? [];\n return;\n }\n if (field.defaultValue != null) {\n output[field.id] = field.defaultValue;\n return;\n }\n output[field.id] = '';\n });\n return output;\n};\n\nconst normalizeInitialValue = (\n field: BackofficeEntityActionFormFieldSpec,\n value: unknown,\n): unknown => {\n if (field.kind === 'number') {\n if (typeof value === 'number') {\n return String(value);\n }\n if (typeof value === 'string') {\n return value;\n }\n return '';\n }\n if (field.kind === 'multiEnum') {\n if (Array.isArray(value)) {\n return value.filter((entry): entry is string => {\n return typeof entry === 'string' && entry.trim() !== '';\n });\n }\n return [];\n }\n if (field.kind === 'boolean') {\n return value === true;\n }\n if (typeof value === 'string') {\n return value;\n }\n return value ?? '';\n};\n\nconst buildInitialValues = <Node,>(\n action: BackofficeEntityFormMutationActionSpec<Node>,\n node: Node,\n): Record<string, unknown> => {\n const defaults = buildDefaultValues(action.fields);\n if (action.getInitialValues == null) {\n return defaults;\n }\n const overrides = action.getInitialValues(node);\n const next: Record<string, unknown> = { ...defaults };\n action.fields.forEach((field) => {\n if (!(field.id in overrides)) {\n return;\n }\n next[field.id] = normalizeInitialValue(field, overrides[field.id]);\n });\n return next;\n};\n\nexport const BackofficeEntityActionFormDialog = <Node,>({\n isOpen,\n action,\n node,\n onClose,\n onSuccess,\n}: BackofficeEntityActionFormDialogProps<Node>): JSX.Element | null => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities } = useBackofficeConfig();\n const routing = useContext(RoutingContext);\n const environment = useRelayEnvironment();\n const toast = useToast();\n const formId = useId();\n\n const [values, setValues] = useState<Record<string, unknown>>({});\n const [formError, setFormError] = useState<string | null>(null);\n const [fieldErrors, setFieldErrors] = useState<Record<string, string>>({});\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [resultValue, setResultValue] = useState<string | null>(null);\n const [resultResponse, setResultResponse] = useState<unknown>(null);\n const [activeEntityPicker, setActiveEntityPicker] = useState<{\n fieldId: string;\n entity: string;\n label: string;\n } | null>(null);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n setValues(buildInitialValues(action, node));\n setFormError(null);\n setFieldErrors({});\n setResultValue(null);\n setResultResponse(null);\n }, [action, isOpen, node]);\n\n const handleClose = useCallback(() => {\n if (isSubmitting) {\n return;\n }\n onClose();\n }, [isSubmitting, onClose]);\n\n const setFieldValue = useCallback((fieldId: string, value: unknown) => {\n setValues((current) => {\n return { ...current, [fieldId]: value };\n });\n setFieldErrors((current) => {\n if (current[fieldId] == null) {\n return current;\n }\n const { [fieldId]: removedValue, ...next } = current;\n return next;\n });\n }, []);\n\n const title = resolveLabel(action.label, tApp);\n\n const resolveRequiredError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.required', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidNumberError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidNumber', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJson', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonObjectError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJsonObject', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonArrayError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJsonArray', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const buildPayload = useCallback(():\n | { values: Record<string, unknown> }\n | { error: string; fieldId?: string } => {\n const output: Record<string, unknown> = {};\n\n for (const field of action.fields) {\n const fieldLabel = resolveLabel(field.label, tApp);\n const rawValue = values[field.id];\n\n switch (field.kind) {\n case 'text': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'textarea': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'number': {\n let valueString = '';\n if (typeof rawValue === 'string') {\n valueString = rawValue.trim();\n } else if (\n typeof rawValue === 'number' &&\n Number.isFinite(rawValue)\n ) {\n valueString = String(rawValue);\n }\n if (valueString === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n const parsed = Number(valueString);\n if (!Number.isFinite(parsed)) {\n return {\n error: resolveInvalidNumberError(fieldLabel),\n fieldId: field.id,\n };\n }\n output[field.id] = parsed;\n break;\n }\n case 'json': {\n let valueString = '';\n if (typeof rawValue === 'string') {\n valueString = rawValue.trim();\n }\n if (valueString === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(valueString);\n } catch {\n return {\n error: resolveInvalidJsonError(fieldLabel),\n fieldId: field.id,\n };\n }\n\n const jsonType = field.jsonType ?? 'object';\n if (jsonType === 'object' && !isPlainObject(parsed)) {\n return {\n error: resolveInvalidJsonObjectError(fieldLabel),\n fieldId: field.id,\n };\n }\n if (jsonType === 'array' && !Array.isArray(parsed)) {\n return {\n error: resolveInvalidJsonArrayError(fieldLabel),\n fieldId: field.id,\n };\n }\n\n output[field.id] = parsed;\n break;\n }\n case 'enum': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'boolean': {\n output[field.id] = rawValue === true;\n break;\n }\n case 'entityId': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'multiEnum': {\n let list: string[] = [];\n if (Array.isArray(rawValue)) {\n list = rawValue.filter((entry): entry is string => {\n return typeof entry === 'string' && entry.trim() !== '';\n });\n }\n if (list.length === 0) {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = list;\n break;\n }\n default: {\n break;\n }\n }\n }\n\n return { values: output };\n }, [\n action.fields,\n resolveInvalidJsonArrayError,\n resolveInvalidJsonError,\n resolveInvalidJsonObjectError,\n resolveInvalidNumberError,\n resolveRequiredError,\n tApp,\n values,\n ]);\n\n const handleSubmit = useCallback(() => {\n if (isSubmitting) {\n return;\n }\n\n setFormError(null);\n setFieldErrors({});\n\n const payload = buildPayload();\n if ('error' in payload) {\n setFormError(payload.error);\n if (payload.fieldId != null) {\n setFieldErrors({ [payload.fieldId]: payload.error });\n }\n return;\n }\n\n let variables: ReturnType<typeof action.getVariables>;\n try {\n variables = action.getVariables(node, payload.values);\n } catch {\n const message = t('actions.form.errors.invalidPayload');\n setFormError(message);\n return;\n }\n\n setIsSubmitting(true);\n commitMutation(environment, {\n mutation: action.mutation,\n variables,\n updater: (store) => {\n action.updater?.(store, node);\n },\n onCompleted: (response) => {\n setIsSubmitting(false);\n const mutationPayload = extractMutationPayload(response);\n if (mutationPayload != null) {\n let defaultErrorMessage = t('actions.form.errors.invalidPayload');\n if (action.toasts?.error?.message != null) {\n defaultErrorMessage = resolveLabel(\n action.toasts.error.message,\n tApp,\n );\n } else if (action.toasts?.error?.title != null) {\n defaultErrorMessage = resolveLabel(action.toasts.error.title, tApp);\n }\n\n const outcome = resolveMutationOutcome(mutationPayload, {\n defaultErrorMessage,\n mapReason: (reason) => {\n const mapped = action.mapErrorReason?.(reason, node);\n if (mapped == null) {\n return null;\n }\n if (typeof mapped === 'function') {\n return resolveLabel(mapped, tApp);\n }\n return String(mapped);\n },\n });\n if (!outcome.ok) {\n const error = new Error(outcome.message);\n setFormError(outcome.message);\n action.onError?.(error, node);\n if (action.toasts?.error != null) {\n const toastTitle = resolveLabel(action.toasts.error.title, tApp);\n let toastMessage: string | undefined;\n if (action.toasts.error.message != null) {\n toastMessage = resolveLabel(action.toasts.error.message, tApp);\n }\n toast.error(toastTitle, toastMessage);\n }\n return;\n }\n }\n\n action.onCompleted?.(response, node);\n\n let hasCustomResult = false;\n if (action.result?.render != null) {\n const renderedResult = action.result.render(response, node);\n if (renderedResult != null) {\n hasCustomResult = true;\n setResultResponse(response);\n }\n }\n if (action.toasts?.success != null) {\n const toastSpec = resolveToastSpec(action.toasts.success, tApp);\n const toastActions = resolveToastViewActions({\n toast: action.toasts.success,\n response,\n node,\n tApp,\n entities,\n defaultLabel: t('actions.view'),\n navigateTo: (to) => {\n routing?.history.push({ pathname: to });\n },\n });\n toast.push({\n kind: 'info',\n title: toastSpec.title,\n message: toastSpec.message,\n actions: toastActions,\n });\n }\n\n if (action.result != null) {\n const nextValue = action.result.getValue(response, node);\n if (typeof nextValue === 'string' && nextValue.trim() !== '') {\n setResultValue(nextValue);\n onSuccess?.();\n return;\n }\n }\n\n if (hasCustomResult) {\n onSuccess?.();\n return;\n }\n\n onSuccess?.();\n onClose();\n },\n onError: (error) => {\n setIsSubmitting(false);\n const message = t('actions.form.errors.submitFailed');\n setFormError(message);\n action.onError?.(error, node);\n if (action.toasts?.error != null) {\n const toastTitle = resolveLabel(action.toasts.error.title, tApp);\n let toastMessage: string | undefined;\n if (action.toasts.error.message != null) {\n toastMessage = resolveLabel(action.toasts.error.message, tApp);\n }\n toast.error(toastTitle, toastMessage);\n }\n },\n });\n }, [\n action,\n buildPayload,\n entities,\n environment,\n isSubmitting,\n node,\n onClose,\n onSuccess,\n routing?.history,\n t,\n tApp,\n toast,\n ]);\n\n const handleFormSubmit = useCallback(\n (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n handleSubmit();\n },\n [handleSubmit],\n );\n\n const resultLabel = useMemo(() => {\n if (action.result == null) {\n return null;\n }\n return resolveLabel(action.result.label, tApp);\n }, [action.result, tApp]);\n\n const resultRender = useMemo(() => {\n if (action.result?.render == null || resultResponse == null) {\n return null;\n }\n return action.result.render(resultResponse, node);\n }, [action.result, node, resultResponse]);\n\n const showResult =\n (resultValue != null && resultLabel != null) || resultRender != null;\n\n const submitLabel = resolveLabel(action.label, tApp);\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <>\n <Modal\n isOpen={isOpen}\n onClose={handleClose}\n title={title}\n initialFocus=\"first-form-control\"\n footer={\n <div className={styles.actions}>\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"small\"\n disabled={isSubmitting}\n onClick={handleClose}\n >\n {t('actions.form.cancel')}\n </Button>\n {!showResult && (\n <Button\n type=\"submit\"\n variant=\"primary\"\n size=\"small\"\n disabled={isSubmitting}\n isLoading={isSubmitting}\n loadingLabel={t('actions.form.submitting')}\n onClick={handleSubmit}\n >\n {submitLabel}\n </Button>\n )}\n </div>\n }\n >\n <Form onSubmit={handleFormSubmit} className={styles.form}>\n <FormError message={formError} />\n <BackofficeFormSection>\n {action.fields.map((field) => {\n const fieldLabel = resolveLabel(field.label, tApp);\n let fieldDescription: string | null = null;\n if (field.description != null) {\n fieldDescription = resolveLabel(field.description, tApp);\n }\n const fieldInputId = `${formId}-${field.id}`;\n const fieldDescriptionId = `${fieldInputId}-description`;\n const fieldErrorId = `${fieldInputId}-error`;\n const fieldError = fieldErrors[field.id] ?? null;\n const isFieldInvalid = fieldError != null;\n let inputVariant: 'error' | undefined;\n let selectState: 'default' | 'error' = 'default';\n if (isFieldInvalid) {\n inputVariant = 'error';\n selectState = 'error';\n }\n let describedBy: string | undefined;\n if (fieldDescription != null && fieldError != null) {\n describedBy = `${fieldDescriptionId} ${fieldErrorId}`;\n } else if (fieldDescription != null) {\n describedBy = fieldDescriptionId;\n } else if (fieldError != null) {\n describedBy = fieldErrorId;\n }\n\n switch (field.kind) {\n case 'text': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Input\n id={fieldInputId}\n type=\"text\"\n value={value}\n placeholder={placeholder}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'textarea': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Textarea\n id={fieldInputId}\n value={value}\n placeholder={placeholder}\n rows={field.rows ?? 8}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'number': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Input\n id={fieldInputId}\n type=\"number\"\n value={value}\n placeholder={placeholder}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'json': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Textarea\n id={fieldInputId}\n value={value}\n placeholder={placeholder}\n rows={8}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'enum': {\n const rawValue = values[field.id];\n let selected = '';\n if (typeof rawValue === 'string') {\n selected = rawValue;\n }\n const options = field.options.map((option) => {\n return {\n id: option.value,\n value: option.value,\n label: resolveLabel(option.label, tApp),\n };\n });\n return (\n <FormGroup key={field.id}>\n <Label\n id={`${fieldInputId}-label`}\n required={field.required}\n >\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <SimpleSelect\n options={options}\n value={selected}\n placeholder={fieldLabel}\n ariaDescribedBy={describedBy}\n ariaInvalid={isFieldInvalid}\n ariaLabelledBy={`${fieldInputId}-label`}\n isDisabled={isSubmitting}\n state={selectState}\n onChange={(nextValue) => {\n setFieldValue(field.id, nextValue);\n }}\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'boolean': {\n const checked = values[field.id] === true;\n return (\n <FormGroup key={field.id}>\n <CheckboxField\n id={fieldInputId}\n label={fieldLabel}\n helperText={fieldDescription ?? undefined}\n error={fieldError ?? undefined}\n checked={checked}\n disabled={isSubmitting}\n onChange={(event) => {\n setFieldValue(field.id, event.target.checked);\n }}\n />\n </FormGroup>\n );\n }\n case 'entityId': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <EntityIdFilterField\n id={fieldInputId}\n label={fieldLabel}\n value={value}\n ariaDescribedBy={describedBy}\n ariaInvalid={isFieldInvalid}\n disabled={isSubmitting}\n onPick={() => {\n setActiveEntityPicker({\n fieldId: field.id,\n entity: field.entity,\n label: fieldLabel,\n });\n }}\n onClear={() => {\n setFieldValue(field.id, '');\n }}\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'multiEnum': {\n const rawValue = values[field.id];\n const fieldLegendId = `${fieldInputId}-legend`;\n let selected: string[] = [];\n if (Array.isArray(rawValue)) {\n selected = rawValue.filter((entry): entry is string => {\n return typeof entry === 'string';\n });\n }\n return (\n <FormGroup key={field.id}>\n <fieldset className={styles.fieldset}>\n <legend id={fieldLegendId} className={styles.legend}>\n {fieldLabel}\n {field.required && (\n <span className={styles.requiredMark}>*</span>\n )}\n </legend>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <div\n className={styles.checkboxGroup}\n role=\"group\"\n aria-labelledby={fieldLegendId}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n >\n {field.options.map((option, index) => {\n const optionLabel = resolveLabel(\n option.label,\n tApp,\n );\n const isChecked = selected.includes(option.value);\n return (\n <CheckboxField\n key={`${option.value}-${index}`}\n id={`${fieldInputId}-${index}`}\n label={optionLabel}\n checked={isChecked}\n disabled={isSubmitting}\n onChange={(event) => {\n let nextList = selected;\n if (event.target.checked) {\n if (!selected.includes(option.value)) {\n nextList = [...selected, option.value];\n }\n } else {\n nextList = selected.filter((value) => {\n return value !== option.value;\n });\n }\n setFieldValue(field.id, nextList);\n }}\n />\n );\n })}\n </div>\n </fieldset>\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n default: {\n return null;\n }\n }\n })}\n </BackofficeFormSection>\n\n {showResult && (\n <div className={styles.resultSection}>\n {resultValue != null && resultLabel != null && (\n <HighlightCode\n badgeLabel={resultLabel}\n copyCode={resultValue}\n fallbackCodeText={resultValue}\n />\n )}\n {resultRender}\n </div>\n )}\n </Form>\n </Modal>\n <EntityIdPickerDialog\n isOpen={activeEntityPicker != null}\n entity={activeEntityPicker?.entity ?? ''}\n title={activeEntityPicker?.label ?? ''}\n onClose={() => {\n setActiveEntityPicker(null);\n }}\n onSelectId={(id) => {\n if (activeEntityPicker == null) {\n return;\n }\n setFieldValue(activeEntityPicker.fieldId, id);\n setActiveEntityPicker(null);\n }}\n />\n </>\n );\n};\n\nexport default BackofficeEntityActionFormDialog;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,EAAE,gBAAA,IAAgB,4BAAwB,GAa1C,KAAgB,GAAkB,MAC/B,EAAM,CAAI,GAGb,KAAiB,MACd,OAAO,KAAU,cAAY,KAAiB,CAAC,MAAM,QAAQ,CAAK,GAGrE,MACJ,MAC+B;CAC/B,IAAI,CAAC,EAAc,CAAQ,GACzB,OAAO;CAGT,KAAK,IAAM,KAAS,OAAO,OAAO,CAAQ,GACxC,IAAI,EAAc,CAAK,MAAM,YAAY,KAAS,YAAY,IAC5D,OAAO;CAIX,OAAO;AACT,GAEM,KACJ,MAC4B;CAC5B,IAAM,IAAkC,CAAC;CAgBzC,OAfA,EAAO,SAAS,MAAU;EACxB,IAAI,EAAM,SAAS,WAAW;GAC5B,EAAO,EAAM,MAAM,EAAM,gBAAgB;GACzC;EACF;EACA,IAAI,EAAM,SAAS,aAAa;GAC9B,E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;WAChD,OACE,kBAAC,GAAD;YAEE,IAAI,GAAG,EAAa,GAAG;YACvB,OAAO;YACP,SAAS;YACT,UAAU;YACV,WAAW,MAAU;aACnB,IAAI,IAAW;aAUf,AATI,EAAM,OAAO,UACV,EAAS,SAAS,EAAO,KAAK,MACjC,IAAW,CAAC,GAAG,GAAU,EAAO,KAAK,KAGvC,IAAW,EAAS,QAAQ,MACnB,MAAU,EAAO,KACzB,GAEH,EAAc,EAAM,IAAI,CAAQ;YAClC;WACD,GAlBM,GAAG,EAAO,MAAM,GAAG,GAkBzB;UAEL,CAAC;SACE,CAAA;QACG;WACT,KAAc,QACb,kBAAC,QAAD;QAAM,IAAI;QAAc,WAAW;kBAChC;OACG,CAAA,CAEC,EAAA,GA3DK,EAAM,EA2DX;MAEf;MACA,SACE,OAAO;KAEX;IACF,CAAC,EACoB,CAAA;IAEtB,KACC,kBAAC,OAAD;KAAK,WAAW;eAAhB,CACG,KAAe,QAAQ,KAAe,QACrC,kBAAC,IAAD;MACE,YAAY;MACZ,UAAU;MACV,kBAAkB;KACnB,CAAA,GAEF,EACE;;GAEH;;CACD,CAAA,GACP,kBAAC,GAAD;EACE,QAAQ,KAAsB;EAC9B,QAAQ,GAAoB,UAAU;EACtC,OAAO,GAAoB,SAAS;EACpC,eAAe;GACb,EAAsB,IAAI;EAC5B;EACA,aAAa,MAAO;GACd,KAAsB,SAG1B,EAAc,EAAmB,SAAS,CAAE,GAC5C,EAAsB,IAAI;EAC5B;CACD,CAAA,CACD,EAAA,CAAA,IApdK;AAsdX"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityActionFormDialog.js","names":[],"sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"sourcesContent":["import {\n type FormEvent,\n type JSX,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport type { TFunction } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport * as ReactRelay from 'react-relay';\nimport {\n type MutationPayloadBase,\n resolveMutationOutcome,\n} from '../../../relay/mutationResult.js';\nimport { Button } from '@plumile/ui/atomic/atoms/button/Button.js';\nimport { Input } from '@plumile/ui/atomic/atoms/input/Input.js';\nimport { Label } from '@plumile/ui/atomic/atoms/label/Label.js';\nimport { Modal } from '@plumile/ui/atomic/atoms/modal/Modal.js';\nimport { Textarea } from '@plumile/ui/atomic/atoms/textarea/Textarea.js';\nimport { CheckboxField } from '@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js';\nimport { Form } from '@plumile/ui/atomic/molecules/form/Form.js';\nimport { FormError } from '@plumile/ui/atomic/molecules/form_error/FormError.js';\nimport { FormGroup } from '@plumile/ui/atomic/molecules/form/FormGroup.js';\nimport { HighlightCode } from '@plumile/ui/atomic/molecules/highlight/HighlightCode.js';\nimport { useToast } from '@plumile/ui/atomic/molecules/toast/ToastProvider.js';\nimport { BackofficeFormSection } from '@plumile/ui/backoffice/molecules/backoffice_form_section/BackofficeFormSection.js';\nimport { SimpleSelect } from '@plumile/ui/components/select/SimpleSelect.js';\nimport type {\n BackofficeEntityActionFormFieldSpec,\n BackofficeEntityFormMutationActionSpec,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../../../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../../../provider/BackofficeConfigContext.js';\nimport { EntityIdFilterField } from '../filters/EntityIdFilterField.js';\nimport { EntityIdPickerDialog } from '../pickers/EntityIdPickerDialog.js';\nimport {\n resolveToastSpec,\n resolveToastViewActions,\n} from './toastViewAction.js';\n\nconst { commitMutation, useRelayEnvironment } = ReactRelay;\nimport RoutingContext from '@plumile/router/routing/RoutingContext.js';\n\nimport * as styles from './backofficeEntityActionFormDialog.css.js';\n\nexport type BackofficeEntityActionFormDialogProps<Node> = {\n isOpen: boolean;\n action: BackofficeEntityFormMutationActionSpec<Node, any, any, any>;\n node: Node;\n onClose: () => void;\n onSuccess?: () => void;\n};\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\n return typeof value === 'object' && value != null && !Array.isArray(value);\n};\n\nconst extractMutationPayload = (\n response: unknown,\n): MutationPayloadBase | null => {\n if (!isPlainObject(response)) {\n return null;\n }\n\n for (const value of Object.values(response)) {\n if (isPlainObject(value) && ('status' in value || 'result' in value)) {\n return value;\n }\n }\n\n return null;\n};\n\nconst buildDefaultValues = (\n fields: readonly BackofficeEntityActionFormFieldSpec[],\n): Record<string, unknown> => {\n const output: Record<string, unknown> = {};\n fields.forEach((field) => {\n if (field.kind === 'boolean') {\n output[field.id] = field.defaultValue ?? false;\n return;\n }\n if (field.kind === 'multiEnum') {\n output[field.id] = field.defaultValue ?? [];\n return;\n }\n if (field.defaultValue != null) {\n output[field.id] = field.defaultValue;\n return;\n }\n output[field.id] = '';\n });\n return output;\n};\n\nconst normalizeInitialValue = (\n field: BackofficeEntityActionFormFieldSpec,\n value: unknown,\n): unknown => {\n if (field.kind === 'number') {\n if (typeof value === 'number') {\n return String(value);\n }\n if (typeof value === 'string') {\n return value;\n }\n return '';\n }\n if (field.kind === 'multiEnum') {\n if (Array.isArray(value)) {\n return value.filter((entry): entry is string => {\n return typeof entry === 'string' && entry.trim() !== '';\n });\n }\n return [];\n }\n if (field.kind === 'boolean') {\n return value === true;\n }\n if (typeof value === 'string') {\n return value;\n }\n return value ?? '';\n};\n\nconst buildInitialValues = <Node,>(\n action: BackofficeEntityFormMutationActionSpec<Node, any, any, any>,\n node: Node,\n): Record<string, unknown> => {\n const defaults = buildDefaultValues(action.fields);\n if (action.getInitialValues == null) {\n return defaults;\n }\n const overrides: unknown = action.getInitialValues(node);\n if (!isPlainObject(overrides)) {\n return defaults;\n }\n const next: Record<string, unknown> = { ...defaults };\n action.fields.forEach((field) => {\n if (!(field.id in overrides)) {\n return;\n }\n next[field.id] = normalizeInitialValue(field, overrides[field.id]);\n });\n return next;\n};\n\nexport const BackofficeEntityActionFormDialog = <Node,>({\n isOpen,\n action,\n node,\n onClose,\n onSuccess,\n}: BackofficeEntityActionFormDialogProps<Node>): JSX.Element | null => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities } = useBackofficeConfig();\n const routing = useContext(RoutingContext);\n const environment = useRelayEnvironment();\n const toast = useToast();\n const formId = useId();\n\n const [values, setValues] = useState<Record<string, unknown>>({});\n const [formError, setFormError] = useState<string | null>(null);\n const [fieldErrors, setFieldErrors] = useState<Record<string, string>>({});\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [resultValue, setResultValue] = useState<string | null>(null);\n const [resultResponse, setResultResponse] = useState<unknown>(null);\n const [activeEntityPicker, setActiveEntityPicker] = useState<{\n fieldId: string;\n entity: string;\n label: string;\n } | null>(null);\n\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n setValues(buildInitialValues(action, node));\n setFormError(null);\n setFieldErrors({});\n setResultValue(null);\n setResultResponse(null);\n }, [action, isOpen, node]);\n\n const handleClose = useCallback(() => {\n if (isSubmitting) {\n return;\n }\n onClose();\n }, [isSubmitting, onClose]);\n\n const setFieldValue = useCallback((fieldId: string, value: unknown) => {\n setValues((current) => {\n return { ...current, [fieldId]: value };\n });\n setFieldErrors((current) => {\n if (current[fieldId] == null) {\n return current;\n }\n const { [fieldId]: removedValue, ...next } = current;\n return next;\n });\n }, []);\n\n const title = resolveLabel(action.label, tApp);\n\n const resolveRequiredError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.required', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidNumberError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidNumber', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJson', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonObjectError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJsonObject', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const resolveInvalidJsonArrayError = useCallback(\n (fieldLabel: string): string => {\n return t('actions.form.errors.invalidJsonArray', {\n label: fieldLabel,\n });\n },\n [t],\n );\n\n const buildPayload = useCallback(():\n | { values: Record<string, unknown> }\n | { error: string; fieldId?: string } => {\n const output: Record<string, unknown> = {};\n\n for (const field of action.fields) {\n const fieldLabel = resolveLabel(field.label, tApp);\n const rawValue = values[field.id];\n\n switch (field.kind) {\n case 'text': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'textarea': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'number': {\n let valueString = '';\n if (typeof rawValue === 'string') {\n valueString = rawValue.trim();\n } else if (\n typeof rawValue === 'number' &&\n Number.isFinite(rawValue)\n ) {\n valueString = String(rawValue);\n }\n if (valueString === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n const parsed = Number(valueString);\n if (!Number.isFinite(parsed)) {\n return {\n error: resolveInvalidNumberError(fieldLabel),\n fieldId: field.id,\n };\n }\n output[field.id] = parsed;\n break;\n }\n case 'json': {\n let valueString = '';\n if (typeof rawValue === 'string') {\n valueString = rawValue.trim();\n }\n if (valueString === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(valueString);\n } catch {\n return {\n error: resolveInvalidJsonError(fieldLabel),\n fieldId: field.id,\n };\n }\n\n const jsonType = field.jsonType ?? 'object';\n if (jsonType === 'object' && !isPlainObject(parsed)) {\n return {\n error: resolveInvalidJsonObjectError(fieldLabel),\n fieldId: field.id,\n };\n }\n if (jsonType === 'array' && !Array.isArray(parsed)) {\n return {\n error: resolveInvalidJsonArrayError(fieldLabel),\n fieldId: field.id,\n };\n }\n\n output[field.id] = parsed;\n break;\n }\n case 'enum': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'boolean': {\n output[field.id] = rawValue === true;\n break;\n }\n case 'entityId': {\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue.trim();\n }\n if (value === '') {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = value;\n break;\n }\n case 'multiEnum': {\n let list: string[] = [];\n if (Array.isArray(rawValue)) {\n list = rawValue.filter((entry): entry is string => {\n return typeof entry === 'string' && entry.trim() !== '';\n });\n }\n if (list.length === 0) {\n if (field.required) {\n return {\n error: resolveRequiredError(fieldLabel),\n fieldId: field.id,\n };\n }\n break;\n }\n output[field.id] = list;\n break;\n }\n default: {\n break;\n }\n }\n }\n\n return { values: output };\n }, [\n action.fields,\n resolveInvalidJsonArrayError,\n resolveInvalidJsonError,\n resolveInvalidJsonObjectError,\n resolveInvalidNumberError,\n resolveRequiredError,\n tApp,\n values,\n ]);\n\n const handleSubmit = useCallback(() => {\n if (isSubmitting) {\n return;\n }\n\n setFormError(null);\n setFieldErrors({});\n\n const payload = buildPayload();\n if ('error' in payload) {\n setFormError(payload.error);\n if (payload.fieldId != null) {\n setFieldErrors({ [payload.fieldId]: payload.error });\n }\n return;\n }\n\n let variables: ReturnType<typeof action.getVariables>;\n try {\n variables = action.getVariables(node, payload.values);\n } catch {\n const message = t('actions.form.errors.invalidPayload');\n setFormError(message);\n return;\n }\n\n setIsSubmitting(true);\n commitMutation(environment, {\n mutation: action.mutation,\n variables,\n updater: (store) => {\n action.updater?.(store, node);\n },\n onCompleted: (response) => {\n setIsSubmitting(false);\n const mutationPayload = extractMutationPayload(response);\n if (mutationPayload != null) {\n let defaultErrorMessage = t('actions.form.errors.invalidPayload');\n if (action.toasts?.error?.message != null) {\n defaultErrorMessage = resolveLabel(\n action.toasts.error.message,\n tApp,\n );\n } else if (action.toasts?.error?.title != null) {\n defaultErrorMessage = resolveLabel(action.toasts.error.title, tApp);\n }\n\n const outcome = resolveMutationOutcome(mutationPayload, {\n defaultErrorMessage,\n mapReason: (reason) => {\n const mapped = action.mapErrorReason?.(reason, node);\n if (mapped == null) {\n return null;\n }\n if (typeof mapped === 'function') {\n return resolveLabel(mapped, tApp);\n }\n return String(mapped);\n },\n });\n if (!outcome.ok) {\n const error = new Error(outcome.message);\n setFormError(outcome.message);\n action.onError?.(error, node);\n if (action.toasts?.error != null) {\n const toastTitle = resolveLabel(action.toasts.error.title, tApp);\n let toastMessage: string | undefined;\n if (action.toasts.error.message != null) {\n toastMessage = resolveLabel(action.toasts.error.message, tApp);\n }\n toast.error(toastTitle, toastMessage);\n }\n return;\n }\n }\n\n action.onCompleted?.(response, node);\n\n let hasCustomResult = false;\n if (action.result?.render != null) {\n const renderedResult = action.result.render(response, node);\n if (renderedResult != null) {\n hasCustomResult = true;\n setResultResponse(response);\n }\n }\n if (action.toasts?.success != null) {\n const toastSpec = resolveToastSpec(action.toasts.success, tApp);\n const toastActions = resolveToastViewActions({\n toast: action.toasts.success,\n response,\n node,\n tApp,\n entities,\n defaultLabel: t('actions.view'),\n navigateTo: (to) => {\n routing?.history.push({ pathname: to });\n },\n });\n toast.push({\n kind: 'info',\n title: toastSpec.title,\n message: toastSpec.message,\n actions: toastActions,\n });\n }\n\n if (action.result != null) {\n const nextValue = action.result.getValue(response, node);\n if (typeof nextValue === 'string' && nextValue.trim() !== '') {\n setResultValue(nextValue);\n onSuccess?.();\n return;\n }\n }\n\n if (hasCustomResult) {\n onSuccess?.();\n return;\n }\n\n onSuccess?.();\n onClose();\n },\n onError: (error) => {\n setIsSubmitting(false);\n const message = t('actions.form.errors.submitFailed');\n setFormError(message);\n action.onError?.(error, node);\n if (action.toasts?.error != null) {\n const toastTitle = resolveLabel(action.toasts.error.title, tApp);\n let toastMessage: string | undefined;\n if (action.toasts.error.message != null) {\n toastMessage = resolveLabel(action.toasts.error.message, tApp);\n }\n toast.error(toastTitle, toastMessage);\n }\n },\n });\n }, [\n action,\n buildPayload,\n entities,\n environment,\n isSubmitting,\n node,\n onClose,\n onSuccess,\n routing?.history,\n t,\n tApp,\n toast,\n ]);\n\n const handleFormSubmit = useCallback(\n (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n handleSubmit();\n },\n [handleSubmit],\n );\n\n const resultLabel = useMemo(() => {\n if (action.result == null) {\n return null;\n }\n return resolveLabel(action.result.label, tApp);\n }, [action.result, tApp]);\n\n const resultRender = useMemo(() => {\n if (action.result?.render == null || resultResponse == null) {\n return null;\n }\n return action.result.render(resultResponse, node);\n }, [action.result, node, resultResponse]);\n\n const showResult =\n (resultValue != null && resultLabel != null) || resultRender != null;\n\n const submitLabel = resolveLabel(action.label, tApp);\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <>\n <Modal\n isOpen={isOpen}\n onClose={handleClose}\n title={title}\n initialFocus=\"first-form-control\"\n footer={\n <div className={styles.actions}>\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"small\"\n disabled={isSubmitting}\n onClick={handleClose}\n >\n {t('actions.form.cancel')}\n </Button>\n {!showResult && (\n <Button\n type=\"submit\"\n variant=\"primary\"\n size=\"small\"\n disabled={isSubmitting}\n isLoading={isSubmitting}\n loadingLabel={t('actions.form.submitting')}\n onClick={handleSubmit}\n >\n {submitLabel}\n </Button>\n )}\n </div>\n }\n >\n <Form onSubmit={handleFormSubmit} className={styles.form}>\n <FormError message={formError} />\n <BackofficeFormSection>\n {action.fields.map((field) => {\n const fieldLabel = resolveLabel(field.label, tApp);\n let fieldDescription: string | null = null;\n if (field.description != null) {\n fieldDescription = resolveLabel(field.description, tApp);\n }\n const fieldInputId = `${formId}-${field.id}`;\n const fieldDescriptionId = `${fieldInputId}-description`;\n const fieldErrorId = `${fieldInputId}-error`;\n const fieldError = fieldErrors[field.id] ?? null;\n const isFieldInvalid = fieldError != null;\n let inputVariant: 'error' | undefined;\n let selectState: 'default' | 'error' = 'default';\n if (isFieldInvalid) {\n inputVariant = 'error';\n selectState = 'error';\n }\n let describedBy: string | undefined;\n if (fieldDescription != null && fieldError != null) {\n describedBy = `${fieldDescriptionId} ${fieldErrorId}`;\n } else if (fieldDescription != null) {\n describedBy = fieldDescriptionId;\n } else if (fieldError != null) {\n describedBy = fieldErrorId;\n }\n\n switch (field.kind) {\n case 'text': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Input\n id={fieldInputId}\n type=\"text\"\n value={value}\n placeholder={placeholder}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'textarea': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Textarea\n id={fieldInputId}\n value={value}\n placeholder={placeholder}\n rows={field.rows ?? 8}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'number': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Input\n id={fieldInputId}\n type=\"number\"\n value={value}\n placeholder={placeholder}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'json': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n let placeholder: string | undefined;\n if (field.placeholder != null) {\n placeholder = resolveLabel(field.placeholder, tApp);\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <Textarea\n id={fieldInputId}\n value={value}\n placeholder={placeholder}\n rows={8}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n disabled={isSubmitting}\n variant={inputVariant}\n onChange={(event) => {\n setFieldValue(field.id, event.target.value);\n }}\n fullWidth\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'enum': {\n const rawValue = values[field.id];\n let selected = '';\n if (typeof rawValue === 'string') {\n selected = rawValue;\n }\n const options = field.options.map((option) => {\n return {\n id: option.value,\n value: option.value,\n label: resolveLabel(option.label, tApp),\n };\n });\n return (\n <FormGroup key={field.id}>\n <Label\n id={`${fieldInputId}-label`}\n required={field.required}\n >\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <SimpleSelect\n options={options}\n value={selected}\n placeholder={fieldLabel}\n ariaDescribedBy={describedBy}\n ariaInvalid={isFieldInvalid}\n ariaLabelledBy={`${fieldInputId}-label`}\n isDisabled={isSubmitting}\n state={selectState}\n onChange={(nextValue) => {\n setFieldValue(field.id, nextValue);\n }}\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'boolean': {\n const checked = values[field.id] === true;\n return (\n <FormGroup key={field.id}>\n <CheckboxField\n id={fieldInputId}\n label={fieldLabel}\n helperText={fieldDescription ?? undefined}\n error={fieldError ?? undefined}\n checked={checked}\n disabled={isSubmitting}\n onChange={(event) => {\n setFieldValue(field.id, event.target.checked);\n }}\n />\n </FormGroup>\n );\n }\n case 'entityId': {\n const rawValue = values[field.id];\n let value = '';\n if (typeof rawValue === 'string') {\n value = rawValue;\n }\n return (\n <FormGroup key={field.id}>\n <Label htmlFor={fieldInputId} required={field.required}>\n {fieldLabel}\n </Label>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <EntityIdFilterField\n id={fieldInputId}\n label={fieldLabel}\n value={value}\n ariaDescribedBy={describedBy}\n ariaInvalid={isFieldInvalid}\n disabled={isSubmitting}\n onPick={() => {\n setActiveEntityPicker({\n fieldId: field.id,\n entity: field.entity,\n label: fieldLabel,\n });\n }}\n onClear={() => {\n setFieldValue(field.id, '');\n }}\n />\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n case 'multiEnum': {\n const rawValue = values[field.id];\n const fieldLegendId = `${fieldInputId}-legend`;\n let selected: string[] = [];\n if (Array.isArray(rawValue)) {\n selected = rawValue.filter((entry): entry is string => {\n return typeof entry === 'string';\n });\n }\n return (\n <FormGroup key={field.id}>\n <fieldset className={styles.fieldset}>\n <legend id={fieldLegendId} className={styles.legend}>\n {fieldLabel}\n {field.required && (\n <span className={styles.requiredMark}>*</span>\n )}\n </legend>\n {fieldDescription != null && (\n <span\n id={fieldDescriptionId}\n className={styles.fieldDescription}\n >\n {fieldDescription}\n </span>\n )}\n <div\n className={styles.checkboxGroup}\n role=\"group\"\n aria-labelledby={fieldLegendId}\n aria-describedby={describedBy}\n aria-invalid={isFieldInvalid}\n >\n {field.options.map((option, index) => {\n const optionLabel = resolveLabel(\n option.label,\n tApp,\n );\n const isChecked = selected.includes(option.value);\n return (\n <CheckboxField\n key={`${option.value}-${index}`}\n id={`${fieldInputId}-${index}`}\n label={optionLabel}\n checked={isChecked}\n disabled={isSubmitting}\n onChange={(event) => {\n let nextList = selected;\n if (event.target.checked) {\n if (!selected.includes(option.value)) {\n nextList = [...selected, option.value];\n }\n } else {\n nextList = selected.filter((value) => {\n return value !== option.value;\n });\n }\n setFieldValue(field.id, nextList);\n }}\n />\n );\n })}\n </div>\n </fieldset>\n {fieldError != null && (\n <span id={fieldErrorId} className={styles.fieldError}>\n {fieldError}\n </span>\n )}\n </FormGroup>\n );\n }\n default: {\n return null;\n }\n }\n })}\n </BackofficeFormSection>\n\n {showResult && (\n <div className={styles.resultSection}>\n {resultValue != null && resultLabel != null && (\n <HighlightCode\n badgeLabel={resultLabel}\n copyCode={resultValue}\n fallbackCodeText={resultValue}\n />\n )}\n {resultRender}\n </div>\n )}\n </Form>\n </Modal>\n <EntityIdPickerDialog\n isOpen={activeEntityPicker != null}\n entity={activeEntityPicker?.entity ?? ''}\n title={activeEntityPicker?.label ?? ''}\n onClose={() => {\n setActiveEntityPicker(null);\n }}\n onSelectId={(id) => {\n if (activeEntityPicker == null) {\n return;\n }\n setFieldValue(activeEntityPicker.fieldId, id);\n setActiveEntityPicker(null);\n }}\n />\n </>\n );\n};\n\nexport default BackofficeEntityActionFormDialog;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,IAAM,EAAE,gBAAA,IAAgB,4BAAwB,GAa1C,KAAgB,GAAkB,MAC/B,EAAM,CAAI,GAGb,KAAiB,MACd,OAAO,KAAU,cAAY,KAAiB,CAAC,MAAM,QAAQ,CAAK,GAGrE,MACJ,MAC+B;CAC/B,IAAI,CAAC,EAAc,CAAQ,GACzB,OAAO;CAGT,KAAK,IAAM,KAAS,OAAO,OAAO,CAAQ,GACxC,IAAI,EAAc,CAAK,MAAM,YAAY,KAAS,YAAY,IAC5D,OAAO;CAIX,OAAO;AACT,GAEM,KACJ,MAC4B;CAC5B,IAAM,IAAkC,CAAC;CAgBzC,OAfA,EAAO,SAAS,MAAU;EACxB,IAAI,EAAM,SAAS,WAAW;GAC5B,EAAO,EAAM,MAAM,EAAM,gBAAgB;GACzC;EACF;EACA,IAAI,EAAM,SAAS,aAAa;GAC9B,EAAO,EAAM,MAAM,EAAM,gBAAgB,CAAC;GAC1C;EACF;EACA,IAAI,EAAM,gBAAgB,MAAM;GAC9B,EAAO,EAAM,MAAM,EAAM;GACzB;EACF;EACA,EAAO,EAAM,MAAM;CACrB,CAAC,GACM;AACT,GAEM,KACJ,GACA,MAEI,EAAM,SAAS,WACb,OAAO,KAA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O,KAAK,MACjC,IAAW,CAAC,GAAG,GAAU,EAAO,KAAK,KAGvC,IAAW,EAAS,QAAQ,MACnB,MAAU,EAAO,KACzB,GAEH,EAAc,EAAM,IAAI,CAAQ;YAClC;WACD,GAlBM,GAAG,EAAO,MAAM,GAAG,GAkBzB;UAEL,CAAC;SACE,CAAA;QACG;WACT,KAAc,QACb,kBAAC,QAAD;QAAM,IAAI;QAAc,WAAW;kBAChC;OACG,CAAA,CAEC,EAAA,GA3DK,EAAM,EA2DX;MAEf;MACA,SACE,OAAO;KAEX;IACF,CAAC,EACoB,CAAA;IAEtB,KACC,kBAAC,OAAD;KAAK,WAAW;eAAhB,CACG,KAAe,QAAQ,KAAe,QACrC,kBAAC,IAAD;MACE,YAAY;MACZ,UAAU;MACV,kBAAkB;KACnB,CAAA,GAEF,EACE;;GAEH;;CACD,CAAA,GACP,kBAAC,GAAD;EACE,QAAQ,KAAsB;EAC9B,QAAQ,GAAoB,UAAU;EACtC,OAAO,GAAoB,SAAS;EACpC,eAAe;GACb,EAAsB,IAAI;EAC5B;EACA,aAAa,MAAO;GACd,KAAsB,SAG1B,EAAc,EAAmB,SAAS,CAAE,GAC5C,EAAsB,IAAI;EAC5B;CACD,CAAA,CACD,EAAA,CAAA,IApdK;AAsdX"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
/* empty css */
|
|
2
3
|
//#region src/components/backoffice/detail/backofficeDetailRelationLink.css.ts
|
|
3
4
|
var e = "_93gupm0 qbwcueg qbwcuee txvbqb2tz txvbqb1bg1 txvbqb3f txvbqb7g txvbqb76 txvbqb7t qbwcuef txvbqb1ct1 txvbqb1dsd qbwcue0 txvbqb1ffs txvbqb1ga0 txvbqb10mx txvbqb11ki txvbqb12hq txvbqbxtt txvbqb7h txvbqb75 txvbqbfpn txvbqblt7 txvbqbhdy txvbqb28o txvbqb2sj txvbqbik txvbqb1b4r txvbqbey txvbqbem txvbqbh4k txvbqbh4y txvbqb1ct4 txvbqb1dsg", t = "txvbqb9j txvbqbhb2 txvbqbv7x txvbqbws9", n = "txvbqbfqq txvbqbey txvbqbhd8 txvbqbh6d txvbqbv7x", r = "txvbqb96 txvbqb1bg3 txvbqbws9 txvbqb18e2", i = "txvbqbfqq txvbqbey txvbqbls4 txvbqb1bg5 txvbqb9j txvbqbmzg";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
/* empty css */
|
|
3
2
|
//#region src/components/backoffice/detail/backofficeRelationsSummaryGrid.css.ts
|
|
4
3
|
var e = "txvbqbfq0 txvbqbhdy txvbqbjcq", t = "txvbqbfpn txvbqbh4x txvbqbhd8 txvbqbwwl txvbqb2tz txvbqb1b7z txvbqb28o txvbqb2sj txvbqb1dz txvbqbv7x", n = "txvbqb96 txvbqb6a txvbqbmw7 txvbqb1bg3", r = "txvbqbam txvbqbhbf txvbqb1bg1", i = "txvbqb9j txvbqb1bg3 txvbqbws9";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
/* empty css */
|
|
3
2
|
//#region src/components/backoffice/filters/backofficeFilterAction.css.ts
|
|
4
3
|
var e = "hwnq700 txvbqbfqq txvbqbey txvbqbls4 txvbqbh6d txvbqb19gp txvbqbjm4 txvbqbwvi txvbqb2tz txvbqb28o txvbqb2sj txvbqb1d9 txvbqb1b83 txvbqb1bhb txvbqbv txvbqb3f txvbqb7h txvbqb75 txvbqb7t txvbqb1eol txvbqb1czh txvbqb1dth qbwcue0 txvbqb1ffs txvbqb1ga0", t = "txvbqb19fm txvbqbjl1";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailPage.helpers.ts"],"sourcesContent":["import type {\n BackofficeBadgeTone,\n BackofficeEntityActionSpec,\n BackofficeEntityFormMutationActionSpec,\n BackofficeEntityMutationActionSpec,\n BackofficeEntityRouteActionSpec,\n BackofficeValueLabel,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { MutationPayloadBase } from '../relay/mutationResult.js';\nimport type { TFunction } from 'i18next';\n\nexport const resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const isPlainObject = (\n value: unknown,\n): value is Record<string, unknown> => {\n return typeof value === 'object' && value != null && !Array.isArray(value);\n};\n\nexport const extractMutationPayload = (\n response: unknown,\n): MutationPayloadBase | null => {\n if (!isPlainObject(response)) {\n return null;\n }\n\n for (const value of Object.values(response)) {\n if (isPlainObject(value) && ('status' in value || 'result' in value)) {\n return value;\n }\n }\n\n return null;\n};\n\nexport const isRouteAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityRouteActionSpec<Node> => {\n return action.kind === 'route';\n};\n\nexport const isMutationAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityMutationActionSpec<Node> => {\n return action.kind === 'mutation';\n};\n\nexport const isFormMutationAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityFormMutationActionSpec<Node> => {\n return action.kind === 'formMutation';\n};\n\nexport const resolveValueLabel = (\n value: BackofficeValueLabel | null | undefined,\n tApp: TFunction,\n): string | number | null => {\n if (typeof value === 'function') {\n return value(tApp);\n }\n if (value == null) {\n return null;\n }\n return value;\n};\n\nexport const resolveRelationValue = (value: string | null): string | null => {\n if (value == null) {\n return null;\n }\n const trimmed = value.trim();\n if (trimmed === '') {\n return null;\n }\n return trimmed;\n};\n\nexport const isEmptyText = (\n value: string | number | null | undefined,\n): boolean => {\n if (value == null) {\n return true;\n }\n if (typeof value === 'string') {\n return value.trim() === '';\n }\n return false;\n};\n\nexport const resolveBadgeTone = <Node>(\n tone: BackofficeBadgeTone | ((node: Node) => BackofficeBadgeTone) | undefined,\n node: Node,\n): BackofficeBadgeTone | undefined => {\n if (typeof tone === 'function') {\n return tone(node);\n }\n return tone;\n};\n"],"mappings":";AAYA,IAAa,KAAgB,GAAkB,MACtC,EAAM,CAAI,GAGN,KACX,MAEO,OAAO,KAAU,cAAY,KAAiB,CAAC,MAAM,QAAQ,CAAK,GAG9D,KACX,MAC+B;CAC/B,IAAI,CAAC,EAAc,CAAQ,GACzB,OAAO;CAGT,KAAK,IAAM,KAAS,OAAO,OAAO,CAAQ,GACxC,IAAI,EAAc,CAAK,MAAM,YAAY,KAAS,YAAY,IAC5D,OAAO;CAIX,OAAO;AACT,GAEa,KACX,MAEO,EAAO,SAAS,SAGZ,KACX,MAEO,EAAO,SAAS,YAGZ,KACX,MAEO,EAAO,SAAS,gBAGZ,KACX,GACA,MAEI,OAAO,KAAU,aACZ,EAAM,CAAI,IAEf,KACK,MAKE,KAAwB,MAAwC;CAC3E,IAAI,KAAS,MACX,OAAO;CAET,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,OAEF;AACT,GAEa,KACX,MAEI,KAAS,OACJ,KAEL,OAAO,KAAU,WACZ,EAAM,KAAK,MAAM,KAEnB,IAGI,KACX,GACA,MAEI,OAAO,KAAS,aACX,EAAK,CAAI,IAEX"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityDetailPage.helpers.ts"],"sourcesContent":["import type {\n BackofficeBadgeTone,\n BackofficeEntityActionSpec,\n BackofficeEntityFormMutationActionSpec,\n BackofficeEntityMutationActionSpec,\n BackofficeEntityRouteActionSpec,\n BackofficeValueLabel,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { MutationPayloadBase } from '../relay/mutationResult.js';\nimport type { TFunction } from 'i18next';\n\nexport const resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const isPlainObject = (\n value: unknown,\n): value is Record<string, unknown> => {\n return typeof value === 'object' && value != null && !Array.isArray(value);\n};\n\nexport const extractMutationPayload = (\n response: unknown,\n): MutationPayloadBase | null => {\n if (!isPlainObject(response)) {\n return null;\n }\n\n for (const value of Object.values(response)) {\n if (isPlainObject(value) && ('status' in value || 'result' in value)) {\n return value;\n }\n }\n\n return null;\n};\n\nexport const isRouteAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityRouteActionSpec<Node> => {\n return action.kind === 'route';\n};\n\nexport const isMutationAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityMutationActionSpec<Node, any> => {\n return action.kind === 'mutation';\n};\n\nexport const isFormMutationAction = <Node>(\n action: BackofficeEntityActionSpec<Node>,\n): action is BackofficeEntityFormMutationActionSpec<Node, any, any, any> => {\n return action.kind === 'formMutation';\n};\n\nexport const resolveValueLabel = (\n value: BackofficeValueLabel | null | undefined,\n tApp: TFunction,\n): string | number | null => {\n if (typeof value === 'function') {\n return value(tApp);\n }\n if (value == null) {\n return null;\n }\n return value;\n};\n\nexport const resolveRelationValue = (value: string | null): string | null => {\n if (value == null) {\n return null;\n }\n const trimmed = value.trim();\n if (trimmed === '') {\n return null;\n }\n return trimmed;\n};\n\nexport const isEmptyText = (\n value: string | number | null | undefined,\n): boolean => {\n if (value == null) {\n return true;\n }\n if (typeof value === 'string') {\n return value.trim() === '';\n }\n return false;\n};\n\nexport const resolveBadgeTone = <Node>(\n tone: BackofficeBadgeTone | ((node: Node) => BackofficeBadgeTone) | undefined,\n node: Node,\n): BackofficeBadgeTone | undefined => {\n if (typeof tone === 'function') {\n return tone(node);\n }\n return tone;\n};\n"],"mappings":";AAYA,IAAa,KAAgB,GAAkB,MACtC,EAAM,CAAI,GAGN,KACX,MAEO,OAAO,KAAU,cAAY,KAAiB,CAAC,MAAM,QAAQ,CAAK,GAG9D,KACX,MAC+B;CAC/B,IAAI,CAAC,EAAc,CAAQ,GACzB,OAAO;CAGT,KAAK,IAAM,KAAS,OAAO,OAAO,CAAQ,GACxC,IAAI,EAAc,CAAK,MAAM,YAAY,KAAS,YAAY,IAC5D,OAAO;CAIX,OAAO;AACT,GAEa,KACX,MAEO,EAAO,SAAS,SAGZ,KACX,MAEO,EAAO,SAAS,YAGZ,KACX,MAEO,EAAO,SAAS,gBAGZ,KACX,GACA,MAEI,OAAO,KAAU,aACZ,EAAM,CAAI,IAEf,KACK,MAKE,KAAwB,MAAwC;CAC3E,IAAI,KAAS,MACX,OAAO;CAET,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,OAEF;AACT,GAEa,KACX,MAEI,KAAS,OACJ,KAEL,OAAO,KAAU,WACZ,EAAM,KAAK,MAAM,KAEnB,IAGI,KACX,GACA,MAEI,OAAO,KAAS,aACX,EAAK,CAAI,IAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityListPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.helpers.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'react';\n\nimport type {\n BackofficeEntityFormMutationActionSpec,\n BackofficeEntityRouteActionSpec,\n BackofficeListActionSpec,\n BackofficeRuntimeConnectionListConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { Button } from '@plumile/ui/atomic/atoms/button/Button.js';\nimport type { DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport type { TFunction } from 'i18next';\n\nimport type { BackofficeSizedDataTableColumn } from '../components/backoffice/columns/buildDataTableColumns.js';\n\ntype ButtonVariant = ComponentProps<typeof Button>['variant'];\n\nconst ROW_FLAGS_SLOT_PX = 24;\nconst ROW_FLAGS_GAP_PX = 6;\nconst ROW_FLAGS_PADDING_X_PX = 4;\n\nconst ACTIONS_SLOT_PX = 32;\nconst ACTIONS_GAP_PX = 8;\nconst ACTIONS_PADDING_X_PX = 12;\nconst ACTIONS_SAFETY_PX = 4;\n\nconst listColumnTrackBySize: Record<\n BackofficeSizedDataTableColumn<unknown>['size'],\n string\n> = {\n xs: 'minmax(3.5rem, 7rem)',\n s: 'minmax(5rem, 10rem)',\n statusAction: 'minmax(7rem, 12rem)',\n m: 'minmax(7rem, 14rem)',\n l: 'minmax(9rem, 18rem)',\n xl: 'minmax(11rem, 24rem)',\n fluid: 'minmax(0, 1fr)',\n};\n\nexport const computeRowFlagsColumnWidthPx = (flagCount: number): number => {\n if (flagCount <= 0) {\n return 0;\n }\n return (\n ROW_FLAGS_PADDING_X_PX * 2 +\n ROW_FLAGS_SLOT_PX * flagCount +\n ROW_FLAGS_GAP_PX * Math.max(0, flagCount - 1)\n );\n};\n\nexport const computeActionsColumnWidthPx = (actionCount: number): number => {\n if (actionCount <= 0) {\n return 0;\n }\n return (\n ACTIONS_SAFETY_PX +\n ACTIONS_PADDING_X_PX * 2 +\n ACTIONS_SLOT_PX * actionCount +\n ACTIONS_GAP_PX * Math.max(0, actionCount - 1)\n );\n};\n\nexport const resolveTrackBySize = (\n column: DataTableColumn<unknown>,\n fallback: string,\n): string => {\n if (column.mobileRole === 'action') {\n return '60px';\n }\n if (column.isPrimary === true) {\n return 'minmax(0, 1.4fr)';\n }\n if ('size' in column && typeof column.size === 'string') {\n return listColumnTrackBySize[\n column.size as BackofficeSizedDataTableColumn<unknown>['size']\n ];\n }\n return fallback;\n};\n\nexport const isRouteAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeEntityRouteActionSpec<null> => {\n return action.kind === 'route';\n};\n\nexport const isFormMutationAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeEntityFormMutationActionSpec<null> => {\n return action.kind === 'formMutation';\n};\n\nexport const resolveActionVariant = (\n actionVariant: ButtonVariant | undefined,\n index: number,\n): Exclude<ButtonVariant, undefined> => {\n if (actionVariant != null) {\n return actionVariant;\n }\n if (index === 0) {\n return 'primary';\n }\n return 'secondary';\n};\n\nexport const resolveRowId = (row: unknown): string | null => {\n if (row == null || typeof row !== 'object') {\n return null;\n }\n if (!('id' in row)) {\n return null;\n }\n const value = (row as { id?: unknown }).id;\n if (typeof value !== 'string') {\n return null;\n }\n const trimmed = value.trim();\n if (trimmed === '') {\n return null;\n }\n return trimmed;\n};\n\nexport type ConnectionListConfig = BackofficeRuntimeResolvedListFacetConfig & {\n list: BackofficeRuntimeConnectionListConfig;\n};\n\nexport const resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const buildActionsColumn = (options: {\n ariaLabel: string;\n fallback: string;\n resolveDetailHref: (id: string) => string | null;\n className?: string;\n renderAction: (input: { href: string; ariaLabel: string }) => JSX.Element;\n}): DataTableColumn<unknown> => {\n const { ariaLabel, fallback, resolveDetailHref, className, renderAction } =\n options;\n\n return {\n id: 'actions',\n header: '',\n className,\n mobileRole: 'action',\n cell: (row) => {\n const id = resolveRowId(row);\n if (id == null) {\n return fallback;\n }\n const href = resolveDetailHref(id);\n if (href == null) {\n return fallback;\n }\n return renderAction({ href, ariaLabel });\n },\n };\n};\n"],"mappings":";AAkBA,IAAM,IAAoB,IACpB,IAAmB,GACnB,IAAyB,GAEzB,IAAkB,IAClB,IAAiB,GAIjB,IAGF;CACF,IAAI;CACJ,GAAG;CACH,cAAc;CACd,GAAG;CACH,GAAG;CACH,IAAI;CACJ,OAAO;AACT,GAEa,KAAgC,MACvC,KAAa,IACR,IAGP,IAAyB,IACzB,IAAoB,IACpB,IAAmB,KAAK,IAAI,GAAG,IAAY,CAAC,GAInC,KAA+B,MACtC,KAAe,IACV,IAGP,KAEA,IAAkB,IAClB,IAAiB,KAAK,IAAI,GAAG,IAAc,CAAC,GAInC,KACX,GACA,MAEI,EAAO,eAAe,WACjB,SAEL,EAAO,cAAc,KAChB,qBAEL,UAAU,KAAU,OAAO,EAAO,QAAS,WACtC,EACL,EAAO,QAGJ,GAGI,KACX,MAEO,EAAO,SAAS,SAGZ,KACX,MAEO,EAAO,SAAS,gBAGZ,KACX,GACA,MAEI,MAGA,MAAU,IACL,YAEF,cAGI,KAAgB,MAAgC;CAI3D,IAHmB,OAAO,KAAQ,aAA9B,KAGA,EAAE,QAAQ,IACZ,OAAO;CAET,IAAM,IAAS,EAAyB;CACxC,IAAI,OAAO,KAAU,UACnB,OAAO;CAET,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,OAEF;AACT,GAMa,KAAgB,GAAkB,MACtC,EAAM,CAAI,GAGN,KAAsB,MAMH;CAC9B,IAAM,EAAE,cAAW,aAAU,sBAAmB,cAAW,oBACzD;CAEF,OAAO;EACL,IAAI;EACJ,QAAQ;EACR;EACA,YAAY;EACZ,OAAO,MAAQ;GACb,IAAM,IAAK,EAAa,CAAG;GAC3B,IAAI,KAAM,MACR,OAAO;GAET,IAAM,IAAO,EAAkB,CAAE;GAIjC,OAHI,KAAQ,OACH,IAEF,EAAa;IAAE;IAAM;GAAU,CAAC;EACzC;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityListPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.helpers.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'react';\n\nimport type {\n BackofficeEntityFormMutationActionSpec,\n BackofficeEntityRouteActionSpec,\n BackofficeListActionSpec,\n BackofficeRuntimeConnectionListConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { Button } from '@plumile/ui/atomic/atoms/button/Button.js';\nimport type { DataTableColumn } from '@plumile/ui/components/data-table/DataTable.js';\nimport type { TFunction } from 'i18next';\n\nimport type { BackofficeSizedDataTableColumn } from '../components/backoffice/columns/buildDataTableColumns.js';\n\ntype ButtonVariant = ComponentProps<typeof Button>['variant'];\n\nconst ROW_FLAGS_SLOT_PX = 24;\nconst ROW_FLAGS_GAP_PX = 6;\nconst ROW_FLAGS_PADDING_X_PX = 4;\n\nconst ACTIONS_SLOT_PX = 32;\nconst ACTIONS_GAP_PX = 8;\nconst ACTIONS_PADDING_X_PX = 12;\nconst ACTIONS_SAFETY_PX = 4;\n\nconst listColumnTrackBySize: Record<\n BackofficeSizedDataTableColumn<unknown>['size'],\n string\n> = {\n xs: 'minmax(3.5rem, 7rem)',\n s: 'minmax(5rem, 10rem)',\n statusAction: 'minmax(7rem, 12rem)',\n m: 'minmax(7rem, 14rem)',\n l: 'minmax(9rem, 18rem)',\n xl: 'minmax(11rem, 24rem)',\n fluid: 'minmax(0, 1fr)',\n};\n\nexport const computeRowFlagsColumnWidthPx = (flagCount: number): number => {\n if (flagCount <= 0) {\n return 0;\n }\n return (\n ROW_FLAGS_PADDING_X_PX * 2 +\n ROW_FLAGS_SLOT_PX * flagCount +\n ROW_FLAGS_GAP_PX * Math.max(0, flagCount - 1)\n );\n};\n\nexport const computeActionsColumnWidthPx = (actionCount: number): number => {\n if (actionCount <= 0) {\n return 0;\n }\n return (\n ACTIONS_SAFETY_PX +\n ACTIONS_PADDING_X_PX * 2 +\n ACTIONS_SLOT_PX * actionCount +\n ACTIONS_GAP_PX * Math.max(0, actionCount - 1)\n );\n};\n\nexport const resolveTrackBySize = (\n column: DataTableColumn<unknown>,\n fallback: string,\n): string => {\n if (column.mobileRole === 'action') {\n return '60px';\n }\n if (column.isPrimary === true) {\n return 'minmax(0, 1.4fr)';\n }\n if ('size' in column && typeof column.size === 'string') {\n return listColumnTrackBySize[\n column.size as BackofficeSizedDataTableColumn<unknown>['size']\n ];\n }\n return fallback;\n};\n\nexport const isRouteAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeEntityRouteActionSpec<null> => {\n return action.kind === 'route';\n};\n\nexport const isFormMutationAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeEntityFormMutationActionSpec<null, any, any, any> => {\n return action.kind === 'formMutation';\n};\n\nexport const resolveActionVariant = (\n actionVariant: ButtonVariant | undefined,\n index: number,\n): Exclude<ButtonVariant, undefined> => {\n if (actionVariant != null) {\n return actionVariant;\n }\n if (index === 0) {\n return 'primary';\n }\n return 'secondary';\n};\n\nexport const resolveRowId = (row: unknown): string | null => {\n if (row == null || typeof row !== 'object') {\n return null;\n }\n if (!('id' in row)) {\n return null;\n }\n const value = (row as { id?: unknown }).id;\n if (typeof value !== 'string') {\n return null;\n }\n const trimmed = value.trim();\n if (trimmed === '') {\n return null;\n }\n return trimmed;\n};\n\nexport type ConnectionListConfig = BackofficeRuntimeResolvedListFacetConfig & {\n list: BackofficeRuntimeConnectionListConfig;\n};\n\nexport const resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const buildActionsColumn = (options: {\n ariaLabel: string;\n fallback: string;\n resolveDetailHref: (id: string) => string | null;\n className?: string;\n renderAction: (input: { href: string; ariaLabel: string }) => JSX.Element;\n}): DataTableColumn<unknown> => {\n const { ariaLabel, fallback, resolveDetailHref, className, renderAction } =\n options;\n\n return {\n id: 'actions',\n header: '',\n className,\n mobileRole: 'action',\n cell: (row) => {\n const id = resolveRowId(row);\n if (id == null) {\n return fallback;\n }\n const href = resolveDetailHref(id);\n if (href == null) {\n return fallback;\n }\n return renderAction({ href, ariaLabel });\n },\n };\n};\n"],"mappings":";AAkBA,IAAM,IAAoB,IACpB,IAAmB,GACnB,IAAyB,GAEzB,IAAkB,IAClB,IAAiB,GAIjB,IAGF;CACF,IAAI;CACJ,GAAG;CACH,cAAc;CACd,GAAG;CACH,GAAG;CACH,IAAI;CACJ,OAAO;AACT,GAEa,KAAgC,MACvC,KAAa,IACR,IAGP,IAAyB,IACzB,IAAoB,IACpB,IAAmB,KAAK,IAAI,GAAG,IAAY,CAAC,GAInC,KAA+B,MACtC,KAAe,IACV,IAGP,KAEA,IAAkB,IAClB,IAAiB,KAAK,IAAI,GAAG,IAAc,CAAC,GAInC,KACX,GACA,MAEI,EAAO,eAAe,WACjB,SAEL,EAAO,cAAc,KAChB,qBAEL,UAAU,KAAU,OAAO,EAAO,QAAS,WACtC,EACL,EAAO,QAGJ,GAGI,KACX,MAEO,EAAO,SAAS,SAGZ,KACX,MAEO,EAAO,SAAS,gBAGZ,KACX,GACA,MAEI,MAGA,MAAU,IACL,YAEF,cAGI,KAAgB,MAAgC;CAI3D,IAHmB,OAAO,KAAQ,aAA9B,KAGA,EAAE,QAAQ,IACZ,OAAO;CAET,IAAM,IAAS,EAAyB;CACxC,IAAI,OAAO,KAAU,UACnB,OAAO;CAET,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,OAEF;AACT,GAMa,KAAgB,GAAkB,MACtC,EAAM,CAAI,GAGN,KAAsB,MAMH;CAC9B,IAAM,EAAE,cAAW,aAAU,sBAAmB,cAAW,oBACzD;CAEF,OAAO;EACL,IAAI;EACJ,QAAQ;EACR;EACA,YAAY;EACZ,OAAO,MAAQ;GACb,IAAM,IAAK,EAAa,CAAG;GAC3B,IAAI,KAAM,MACR,OAAO;GAET,IAAM,IAAO,EAAkB,CAAE;GAIjC,OAHI,KAAQ,OACH,IAEF,EAAa;IAAE;IAAM;GAAU,CAAC;EACzC;CACF;AACF"}
|
|
@@ -2,7 +2,7 @@ import { type JSX } from 'react';
|
|
|
2
2
|
import type { BackofficeEntityFormMutationActionSpec } from '@plumile/backoffice-core/types.js';
|
|
3
3
|
export type BackofficeEntityActionFormDialogProps<Node> = {
|
|
4
4
|
isOpen: boolean;
|
|
5
|
-
action: BackofficeEntityFormMutationActionSpec<Node>;
|
|
5
|
+
action: BackofficeEntityFormMutationActionSpec<Node, any, any, any>;
|
|
6
6
|
node: Node;
|
|
7
7
|
onClose: () => void;
|
|
8
8
|
onSuccess?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAqBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACpE,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAoGF,eAAO,MAAM,gCAAgC,GAAI,IAAI,EAAG,+CAMrD,qCAAqC,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,OAAO,GAAG,IA46B9D,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
|
|
@@ -5,8 +5,8 @@ export declare const resolveLabel: (label: I18nLabel, tApp: TFunction) => string
|
|
|
5
5
|
export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
|
|
6
6
|
export declare const extractMutationPayload: (response: unknown) => MutationPayloadBase | null;
|
|
7
7
|
export declare const isRouteAction: <Node>(action: BackofficeEntityActionSpec<Node>) => action is BackofficeEntityRouteActionSpec<Node>;
|
|
8
|
-
export declare const isMutationAction: <Node>(action: BackofficeEntityActionSpec<Node>) => action is BackofficeEntityMutationActionSpec<Node>;
|
|
9
|
-
export declare const isFormMutationAction: <Node>(action: BackofficeEntityActionSpec<Node>) => action is BackofficeEntityFormMutationActionSpec<Node>;
|
|
8
|
+
export declare const isMutationAction: <Node>(action: BackofficeEntityActionSpec<Node>) => action is BackofficeEntityMutationActionSpec<Node, any>;
|
|
9
|
+
export declare const isFormMutationAction: <Node>(action: BackofficeEntityActionSpec<Node>) => action is BackofficeEntityFormMutationActionSpec<Node, any, any, any>;
|
|
10
10
|
export declare const resolveValueLabel: (value: BackofficeValueLabel | null | undefined, tApp: TFunction) => string | number | null;
|
|
11
11
|
export declare const resolveRelationValue: (value: string | null) => string | null;
|
|
12
12
|
export declare const isEmptyText: (value: string | number | null | undefined) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityDetailPage.helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailPage.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,sCAAsC,EACtC,kCAAkC,EAClC,+BAA+B,EAC/B,oBAAoB,EACpB,SAAS,EACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,EAAE,MAAM,SAAS,KAAG,MAEhE,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,OAAO,OAAO,KACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAEjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,OAAO,KAChB,mBAAmB,GAAG,IAYxB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,IAAI,EAChC,QAAQ,0BAA0B,CAAC,IAAI,CAAC,KACvC,MAAM,IAAI,+BAA+B,CAAC,IAAI,CAEhD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,IAAI,EACnC,QAAQ,0BAA0B,CAAC,IAAI,CAAC,KACvC,MAAM,IAAI,kCAAkC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"BackofficeEntityDetailPage.helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityDetailPage.helpers.ts"],"names":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AAM,GAAG,IAAI,GAAG,SAAS,KACxC,OAQF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,IAAI,EACnC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,mBAAmB,CAAC,GAAG,SAAS,EAC7E,MAAM,IAAI,KACT,mBAAmB,GAAG,SAKxB,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare const computeRowFlagsColumnWidthPx: (flagCount: number) => number
|
|
|
8
8
|
export declare const computeActionsColumnWidthPx: (actionCount: number) => number;
|
|
9
9
|
export declare const resolveTrackBySize: (column: DataTableColumn<unknown>, fallback: string) => string;
|
|
10
10
|
export declare const isRouteAction: (action: BackofficeListActionSpec) => action is BackofficeEntityRouteActionSpec<null>;
|
|
11
|
-
export declare const isFormMutationAction: (action: BackofficeListActionSpec) => action is BackofficeEntityFormMutationActionSpec<null>;
|
|
11
|
+
export declare const isFormMutationAction: (action: BackofficeListActionSpec) => action is BackofficeEntityFormMutationActionSpec<null, any, any, any>;
|
|
12
12
|
export declare const resolveActionVariant: (actionVariant: ButtonVariant | undefined, index: number) => Exclude<ButtonVariant, undefined>;
|
|
13
13
|
export declare const resolveRowId: (row: unknown) => string | null;
|
|
14
14
|
export type ConnectionListConfig = BackofficeRuntimeResolvedListFacetConfig & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityListPage.helpers.d.ts","sourceRoot":"","sources":["../../../src/pages/BackofficeEntityListPage.helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EACV,sCAAsC,EACtC,+BAA+B,EAC/B,wBAAwB,EACxB,qCAAqC,EACrC,wCAAwC,EACxC,SAAS,EACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAA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"0.1.
|
|
3
|
+
"version": "0.1.187",
|
|
4
4
|
"description": "React provider and pages for Kronex backoffice",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -179,12 +179,12 @@
|
|
|
179
179
|
"tslib": "^2.8.1"
|
|
180
180
|
},
|
|
181
181
|
"devDependencies": {
|
|
182
|
-
"@plumile/auth": "^0.1.
|
|
183
|
-
"@plumile/backoffice-core": "^0.1.
|
|
184
|
-
"@plumile/filter-query": "^0.1.
|
|
185
|
-
"@plumile/relay": "^0.1.
|
|
186
|
-
"@plumile/router": "^0.1.
|
|
187
|
-
"@plumile/ui": "^0.1.
|
|
182
|
+
"@plumile/auth": "^0.1.187",
|
|
183
|
+
"@plumile/backoffice-core": "^0.1.187",
|
|
184
|
+
"@plumile/filter-query": "^0.1.187",
|
|
185
|
+
"@plumile/relay": "^0.1.187",
|
|
186
|
+
"@plumile/router": "^0.1.187",
|
|
187
|
+
"@plumile/ui": "^0.1.187",
|
|
188
188
|
"@types/react": "19.2.17",
|
|
189
189
|
"@types/react-dom": "19.2.3",
|
|
190
190
|
"@types/relay-runtime": "20.1.1",
|
|
@@ -197,12 +197,12 @@
|
|
|
197
197
|
"typescript": "6.0.3"
|
|
198
198
|
},
|
|
199
199
|
"peerDependencies": {
|
|
200
|
-
"@plumile/auth": "^0.1.
|
|
201
|
-
"@plumile/backoffice-core": "^0.1.
|
|
202
|
-
"@plumile/filter-query": "^0.1.
|
|
203
|
-
"@plumile/relay": "^0.1.
|
|
204
|
-
"@plumile/router": "^0.1.
|
|
205
|
-
"@plumile/ui": "^0.1.
|
|
200
|
+
"@plumile/auth": "^0.1.185",
|
|
201
|
+
"@plumile/backoffice-core": "^0.1.185",
|
|
202
|
+
"@plumile/filter-query": "^0.1.185",
|
|
203
|
+
"@plumile/relay": "^0.1.185",
|
|
204
|
+
"@plumile/router": "^0.1.185",
|
|
205
|
+
"@plumile/ui": "^0.1.185",
|
|
206
206
|
"i18next": "^26.3.1",
|
|
207
207
|
"react": "^19.2.7",
|
|
208
208
|
"react-dom": "^19.2.7",
|