@trungkhai/dynamic-form 0.1.2 → 0.1.4
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/dist/index.cjs.js +1 -1
- package/dist/index.es.js +721 -646
- package/package.json +5 -3
package/dist/index.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import
|
|
5
|
-
import { FileImageOutlined as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as u, jsxs as Be, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { Select as Ee, Form as G, Upload as ke, Button as Re, DatePicker as We, Checkbox as Ie, Radio as Ke, InputNumber as $e, Input as we, Row as ze, Col as He, App as Ye, Flex as de, Spin as ue } from "antd";
|
|
3
|
+
import { createContext as Ne, useContext as De, memo as V, useState as x, useMemo as P, useEffect as B, useCallback as L, useRef as K, forwardRef as Je, useImperativeHandle as Qe } from "react";
|
|
4
|
+
import ae from "dayjs";
|
|
5
|
+
import { FileImageOutlined as Xe, UploadOutlined as Ze } from "@ant-design/icons";
|
|
6
|
+
const fe = Ne(
|
|
7
7
|
null
|
|
8
8
|
);
|
|
9
|
-
function
|
|
10
|
-
const e =
|
|
9
|
+
function O() {
|
|
10
|
+
const e = De(fe);
|
|
11
11
|
if (!e)
|
|
12
12
|
throw new Error(
|
|
13
13
|
"useDynamicFormContext must be used within DynamicFormProvider"
|
|
14
14
|
);
|
|
15
15
|
return e;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function nn() {
|
|
18
|
+
return De(fe);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function et(e, t = []) {
|
|
21
21
|
for (const r of t) {
|
|
22
22
|
if (typeof r == "function")
|
|
23
23
|
continue;
|
|
@@ -32,15 +32,15 @@ function Xe(e, t = []) {
|
|
|
32
32
|
for (const r of t)
|
|
33
33
|
;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
35
|
+
function tt(e, t = [], n = {}) {
|
|
36
|
+
return et(e, t) ?? n[e.code] ?? n[e.field?.type?.code ?? ""];
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function nt(e, t) {
|
|
39
39
|
const n = t.option_config?.label_attr, r = t.option_config?.value_attr || "value";
|
|
40
40
|
let i;
|
|
41
41
|
if (n?.length) {
|
|
42
42
|
const a = n.join(" - ");
|
|
43
|
-
e[a] !== void 0 ? i = String(e[a]) : i = n.map((
|
|
43
|
+
e[a] !== void 0 ? i = String(e[a]) : i = n.map((o) => e[o]).filter((o) => o != null && o !== "").join(" - ");
|
|
44
44
|
} else
|
|
45
45
|
i = String(e[r] ?? "");
|
|
46
46
|
return {
|
|
@@ -48,107 +48,118 @@ function et(e, t) {
|
|
|
48
48
|
value: e[r]
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return t.option_config && t.is_option_api ? e?.map((n) =>
|
|
51
|
+
function rt(e, t) {
|
|
52
|
+
return t.option_config && t.is_option_api ? e?.map((n) => nt(n, t)) : t.metas?.map((n) => ({
|
|
53
53
|
label: n.label,
|
|
54
54
|
value: n.value
|
|
55
55
|
}));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Pe(e, t) {
|
|
58
|
+
const n = t.option_config?.value_attr || "value";
|
|
59
|
+
return e[n];
|
|
60
|
+
}
|
|
61
|
+
function it(e, t) {
|
|
62
|
+
const n = /* @__PURE__ */ new Set(), r = [];
|
|
63
|
+
return e.forEach((i) => {
|
|
64
|
+
const a = Pe(i, t), o = String(a);
|
|
65
|
+
n.has(o) || (n.add(o), r.push(i));
|
|
66
|
+
}), r;
|
|
67
|
+
}
|
|
68
|
+
function me(e, t) {
|
|
58
69
|
let n;
|
|
59
70
|
return (...r) => {
|
|
60
71
|
n && clearTimeout(n), n = setTimeout(() => e(...r), t);
|
|
61
72
|
};
|
|
62
73
|
}
|
|
63
|
-
const
|
|
74
|
+
const at = ({
|
|
64
75
|
onSearchKeyword: e,
|
|
65
76
|
searchDebounceMs: t = 500,
|
|
66
77
|
...n
|
|
67
78
|
}) => {
|
|
68
|
-
const [r, i] =
|
|
69
|
-
() =>
|
|
79
|
+
const [r, i] = x(""), a = P(
|
|
80
|
+
() => me((s) => e?.(s), t),
|
|
70
81
|
[e, t]
|
|
71
82
|
);
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
83
|
+
return /* @__PURE__ */ u(
|
|
84
|
+
Ee,
|
|
74
85
|
{
|
|
75
86
|
allowClear: !0,
|
|
76
87
|
showSearch: !0,
|
|
77
88
|
searchValue: r,
|
|
78
|
-
onSearch: (
|
|
79
|
-
i(
|
|
89
|
+
onSearch: (s) => {
|
|
90
|
+
i(s), a(s);
|
|
80
91
|
},
|
|
81
92
|
filterOption: !1,
|
|
82
93
|
...n
|
|
83
94
|
}
|
|
84
95
|
);
|
|
85
|
-
},
|
|
96
|
+
}, ot = V(at), st = ({
|
|
86
97
|
fieldName: e,
|
|
87
98
|
formInstance: t,
|
|
88
99
|
...n
|
|
89
100
|
}) => {
|
|
90
|
-
const r =
|
|
91
|
-
return
|
|
101
|
+
const r = G.useWatch(e, t);
|
|
102
|
+
return B(() => {
|
|
92
103
|
if (r?.fileList?.length && r.fileList.some(
|
|
93
|
-
(
|
|
104
|
+
(o) => !o.type?.startsWith("image/")
|
|
94
105
|
)) {
|
|
95
|
-
const
|
|
96
|
-
(
|
|
106
|
+
const o = r.fileList.filter(
|
|
107
|
+
(s) => s.type?.startsWith("image/")
|
|
97
108
|
);
|
|
98
109
|
t.setFieldValue(
|
|
99
110
|
e,
|
|
100
|
-
|
|
101
|
-
file:
|
|
102
|
-
fileList:
|
|
111
|
+
o?.length ? {
|
|
112
|
+
file: o[0]?.originFileObj,
|
|
113
|
+
fileList: o
|
|
103
114
|
} : null
|
|
104
115
|
);
|
|
105
116
|
}
|
|
106
|
-
}, [e, t, r]), /* @__PURE__ */
|
|
117
|
+
}, [e, t, r]), /* @__PURE__ */ u(ke, { listType: "picture-card", accept: "image/*", ...n, children: /* @__PURE__ */ u(
|
|
107
118
|
"button",
|
|
108
119
|
{
|
|
109
120
|
style: { border: 0, background: "none", cursor: "pointer" },
|
|
110
121
|
type: "button",
|
|
111
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ u(Xe, {})
|
|
112
123
|
}
|
|
113
124
|
) });
|
|
114
|
-
},
|
|
125
|
+
}, lt = V(st), ct = ({
|
|
115
126
|
fieldName: e,
|
|
116
127
|
formInstance: t,
|
|
117
128
|
...n
|
|
118
129
|
}) => {
|
|
119
|
-
const r =
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
},
|
|
130
|
+
const r = G.useWatch(e, t);
|
|
131
|
+
return /* @__PURE__ */ u(ke, { fileList: r?.fileList, ...n, children: /* @__PURE__ */ u(Re, { icon: /* @__PURE__ */ u(Ze, {}) }) });
|
|
132
|
+
}, dt = V(ct), ut = ({
|
|
122
133
|
formInstance: e,
|
|
123
134
|
uploadUrl: t,
|
|
124
135
|
setFieldState: n
|
|
125
136
|
}) => {
|
|
126
|
-
const { client: r, upload: i, i18n: a, renderers:
|
|
137
|
+
const { client: r, upload: i, i18n: a, renderers: o } = O(), { messages: s } = a, d = L(() => {
|
|
127
138
|
if (i.upload) return i.upload;
|
|
128
139
|
const l = t ?? i.uploadUrl;
|
|
129
140
|
if (l)
|
|
130
|
-
return async ({ file: p, signal:
|
|
131
|
-
const
|
|
141
|
+
return async ({ file: p, signal: h, onProgress: f, fieldCode: _, fieldGroup: v, metadata: b }) => {
|
|
142
|
+
const w = i.getPayload ? i.getPayload({
|
|
132
143
|
file: p,
|
|
133
|
-
fieldCode:
|
|
134
|
-
fieldGroup:
|
|
144
|
+
fieldCode: _,
|
|
145
|
+
fieldGroup: v,
|
|
135
146
|
uploadUrl: l,
|
|
136
|
-
signal:
|
|
137
|
-
onProgress:
|
|
138
|
-
metadata:
|
|
147
|
+
signal: h,
|
|
148
|
+
onProgress: f,
|
|
149
|
+
metadata: b
|
|
139
150
|
}) : (() => {
|
|
140
151
|
const g = new FormData();
|
|
141
|
-
return g.append("file", p),
|
|
142
|
-
g.append(
|
|
152
|
+
return g.append("file", p), b && Object.entries(b).forEach(([k, E]) => {
|
|
153
|
+
g.append(k, String(E));
|
|
143
154
|
}), g;
|
|
144
155
|
})(), A = (await r.request({
|
|
145
156
|
method: "POST",
|
|
146
157
|
url: l,
|
|
147
|
-
data:
|
|
148
|
-
headers:
|
|
149
|
-
signal:
|
|
158
|
+
data: w,
|
|
159
|
+
headers: w instanceof FormData ? { "Content-Type": "multipart/form-data" } : void 0,
|
|
160
|
+
signal: h,
|
|
150
161
|
onUploadProgress: (g) => {
|
|
151
|
-
|
|
162
|
+
f?.(
|
|
152
163
|
Math.round(g.loaded * 100 / (g.total || 1))
|
|
153
164
|
);
|
|
154
165
|
}
|
|
@@ -159,145 +170,145 @@ const nt = ({
|
|
|
159
170
|
path: String(A.path ?? "")
|
|
160
171
|
};
|
|
161
172
|
};
|
|
162
|
-
}, [r, i, t]), c =
|
|
163
|
-
(l, p) => (
|
|
164
|
-
const { file:
|
|
173
|
+
}, [r, i, t]), c = L(
|
|
174
|
+
(l, p) => (h) => {
|
|
175
|
+
const { file: f, onProgress: _, onError: v, onSuccess: b } = h, w = new AbortController(), S = d();
|
|
165
176
|
return S ? (S({
|
|
166
|
-
file:
|
|
177
|
+
file: f,
|
|
167
178
|
fieldCode: l,
|
|
168
179
|
fieldGroup: p,
|
|
169
180
|
uploadUrl: t ?? i.uploadUrl,
|
|
170
|
-
signal:
|
|
171
|
-
onProgress: (A) =>
|
|
181
|
+
signal: w.signal,
|
|
182
|
+
onProgress: (A) => _?.({ percent: A })
|
|
172
183
|
}).then(
|
|
173
|
-
(A) =>
|
|
184
|
+
(A) => b?.({
|
|
174
185
|
...A,
|
|
175
|
-
uid: A.uid ??
|
|
186
|
+
uid: A.uid ?? f.uid,
|
|
176
187
|
path: A.path,
|
|
177
|
-
upload_date:
|
|
188
|
+
upload_date: ae().format("YYYY-MM-DD HH:mm:ss")
|
|
178
189
|
})
|
|
179
|
-
).catch((A) =>
|
|
190
|
+
).catch((A) => v?.(A)), { abort: () => w.abort() }) : (v?.(new Error(s.uploadError ?? "Upload not configured")), { abort() {
|
|
180
191
|
} });
|
|
181
192
|
},
|
|
182
|
-
[
|
|
183
|
-
),
|
|
184
|
-
(l, p) => async (
|
|
185
|
-
const
|
|
186
|
-
return
|
|
193
|
+
[s.uploadError, d, i.uploadUrl, t]
|
|
194
|
+
), y = L(
|
|
195
|
+
(l, p) => async (h) => {
|
|
196
|
+
const f = h.response?.path;
|
|
197
|
+
return f ? i.remove({ path: f, fieldCode: l, fieldGroup: p }) : !0;
|
|
187
198
|
},
|
|
188
199
|
[i]
|
|
189
|
-
), m =
|
|
200
|
+
), m = L(
|
|
190
201
|
(l, {
|
|
191
202
|
state: p,
|
|
192
|
-
options:
|
|
193
|
-
optionsLoading:
|
|
194
|
-
optionsError:
|
|
195
|
-
onSearchKeyword:
|
|
196
|
-
readOnly:
|
|
203
|
+
options: h,
|
|
204
|
+
optionsLoading: f,
|
|
205
|
+
optionsError: _,
|
|
206
|
+
onSearchKeyword: v,
|
|
207
|
+
readOnly: b = !1
|
|
197
208
|
}) => {
|
|
198
|
-
const { additional_config:
|
|
209
|
+
const { additional_config: w, field: S } = l, A = S?.type?.code, g = b || l.is_readonly || p?.disabled, k = tt(
|
|
199
210
|
l,
|
|
200
|
-
|
|
211
|
+
o.fields
|
|
201
212
|
);
|
|
202
|
-
if (
|
|
203
|
-
return
|
|
213
|
+
if (k)
|
|
214
|
+
return k(l, {
|
|
204
215
|
state: p,
|
|
205
|
-
options:
|
|
206
|
-
optionsLoading:
|
|
207
|
-
optionsError:
|
|
208
|
-
onSearchKeyword:
|
|
209
|
-
readOnly:
|
|
216
|
+
options: h,
|
|
217
|
+
optionsLoading: f,
|
|
218
|
+
optionsError: _,
|
|
219
|
+
onSearchKeyword: v,
|
|
220
|
+
readOnly: b,
|
|
210
221
|
formInstance: e,
|
|
211
222
|
disabled: !!g,
|
|
212
223
|
setFieldState: n
|
|
213
224
|
});
|
|
214
|
-
const
|
|
225
|
+
const E = rt(h, l);
|
|
215
226
|
switch (A) {
|
|
216
227
|
case "text":
|
|
217
|
-
return
|
|
218
|
-
|
|
228
|
+
return w?.text?.textarea ? /* @__PURE__ */ u(
|
|
229
|
+
we.TextArea,
|
|
219
230
|
{
|
|
220
231
|
disabled: g,
|
|
221
|
-
placeholder:
|
|
222
|
-
rows:
|
|
232
|
+
placeholder: s.inputPlaceholder(l.label),
|
|
233
|
+
rows: w?.text?.rows
|
|
223
234
|
}
|
|
224
|
-
) : /* @__PURE__ */
|
|
225
|
-
|
|
235
|
+
) : /* @__PURE__ */ u(
|
|
236
|
+
we,
|
|
226
237
|
{
|
|
227
238
|
disabled: g,
|
|
228
|
-
placeholder:
|
|
239
|
+
placeholder: s.inputPlaceholder(l.label)
|
|
229
240
|
}
|
|
230
241
|
);
|
|
231
242
|
case "number":
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
243
|
+
return /* @__PURE__ */ u(
|
|
244
|
+
$e,
|
|
234
245
|
{
|
|
235
246
|
style: { width: "100%" },
|
|
236
247
|
disabled: g,
|
|
237
|
-
placeholder:
|
|
238
|
-
min:
|
|
239
|
-
max:
|
|
248
|
+
placeholder: s.inputPlaceholder(l.label),
|
|
249
|
+
min: w?.number?.min,
|
|
250
|
+
max: w?.number?.max
|
|
240
251
|
}
|
|
241
252
|
);
|
|
242
253
|
case "select": {
|
|
243
|
-
const
|
|
254
|
+
const M = {
|
|
244
255
|
disabled: g,
|
|
245
|
-
options:
|
|
246
|
-
placeholder:
|
|
256
|
+
options: E,
|
|
257
|
+
placeholder: s.selectPlaceholder(l.label),
|
|
247
258
|
allowClear: !0,
|
|
248
|
-
loading:
|
|
249
|
-
mode:
|
|
250
|
-
notFoundContent:
|
|
259
|
+
loading: f,
|
|
260
|
+
mode: w?.select?.multiple ? "multiple" : void 0,
|
|
261
|
+
notFoundContent: _ ? s.optionError : f ? s.optionLoading : void 0
|
|
251
262
|
};
|
|
252
|
-
return
|
|
253
|
-
|
|
263
|
+
return v ? /* @__PURE__ */ u(
|
|
264
|
+
ot,
|
|
254
265
|
{
|
|
255
|
-
...
|
|
256
|
-
onSearchKeyword:
|
|
257
|
-
searchDebounceMs:
|
|
266
|
+
...M,
|
|
267
|
+
onSearchKeyword: v,
|
|
268
|
+
searchDebounceMs: w?.select?.searchDebounceMs ?? 500
|
|
258
269
|
}
|
|
259
|
-
) : /* @__PURE__ */
|
|
270
|
+
) : /* @__PURE__ */ u(Ee, { ...M, showSearch: !0, optionFilterProp: "label" });
|
|
260
271
|
}
|
|
261
272
|
case "radio":
|
|
262
|
-
return /* @__PURE__ */
|
|
273
|
+
return /* @__PURE__ */ u(Ke.Group, { disabled: g, options: E });
|
|
263
274
|
case "checkbox":
|
|
264
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ u(Ie.Group, { disabled: g, options: E });
|
|
265
276
|
case "datetime":
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
-
|
|
277
|
+
return /* @__PURE__ */ u(
|
|
278
|
+
We,
|
|
268
279
|
{
|
|
269
280
|
style: { width: "100%" },
|
|
270
281
|
disabled: g,
|
|
271
|
-
showTime:
|
|
272
|
-
format:
|
|
282
|
+
showTime: w?.datetime?.showTime,
|
|
283
|
+
format: w?.datetime?.format
|
|
273
284
|
}
|
|
274
285
|
);
|
|
275
286
|
case "file":
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
-
|
|
287
|
+
return /* @__PURE__ */ u(
|
|
288
|
+
dt,
|
|
278
289
|
{
|
|
279
290
|
disabled: g,
|
|
280
291
|
fieldName: l.code,
|
|
281
292
|
formInstance: e,
|
|
282
|
-
multiple:
|
|
283
|
-
maxCount:
|
|
284
|
-
accept:
|
|
293
|
+
multiple: w?.file?.multiple || !1,
|
|
294
|
+
maxCount: w?.file?.max,
|
|
295
|
+
accept: w?.file?.accept,
|
|
285
296
|
customRequest: c(l.code, l),
|
|
286
|
-
onRemove:
|
|
297
|
+
onRemove: y(l.code, l)
|
|
287
298
|
}
|
|
288
299
|
);
|
|
289
300
|
case "image":
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
-
|
|
301
|
+
return /* @__PURE__ */ u(
|
|
302
|
+
lt,
|
|
292
303
|
{
|
|
293
304
|
disabled: g,
|
|
294
305
|
fieldName: l.code,
|
|
295
306
|
formInstance: e,
|
|
296
|
-
multiple:
|
|
297
|
-
maxCount:
|
|
298
|
-
accept:
|
|
307
|
+
multiple: w?.image?.multiple || !1,
|
|
308
|
+
maxCount: w?.image?.max,
|
|
309
|
+
accept: w?.image?.accept ?? "image/*",
|
|
299
310
|
customRequest: c(l.code, l),
|
|
300
|
-
onRemove:
|
|
311
|
+
onRemove: y(l.code, l)
|
|
301
312
|
}
|
|
302
313
|
);
|
|
303
314
|
default:
|
|
@@ -306,19 +317,19 @@ const nt = ({
|
|
|
306
317
|
},
|
|
307
318
|
[
|
|
308
319
|
c,
|
|
309
|
-
|
|
320
|
+
y,
|
|
310
321
|
e,
|
|
311
|
-
|
|
312
|
-
|
|
322
|
+
s,
|
|
323
|
+
o.fields,
|
|
313
324
|
n
|
|
314
325
|
]
|
|
315
326
|
);
|
|
316
|
-
return
|
|
327
|
+
return P(() => ({ getDynamicField: m }), [m]);
|
|
317
328
|
};
|
|
318
|
-
function
|
|
329
|
+
function te(e) {
|
|
319
330
|
return JSON.stringify(e);
|
|
320
331
|
}
|
|
321
|
-
function
|
|
332
|
+
function ft(e, t) {
|
|
322
333
|
const n = e.get(t);
|
|
323
334
|
if (n) {
|
|
324
335
|
if (Date.now() > n.expiresAt) {
|
|
@@ -328,56 +339,56 @@ function ct(e, t) {
|
|
|
328
339
|
return n.data;
|
|
329
340
|
}
|
|
330
341
|
}
|
|
331
|
-
function
|
|
342
|
+
function mt(e, t, n, r) {
|
|
332
343
|
e.set(t, { data: n, expiresAt: Date.now() + r });
|
|
333
344
|
}
|
|
334
|
-
async function
|
|
345
|
+
async function ne(e, t, n, r, i) {
|
|
335
346
|
const a = e[t];
|
|
336
347
|
if (e.cache.enabled) {
|
|
337
|
-
const c =
|
|
348
|
+
const c = ft(a, n);
|
|
338
349
|
if (c !== void 0) return c;
|
|
339
350
|
}
|
|
340
|
-
const
|
|
341
|
-
return e.cache.enabled &&
|
|
351
|
+
const o = new AbortController(), s = i ? AbortSignal.any([i, o.signal]) : o.signal, d = await r(s);
|
|
352
|
+
return e.cache.enabled && mt(a, n, d, e.cache.ttlMs), d;
|
|
342
353
|
}
|
|
343
|
-
function
|
|
354
|
+
function z(e, t) {
|
|
344
355
|
return t.split(".").reduce((n, r) => {
|
|
345
356
|
if (n && typeof n == "object")
|
|
346
357
|
return n[r];
|
|
347
358
|
}, e);
|
|
348
359
|
}
|
|
349
|
-
function
|
|
360
|
+
function pt(e, t) {
|
|
350
361
|
if (typeof e != "string") return e;
|
|
351
362
|
const n = e.match(/^\{\{(.+?)\}\}$/);
|
|
352
363
|
if (!n) return e;
|
|
353
|
-
const r = n[1].trim(), i =
|
|
364
|
+
const r = n[1].trim(), i = z(t, r);
|
|
354
365
|
return i !== void 0 ? i : e;
|
|
355
366
|
}
|
|
356
|
-
function
|
|
367
|
+
function ht(e, t) {
|
|
357
368
|
const n = {};
|
|
358
369
|
for (const r in e)
|
|
359
|
-
n[r] =
|
|
370
|
+
n[r] = pt(
|
|
360
371
|
e[r],
|
|
361
372
|
t
|
|
362
373
|
);
|
|
363
374
|
return n;
|
|
364
375
|
}
|
|
365
|
-
function
|
|
376
|
+
function rn(e, t) {
|
|
366
377
|
const n = { ...e };
|
|
367
378
|
return t.forEach((r) => {
|
|
368
379
|
const i = e[r.code];
|
|
369
380
|
if (i == null) return;
|
|
370
381
|
switch (r.field?.type?.code) {
|
|
371
382
|
case "datetime": {
|
|
372
|
-
const
|
|
373
|
-
|
|
383
|
+
const o = ae(i);
|
|
384
|
+
o.isValid() && (n[r.code] = o);
|
|
374
385
|
break;
|
|
375
386
|
}
|
|
376
387
|
case "file":
|
|
377
388
|
case "image": {
|
|
378
389
|
if (Array.isArray(i) && i.length > 0) {
|
|
379
|
-
const
|
|
380
|
-
const c =
|
|
390
|
+
const o = i.map((s, d) => {
|
|
391
|
+
const c = s;
|
|
381
392
|
return {
|
|
382
393
|
uid: String(c.uid ?? c.path ?? d),
|
|
383
394
|
name: c.name ?? `file-${d}`,
|
|
@@ -385,23 +396,23 @@ function Zt(e, t) {
|
|
|
385
396
|
percent: 100,
|
|
386
397
|
type: c.type,
|
|
387
398
|
size: c.size,
|
|
388
|
-
response:
|
|
399
|
+
response: s
|
|
389
400
|
};
|
|
390
401
|
});
|
|
391
|
-
n[r.code] = { fileList:
|
|
402
|
+
n[r.code] = { fileList: o };
|
|
392
403
|
}
|
|
393
404
|
break;
|
|
394
405
|
}
|
|
395
406
|
}
|
|
396
407
|
}), n;
|
|
397
408
|
}
|
|
398
|
-
function
|
|
409
|
+
function yt(e) {
|
|
399
410
|
const t = e.option_config?.api_options?.params || {}, n = e.option_config?.api_options?.data || {}, r = (i) => Object.values(i).filter(
|
|
400
411
|
(a) => typeof a == "string" && a.startsWith("{{") && a.endsWith("}}")
|
|
401
412
|
).map((a) => a.slice(2, -2).trim());
|
|
402
413
|
return Array.from(/* @__PURE__ */ new Set([...r(t), ...r(n)]));
|
|
403
414
|
}
|
|
404
|
-
function
|
|
415
|
+
function I(e, t) {
|
|
405
416
|
const n = {};
|
|
406
417
|
for (const r in e) {
|
|
407
418
|
const i = e[r];
|
|
@@ -413,162 +424,214 @@ function O(e, t) {
|
|
|
413
424
|
}
|
|
414
425
|
return n;
|
|
415
426
|
}
|
|
416
|
-
function
|
|
427
|
+
function re(e, t) {
|
|
417
428
|
return e.replace(/\{\{\s*(\w+)\s*\}\}/g, (n, r) => {
|
|
418
429
|
const i = t?.[r];
|
|
419
430
|
return i != null ? String(i) : "";
|
|
420
431
|
});
|
|
421
432
|
}
|
|
422
|
-
function
|
|
423
|
-
const
|
|
424
|
-
|
|
433
|
+
function _t(e, t, n) {
|
|
434
|
+
const i = t.find((a) => a.code === e)?.additional_config?.on_field_change?.clear ?? [];
|
|
435
|
+
return i.length === 0 ? [] : i.filter(
|
|
436
|
+
(a) => n?.[a] !== void 0 && n?.[a] !== null
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
function bt(e, t) {
|
|
440
|
+
const n = P(
|
|
441
|
+
() => yt(e),
|
|
425
442
|
[e]
|
|
426
|
-
), r =
|
|
443
|
+
), r = G.useWatch(
|
|
427
444
|
n.length > 0 ? n : void 0,
|
|
428
445
|
t
|
|
429
446
|
);
|
|
430
|
-
return
|
|
447
|
+
return P(() => {
|
|
431
448
|
if (!n.length) return {};
|
|
432
449
|
const i = {};
|
|
433
|
-
return n.forEach((a,
|
|
434
|
-
Array.isArray(r) ? i[a] = r[
|
|
450
|
+
return n.forEach((a, o) => {
|
|
451
|
+
Array.isArray(r) ? i[a] = r[o] : i[a] = r;
|
|
435
452
|
}), i;
|
|
436
453
|
}, [n, r]);
|
|
437
454
|
}
|
|
438
|
-
function
|
|
455
|
+
function vt({
|
|
439
456
|
group: e,
|
|
440
457
|
formInstance: t,
|
|
441
458
|
searchKeyword: n = "",
|
|
442
459
|
searchDebounceMs: r = 500
|
|
443
460
|
}) {
|
|
444
|
-
const i =
|
|
445
|
-
() =>
|
|
461
|
+
const i = O(), a = bt(e, t), o = G.useWatch(e.code, t), [s, d] = x(), [c, y] = x(!1), [m, l] = x(), p = K(null), [h, f] = x(n), _ = e.additional_config?.select?.search_keyword ?? !1, v = P(
|
|
462
|
+
() => me((S) => f(S), r),
|
|
446
463
|
[r]
|
|
447
464
|
);
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}, [n,
|
|
451
|
-
const b =
|
|
452
|
-
const
|
|
453
|
-
if (!(!
|
|
465
|
+
B(() => {
|
|
466
|
+
_ ? v(n) : f("");
|
|
467
|
+
}, [n, _, v]);
|
|
468
|
+
const b = P(() => {
|
|
469
|
+
const S = e.option_config?.api_options?.params, A = e.option_config?.api_options?.data;
|
|
470
|
+
if (!(!S && !A))
|
|
454
471
|
return {
|
|
455
|
-
params:
|
|
456
|
-
data:
|
|
472
|
+
params: S ? I(S, a) : void 0,
|
|
473
|
+
data: A ? I(A, a) : void 0
|
|
457
474
|
};
|
|
458
|
-
}, [a, e]), w =
|
|
475
|
+
}, [a, e]), w = L(async () => {
|
|
459
476
|
if (!e.option_config || !e.is_option_api || !e.option_config.url)
|
|
460
477
|
return;
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
const
|
|
478
|
+
p.current?.abort();
|
|
479
|
+
const S = new AbortController();
|
|
480
|
+
p.current = S;
|
|
481
|
+
const A = e.option_config.method?.toUpperCase() === "GET" || !e.option_config.method, g = _ ? h : "", k = te([
|
|
465
482
|
e.code,
|
|
466
483
|
e.option_config.url,
|
|
467
484
|
e.option_config.method,
|
|
468
485
|
b,
|
|
469
|
-
|
|
486
|
+
g
|
|
470
487
|
]);
|
|
471
|
-
|
|
488
|
+
y(!0), l(void 0);
|
|
472
489
|
try {
|
|
473
|
-
const
|
|
490
|
+
const E = await ne(
|
|
474
491
|
i,
|
|
475
492
|
"optionCache",
|
|
476
|
-
|
|
493
|
+
k,
|
|
477
494
|
async (R) => {
|
|
478
|
-
const
|
|
495
|
+
const T = await i.client.request({
|
|
479
496
|
method: e.option_config?.method || "GET",
|
|
480
497
|
url: e.option_config?.url,
|
|
481
|
-
params:
|
|
482
|
-
data: !
|
|
498
|
+
params: A && _ ? { ...b?.params, keywords: g } : b?.params,
|
|
499
|
+
data: !A && _ ? { ...b?.data, keywords: g } : b?.data,
|
|
483
500
|
signal: R
|
|
484
501
|
});
|
|
485
|
-
return i.parsers.optionResponse(
|
|
502
|
+
return i.parsers.optionResponse(T.data, e);
|
|
486
503
|
},
|
|
487
|
-
|
|
504
|
+
S.signal
|
|
505
|
+
), M = Array.isArray(o) ? o : o == null ? [] : [o], W = new Set(
|
|
506
|
+
E.map((R) => String(Pe(R, e)))
|
|
507
|
+
), j = M.filter((R) => R == null || R === "" ? !1 : !W.has(String(R)));
|
|
508
|
+
let H = [];
|
|
509
|
+
j.length > 0 && (H = (await Promise.all(
|
|
510
|
+
j.map(async (R) => {
|
|
511
|
+
const T = te([
|
|
512
|
+
e.code,
|
|
513
|
+
e.option_config?.url,
|
|
514
|
+
e.option_config?.method,
|
|
515
|
+
b,
|
|
516
|
+
"selected",
|
|
517
|
+
R
|
|
518
|
+
]);
|
|
519
|
+
return ne(
|
|
520
|
+
i,
|
|
521
|
+
"optionCache",
|
|
522
|
+
T,
|
|
523
|
+
async (se) => {
|
|
524
|
+
const q = { [e.option_config?.value_attr || "value"]: R }, Q = await i.client.request({
|
|
525
|
+
method: e.option_config?.method || "GET",
|
|
526
|
+
url: e.option_config?.url,
|
|
527
|
+
params: A ? {
|
|
528
|
+
...b?.params,
|
|
529
|
+
filter: {
|
|
530
|
+
...b?.params?.filter,
|
|
531
|
+
...q
|
|
532
|
+
}
|
|
533
|
+
} : b?.params,
|
|
534
|
+
data: A ? b?.data : {
|
|
535
|
+
...b?.data,
|
|
536
|
+
filter: {
|
|
537
|
+
...b?.data?.filter,
|
|
538
|
+
...q
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
signal: se
|
|
542
|
+
});
|
|
543
|
+
return i.parsers.optionResponse(Q.data, e);
|
|
544
|
+
},
|
|
545
|
+
S.signal
|
|
546
|
+
);
|
|
547
|
+
})
|
|
548
|
+
)).flat());
|
|
549
|
+
const J = it(
|
|
550
|
+
[...E, ...H],
|
|
551
|
+
e
|
|
488
552
|
);
|
|
489
|
-
|
|
490
|
-
} catch (
|
|
491
|
-
|
|
553
|
+
S.signal.aborted || d(J);
|
|
554
|
+
} catch (E) {
|
|
555
|
+
S.signal.aborted || l(E);
|
|
492
556
|
} finally {
|
|
493
|
-
|
|
557
|
+
S.signal.aborted || y(!1);
|
|
494
558
|
}
|
|
495
|
-
}, [
|
|
496
|
-
|
|
559
|
+
}, [
|
|
560
|
+
b,
|
|
561
|
+
i,
|
|
562
|
+
h,
|
|
563
|
+
e,
|
|
564
|
+
_,
|
|
565
|
+
o
|
|
566
|
+
]);
|
|
567
|
+
return B(() => (e.option_config && e.is_option_api && w(), () => p.current?.abort()), [w, e]), { options: s, isLoading: c, error: m, refetch: w };
|
|
497
568
|
}
|
|
498
|
-
const
|
|
569
|
+
const wt = ({
|
|
499
570
|
group: e,
|
|
500
571
|
formInstance: t,
|
|
501
572
|
fieldState: n,
|
|
502
573
|
setFieldState: r,
|
|
503
574
|
uploadUrl: i,
|
|
504
575
|
readOnly: a = !1,
|
|
505
|
-
size:
|
|
506
|
-
...
|
|
576
|
+
size: o = "middle",
|
|
577
|
+
...s
|
|
507
578
|
}) => {
|
|
508
|
-
const { getDynamicField: d } =
|
|
579
|
+
const { getDynamicField: d } = ut({
|
|
509
580
|
formInstance: t,
|
|
510
581
|
uploadUrl: i,
|
|
511
582
|
setFieldState: r
|
|
512
|
-
}), c =
|
|
583
|
+
}), c = G.useWatch(e.code, t), [y, m] = x(""), l = e.additional_config?.select?.search_keyword ?? !1, { options: p, isLoading: h, error: f } = vt({
|
|
513
584
|
group: e,
|
|
514
585
|
formInstance: t,
|
|
515
|
-
searchKeyword:
|
|
586
|
+
searchKeyword: y,
|
|
516
587
|
searchDebounceMs: e.additional_config?.select?.searchDebounceMs ?? 500
|
|
517
|
-
}),
|
|
518
|
-
m(
|
|
588
|
+
}), _ = L((b) => {
|
|
589
|
+
m(b);
|
|
519
590
|
}, []);
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
e.additional_config.on_field_change.clear
|
|
524
|
-
), h = e.additional_config.on_field_change.clear.filter(
|
|
525
|
-
(S) => w?.[S]
|
|
526
|
-
);
|
|
527
|
-
h.length && t.resetFields(h);
|
|
528
|
-
}
|
|
529
|
-
e.additional_config?.on_field_empty?.disable?.length && e.additional_config.on_field_empty.disable.forEach((w) => {
|
|
530
|
-
r(w, { disabled: !c });
|
|
591
|
+
B(() => {
|
|
592
|
+
e.additional_config?.on_field_empty?.disable?.length && e.additional_config.on_field_empty.disable.forEach((b) => {
|
|
593
|
+
r(b, { disabled: !c });
|
|
531
594
|
});
|
|
532
595
|
}, [c, t, e, r]);
|
|
533
|
-
const
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
|
|
596
|
+
const v = o === "small" ? 4 : 12;
|
|
597
|
+
return /* @__PURE__ */ u(
|
|
598
|
+
G.Item,
|
|
536
599
|
{
|
|
537
600
|
label: e.label,
|
|
538
601
|
name: e.code,
|
|
539
602
|
hidden: n?.hidden,
|
|
540
603
|
rules: [{ required: n?.required || !1 }],
|
|
541
|
-
style: { marginBottom:
|
|
542
|
-
...
|
|
604
|
+
style: { marginBottom: v, ...s.style },
|
|
605
|
+
...s,
|
|
543
606
|
children: d(e, {
|
|
544
607
|
state: n,
|
|
545
608
|
options: p,
|
|
546
|
-
optionsLoading:
|
|
547
|
-
optionsError:
|
|
548
|
-
onSearchKeyword: l ?
|
|
609
|
+
optionsLoading: h,
|
|
610
|
+
optionsError: f,
|
|
611
|
+
onSearchKeyword: l ? _ : void 0,
|
|
549
612
|
readOnly: a
|
|
550
613
|
})
|
|
551
614
|
}
|
|
552
615
|
);
|
|
553
616
|
};
|
|
554
|
-
function
|
|
617
|
+
function gt(e, t) {
|
|
555
618
|
return e.group.id === t.group.id && e.readOnly === t.readOnly && e.uploadUrl === t.uploadUrl && e.size === t.size && e.fieldState?.disabled === t.fieldState?.disabled && e.fieldState?.hidden === t.fieldState?.hidden && e.fieldState?.required === t.fieldState?.required;
|
|
556
619
|
}
|
|
557
|
-
const
|
|
558
|
-
function
|
|
620
|
+
const At = V(wt, gt);
|
|
621
|
+
function St({
|
|
559
622
|
fieldGroups: e,
|
|
560
623
|
fieldStates: t,
|
|
561
624
|
renderField: n,
|
|
562
625
|
gutter: r,
|
|
563
626
|
defaultColSpan: i
|
|
564
627
|
}) {
|
|
565
|
-
return /* @__PURE__ */
|
|
566
|
-
const
|
|
567
|
-
return /* @__PURE__ */
|
|
628
|
+
return /* @__PURE__ */ u(ze, { gutter: r, children: e.map((a) => {
|
|
629
|
+
const o = t[a.code]?.hidden ? 0 : Number(a.additional_config?.field_col_span) || i;
|
|
630
|
+
return /* @__PURE__ */ u(He, { xs: o, children: n(a) }, a.id);
|
|
568
631
|
}) });
|
|
569
632
|
}
|
|
570
|
-
function
|
|
571
|
-
return
|
|
633
|
+
function Ft(e) {
|
|
634
|
+
return P(() => {
|
|
572
635
|
const t = e?.form?.field_groups ?? [], n = /* @__PURE__ */ new Map(), r = {};
|
|
573
636
|
t.forEach((a) => {
|
|
574
637
|
n.set(a.code, a), a.additional_config?.default !== void 0 && (r[a.code] = a.additional_config.default);
|
|
@@ -577,7 +640,7 @@ function wt(e) {
|
|
|
577
640
|
return { fieldGroups: t, fieldByCode: n, visibleFieldGroups: i, initialValues: r };
|
|
578
641
|
}, [e]);
|
|
579
642
|
}
|
|
580
|
-
function
|
|
643
|
+
function ge(e) {
|
|
581
644
|
const t = {};
|
|
582
645
|
return e.forEach((n) => {
|
|
583
646
|
t[n.code] = {
|
|
@@ -587,38 +650,38 @@ function we(e) {
|
|
|
587
650
|
};
|
|
588
651
|
}), t;
|
|
589
652
|
}
|
|
590
|
-
function
|
|
591
|
-
const [t, n] =
|
|
592
|
-
() =>
|
|
653
|
+
function Et(e) {
|
|
654
|
+
const [t, n] = x(
|
|
655
|
+
() => ge(e)
|
|
593
656
|
);
|
|
594
|
-
|
|
595
|
-
n(
|
|
657
|
+
B(() => {
|
|
658
|
+
n(ge(e));
|
|
596
659
|
}, [e]);
|
|
597
|
-
const r =
|
|
598
|
-
n((
|
|
599
|
-
...
|
|
600
|
-
[i]: { ...
|
|
660
|
+
const r = L((i, a) => {
|
|
661
|
+
n((o) => ({
|
|
662
|
+
...o,
|
|
663
|
+
[i]: { ...o[i], ...a }
|
|
601
664
|
}));
|
|
602
665
|
}, []);
|
|
603
666
|
return { fieldStates: t, setFieldStates: n, setFieldState: r };
|
|
604
667
|
}
|
|
605
|
-
function
|
|
668
|
+
function kt({
|
|
606
669
|
formInstance: e,
|
|
607
670
|
fieldByCode: t,
|
|
608
671
|
relatedData: n,
|
|
609
672
|
transformers: r
|
|
610
673
|
}) {
|
|
611
|
-
return { buildProcessedValues:
|
|
674
|
+
return { buildProcessedValues: L(async () => {
|
|
612
675
|
await e.validateFields();
|
|
613
|
-
const a = e.getFieldsValue(),
|
|
676
|
+
const a = e.getFieldsValue(), o = {};
|
|
614
677
|
for (const c of Object.keys(a)) {
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
678
|
+
const y = t.get(c);
|
|
679
|
+
if (!y) continue;
|
|
617
680
|
let m;
|
|
618
|
-
switch (
|
|
681
|
+
switch (y.field?.type?.code) {
|
|
619
682
|
case "datetime":
|
|
620
|
-
m = a[c] ?
|
|
621
|
-
|
|
683
|
+
m = a[c] ? ae(a[c]).format(
|
|
684
|
+
y.additional_config?.datetime?.format
|
|
622
685
|
) : null;
|
|
623
686
|
break;
|
|
624
687
|
case "image":
|
|
@@ -633,17 +696,17 @@ function At({
|
|
|
633
696
|
default:
|
|
634
697
|
m = a[c];
|
|
635
698
|
}
|
|
636
|
-
r.transformFieldValue && (m = r.transformFieldValue(c, m,
|
|
699
|
+
r.transformFieldValue && (m = r.transformFieldValue(c, m, y)), o[c] = m;
|
|
637
700
|
}
|
|
638
|
-
let
|
|
639
|
-
return r.transformSubmitValues && (
|
|
640
|
-
|
|
701
|
+
let s = o;
|
|
702
|
+
return r.transformSubmitValues && (s = r.transformSubmitValues(
|
|
703
|
+
s,
|
|
641
704
|
Array.from(t.values()),
|
|
642
705
|
n
|
|
643
|
-
)), (r.parseRelatedDataTemplates ??
|
|
706
|
+
)), (r.parseRelatedDataTemplates ?? ht)(s, n ?? {});
|
|
644
707
|
}, [t, e, n, r]) };
|
|
645
708
|
}
|
|
646
|
-
const
|
|
709
|
+
const Rt = Je(
|
|
647
710
|
({
|
|
648
711
|
formConfig: e,
|
|
649
712
|
formInstance: t,
|
|
@@ -651,176 +714,188 @@ const St = Ne(
|
|
|
651
714
|
uploadUrl: r,
|
|
652
715
|
uploadResourceUrl: i,
|
|
653
716
|
submitTrackingUrl: a,
|
|
654
|
-
onBeforeSubmit:
|
|
655
|
-
onSubmitSuccess:
|
|
717
|
+
onBeforeSubmit: o,
|
|
718
|
+
onSubmitSuccess: s,
|
|
656
719
|
onSubmitError: d,
|
|
657
720
|
isRedirectAfterCreate: c,
|
|
658
|
-
onRedirect:
|
|
721
|
+
onRedirect: y,
|
|
659
722
|
size: m = "middle",
|
|
660
723
|
manualSubmit: l = !1,
|
|
661
724
|
onValuesChange: p,
|
|
662
|
-
readOnly:
|
|
663
|
-
submitDebounceMs:
|
|
664
|
-
gutter:
|
|
665
|
-
defaultColSpan:
|
|
666
|
-
submitButtonLabel:
|
|
667
|
-
},
|
|
668
|
-
const { message: S } =
|
|
725
|
+
readOnly: h = !1,
|
|
726
|
+
submitDebounceMs: f,
|
|
727
|
+
gutter: _ = [8, 0],
|
|
728
|
+
defaultColSpan: v = 12,
|
|
729
|
+
submitButtonLabel: b
|
|
730
|
+
}, w) => {
|
|
731
|
+
const { message: S } = Ye.useApp(), A = O(), { i18n: g, client: k, parsers: E, redirectHandler: M, renderers: W, transformers: j } = A, H = r ?? i, J = f ?? A.submitDebounceMs, R = b ?? g.messages.submit, { fieldGroups: T, fieldByCode: se, initialValues: Y } = Ft(e), { fieldStates: q, setFieldState: Q } = Et(T), { buildProcessedValues: X } = kt({
|
|
669
732
|
formInstance: t,
|
|
670
|
-
fieldByCode:
|
|
733
|
+
fieldByCode: se,
|
|
671
734
|
relatedData: n,
|
|
672
|
-
transformers:
|
|
673
|
-
}),
|
|
674
|
-
|
|
675
|
-
if (Object.keys(
|
|
676
|
-
const
|
|
677
|
-
t.setFieldsValue(
|
|
735
|
+
transformers: j
|
|
736
|
+
}), Z = K(!1), [pe, he] = x(!1), [ye, _e] = x(!1);
|
|
737
|
+
B(() => {
|
|
738
|
+
if (Object.keys(Y).length > 0) {
|
|
739
|
+
const F = j.normalizeInitialValues ? j.normalizeInitialValues(Y, T) : Y;
|
|
740
|
+
t.setFieldsValue(F);
|
|
678
741
|
}
|
|
679
|
-
}, [
|
|
680
|
-
const
|
|
681
|
-
if (!
|
|
682
|
-
|
|
742
|
+
}, [T, t, Y, j]);
|
|
743
|
+
const ee = L(async () => {
|
|
744
|
+
if (!Z.current) {
|
|
745
|
+
Z.current = !0, he(!0);
|
|
683
746
|
try {
|
|
684
|
-
let
|
|
747
|
+
let F = await X();
|
|
685
748
|
try {
|
|
686
|
-
a && (
|
|
749
|
+
a && (_e(!0), await k.request({
|
|
687
750
|
method: "POST",
|
|
688
751
|
url: a,
|
|
689
|
-
data:
|
|
752
|
+
data: F
|
|
690
753
|
}));
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
|
|
694
|
-
} catch (
|
|
695
|
-
console.error(
|
|
754
|
+
const D = await o?.(F);
|
|
755
|
+
if (D === !1) return;
|
|
756
|
+
D && typeof D == "object" && (F = D);
|
|
757
|
+
} catch (D) {
|
|
758
|
+
console.error(D);
|
|
696
759
|
return;
|
|
697
760
|
} finally {
|
|
698
|
-
|
|
761
|
+
_e(!1);
|
|
699
762
|
}
|
|
700
|
-
const
|
|
763
|
+
const U = await k.request({
|
|
701
764
|
method: e.method,
|
|
702
765
|
url: e.action,
|
|
703
|
-
data:
|
|
766
|
+
data: F
|
|
704
767
|
});
|
|
705
768
|
t.resetFields(
|
|
706
|
-
|
|
769
|
+
T.filter((D) => !D.is_hidden).map((D) => D.code)
|
|
707
770
|
);
|
|
708
|
-
const
|
|
709
|
-
c &&
|
|
710
|
-
values:
|
|
711
|
-
response:
|
|
712
|
-
data:
|
|
771
|
+
const N = E.submitResponse(U.data);
|
|
772
|
+
c && N.redirectUrl && (y ?? M)(N.redirectUrl, "_blank"), s?.({
|
|
773
|
+
values: F,
|
|
774
|
+
response: U.data,
|
|
775
|
+
data: N.data ?? U.data
|
|
713
776
|
});
|
|
714
|
-
} catch (
|
|
715
|
-
const
|
|
777
|
+
} catch (F) {
|
|
778
|
+
const U = F;
|
|
716
779
|
S.error(
|
|
717
|
-
|
|
718
|
-
), d?.(
|
|
780
|
+
U?.response?.data?.message ?? g.messages.submitError
|
|
781
|
+
), d?.(F);
|
|
719
782
|
} finally {
|
|
720
|
-
|
|
783
|
+
Z.current = !1, he(!1);
|
|
721
784
|
}
|
|
722
785
|
}
|
|
723
786
|
}, [
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
787
|
+
X,
|
|
788
|
+
k,
|
|
789
|
+
T,
|
|
727
790
|
e.action,
|
|
728
791
|
e.method,
|
|
729
792
|
t,
|
|
730
793
|
g.messages.submitError,
|
|
731
794
|
c,
|
|
732
795
|
S,
|
|
733
|
-
s,
|
|
734
|
-
_,
|
|
735
|
-
d,
|
|
736
796
|
o,
|
|
737
|
-
|
|
738
|
-
|
|
797
|
+
y,
|
|
798
|
+
d,
|
|
799
|
+
s,
|
|
800
|
+
E,
|
|
801
|
+
M,
|
|
739
802
|
a
|
|
740
803
|
]);
|
|
741
|
-
|
|
742
|
-
|
|
804
|
+
Qe(
|
|
805
|
+
w,
|
|
743
806
|
() => ({
|
|
744
|
-
submit:
|
|
745
|
-
getProcessedValues:
|
|
746
|
-
isSubmitting: () =>
|
|
807
|
+
submit: ee,
|
|
808
|
+
getProcessedValues: X,
|
|
809
|
+
isSubmitting: () => Z.current
|
|
747
810
|
}),
|
|
748
|
-
[
|
|
811
|
+
[X, ee]
|
|
749
812
|
);
|
|
750
|
-
const
|
|
751
|
-
() =>
|
|
752
|
-
|
|
753
|
-
},
|
|
754
|
-
[
|
|
755
|
-
),
|
|
756
|
-
(
|
|
757
|
-
|
|
813
|
+
const be = P(
|
|
814
|
+
() => me(() => {
|
|
815
|
+
ee();
|
|
816
|
+
}, J),
|
|
817
|
+
[ee, J]
|
|
818
|
+
), qe = L(
|
|
819
|
+
(F, U) => {
|
|
820
|
+
Object.keys(F).forEach((N) => {
|
|
821
|
+
const D = _t(
|
|
822
|
+
N,
|
|
823
|
+
T,
|
|
824
|
+
t.getFieldsValue()
|
|
825
|
+
);
|
|
826
|
+
D.length > 0 && t.resetFields(D);
|
|
827
|
+
}), p?.(F, U);
|
|
828
|
+
},
|
|
829
|
+
[T, t, p]
|
|
830
|
+
), ve = L(
|
|
831
|
+
(F) => /* @__PURE__ */ u(
|
|
832
|
+
At,
|
|
758
833
|
{
|
|
759
|
-
group:
|
|
834
|
+
group: F,
|
|
760
835
|
formInstance: t,
|
|
761
|
-
fieldState:
|
|
762
|
-
setFieldState:
|
|
763
|
-
uploadUrl:
|
|
764
|
-
readOnly:
|
|
836
|
+
fieldState: q[F.code],
|
|
837
|
+
setFieldState: Q,
|
|
838
|
+
uploadUrl: H,
|
|
839
|
+
readOnly: h,
|
|
765
840
|
size: m
|
|
766
841
|
},
|
|
767
|
-
|
|
842
|
+
F.id
|
|
768
843
|
),
|
|
769
844
|
[
|
|
770
|
-
|
|
845
|
+
q,
|
|
771
846
|
t,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
847
|
+
h,
|
|
848
|
+
H,
|
|
849
|
+
Q,
|
|
775
850
|
m
|
|
776
851
|
]
|
|
777
|
-
),
|
|
778
|
-
fieldGroups:
|
|
779
|
-
fieldStates:
|
|
780
|
-
renderField:
|
|
781
|
-
gutter:
|
|
782
|
-
defaultColSpan:
|
|
852
|
+
), Ue = W.layout ? W.layout({
|
|
853
|
+
fieldGroups: T,
|
|
854
|
+
fieldStates: q,
|
|
855
|
+
renderField: ve,
|
|
856
|
+
gutter: _,
|
|
857
|
+
defaultColSpan: v,
|
|
783
858
|
size: m
|
|
784
|
-
}) : /* @__PURE__ */
|
|
785
|
-
|
|
859
|
+
}) : /* @__PURE__ */ u(
|
|
860
|
+
St,
|
|
786
861
|
{
|
|
787
|
-
fieldGroups:
|
|
788
|
-
fieldStates:
|
|
789
|
-
renderField:
|
|
790
|
-
gutter:
|
|
791
|
-
defaultColSpan:
|
|
862
|
+
fieldGroups: T,
|
|
863
|
+
fieldStates: q,
|
|
864
|
+
renderField: ve,
|
|
865
|
+
gutter: _,
|
|
866
|
+
defaultColSpan: v,
|
|
792
867
|
size: m
|
|
793
868
|
}
|
|
794
|
-
),
|
|
795
|
-
onSubmit:
|
|
796
|
-
loading:
|
|
797
|
-
label:
|
|
798
|
-
}) : /* @__PURE__ */
|
|
799
|
-
|
|
869
|
+
), Ge = !l && !h && (W.submitActions ? W.submitActions({
|
|
870
|
+
onSubmit: be,
|
|
871
|
+
loading: pe || ye,
|
|
872
|
+
label: R
|
|
873
|
+
}) : /* @__PURE__ */ u(de, { justify: "flex-end", children: /* @__PURE__ */ u(
|
|
874
|
+
Re,
|
|
800
875
|
{
|
|
801
876
|
type: "primary",
|
|
802
|
-
onClick:
|
|
803
|
-
loading:
|
|
804
|
-
children:
|
|
877
|
+
onClick: be,
|
|
878
|
+
loading: pe || ye,
|
|
879
|
+
children: R
|
|
805
880
|
}
|
|
806
881
|
) }));
|
|
807
|
-
return /* @__PURE__ */
|
|
808
|
-
|
|
882
|
+
return /* @__PURE__ */ Be(
|
|
883
|
+
G,
|
|
809
884
|
{
|
|
810
885
|
layout: "vertical",
|
|
811
886
|
form: t,
|
|
812
887
|
size: m,
|
|
813
|
-
onValuesChange:
|
|
888
|
+
onValuesChange: qe,
|
|
814
889
|
children: [
|
|
815
|
-
|
|
816
|
-
|
|
890
|
+
Ue,
|
|
891
|
+
Ge
|
|
817
892
|
]
|
|
818
893
|
}
|
|
819
894
|
);
|
|
820
895
|
}
|
|
821
896
|
);
|
|
822
|
-
|
|
823
|
-
function
|
|
897
|
+
Rt.displayName = "DynamicForm";
|
|
898
|
+
function Te(e) {
|
|
824
899
|
if (!e) return;
|
|
825
900
|
const { mode: t } = e;
|
|
826
901
|
if (t === "api" && e.api?.url)
|
|
@@ -853,76 +928,76 @@ function De(e) {
|
|
|
853
928
|
};
|
|
854
929
|
}
|
|
855
930
|
}
|
|
856
|
-
function
|
|
931
|
+
function Ae(e) {
|
|
857
932
|
return {
|
|
858
933
|
value: e,
|
|
859
934
|
id: e
|
|
860
935
|
};
|
|
861
936
|
}
|
|
862
|
-
function
|
|
937
|
+
function Dt(e, t) {
|
|
863
938
|
const n = t.method || "GET", r = n.toUpperCase() === "GET";
|
|
864
939
|
if (t.url_template)
|
|
865
940
|
return (Array.isArray(e) ? e.filter((d) => d != null && d !== "") : e != null && e !== "" ? [e] : []).map((d) => {
|
|
866
|
-
const c =
|
|
941
|
+
const c = Ae(d), y = re(t.url, c), m = t.params ? I(t.params, c) : void 0, l = t.data ? I(t.data, c) : void 0;
|
|
867
942
|
return {
|
|
868
943
|
method: n,
|
|
869
|
-
url:
|
|
944
|
+
url: y,
|
|
870
945
|
params: r ? m : void 0,
|
|
871
946
|
data: r ? void 0 : l
|
|
872
947
|
};
|
|
873
948
|
});
|
|
874
|
-
const i =
|
|
949
|
+
const i = Ae(e), a = t.params ? I(t.params, i) : void 0, o = t.data ? I(t.data, i) : void 0;
|
|
875
950
|
return [
|
|
876
951
|
{
|
|
877
952
|
method: n,
|
|
878
953
|
url: t.url,
|
|
879
954
|
params: r ? a : void 0,
|
|
880
|
-
data: r ? void 0 :
|
|
955
|
+
data: r ? void 0 : o
|
|
881
956
|
}
|
|
882
957
|
];
|
|
883
958
|
}
|
|
884
|
-
function Pe(e, t) {
|
|
885
|
-
const n = t.data_path ? B(e, t.data_path) : e;
|
|
886
|
-
return (t.result_type ?? (Array.isArray(n) ? "array" : "object")) === "array" ? Array.isArray(n) ? n : n != null ? [n] : [] : Array.isArray(n) ? n.length ? [n[0]] : [] : n && typeof n == "object" ? [n] : [];
|
|
887
|
-
}
|
|
888
959
|
function xe(e, t) {
|
|
889
|
-
|
|
960
|
+
const n = t.data_path ? z(e, t.data_path) : e;
|
|
961
|
+
return (t.result_type ?? (Array.isArray(n) ? "array" : "object")) === "array" ? Array.isArray(n) ? n : n != null ? [n] : [] : Array.isArray(n) ? n.length ? [n[0]] : [] : n && typeof n == "object" ? [n] : [];
|
|
890
962
|
}
|
|
891
963
|
function Le(e, t) {
|
|
892
|
-
return Mt(t.
|
|
964
|
+
return Mt(e, t.mapping_attr);
|
|
893
965
|
}
|
|
894
|
-
|
|
895
|
-
|
|
966
|
+
function Ce(e, t) {
|
|
967
|
+
return jt(t.link, e);
|
|
968
|
+
}
|
|
969
|
+
async function Pt(e, t, n, r) {
|
|
970
|
+
const i = Dt(e, t);
|
|
896
971
|
if (!i.length) return [];
|
|
897
972
|
const a = await Promise.all(
|
|
898
|
-
i.map((
|
|
899
|
-
),
|
|
900
|
-
for (const
|
|
901
|
-
|
|
902
|
-
return
|
|
973
|
+
i.map((s) => n({ ...s, signal: r }))
|
|
974
|
+
), o = [];
|
|
975
|
+
for (const s of a)
|
|
976
|
+
o.push(...xe(s.data, t));
|
|
977
|
+
return o;
|
|
903
978
|
}
|
|
904
|
-
function
|
|
979
|
+
function $(e) {
|
|
905
980
|
return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
906
981
|
}
|
|
907
|
-
function
|
|
982
|
+
function Tt(e, t) {
|
|
908
983
|
const n = e.option_config?.api_options?.params, r = e.option_config?.api_options?.data;
|
|
909
984
|
if (!n && !r) return;
|
|
910
985
|
const i = (a) => {
|
|
911
|
-
const
|
|
912
|
-
for (const
|
|
913
|
-
if (typeof a[
|
|
914
|
-
const d = a[
|
|
915
|
-
s
|
|
986
|
+
const o = {};
|
|
987
|
+
for (const s in a)
|
|
988
|
+
if (typeof a[s] == "string" && a[s].startsWith("{{") && a[s].endsWith("}}")) {
|
|
989
|
+
const d = a[s].slice(2, -2).trim();
|
|
990
|
+
o[s] = t?.[d];
|
|
916
991
|
} else
|
|
917
|
-
s
|
|
918
|
-
return
|
|
992
|
+
o[s] = a[s];
|
|
993
|
+
return o;
|
|
919
994
|
};
|
|
920
995
|
return {
|
|
921
996
|
params: n ? i(n) : void 0,
|
|
922
997
|
data: r ? i(r) : void 0
|
|
923
998
|
};
|
|
924
999
|
}
|
|
925
|
-
function
|
|
1000
|
+
function xt(e, t) {
|
|
926
1001
|
const n = t.option_config?.label_attr, r = t.option_config?.value_attr || "";
|
|
927
1002
|
if (n?.length) {
|
|
928
1003
|
const i = n.join(" - ");
|
|
@@ -930,33 +1005,33 @@ function Rt(e, t) {
|
|
|
930
1005
|
}
|
|
931
1006
|
return String(e[r] ?? "");
|
|
932
1007
|
}
|
|
933
|
-
function
|
|
1008
|
+
function Lt(e, t) {
|
|
934
1009
|
if (!t?.length) return null;
|
|
935
1010
|
const r = (Array.isArray(e) ? e : [e]).map((i) => t.find((a) => String(a.value) === String(i))?.label).filter((i) => !!i);
|
|
936
1011
|
return r.length ? r.join(", ") : null;
|
|
937
1012
|
}
|
|
938
|
-
function
|
|
939
|
-
if (
|
|
1013
|
+
function Ct(e, t, n) {
|
|
1014
|
+
if ($(e)) return null;
|
|
940
1015
|
const r = t.option_config?.value_attr || "value", i = Array.isArray(e) ? e : [e];
|
|
941
1016
|
if (t.is_option_api && n?.length) {
|
|
942
|
-
const
|
|
1017
|
+
const o = i.map((s) => {
|
|
943
1018
|
const d = n.find(
|
|
944
|
-
(c) => String(c[r]) === String(
|
|
1019
|
+
(c) => String(c[r]) === String(s)
|
|
945
1020
|
);
|
|
946
|
-
return d ?
|
|
1021
|
+
return d ? xt(d, t) : String(s);
|
|
947
1022
|
}).filter(Boolean);
|
|
948
|
-
return
|
|
1023
|
+
return o.length ? o.join(", ") : null;
|
|
949
1024
|
}
|
|
950
|
-
const a =
|
|
1025
|
+
const a = Lt(e, t.metas);
|
|
951
1026
|
return a || i.map(String).join(", ");
|
|
952
1027
|
}
|
|
953
|
-
function
|
|
954
|
-
if (
|
|
955
|
-
const n = t.additional_config?.datetime?.format, r =
|
|
1028
|
+
function Vt(e, t) {
|
|
1029
|
+
if ($(e)) return null;
|
|
1030
|
+
const n = t.additional_config?.datetime?.format, r = ae(e);
|
|
956
1031
|
return r.isValid() ? n ? r.format(n) : r.format("YYYY-MM-DD HH:mm:ss") : String(e);
|
|
957
1032
|
}
|
|
958
|
-
function
|
|
959
|
-
if (
|
|
1033
|
+
function Ot(e) {
|
|
1034
|
+
if ($(e)) return null;
|
|
960
1035
|
if (Array.isArray(e)) {
|
|
961
1036
|
const t = e.map(
|
|
962
1037
|
(n) => typeof n == "object" && n && "name" in n ? String(n.name) : String(n)
|
|
@@ -965,20 +1040,20 @@ function Lt(e) {
|
|
|
965
1040
|
}
|
|
966
1041
|
return String(e);
|
|
967
1042
|
}
|
|
968
|
-
function
|
|
1043
|
+
function Mt(e, t) {
|
|
969
1044
|
return t?.length ? t.map((n) => {
|
|
970
|
-
const r =
|
|
1045
|
+
const r = z(e, n) ?? e[n];
|
|
971
1046
|
return r != null ? String(r) : "";
|
|
972
1047
|
}).filter(Boolean).join(" - ") : JSON.stringify(e);
|
|
973
1048
|
}
|
|
974
|
-
function
|
|
1049
|
+
function jt(e, t) {
|
|
975
1050
|
return e ? e.replace(/\{\{(.+?)\}\}/g, (n, r) => {
|
|
976
|
-
const i = r.trim(), a =
|
|
1051
|
+
const i = r.trim(), a = z(t, i) ?? t[i];
|
|
977
1052
|
return a != null ? String(a) : "";
|
|
978
1053
|
}) : null;
|
|
979
1054
|
}
|
|
980
|
-
function
|
|
981
|
-
if (
|
|
1055
|
+
function Se(e, t, n) {
|
|
1056
|
+
if ($(e)) return null;
|
|
982
1057
|
switch (t?.mode ?? "formatted") {
|
|
983
1058
|
case "raw":
|
|
984
1059
|
case "formatted":
|
|
@@ -986,12 +1061,12 @@ function Ae(e, t, n) {
|
|
|
986
1061
|
case "api":
|
|
987
1062
|
case "api_ids":
|
|
988
1063
|
case "api_detail": {
|
|
989
|
-
const i =
|
|
1064
|
+
const i = Te(t);
|
|
990
1065
|
if (!n || !i)
|
|
991
1066
|
return Array.isArray(e) ? e.map(String).join(", ") : String(e);
|
|
992
|
-
const a =
|
|
993
|
-
return a.length ? a.map((
|
|
994
|
-
const d =
|
|
1067
|
+
const a = xe(n, i);
|
|
1068
|
+
return a.length ? a.map((s) => {
|
|
1069
|
+
const d = Le(s, i), c = Ce(s, i);
|
|
995
1070
|
return c ? `${d} (${c})` : d;
|
|
996
1071
|
}).filter(Boolean).join(", ") || null : String(e);
|
|
997
1072
|
}
|
|
@@ -999,10 +1074,10 @@ function Ae(e, t, n) {
|
|
|
999
1074
|
return String(e);
|
|
1000
1075
|
}
|
|
1001
1076
|
}
|
|
1002
|
-
function
|
|
1077
|
+
function qt(e, t, n) {
|
|
1003
1078
|
const r = e.additional_config?.view_value;
|
|
1004
1079
|
if (r?.mode === "api" || r?.mode === "api_ids" || r?.mode === "api_detail")
|
|
1005
|
-
return
|
|
1080
|
+
return Se(
|
|
1006
1081
|
t,
|
|
1007
1082
|
r,
|
|
1008
1083
|
n.viewValueFetched
|
|
@@ -1010,274 +1085,274 @@ function jt(e, t, n) {
|
|
|
1010
1085
|
switch (e.field?.type?.code) {
|
|
1011
1086
|
case "text":
|
|
1012
1087
|
case "number":
|
|
1013
|
-
return
|
|
1088
|
+
return $(t) ? null : String(t);
|
|
1014
1089
|
case "datetime":
|
|
1015
|
-
return
|
|
1090
|
+
return Vt(t, e);
|
|
1016
1091
|
case "select":
|
|
1017
1092
|
case "radio":
|
|
1018
1093
|
case "checkbox":
|
|
1019
|
-
return
|
|
1094
|
+
return Ct(t, e, n.optionList);
|
|
1020
1095
|
case "image":
|
|
1021
1096
|
case "file":
|
|
1022
|
-
return
|
|
1097
|
+
return Ot(t);
|
|
1023
1098
|
default:
|
|
1024
|
-
return r ?
|
|
1099
|
+
return r ? Se(
|
|
1025
1100
|
t,
|
|
1026
1101
|
r,
|
|
1027
1102
|
n.viewValueFetched
|
|
1028
|
-
) :
|
|
1103
|
+
) : $(t) ? null : String(t);
|
|
1029
1104
|
}
|
|
1030
1105
|
}
|
|
1031
|
-
const
|
|
1032
|
-
function
|
|
1033
|
-
const t =
|
|
1106
|
+
const ie = /* @__PURE__ */ new Map(), Ut = 3e4;
|
|
1107
|
+
function Gt(e) {
|
|
1108
|
+
const t = ie.get(e);
|
|
1034
1109
|
if (t) {
|
|
1035
1110
|
if (Date.now() > t.expiresAt) {
|
|
1036
|
-
|
|
1111
|
+
ie.delete(e);
|
|
1037
1112
|
return;
|
|
1038
1113
|
}
|
|
1039
1114
|
return t.error;
|
|
1040
1115
|
}
|
|
1041
1116
|
}
|
|
1042
|
-
function
|
|
1043
|
-
|
|
1117
|
+
function Fe(e, t) {
|
|
1118
|
+
ie.set(e, {
|
|
1044
1119
|
error: t,
|
|
1045
|
-
expiresAt: Date.now() +
|
|
1120
|
+
expiresAt: Date.now() + Ut
|
|
1046
1121
|
});
|
|
1047
1122
|
}
|
|
1048
|
-
function
|
|
1049
|
-
const r =
|
|
1050
|
-
|
|
1051
|
-
const l =
|
|
1052
|
-
return
|
|
1123
|
+
function oe(e, t, n = !0) {
|
|
1124
|
+
const r = O(), [i, a] = x(), [o, s] = x(!1), [d, c] = x(), y = K(t), m = K(r);
|
|
1125
|
+
y.current = t, m.current = r;
|
|
1126
|
+
const l = te(e);
|
|
1127
|
+
return B(() => {
|
|
1053
1128
|
if (!n) {
|
|
1054
|
-
a(void 0), c(void 0),
|
|
1129
|
+
a(void 0), c(void 0), s(!1);
|
|
1055
1130
|
return;
|
|
1056
1131
|
}
|
|
1057
|
-
const
|
|
1058
|
-
if (
|
|
1059
|
-
c(
|
|
1132
|
+
const h = Gt(l);
|
|
1133
|
+
if (h !== void 0) {
|
|
1134
|
+
c(h), s(!1);
|
|
1060
1135
|
return;
|
|
1061
1136
|
}
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1137
|
+
const f = new AbortController();
|
|
1138
|
+
return s(!0), c(void 0), (async () => {
|
|
1064
1139
|
try {
|
|
1065
|
-
const
|
|
1140
|
+
const v = await ne(
|
|
1066
1141
|
m.current,
|
|
1067
1142
|
"viewCache",
|
|
1068
1143
|
l,
|
|
1069
|
-
(
|
|
1070
|
-
|
|
1144
|
+
(b) => y.current(b),
|
|
1145
|
+
f.signal
|
|
1071
1146
|
);
|
|
1072
|
-
|
|
1073
|
-
} catch (
|
|
1074
|
-
|
|
1147
|
+
f.signal.aborted || (a(v), c(void 0));
|
|
1148
|
+
} catch (v) {
|
|
1149
|
+
f.signal.aborted || (Fe(l, v), c(v));
|
|
1075
1150
|
} finally {
|
|
1076
|
-
|
|
1151
|
+
f.signal.aborted || s(!1);
|
|
1077
1152
|
}
|
|
1078
|
-
})(), () =>
|
|
1079
|
-
}, [n, l]), { data: i, isLoading:
|
|
1080
|
-
if (
|
|
1081
|
-
const
|
|
1082
|
-
|
|
1153
|
+
})(), () => f.abort();
|
|
1154
|
+
}, [n, l]), { data: i, isLoading: o, error: d, refetch: async () => {
|
|
1155
|
+
if (ie.delete(l), !n) return;
|
|
1156
|
+
const h = new AbortController();
|
|
1157
|
+
s(!0), c(void 0);
|
|
1083
1158
|
try {
|
|
1084
|
-
const
|
|
1159
|
+
const f = await ne(
|
|
1085
1160
|
m.current,
|
|
1086
1161
|
"viewCache",
|
|
1087
1162
|
l,
|
|
1088
|
-
(
|
|
1089
|
-
|
|
1163
|
+
(_) => y.current(_),
|
|
1164
|
+
h.signal
|
|
1090
1165
|
);
|
|
1091
|
-
return a(
|
|
1092
|
-
} catch (
|
|
1093
|
-
throw
|
|
1166
|
+
return a(f), f;
|
|
1167
|
+
} catch (f) {
|
|
1168
|
+
throw Fe(l, f), c(f), f;
|
|
1094
1169
|
} finally {
|
|
1095
|
-
|
|
1170
|
+
s(!1);
|
|
1096
1171
|
}
|
|
1097
1172
|
} };
|
|
1098
1173
|
}
|
|
1099
|
-
const
|
|
1100
|
-
const { client: r, renderers: i, i18n: a } =
|
|
1174
|
+
const Bt = ({ value: e, code: t, modeConfig: n }) => {
|
|
1175
|
+
const { client: r, renderers: i, i18n: a } = O(), o = P(
|
|
1101
1176
|
() => (Array.isArray(e) ? e : [e]).filter(Boolean),
|
|
1102
1177
|
[e]
|
|
1103
1178
|
), {
|
|
1104
|
-
data:
|
|
1179
|
+
data: s,
|
|
1105
1180
|
isLoading: d,
|
|
1106
1181
|
error: c
|
|
1107
|
-
} =
|
|
1108
|
-
["api_detail", t,
|
|
1182
|
+
} = oe(
|
|
1183
|
+
["api_detail", t, o, n?.url, n?.method],
|
|
1109
1184
|
async (l) => (await Promise.all(
|
|
1110
|
-
|
|
1111
|
-
const
|
|
1185
|
+
o.map(async (h) => {
|
|
1186
|
+
const f = re(n?.url || "", { id: h });
|
|
1112
1187
|
return (await r.request({
|
|
1113
1188
|
method: n?.method,
|
|
1114
|
-
url:
|
|
1189
|
+
url: f,
|
|
1115
1190
|
signal: l
|
|
1116
1191
|
})).data;
|
|
1117
1192
|
})
|
|
1118
1193
|
)).filter(Boolean),
|
|
1119
|
-
!!(
|
|
1120
|
-
),
|
|
1121
|
-
const p = n?.mapping_attr?.map((
|
|
1194
|
+
!!(o.length && n?.url)
|
|
1195
|
+
), y = (l, p, h) => i.link ? i.link({ url: l, label: p, data: h }) : /* @__PURE__ */ u("a", { href: l, target: "_blank", rel: "noreferrer", children: p }), m = (l) => {
|
|
1196
|
+
const p = n?.mapping_attr?.map((h) => l?.[h]).join(" - ");
|
|
1122
1197
|
if (n?.link) {
|
|
1123
|
-
const
|
|
1124
|
-
return
|
|
1198
|
+
const h = re(n.link, l);
|
|
1199
|
+
return y(h, p, l);
|
|
1125
1200
|
}
|
|
1126
1201
|
return p;
|
|
1127
1202
|
};
|
|
1128
|
-
return d ? /* @__PURE__ */
|
|
1129
|
-
},
|
|
1130
|
-
const { client: r, renderers: i, i18n: a } =
|
|
1131
|
-
data:
|
|
1132
|
-
isLoading:
|
|
1203
|
+
return d ? /* @__PURE__ */ u(C, { children: i.viewLoading?.() ?? /* @__PURE__ */ u(ue, { size: "small" }) }) : c ? /* @__PURE__ */ u(C, { children: i.viewError?.(c) ?? a.messages.viewError }) : s?.length ? /* @__PURE__ */ u(C, { children: s.map((l, p) => /* @__PURE__ */ u("div", { children: m(l) }, p)) }) : /* @__PURE__ */ u(C, { children: i.viewEmpty?.() ?? a.messages.viewEmpty });
|
|
1204
|
+
}, Ve = V(Bt), Wt = ({ value: e, code: t, modeConfig: n }) => {
|
|
1205
|
+
const { client: r, renderers: i, i18n: a } = O(), {
|
|
1206
|
+
data: o,
|
|
1207
|
+
isLoading: s,
|
|
1133
1208
|
error: d
|
|
1134
|
-
} =
|
|
1209
|
+
} = oe(
|
|
1135
1210
|
["api_ids", t, e, n?.url, n?.method],
|
|
1136
1211
|
async (m) => {
|
|
1137
|
-
const l = n?.method || "GET", p = l.toUpperCase() === "POST",
|
|
1212
|
+
const l = n?.method || "GET", p = l.toUpperCase() === "POST", h = Array.isArray(e) ? e : [e], _ = (await r.request({
|
|
1138
1213
|
method: l,
|
|
1139
1214
|
url: n?.url || "",
|
|
1140
|
-
data: p ? { ids:
|
|
1141
|
-
params: p ? void 0 : { ids:
|
|
1215
|
+
data: p ? { ids: h } : void 0,
|
|
1216
|
+
params: p ? void 0 : { ids: h },
|
|
1142
1217
|
signal: m
|
|
1143
|
-
})).data,
|
|
1144
|
-
return Array.isArray(
|
|
1218
|
+
})).data, v = n?.data_path ? z(_, n.data_path) : _;
|
|
1219
|
+
return Array.isArray(v) ? v : _;
|
|
1145
1220
|
},
|
|
1146
1221
|
!!(e && n?.url)
|
|
1147
|
-
), c = (m, l, p) => i.link ? i.link({ url: m, label: l, data: p }) : /* @__PURE__ */
|
|
1222
|
+
), c = (m, l, p) => i.link ? i.link({ url: m, label: l, data: p }) : /* @__PURE__ */ u("a", { href: m, target: "_blank", rel: "noreferrer", children: l }), y = (m) => {
|
|
1148
1223
|
const l = n?.mapping_attr?.map((p) => m?.[p]).join(" - ");
|
|
1149
1224
|
if (n?.link) {
|
|
1150
|
-
const p =
|
|
1225
|
+
const p = re(n.link, m);
|
|
1151
1226
|
return c(p, l, m);
|
|
1152
1227
|
}
|
|
1153
1228
|
return l;
|
|
1154
1229
|
};
|
|
1155
|
-
return
|
|
1156
|
-
Array.isArray(
|
|
1157
|
-
) : /* @__PURE__ */
|
|
1158
|
-
},
|
|
1230
|
+
return s ? /* @__PURE__ */ u(C, { children: i.viewLoading?.() ?? /* @__PURE__ */ u(ue, { size: "small" }) }) : d ? /* @__PURE__ */ u(C, { children: i.viewError?.(d) ?? a.messages.viewError }) : o ? Array.isArray(e) ? /* @__PURE__ */ u(de, { vertical: !0, children: (Array.isArray(o) ? o : [o]).map((m, l) => /* @__PURE__ */ u("div", { children: y(m) }, m.id ?? l)) }) : y(
|
|
1231
|
+
Array.isArray(o) ? o[0] : o
|
|
1232
|
+
) : /* @__PURE__ */ u(C, { children: i.viewEmpty?.() ?? a.messages.viewEmpty });
|
|
1233
|
+
}, Oe = V(Wt), It = ({
|
|
1159
1234
|
value: e,
|
|
1160
1235
|
code: t,
|
|
1161
1236
|
modeConfig: n,
|
|
1162
1237
|
viewConfig: r
|
|
1163
1238
|
}) => {
|
|
1164
|
-
const { client: i, renderers: a, i18n:
|
|
1165
|
-
() => n ?? (r ?
|
|
1239
|
+
const { client: i, renderers: a, i18n: o } = O(), s = P(
|
|
1240
|
+
() => n ?? (r ? Te(r) : void 0),
|
|
1166
1241
|
[n, r]
|
|
1167
|
-
), d =
|
|
1168
|
-
() => ["api_view", t, e,
|
|
1169
|
-
[t, e,
|
|
1170
|
-
), c =
|
|
1171
|
-
async (
|
|
1242
|
+
), d = P(
|
|
1243
|
+
() => ["api_view", t, e, s?.url, s?.method, s?.data_path],
|
|
1244
|
+
[t, e, s?.url, s?.method, s?.data_path]
|
|
1245
|
+
), c = L(
|
|
1246
|
+
async (f) => s ? Pt(
|
|
1172
1247
|
e,
|
|
1173
|
-
|
|
1174
|
-
(
|
|
1248
|
+
s,
|
|
1249
|
+
(_) => i.request({ ..._, signal: f })
|
|
1175
1250
|
) : [],
|
|
1176
|
-
[i,
|
|
1177
|
-
), { data:
|
|
1178
|
-
if (!
|
|
1179
|
-
const
|
|
1180
|
-
return /* @__PURE__ */
|
|
1251
|
+
[i, s, e]
|
|
1252
|
+
), { data: y, isLoading: m, error: l } = oe(d, c, !!(e && s?.url)), p = (f, _, v) => a.link ? a.link({ url: f, label: _, data: v }) : /* @__PURE__ */ u("a", { href: f, target: "_blank", rel: "noreferrer", children: _ }), h = (f, _) => {
|
|
1253
|
+
if (!s) return null;
|
|
1254
|
+
const v = Le(f, s), b = Ce(f, s), w = b ? p(b, v, f) : v;
|
|
1255
|
+
return /* @__PURE__ */ u("div", { children: w }, f.id ?? _);
|
|
1181
1256
|
};
|
|
1182
|
-
return m ? /* @__PURE__ */
|
|
1183
|
-
},
|
|
1184
|
-
function
|
|
1257
|
+
return m ? /* @__PURE__ */ u(C, { children: a.viewLoading?.() ?? /* @__PURE__ */ u(ue, { size: "small" }) }) : l ? /* @__PURE__ */ u(C, { children: a.viewError?.(l) ?? o.messages.viewError }) : y?.length ? s?.result_type === "object" && y.length === 1 ? h(y[0], 0) : /* @__PURE__ */ u(de, { vertical: !0, children: y.map(h) }) : /* @__PURE__ */ u(C, { children: a.viewEmpty?.() ?? o.messages.viewEmpty });
|
|
1258
|
+
}, Me = V(It);
|
|
1259
|
+
function Kt(e) {
|
|
1185
1260
|
return !!(e.option_config && e.is_option_api);
|
|
1186
1261
|
}
|
|
1187
|
-
function
|
|
1188
|
-
const n =
|
|
1262
|
+
function $t(e, t) {
|
|
1263
|
+
const n = O(), r = te([
|
|
1189
1264
|
"viewModeOptions",
|
|
1190
1265
|
e.map((a) => a.code),
|
|
1191
1266
|
t
|
|
1192
|
-
]), { data: i } =
|
|
1267
|
+
]), { data: i } = oe(
|
|
1193
1268
|
[r],
|
|
1194
1269
|
async (a) => {
|
|
1195
|
-
const
|
|
1270
|
+
const o = {};
|
|
1196
1271
|
return await Promise.all(
|
|
1197
|
-
e.map(async (
|
|
1198
|
-
if (!
|
|
1199
|
-
const d =
|
|
1200
|
-
method:
|
|
1201
|
-
url:
|
|
1272
|
+
e.map(async (s) => {
|
|
1273
|
+
if (!s.option_config?.url) return;
|
|
1274
|
+
const d = Tt(s, t), c = s.option_config.method?.toUpperCase() === "GET" || !s.option_config.method, y = await n.client.request({
|
|
1275
|
+
method: s.option_config.method || "GET",
|
|
1276
|
+
url: s.option_config.url,
|
|
1202
1277
|
params: c ? d?.params : void 0,
|
|
1203
1278
|
data: c ? void 0 : d?.data,
|
|
1204
1279
|
signal: a
|
|
1205
1280
|
});
|
|
1206
|
-
s
|
|
1207
|
-
optionList: n.parsers.optionResponse(
|
|
1281
|
+
o[s.code] = {
|
|
1282
|
+
optionList: n.parsers.optionResponse(y.data, s)
|
|
1208
1283
|
};
|
|
1209
1284
|
})
|
|
1210
|
-
),
|
|
1285
|
+
), o;
|
|
1211
1286
|
},
|
|
1212
1287
|
e.length > 0
|
|
1213
1288
|
);
|
|
1214
1289
|
return i ?? {};
|
|
1215
1290
|
}
|
|
1216
|
-
const
|
|
1291
|
+
const an = ({
|
|
1217
1292
|
formConfig: e,
|
|
1218
1293
|
formValues: t
|
|
1219
1294
|
}) => {
|
|
1220
|
-
const n = e?.form?.field_groups ?? [], r =
|
|
1221
|
-
() => n.filter(
|
|
1295
|
+
const n = e?.form?.field_groups ?? [], r = P(
|
|
1296
|
+
() => n.filter(Kt),
|
|
1222
1297
|
[n]
|
|
1223
|
-
), i =
|
|
1224
|
-
return
|
|
1225
|
-
const
|
|
1298
|
+
), i = $t(r, t);
|
|
1299
|
+
return P(() => n.filter((o) => !o.is_hidden).map((o) => {
|
|
1300
|
+
const s = t?.[o.code], d = o.additional_config?.view_value, c = d?.mode;
|
|
1226
1301
|
if (c === "api" && d)
|
|
1227
1302
|
return {
|
|
1228
|
-
key:
|
|
1229
|
-
label:
|
|
1230
|
-
rawValue:
|
|
1231
|
-
viewValue: /* @__PURE__ */
|
|
1232
|
-
|
|
1303
|
+
key: o.code,
|
|
1304
|
+
label: o.label,
|
|
1305
|
+
rawValue: s,
|
|
1306
|
+
viewValue: /* @__PURE__ */ u(
|
|
1307
|
+
Me,
|
|
1233
1308
|
{
|
|
1234
|
-
code:
|
|
1235
|
-
value:
|
|
1309
|
+
code: o.code,
|
|
1310
|
+
value: s,
|
|
1236
1311
|
viewConfig: d
|
|
1237
1312
|
}
|
|
1238
1313
|
),
|
|
1239
|
-
field_group:
|
|
1314
|
+
field_group: o
|
|
1240
1315
|
};
|
|
1241
1316
|
if (c === "api_ids" && d?.api_ids)
|
|
1242
1317
|
return {
|
|
1243
|
-
key:
|
|
1244
|
-
label:
|
|
1245
|
-
rawValue:
|
|
1246
|
-
viewValue: /* @__PURE__ */
|
|
1247
|
-
|
|
1318
|
+
key: o.code,
|
|
1319
|
+
label: o.label,
|
|
1320
|
+
rawValue: s,
|
|
1321
|
+
viewValue: /* @__PURE__ */ u(
|
|
1322
|
+
Oe,
|
|
1248
1323
|
{
|
|
1249
|
-
code:
|
|
1250
|
-
value:
|
|
1324
|
+
code: o.code,
|
|
1325
|
+
value: s,
|
|
1251
1326
|
modeConfig: d.api_ids
|
|
1252
1327
|
}
|
|
1253
1328
|
),
|
|
1254
|
-
field_group:
|
|
1329
|
+
field_group: o
|
|
1255
1330
|
};
|
|
1256
1331
|
if (c === "api_detail" && d?.api_detail)
|
|
1257
1332
|
return {
|
|
1258
|
-
key:
|
|
1259
|
-
label:
|
|
1260
|
-
rawValue:
|
|
1261
|
-
viewValue: /* @__PURE__ */
|
|
1262
|
-
|
|
1333
|
+
key: o.code,
|
|
1334
|
+
label: o.label,
|
|
1335
|
+
rawValue: s,
|
|
1336
|
+
viewValue: /* @__PURE__ */ u(
|
|
1337
|
+
Ve,
|
|
1263
1338
|
{
|
|
1264
|
-
code:
|
|
1265
|
-
value:
|
|
1339
|
+
code: o.code,
|
|
1340
|
+
value: s,
|
|
1266
1341
|
modeConfig: d.api_detail
|
|
1267
1342
|
}
|
|
1268
1343
|
),
|
|
1269
|
-
field_group:
|
|
1344
|
+
field_group: o
|
|
1270
1345
|
};
|
|
1271
|
-
const
|
|
1346
|
+
const y = i[o.code] ?? {};
|
|
1272
1347
|
return {
|
|
1273
|
-
key:
|
|
1274
|
-
label:
|
|
1275
|
-
rawValue:
|
|
1276
|
-
viewValue:
|
|
1277
|
-
field_group:
|
|
1348
|
+
key: o.code,
|
|
1349
|
+
label: o.label,
|
|
1350
|
+
rawValue: s,
|
|
1351
|
+
viewValue: qt(o, s, y),
|
|
1352
|
+
field_group: o
|
|
1278
1353
|
};
|
|
1279
1354
|
}), [i, n, t]);
|
|
1280
|
-
},
|
|
1355
|
+
}, zt = ({
|
|
1281
1356
|
code: e,
|
|
1282
1357
|
value: t,
|
|
1283
1358
|
fieldGroup: n
|
|
@@ -1287,19 +1362,19 @@ const en = ({
|
|
|
1287
1362
|
case "raw":
|
|
1288
1363
|
return t;
|
|
1289
1364
|
case "api":
|
|
1290
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ u(Me, { code: e, value: t, viewConfig: r });
|
|
1291
1366
|
case "api_ids": {
|
|
1292
1367
|
const i = r?.api_ids;
|
|
1293
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ u(Oe, { code: e, value: t, modeConfig: i });
|
|
1294
1369
|
}
|
|
1295
1370
|
case "api_detail": {
|
|
1296
1371
|
const i = r?.api_detail;
|
|
1297
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ u(Ve, { code: e, value: t, modeConfig: i });
|
|
1298
1373
|
}
|
|
1299
1374
|
default:
|
|
1300
1375
|
return t;
|
|
1301
1376
|
}
|
|
1302
|
-
},
|
|
1377
|
+
}, on = V(zt), je = {
|
|
1303
1378
|
submit: "Save",
|
|
1304
1379
|
submitError: "Failed to submit form",
|
|
1305
1380
|
inputPlaceholder: (e) => `Enter ${e}`,
|
|
@@ -1310,9 +1385,9 @@ const en = ({
|
|
|
1310
1385
|
viewLoading: "Loading...",
|
|
1311
1386
|
viewEmpty: "-",
|
|
1312
1387
|
viewError: "Failed to load"
|
|
1313
|
-
},
|
|
1314
|
-
messages:
|
|
1315
|
-
},
|
|
1388
|
+
}, sn = {
|
|
1389
|
+
messages: je
|
|
1390
|
+
}, Ht = (e) => {
|
|
1316
1391
|
if (Array.isArray(e)) return e;
|
|
1317
1392
|
if (e && typeof e == "object" && "items" in e && Array.isArray(e.items))
|
|
1318
1393
|
return e.items;
|
|
@@ -1321,84 +1396,84 @@ const en = ({
|
|
|
1321
1396
|
return Array.isArray(t.items) ? t.items : [];
|
|
1322
1397
|
}
|
|
1323
1398
|
return [];
|
|
1324
|
-
},
|
|
1399
|
+
}, Yt = (e) => ({
|
|
1325
1400
|
redirectUrl: e?.redirect_after_create,
|
|
1326
1401
|
data: e
|
|
1327
|
-
}),
|
|
1328
|
-
optionResponse:
|
|
1329
|
-
submitResponse:
|
|
1330
|
-
viewResponse:
|
|
1331
|
-
},
|
|
1402
|
+
}), Nt = (e, t) => t?.dataPath ? z(e, t.dataPath) : e, le = {
|
|
1403
|
+
optionResponse: Ht,
|
|
1404
|
+
submitResponse: Yt,
|
|
1405
|
+
viewResponse: Nt
|
|
1406
|
+
}, Jt = (e, t = "_blank") => {
|
|
1332
1407
|
window.open(e, t);
|
|
1333
|
-
},
|
|
1408
|
+
}, ce = {
|
|
1334
1409
|
upload: async () => {
|
|
1335
1410
|
throw new Error("Upload adapter is not configured");
|
|
1336
1411
|
},
|
|
1337
1412
|
remove: async () => !1
|
|
1338
1413
|
};
|
|
1339
|
-
function
|
|
1414
|
+
function ln({
|
|
1340
1415
|
children: e,
|
|
1341
1416
|
client: t,
|
|
1342
1417
|
upload: n,
|
|
1343
1418
|
i18n: r,
|
|
1344
1419
|
parsers: i,
|
|
1345
1420
|
renderers: a = {},
|
|
1346
|
-
transformers:
|
|
1347
|
-
cache:
|
|
1421
|
+
transformers: o = {},
|
|
1422
|
+
cache: s,
|
|
1348
1423
|
submitDebounceMs: d = 200,
|
|
1349
1424
|
redirectHandler: c,
|
|
1350
1425
|
// legacy props
|
|
1351
|
-
requestClient:
|
|
1426
|
+
requestClient: y,
|
|
1352
1427
|
uploadAdapter: m,
|
|
1353
1428
|
deleteUploadAdapter: l,
|
|
1354
1429
|
messages: p,
|
|
1355
|
-
optionResponseParser:
|
|
1356
|
-
customFieldRenderers:
|
|
1430
|
+
optionResponseParser: h,
|
|
1431
|
+
customFieldRenderers: f
|
|
1357
1432
|
}) {
|
|
1358
|
-
const
|
|
1359
|
-
const
|
|
1360
|
-
request:
|
|
1433
|
+
const _ = K(/* @__PURE__ */ new Map()), v = K(/* @__PURE__ */ new Map()), b = P(() => {
|
|
1434
|
+
const w = t ?? {
|
|
1435
|
+
request: y ?? (() => {
|
|
1361
1436
|
throw new Error("DynamicFormProvider requires client or requestClient");
|
|
1362
1437
|
})
|
|
1363
|
-
}, S =
|
|
1364
|
-
match:
|
|
1365
|
-
render:
|
|
1438
|
+
}, S = f ? Object.entries(f).map(([k, E]) => ({
|
|
1439
|
+
match: k,
|
|
1440
|
+
render: E
|
|
1366
1441
|
})) : [], A = {
|
|
1367
|
-
...
|
|
1442
|
+
...je,
|
|
1368
1443
|
...r?.messages,
|
|
1369
1444
|
...p
|
|
1370
1445
|
}, g = {
|
|
1371
|
-
...
|
|
1446
|
+
...ce,
|
|
1372
1447
|
...n,
|
|
1373
|
-
upload: n?.upload ?? m ??
|
|
1374
|
-
remove: n?.remove ?? (l ? (
|
|
1448
|
+
upload: n?.upload ?? m ?? ce.upload,
|
|
1449
|
+
remove: n?.remove ?? (l ? (k) => l(k.path) : ce.remove)
|
|
1375
1450
|
};
|
|
1376
1451
|
return {
|
|
1377
|
-
client:
|
|
1452
|
+
client: w,
|
|
1378
1453
|
upload: g,
|
|
1379
1454
|
i18n: { messages: A },
|
|
1380
1455
|
parsers: {
|
|
1381
|
-
optionResponse: i?.optionResponse ??
|
|
1382
|
-
submitResponse: i?.submitResponse ??
|
|
1383
|
-
viewResponse: i?.viewResponse ??
|
|
1456
|
+
optionResponse: i?.optionResponse ?? h ?? le.optionResponse,
|
|
1457
|
+
submitResponse: i?.submitResponse ?? le.submitResponse,
|
|
1458
|
+
viewResponse: i?.viewResponse ?? le.viewResponse
|
|
1384
1459
|
},
|
|
1385
1460
|
renderers: {
|
|
1386
1461
|
...a,
|
|
1387
1462
|
fields: [...a.fields ?? [], ...S]
|
|
1388
1463
|
},
|
|
1389
|
-
transformers:
|
|
1464
|
+
transformers: o,
|
|
1390
1465
|
cache: {
|
|
1391
|
-
enabled:
|
|
1392
|
-
ttlMs:
|
|
1466
|
+
enabled: s?.enabled ?? !0,
|
|
1467
|
+
ttlMs: s?.ttlMs ?? 6e4
|
|
1393
1468
|
},
|
|
1394
1469
|
submitDebounceMs: d,
|
|
1395
|
-
redirectHandler: c ??
|
|
1396
|
-
optionCache:
|
|
1397
|
-
viewCache:
|
|
1470
|
+
redirectHandler: c ?? Jt,
|
|
1471
|
+
optionCache: _.current,
|
|
1472
|
+
viewCache: v.current
|
|
1398
1473
|
};
|
|
1399
1474
|
}, [
|
|
1400
1475
|
t,
|
|
1401
|
-
|
|
1476
|
+
y,
|
|
1402
1477
|
n,
|
|
1403
1478
|
m,
|
|
1404
1479
|
l,
|
|
@@ -1407,18 +1482,18 @@ function rn({
|
|
|
1407
1482
|
i?.optionResponse,
|
|
1408
1483
|
i?.submitResponse,
|
|
1409
1484
|
i?.viewResponse,
|
|
1410
|
-
|
|
1485
|
+
h,
|
|
1411
1486
|
a,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1487
|
+
f,
|
|
1488
|
+
o,
|
|
1489
|
+
s?.enabled,
|
|
1490
|
+
s?.ttlMs,
|
|
1416
1491
|
d,
|
|
1417
1492
|
c
|
|
1418
1493
|
]);
|
|
1419
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ u(fe.Provider, { value: b, children: e });
|
|
1420
1495
|
}
|
|
1421
|
-
function
|
|
1496
|
+
function cn(e) {
|
|
1422
1497
|
return {
|
|
1423
1498
|
request: async (t) => ({ data: (await e({
|
|
1424
1499
|
method: t.method,
|
|
@@ -1432,55 +1507,55 @@ function an(e) {
|
|
|
1432
1507
|
};
|
|
1433
1508
|
}
|
|
1434
1509
|
export {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1510
|
+
Ve as ApiDetailItem,
|
|
1511
|
+
Oe as ApiItem,
|
|
1512
|
+
Me as ApiViewItem,
|
|
1513
|
+
St as DefaultLayout,
|
|
1514
|
+
Rt as DynamicForm,
|
|
1515
|
+
ln as DynamicFormProvider,
|
|
1516
|
+
At as FormItem,
|
|
1517
|
+
on as MetaItemValue,
|
|
1518
|
+
Dt as buildApiViewRequests,
|
|
1519
|
+
te as buildCacheKey,
|
|
1520
|
+
ne as cachedRequest,
|
|
1521
|
+
cn as createAxiosDynamicFormClient,
|
|
1522
|
+
me as debounce,
|
|
1523
|
+
sn as defaultI18n,
|
|
1524
|
+
je as defaultMessages,
|
|
1525
|
+
Ht as defaultOptionResponseParser,
|
|
1526
|
+
le as defaultParsers,
|
|
1527
|
+
Jt as defaultRedirectHandler,
|
|
1528
|
+
Yt as defaultSubmitResponseParser,
|
|
1529
|
+
Nt as defaultViewResponseParser,
|
|
1530
|
+
yt as extractDependencyFields,
|
|
1531
|
+
xe as extractViewData,
|
|
1532
|
+
Pt as fetchApiViewItems,
|
|
1533
|
+
re as fillTemplate,
|
|
1534
|
+
z as getByPath,
|
|
1535
|
+
ft as getCached,
|
|
1536
|
+
Le as getMappedLabel,
|
|
1537
|
+
Ce as getMappedLink,
|
|
1538
|
+
$ as isEmptyValue,
|
|
1539
|
+
nt as mapOptionToSelectItem,
|
|
1540
|
+
rt as mapOptions,
|
|
1541
|
+
Te as normalizeApiViewConfig,
|
|
1542
|
+
rn as normalizeMetaForForm,
|
|
1543
|
+
ht as parseFormValues,
|
|
1544
|
+
I as replaceTemplateInObject,
|
|
1545
|
+
Tt as resolveApiOptionMeta,
|
|
1546
|
+
et as resolveFieldRenderer,
|
|
1547
|
+
tt as resolveFieldRendererFromMap,
|
|
1548
|
+
qt as resolveFieldViewValue,
|
|
1549
|
+
Se as resolveViewValueConfig,
|
|
1550
|
+
mt as setCache,
|
|
1551
|
+
oe as useCachedViewRequest,
|
|
1552
|
+
bt as useDependencyValues,
|
|
1553
|
+
ut as useDynamicField,
|
|
1554
|
+
O as useDynamicFormContext,
|
|
1555
|
+
nn as useDynamicFormContextOptional,
|
|
1556
|
+
vt as useDynamicOptions,
|
|
1557
|
+
Ft as useFieldGroups,
|
|
1558
|
+
Et as useFieldStates,
|
|
1559
|
+
kt as useProcessedValues,
|
|
1560
|
+
an as useViewMode
|
|
1486
1561
|
};
|