@king-one/antdv 2.8.11 → 2.9.0
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/es/components/index.mjs +36 -35
- package/dist/es/components/pro-form-render/index.mjs +11 -8
- package/dist/es/components/pro-form-render/src/index.vue2.mjs +53 -50
- package/dist/es/components/pro-form-render/src/v-model.vue.mjs +4 -0
- package/dist/es/components/pro-form-render/src/v-model.vue2.mjs +101 -0
- package/dist/es/index.mjs +36 -35
- package/dist/lib/components/index.js +1 -1
- package/dist/lib/components/pro-form-render/index.js +1 -1
- package/dist/lib/components/pro-form-render/src/index.vue2.js +1 -1
- package/dist/lib/components/pro-form-render/src/v-model.vue.js +1 -0
- package/dist/lib/components/pro-form-render/src/v-model.vue2.js +1 -0
- package/dist/lib/index.js +1 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/components/pro-form-render/index.d.ts +711 -0
- package/dist/types/components/pro-form-render/src/__tests__/v-model.test.d.ts +1 -0
- package/dist/types/components/pro-form-render/src/v-model.vue.d.ts +724 -0
- package/package.json +4 -2
|
@@ -1,61 +1,62 @@
|
|
|
1
1
|
import { KCollapseTranstion as p } from "./collapse-transtion/index.mjs";
|
|
2
2
|
import { KProModal as K } from "./pro-modal/index.mjs";
|
|
3
|
-
import { KProTitle as
|
|
3
|
+
import { KProTitle as x } from "./pro-title/index.mjs";
|
|
4
4
|
import { KScrollBar as a } from "./scroll-bar/index.mjs";
|
|
5
5
|
import { KCoverScrollBar as c } from "./cover-scroll-bar/index.mjs";
|
|
6
6
|
import { KScaleVirtualList as S } from "./scale-virtual-list/index.mjs";
|
|
7
|
-
import { KProTag as
|
|
8
|
-
import { KProPicker as
|
|
9
|
-
import { KProArea as
|
|
10
|
-
import { KProSignature as
|
|
11
|
-
import { KProTable as
|
|
12
|
-
import { KIcon as
|
|
13
|
-
import { KProUpload as
|
|
14
|
-
import { KProContractView as
|
|
7
|
+
import { KProTag as s } from "./pro-tag/index.mjs";
|
|
8
|
+
import { KProPicker as u } from "./pro-picker/index.mjs";
|
|
9
|
+
import { KProArea as T } from "./pro-area/index.mjs";
|
|
10
|
+
import { KProSignature as g } from "./pro-signature/index.mjs";
|
|
11
|
+
import { KProTable as R } from "./pro-table/index.mjs";
|
|
12
|
+
import { KIcon as G } from "./icon/index.mjs";
|
|
13
|
+
import { KProUpload as b } from "./pro-upload/index.mjs";
|
|
14
|
+
import { KProContractView as y } from "./pro-contract-view/index.mjs";
|
|
15
15
|
import "./pro-loading/index.mjs";
|
|
16
|
-
import { KPlusUpload as
|
|
17
|
-
import { KProOverlay as
|
|
18
|
-
import { KProSign as
|
|
19
|
-
import { KUserSelector as
|
|
16
|
+
import { KPlusUpload as D } from "./plus-upload/index.mjs";
|
|
17
|
+
import { KProOverlay as M } from "./pro-overlay/index.mjs";
|
|
18
|
+
import { KProSign as w } from "./pro-sign/index.mjs";
|
|
19
|
+
import { KUserSelector as L, KUserSelectorCheckbox as O } from "./pro-selector/index.mjs";
|
|
20
20
|
import { KProUserAvatar as q, KUserAvatar as z } from "./pro-user-avatar/index.mjs";
|
|
21
21
|
import { KProRoleSelector as H, KRoleSelector as J } from "./role-selector/index.mjs";
|
|
22
22
|
import { KDeptSelector as Q } from "./dept-selector/index.mjs";
|
|
23
23
|
import { KProTagGroup as X } from "./pro-tag-group/index.mjs";
|
|
24
|
-
import { KFormRender as Z } from "./pro-form-render/index.mjs";
|
|
25
|
-
import { KProCell as
|
|
26
|
-
import { KProCellGroup as
|
|
27
|
-
import { KProSelectorGroup as
|
|
28
|
-
import { KProDynamicTags as
|
|
24
|
+
import { KFormRender as Z, KFormRenderVModel as _ } from "./pro-form-render/index.mjs";
|
|
25
|
+
import { KProCell as rr } from "./pro-cell/index.mjs";
|
|
26
|
+
import { KProCellGroup as er } from "./pro-cell-group/index.mjs";
|
|
27
|
+
import { KProSelectorGroup as pr } from "./pro-selector-group/index.mjs";
|
|
28
|
+
import { KProDynamicTags as Kr } from "./pro-dynamic-tags/index.mjs";
|
|
29
29
|
import "./hooks/index.mjs";
|
|
30
30
|
export {
|
|
31
31
|
p as KCollapseTranstion,
|
|
32
32
|
c as KCoverScrollBar,
|
|
33
33
|
Q as KDeptSelector,
|
|
34
34
|
Z as KFormRender,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
_ as KFormRenderVModel,
|
|
36
|
+
G as KIcon,
|
|
37
|
+
D as KPlusUpload,
|
|
38
|
+
T as KProArea,
|
|
39
|
+
rr as KProCell,
|
|
40
|
+
er as KProCellGroup,
|
|
41
|
+
y as KProContractView,
|
|
42
|
+
Kr as KProDynamicTags,
|
|
42
43
|
K as KProModal,
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
M as KProOverlay,
|
|
45
|
+
u as KProPicker,
|
|
45
46
|
H as KProRoleSelector,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
pr as KProSelectorGroup,
|
|
48
|
+
w as KProSign,
|
|
49
|
+
g as KProSignature,
|
|
50
|
+
R as KProTable,
|
|
51
|
+
s as KProTag,
|
|
51
52
|
X as KProTagGroup,
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
x as KProTitle,
|
|
54
|
+
b as KProUpload,
|
|
54
55
|
q as KProUserAvatar,
|
|
55
56
|
J as KRoleSelector,
|
|
56
57
|
S as KScaleVirtualList,
|
|
57
58
|
a as KScrollBar,
|
|
58
59
|
z as KUserAvatar,
|
|
59
|
-
|
|
60
|
+
L as KUserSelector,
|
|
60
61
|
O as KUserSelectorCheckbox
|
|
61
62
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { withInstall as
|
|
1
|
+
import { withInstall as o } from "../utils/install.mjs";
|
|
2
2
|
import "./src/index.vue.mjs";
|
|
3
|
+
import "./src/v-model.vue.mjs";
|
|
3
4
|
import "./src/style/index.mjs";
|
|
4
|
-
import { FormItemProps as
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { FormItemProps as l, FormRenderProps as F } from "./src/types.mjs";
|
|
6
|
+
import r from "./src/index.vue2.mjs";
|
|
7
|
+
import m from "./src/v-model.vue2.mjs";
|
|
8
|
+
const f = o(r), a = o(m);
|
|
7
9
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
l as FormItemProps,
|
|
11
|
+
F as FormRenderProps,
|
|
12
|
+
f as KFormRender,
|
|
13
|
+
a as KFormRenderVModel,
|
|
14
|
+
f as default
|
|
12
15
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as S, ref as c, computed as
|
|
2
|
-
import { Form as q, FormItem as K, Collapse as
|
|
3
|
-
import { FormRenderProps as
|
|
1
|
+
import { defineComponent as S, ref as c, computed as E, watch as y, watchEffect as R, createBlock as m, openBlock as s, unref as i, mergeProps as P, withCtx as p, createElementBlock as C, Fragment as D, renderList as U, resolveDynamicComponent as b } from "vue";
|
|
2
|
+
import { Form as q, FormItem as K, Collapse as N, CollapsePanel as O } from "ant-design-vue";
|
|
3
|
+
import { FormRenderProps as j } from "./types.mjs";
|
|
4
4
|
import "./module/index.mjs";
|
|
5
|
-
import { formatFormItems as
|
|
5
|
+
import { formatFormItems as w, getMesg as B } from "./utils.mjs";
|
|
6
6
|
import J from "./module/AioArraySubForm.vue.mjs";
|
|
7
7
|
import L from "./module/AioKeyValue.vue.mjs";
|
|
8
8
|
import M from "./module/AioSubForm.vue.mjs";
|
|
@@ -17,7 +17,7 @@ import Y from "./module/AioInput.vue.mjs";
|
|
|
17
17
|
const ye = /* @__PURE__ */ S({
|
|
18
18
|
name: "ProFormRender",
|
|
19
19
|
__name: "index",
|
|
20
|
-
props:
|
|
20
|
+
props: j,
|
|
21
21
|
emits: ["change"],
|
|
22
22
|
setup(h, { expose: F, emit: V }) {
|
|
23
23
|
const u = h, k = V, v = {
|
|
@@ -32,107 +32,110 @@ const ye = /* @__PURE__ */ S({
|
|
|
32
32
|
AioSubForm: M,
|
|
33
33
|
AioKeyValue: L,
|
|
34
34
|
AioArraySubForm: J
|
|
35
|
-
},
|
|
35
|
+
}, l = c({}), g = c(), _ = c({}), A = c([]), d = E(() => u.formItems ? Array.isArray(u.formItems) ? w(u.formItems) : [] : []);
|
|
36
36
|
y(() => u.formItems, (e) => {
|
|
37
37
|
e && k("change", e);
|
|
38
38
|
}, { deep: !0 }), y(() => u.modelValue, (e) => {
|
|
39
39
|
e !== void 0 && d.value.forEach((o) => {
|
|
40
|
-
o.key in e && (
|
|
40
|
+
o.key in e && (l.value[o.key] = e[o.key]);
|
|
41
41
|
});
|
|
42
|
-
}, { deep: !0, immediate: !0 }), y(
|
|
42
|
+
}, { deep: !0, immediate: !0 }), y(l, (e) => {
|
|
43
43
|
k("change", e);
|
|
44
|
-
}, { deep: !0 }),
|
|
44
|
+
}, { deep: !0 }), R(() => {
|
|
45
45
|
d.value.forEach((e) => {
|
|
46
46
|
if (u.modelValue !== void 0 && e.key in u.modelValue)
|
|
47
|
-
|
|
48
|
-
else
|
|
47
|
+
l.value[e.key] !== u.modelValue[e.key] && (l.value[e.key] = u.modelValue[e.key]);
|
|
48
|
+
else {
|
|
49
|
+
const o = l.value[e.key], r = !(e.key in l.value);
|
|
49
50
|
if (e.type === "AioSubForm" && Array.isArray(e.elements)) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
if (r || o === null || o === void 0) {
|
|
52
|
+
const a = {};
|
|
53
|
+
e.elements.forEach((f) => {
|
|
54
|
+
f.key !== void 0 && (a[f.key] = f.defaultValue);
|
|
55
|
+
}), l.value[e.key] = a;
|
|
56
|
+
}
|
|
57
|
+
} else r && (l.value[e.key] = e.defaultValue);
|
|
58
|
+
}
|
|
56
59
|
});
|
|
57
60
|
});
|
|
58
61
|
function $(e) {
|
|
59
|
-
var
|
|
62
|
+
var a;
|
|
60
63
|
if (e.type === "AioArrayInput")
|
|
61
64
|
return [{ required: e.required ?? !1, message: "", trigger: ["blur", "change"] }];
|
|
62
|
-
const o =
|
|
65
|
+
const o = B(e), r = [
|
|
63
66
|
{ required: e.required ?? !1, message: o, trigger: ["blur", "change"] }
|
|
64
67
|
];
|
|
65
|
-
if ((
|
|
66
|
-
const
|
|
68
|
+
if ((a = e.properties) != null && a.regex) {
|
|
69
|
+
const f = new RegExp(e.properties.regex);
|
|
67
70
|
r.push({
|
|
68
|
-
pattern:
|
|
71
|
+
pattern: f,
|
|
69
72
|
message: e.properties.regexMessage || "格式不正确",
|
|
70
73
|
trigger: ["blur", "change"]
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
76
|
return r;
|
|
74
77
|
}
|
|
75
|
-
function
|
|
78
|
+
function x(e) {
|
|
76
79
|
g.value.validate().then(() => {
|
|
77
|
-
var
|
|
78
|
-
const o = JSON.parse(JSON.stringify(
|
|
80
|
+
var f;
|
|
81
|
+
const o = JSON.parse(JSON.stringify(l.value)), r = u.formItems.filter((t) => t.type === "AioArrayInput").map((t) => t.key);
|
|
79
82
|
Object.keys(o).forEach((t) => {
|
|
80
|
-
r.includes(t) && (o[t] = o[t].map((
|
|
83
|
+
r.includes(t) && (o[t] = o[t].map((n) => typeof n == "object" && n !== null && Object.keys(n).length === 1 && "value" in n ? n.value : n));
|
|
81
84
|
});
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
}), (
|
|
85
|
+
const a = u.formItems.filter((t) => t.type === "AioSubForm");
|
|
86
|
+
a.length > 0 && a.forEach((t) => {
|
|
87
|
+
const n = _.value[t.key];
|
|
88
|
+
n && n.validate ? n.validate() : console.log(`${t.key} 的 validate 方法不存在或组件引用为空`);
|
|
89
|
+
}), (f = e.success) == null || f.call(e, o);
|
|
87
90
|
}).catch((o) => {
|
|
88
91
|
var r;
|
|
89
92
|
console.log("表单校验失败:", o), (r = e.error) == null || r.call(e, o);
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
95
|
+
function I() {
|
|
96
|
+
return l.value;
|
|
94
97
|
}
|
|
95
98
|
return F({
|
|
96
|
-
submit:
|
|
97
|
-
getFormData:
|
|
98
|
-
}), (e, o) => (
|
|
99
|
+
submit: x,
|
|
100
|
+
getFormData: I
|
|
101
|
+
}), (e, o) => (s(), m(i(q), P({
|
|
99
102
|
ref_key: "formRef",
|
|
100
103
|
ref: g,
|
|
101
|
-
model:
|
|
104
|
+
model: l.value,
|
|
102
105
|
"label-col": { span: 8 },
|
|
103
106
|
style: { width: "360px" }
|
|
104
107
|
}, e.$attrs), {
|
|
105
108
|
default: p(() => [
|
|
106
|
-
(
|
|
109
|
+
(s(!0), C(
|
|
107
110
|
D,
|
|
108
111
|
null,
|
|
109
|
-
U(d.value, (r) => (
|
|
112
|
+
U(d.value, (r) => (s(), m(i(K), {
|
|
110
113
|
key: r.key,
|
|
111
114
|
label: r.type === "AioSubForm" ? "" : r.label,
|
|
112
115
|
name: r.key,
|
|
113
116
|
rules: $(r)
|
|
114
117
|
}, {
|
|
115
118
|
default: p(() => [
|
|
116
|
-
r.type === "AioSubForm" ? (
|
|
119
|
+
r.type === "AioSubForm" ? (s(), m(i(N), {
|
|
117
120
|
key: 0,
|
|
118
121
|
"active-key": A.value,
|
|
119
|
-
"onUpdate:activeKey": o[0] || (o[0] = (
|
|
122
|
+
"onUpdate:activeKey": o[0] || (o[0] = (a) => A.value = a),
|
|
120
123
|
bordered: !0
|
|
121
124
|
}, {
|
|
122
125
|
default: p(() => [
|
|
123
|
-
(
|
|
126
|
+
(s(), m(i(O), {
|
|
124
127
|
key: r.key,
|
|
125
128
|
header: r.label,
|
|
126
129
|
forceRender: !0
|
|
127
130
|
}, {
|
|
128
131
|
default: p(() => [
|
|
129
|
-
(
|
|
132
|
+
(s(), m(b(v[r.type]), {
|
|
130
133
|
ref_for: !0,
|
|
131
|
-
ref: r.type === "AioSubForm" ? (
|
|
132
|
-
|
|
134
|
+
ref: r.type === "AioSubForm" ? (a) => {
|
|
135
|
+
a && (_.value[r.key] = a);
|
|
133
136
|
} : void 0,
|
|
134
|
-
modelValue:
|
|
135
|
-
"onUpdate:modelValue": (
|
|
137
|
+
modelValue: l.value[r.key],
|
|
138
|
+
"onUpdate:modelValue": (a) => l.value[r.key] = a,
|
|
136
139
|
"form-item": r
|
|
137
140
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "form-item"]))
|
|
138
141
|
]),
|
|
@@ -142,10 +145,10 @@ const ye = /* @__PURE__ */ S({
|
|
|
142
145
|
]),
|
|
143
146
|
_: 2
|
|
144
147
|
/* DYNAMIC */
|
|
145
|
-
}, 1032, ["active-key"])) : (
|
|
148
|
+
}, 1032, ["active-key"])) : (s(), m(b(v[r.type]), {
|
|
146
149
|
key: 1,
|
|
147
|
-
modelValue:
|
|
148
|
-
"onUpdate:modelValue": (
|
|
150
|
+
modelValue: l.value[r.key],
|
|
151
|
+
"onUpdate:modelValue": (a) => l.value[r.key] = a,
|
|
149
152
|
"form-item": r
|
|
150
153
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "form-item"]))
|
|
151
154
|
]),
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent as O, ref as g, watch as h, createBlock as x, openBlock as T, mergeProps as w } from "vue";
|
|
2
|
+
import "./index.vue.mjs";
|
|
3
|
+
import B from "./index.vue2.mjs";
|
|
4
|
+
const $ = /* @__PURE__ */ O({
|
|
5
|
+
name: "ProFormRenderVModel",
|
|
6
|
+
__name: "v-model",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: Object,
|
|
10
|
+
default: () => ({})
|
|
11
|
+
},
|
|
12
|
+
formItems: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: () => []
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue", "change"],
|
|
18
|
+
setup(F, { expose: b, emit: k }) {
|
|
19
|
+
const u = F, d = k, i = g(), A = g([]);
|
|
20
|
+
function v(e, l) {
|
|
21
|
+
return !e || e.length === 0 ? [] : !l || Object.keys(l).length === 0 ? JSON.parse(JSON.stringify(e)) : e.map((a) => {
|
|
22
|
+
const s = { ...a }, r = l[a.key];
|
|
23
|
+
return r != null && (a.type === "AioSubForm" && a.elements ? s.elements = a.elements.map((t) => {
|
|
24
|
+
const n = r == null ? void 0 : r[t.key];
|
|
25
|
+
return {
|
|
26
|
+
...t,
|
|
27
|
+
defaultValue: n !== void 0 ? n : t.defaultValue
|
|
28
|
+
};
|
|
29
|
+
}) : (a.type === "AioArraySubForm" && a.elements, s.defaultValue = r)), s;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function I(e) {
|
|
33
|
+
return !e || typeof e != "object" ? !1 : "type" in e && "key" in e;
|
|
34
|
+
}
|
|
35
|
+
function f(e) {
|
|
36
|
+
return !Array.isArray(e) || e.length === 0 ? !1 : I(e[0]);
|
|
37
|
+
}
|
|
38
|
+
function c(e, l, a) {
|
|
39
|
+
const s = {};
|
|
40
|
+
for (const r in e) {
|
|
41
|
+
const t = e[r], n = l.find((m) => m.key === r), o = a == null ? void 0 : a[r];
|
|
42
|
+
if (f(t)) {
|
|
43
|
+
o !== void 0 && !f(o) && (s[r] = o);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
(n == null ? void 0 : n.type) === "AioSubForm" && n.elements ? t && typeof t == "object" && !Array.isArray(t) ? s[r] = c(t, n.elements, o) : o && typeof o == "object" && !Array.isArray(o) && (s[r] = o) : (n == null ? void 0 : n.type) === "AioArraySubForm" && n.elements ? Array.isArray(t) && !f(t) ? s[r] = t.map((m, C) => {
|
|
47
|
+
const R = Array.isArray(o) ? o[C] : void 0;
|
|
48
|
+
return typeof m == "object" ? c(m, n.elements, R) : m;
|
|
49
|
+
}) : Array.isArray(o) && !f(o) && (s[r] = o) : s[r] = t;
|
|
50
|
+
}
|
|
51
|
+
return s;
|
|
52
|
+
}
|
|
53
|
+
let y = !1, p = !1;
|
|
54
|
+
function V() {
|
|
55
|
+
u.formItems && u.formItems.length > 0 && (p = !0, A.value = v(u.formItems, u.modelValue), setTimeout(() => {
|
|
56
|
+
p = !1;
|
|
57
|
+
}, 50));
|
|
58
|
+
}
|
|
59
|
+
h(
|
|
60
|
+
() => u.formItems,
|
|
61
|
+
() => {
|
|
62
|
+
V();
|
|
63
|
+
},
|
|
64
|
+
{ deep: !0, immediate: !0 }
|
|
65
|
+
), h(
|
|
66
|
+
() => u.modelValue,
|
|
67
|
+
() => {
|
|
68
|
+
y || u.formItems && u.formItems.length > 0 && V();
|
|
69
|
+
},
|
|
70
|
+
{ deep: !0 }
|
|
71
|
+
);
|
|
72
|
+
function _(e) {
|
|
73
|
+
if (p || f(e))
|
|
74
|
+
return;
|
|
75
|
+
const l = c(e, u.formItems, u.modelValue);
|
|
76
|
+
y = !0, d("update:modelValue", l), d("change", l), setTimeout(() => {
|
|
77
|
+
y = !1;
|
|
78
|
+
}, 0);
|
|
79
|
+
}
|
|
80
|
+
function S(e) {
|
|
81
|
+
var l;
|
|
82
|
+
(l = i.value) == null || l.submit(e);
|
|
83
|
+
}
|
|
84
|
+
function j() {
|
|
85
|
+
var e;
|
|
86
|
+
return ((e = i.value) == null ? void 0 : e.getFormData()) ?? {};
|
|
87
|
+
}
|
|
88
|
+
return b({
|
|
89
|
+
submit: S,
|
|
90
|
+
getFormData: j
|
|
91
|
+
}), (e, l) => (T(), x(B, w({
|
|
92
|
+
ref_key: "formRenderRef",
|
|
93
|
+
ref: i,
|
|
94
|
+
"form-items": A.value,
|
|
95
|
+
"model-value": u.modelValue
|
|
96
|
+
}, e.$attrs, { onChange: _ }), null, 16, ["form-items", "model-value"]));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
$ as default
|
|
101
|
+
};
|
package/dist/es/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import "./hooks/index.mjs";
|
|
|
4
4
|
import { collapseProps as f } from "./components/collapse-transtion/src/types.mjs";
|
|
5
5
|
import { KCollapseTranstion as l } from "./components/collapse-transtion/index.mjs";
|
|
6
6
|
import { useProModal as P, useProModalInit as a } from "./components/pro-modal/hooks/useProModal.mjs";
|
|
7
|
-
import { KProModal as
|
|
7
|
+
import { KProModal as K } from "./components/pro-modal/index.mjs";
|
|
8
8
|
import { TitleProps as n } from "./components/pro-title/src/types.mjs";
|
|
9
9
|
import { KProTitle as S } from "./components/pro-title/index.mjs";
|
|
10
10
|
import { scrollbarProps as g } from "./components/scroll-bar/src/types.mjs";
|
|
@@ -12,9 +12,9 @@ import { KScrollBar as U } from "./components/scroll-bar/index.mjs";
|
|
|
12
12
|
import { CoverScrollbarProps as E } from "./components/cover-scroll-bar/src/types.mjs";
|
|
13
13
|
import { KCoverScrollBar as _ } from "./components/cover-scroll-bar/index.mjs";
|
|
14
14
|
import { KScaleVirtualList as A } from "./components/scale-virtual-list/index.mjs";
|
|
15
|
-
import { proTagProps as
|
|
16
|
-
import { KProTag as
|
|
17
|
-
import { PickerApiEnum as
|
|
15
|
+
import { proTagProps as F } from "./components/pro-tag/src/types.mjs";
|
|
16
|
+
import { KProTag as L } from "./components/pro-tag/index.mjs";
|
|
17
|
+
import { PickerApiEnum as k, ProPickerProps as v } from "./components/pro-picker/src/types.mjs";
|
|
18
18
|
import { KProPicker as M } from "./components/pro-picker/index.mjs";
|
|
19
19
|
import { ProAreaProps as B } from "./components/pro-area/src/types.mjs";
|
|
20
20
|
import { useProArea as h } from "./components/pro-area/hooks/use-pro-area.mjs";
|
|
@@ -31,14 +31,14 @@ import { useProContractView as fr } from "./components/pro-contract-view/hooks/u
|
|
|
31
31
|
import { KProContractView as lr } from "./components/pro-contract-view/index.mjs";
|
|
32
32
|
import { default as Pr } from "./components/pro-loading/src/pro-loading.mjs";
|
|
33
33
|
import { KPlusUpload as ir } from "./components/plus-upload/index.mjs";
|
|
34
|
-
import { KProOverlay as
|
|
34
|
+
import { KProOverlay as cr } from "./components/pro-overlay/index.mjs";
|
|
35
35
|
import { onSignConfirm as ur, onSignInit as Sr, onSignSuccess as dr } from "./components/pro-sign/src/effects/onEffects.mjs";
|
|
36
36
|
import { initProSign as Tr } from "./components/pro-sign/src/core/index.mjs";
|
|
37
37
|
import { useProSign as Cr } from "./components/pro-sign/src/hook/useProSign.mjs";
|
|
38
38
|
import { KProSign as Rr } from "./components/pro-sign/index.mjs";
|
|
39
|
-
import { GTE_ORGTREE_URL as Gr, UserSelectorProps as Ar, selectUserContextKey as br, userSelectorEmits as
|
|
40
|
-
import { useUserSelector as
|
|
41
|
-
import { KUserSelector as
|
|
39
|
+
import { GTE_ORGTREE_URL as Gr, UserSelectorProps as Ar, selectUserContextKey as br, userSelectorEmits as Fr } from "./components/pro-selector/src/types.mjs";
|
|
40
|
+
import { useUserSelector as Lr } from "./components/pro-selector/src/hooks/useUserSelector.mjs";
|
|
41
|
+
import { KUserSelector as kr, KUserSelectorCheckbox as vr } from "./components/pro-selector/index.mjs";
|
|
42
42
|
import { default as Mr } from "./components/pro-selector/src/pro-user.mjs";
|
|
43
43
|
import { default as Br } from "./components/pro-selector/src/components/user.mjs";
|
|
44
44
|
import { KProUserAvatar as hr, KUserAvatar as wr } from "./components/pro-user-avatar/index.mjs";
|
|
@@ -49,15 +49,15 @@ import { KDeptSelector as ro } from "./components/dept-selector/index.mjs";
|
|
|
49
49
|
import { ProTagGroupProps as eo } from "./components/pro-tag-group/src/types.mjs";
|
|
50
50
|
import { KProTagGroup as po } from "./components/pro-tag-group/index.mjs";
|
|
51
51
|
import { FormItemProps as fo, FormRenderProps as xo } from "./components/pro-form-render/src/types.mjs";
|
|
52
|
-
import { KFormRender as so } from "./components/pro-form-render/index.mjs";
|
|
53
|
-
import { KProCell as
|
|
52
|
+
import { KFormRender as so, KFormRenderVModel as Po } from "./components/pro-form-render/index.mjs";
|
|
53
|
+
import { KProCell as io } from "./components/pro-cell/index.mjs";
|
|
54
54
|
import { PRO_CELL_GROUP_KEY as co } from "./components/pro-cell-group/src/types.mjs";
|
|
55
|
-
import { KProCellGroup as
|
|
56
|
-
import { selectContextKey as
|
|
57
|
-
import { KProSelectorGroup as
|
|
58
|
-
import { KProDynamicTags as
|
|
59
|
-
import { setupAppConfig as
|
|
60
|
-
import { useProForm as
|
|
55
|
+
import { KProCellGroup as uo } from "./components/pro-cell-group/index.mjs";
|
|
56
|
+
import { selectContextKey as go } from "./components/pro-selector-group/src/types.mjs";
|
|
57
|
+
import { KProSelectorGroup as Uo } from "./components/pro-selector-group/index.mjs";
|
|
58
|
+
import { KProDynamicTags as Eo } from "./components/pro-dynamic-tags/index.mjs";
|
|
59
|
+
import { setupAppConfig as _o, useBasicAppConfig as Go } from "./components/hooks/use-basic-app-config.mjs";
|
|
60
|
+
import { useProForm as bo, useProFormInit as Fo } from "./hooks/useProForm.mjs";
|
|
61
61
|
import { useModelValue as Lo } from "./hooks/useModelValue.mjs";
|
|
62
62
|
export {
|
|
63
63
|
E as CoverScrollbarProps,
|
|
@@ -70,22 +70,23 @@ export {
|
|
|
70
70
|
_ as KCoverScrollBar,
|
|
71
71
|
ro as KDeptSelector,
|
|
72
72
|
so as KFormRender,
|
|
73
|
+
Po as KFormRenderVModel,
|
|
73
74
|
Z as KIcon,
|
|
74
75
|
ir as KPlusUpload,
|
|
75
76
|
N as KProArea,
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
io as KProCell,
|
|
78
|
+
uo as KProCellGroup,
|
|
78
79
|
lr as KProContractView,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
Eo as KProDynamicTags,
|
|
81
|
+
K as KProModal,
|
|
82
|
+
cr as KProOverlay,
|
|
82
83
|
M as KProPicker,
|
|
83
84
|
Hr as KProRoleSelector,
|
|
84
|
-
|
|
85
|
+
Uo as KProSelectorGroup,
|
|
85
86
|
Rr as KProSign,
|
|
86
87
|
z as KProSignature,
|
|
87
88
|
W as KProTable,
|
|
88
|
-
|
|
89
|
+
L as KProTag,
|
|
89
90
|
po as KProTagGroup,
|
|
90
91
|
S as KProTitle,
|
|
91
92
|
pr as KProUpload,
|
|
@@ -95,12 +96,12 @@ export {
|
|
|
95
96
|
A as KScaleVirtualList,
|
|
96
97
|
U as KScrollBar,
|
|
97
98
|
wr as KUserAvatar,
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
kr as KUserSelector,
|
|
100
|
+
vr as KUserSelectorCheckbox,
|
|
100
101
|
co as PRO_CELL_GROUP_KEY,
|
|
101
|
-
|
|
102
|
+
k as PickerApiEnum,
|
|
102
103
|
B as ProAreaProps,
|
|
103
|
-
|
|
104
|
+
v as ProPickerProps,
|
|
104
105
|
j as ProSignatureProps,
|
|
105
106
|
eo as ProTagGroupProps,
|
|
106
107
|
Mr as ProUserSelector,
|
|
@@ -116,24 +117,24 @@ export {
|
|
|
116
117
|
ur as onSignConfirm,
|
|
117
118
|
Sr as onSignInit,
|
|
118
119
|
dr as onSignSuccess,
|
|
119
|
-
|
|
120
|
+
F as proTagProps,
|
|
120
121
|
jr as roleSelectorEmits,
|
|
121
122
|
qr as roleSelectorProps,
|
|
122
123
|
g as scrollbarProps,
|
|
123
|
-
|
|
124
|
+
go as selectContextKey,
|
|
124
125
|
br as selectUserContextKey,
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
_o as setupAppConfig,
|
|
127
|
+
Go as useBasicAppConfig,
|
|
127
128
|
Lo as useModelValue,
|
|
128
129
|
h as useProArea,
|
|
129
130
|
fr as useProContractView,
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
bo as useProForm,
|
|
132
|
+
Fo as useProFormInit,
|
|
132
133
|
P as useProModal,
|
|
133
134
|
a as useProModalInit,
|
|
134
135
|
Cr as useProSign,
|
|
135
136
|
J as useProTable,
|
|
136
137
|
er as useUpload,
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
Lr as useUserSelector,
|
|
139
|
+
Fr as userSelectorEmits
|
|
139
140
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./collapse-transtion/index.js"),t=require("./pro-modal/index.js"),K=require("./pro-title/index.js"),l=require("./scroll-bar/index.js"),c=require("./cover-scroll-bar/index.js"),a=require("./scale-virtual-list/index.js"),s=require("./pro-tag/index.js"),u=require("./pro-picker/index.js"),d=require("./pro-area/index.js"),P=require("./pro-signature/index.js"),q=require("./pro-table/index.js"),x=require("./icon/index.js"),$=require("./pro-upload/index.js"),S=require("./pro-contract-view/index.js");require("./pro-loading/index.js");const p=require("./plus-upload/index.js"),g=require("./pro-overlay/index.js"),T=require("./pro-sign/index.js"),e=require("./pro-selector/index.js"),r=require("./pro-user-avatar/index.js"),o=require("./role-selector/index.js"),C=require("./dept-selector/index.js"),U=require("./pro-tag-group/index.js"),i=require("./pro-form-render/index.js"),v=require("./pro-cell/index.js"),m=require("./pro-cell-group/index.js"),R=require("./pro-selector-group/index.js"),b=require("./pro-dynamic-tags/index.js");require("./hooks/index.js");exports.KCollapseTranstion=n.KCollapseTranstion;exports.KProModal=t.KProModal;exports.KProTitle=K.KProTitle;exports.KScrollBar=l.KScrollBar;exports.KCoverScrollBar=c.KCoverScrollBar;exports.KScaleVirtualList=a.KScaleVirtualList;exports.KProTag=s.KProTag;exports.KProPicker=u.KProPicker;exports.KProArea=d.KProArea;exports.KProSignature=P.KProSignature;exports.KProTable=q.KProTable;exports.KIcon=x.KIcon;exports.KProUpload=$.KProUpload;exports.KProContractView=S.KProContractView;exports.KPlusUpload=p.KPlusUpload;exports.KProOverlay=g.KProOverlay;exports.KProSign=T.KProSign;exports.KUserSelector=e.KUserSelector;exports.KUserSelectorCheckbox=e.KUserSelectorCheckbox;exports.KProUserAvatar=r.KProUserAvatar;exports.KUserAvatar=r.KUserAvatar;exports.KProRoleSelector=o.KProRoleSelector;exports.KRoleSelector=o.KRoleSelector;exports.KDeptSelector=C.KDeptSelector;exports.KProTagGroup=U.KProTagGroup;exports.KFormRender=i.KFormRender;exports.KFormRenderVModel=i.KFormRenderVModel;exports.KProCell=v.KProCell;exports.KProCellGroup=m.KProCellGroup;exports.KProSelectorGroup=R.KProSelectorGroup;exports.KProDynamicTags=b.KProDynamicTags;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../utils/install.js");require("./src/index.vue.js");require("./src/v-model.vue.js");require("./src/style/index.js");const r=require("./src/types.js"),o=require("./src/index.vue2.js"),u=require("./src/v-model.vue2.js"),t=e.withInstall(o.default),s=e.withInstall(u.default);exports.FormItemProps=r.FormItemProps;exports.FormRenderProps=r.FormRenderProps;exports.KFormRender=t;exports.KFormRenderVModel=s;exports.default=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),i=require("ant-design-vue"),F=require("./types.js");require("./module/index.js");const k=require("./utils.js"),S=require("./module/AioArraySubForm.vue.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),i=require("ant-design-vue"),F=require("./types.js");require("./module/index.js");const k=require("./utils.js"),S=require("./module/AioArraySubForm.vue.js"),V=require("./module/AioKeyValue.vue.js"),x=require("./module/AioSubForm.vue.js"),I=require("./module/AioDatePicker.vue.js"),B=require("./module/AioArrayInput.vue.js"),w=require("./module/AioTimePicker.vue.js"),C=require("./module/AioTextarea.vue.js"),E=require("./module/AioSelect.vue.js"),P=require("./module/AioInputNumber.vue.js"),R=require("./module/AioSwitch.vue.js"),D=require("./module/AioInput.vue.js"),K=r.defineComponent({name:"ProFormRender",__name:"index",props:F.FormRenderProps,emits:["change"],setup(m,{expose:g,emit:A}){const n=m,p=A,_={AioInput:D.default,AioSwitch:R.default,AioInputNumber:P.default,AioSelect:E.default,AioTextarea:C.default,AioTimePicker:w.default,AioArrayInput:B.default,AioDatePicker:I.default,AioSubForm:x.default,AioKeyValue:V.default,AioArraySubForm:S.default},a=r.ref({}),y=r.ref(),d=r.ref({}),v=r.ref([]),f=r.computed(()=>n.formItems?Array.isArray(n.formItems)?k.formatFormItems(n.formItems):[]:[]);r.watch(()=>n.formItems,e=>{e&&p("change",e)},{deep:!0}),r.watch(()=>n.modelValue,e=>{e!==void 0&&f.value.forEach(t=>{t.key in e&&(a.value[t.key]=e[t.key])})},{deep:!0,immediate:!0}),r.watch(a,e=>{p("change",e)},{deep:!0}),r.watchEffect(()=>{f.value.forEach(e=>{if(n.modelValue!==void 0&&e.key in n.modelValue)a.value[e.key]!==n.modelValue[e.key]&&(a.value[e.key]=n.modelValue[e.key]);else{const t=a.value[e.key],u=!(e.key in a.value);if(e.type==="AioSubForm"&&Array.isArray(e.elements)){if(u||t===null||t===void 0){const o={};e.elements.forEach(c=>{c.key!==void 0&&(o[c.key]=c.defaultValue)}),a.value[e.key]=o}}else u&&(a.value[e.key]=e.defaultValue)}})});function h(e){var o;if(e.type==="AioArrayInput")return[{required:e.required??!1,message:"",trigger:["blur","change"]}];const t=k.getMesg(e),u=[{required:e.required??!1,message:t,trigger:["blur","change"]}];if((o=e.properties)!=null&&o.regex){const c=new RegExp(e.properties.regex);u.push({pattern:c,message:e.properties.regexMessage||"格式不正确",trigger:["blur","change"]})}return u}function b(e){y.value.validate().then(()=>{var c;const t=JSON.parse(JSON.stringify(a.value)),u=n.formItems.filter(l=>l.type==="AioArrayInput").map(l=>l.key);Object.keys(t).forEach(l=>{u.includes(l)&&(t[l]=t[l].map(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"value"in s?s.value:s))});const o=n.formItems.filter(l=>l.type==="AioSubForm");o.length>0&&o.forEach(l=>{const s=d.value[l.key];s&&s.validate?s.validate():console.log(`${l.key} 的 validate 方法不存在或组件引用为空`)}),(c=e.success)==null||c.call(e,t)}).catch(t=>{var u;console.log("表单校验失败:",t),(u=e.error)==null||u.call(e,t)})}function q(){return a.value}return g({submit:b,getFormData:q}),(e,t)=>(r.openBlock(),r.createBlock(r.unref(i.Form),r.mergeProps({ref_key:"formRef",ref:y,model:a.value,"label-col":{span:8},style:{width:"360px"}},e.$attrs),{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.value,u=>(r.openBlock(),r.createBlock(r.unref(i.FormItem),{key:u.key,label:u.type==="AioSubForm"?"":u.label,name:u.key,rules:h(u)},{default:r.withCtx(()=>[u.type==="AioSubForm"?(r.openBlock(),r.createBlock(r.unref(i.Collapse),{key:0,"active-key":v.value,"onUpdate:activeKey":t[0]||(t[0]=o=>v.value=o),bordered:!0},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.unref(i.CollapsePanel),{key:u.key,header:u.label,forceRender:!0},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_[u.type]),{ref_for:!0,ref:u.type==="AioSubForm"?o=>{o&&(d.value[u.key]=o)}:void 0,modelValue:a.value[u.key],"onUpdate:modelValue":o=>a.value[u.key]=o,"form-item":u},null,8,["modelValue","onUpdate:modelValue","form-item"]))]),_:2},1032,["header"]))]),_:2},1032,["active-key"])):(r.openBlock(),r.createBlock(r.resolveDynamicComponent(_[u.type]),{key:1,modelValue:a.value[u.key],"onUpdate:modelValue":o=>a.value[u.key]=o,"form-item":u},null,8,["modelValue","onUpdate:modelValue","form-item"]))]),_:2},1032,["label","name","rules"]))),128))]),_:1},16,["model"]))}});exports.default=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./v-model.vue2.js");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("vue");require("./index.vue.js");const O=require("./index.vue2.js"),R=f.defineComponent({name:"ProFormRenderVModel",__name:"v-model",props:{modelValue:{type:Object,default:()=>({})},formItems:{type:Array,default:()=>[]}},emits:["update:modelValue","change"],setup(_,{expose:h,emit:v}){const s=_,A=v,c=f.ref(),g=f.ref([]);function b(e,u){return!e||e.length===0?[]:!u||Object.keys(u).length===0?JSON.parse(JSON.stringify(e)):e.map(a=>{const l={...a},r=u[a.key];return r!=null&&(a.type==="AioSubForm"&&a.elements?l.elements=a.elements.map(t=>{const n=r==null?void 0:r[t.key];return{...t,defaultValue:n!==void 0?n:t.defaultValue}}):(a.type==="AioArraySubForm"&&a.elements,l.defaultValue=r)),l})}function F(e){return!e||typeof e!="object"?!1:"type"in e&&"key"in e}function i(e){return!Array.isArray(e)||e.length===0?!1:F(e[0])}function y(e,u,a){const l={};for(const r in e){const t=e[r],n=u.find(m=>m.key===r),o=a==null?void 0:a[r];if(i(t)){o!==void 0&&!i(o)&&(l[r]=o);continue}(n==null?void 0:n.type)==="AioSubForm"&&n.elements?t&&typeof t=="object"&&!Array.isArray(t)?l[r]=y(t,n.elements,o):o&&typeof o=="object"&&!Array.isArray(o)&&(l[r]=o):(n==null?void 0:n.type)==="AioArraySubForm"&&n.elements?Array.isArray(t)&&!i(t)?l[r]=t.map((m,j)=>{const C=Array.isArray(o)?o[j]:void 0;return typeof m=="object"?y(m,n.elements,C):m}):Array.isArray(o)&&!i(o)&&(l[r]=o):l[r]=t}return l}let d=!1,p=!1;function V(){s.formItems&&s.formItems.length>0&&(p=!0,g.value=b(s.formItems,s.modelValue),setTimeout(()=>{p=!1},50))}f.watch(()=>s.formItems,()=>{V()},{deep:!0,immediate:!0}),f.watch(()=>s.modelValue,()=>{d||s.formItems&&s.formItems.length>0&&V()},{deep:!0});function k(e){if(p||i(e))return;const u=y(e,s.formItems,s.modelValue);d=!0,A("update:modelValue",u),A("change",u),setTimeout(()=>{d=!1},0)}function I(e){var u;(u=c.value)==null||u.submit(e)}function S(){var e;return((e=c.value)==null?void 0:e.getFormData())??{}}return h({submit:I,getFormData:S}),(e,u)=>(f.openBlock(),f.createBlock(O.default,f.mergeProps({ref_key:"formRenderRef",ref:c,"form-items":g.value,"model-value":s.modelValue},e.$attrs,{onChange:k}),null,16,["form-items","model-value"]))}});exports.default=R;
|