@harbor-design/proform 1.4.2 → 1.4.3
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
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ze = Object.defineProperty;
|
|
2
2
|
var Le = (r, e, t) => e in r ? ze(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var l = (r, e, t) => (Le(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { ref as L, readonly as Ie, nextTick as
|
|
5
|
-
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, A = We || Xe || Function("return this")(), R = A.Symbol,
|
|
4
|
+
import { ref as L, readonly as Ie, nextTick as C, isRef as U, watch as E, isReactive as T, watchEffect as D, toRaw as x, reactive as W, createVNode as m, mergeProps as $, withDirectives as He, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as Ke } from "vue";
|
|
5
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, A = We || Xe || Function("return this")(), R = A.Symbol, Fe = Object.prototype, Ye = Fe.hasOwnProperty, Ze = Fe.toString, N = R ? R.toStringTag : void 0;
|
|
6
6
|
function Je(r) {
|
|
7
7
|
var e = Ye.call(r, N), t = r[N];
|
|
8
8
|
try {
|
|
@@ -92,7 +92,7 @@ function te(r, e) {
|
|
|
92
92
|
var t = Ct(r, e);
|
|
93
93
|
return It(t) ? t : void 0;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var we = function() {
|
|
96
96
|
try {
|
|
97
97
|
var r = te(Object, "defineProperty");
|
|
98
98
|
return r({}, "", {}), r;
|
|
@@ -103,8 +103,8 @@ function Et(r, e) {
|
|
|
103
103
|
var t = typeof r;
|
|
104
104
|
return e = e ?? St, !!e && (t == "number" || t != "symbol" && Ot.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
e == "__proto__" &&
|
|
106
|
+
function wt(r, e, t) {
|
|
107
|
+
e == "__proto__" && we ? we(r, e, {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
enumerable: !0,
|
|
110
110
|
value: t,
|
|
@@ -114,10 +114,10 @@ function Ft(r, e, t) {
|
|
|
114
114
|
function xe(r, e) {
|
|
115
115
|
return r === e || r !== r && e !== e;
|
|
116
116
|
}
|
|
117
|
-
var
|
|
117
|
+
var Ft = Object.prototype, jt = Ft.hasOwnProperty;
|
|
118
118
|
function Mt(r, e, t) {
|
|
119
119
|
var i = r[e];
|
|
120
|
-
(!(jt.call(r, e) && xe(i, t)) || t === void 0 && !(e in r)) &&
|
|
120
|
+
(!(jt.call(r, e) && xe(i, t)) || t === void 0 && !(e in r)) && wt(r, e, t);
|
|
121
121
|
}
|
|
122
122
|
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
123
123
|
function Vt(r, e) {
|
|
@@ -153,18 +153,18 @@ function Bt(r, e) {
|
|
|
153
153
|
var t = this.__data__;
|
|
154
154
|
return this.size += this.has(r) ? 0 : 1, t[r] = z && e === void 0 ? Gt : 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
|
-
|
|
163
|
+
w.prototype.clear = qt;
|
|
164
|
+
w.prototype.delete = Nt;
|
|
165
|
+
w.prototype.get = zt;
|
|
166
|
+
w.prototype.has = Dt;
|
|
167
|
+
w.prototype.set = Bt;
|
|
168
168
|
function Kt() {
|
|
169
169
|
this.__data__ = [], this.size = 0;
|
|
170
170
|
}
|
|
@@ -208,9 +208,9 @@ V.prototype.set = Qt;
|
|
|
208
208
|
var At = te(A, "Map");
|
|
209
209
|
function kt() {
|
|
210
210
|
this.size = 0, this.__data__ = {
|
|
211
|
-
hash: new
|
|
211
|
+
hash: new w(),
|
|
212
212
|
map: new (At || V)(),
|
|
213
|
-
string: new
|
|
213
|
+
string: new w()
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
function er(r) {
|
|
@@ -235,18 +235,18 @@ function sr(r, e) {
|
|
|
235
235
|
var t = K(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 F(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
|
-
|
|
245
|
+
F.prototype.clear = kt;
|
|
246
|
+
F.prototype.delete = tr;
|
|
247
|
+
F.prototype.get = rr;
|
|
248
|
+
F.prototype.has = ir;
|
|
249
|
+
F.prototype.set = sr;
|
|
250
250
|
var nr = "Expected a function";
|
|
251
251
|
function re(r, e) {
|
|
252
252
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
@@ -258,9 +258,9 @@ function re(r, e) {
|
|
|
258
258
|
var a = r.apply(this, i);
|
|
259
259
|
return t.cache = n.set(s, a) || n, a;
|
|
260
260
|
};
|
|
261
|
-
return t.cache = new (re.Cache ||
|
|
261
|
+
return t.cache = new (re.Cache || F)(), t;
|
|
262
262
|
}
|
|
263
|
-
re.Cache =
|
|
263
|
+
re.Cache = F;
|
|
264
264
|
var or = 500;
|
|
265
265
|
function ar(r) {
|
|
266
266
|
var e = re(r, function(i) {
|
|
@@ -313,7 +313,7 @@ function hr(r, e, t, i) {
|
|
|
313
313
|
}
|
|
314
314
|
return r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function _(r, e, t) {
|
|
317
317
|
return r == null ? r : hr(r, e, t);
|
|
318
318
|
}
|
|
319
319
|
class o {
|
|
@@ -393,7 +393,7 @@ function v(r, ...e) {
|
|
|
393
393
|
t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null ? r[i] = v(r[i] || {}, t[i]) : r[i] = t[i]);
|
|
394
394
|
}), r;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function P(r) {
|
|
397
397
|
const e = /* @__PURE__ */ new WeakMap();
|
|
398
398
|
function t(i) {
|
|
399
399
|
if (i === null || typeof i != "object")
|
|
@@ -452,11 +452,11 @@ class mr {
|
|
|
452
452
|
}
|
|
453
453
|
submit() {
|
|
454
454
|
var i;
|
|
455
|
-
const e = (i = c.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t =
|
|
455
|
+
const e = (i = c.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t = I.adapters[c.getUI(this.runtimeCore.ui)];
|
|
456
456
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
457
457
|
}
|
|
458
458
|
hydrate(e) {
|
|
459
|
-
|
|
459
|
+
C(() => {
|
|
460
460
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
461
461
|
() => {
|
|
462
462
|
U(e) ? E(
|
|
@@ -486,24 +486,24 @@ class mr {
|
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
share(e) {
|
|
489
|
-
|
|
489
|
+
C(() => {
|
|
490
490
|
Object.keys(e).forEach((t) => {
|
|
491
491
|
U(e[t]) ? D(() => {
|
|
492
|
-
|
|
492
|
+
_(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());
|
|
493
493
|
}) : T(e[t]) ? D(() => {
|
|
494
|
-
|
|
495
|
-
}) : (
|
|
494
|
+
_(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
495
|
+
}) : (_(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects()));
|
|
496
496
|
});
|
|
497
497
|
});
|
|
498
498
|
}
|
|
499
499
|
subscribeModel(e) {
|
|
500
|
-
|
|
500
|
+
C(() => {
|
|
501
501
|
const t = E(
|
|
502
502
|
() => this.readonlyReactiveModel.value,
|
|
503
503
|
(i) => {
|
|
504
504
|
e(i, {
|
|
505
505
|
stopSubscribe() {
|
|
506
|
-
|
|
506
|
+
C(() => {
|
|
507
507
|
t();
|
|
508
508
|
});
|
|
509
509
|
}
|
|
@@ -518,7 +518,7 @@ class mr {
|
|
|
518
518
|
}
|
|
519
519
|
resetModel() {
|
|
520
520
|
var e;
|
|
521
|
-
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value =
|
|
521
|
+
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = P(
|
|
522
522
|
this.runtimeCore.processor.stableModel
|
|
523
523
|
), this.readonlyReactiveModel.value = Ie(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
524
524
|
}
|
|
@@ -539,7 +539,7 @@ class J {
|
|
|
539
539
|
trackEffect(e, t = {
|
|
540
540
|
lazy: !0
|
|
541
541
|
}) {
|
|
542
|
-
return
|
|
542
|
+
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);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
class gr {
|
|
@@ -550,8 +550,8 @@ class gr {
|
|
|
550
550
|
l(this, "getRuntimeMeta");
|
|
551
551
|
l(this, "stableSchemas", []);
|
|
552
552
|
l(this, "stableModel", {});
|
|
553
|
-
l(this, "schemaPreset",
|
|
554
|
-
l(this, "componentPropsPreset",
|
|
553
|
+
l(this, "schemaPreset", I.schemaPreset);
|
|
554
|
+
l(this, "componentPropsPreset", I.componentPropsPreset);
|
|
555
555
|
l(this, "stableUpdaterProcessProgress");
|
|
556
556
|
l(this, "stableUpdaterTimes", 0);
|
|
557
557
|
l(this, "schemaEffect", new J());
|
|
@@ -559,6 +559,7 @@ class gr {
|
|
|
559
559
|
l(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
560
560
|
l(this, "baseDefaultValueFunctionsLength");
|
|
561
561
|
l(this, "isModelInitialized", !0);
|
|
562
|
+
l(this, "schemaEffectHistory", /* @__PURE__ */ new Map());
|
|
562
563
|
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), E(
|
|
563
564
|
() => this.processedModel.value,
|
|
564
565
|
() => {
|
|
@@ -597,7 +598,7 @@ class gr {
|
|
|
597
598
|
// 派生过程,用于外部应用
|
|
598
599
|
parseSchemas(e, t) {
|
|
599
600
|
o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
600
|
-
|
|
601
|
+
P(e)
|
|
601
602
|
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
602
603
|
}
|
|
603
604
|
parseStable(e) {
|
|
@@ -674,7 +675,7 @@ class gr {
|
|
|
674
675
|
},
|
|
675
676
|
{
|
|
676
677
|
lazy: !1,
|
|
677
|
-
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}
|
|
678
|
+
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}parentIndex:${(u = e.parentMeta) == null ? void 0 : u.index}childIndex:${e.index}${s}${n}`
|
|
678
679
|
}
|
|
679
680
|
) : this.defaultValueEffect.trackEffect(
|
|
680
681
|
() => {
|
|
@@ -690,7 +691,7 @@ class gr {
|
|
|
690
691
|
).every((h) => {
|
|
691
692
|
var b;
|
|
692
693
|
return !((b = h == null ? void 0 : h.includes) != null && b.call(h, "undefined"));
|
|
693
|
-
}) ? (f(p), this.defaultValueEffect.clearEffects(),
|
|
694
|
+
}) ? (f(p), this.defaultValueEffect.clearEffects(), C(() => {
|
|
694
695
|
d();
|
|
695
696
|
})) : f(p);
|
|
696
697
|
},
|
|
@@ -706,7 +707,7 @@ class gr {
|
|
|
706
707
|
).every((h) => {
|
|
707
708
|
var b;
|
|
708
709
|
return !((b = h == null ? void 0 : h.includes) != null && b.call(h, "undefined"));
|
|
709
|
-
}) ? (f(p), this.defaultValueEffect.clearEffects(),
|
|
710
|
+
}) ? (f(p), this.defaultValueEffect.clearEffects(), C(() => {
|
|
710
711
|
d();
|
|
711
712
|
})) : f(p);
|
|
712
713
|
},
|
|
@@ -807,12 +808,12 @@ class gr {
|
|
|
807
808
|
modelProcessor(e) {
|
|
808
809
|
e.map(
|
|
809
810
|
(t) => this.createModel(t, this.processedModel.value)
|
|
810
|
-
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 &&
|
|
811
|
-
this.stableModel =
|
|
811
|
+
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && C(() => {
|
|
812
|
+
this.stableModel = P(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects();
|
|
812
813
|
});
|
|
813
814
|
}
|
|
814
815
|
setModel(e, t, i) {
|
|
815
|
-
o.isFunction(t) ?
|
|
816
|
+
o.isFunction(t) ? _(e, t(), i) : v(e, {
|
|
816
817
|
[t]: i
|
|
817
818
|
});
|
|
818
819
|
}
|
|
@@ -821,7 +822,7 @@ class gr {
|
|
|
821
822
|
this.createModel(i, t[e.field][0]);
|
|
822
823
|
})), o.isGroupSchema(e) && e.children.forEach((i) => {
|
|
823
824
|
this.createModel(i, t);
|
|
824
|
-
}), o.isItemSchema(e) &&
|
|
825
|
+
}), o.isItemSchema(e) && C(() => {
|
|
825
826
|
if ("defaultValue" in e)
|
|
826
827
|
this.setModel(t, e.field, e.defaultValue);
|
|
827
828
|
else {
|
|
@@ -864,27 +865,27 @@ class vr {
|
|
|
864
865
|
}
|
|
865
866
|
getRuntimeField(e) {
|
|
866
867
|
var s;
|
|
867
|
-
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
868
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
868
869
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
|
|
869
870
|
}
|
|
870
871
|
getRuntimeRequired(e) {
|
|
871
872
|
var s;
|
|
872
|
-
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
873
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
873
874
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
|
|
874
875
|
}
|
|
875
876
|
getFormModelPropName() {
|
|
876
877
|
var i;
|
|
877
|
-
const e = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t =
|
|
878
|
+
const e = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t = I.adapters[c.getUI(this.ui)];
|
|
878
879
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
879
880
|
}
|
|
880
881
|
formComponentRenderer(e) {
|
|
881
882
|
var s;
|
|
882
|
-
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
883
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
883
884
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
|
|
884
885
|
}
|
|
885
886
|
clearValidate(e) {
|
|
886
887
|
var s;
|
|
887
|
-
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
888
|
+
const t = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
|
|
888
889
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
|
|
889
890
|
}
|
|
890
891
|
}
|
|
@@ -919,42 +920,35 @@ class yr {
|
|
|
919
920
|
l(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
920
921
|
this.setup = e, this.processor = new gr(this);
|
|
921
922
|
const t = this.setup(this);
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
()
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
{
|
|
930
|
-
deep: !0
|
|
931
|
-
}
|
|
932
|
-
);
|
|
933
|
-
else if (T(t.schemas)) {
|
|
934
|
-
const i = E(() => t.schemas, () => {
|
|
935
|
-
this.processor.parseSchemas(t.schemas), _(() => {
|
|
936
|
-
i();
|
|
937
|
-
});
|
|
938
|
-
}, {
|
|
923
|
+
this.ui = t.ui ?? c.presets.ui, this.runtimeAdapter = new vr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), U(t.schemas) ? E(
|
|
924
|
+
// @ts-expect-error
|
|
925
|
+
() => t.schemas.value,
|
|
926
|
+
() => {
|
|
927
|
+
this.processor.parseSchemas(t.schemas.value);
|
|
928
|
+
},
|
|
929
|
+
{
|
|
939
930
|
deep: !0
|
|
940
|
-
}
|
|
941
|
-
|
|
931
|
+
}
|
|
932
|
+
) : T(t.schemas) ? E(() => t.schemas, () => {
|
|
942
933
|
this.processor.parseSchemas(t.schemas);
|
|
934
|
+
}, {
|
|
935
|
+
deep: !0
|
|
936
|
+
}) : this.processor.parseSchemas(t.schemas);
|
|
943
937
|
}
|
|
944
938
|
getRuntimeMeta() {
|
|
945
939
|
return {
|
|
946
|
-
model: x(
|
|
940
|
+
model: x(P(this.model.value)),
|
|
947
941
|
reactiveModel: this.model.value,
|
|
948
942
|
shared: this.shared,
|
|
949
943
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
950
944
|
share: (t) => {
|
|
951
|
-
|
|
945
|
+
C(() => {
|
|
952
946
|
Object.keys(t).forEach((i) => {
|
|
953
947
|
U(t[i]) ? D(() => {
|
|
954
|
-
|
|
948
|
+
_(this.shared, i, t[i].value), this.shareHistory.get(i) !== t[i].value && (this.shareHistory.set(i, t[i].value), this.processor.schemaEffect.triggerEffects());
|
|
955
949
|
}) : T(t[i]) ? D(() => {
|
|
956
|
-
|
|
957
|
-
}) : (
|
|
950
|
+
_(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects());
|
|
951
|
+
}) : (_(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects()));
|
|
958
952
|
});
|
|
959
953
|
});
|
|
960
954
|
}
|
|
@@ -966,15 +960,15 @@ class yr {
|
|
|
966
960
|
if (!n)
|
|
967
961
|
return;
|
|
968
962
|
(ne = (se = e.native) == null ? void 0 : se.props) != null && ne.Form && v(this.globalNativeFormOverride.props.Form, (ae = (oe = e.native) == null ? void 0 : oe.props) == null ? void 0 : ae.Form), (ue = (le = e.native) == null ? void 0 : le.slots) != null && ue.Form && v(this.globalNativeFormOverride.slots.Form, (ce = (fe = e.native) == null ? void 0 : fe.slots) == null ? void 0 : ce.Form);
|
|
969
|
-
const a = v(
|
|
963
|
+
const a = v(P((pe = (de = this.native) == null ? void 0 : de.slots) == null ? void 0 : pe.FormItem) ?? {}, (me = (he = e.native) == null ? void 0 : he.slots) == null ? void 0 : me.FormItem), u = {
|
|
970
964
|
display: "grid",
|
|
971
965
|
gridColumn: "1 / -1",
|
|
972
966
|
...e.grid
|
|
973
|
-
}, f = v(
|
|
967
|
+
}, f = v(P((ve = (ge = this.native) == null ? void 0 : ge.props) == null ? void 0 : ve.FormItem) ?? {}, (ye = (be = e.native) == null ? void 0 : be.props) == null ? void 0 : ye.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
974
968
|
schema: e,
|
|
975
969
|
parentSchema: s,
|
|
976
970
|
index: t
|
|
977
|
-
}), p = n.name, h = e.componentProps ?? {}, b =
|
|
971
|
+
}), p = n.name, h = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
|
|
978
972
|
let S = e.placeholder, y = e.show;
|
|
979
973
|
y === void 0 && (y = !0);
|
|
980
974
|
let g = e.label ?? "", O;
|
|
@@ -1031,7 +1025,7 @@ class yr {
|
|
|
1031
1025
|
}
|
|
1032
1026
|
addListItem(e) {
|
|
1033
1027
|
var t;
|
|
1034
|
-
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(
|
|
1028
|
+
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(P(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1035
1029
|
}
|
|
1036
1030
|
deleteListItem(e, t) {
|
|
1037
1031
|
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1087,7 +1081,7 @@ class yr {
|
|
|
1087
1081
|
gridColumn: "1 / -1",
|
|
1088
1082
|
gridAutoColumns: "1fr",
|
|
1089
1083
|
...this.grid
|
|
1090
|
-
}, t = this, i = v(this.globalNativeFormOverride.props.Form,
|
|
1084
|
+
}, t = this, i = v(this.globalNativeFormOverride.props.Form, P((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), s = v(this.globalNativeFormOverride.slots.Form, P((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1091
1085
|
return m(n, $(i, {
|
|
1092
1086
|
ref: this.formRef
|
|
1093
1087
|
}, {
|
|
@@ -1170,7 +1164,7 @@ const _r = {
|
|
|
1170
1164
|
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, $({
|
|
1171
1165
|
modelValue: a,
|
|
1172
1166
|
"onUpdate:modelValue": (u) => {
|
|
1173
|
-
o.isFunction(t.field) ?
|
|
1167
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1174
1168
|
},
|
|
1175
1169
|
placeholder: i
|
|
1176
1170
|
}, n), {
|
|
@@ -1237,7 +1231,7 @@ const _r = {
|
|
|
1237
1231
|
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, $({
|
|
1238
1232
|
modelValue: a,
|
|
1239
1233
|
"onUpdate:modelValue": (u) => {
|
|
1240
|
-
o.isFunction(t.field) ?
|
|
1234
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1241
1235
|
},
|
|
1242
1236
|
placeholder: i
|
|
1243
1237
|
}, n), {
|
|
@@ -1311,7 +1305,7 @@ const _r = {
|
|
|
1311
1305
|
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, $({
|
|
1312
1306
|
value: a,
|
|
1313
1307
|
"onUpdate:value": (u) => {
|
|
1314
|
-
o.isFunction(t.field) ?
|
|
1308
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1315
1309
|
},
|
|
1316
1310
|
placeholder: i
|
|
1317
1311
|
}, n), {
|
|
@@ -1394,7 +1388,7 @@ l(M, "schemaPreset", {
|
|
|
1394
1388
|
}), // 基于基本功能提出基本预设
|
|
1395
1389
|
l(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1396
1390
|
let Q = M;
|
|
1397
|
-
const
|
|
1391
|
+
const I = {
|
|
1398
1392
|
...Q,
|
|
1399
1393
|
adapters: {
|
|
1400
1394
|
..._r
|
|
@@ -1442,10 +1436,10 @@ function ie(r, e) {
|
|
|
1442
1436
|
function Er(r) {
|
|
1443
1437
|
return ie(r, "native");
|
|
1444
1438
|
}
|
|
1445
|
-
function
|
|
1439
|
+
function wr(r) {
|
|
1446
1440
|
return r.__proform_raw_object = !0, r;
|
|
1447
1441
|
}
|
|
1448
|
-
function
|
|
1442
|
+
function Fr(r) {
|
|
1449
1443
|
return ie(r, "onetime");
|
|
1450
1444
|
}
|
|
1451
1445
|
function jr(r) {
|
|
@@ -1460,8 +1454,8 @@ function jr(r) {
|
|
|
1460
1454
|
export {
|
|
1461
1455
|
Cr as ProForm,
|
|
1462
1456
|
Er as markNativeFunction,
|
|
1463
|
-
|
|
1464
|
-
|
|
1457
|
+
wr as markNativeObject,
|
|
1458
|
+
Fr as markOnetimeFunction,
|
|
1465
1459
|
jr as markStructuredPathParsing,
|
|
1466
1460
|
Sr as useForm,
|
|
1467
1461
|
Or as useFormPresetConfigurer,
|
|
@@ -22,6 +22,7 @@ export default class Processor {
|
|
|
22
22
|
defaultValueInprogressMap: Map<any, any>;
|
|
23
23
|
baseDefaultValueFunctionsLength: number;
|
|
24
24
|
isModelInitialized: boolean;
|
|
25
|
+
schemaEffectHistory: Map<any, any>;
|
|
25
26
|
constructor(runtimeCore: RuntimeCore);
|
|
26
27
|
parse<T extends object = any>(data: T[], parentMeta?: AnyObject): void;
|
|
27
28
|
initSchemas(schemas: AnyObject[]): AnyObject[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harbor-design/proform",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@types/lodash-es": "^4.17.12"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "vue-tsc && vite build"
|
|
37
|
+
"build": "vue-tsc && vite build",
|
|
38
|
+
"dev:watch": "nodemon -e .ts,.tsx --ignore dist --exec 'vite build'"
|
|
38
39
|
}
|
|
39
40
|
}
|