dynamicformdjx-react 0.2.0 → 0.2.1
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/README.md +49 -6
- package/dist/antd/hooks/renderForm.d.ts +7 -2
- package/dist/antd/index.cjs +1 -1
- package/dist/antd/index.mjs +284 -257
- package/dist/constants/index.d.ts +2 -1
- package/dist/index-B4EyP31q.cjs +1 -0
- package/dist/index-px61OvsX.js +75 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +340 -388
- package/dist/types/form.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/antd/AntdIndex.d.ts +0 -2
- package/dist/components/antd/allForm.d.ts +0 -2
- package/dist/components/antd/customForm.d.ts +0 -2
- package/dist/components/antd/simpleForm.d.ts +0 -2
- package/dist/components/cascadeInput.d.ts +0 -2
- package/dist/components/singleInput.d.ts +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,236 +1,187 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
rId: m(u),
|
|
7
|
-
key: n,
|
|
8
|
-
value: f ? y.join(t) : y,
|
|
9
|
-
isArray: f || void 0,
|
|
10
|
-
isNumber: $ || void 0
|
|
11
|
-
};
|
|
12
|
-
}), G = (i, m) => i.reduce((t, n) => (n.key.trim() && (t[n.key] = Y(n.value, n.isArray, n.isNumber, m)), t), {}), Y = (i, m, t, n = ",") => {
|
|
13
|
-
let u;
|
|
14
|
-
return m ? t ? u = String(i).split(n).map(Number).filter((y) => !Number.isNaN(y)) : u = String(i).split(n) : t ? u = parseFloat(i) : u = i.toString(), u;
|
|
15
|
-
}, Z = (i, m, t = ",") => {
|
|
16
|
-
const n = (u) => {
|
|
17
|
-
u = u.replace(/[^\d.-]/g, "");
|
|
18
|
-
let y = !1;
|
|
19
|
-
u.startsWith("-") && (y = !0), u = u.replace(/-/g, "");
|
|
20
|
-
const f = u.indexOf(".");
|
|
21
|
-
return f !== -1 && (u = u.slice(0, f + 1) + u.slice(f + 1).replace(/\./g, "")), (y ? "-" : "") + u;
|
|
22
|
-
};
|
|
23
|
-
return m ? i.split(t).map((u) => n(u)).join(t) : n(i);
|
|
24
|
-
}, ne = (i) => `hsl(${i * 35 % 360}, 60%, 65%)`, re = (i, m) => i[m - 1] ?? ne(m);
|
|
25
|
-
function L(i, m, t) {
|
|
26
|
-
if (m.length === 0)
|
|
27
|
-
return t(i, -1);
|
|
28
|
-
const [n, ...u] = m, y = [...i];
|
|
29
|
-
if (u.length === 0)
|
|
30
|
-
return t(y, n);
|
|
31
|
-
const f = y[n];
|
|
32
|
-
if (!Array.isArray(f.value)) return y;
|
|
33
|
-
const $ = L(
|
|
34
|
-
f.value,
|
|
35
|
-
u,
|
|
36
|
-
t
|
|
37
|
-
);
|
|
38
|
-
return $.length === 0 ? y[n] = {
|
|
39
|
-
...f,
|
|
40
|
-
value: "",
|
|
41
|
-
isArray: void 0,
|
|
42
|
-
isNumber: void 0
|
|
43
|
-
} : y[n] = { ...f, value: $ }, y;
|
|
44
|
-
}
|
|
45
|
-
function I(i) {
|
|
46
|
-
return i.filter(Boolean).join(" ");
|
|
47
|
-
}
|
|
48
|
-
function ae(i, m) {
|
|
49
|
-
const t = { ...i };
|
|
50
|
-
return delete t.value, m?.forEach((n) => {
|
|
51
|
-
n !== "value" && delete t[n];
|
|
52
|
-
}), t;
|
|
53
|
-
}
|
|
54
|
-
const oe = Q((i, m) => {
|
|
1
|
+
import { jsxs as b, jsx as i, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as U, useState as Q, useRef as W, useImperativeHandle as X, useEffect as E, useCallback as I, useMemo as ee } from "react";
|
|
3
|
+
import { t as _, r as J, c as g, f as Y, p as te, s as ne, u as j } from "./index-px61OvsX.js";
|
|
4
|
+
import { O as de, g as ye, a as be, o as he } from "./index-px61OvsX.js";
|
|
5
|
+
import './index.css';const ae = U((F, x) => {
|
|
55
6
|
const {
|
|
56
|
-
value:
|
|
57
|
-
size:
|
|
58
|
-
dyCls:
|
|
59
|
-
isController:
|
|
60
|
-
configs:
|
|
61
|
-
btnConfigs:
|
|
62
|
-
dyListConfigs:
|
|
63
|
-
randomFun:
|
|
7
|
+
value: c = {},
|
|
8
|
+
size: h,
|
|
9
|
+
dyCls: T,
|
|
10
|
+
isController: L,
|
|
11
|
+
configs: V,
|
|
12
|
+
btnConfigs: H,
|
|
13
|
+
dyListConfigs: D,
|
|
14
|
+
randomFun: v = (e) => `${Date.now()}_${e ?? 0}`,
|
|
64
15
|
onReset: K,
|
|
65
16
|
onMerge: P,
|
|
66
|
-
onChange:
|
|
67
|
-
} =
|
|
17
|
+
onChange: O
|
|
18
|
+
} = F, $ = {
|
|
68
19
|
resetTxt: "重置",
|
|
69
20
|
newTxt: "添加项",
|
|
70
21
|
mergeTxt: "合并",
|
|
71
|
-
|
|
72
|
-
},
|
|
22
|
+
...H
|
|
23
|
+
}, A = {
|
|
73
24
|
hideReset: !1,
|
|
74
25
|
maxHeight: "300px",
|
|
75
26
|
autoScroll: !0,
|
|
76
27
|
allowFilter: !0,
|
|
77
|
-
...f
|
|
78
|
-
}, p = {
|
|
79
|
-
arraySplitSymbol: ",",
|
|
80
28
|
...V
|
|
81
|
-
},
|
|
82
|
-
|
|
29
|
+
}, d = {
|
|
30
|
+
arraySplitSymbol: ",",
|
|
31
|
+
...D
|
|
32
|
+
}, [t, n] = Q(() => _(c, v, d.arraySplitSymbol)), l = W(null);
|
|
33
|
+
return X(x, () => ({
|
|
83
34
|
getResult(e) {
|
|
84
|
-
return e === "ori" ?
|
|
35
|
+
return e === "ori" ? t : J(t, d.arraySplitSymbol);
|
|
85
36
|
},
|
|
86
37
|
onSet(e) {
|
|
87
|
-
|
|
38
|
+
n(_(e ?? c, v, d.arraySplitSymbol));
|
|
88
39
|
}
|
|
89
|
-
})),
|
|
90
|
-
|
|
91
|
-
}, [
|
|
92
|
-
/* @__PURE__ */
|
|
40
|
+
})), E(() => {
|
|
41
|
+
L && O(J(t, d.arraySplitSymbol));
|
|
42
|
+
}, [t]), /* @__PURE__ */ b("div", { className: `dynamicInput ${h} ${T}`, children: [
|
|
43
|
+
/* @__PURE__ */ i(
|
|
93
44
|
"div",
|
|
94
45
|
{
|
|
95
|
-
className: `dyFormList ${
|
|
96
|
-
ref:
|
|
97
|
-
style: { maxHeight:
|
|
98
|
-
children:
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
return
|
|
46
|
+
className: `dyFormList ${t.length ? "" : "noList"}`,
|
|
47
|
+
ref: l,
|
|
48
|
+
style: { maxHeight: A.maxHeight },
|
|
49
|
+
children: t.map((e, r, N) => /* @__PURE__ */ b("div", { className: "dItem", children: [
|
|
50
|
+
/* @__PURE__ */ b("div", { className: "input", children: [
|
|
51
|
+
/* @__PURE__ */ i("input", { value: e.key, className: "key nativeInput", onInput: (m) => {
|
|
52
|
+
const s = m.target.value;
|
|
53
|
+
n((o) => {
|
|
54
|
+
const p = [...o], a = p[r];
|
|
55
|
+
return p[r] = { ...a, key: s }, p;
|
|
105
56
|
});
|
|
106
57
|
} }),
|
|
107
58
|
":",
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ b("div", { className: "vInput", children: [
|
|
60
|
+
/* @__PURE__ */ b("div", { className: "slot", children: [
|
|
61
|
+
/* @__PURE__ */ i(
|
|
111
62
|
"button",
|
|
112
63
|
{
|
|
113
|
-
className:
|
|
64
|
+
className: g([
|
|
114
65
|
e.isArray ? "success" : "default",
|
|
115
66
|
"small",
|
|
116
67
|
"bt"
|
|
117
68
|
]),
|
|
118
69
|
onClick: () => {
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
return
|
|
70
|
+
n((m) => {
|
|
71
|
+
const s = [...m], o = s[r];
|
|
72
|
+
return s[r] = { ...o, isArray: !o.isArray }, s;
|
|
122
73
|
});
|
|
123
74
|
},
|
|
124
75
|
children: "Array"
|
|
125
76
|
}
|
|
126
77
|
),
|
|
127
78
|
" ",
|
|
128
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ i(
|
|
129
80
|
"button",
|
|
130
81
|
{
|
|
131
|
-
className:
|
|
82
|
+
className: g([
|
|
132
83
|
e.isNumber ? "success" : "default",
|
|
133
84
|
"small",
|
|
134
85
|
"bt"
|
|
135
86
|
]),
|
|
136
87
|
onClick: () => {
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
return
|
|
88
|
+
n((m) => {
|
|
89
|
+
const s = [...m], o = s[r];
|
|
90
|
+
return s[r] = { ...o, isNumber: !o.isNumber }, s;
|
|
140
91
|
});
|
|
141
92
|
},
|
|
142
93
|
children: "Number"
|
|
143
94
|
}
|
|
144
95
|
)
|
|
145
96
|
] }),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
const
|
|
148
|
-
let
|
|
149
|
-
e.isNumber &&
|
|
150
|
-
|
|
97
|
+
/* @__PURE__ */ i("input", { value: e.value, className: "value nativeV", onInput: (m) => {
|
|
98
|
+
const s = m.target.value;
|
|
99
|
+
let o = s;
|
|
100
|
+
e.isNumber && A.allowFilter && (o = Y(
|
|
101
|
+
s,
|
|
151
102
|
e.isArray,
|
|
152
|
-
|
|
153
|
-
)),
|
|
154
|
-
const
|
|
155
|
-
return
|
|
103
|
+
d.arraySplitSymbol
|
|
104
|
+
)), n((p) => {
|
|
105
|
+
const a = [...p], M = a[r];
|
|
106
|
+
return a[r] = { ...M, value: o }, a;
|
|
156
107
|
});
|
|
157
108
|
} })
|
|
158
109
|
] })
|
|
159
110
|
] }),
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ b("div", { className: "btn", children: [
|
|
112
|
+
/* @__PURE__ */ i(
|
|
162
113
|
"button",
|
|
163
114
|
{
|
|
164
|
-
className:
|
|
165
|
-
disabled:
|
|
115
|
+
className: g([h, "success", "bt"]),
|
|
116
|
+
disabled: r !== N.length - 1,
|
|
166
117
|
onClick: () => {
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
118
|
+
n((m) => [...m, { rId: v(), key: "", value: "" }]), A.autoScroll && setTimeout(() => {
|
|
119
|
+
const m = l.current;
|
|
120
|
+
m?.scrollTo({ top: m?.scrollHeight + 20, behavior: "smooth" });
|
|
170
121
|
});
|
|
171
122
|
},
|
|
172
123
|
children: "+"
|
|
173
124
|
}
|
|
174
125
|
),
|
|
175
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ i("button", { className: g([
|
|
176
127
|
"danger",
|
|
177
|
-
|
|
128
|
+
h,
|
|
178
129
|
"bt"
|
|
179
130
|
]), onClick: () => {
|
|
180
|
-
|
|
131
|
+
n((m) => m.filter((s) => s.rId !== e.rId));
|
|
181
132
|
}, children: "-" })
|
|
182
133
|
] })
|
|
183
134
|
] }, e.rId))
|
|
184
135
|
}
|
|
185
136
|
),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
!
|
|
137
|
+
/* @__PURE__ */ b("div", { className: `control ${t.length ? "" : "noList"}`, children: [
|
|
138
|
+
!t.length && /* @__PURE__ */ i("button", { className: g([
|
|
188
139
|
"success",
|
|
189
|
-
|
|
140
|
+
h,
|
|
190
141
|
"bt"
|
|
191
142
|
]), onClick: () => {
|
|
192
|
-
|
|
193
|
-
}, children:
|
|
194
|
-
!
|
|
195
|
-
!
|
|
143
|
+
n((e) => [...e, { rId: v(), key: "", value: "" }]);
|
|
144
|
+
}, children: $.newTxt }),
|
|
145
|
+
!L && /* @__PURE__ */ b(z, { children: [
|
|
146
|
+
!A.hideReset && /* @__PURE__ */ i("button", { className: g([
|
|
196
147
|
"default",
|
|
197
|
-
|
|
148
|
+
h,
|
|
198
149
|
"bt"
|
|
199
150
|
]), onClick: () => {
|
|
200
|
-
|
|
201
|
-
}, children:
|
|
202
|
-
/* @__PURE__ */
|
|
151
|
+
n(_(c, v, d.arraySplitSymbol)), K?.();
|
|
152
|
+
}, children: $.resetTxt }),
|
|
153
|
+
/* @__PURE__ */ i("button", { className: g([
|
|
203
154
|
"info",
|
|
204
|
-
|
|
155
|
+
h,
|
|
205
156
|
"bt"
|
|
206
157
|
]), onClick: () => {
|
|
207
|
-
[...
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
}, children:
|
|
158
|
+
[...t].sort((N, m) => +N.rId - +m.rId);
|
|
159
|
+
const r = J(t, d.arraySplitSymbol);
|
|
160
|
+
O(r), P?.(r, t), n(_(r, v, d.arraySplitSymbol));
|
|
161
|
+
}, children: $.mergeTxt })
|
|
211
162
|
] })
|
|
212
163
|
] })
|
|
213
164
|
] });
|
|
214
|
-
}),
|
|
165
|
+
}), oe = U((F, x) => {
|
|
215
166
|
const {
|
|
216
|
-
depth:
|
|
217
|
-
value:
|
|
218
|
-
isController:
|
|
219
|
-
dyCls:
|
|
220
|
-
configs:
|
|
221
|
-
btnConfigs:
|
|
222
|
-
dyListConfigs:
|
|
223
|
-
randomFun:
|
|
224
|
-
newChildTxt: K = (
|
|
167
|
+
depth: c = 5,
|
|
168
|
+
value: h,
|
|
169
|
+
isController: T,
|
|
170
|
+
dyCls: L,
|
|
171
|
+
configs: V,
|
|
172
|
+
btnConfigs: H,
|
|
173
|
+
dyListConfigs: D,
|
|
174
|
+
randomFun: v = (s) => `${Date.now()}_${s ?? 0}`,
|
|
175
|
+
newChildTxt: K = (s) => `添加 '${s.key}' 子项`,
|
|
225
176
|
onReset: P,
|
|
226
|
-
onMerge:
|
|
227
|
-
onChange:
|
|
228
|
-
} =
|
|
177
|
+
onMerge: O,
|
|
178
|
+
onChange: $
|
|
179
|
+
} = F, A = {
|
|
229
180
|
resetTxt: "重置",
|
|
230
181
|
newTxt: "添加项",
|
|
231
182
|
mergeTxt: "合并",
|
|
232
|
-
|
|
233
|
-
},
|
|
183
|
+
...H
|
|
184
|
+
}, d = {
|
|
234
185
|
hideReset: !1,
|
|
235
186
|
maxHeight: "600px",
|
|
236
187
|
allowFilter: !0,
|
|
@@ -238,69 +189,69 @@ const oe = Q((i, m) => {
|
|
|
238
189
|
showPad: !0,
|
|
239
190
|
retractLen: 0,
|
|
240
191
|
borderColors: [],
|
|
241
|
-
...f
|
|
242
|
-
}, r = {
|
|
243
|
-
arraySplitSymbol: ",",
|
|
244
192
|
...V
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
193
|
+
}, t = {
|
|
194
|
+
arraySplitSymbol: ",",
|
|
195
|
+
...D
|
|
196
|
+
}, n = (s) => ["string", "number"].includes(s), [l, e] = Q(() => r(h));
|
|
197
|
+
X(x, () => ({
|
|
198
|
+
getResult(s) {
|
|
199
|
+
return s === "ori" ? l : N(l);
|
|
249
200
|
},
|
|
250
|
-
onSet(
|
|
251
|
-
e(
|
|
201
|
+
onSet(s) {
|
|
202
|
+
e(r(s ?? h));
|
|
252
203
|
}
|
|
253
204
|
}));
|
|
254
|
-
function
|
|
255
|
-
return Object.keys(
|
|
256
|
-
let
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
-
rId:
|
|
260
|
-
key:
|
|
261
|
-
value: Object.prototype.toString.call(
|
|
262
|
-
isArray:
|
|
263
|
-
isNumber:
|
|
205
|
+
function r(s) {
|
|
206
|
+
return Object.keys(s).map((o, p) => {
|
|
207
|
+
let a = s[o];
|
|
208
|
+
const M = Array.isArray(a), q = M ? a.every((B) => typeof B == "number") : typeof a == "number", C = a === null;
|
|
209
|
+
return n(typeof a) && (a = s[o]), C && (a = ""), {
|
|
210
|
+
rId: v(p),
|
|
211
|
+
key: o,
|
|
212
|
+
value: Object.prototype.toString.call(a) === "[object Object]" ? r(s[o]) : M ? a.join(t.arraySplitSymbol) : a,
|
|
213
|
+
isArray: M || void 0,
|
|
214
|
+
isNumber: q || void 0
|
|
264
215
|
};
|
|
265
216
|
});
|
|
266
217
|
}
|
|
267
|
-
const
|
|
268
|
-
const
|
|
269
|
-
return
|
|
270
|
-
}, {}),
|
|
218
|
+
const N = (s) => s.reduce((o, p) => {
|
|
219
|
+
const a = p.value;
|
|
220
|
+
return p.key.trim().length && (o[p.key] = Array.isArray(a) ? N(a) : te(p.value, p.isArray, p.isNumber, t.arraySplitSymbol)), o;
|
|
221
|
+
}, {}), m = (s, o = 1, p = []) => /* @__PURE__ */ i(
|
|
271
222
|
"div",
|
|
272
223
|
{
|
|
273
|
-
className:
|
|
274
|
-
`depth-${
|
|
275
|
-
|
|
276
|
-
|
|
224
|
+
className: g([
|
|
225
|
+
`depth-${o}`,
|
|
226
|
+
d.showBorder ? "" : "no-border",
|
|
227
|
+
d.showPad ? "" : "no-pad"
|
|
277
228
|
]),
|
|
278
229
|
style: {
|
|
279
230
|
//@ts-ignore
|
|
280
|
-
"--depth":
|
|
281
|
-
["--c" + [
|
|
231
|
+
"--depth": o,
|
|
232
|
+
["--c" + [o]]: ne(d.borderColors, o)
|
|
282
233
|
},
|
|
283
|
-
children:
|
|
284
|
-
const
|
|
285
|
-
return /* @__PURE__ */
|
|
234
|
+
children: s.map((a, M, q) => {
|
|
235
|
+
const C = [...p, M], B = Array.isArray(a.value), Z = n(typeof a.value);
|
|
236
|
+
return /* @__PURE__ */ b(
|
|
286
237
|
"div",
|
|
287
238
|
{
|
|
288
239
|
className: "dItem",
|
|
289
|
-
style: { marginLeft:
|
|
240
|
+
style: { marginLeft: o > 1 ? `${o * d.retractLen}px` : "0" },
|
|
290
241
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
!B && /* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ b("div", { className: "input", children: [
|
|
243
|
+
!B && /* @__PURE__ */ b(z, { children: [
|
|
244
|
+
/* @__PURE__ */ i(
|
|
294
245
|
"input",
|
|
295
246
|
{
|
|
296
|
-
value:
|
|
247
|
+
value: a.key,
|
|
297
248
|
className: "key nativeInput",
|
|
298
|
-
onInput: (
|
|
299
|
-
const
|
|
249
|
+
onInput: (S) => {
|
|
250
|
+
const k = S.target.value;
|
|
300
251
|
e(
|
|
301
|
-
(
|
|
302
|
-
const
|
|
303
|
-
return
|
|
252
|
+
(y) => j(y, C, (u, f) => {
|
|
253
|
+
const R = [...u], w = R[f];
|
|
254
|
+
return R[f] = { ...w, key: k }, R;
|
|
304
255
|
})
|
|
305
256
|
);
|
|
306
257
|
}
|
|
@@ -308,24 +259,24 @@ const oe = Q((i, m) => {
|
|
|
308
259
|
),
|
|
309
260
|
":"
|
|
310
261
|
] }),
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ b("div", { className: "vInput", children: [
|
|
263
|
+
/* @__PURE__ */ i("div", { className: "slot", children: Array.isArray(a.value) ? void 0 : /* @__PURE__ */ b(z, { children: [
|
|
264
|
+
/* @__PURE__ */ i(
|
|
314
265
|
"button",
|
|
315
266
|
{
|
|
316
|
-
className:
|
|
317
|
-
|
|
267
|
+
className: g([
|
|
268
|
+
a.isArray ? "success" : "default",
|
|
318
269
|
"small",
|
|
319
270
|
"bt"
|
|
320
271
|
]),
|
|
321
272
|
onClick: () => {
|
|
322
273
|
e(
|
|
323
|
-
(
|
|
324
|
-
const
|
|
325
|
-
return
|
|
326
|
-
...
|
|
327
|
-
isArray: !
|
|
328
|
-
},
|
|
274
|
+
(S) => j(S, C, (k, y) => {
|
|
275
|
+
const u = [...k], f = u[y];
|
|
276
|
+
return u[y] = {
|
|
277
|
+
...f,
|
|
278
|
+
isArray: !f.isArray
|
|
279
|
+
}, u;
|
|
329
280
|
})
|
|
330
281
|
);
|
|
331
282
|
},
|
|
@@ -333,22 +284,22 @@ const oe = Q((i, m) => {
|
|
|
333
284
|
}
|
|
334
285
|
),
|
|
335
286
|
" ",
|
|
336
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ i(
|
|
337
288
|
"button",
|
|
338
289
|
{
|
|
339
|
-
className:
|
|
340
|
-
|
|
290
|
+
className: g([
|
|
291
|
+
a.isNumber ? "success" : "default",
|
|
341
292
|
"small",
|
|
342
293
|
"bt"
|
|
343
294
|
]),
|
|
344
295
|
onClick: () => {
|
|
345
296
|
e(
|
|
346
|
-
(
|
|
347
|
-
const
|
|
348
|
-
return
|
|
349
|
-
...
|
|
350
|
-
isNumber: !
|
|
351
|
-
},
|
|
297
|
+
(S) => j(S, C, (k, y) => {
|
|
298
|
+
const u = [...k], f = u[y];
|
|
299
|
+
return u[y] = {
|
|
300
|
+
...f,
|
|
301
|
+
isNumber: !f.isNumber
|
|
302
|
+
}, u;
|
|
352
303
|
})
|
|
353
304
|
);
|
|
354
305
|
},
|
|
@@ -356,95 +307,95 @@ const oe = Q((i, m) => {
|
|
|
356
307
|
}
|
|
357
308
|
)
|
|
358
309
|
] }) }),
|
|
359
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ i(
|
|
360
311
|
"input",
|
|
361
312
|
{
|
|
362
313
|
className: `value nativeV ${B ? "isKey" : ""}`,
|
|
363
|
-
value:
|
|
364
|
-
onInput: (
|
|
365
|
-
const
|
|
314
|
+
value: Z ? a.value : a.key,
|
|
315
|
+
onInput: (S) => {
|
|
316
|
+
const k = S.target.value;
|
|
366
317
|
if (B) {
|
|
367
318
|
e(
|
|
368
|
-
(
|
|
369
|
-
const
|
|
370
|
-
return
|
|
319
|
+
(u) => j(u, C, (f, R) => {
|
|
320
|
+
const w = [...f], G = w[R];
|
|
321
|
+
return w[R] = { ...G, key: k }, w;
|
|
371
322
|
})
|
|
372
323
|
);
|
|
373
324
|
return;
|
|
374
325
|
}
|
|
375
|
-
let
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
326
|
+
let y = k;
|
|
327
|
+
d.allowFilter && a.isNumber && (y = Y(
|
|
328
|
+
k,
|
|
329
|
+
a.isArray,
|
|
330
|
+
t.arraySplitSymbol
|
|
380
331
|
)), e(
|
|
381
|
-
(
|
|
382
|
-
const
|
|
383
|
-
return
|
|
332
|
+
(u) => j(u, C, (f, R) => {
|
|
333
|
+
const w = [...f], G = w[R];
|
|
334
|
+
return w[R] = { ...G, value: y }, w;
|
|
384
335
|
})
|
|
385
336
|
);
|
|
386
337
|
}
|
|
387
338
|
}
|
|
388
339
|
),
|
|
389
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ i("div", { className: "surSlot", children: o < c ? !B && /* @__PURE__ */ i(
|
|
390
341
|
"button",
|
|
391
342
|
{
|
|
392
|
-
className:
|
|
343
|
+
className: g([
|
|
393
344
|
"success",
|
|
394
345
|
"bt"
|
|
395
346
|
]),
|
|
396
347
|
onClick: () => {
|
|
397
348
|
e(
|
|
398
|
-
(
|
|
399
|
-
const
|
|
400
|
-
...Array.isArray(
|
|
401
|
-
{ rId:
|
|
349
|
+
(S) => j(S, C, (k, y) => {
|
|
350
|
+
const u = [...k], f = u[y], w = [
|
|
351
|
+
...Array.isArray(f.value) ? f.value : [],
|
|
352
|
+
{ rId: v(), key: "", value: "" }
|
|
402
353
|
];
|
|
403
|
-
return
|
|
404
|
-
...
|
|
354
|
+
return u[y] = {
|
|
355
|
+
...f,
|
|
405
356
|
isArray: void 0,
|
|
406
357
|
isNumber: void 0,
|
|
407
|
-
value:
|
|
408
|
-
},
|
|
358
|
+
value: w
|
|
359
|
+
}, u;
|
|
409
360
|
})
|
|
410
361
|
);
|
|
411
362
|
},
|
|
412
|
-
children: K(
|
|
363
|
+
children: K(a)
|
|
413
364
|
}
|
|
414
365
|
) : null })
|
|
415
366
|
] })
|
|
416
367
|
] }),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ b("div", { className: "btn", children: [
|
|
369
|
+
/* @__PURE__ */ i(
|
|
419
370
|
"button",
|
|
420
371
|
{
|
|
421
|
-
className:
|
|
422
|
-
disabled:
|
|
372
|
+
className: g(["success", "bt"]),
|
|
373
|
+
disabled: M !== q.length - 1,
|
|
423
374
|
onClick: () => {
|
|
424
|
-
e((
|
|
425
|
-
const
|
|
426
|
-
return
|
|
427
|
-
rId:
|
|
375
|
+
e((S) => j(S, C, (k, y) => {
|
|
376
|
+
const u = [...k];
|
|
377
|
+
return u.splice(y + 1, 0, {
|
|
378
|
+
rId: v(),
|
|
428
379
|
key: "",
|
|
429
380
|
value: ""
|
|
430
|
-
}),
|
|
381
|
+
}), u;
|
|
431
382
|
}));
|
|
432
383
|
},
|
|
433
384
|
children: "+"
|
|
434
385
|
}
|
|
435
386
|
),
|
|
436
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ i(
|
|
437
388
|
"button",
|
|
438
389
|
{
|
|
439
|
-
className:
|
|
390
|
+
className: g([
|
|
440
391
|
"danger",
|
|
441
392
|
"bt"
|
|
442
393
|
]),
|
|
443
394
|
onClick: () => {
|
|
444
395
|
e(
|
|
445
|
-
(
|
|
446
|
-
const
|
|
447
|
-
return
|
|
396
|
+
(S) => j(S, C, (k, y) => {
|
|
397
|
+
const u = [...k];
|
|
398
|
+
return u.splice(y, 1), u;
|
|
448
399
|
})
|
|
449
400
|
);
|
|
450
401
|
},
|
|
@@ -452,218 +403,219 @@ const oe = Q((i, m) => {
|
|
|
452
403
|
}
|
|
453
404
|
)
|
|
454
405
|
] }),
|
|
455
|
-
Array.isArray(
|
|
406
|
+
Array.isArray(a.value) && m(a.value, o + 1, C)
|
|
456
407
|
]
|
|
457
408
|
},
|
|
458
|
-
|
|
409
|
+
a.rId
|
|
459
410
|
);
|
|
460
411
|
})
|
|
461
412
|
}
|
|
462
413
|
);
|
|
463
|
-
return
|
|
464
|
-
|
|
465
|
-
}, [
|
|
466
|
-
/* @__PURE__ */
|
|
414
|
+
return E(() => {
|
|
415
|
+
T && $(N(l));
|
|
416
|
+
}, [l]), /* @__PURE__ */ b("div", { className: `dynamicCascadeInput ${L}`, children: [
|
|
417
|
+
/* @__PURE__ */ i(
|
|
467
418
|
"div",
|
|
468
419
|
{
|
|
469
|
-
className: `dyFormList ${
|
|
470
|
-
style: { maxHeight:
|
|
471
|
-
children:
|
|
420
|
+
className: `dyFormList ${l.length ? "" : "noObj"}`,
|
|
421
|
+
style: { maxHeight: d.maxHeight },
|
|
422
|
+
children: m(l)
|
|
472
423
|
}
|
|
473
424
|
),
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
!
|
|
425
|
+
/* @__PURE__ */ b("div", { className: `control ${l.length ? "" : "noObj"}`, children: [
|
|
426
|
+
!l.length && /* @__PURE__ */ i(
|
|
476
427
|
"button",
|
|
477
428
|
{
|
|
478
|
-
className:
|
|
429
|
+
className: g([
|
|
479
430
|
"success",
|
|
480
431
|
"bt"
|
|
481
432
|
]),
|
|
482
433
|
onClick: () => {
|
|
483
|
-
e((
|
|
434
|
+
e((s) => [...s, { rId: v(), key: "", value: "" }]);
|
|
484
435
|
},
|
|
485
|
-
children:
|
|
436
|
+
children: A.newTxt
|
|
486
437
|
}
|
|
487
438
|
),
|
|
488
|
-
!
|
|
489
|
-
!
|
|
439
|
+
!T && /* @__PURE__ */ b(z, { children: [
|
|
440
|
+
!d.hideReset && /* @__PURE__ */ i(
|
|
490
441
|
"button",
|
|
491
442
|
{
|
|
492
|
-
className:
|
|
443
|
+
className: g([
|
|
493
444
|
"default",
|
|
494
445
|
"bt"
|
|
495
446
|
]),
|
|
496
447
|
onClick: () => {
|
|
497
|
-
e(
|
|
448
|
+
e(r(h)), P?.();
|
|
498
449
|
},
|
|
499
|
-
children:
|
|
450
|
+
children: A.resetTxt
|
|
500
451
|
}
|
|
501
452
|
),
|
|
502
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ i(
|
|
503
454
|
"button",
|
|
504
455
|
{
|
|
505
|
-
className:
|
|
456
|
+
className: g([
|
|
506
457
|
"info",
|
|
507
458
|
"bt"
|
|
508
459
|
]),
|
|
509
460
|
onClick: () => {
|
|
510
|
-
const
|
|
511
|
-
|
|
461
|
+
const s = N(l);
|
|
462
|
+
$(s), O?.(s, l), e(r(s));
|
|
512
463
|
},
|
|
513
|
-
children:
|
|
464
|
+
children: A.mergeTxt
|
|
514
465
|
}
|
|
515
466
|
)
|
|
516
467
|
] })
|
|
517
468
|
] })
|
|
518
469
|
] });
|
|
519
|
-
})
|
|
520
|
-
function
|
|
521
|
-
const [
|
|
522
|
-
return
|
|
523
|
-
|
|
524
|
-
}, [
|
|
470
|
+
});
|
|
471
|
+
function ce(F, x = {}) {
|
|
472
|
+
const [c, h] = Q(() => F);
|
|
473
|
+
return E(() => {
|
|
474
|
+
x.syncFromRaw && h(F);
|
|
475
|
+
}, [x.syncFromRaw, F]), [c, h];
|
|
525
476
|
}
|
|
526
|
-
function
|
|
527
|
-
const [
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
}, [
|
|
531
|
-
const
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
(e) => e.map((
|
|
535
|
-
const
|
|
536
|
-
return !
|
|
477
|
+
function ie(F) {
|
|
478
|
+
const [x, c] = F, h = W(x);
|
|
479
|
+
E(() => {
|
|
480
|
+
h.current = x;
|
|
481
|
+
}, [x]);
|
|
482
|
+
const T = I(() => h.current, []), L = I((t, n) => {
|
|
483
|
+
const l = n?.length ? new Set(n) : null;
|
|
484
|
+
c(
|
|
485
|
+
(e) => e.map((r) => {
|
|
486
|
+
const N = r.key;
|
|
487
|
+
return !l || l.has(N) ? { ...r, disabled: t } : r;
|
|
537
488
|
})
|
|
538
489
|
);
|
|
539
|
-
}, [
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
(e) => e.map((
|
|
543
|
-
const
|
|
544
|
-
return !
|
|
490
|
+
}, [c]), V = I((t, n) => {
|
|
491
|
+
const l = n?.length ? new Set(n) : null;
|
|
492
|
+
c(
|
|
493
|
+
(e) => e.map((r) => {
|
|
494
|
+
const N = r.key;
|
|
495
|
+
return !l || l.has(N) ? { ...r, hidden: t } : r;
|
|
545
496
|
})
|
|
546
497
|
);
|
|
547
|
-
}, [
|
|
548
|
-
(
|
|
549
|
-
|
|
550
|
-
(
|
|
498
|
+
}, [c]), H = I(
|
|
499
|
+
(t, n) => {
|
|
500
|
+
c(
|
|
501
|
+
(l) => l.map((e) => e.key === t ? { ...e, value: n } : e)
|
|
551
502
|
);
|
|
552
503
|
},
|
|
553
|
-
[
|
|
554
|
-
),
|
|
555
|
-
(
|
|
556
|
-
|
|
557
|
-
(
|
|
558
|
-
const e =
|
|
559
|
-
return e in
|
|
504
|
+
[c]
|
|
505
|
+
), D = I(
|
|
506
|
+
(t) => {
|
|
507
|
+
c(
|
|
508
|
+
(n) => n.map((l) => {
|
|
509
|
+
const e = l.key;
|
|
510
|
+
return e in t ? { ...l, value: t[e] } : l;
|
|
560
511
|
})
|
|
561
512
|
);
|
|
562
513
|
},
|
|
563
|
-
[
|
|
564
|
-
),
|
|
565
|
-
(
|
|
566
|
-
[
|
|
567
|
-
), K =
|
|
568
|
-
(
|
|
569
|
-
const
|
|
570
|
-
return
|
|
514
|
+
[c]
|
|
515
|
+
), v = I(
|
|
516
|
+
(t) => T().find((n) => n.key === t),
|
|
517
|
+
[T]
|
|
518
|
+
), K = I(
|
|
519
|
+
(t) => {
|
|
520
|
+
const n = v(t);
|
|
521
|
+
return n ? n.value : void 0;
|
|
571
522
|
},
|
|
572
|
-
[
|
|
573
|
-
), P =
|
|
574
|
-
(
|
|
575
|
-
const
|
|
576
|
-
return
|
|
577
|
-
const
|
|
578
|
-
return (!
|
|
523
|
+
[v]
|
|
524
|
+
), P = I(
|
|
525
|
+
(t) => {
|
|
526
|
+
const n = t?.length ? new Set(t) : null;
|
|
527
|
+
return T().reduce((l, e) => {
|
|
528
|
+
const r = e.key;
|
|
529
|
+
return (!n || n.has(r)) && (l[r] = e.value), l;
|
|
579
530
|
}, {});
|
|
580
531
|
},
|
|
581
|
-
[
|
|
582
|
-
),
|
|
583
|
-
(
|
|
584
|
-
|
|
532
|
+
[T]
|
|
533
|
+
), O = I(
|
|
534
|
+
(t = null) => {
|
|
535
|
+
c((n) => n.map((l) => ({ ...l, value: t })));
|
|
585
536
|
},
|
|
586
|
-
[
|
|
587
|
-
),
|
|
588
|
-
(
|
|
589
|
-
|
|
590
|
-
(
|
|
591
|
-
if (e.key !==
|
|
592
|
-
const { key:
|
|
593
|
-
return { ...e, ...
|
|
537
|
+
[c]
|
|
538
|
+
), $ = I(
|
|
539
|
+
(t, n) => {
|
|
540
|
+
c(
|
|
541
|
+
(l) => l.map((e) => {
|
|
542
|
+
if (e.key !== t) return e;
|
|
543
|
+
const { key: r, ...N } = n;
|
|
544
|
+
return { ...e, ...N };
|
|
594
545
|
})
|
|
595
546
|
);
|
|
596
547
|
},
|
|
597
|
-
[
|
|
598
|
-
),
|
|
599
|
-
(
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
(
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
605
|
-
const { key:
|
|
606
|
-
return { ...e, ...
|
|
548
|
+
[c]
|
|
549
|
+
), A = I(
|
|
550
|
+
(t) => {
|
|
551
|
+
const n = new Map(t);
|
|
552
|
+
c(
|
|
553
|
+
(l) => l.map((e) => {
|
|
554
|
+
const r = n.get(e.key);
|
|
555
|
+
if (!r) return e;
|
|
556
|
+
const { key: N, ...m } = r;
|
|
557
|
+
return { ...e, ...m };
|
|
607
558
|
})
|
|
608
559
|
);
|
|
609
560
|
},
|
|
610
|
-
[
|
|
611
|
-
),
|
|
612
|
-
(
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
(
|
|
616
|
-
const
|
|
617
|
-
return
|
|
561
|
+
[c]
|
|
562
|
+
), d = I(
|
|
563
|
+
(t) => {
|
|
564
|
+
const n = new Map(t);
|
|
565
|
+
c(
|
|
566
|
+
(l) => l.map((e) => {
|
|
567
|
+
const r = n.get(e.key);
|
|
568
|
+
return r ? { ...e, key: r } : e;
|
|
618
569
|
})
|
|
619
570
|
);
|
|
620
571
|
},
|
|
621
|
-
[
|
|
572
|
+
[c]
|
|
622
573
|
);
|
|
623
|
-
return
|
|
574
|
+
return ee(
|
|
624
575
|
() => ({
|
|
625
|
-
items:
|
|
626
|
-
setDisabled:
|
|
627
|
-
setHidden:
|
|
628
|
-
setValue:
|
|
629
|
-
setValues:
|
|
576
|
+
items: x,
|
|
577
|
+
setDisabled: L,
|
|
578
|
+
setHidden: V,
|
|
579
|
+
setValue: H,
|
|
580
|
+
setValues: D,
|
|
630
581
|
getValue: K,
|
|
631
582
|
getValues: P,
|
|
632
|
-
onReset:
|
|
633
|
-
getItem:
|
|
634
|
-
setItem:
|
|
635
|
-
setItems:
|
|
636
|
-
updateKeys:
|
|
583
|
+
onReset: O,
|
|
584
|
+
getItem: v,
|
|
585
|
+
setItem: $,
|
|
586
|
+
setItems: A,
|
|
587
|
+
updateKeys: d
|
|
637
588
|
}),
|
|
638
589
|
[
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
f,
|
|
642
|
-
$,
|
|
590
|
+
x,
|
|
591
|
+
L,
|
|
643
592
|
V,
|
|
593
|
+
H,
|
|
594
|
+
D,
|
|
644
595
|
K,
|
|
645
596
|
P,
|
|
646
|
-
D,
|
|
647
|
-
k,
|
|
648
597
|
O,
|
|
649
|
-
|
|
650
|
-
|
|
598
|
+
v,
|
|
599
|
+
$,
|
|
600
|
+
A,
|
|
601
|
+
d
|
|
651
602
|
]
|
|
652
603
|
);
|
|
653
604
|
}
|
|
654
605
|
export {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
606
|
+
oe as DynamicCascadeInput,
|
|
607
|
+
ae as DynamicInput,
|
|
608
|
+
de as OmitValue,
|
|
609
|
+
g as clsx,
|
|
610
|
+
Y as formatNumberInput,
|
|
611
|
+
ye as getDepthColor,
|
|
612
|
+
be as omitAllCommonKey,
|
|
613
|
+
he as omitFormCommonKey,
|
|
614
|
+
te as parseValue,
|
|
615
|
+
J as resetObj,
|
|
616
|
+
ne as saferRepairColor,
|
|
617
|
+
_ as tranArr,
|
|
618
|
+
j as updateArrayAtPath,
|
|
619
|
+
ie as useDyForm,
|
|
620
|
+
ce as useReactiveForm
|
|
669
621
|
};
|