vft 0.0.487 → 0.0.493
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/es/components/dialog/use-dialog.js +11 -11
- package/es/components/message/message.vue2.js +45 -42
- package/es/components/message/types.d.ts +8 -2
- package/es/components/message/types.js +2 -1
- package/es/components/modal/modal-footer-action.vue.d.ts +1 -1
- package/es/components/modal/modal-footer-action.vue2.js +13 -15
- package/es/components/modal/modal.vue2.js +35 -36
- package/es/components/super-form/index.d.ts +30 -24
- package/es/components/super-form/super-form-item.vue2.js +263 -231
- package/es/components/super-form/super-form.vue.d.ts +3 -1
- package/es/components/super-form/super-form.vue2.js +153 -132
- package/es/components/super-form/types.d.ts +4 -2
- package/es/components/super-form/use/helper.d.ts +34 -0
- package/es/components/super-form/use/helper.js +81 -34
- package/es/components/switch/index.d.ts +1 -0
- package/es/components/switch/switch.vue.d.ts +1 -25
- package/es/components/switch/types.d.ts +25 -0
- package/es/components/switch/types.js +1 -0
- package/es/components/table/index.d.ts +6 -0
- package/es/components/table/table.vue.d.ts +4 -0
- package/es/components/table/table.vue2.js +164 -149
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/form-register.d.ts +1 -1
- package/es/utils/form-register.js +1 -1
- package/lib/components/dialog/use-dialog.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/message/types.cjs +1 -1
- package/lib/components/message/types.d.ts +8 -2
- package/lib/components/modal/modal-footer-action.vue.d.ts +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/super-form/index.d.ts +30 -24
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue.d.ts +3 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +4 -2
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +34 -0
- package/lib/components/switch/index.d.ts +1 -0
- package/lib/components/switch/switch.vue.d.ts +1 -25
- package/lib/components/switch/types.cjs +1 -0
- package/lib/components/switch/types.d.ts +25 -0
- package/lib/components/table/index.d.ts +6 -0
- package/lib/components/table/table.vue.d.ts +4 -0
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/utils/form-register.cjs +1 -1
- package/lib/utils/form-register.d.ts +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/dialog.scss +1 -1
- package/theme-style/src/message.scss +8 -4
- package/theme-style/src/super-form.scss +6 -0
- package/theme-style/src/table.scss +25 -6
- package/theme-style/vft-dialog.css +1 -1
- package/theme-style/vft-message.css +1 -1
- package/theme-style/vft-super-form.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { DEFAULT_DIALOG_TRANSITION as P } from "./constants.js";
|
|
2
1
|
import "../config-provider/index.js";
|
|
3
2
|
import { UPDATE_MODEL_EVENT as Y } from "../../constants/event.js";
|
|
4
|
-
import { useTimeoutFn as
|
|
5
|
-
import { isObject as R, isArray as p, isFunction as
|
|
3
|
+
import { useTimeoutFn as P, isClient as H } from "@vueuse/core";
|
|
4
|
+
import { isObject as R, isArray as p, isFunction as M } from "@vft/utils";
|
|
6
5
|
import { addUnit as ee } from "../../utils/helper.js";
|
|
7
6
|
import { getCurrentInstance as ne, ref as r, computed as l, watch as x, nextTick as oe, onMounted as te } from "vue";
|
|
8
7
|
import "lodash-es";
|
|
9
8
|
import "../form/index.js";
|
|
10
|
-
import { useId as
|
|
9
|
+
import { useId as N } from "../../hooks/use-id/index.js";
|
|
11
10
|
import { useLockscreen as le } from "../../hooks/use-lockscreen/index.js";
|
|
12
11
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
12
|
import { defaultNamespace as ie } from "../../hooks/use-namespace/index.js";
|
|
14
13
|
import "@popperjs/core";
|
|
15
14
|
import { useZIndex as ae } from "../../hooks/use-z-index/index.js";
|
|
15
|
+
import { DEFAULT_DIALOG_TRANSITION as k } from "./constants.js";
|
|
16
16
|
import { useGlobalConfig as fe } from "../config-provider/hooks/use-global-config.js";
|
|
17
17
|
const Te = (e, t) => {
|
|
18
18
|
const i = ne().emit, { nextZIndex: m } = ae();
|
|
19
19
|
let T = "";
|
|
20
|
-
const B =
|
|
20
|
+
const B = N(), S = N(), a = r(!1), v = r(!1), u = r(!1), d = r(e.zIndex ?? m());
|
|
21
21
|
let C, y;
|
|
22
22
|
const O = fe(), U = l(() => O.value?.namespace ?? ie), c = l(() => O.value?.dialog), V = l(() => {
|
|
23
23
|
const n = {}, f = `--${U.value}-dialog`;
|
|
@@ -29,7 +29,7 @@ const Te = (e, t) => {
|
|
|
29
29
|
), G = l(
|
|
30
30
|
() => e.overflow ?? c.value?.overflow ?? !1
|
|
31
31
|
), Z = l(() => F.value ? { display: "flex" } : {}), j = l(() => {
|
|
32
|
-
const n = e.transition ?? c.value?.transition ??
|
|
32
|
+
const n = e.transition ?? c.value?.transition ?? k, f = {
|
|
33
33
|
name: n,
|
|
34
34
|
onAfterEnter: g,
|
|
35
35
|
onBeforeLeave: I,
|
|
@@ -38,10 +38,10 @@ const Te = (e, t) => {
|
|
|
38
38
|
if (R(n)) {
|
|
39
39
|
const o = { ...n }, b = (s, X) => (w) => {
|
|
40
40
|
p(s) ? s.forEach((z) => {
|
|
41
|
-
|
|
42
|
-
}) :
|
|
41
|
+
M(z) && z(w);
|
|
42
|
+
}) : M(s) && s(w), X();
|
|
43
43
|
};
|
|
44
|
-
return o.onAfterEnter = b(o.onAfterEnter, g), o.onBeforeLeave = b(o.onBeforeLeave, I), o.onAfterLeave = b(o.onAfterLeave, A), o.name || (o.name =
|
|
44
|
+
return o.onAfterEnter = b(o.onAfterEnter, g), o.onBeforeLeave = b(o.onBeforeLeave, I), o.onAfterLeave = b(o.onAfterLeave, A), o.name || (o.name = k), o;
|
|
45
45
|
}
|
|
46
46
|
return f;
|
|
47
47
|
});
|
|
@@ -55,10 +55,10 @@ const Te = (e, t) => {
|
|
|
55
55
|
i("close");
|
|
56
56
|
}
|
|
57
57
|
function _() {
|
|
58
|
-
y?.(), C?.(), e.openDelay && e.openDelay > 0 ? { stop: C } =
|
|
58
|
+
y?.(), C?.(), e.openDelay && e.openDelay > 0 ? { stop: C } = P(() => h(), e.openDelay) : h();
|
|
59
59
|
}
|
|
60
60
|
function D() {
|
|
61
|
-
C?.(), y?.(), e.closeDelay && e.closeDelay > 0 ? { stop: y } =
|
|
61
|
+
C?.(), y?.(), e.closeDelay && e.closeDelay > 0 ? { stop: y } = P(() => L(), e.closeDelay) : L();
|
|
62
62
|
}
|
|
63
63
|
function E() {
|
|
64
64
|
function n(f) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as V, ref as
|
|
2
|
-
import { VftIcon as
|
|
1
|
+
import { defineComponent as V, ref as m, computed as i, onMounted as H, watch as $, createBlock as w, openBlock as c, Transition as D, unref as o, withCtx as F, withDirectives as P, createElementVNode as j, normalizeStyle as A, normalizeClass as a, createElementBlock as d, createCommentVNode as B, renderSlot as U, createVNode as Z, normalizeProps as G, guardReactiveProps as q, toDisplayString as J, mergeProps as K, withModifiers as Q, vShow as W } from "vue";
|
|
2
|
+
import { VftIcon as k } from "../icon/index.js";
|
|
3
3
|
import { EVENT_CODE as X } from "@vft/constants";
|
|
4
4
|
import { useEventListener as Y } from "@vft/use";
|
|
5
5
|
import { singleAttrToObj as T } from "@vft/utils";
|
|
6
6
|
import { useResizeObserver as _, useTimeoutFn as ee } from "@vueuse/core";
|
|
7
7
|
import "../config-provider/index.js";
|
|
8
|
-
import { getLastOffset as oe, getOffsetOrSpace as
|
|
9
|
-
import { useGlobalComponentSettings as
|
|
10
|
-
const se = ["id"], ie = ["innerHTML"],
|
|
8
|
+
import { getLastOffset as oe, getOffsetOrSpace as ne } from "./instance.js";
|
|
9
|
+
import { useGlobalComponentSettings as te } from "../config-provider/hooks/use-global-config.js";
|
|
10
|
+
const se = ["id"], ie = ["innerHTML"], ve = /* @__PURE__ */ V({
|
|
11
11
|
__name: "message",
|
|
12
12
|
props: {
|
|
13
13
|
customClass: {},
|
|
@@ -15,6 +15,7 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
15
15
|
dangerouslyUseHTMLString: { type: Boolean },
|
|
16
16
|
duration: {},
|
|
17
17
|
icon: {},
|
|
18
|
+
showIcon: { type: Boolean },
|
|
18
19
|
closeIcon: {},
|
|
19
20
|
id: {},
|
|
20
21
|
message: { type: [String, Object, Function] },
|
|
@@ -28,36 +29,38 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
28
29
|
},
|
|
29
30
|
emits: ["destroy"],
|
|
30
31
|
setup(e, { expose: b }) {
|
|
31
|
-
const
|
|
32
|
-
let
|
|
33
|
-
const
|
|
32
|
+
const n = e, { ns: t, zIndex: I } = te("message"), { currentZIndex: M, nextZIndex: S } = I, u = m(), l = m(!1), g = m(0);
|
|
33
|
+
let y;
|
|
34
|
+
const x = /* @__PURE__ */ new Map([
|
|
35
|
+
["primary", { icon: "icon-info-filled" }],
|
|
36
|
+
["info", { icon: "icon-info-filled" }],
|
|
34
37
|
["success", { icon: "icon-success-filled" }],
|
|
35
38
|
["error", { icon: "icon-circle-close-filled" }],
|
|
36
39
|
["warning", { icon: "icon-warning-filled" }]
|
|
37
|
-
]),
|
|
38
|
-
() => T(
|
|
39
|
-
icon:
|
|
40
|
+
]), v = i(
|
|
41
|
+
() => T(n.icon, "icon", {
|
|
42
|
+
icon: x.get(n.type)?.icon
|
|
40
43
|
})
|
|
41
|
-
),
|
|
42
|
-
() => T(
|
|
44
|
+
), L = i(
|
|
45
|
+
() => T(n.icon, "icon", {
|
|
43
46
|
icon: "icon-close"
|
|
44
47
|
})
|
|
45
48
|
), O = i(() => {
|
|
46
|
-
const s =
|
|
47
|
-
return { [
|
|
48
|
-
}), z = i(() => oe(
|
|
49
|
-
() =>
|
|
49
|
+
const s = n.type;
|
|
50
|
+
return { [t.bm("icon", s)]: s };
|
|
51
|
+
}), z = i(() => oe(n.id)), p = i(
|
|
52
|
+
() => ne(n.id, n.offset) + z.value
|
|
50
53
|
), E = i(() => g.value + p.value), N = i(() => ({
|
|
51
54
|
top: `${p.value}px`,
|
|
52
|
-
zIndex:
|
|
55
|
+
zIndex: M.value
|
|
53
56
|
}));
|
|
54
|
-
function
|
|
55
|
-
|
|
57
|
+
function f() {
|
|
58
|
+
n.duration !== 0 && ({ stop: y } = ee(() => {
|
|
56
59
|
r();
|
|
57
|
-
},
|
|
60
|
+
}, n.duration));
|
|
58
61
|
}
|
|
59
62
|
function C() {
|
|
60
|
-
|
|
63
|
+
y?.();
|
|
61
64
|
}
|
|
62
65
|
function r() {
|
|
63
66
|
l.value = !1;
|
|
@@ -66,11 +69,11 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
66
69
|
s === X.esc && r();
|
|
67
70
|
}
|
|
68
71
|
return H(() => {
|
|
69
|
-
|
|
72
|
+
f(), S(), l.value = !0;
|
|
70
73
|
}), $(
|
|
71
|
-
() =>
|
|
74
|
+
() => n.repeatNum,
|
|
72
75
|
() => {
|
|
73
|
-
C(),
|
|
76
|
+
C(), f();
|
|
74
77
|
}
|
|
75
78
|
), Y(document, "keydown", R), _(u, () => {
|
|
76
79
|
g.value = u.value.getBoundingClientRect().height;
|
|
@@ -79,7 +82,7 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
79
82
|
bottom: E,
|
|
80
83
|
close: r
|
|
81
84
|
}), (s, h) => (c(), w(D, {
|
|
82
|
-
name: o(
|
|
85
|
+
name: o(t).b("fade"),
|
|
83
86
|
onBeforeLeave: e.onClose,
|
|
84
87
|
onAfterLeave: h[0] || (h[0] = (ce) => s.$emit("destroy"))
|
|
85
88
|
}, {
|
|
@@ -89,39 +92,39 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
89
92
|
ref_key: "messageRef",
|
|
90
93
|
ref: u,
|
|
91
94
|
class: a([
|
|
92
|
-
o(
|
|
93
|
-
{ [o(
|
|
94
|
-
o(
|
|
95
|
-
o(
|
|
95
|
+
o(t).b(),
|
|
96
|
+
{ [o(t).m(e.type)]: e.type && !e.icon },
|
|
97
|
+
o(t).is("center", e.center),
|
|
98
|
+
o(t).is("closable", e.showClose),
|
|
96
99
|
e.customClass
|
|
97
100
|
]),
|
|
98
101
|
style: A(N.value),
|
|
99
102
|
role: "alert",
|
|
100
103
|
onMouseenter: C,
|
|
101
|
-
onMouseleave:
|
|
104
|
+
onMouseleave: f
|
|
102
105
|
}, [
|
|
103
|
-
|
|
106
|
+
e.showIcon && v.value?.icon ? (c(), d("div", {
|
|
104
107
|
key: 0,
|
|
105
|
-
class: a([o(
|
|
108
|
+
class: a([o(t).e("icon"), O.value])
|
|
106
109
|
}, [
|
|
107
|
-
Z(o(
|
|
108
|
-
], 2)) :
|
|
110
|
+
Z(o(k), G(q(v.value)), null, 16)
|
|
111
|
+
], 2)) : B("", !0),
|
|
109
112
|
U(s.$slots, "default", {}, () => [
|
|
110
113
|
e.dangerouslyUseHTMLString ? (c(), d("p", {
|
|
111
114
|
key: 1,
|
|
112
|
-
class: a(o(
|
|
115
|
+
class: a(o(t).e("content")),
|
|
113
116
|
innerHTML: e.message
|
|
114
117
|
}, null, 10, ie)) : (c(), d("p", {
|
|
115
118
|
key: 0,
|
|
116
|
-
class: a(o(
|
|
119
|
+
class: a(o(t).e("content"))
|
|
117
120
|
}, J(e.message), 3))
|
|
118
121
|
]),
|
|
119
|
-
e.showClose ? (c(), w(o(
|
|
122
|
+
e.showClose ? (c(), w(o(k), K({
|
|
120
123
|
key: 1,
|
|
121
|
-
class: o(
|
|
122
|
-
},
|
|
124
|
+
class: o(t).e("closeBtn")
|
|
125
|
+
}, L.value, {
|
|
123
126
|
onClick: Q(r, ["stop"])
|
|
124
|
-
}), null, 16, ["class"])) :
|
|
127
|
+
}), null, 16, ["class"])) : B("", !0)
|
|
125
128
|
], 46, se), [
|
|
126
129
|
[W, l.value]
|
|
127
130
|
])
|
|
@@ -131,5 +134,5 @@ const se = ["id"], ie = ["innerHTML"], ye = /* @__PURE__ */ V({
|
|
|
131
134
|
}
|
|
132
135
|
});
|
|
133
136
|
export {
|
|
134
|
-
|
|
137
|
+
ve as default
|
|
135
138
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppContext, VNode } from 'vue';
|
|
2
|
-
export declare const messageTypes: readonly ["success", "info", "warning", "error"];
|
|
3
|
-
export type MessageType = 'success' | 'warning' | 'info' | 'error';
|
|
2
|
+
export declare const messageTypes: readonly ["primary", "success", "info", "warning", "error"];
|
|
3
|
+
export type MessageType = 'primary' | 'success' | 'warning' | 'info' | 'error';
|
|
4
4
|
export interface MessageConfigContext {
|
|
5
5
|
/** 可同时显示的消息最大数量 */
|
|
6
6
|
max?: number;
|
|
@@ -14,6 +14,8 @@ export interface MessageConfigContext {
|
|
|
14
14
|
duration?: number;
|
|
15
15
|
/** 默认图标 */
|
|
16
16
|
icon?: string;
|
|
17
|
+
/** 默认是否显示图标 */
|
|
18
|
+
showIcon?: boolean;
|
|
17
19
|
/** 默认是否显示关闭按钮 */
|
|
18
20
|
showClose?: boolean;
|
|
19
21
|
/** 默认消息类型 */
|
|
@@ -33,6 +35,7 @@ export declare const messageDefaults: {
|
|
|
33
35
|
dangerouslyUseHTMLString: boolean;
|
|
34
36
|
duration: number;
|
|
35
37
|
icon: undefined;
|
|
38
|
+
showIcon: boolean;
|
|
36
39
|
id: string;
|
|
37
40
|
message: string;
|
|
38
41
|
onClose: undefined;
|
|
@@ -55,6 +58,8 @@ export interface MessageProps {
|
|
|
55
58
|
duration: number;
|
|
56
59
|
/** 自定义图标,该属性会覆盖 type 的图标 */
|
|
57
60
|
icon?: any;
|
|
61
|
+
/** 是否显示图标 */
|
|
62
|
+
showIcon?: boolean;
|
|
58
63
|
/** 自定义关闭图标 */
|
|
59
64
|
closeIcon?: any;
|
|
60
65
|
/** 消息的唯一标识 */
|
|
@@ -94,6 +99,7 @@ export type MessageFn = {
|
|
|
94
99
|
};
|
|
95
100
|
export type MessageTypedFn = (options?: MessageParamsWithType, appContext?: null | AppContext) => MessageHandler;
|
|
96
101
|
export interface Message extends MessageFn {
|
|
102
|
+
primary: MessageTypedFn;
|
|
97
103
|
success: MessageTypedFn;
|
|
98
104
|
warning: MessageTypedFn;
|
|
99
105
|
info: MessageTypedFn;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isClient as e } from "@vueuse/core";
|
|
2
|
-
const o = ["success", "info", "warning", "error"], n = {
|
|
2
|
+
const o = ["primary", "success", "info", "warning", "error"], n = {
|
|
3
3
|
customClass: "",
|
|
4
4
|
center: !1,
|
|
5
5
|
dangerouslyUseHTMLString: !1,
|
|
6
6
|
duration: 3e3,
|
|
7
7
|
icon: void 0,
|
|
8
|
+
showIcon: !0,
|
|
8
9
|
id: "",
|
|
9
10
|
message: "",
|
|
10
11
|
onClose: void 0,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { defineComponent as O, computed as e, createBlock as n, openBlock as
|
|
1
|
+
import { defineComponent as O, computed as e, createBlock as n, openBlock as s, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as i, createCommentVNode as c, renderSlot as l, mergeProps as p, createTextVNode as f, toDisplayString as B } from "vue";
|
|
2
2
|
import { VftRow as g } from "../row/index.js";
|
|
3
3
|
import { VftButton as b } from "../button/index.js";
|
|
4
|
-
import "../super-form/index.js";
|
|
5
|
-
import "./index.js";
|
|
6
4
|
import "@vueuse/core";
|
|
7
5
|
import "@vft/utils";
|
|
8
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -12,7 +10,7 @@ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
|
12
10
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
11
|
import "@popperjs/core";
|
|
14
12
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
const
|
|
13
|
+
const A = /* @__PURE__ */ O({
|
|
16
14
|
__name: "modal-footer-action",
|
|
17
15
|
props: {
|
|
18
16
|
showSubmitButton: { type: Boolean },
|
|
@@ -27,36 +25,36 @@ const q = /* @__PURE__ */ O({
|
|
|
27
25
|
...t.actionRowOptions
|
|
28
26
|
})), r = e(
|
|
29
27
|
() => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
|
|
30
|
-
),
|
|
28
|
+
), u = e(
|
|
31
29
|
() => Object.assign({ btnText: "取消" }, t.cancelButtonOptions)
|
|
32
30
|
);
|
|
33
|
-
return (
|
|
34
|
-
default:
|
|
35
|
-
t.showCancelButton ? (
|
|
31
|
+
return (m, v) => (s(), n(o(g), w(y(d.value)), {
|
|
32
|
+
default: i(() => [
|
|
33
|
+
t.showCancelButton ? (s(), n(o(b), p({ key: 0 }, u.value, {
|
|
36
34
|
class: o(a).e("cancel")
|
|
37
35
|
}), {
|
|
38
|
-
default:
|
|
39
|
-
f(B(
|
|
36
|
+
default: i(() => [
|
|
37
|
+
f(B(u.value.btnText), 1)
|
|
40
38
|
]),
|
|
41
39
|
_: 1
|
|
42
40
|
}, 16, ["class"])) : c("", !0),
|
|
43
|
-
|
|
44
|
-
t.showSubmitButton ? (
|
|
41
|
+
l(m.$slots, "submitBefore"),
|
|
42
|
+
t.showSubmitButton ? (s(), n(o(b), p({
|
|
45
43
|
key: 1,
|
|
46
44
|
type: "primary",
|
|
47
45
|
class: o(a).e("submit")
|
|
48
46
|
}, r.value), {
|
|
49
|
-
default:
|
|
47
|
+
default: i(() => [
|
|
50
48
|
f(B(r.value.btnText), 1)
|
|
51
49
|
]),
|
|
52
50
|
_: 1
|
|
53
51
|
}, 16, ["class"])) : c("", !0),
|
|
54
|
-
|
|
52
|
+
l(m.$slots, "submitAfter")
|
|
55
53
|
]),
|
|
56
54
|
_: 3
|
|
57
55
|
}, 16));
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
58
|
export {
|
|
61
|
-
|
|
59
|
+
A as default
|
|
62
60
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as k, useAttrs as A, ref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as k, useAttrs as A, ref as m, getCurrentInstance as $, computed as r, unref as l, watchEffect as M, watch as P, nextTick as B, createBlock as y, openBlock as C, mergeProps as T, createSlots as R, withCtx as g, renderSlot as S, createCommentVNode as x } from "vue";
|
|
2
|
+
import { VftDialog as D } from "../dialog/index.js";
|
|
3
|
+
import { deepMerge as G, isFunction as I } from "@vft/utils";
|
|
4
4
|
import E from "./modal-footer-action.vue2.js";
|
|
5
5
|
const W = /* @__PURE__ */ k({
|
|
6
6
|
__name: "modal",
|
|
@@ -47,33 +47,33 @@ const W = /* @__PURE__ */ k({
|
|
|
47
47
|
actionRowOptions: {}
|
|
48
48
|
},
|
|
49
49
|
emits: ["visible-change", "close", "ok", "register", "update:modelValue", "submit", "open", "opened", "closed", "openAutoFocus", "closeAutoFocus"],
|
|
50
|
-
setup(
|
|
51
|
-
const n =
|
|
52
|
-
setModalProps:
|
|
50
|
+
setup(s, { emit: w }) {
|
|
51
|
+
const n = s, t = w, h = A(), d = m(null), a = m(!1), u = m(null), f = {
|
|
52
|
+
setModalProps: p,
|
|
53
53
|
emitVisible: void 0,
|
|
54
54
|
redoModalHeight: () => {
|
|
55
|
-
|
|
55
|
+
B(() => {
|
|
56
56
|
l(u) && l(u).setModalHeight();
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
}, i = $();
|
|
60
|
-
i && t("register",
|
|
61
|
-
const
|
|
60
|
+
i && t("register", f, i.uid);
|
|
61
|
+
const V = r(() => ({
|
|
62
62
|
...n,
|
|
63
63
|
...l(d)
|
|
64
|
-
})),
|
|
65
|
-
...
|
|
66
|
-
...l(
|
|
67
|
-
modelValue: l(
|
|
64
|
+
})), v = r(() => ({
|
|
65
|
+
...h,
|
|
66
|
+
...l(V),
|
|
67
|
+
modelValue: l(a)
|
|
68
68
|
}));
|
|
69
69
|
M(() => {
|
|
70
|
-
|
|
70
|
+
a.value = !!n.modelValue;
|
|
71
71
|
}), P(
|
|
72
|
-
() => l(
|
|
72
|
+
() => l(a),
|
|
73
73
|
(e) => {
|
|
74
|
-
t("visible-change", e), t("update:modelValue", e), i &&
|
|
75
|
-
|
|
76
|
-
}),
|
|
74
|
+
t("visible-change", e), t("update:modelValue", e), i && f.emitVisible && B(() => {
|
|
75
|
+
f.emitVisible(e, i.uid);
|
|
76
|
+
}), B(() => {
|
|
77
77
|
n.scrollTop && e && l(u) && l(u).scrollTop();
|
|
78
78
|
});
|
|
79
79
|
},
|
|
@@ -81,45 +81,44 @@ const W = /* @__PURE__ */ k({
|
|
|
81
81
|
immediate: !1
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
async function
|
|
85
|
-
if (e?.stopPropagation(), n.closeFunc &&
|
|
86
|
-
|
|
87
|
-
s.value = !o;
|
|
84
|
+
async function b(e) {
|
|
85
|
+
if (e?.stopPropagation(), n.closeFunc && I(n.closeFunc)) {
|
|
86
|
+
await n.closeFunc() || p({ modelValue: !1 });
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
|
-
|
|
89
|
+
p({ modelValue: !1 }), t("close", e);
|
|
91
90
|
}
|
|
92
|
-
function
|
|
93
|
-
d.value =
|
|
91
|
+
function p(e) {
|
|
92
|
+
d.value = G(l(d) || {}, e), Reflect.has(e, "modelValue") && (a.value = !!e.modelValue);
|
|
94
93
|
}
|
|
95
|
-
const
|
|
96
|
-
onClick: (e) =>
|
|
94
|
+
const O = r(() => ({
|
|
95
|
+
onClick: (e) => b(e),
|
|
97
96
|
...n.cancelButtonOptions
|
|
98
97
|
})), F = r(() => ({
|
|
99
98
|
onClick: () => t("submit"),
|
|
100
99
|
...n.submitButtonOptions
|
|
101
100
|
}));
|
|
102
|
-
return (e, o) => (
|
|
103
|
-
onClose:
|
|
101
|
+
return (e, o) => (C(), y(l(D), T(v.value, {
|
|
102
|
+
onClose: b,
|
|
104
103
|
onOpen: o[0] || (o[0] = (c) => t("open")),
|
|
105
104
|
onOpened: o[1] || (o[1] = (c) => t("opened")),
|
|
106
105
|
onClosed: o[2] || (o[2] = (c) => t("closed")),
|
|
107
106
|
onOpenAutoFocus: o[3] || (o[3] = (c) => t("openAutoFocus")),
|
|
108
107
|
onCloseAutoFocus: o[4] || (o[4] = (c) => t("closeAutoFocus"))
|
|
109
108
|
}), R({
|
|
110
|
-
default:
|
|
109
|
+
default: g(() => [
|
|
111
110
|
S(e.$slots, "default")
|
|
112
111
|
]),
|
|
113
112
|
_: 2
|
|
114
113
|
}, [
|
|
115
|
-
e.$slots.footer ||
|
|
114
|
+
e.$slots.footer || s.showActionButtonGroup ? {
|
|
116
115
|
name: "footer",
|
|
117
|
-
fn:
|
|
118
|
-
|
|
116
|
+
fn: g(() => [
|
|
117
|
+
s.showActionButtonGroup ? (C(), y(E, {
|
|
119
118
|
key: 0,
|
|
120
|
-
"show-cancel-button":
|
|
121
|
-
"show-submit-button":
|
|
122
|
-
"cancel-button-options":
|
|
119
|
+
"show-cancel-button": s.showCancelButton,
|
|
120
|
+
"show-submit-button": s.showSubmitButton,
|
|
121
|
+
"cancel-button-options": O.value,
|
|
123
122
|
"submit-button-options": F.value
|
|
124
123
|
}, null, 8, ["show-cancel-button", "show-submit-button", "cancel-button-options", "submit-button-options"])) : x("", !0)
|
|
125
124
|
]),
|
|
@@ -45,6 +45,13 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
45
45
|
submitResetReverse: {
|
|
46
46
|
type: import("vue").PropType<boolean>;
|
|
47
47
|
};
|
|
48
|
+
baseColProps: {
|
|
49
|
+
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
50
|
+
};
|
|
51
|
+
quickColSpan: {
|
|
52
|
+
type: import("vue").PropType<number>;
|
|
53
|
+
default: number;
|
|
54
|
+
};
|
|
48
55
|
mergeDynamicData: {
|
|
49
56
|
type: import("vue").PropType<import("../types").Recordable>;
|
|
50
57
|
};
|
|
@@ -64,13 +71,6 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
64
71
|
type: import("vue").PropType<boolean>;
|
|
65
72
|
default: boolean;
|
|
66
73
|
};
|
|
67
|
-
quickColSpan: {
|
|
68
|
-
type: import("vue").PropType<number>;
|
|
69
|
-
default: number;
|
|
70
|
-
};
|
|
71
|
-
baseColProps: {
|
|
72
|
-
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
73
|
-
};
|
|
74
74
|
resetFunc: {
|
|
75
75
|
type: import("vue").PropType<() => Promise<void>>;
|
|
76
76
|
};
|
|
@@ -145,6 +145,8 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
145
145
|
getSchema: import("vue").ComputedRef<import("./types").FormSchema[]>;
|
|
146
146
|
setFormItemError: (field: string, errMess: string) => Promise<void>;
|
|
147
147
|
formModel: import("vue").ComputedRef<import("../types").Recordable>;
|
|
148
|
+
hasActionButton: import("vue").ComputedRef<boolean>;
|
|
149
|
+
willExceedOneRow: import("vue").ComputedRef<boolean>;
|
|
148
150
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
149
151
|
register: (instance: Partial<import("./types").FormActionType>) => void;
|
|
150
152
|
reset: (data: import("../types").Recordable) => void;
|
|
@@ -158,11 +160,11 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
158
160
|
showResetButton: boolean;
|
|
159
161
|
showSubmitButton: boolean;
|
|
160
162
|
showCommonButton: boolean;
|
|
163
|
+
quickColSpan: number;
|
|
161
164
|
rulesMessageJoinLabel: boolean;
|
|
162
165
|
autoCleanErrorMessage: boolean;
|
|
163
166
|
compFullWidth: boolean;
|
|
164
167
|
autoSetPlaceHolder: boolean;
|
|
165
|
-
quickColSpan: number;
|
|
166
168
|
rowProps: import("vft/es/vft").RowProps;
|
|
167
169
|
autoFocusFirstItem: boolean;
|
|
168
170
|
autoSubmitOnEnter: boolean;
|
|
@@ -222,6 +224,13 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
222
224
|
submitResetReverse: {
|
|
223
225
|
type: import("vue").PropType<boolean>;
|
|
224
226
|
};
|
|
227
|
+
baseColProps: {
|
|
228
|
+
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
229
|
+
};
|
|
230
|
+
quickColSpan: {
|
|
231
|
+
type: import("vue").PropType<number>;
|
|
232
|
+
default: number;
|
|
233
|
+
};
|
|
225
234
|
mergeDynamicData: {
|
|
226
235
|
type: import("vue").PropType<import("../types").Recordable>;
|
|
227
236
|
};
|
|
@@ -241,13 +250,6 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
241
250
|
type: import("vue").PropType<boolean>;
|
|
242
251
|
default: boolean;
|
|
243
252
|
};
|
|
244
|
-
quickColSpan: {
|
|
245
|
-
type: import("vue").PropType<number>;
|
|
246
|
-
default: number;
|
|
247
|
-
};
|
|
248
|
-
baseColProps: {
|
|
249
|
-
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
250
|
-
};
|
|
251
253
|
resetFunc: {
|
|
252
254
|
type: import("vue").PropType<() => Promise<void>>;
|
|
253
255
|
};
|
|
@@ -322,6 +324,8 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
322
324
|
getSchema: import("vue").ComputedRef<import("./types").FormSchema[]>;
|
|
323
325
|
setFormItemError: (field: string, errMess: string) => Promise<void>;
|
|
324
326
|
formModel: import("vue").ComputedRef<import("../types").Recordable>;
|
|
327
|
+
hasActionButton: import("vue").ComputedRef<boolean>;
|
|
328
|
+
willExceedOneRow: import("vue").ComputedRef<boolean>;
|
|
325
329
|
}, {}, {}, {}, {
|
|
326
330
|
size: import("vft/es/constants").ComponentSize;
|
|
327
331
|
labelPosition: "left" | "right" | "top";
|
|
@@ -329,11 +333,11 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
329
333
|
showResetButton: boolean;
|
|
330
334
|
showSubmitButton: boolean;
|
|
331
335
|
showCommonButton: boolean;
|
|
336
|
+
quickColSpan: number;
|
|
332
337
|
rulesMessageJoinLabel: boolean;
|
|
333
338
|
autoCleanErrorMessage: boolean;
|
|
334
339
|
compFullWidth: boolean;
|
|
335
340
|
autoSetPlaceHolder: boolean;
|
|
336
|
-
quickColSpan: number;
|
|
337
341
|
rowProps: import("vft/es/vft").RowProps;
|
|
338
342
|
autoFocusFirstItem: boolean;
|
|
339
343
|
autoSubmitOnEnter: boolean;
|
|
@@ -390,6 +394,13 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
390
394
|
submitResetReverse: {
|
|
391
395
|
type: import("vue").PropType<boolean>;
|
|
392
396
|
};
|
|
397
|
+
baseColProps: {
|
|
398
|
+
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
399
|
+
};
|
|
400
|
+
quickColSpan: {
|
|
401
|
+
type: import("vue").PropType<number>;
|
|
402
|
+
default: number;
|
|
403
|
+
};
|
|
393
404
|
mergeDynamicData: {
|
|
394
405
|
type: import("vue").PropType<import("../types").Recordable>;
|
|
395
406
|
};
|
|
@@ -409,13 +420,6 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
409
420
|
type: import("vue").PropType<boolean>;
|
|
410
421
|
default: boolean;
|
|
411
422
|
};
|
|
412
|
-
quickColSpan: {
|
|
413
|
-
type: import("vue").PropType<number>;
|
|
414
|
-
default: number;
|
|
415
|
-
};
|
|
416
|
-
baseColProps: {
|
|
417
|
-
type: import("vue").PropType<Partial<import("vft/es/vft").ColProps>>;
|
|
418
|
-
};
|
|
419
423
|
resetFunc: {
|
|
420
424
|
type: import("vue").PropType<() => Promise<void>>;
|
|
421
425
|
};
|
|
@@ -490,6 +494,8 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
490
494
|
getSchema: import("vue").ComputedRef<import("./types").FormSchema[]>;
|
|
491
495
|
setFormItemError: (field: string, errMess: string) => Promise<void>;
|
|
492
496
|
formModel: import("vue").ComputedRef<import("../types").Recordable>;
|
|
497
|
+
hasActionButton: import("vue").ComputedRef<boolean>;
|
|
498
|
+
willExceedOneRow: import("vue").ComputedRef<boolean>;
|
|
493
499
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
494
500
|
register: (instance: Partial<import("./types").FormActionType>) => void;
|
|
495
501
|
reset: (data: import("../types").Recordable) => void;
|
|
@@ -503,11 +509,11 @@ export declare const VftSuperForm: import("vft/es/utils").SFCWithInstall<{
|
|
|
503
509
|
showResetButton: boolean;
|
|
504
510
|
showSubmitButton: boolean;
|
|
505
511
|
showCommonButton: boolean;
|
|
512
|
+
quickColSpan: number;
|
|
506
513
|
rulesMessageJoinLabel: boolean;
|
|
507
514
|
autoCleanErrorMessage: boolean;
|
|
508
515
|
compFullWidth: boolean;
|
|
509
516
|
autoSetPlaceHolder: boolean;
|
|
510
|
-
quickColSpan: number;
|
|
511
517
|
rowProps: import("vft/es/vft").RowProps;
|
|
512
518
|
autoFocusFirstItem: boolean;
|
|
513
519
|
autoSubmitOnEnter: boolean;
|