@harbor-design/proform 1.3.4 → 1.3.5
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 +56 -63
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ue = Object.defineProperty;
|
|
2
2
|
var ze = (t, e, r) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var u = (t, e, r) => (ze(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
-
import { ref as z, readonly as _e, nextTick as P, isRef as T, watch as _, isReactive as q, toRaw as
|
|
4
|
+
import { ref as z, readonly as _e, nextTick as P, isRef as T, watch as _, isReactive as q, toRaw as F, reactive as Pe, createVNode as g, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as We, defineComponent as Be } from "vue";
|
|
5
5
|
class o {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -247,7 +247,7 @@ class X {
|
|
|
247
247
|
return !r.lazy && e(), r.identifier ? this.identifierMap.get(r.identifier) || (this.effects.add(e), this.identifierMap.set(r.identifier, !0)) : this.effects.add(e), () => this.effects.delete(e);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
var He = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = He || Ke || Function("return this")(), x = Z.Symbol,
|
|
250
|
+
var He = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = He || Ke || Function("return this")(), x = Z.Symbol, Ee = Object.prototype, Xe = Ee.hasOwnProperty, Ye = Ee.toString, V = x ? x.toStringTag : void 0;
|
|
251
251
|
function Ze(t) {
|
|
252
252
|
var e = Xe.call(t, V), r = t[V];
|
|
253
253
|
try {
|
|
@@ -263,7 +263,7 @@ function Ae(t) {
|
|
|
263
263
|
return Qe.call(t);
|
|
264
264
|
}
|
|
265
265
|
var et = "[object Null]", tt = "[object Undefined]", Ce = x ? x.toStringTag : void 0;
|
|
266
|
-
function
|
|
266
|
+
function Me(t) {
|
|
267
267
|
return t == null ? t === void 0 ? tt : et : Ce && Ce in Object(t) ? Ze(t) : Ae(t);
|
|
268
268
|
}
|
|
269
269
|
function rt(t) {
|
|
@@ -271,7 +271,7 @@ function rt(t) {
|
|
|
271
271
|
}
|
|
272
272
|
var it = "[object Symbol]";
|
|
273
273
|
function J(t) {
|
|
274
|
-
return typeof t == "symbol" || rt(t) &&
|
|
274
|
+
return typeof t == "symbol" || rt(t) && Me(t) == it;
|
|
275
275
|
}
|
|
276
276
|
function st(t, e) {
|
|
277
277
|
for (var r = -1, i = t == null ? 0 : t.length, s = Array(i); ++r < i; )
|
|
@@ -279,11 +279,11 @@ function st(t, e) {
|
|
|
279
279
|
return s;
|
|
280
280
|
}
|
|
281
281
|
var Q = Array.isArray, nt = 1 / 0, Ie = x ? x.prototype : void 0, Se = Ie ? Ie.toString : void 0;
|
|
282
|
-
function
|
|
282
|
+
function we(t) {
|
|
283
283
|
if (typeof t == "string")
|
|
284
284
|
return t;
|
|
285
285
|
if (Q(t))
|
|
286
|
-
return st(t,
|
|
286
|
+
return st(t, we) + "";
|
|
287
287
|
if (J(t))
|
|
288
288
|
return Se ? Se.call(t) : "";
|
|
289
289
|
var e = t + "";
|
|
@@ -297,7 +297,7 @@ var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object Gener
|
|
|
297
297
|
function ct(t) {
|
|
298
298
|
if (!G(t))
|
|
299
299
|
return !1;
|
|
300
|
-
var e =
|
|
300
|
+
var e = Me(t);
|
|
301
301
|
return e == at || e == lt || e == ot || e == ut;
|
|
302
302
|
}
|
|
303
303
|
var k = Z["__core-js_shared__"], Oe = function() {
|
|
@@ -348,7 +348,7 @@ function jt(t, e) {
|
|
|
348
348
|
var r = typeof t;
|
|
349
349
|
return e = e ?? St, !!e && (r == "number" || r != "symbol" && Ot.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function Et(t, e, r) {
|
|
352
352
|
e == "__proto__" && je ? je(t, e, {
|
|
353
353
|
configurable: !0,
|
|
354
354
|
enumerable: !0,
|
|
@@ -356,13 +356,13 @@ function Mt(t, e, r) {
|
|
|
356
356
|
writable: !0
|
|
357
357
|
}) : t[e] = r;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Fe(t, e) {
|
|
360
360
|
return t === e || t !== t && e !== e;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
363
|
-
function
|
|
362
|
+
var Mt = Object.prototype, wt = Mt.hasOwnProperty;
|
|
363
|
+
function Ft(t, e, r) {
|
|
364
364
|
var i = t[e];
|
|
365
|
-
(!(
|
|
365
|
+
(!(wt.call(t, e) && Fe(i, r)) || r === void 0 && !(e in t)) && Et(t, e, r);
|
|
366
366
|
}
|
|
367
367
|
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
368
368
|
function $t(t, e) {
|
|
@@ -415,7 +415,7 @@ function kt() {
|
|
|
415
415
|
}
|
|
416
416
|
function W(t, e) {
|
|
417
417
|
for (var r = t.length; r--; )
|
|
418
|
-
if (
|
|
418
|
+
if (Fe(t[r][0], e))
|
|
419
419
|
return r;
|
|
420
420
|
return -1;
|
|
421
421
|
}
|
|
@@ -480,18 +480,18 @@ function sr(t, e) {
|
|
|
480
480
|
var r = B(this, t), i = r.size;
|
|
481
481
|
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function E(t) {
|
|
484
484
|
var e = -1, r = t == null ? 0 : t.length;
|
|
485
485
|
for (this.clear(); ++e < r; ) {
|
|
486
486
|
var i = t[e];
|
|
487
487
|
this.set(i[0], i[1]);
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
490
|
+
E.prototype.clear = At;
|
|
491
|
+
E.prototype.delete = tr;
|
|
492
|
+
E.prototype.get = rr;
|
|
493
|
+
E.prototype.has = ir;
|
|
494
|
+
E.prototype.set = sr;
|
|
495
495
|
var nr = "Expected a function";
|
|
496
496
|
function ee(t, e) {
|
|
497
497
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
@@ -503,9 +503,9 @@ function ee(t, e) {
|
|
|
503
503
|
var a = t.apply(this, i);
|
|
504
504
|
return r.cache = n.set(s, a) || n, a;
|
|
505
505
|
};
|
|
506
|
-
return r.cache = new (ee.Cache ||
|
|
506
|
+
return r.cache = new (ee.Cache || E)(), r;
|
|
507
507
|
}
|
|
508
|
-
ee.Cache =
|
|
508
|
+
ee.Cache = E;
|
|
509
509
|
var or = 500;
|
|
510
510
|
function ar(t) {
|
|
511
511
|
var e = ee(t, function(i) {
|
|
@@ -520,7 +520,7 @@ var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
|
|
|
520
520
|
}), e;
|
|
521
521
|
});
|
|
522
522
|
function fr(t) {
|
|
523
|
-
return t == null ? "" :
|
|
523
|
+
return t == null ? "" : we(t);
|
|
524
524
|
}
|
|
525
525
|
function xe(t, e) {
|
|
526
526
|
return Q(t) ? t : $t(t, e) ? [t] : cr(fr(t));
|
|
@@ -554,7 +554,7 @@ function hr(t, e, r, i) {
|
|
|
554
554
|
var p = l[c];
|
|
555
555
|
d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : jt(e[s + 1]) ? [] : {});
|
|
556
556
|
}
|
|
557
|
-
|
|
557
|
+
Ft(l, c, d), l = l[c];
|
|
558
558
|
}
|
|
559
559
|
return t;
|
|
560
560
|
}
|
|
@@ -634,7 +634,7 @@ class mr {
|
|
|
634
634
|
// 对于稳定初始化更新的抽象
|
|
635
635
|
stableUpdater(e = []) {
|
|
636
636
|
if (e.every(Boolean)) {
|
|
637
|
-
const r =
|
|
637
|
+
const r = F(this.processedSchemas.value);
|
|
638
638
|
!o.isProcessInprogress(r) && o.isObjectEmpty(this.stableModel) && (this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
639
639
|
length: r.length
|
|
640
640
|
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(r));
|
|
@@ -852,7 +852,7 @@ class mr {
|
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
class
|
|
855
|
+
class M {
|
|
856
856
|
static getFormContainer({ ui: e } = {}) {
|
|
857
857
|
return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
|
|
858
858
|
}
|
|
@@ -936,31 +936,24 @@ class br {
|
|
|
936
936
|
u(this, "shared", {});
|
|
937
937
|
this.setup = e, this.processor = new mr(this);
|
|
938
938
|
const r = this.setup(this);
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
()
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
{
|
|
947
|
-
deep: !0
|
|
948
|
-
}
|
|
949
|
-
);
|
|
950
|
-
else if (q(r.schemas)) {
|
|
951
|
-
const i = _(() => r.schemas, () => {
|
|
952
|
-
this.processor.parseSchemas(r.schemas), P(() => {
|
|
953
|
-
i();
|
|
954
|
-
});
|
|
955
|
-
}, {
|
|
939
|
+
this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new gr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), T(r.schemas) ? _(
|
|
940
|
+
// @ts-expect-error
|
|
941
|
+
() => r.schemas.value,
|
|
942
|
+
() => {
|
|
943
|
+
this.processor.schemaEffect.clearEffects(), this.processor.processedSchemas.value = [], this.processor.parseSchemas(r.schemas.value);
|
|
944
|
+
},
|
|
945
|
+
{
|
|
956
946
|
deep: !0
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
this.processor.parseSchemas(r.schemas);
|
|
947
|
+
}
|
|
948
|
+
) : q(r.schemas) ? _(() => r.schemas, () => {
|
|
949
|
+
this.processor.schemaEffect.clearEffects(), this.processor.processedSchemas.value = [], this.processor.parseSchemas(r.schemas);
|
|
950
|
+
}, {
|
|
951
|
+
deep: !0
|
|
952
|
+
}) : this.processor.parseSchemas(r.schemas);
|
|
960
953
|
}
|
|
961
954
|
getRuntimeMeta() {
|
|
962
955
|
return {
|
|
963
|
-
model:
|
|
956
|
+
model: F(C(this.model.value)),
|
|
964
957
|
reactiveModel: this.model.value,
|
|
965
958
|
shared: this.shared,
|
|
966
959
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
@@ -990,7 +983,7 @@ class br {
|
|
|
990
983
|
}
|
|
991
984
|
runtimeItemProcessor(e, r, i = this.model.value, s) {
|
|
992
985
|
var re, ie, se, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ge, ye, be;
|
|
993
|
-
const n =
|
|
986
|
+
const n = F(e.component);
|
|
994
987
|
if (!n)
|
|
995
988
|
return;
|
|
996
989
|
(ie = (re = e.native) == null ? void 0 : re.props) != null && ie.Form && h(this.globalNativeFormOverride.props.Form, (ne = (se = e.native) == null ? void 0 : se.props) == null ? void 0 : ne.Form), (ae = (oe = e.native) == null ? void 0 : oe.slots) != null && ae.Form && h(this.globalNativeFormOverride.slots.Form, (ue = (le = e.native) == null ? void 0 : le.slots) == null ? void 0 : ue.Form);
|
|
@@ -1016,7 +1009,7 @@ class br {
|
|
|
1016
1009
|
const $e = this.runtimeAdapter.getRuntimeRequired({
|
|
1017
1010
|
...e,
|
|
1018
1011
|
label: y
|
|
1019
|
-
}), Ve =
|
|
1012
|
+
}), Ve = M.getItemContainer(this), Ne = M.getFormItemContainer(this), Te = this, qe = e.componentSlots;
|
|
1020
1013
|
return g("div", {
|
|
1021
1014
|
style: l
|
|
1022
1015
|
}, [g(Ve, {
|
|
@@ -1047,7 +1040,7 @@ class br {
|
|
|
1047
1040
|
display: "grid",
|
|
1048
1041
|
gridColumn: "1 / -1",
|
|
1049
1042
|
...e.grid
|
|
1050
|
-
}, s =
|
|
1043
|
+
}, s = M.getGroupContainer(this);
|
|
1051
1044
|
let n = e.show;
|
|
1052
1045
|
return n === void 0 && (n = !0), g("div", {
|
|
1053
1046
|
style: i
|
|
@@ -1078,7 +1071,7 @@ class br {
|
|
|
1078
1071
|
i.model.value[e.field] || (i.model.value[e.field] = [{}]);
|
|
1079
1072
|
let s = e.show;
|
|
1080
1073
|
s === void 0 && (s = !0);
|
|
1081
|
-
const n =
|
|
1074
|
+
const n = M.getListContainer(this), a = M.getListItemContainer(this);
|
|
1082
1075
|
return g("div", {
|
|
1083
1076
|
style: r
|
|
1084
1077
|
}, [s && g(n, {
|
|
@@ -1120,7 +1113,7 @@ class br {
|
|
|
1120
1113
|
gridColumn: "1 / -1",
|
|
1121
1114
|
gridAutoColumns: "1fr",
|
|
1122
1115
|
...this.grid
|
|
1123
|
-
}, r = this, i = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n =
|
|
1116
|
+
}, r = this, i = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = M.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1124
1117
|
return g(n, N(i, {
|
|
1125
1118
|
ref: this.formRef
|
|
1126
1119
|
}, {
|
|
@@ -1213,7 +1206,7 @@ const vr = {
|
|
|
1213
1206
|
},
|
|
1214
1207
|
validateForm(t) {
|
|
1215
1208
|
return new Promise((e, r) => {
|
|
1216
|
-
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(
|
|
1209
|
+
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(F(t.runtimeCore.processor.processedModel.value))));
|
|
1217
1210
|
});
|
|
1218
1211
|
},
|
|
1219
1212
|
clearValidate(t) {
|
|
@@ -1285,7 +1278,7 @@ const vr = {
|
|
|
1285
1278
|
valid: i,
|
|
1286
1279
|
errors: s
|
|
1287
1280
|
}) => {
|
|
1288
|
-
i ? e(t.cleanFallbackFields(
|
|
1281
|
+
i ? e(t.cleanFallbackFields(F(t.runtimeCore.processor.processedModel.value))) : r(s);
|
|
1289
1282
|
});
|
|
1290
1283
|
});
|
|
1291
1284
|
},
|
|
@@ -1356,7 +1349,7 @@ const vr = {
|
|
|
1356
1349
|
},
|
|
1357
1350
|
validateForm(t) {
|
|
1358
1351
|
return new Promise((e, r) => {
|
|
1359
|
-
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(
|
|
1352
|
+
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(F(t.runtimeCore.processor.processedModel.value))));
|
|
1360
1353
|
});
|
|
1361
1354
|
},
|
|
1362
1355
|
clearValidate(t) {
|
|
@@ -1364,7 +1357,7 @@ const vr = {
|
|
|
1364
1357
|
(r = (e = t.formRef.value) == null ? void 0 : e.restoreValidation) == null || r.call(e);
|
|
1365
1358
|
}
|
|
1366
1359
|
}
|
|
1367
|
-
},
|
|
1360
|
+
}, w = class w {
|
|
1368
1361
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
1369
1362
|
const e = {
|
|
1370
1363
|
请选择: ["select", "tree"],
|
|
@@ -1377,7 +1370,7 @@ const vr = {
|
|
|
1377
1370
|
return r;
|
|
1378
1371
|
}
|
|
1379
1372
|
};
|
|
1380
|
-
u(
|
|
1373
|
+
u(w, "schemaPreset", {
|
|
1381
1374
|
type: {
|
|
1382
1375
|
defaultValue: "item"
|
|
1383
1376
|
},
|
|
@@ -1423,13 +1416,13 @@ u(F, "schemaPreset", {
|
|
|
1423
1416
|
runtime: {
|
|
1424
1417
|
default: void 0
|
|
1425
1418
|
}
|
|
1426
|
-
}), u(
|
|
1419
|
+
}), u(w, "componentPropsPreset", {
|
|
1427
1420
|
options: {
|
|
1428
1421
|
defaultValue: []
|
|
1429
1422
|
}
|
|
1430
1423
|
}), // 基于基本功能提出基本预设
|
|
1431
|
-
u(
|
|
1432
|
-
let Y =
|
|
1424
|
+
u(w, "placeholderPresetByComponentName", w.getPlaceholderPrefixPresetByComponentName());
|
|
1425
|
+
let Y = w;
|
|
1433
1426
|
const I = {
|
|
1434
1427
|
...Y,
|
|
1435
1428
|
adapters: {
|
|
@@ -1481,10 +1474,10 @@ function Or(t) {
|
|
|
1481
1474
|
function jr(t) {
|
|
1482
1475
|
return t.__proform_raw_object = !0, t;
|
|
1483
1476
|
}
|
|
1484
|
-
function
|
|
1477
|
+
function Er(t) {
|
|
1485
1478
|
return te(t, "onetime");
|
|
1486
1479
|
}
|
|
1487
|
-
function
|
|
1480
|
+
function Mr(t) {
|
|
1488
1481
|
function e() {
|
|
1489
1482
|
return t;
|
|
1490
1483
|
}
|
|
@@ -1497,8 +1490,8 @@ export {
|
|
|
1497
1490
|
Cr as ProForm,
|
|
1498
1491
|
Or as markNativeFunction,
|
|
1499
1492
|
jr as markNativeObject,
|
|
1500
|
-
|
|
1501
|
-
|
|
1493
|
+
Er as markOnetimeFunction,
|
|
1494
|
+
Mr as markStructuredPathParsing,
|
|
1502
1495
|
Ir as useForm,
|
|
1503
1496
|
Sr as useFormPresetConfigurer,
|
|
1504
1497
|
te as useModifiers
|