@harbor-design/proform 1.3.10 → 1.3.12
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 +50 -50
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Te = Object.defineProperty;
|
|
2
2
|
var ze = (t, e, r) => e in t ? Te(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
|
|
4
|
+
import { ref as z, readonly as Pe, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as E, reactive as H, createVNode as y, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as ke } from "vue";
|
|
5
5
|
class o {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -118,7 +118,7 @@ function C(t) {
|
|
|
118
118
|
}
|
|
119
119
|
return r(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function X(t, e) {
|
|
122
122
|
return t.replace(/undefined/g, e);
|
|
123
123
|
}
|
|
124
124
|
class He {
|
|
@@ -134,7 +134,7 @@ class He {
|
|
|
134
134
|
})), e;
|
|
135
135
|
}
|
|
136
136
|
setup(e) {
|
|
137
|
-
return this.runtimeCore = e, this.readonlyReactiveModel.value =
|
|
137
|
+
return this.runtimeCore = e, this.readonlyReactiveModel.value = Pe(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;
|
|
138
138
|
}
|
|
139
139
|
submit() {
|
|
140
140
|
var i;
|
|
@@ -227,10 +227,10 @@ class He {
|
|
|
227
227
|
var e;
|
|
228
228
|
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = C(
|
|
229
229
|
this.runtimeCore.processor.stableModel
|
|
230
|
-
), this.readonlyReactiveModel.value =
|
|
230
|
+
), this.readonlyReactiveModel.value = Pe(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class Y {
|
|
234
234
|
constructor() {
|
|
235
235
|
u(this, "effects", /* @__PURE__ */ new Set());
|
|
236
236
|
u(this, "identifierMap", /* @__PURE__ */ new Map());
|
|
@@ -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 We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self,
|
|
250
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, J = We || Ke || Function("return this")(), x = J.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.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 {
|
|
@@ -270,7 +270,7 @@ function rt(t) {
|
|
|
270
270
|
return t != null && typeof t == "object";
|
|
271
271
|
}
|
|
272
272
|
var it = "[object Symbol]";
|
|
273
|
-
function
|
|
273
|
+
function Q(t) {
|
|
274
274
|
return typeof t == "symbol" || rt(t) && we(t) == it;
|
|
275
275
|
}
|
|
276
276
|
function st(t, e) {
|
|
@@ -278,13 +278,13 @@ function st(t, e) {
|
|
|
278
278
|
s[r] = e(t[r], r, t);
|
|
279
279
|
return s;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var A = Array.isArray, nt = 1 / 0, Ie = x ? x.prototype : void 0, Se = Ie ? Ie.toString : void 0;
|
|
282
282
|
function Me(t) {
|
|
283
283
|
if (typeof t == "string")
|
|
284
284
|
return t;
|
|
285
|
-
if (
|
|
285
|
+
if (A(t))
|
|
286
286
|
return st(t, Me) + "";
|
|
287
|
-
if (
|
|
287
|
+
if (Q(t))
|
|
288
288
|
return Se ? Se.call(t) : "";
|
|
289
289
|
var e = t + "";
|
|
290
290
|
return e == "0" && 1 / t == -nt ? "-0" : e;
|
|
@@ -300,8 +300,8 @@ function ct(t) {
|
|
|
300
300
|
var e = we(t);
|
|
301
301
|
return e == at || e == lt || e == ot || e == ut;
|
|
302
302
|
}
|
|
303
|
-
var
|
|
304
|
-
var t = /[^.]+$/.exec(
|
|
303
|
+
var W = J["__core-js_shared__"], Oe = function() {
|
|
304
|
+
var t = /[^.]+$/.exec(W && W.keys && W.keys.IE_PROTO || "");
|
|
305
305
|
return t ? "Symbol(src)_1." + t : "";
|
|
306
306
|
}();
|
|
307
307
|
function ft(t) {
|
|
@@ -333,13 +333,13 @@ function Ct(t) {
|
|
|
333
333
|
function It(t, e) {
|
|
334
334
|
return t == null ? void 0 : t[e];
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function ee(t, e) {
|
|
337
337
|
var r = It(t, e);
|
|
338
338
|
return Ct(r) ? r : void 0;
|
|
339
339
|
}
|
|
340
340
|
var Fe = function() {
|
|
341
341
|
try {
|
|
342
|
-
var t =
|
|
342
|
+
var t = ee(Object, "defineProperty");
|
|
343
343
|
return t({}, "", {}), t;
|
|
344
344
|
} catch {
|
|
345
345
|
}
|
|
@@ -366,12 +366,12 @@ function Et(t, e, r) {
|
|
|
366
366
|
}
|
|
367
367
|
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
368
368
|
function $t(t, e) {
|
|
369
|
-
if (
|
|
369
|
+
if (A(t))
|
|
370
370
|
return !1;
|
|
371
371
|
var r = typeof t;
|
|
372
|
-
return r == "number" || r == "symbol" || r == "boolean" || t == null ||
|
|
372
|
+
return r == "number" || r == "symbol" || r == "boolean" || t == null || Q(t) ? !0 : Rt.test(t) || !xt.test(t) || e != null && t in Object(e);
|
|
373
373
|
}
|
|
374
|
-
var T =
|
|
374
|
+
var T = ee(Object, "create");
|
|
375
375
|
function Vt() {
|
|
376
376
|
this.__data__ = T ? T(null) : {}, this.size = 0;
|
|
377
377
|
}
|
|
@@ -450,7 +450,7 @@ R.prototype.delete = Xt;
|
|
|
450
450
|
R.prototype.get = Yt;
|
|
451
451
|
R.prototype.has = Zt;
|
|
452
452
|
R.prototype.set = Jt;
|
|
453
|
-
var Qt =
|
|
453
|
+
var Qt = ee(J, "Map");
|
|
454
454
|
function At() {
|
|
455
455
|
this.size = 0, this.__data__ = {
|
|
456
456
|
hash: new F(),
|
|
@@ -493,7 +493,7 @@ j.prototype.get = rr;
|
|
|
493
493
|
j.prototype.has = ir;
|
|
494
494
|
j.prototype.set = sr;
|
|
495
495
|
var nr = "Expected a function";
|
|
496
|
-
function
|
|
496
|
+
function te(t, e) {
|
|
497
497
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
498
498
|
throw new TypeError(nr);
|
|
499
499
|
var r = function() {
|
|
@@ -503,12 +503,12 @@ 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 (
|
|
506
|
+
return r.cache = new (te.Cache || j)(), r;
|
|
507
507
|
}
|
|
508
|
-
|
|
508
|
+
te.Cache = j;
|
|
509
509
|
var or = 500;
|
|
510
510
|
function ar(t) {
|
|
511
|
-
var e =
|
|
511
|
+
var e = te(t, function(i) {
|
|
512
512
|
return r.size === or && r.clear(), i;
|
|
513
513
|
}), r = e.cache;
|
|
514
514
|
return e;
|
|
@@ -523,11 +523,11 @@ function fr(t) {
|
|
|
523
523
|
return t == null ? "" : Me(t);
|
|
524
524
|
}
|
|
525
525
|
function xe(t, e) {
|
|
526
|
-
return
|
|
526
|
+
return A(t) ? t : $t(t, e) ? [t] : cr(fr(t));
|
|
527
527
|
}
|
|
528
528
|
var dr = 1 / 0;
|
|
529
529
|
function Re(t) {
|
|
530
|
-
if (typeof t == "string" ||
|
|
530
|
+
if (typeof t == "string" || Q(t))
|
|
531
531
|
return t;
|
|
532
532
|
var e = t + "";
|
|
533
533
|
return e == "0" && 1 / t == -dr ? "-0" : e;
|
|
@@ -573,8 +573,8 @@ class mr {
|
|
|
573
573
|
u(this, "componentPropsPreset", I.componentPropsPreset);
|
|
574
574
|
u(this, "stableUpdaterProcessProgress");
|
|
575
575
|
u(this, "stableUpdaterTimes", 0);
|
|
576
|
-
u(this, "schemaEffect", new
|
|
577
|
-
u(this, "defaultValueEffect", new
|
|
576
|
+
u(this, "schemaEffect", new Y());
|
|
577
|
+
u(this, "defaultValueEffect", new Y());
|
|
578
578
|
u(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
579
579
|
u(this, "baseDefaultValueFunctionsLength");
|
|
580
580
|
u(this, "isModelInitialized", !0);
|
|
@@ -755,13 +755,13 @@ class mr {
|
|
|
755
755
|
}
|
|
756
756
|
promiseFieldParser(e, r, i, s) {
|
|
757
757
|
o.isPromise(e) ? e.then((n) => {
|
|
758
|
-
o.isString(n) && (n =
|
|
758
|
+
o.isString(n) && (n = X(n, "")), i && o.isObject(n) && !o.isNativeObject(n) ? this.objectParser({
|
|
759
759
|
data: n,
|
|
760
760
|
updater: r,
|
|
761
761
|
index: s.rootIndex,
|
|
762
762
|
parentMeta: s.parentMeta
|
|
763
763
|
}) : r(n);
|
|
764
|
-
}) : (o.isString(e) && (e =
|
|
764
|
+
}) : (o.isString(e) && (e = X(e, "")), i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
765
765
|
data: e,
|
|
766
766
|
updater: r,
|
|
767
767
|
index: s.rootIndex,
|
|
@@ -915,11 +915,11 @@ class br {
|
|
|
915
915
|
list: this.runtimeListProcessor.bind(this)
|
|
916
916
|
});
|
|
917
917
|
u(this, "formRef", z(null));
|
|
918
|
-
u(this, "hydrateEffect", new
|
|
919
|
-
u(this, "native",
|
|
918
|
+
u(this, "hydrateEffect", new Y());
|
|
919
|
+
u(this, "native", H({}));
|
|
920
920
|
u(this, "grid", {});
|
|
921
921
|
u(this, "runtime", {});
|
|
922
|
-
u(this, "globalNativeFormOverride",
|
|
922
|
+
u(this, "globalNativeFormOverride", H({
|
|
923
923
|
props: {
|
|
924
924
|
Form: {},
|
|
925
925
|
FormItem: {}
|
|
@@ -929,7 +929,7 @@ class br {
|
|
|
929
929
|
FormItem: {}
|
|
930
930
|
}
|
|
931
931
|
}));
|
|
932
|
-
u(this, "shared", {});
|
|
932
|
+
u(this, "shared", H({}));
|
|
933
933
|
this.setup = e, this.processor = new mr(this);
|
|
934
934
|
const r = this.setup(this);
|
|
935
935
|
if (this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new yr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
|
|
@@ -985,16 +985,16 @@ class br {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
runtimeItemProcessor(e, r, i = this.model.value, s) {
|
|
988
|
-
var
|
|
988
|
+
var ie, se, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ye, ge, be, ve;
|
|
989
989
|
const n = E(e.component);
|
|
990
990
|
if (!n)
|
|
991
991
|
return;
|
|
992
|
-
(
|
|
993
|
-
const a = h(C((
|
|
992
|
+
(se = (ie = e.native) == null ? void 0 : ie.props) != null && se.Form && h(this.globalNativeFormOverride.props.Form, (oe = (ne = e.native) == null ? void 0 : ne.props) == null ? void 0 : oe.Form), (le = (ae = e.native) == null ? void 0 : ae.slots) != null && le.Form && h(this.globalNativeFormOverride.slots.Form, (ce = (ue = e.native) == null ? void 0 : ue.slots) == null ? void 0 : ce.Form);
|
|
993
|
+
const a = h(C((de = (fe = this.native) == null ? void 0 : fe.slots) == null ? void 0 : de.FormItem) ?? {}, (he = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : he.FormItem), l = {
|
|
994
994
|
display: "grid",
|
|
995
995
|
gridColumn: "1 / -1",
|
|
996
996
|
...e.grid
|
|
997
|
-
}, c = h(C((
|
|
997
|
+
}, c = h(C((ye = (me = this.native) == null ? void 0 : me.props) == null ? void 0 : ye.FormItem) ?? {}, (be = (ge = e.native) == null ? void 0 : ge.props) == null ? void 0 : be.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
998
998
|
schema: e,
|
|
999
999
|
parentSchema: s,
|
|
1000
1000
|
index: r
|
|
@@ -1002,11 +1002,11 @@ class br {
|
|
|
1002
1002
|
let S = e.placeholder, v = e.show;
|
|
1003
1003
|
v === void 0 && (v = !0);
|
|
1004
1004
|
let g = e.label ?? "", O;
|
|
1005
|
-
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (g =
|
|
1005
|
+
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (g = X((ve = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : ve.call(O, e.label ?? "", r + 1), "")), !S) {
|
|
1006
1006
|
let $ = "请输入";
|
|
1007
1007
|
o.isUndefined(p) ? S = `${$}${g}` : /* @ts-expect-error */ b[p.toLowerCase()] ? ($ = // @ts-expect-error
|
|
1008
|
-
b[p.toLowerCase()], S = `${$}${g}`) : (Object.keys(b).forEach((
|
|
1009
|
-
p.toLowerCase().includes(
|
|
1008
|
+
b[p.toLowerCase()], S = `${$}${g}`) : (Object.keys(b).forEach((_e) => {
|
|
1009
|
+
p.toLowerCase().includes(_e.toLowerCase()) && ($ = b[_e]);
|
|
1010
1010
|
}), S = `${$}${g}`);
|
|
1011
1011
|
}
|
|
1012
1012
|
const $e = this.runtimeAdapter.getRuntimeRequired({
|
|
@@ -1142,7 +1142,7 @@ class f {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
u(f, "presets");
|
|
1145
|
-
function
|
|
1145
|
+
function K({
|
|
1146
1146
|
parentSchema: t,
|
|
1147
1147
|
schema: e,
|
|
1148
1148
|
index: r
|
|
@@ -1152,7 +1152,7 @@ function W({
|
|
|
1152
1152
|
const vr = {
|
|
1153
1153
|
ArcoVue: {
|
|
1154
1154
|
getRuntimeField(t) {
|
|
1155
|
-
const e =
|
|
1155
|
+
const e = K(t);
|
|
1156
1156
|
return o.isFunction(e) ? {
|
|
1157
1157
|
field: e()
|
|
1158
1158
|
} : {
|
|
@@ -1219,7 +1219,7 @@ const vr = {
|
|
|
1219
1219
|
},
|
|
1220
1220
|
NutUI: {
|
|
1221
1221
|
getRuntimeField(t) {
|
|
1222
|
-
const e =
|
|
1222
|
+
const e = K(t);
|
|
1223
1223
|
return o.isFunction(e) ? {
|
|
1224
1224
|
prop: e()
|
|
1225
1225
|
} : {
|
|
@@ -1292,7 +1292,7 @@ const vr = {
|
|
|
1292
1292
|
},
|
|
1293
1293
|
NaiveUI: {
|
|
1294
1294
|
getRuntimeField(t) {
|
|
1295
|
-
const e =
|
|
1295
|
+
const e = K(t);
|
|
1296
1296
|
return o.isFunction(e) ? {
|
|
1297
1297
|
path: e()
|
|
1298
1298
|
} : {
|
|
@@ -1425,9 +1425,9 @@ u(M, "schemaPreset", {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}), // 基于基本功能提出基本预设
|
|
1427
1427
|
u(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1428
|
-
let
|
|
1428
|
+
let Z = M;
|
|
1429
1429
|
const I = {
|
|
1430
|
-
...
|
|
1430
|
+
...Z,
|
|
1431
1431
|
adapters: {
|
|
1432
1432
|
...vr
|
|
1433
1433
|
}
|
|
@@ -1459,7 +1459,7 @@ function Ir(t) {
|
|
|
1459
1459
|
function Sr(t) {
|
|
1460
1460
|
f.presets = t;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function re(t, e) {
|
|
1463
1463
|
return e === "native" && Object.defineProperty(t, "name", {
|
|
1464
1464
|
value: `__proform_raw_${t.name}`,
|
|
1465
1465
|
writable: !0
|
|
@@ -1472,19 +1472,19 @@ function te(t, e) {
|
|
|
1472
1472
|
}), t;
|
|
1473
1473
|
}
|
|
1474
1474
|
function Or(t) {
|
|
1475
|
-
return
|
|
1475
|
+
return re(t, "native");
|
|
1476
1476
|
}
|
|
1477
1477
|
function Fr(t) {
|
|
1478
1478
|
return t.__proform_raw_object = !0, t;
|
|
1479
1479
|
}
|
|
1480
1480
|
function jr(t) {
|
|
1481
|
-
return
|
|
1481
|
+
return re(t, "onetime");
|
|
1482
1482
|
}
|
|
1483
1483
|
function wr(t) {
|
|
1484
1484
|
function e() {
|
|
1485
1485
|
return t;
|
|
1486
1486
|
}
|
|
1487
|
-
return
|
|
1487
|
+
return re(
|
|
1488
1488
|
e,
|
|
1489
1489
|
"structured_path_parsing_mark"
|
|
1490
1490
|
);
|
|
@@ -1497,5 +1497,5 @@ export {
|
|
|
1497
1497
|
wr as markStructuredPathParsing,
|
|
1498
1498
|
Ir as useForm,
|
|
1499
1499
|
Sr as useFormPresetConfigurer,
|
|
1500
|
-
|
|
1500
|
+
re as useModifiers
|
|
1501
1501
|
};
|