@aplus-frontend/ui 0.2.10 → 0.2.11
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/es/src/ap-form/ap-form.vue.d.ts +4 -0
- package/es/src/ap-form/ap-form.vue2.mjs +131 -108
- package/es/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/drawer-form/index.vue.mjs +43 -37
- package/es/src/ap-form/interface.d.ts +8 -0
- package/es/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/modal-form/index.vue.mjs +26 -20
- package/es/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/es/src/ap-form/search-form/index.vue.mjs +37 -31
- package/es/src/ap-form/utils/params.d.ts +17 -0
- package/es/src/ap-form/utils/params.mjs +19 -0
- package/es/src/ap-table/interface.d.ts +1 -0
- package/es/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/es/src/business/ap-group-search/ap-group-search.vue2.mjs +80 -70
- package/es/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/extension-select/index.vue2.mjs +44 -34
- package/es/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/es/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/es/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/es/src/business/ap-group-search/images/icon-line-select.vue.mjs +9 -9
- package/es/src/business/ap-group-search/index.d.ts +28 -0
- package/es/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/es/src/business/ap-group-search/popover-select/index.vue2.mjs +50 -50
- package/es/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/es/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
- package/es/src/locale/lang/en.mjs +1 -1
- package/es/src/locale/lang/zh-cn.mjs +1 -1
- package/es/src/path-map.mjs +2 -1
- package/es/src/utils/index.d.ts +12 -0
- package/es/src/utils/index.mjs +27 -18
- package/lib/src/ap-form/ap-form.vue.d.ts +4 -0
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/interface.d.ts +8 -0
- package/lib/src/ap-form/modal-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/index.vue.d.ts +27 -2
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/utils/params.d.ts +17 -0
- package/lib/src/ap-form/utils/params.js +1 -0
- package/lib/src/ap-table/interface.d.ts +1 -0
- package/lib/src/business/ap-group-search/ap-group-search.vue.d.ts +3 -1
- package/lib/src/business/ap-group-search/ap-group-search.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/extension-select/index.vue2.js +1 -1
- package/lib/src/business/ap-group-search/extension-select/style/css.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/css.js +1 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.d.ts +0 -0
- package/lib/src/business/ap-group-search/extension-select/style/index.js +1 -0
- package/lib/src/business/ap-group-search/images/icon-line-select.vue.js +1 -1
- package/lib/src/business/ap-group-search/index.d.ts +28 -0
- package/lib/src/business/ap-group-search/popover-select/index.vue.d.ts +6 -2
- package/lib/src/business/ap-group-search/popover-select/index.vue2.js +2 -2
- package/lib/src/business/ap-group-search/popover-select/style/css.js +1 -1
- package/lib/src/business/ap-group-search/popover-select/style/index.js +1 -1
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/path-map.js +1 -1
- package/lib/src/utils/index.d.ts +12 -0
- package/lib/src/utils/index.js +1 -1
- package/package.json +4 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Popover as
|
|
1
|
+
import { defineComponent as P, ref as u, watchEffect as R, openBlock as L, createElementBlock as M, normalizeClass as p, unref as e, createVNode as a, withCtx as n, createElementVNode as s, mergeProps as O, createTextVNode as d, toDisplayString as m } from "vue";
|
|
2
|
+
import { Popover as T, Select as z, Button as f, Space as G } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../../config-provider/index.mjs";
|
|
4
|
-
import
|
|
5
|
-
import { wait as
|
|
6
|
-
import { useLocale as
|
|
7
|
-
import { useGlobalConfig as
|
|
8
|
-
import { useNamespace as
|
|
9
|
-
const
|
|
4
|
+
import A from "../images/icon-line-select.vue.mjs";
|
|
5
|
+
import { wait as D } from "@aplus-frontend/utils";
|
|
6
|
+
import { useLocale as F } from "../../../config-provider/hooks/use-locale.mjs";
|
|
7
|
+
import { useGlobalConfig as E } from "../../../config-provider/hooks/use-global-config.mjs";
|
|
8
|
+
import { useNamespace as K } from "../../../config-provider/hooks/use-namespace.mjs";
|
|
9
|
+
const Y = /* @__PURE__ */ P({
|
|
10
10
|
__name: "index",
|
|
11
11
|
props: {
|
|
12
12
|
value: {},
|
|
@@ -81,54 +81,52 @@ const Z = /* @__PURE__ */ O({
|
|
|
81
81
|
optionFilterProp: {},
|
|
82
82
|
optionLabelProp: {},
|
|
83
83
|
defaultActiveFirstOption: { type: Boolean },
|
|
84
|
-
labelInValue: { type: Boolean }
|
|
84
|
+
labelInValue: { type: Boolean },
|
|
85
|
+
__parentRef: {}
|
|
85
86
|
},
|
|
86
87
|
emits: ["submit", "open-change"],
|
|
87
|
-
setup(
|
|
88
|
-
const { t:
|
|
89
|
-
|
|
90
|
-
t.value =
|
|
88
|
+
setup(S, { emit: w }) {
|
|
89
|
+
const { t: r } = F(), h = E("uiMode", "aplus"), i = S, v = w, t = u([]), c = u(!1), g = u();
|
|
90
|
+
R(() => {
|
|
91
|
+
t.value = i.value;
|
|
91
92
|
});
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return document.querySelector(u) || ((w = (S = o == null ? void 0 : o.parentNode) == null ? void 0 : S.parentNode) == null ? void 0 : w.parentNode) || o;
|
|
96
|
-
}, _ = (o) => {
|
|
97
|
-
c.value = o, C("open-change", o);
|
|
98
|
-
}, y = () => {
|
|
93
|
+
const B = (o) => i.__parentRef || o, b = (o) => {
|
|
94
|
+
c.value = o, v("open-change", o);
|
|
95
|
+
}, C = () => {
|
|
99
96
|
c.value = !1;
|
|
100
|
-
},
|
|
97
|
+
}, _ = () => {
|
|
101
98
|
t.value = [];
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
99
|
+
}, x = (o) => {
|
|
100
|
+
t.value = o;
|
|
101
|
+
}, k = async () => {
|
|
105
102
|
var o;
|
|
106
|
-
(o = g.value) == null || o.blur(),
|
|
107
|
-
}, { b:
|
|
108
|
-
return (o,
|
|
109
|
-
class: p(e(
|
|
103
|
+
(o = g.value) == null || o.blur(), C(), await D(150), v("submit", t.value);
|
|
104
|
+
}, { b: N, e: V, em: l } = K("ap-popover-select");
|
|
105
|
+
return (o, y) => (L(), M("div", {
|
|
106
|
+
class: p(e(N)())
|
|
110
107
|
}, [
|
|
111
|
-
a(e(
|
|
112
|
-
overlayClassName: e(
|
|
113
|
-
"get-popup-container":
|
|
108
|
+
a(e(T), {
|
|
109
|
+
overlayClassName: e(V)("popover"),
|
|
110
|
+
"get-popup-container": B,
|
|
114
111
|
trigger: "click",
|
|
115
112
|
open: c.value,
|
|
116
113
|
placement: "bottomLeft",
|
|
117
|
-
onOpenChange:
|
|
114
|
+
onOpenChange: b
|
|
118
115
|
}, {
|
|
119
116
|
content: n(() => [
|
|
120
117
|
s("div", null, [
|
|
121
118
|
s("div", {
|
|
122
|
-
class: p(e(
|
|
119
|
+
class: p(e(l)("popover", "content"))
|
|
123
120
|
}, [
|
|
124
|
-
a(e(
|
|
121
|
+
a(e(z), O({ ...i }, {
|
|
125
122
|
mode: "tags",
|
|
126
123
|
bordered: !1,
|
|
127
124
|
value: t.value,
|
|
128
|
-
onChange:
|
|
129
|
-
placeholder: e(
|
|
125
|
+
onChange: y[0] || (y[0] = (I) => x(I)),
|
|
126
|
+
placeholder: e(r)("ap.apGroupSearch.tokenSeparatorsPlaceholder"),
|
|
130
127
|
tokenSeparators: [",", `
|
|
131
128
|
`, "\r"],
|
|
129
|
+
"max-tag-count": 200,
|
|
132
130
|
open: !1,
|
|
133
131
|
ref_key: "selectRef",
|
|
134
132
|
ref: g
|
|
@@ -136,36 +134,36 @@ const Z = /* @__PURE__ */ O({
|
|
|
136
134
|
], 2),
|
|
137
135
|
s("div", {
|
|
138
136
|
class: p(
|
|
139
|
-
e(
|
|
137
|
+
e(h) === "aplus" ? e(l)("popover", "footer") : e(l)("popover", "footer--admin")
|
|
140
138
|
)
|
|
141
139
|
}, [
|
|
142
|
-
a(e(
|
|
140
|
+
a(e(f), {
|
|
143
141
|
size: "small",
|
|
144
|
-
onClick:
|
|
142
|
+
onClick: C
|
|
145
143
|
}, {
|
|
146
144
|
default: n(() => [
|
|
147
|
-
m(
|
|
145
|
+
d(m(e(r)("ap.apGroupSearch.close")), 1)
|
|
148
146
|
]),
|
|
149
147
|
_: 1
|
|
150
148
|
}),
|
|
151
|
-
a(e(
|
|
149
|
+
a(e(G), null, {
|
|
152
150
|
default: n(() => [
|
|
153
|
-
a(e(
|
|
151
|
+
a(e(f), {
|
|
154
152
|
size: "small",
|
|
155
|
-
onClick:
|
|
153
|
+
onClick: _
|
|
156
154
|
}, {
|
|
157
155
|
default: n(() => [
|
|
158
|
-
m(
|
|
156
|
+
d(m(e(r)("ap.apGroupSearch.clear")), 1)
|
|
159
157
|
]),
|
|
160
158
|
_: 1
|
|
161
159
|
}),
|
|
162
|
-
a(e(
|
|
160
|
+
a(e(f), {
|
|
163
161
|
size: "small",
|
|
164
162
|
type: "primary",
|
|
165
|
-
onClick:
|
|
163
|
+
onClick: k
|
|
166
164
|
}, {
|
|
167
165
|
default: n(() => [
|
|
168
|
-
m(
|
|
166
|
+
d(m(e(r)("ap.apGroupSearch.confirm")), 1)
|
|
169
167
|
]),
|
|
170
168
|
_: 1
|
|
171
169
|
})
|
|
@@ -177,9 +175,11 @@ const Z = /* @__PURE__ */ O({
|
|
|
177
175
|
]),
|
|
178
176
|
default: n(() => [
|
|
179
177
|
s("span", {
|
|
180
|
-
class: p(
|
|
178
|
+
class: p(
|
|
179
|
+
e(h) === "aplus" ? e(l)("popover", "trigger") : e(l)("popover", "trigger--admin")
|
|
180
|
+
)
|
|
181
181
|
}, [
|
|
182
|
-
a(
|
|
182
|
+
a(A)
|
|
183
183
|
], 2)
|
|
184
184
|
]),
|
|
185
185
|
_: 1
|
|
@@ -188,5 +188,5 @@ const Z = /* @__PURE__ */ O({
|
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
190
|
export {
|
|
191
|
-
|
|
191
|
+
Y as default
|
|
192
192
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-popover-select.css';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-
|
|
1
|
+
import '@aplus-frontend/ui-theme/src/ap-group-search/ap-popover-select.less';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isNil as
|
|
3
|
-
import { TableSummaryRow as
|
|
4
|
-
import { flattenColumns as
|
|
1
|
+
import { defineComponent as I, computed as v, openBlock as m, createBlock as l, unref as r, normalizeClass as y, withCtx as f, createElementBlock as L, Fragment as w, renderList as z, normalizeStyle as B, resolveDynamicComponent as N } from "vue";
|
|
2
|
+
import { isNil as R, get as c } from "lodash-unified";
|
|
3
|
+
import { TableSummaryRow as A, TableSummaryCell as D } from "@aplus-frontend/antdv";
|
|
4
|
+
import { flattenColumns as F, formatDataIndex as u } from "./utils.mjs";
|
|
5
5
|
import "../../config-provider/index.mjs";
|
|
6
|
-
import { isNumeric as
|
|
7
|
-
import { useNamespace as
|
|
8
|
-
const
|
|
6
|
+
import { isNumeric as E, toThousand as P, toFixed as V } from "@aplus-frontend/utils";
|
|
7
|
+
import { useNamespace as $ } from "../../config-provider/hooks/use-namespace.mjs";
|
|
8
|
+
const O = /* @__PURE__ */ I({
|
|
9
9
|
name: "ApSummary",
|
|
10
10
|
__name: "ap-summary",
|
|
11
11
|
props: {
|
|
@@ -22,45 +22,65 @@ const J = /* @__PURE__ */ S({
|
|
|
22
22
|
default: "middle"
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
var
|
|
28
|
-
if (!
|
|
29
|
-
return
|
|
30
|
-
const
|
|
31
|
-
return (
|
|
32
|
-
},
|
|
33
|
-
let
|
|
34
|
-
|
|
25
|
+
setup(x) {
|
|
26
|
+
const n = x, k = (a) => a === 0, h = (a, o) => {
|
|
27
|
+
var s;
|
|
28
|
+
if (!a || !E(a) || o.valueType !== "number")
|
|
29
|
+
return a;
|
|
30
|
+
const e = (s = o.fieldProps) == null ? void 0 : s.field, t = (e == null ? void 0 : e.precision) || 0;
|
|
31
|
+
return (R(e == null ? void 0 : e.thousands) ? !0 : e == null ? void 0 : e.thousands) ? P(a, t) : V(a, t);
|
|
32
|
+
}, T = v(() => {
|
|
33
|
+
let a = [];
|
|
34
|
+
n.hasSelect && a.push({
|
|
35
35
|
key: "select",
|
|
36
36
|
rowSpan: 1,
|
|
37
37
|
align: "left",
|
|
38
38
|
value: ""
|
|
39
39
|
});
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const e = F(n.columns).map((t, d) => {
|
|
41
|
+
let s;
|
|
42
|
+
const g = c(n.data, u(t.dataIndex || t.key));
|
|
43
|
+
if (k(d))
|
|
44
|
+
s = n.summaryTitle;
|
|
45
|
+
else if (g && (t.customRender || t.renderText)) {
|
|
46
|
+
const p = c(n.data, u(t.dataIndex || t.key)), b = u(t.dataIndex || t.key), i = t.customRender || t.renderText;
|
|
47
|
+
s = i == null ? void 0 : i({
|
|
48
|
+
value: p,
|
|
49
|
+
record: {
|
|
50
|
+
[b]: p
|
|
51
|
+
},
|
|
52
|
+
text: void 0,
|
|
53
|
+
index: 0,
|
|
54
|
+
renderIndex: 0,
|
|
55
|
+
column: {}
|
|
56
|
+
});
|
|
57
|
+
} else
|
|
58
|
+
s = h(c(n.data, u(t.dataIndex || t.key)), t);
|
|
59
|
+
return {
|
|
60
|
+
key: t.key,
|
|
61
|
+
rowSpan: 1,
|
|
62
|
+
align: t.align,
|
|
63
|
+
value: s
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
return a.concat(e);
|
|
47
67
|
}), {
|
|
48
|
-
b:
|
|
49
|
-
e:
|
|
50
|
-
em:
|
|
51
|
-
} =
|
|
52
|
-
return (
|
|
53
|
-
class:
|
|
68
|
+
b: C,
|
|
69
|
+
e: S,
|
|
70
|
+
em: _
|
|
71
|
+
} = $("ap-summary");
|
|
72
|
+
return (a, o) => (m(), l(r(A), {
|
|
73
|
+
class: y(r(C)())
|
|
54
74
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
class:
|
|
57
|
-
key:
|
|
58
|
-
index:
|
|
59
|
-
style:
|
|
60
|
-
textAlign:
|
|
75
|
+
default: f(() => [(m(!0), L(w, null, z(T.value, (e, t) => (m(), l(r(D), {
|
|
76
|
+
class: y(`${n.size === "small" ? r(_)("item", "small") : r(S)("item")}`),
|
|
77
|
+
key: e.key,
|
|
78
|
+
index: t,
|
|
79
|
+
style: B({
|
|
80
|
+
textAlign: e.align
|
|
61
81
|
})
|
|
62
82
|
}, {
|
|
63
|
-
default:
|
|
83
|
+
default: f(() => [(m(), l(N(e.value)))]),
|
|
64
84
|
_: 2
|
|
65
85
|
}, 1032, ["class", "index", "style"]))), 128))]),
|
|
66
86
|
_: 1
|
|
@@ -68,5 +88,5 @@ const J = /* @__PURE__ */ S({
|
|
|
68
88
|
}
|
|
69
89
|
});
|
|
70
90
|
export {
|
|
71
|
-
|
|
91
|
+
O as default
|
|
72
92
|
};
|
|
@@ -125,7 +125,7 @@ const e = {
|
|
|
125
125
|
close: "Close",
|
|
126
126
|
clear: "Clear",
|
|
127
127
|
confirm: "Confirm",
|
|
128
|
-
tokenSeparatorsPlaceholder: "
|
|
128
|
+
tokenSeparatorsPlaceholder: "A maximum of 200 entries can be entered in batches, separated by commas and newlines"
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
};
|
package/es/src/path-map.mjs
CHANGED
|
@@ -78,7 +78,8 @@ const e = {
|
|
|
78
78
|
ApScrollBar: ["ap-scroll-bar"],
|
|
79
79
|
ApAppendix: ["business", "ap-appendix"],
|
|
80
80
|
ApGroupSearch: ["business", "ap-group-search"],
|
|
81
|
-
ApPopoverSelect: ["business", "ap-group-search", "popover-select"]
|
|
81
|
+
ApPopoverSelect: ["business", "ap-group-search", "popover-select"],
|
|
82
|
+
ApExtensionSelect: ["business", "ap-group-search", "extension-select"]
|
|
82
83
|
};
|
|
83
84
|
export {
|
|
84
85
|
e as default
|
package/es/src/utils/index.d.ts
CHANGED
|
@@ -27,3 +27,15 @@ export declare function convertReactiveToRaw(obj: Recordable<any>): Recordable<a
|
|
|
27
27
|
export declare function omitUndefined(value: Recordable<any>): {
|
|
28
28
|
[x: string]: any;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* 如果是一个函数则执行它,否则直接返回该值
|
|
32
|
+
* @param func
|
|
33
|
+
* @param restParams
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
export declare function runFunction<T extends any[]>(func: any, ...restParams: T): any;
|
|
37
|
+
/**
|
|
38
|
+
* 获取当前的路由类型
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
export declare function getRouteType(): "history" | "hash";
|
package/es/src/utils/index.mjs
CHANGED
|
@@ -1,51 +1,60 @@
|
|
|
1
|
-
import { unref as
|
|
1
|
+
import { unref as f, markRaw as s } from "vue";
|
|
2
2
|
import { isUndefined as a } from "lodash-unified";
|
|
3
|
-
function
|
|
3
|
+
function d(t) {
|
|
4
4
|
return (t == null ? void 0 : t.parentNode) ?? document.body;
|
|
5
5
|
}
|
|
6
6
|
function p(t) {
|
|
7
7
|
return typeof t < "u";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function m(t) {
|
|
10
10
|
const e = {};
|
|
11
11
|
return Object.keys(t).map((n) => {
|
|
12
|
-
e[n] =
|
|
12
|
+
e[n] = f(t[n]);
|
|
13
13
|
}), e;
|
|
14
14
|
}
|
|
15
15
|
function g(t, e = [], n) {
|
|
16
|
-
const r = Object.assign({}, t),
|
|
17
|
-
for (let
|
|
18
|
-
const
|
|
19
|
-
(e.includes(
|
|
16
|
+
const r = Object.assign({}, t), u = Object.keys(r);
|
|
17
|
+
for (let i = 0; i < u.length; i += 1) {
|
|
18
|
+
const o = u[i];
|
|
19
|
+
(e.includes(o) || n != null && n(o, r[o])) && delete r[o];
|
|
20
20
|
}
|
|
21
21
|
return r;
|
|
22
22
|
}
|
|
23
23
|
function k(t) {
|
|
24
24
|
return /^[A-Z][A-Za-z]*$/.test(t);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function c(t) {
|
|
27
27
|
if (Array.isArray(t))
|
|
28
|
-
return t.map((e) =>
|
|
28
|
+
return t.map((e) => c(e));
|
|
29
29
|
if (typeof t == "object" && t !== null) {
|
|
30
30
|
const e = {};
|
|
31
31
|
for (const n in t)
|
|
32
|
-
e[n] =
|
|
33
|
-
return
|
|
32
|
+
e[n] = c(t[n]);
|
|
33
|
+
return s(e);
|
|
34
34
|
}
|
|
35
35
|
return t;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function R(t) {
|
|
38
38
|
const e = { ...t };
|
|
39
39
|
for (const n of Object.keys(e))
|
|
40
40
|
a(e[n]) && delete e[n];
|
|
41
41
|
return e;
|
|
42
42
|
}
|
|
43
|
+
function O(t, ...e) {
|
|
44
|
+
return typeof t == "function" ? t(...e) : t;
|
|
45
|
+
}
|
|
46
|
+
function A() {
|
|
47
|
+
const t = "history";
|
|
48
|
+
return typeof window > "u" ? t : window.location.href.includes("#/") ? "hash" : t;
|
|
49
|
+
}
|
|
43
50
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
c as convertReactiveToRaw,
|
|
52
|
+
m as getDynamicProps,
|
|
53
|
+
d as getPopupContainer,
|
|
54
|
+
A as getRouteType,
|
|
47
55
|
p as isDef,
|
|
48
56
|
k as isPascalCase,
|
|
49
|
-
|
|
50
|
-
g as omitWhen
|
|
57
|
+
R as omitUndefined,
|
|
58
|
+
g as omitWhen,
|
|
59
|
+
O as runFunction
|
|
51
60
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApFormProps, RegistedFieldType, WatchFunc } from './interface';
|
|
2
2
|
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, RuleObject, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
3
|
+
import { Recordable } from '../type';
|
|
3
4
|
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, DefineComponent, PublicProps } from 'vue';
|
|
4
5
|
import { VueTypeDef, VueTypeValidableDef } from '../../node_modules/vue-types';
|
|
5
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
@@ -895,6 +896,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
895
896
|
labelAlign: string;
|
|
896
897
|
validateOnRuleChange: boolean;
|
|
897
898
|
validateTrigger: string;
|
|
899
|
+
syncToUrl: boolean;
|
|
898
900
|
}>, {
|
|
899
901
|
resetFields: () => Promise<void>;
|
|
900
902
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -921,6 +923,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
921
923
|
labelAlign: string;
|
|
922
924
|
validateOnRuleChange: boolean;
|
|
923
925
|
validateTrigger: string;
|
|
926
|
+
syncToUrl: boolean;
|
|
924
927
|
}>>>, {
|
|
925
928
|
layout: string;
|
|
926
929
|
colon: boolean;
|
|
@@ -928,6 +931,7 @@ declare const __VLS_component: DefineComponent<__VLS_WithDefaults<__VLS_TypeProp
|
|
|
928
931
|
validateTrigger: string | string[];
|
|
929
932
|
hideRequiredMark: boolean;
|
|
930
933
|
validateOnRuleChange: boolean;
|
|
934
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
931
935
|
}, {}>;
|
|
932
936
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
933
937
|
export default _default;
|
|
@@ -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 l=require("vue"),z=require("@aplus-frontend/antdv"),C=require("./context.js"),a=require("lodash-unified"),L=require("@vueuse/core"),$=require("./constant.js"),T=require("../utils/index.js"),k=require("./utils/set.js"),y=require("./utils/params.js"),K=l.defineComponent({__name:"ap-form",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinish:{},onFinishFailed:{},onValidate:{},initialValues:{},syncToUrl:{type:[Boolean,Function],default:!1},syncToUrlPriority:{type:Boolean}},setup(R,{expose:U}){const i=R;function V(e,t,s=!0){var o;if(a.isArray(e)){let n=u;for(let d=0;d<e.length-1;d++)e[d]in n||(n[e[d]]={}),n=n[e[d]];n[e[e.length-1]]=t}else u[e]=t;let r=a.isArray(e)?e[0]:e;s&&((o=i.onValuesChange)==null||o.call(i,{[r]:u[r]},u)),p()}const c=l.ref(),P=L.useUrlSearchParams(T.getRouteType()),_=l.ref(i.syncToUrl?y.genParams(i.syncToUrl,P,"get"):{});let v=a.cloneDeep(m()),F={};const u=l.reactive(m());let g=[];function m(){const e=i.initialValues||{};return i.syncToUrlPriority?{...e,...l.unref(_)}:{...l.unref(_),...e}}function M(e){var s;const t=h(e,F);i.syncToUrl&&y.setToParams(P,y.genParams(i.syncToUrl,t,"set")),(s=i.onFinish)==null||s.call(i,t)}const O=async()=>{var e;(e=c.value)==null||e.resetFields(),await l.nextTick(()=>{Object.keys(u).forEach(t=>delete u[t]),Object.assign(u,v),p(),i.syncToUrl&&y.setToParams(P,y.genParams(i.syncToUrl,h(v,F),"set"))})},B=e=>{var t;(t=c.value)==null||t.clearValidate(e)},I=(e,t)=>{var s;return(s=c.value)==null?void 0:s.validateFields(e,t)},j=async(e,t)=>{var r;const s=await((r=c.value)==null?void 0:r.validateFields(e,t));return h(s,F)},w=e=>{var t;return(t=c.value)==null?void 0:t.getFieldsValue(e)},x=e=>{var s;const t=(s=c.value)==null?void 0:s.getFieldsValue(e);return h(t,F)},E=(e,t)=>{var s;return(s=c.value)==null?void 0:s.validate(e,t)},S=(e,t={})=>{var s;(s=c.value)==null||s.scrollToField(e,t)},N=e=>{Object.assign(u,e),p()},q=(e,t)=>{V(e,t),p()};function b(e,t){return t||e(l.toRaw(u)),g.push(e),()=>{g=g.filter(s=>s!==e)}}function A({initialValue:e,name:t,transform:s}){if(T.isDef(e)&&T.isDef(t))if(V(t,e,!1),a.isArray(t)){let r=v;for(let o=0;o<t.length-1;o++)T.isDef(r[t[o]])||(r[t[o]]={}),r=r[t[o]];r[t[t.length-1]]=e}else v[t]=e;s&&(F=k.default(F,[t].flat(1),s,!0))}function D(e){if(e!==$.INTERNAL_FORM_INSTANCE_MARK){console.warn("getInternalInstance should only used at internal");return}return{registerField:A,registerWatch:b}}function p(){if(g.length){const e=l.toRaw(u);g.forEach(t=>{t(e)})}}function h(e,t){if(e==null)return;let s=a.isArray(e)?[]:{};return Object.keys(e).forEach(r=>{const o=e[r],n=t==null?void 0:t[r],d=a.isFunction(n)?n:n==null?void 0:n.transformer,W=a.isFunction(n)?!0:n==null?void 0:n.flat;if(a.isFunction(d)){const f=d(o);W?a.isArray(f)&&a.isArray(s)?s=[...s,...f]:a.isPlainObject(f)&&a.isPlainObject(s)?s={...s,...f}:s[r]=f:s[r]=f}else if(a.isPlainObject(o)||a.isArray(o)){const f=h(o,n);s[r]=f}else s[r]=o}),s}return C.useProvideForm({model:l.computed(()=>u),updateModel:V,internalInstance:{registerWatch:b,registerField:A,setFieldValue:q}}),U({resetFields:O,clearValidate:B,validateFields:I,getFieldsValue:w,validate:E,scrollToField:S,setFieldsValue:N,setFieldValue:q,registerWatch:b,validateFieldsReturnTransformed:j,getFieldsValueTransformed:x,getInternalInstance:D}),(e,t)=>(l.openBlock(),l.createBlock(l.unref(z.Form),l.mergeProps({ref_key:"formRef",ref:c},l.unref(a.omit)(i,["initialValues","onValuesChange","onFinish"]),{onFinish:M,model:u}),{default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3},16,["model"]))}});exports.default=K;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ApFormDrawerFormProps, CustomizeResizeType } from '../interface';
|
|
2
2
|
import { VNode, ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, PublicProps, CSSProperties } from 'vue';
|
|
3
3
|
import { InternalNamePath, NamePath, ValidateOptions, FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity } from '@aplus-frontend/antdv/es/form/interface';
|
|
4
|
+
import { Recordable } from '../../type';
|
|
4
5
|
import { RequiredMark } from '@aplus-frontend/antdv/es/form/Form';
|
|
5
6
|
import { ColSize } from '@aplus-frontend/antdv/es/grid';
|
|
6
7
|
import { RuleObject } from '@aplus-frontend/antdv/es/form';
|
|
7
8
|
import { Options } from '../../../node_modules/scroll-into-view-if-needed';
|
|
8
|
-
import { Recordable } from '../../type';
|
|
9
9
|
import { WatchFunc, RegistedFieldType, ApFormInternalInstance, ApFormSubmitterConfig } from '..';
|
|
10
10
|
import { VueTypeValidableDef, VueTypeDef } from '../../../node_modules/vue-types';
|
|
11
11
|
import { PushState } from '@aplus-frontend/antdv/es/drawer';
|
|
@@ -29,6 +29,7 @@ declare function __VLS_template(): {
|
|
|
29
29
|
validateTrigger: string | string[];
|
|
30
30
|
hideRequiredMark: boolean;
|
|
31
31
|
validateOnRuleChange: boolean;
|
|
32
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
32
33
|
}> & Omit<{
|
|
33
34
|
readonly layout: string;
|
|
34
35
|
readonly colon: boolean;
|
|
@@ -36,6 +37,7 @@ declare function __VLS_template(): {
|
|
|
36
37
|
readonly validateTrigger: string | string[];
|
|
37
38
|
readonly hideRequiredMark: boolean;
|
|
38
39
|
readonly validateOnRuleChange: boolean;
|
|
40
|
+
readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
39
41
|
readonly size?: "small" | "large" | "middle" | undefined;
|
|
40
42
|
readonly onSubmit?: ((e: Event) => void) | undefined;
|
|
41
43
|
readonly disabled?: boolean | undefined;
|
|
@@ -120,6 +122,7 @@ declare function __VLS_template(): {
|
|
|
120
122
|
readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
|
|
121
123
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
122
124
|
readonly initialValues?: Recordable | undefined;
|
|
125
|
+
readonly syncToUrlPriority?: boolean | undefined;
|
|
123
126
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
124
127
|
size: {
|
|
125
128
|
type: PropType<"small" | "large" | "middle">;
|
|
@@ -265,7 +268,14 @@ declare function __VLS_template(): {
|
|
|
265
268
|
initialValues: {
|
|
266
269
|
type: PropType<Recordable>;
|
|
267
270
|
};
|
|
268
|
-
|
|
271
|
+
syncToUrl: {
|
|
272
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
273
|
+
default: boolean;
|
|
274
|
+
};
|
|
275
|
+
syncToUrlPriority: {
|
|
276
|
+
type: PropType<boolean>;
|
|
277
|
+
};
|
|
278
|
+
}>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
|
|
269
279
|
$attrs: {
|
|
270
280
|
[x: string]: unknown;
|
|
271
281
|
};
|
|
@@ -424,6 +434,13 @@ declare function __VLS_template(): {
|
|
|
424
434
|
initialValues: {
|
|
425
435
|
type: PropType<Recordable>;
|
|
426
436
|
};
|
|
437
|
+
syncToUrl: {
|
|
438
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
439
|
+
default: boolean;
|
|
440
|
+
};
|
|
441
|
+
syncToUrlPriority: {
|
|
442
|
+
type: PropType<boolean>;
|
|
443
|
+
};
|
|
427
444
|
}>>, {
|
|
428
445
|
resetFields: () => Promise<void>;
|
|
429
446
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -453,6 +470,7 @@ declare function __VLS_template(): {
|
|
|
453
470
|
validateTrigger: string | string[];
|
|
454
471
|
hideRequiredMark: boolean;
|
|
455
472
|
validateOnRuleChange: boolean;
|
|
473
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
456
474
|
}, {}, string, {}> & {
|
|
457
475
|
beforeCreate?: (() => void) | (() => void)[];
|
|
458
476
|
created?: (() => void) | (() => void)[];
|
|
@@ -618,6 +636,13 @@ declare function __VLS_template(): {
|
|
|
618
636
|
initialValues: {
|
|
619
637
|
type: PropType<Recordable>;
|
|
620
638
|
};
|
|
639
|
+
syncToUrl: {
|
|
640
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
641
|
+
default: boolean;
|
|
642
|
+
};
|
|
643
|
+
syncToUrlPriority: {
|
|
644
|
+
type: PropType<boolean>;
|
|
645
|
+
};
|
|
621
646
|
}>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
|
|
622
647
|
resetFields: () => Promise<void>;
|
|
623
648
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),c=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),c=require("@aplus-frontend/antdv");require("../ap-form.vue.js");require("../../hooks/index.js");const U=require("../../utils/slot.js");require("../../config-provider/index.js");const g=require("lodash-unified"),j=require("../../utils/index.js"),E=require("../../hooks/useControllableValue.js"),D=require("../../config-provider/hooks/use-locale.js"),I=require("../../config-provider/hooks/use-namespace.js"),$=require("../ap-form.vue2.js");function k(f){return typeof f=="function"||Object.prototype.toString.call(f)==="[object Object]"&&!t.isVNode(f)}const A=t.defineComponent({__name:"index",props:{layout:{default:"horizontal"},labelCol:{},wrapperCol:{},colon:{type:Boolean,default:!0},labelAlign:{default:"right"},labelWrap:{type:Boolean},prefixCls:{},requiredMark:{},hideRequiredMark:{type:Boolean,default:!1},rules:{},validateMessages:{},validateOnRuleChange:{type:Boolean,default:!0},scrollToFirstError:{},onSubmit:{},name:{},validateTrigger:{default:"change"},size:{},disabled:{type:Boolean},onValuesChange:{},onFieldsChange:{},onFinishFailed:{},onValidate:{},initialValues:{},syncToUrl:{type:[Boolean,Function]},syncToUrlPriority:{type:Boolean},open:{type:Boolean,default:void 0},"onUpdate:open":{},drawerProps:{default:()=>({})},title:{},width:{default:378},onFinish:{},submitter:{type:[Boolean,Object],default:()=>({resetButtonProps:!1})},showCancel:{type:Boolean,default:!0},submitTimeout:{},resize:{type:[Object,Boolean],default:!1}},emits:["update:open"],setup(f,{expose:x,emit:T}){const i=f,v=t.useSlots(),N=T,a=t.ref(),p=t.ref(),u=t.ref(!1),{value:y,updateValue:h}=E.useControllableValue(i,N,{valuePropName:"open",defaultValue:!1}),d=t.computed(()=>{var n,o,r,s;const e={onResize:()=>{},minWidth:300,maxWidth:window.innerWidth*.8,resizeOnOpen:!0};return g.isBoolean(i.resize)?i.resize?e:{}:{minWidth:((n=i.resize)==null?void 0:n.minWidth)??e.minWidth,maxWidth:((o=i.resize)==null?void 0:o.maxWidth)??e.maxWidth,onResize:((r=i.resize)==null?void 0:r.onResize)??e.onResize,resizeOnOpen:g.isUndefined((s=i.resize)==null?void 0:s.resizeOnOpen)?e.onResize:i.resize.resizeOnOpen}}),m=t.ref(F()),{t:b}=D.useLocale(),{e:O,em:V}=I.useNamespace("ap-form-drawer-form"),P=t.computed(()=>[O("resize-bar"),{[V("resize-bar","min-disabled")]:t.unref(m)===t.unref(d).minWidth},{[V("resize-bar","max-disabled")]:t.unref(m)===t.unref(d).maxWidth}]);t.watch(()=>a.value,e=>{var n;e&&p.value&&((n=e.setFieldsValue)==null||n.call(e,p.value),p.value=void 0)}),t.watch(()=>t.unref(y),e=>{var n;e&&(n=t.unref(d))!=null&&n.resizeOnOpen&&(m.value=F())});function F(){var n;const e=(n=t.unref(d))==null?void 0:n.minWidth;return!e||e&&e<i.width?i.width:e}const C=U.getSingleVNode(v.trigger),w=C?t.cloneVNode(C,{onClick:()=>{h(!0)}}):null,_=t.computed(()=>{var n,o,r,s;const e=[];if(i.submitter===!1)return null;if(i.showCancel){let l;e.push(t.createVNode(c.Button,{onClick:W,disabled:u.value},k(l=b("ap.common.cancelText"))?l:{default:()=>[l]}))}return((n=i.submitter)==null?void 0:n.resetButtonProps)!==!1&&e.push(t.createVNode(c.Button,t.mergeProps(((o=i.submitter)==null?void 0:o.resetButtonProps)||{},{key:"submit",disabled:u.value,onClick:q}),{default:()=>{var l;return[((l=i.submitter)==null?void 0:l.resetText)||b("ap.common.resetText")]}})),((r=i.submitter)==null?void 0:r.submitButtonProps)!==!1&&e.push(t.createVNode(c.Button,t.mergeProps({type:"primary",key:"submit"},((s=i.submitter)==null?void 0:s.submitButtonProps)||{},{loading:u.value,onClick:S}),{default:()=>{var l;return[((l=i.submitter)==null?void 0:l.submitText)||b("ap.common.okText")]}})),t.createVNode(c.Flex,{justify:"flex-end"},{default:()=>[v.submitter?v.submitter(e):t.createVNode(c.Space,null,k(e)?e:{default:()=>[e]})]})});function R(){var e,n;(n=(e=d.value)==null?void 0:e.onResize)==null||n.call(e),document.addEventListener("mousemove",B),document.addEventListener("mouseup",z)}function B(e){const n=t.unref(d),o=(document.body.offsetWidth||1e3)-(e.clientX-document.body.offsetLeft),r=(n==null?void 0:n.minWidth)??(i.width||800),s=(n==null?void 0:n.maxWidth)??window.innerWidth*.8;let l=o;o<r&&(l=r),o>s&&(l=s),m.value=l}function z(){document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",z)}function q(){var e,n,o;i.submitter!==!1&&((e=a.value)==null||e.resetFields(),(o=(n=i.submitter)==null?void 0:n.onReset)==null||o.call(n))}async function S(){var e,n,o,r;if(i.submitter!==!1)try{const s=await((e=a.value)==null?void 0:e.validateFields());(o=(n=i.submitter)==null?void 0:n.onSubmit)==null||o.call(n),u.value=!0;const l=(r=i.onFinish)==null?void 0:r.call(i,j.convertReactiveToRaw(s));if(i.submitTimeout&&l instanceof Promise){const L=setTimeout(()=>u.value=!1,i.submitTimeout);l.finally(()=>{clearTimeout(L),u.value=!1})}await l&&h(!1)}finally{u.value=!1}}function W(){t.unref(u)||h(!1)}function M(e){!e&&t.unref(u)||h(e)}return x({resetFields:()=>{var e;(e=a.value)==null||e.resetFields()},clearValidate:e=>{var n;(n=a.value)==null||n.clearValidate(e)},validateFields:(e,n)=>{var o;return(o=a.value)==null?void 0:o.validateFields(e,n)},getFieldsValue:e=>{var n;return(n=a.value)==null?void 0:n.getFieldsValue(e)},validate:(e,n)=>{var o;return(o=a.value)==null?void 0:o.validate(e,n)},scrollToField:(e,n={})=>{var o;(o=a.value)==null||o.scrollToField(e,n)},setFieldValue:(e,n)=>{var o,r;(r=(o=a.value)==null?void 0:o.setFieldValue)==null||r.call(o,e,n)},setFieldsValue:e=>{var n,o;if(!a.value){p.value=e;return}(o=(n=a.value)==null?void 0:n.setFieldsValue)==null||o.call(n,e)},getInternalInstance:e=>{var n;return(n=a.value)==null?void 0:n.getInternalInstance(e)}}),(e,n)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(t.unref(c.Drawer),t.mergeProps(e.drawerProps,{open:t.unref(y),"onUpdate:open":M,onCancel:W,width:m.value}),{title:t.withCtx(()=>[t.renderSlot(e.$slots,"title",{},()=>[t.createTextVNode(t.toDisplayString(i.title),1)])]),footer:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(_.value)))]),default:t.withCtx(()=>[t.createVNode($.default,t.mergeProps({ref_key:"formRef",ref:a},t.unref(g.omit)(i,["drawerProps","open","onUpdate:open","title","width","onFinish","submitter"])),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16),e.resize?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(P.value),onMousedown:t.withModifiers(R,["stop","prevent"])},null,34)):t.createCommentVNode("",!0)]),_:3},16,["open","width"]),t.unref(w)?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(w)),{key:0})):t.createCommentVNode("",!0)],64))}});exports.default=A;
|
|
@@ -46,6 +46,14 @@ export type ApFormProps = Omit<FormProps, 'model'> & {
|
|
|
46
46
|
* @returns
|
|
47
47
|
*/
|
|
48
48
|
onValuesChange?: (changedValues: Recordable, allValues: Recordable) => void;
|
|
49
|
+
/**
|
|
50
|
+
* 同步表单数据到url中
|
|
51
|
+
*/
|
|
52
|
+
syncToUrl?: boolean | ((values: Recordable, type: 'get' | 'set') => Recordable);
|
|
53
|
+
/**
|
|
54
|
+
* syncToUrl和initialValues合并是否优先,默认为false
|
|
55
|
+
*/
|
|
56
|
+
syncToUrlPriority?: boolean;
|
|
49
57
|
};
|
|
50
58
|
export type WatchFunc = (values?: Recordable) => void;
|
|
51
59
|
export type ApFormExpose<ModelType = any> = {
|