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