@aplus-frontend/ui 0.2.10 → 0.2.12
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/index.mjs +41 -39
- 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-list/index.vue.d.ts +1 -0
- package/es/src/ap-list/index.vue.mjs +85 -79
- package/es/src/ap-list/interface.d.ts +7 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +84 -75
- 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-image/ApImage.vue2.mjs +16 -14
- package/es/src/business/ap-summary/ap-summary.vue2.mjs +58 -38
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.mjs +227 -0
- package/es/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.mjs +4 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/es/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/es/src/business/ap-upload-file/hook/useInjectContext.mjs +9 -0
- package/es/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/es/src/business/ap-upload-file/hook/useOss.mjs +30 -0
- package/es/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/es/src/business/ap-upload-file/hook/useProps.mjs +28 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/delete-icon.vue.mjs +27 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/es/src/business/ap-upload-file/icon/file-icon.vue.mjs +18 -0
- package/es/src/business/ap-upload-file/index.d.ts +3 -0
- package/es/src/business/ap-upload-file/index.mjs +2 -0
- package/es/src/business/ap-upload-file/interface.d.ts +29 -0
- package/es/src/business/ap-upload-file/interface.mjs +1 -0
- package/es/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/es/src/business/ap-upload-file/utils/accept.mjs +55 -0
- package/es/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/es/src/business/ap-upload-file/utils/fileList.mjs +16 -0
- package/es/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/es/src/business/ap-upload-file/utils/upload.mjs +62 -0
- package/es/src/business/index.d.ts +1 -0
- package/es/src/business/index.mjs +43 -42
- package/es/src/config-provider/config-provider.d.ts +8 -0
- package/es/src/config-provider/css-var.d.ts +8 -0
- package/es/src/config-provider/css-var.mjs +25 -9
- package/es/src/config-provider/index.d.ts +48 -0
- package/es/src/index.mjs +33 -31
- 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 +3 -1
- package/es/src/utils/index.d.ts +12 -0
- package/es/src/utils/index.mjs +27 -18
- package/lib/index.js +1 -1
- 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-list/index.vue.d.ts +1 -0
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-list/interface.d.ts +7 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -1
- 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-image/ApImage.vue2.js +1 -1
- package/lib/src/business/ap-summary/ap-summary.vue2.js +1 -1
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.d.ts +50 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/ap-upload-single.vue2.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/css.js +1 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.d.ts +0 -0
- package/lib/src/business/ap-upload-file/ap-upload-single/style/index.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.d.ts +4 -0
- package/lib/src/business/ap-upload-file/hook/useInjectContext.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useOss.d.ts +8 -0
- package/lib/src/business/ap-upload-file/hook/useOss.js +1 -0
- package/lib/src/business/ap-upload-file/hook/useProps.d.ts +12 -0
- package/lib/src/business/ap-upload-file/hook/useProps.js +1 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/delete-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.d.ts +3 -0
- package/lib/src/business/ap-upload-file/icon/file-icon.vue.js +1 -0
- package/lib/src/business/ap-upload-file/index.d.ts +3 -0
- package/lib/src/business/ap-upload-file/index.js +1 -0
- package/lib/src/business/ap-upload-file/interface.d.ts +29 -0
- package/lib/src/business/ap-upload-file/interface.js +1 -0
- package/lib/src/business/ap-upload-file/utils/accept.d.ts +16 -0
- package/lib/src/business/ap-upload-file/utils/accept.js +1 -0
- package/lib/src/business/ap-upload-file/utils/fileList.d.ts +5 -0
- package/lib/src/business/ap-upload-file/utils/fileList.js +1 -0
- package/lib/src/business/ap-upload-file/utils/upload.d.ts +10 -0
- package/lib/src/business/ap-upload-file/utils/upload.js +1 -0
- package/lib/src/business/index.d.ts +1 -0
- package/lib/src/business/index.js +1 -1
- package/lib/src/config-provider/config-provider.d.ts +8 -0
- package/lib/src/config-provider/css-var.d.ts +8 -0
- package/lib/src/config-provider/css-var.js +1 -1
- package/lib/src/config-provider/index.d.ts +48 -0
- package/lib/src/index.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,19 +1,19 @@
|
|
|
1
|
-
import { isVNode as K, defineComponent as Q, useSlots as Y, ref as v, computed as w, unref as l, watch as
|
|
1
|
+
import { isVNode as K, defineComponent as Q, useSlots as Y, ref as v, computed as w, unref as l, watch as P, cloneVNode as Z, createVNode as d, mergeProps as b, openBlock as y, createElementBlock as N, Fragment as ee, withCtx as g, renderSlot as M, createTextVNode as te, toDisplayString as ie, createBlock as S, resolveDynamicComponent as _, normalizeClass as ne, withModifiers as oe, createCommentVNode as L } from "vue";
|
|
2
2
|
import { Button as V, Flex as le, Space as ae, Drawer as se } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import { getSingleVNode as re } from "../../utils/slot.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { isBoolean as ue, isUndefined as de, omit as
|
|
8
|
-
import { convertReactiveToRaw as
|
|
7
|
+
import { isBoolean as ue, isUndefined as de, omit as ce } from "lodash-unified";
|
|
8
|
+
import { convertReactiveToRaw as me } from "../../utils/index.mjs";
|
|
9
9
|
import { useControllableValue as fe } from "../../hooks/useControllableValue.mjs";
|
|
10
10
|
import { useLocale as pe } from "../../config-provider/hooks/use-locale.mjs";
|
|
11
11
|
import { useNamespace as he } from "../../config-provider/hooks/use-namespace.mjs";
|
|
12
12
|
import ve from "../ap-form.vue2.mjs";
|
|
13
|
-
function
|
|
14
|
-
return typeof
|
|
13
|
+
function U(m) {
|
|
14
|
+
return typeof m == "function" || Object.prototype.toString.call(m) === "[object Object]" && !K(m);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const je = /* @__PURE__ */ Q({
|
|
17
17
|
__name: "index",
|
|
18
18
|
props: {
|
|
19
19
|
layout: {
|
|
@@ -58,6 +58,12 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
58
58
|
onFinishFailed: {},
|
|
59
59
|
onValidate: {},
|
|
60
60
|
initialValues: {},
|
|
61
|
+
syncToUrl: {
|
|
62
|
+
type: [Boolean, Function]
|
|
63
|
+
},
|
|
64
|
+
syncToUrlPriority: {
|
|
65
|
+
type: Boolean
|
|
66
|
+
},
|
|
61
67
|
open: {
|
|
62
68
|
type: Boolean,
|
|
63
69
|
default: void 0
|
|
@@ -88,17 +94,17 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
88
94
|
}
|
|
89
95
|
},
|
|
90
96
|
emits: ["update:open"],
|
|
91
|
-
setup(
|
|
92
|
-
expose:
|
|
93
|
-
emit:
|
|
97
|
+
setup(m, {
|
|
98
|
+
expose: j,
|
|
99
|
+
emit: E
|
|
94
100
|
}) {
|
|
95
|
-
const n =
|
|
101
|
+
const n = m, F = Y(), D = E, a = v(), p = v(), u = v(!1), {
|
|
96
102
|
value: C,
|
|
97
103
|
updateValue: h
|
|
98
104
|
} = fe(n, D, {
|
|
99
105
|
valuePropName: "open",
|
|
100
106
|
defaultValue: !1
|
|
101
|
-
}),
|
|
107
|
+
}), c = w(() => {
|
|
102
108
|
var t, i, s, r;
|
|
103
109
|
const e = {
|
|
104
110
|
onResize: () => {
|
|
@@ -113,29 +119,29 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
113
119
|
onResize: ((s = n.resize) == null ? void 0 : s.onResize) ?? e.onResize,
|
|
114
120
|
resizeOnOpen: de((r = n.resize) == null ? void 0 : r.resizeOnOpen) ? e.onResize : n.resize.resizeOnOpen
|
|
115
121
|
};
|
|
116
|
-
}), f = v(
|
|
122
|
+
}), f = v(B()), {
|
|
117
123
|
t: z
|
|
118
124
|
} = pe(), {
|
|
119
125
|
e: $,
|
|
120
126
|
em: W
|
|
121
127
|
} = he("ap-form-drawer-form"), q = w(() => [$("resize-bar"), {
|
|
122
|
-
[W("resize-bar", "min-disabled")]: l(f) === l(
|
|
128
|
+
[W("resize-bar", "min-disabled")]: l(f) === l(c).minWidth
|
|
123
129
|
}, {
|
|
124
|
-
[W("resize-bar", "max-disabled")]: l(f) === l(
|
|
130
|
+
[W("resize-bar", "max-disabled")]: l(f) === l(c).maxWidth
|
|
125
131
|
}]);
|
|
126
|
-
|
|
132
|
+
P(() => a.value, (e) => {
|
|
127
133
|
var t;
|
|
128
134
|
e && p.value && ((t = e.setFieldsValue) == null || t.call(e, p.value), p.value = void 0);
|
|
129
|
-
}),
|
|
135
|
+
}), P(() => l(C), (e) => {
|
|
130
136
|
var t;
|
|
131
|
-
e && (t = l(
|
|
137
|
+
e && (t = l(c)) != null && t.resizeOnOpen && (f.value = B());
|
|
132
138
|
});
|
|
133
|
-
function
|
|
139
|
+
function B() {
|
|
134
140
|
var t;
|
|
135
|
-
const e = (t = l(
|
|
141
|
+
const e = (t = l(c)) == null ? void 0 : t.minWidth;
|
|
136
142
|
return !e || e && e < n.width ? n.width : e;
|
|
137
143
|
}
|
|
138
|
-
const
|
|
144
|
+
const x = re(F.trigger), T = x ? Z(x, {
|
|
139
145
|
onClick: () => {
|
|
140
146
|
h(!0);
|
|
141
147
|
}
|
|
@@ -149,7 +155,7 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
149
155
|
e.push(d(V, {
|
|
150
156
|
onClick: R,
|
|
151
157
|
disabled: u.value
|
|
152
|
-
},
|
|
158
|
+
}, U(o = z("ap.common.cancelText")) ? o : {
|
|
153
159
|
default: () => [o]
|
|
154
160
|
}));
|
|
155
161
|
}
|
|
@@ -176,22 +182,22 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
176
182
|
})), d(le, {
|
|
177
183
|
justify: "flex-end"
|
|
178
184
|
}, {
|
|
179
|
-
default: () => [
|
|
185
|
+
default: () => [F.submitter ? F.submitter(e) : d(ae, null, U(e) ? e : {
|
|
180
186
|
default: () => [e]
|
|
181
187
|
})]
|
|
182
188
|
});
|
|
183
189
|
});
|
|
184
190
|
function A() {
|
|
185
191
|
var e, t;
|
|
186
|
-
(t = (e =
|
|
192
|
+
(t = (e = c.value) == null ? void 0 : e.onResize) == null || t.call(e), document.addEventListener("mousemove", k), document.addEventListener("mouseup", O);
|
|
187
193
|
}
|
|
188
|
-
function
|
|
189
|
-
const t = l(
|
|
194
|
+
function k(e) {
|
|
195
|
+
const t = l(c), i = (document.body.offsetWidth || 1e3) - (e.clientX - document.body.offsetLeft), s = (t == null ? void 0 : t.minWidth) ?? (n.width || 800), r = (t == null ? void 0 : t.maxWidth) ?? window.innerWidth * 0.8;
|
|
190
196
|
let o = i;
|
|
191
197
|
i < s && (o = s), i > r && (o = r), f.value = o;
|
|
192
198
|
}
|
|
193
199
|
function O() {
|
|
194
|
-
document.removeEventListener("mousemove",
|
|
200
|
+
document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", O);
|
|
195
201
|
}
|
|
196
202
|
function X() {
|
|
197
203
|
var e, t, i;
|
|
@@ -203,7 +209,7 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
203
209
|
try {
|
|
204
210
|
const r = await ((e = a.value) == null ? void 0 : e.validateFields());
|
|
205
211
|
(i = (t = n.submitter) == null ? void 0 : t.onSubmit) == null || i.call(t), u.value = !0;
|
|
206
|
-
const o = (s = n.onFinish) == null ? void 0 : s.call(n,
|
|
212
|
+
const o = (s = n.onFinish) == null ? void 0 : s.call(n, me(r));
|
|
207
213
|
if (n.submitTimeout && o instanceof Promise) {
|
|
208
214
|
const J = setTimeout(() => u.value = !1, n.submitTimeout);
|
|
209
215
|
o.finally(() => {
|
|
@@ -221,7 +227,7 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
221
227
|
function H(e) {
|
|
222
228
|
!e && l(u) || h(e);
|
|
223
229
|
}
|
|
224
|
-
return
|
|
230
|
+
return j({
|
|
225
231
|
resetFields: () => {
|
|
226
232
|
var e;
|
|
227
233
|
(e = a.value) == null || e.resetFields();
|
|
@@ -262,31 +268,31 @@ const Ee = /* @__PURE__ */ Q({
|
|
|
262
268
|
var t;
|
|
263
269
|
return (t = a.value) == null ? void 0 : t.getInternalInstance(e);
|
|
264
270
|
}
|
|
265
|
-
}), (e, t) => (
|
|
271
|
+
}), (e, t) => (y(), N(ee, null, [d(l(se), b(e.drawerProps, {
|
|
266
272
|
open: l(C),
|
|
267
273
|
"onUpdate:open": H,
|
|
268
274
|
onCancel: R,
|
|
269
275
|
width: f.value
|
|
270
276
|
}), {
|
|
271
|
-
title:
|
|
272
|
-
footer:
|
|
273
|
-
default:
|
|
277
|
+
title: g(() => [M(e.$slots, "title", {}, () => [te(ie(n.title), 1)])]),
|
|
278
|
+
footer: g(() => [(y(), S(_(I.value)))]),
|
|
279
|
+
default: g(() => [d(ve, b({
|
|
274
280
|
ref_key: "formRef",
|
|
275
281
|
ref: a
|
|
276
|
-
}, l(
|
|
277
|
-
default:
|
|
282
|
+
}, l(ce)(n, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
283
|
+
default: g(() => [M(e.$slots, "default")]),
|
|
278
284
|
_: 3
|
|
279
|
-
}, 16), e.resize ? (
|
|
285
|
+
}, 16), e.resize ? (y(), N("div", {
|
|
280
286
|
key: 0,
|
|
281
287
|
class: ne(q.value),
|
|
282
288
|
onMousedown: oe(A, ["stop", "prevent"])
|
|
283
289
|
}, null, 34)) : L("", !0)]),
|
|
284
290
|
_: 3
|
|
285
|
-
}, 16, ["open", "width"]), l(
|
|
291
|
+
}, 16, ["open", "width"]), l(T) ? (y(), S(_(l(T)), {
|
|
286
292
|
key: 0
|
|
287
293
|
})) : L("", !0)], 64));
|
|
288
294
|
}
|
|
289
295
|
});
|
|
290
296
|
export {
|
|
291
|
-
|
|
297
|
+
je as default
|
|
292
298
|
};
|
|
@@ -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> = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ApFormModalFormProps } 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 } from '../../../node_modules/vue-types';
|
|
11
11
|
import { LegacyButtonType, ButtonHTMLType } from '@aplus-frontend/antdv/es/button/buttonTypes';
|
|
@@ -31,6 +31,7 @@ declare function __VLS_template(): {
|
|
|
31
31
|
validateTrigger: string | string[];
|
|
32
32
|
hideRequiredMark: boolean;
|
|
33
33
|
validateOnRuleChange: boolean;
|
|
34
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
34
35
|
}> & Omit<{
|
|
35
36
|
readonly layout: string;
|
|
36
37
|
readonly colon: boolean;
|
|
@@ -38,6 +39,7 @@ declare function __VLS_template(): {
|
|
|
38
39
|
readonly validateTrigger: string | string[];
|
|
39
40
|
readonly hideRequiredMark: boolean;
|
|
40
41
|
readonly validateOnRuleChange: boolean;
|
|
42
|
+
readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
41
43
|
readonly size?: "small" | "large" | "middle" | undefined;
|
|
42
44
|
readonly onSubmit?: ((e: Event) => void) | undefined;
|
|
43
45
|
readonly disabled?: boolean | undefined;
|
|
@@ -122,6 +124,7 @@ declare function __VLS_template(): {
|
|
|
122
124
|
readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
|
|
123
125
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
124
126
|
readonly initialValues?: Recordable | undefined;
|
|
127
|
+
readonly syncToUrlPriority?: boolean | undefined;
|
|
125
128
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
126
129
|
size: {
|
|
127
130
|
type: PropType<"small" | "large" | "middle">;
|
|
@@ -267,7 +270,14 @@ declare function __VLS_template(): {
|
|
|
267
270
|
initialValues: {
|
|
268
271
|
type: PropType<Recordable>;
|
|
269
272
|
};
|
|
270
|
-
|
|
273
|
+
syncToUrl: {
|
|
274
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
275
|
+
default: boolean;
|
|
276
|
+
};
|
|
277
|
+
syncToUrlPriority: {
|
|
278
|
+
type: PropType<boolean>;
|
|
279
|
+
};
|
|
280
|
+
}>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
|
|
271
281
|
$attrs: {
|
|
272
282
|
[x: string]: unknown;
|
|
273
283
|
};
|
|
@@ -426,6 +436,13 @@ declare function __VLS_template(): {
|
|
|
426
436
|
initialValues: {
|
|
427
437
|
type: PropType<Recordable>;
|
|
428
438
|
};
|
|
439
|
+
syncToUrl: {
|
|
440
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
441
|
+
default: boolean;
|
|
442
|
+
};
|
|
443
|
+
syncToUrlPriority: {
|
|
444
|
+
type: PropType<boolean>;
|
|
445
|
+
};
|
|
429
446
|
}>>, {
|
|
430
447
|
resetFields: () => Promise<void>;
|
|
431
448
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -455,6 +472,7 @@ declare function __VLS_template(): {
|
|
|
455
472
|
validateTrigger: string | string[];
|
|
456
473
|
hideRequiredMark: boolean;
|
|
457
474
|
validateOnRuleChange: boolean;
|
|
475
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
458
476
|
}, {}, string, {}> & {
|
|
459
477
|
beforeCreate?: (() => void) | (() => void)[];
|
|
460
478
|
created?: (() => void) | (() => void)[];
|
|
@@ -620,6 +638,13 @@ declare function __VLS_template(): {
|
|
|
620
638
|
initialValues: {
|
|
621
639
|
type: PropType<Recordable>;
|
|
622
640
|
};
|
|
641
|
+
syncToUrl: {
|
|
642
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
643
|
+
default: boolean;
|
|
644
|
+
};
|
|
645
|
+
syncToUrlPriority: {
|
|
646
|
+
type: PropType<boolean>;
|
|
647
|
+
};
|
|
623
648
|
}>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
|
|
624
649
|
resetFields: () => Promise<void>;
|
|
625
650
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isVNode as q, defineComponent as D, useSlots as L, ref as
|
|
1
|
+
import { isVNode as q, defineComponent as D, useSlots as L, ref as g, watch as A, cloneVNode as G, computed as I, createVNode as u, mergeProps as p, unref as n, openBlock as F, createElementBlock as W, Fragment as H, withCtx as h, renderSlot as w, createTextVNode as J, toDisplayString as K, createElementVNode as Q, normalizeClass as X, createBlock as x, resolveDynamicComponent as P, createCommentVNode as Y } from "vue";
|
|
2
2
|
import { Button as V, Flex as Z, Space as ee, Modal as te } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
@@ -11,7 +11,7 @@ import { useLocale as ne } from "../../config-provider/hooks/use-locale.mjs";
|
|
|
11
11
|
import { useGlobalConfig as se } from "../../config-provider/hooks/use-global-config.mjs";
|
|
12
12
|
import { useNamespace as re } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
13
|
import ue from "../ap-form.vue2.mjs";
|
|
14
|
-
function
|
|
14
|
+
function N(d) {
|
|
15
15
|
return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !q(d);
|
|
16
16
|
}
|
|
17
17
|
const Me = /* @__PURE__ */ D({
|
|
@@ -59,6 +59,12 @@ const Me = /* @__PURE__ */ D({
|
|
|
59
59
|
onFinishFailed: {},
|
|
60
60
|
onValidate: {},
|
|
61
61
|
initialValues: {},
|
|
62
|
+
syncToUrl: {
|
|
63
|
+
type: [Boolean, Function]
|
|
64
|
+
},
|
|
65
|
+
syncToUrlPriority: {
|
|
66
|
+
type: Boolean
|
|
67
|
+
},
|
|
62
68
|
open: {
|
|
63
69
|
type: Boolean,
|
|
64
70
|
default: void 0
|
|
@@ -89,7 +95,7 @@ const Me = /* @__PURE__ */ D({
|
|
|
89
95
|
expose: S,
|
|
90
96
|
emit: _
|
|
91
97
|
}) {
|
|
92
|
-
const a = d, b = L(), R = _, o =
|
|
98
|
+
const a = d, b = L(), R = _, o = g(), c = g(), s = g(!1), {
|
|
93
99
|
value: M,
|
|
94
100
|
updateValue: m
|
|
95
101
|
} = ie(a, R, {
|
|
@@ -97,7 +103,7 @@ const Me = /* @__PURE__ */ D({
|
|
|
97
103
|
defaultValue: !1
|
|
98
104
|
}), {
|
|
99
105
|
t: v
|
|
100
|
-
} = ne(),
|
|
106
|
+
} = ne(), y = se("uiMode", "aplus"), {
|
|
101
107
|
b: j,
|
|
102
108
|
e: C
|
|
103
109
|
} = re("ap-form-modal-form");
|
|
@@ -119,14 +125,14 @@ const Me = /* @__PURE__ */ D({
|
|
|
119
125
|
e.push(u(V, {
|
|
120
126
|
onClick: k,
|
|
121
127
|
disabled: s.value
|
|
122
|
-
},
|
|
128
|
+
}, N(i = v("ap.common.cancelText")) ? i : {
|
|
123
129
|
default: () => [i]
|
|
124
130
|
}));
|
|
125
131
|
}
|
|
126
132
|
return ((t = a.submitter) == null ? void 0 : t.resetButtonProps) !== !1 && e.push(u(V, p(((l = a.submitter) == null ? void 0 : l.resetButtonProps) || {}, {
|
|
127
133
|
key: "submit",
|
|
128
134
|
disabled: s.value,
|
|
129
|
-
onClick:
|
|
135
|
+
onClick: U
|
|
130
136
|
}), {
|
|
131
137
|
default: () => {
|
|
132
138
|
var i;
|
|
@@ -137,7 +143,7 @@ const Me = /* @__PURE__ */ D({
|
|
|
137
143
|
key: "submit"
|
|
138
144
|
}, ((f = a.submitter) == null ? void 0 : f.submitButtonProps) || {}, {
|
|
139
145
|
loading: s.value,
|
|
140
|
-
onClick:
|
|
146
|
+
onClick: z
|
|
141
147
|
}), {
|
|
142
148
|
default: () => {
|
|
143
149
|
var i;
|
|
@@ -145,18 +151,18 @@ const Me = /* @__PURE__ */ D({
|
|
|
145
151
|
}
|
|
146
152
|
})), u(Z, {
|
|
147
153
|
justify: "flex-end",
|
|
148
|
-
class: C(n(
|
|
154
|
+
class: C(n(y) === "admin" ? "footer-admin" : "footer")
|
|
149
155
|
}, {
|
|
150
|
-
default: () => [b.submitter ? b.submitter(e) : u(ee, null,
|
|
156
|
+
default: () => [b.submitter ? b.submitter(e) : u(ee, null, N(e) ? e : {
|
|
151
157
|
default: () => [e]
|
|
152
158
|
})]
|
|
153
159
|
});
|
|
154
160
|
});
|
|
155
|
-
function
|
|
161
|
+
function U() {
|
|
156
162
|
var e, t, l;
|
|
157
163
|
a.submitter !== !1 && ((e = o.value) == null || e.resetFields(), (l = (t = a.submitter) == null ? void 0 : t.onReset) == null || l.call(t));
|
|
158
164
|
}
|
|
159
|
-
async function
|
|
165
|
+
async function z() {
|
|
160
166
|
var e, t, l, r;
|
|
161
167
|
if (a.submitter !== !1)
|
|
162
168
|
try {
|
|
@@ -177,7 +183,7 @@ const Me = /* @__PURE__ */ D({
|
|
|
177
183
|
function k() {
|
|
178
184
|
n(s) || m(!1);
|
|
179
185
|
}
|
|
180
|
-
function
|
|
186
|
+
function E(e) {
|
|
181
187
|
!e && n(s) || m(e);
|
|
182
188
|
}
|
|
183
189
|
return S({
|
|
@@ -223,29 +229,29 @@ const Me = /* @__PURE__ */ D({
|
|
|
223
229
|
}
|
|
224
230
|
}), (e, t) => (F(), W(H, null, [u(n(te), p(e.modalProps, {
|
|
225
231
|
open: n(M),
|
|
226
|
-
"onUpdate:open":
|
|
232
|
+
"onUpdate:open": E,
|
|
227
233
|
onCancel: k,
|
|
228
234
|
footer: null,
|
|
229
235
|
width: e.width,
|
|
230
236
|
class: n(j)(),
|
|
231
237
|
"body-style": {
|
|
232
|
-
padding: n(
|
|
238
|
+
padding: n(y) === "admin" ? "0px !important" : "20px !important"
|
|
233
239
|
// 这里使用内联样式目的是为了使用最高优先级覆盖设置的全局样式
|
|
234
240
|
// 使用ModalForm你可能无法再自定义body的样式
|
|
235
241
|
}
|
|
236
242
|
}), {
|
|
237
|
-
title:
|
|
238
|
-
default:
|
|
239
|
-
class: X(n(C)(n(
|
|
243
|
+
title: h(() => [w(e.$slots, "title", {}, () => [J(K(a.title), 1)])]),
|
|
244
|
+
default: h(() => [Q("div", {
|
|
245
|
+
class: X(n(C)(n(y) === "admin" ? "content-admin" : "content"))
|
|
240
246
|
}, [u(ue, p({
|
|
241
247
|
ref_key: "formRef",
|
|
242
248
|
ref: o
|
|
243
249
|
}, n(ae)(a, ["modalProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
244
|
-
default:
|
|
250
|
+
default: h(() => [w(e.$slots, "default")]),
|
|
245
251
|
_: 3
|
|
246
|
-
}, 16)], 2), (F(), x(
|
|
252
|
+
}, 16)], 2), (F(), x(P(O.value)))]),
|
|
247
253
|
_: 3
|
|
248
|
-
}, 16, ["open", "width", "class", "body-style"]), n(T) ? (F(), x(
|
|
254
|
+
}, 16, ["open", "width", "class", "body-style"]), n(T) ? (F(), x(P(n(T)), {
|
|
249
255
|
key: 0
|
|
250
256
|
})) : Y("", !0)], 64));
|
|
251
257
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ApFormExpose, ApFormSearchFormProps } from '../interface';
|
|
2
2
|
import { ComponentInternalInstance, ExtractPropTypes, PropType, HTMLAttributes, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, ComponentOptionsMixin, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties, DefineComponent, ComputedRef, PublicProps } from 'vue';
|
|
3
3
|
import { FormLabelAlign, ValidateMessages, FieldData, ValidateErrorEntity, NamePath, ValidateOptions, InternalNamePath } 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 } from '..';
|
|
10
10
|
declare function __VLS_template(): {
|
|
11
11
|
slots: Readonly<{
|
|
@@ -26,6 +26,7 @@ declare function __VLS_template(): {
|
|
|
26
26
|
validateTrigger: string | string[];
|
|
27
27
|
hideRequiredMark: boolean;
|
|
28
28
|
validateOnRuleChange: boolean;
|
|
29
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
29
30
|
}> & Omit<{
|
|
30
31
|
readonly layout: string;
|
|
31
32
|
readonly colon: boolean;
|
|
@@ -33,6 +34,7 @@ declare function __VLS_template(): {
|
|
|
33
34
|
readonly validateTrigger: string | string[];
|
|
34
35
|
readonly hideRequiredMark: boolean;
|
|
35
36
|
readonly validateOnRuleChange: boolean;
|
|
37
|
+
readonly syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
36
38
|
readonly size?: "small" | "large" | "middle" | undefined;
|
|
37
39
|
readonly onSubmit?: ((e: Event) => void) | undefined;
|
|
38
40
|
readonly disabled?: boolean | undefined;
|
|
@@ -117,6 +119,7 @@ declare function __VLS_template(): {
|
|
|
117
119
|
readonly onFinishFailed?: ((errorInfo: ValidateErrorEntity<any>) => void) | undefined;
|
|
118
120
|
readonly onValidate?: ((name: string | number | string[] | number[], status: boolean, errors: string[]) => void) | undefined;
|
|
119
121
|
readonly initialValues?: Recordable | undefined;
|
|
122
|
+
readonly syncToUrlPriority?: boolean | undefined;
|
|
120
123
|
} & VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
121
124
|
size: {
|
|
122
125
|
type: PropType<"small" | "large" | "middle">;
|
|
@@ -262,7 +265,14 @@ declare function __VLS_template(): {
|
|
|
262
265
|
initialValues: {
|
|
263
266
|
type: PropType<Recordable>;
|
|
264
267
|
};
|
|
265
|
-
|
|
268
|
+
syncToUrl: {
|
|
269
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
270
|
+
default: boolean;
|
|
271
|
+
};
|
|
272
|
+
syncToUrlPriority: {
|
|
273
|
+
type: PropType<boolean>;
|
|
274
|
+
};
|
|
275
|
+
}>>, "layout" | "colon" | "labelAlign" | "validateTrigger" | "hideRequiredMark" | "validateOnRuleChange" | "syncToUrl">;
|
|
266
276
|
$attrs: {
|
|
267
277
|
[x: string]: unknown;
|
|
268
278
|
};
|
|
@@ -421,6 +431,13 @@ declare function __VLS_template(): {
|
|
|
421
431
|
initialValues: {
|
|
422
432
|
type: PropType<Recordable>;
|
|
423
433
|
};
|
|
434
|
+
syncToUrl: {
|
|
435
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
436
|
+
default: boolean;
|
|
437
|
+
};
|
|
438
|
+
syncToUrlPriority: {
|
|
439
|
+
type: PropType<boolean>;
|
|
440
|
+
};
|
|
424
441
|
}>>, {
|
|
425
442
|
resetFields: () => Promise<void>;
|
|
426
443
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|
|
@@ -450,6 +467,7 @@ declare function __VLS_template(): {
|
|
|
450
467
|
validateTrigger: string | string[];
|
|
451
468
|
hideRequiredMark: boolean;
|
|
452
469
|
validateOnRuleChange: boolean;
|
|
470
|
+
syncToUrl: boolean | ((values: Recordable, type: "get" | "set") => Recordable);
|
|
453
471
|
}, {}, string, {}> & {
|
|
454
472
|
beforeCreate?: (() => void) | (() => void)[];
|
|
455
473
|
created?: (() => void) | (() => void)[];
|
|
@@ -615,6 +633,13 @@ declare function __VLS_template(): {
|
|
|
615
633
|
initialValues: {
|
|
616
634
|
type: PropType<Recordable>;
|
|
617
635
|
};
|
|
636
|
+
syncToUrl: {
|
|
637
|
+
type: PropType<boolean | ((values: Recordable, type: "get" | "set") => Recordable)>;
|
|
638
|
+
default: boolean;
|
|
639
|
+
};
|
|
640
|
+
syncToUrlPriority: {
|
|
641
|
+
type: PropType<boolean>;
|
|
642
|
+
};
|
|
618
643
|
}>>, "validate" | "setFieldValue" | "setFieldsValue" | "resetFields" | "clearValidate" | "validateFields" | "getFieldsValue" | "scrollToField" | "getInternalInstance" | "validateFieldsReturnTransformed" | "getFieldsValueTransformed" | "registerWatch"> & ShallowUnwrapRef<{
|
|
619
644
|
resetFields: () => Promise<void>;
|
|
620
645
|
clearValidate: (name?: NamePath | NamePath[]) => void;
|