@harbor-design/proform 1.4.19 → 1.4.21
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.js +461 -381
- package/dist/types/src/services/Context/index.d.ts +15 -1
- package/dist/types/src/services/RuntimeCore/index.d.ts +1 -0
- package/dist/types/src/types/contextTypes.d.ts +19 -0
- package/dist/types/src/types/formCustomizerTypes.d.ts +1 -0
- package/package.json +1 -1
- package/CHANGELOG.md +0 -829
package/dist/index.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
var e =
|
|
1
|
+
var Qe = Object.defineProperty;
|
|
2
|
+
var Ae = (r, e, t) => e in r ? Qe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var u = (r, e, t) => (Ae(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { ref as L, readonly as Ve, nextTick as S, isRef as T, watch as E, isReactive as U, watchEffect as K, toRaw as M, reactive as D, createVNode as m, mergeProps as q, withDirectives as ke, vShow as et, createTextVNode as tt, isVNode as rt, defineComponent as it } from "vue";
|
|
5
|
+
var st = typeof global == "object" && global && global.Object === Object && global, nt = typeof self == "object" && self && self.Object === Object && self, re = st || nt || Function("return this")(), $ = re.Symbol, ze = Object.prototype, ot = ze.hasOwnProperty, at = ze.toString, N = $ ? $.toStringTag : void 0;
|
|
6
|
+
function lt(r) {
|
|
7
|
+
var e = ot.call(r, N), t = r[N];
|
|
8
8
|
try {
|
|
9
|
-
r[
|
|
9
|
+
r[N] = void 0;
|
|
10
10
|
var i = !0;
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
|
-
var s =
|
|
14
|
-
return i && (e ? r[
|
|
13
|
+
var s = at.call(r);
|
|
14
|
+
return i && (e ? r[N] = t : delete r[N]), s;
|
|
15
15
|
}
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var ut = Object.prototype, ct = ut.toString;
|
|
17
|
+
function ft(r) {
|
|
18
18
|
return ct.call(r);
|
|
19
19
|
}
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
return r == null ? r === void 0 ?
|
|
20
|
+
var dt = "[object Null]", ht = "[object Undefined]", Ne = $ ? $.toStringTag : void 0;
|
|
21
|
+
function He(r) {
|
|
22
|
+
return r == null ? r === void 0 ? ht : dt : Ne && Ne in Object(r) ? lt(r) : ft(r);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function pt(r) {
|
|
25
25
|
return r != null && typeof r == "object";
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var mt = "[object Symbol]";
|
|
28
28
|
function ie(r) {
|
|
29
|
-
return typeof r == "symbol" ||
|
|
29
|
+
return typeof r == "symbol" || pt(r) && He(r) == mt;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function gt(r, e) {
|
|
32
32
|
for (var t = -1, i = r == null ? 0 : r.length, s = Array(i); ++t < i; )
|
|
33
33
|
s[t] = e(r[t], t, r);
|
|
34
34
|
return s;
|
|
35
35
|
}
|
|
36
|
-
var se = Array.isArray,
|
|
37
|
-
function
|
|
36
|
+
var se = Array.isArray, Pt = 1 / 0, Le = $ ? $.prototype : void 0, qe = Le ? Le.toString : void 0;
|
|
37
|
+
function De(r) {
|
|
38
38
|
if (typeof r == "string")
|
|
39
39
|
return r;
|
|
40
40
|
if (se(r))
|
|
41
|
-
return
|
|
41
|
+
return gt(r, De) + "";
|
|
42
42
|
if (ie(r))
|
|
43
|
-
return
|
|
43
|
+
return qe ? qe.call(r) : "";
|
|
44
44
|
var e = r + "";
|
|
45
|
-
return e == "0" && 1 / r == -
|
|
45
|
+
return e == "0" && 1 / r == -Pt ? "-0" : e;
|
|
46
46
|
}
|
|
47
47
|
function W(r) {
|
|
48
48
|
var e = typeof r;
|
|
49
49
|
return r != null && (e == "object" || e == "function");
|
|
50
50
|
}
|
|
51
|
-
var
|
|
51
|
+
var vt = "[object AsyncFunction]", bt = "[object Function]", yt = "[object GeneratorFunction]", _t = "[object Proxy]";
|
|
52
52
|
function G(r) {
|
|
53
53
|
if (!W(r))
|
|
54
54
|
return !1;
|
|
55
|
-
var e =
|
|
56
|
-
return e ==
|
|
55
|
+
var e = He(r);
|
|
56
|
+
return e == bt || e == yt || e == vt || e == _t;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
var r = /[^.]+$/.exec(
|
|
58
|
+
var J = re["__core-js_shared__"], Te = function() {
|
|
59
|
+
var r = /[^.]+$/.exec(J && J.keys && J.keys.IE_PROTO || "");
|
|
60
60
|
return r ? "Symbol(src)_1." + r : "";
|
|
61
61
|
}();
|
|
62
62
|
function Ct(r) {
|
|
63
|
-
return !!
|
|
63
|
+
return !!Te && Te in r;
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
65
|
+
var It = Function.prototype, St = It.toString;
|
|
66
|
+
function Ft(r) {
|
|
67
67
|
if (r != null) {
|
|
68
68
|
try {
|
|
69
|
-
return
|
|
69
|
+
return St.call(r);
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
@@ -76,247 +76,247 @@ function Et(r) {
|
|
|
76
76
|
}
|
|
77
77
|
return "";
|
|
78
78
|
}
|
|
79
|
-
var Ot = /[\\^$.*+?()[\]{}|]/g,
|
|
80
|
-
"^" +
|
|
79
|
+
var Ot = /[\\^$.*+?()[\]{}|]/g, Et = /^\[object .+?Constructor\]$/, wt = Function.prototype, jt = Object.prototype, xt = wt.toString, Rt = jt.hasOwnProperty, Mt = RegExp(
|
|
80
|
+
"^" + xt.call(Rt).replace(Ot, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
81
81
|
);
|
|
82
|
-
function
|
|
82
|
+
function $t(r) {
|
|
83
83
|
if (!W(r) || Ct(r))
|
|
84
84
|
return !1;
|
|
85
|
-
var e = G(r) ? Mt :
|
|
86
|
-
return e.test(
|
|
85
|
+
var e = G(r) ? Mt : Et;
|
|
86
|
+
return e.test(Ft(r));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Vt(r, e) {
|
|
89
89
|
return r == null ? void 0 : r[e];
|
|
90
90
|
}
|
|
91
91
|
function ne(r, e) {
|
|
92
|
-
var t =
|
|
93
|
-
return
|
|
92
|
+
var t = Vt(r, e);
|
|
93
|
+
return $t(t) ? t : void 0;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var Ue = function() {
|
|
96
96
|
try {
|
|
97
97
|
var r = ne(Object, "defineProperty");
|
|
98
98
|
return r({}, "", {}), r;
|
|
99
99
|
} catch {
|
|
100
100
|
}
|
|
101
|
-
}(),
|
|
102
|
-
function
|
|
101
|
+
}(), Nt = 9007199254740991, Lt = /^(?:0|[1-9]\d*)$/;
|
|
102
|
+
function qt(r, e) {
|
|
103
103
|
var t = typeof r;
|
|
104
|
-
return e = e ??
|
|
104
|
+
return e = e ?? Nt, !!e && (t == "number" || t != "symbol" && Lt.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
e == "__proto__" &&
|
|
106
|
+
function Tt(r, e, t) {
|
|
107
|
+
e == "__proto__" && Ue ? Ue(r, e, {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
enumerable: !0,
|
|
110
110
|
value: t,
|
|
111
111
|
writable: !0
|
|
112
112
|
}) : r[e] = t;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ge(r, e) {
|
|
115
115
|
return r === e || r !== r && e !== e;
|
|
116
116
|
}
|
|
117
|
-
var
|
|
118
|
-
function
|
|
117
|
+
var Ut = Object.prototype, zt = Ut.hasOwnProperty;
|
|
118
|
+
function Ht(r, e, t) {
|
|
119
119
|
var i = r[e];
|
|
120
|
-
(!(
|
|
120
|
+
(!(zt.call(r, e) && Ge(i, t)) || t === void 0 && !(e in r)) && Tt(r, e, t);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var Dt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Gt = /^\w*$/;
|
|
123
|
+
function Bt(r, e) {
|
|
124
124
|
if (se(r))
|
|
125
125
|
return !1;
|
|
126
126
|
var t = typeof r;
|
|
127
|
-
return t == "number" || t == "symbol" || t == "boolean" || r == null || ie(r) ? !0 :
|
|
127
|
+
return t == "number" || t == "symbol" || t == "boolean" || r == null || ie(r) ? !0 : Gt.test(r) || !Dt.test(r) || e != null && r in Object(e);
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
this.__data__ =
|
|
129
|
+
var z = ne(Object, "create");
|
|
130
|
+
function Kt() {
|
|
131
|
+
this.__data__ = z ? z(null) : {}, this.size = 0;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Wt(r) {
|
|
134
134
|
var e = this.has(r) && delete this.__data__[r];
|
|
135
135
|
return this.size -= e ? 1 : 0, e;
|
|
136
136
|
}
|
|
137
|
-
var
|
|
138
|
-
function
|
|
137
|
+
var Xt = "__lodash_hash_undefined__", Yt = Object.prototype, Zt = Yt.hasOwnProperty;
|
|
138
|
+
function Jt(r) {
|
|
139
139
|
var e = this.__data__;
|
|
140
|
-
if (
|
|
140
|
+
if (z) {
|
|
141
141
|
var t = e[r];
|
|
142
|
-
return t ===
|
|
142
|
+
return t === Xt ? void 0 : t;
|
|
143
143
|
}
|
|
144
|
-
return
|
|
144
|
+
return Zt.call(e, r) ? e[r] : void 0;
|
|
145
145
|
}
|
|
146
|
-
var
|
|
147
|
-
function
|
|
146
|
+
var Qt = Object.prototype, At = Qt.hasOwnProperty;
|
|
147
|
+
function kt(r) {
|
|
148
148
|
var e = this.__data__;
|
|
149
|
-
return
|
|
149
|
+
return z ? e[r] !== void 0 : At.call(e, r);
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function
|
|
151
|
+
var er = "__lodash_hash_undefined__";
|
|
152
|
+
function tr(r, e) {
|
|
153
153
|
var t = this.__data__;
|
|
154
|
-
return this.size += this.has(r) ? 0 : 1, t[r] =
|
|
154
|
+
return this.size += this.has(r) ? 0 : 1, t[r] = z && e === void 0 ? er : e, this;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function w(r) {
|
|
157
157
|
var e = -1, t = r == null ? 0 : r.length;
|
|
158
158
|
for (this.clear(); ++e < t; ) {
|
|
159
159
|
var i = r[e];
|
|
160
160
|
this.set(i[0], i[1]);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
function
|
|
163
|
+
w.prototype.clear = Kt;
|
|
164
|
+
w.prototype.delete = Wt;
|
|
165
|
+
w.prototype.get = Jt;
|
|
166
|
+
w.prototype.has = kt;
|
|
167
|
+
w.prototype.set = tr;
|
|
168
|
+
function rr() {
|
|
169
169
|
this.__data__ = [], this.size = 0;
|
|
170
170
|
}
|
|
171
171
|
function X(r, e) {
|
|
172
172
|
for (var t = r.length; t--; )
|
|
173
|
-
if (
|
|
173
|
+
if (Ge(r[t][0], e))
|
|
174
174
|
return t;
|
|
175
175
|
return -1;
|
|
176
176
|
}
|
|
177
|
-
var
|
|
178
|
-
function
|
|
177
|
+
var ir = Array.prototype, sr = ir.splice;
|
|
178
|
+
function nr(r) {
|
|
179
179
|
var e = this.__data__, t = X(e, r);
|
|
180
180
|
if (t < 0)
|
|
181
181
|
return !1;
|
|
182
182
|
var i = e.length - 1;
|
|
183
|
-
return t == i ? e.pop() :
|
|
183
|
+
return t == i ? e.pop() : sr.call(e, t, 1), --this.size, !0;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function or(r) {
|
|
186
186
|
var e = this.__data__, t = X(e, r);
|
|
187
187
|
return t < 0 ? void 0 : e[t][1];
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function ar(r) {
|
|
190
190
|
return X(this.__data__, r) > -1;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function lr(r, e) {
|
|
193
193
|
var t = this.__data__, i = X(t, r);
|
|
194
194
|
return i < 0 ? (++this.size, t.push([r, e])) : t[i][1] = e, this;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function V(r) {
|
|
197
197
|
var e = -1, t = r == null ? 0 : r.length;
|
|
198
198
|
for (this.clear(); ++e < t; ) {
|
|
199
199
|
var i = r[e];
|
|
200
200
|
this.set(i[0], i[1]);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
var
|
|
203
|
+
V.prototype.clear = rr;
|
|
204
|
+
V.prototype.delete = nr;
|
|
205
|
+
V.prototype.get = or;
|
|
206
|
+
V.prototype.has = ar;
|
|
207
|
+
V.prototype.set = lr;
|
|
208
|
+
var ur = ne(re, "Map");
|
|
209
209
|
function cr() {
|
|
210
210
|
this.size = 0, this.__data__ = {
|
|
211
|
-
hash: new
|
|
212
|
-
map: new (
|
|
213
|
-
string: new
|
|
211
|
+
hash: new w(),
|
|
212
|
+
map: new (ur || V)(),
|
|
213
|
+
string: new w()
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function fr(r) {
|
|
217
217
|
var e = typeof r;
|
|
218
218
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? r !== "__proto__" : r === null;
|
|
219
219
|
}
|
|
220
220
|
function Y(r, e) {
|
|
221
221
|
var t = r.__data__;
|
|
222
|
-
return
|
|
222
|
+
return fr(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function dr(r) {
|
|
225
225
|
var e = Y(this, r).delete(r);
|
|
226
226
|
return this.size -= e ? 1 : 0, e;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function hr(r) {
|
|
229
229
|
return Y(this, r).get(r);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function pr(r) {
|
|
232
232
|
return Y(this, r).has(r);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function mr(r, e) {
|
|
235
235
|
var t = Y(this, r), i = t.size;
|
|
236
236
|
return t.set(r, e), this.size += t.size == i ? 0 : 1, this;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function j(r) {
|
|
239
239
|
var e = -1, t = r == null ? 0 : r.length;
|
|
240
240
|
for (this.clear(); ++e < t; ) {
|
|
241
241
|
var i = r[e];
|
|
242
242
|
this.set(i[0], i[1]);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
var
|
|
245
|
+
j.prototype.clear = cr;
|
|
246
|
+
j.prototype.delete = dr;
|
|
247
|
+
j.prototype.get = hr;
|
|
248
|
+
j.prototype.has = pr;
|
|
249
|
+
j.prototype.set = mr;
|
|
250
|
+
var gr = "Expected a function";
|
|
251
251
|
function oe(r, e) {
|
|
252
252
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
253
|
-
throw new TypeError(
|
|
253
|
+
throw new TypeError(gr);
|
|
254
254
|
var t = function() {
|
|
255
255
|
var i = arguments, s = e ? e.apply(this, i) : i[0], n = t.cache;
|
|
256
256
|
if (n.has(s))
|
|
257
257
|
return n.get(s);
|
|
258
|
-
var
|
|
259
|
-
return t.cache = n.set(s,
|
|
258
|
+
var o = r.apply(this, i);
|
|
259
|
+
return t.cache = n.set(s, o) || n, o;
|
|
260
260
|
};
|
|
261
|
-
return t.cache = new (oe.Cache ||
|
|
261
|
+
return t.cache = new (oe.Cache || j)(), t;
|
|
262
262
|
}
|
|
263
|
-
oe.Cache =
|
|
264
|
-
var
|
|
265
|
-
function
|
|
263
|
+
oe.Cache = j;
|
|
264
|
+
var Pr = 500;
|
|
265
|
+
function vr(r) {
|
|
266
266
|
var e = oe(r, function(i) {
|
|
267
|
-
return t.size ===
|
|
267
|
+
return t.size === Pr && t.clear(), i;
|
|
268
268
|
}), t = e.cache;
|
|
269
269
|
return e;
|
|
270
270
|
}
|
|
271
|
-
var
|
|
271
|
+
var br = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, yr = /\\(\\)?/g, _r = vr(function(r) {
|
|
272
272
|
var e = [];
|
|
273
|
-
return r.charCodeAt(0) === 46 && e.push(""), r.replace(
|
|
274
|
-
e.push(s ? n.replace(
|
|
273
|
+
return r.charCodeAt(0) === 46 && e.push(""), r.replace(br, function(t, i, s, n) {
|
|
274
|
+
e.push(s ? n.replace(yr, "$1") : i || t);
|
|
275
275
|
}), e;
|
|
276
276
|
});
|
|
277
277
|
function Cr(r) {
|
|
278
|
-
return r == null ? "" :
|
|
278
|
+
return r == null ? "" : De(r);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return se(r) ? r :
|
|
280
|
+
function Be(r, e) {
|
|
281
|
+
return se(r) ? r : Bt(r, e) ? [r] : _r(Cr(r));
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
function
|
|
283
|
+
var Ir = 1 / 0;
|
|
284
|
+
function Ke(r) {
|
|
285
285
|
if (typeof r == "string" || ie(r))
|
|
286
286
|
return r;
|
|
287
287
|
var e = r + "";
|
|
288
|
-
return e == "0" && 1 / r == -
|
|
288
|
+
return e == "0" && 1 / r == -Ir ? "-0" : e;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
e =
|
|
290
|
+
function Sr(r, e) {
|
|
291
|
+
e = Be(e, r);
|
|
292
292
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
293
|
-
r = r[
|
|
293
|
+
r = r[Ke(e[t++])];
|
|
294
294
|
return t && t == i ? r : void 0;
|
|
295
295
|
}
|
|
296
296
|
function B(r, e, t) {
|
|
297
|
-
var i = r == null ? void 0 :
|
|
297
|
+
var i = r == null ? void 0 : Sr(r, e);
|
|
298
298
|
return i === void 0 ? t : i;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function Fr(r, e, t, i) {
|
|
301
301
|
if (!W(r))
|
|
302
302
|
return r;
|
|
303
|
-
e =
|
|
304
|
-
for (var s = -1, n = e.length,
|
|
305
|
-
var f =
|
|
303
|
+
e = Be(e, r);
|
|
304
|
+
for (var s = -1, n = e.length, o = n - 1, l = r; l != null && ++s < n; ) {
|
|
305
|
+
var f = Ke(e[s]), d = t;
|
|
306
306
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
307
307
|
return r;
|
|
308
|
-
if (s !=
|
|
309
|
-
var h =
|
|
310
|
-
|
|
308
|
+
if (s != o) {
|
|
309
|
+
var h = l[f];
|
|
310
|
+
d = i ? i(h, f, l) : void 0, d === void 0 && (d = W(h) ? h : qt(e[s + 1]) ? [] : {});
|
|
311
311
|
}
|
|
312
|
-
|
|
312
|
+
Ht(l, f, d), l = l[f];
|
|
313
313
|
}
|
|
314
314
|
return r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
return r == null ? r :
|
|
316
|
+
function y(r, e, t) {
|
|
317
|
+
return r == null ? r : Fr(r, e, t);
|
|
318
318
|
}
|
|
319
|
-
class
|
|
319
|
+
class a {
|
|
320
320
|
static typeChecker(e) {
|
|
321
321
|
return {}.toString.call(e);
|
|
322
322
|
}
|
|
@@ -391,16 +391,16 @@ class o {
|
|
|
391
391
|
return !!e.__proform_raw_object;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function P(r, ...e) {
|
|
395
395
|
return e.forEach((t) => {
|
|
396
396
|
if (Array.isArray(t))
|
|
397
397
|
r = [...t];
|
|
398
398
|
else
|
|
399
399
|
for (const i in t)
|
|
400
|
-
t.hasOwnProperty(i) && t[i] !== void 0 && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? Array.isArray(t[i]) ? r[i] = [...t[i]] : r[i] =
|
|
400
|
+
t.hasOwnProperty(i) && t[i] !== void 0 && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? Array.isArray(t[i]) ? r[i] = [...t[i]] : r[i] = P(r[i] || {}, t[i]) : r[i] = t[i]);
|
|
401
401
|
}), r;
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function C(r) {
|
|
404
404
|
const e = /* @__PURE__ */ new WeakMap();
|
|
405
405
|
function t(i) {
|
|
406
406
|
if (i === null || typeof i != "object")
|
|
@@ -411,14 +411,14 @@ function I(r) {
|
|
|
411
411
|
return new RegExp(i);
|
|
412
412
|
if (i instanceof Map) {
|
|
413
413
|
const n = /* @__PURE__ */ new Map();
|
|
414
|
-
for (const [
|
|
415
|
-
n.set(t(
|
|
414
|
+
for (const [o, l] of i)
|
|
415
|
+
n.set(t(o), t(l));
|
|
416
416
|
return n;
|
|
417
417
|
}
|
|
418
418
|
if (i instanceof Set) {
|
|
419
419
|
const n = /* @__PURE__ */ new Set();
|
|
420
|
-
for (const
|
|
421
|
-
n.add(t(
|
|
420
|
+
for (const o of i)
|
|
421
|
+
n.add(t(o));
|
|
422
422
|
return n;
|
|
423
423
|
}
|
|
424
424
|
if (e.has(i))
|
|
@@ -426,8 +426,8 @@ function I(r) {
|
|
|
426
426
|
if (Array.isArray(i)) {
|
|
427
427
|
const n = [];
|
|
428
428
|
e.set(i, n);
|
|
429
|
-
for (let
|
|
430
|
-
n[
|
|
429
|
+
for (let o = 0; o < i.length; o++)
|
|
430
|
+
n[o] = t(i[o]);
|
|
431
431
|
return n;
|
|
432
432
|
}
|
|
433
433
|
const s = Object.create(Object.getPrototypeOf(i));
|
|
@@ -443,9 +443,9 @@ function k(r, e) {
|
|
|
443
443
|
}
|
|
444
444
|
class Or {
|
|
445
445
|
constructor(e) {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
u(this, "runtimeCore");
|
|
447
|
+
u(this, "readonlyReactiveModel", L({}));
|
|
448
|
+
u(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
449
449
|
this.formCustomization = e;
|
|
450
450
|
}
|
|
451
451
|
// happy path, 后续可以完善更多的 fallback 处理,fallback 处理是为了不卡住异步时的首次渲染做的优化
|
|
@@ -455,36 +455,36 @@ class Or {
|
|
|
455
455
|
})), e;
|
|
456
456
|
}
|
|
457
457
|
setup(e) {
|
|
458
|
-
return this.runtimeCore = e, this.readonlyReactiveModel.value =
|
|
458
|
+
return this.runtimeCore = e, this.readonlyReactiveModel.value = Ve(e.model.value), Object.assign(this.runtimeCore.native, this.formCustomization.native), Object.assign(this.runtimeCore.grid, this.formCustomization.grid), Object.assign(this.runtimeCore.runtime, this.formCustomization.runtime), this.formCustomization.ui && (this.runtimeCore.ui = this.formCustomization.ui), this.formCustomization;
|
|
459
459
|
}
|
|
460
460
|
submit() {
|
|
461
461
|
var i;
|
|
462
|
-
const e = (i =
|
|
462
|
+
const e = (i = c.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t = I.adapters[c.getUI(this.runtimeCore.ui)];
|
|
463
463
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
464
464
|
}
|
|
465
465
|
hydrate(e) {
|
|
466
466
|
S(() => {
|
|
467
467
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
468
468
|
() => {
|
|
469
|
-
|
|
469
|
+
T(e) ? E(
|
|
470
470
|
() => e.value,
|
|
471
471
|
() => {
|
|
472
|
-
|
|
472
|
+
P(this.runtimeCore.model.value, e.value);
|
|
473
473
|
},
|
|
474
474
|
{
|
|
475
475
|
deep: !0,
|
|
476
476
|
immediate: !0
|
|
477
477
|
}
|
|
478
|
-
) :
|
|
478
|
+
) : U(e) ? E(
|
|
479
479
|
() => e,
|
|
480
480
|
() => {
|
|
481
|
-
|
|
481
|
+
P(this.runtimeCore.model.value, e);
|
|
482
482
|
},
|
|
483
483
|
{
|
|
484
484
|
deep: !0,
|
|
485
485
|
immediate: !0
|
|
486
486
|
}
|
|
487
|
-
) :
|
|
487
|
+
) : P(this.runtimeCore.model.value, e);
|
|
488
488
|
},
|
|
489
489
|
{
|
|
490
490
|
lazy: !1
|
|
@@ -495,17 +495,17 @@ class Or {
|
|
|
495
495
|
share(e) {
|
|
496
496
|
S(() => {
|
|
497
497
|
Object.keys(e).forEach((t) => {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}) :
|
|
501
|
-
|
|
502
|
-
}) : (
|
|
498
|
+
T(e[t]) ? K(() => {
|
|
499
|
+
y(this.runtimeCore.shared, t, e[t].value), this.shareHistory.get(t) !== e[t].value && (this.shareHistory.set(t, e[t].value), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
500
|
+
}) : U(e[t]) ? K(() => {
|
|
501
|
+
y(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
502
|
+
}) : (y(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects()));
|
|
503
503
|
});
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
subscribeModel(e) {
|
|
507
507
|
S(() => {
|
|
508
|
-
const t =
|
|
508
|
+
const t = E(
|
|
509
509
|
() => this.readonlyReactiveModel.value,
|
|
510
510
|
(i) => {
|
|
511
511
|
e(i, {
|
|
@@ -526,17 +526,17 @@ class Or {
|
|
|
526
526
|
}
|
|
527
527
|
resetModel() {
|
|
528
528
|
var e;
|
|
529
|
-
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value =
|
|
529
|
+
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = C(
|
|
530
530
|
this.runtimeCore.processor.stableModel
|
|
531
|
-
), this.readonlyReactiveModel.value =
|
|
531
|
+
), this.readonlyReactiveModel.value = Ve(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
class ee {
|
|
535
535
|
constructor() {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
536
|
+
u(this, "effects", /* @__PURE__ */ new Set());
|
|
537
|
+
u(this, "tempClonedEffects", /* @__PURE__ */ new Set());
|
|
538
|
+
u(this, "identifierMap", /* @__PURE__ */ new Map());
|
|
539
|
+
u(this, "timer");
|
|
540
540
|
}
|
|
541
541
|
clearEffects() {
|
|
542
542
|
this.effects.clear();
|
|
@@ -550,26 +550,26 @@ class ee {
|
|
|
550
550
|
return t.identifier ? this.identifierMap.get(t.identifier) || (this.identifierMap.set(t.identifier, !0), !t.lazy && e(), this.effects.add(e)) : (!t.lazy && e(), this.effects.add(e)), () => this.effects.delete(e);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
class
|
|
553
|
+
class Er {
|
|
554
554
|
constructor(e) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e),
|
|
555
|
+
u(this, "runtimeCore");
|
|
556
|
+
u(this, "processedSchemas");
|
|
557
|
+
u(this, "processedModel");
|
|
558
|
+
u(this, "getRuntimeMeta");
|
|
559
|
+
u(this, "stableSchemas", []);
|
|
560
|
+
u(this, "stableModel", {});
|
|
561
|
+
u(this, "schemaPreset", I.schemaPreset);
|
|
562
|
+
u(this, "componentPropsPreset", I.componentPropsPreset);
|
|
563
|
+
u(this, "stableUpdaterProcessProgress");
|
|
564
|
+
u(this, "stableUpdaterTimes", 0);
|
|
565
|
+
u(this, "schemaEffect", new ee());
|
|
566
|
+
u(this, "defaultValueEffect", new ee());
|
|
567
|
+
u(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
568
|
+
u(this, "baseDefaultValueFunctionsLength");
|
|
569
|
+
u(this, "isModelInitialized", !0);
|
|
570
|
+
u(this, "schemaEffectHistory", /* @__PURE__ */ new Map());
|
|
571
|
+
u(this, "stableUpdaterHistory", /* @__PURE__ */ new Map());
|
|
572
|
+
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), E(
|
|
573
573
|
() => this.processedModel.value,
|
|
574
574
|
() => {
|
|
575
575
|
this.schemaEffect.triggerEffects();
|
|
@@ -598,21 +598,21 @@ class wr {
|
|
|
598
598
|
function s(n) {
|
|
599
599
|
if (!i.has(n) && (Array.isArray(n) || n !== null && typeof n == "object")) {
|
|
600
600
|
i.add(n);
|
|
601
|
-
for (const
|
|
602
|
-
n.hasOwnProperty(
|
|
601
|
+
for (const o in n)
|
|
602
|
+
n.hasOwnProperty(o) && (o === "defaultValue" && typeof n[o] == "function" && !n[o].toString().includes("[native code]") && t++, s(n[o]));
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
return s(e), t;
|
|
606
606
|
}
|
|
607
607
|
// 派生过程,用于外部应用
|
|
608
608
|
parseSchemas(e, t) {
|
|
609
|
-
|
|
610
|
-
|
|
609
|
+
a.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
610
|
+
C(e)
|
|
611
611
|
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
612
612
|
}
|
|
613
613
|
parseStable(e) {
|
|
614
614
|
const t = {};
|
|
615
|
-
if (!
|
|
615
|
+
if (!a.isUndefined(e.stable) && !a.isNull(e.stable))
|
|
616
616
|
t[e.key] = this.parseStable(e.stable);
|
|
617
617
|
else
|
|
618
618
|
return e;
|
|
@@ -621,45 +621,45 @@ class wr {
|
|
|
621
621
|
// 对于稳定初始化更新的抽象
|
|
622
622
|
stableUpdater(e = [], t, i, s, n) {
|
|
623
623
|
if (e.every(Boolean)) {
|
|
624
|
-
const
|
|
625
|
-
!
|
|
624
|
+
const o = M(this.processedSchemas.value);
|
|
625
|
+
!a.isProcessInprogress(o) && a.isObjectEmpty(this.stableModel), !this.stableUpdaterHistory.get(
|
|
626
626
|
`${t == null ? void 0 : t.key}parentIndex:${t == null ? void 0 : t.index}childIndex:${i}${s}${n}`
|
|
627
627
|
) && (this.stableUpdaterHistory.set(
|
|
628
628
|
`${t == null ? void 0 : t.key}parentIndex:${t == null ? void 0 : t.index}childIndex:${i}${s}${n}`,
|
|
629
629
|
!0
|
|
630
630
|
), this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
631
|
-
length:
|
|
632
|
-
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(
|
|
631
|
+
length: o.length
|
|
632
|
+
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(o));
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
635
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
636
636
|
parseItem(e, t, i) {
|
|
637
637
|
const s = this, n = Array.from({
|
|
638
|
-
length: Object.keys(e).filter((
|
|
638
|
+
length: Object.keys(e).filter((l) => l !== "children").length
|
|
639
639
|
}).fill(!1);
|
|
640
|
-
this.objectParser({ data: e, index: t, updater:
|
|
641
|
-
function
|
|
642
|
-
const f =
|
|
643
|
-
if (
|
|
640
|
+
this.objectParser({ data: e, index: t, updater: o, parentMeta: i });
|
|
641
|
+
function o(l) {
|
|
642
|
+
const f = l.index, d = l.key, h = l.keyIndex;
|
|
643
|
+
if (a.isUndefined(l.stable) || a.isNull(l.stable))
|
|
644
644
|
return;
|
|
645
|
-
const p = s.parseStable(
|
|
645
|
+
const p = s.parseStable(l.stable), b = i == null ? void 0 : i.index, H = i == null ? void 0 : i.key;
|
|
646
646
|
let g = p;
|
|
647
|
-
if (
|
|
648
|
-
const
|
|
649
|
-
|
|
647
|
+
if (a.isProcessInprogress(g) || (n[h] = !0), i) {
|
|
648
|
+
const v = s.processedSchemas.value[b][H][f][d];
|
|
649
|
+
v && a.isObject(v) && d !== "component" && (g = P(v, g)), s.processedSchemas.value[b][H][f][d] = g, s.stableUpdater(
|
|
650
650
|
n,
|
|
651
651
|
i,
|
|
652
652
|
t,
|
|
653
|
-
|
|
653
|
+
d,
|
|
654
654
|
f
|
|
655
655
|
);
|
|
656
656
|
} else {
|
|
657
|
-
const
|
|
658
|
-
|
|
657
|
+
const v = s.processedSchemas.value[f][d];
|
|
658
|
+
v && a.isObject(v) && d !== "component" && (g = P(v, g)), s.processedSchemas.value[f][d] = g, s.stableUpdater(
|
|
659
659
|
n,
|
|
660
660
|
i,
|
|
661
661
|
t,
|
|
662
|
-
|
|
662
|
+
d,
|
|
663
663
|
f
|
|
664
664
|
);
|
|
665
665
|
}
|
|
@@ -669,7 +669,7 @@ class wr {
|
|
|
669
669
|
objectParser(e) {
|
|
670
670
|
const t = e.data;
|
|
671
671
|
Object.keys(t).forEach((s, n) => {
|
|
672
|
-
var
|
|
672
|
+
var o, l;
|
|
673
673
|
if (s === "children")
|
|
674
674
|
this.parseSchemas(t[s], {
|
|
675
675
|
...e,
|
|
@@ -677,19 +677,19 @@ class wr {
|
|
|
677
677
|
keyIndex: n
|
|
678
678
|
});
|
|
679
679
|
else {
|
|
680
|
-
const f = (
|
|
680
|
+
const f = (d) => {
|
|
681
681
|
e.updater({
|
|
682
682
|
...e,
|
|
683
683
|
key: s,
|
|
684
684
|
keyIndex: n,
|
|
685
|
-
stable:
|
|
685
|
+
stable: d
|
|
686
686
|
});
|
|
687
687
|
};
|
|
688
|
-
|
|
688
|
+
a.isFunction(t[s]) ? s !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
689
689
|
() => {
|
|
690
690
|
if (s === "component") {
|
|
691
|
-
const
|
|
692
|
-
this.promiseFieldParser(
|
|
691
|
+
const d = t[s](this.getRuntimeMeta());
|
|
692
|
+
this.promiseFieldParser(d, f, !1, {
|
|
693
693
|
rootIndex: e.index,
|
|
694
694
|
parentMeta: e.parentMeta
|
|
695
695
|
});
|
|
@@ -701,24 +701,24 @@ class wr {
|
|
|
701
701
|
},
|
|
702
702
|
{
|
|
703
703
|
lazy: !1,
|
|
704
|
-
identifier: `${(
|
|
704
|
+
identifier: `${(o = e.parentMeta) == null ? void 0 : o.key}parentIndex:${(l = e.parentMeta) == null ? void 0 : l.index}childIndex:${e.index}${s}${n}`
|
|
705
705
|
}
|
|
706
706
|
) : this.defaultValueEffect.trackEffect(
|
|
707
707
|
() => {
|
|
708
|
-
const
|
|
708
|
+
const d = this.schemaEffect.trackEffect(
|
|
709
709
|
() => {
|
|
710
710
|
/\{\s*model\s*\}/.test(t[s].toString()) ? this.fieldParser(
|
|
711
711
|
t[s],
|
|
712
712
|
(h) => {
|
|
713
713
|
if (!h)
|
|
714
714
|
return f(h);
|
|
715
|
-
this.defaultValueInprogressMap.set(t[s], h), !
|
|
715
|
+
this.defaultValueInprogressMap.set(t[s], h), !a.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
716
716
|
this.defaultValueInprogressMap.values()
|
|
717
717
|
).every((p) => {
|
|
718
|
-
var
|
|
719
|
-
return !((
|
|
718
|
+
var b;
|
|
719
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
720
720
|
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
721
|
-
|
|
721
|
+
d();
|
|
722
722
|
})) : f(h);
|
|
723
723
|
},
|
|
724
724
|
{
|
|
@@ -728,13 +728,13 @@ class wr {
|
|
|
728
728
|
) : this.fieldParser(
|
|
729
729
|
t[s],
|
|
730
730
|
(h) => {
|
|
731
|
-
this.defaultValueInprogressMap.set(t[s], h), !
|
|
731
|
+
this.defaultValueInprogressMap.set(t[s], h), !a.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
732
732
|
this.defaultValueInprogressMap.values()
|
|
733
733
|
).every((p) => {
|
|
734
|
-
var
|
|
735
|
-
return !((
|
|
734
|
+
var b;
|
|
735
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
736
736
|
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
737
|
-
|
|
737
|
+
d();
|
|
738
738
|
})) : f(h);
|
|
739
739
|
},
|
|
740
740
|
{
|
|
@@ -762,14 +762,14 @@ class wr {
|
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
764
|
promiseFieldParser(e, t, i, s) {
|
|
765
|
-
|
|
766
|
-
|
|
765
|
+
a.isPromise(e) ? e.then((n) => {
|
|
766
|
+
a.isString(n) && (n = k(n, "")), i && a.isObject(n) && !a.isNativeObject(n) ? this.objectParser({
|
|
767
767
|
data: n,
|
|
768
768
|
updater: t,
|
|
769
769
|
index: s.rootIndex,
|
|
770
770
|
parentMeta: s.parentMeta
|
|
771
771
|
}) : t(n);
|
|
772
|
-
}) : (
|
|
772
|
+
}) : (a.isString(e) && (e = k(e, "")), i && a.isObject(e) && !a.isNativeObject(e) ? this.objectParser({
|
|
773
773
|
data: e,
|
|
774
774
|
updater: t,
|
|
775
775
|
index: s.rootIndex,
|
|
@@ -778,7 +778,7 @@ class wr {
|
|
|
778
778
|
}
|
|
779
779
|
// 对任意对象中单个字段的 parse: 做基本处理
|
|
780
780
|
fieldParser(e, t, i, s = !0) {
|
|
781
|
-
if (
|
|
781
|
+
if (a.isFunction(e))
|
|
782
782
|
if (e.name.startsWith("__proform_raw_"))
|
|
783
783
|
t(
|
|
784
784
|
(...n) => e({
|
|
@@ -796,10 +796,10 @@ class wr {
|
|
|
796
796
|
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, t, s, i);
|
|
797
797
|
}
|
|
798
798
|
else
|
|
799
|
-
|
|
799
|
+
T(e) ? E(
|
|
800
800
|
() => e.value,
|
|
801
801
|
() => {
|
|
802
|
-
|
|
802
|
+
a.isUndefined(e.value) || (s && a.isObject(e.value) && !a.isNativeObject(e.value) ? this.objectParser({
|
|
803
803
|
data: e.value,
|
|
804
804
|
updater: t,
|
|
805
805
|
index: i.rootIndex,
|
|
@@ -810,10 +810,10 @@ class wr {
|
|
|
810
810
|
immediate: !0,
|
|
811
811
|
deep: !0
|
|
812
812
|
}
|
|
813
|
-
) :
|
|
813
|
+
) : U(e) ? E(
|
|
814
814
|
() => e,
|
|
815
815
|
() => {
|
|
816
|
-
|
|
816
|
+
a.isUndefined(e) || (s && a.isObject(e) && !a.isNativeObject(e) ? this.objectParser({
|
|
817
817
|
data: e,
|
|
818
818
|
updater: t,
|
|
819
819
|
index: i.rootIndex,
|
|
@@ -824,7 +824,7 @@ class wr {
|
|
|
824
824
|
immediate: !0,
|
|
825
825
|
deep: !0
|
|
826
826
|
}
|
|
827
|
-
) : s &&
|
|
827
|
+
) : s && a.isObject(e) && !a.isNativeObject(e) ? this.objectParser({
|
|
828
828
|
data: e,
|
|
829
829
|
updater: t,
|
|
830
830
|
index: i.rootIndex,
|
|
@@ -834,105 +834,105 @@ class wr {
|
|
|
834
834
|
modelProcessor(e) {
|
|
835
835
|
e.map((t) => {
|
|
836
836
|
this.createModel(t, this.processedModel.value);
|
|
837
|
-
}),
|
|
838
|
-
this.stableModel =
|
|
837
|
+
}), a.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && S(() => {
|
|
838
|
+
this.stableModel = C(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects();
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
setModel(e, t, i) {
|
|
842
|
-
|
|
842
|
+
a.isFunction(t) ? y(e, t(), i) : P(e, {
|
|
843
843
|
[t]: i
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
createModel(e, t) {
|
|
847
|
-
|
|
847
|
+
a.isListSchema(e) && (t[e.field] || this.setModel(t, e.field, [{}]), e.children.forEach((i) => {
|
|
848
848
|
this.createModel(i, t[e.field][0]);
|
|
849
|
-
})),
|
|
849
|
+
})), a.isGroupSchema(e) && e.children.forEach((i) => {
|
|
850
850
|
this.createModel(i, t);
|
|
851
|
-
}),
|
|
851
|
+
}), a.isItemSchema(e) && S(() => {
|
|
852
852
|
if ("defaultValue" in e && !t[e.field])
|
|
853
853
|
this.setModel(t, e.field, e.defaultValue);
|
|
854
854
|
else {
|
|
855
|
-
if (
|
|
855
|
+
if (a.isFunction(e.field) && B(t, e.field()))
|
|
856
856
|
return;
|
|
857
|
-
if (
|
|
857
|
+
if (a.isString(e.field) && t[e.field])
|
|
858
858
|
return;
|
|
859
859
|
this.setModel(t, e.field, void 0);
|
|
860
860
|
}
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
class
|
|
864
|
+
class x {
|
|
865
865
|
static getFormContainer({ ui: e } = {}) {
|
|
866
|
-
return
|
|
866
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Form;
|
|
867
867
|
}
|
|
868
868
|
static getFormItemContainer({ ui: e } = {}) {
|
|
869
|
-
return
|
|
869
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.FormItem;
|
|
870
870
|
}
|
|
871
871
|
static getItemContainer({ ui: e } = {}) {
|
|
872
|
-
return
|
|
872
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Item;
|
|
873
873
|
}
|
|
874
874
|
static getGroupContainer({ ui: e } = {}) {
|
|
875
|
-
return
|
|
875
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Group;
|
|
876
876
|
}
|
|
877
877
|
static getListContainer({ ui: e } = {}) {
|
|
878
|
-
return
|
|
878
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.List;
|
|
879
879
|
}
|
|
880
880
|
static getListItemContainer({ ui: e } = {}) {
|
|
881
|
-
return
|
|
881
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.ListItem;
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
class
|
|
884
|
+
class wr {
|
|
885
885
|
constructor(e) {
|
|
886
886
|
this.ui = e;
|
|
887
887
|
}
|
|
888
888
|
getRuntimeNative() {
|
|
889
889
|
var t;
|
|
890
|
-
return (t =
|
|
890
|
+
return (t = c.presets.uiPresets[this.ui]) == null ? void 0 : t.native;
|
|
891
891
|
}
|
|
892
892
|
getRuntimeField(e) {
|
|
893
893
|
var s;
|
|
894
|
-
const t = (s =
|
|
894
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
895
895
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
|
|
896
896
|
}
|
|
897
897
|
getRuntimeRequired(e) {
|
|
898
898
|
var s;
|
|
899
|
-
const t = (s =
|
|
899
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
900
900
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
|
|
901
901
|
}
|
|
902
902
|
getFormModelPropName() {
|
|
903
903
|
var i;
|
|
904
|
-
const e = (i =
|
|
904
|
+
const e = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t = I.adapters[c.getUI(this.ui)];
|
|
905
905
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
906
906
|
}
|
|
907
907
|
formComponentRenderer(e) {
|
|
908
908
|
var s;
|
|
909
|
-
const t = (s =
|
|
909
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
910
910
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
|
|
911
911
|
}
|
|
912
912
|
clearValidate(e) {
|
|
913
913
|
var s;
|
|
914
|
-
const t = (s =
|
|
914
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
915
915
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !
|
|
918
|
+
function jr(r) {
|
|
919
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !rt(r);
|
|
920
920
|
}
|
|
921
|
-
class
|
|
921
|
+
class xr {
|
|
922
922
|
constructor(e) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
923
|
+
u(this, "schemas", L([]));
|
|
924
|
+
u(this, "model", L({}));
|
|
925
|
+
u(this, "processorBySchemaType", {
|
|
926
926
|
item: this.runtimeItemProcessor.bind(this),
|
|
927
927
|
group: this.runtimeGroupProcessor.bind(this),
|
|
928
928
|
list: this.runtimeListProcessor.bind(this)
|
|
929
929
|
});
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
930
|
+
u(this, "formRef", L(null));
|
|
931
|
+
u(this, "hydrateEffect", new ee());
|
|
932
|
+
u(this, "native", D({}));
|
|
933
|
+
u(this, "grid", {});
|
|
934
|
+
u(this, "runtime", {});
|
|
935
|
+
u(this, "globalNativeFormOverride", D({
|
|
936
936
|
props: {
|
|
937
937
|
Form: {},
|
|
938
938
|
FormItem: {}
|
|
@@ -942,11 +942,12 @@ class Rr {
|
|
|
942
942
|
FormItem: {}
|
|
943
943
|
}
|
|
944
944
|
}));
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
this
|
|
945
|
+
u(this, "shared", D({}));
|
|
946
|
+
u(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
947
|
+
u(this, "specialFormIdPrefix", "");
|
|
948
|
+
this.setup = e, this.processor = new Er(this);
|
|
948
949
|
const t = this.setup(this);
|
|
949
|
-
this.ui = t.ui ??
|
|
950
|
+
this.ui = t.ui ?? c.presets.ui, this.runtimeAdapter = new wr(this.ui), this.specialFormIdPrefix = t.specialFormIdPrefix ?? "", Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), T(t.schemas) ? E(
|
|
950
951
|
// @ts-expect-error
|
|
951
952
|
() => t.schemas.value,
|
|
952
953
|
() => {
|
|
@@ -955,7 +956,7 @@ class Rr {
|
|
|
955
956
|
{
|
|
956
957
|
deep: !0
|
|
957
958
|
}
|
|
958
|
-
) :
|
|
959
|
+
) : U(t.schemas) ? E(() => t.schemas, () => {
|
|
959
960
|
this.processor.parseSchemas(t.schemas);
|
|
960
961
|
}, {
|
|
961
962
|
deep: !0
|
|
@@ -963,82 +964,77 @@ class Rr {
|
|
|
963
964
|
}
|
|
964
965
|
getRuntimeMeta() {
|
|
965
966
|
return {
|
|
966
|
-
model: M(
|
|
967
|
+
model: M(C(this.model.value)),
|
|
967
968
|
reactiveModel: this.model.value,
|
|
968
969
|
shared: this.shared,
|
|
969
970
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
970
971
|
share: (t) => {
|
|
971
972
|
S(() => {
|
|
972
973
|
Object.keys(t).forEach((i) => {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
}) :
|
|
976
|
-
|
|
977
|
-
}) : (
|
|
974
|
+
T(t[i]) ? K(() => {
|
|
975
|
+
y(this.shared, i, t[i].value), this.shareHistory.get(i) !== t[i].value && (this.shareHistory.set(i, t[i].value), this.processor.schemaEffect.triggerEffects());
|
|
976
|
+
}) : U(t[i]) ? K(() => {
|
|
977
|
+
y(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects());
|
|
978
|
+
}) : (y(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects()));
|
|
978
979
|
});
|
|
979
980
|
});
|
|
980
981
|
}
|
|
981
982
|
};
|
|
982
983
|
}
|
|
983
984
|
runtimeItemProcessor(e, t, i = this.model.value, s) {
|
|
984
|
-
var le, ue,
|
|
985
|
+
var le, ue, ce, fe, de, he, pe, me, ge, Pe, ve, be, ye, _e, Ce, Ie, Se, Fe, Oe, Ee, we, je, xe, Re, Me, $e;
|
|
985
986
|
const n = M(e.component);
|
|
986
987
|
if (!n)
|
|
987
988
|
return;
|
|
988
|
-
(ue = (le = e.native) == null ? void 0 : le.props) != null && ue.Form &&
|
|
989
|
-
const
|
|
989
|
+
(ue = (le = e.native) == null ? void 0 : le.props) != null && ue.Form && P(this.globalNativeFormOverride.props.Form, (fe = (ce = e.native) == null ? void 0 : ce.props) == null ? void 0 : fe.Form), (he = (de = e.native) == null ? void 0 : de.slots) != null && he.FormItem && P(this.globalNativeFormOverride.slots.FormItem, (me = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : me.FormItem);
|
|
990
|
+
const o = P(C((Pe = (ge = this.native) == null ? void 0 : ge.slots) == null ? void 0 : Pe.FormItem) ?? {}, (be = (ve = e.native) == null ? void 0 : ve.slots) == null ? void 0 : be.FormItem), l = {
|
|
990
991
|
display: "grid",
|
|
991
992
|
gridColumn: "1 / -1",
|
|
992
993
|
...e.grid
|
|
993
994
|
};
|
|
994
995
|
let f = {
|
|
995
|
-
...(
|
|
996
|
+
...(_e = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : _e.FormItem
|
|
996
997
|
};
|
|
997
|
-
G((Se = (
|
|
998
|
-
...(
|
|
999
|
-
tooltip: (je = (we = (
|
|
998
|
+
G((Se = (Ie = (Ce = e.native) == null ? void 0 : Ce.props) == null ? void 0 : Ie.FormItem) == null ? void 0 : Se.tooltip) && (f = {
|
|
999
|
+
...(Oe = (Fe = e.native) == null ? void 0 : Fe.props) == null ? void 0 : Oe.FormItem,
|
|
1000
|
+
tooltip: (je = (we = (Ee = e.native) == null ? void 0 : Ee.props) == null ? void 0 : we.FormItem) == null ? void 0 : je.tooltip()
|
|
1000
1001
|
});
|
|
1001
|
-
const
|
|
1002
|
+
const d = P(C((Re = (xe = this.native) == null ? void 0 : xe.props) == null ? void 0 : Re.FormItem) ?? {}, f), h = this.runtimeAdapter.getRuntimeField({
|
|
1002
1003
|
schema: e,
|
|
1003
1004
|
parentSchema: s,
|
|
1004
1005
|
index: t
|
|
1005
|
-
}), p = n.name,
|
|
1006
|
-
let g = G(e.placeholder) ? e.placeholder() : e.placeholder,
|
|
1007
|
-
|
|
1008
|
-
let F = (G(e.label) ? e.label() : e.label) ?? "",
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
o.isUndefined(p) ? g = `${U}${F}` : /* @ts-expect-error */ w[p.toLowerCase()] ? (U = // @ts-expect-error
|
|
1012
|
-
w[p.toLowerCase()], g = `${U}${F}`) : (Object.keys(w).forEach((Ve) => {
|
|
1013
|
-
p.toLowerCase().includes(Ve.toLowerCase()) && (U = w[Ve]);
|
|
1014
|
-
}), g = `${U}${F}`);
|
|
1015
|
-
}
|
|
1016
|
-
const Xe = this.runtimeAdapter.getRuntimeRequired({
|
|
1006
|
+
}), p = n.name, b = e.componentProps ?? {}, H = I.placeholderPresetByComponentName;
|
|
1007
|
+
let g = G(e.placeholder) ? e.placeholder() : e.placeholder, v = e.show;
|
|
1008
|
+
v === void 0 && (v = !0);
|
|
1009
|
+
let F = (G(e.label) ? e.label() : e.label) ?? "", O;
|
|
1010
|
+
e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !a.isUndefined(t) && !a.isObjectEmpty(O) && (F = k((Me = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : Me.call(O, e.label ?? "", t + 1), "")), F = c.translateLabel(F), a.isString(g) && (g = c.translateMessage(g)), g || (g = c.buildPlaceholder(p, F, H));
|
|
1011
|
+
const We = this.runtimeAdapter.getRuntimeRequired({
|
|
1017
1012
|
...e,
|
|
1018
1013
|
label: F
|
|
1019
|
-
}),
|
|
1014
|
+
}), Xe = x.getItemContainer(this), Ye = x.getFormItemContainer(this), Ze = this, Je = e.componentSlots, _ = ($e = c.presets.uiPresets[this.ui]) == null ? void 0 : $e.display;
|
|
1020
1015
|
let Z;
|
|
1021
|
-
return !
|
|
1022
|
-
style:
|
|
1023
|
-
}, [m(
|
|
1024
|
-
show:
|
|
1025
|
-
schema: e
|
|
1016
|
+
return !a.isUndefined(_ == null ? void 0 : _.labelPrefix) && !a.isNull(_ == null ? void 0 : _.labelPrefix) ? Z = `${F}${_ == null ? void 0 : _.labelPrefix}` : Z = `${F}:`, m("div", {
|
|
1017
|
+
style: l
|
|
1018
|
+
}, [m(Xe, {
|
|
1019
|
+
show: v,
|
|
1020
|
+
schema: e,
|
|
1021
|
+
id: t ? `${this.specialFormIdPrefix}${e.field}-${t}` : `${this.specialFormIdPrefix}${e.field}`
|
|
1026
1022
|
}, {
|
|
1027
1023
|
default() {
|
|
1028
|
-
return
|
|
1024
|
+
return v && m(Ye, q(d, {
|
|
1029
1025
|
label: `${F ? Z : ""}`
|
|
1030
|
-
}, h,
|
|
1026
|
+
}, h, We), {
|
|
1031
1027
|
default() {
|
|
1032
|
-
return
|
|
1028
|
+
return Ze.runtimeAdapter.formComponentRenderer({
|
|
1033
1029
|
Component: n,
|
|
1034
1030
|
schema: e,
|
|
1035
1031
|
baseModel: i,
|
|
1036
1032
|
placeholder: g,
|
|
1037
|
-
componentSlots:
|
|
1038
|
-
props:
|
|
1033
|
+
componentSlots: Je,
|
|
1034
|
+
props: b
|
|
1039
1035
|
});
|
|
1040
1036
|
},
|
|
1041
|
-
...
|
|
1037
|
+
...o
|
|
1042
1038
|
});
|
|
1043
1039
|
}
|
|
1044
1040
|
})]);
|
|
@@ -1049,19 +1045,19 @@ class Rr {
|
|
|
1049
1045
|
display: "grid",
|
|
1050
1046
|
gridColumn: "1 / -1",
|
|
1051
1047
|
...e.grid
|
|
1052
|
-
}, s =
|
|
1048
|
+
}, s = x.getGroupContainer(this);
|
|
1053
1049
|
let n = e.show;
|
|
1054
1050
|
return n === void 0 && (n = !0), m("div", {
|
|
1055
1051
|
style: i
|
|
1056
1052
|
}, [n && m(s, {
|
|
1057
1053
|
schema: e
|
|
1058
|
-
},
|
|
1054
|
+
}, jr(t = e.children.map((o) => this.runtimeItemProcessor(o))) ? t : {
|
|
1059
1055
|
default: () => [t]
|
|
1060
1056
|
})]);
|
|
1061
1057
|
}
|
|
1062
1058
|
addListItem(e) {
|
|
1063
1059
|
var t;
|
|
1064
|
-
(t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(
|
|
1060
|
+
(t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(C(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1065
1061
|
}
|
|
1066
1062
|
deleteListItem(e, t) {
|
|
1067
1063
|
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1075,32 +1071,32 @@ class Rr {
|
|
|
1075
1071
|
i.model.value[e.field] || (i.model.value[e.field] = [{}]);
|
|
1076
1072
|
let s = e.show;
|
|
1077
1073
|
s === void 0 && (s = !0);
|
|
1078
|
-
const n =
|
|
1074
|
+
const n = x.getListContainer(this), o = x.getListItemContainer(this);
|
|
1079
1075
|
return m("div", {
|
|
1080
1076
|
style: t
|
|
1081
1077
|
}, [s && m(n, {
|
|
1082
1078
|
schema: e
|
|
1083
1079
|
}, {
|
|
1084
1080
|
default() {
|
|
1085
|
-
return i.model.value[e.field].map((
|
|
1081
|
+
return i.model.value[e.field].map((l, f) => m(o, null, {
|
|
1086
1082
|
default() {
|
|
1087
|
-
return e.children.map((
|
|
1083
|
+
return e.children.map((d) => i.runtimeItemProcessor(d, f, l, e));
|
|
1088
1084
|
},
|
|
1089
1085
|
delete({
|
|
1090
|
-
container:
|
|
1086
|
+
container: d
|
|
1091
1087
|
} = {}) {
|
|
1092
1088
|
var p;
|
|
1093
|
-
const h =
|
|
1094
|
-
return
|
|
1089
|
+
const h = d ?? m("button", null, null);
|
|
1090
|
+
return ke(m(h, {
|
|
1095
1091
|
onClick: () => i.deleteListItem(e, f)
|
|
1096
|
-
}, null), [[
|
|
1092
|
+
}, null), [[et, ((p = i.model.value[e.field]) == null ? void 0 : p.length) > 1]]);
|
|
1097
1093
|
}
|
|
1098
1094
|
}));
|
|
1099
1095
|
},
|
|
1100
1096
|
add({
|
|
1101
|
-
container:
|
|
1097
|
+
container: l
|
|
1102
1098
|
} = {}) {
|
|
1103
|
-
const f =
|
|
1099
|
+
const f = l ?? m("button", null, [tt("添加")]);
|
|
1104
1100
|
return m(f, {
|
|
1105
1101
|
onClick: () => i.addListItem(e)
|
|
1106
1102
|
}, null);
|
|
@@ -1111,17 +1107,17 @@ class Rr {
|
|
|
1111
1107
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
1112
1108
|
}
|
|
1113
1109
|
exec() {
|
|
1114
|
-
var
|
|
1110
|
+
var l, f, d, h;
|
|
1115
1111
|
const e = {
|
|
1116
1112
|
display: "grid",
|
|
1117
1113
|
gridColumn: "1 / -1",
|
|
1118
1114
|
gridAutoColumns: "1fr",
|
|
1119
1115
|
...this.grid
|
|
1120
|
-
}, t = this, i =
|
|
1121
|
-
return m(n,
|
|
1116
|
+
}, t = this, i = P(this.globalNativeFormOverride.props.Form, C((f = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : f.Form) ?? {}), s = P(this.globalNativeFormOverride.slots.Form, C((h = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : h.Form) ?? {}), n = x.getFormContainer(this), o = this.runtimeAdapter.getFormModelPropName();
|
|
1117
|
+
return m(n, q(i, {
|
|
1122
1118
|
ref: this.formRef
|
|
1123
1119
|
}, {
|
|
1124
|
-
[
|
|
1120
|
+
[o]: this.model.value
|
|
1125
1121
|
}), {
|
|
1126
1122
|
default() {
|
|
1127
1123
|
return m("div", {
|
|
@@ -1132,7 +1128,13 @@ class Rr {
|
|
|
1132
1128
|
});
|
|
1133
1129
|
}
|
|
1134
1130
|
}
|
|
1135
|
-
class
|
|
1131
|
+
class c {
|
|
1132
|
+
static setPresets(e) {
|
|
1133
|
+
var i, s;
|
|
1134
|
+
this.presets = e;
|
|
1135
|
+
const t = (s = (i = e.i18n) == null ? void 0 : i.localeRef) == null ? void 0 : s.value;
|
|
1136
|
+
t && this.ensureLocalePackLoaded(t);
|
|
1137
|
+
}
|
|
1136
1138
|
static getPreset(e) {
|
|
1137
1139
|
var t, i, s;
|
|
1138
1140
|
return (i = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && i.extend ? this.presets.uiPresets[(s = this.presets.uiPresets[e]) == null ? void 0 : s.extend] : this.presets.uiPresets[e];
|
|
@@ -1141,8 +1143,85 @@ class d {
|
|
|
1141
1143
|
var t, i, s;
|
|
1142
1144
|
return (i = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && i.extend ? (s = this.presets.uiPresets[e]) == null ? void 0 : s.extend : e;
|
|
1143
1145
|
}
|
|
1146
|
+
static getI18nConfig() {
|
|
1147
|
+
var e;
|
|
1148
|
+
return (e = this.presets) == null ? void 0 : e.i18n;
|
|
1149
|
+
}
|
|
1150
|
+
static getCurrentLocale() {
|
|
1151
|
+
var e, t;
|
|
1152
|
+
return ((t = (e = this.getI18nConfig()) == null ? void 0 : e.localeRef) == null ? void 0 : t.value) ?? "";
|
|
1153
|
+
}
|
|
1154
|
+
static getLocalePack(e = this.getCurrentLocale()) {
|
|
1155
|
+
var i;
|
|
1156
|
+
const t = this.getI18nConfig();
|
|
1157
|
+
if ((i = t == null ? void 0 : t.versionRef) == null || i.value, this.internalI18nVersion.value, !!e)
|
|
1158
|
+
return this.ensureLocalePackLoaded(e), this.localePackCache[e];
|
|
1159
|
+
}
|
|
1160
|
+
static async ensureLocalePackLoaded(e = this.getCurrentLocale()) {
|
|
1161
|
+
const t = this.getI18nConfig();
|
|
1162
|
+
if (!(t != null && t.loadLocalePack) || !e)
|
|
1163
|
+
return this.localePackCache[e];
|
|
1164
|
+
if (this.localePackCache[e])
|
|
1165
|
+
return this.localePackCache[e];
|
|
1166
|
+
const i = this.localePackPromiseCache.get(e);
|
|
1167
|
+
if (i)
|
|
1168
|
+
return i;
|
|
1169
|
+
const s = t.loadLocalePack(e).then((n) => (n && (this.localePackCache[e] = n), this.localePackCache[e])).catch(() => {
|
|
1170
|
+
}).finally(() => {
|
|
1171
|
+
this.localePackPromiseCache.delete(e), this.internalI18nVersion.value += 1;
|
|
1172
|
+
});
|
|
1173
|
+
return this.localePackPromiseCache.set(e, s), s;
|
|
1174
|
+
}
|
|
1175
|
+
static formatTemplate(e, t) {
|
|
1176
|
+
return Object.entries(t).reduce((i, [s, n]) => i.split(`{${s}}`).join(`${n ?? ""}`), e);
|
|
1177
|
+
}
|
|
1178
|
+
static translateMessage(e) {
|
|
1179
|
+
var i;
|
|
1180
|
+
if (!e)
|
|
1181
|
+
return e ?? "";
|
|
1182
|
+
const t = this.getLocalePack();
|
|
1183
|
+
return ((i = t == null ? void 0 : t.messages) == null ? void 0 : i[e]) ?? e;
|
|
1184
|
+
}
|
|
1185
|
+
static translateLabel(e) {
|
|
1186
|
+
var s, n, o;
|
|
1187
|
+
if (!e)
|
|
1188
|
+
return e ?? "";
|
|
1189
|
+
const t = this.getCurrentLocale(), i = this.getLocalePack(t);
|
|
1190
|
+
return ((n = (s = this.getI18nConfig()) == null ? void 0 : s.translateLabel) == null ? void 0 : n.call(s, e, {
|
|
1191
|
+
locale: t,
|
|
1192
|
+
pack: i
|
|
1193
|
+
})) ?? ((o = i == null ? void 0 : i.messages) == null ? void 0 : o[e]) ?? e;
|
|
1194
|
+
}
|
|
1195
|
+
static buildRequiredMessage(e) {
|
|
1196
|
+
var n;
|
|
1197
|
+
const t = this.translateLabel(e), i = this.getLocalePack(), s = (n = i == null ? void 0 : i.templates) == null ? void 0 : n.required;
|
|
1198
|
+
return s ? this.formatTemplate(s, {
|
|
1199
|
+
label: t
|
|
1200
|
+
}) : `${t}是必填项`;
|
|
1201
|
+
}
|
|
1202
|
+
static buildPlaceholder(e, t, i) {
|
|
1203
|
+
const s = this.translateLabel(t), n = this.getLocalePack(), o = (n == null ? void 0 : n.placeholderPrefixByComponentName) ?? i ?? {};
|
|
1204
|
+
let l = this.translateMessage("请输入") || "请输入";
|
|
1205
|
+
if (!e)
|
|
1206
|
+
return this.applyPlaceholderTemplate(l, s);
|
|
1207
|
+
const f = e.toLowerCase();
|
|
1208
|
+
return o[f] ? (l = o[f], this.applyPlaceholderTemplate(l, s)) : (Object.keys(o).forEach((d) => {
|
|
1209
|
+
f.includes(d.toLowerCase()) && (l = o[d]);
|
|
1210
|
+
}), this.applyPlaceholderTemplate(l, s));
|
|
1211
|
+
}
|
|
1212
|
+
static applyPlaceholderTemplate(e, t) {
|
|
1213
|
+
var n;
|
|
1214
|
+
const i = this.getLocalePack(), s = (n = i == null ? void 0 : i.templates) == null ? void 0 : n.placeholder;
|
|
1215
|
+
return s ? this.formatTemplate(s, {
|
|
1216
|
+
prefix: e,
|
|
1217
|
+
label: t
|
|
1218
|
+
}) : `${e}${t}`;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
u(c, "presets"), u(c, "localePackCache", D({})), u(c, "localePackPromiseCache", /* @__PURE__ */ new Map()), u(c, "internalI18nVersion", L(0));
|
|
1222
|
+
function Q(r) {
|
|
1223
|
+
return a.isString(r.required) ? c.translateMessage(r.required) : a.isFunction(r.required) ? r.required() : c.buildRequiredMessage(r.label);
|
|
1144
1224
|
}
|
|
1145
|
-
l(d, "presets");
|
|
1146
1225
|
function A({
|
|
1147
1226
|
parentSchema: r,
|
|
1148
1227
|
schema: e,
|
|
@@ -1150,26 +1229,26 @@ function A({
|
|
|
1150
1229
|
}) {
|
|
1151
1230
|
return r ? `${r.field}.${t}.${e.field}` : e.field;
|
|
1152
1231
|
}
|
|
1153
|
-
const
|
|
1232
|
+
const Rr = {
|
|
1154
1233
|
ArcoVue: {
|
|
1155
1234
|
getRuntimeField(r) {
|
|
1156
1235
|
const e = A(r);
|
|
1157
|
-
return
|
|
1236
|
+
return a.isFunction(e) ? {
|
|
1158
1237
|
field: e()
|
|
1159
1238
|
} : {
|
|
1160
1239
|
field: e
|
|
1161
1240
|
};
|
|
1162
1241
|
},
|
|
1163
1242
|
getRuntimeRequired(r) {
|
|
1164
|
-
let e =
|
|
1243
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1165
1244
|
if (r.required)
|
|
1166
|
-
if (
|
|
1245
|
+
if (e = Q(r), !r.rules)
|
|
1167
1246
|
r.rules = [], r.rules.push({
|
|
1168
1247
|
required: !0,
|
|
1169
1248
|
message: e
|
|
1170
1249
|
});
|
|
1171
1250
|
else {
|
|
1172
|
-
const t = r.rules.findIndex((i) => !
|
|
1251
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1173
1252
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1174
1253
|
required: !0,
|
|
1175
1254
|
message: e
|
|
@@ -1190,11 +1269,11 @@ const $r = {
|
|
|
1190
1269
|
componentSlots: s,
|
|
1191
1270
|
props: n
|
|
1192
1271
|
}) {
|
|
1193
|
-
let
|
|
1194
|
-
return
|
|
1195
|
-
modelValue:
|
|
1196
|
-
"onUpdate:modelValue": (
|
|
1197
|
-
|
|
1272
|
+
let o;
|
|
1273
|
+
return a.isFunction(t.field) ? o = B(e, t.field()) : o = e[t.field], m(r, q({
|
|
1274
|
+
modelValue: o,
|
|
1275
|
+
"onUpdate:modelValue": (l) => {
|
|
1276
|
+
a.isFunction(t.field) ? y(e, t.field(), l) : e[t.field] = l;
|
|
1198
1277
|
},
|
|
1199
1278
|
placeholder: i
|
|
1200
1279
|
}, n), {
|
|
@@ -1214,22 +1293,22 @@ const $r = {
|
|
|
1214
1293
|
NutUI: {
|
|
1215
1294
|
getRuntimeField(r) {
|
|
1216
1295
|
const e = A(r);
|
|
1217
|
-
return
|
|
1296
|
+
return a.isFunction(e) ? {
|
|
1218
1297
|
prop: e()
|
|
1219
1298
|
} : {
|
|
1220
1299
|
prop: e
|
|
1221
1300
|
};
|
|
1222
1301
|
},
|
|
1223
1302
|
getRuntimeRequired(r) {
|
|
1224
|
-
let e =
|
|
1303
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1225
1304
|
if (r.required)
|
|
1226
|
-
if (
|
|
1305
|
+
if (e = Q(r), !r.rules)
|
|
1227
1306
|
r.rules = [], r.rules.push({
|
|
1228
1307
|
required: !0,
|
|
1229
1308
|
message: e
|
|
1230
1309
|
});
|
|
1231
1310
|
else {
|
|
1232
|
-
const t = r.rules.findIndex((i) => !
|
|
1311
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1233
1312
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1234
1313
|
required: !0,
|
|
1235
1314
|
message: e
|
|
@@ -1251,11 +1330,11 @@ const $r = {
|
|
|
1251
1330
|
componentSlots: s,
|
|
1252
1331
|
props: n
|
|
1253
1332
|
}) {
|
|
1254
|
-
let
|
|
1255
|
-
return
|
|
1256
|
-
modelValue:
|
|
1257
|
-
"onUpdate:modelValue": (
|
|
1258
|
-
|
|
1333
|
+
let o;
|
|
1334
|
+
return a.isFunction(t.field) ? o = B(e, t.field()) : o = e[t.field], m(r, q({
|
|
1335
|
+
modelValue: o,
|
|
1336
|
+
"onUpdate:modelValue": (l) => {
|
|
1337
|
+
a.isFunction(t.field) ? y(e, t.field(), l) : e[t.field] = l;
|
|
1259
1338
|
},
|
|
1260
1339
|
placeholder: i
|
|
1261
1340
|
}, n), {
|
|
@@ -1280,23 +1359,23 @@ const $r = {
|
|
|
1280
1359
|
NaiveUI: {
|
|
1281
1360
|
getRuntimeField(r) {
|
|
1282
1361
|
const e = A(r);
|
|
1283
|
-
return
|
|
1362
|
+
return a.isFunction(e) ? {
|
|
1284
1363
|
path: e()
|
|
1285
1364
|
} : {
|
|
1286
1365
|
path: e
|
|
1287
1366
|
};
|
|
1288
1367
|
},
|
|
1289
1368
|
getRuntimeRequired(r) {
|
|
1290
|
-
let e =
|
|
1369
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1291
1370
|
if (r.required)
|
|
1292
|
-
if (
|
|
1371
|
+
if (e = Q(r), !r.rules)
|
|
1293
1372
|
r.rules = [], r.rules.push({
|
|
1294
1373
|
required: !0,
|
|
1295
1374
|
message: e,
|
|
1296
1375
|
trigger: ["input", "blur"]
|
|
1297
1376
|
});
|
|
1298
1377
|
else {
|
|
1299
|
-
const t = r.rules.findIndex((i) => !
|
|
1378
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1300
1379
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1301
1380
|
required: !0,
|
|
1302
1381
|
message: e,
|
|
@@ -1318,11 +1397,11 @@ const $r = {
|
|
|
1318
1397
|
componentSlots: s,
|
|
1319
1398
|
props: n
|
|
1320
1399
|
}) {
|
|
1321
|
-
let
|
|
1322
|
-
return
|
|
1323
|
-
value:
|
|
1324
|
-
"onUpdate:value": (
|
|
1325
|
-
|
|
1400
|
+
let o;
|
|
1401
|
+
return a.isFunction(t.field) ? o = B(e, t.field()) : o = e[t.field], m(r, q({
|
|
1402
|
+
value: o,
|
|
1403
|
+
"onUpdate:value": (l) => {
|
|
1404
|
+
a.isFunction(t.field) ? y(e, t.field(), l) : e[t.field] = l;
|
|
1326
1405
|
},
|
|
1327
1406
|
placeholder: i
|
|
1328
1407
|
}, n), {
|
|
@@ -1339,7 +1418,7 @@ const $r = {
|
|
|
1339
1418
|
(t = (e = r.formRef.value) == null ? void 0 : e.restoreValidation) == null || t.call(e);
|
|
1340
1419
|
}
|
|
1341
1420
|
}
|
|
1342
|
-
},
|
|
1421
|
+
}, R = class R {
|
|
1343
1422
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
1344
1423
|
const e = {
|
|
1345
1424
|
请选择: ["select", "tree"],
|
|
@@ -1352,7 +1431,7 @@ const $r = {
|
|
|
1352
1431
|
return t;
|
|
1353
1432
|
}
|
|
1354
1433
|
};
|
|
1355
|
-
|
|
1434
|
+
u(R, "schemaPreset", {
|
|
1356
1435
|
type: {
|
|
1357
1436
|
defaultValue: "item"
|
|
1358
1437
|
},
|
|
@@ -1398,19 +1477,19 @@ l($, "schemaPreset", {
|
|
|
1398
1477
|
runtime: {
|
|
1399
1478
|
default: void 0
|
|
1400
1479
|
}
|
|
1401
|
-
}),
|
|
1480
|
+
}), u(R, "componentPropsPreset", {
|
|
1402
1481
|
options: {
|
|
1403
1482
|
defaultValue: []
|
|
1404
1483
|
}
|
|
1405
1484
|
}), // 基于基本功能提出基本预设
|
|
1406
|
-
|
|
1407
|
-
let te =
|
|
1408
|
-
const
|
|
1485
|
+
u(R, "placeholderPresetByComponentName", R.getPlaceholderPrefixPresetByComponentName());
|
|
1486
|
+
let te = R;
|
|
1487
|
+
const I = {
|
|
1409
1488
|
...te,
|
|
1410
1489
|
adapters: {
|
|
1411
|
-
|
|
1490
|
+
...Rr
|
|
1412
1491
|
}
|
|
1413
|
-
},
|
|
1492
|
+
}, Vr = /* @__PURE__ */ it({
|
|
1414
1493
|
props: {
|
|
1415
1494
|
setup: {
|
|
1416
1495
|
type: Function,
|
|
@@ -1418,11 +1497,12 @@ const C = {
|
|
|
1418
1497
|
}
|
|
1419
1498
|
},
|
|
1420
1499
|
setup(r) {
|
|
1421
|
-
const e = new
|
|
1500
|
+
const e = new xr(r.setup);
|
|
1422
1501
|
return () => e.exec();
|
|
1423
1502
|
}
|
|
1424
1503
|
});
|
|
1425
|
-
function
|
|
1504
|
+
function Nr(r) {
|
|
1505
|
+
console.log("new ffffffffffff========123===");
|
|
1426
1506
|
const e = new Or(r);
|
|
1427
1507
|
return [
|
|
1428
1508
|
e.setup.bind(e),
|
|
@@ -1435,8 +1515,8 @@ function Ur(r) {
|
|
|
1435
1515
|
}
|
|
1436
1516
|
];
|
|
1437
1517
|
}
|
|
1438
|
-
function
|
|
1439
|
-
|
|
1518
|
+
function Lr(r) {
|
|
1519
|
+
c.setPresets(r);
|
|
1440
1520
|
}
|
|
1441
1521
|
function ae(r, e) {
|
|
1442
1522
|
return e === "native" && Object.defineProperty(r, "name", {
|
|
@@ -1450,16 +1530,16 @@ function ae(r, e) {
|
|
|
1450
1530
|
writable: !0
|
|
1451
1531
|
}), r;
|
|
1452
1532
|
}
|
|
1453
|
-
function
|
|
1533
|
+
function qr(r) {
|
|
1454
1534
|
return ae(r, "native");
|
|
1455
1535
|
}
|
|
1456
|
-
function
|
|
1536
|
+
function Tr(r) {
|
|
1457
1537
|
return r.__proform_raw_object = !0, r;
|
|
1458
1538
|
}
|
|
1459
|
-
function
|
|
1539
|
+
function Ur(r) {
|
|
1460
1540
|
return ae(r, "onetime");
|
|
1461
1541
|
}
|
|
1462
|
-
function
|
|
1542
|
+
function zr(r) {
|
|
1463
1543
|
function e() {
|
|
1464
1544
|
return r;
|
|
1465
1545
|
}
|
|
@@ -1469,12 +1549,12 @@ function Hr(r) {
|
|
|
1469
1549
|
);
|
|
1470
1550
|
}
|
|
1471
1551
|
export {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1552
|
+
Vr as ProForm,
|
|
1553
|
+
qr as markNativeFunction,
|
|
1554
|
+
Tr as markNativeObject,
|
|
1555
|
+
Ur as markOnetimeFunction,
|
|
1556
|
+
zr as markStructuredPathParsing,
|
|
1557
|
+
Nr as useForm,
|
|
1558
|
+
Lr as useFormPresetConfigurer,
|
|
1479
1559
|
ae as useModifiers
|
|
1480
1560
|
};
|