@harbor-design/proform 1.4.20 → 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 +466 -388
- package/dist/types/src/services/Context/index.d.ts +15 -1
- package/dist/types/src/types/contextTypes.d.ts +19 -0
- package/package.json +40 -40
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 ? ht :
|
|
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
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
|
|
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
|
|
646
|
-
let g =
|
|
647
|
-
if (
|
|
648
|
-
const
|
|
649
|
-
|
|
645
|
+
const p = s.parseStable(l.stable), b = i == null ? void 0 : i.index, H = i == null ? void 0 : i.key;
|
|
646
|
+
let g = p;
|
|
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,25 +701,25 @@ 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
|
-
(
|
|
713
|
-
if (!
|
|
714
|
-
return f(
|
|
715
|
-
this.defaultValueInprogressMap.set(t[s],
|
|
712
|
+
(h) => {
|
|
713
|
+
if (!h)
|
|
714
|
+
return f(h);
|
|
715
|
+
this.defaultValueInprogressMap.set(t[s], h), !a.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
716
716
|
this.defaultValueInprogressMap.values()
|
|
717
|
-
).every((
|
|
718
|
-
var
|
|
719
|
-
return !((
|
|
720
|
-
}) ? (f(
|
|
721
|
-
|
|
722
|
-
})) : f(
|
|
717
|
+
).every((p) => {
|
|
718
|
+
var b;
|
|
719
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
720
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
721
|
+
d();
|
|
722
|
+
})) : f(h);
|
|
723
723
|
},
|
|
724
724
|
{
|
|
725
725
|
rootIndex: e.index,
|
|
@@ -727,15 +727,15 @@ class wr {
|
|
|
727
727
|
}
|
|
728
728
|
) : this.fieldParser(
|
|
729
729
|
t[s],
|
|
730
|
-
(
|
|
731
|
-
this.defaultValueInprogressMap.set(t[s],
|
|
730
|
+
(h) => {
|
|
731
|
+
this.defaultValueInprogressMap.set(t[s], h), !a.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
732
732
|
this.defaultValueInprogressMap.values()
|
|
733
|
-
).every((
|
|
734
|
-
var
|
|
735
|
-
return !((
|
|
736
|
-
}) ? (f(
|
|
737
|
-
|
|
738
|
-
})) : f(
|
|
733
|
+
).every((p) => {
|
|
734
|
+
var b;
|
|
735
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
736
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
737
|
+
d();
|
|
738
|
+
})) : f(h);
|
|
739
739
|
},
|
|
740
740
|
{
|
|
741
741
|
rootIndex: e.index,
|
|
@@ -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,12 +942,12 @@ class $r {
|
|
|
942
942
|
FormItem: {}
|
|
943
943
|
}
|
|
944
944
|
}));
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
this.setup = e, this.processor = new
|
|
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);
|
|
949
949
|
const t = this.setup(this);
|
|
950
|
-
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(
|
|
951
951
|
// @ts-expect-error
|
|
952
952
|
() => t.schemas.value,
|
|
953
953
|
() => {
|
|
@@ -956,7 +956,7 @@ class $r {
|
|
|
956
956
|
{
|
|
957
957
|
deep: !0
|
|
958
958
|
}
|
|
959
|
-
) :
|
|
959
|
+
) : U(t.schemas) ? E(() => t.schemas, () => {
|
|
960
960
|
this.processor.parseSchemas(t.schemas);
|
|
961
961
|
}, {
|
|
962
962
|
deep: !0
|
|
@@ -964,83 +964,77 @@ class $r {
|
|
|
964
964
|
}
|
|
965
965
|
getRuntimeMeta() {
|
|
966
966
|
return {
|
|
967
|
-
model: M(
|
|
967
|
+
model: M(C(this.model.value)),
|
|
968
968
|
reactiveModel: this.model.value,
|
|
969
969
|
shared: this.shared,
|
|
970
970
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
971
971
|
share: (t) => {
|
|
972
972
|
S(() => {
|
|
973
973
|
Object.keys(t).forEach((i) => {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}) :
|
|
977
|
-
|
|
978
|
-
}) : (
|
|
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()));
|
|
979
979
|
});
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
};
|
|
983
983
|
}
|
|
984
984
|
runtimeItemProcessor(e, t, i = this.model.value, s) {
|
|
985
|
-
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;
|
|
986
986
|
const n = M(e.component);
|
|
987
987
|
if (!n)
|
|
988
988
|
return;
|
|
989
|
-
(ue = (le = e.native) == null ? void 0 : le.props) != null && ue.Form &&
|
|
990
|
-
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 = {
|
|
991
991
|
display: "grid",
|
|
992
992
|
gridColumn: "1 / -1",
|
|
993
993
|
...e.grid
|
|
994
994
|
};
|
|
995
995
|
let f = {
|
|
996
|
-
...(_e = (
|
|
996
|
+
...(_e = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : _e.FormItem
|
|
997
997
|
};
|
|
998
|
-
G((Se = (
|
|
999
|
-
...(
|
|
1000
|
-
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()
|
|
1001
1001
|
});
|
|
1002
|
-
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({
|
|
1003
1003
|
schema: e,
|
|
1004
1004
|
parentSchema: s,
|
|
1005
1005
|
index: t
|
|
1006
|
-
}),
|
|
1007
|
-
let g = G(e.placeholder) ? e.placeholder() : e.placeholder,
|
|
1008
|
-
|
|
1009
|
-
let F = (G(e.label) ? e.label() : e.label) ?? "",
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
o.isUndefined(h) ? g = `${U}${F}` : /* @ts-expect-error */ w[h.toLowerCase()] ? (U = // @ts-expect-error
|
|
1013
|
-
w[h.toLowerCase()], g = `${U}${F}`) : (Object.keys(w).forEach((Ve) => {
|
|
1014
|
-
h.toLowerCase().includes(Ve.toLowerCase()) && (U = w[Ve]);
|
|
1015
|
-
}), g = `${U}${F}`);
|
|
1016
|
-
}
|
|
1017
|
-
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({
|
|
1018
1012
|
...e,
|
|
1019
1013
|
label: F
|
|
1020
|
-
}),
|
|
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;
|
|
1021
1015
|
let Z;
|
|
1022
|
-
return !
|
|
1023
|
-
style:
|
|
1024
|
-
}, [m(
|
|
1025
|
-
show:
|
|
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,
|
|
1026
1020
|
schema: e,
|
|
1027
1021
|
id: t ? `${this.specialFormIdPrefix}${e.field}-${t}` : `${this.specialFormIdPrefix}${e.field}`
|
|
1028
1022
|
}, {
|
|
1029
1023
|
default() {
|
|
1030
|
-
return
|
|
1024
|
+
return v && m(Ye, q(d, {
|
|
1031
1025
|
label: `${F ? Z : ""}`
|
|
1032
|
-
},
|
|
1026
|
+
}, h, We), {
|
|
1033
1027
|
default() {
|
|
1034
|
-
return
|
|
1028
|
+
return Ze.runtimeAdapter.formComponentRenderer({
|
|
1035
1029
|
Component: n,
|
|
1036
1030
|
schema: e,
|
|
1037
1031
|
baseModel: i,
|
|
1038
1032
|
placeholder: g,
|
|
1039
|
-
componentSlots:
|
|
1040
|
-
props:
|
|
1033
|
+
componentSlots: Je,
|
|
1034
|
+
props: b
|
|
1041
1035
|
});
|
|
1042
1036
|
},
|
|
1043
|
-
...
|
|
1037
|
+
...o
|
|
1044
1038
|
});
|
|
1045
1039
|
}
|
|
1046
1040
|
})]);
|
|
@@ -1051,19 +1045,19 @@ class $r {
|
|
|
1051
1045
|
display: "grid",
|
|
1052
1046
|
gridColumn: "1 / -1",
|
|
1053
1047
|
...e.grid
|
|
1054
|
-
}, s =
|
|
1048
|
+
}, s = x.getGroupContainer(this);
|
|
1055
1049
|
let n = e.show;
|
|
1056
1050
|
return n === void 0 && (n = !0), m("div", {
|
|
1057
1051
|
style: i
|
|
1058
1052
|
}, [n && m(s, {
|
|
1059
1053
|
schema: e
|
|
1060
|
-
},
|
|
1054
|
+
}, jr(t = e.children.map((o) => this.runtimeItemProcessor(o))) ? t : {
|
|
1061
1055
|
default: () => [t]
|
|
1062
1056
|
})]);
|
|
1063
1057
|
}
|
|
1064
1058
|
addListItem(e) {
|
|
1065
1059
|
var t;
|
|
1066
|
-
(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);
|
|
1067
1061
|
}
|
|
1068
1062
|
deleteListItem(e, t) {
|
|
1069
1063
|
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1077,32 +1071,32 @@ class $r {
|
|
|
1077
1071
|
i.model.value[e.field] || (i.model.value[e.field] = [{}]);
|
|
1078
1072
|
let s = e.show;
|
|
1079
1073
|
s === void 0 && (s = !0);
|
|
1080
|
-
const n =
|
|
1074
|
+
const n = x.getListContainer(this), o = x.getListItemContainer(this);
|
|
1081
1075
|
return m("div", {
|
|
1082
1076
|
style: t
|
|
1083
1077
|
}, [s && m(n, {
|
|
1084
1078
|
schema: e
|
|
1085
1079
|
}, {
|
|
1086
1080
|
default() {
|
|
1087
|
-
return i.model.value[e.field].map((
|
|
1081
|
+
return i.model.value[e.field].map((l, f) => m(o, null, {
|
|
1088
1082
|
default() {
|
|
1089
|
-
return e.children.map((
|
|
1083
|
+
return e.children.map((d) => i.runtimeItemProcessor(d, f, l, e));
|
|
1090
1084
|
},
|
|
1091
1085
|
delete({
|
|
1092
|
-
container:
|
|
1086
|
+
container: d
|
|
1093
1087
|
} = {}) {
|
|
1094
|
-
var
|
|
1095
|
-
const
|
|
1096
|
-
return
|
|
1088
|
+
var p;
|
|
1089
|
+
const h = d ?? m("button", null, null);
|
|
1090
|
+
return ke(m(h, {
|
|
1097
1091
|
onClick: () => i.deleteListItem(e, f)
|
|
1098
|
-
}, null), [[
|
|
1092
|
+
}, null), [[et, ((p = i.model.value[e.field]) == null ? void 0 : p.length) > 1]]);
|
|
1099
1093
|
}
|
|
1100
1094
|
}));
|
|
1101
1095
|
},
|
|
1102
1096
|
add({
|
|
1103
|
-
container:
|
|
1097
|
+
container: l
|
|
1104
1098
|
} = {}) {
|
|
1105
|
-
const f =
|
|
1099
|
+
const f = l ?? m("button", null, [tt("添加")]);
|
|
1106
1100
|
return m(f, {
|
|
1107
1101
|
onClick: () => i.addListItem(e)
|
|
1108
1102
|
}, null);
|
|
@@ -1113,17 +1107,17 @@ class $r {
|
|
|
1113
1107
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
1114
1108
|
}
|
|
1115
1109
|
exec() {
|
|
1116
|
-
var
|
|
1110
|
+
var l, f, d, h;
|
|
1117
1111
|
const e = {
|
|
1118
1112
|
display: "grid",
|
|
1119
1113
|
gridColumn: "1 / -1",
|
|
1120
1114
|
gridAutoColumns: "1fr",
|
|
1121
1115
|
...this.grid
|
|
1122
|
-
}, t = this, i =
|
|
1123
|
-
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, {
|
|
1124
1118
|
ref: this.formRef
|
|
1125
1119
|
}, {
|
|
1126
|
-
[
|
|
1120
|
+
[o]: this.model.value
|
|
1127
1121
|
}), {
|
|
1128
1122
|
default() {
|
|
1129
1123
|
return m("div", {
|
|
@@ -1134,7 +1128,13 @@ class $r {
|
|
|
1134
1128
|
});
|
|
1135
1129
|
}
|
|
1136
1130
|
}
|
|
1137
|
-
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
|
+
}
|
|
1138
1138
|
static getPreset(e) {
|
|
1139
1139
|
var t, i, s;
|
|
1140
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];
|
|
@@ -1143,8 +1143,85 @@ class d {
|
|
|
1143
1143
|
var t, i, s;
|
|
1144
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;
|
|
1145
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);
|
|
1146
1224
|
}
|
|
1147
|
-
l(d, "presets");
|
|
1148
1225
|
function A({
|
|
1149
1226
|
parentSchema: r,
|
|
1150
1227
|
schema: e,
|
|
@@ -1156,22 +1233,22 @@ const Rr = {
|
|
|
1156
1233
|
ArcoVue: {
|
|
1157
1234
|
getRuntimeField(r) {
|
|
1158
1235
|
const e = A(r);
|
|
1159
|
-
return
|
|
1236
|
+
return a.isFunction(e) ? {
|
|
1160
1237
|
field: e()
|
|
1161
1238
|
} : {
|
|
1162
1239
|
field: e
|
|
1163
1240
|
};
|
|
1164
1241
|
},
|
|
1165
1242
|
getRuntimeRequired(r) {
|
|
1166
|
-
let e =
|
|
1243
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1167
1244
|
if (r.required)
|
|
1168
|
-
if (
|
|
1245
|
+
if (e = Q(r), !r.rules)
|
|
1169
1246
|
r.rules = [], r.rules.push({
|
|
1170
1247
|
required: !0,
|
|
1171
1248
|
message: e
|
|
1172
1249
|
});
|
|
1173
1250
|
else {
|
|
1174
|
-
const t = r.rules.findIndex((i) => !
|
|
1251
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1175
1252
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1176
1253
|
required: !0,
|
|
1177
1254
|
message: e
|
|
@@ -1192,11 +1269,11 @@ const Rr = {
|
|
|
1192
1269
|
componentSlots: s,
|
|
1193
1270
|
props: n
|
|
1194
1271
|
}) {
|
|
1195
|
-
let
|
|
1196
|
-
return
|
|
1197
|
-
modelValue:
|
|
1198
|
-
"onUpdate:modelValue": (
|
|
1199
|
-
|
|
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;
|
|
1200
1277
|
},
|
|
1201
1278
|
placeholder: i
|
|
1202
1279
|
}, n), {
|
|
@@ -1216,22 +1293,22 @@ const Rr = {
|
|
|
1216
1293
|
NutUI: {
|
|
1217
1294
|
getRuntimeField(r) {
|
|
1218
1295
|
const e = A(r);
|
|
1219
|
-
return
|
|
1296
|
+
return a.isFunction(e) ? {
|
|
1220
1297
|
prop: e()
|
|
1221
1298
|
} : {
|
|
1222
1299
|
prop: e
|
|
1223
1300
|
};
|
|
1224
1301
|
},
|
|
1225
1302
|
getRuntimeRequired(r) {
|
|
1226
|
-
let e =
|
|
1303
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1227
1304
|
if (r.required)
|
|
1228
|
-
if (
|
|
1305
|
+
if (e = Q(r), !r.rules)
|
|
1229
1306
|
r.rules = [], r.rules.push({
|
|
1230
1307
|
required: !0,
|
|
1231
1308
|
message: e
|
|
1232
1309
|
});
|
|
1233
1310
|
else {
|
|
1234
|
-
const t = r.rules.findIndex((i) => !
|
|
1311
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1235
1312
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1236
1313
|
required: !0,
|
|
1237
1314
|
message: e
|
|
@@ -1253,11 +1330,11 @@ const Rr = {
|
|
|
1253
1330
|
componentSlots: s,
|
|
1254
1331
|
props: n
|
|
1255
1332
|
}) {
|
|
1256
|
-
let
|
|
1257
|
-
return
|
|
1258
|
-
modelValue:
|
|
1259
|
-
"onUpdate:modelValue": (
|
|
1260
|
-
|
|
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;
|
|
1261
1338
|
},
|
|
1262
1339
|
placeholder: i
|
|
1263
1340
|
}, n), {
|
|
@@ -1282,23 +1359,23 @@ const Rr = {
|
|
|
1282
1359
|
NaiveUI: {
|
|
1283
1360
|
getRuntimeField(r) {
|
|
1284
1361
|
const e = A(r);
|
|
1285
|
-
return
|
|
1362
|
+
return a.isFunction(e) ? {
|
|
1286
1363
|
path: e()
|
|
1287
1364
|
} : {
|
|
1288
1365
|
path: e
|
|
1289
1366
|
};
|
|
1290
1367
|
},
|
|
1291
1368
|
getRuntimeRequired(r) {
|
|
1292
|
-
let e =
|
|
1369
|
+
let e = c.buildRequiredMessage(r.label);
|
|
1293
1370
|
if (r.required)
|
|
1294
|
-
if (
|
|
1371
|
+
if (e = Q(r), !r.rules)
|
|
1295
1372
|
r.rules = [], r.rules.push({
|
|
1296
1373
|
required: !0,
|
|
1297
1374
|
message: e,
|
|
1298
1375
|
trigger: ["input", "blur"]
|
|
1299
1376
|
});
|
|
1300
1377
|
else {
|
|
1301
|
-
const t = r.rules.findIndex((i) => !
|
|
1378
|
+
const t = r.rules.findIndex((i) => !a.isUndefined(i.required));
|
|
1302
1379
|
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1303
1380
|
required: !0,
|
|
1304
1381
|
message: e,
|
|
@@ -1320,11 +1397,11 @@ const Rr = {
|
|
|
1320
1397
|
componentSlots: s,
|
|
1321
1398
|
props: n
|
|
1322
1399
|
}) {
|
|
1323
|
-
let
|
|
1324
|
-
return
|
|
1325
|
-
value:
|
|
1326
|
-
"onUpdate:value": (
|
|
1327
|
-
|
|
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;
|
|
1328
1405
|
},
|
|
1329
1406
|
placeholder: i
|
|
1330
1407
|
}, n), {
|
|
@@ -1354,7 +1431,7 @@ const Rr = {
|
|
|
1354
1431
|
return t;
|
|
1355
1432
|
}
|
|
1356
1433
|
};
|
|
1357
|
-
|
|
1434
|
+
u(R, "schemaPreset", {
|
|
1358
1435
|
type: {
|
|
1359
1436
|
defaultValue: "item"
|
|
1360
1437
|
},
|
|
@@ -1400,19 +1477,19 @@ l(R, "schemaPreset", {
|
|
|
1400
1477
|
runtime: {
|
|
1401
1478
|
default: void 0
|
|
1402
1479
|
}
|
|
1403
|
-
}),
|
|
1480
|
+
}), u(R, "componentPropsPreset", {
|
|
1404
1481
|
options: {
|
|
1405
1482
|
defaultValue: []
|
|
1406
1483
|
}
|
|
1407
1484
|
}), // 基于基本功能提出基本预设
|
|
1408
|
-
|
|
1485
|
+
u(R, "placeholderPresetByComponentName", R.getPlaceholderPrefixPresetByComponentName());
|
|
1409
1486
|
let te = R;
|
|
1410
|
-
const
|
|
1487
|
+
const I = {
|
|
1411
1488
|
...te,
|
|
1412
1489
|
adapters: {
|
|
1413
1490
|
...Rr
|
|
1414
1491
|
}
|
|
1415
|
-
},
|
|
1492
|
+
}, Vr = /* @__PURE__ */ it({
|
|
1416
1493
|
props: {
|
|
1417
1494
|
setup: {
|
|
1418
1495
|
type: Function,
|
|
@@ -1420,11 +1497,12 @@ const C = {
|
|
|
1420
1497
|
}
|
|
1421
1498
|
},
|
|
1422
1499
|
setup(r) {
|
|
1423
|
-
const e = new
|
|
1500
|
+
const e = new xr(r.setup);
|
|
1424
1501
|
return () => e.exec();
|
|
1425
1502
|
}
|
|
1426
1503
|
});
|
|
1427
|
-
function
|
|
1504
|
+
function Nr(r) {
|
|
1505
|
+
console.log("new ffffffffffff========123===");
|
|
1428
1506
|
const e = new Or(r);
|
|
1429
1507
|
return [
|
|
1430
1508
|
e.setup.bind(e),
|
|
@@ -1437,8 +1515,8 @@ function Ur(r) {
|
|
|
1437
1515
|
}
|
|
1438
1516
|
];
|
|
1439
1517
|
}
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1518
|
+
function Lr(r) {
|
|
1519
|
+
c.setPresets(r);
|
|
1442
1520
|
}
|
|
1443
1521
|
function ae(r, e) {
|
|
1444
1522
|
return e === "native" && Object.defineProperty(r, "name", {
|
|
@@ -1452,16 +1530,16 @@ function ae(r, e) {
|
|
|
1452
1530
|
writable: !0
|
|
1453
1531
|
}), r;
|
|
1454
1532
|
}
|
|
1455
|
-
function
|
|
1533
|
+
function qr(r) {
|
|
1456
1534
|
return ae(r, "native");
|
|
1457
1535
|
}
|
|
1458
|
-
function
|
|
1536
|
+
function Tr(r) {
|
|
1459
1537
|
return r.__proform_raw_object = !0, r;
|
|
1460
1538
|
}
|
|
1461
|
-
function
|
|
1539
|
+
function Ur(r) {
|
|
1462
1540
|
return ae(r, "onetime");
|
|
1463
1541
|
}
|
|
1464
|
-
function
|
|
1542
|
+
function zr(r) {
|
|
1465
1543
|
function e() {
|
|
1466
1544
|
return r;
|
|
1467
1545
|
}
|
|
@@ -1471,12 +1549,12 @@ function Hr(r) {
|
|
|
1471
1549
|
);
|
|
1472
1550
|
}
|
|
1473
1551
|
export {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
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,
|
|
1481
1559
|
ae as useModifiers
|
|
1482
1560
|
};
|