@harbor-design/proform 1.2.21 → 1.2.23
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
|
@@ -118,7 +118,7 @@ function g(r) {
|
|
|
118
118
|
}
|
|
119
119
|
return t(r);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function _(r, e) {
|
|
122
122
|
return r.replace(/undefined/g, e);
|
|
123
123
|
}
|
|
124
124
|
class be {
|
|
@@ -230,7 +230,7 @@ class be {
|
|
|
230
230
|
), this.readonlyReactiveModel.value = se(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
class
|
|
233
|
+
class x {
|
|
234
234
|
constructor() {
|
|
235
235
|
a(this, "effects", /* @__PURE__ */ new Set());
|
|
236
236
|
}
|
|
@@ -258,8 +258,8 @@ class ve {
|
|
|
258
258
|
a(this, "componentPropsPreset", C.componentPropsPreset);
|
|
259
259
|
a(this, "stableUpdaterProcessProgress");
|
|
260
260
|
a(this, "stableUpdaterTimes", 0);
|
|
261
|
-
a(this, "schemaEffect", new
|
|
262
|
-
a(this, "defaultValueEffect", new
|
|
261
|
+
a(this, "schemaEffect", new x());
|
|
262
|
+
a(this, "defaultValueEffect", new x());
|
|
263
263
|
a(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
264
264
|
a(this, "baseDefaultValueFunctionsLength");
|
|
265
265
|
a(this, "isModelInitialized", !0);
|
|
@@ -331,11 +331,11 @@ class ve {
|
|
|
331
331
|
const c = f.index, d = f.key, y = f.keyIndex;
|
|
332
332
|
if (l.isUndefined(f.stable))
|
|
333
333
|
return;
|
|
334
|
-
const
|
|
335
|
-
let b =
|
|
334
|
+
const V = i.parseStable(f.stable), F = s == null ? void 0 : s.index, I = s == null ? void 0 : s.key;
|
|
335
|
+
let b = V;
|
|
336
336
|
if (l.isProcessInprogress(b) || (o[y] = !0), s) {
|
|
337
|
-
const m = i.processedSchemas.value[
|
|
338
|
-
m && l.isObject(m) && d !== "component" && (b = h(m, b)), i.processedSchemas.value[
|
|
337
|
+
const m = i.processedSchemas.value[F][I][c][d];
|
|
338
|
+
m && l.isObject(m) && d !== "component" && (b = h(m, b)), i.processedSchemas.value[F][I][c][d] = b, i.stableUpdater(o);
|
|
339
339
|
} else {
|
|
340
340
|
const m = i.processedSchemas.value[c][d];
|
|
341
341
|
m && l.isObject(m) && d !== "component" && (b = h(m, b)), i.processedSchemas.value[c][d] = b, i.stableUpdater(o);
|
|
@@ -406,11 +406,11 @@ class ve {
|
|
|
406
406
|
}
|
|
407
407
|
promiseFieldParser(e, t, s) {
|
|
408
408
|
l.isPromise(e) ? e.then((i) => {
|
|
409
|
-
l.isString(i) && (i =
|
|
409
|
+
l.isString(i) && (i = _(i, "")), s && l.isObject(i) && !l.isNativeObject(i) ? this.objectParser({
|
|
410
410
|
data: i,
|
|
411
411
|
updater: t
|
|
412
412
|
}) : t(i);
|
|
413
|
-
}) : (l.isString(e) && (e =
|
|
413
|
+
}) : (l.isString(e) && (e = _(e, "")), s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
|
|
414
414
|
data: e,
|
|
415
415
|
updater: t
|
|
416
416
|
}) : t(e));
|
|
@@ -425,9 +425,12 @@ class ve {
|
|
|
425
425
|
...this.getRuntimeMeta()
|
|
426
426
|
})
|
|
427
427
|
);
|
|
428
|
-
else {
|
|
429
|
-
const i = e
|
|
428
|
+
else if (e.__proform_async_result) {
|
|
429
|
+
const i = e.__proform_async_result;
|
|
430
430
|
this.promiseFieldParser(i, t, s);
|
|
431
|
+
} else {
|
|
432
|
+
const i = e(this.getRuntimeMeta());
|
|
433
|
+
e.__proform_async_result = i, this.promiseFieldParser(i, t, s);
|
|
431
434
|
}
|
|
432
435
|
else
|
|
433
436
|
q(e) ? v(
|
|
@@ -539,7 +542,7 @@ class ge {
|
|
|
539
542
|
list: this.runtimeListProcessor.bind(this)
|
|
540
543
|
});
|
|
541
544
|
a(this, "formRef", N(null));
|
|
542
|
-
a(this, "hydrateEffect", new
|
|
545
|
+
a(this, "hydrateEffect", new x());
|
|
543
546
|
a(this, "native", re({}));
|
|
544
547
|
a(this, "grid", {});
|
|
545
548
|
a(this, "runtime", {});
|
|
@@ -613,11 +616,11 @@ class ge {
|
|
|
613
616
|
};
|
|
614
617
|
}
|
|
615
618
|
runtimeItemProcessor(e, t, s = this.model.value, i) {
|
|
616
|
-
var
|
|
619
|
+
var $, z, k, B, D, T, G, W, K, H, J, Q, X, Y, Z, A, ee;
|
|
617
620
|
const o = S(e.component);
|
|
618
621
|
if (!o)
|
|
619
622
|
return;
|
|
620
|
-
(z = (
|
|
623
|
+
(z = ($ = e.native) == null ? void 0 : $.props) != null && z.Form && h(this.globalNativeFormOverride.props.Form, (B = (k = e.native) == null ? void 0 : k.props) == null ? void 0 : B.Form), (T = (D = e.native) == null ? void 0 : D.slots) != null && T.Form && h(this.globalNativeFormOverride.slots.Form, (W = (G = e.native) == null ? void 0 : G.slots) == null ? void 0 : W.Form);
|
|
621
624
|
const n = h(g((H = (K = this.native) == null ? void 0 : K.slots) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.slots) == null ? void 0 : Q.FormItem), f = {
|
|
622
625
|
display: "grid",
|
|
623
626
|
gridColumn: "1 / -1",
|
|
@@ -626,16 +629,15 @@ class ge {
|
|
|
626
629
|
schema: e,
|
|
627
630
|
parentSchema: i,
|
|
628
631
|
index: t
|
|
629
|
-
}), y = o.name,
|
|
632
|
+
}), y = o.name, V = e.componentProps ?? {}, F = C.placeholderPresetByComponentName;
|
|
630
633
|
let I = e.placeholder, b = e.show;
|
|
631
634
|
b === void 0 && (b = !0);
|
|
632
|
-
let m = e.label ?? "";
|
|
633
|
-
|
|
634
|
-
if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (m = x((ee = V == null ? void 0 : V.customizeListItemLabel) == null ? void 0 : ee.call(V, e.label ?? "", t + 1), "")), !I) {
|
|
635
|
+
let m = e.label ?? "", E;
|
|
636
|
+
if (e.runtime ? E = e.runtime : E = (i == null ? void 0 : i.runtime) ?? this.runtime, !l.isUndefined(t) && !l.isObjectEmpty(E) && (m = _((ee = E == null ? void 0 : E.customizeListItemLabel) == null ? void 0 : ee.call(E, e.label ?? "", t + 1), "")), !I) {
|
|
635
637
|
let w = "请输入";
|
|
636
|
-
l.isUndefined(y) ? I = `${w}${m}` : /* @ts-expect-error */
|
|
637
|
-
|
|
638
|
-
y.toLowerCase().includes(te.toLowerCase()) && (w =
|
|
638
|
+
l.isUndefined(y) ? I = `${w}${m}` : /* @ts-expect-error */ F[y.toLowerCase()] ? (w = // @ts-expect-error
|
|
639
|
+
F[y.toLowerCase()], I = `${w}${m}`) : (Object.keys(F).forEach((te) => {
|
|
640
|
+
y.toLowerCase().includes(te.toLowerCase()) && (w = F[te]);
|
|
639
641
|
}), I = `${w}${m}`);
|
|
640
642
|
}
|
|
641
643
|
const ie = this.runtimeAdapter.getRuntimeRequired({
|
|
@@ -658,7 +660,7 @@ class ge {
|
|
|
658
660
|
baseModel: s,
|
|
659
661
|
placeholder: I,
|
|
660
662
|
componentSlots: ae,
|
|
661
|
-
props:
|
|
663
|
+
props: V
|
|
662
664
|
});
|
|
663
665
|
},
|
|
664
666
|
...n
|
|
@@ -717,11 +719,11 @@ class ge {
|
|
|
717
719
|
delete({
|
|
718
720
|
container: d
|
|
719
721
|
} = {}) {
|
|
720
|
-
var
|
|
722
|
+
var V;
|
|
721
723
|
const y = d ?? p("button", null, null);
|
|
722
724
|
return fe(p(y, {
|
|
723
725
|
onClick: () => s.deleteListItem(e, c)
|
|
724
|
-
}, null), [[de, ((
|
|
726
|
+
}, null), [[de, ((V = s.model.value[e.field]) == null ? void 0 : V.length) > 1]]);
|
|
725
727
|
}
|
|
726
728
|
}));
|
|
727
729
|
},
|
|
@@ -1023,6 +1025,9 @@ a(R, "schemaPreset", {
|
|
|
1023
1025
|
},
|
|
1024
1026
|
grid: {
|
|
1025
1027
|
default: void 0
|
|
1028
|
+
},
|
|
1029
|
+
runtime: {
|
|
1030
|
+
default: void 0
|
|
1026
1031
|
}
|
|
1027
1032
|
}), a(R, "componentPropsPreset", {
|
|
1028
1033
|
options: {
|
|
@@ -1030,9 +1035,9 @@ a(R, "schemaPreset", {
|
|
|
1030
1035
|
}
|
|
1031
1036
|
}), // 基于基本功能提出基本预设
|
|
1032
1037
|
a(R, "placeholderPresetByComponentName", R.getPlaceholderPrefixPresetByComponentName());
|
|
1033
|
-
let
|
|
1038
|
+
let L = R;
|
|
1034
1039
|
const C = {
|
|
1035
|
-
|
|
1040
|
+
...L,
|
|
1036
1041
|
adapters: {
|
|
1037
1042
|
...Ce
|
|
1038
1043
|
}
|