@harbor-design/proform 1.1.27 → 1.1.28
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 +39 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (r, e, t) => (
|
|
4
|
-
import { isRef as x, watch as I, isReactive as z, toRaw as j, nextTick as w, ref as q, reactive as
|
|
1
|
+
var oe = Object.defineProperty;
|
|
2
|
+
var ne = (r, e, t) => e in r ? oe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => (ne(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { isRef as x, watch as I, isReactive as z, toRaw as j, nextTick as w, ref as q, reactive as le, createVNode as p, withDirectives as Z, mergeProps as R, vShow as A, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
|
|
5
5
|
class l {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -63,15 +63,15 @@ class l {
|
|
|
63
63
|
return !1;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function y(r, ...e) {
|
|
67
67
|
return e.forEach((t) => {
|
|
68
68
|
if (Array.isArray(t))
|
|
69
69
|
Array.isArray(r) || (r = []), t.forEach((s, i) => {
|
|
70
|
-
typeof s == "object" && s !== null ? r[i] =
|
|
70
|
+
typeof s == "object" && s !== null ? r[i] = y(Array.isArray(s) ? [] : {}, s) : r[i] = s;
|
|
71
71
|
});
|
|
72
72
|
else
|
|
73
73
|
for (const s in t)
|
|
74
|
-
t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ? r[s] =
|
|
74
|
+
t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ? r[s] = y(r[s] || {}, t[s]) : r[s] = t[s]);
|
|
75
75
|
}), r;
|
|
76
76
|
}
|
|
77
77
|
function g(r) {
|
|
@@ -145,7 +145,7 @@ class fe {
|
|
|
145
145
|
x(e) ? I(
|
|
146
146
|
() => e.value,
|
|
147
147
|
() => {
|
|
148
|
-
|
|
148
|
+
y(this.runtimeCore.model.value, e.value);
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
deep: !0,
|
|
@@ -154,13 +154,13 @@ class fe {
|
|
|
154
154
|
) : z(e) ? I(
|
|
155
155
|
() => e,
|
|
156
156
|
() => {
|
|
157
|
-
|
|
157
|
+
y(this.runtimeCore.model.value, e);
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
deep: !0,
|
|
161
161
|
immediate: !0
|
|
162
162
|
}
|
|
163
|
-
) :
|
|
163
|
+
) : y(this.runtimeCore.model.value, e);
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
lazy: !0
|
|
@@ -266,17 +266,17 @@ class de {
|
|
|
266
266
|
}).fill(!1);
|
|
267
267
|
this.objectParser({ data: e, index: t, updater: n });
|
|
268
268
|
function n(u) {
|
|
269
|
-
const c = u.index, d = u.key,
|
|
269
|
+
const c = u.index, d = u.key, P = u.keyIndex;
|
|
270
270
|
if (l.isUndefined(u.stable))
|
|
271
271
|
return;
|
|
272
272
|
const O = i.parseStable(u.stable), C = s == null ? void 0 : s.index, v = s == null ? void 0 : s.key;
|
|
273
|
-
let
|
|
274
|
-
if (l.isProcessInprogress(
|
|
273
|
+
let m = O;
|
|
274
|
+
if (l.isProcessInprogress(m) || (o[P] = !0), s) {
|
|
275
275
|
const h = i.processedSchemas.value[C][v][c][d];
|
|
276
|
-
h && l.isObject(h) && d !== "component" && (
|
|
276
|
+
h && l.isObject(h) && d !== "component" && (m = y(h, m)), i.processedSchemas.value[C][v][c][d] = m, i.stableUpdater(o);
|
|
277
277
|
} else {
|
|
278
278
|
const h = i.processedSchemas.value[c][d];
|
|
279
|
-
h && l.isObject(h) && d !== "component" && (
|
|
279
|
+
h && l.isObject(h) && d !== "component" && (m = y(h, m)), i.processedSchemas.value[c][d] = m, i.stableUpdater(o);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -469,7 +469,7 @@ class me {
|
|
|
469
469
|
});
|
|
470
470
|
a(this, "formRef", q(null));
|
|
471
471
|
a(this, "hydrateEffect", new N());
|
|
472
|
-
a(this, "native",
|
|
472
|
+
a(this, "native", le({}));
|
|
473
473
|
a(this, "grid", {});
|
|
474
474
|
a(this, "runtime", {});
|
|
475
475
|
a(this, "globalNativeFormOverride", {
|
|
@@ -508,52 +508,52 @@ class me {
|
|
|
508
508
|
const o = j(e.component);
|
|
509
509
|
if (!o)
|
|
510
510
|
return;
|
|
511
|
-
|
|
512
|
-
const n =
|
|
511
|
+
y(this.globalNativeFormOverride.props, ($ = (k = e.native) == null ? void 0 : k.props) == null ? void 0 : $.Form), y(this.globalNativeFormOverride.slots, (B = (_ = e.native) == null ? void 0 : _.slots) == null ? void 0 : B.Form);
|
|
512
|
+
const n = y(g((G = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : G.FormItem) ?? {}, (K = (T = e.native) == null ? void 0 : T.slots) == null ? void 0 : K.FormItem), u = {
|
|
513
513
|
display: "grid",
|
|
514
514
|
gridColumn: "1 / -1",
|
|
515
515
|
...e.grid
|
|
516
|
-
}, c =
|
|
516
|
+
}, c = y(g((H = (W = this.native) == null ? void 0 : W.props) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.props) == null ? void 0 : Q.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
517
517
|
schema: e,
|
|
518
518
|
parentSchema: i,
|
|
519
519
|
index: t
|
|
520
|
-
}),
|
|
521
|
-
let v = e.placeholder,
|
|
522
|
-
|
|
520
|
+
}), P = o.name, O = e.componentProps ?? {}, C = b.placeholderPresetByComponentName;
|
|
521
|
+
let v = e.placeholder, m = e.show;
|
|
522
|
+
m === void 0 && (m = !0), m || delete s[e.field];
|
|
523
523
|
let h = e.label ?? "";
|
|
524
524
|
const V = (i == null ? void 0 : i.runtime) ?? this.runtime;
|
|
525
525
|
if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (h = U((X = V == null ? void 0 : V.customizeItemLabel) == null ? void 0 : X.call(V, e.label ?? "", t + 1), "")), !v) {
|
|
526
526
|
let E = "请输入";
|
|
527
|
-
l.isUndefined(
|
|
528
|
-
C[
|
|
529
|
-
|
|
527
|
+
l.isUndefined(P) ? v = `${E}${h}` : /* @ts-expect-error */ C[P.toLowerCase()] ? (E = // @ts-expect-error
|
|
528
|
+
C[P.toLowerCase()], v = `${E}${h}`) : (Object.keys(C).forEach((Y) => {
|
|
529
|
+
P.toLowerCase().includes(Y.toLowerCase()) && (E = C[Y]);
|
|
530
530
|
}), v = `${E}${h}`);
|
|
531
531
|
}
|
|
532
|
-
const
|
|
532
|
+
const ee = this.runtimeAdapter.getRuntimeRequired({
|
|
533
533
|
...e,
|
|
534
534
|
label: h
|
|
535
|
-
}),
|
|
535
|
+
}), te = F.getItemContainer(this), se = F.getFormItemContainer(this), re = this, ie = e.componentSlots;
|
|
536
536
|
return p("div", {
|
|
537
537
|
style: u
|
|
538
|
-
}, [p(
|
|
539
|
-
show:
|
|
538
|
+
}, [p(te, {
|
|
539
|
+
show: m
|
|
540
540
|
}, {
|
|
541
541
|
default() {
|
|
542
|
-
return p(
|
|
542
|
+
return Z(p(se, R(c, {
|
|
543
543
|
label: `${h ? `${h}:` : ""}`
|
|
544
|
-
}, d,
|
|
544
|
+
}, d, ee), {
|
|
545
545
|
default() {
|
|
546
|
-
return
|
|
546
|
+
return re.runtimeAdapter.formComponentRenderer({
|
|
547
547
|
Component: o,
|
|
548
548
|
schema: e,
|
|
549
549
|
baseModel: s,
|
|
550
550
|
placeholder: v,
|
|
551
|
-
componentSlots:
|
|
551
|
+
componentSlots: ie,
|
|
552
552
|
props: O
|
|
553
553
|
});
|
|
554
554
|
},
|
|
555
555
|
...n
|
|
556
|
-
});
|
|
556
|
+
}), [[A, m]]);
|
|
557
557
|
}
|
|
558
558
|
})]);
|
|
559
559
|
}
|
|
@@ -605,11 +605,11 @@ class me {
|
|
|
605
605
|
delete({
|
|
606
606
|
container: c
|
|
607
607
|
} = {}) {
|
|
608
|
-
var
|
|
608
|
+
var P;
|
|
609
609
|
const d = c ?? p("button", null, null);
|
|
610
|
-
return
|
|
610
|
+
return Z(p(d, {
|
|
611
611
|
onClick: () => s.deleteListItem(e, u)
|
|
612
|
-
}, null), [[
|
|
612
|
+
}, null), [[A, ((P = s.model.value[e.field]) == null ? void 0 : P.length) > 1]]);
|
|
613
613
|
}
|
|
614
614
|
}));
|
|
615
615
|
},
|
|
@@ -627,13 +627,13 @@ class me {
|
|
|
627
627
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
628
628
|
}
|
|
629
629
|
exec() {
|
|
630
|
-
var u, c, d,
|
|
630
|
+
var u, c, d, P;
|
|
631
631
|
const e = {
|
|
632
632
|
display: "grid",
|
|
633
633
|
gridColumn: "1 / -1",
|
|
634
634
|
gridAutoColumns: "1fr",
|
|
635
635
|
...this.grid
|
|
636
|
-
}, t = this, s =
|
|
636
|
+
}, t = this, s = y(g((c = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : c.Form) ?? {}, this.globalNativeFormOverride.props), i = y(g((P = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : P.Form) ?? {}, this.globalNativeFormOverride.slots), o = F.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
|
|
637
637
|
return p(o, R(s, {
|
|
638
638
|
ref: this.formRef
|
|
639
639
|
}, {
|