@aplus-frontend/ui 7.7.3 → 7.7.5
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-action/group/index.vue.d.ts +1 -0
- package/es/src/ap-action/group/index.vue.mjs +28 -28
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
- package/es/src/ap-button/ap-action-button.vue.d.ts +2 -1
- package/es/src/ap-button/ap-button.vue.d.ts +2 -1
- package/es/src/ap-field/checkbox/index.vue.mjs +18 -8
- package/es/src/ap-field/number/index.vue.d.ts +20 -0
- package/es/src/ap-field/number/index.vue.mjs +24 -23
- package/es/src/ap-field/number/read.vue2.mjs +3 -2
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/rate/index.vue.mjs +10 -10
- package/es/src/ap-field/select/index.vue.d.ts +12 -4
- package/es/src/ap-field/select/index.vue.mjs +74 -71
- package/es/src/ap-field/slider/index.vue.d.ts +4 -2
- package/es/src/ap-field/slider/index.vue.mjs +12 -12
- package/es/src/ap-field/switch/index.vue.mjs +20 -20
- package/es/src/ap-field/text/index.vue2.mjs +23 -23
- package/es/src/ap-field/text/password.vue.mjs +9 -9
- package/es/src/ap-field/text-area/index.vue.mjs +24 -20
- package/es/src/ap-field/tree-select/index.vue.d.ts +2 -0
- package/es/src/ap-field/tree-select/index.vue.mjs +17 -17
- package/es/src/ap-form/ap-form.vue2.mjs +64 -64
- package/es/src/ap-form/drawer-form/index.vue.mjs +41 -41
- package/es/src/ap-form/item/index.vue.mjs +64 -64
- package/es/src/ap-form/items/number/index.vue.d.ts +22 -0
- package/es/src/ap-form/items/number/index.vue.mjs +10 -10
- package/es/src/ap-form/items/radio/index.vue.mjs +3 -3
- package/es/src/ap-form/items/select/index.vue.d.ts +18 -6
- package/es/src/ap-form/items/select/index.vue.mjs +5 -5
- package/es/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/es/src/ap-form/items/text/index.vue2.mjs +6 -6
- package/es/src/ap-form/items/text/password.vue.mjs +7 -7
- package/es/src/ap-form/items/text-area/index.vue.mjs +5 -5
- package/es/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
- package/es/src/ap-form/items/tree-select/index.vue.mjs +7 -7
- package/es/src/ap-form/modal-form/index.vue.d.ts +25 -1
- package/es/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
- package/es/src/ap-form/search-form/index.vue.mjs +63 -63
- package/es/src/ap-form/style/item.mjs +8 -7
- package/es/src/ap-list/index.vue.mjs +6 -6
- package/es/src/ap-table/constants.d.ts +23 -4
- package/es/src/business/ap-batch-action-group/index.d.ts +34 -4
- package/es/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
- package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +58 -79
- package/es/src/business/ap-descriptions/interface.d.ts +2 -3
- package/es/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/es/src/business/ap-upload/apUpload.vue.mjs +33 -29
- package/es/src/business/ap-upload/apUploadTypes.d.ts +4 -0
- package/es/src/business/ap-upload/components/MultipleFile.vue2.mjs +50 -49
- package/es/src/business/ap-upload/components/Picture.vue2.mjs +66 -65
- package/es/src/business/ap-upload/components/SingleFile.vue2.mjs +95 -94
- package/es/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/es/src/business/ap-upload/hooks/useOss.mjs +26 -24
- package/es/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/es/src/editable-table/form-item.vue.mjs +64 -64
- package/es/src/editable-table/index.vue.mjs +66 -66
- package/es/src/scroll-bar/index.vue.d.ts +7 -7
- package/es/src/scroll-bar/index.vue.mjs +21 -21
- package/es/src/scroll-bar/internal.vue.d.ts +4 -4
- package/es/src/scroll-bar/internal.vue.mjs +20 -20
- package/es/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/es/src/scroll-view/hooks/use-scroll-wrapper.mjs +13 -13
- package/es/src/scroll-view/index.vue.d.ts +25 -25
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ap-action/group/index.vue.d.ts +1 -0
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +25 -1
- package/lib/src/ap-button/ap-action-button.vue.d.ts +2 -1
- package/lib/src/ap-button/ap-button.vue.d.ts +2 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/number/index.vue.d.ts +20 -0
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/number/read.vue2.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/rate/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +12 -4
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/slider/index.vue.d.ts +4 -2
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/index.vue2.js +1 -1
- package/lib/src/ap-field/text/password.vue.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.d.ts +2 -0
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.d.ts +22 -0
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/select/index.vue.d.ts +18 -6
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue.d.ts +2 -2
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/items/tree-select/index.vue.d.ts +2 -0
- package/lib/src/ap-form/items/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.d.ts +25 -1
- package/lib/src/ap-form/search-form/components/popover-filter.vue.d.ts +19 -1
- package/lib/src/ap-form/search-form/index.vue.js +1 -1
- package/lib/src/ap-form/style/item.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +23 -4
- package/lib/src/business/ap-batch-action-group/index.d.ts +34 -4
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.d.ts +3 -10
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/business/ap-descriptions/interface.d.ts +2 -3
- package/lib/src/business/ap-upload/apUpload.vue.d.ts +9 -0
- package/lib/src/business/ap-upload/apUpload.vue.js +1 -1
- package/lib/src/business/ap-upload/apUploadTypes.d.ts +4 -0
- package/lib/src/business/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/business/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-upload/hooks/useOss.d.ts +2 -1
- package/lib/src/business/ap-upload/hooks/useOss.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.d.ts +1 -1
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/scroll-bar/index.vue.d.ts +7 -7
- package/lib/src/scroll-bar/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.d.ts +4 -4
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.d.ts +4 -4
- package/lib/src/scroll-view/hooks/use-scroll-wrapper.js +1 -1
- package/lib/src/scroll-view/index.vue.d.ts +25 -25
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +5 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { isVNode as
|
|
1
|
+
import { isVNode as A, defineComponent as F, useSlots as L, shallowRef as _, computed as E, unref as e, createVNode as d, Fragment as g, createBlock as v, openBlock as S, resolveDynamicComponent as K, mergeProps as U, createSlots as z, renderList as M, withCtx as B, renderSlot as j, normalizeProps as q, guardReactiveProps as O } from "vue";
|
|
2
2
|
import { Space as $, Tag as H, TreeSelect as W, Spin as G } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../../hooks/index.mjs";
|
|
4
4
|
import { isArray as J, omit as Q } from "lodash-unified";
|
|
5
5
|
import { useRequest as X } from "./use-request.mjs";
|
|
6
6
|
import { useControllableValue as Y } from "../../hooks/useControllableValue.mjs";
|
|
7
|
-
function
|
|
8
|
-
return typeof
|
|
7
|
+
function w(r) {
|
|
8
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !A(r);
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const de = /* @__PURE__ */ F({
|
|
11
11
|
name: "ApFieldTreeSelect",
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: {
|
|
@@ -172,11 +172,11 @@ const re = /* @__PURE__ */ L({
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
emits: ["update:value"],
|
|
175
|
-
setup(
|
|
176
|
-
expose:
|
|
177
|
-
emit:
|
|
175
|
+
setup(r, {
|
|
176
|
+
expose: x,
|
|
177
|
+
emit: C
|
|
178
178
|
}) {
|
|
179
|
-
const o =
|
|
179
|
+
const o = r, N = L(), T = C, p = _(), {
|
|
180
180
|
value: f,
|
|
181
181
|
updateValue: b
|
|
182
182
|
} = Y(o, T), {
|
|
@@ -187,25 +187,25 @@ const re = /* @__PURE__ */ L({
|
|
|
187
187
|
let t;
|
|
188
188
|
const u = e(f), i = J(u) ? u : [u].filter(Boolean);
|
|
189
189
|
if (!i.length)
|
|
190
|
-
return
|
|
190
|
+
return d(g, null, [o.emptyText]);
|
|
191
191
|
const n = [], s = o.fieldNames?.label || "label", P = o.fieldNames?.value || "value";
|
|
192
192
|
function h(a) {
|
|
193
193
|
for (const l of a) {
|
|
194
|
-
if (i.find((
|
|
194
|
+
if (i.find((R) => R === l[P]) && n.push(l[s]), n.length === i.length)
|
|
195
195
|
return;
|
|
196
196
|
l.children?.length && h(l.children);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
return h(e(c)), n.length ? n.length === 1 ?
|
|
199
|
+
return h(e(c)), n.length ? n.length === 1 ? d("span", null, [n[0]]) : d($, {
|
|
200
200
|
size: 4
|
|
201
|
-
},
|
|
201
|
+
}, w(t = n.map((a, l) => d(H, {
|
|
202
202
|
style: "margin-right: 0px",
|
|
203
203
|
key: `${a}-${l}`
|
|
204
|
-
},
|
|
204
|
+
}, w(a) ? a : {
|
|
205
205
|
default: () => [a]
|
|
206
206
|
}))) ? t : {
|
|
207
207
|
default: () => [t]
|
|
208
|
-
}) :
|
|
208
|
+
}) : d(g, null, [o.emptyText]);
|
|
209
209
|
});
|
|
210
210
|
function V() {
|
|
211
211
|
p.value?.focus?.();
|
|
@@ -216,7 +216,7 @@ const re = /* @__PURE__ */ L({
|
|
|
216
216
|
function I(t) {
|
|
217
217
|
return y(t);
|
|
218
218
|
}
|
|
219
|
-
return
|
|
219
|
+
return x({
|
|
220
220
|
request: y,
|
|
221
221
|
focus: V,
|
|
222
222
|
blur: k
|
|
@@ -239,7 +239,7 @@ const re = /* @__PURE__ */ L({
|
|
|
239
239
|
fn: B((s) => [j(t.$slots, n, q(O(s || {})))])
|
|
240
240
|
})), e(m) ? {
|
|
241
241
|
name: "notFoundContent",
|
|
242
|
-
fn: B(() => [
|
|
242
|
+
fn: B(() => [d(e(G), {
|
|
243
243
|
size: "small"
|
|
244
244
|
})]),
|
|
245
245
|
key: "0"
|
|
@@ -247,5 +247,5 @@ const re = /* @__PURE__ */ L({
|
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
249
|
export {
|
|
250
|
-
|
|
250
|
+
de as default
|
|
251
251
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useProvideForm as
|
|
4
|
-
import { isArray as f, cloneDeep as
|
|
5
|
-
import { useUrlSearchParams as
|
|
6
|
-
import { INTERNAL_FORM_INSTANCE_MARK as
|
|
7
|
-
import { getRouteType as
|
|
8
|
-
import
|
|
9
|
-
import { genParams as B, setToParams as
|
|
10
|
-
import { useInjectFormProvider as
|
|
11
|
-
import { getModelValue as
|
|
12
|
-
import { useDevWarning as
|
|
1
|
+
import { defineComponent as ee, reactive as te, shallowRef as re, ref as oe, unref as h, nextTick as ne, toRaw as P, watch as ie, onWatcherCleanup as le, computed as se, createBlock as ae, openBlock as ue, mergeProps as ce, withCtx as fe, renderSlot as de } from "vue";
|
|
2
|
+
import { Form as ge } from "@aplus-frontend/antdv";
|
|
3
|
+
import { useProvideForm as me } from "./context.mjs";
|
|
4
|
+
import { isArray as f, cloneDeep as pe, isEqual as he, isFunction as R, isPlainObject as M, omit as Fe } from "lodash-unified";
|
|
5
|
+
import { useUrlSearchParams as ye } from "@vueuse/core";
|
|
6
|
+
import { INTERNAL_FORM_INSTANCE_MARK as O } from "./constant.mjs";
|
|
7
|
+
import { getRouteType as Te } from "../utils/index.mjs";
|
|
8
|
+
import Ve from "./utils/set.mjs";
|
|
9
|
+
import { genParams as B, setToParams as j } from "./utils/params.mjs";
|
|
10
|
+
import { useInjectFormProvider as ve } from "./provider/context.mjs";
|
|
11
|
+
import { getModelValue as x } from "./utils/get.mjs";
|
|
12
|
+
import { useDevWarning as Ce } from "../utils/warning.mjs";
|
|
13
13
|
import { isDef as T } from "../utils/is.mjs";
|
|
14
|
-
const
|
|
14
|
+
const xe = /* @__PURE__ */ ee({
|
|
15
15
|
name: "ApForm",
|
|
16
16
|
__name: "ap-form",
|
|
17
17
|
props: {
|
|
@@ -43,8 +43,8 @@ const je = /* @__PURE__ */ te({
|
|
|
43
43
|
syncToUrl: { type: [Boolean, Function], default: !1 },
|
|
44
44
|
syncToUrlPriority: { type: Boolean }
|
|
45
45
|
},
|
|
46
|
-
setup(
|
|
47
|
-
const n =
|
|
46
|
+
setup(W, { expose: N }) {
|
|
47
|
+
const n = W;
|
|
48
48
|
function V(e, t, r = !0, o) {
|
|
49
49
|
if (f(e)) {
|
|
50
50
|
let i = l;
|
|
@@ -60,11 +60,11 @@ const je = /* @__PURE__ */ te({
|
|
|
60
60
|
}
|
|
61
61
|
y();
|
|
62
62
|
}
|
|
63
|
-
const s =
|
|
63
|
+
const s = re(), v = ye(Te()), F = ve(), S = Ce("ApForm"), C = oe(
|
|
64
64
|
n.syncToUrl ? B(n.syncToUrl, v, "get") : {}
|
|
65
65
|
);
|
|
66
|
-
let d =
|
|
67
|
-
const l =
|
|
66
|
+
let d = pe(_()), g = {};
|
|
67
|
+
const l = te(_());
|
|
68
68
|
let m = [];
|
|
69
69
|
function _() {
|
|
70
70
|
const e = n.initialValues || {};
|
|
@@ -76,13 +76,13 @@ const je = /* @__PURE__ */ te({
|
|
|
76
76
|
...e
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function q(e) {
|
|
80
80
|
const t = p(e, g);
|
|
81
|
-
F.triggerFormFinish(n.name, e), n.syncToUrl &&
|
|
81
|
+
F.triggerFormFinish(n.name, e), n.syncToUrl && j(v, B(n.syncToUrl, t, "set")), n.onFinish?.(t);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
84
|
-
s.value?.resetFields(), await
|
|
85
|
-
Object.keys(l).forEach((e) => delete l[e]), Object.assign(l, d), y(), n.syncToUrl &&
|
|
83
|
+
const D = async () => {
|
|
84
|
+
s.value?.resetFields(), await ne(() => {
|
|
85
|
+
Object.keys(l).forEach((e) => delete l[e]), Object.assign(l, d), y(), n.syncToUrl && j(
|
|
86
86
|
v,
|
|
87
87
|
B(
|
|
88
88
|
n.syncToUrl,
|
|
@@ -91,20 +91,20 @@ const je = /* @__PURE__ */ te({
|
|
|
91
91
|
)
|
|
92
92
|
);
|
|
93
93
|
});
|
|
94
|
-
},
|
|
94
|
+
}, K = (e) => {
|
|
95
95
|
s.value?.clearValidate(e);
|
|
96
|
-
},
|
|
96
|
+
}, L = (e, t) => s.value?.validateFields(e, t), $ = async (e, t) => {
|
|
97
97
|
const r = await s.value?.validateFields(
|
|
98
98
|
e,
|
|
99
99
|
t
|
|
100
100
|
);
|
|
101
101
|
return p(r, g);
|
|
102
|
-
}, b = (e) => e === !0 ? P(l) : s.value?.getFieldsValue(e),
|
|
102
|
+
}, b = (e) => e === !0 ? P(l) : s.value?.getFieldsValue(e), k = (e) => {
|
|
103
103
|
const t = b(e);
|
|
104
104
|
return p(t, g);
|
|
105
|
-
},
|
|
105
|
+
}, G = (e, t) => s.value?.validate(e, t), H = (e, t = {}) => {
|
|
106
106
|
s.value?.scrollToField(e, t);
|
|
107
|
-
},
|
|
107
|
+
}, J = (e) => {
|
|
108
108
|
Object.assign(l, e), y();
|
|
109
109
|
}, I = (e, t, r = !0, o) => {
|
|
110
110
|
V(e, t, r, o), y();
|
|
@@ -114,7 +114,7 @@ const je = /* @__PURE__ */ te({
|
|
|
114
114
|
m = m.filter((t) => t !== e);
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Q(e, t) {
|
|
118
118
|
if (f(e)) {
|
|
119
119
|
let r = d;
|
|
120
120
|
for (let o = 0; o < e.length - 1; o++)
|
|
@@ -123,17 +123,17 @@ const je = /* @__PURE__ */ te({
|
|
|
123
123
|
} else
|
|
124
124
|
d[e] = t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function X(e, t) {
|
|
127
127
|
if (!T(e) || !T(t))
|
|
128
128
|
return;
|
|
129
|
-
const r =
|
|
130
|
-
if (
|
|
129
|
+
const r = x(d, t);
|
|
130
|
+
if (he(r, e))
|
|
131
131
|
return;
|
|
132
|
-
const o =
|
|
133
|
-
T(o) && n.syncToUrlPriority || (V(t, e, !1),
|
|
132
|
+
const o = x(h(C), t);
|
|
133
|
+
T(o) && n.syncToUrlPriority || (V(t, e, !1), Q(t, e));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
t && (g =
|
|
135
|
+
function Y(e, t) {
|
|
136
|
+
t && (g = Ve(
|
|
137
137
|
g,
|
|
138
138
|
[e].flat(1),
|
|
139
139
|
t,
|
|
@@ -141,17 +141,17 @@ const je = /* @__PURE__ */ te({
|
|
|
141
141
|
));
|
|
142
142
|
}
|
|
143
143
|
function w({ initialValue: e, name: t, transform: r }) {
|
|
144
|
-
|
|
144
|
+
X(e, t), Y(t, r);
|
|
145
145
|
}
|
|
146
146
|
function A() {
|
|
147
147
|
return d;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
if (
|
|
151
|
-
e ===
|
|
149
|
+
function Z(e) {
|
|
150
|
+
if (S(
|
|
151
|
+
e === O,
|
|
152
152
|
"usage",
|
|
153
153
|
"getInternalInstance should only used at internal"
|
|
154
|
-
), e ===
|
|
154
|
+
), e === O)
|
|
155
155
|
return {
|
|
156
156
|
registerField: w,
|
|
157
157
|
registerWatch: U,
|
|
@@ -172,14 +172,14 @@ const je = /* @__PURE__ */ te({
|
|
|
172
172
|
return;
|
|
173
173
|
let r = f(e) ? [] : {};
|
|
174
174
|
return Object.keys(e).forEach((o) => {
|
|
175
|
-
const a = e[o], i = t?.[o], u =
|
|
176
|
-
if (
|
|
175
|
+
const a = e[o], i = t?.[o], u = R(i) ? i : i?.transformer, z = R(i) ? !0 : i?.flat;
|
|
176
|
+
if (R(u)) {
|
|
177
177
|
const c = u(a);
|
|
178
|
-
|
|
178
|
+
z ? f(c) && f(r) ? r = [...r, ...c] : M(c) && M(r) ? r = {
|
|
179
179
|
...r,
|
|
180
180
|
...c
|
|
181
181
|
} : r[o] = c : r[o] = c;
|
|
182
|
-
} else if (
|
|
182
|
+
} else if (M(a) || f(a)) {
|
|
183
183
|
const c = p(
|
|
184
184
|
a,
|
|
185
185
|
i
|
|
@@ -190,31 +190,31 @@ const je = /* @__PURE__ */ te({
|
|
|
190
190
|
}), r;
|
|
191
191
|
}
|
|
192
192
|
const E = {
|
|
193
|
-
resetFields:
|
|
194
|
-
clearValidate:
|
|
195
|
-
validateFields:
|
|
193
|
+
resetFields: D,
|
|
194
|
+
clearValidate: K,
|
|
195
|
+
validateFields: L,
|
|
196
196
|
getFieldsValue: b,
|
|
197
|
-
validate:
|
|
198
|
-
scrollToField:
|
|
199
|
-
setFieldsValue:
|
|
197
|
+
validate: G,
|
|
198
|
+
scrollToField: H,
|
|
199
|
+
setFieldsValue: J,
|
|
200
200
|
setFieldValue: I,
|
|
201
201
|
registerWatch: U,
|
|
202
|
-
validateFieldsReturnTransformed:
|
|
203
|
-
getFieldsValueTransformed:
|
|
204
|
-
getInternalInstance:
|
|
202
|
+
validateFieldsReturnTransformed: $,
|
|
203
|
+
getFieldsValueTransformed: k,
|
|
204
|
+
getInternalInstance: Z
|
|
205
205
|
};
|
|
206
|
-
return
|
|
206
|
+
return ie(
|
|
207
207
|
() => n.name,
|
|
208
208
|
(e) => {
|
|
209
|
-
e && (F.registerForm(e, E),
|
|
209
|
+
e && (F.registerForm(e, E), le(() => {
|
|
210
210
|
F.unregisterForm(n.name);
|
|
211
211
|
}));
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
immediate: !0
|
|
215
215
|
}
|
|
216
|
-
),
|
|
217
|
-
model:
|
|
216
|
+
), me({
|
|
217
|
+
model: se(() => l),
|
|
218
218
|
updateModel: V,
|
|
219
219
|
internalInstance: {
|
|
220
220
|
registerWatch: U,
|
|
@@ -222,12 +222,12 @@ const je = /* @__PURE__ */ te({
|
|
|
222
222
|
setFieldValue: I,
|
|
223
223
|
getInitialValues: A
|
|
224
224
|
}
|
|
225
|
-
}),
|
|
225
|
+
}), N(E), (e, t) => (ue(), ae(h(ge), ce(
|
|
226
226
|
{
|
|
227
227
|
ref_key: "formRef",
|
|
228
228
|
ref: s
|
|
229
229
|
},
|
|
230
|
-
h(
|
|
230
|
+
h(Fe)(n, [
|
|
231
231
|
"initialValues",
|
|
232
232
|
"onValuesChange",
|
|
233
233
|
"onFinish",
|
|
@@ -237,16 +237,16 @@ const je = /* @__PURE__ */ te({
|
|
|
237
237
|
{
|
|
238
238
|
model: l,
|
|
239
239
|
"data-form-name": e.name,
|
|
240
|
-
onFinish:
|
|
240
|
+
onFinish: q
|
|
241
241
|
}
|
|
242
242
|
), {
|
|
243
|
-
default:
|
|
244
|
-
|
|
243
|
+
default: fe(() => [
|
|
244
|
+
de(e.$slots, "default")
|
|
245
245
|
]),
|
|
246
246
|
_: 3
|
|
247
247
|
}, 16, ["model", "data-form-name"]));
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
250
|
export {
|
|
251
|
-
|
|
251
|
+
xe as default
|
|
252
252
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { isVNode as Q, defineComponent as Y, useSlots as Z, ref as
|
|
2
|
-
import { Button as z, Flex as
|
|
1
|
+
import { isVNode as Q, defineComponent as Y, useSlots as Z, shallowRef as ee, ref as y, computed as w, unref as n, watch as P, cloneVNode as te, createVNode as s, mergeProps as p, createElementBlock as N, openBlock as h, Fragment as ie, createBlock as S, createCommentVNode as M, withCtx as v, renderSlot as _, withModifiers as ne, normalizeClass as oe, resolveDynamicComponent as I, createTextVNode as ae, toDisplayString as se } from "vue";
|
|
2
|
+
import { Button as z, Flex as le, Space as re, Drawer as ue } from "@aplus-frontend/antdv";
|
|
3
3
|
import "../ap-form.vue.mjs";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
|
-
import { getSingleVNode as
|
|
5
|
+
import { getSingleVNode as de } from "../../utils/slot.mjs";
|
|
6
6
|
import "../../config-provider/index.mjs";
|
|
7
|
-
import { isBoolean as
|
|
8
|
-
import { convertReactiveToRaw as
|
|
9
|
-
import
|
|
10
|
-
import { useControllableValue as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useNamespace as
|
|
13
|
-
import
|
|
7
|
+
import { isBoolean as me, isUndefined as ce, omit as fe } from "lodash-unified";
|
|
8
|
+
import { convertReactiveToRaw as pe } from "../../utils/index.mjs";
|
|
9
|
+
import he from "../style/drawer-form.mjs";
|
|
10
|
+
import { useControllableValue as ve } from "../../hooks/useControllableValue.mjs";
|
|
11
|
+
import { useLocale as be } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useNamespace as ge } from "../../config-provider/hooks/use-namespace.mjs";
|
|
13
|
+
import Fe from "../ap-form.vue2.mjs";
|
|
14
14
|
function L(r) {
|
|
15
15
|
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Q(r);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const De = /* @__PURE__ */ Y({
|
|
18
18
|
name: "ApFormDrawerForm",
|
|
19
19
|
__name: "index",
|
|
20
20
|
props: {
|
|
@@ -101,10 +101,10 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
101
101
|
expose: U,
|
|
102
102
|
emit: j
|
|
103
103
|
}) {
|
|
104
|
-
const t = r,
|
|
104
|
+
const t = r, b = Z(), E = j, o = ee(), d = y(), a = y(!1), {
|
|
105
105
|
value: C,
|
|
106
106
|
updateValue: m
|
|
107
|
-
} =
|
|
107
|
+
} = ve(t, E, {
|
|
108
108
|
valuePropName: "open",
|
|
109
109
|
defaultValue: !1
|
|
110
110
|
}), l = w(() => {
|
|
@@ -115,19 +115,19 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
115
115
|
maxWidth: window.innerWidth * 0.8,
|
|
116
116
|
resizeOnOpen: !0
|
|
117
117
|
};
|
|
118
|
-
return
|
|
118
|
+
return me(t.resize) ? t.resize ? e : {} : {
|
|
119
119
|
minWidth: t.resize?.minWidth ?? e.minWidth,
|
|
120
120
|
maxWidth: t.resize?.maxWidth ?? e.maxWidth,
|
|
121
121
|
onResize: t.resize?.onResize ?? e.onResize,
|
|
122
|
-
resizeOnOpen:
|
|
122
|
+
resizeOnOpen: ce(t.resize?.resizeOnOpen) ? e.onResize : t.resize.resizeOnOpen
|
|
123
123
|
};
|
|
124
|
-
}), u =
|
|
125
|
-
t:
|
|
126
|
-
} =
|
|
124
|
+
}), u = y(T()), {
|
|
125
|
+
t: g
|
|
126
|
+
} = be(), D = he("ap-form-drawer-form"), {
|
|
127
127
|
b: $,
|
|
128
128
|
e: q,
|
|
129
129
|
em: V
|
|
130
|
-
} =
|
|
130
|
+
} = ge("ap-form-drawer-form"), A = w(() => [q("resize-bar"), {
|
|
131
131
|
[V("resize-bar", "min-disabled")]: n(u) === n(l).minWidth
|
|
132
132
|
}, {
|
|
133
133
|
[V("resize-bar", "max-disabled")]: n(u) === n(l).maxWidth
|
|
@@ -141,7 +141,7 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
141
141
|
const e = n(l)?.minWidth;
|
|
142
142
|
return !e || e && e < t.width ? t.width : e;
|
|
143
143
|
}
|
|
144
|
-
const
|
|
144
|
+
const R = de(b.trigger), W = R ? te(R, {
|
|
145
145
|
onClick: () => {
|
|
146
146
|
m(!0);
|
|
147
147
|
}
|
|
@@ -154,28 +154,28 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
154
154
|
e.push(s(z, {
|
|
155
155
|
onClick: k,
|
|
156
156
|
disabled: a.value
|
|
157
|
-
}, L(i =
|
|
157
|
+
}, L(i = g("ap.common.cancelText")) ? i : {
|
|
158
158
|
default: () => [i]
|
|
159
159
|
}));
|
|
160
160
|
}
|
|
161
|
-
return t.submitter?.resetButtonProps !== !1 && e.push(s(z,
|
|
161
|
+
return t.submitter?.resetButtonProps !== !1 && e.push(s(z, p(t.submitter?.resetButtonProps || {}, {
|
|
162
162
|
key: "submit",
|
|
163
163
|
disabled: a.value,
|
|
164
164
|
onClick: H
|
|
165
165
|
}), {
|
|
166
|
-
default: () => [t.submitter?.resetText ||
|
|
167
|
-
})), t.submitter?.submitButtonProps !== !1 && e.push(s(z,
|
|
166
|
+
default: () => [t.submitter?.resetText || g("ap.common.resetText")]
|
|
167
|
+
})), t.submitter?.submitButtonProps !== !1 && e.push(s(z, p({
|
|
168
168
|
type: "primary",
|
|
169
169
|
key: "submit"
|
|
170
170
|
}, t.submitter?.submitButtonProps || {}, {
|
|
171
171
|
loading: a.value,
|
|
172
172
|
onClick: J
|
|
173
173
|
}), {
|
|
174
|
-
default: () => [t.submitter?.submitText ||
|
|
175
|
-
})), s(
|
|
174
|
+
default: () => [t.submitter?.submitText || g("ap.common.okText")]
|
|
175
|
+
})), s(le, {
|
|
176
176
|
justify: "flex-end"
|
|
177
177
|
}, {
|
|
178
|
-
default: () => [
|
|
178
|
+
default: () => [b.submitter ? b.submitter(e) : s(re, null, L(e) ? e : {
|
|
179
179
|
default: () => [e]
|
|
180
180
|
})]
|
|
181
181
|
});
|
|
@@ -185,8 +185,8 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
185
185
|
}
|
|
186
186
|
function B(e) {
|
|
187
187
|
const i = n(l), c = (document.body.offsetWidth || 1e3) - (e.clientX - document.body.offsetLeft), f = i?.minWidth ?? (t.width || 800), O = i?.maxWidth ?? window.innerWidth * 0.8;
|
|
188
|
-
let
|
|
189
|
-
c < f && (
|
|
188
|
+
let F = c;
|
|
189
|
+
c < f && (F = f), c > O && (F = O), u.value = F;
|
|
190
190
|
}
|
|
191
191
|
function x() {
|
|
192
192
|
document.removeEventListener("mousemove", B), document.removeEventListener("mouseup", x);
|
|
@@ -199,7 +199,7 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
199
199
|
try {
|
|
200
200
|
const e = await o.value?.validateFieldsReturnTransformed();
|
|
201
201
|
t.submitter?.onSubmit?.(), a.value = !0;
|
|
202
|
-
const i = t.onFinish?.(
|
|
202
|
+
const i = t.onFinish?.(pe(e));
|
|
203
203
|
if (t.submitTimeout && i instanceof Promise) {
|
|
204
204
|
const f = setTimeout(() => a.value = !1, t.submitTimeout);
|
|
205
205
|
i.finally(() => {
|
|
@@ -243,32 +243,32 @@ const Ee = /* @__PURE__ */ Y({
|
|
|
243
243
|
getInternalInstance: (e) => o.value?.getInternalInstance(e),
|
|
244
244
|
getFieldsValueTransformed: (e) => o.value?.getFieldsValueTransformed(e),
|
|
245
245
|
validateFieldsReturnTransformed: (e) => o.value?.validateFieldsReturnTransformed(e)
|
|
246
|
-
}), (e, i) => (
|
|
246
|
+
}), (e, i) => (h(), N(ie, null, [s(n(ue), p(e.drawerProps, {
|
|
247
247
|
open: n(C),
|
|
248
248
|
width: u.value,
|
|
249
249
|
class: [n($)(), n(D)],
|
|
250
250
|
"onUpdate:open": K,
|
|
251
251
|
onCancel: k
|
|
252
252
|
}), {
|
|
253
|
-
title:
|
|
254
|
-
footer:
|
|
255
|
-
default:
|
|
253
|
+
title: v(() => [_(e.$slots, "title", {}, () => [ae(se(t.title), 1)])]),
|
|
254
|
+
footer: v(() => [(h(), S(I(X.value)))]),
|
|
255
|
+
default: v(() => [s(Fe, p({
|
|
256
256
|
ref_key: "formRef",
|
|
257
257
|
ref: o
|
|
258
|
-
}, n(
|
|
259
|
-
default:
|
|
258
|
+
}, n(fe)(t, ["drawerProps", "open", "onUpdate:open", "title", "width", "onFinish", "submitter"])), {
|
|
259
|
+
default: v(() => [_(e.$slots, "default")]),
|
|
260
260
|
_: 3
|
|
261
|
-
}, 16), e.resize ? (
|
|
261
|
+
}, 16), e.resize ? (h(), N("div", {
|
|
262
262
|
key: 0,
|
|
263
|
-
class:
|
|
264
|
-
onMousedown:
|
|
263
|
+
class: oe(A.value),
|
|
264
|
+
onMousedown: ne(G, ["stop", "prevent"])
|
|
265
265
|
}, null, 34)) : M("", !0)]),
|
|
266
266
|
_: 3
|
|
267
|
-
}, 16, ["open", "width", "class"]), n(
|
|
267
|
+
}, 16, ["open", "width", "class"]), n(W) ? (h(), S(I(n(W)), {
|
|
268
268
|
key: 0
|
|
269
269
|
})) : M("", !0)], 64));
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
export {
|
|
273
|
-
|
|
273
|
+
De as default
|
|
274
274
|
};
|