@trungkhai/dynamic-form 0.1.3 → 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 +658 -593
- package/package.json +1 -1
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 Ze(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 tt(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: h, onProgress:
|
|
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
147
|
signal: h,
|
|
137
|
-
onProgress:
|
|
138
|
-
metadata:
|
|
148
|
+
onProgress: f,
|
|
149
|
+
metadata: b
|
|
139
150
|
}) : (() => {
|
|
140
151
|
const g = new FormData();
|
|
141
|
-
return g.append("file", p),
|
|
142
|
-
g.append(k, String(
|
|
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:
|
|
158
|
+
data: w,
|
|
159
|
+
headers: w instanceof FormData ? { "Content-Type": "multipart/form-data" } : void 0,
|
|
149
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,143 +170,143 @@ const rt = ({
|
|
|
159
170
|
path: String(A.path ?? "")
|
|
160
171
|
};
|
|
161
172
|
};
|
|
162
|
-
}, [r, i, t]), c =
|
|
173
|
+
}, [r, i, t]), c = L(
|
|
163
174
|
(l, p) => (h) => {
|
|
164
|
-
const { file:
|
|
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
|
-
), y =
|
|
193
|
+
[s.uploadError, d, i.uploadUrl, t]
|
|
194
|
+
), y = L(
|
|
184
195
|
(l, p) => async (h) => {
|
|
185
|
-
const
|
|
186
|
-
return
|
|
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
203
|
options: h,
|
|
193
|
-
optionsLoading:
|
|
194
|
-
optionsError:
|
|
195
|
-
onSearchKeyword:
|
|
196
|
-
readOnly:
|
|
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
213
|
if (k)
|
|
203
214
|
return k(l, {
|
|
204
215
|
state: p,
|
|
205
216
|
options: h,
|
|
206
|
-
optionsLoading:
|
|
207
|
-
optionsError:
|
|
208
|
-
onSearchKeyword:
|
|
209
|
-
readOnly:
|
|
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
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
311
|
onRemove: y(l.code, l)
|
|
301
312
|
}
|
|
@@ -308,17 +319,17 @@ const rt = ({
|
|
|
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 dt(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 tn(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,160 +424,214 @@ function q(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
|
|
433
|
+
function _t(e, t, n) {
|
|
423
434
|
const i = t.find((a) => a.code === e)?.additional_config?.on_field_change?.clear ?? [];
|
|
424
435
|
return i.length === 0 ? [] : i.filter(
|
|
425
436
|
(a) => n?.[a] !== void 0 && n?.[a] !== null
|
|
426
437
|
);
|
|
427
438
|
}
|
|
428
|
-
function
|
|
429
|
-
const n =
|
|
430
|
-
() =>
|
|
439
|
+
function bt(e, t) {
|
|
440
|
+
const n = P(
|
|
441
|
+
() => yt(e),
|
|
431
442
|
[e]
|
|
432
|
-
), r =
|
|
443
|
+
), r = G.useWatch(
|
|
433
444
|
n.length > 0 ? n : void 0,
|
|
434
445
|
t
|
|
435
446
|
);
|
|
436
|
-
return
|
|
447
|
+
return P(() => {
|
|
437
448
|
if (!n.length) return {};
|
|
438
449
|
const i = {};
|
|
439
|
-
return n.forEach((a,
|
|
440
|
-
Array.isArray(r) ? i[a] = r[
|
|
450
|
+
return n.forEach((a, o) => {
|
|
451
|
+
Array.isArray(r) ? i[a] = r[o] : i[a] = r;
|
|
441
452
|
}), i;
|
|
442
453
|
}, [n, r]);
|
|
443
454
|
}
|
|
444
|
-
function
|
|
455
|
+
function vt({
|
|
445
456
|
group: e,
|
|
446
457
|
formInstance: t,
|
|
447
458
|
searchKeyword: n = "",
|
|
448
459
|
searchDebounceMs: r = 500
|
|
449
460
|
}) {
|
|
450
|
-
const i =
|
|
451
|
-
() =>
|
|
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),
|
|
452
463
|
[r]
|
|
453
464
|
);
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}, [n,
|
|
457
|
-
const
|
|
458
|
-
const
|
|
459
|
-
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))
|
|
460
471
|
return {
|
|
461
|
-
params:
|
|
462
|
-
data:
|
|
472
|
+
params: S ? I(S, a) : void 0,
|
|
473
|
+
data: A ? I(A, a) : void 0
|
|
463
474
|
};
|
|
464
|
-
}, [a, e]), w =
|
|
475
|
+
}, [a, e]), w = L(async () => {
|
|
465
476
|
if (!e.option_config || !e.is_option_api || !e.option_config.url)
|
|
466
477
|
return;
|
|
467
|
-
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
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([
|
|
471
482
|
e.code,
|
|
472
483
|
e.option_config.url,
|
|
473
484
|
e.option_config.method,
|
|
474
|
-
|
|
475
|
-
|
|
485
|
+
b,
|
|
486
|
+
g
|
|
476
487
|
]);
|
|
477
|
-
|
|
488
|
+
y(!0), l(void 0);
|
|
478
489
|
try {
|
|
479
|
-
const
|
|
490
|
+
const E = await ne(
|
|
480
491
|
i,
|
|
481
492
|
"optionCache",
|
|
482
|
-
|
|
483
|
-
async (
|
|
484
|
-
const
|
|
493
|
+
k,
|
|
494
|
+
async (R) => {
|
|
495
|
+
const T = await i.client.request({
|
|
485
496
|
method: e.option_config?.method || "GET",
|
|
486
497
|
url: e.option_config?.url,
|
|
487
|
-
params:
|
|
488
|
-
data: !
|
|
489
|
-
signal:
|
|
498
|
+
params: A && _ ? { ...b?.params, keywords: g } : b?.params,
|
|
499
|
+
data: !A && _ ? { ...b?.data, keywords: g } : b?.data,
|
|
500
|
+
signal: R
|
|
490
501
|
});
|
|
491
|
-
return i.parsers.optionResponse(
|
|
502
|
+
return i.parsers.optionResponse(T.data, e);
|
|
492
503
|
},
|
|
493
|
-
|
|
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
|
|
494
552
|
);
|
|
495
|
-
|
|
496
|
-
} catch (
|
|
497
|
-
|
|
553
|
+
S.signal.aborted || d(J);
|
|
554
|
+
} catch (E) {
|
|
555
|
+
S.signal.aborted || l(E);
|
|
498
556
|
} finally {
|
|
499
|
-
|
|
557
|
+
S.signal.aborted || y(!1);
|
|
500
558
|
}
|
|
501
|
-
}, [
|
|
502
|
-
|
|
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 };
|
|
503
568
|
}
|
|
504
|
-
const
|
|
569
|
+
const wt = ({
|
|
505
570
|
group: e,
|
|
506
571
|
formInstance: t,
|
|
507
572
|
fieldState: n,
|
|
508
573
|
setFieldState: r,
|
|
509
574
|
uploadUrl: i,
|
|
510
575
|
readOnly: a = !1,
|
|
511
|
-
size:
|
|
512
|
-
...
|
|
576
|
+
size: o = "middle",
|
|
577
|
+
...s
|
|
513
578
|
}) => {
|
|
514
|
-
const { getDynamicField: d } =
|
|
579
|
+
const { getDynamicField: d } = ut({
|
|
515
580
|
formInstance: t,
|
|
516
581
|
uploadUrl: i,
|
|
517
582
|
setFieldState: r
|
|
518
|
-
}), 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({
|
|
519
584
|
group: e,
|
|
520
585
|
formInstance: t,
|
|
521
586
|
searchKeyword: y,
|
|
522
587
|
searchDebounceMs: e.additional_config?.select?.searchDebounceMs ?? 500
|
|
523
|
-
}),
|
|
524
|
-
m(
|
|
588
|
+
}), _ = L((b) => {
|
|
589
|
+
m(b);
|
|
525
590
|
}, []);
|
|
526
|
-
|
|
527
|
-
e.additional_config?.on_field_empty?.disable?.length && e.additional_config.on_field_empty.disable.forEach((
|
|
528
|
-
r(
|
|
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 });
|
|
529
594
|
});
|
|
530
595
|
}, [c, t, e, r]);
|
|
531
|
-
const
|
|
532
|
-
return /* @__PURE__ */
|
|
533
|
-
|
|
596
|
+
const v = o === "small" ? 4 : 12;
|
|
597
|
+
return /* @__PURE__ */ u(
|
|
598
|
+
G.Item,
|
|
534
599
|
{
|
|
535
600
|
label: e.label,
|
|
536
601
|
name: e.code,
|
|
537
602
|
hidden: n?.hidden,
|
|
538
603
|
rules: [{ required: n?.required || !1 }],
|
|
539
|
-
style: { marginBottom:
|
|
540
|
-
...
|
|
604
|
+
style: { marginBottom: v, ...s.style },
|
|
605
|
+
...s,
|
|
541
606
|
children: d(e, {
|
|
542
607
|
state: n,
|
|
543
608
|
options: p,
|
|
544
609
|
optionsLoading: h,
|
|
545
|
-
optionsError:
|
|
546
|
-
onSearchKeyword: l ?
|
|
610
|
+
optionsError: f,
|
|
611
|
+
onSearchKeyword: l ? _ : void 0,
|
|
547
612
|
readOnly: a
|
|
548
613
|
})
|
|
549
614
|
}
|
|
550
615
|
);
|
|
551
616
|
};
|
|
552
|
-
function
|
|
617
|
+
function gt(e, t) {
|
|
553
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;
|
|
554
619
|
}
|
|
555
|
-
const
|
|
556
|
-
function
|
|
620
|
+
const At = V(wt, gt);
|
|
621
|
+
function St({
|
|
557
622
|
fieldGroups: e,
|
|
558
623
|
fieldStates: t,
|
|
559
624
|
renderField: n,
|
|
560
625
|
gutter: r,
|
|
561
626
|
defaultColSpan: i
|
|
562
627
|
}) {
|
|
563
|
-
return /* @__PURE__ */
|
|
564
|
-
const
|
|
565
|
-
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);
|
|
566
631
|
}) });
|
|
567
632
|
}
|
|
568
|
-
function
|
|
569
|
-
return
|
|
633
|
+
function Ft(e) {
|
|
634
|
+
return P(() => {
|
|
570
635
|
const t = e?.form?.field_groups ?? [], n = /* @__PURE__ */ new Map(), r = {};
|
|
571
636
|
t.forEach((a) => {
|
|
572
637
|
n.set(a.code, a), a.additional_config?.default !== void 0 && (r[a.code] = a.additional_config.default);
|
|
@@ -575,7 +640,7 @@ function At(e) {
|
|
|
575
640
|
return { fieldGroups: t, fieldByCode: n, visibleFieldGroups: i, initialValues: r };
|
|
576
641
|
}, [e]);
|
|
577
642
|
}
|
|
578
|
-
function
|
|
643
|
+
function ge(e) {
|
|
579
644
|
const t = {};
|
|
580
645
|
return e.forEach((n) => {
|
|
581
646
|
t[n.code] = {
|
|
@@ -585,37 +650,37 @@ function we(e) {
|
|
|
585
650
|
};
|
|
586
651
|
}), t;
|
|
587
652
|
}
|
|
588
|
-
function
|
|
589
|
-
const [t, n] =
|
|
590
|
-
() =>
|
|
653
|
+
function Et(e) {
|
|
654
|
+
const [t, n] = x(
|
|
655
|
+
() => ge(e)
|
|
591
656
|
);
|
|
592
|
-
|
|
593
|
-
n(
|
|
657
|
+
B(() => {
|
|
658
|
+
n(ge(e));
|
|
594
659
|
}, [e]);
|
|
595
|
-
const r =
|
|
596
|
-
n((
|
|
597
|
-
...
|
|
598
|
-
[i]: { ...
|
|
660
|
+
const r = L((i, a) => {
|
|
661
|
+
n((o) => ({
|
|
662
|
+
...o,
|
|
663
|
+
[i]: { ...o[i], ...a }
|
|
599
664
|
}));
|
|
600
665
|
}, []);
|
|
601
666
|
return { fieldStates: t, setFieldStates: n, setFieldState: r };
|
|
602
667
|
}
|
|
603
|
-
function
|
|
668
|
+
function kt({
|
|
604
669
|
formInstance: e,
|
|
605
670
|
fieldByCode: t,
|
|
606
671
|
relatedData: n,
|
|
607
672
|
transformers: r
|
|
608
673
|
}) {
|
|
609
|
-
return { buildProcessedValues:
|
|
674
|
+
return { buildProcessedValues: L(async () => {
|
|
610
675
|
await e.validateFields();
|
|
611
|
-
const a = e.getFieldsValue(),
|
|
676
|
+
const a = e.getFieldsValue(), o = {};
|
|
612
677
|
for (const c of Object.keys(a)) {
|
|
613
678
|
const y = t.get(c);
|
|
614
679
|
if (!y) continue;
|
|
615
680
|
let m;
|
|
616
681
|
switch (y.field?.type?.code) {
|
|
617
682
|
case "datetime":
|
|
618
|
-
m = a[c] ?
|
|
683
|
+
m = a[c] ? ae(a[c]).format(
|
|
619
684
|
y.additional_config?.datetime?.format
|
|
620
685
|
) : null;
|
|
621
686
|
break;
|
|
@@ -631,17 +696,17 @@ function Ft({
|
|
|
631
696
|
default:
|
|
632
697
|
m = a[c];
|
|
633
698
|
}
|
|
634
|
-
r.transformFieldValue && (m = r.transformFieldValue(c, m, y)),
|
|
699
|
+
r.transformFieldValue && (m = r.transformFieldValue(c, m, y)), o[c] = m;
|
|
635
700
|
}
|
|
636
|
-
let
|
|
637
|
-
return r.transformSubmitValues && (
|
|
638
|
-
|
|
701
|
+
let s = o;
|
|
702
|
+
return r.transformSubmitValues && (s = r.transformSubmitValues(
|
|
703
|
+
s,
|
|
639
704
|
Array.from(t.values()),
|
|
640
705
|
n
|
|
641
|
-
)), (r.parseRelatedDataTemplates ??
|
|
706
|
+
)), (r.parseRelatedDataTemplates ?? ht)(s, n ?? {});
|
|
642
707
|
}, [t, e, n, r]) };
|
|
643
708
|
}
|
|
644
|
-
const
|
|
709
|
+
const Rt = Je(
|
|
645
710
|
({
|
|
646
711
|
formConfig: e,
|
|
647
712
|
formInstance: t,
|
|
@@ -649,8 +714,8 @@ const kt = Ne(
|
|
|
649
714
|
uploadUrl: r,
|
|
650
715
|
uploadResourceUrl: i,
|
|
651
716
|
submitTrackingUrl: a,
|
|
652
|
-
onBeforeSubmit:
|
|
653
|
-
onSubmitSuccess:
|
|
717
|
+
onBeforeSubmit: o,
|
|
718
|
+
onSubmitSuccess: s,
|
|
654
719
|
onSubmitError: d,
|
|
655
720
|
isRedirectAfterCreate: c,
|
|
656
721
|
onRedirect: y,
|
|
@@ -658,179 +723,179 @@ const kt = Ne(
|
|
|
658
723
|
manualSubmit: l = !1,
|
|
659
724
|
onValuesChange: p,
|
|
660
725
|
readOnly: h = !1,
|
|
661
|
-
submitDebounceMs:
|
|
662
|
-
gutter:
|
|
663
|
-
defaultColSpan:
|
|
664
|
-
submitButtonLabel:
|
|
665
|
-
},
|
|
666
|
-
const { message: S } =
|
|
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({
|
|
667
732
|
formInstance: t,
|
|
668
|
-
fieldByCode:
|
|
733
|
+
fieldByCode: se,
|
|
669
734
|
relatedData: n,
|
|
670
|
-
transformers:
|
|
671
|
-
}),
|
|
672
|
-
|
|
673
|
-
if (Object.keys(
|
|
674
|
-
const F =
|
|
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;
|
|
675
740
|
t.setFieldsValue(F);
|
|
676
741
|
}
|
|
677
|
-
}, [
|
|
678
|
-
const
|
|
679
|
-
if (!
|
|
680
|
-
|
|
742
|
+
}, [T, t, Y, j]);
|
|
743
|
+
const ee = L(async () => {
|
|
744
|
+
if (!Z.current) {
|
|
745
|
+
Z.current = !0, he(!0);
|
|
681
746
|
try {
|
|
682
|
-
let F = await
|
|
747
|
+
let F = await X();
|
|
683
748
|
try {
|
|
684
|
-
a && (
|
|
749
|
+
a && (_e(!0), await k.request({
|
|
685
750
|
method: "POST",
|
|
686
751
|
url: a,
|
|
687
752
|
data: F
|
|
688
753
|
}));
|
|
689
|
-
const
|
|
690
|
-
if (
|
|
691
|
-
|
|
692
|
-
} catch (
|
|
693
|
-
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);
|
|
694
759
|
return;
|
|
695
760
|
} finally {
|
|
696
|
-
|
|
761
|
+
_e(!1);
|
|
697
762
|
}
|
|
698
|
-
const
|
|
763
|
+
const U = await k.request({
|
|
699
764
|
method: e.method,
|
|
700
765
|
url: e.action,
|
|
701
766
|
data: F
|
|
702
767
|
});
|
|
703
768
|
t.resetFields(
|
|
704
|
-
|
|
769
|
+
T.filter((D) => !D.is_hidden).map((D) => D.code)
|
|
705
770
|
);
|
|
706
|
-
const
|
|
707
|
-
c &&
|
|
771
|
+
const N = E.submitResponse(U.data);
|
|
772
|
+
c && N.redirectUrl && (y ?? M)(N.redirectUrl, "_blank"), s?.({
|
|
708
773
|
values: F,
|
|
709
|
-
response:
|
|
710
|
-
data:
|
|
774
|
+
response: U.data,
|
|
775
|
+
data: N.data ?? U.data
|
|
711
776
|
});
|
|
712
777
|
} catch (F) {
|
|
713
|
-
const
|
|
778
|
+
const U = F;
|
|
714
779
|
S.error(
|
|
715
|
-
|
|
780
|
+
U?.response?.data?.message ?? g.messages.submitError
|
|
716
781
|
), d?.(F);
|
|
717
782
|
} finally {
|
|
718
|
-
|
|
783
|
+
Z.current = !1, he(!1);
|
|
719
784
|
}
|
|
720
785
|
}
|
|
721
786
|
}, [
|
|
722
|
-
|
|
787
|
+
X,
|
|
723
788
|
k,
|
|
724
|
-
|
|
789
|
+
T,
|
|
725
790
|
e.action,
|
|
726
791
|
e.method,
|
|
727
792
|
t,
|
|
728
793
|
g.messages.submitError,
|
|
729
794
|
c,
|
|
730
795
|
S,
|
|
731
|
-
|
|
796
|
+
o,
|
|
732
797
|
y,
|
|
733
798
|
d,
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
799
|
+
s,
|
|
800
|
+
E,
|
|
801
|
+
M,
|
|
737
802
|
a
|
|
738
803
|
]);
|
|
739
|
-
|
|
740
|
-
|
|
804
|
+
Qe(
|
|
805
|
+
w,
|
|
741
806
|
() => ({
|
|
742
|
-
submit:
|
|
743
|
-
getProcessedValues:
|
|
744
|
-
isSubmitting: () =>
|
|
807
|
+
submit: ee,
|
|
808
|
+
getProcessedValues: X,
|
|
809
|
+
isSubmitting: () => Z.current
|
|
745
810
|
}),
|
|
746
|
-
[
|
|
811
|
+
[X, ee]
|
|
747
812
|
);
|
|
748
|
-
const be =
|
|
749
|
-
() =>
|
|
750
|
-
|
|
751
|
-
},
|
|
752
|
-
[
|
|
753
|
-
),
|
|
754
|
-
(F,
|
|
755
|
-
Object.keys(F).forEach((
|
|
756
|
-
const
|
|
757
|
-
|
|
758
|
-
|
|
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,
|
|
759
824
|
t.getFieldsValue()
|
|
760
825
|
);
|
|
761
|
-
|
|
762
|
-
}), p?.(F,
|
|
826
|
+
D.length > 0 && t.resetFields(D);
|
|
827
|
+
}), p?.(F, U);
|
|
763
828
|
},
|
|
764
|
-
[
|
|
765
|
-
),
|
|
766
|
-
(F) => /* @__PURE__ */
|
|
767
|
-
|
|
829
|
+
[T, t, p]
|
|
830
|
+
), ve = L(
|
|
831
|
+
(F) => /* @__PURE__ */ u(
|
|
832
|
+
At,
|
|
768
833
|
{
|
|
769
834
|
group: F,
|
|
770
835
|
formInstance: t,
|
|
771
|
-
fieldState:
|
|
772
|
-
setFieldState:
|
|
773
|
-
uploadUrl:
|
|
836
|
+
fieldState: q[F.code],
|
|
837
|
+
setFieldState: Q,
|
|
838
|
+
uploadUrl: H,
|
|
774
839
|
readOnly: h,
|
|
775
840
|
size: m
|
|
776
841
|
},
|
|
777
842
|
F.id
|
|
778
843
|
),
|
|
779
844
|
[
|
|
780
|
-
|
|
845
|
+
q,
|
|
781
846
|
t,
|
|
782
847
|
h,
|
|
783
|
-
|
|
784
|
-
|
|
848
|
+
H,
|
|
849
|
+
Q,
|
|
785
850
|
m
|
|
786
851
|
]
|
|
787
|
-
),
|
|
788
|
-
fieldGroups:
|
|
789
|
-
fieldStates:
|
|
790
|
-
renderField:
|
|
791
|
-
gutter:
|
|
792
|
-
defaultColSpan:
|
|
852
|
+
), Ue = W.layout ? W.layout({
|
|
853
|
+
fieldGroups: T,
|
|
854
|
+
fieldStates: q,
|
|
855
|
+
renderField: ve,
|
|
856
|
+
gutter: _,
|
|
857
|
+
defaultColSpan: v,
|
|
793
858
|
size: m
|
|
794
|
-
}) : /* @__PURE__ */
|
|
795
|
-
|
|
859
|
+
}) : /* @__PURE__ */ u(
|
|
860
|
+
St,
|
|
796
861
|
{
|
|
797
|
-
fieldGroups:
|
|
798
|
-
fieldStates:
|
|
799
|
-
renderField:
|
|
800
|
-
gutter:
|
|
801
|
-
defaultColSpan:
|
|
862
|
+
fieldGroups: T,
|
|
863
|
+
fieldStates: q,
|
|
864
|
+
renderField: ve,
|
|
865
|
+
gutter: _,
|
|
866
|
+
defaultColSpan: v,
|
|
802
867
|
size: m
|
|
803
868
|
}
|
|
804
|
-
),
|
|
869
|
+
), Ge = !l && !h && (W.submitActions ? W.submitActions({
|
|
805
870
|
onSubmit: be,
|
|
806
|
-
loading:
|
|
807
|
-
label:
|
|
808
|
-
}) : /* @__PURE__ */
|
|
809
|
-
|
|
871
|
+
loading: pe || ye,
|
|
872
|
+
label: R
|
|
873
|
+
}) : /* @__PURE__ */ u(de, { justify: "flex-end", children: /* @__PURE__ */ u(
|
|
874
|
+
Re,
|
|
810
875
|
{
|
|
811
876
|
type: "primary",
|
|
812
877
|
onClick: be,
|
|
813
|
-
loading:
|
|
814
|
-
children:
|
|
878
|
+
loading: pe || ye,
|
|
879
|
+
children: R
|
|
815
880
|
}
|
|
816
881
|
) }));
|
|
817
882
|
return /* @__PURE__ */ Be(
|
|
818
|
-
|
|
883
|
+
G,
|
|
819
884
|
{
|
|
820
885
|
layout: "vertical",
|
|
821
886
|
form: t,
|
|
822
887
|
size: m,
|
|
823
|
-
onValuesChange:
|
|
888
|
+
onValuesChange: qe,
|
|
824
889
|
children: [
|
|
825
|
-
|
|
826
|
-
|
|
890
|
+
Ue,
|
|
891
|
+
Ge
|
|
827
892
|
]
|
|
828
893
|
}
|
|
829
894
|
);
|
|
830
895
|
}
|
|
831
896
|
);
|
|
832
|
-
|
|
833
|
-
function
|
|
897
|
+
Rt.displayName = "DynamicForm";
|
|
898
|
+
function Te(e) {
|
|
834
899
|
if (!e) return;
|
|
835
900
|
const { mode: t } = e;
|
|
836
901
|
if (t === "api" && e.api?.url)
|
|
@@ -863,17 +928,17 @@ function De(e) {
|
|
|
863
928
|
};
|
|
864
929
|
}
|
|
865
930
|
}
|
|
866
|
-
function
|
|
931
|
+
function Ae(e) {
|
|
867
932
|
return {
|
|
868
933
|
value: e,
|
|
869
934
|
id: e
|
|
870
935
|
};
|
|
871
936
|
}
|
|
872
|
-
function
|
|
937
|
+
function Dt(e, t) {
|
|
873
938
|
const n = t.method || "GET", r = n.toUpperCase() === "GET";
|
|
874
939
|
if (t.url_template)
|
|
875
940
|
return (Array.isArray(e) ? e.filter((d) => d != null && d !== "") : e != null && e !== "" ? [e] : []).map((d) => {
|
|
876
|
-
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;
|
|
877
942
|
return {
|
|
878
943
|
method: n,
|
|
879
944
|
url: y,
|
|
@@ -881,58 +946,58 @@ function Et(e, t) {
|
|
|
881
946
|
data: r ? void 0 : l
|
|
882
947
|
};
|
|
883
948
|
});
|
|
884
|
-
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;
|
|
885
950
|
return [
|
|
886
951
|
{
|
|
887
952
|
method: n,
|
|
888
953
|
url: t.url,
|
|
889
954
|
params: r ? a : void 0,
|
|
890
|
-
data: r ? void 0 :
|
|
955
|
+
data: r ? void 0 : o
|
|
891
956
|
}
|
|
892
957
|
];
|
|
893
958
|
}
|
|
894
|
-
function
|
|
895
|
-
const n = t.data_path ?
|
|
959
|
+
function xe(e, t) {
|
|
960
|
+
const n = t.data_path ? z(e, t.data_path) : e;
|
|
896
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] : [];
|
|
897
962
|
}
|
|
898
|
-
function
|
|
963
|
+
function Le(e, t) {
|
|
899
964
|
return Mt(e, t.mapping_attr);
|
|
900
965
|
}
|
|
901
|
-
function
|
|
966
|
+
function Ce(e, t) {
|
|
902
967
|
return jt(t.link, e);
|
|
903
968
|
}
|
|
904
|
-
async function
|
|
905
|
-
const i =
|
|
969
|
+
async function Pt(e, t, n, r) {
|
|
970
|
+
const i = Dt(e, t);
|
|
906
971
|
if (!i.length) return [];
|
|
907
972
|
const a = await Promise.all(
|
|
908
|
-
i.map((
|
|
909
|
-
),
|
|
910
|
-
for (const
|
|
911
|
-
|
|
912
|
-
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;
|
|
913
978
|
}
|
|
914
|
-
function
|
|
979
|
+
function $(e) {
|
|
915
980
|
return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
916
981
|
}
|
|
917
|
-
function
|
|
982
|
+
function Tt(e, t) {
|
|
918
983
|
const n = e.option_config?.api_options?.params, r = e.option_config?.api_options?.data;
|
|
919
984
|
if (!n && !r) return;
|
|
920
985
|
const i = (a) => {
|
|
921
|
-
const
|
|
922
|
-
for (const
|
|
923
|
-
if (typeof a[
|
|
924
|
-
const d = a[
|
|
925
|
-
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];
|
|
926
991
|
} else
|
|
927
|
-
s
|
|
928
|
-
return
|
|
992
|
+
o[s] = a[s];
|
|
993
|
+
return o;
|
|
929
994
|
};
|
|
930
995
|
return {
|
|
931
996
|
params: n ? i(n) : void 0,
|
|
932
997
|
data: r ? i(r) : void 0
|
|
933
998
|
};
|
|
934
999
|
}
|
|
935
|
-
function
|
|
1000
|
+
function xt(e, t) {
|
|
936
1001
|
const n = t.option_config?.label_attr, r = t.option_config?.value_attr || "";
|
|
937
1002
|
if (n?.length) {
|
|
938
1003
|
const i = n.join(" - ");
|
|
@@ -940,33 +1005,33 @@ function Pt(e, t) {
|
|
|
940
1005
|
}
|
|
941
1006
|
return String(e[r] ?? "");
|
|
942
1007
|
}
|
|
943
|
-
function
|
|
1008
|
+
function Lt(e, t) {
|
|
944
1009
|
if (!t?.length) return null;
|
|
945
1010
|
const r = (Array.isArray(e) ? e : [e]).map((i) => t.find((a) => String(a.value) === String(i))?.label).filter((i) => !!i);
|
|
946
1011
|
return r.length ? r.join(", ") : null;
|
|
947
1012
|
}
|
|
948
|
-
function
|
|
949
|
-
if (
|
|
1013
|
+
function Ct(e, t, n) {
|
|
1014
|
+
if ($(e)) return null;
|
|
950
1015
|
const r = t.option_config?.value_attr || "value", i = Array.isArray(e) ? e : [e];
|
|
951
1016
|
if (t.is_option_api && n?.length) {
|
|
952
|
-
const
|
|
1017
|
+
const o = i.map((s) => {
|
|
953
1018
|
const d = n.find(
|
|
954
|
-
(c) => String(c[r]) === String(
|
|
1019
|
+
(c) => String(c[r]) === String(s)
|
|
955
1020
|
);
|
|
956
|
-
return d ?
|
|
1021
|
+
return d ? xt(d, t) : String(s);
|
|
957
1022
|
}).filter(Boolean);
|
|
958
|
-
return
|
|
1023
|
+
return o.length ? o.join(", ") : null;
|
|
959
1024
|
}
|
|
960
|
-
const a =
|
|
1025
|
+
const a = Lt(e, t.metas);
|
|
961
1026
|
return a || i.map(String).join(", ");
|
|
962
1027
|
}
|
|
963
|
-
function
|
|
964
|
-
if (
|
|
965
|
-
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);
|
|
966
1031
|
return r.isValid() ? n ? r.format(n) : r.format("YYYY-MM-DD HH:mm:ss") : String(e);
|
|
967
1032
|
}
|
|
968
|
-
function
|
|
969
|
-
if (
|
|
1033
|
+
function Ot(e) {
|
|
1034
|
+
if ($(e)) return null;
|
|
970
1035
|
if (Array.isArray(e)) {
|
|
971
1036
|
const t = e.map(
|
|
972
1037
|
(n) => typeof n == "object" && n && "name" in n ? String(n.name) : String(n)
|
|
@@ -977,18 +1042,18 @@ function Ct(e) {
|
|
|
977
1042
|
}
|
|
978
1043
|
function Mt(e, t) {
|
|
979
1044
|
return t?.length ? t.map((n) => {
|
|
980
|
-
const r =
|
|
1045
|
+
const r = z(e, n) ?? e[n];
|
|
981
1046
|
return r != null ? String(r) : "";
|
|
982
1047
|
}).filter(Boolean).join(" - ") : JSON.stringify(e);
|
|
983
1048
|
}
|
|
984
1049
|
function jt(e, t) {
|
|
985
1050
|
return e ? e.replace(/\{\{(.+?)\}\}/g, (n, r) => {
|
|
986
|
-
const i = r.trim(), a =
|
|
1051
|
+
const i = r.trim(), a = z(t, i) ?? t[i];
|
|
987
1052
|
return a != null ? String(a) : "";
|
|
988
1053
|
}) : null;
|
|
989
1054
|
}
|
|
990
|
-
function
|
|
991
|
-
if (
|
|
1055
|
+
function Se(e, t, n) {
|
|
1056
|
+
if ($(e)) return null;
|
|
992
1057
|
switch (t?.mode ?? "formatted") {
|
|
993
1058
|
case "raw":
|
|
994
1059
|
case "formatted":
|
|
@@ -996,12 +1061,12 @@ function Ae(e, t, n) {
|
|
|
996
1061
|
case "api":
|
|
997
1062
|
case "api_ids":
|
|
998
1063
|
case "api_detail": {
|
|
999
|
-
const i =
|
|
1064
|
+
const i = Te(t);
|
|
1000
1065
|
if (!n || !i)
|
|
1001
1066
|
return Array.isArray(e) ? e.map(String).join(", ") : String(e);
|
|
1002
|
-
const a =
|
|
1003
|
-
return a.length ? a.map((
|
|
1004
|
-
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);
|
|
1005
1070
|
return c ? `${d} (${c})` : d;
|
|
1006
1071
|
}).filter(Boolean).join(", ") || null : String(e);
|
|
1007
1072
|
}
|
|
@@ -1009,10 +1074,10 @@ function Ae(e, t, n) {
|
|
|
1009
1074
|
return String(e);
|
|
1010
1075
|
}
|
|
1011
1076
|
}
|
|
1012
|
-
function
|
|
1077
|
+
function qt(e, t, n) {
|
|
1013
1078
|
const r = e.additional_config?.view_value;
|
|
1014
1079
|
if (r?.mode === "api" || r?.mode === "api_ids" || r?.mode === "api_detail")
|
|
1015
|
-
return
|
|
1080
|
+
return Se(
|
|
1016
1081
|
t,
|
|
1017
1082
|
r,
|
|
1018
1083
|
n.viewValueFetched
|
|
@@ -1020,274 +1085,274 @@ function Ot(e, t, n) {
|
|
|
1020
1085
|
switch (e.field?.type?.code) {
|
|
1021
1086
|
case "text":
|
|
1022
1087
|
case "number":
|
|
1023
|
-
return
|
|
1088
|
+
return $(t) ? null : String(t);
|
|
1024
1089
|
case "datetime":
|
|
1025
|
-
return
|
|
1090
|
+
return Vt(t, e);
|
|
1026
1091
|
case "select":
|
|
1027
1092
|
case "radio":
|
|
1028
1093
|
case "checkbox":
|
|
1029
|
-
return
|
|
1094
|
+
return Ct(t, e, n.optionList);
|
|
1030
1095
|
case "image":
|
|
1031
1096
|
case "file":
|
|
1032
|
-
return
|
|
1097
|
+
return Ot(t);
|
|
1033
1098
|
default:
|
|
1034
|
-
return r ?
|
|
1099
|
+
return r ? Se(
|
|
1035
1100
|
t,
|
|
1036
1101
|
r,
|
|
1037
1102
|
n.viewValueFetched
|
|
1038
|
-
) :
|
|
1103
|
+
) : $(t) ? null : String(t);
|
|
1039
1104
|
}
|
|
1040
1105
|
}
|
|
1041
|
-
const
|
|
1042
|
-
function
|
|
1043
|
-
const t =
|
|
1106
|
+
const ie = /* @__PURE__ */ new Map(), Ut = 3e4;
|
|
1107
|
+
function Gt(e) {
|
|
1108
|
+
const t = ie.get(e);
|
|
1044
1109
|
if (t) {
|
|
1045
1110
|
if (Date.now() > t.expiresAt) {
|
|
1046
|
-
|
|
1111
|
+
ie.delete(e);
|
|
1047
1112
|
return;
|
|
1048
1113
|
}
|
|
1049
1114
|
return t.error;
|
|
1050
1115
|
}
|
|
1051
1116
|
}
|
|
1052
|
-
function
|
|
1053
|
-
|
|
1117
|
+
function Fe(e, t) {
|
|
1118
|
+
ie.set(e, {
|
|
1054
1119
|
error: t,
|
|
1055
|
-
expiresAt: Date.now() +
|
|
1120
|
+
expiresAt: Date.now() + Ut
|
|
1056
1121
|
});
|
|
1057
1122
|
}
|
|
1058
|
-
function
|
|
1059
|
-
const r =
|
|
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);
|
|
1060
1125
|
y.current = t, m.current = r;
|
|
1061
|
-
const l =
|
|
1062
|
-
return
|
|
1126
|
+
const l = te(e);
|
|
1127
|
+
return B(() => {
|
|
1063
1128
|
if (!n) {
|
|
1064
|
-
a(void 0), c(void 0),
|
|
1129
|
+
a(void 0), c(void 0), s(!1);
|
|
1065
1130
|
return;
|
|
1066
1131
|
}
|
|
1067
|
-
const h =
|
|
1132
|
+
const h = Gt(l);
|
|
1068
1133
|
if (h !== void 0) {
|
|
1069
|
-
c(h),
|
|
1134
|
+
c(h), s(!1);
|
|
1070
1135
|
return;
|
|
1071
1136
|
}
|
|
1072
|
-
const
|
|
1073
|
-
return
|
|
1137
|
+
const f = new AbortController();
|
|
1138
|
+
return s(!0), c(void 0), (async () => {
|
|
1074
1139
|
try {
|
|
1075
|
-
const
|
|
1140
|
+
const v = await ne(
|
|
1076
1141
|
m.current,
|
|
1077
1142
|
"viewCache",
|
|
1078
1143
|
l,
|
|
1079
|
-
(
|
|
1080
|
-
|
|
1144
|
+
(b) => y.current(b),
|
|
1145
|
+
f.signal
|
|
1081
1146
|
);
|
|
1082
|
-
|
|
1083
|
-
} catch (
|
|
1084
|
-
|
|
1147
|
+
f.signal.aborted || (a(v), c(void 0));
|
|
1148
|
+
} catch (v) {
|
|
1149
|
+
f.signal.aborted || (Fe(l, v), c(v));
|
|
1085
1150
|
} finally {
|
|
1086
|
-
|
|
1151
|
+
f.signal.aborted || s(!1);
|
|
1087
1152
|
}
|
|
1088
|
-
})(), () =>
|
|
1089
|
-
}, [n, l]), { data: i, isLoading:
|
|
1090
|
-
if (
|
|
1153
|
+
})(), () => f.abort();
|
|
1154
|
+
}, [n, l]), { data: i, isLoading: o, error: d, refetch: async () => {
|
|
1155
|
+
if (ie.delete(l), !n) return;
|
|
1091
1156
|
const h = new AbortController();
|
|
1092
|
-
|
|
1157
|
+
s(!0), c(void 0);
|
|
1093
1158
|
try {
|
|
1094
|
-
const
|
|
1159
|
+
const f = await ne(
|
|
1095
1160
|
m.current,
|
|
1096
1161
|
"viewCache",
|
|
1097
1162
|
l,
|
|
1098
|
-
(
|
|
1163
|
+
(_) => y.current(_),
|
|
1099
1164
|
h.signal
|
|
1100
1165
|
);
|
|
1101
|
-
return a(
|
|
1102
|
-
} catch (
|
|
1103
|
-
throw
|
|
1166
|
+
return a(f), f;
|
|
1167
|
+
} catch (f) {
|
|
1168
|
+
throw Fe(l, f), c(f), f;
|
|
1104
1169
|
} finally {
|
|
1105
|
-
|
|
1170
|
+
s(!1);
|
|
1106
1171
|
}
|
|
1107
1172
|
} };
|
|
1108
1173
|
}
|
|
1109
|
-
const
|
|
1110
|
-
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(
|
|
1111
1176
|
() => (Array.isArray(e) ? e : [e]).filter(Boolean),
|
|
1112
1177
|
[e]
|
|
1113
1178
|
), {
|
|
1114
|
-
data:
|
|
1179
|
+
data: s,
|
|
1115
1180
|
isLoading: d,
|
|
1116
1181
|
error: c
|
|
1117
|
-
} =
|
|
1118
|
-
["api_detail", t,
|
|
1182
|
+
} = oe(
|
|
1183
|
+
["api_detail", t, o, n?.url, n?.method],
|
|
1119
1184
|
async (l) => (await Promise.all(
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1185
|
+
o.map(async (h) => {
|
|
1186
|
+
const f = re(n?.url || "", { id: h });
|
|
1122
1187
|
return (await r.request({
|
|
1123
1188
|
method: n?.method,
|
|
1124
|
-
url:
|
|
1189
|
+
url: f,
|
|
1125
1190
|
signal: l
|
|
1126
1191
|
})).data;
|
|
1127
1192
|
})
|
|
1128
1193
|
)).filter(Boolean),
|
|
1129
|
-
!!(
|
|
1130
|
-
), y = (l, p, h) => i.link ? i.link({ url: l, label: p, data: h }) : /* @__PURE__ */
|
|
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) => {
|
|
1131
1196
|
const p = n?.mapping_attr?.map((h) => l?.[h]).join(" - ");
|
|
1132
1197
|
if (n?.link) {
|
|
1133
|
-
const h =
|
|
1198
|
+
const h = re(n.link, l);
|
|
1134
1199
|
return y(h, p, l);
|
|
1135
1200
|
}
|
|
1136
1201
|
return p;
|
|
1137
1202
|
};
|
|
1138
|
-
return d ? /* @__PURE__ */
|
|
1139
|
-
},
|
|
1140
|
-
const { client: r, renderers: i, i18n: a } =
|
|
1141
|
-
data:
|
|
1142
|
-
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,
|
|
1143
1208
|
error: d
|
|
1144
|
-
} =
|
|
1209
|
+
} = oe(
|
|
1145
1210
|
["api_ids", t, e, n?.url, n?.method],
|
|
1146
1211
|
async (m) => {
|
|
1147
|
-
const l = n?.method || "GET", p = l.toUpperCase() === "POST", h = Array.isArray(e) ? e : [e],
|
|
1212
|
+
const l = n?.method || "GET", p = l.toUpperCase() === "POST", h = Array.isArray(e) ? e : [e], _ = (await r.request({
|
|
1148
1213
|
method: l,
|
|
1149
1214
|
url: n?.url || "",
|
|
1150
1215
|
data: p ? { ids: h } : void 0,
|
|
1151
1216
|
params: p ? void 0 : { ids: h },
|
|
1152
1217
|
signal: m
|
|
1153
|
-
})).data,
|
|
1154
|
-
return Array.isArray(
|
|
1218
|
+
})).data, v = n?.data_path ? z(_, n.data_path) : _;
|
|
1219
|
+
return Array.isArray(v) ? v : _;
|
|
1155
1220
|
},
|
|
1156
1221
|
!!(e && n?.url)
|
|
1157
|
-
), 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) => {
|
|
1158
1223
|
const l = n?.mapping_attr?.map((p) => m?.[p]).join(" - ");
|
|
1159
1224
|
if (n?.link) {
|
|
1160
|
-
const p =
|
|
1225
|
+
const p = re(n.link, m);
|
|
1161
1226
|
return c(p, l, m);
|
|
1162
1227
|
}
|
|
1163
1228
|
return l;
|
|
1164
1229
|
};
|
|
1165
|
-
return
|
|
1166
|
-
Array.isArray(
|
|
1167
|
-
) : /* @__PURE__ */
|
|
1168
|
-
},
|
|
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 = ({
|
|
1169
1234
|
value: e,
|
|
1170
1235
|
code: t,
|
|
1171
1236
|
modeConfig: n,
|
|
1172
1237
|
viewConfig: r
|
|
1173
1238
|
}) => {
|
|
1174
|
-
const { client: i, renderers: a, i18n:
|
|
1175
|
-
() => n ?? (r ?
|
|
1239
|
+
const { client: i, renderers: a, i18n: o } = O(), s = P(
|
|
1240
|
+
() => n ?? (r ? Te(r) : void 0),
|
|
1176
1241
|
[n, r]
|
|
1177
|
-
), d =
|
|
1178
|
-
() => ["api_view", t, e,
|
|
1179
|
-
[t, e,
|
|
1180
|
-
), c =
|
|
1181
|
-
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(
|
|
1182
1247
|
e,
|
|
1183
|
-
|
|
1184
|
-
(
|
|
1248
|
+
s,
|
|
1249
|
+
(_) => i.request({ ..._, signal: f })
|
|
1185
1250
|
) : [],
|
|
1186
|
-
[i,
|
|
1187
|
-
), { data: y, isLoading: m, error: l } =
|
|
1188
|
-
if (!
|
|
1189
|
-
const
|
|
1190
|
-
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 ?? _);
|
|
1191
1256
|
};
|
|
1192
|
-
return m ? /* @__PURE__ */
|
|
1193
|
-
}, Me =
|
|
1194
|
-
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) {
|
|
1195
1260
|
return !!(e.option_config && e.is_option_api);
|
|
1196
1261
|
}
|
|
1197
|
-
function
|
|
1198
|
-
const n =
|
|
1262
|
+
function $t(e, t) {
|
|
1263
|
+
const n = O(), r = te([
|
|
1199
1264
|
"viewModeOptions",
|
|
1200
1265
|
e.map((a) => a.code),
|
|
1201
1266
|
t
|
|
1202
|
-
]), { data: i } =
|
|
1267
|
+
]), { data: i } = oe(
|
|
1203
1268
|
[r],
|
|
1204
1269
|
async (a) => {
|
|
1205
|
-
const
|
|
1270
|
+
const o = {};
|
|
1206
1271
|
return await Promise.all(
|
|
1207
|
-
e.map(async (
|
|
1208
|
-
if (!
|
|
1209
|
-
const d =
|
|
1210
|
-
method:
|
|
1211
|
-
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,
|
|
1212
1277
|
params: c ? d?.params : void 0,
|
|
1213
1278
|
data: c ? void 0 : d?.data,
|
|
1214
1279
|
signal: a
|
|
1215
1280
|
});
|
|
1216
|
-
s
|
|
1217
|
-
optionList: n.parsers.optionResponse(y.data,
|
|
1281
|
+
o[s.code] = {
|
|
1282
|
+
optionList: n.parsers.optionResponse(y.data, s)
|
|
1218
1283
|
};
|
|
1219
1284
|
})
|
|
1220
|
-
),
|
|
1285
|
+
), o;
|
|
1221
1286
|
},
|
|
1222
1287
|
e.length > 0
|
|
1223
1288
|
);
|
|
1224
1289
|
return i ?? {};
|
|
1225
1290
|
}
|
|
1226
|
-
const
|
|
1291
|
+
const an = ({
|
|
1227
1292
|
formConfig: e,
|
|
1228
1293
|
formValues: t
|
|
1229
1294
|
}) => {
|
|
1230
|
-
const n = e?.form?.field_groups ?? [], r =
|
|
1231
|
-
() => n.filter(
|
|
1295
|
+
const n = e?.form?.field_groups ?? [], r = P(
|
|
1296
|
+
() => n.filter(Kt),
|
|
1232
1297
|
[n]
|
|
1233
|
-
), i =
|
|
1234
|
-
return
|
|
1235
|
-
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;
|
|
1236
1301
|
if (c === "api" && d)
|
|
1237
1302
|
return {
|
|
1238
|
-
key:
|
|
1239
|
-
label:
|
|
1240
|
-
rawValue:
|
|
1241
|
-
viewValue: /* @__PURE__ */
|
|
1303
|
+
key: o.code,
|
|
1304
|
+
label: o.label,
|
|
1305
|
+
rawValue: s,
|
|
1306
|
+
viewValue: /* @__PURE__ */ u(
|
|
1242
1307
|
Me,
|
|
1243
1308
|
{
|
|
1244
|
-
code:
|
|
1245
|
-
value:
|
|
1309
|
+
code: o.code,
|
|
1310
|
+
value: s,
|
|
1246
1311
|
viewConfig: d
|
|
1247
1312
|
}
|
|
1248
1313
|
),
|
|
1249
|
-
field_group:
|
|
1314
|
+
field_group: o
|
|
1250
1315
|
};
|
|
1251
1316
|
if (c === "api_ids" && d?.api_ids)
|
|
1252
1317
|
return {
|
|
1253
|
-
key:
|
|
1254
|
-
label:
|
|
1255
|
-
rawValue:
|
|
1256
|
-
viewValue: /* @__PURE__ */
|
|
1257
|
-
|
|
1318
|
+
key: o.code,
|
|
1319
|
+
label: o.label,
|
|
1320
|
+
rawValue: s,
|
|
1321
|
+
viewValue: /* @__PURE__ */ u(
|
|
1322
|
+
Oe,
|
|
1258
1323
|
{
|
|
1259
|
-
code:
|
|
1260
|
-
value:
|
|
1324
|
+
code: o.code,
|
|
1325
|
+
value: s,
|
|
1261
1326
|
modeConfig: d.api_ids
|
|
1262
1327
|
}
|
|
1263
1328
|
),
|
|
1264
|
-
field_group:
|
|
1329
|
+
field_group: o
|
|
1265
1330
|
};
|
|
1266
1331
|
if (c === "api_detail" && d?.api_detail)
|
|
1267
1332
|
return {
|
|
1268
|
-
key:
|
|
1269
|
-
label:
|
|
1270
|
-
rawValue:
|
|
1271
|
-
viewValue: /* @__PURE__ */
|
|
1272
|
-
|
|
1333
|
+
key: o.code,
|
|
1334
|
+
label: o.label,
|
|
1335
|
+
rawValue: s,
|
|
1336
|
+
viewValue: /* @__PURE__ */ u(
|
|
1337
|
+
Ve,
|
|
1273
1338
|
{
|
|
1274
|
-
code:
|
|
1275
|
-
value:
|
|
1339
|
+
code: o.code,
|
|
1340
|
+
value: s,
|
|
1276
1341
|
modeConfig: d.api_detail
|
|
1277
1342
|
}
|
|
1278
1343
|
),
|
|
1279
|
-
field_group:
|
|
1344
|
+
field_group: o
|
|
1280
1345
|
};
|
|
1281
|
-
const y = i[
|
|
1346
|
+
const y = i[o.code] ?? {};
|
|
1282
1347
|
return {
|
|
1283
|
-
key:
|
|
1284
|
-
label:
|
|
1285
|
-
rawValue:
|
|
1286
|
-
viewValue:
|
|
1287
|
-
field_group:
|
|
1348
|
+
key: o.code,
|
|
1349
|
+
label: o.label,
|
|
1350
|
+
rawValue: s,
|
|
1351
|
+
viewValue: qt(o, s, y),
|
|
1352
|
+
field_group: o
|
|
1288
1353
|
};
|
|
1289
1354
|
}), [i, n, t]);
|
|
1290
|
-
},
|
|
1355
|
+
}, zt = ({
|
|
1291
1356
|
code: e,
|
|
1292
1357
|
value: t,
|
|
1293
1358
|
fieldGroup: n
|
|
@@ -1297,19 +1362,19 @@ const nn = ({
|
|
|
1297
1362
|
case "raw":
|
|
1298
1363
|
return t;
|
|
1299
1364
|
case "api":
|
|
1300
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ u(Me, { code: e, value: t, viewConfig: r });
|
|
1301
1366
|
case "api_ids": {
|
|
1302
1367
|
const i = r?.api_ids;
|
|
1303
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ u(Oe, { code: e, value: t, modeConfig: i });
|
|
1304
1369
|
}
|
|
1305
1370
|
case "api_detail": {
|
|
1306
1371
|
const i = r?.api_detail;
|
|
1307
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ u(Ve, { code: e, value: t, modeConfig: i });
|
|
1308
1373
|
}
|
|
1309
1374
|
default:
|
|
1310
1375
|
return t;
|
|
1311
1376
|
}
|
|
1312
|
-
},
|
|
1377
|
+
}, on = V(zt), je = {
|
|
1313
1378
|
submit: "Save",
|
|
1314
1379
|
submitError: "Failed to submit form",
|
|
1315
1380
|
inputPlaceholder: (e) => `Enter ${e}`,
|
|
@@ -1320,9 +1385,9 @@ const nn = ({
|
|
|
1320
1385
|
viewLoading: "Loading...",
|
|
1321
1386
|
viewEmpty: "-",
|
|
1322
1387
|
viewError: "Failed to load"
|
|
1323
|
-
},
|
|
1388
|
+
}, sn = {
|
|
1324
1389
|
messages: je
|
|
1325
|
-
},
|
|
1390
|
+
}, Ht = (e) => {
|
|
1326
1391
|
if (Array.isArray(e)) return e;
|
|
1327
1392
|
if (e && typeof e == "object" && "items" in e && Array.isArray(e.items))
|
|
1328
1393
|
return e.items;
|
|
@@ -1331,30 +1396,30 @@ const nn = ({
|
|
|
1331
1396
|
return Array.isArray(t.items) ? t.items : [];
|
|
1332
1397
|
}
|
|
1333
1398
|
return [];
|
|
1334
|
-
},
|
|
1399
|
+
}, Yt = (e) => ({
|
|
1335
1400
|
redirectUrl: e?.redirect_after_create,
|
|
1336
1401
|
data: e
|
|
1337
|
-
}),
|
|
1338
|
-
optionResponse:
|
|
1339
|
-
submitResponse:
|
|
1340
|
-
viewResponse:
|
|
1341
|
-
},
|
|
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") => {
|
|
1342
1407
|
window.open(e, t);
|
|
1343
|
-
},
|
|
1408
|
+
}, ce = {
|
|
1344
1409
|
upload: async () => {
|
|
1345
1410
|
throw new Error("Upload adapter is not configured");
|
|
1346
1411
|
},
|
|
1347
1412
|
remove: async () => !1
|
|
1348
1413
|
};
|
|
1349
|
-
function
|
|
1414
|
+
function ln({
|
|
1350
1415
|
children: e,
|
|
1351
1416
|
client: t,
|
|
1352
1417
|
upload: n,
|
|
1353
1418
|
i18n: r,
|
|
1354
1419
|
parsers: i,
|
|
1355
1420
|
renderers: a = {},
|
|
1356
|
-
transformers:
|
|
1357
|
-
cache:
|
|
1421
|
+
transformers: o = {},
|
|
1422
|
+
cache: s,
|
|
1358
1423
|
submitDebounceMs: d = 200,
|
|
1359
1424
|
redirectHandler: c,
|
|
1360
1425
|
// legacy props
|
|
@@ -1363,48 +1428,48 @@ function on({
|
|
|
1363
1428
|
deleteUploadAdapter: l,
|
|
1364
1429
|
messages: p,
|
|
1365
1430
|
optionResponseParser: h,
|
|
1366
|
-
customFieldRenderers:
|
|
1431
|
+
customFieldRenderers: f
|
|
1367
1432
|
}) {
|
|
1368
|
-
const
|
|
1369
|
-
const
|
|
1433
|
+
const _ = K(/* @__PURE__ */ new Map()), v = K(/* @__PURE__ */ new Map()), b = P(() => {
|
|
1434
|
+
const w = t ?? {
|
|
1370
1435
|
request: y ?? (() => {
|
|
1371
1436
|
throw new Error("DynamicFormProvider requires client or requestClient");
|
|
1372
1437
|
})
|
|
1373
|
-
}, S =
|
|
1438
|
+
}, S = f ? Object.entries(f).map(([k, E]) => ({
|
|
1374
1439
|
match: k,
|
|
1375
|
-
render:
|
|
1440
|
+
render: E
|
|
1376
1441
|
})) : [], A = {
|
|
1377
1442
|
...je,
|
|
1378
1443
|
...r?.messages,
|
|
1379
1444
|
...p
|
|
1380
1445
|
}, g = {
|
|
1381
|
-
...
|
|
1446
|
+
...ce,
|
|
1382
1447
|
...n,
|
|
1383
|
-
upload: n?.upload ?? m ??
|
|
1384
|
-
remove: n?.remove ?? (l ? (k) => l(k.path) :
|
|
1448
|
+
upload: n?.upload ?? m ?? ce.upload,
|
|
1449
|
+
remove: n?.remove ?? (l ? (k) => l(k.path) : ce.remove)
|
|
1385
1450
|
};
|
|
1386
1451
|
return {
|
|
1387
|
-
client:
|
|
1452
|
+
client: w,
|
|
1388
1453
|
upload: g,
|
|
1389
1454
|
i18n: { messages: A },
|
|
1390
1455
|
parsers: {
|
|
1391
|
-
optionResponse: i?.optionResponse ?? h ??
|
|
1392
|
-
submitResponse: i?.submitResponse ??
|
|
1393
|
-
viewResponse: i?.viewResponse ??
|
|
1456
|
+
optionResponse: i?.optionResponse ?? h ?? le.optionResponse,
|
|
1457
|
+
submitResponse: i?.submitResponse ?? le.submitResponse,
|
|
1458
|
+
viewResponse: i?.viewResponse ?? le.viewResponse
|
|
1394
1459
|
},
|
|
1395
1460
|
renderers: {
|
|
1396
1461
|
...a,
|
|
1397
1462
|
fields: [...a.fields ?? [], ...S]
|
|
1398
1463
|
},
|
|
1399
|
-
transformers:
|
|
1464
|
+
transformers: o,
|
|
1400
1465
|
cache: {
|
|
1401
|
-
enabled:
|
|
1402
|
-
ttlMs:
|
|
1466
|
+
enabled: s?.enabled ?? !0,
|
|
1467
|
+
ttlMs: s?.ttlMs ?? 6e4
|
|
1403
1468
|
},
|
|
1404
1469
|
submitDebounceMs: d,
|
|
1405
|
-
redirectHandler: c ??
|
|
1406
|
-
optionCache:
|
|
1407
|
-
viewCache:
|
|
1470
|
+
redirectHandler: c ?? Jt,
|
|
1471
|
+
optionCache: _.current,
|
|
1472
|
+
viewCache: v.current
|
|
1408
1473
|
};
|
|
1409
1474
|
}, [
|
|
1410
1475
|
t,
|
|
@@ -1419,16 +1484,16 @@ function on({
|
|
|
1419
1484
|
i?.viewResponse,
|
|
1420
1485
|
h,
|
|
1421
1486
|
a,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1487
|
+
f,
|
|
1488
|
+
o,
|
|
1489
|
+
s?.enabled,
|
|
1490
|
+
s?.ttlMs,
|
|
1426
1491
|
d,
|
|
1427
1492
|
c
|
|
1428
1493
|
]);
|
|
1429
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ u(fe.Provider, { value: b, children: e });
|
|
1430
1495
|
}
|
|
1431
|
-
function
|
|
1496
|
+
function cn(e) {
|
|
1432
1497
|
return {
|
|
1433
1498
|
request: async (t) => ({ data: (await e({
|
|
1434
1499
|
method: t.method,
|
|
@@ -1442,55 +1507,55 @@ function sn(e) {
|
|
|
1442
1507
|
};
|
|
1443
1508
|
}
|
|
1444
1509
|
export {
|
|
1445
|
-
|
|
1446
|
-
|
|
1510
|
+
Ve as ApiDetailItem,
|
|
1511
|
+
Oe as ApiItem,
|
|
1447
1512
|
Me as ApiViewItem,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
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,
|
|
1459
1524
|
je as defaultMessages,
|
|
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
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
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
|
|
1496
1561
|
};
|