@plumile/backoffice-react 0.1.150 → 0.1.152
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/auth/login/loginPage.css.js +1 -0
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +192 -144
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +0 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -0
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +0 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +0 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +73 -244
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js +193 -0
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -0
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +8 -10
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +130 -133
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js +10 -9
- package/lib/esm/pages/BackofficeEntityDetailUnknownPageRedirect.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +5 -5
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeRedirect.js +13 -0
- package/lib/esm/pages/BackofficeRedirect.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +100 -97
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts +9 -0
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -0
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailUnknownPageRedirect.d.ts.map +1 -1
- package/lib/types/pages/BackofficeRedirect.d.ts +7 -0
- package/lib/types/pages/BackofficeRedirect.d.ts.map +1 -0
- package/lib/types/router/createBackofficeRoutes.d.ts +3 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* empty css */
|
|
1
2
|
/* empty css */
|
|
2
3
|
//#region src/auth/login/loginPage.css.ts
|
|
3
4
|
var e = "txvbqbfpn txvbqbh4x txvbqbheb", t = "txvbqbfpn txvbqbh4x txvbqb19uf", n = "txvbqb1bg3 txvbqb9j txvbqbo7v txvbqbny4", r = "txvbqbey txvbqb1bg3 txvbqbfpn txvbqbhdl txvbqbs00 txvbqbp6j", i = "txvbqb1b9r txvbqbk07 txvbqbfvs txvbqb2wi txvbqb1bk3", a = "txvbqbey txvbqbfpn txvbqbh7g txvbqbhdy txvbqblt7 txvbqbrza", o = "w8yhmy0 txvbqb1b4r txvbqb1tv txvbqb2rt txvbqb1bhb txvbqbv txvbqbhbf txvbqbwvi txvbqb3f txvbqb7h txvbqb76 txvbqb7t txvbqb1etp txvbqb1gct", s = "txvbqb10o0 txvbqb11ll txvbqb12j6 txvbqbxv9 txvbqbc7z txvbqbc27 txvbqbci3 txvbqbce4", c = "txvbqbfpn txvbqbh4x txvbqbheb", l = "txvbqb19uf", u = "txvbqbo7v txvbqbam txvbqbhbs txvbqb1bhb txvbqbmu1", d = "txvbqbrzn", f = "w8yhmy1 txvbqb1f2 txvbqb29r txvbqb2sj txvbqb1bhb txvbqb1b9n txvbqb7h txvbqb75 txvbqb7t";
|
|
@@ -15,20 +15,20 @@ import * as v from "react-relay";
|
|
|
15
15
|
import { Input as y } from "@plumile/ui/atomic/atoms/input/Input.js";
|
|
16
16
|
import { Label as b } from "@plumile/ui/atomic/atoms/label/Label.js";
|
|
17
17
|
import { Modal as se } from "@plumile/ui/atomic/atoms/modal/Modal.js";
|
|
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
|
|
18
|
+
import { Textarea as x } from "@plumile/ui/atomic/atoms/textarea/Textarea.js";
|
|
19
|
+
import { CheckboxField as S } from "@plumile/ui/atomic/molecules/checkbox_field/CheckboxField.js";
|
|
20
|
+
import { FormGroup as C } from "@plumile/ui/atomic/molecules/form/FormGroup.js";
|
|
21
|
+
import { HighlightCode as ce } from "@plumile/ui/atomic/molecules/highlight/HighlightCode.js";
|
|
22
|
+
import { useToast as le } from "@plumile/ui/atomic/molecules/toast/ToastProvider.js";
|
|
23
|
+
import { BackofficeFormSection as ue } from "@plumile/ui/backoffice/molecules/backoffice_form_section/BackofficeFormSection.js";
|
|
24
|
+
import { SimpleSelect as de } from "@plumile/ui/components/select/SimpleSelect.js";
|
|
25
|
+
import fe 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: pe, useRelayEnvironment: me } = v, w = (e, t) => e(t), T = (e) => typeof e == "object" && !!e && !Array.isArray(e), he = (e) => {
|
|
28
|
+
if (!T(e)) return null;
|
|
29
|
+
for (let t of Object.values(e)) if (T(t) && ("status" in t || "result" in t)) return t;
|
|
30
30
|
return null;
|
|
31
|
-
},
|
|
31
|
+
}, E = (e) => {
|
|
32
32
|
let t = {};
|
|
33
33
|
return e.forEach((e) => {
|
|
34
34
|
if (e.kind === "boolean") {
|
|
@@ -45,43 +45,55 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
45
45
|
}
|
|
46
46
|
t[e.id] = "";
|
|
47
47
|
}), t;
|
|
48
|
-
},
|
|
49
|
-
let n =
|
|
48
|
+
}, D = (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 ?? "", ge = (e, t) => {
|
|
49
|
+
let n = E(e.fields);
|
|
50
50
|
if (e.getInitialValues == null) return n;
|
|
51
51
|
let r = e.getInitialValues(t), i = { ...n };
|
|
52
52
|
return e.fields.forEach((e) => {
|
|
53
|
-
e.id in r && (i[e.id] =
|
|
53
|
+
e.id in r && (i[e.id] = D(e, r[e.id]));
|
|
54
54
|
}), i;
|
|
55
|
-
},
|
|
56
|
-
let { t:
|
|
55
|
+
}, O = ({ isOpen: v, action: E, node: D, onClose: O, onSuccess: k }) => {
|
|
56
|
+
let { t: A } = re(), { t: j } = e(), { entities: M } = n(), N = f(fe), P = me(), F = le(), _e = te(), [I, L] = h({}), [ve, R] = h(null), [ye, z] = h({}), [B, V] = h(!1), [H, U] = h(null), [W, G] = h(null), [K, q] = h(null);
|
|
57
57
|
p(() => {
|
|
58
|
-
v && (
|
|
58
|
+
v && (L(ge(E, D)), R(null), z({}), U(null), G(null));
|
|
59
59
|
}, [
|
|
60
|
-
|
|
60
|
+
E,
|
|
61
61
|
v,
|
|
62
|
-
|
|
62
|
+
D
|
|
63
63
|
]);
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
|
|
64
|
+
let J = d(() => {
|
|
65
|
+
B || O();
|
|
66
|
+
}, [B, O]), Y = d((e, t) => {
|
|
67
|
+
L((n) => ({
|
|
68
68
|
...n,
|
|
69
69
|
[e]: t
|
|
70
|
-
})),
|
|
70
|
+
})), z((t) => {
|
|
71
71
|
if (t[e] == null) return t;
|
|
72
72
|
let { [e]: n, ...r } = t;
|
|
73
73
|
return r;
|
|
74
74
|
});
|
|
75
|
-
}, []),
|
|
75
|
+
}, []), be = w(E.label, A), X = d((e) => j("actions.form.errors.required", { label: e }), [j]), xe = d((e) => j("actions.form.errors.invalidNumber", { label: e }), [j]), Se = d((e) => j("actions.form.errors.invalidJson", { label: e }), [j]), Ce = d((e) => j("actions.form.errors.invalidJsonObject", { label: e }), [j]), we = d((e) => j("actions.form.errors.invalidJsonArray", { label: e }), [j]), Te = d(() => {
|
|
76
76
|
let e = {};
|
|
77
|
-
for (let t of
|
|
78
|
-
let n =
|
|
77
|
+
for (let t of E.fields) {
|
|
78
|
+
let n = w(t.label, A), r = I[t.id];
|
|
79
79
|
switch (t.kind) {
|
|
80
80
|
case "text": {
|
|
81
81
|
let i = "";
|
|
82
82
|
if (typeof r == "string" && (i = r.trim()), i === "") {
|
|
83
83
|
if (t.required) return {
|
|
84
|
-
error:
|
|
84
|
+
error: X(n),
|
|
85
|
+
fieldId: t.id
|
|
86
|
+
};
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
e[t.id] = i;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "textarea": {
|
|
93
|
+
let i = "";
|
|
94
|
+
if (typeof r == "string" && (i = r.trim()), i === "") {
|
|
95
|
+
if (t.required) return {
|
|
96
|
+
error: X(n),
|
|
85
97
|
fieldId: t.id
|
|
86
98
|
};
|
|
87
99
|
break;
|
|
@@ -93,14 +105,14 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
93
105
|
let i = "";
|
|
94
106
|
if (typeof r == "string" ? i = r.trim() : typeof r == "number" && Number.isFinite(r) && (i = String(r)), i === "") {
|
|
95
107
|
if (t.required) return {
|
|
96
|
-
error:
|
|
108
|
+
error: X(n),
|
|
97
109
|
fieldId: t.id
|
|
98
110
|
};
|
|
99
111
|
break;
|
|
100
112
|
}
|
|
101
113
|
let a = Number(i);
|
|
102
114
|
if (!Number.isFinite(a)) return {
|
|
103
|
-
error:
|
|
115
|
+
error: xe(n),
|
|
104
116
|
fieldId: t.id
|
|
105
117
|
};
|
|
106
118
|
e[t.id] = a;
|
|
@@ -110,7 +122,7 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
110
122
|
let i = "";
|
|
111
123
|
if (typeof r == "string" && (i = r.trim()), i === "") {
|
|
112
124
|
if (t.required) return {
|
|
113
|
-
error:
|
|
125
|
+
error: X(n),
|
|
114
126
|
fieldId: t.id
|
|
115
127
|
};
|
|
116
128
|
break;
|
|
@@ -125,7 +137,7 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
125
137
|
};
|
|
126
138
|
}
|
|
127
139
|
let o = t.jsonType ?? "object";
|
|
128
|
-
if (o === "object" && !
|
|
140
|
+
if (o === "object" && !T(a)) return {
|
|
129
141
|
error: Ce(n),
|
|
130
142
|
fieldId: t.id
|
|
131
143
|
};
|
|
@@ -140,7 +152,7 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
140
152
|
let i = "";
|
|
141
153
|
if (typeof r == "string" && (i = r.trim()), i === "") {
|
|
142
154
|
if (t.required) return {
|
|
143
|
-
error:
|
|
155
|
+
error: X(n),
|
|
144
156
|
fieldId: t.id
|
|
145
157
|
};
|
|
146
158
|
break;
|
|
@@ -155,7 +167,7 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
155
167
|
let i = "";
|
|
156
168
|
if (typeof r == "string" && (i = r.trim()), i === "") {
|
|
157
169
|
if (t.required) return {
|
|
158
|
-
error:
|
|
170
|
+
error: X(n),
|
|
159
171
|
fieldId: t.id
|
|
160
172
|
};
|
|
161
173
|
break;
|
|
@@ -167,7 +179,7 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
167
179
|
let i = [];
|
|
168
180
|
if (Array.isArray(r) && (i = r.filter((e) => typeof e == "string" && e.trim() !== "")), i.length === 0) {
|
|
169
181
|
if (t.required) return {
|
|
170
|
-
error:
|
|
182
|
+
error: X(n),
|
|
171
183
|
fieldId: t.id
|
|
172
184
|
};
|
|
173
185
|
break;
|
|
@@ -180,122 +192,122 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
180
192
|
}
|
|
181
193
|
return { values: e };
|
|
182
194
|
}, [
|
|
183
|
-
|
|
195
|
+
E.fields,
|
|
184
196
|
we,
|
|
185
197
|
Se,
|
|
186
198
|
Ce,
|
|
199
|
+
xe,
|
|
187
200
|
X,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
F
|
|
201
|
+
A,
|
|
202
|
+
I
|
|
191
203
|
]), Z = d(() => {
|
|
192
|
-
if (
|
|
193
|
-
|
|
204
|
+
if (B) return;
|
|
205
|
+
R(null), z({});
|
|
194
206
|
let e = Te();
|
|
195
207
|
if ("error" in e) {
|
|
196
|
-
|
|
208
|
+
R(e.error), e.fieldId != null && z({ [e.fieldId]: e.error });
|
|
197
209
|
return;
|
|
198
210
|
}
|
|
199
211
|
let n;
|
|
200
212
|
try {
|
|
201
|
-
n =
|
|
213
|
+
n = E.getVariables(D, e.values);
|
|
202
214
|
} catch {
|
|
203
|
-
|
|
215
|
+
R(j("actions.form.errors.invalidPayload"));
|
|
204
216
|
return;
|
|
205
217
|
}
|
|
206
|
-
|
|
207
|
-
mutation:
|
|
218
|
+
V(!0), pe(P, {
|
|
219
|
+
mutation: E.mutation,
|
|
208
220
|
variables: n,
|
|
209
221
|
updater: (e) => {
|
|
210
|
-
|
|
222
|
+
E.updater?.(e, D);
|
|
211
223
|
},
|
|
212
224
|
onCompleted: (e) => {
|
|
213
|
-
|
|
214
|
-
let n =
|
|
225
|
+
V(!1);
|
|
226
|
+
let n = he(e);
|
|
215
227
|
if (n != null) {
|
|
216
|
-
let e =
|
|
217
|
-
|
|
228
|
+
let e = j("actions.form.errors.invalidPayload");
|
|
229
|
+
E.toasts?.error?.message == null ? E.toasts?.error?.title != null && (e = w(E.toasts.error.title, A)) : e = w(E.toasts.error.message, A);
|
|
218
230
|
let r = t(n, {
|
|
219
231
|
defaultErrorMessage: e,
|
|
220
232
|
mapReason: (e) => {
|
|
221
|
-
let t =
|
|
222
|
-
return t == null ? null : typeof t == "function" ?
|
|
233
|
+
let t = E.mapErrorReason?.(e, D);
|
|
234
|
+
return t == null ? null : typeof t == "function" ? w(t, A) : String(t);
|
|
223
235
|
}
|
|
224
236
|
});
|
|
225
237
|
if (!r.ok) {
|
|
226
238
|
let e = Error(r.message);
|
|
227
|
-
if (
|
|
228
|
-
let e =
|
|
229
|
-
|
|
239
|
+
if (R(r.message), E.onError?.(e, D), E.toasts?.error != null) {
|
|
240
|
+
let e = w(E.toasts.error.title, A), t;
|
|
241
|
+
E.toasts.error.message != null && (t = w(E.toasts.error.message, A)), F.error(e, t);
|
|
230
242
|
}
|
|
231
243
|
return;
|
|
232
244
|
}
|
|
233
245
|
}
|
|
234
|
-
|
|
246
|
+
E.onCompleted?.(e, D);
|
|
235
247
|
let r = !1;
|
|
236
|
-
if (
|
|
237
|
-
let t = a(
|
|
238
|
-
toast:
|
|
248
|
+
if (E.result?.render != null && E.result.render(e, D) != null && (r = !0, G(e)), E.toasts?.success != null) {
|
|
249
|
+
let t = a(E.toasts.success, A), n = o({
|
|
250
|
+
toast: E.toasts.success,
|
|
239
251
|
response: e,
|
|
240
|
-
node:
|
|
241
|
-
tApp:
|
|
242
|
-
entities:
|
|
243
|
-
defaultLabel:
|
|
252
|
+
node: D,
|
|
253
|
+
tApp: A,
|
|
254
|
+
entities: M,
|
|
255
|
+
defaultLabel: j("actions.view"),
|
|
244
256
|
navigateTo: (e) => {
|
|
245
|
-
|
|
257
|
+
N?.history.push({ pathname: e });
|
|
246
258
|
}
|
|
247
259
|
});
|
|
248
|
-
|
|
260
|
+
F.push({
|
|
249
261
|
kind: "info",
|
|
250
262
|
title: t.title,
|
|
251
263
|
message: t.message,
|
|
252
264
|
actions: n
|
|
253
265
|
});
|
|
254
266
|
}
|
|
255
|
-
if (
|
|
256
|
-
let t =
|
|
267
|
+
if (E.result != null) {
|
|
268
|
+
let t = E.result.getValue(e, D);
|
|
257
269
|
if (typeof t == "string" && t.trim() !== "") {
|
|
258
|
-
|
|
270
|
+
U(t), k?.();
|
|
259
271
|
return;
|
|
260
272
|
}
|
|
261
273
|
}
|
|
262
274
|
if (r) {
|
|
263
|
-
|
|
275
|
+
k?.();
|
|
264
276
|
return;
|
|
265
277
|
}
|
|
266
|
-
|
|
278
|
+
k?.(), O();
|
|
267
279
|
},
|
|
268
280
|
onError: (e) => {
|
|
269
|
-
if (
|
|
270
|
-
let e =
|
|
271
|
-
|
|
281
|
+
if (V(!1), R(j("actions.form.errors.submitFailed")), E.onError?.(e, D), E.toasts?.error != null) {
|
|
282
|
+
let e = w(E.toasts.error.title, A), t;
|
|
283
|
+
E.toasts.error.message != null && (t = w(E.toasts.error.message, A)), F.error(e, t);
|
|
272
284
|
}
|
|
273
285
|
}
|
|
274
286
|
});
|
|
275
287
|
}, [
|
|
276
|
-
T,
|
|
277
|
-
Te,
|
|
278
|
-
j,
|
|
279
|
-
N,
|
|
280
|
-
z,
|
|
281
288
|
E,
|
|
289
|
+
Te,
|
|
290
|
+
M,
|
|
291
|
+
P,
|
|
292
|
+
B,
|
|
282
293
|
D,
|
|
283
294
|
O,
|
|
284
|
-
M?.history,
|
|
285
|
-
A,
|
|
286
295
|
k,
|
|
287
|
-
|
|
296
|
+
N?.history,
|
|
297
|
+
j,
|
|
298
|
+
A,
|
|
299
|
+
F
|
|
288
300
|
]), Ee = d((e) => {
|
|
289
301
|
e.preventDefault(), Z();
|
|
290
|
-
}, [Z]), Q = m(() =>
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
]), $ =
|
|
302
|
+
}, [Z]), Q = m(() => E.result == null ? null : w(E.result.label, A), [E.result, A]), De = m(() => E.result?.render == null || W == null ? null : E.result.render(W, D), [
|
|
303
|
+
E.result,
|
|
304
|
+
D,
|
|
305
|
+
W
|
|
306
|
+
]), $ = H != null && Q != null || De != null, Oe = w(E.label, A);
|
|
295
307
|
return v ? /* @__PURE__ */ _(ne, { children: [/* @__PURE__ */ g(se, {
|
|
296
308
|
isOpen: v,
|
|
297
|
-
onClose:
|
|
298
|
-
title:
|
|
309
|
+
onClose: J,
|
|
310
|
+
title: be,
|
|
299
311
|
initialFocus: "first-form-control",
|
|
300
312
|
footer: /* @__PURE__ */ _("div", {
|
|
301
313
|
className: s,
|
|
@@ -303,16 +315,16 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
303
315
|
type: "button",
|
|
304
316
|
variant: "secondary",
|
|
305
317
|
size: "small",
|
|
306
|
-
disabled:
|
|
307
|
-
onClick:
|
|
308
|
-
children:
|
|
318
|
+
disabled: B,
|
|
319
|
+
onClick: J,
|
|
320
|
+
children: j("actions.form.cancel")
|
|
309
321
|
}), !$ && /* @__PURE__ */ g(ie, {
|
|
310
322
|
type: "submit",
|
|
311
323
|
variant: "primary",
|
|
312
324
|
size: "small",
|
|
313
|
-
disabled:
|
|
314
|
-
isLoading:
|
|
315
|
-
loadingLabel:
|
|
325
|
+
disabled: B,
|
|
326
|
+
isLoading: B,
|
|
327
|
+
loadingLabel: j("actions.form.submitting"),
|
|
316
328
|
onClick: Z,
|
|
317
329
|
children: Oe
|
|
318
330
|
})]
|
|
@@ -321,19 +333,19 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
321
333
|
onSubmit: Ee,
|
|
322
334
|
className: u,
|
|
323
335
|
children: [
|
|
324
|
-
/* @__PURE__ */ g(ae, { message:
|
|
325
|
-
/* @__PURE__ */ g(
|
|
326
|
-
let t =
|
|
327
|
-
e.description != null && (n =
|
|
328
|
-
let i = `${
|
|
336
|
+
/* @__PURE__ */ g(ae, { message: ve }),
|
|
337
|
+
/* @__PURE__ */ g(ue, { children: E.fields.map((e) => {
|
|
338
|
+
let t = w(e.label, A), n = null;
|
|
339
|
+
e.description != null && (n = w(e.description, A));
|
|
340
|
+
let i = `${_e}-${e.id}`, a = `${i}-description`, o = `${i}-error`, s = ye[e.id] ?? null, u = s != null, d, f = "default";
|
|
329
341
|
u && (d = "error", f = "error");
|
|
330
342
|
let p;
|
|
331
343
|
switch (n != null && s != null ? p = `${a} ${o}` : n == null ? s != null && (p = o) : p = a, e.kind) {
|
|
332
344
|
case "text": {
|
|
333
|
-
let r =
|
|
345
|
+
let r = I[e.id], c = "";
|
|
334
346
|
typeof r == "string" && (c = r);
|
|
335
347
|
let l;
|
|
336
|
-
return e.placeholder != null && (l =
|
|
348
|
+
return e.placeholder != null && (l = w(e.placeholder, A)), /* @__PURE__ */ _(C, { children: [
|
|
337
349
|
/* @__PURE__ */ g(b, {
|
|
338
350
|
htmlFor: i,
|
|
339
351
|
required: e.required,
|
|
@@ -351,10 +363,46 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
351
363
|
placeholder: l,
|
|
352
364
|
"aria-describedby": p,
|
|
353
365
|
"aria-invalid": u,
|
|
354
|
-
disabled:
|
|
366
|
+
disabled: B,
|
|
367
|
+
variant: d,
|
|
368
|
+
onChange: (t) => {
|
|
369
|
+
Y(e.id, t.target.value);
|
|
370
|
+
},
|
|
371
|
+
fullWidth: !0
|
|
372
|
+
}),
|
|
373
|
+
s != null && /* @__PURE__ */ g("span", {
|
|
374
|
+
id: o,
|
|
375
|
+
className: "txvbqb96 txvbqb1bij",
|
|
376
|
+
children: s
|
|
377
|
+
})
|
|
378
|
+
] }, e.id);
|
|
379
|
+
}
|
|
380
|
+
case "textarea": {
|
|
381
|
+
let r = I[e.id], c = "";
|
|
382
|
+
typeof r == "string" && (c = r);
|
|
383
|
+
let l;
|
|
384
|
+
return e.placeholder != null && (l = w(e.placeholder, A)), /* @__PURE__ */ _(C, { children: [
|
|
385
|
+
/* @__PURE__ */ g(b, {
|
|
386
|
+
htmlFor: i,
|
|
387
|
+
required: e.required,
|
|
388
|
+
children: t
|
|
389
|
+
}),
|
|
390
|
+
n != null && /* @__PURE__ */ g("span", {
|
|
391
|
+
id: a,
|
|
392
|
+
className: "txvbqb96 txvbqb1bff",
|
|
393
|
+
children: n
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ g(x, {
|
|
396
|
+
id: i,
|
|
397
|
+
value: c,
|
|
398
|
+
placeholder: l,
|
|
399
|
+
rows: e.rows ?? 8,
|
|
400
|
+
"aria-describedby": p,
|
|
401
|
+
"aria-invalid": u,
|
|
402
|
+
disabled: B,
|
|
355
403
|
variant: d,
|
|
356
404
|
onChange: (t) => {
|
|
357
|
-
|
|
405
|
+
Y(e.id, t.target.value);
|
|
358
406
|
},
|
|
359
407
|
fullWidth: !0
|
|
360
408
|
}),
|
|
@@ -366,10 +414,10 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
366
414
|
] }, e.id);
|
|
367
415
|
}
|
|
368
416
|
case "number": {
|
|
369
|
-
let r =
|
|
417
|
+
let r = I[e.id], c = "";
|
|
370
418
|
typeof r == "string" && (c = r);
|
|
371
419
|
let l;
|
|
372
|
-
return e.placeholder != null && (l =
|
|
420
|
+
return e.placeholder != null && (l = w(e.placeholder, A)), /* @__PURE__ */ _(C, { children: [
|
|
373
421
|
/* @__PURE__ */ g(b, {
|
|
374
422
|
htmlFor: i,
|
|
375
423
|
required: e.required,
|
|
@@ -387,10 +435,10 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
387
435
|
placeholder: l,
|
|
388
436
|
"aria-describedby": p,
|
|
389
437
|
"aria-invalid": u,
|
|
390
|
-
disabled:
|
|
438
|
+
disabled: B,
|
|
391
439
|
variant: d,
|
|
392
440
|
onChange: (t) => {
|
|
393
|
-
|
|
441
|
+
Y(e.id, t.target.value);
|
|
394
442
|
},
|
|
395
443
|
fullWidth: !0
|
|
396
444
|
}),
|
|
@@ -402,10 +450,10 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
402
450
|
] }, e.id);
|
|
403
451
|
}
|
|
404
452
|
case "json": {
|
|
405
|
-
let r =
|
|
453
|
+
let r = I[e.id], c = "";
|
|
406
454
|
typeof r == "string" && (c = r);
|
|
407
455
|
let l;
|
|
408
|
-
return e.placeholder != null && (l =
|
|
456
|
+
return e.placeholder != null && (l = w(e.placeholder, A)), /* @__PURE__ */ _(C, { children: [
|
|
409
457
|
/* @__PURE__ */ g(b, {
|
|
410
458
|
htmlFor: i,
|
|
411
459
|
required: e.required,
|
|
@@ -416,17 +464,17 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
416
464
|
className: "txvbqb96 txvbqb1bff",
|
|
417
465
|
children: n
|
|
418
466
|
}),
|
|
419
|
-
/* @__PURE__ */ g(
|
|
467
|
+
/* @__PURE__ */ g(x, {
|
|
420
468
|
id: i,
|
|
421
469
|
value: c,
|
|
422
470
|
placeholder: l,
|
|
423
471
|
rows: 8,
|
|
424
472
|
"aria-describedby": p,
|
|
425
473
|
"aria-invalid": u,
|
|
426
|
-
disabled:
|
|
474
|
+
disabled: B,
|
|
427
475
|
variant: d,
|
|
428
476
|
onChange: (t) => {
|
|
429
|
-
|
|
477
|
+
Y(e.id, t.target.value);
|
|
430
478
|
},
|
|
431
479
|
fullWidth: !0
|
|
432
480
|
}),
|
|
@@ -438,14 +486,14 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
438
486
|
] }, e.id);
|
|
439
487
|
}
|
|
440
488
|
case "enum": {
|
|
441
|
-
let r =
|
|
489
|
+
let r = I[e.id], c = "";
|
|
442
490
|
typeof r == "string" && (c = r);
|
|
443
491
|
let l = e.options.map((e) => ({
|
|
444
492
|
id: e.value,
|
|
445
493
|
value: e.value,
|
|
446
|
-
label:
|
|
494
|
+
label: w(e.label, A)
|
|
447
495
|
}));
|
|
448
|
-
return /* @__PURE__ */ _(
|
|
496
|
+
return /* @__PURE__ */ _(C, { children: [
|
|
449
497
|
/* @__PURE__ */ g(b, {
|
|
450
498
|
id: `${i}-label`,
|
|
451
499
|
required: e.required,
|
|
@@ -456,17 +504,17 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
456
504
|
className: "txvbqb96 txvbqb1bff",
|
|
457
505
|
children: n
|
|
458
506
|
}),
|
|
459
|
-
/* @__PURE__ */ g(
|
|
507
|
+
/* @__PURE__ */ g(de, {
|
|
460
508
|
options: l,
|
|
461
509
|
value: c,
|
|
462
510
|
placeholder: t,
|
|
463
511
|
ariaDescribedBy: p,
|
|
464
512
|
ariaInvalid: u,
|
|
465
513
|
ariaLabelledBy: `${i}-label`,
|
|
466
|
-
isDisabled:
|
|
514
|
+
isDisabled: B,
|
|
467
515
|
state: f,
|
|
468
516
|
onChange: (t) => {
|
|
469
|
-
|
|
517
|
+
Y(e.id, t);
|
|
470
518
|
}
|
|
471
519
|
}),
|
|
472
520
|
s != null && /* @__PURE__ */ g("span", {
|
|
@@ -477,22 +525,22 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
477
525
|
] }, e.id);
|
|
478
526
|
}
|
|
479
527
|
case "boolean": {
|
|
480
|
-
let r =
|
|
481
|
-
return /* @__PURE__ */ g(
|
|
528
|
+
let r = I[e.id] === !0;
|
|
529
|
+
return /* @__PURE__ */ g(C, { children: /* @__PURE__ */ g(S, {
|
|
482
530
|
id: i,
|
|
483
531
|
label: t,
|
|
484
532
|
helperText: n ?? void 0,
|
|
485
533
|
error: s ?? void 0,
|
|
486
534
|
checked: r,
|
|
487
|
-
disabled:
|
|
535
|
+
disabled: B,
|
|
488
536
|
onChange: (t) => {
|
|
489
|
-
|
|
537
|
+
Y(e.id, t.target.checked);
|
|
490
538
|
}
|
|
491
539
|
}) }, e.id);
|
|
492
540
|
}
|
|
493
541
|
case "entityId": {
|
|
494
|
-
let c =
|
|
495
|
-
return typeof c == "string" && (l = c), /* @__PURE__ */ _(
|
|
542
|
+
let c = I[e.id], l = "";
|
|
543
|
+
return typeof c == "string" && (l = c), /* @__PURE__ */ _(C, { children: [
|
|
496
544
|
/* @__PURE__ */ g(b, {
|
|
497
545
|
htmlFor: i,
|
|
498
546
|
required: e.required,
|
|
@@ -509,16 +557,16 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
509
557
|
value: l,
|
|
510
558
|
ariaDescribedBy: p,
|
|
511
559
|
ariaInvalid: u,
|
|
512
|
-
disabled:
|
|
560
|
+
disabled: B,
|
|
513
561
|
onPick: () => {
|
|
514
|
-
|
|
562
|
+
q({
|
|
515
563
|
fieldId: e.id,
|
|
516
564
|
entity: e.entity,
|
|
517
565
|
label: t
|
|
518
566
|
});
|
|
519
567
|
},
|
|
520
568
|
onClear: () => {
|
|
521
|
-
|
|
569
|
+
Y(e.id, "");
|
|
522
570
|
}
|
|
523
571
|
}),
|
|
524
572
|
s != null && /* @__PURE__ */ g("span", {
|
|
@@ -529,8 +577,8 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
529
577
|
] }, e.id);
|
|
530
578
|
}
|
|
531
579
|
case "multiEnum": {
|
|
532
|
-
let r =
|
|
533
|
-
return Array.isArray(r) && (f = r.filter((e) => typeof e == "string")), /* @__PURE__ */ _(
|
|
580
|
+
let r = I[e.id], d = `${i}-legend`, f = [];
|
|
581
|
+
return Array.isArray(r) && (f = r.filter((e) => typeof e == "string")), /* @__PURE__ */ _(C, { children: [/* @__PURE__ */ _("fieldset", {
|
|
534
582
|
className: l,
|
|
535
583
|
children: [
|
|
536
584
|
/* @__PURE__ */ _("legend", {
|
|
@@ -553,15 +601,15 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
553
601
|
"aria-describedby": p,
|
|
554
602
|
"aria-invalid": u,
|
|
555
603
|
children: e.options.map((t, n) => {
|
|
556
|
-
let r =
|
|
557
|
-
return /* @__PURE__ */ g(
|
|
604
|
+
let r = w(t.label, A), a = f.includes(t.value);
|
|
605
|
+
return /* @__PURE__ */ g(S, {
|
|
558
606
|
id: `${i}-${n}`,
|
|
559
607
|
label: r,
|
|
560
608
|
checked: a,
|
|
561
|
-
disabled:
|
|
609
|
+
disabled: B,
|
|
562
610
|
onChange: (n) => {
|
|
563
611
|
let r = f;
|
|
564
|
-
n.target.checked ? f.includes(t.value) || (r = [...f, t.value]) : r = f.filter((e) => e !== t.value),
|
|
612
|
+
n.target.checked ? f.includes(t.value) || (r = [...f, t.value]) : r = f.filter((e) => e !== t.value), Y(e.id, r);
|
|
565
613
|
}
|
|
566
614
|
}, `${t.value}-${n}`);
|
|
567
615
|
})
|
|
@@ -578,27 +626,27 @@ var { commitMutation: me, useRelayEnvironment: he } = v, C = (e, t) => e(t), w =
|
|
|
578
626
|
}) }),
|
|
579
627
|
$ && /* @__PURE__ */ _("div", {
|
|
580
628
|
className: "txvbqbfpn txvbqbh4x txvbqbhdl",
|
|
581
|
-
children: [
|
|
629
|
+
children: [H != null && Q != null && /* @__PURE__ */ g(ce, {
|
|
582
630
|
badgeLabel: Q,
|
|
583
|
-
copyCode:
|
|
584
|
-
fallbackCodeText:
|
|
631
|
+
copyCode: H,
|
|
632
|
+
fallbackCodeText: H
|
|
585
633
|
}), De]
|
|
586
634
|
})
|
|
587
635
|
]
|
|
588
636
|
})
|
|
589
637
|
}), /* @__PURE__ */ g(i, {
|
|
590
|
-
isOpen:
|
|
591
|
-
entity:
|
|
592
|
-
title:
|
|
638
|
+
isOpen: K != null,
|
|
639
|
+
entity: K?.entity ?? "",
|
|
640
|
+
title: K?.label ?? "",
|
|
593
641
|
onClose: () => {
|
|
594
|
-
|
|
642
|
+
q(null);
|
|
595
643
|
},
|
|
596
644
|
onSelectId: (e) => {
|
|
597
|
-
|
|
645
|
+
K != null && (Y(K.fieldId, e), q(null));
|
|
598
646
|
}
|
|
599
647
|
})] }) : null;
|
|
600
648
|
};
|
|
601
649
|
//#endregion
|
|
602
|
-
export {
|
|
650
|
+
export { O as BackofficeEntityActionFormDialog, O as default };
|
|
603
651
|
|
|
604
652
|
//# sourceMappingURL=BackofficeEntityActionFormDialog.js.map
|