@harbor-design/proform 1.4.12 → 1.4.14
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 +47 -46
- package/dist/types/src/types/useFormTypes.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (r, e, t) => (
|
|
4
|
-
import { ref as H, readonly as Ee, nextTick as S, isRef as T, watch as w, isReactive as z, watchEffect as G, toRaw as $, reactive as Y, createVNode as m, mergeProps as q, withDirectives as
|
|
5
|
-
var
|
|
6
|
-
function
|
|
7
|
-
var e =
|
|
1
|
+
var Ge = Object.defineProperty;
|
|
2
|
+
var Be = (r, e, t) => e in r ? Ge(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var l = (r, e, t) => (Be(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { ref as H, readonly as Ee, nextTick as S, isRef as T, watch as w, isReactive as z, watchEffect as G, toRaw as $, reactive as Y, createVNode as m, mergeProps as q, withDirectives as Ke, vShow as We, createTextVNode as Xe, isVNode as Ye, defineComponent as Ze } from "vue";
|
|
5
|
+
var Je = typeof global == "object" && global && global.Object === Object && global, Qe = typeof self == "object" && self && self.Object === Object && self, ee = Je || Qe || Function("return this")(), M = ee.Symbol, Re = Object.prototype, Ae = Re.hasOwnProperty, ke = Re.toString, U = M ? M.toStringTag : void 0;
|
|
6
|
+
function et(r) {
|
|
7
|
+
var e = Ae.call(r, U), t = r[U];
|
|
8
8
|
try {
|
|
9
9
|
r[U] = void 0;
|
|
10
10
|
var i = !0;
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
|
-
var s =
|
|
13
|
+
var s = ke.call(r);
|
|
14
14
|
return i && (e ? r[U] = t : delete r[U]), s;
|
|
15
15
|
}
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
var tt = Object.prototype, rt = tt.toString;
|
|
17
|
+
function it(r) {
|
|
18
|
+
return rt.call(r);
|
|
19
19
|
}
|
|
20
|
-
var
|
|
20
|
+
var st = "[object Null]", nt = "[object Undefined]", Oe = M ? M.toStringTag : void 0;
|
|
21
21
|
function $e(r) {
|
|
22
|
-
return r == null ? r === void 0 ?
|
|
22
|
+
return r == null ? r === void 0 ? nt : st : Oe && Oe in Object(r) ? et(r) : it(r);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ot(r) {
|
|
25
25
|
return r != null && typeof r == "object";
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var at = "[object Symbol]";
|
|
28
28
|
function te(r) {
|
|
29
|
-
return typeof r == "symbol" ||
|
|
29
|
+
return typeof r == "symbol" || ot(r) && $e(r) == at;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function lt(r, e) {
|
|
32
32
|
for (var t = -1, i = r == null ? 0 : r.length, s = Array(i); ++t < i; )
|
|
33
33
|
s[t] = e(r[t], t, r);
|
|
34
34
|
return s;
|
|
35
35
|
}
|
|
36
|
-
var re = Array.isArray,
|
|
36
|
+
var re = Array.isArray, ut = 1 / 0, we = M ? M.prototype : void 0, Fe = we ? we.toString : void 0;
|
|
37
37
|
function Me(r) {
|
|
38
38
|
if (typeof r == "string")
|
|
39
39
|
return r;
|
|
40
40
|
if (re(r))
|
|
41
|
-
return
|
|
41
|
+
return lt(r, Me) + "";
|
|
42
42
|
if (te(r))
|
|
43
43
|
return Fe ? Fe.call(r) : "";
|
|
44
44
|
var e = r + "";
|
|
45
|
-
return e == "0" && 1 / r == -
|
|
45
|
+
return e == "0" && 1 / r == -ut ? "-0" : e;
|
|
46
46
|
}
|
|
47
47
|
function B(r) {
|
|
48
48
|
var e = typeof r;
|
|
49
49
|
return r != null && (e == "object" || e == "function");
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var ft = "[object AsyncFunction]", ct = "[object Function]", dt = "[object GeneratorFunction]", ht = "[object Proxy]";
|
|
52
|
+
function Ve(r) {
|
|
53
53
|
if (!B(r))
|
|
54
54
|
return !1;
|
|
55
55
|
var e = $e(r);
|
|
56
|
-
return e ==
|
|
56
|
+
return e == ct || e == dt || e == ft || e == ht;
|
|
57
57
|
}
|
|
58
58
|
var Z = ee["__core-js_shared__"], je = function() {
|
|
59
59
|
var r = /[^.]+$/.exec(Z && Z.keys && Z.keys.IE_PROTO || "");
|
|
@@ -82,7 +82,7 @@ var vt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, _t = Functio
|
|
|
82
82
|
function Et(r) {
|
|
83
83
|
if (!B(r) || pt(r))
|
|
84
84
|
return !1;
|
|
85
|
-
var e =
|
|
85
|
+
var e = Ve(r) ? St : yt;
|
|
86
86
|
return e.test(bt(r));
|
|
87
87
|
}
|
|
88
88
|
function Ot(r, e) {
|
|
@@ -111,13 +111,13 @@ function xt(r, e, t) {
|
|
|
111
111
|
writable: !0
|
|
112
112
|
}) : r[e] = t;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ne(r, e) {
|
|
115
115
|
return r === e || r !== r && e !== e;
|
|
116
116
|
}
|
|
117
117
|
var Rt = Object.prototype, $t = Rt.hasOwnProperty;
|
|
118
118
|
function Mt(r, e, t) {
|
|
119
119
|
var i = r[e];
|
|
120
|
-
(!($t.call(r, e) &&
|
|
120
|
+
(!($t.call(r, e) && Ne(i, t)) || t === void 0 && !(e in r)) && xt(r, e, t);
|
|
121
121
|
}
|
|
122
122
|
var Vt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Nt = /^\w*$/;
|
|
123
123
|
function Ut(r, e) {
|
|
@@ -170,7 +170,7 @@ function Yt() {
|
|
|
170
170
|
}
|
|
171
171
|
function K(r, e) {
|
|
172
172
|
for (var t = r.length; t--; )
|
|
173
|
-
if (
|
|
173
|
+
if (Ne(r[t][0], e))
|
|
174
174
|
return t;
|
|
175
175
|
return -1;
|
|
176
176
|
}
|
|
@@ -277,20 +277,20 @@ var cr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
|
|
|
277
277
|
function pr(r) {
|
|
278
278
|
return r == null ? "" : Me(r);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function Ue(r, e) {
|
|
281
281
|
return re(r) ? r : Ut(r, e) ? [r] : hr(pr(r));
|
|
282
282
|
}
|
|
283
283
|
var mr = 1 / 0;
|
|
284
|
-
function
|
|
284
|
+
function qe(r) {
|
|
285
285
|
if (typeof r == "string" || te(r))
|
|
286
286
|
return r;
|
|
287
287
|
var e = r + "";
|
|
288
288
|
return e == "0" && 1 / r == -mr ? "-0" : e;
|
|
289
289
|
}
|
|
290
290
|
function gr(r, e) {
|
|
291
|
-
e =
|
|
291
|
+
e = Ue(e, r);
|
|
292
292
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
293
|
-
r = r[
|
|
293
|
+
r = r[qe(e[t++])];
|
|
294
294
|
return t && t == i ? r : void 0;
|
|
295
295
|
}
|
|
296
296
|
function D(r, e, t) {
|
|
@@ -300,9 +300,9 @@ function D(r, e, t) {
|
|
|
300
300
|
function br(r, e, t, i) {
|
|
301
301
|
if (!B(r))
|
|
302
302
|
return r;
|
|
303
|
-
e =
|
|
303
|
+
e = Ue(e, r);
|
|
304
304
|
for (var s = -1, n = e.length, a = n - 1, u = r; u != null && ++s < n; ) {
|
|
305
|
-
var f =
|
|
305
|
+
var f = qe(e[s]), c = t;
|
|
306
306
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
307
307
|
return r;
|
|
308
308
|
if (s != a) {
|
|
@@ -509,6 +509,7 @@ class vr {
|
|
|
509
509
|
() => this.readonlyReactiveModel.value,
|
|
510
510
|
(i) => {
|
|
511
511
|
e(i, {
|
|
512
|
+
reactiveModel: this.runtimeCore.model.value,
|
|
512
513
|
stopSubscribe() {
|
|
513
514
|
S(() => {
|
|
514
515
|
t();
|
|
@@ -915,7 +916,7 @@ class _r {
|
|
|
915
916
|
}
|
|
916
917
|
}
|
|
917
918
|
function Pr(r) {
|
|
918
|
-
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !
|
|
919
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Ye(r);
|
|
919
920
|
}
|
|
920
921
|
class Cr {
|
|
921
922
|
constructor(e) {
|
|
@@ -996,7 +997,7 @@ class Cr {
|
|
|
996
997
|
}), h = n.name, p = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
|
|
997
998
|
let E = e.placeholder, y = e.show;
|
|
998
999
|
y === void 0 && (y = !0);
|
|
999
|
-
let g = e.label ?? "", O;
|
|
1000
|
+
let g = (Ve(e.label) ? e.label() : e.label) ?? "", O;
|
|
1000
1001
|
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Q((Ce = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : Ce.call(O, e.label ?? "", t + 1), "")), !E) {
|
|
1001
1002
|
let N = "请输入";
|
|
1002
1003
|
o.isUndefined(h) ? E = `${N}${g}` : /* @ts-expect-error */ b[h.toLowerCase()] ? (N = // @ts-expect-error
|
|
@@ -1004,27 +1005,27 @@ class Cr {
|
|
|
1004
1005
|
h.toLowerCase().includes(Se.toLowerCase()) && (N = b[Se]);
|
|
1005
1006
|
}), E = `${N}${g}`);
|
|
1006
1007
|
}
|
|
1007
|
-
const
|
|
1008
|
+
const Te = this.runtimeAdapter.getRuntimeRequired({
|
|
1008
1009
|
...e,
|
|
1009
1010
|
label: g
|
|
1010
|
-
}),
|
|
1011
|
+
}), ze = x.getItemContainer(this), Le = x.getFormItemContainer(this), He = this, De = e.componentSlots, P = (Ie = d.presets.uiPresets[this.ui]) == null ? void 0 : Ie.display;
|
|
1011
1012
|
let X;
|
|
1012
1013
|
return !o.isUndefined(P == null ? void 0 : P.labelPrefix) && !o.isNull(P == null ? void 0 : P.labelPrefix) ? X = `${g}${P == null ? void 0 : P.labelPrefix}` : X = `${g}:`, m("div", {
|
|
1013
1014
|
style: u
|
|
1014
|
-
}, [m(
|
|
1015
|
+
}, [m(ze, {
|
|
1015
1016
|
show: y
|
|
1016
1017
|
}, {
|
|
1017
1018
|
default() {
|
|
1018
|
-
return y && m(
|
|
1019
|
+
return y && m(Le, q(f, {
|
|
1019
1020
|
label: `${g ? X : ""}`
|
|
1020
|
-
}, c,
|
|
1021
|
+
}, c, Te), {
|
|
1021
1022
|
default() {
|
|
1022
|
-
return
|
|
1023
|
+
return He.runtimeAdapter.formComponentRenderer({
|
|
1023
1024
|
Component: n,
|
|
1024
1025
|
schema: e,
|
|
1025
1026
|
baseModel: i,
|
|
1026
1027
|
placeholder: E,
|
|
1027
|
-
componentSlots:
|
|
1028
|
+
componentSlots: De,
|
|
1028
1029
|
props: p
|
|
1029
1030
|
});
|
|
1030
1031
|
},
|
|
@@ -1081,16 +1082,16 @@ class Cr {
|
|
|
1081
1082
|
} = {}) {
|
|
1082
1083
|
var p;
|
|
1083
1084
|
const h = c ?? m("button", null, null);
|
|
1084
|
-
return
|
|
1085
|
+
return Ke(m(h, {
|
|
1085
1086
|
onClick: () => i.deleteListItem(e, f)
|
|
1086
|
-
}, null), [[
|
|
1087
|
+
}, null), [[We, ((p = i.model.value[e.field]) == null ? void 0 : p.length) > 1]]);
|
|
1087
1088
|
}
|
|
1088
1089
|
}));
|
|
1089
1090
|
},
|
|
1090
1091
|
add({
|
|
1091
1092
|
container: u
|
|
1092
1093
|
} = {}) {
|
|
1093
|
-
const f = u ?? m("button", null, [
|
|
1094
|
+
const f = u ?? m("button", null, [Xe("添加")]);
|
|
1094
1095
|
return m(f, {
|
|
1095
1096
|
onClick: () => i.addListItem(e)
|
|
1096
1097
|
}, null);
|
|
@@ -1400,7 +1401,7 @@ const I = {
|
|
|
1400
1401
|
adapters: {
|
|
1401
1402
|
...Ir
|
|
1402
1403
|
}
|
|
1403
|
-
}, Or = /* @__PURE__ */
|
|
1404
|
+
}, Or = /* @__PURE__ */ Ze({
|
|
1404
1405
|
props: {
|
|
1405
1406
|
setup: {
|
|
1406
1407
|
type: Function,
|
|
@@ -3,6 +3,7 @@ import type { RuntimeCore } from "../services";
|
|
|
3
3
|
import { WatchStopHandle } from "vue";
|
|
4
4
|
export type Setup = (runtimeCore: RuntimeCore) => any;
|
|
5
5
|
export type SubscribeUtils = {
|
|
6
|
+
reactiveModel: AnyObject;
|
|
6
7
|
stopSubscribe: WatchStopHandle;
|
|
7
8
|
};
|
|
8
9
|
export type SubscribeCallback = (value: any, utils: SubscribeUtils) => any;
|