vft 0.0.413 → 0.0.414
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/components/dialog/dialog-content.vue.d.ts +1 -10
- package/es/components/dialog/dialog-content.vue2.js +36 -39
- package/es/components/dialog/index.d.ts +3 -3
- package/es/components/dialog/types.d.ts +2 -1
- package/es/components/drawer/drawer.vue2.js +63 -61
- package/es/components/drawer/index.d.ts +3 -3
- package/es/components/modal/index.d.ts +3 -3
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/dialog/dialog-content.vue.d.ts +1 -10
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/index.d.ts +3 -3
- package/lib/components/dialog/types.d.ts +2 -1
- package/lib/components/drawer/drawer.vue2.cjs +1 -1
- package/lib/components/drawer/index.d.ts +3 -3
- package/lib/components/modal/index.d.ts +3 -3
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/web-types.json +1 -1
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
center?: boolean;
|
|
3
|
-
alignCenter?: boolean;
|
|
4
|
-
closeIcon?: string;
|
|
5
|
-
customClass?: string;
|
|
6
|
-
draggable?: boolean;
|
|
7
|
-
fullscreen?: boolean;
|
|
8
|
-
showClose?: boolean;
|
|
9
|
-
title?: string;
|
|
10
|
-
}
|
|
1
|
+
import type { DialogContentProps } from './types';
|
|
11
2
|
declare function __VLS_template(): {
|
|
12
3
|
header?(_: {}): any;
|
|
13
4
|
default?(_: {}): any;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as g, inject as m, computed as d, createElementBlock as p, openBlock as s, normalizeStyle as k, normalizeClass as l, unref as e, createElementVNode as r, createCommentVNode as u, renderSlot as a, createBlock as R, toDisplayString as $, mergeProps as v } from "vue";
|
|
2
|
+
import { singleAttrToObj as E } from "@vft/utils";
|
|
3
|
+
import { VftIcon as N } from "../icon/index.js";
|
|
3
4
|
import "../focus-trap/focus-trap.vue2.js";
|
|
4
|
-
import { FOCUS_TRAP_INJECTION_KEY as
|
|
5
|
+
import { FOCUS_TRAP_INJECTION_KEY as S } from "../focus-trap/tokens.js";
|
|
5
6
|
import "../focus-trap/utils.js";
|
|
6
7
|
import "@vueuse/core";
|
|
7
|
-
import "@vft/utils";
|
|
8
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
9
9
|
import "lodash-es";
|
|
10
|
-
import { composeRefs as
|
|
10
|
+
import { composeRefs as T } from "../../utils/vue/refs.js";
|
|
11
11
|
import "../form/index.js";
|
|
12
|
-
import { useDraggable as
|
|
12
|
+
import { useDraggable as j } from "../../hooks/use-draggable/index.js";
|
|
13
13
|
import "../../hooks/use-model-toggle/index.js";
|
|
14
14
|
import "@popperjs/core";
|
|
15
15
|
import "../../hooks/use-z-index/index.js";
|
|
16
|
-
import { dialogInjectionKey as
|
|
17
|
-
const
|
|
16
|
+
import { dialogInjectionKey as z } from "./constants.js";
|
|
17
|
+
const D = ["id"], O = g({
|
|
18
18
|
name: "vft-dialog-content"
|
|
19
|
-
}),
|
|
20
|
-
...
|
|
19
|
+
}), Z = /* @__PURE__ */ g({
|
|
20
|
+
...O,
|
|
21
21
|
props: {
|
|
22
22
|
center: { type: Boolean, default: !1 },
|
|
23
23
|
alignCenter: { type: Boolean, default: !1 },
|
|
24
|
-
closeIcon: {
|
|
24
|
+
closeIcon: {},
|
|
25
25
|
customClass: {},
|
|
26
26
|
draggable: { type: Boolean, default: !1 },
|
|
27
27
|
fullscreen: { type: Boolean, default: !1 },
|
|
@@ -29,10 +29,14 @@ const V = ["id"], z = p({
|
|
|
29
29
|
title: { default: "" }
|
|
30
30
|
},
|
|
31
31
|
emits: ["close"],
|
|
32
|
-
setup(
|
|
33
|
-
const { dialogRef: i, headerRef: f, bodyId:
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
setup(n) {
|
|
33
|
+
const { dialogRef: i, headerRef: f, bodyId: y, ns: t, style: C } = m(z), { focusTrapRef: b } = m(S), h = T(b, i), B = d(() => n.draggable);
|
|
34
|
+
j(i, f, B);
|
|
35
|
+
const I = d(() => E(n.closeIcon, "icon", {
|
|
36
|
+
icon: "icon-close"
|
|
37
|
+
}));
|
|
38
|
+
return (o, c) => (s(), p("div", {
|
|
39
|
+
ref: e(h),
|
|
36
40
|
class: l([
|
|
37
41
|
e(t).b(),
|
|
38
42
|
e(t).is("fullscreen", o.fullscreen),
|
|
@@ -41,48 +45,41 @@ const V = ["id"], z = p({
|
|
|
41
45
|
{ [e(t).m("center")]: o.center },
|
|
42
46
|
o.customClass
|
|
43
47
|
]),
|
|
44
|
-
style:
|
|
48
|
+
style: k(e(C)),
|
|
45
49
|
tabindex: "-1"
|
|
46
50
|
}, [
|
|
47
|
-
|
|
51
|
+
r("header", {
|
|
48
52
|
ref_key: "headerRef",
|
|
49
53
|
ref: f,
|
|
50
54
|
class: l(e(t).e("header"))
|
|
51
55
|
}, [
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
a(o.$slots, "header", {}, () => [
|
|
57
|
+
r("span", {
|
|
54
58
|
role: "heading",
|
|
55
59
|
class: l(e(t).e("title"))
|
|
56
|
-
},
|
|
60
|
+
}, $(o.title), 3)
|
|
57
61
|
]),
|
|
58
|
-
o.showClose ? (
|
|
62
|
+
o.showClose ? (s(), R(e(N), v({
|
|
59
63
|
key: 0,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
k(e($), {
|
|
65
|
-
class: l(e(t).e("close")),
|
|
66
|
-
icon: o.closeIcon,
|
|
67
|
-
size: "20"
|
|
68
|
-
}, null, 8, ["class", "icon"])
|
|
69
|
-
], 2)) : c("", !0)
|
|
64
|
+
onClick: c[0] || (c[0] = (V) => o.$emit("close")),
|
|
65
|
+
class: e(t).e("close")
|
|
66
|
+
}, I.value, { size: "20" }), null, 16, ["class"])) : u("", !0)
|
|
70
67
|
], 2),
|
|
71
|
-
|
|
72
|
-
id: e(
|
|
68
|
+
r("div", {
|
|
69
|
+
id: e(y),
|
|
73
70
|
class: l(e(t).e("body"))
|
|
74
71
|
}, [
|
|
75
|
-
|
|
76
|
-
], 10,
|
|
77
|
-
o.$slots.footer ? (
|
|
72
|
+
a(o.$slots, "default")
|
|
73
|
+
], 10, D),
|
|
74
|
+
o.$slots.footer ? (s(), p("footer", {
|
|
78
75
|
key: 0,
|
|
79
76
|
class: l(e(t).e("footer"))
|
|
80
77
|
}, [
|
|
81
|
-
|
|
82
|
-
], 2)) :
|
|
78
|
+
a(o.$slots, "footer")
|
|
79
|
+
], 2)) : u("", !0)
|
|
83
80
|
], 6));
|
|
84
81
|
}
|
|
85
82
|
});
|
|
86
83
|
export {
|
|
87
|
-
|
|
84
|
+
Z as default
|
|
88
85
|
};
|
|
@@ -57,7 +57,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
57
57
|
type: import("vue").PropType<boolean>;
|
|
58
58
|
};
|
|
59
59
|
closeIcon: {
|
|
60
|
-
type: import("vue").PropType<string>;
|
|
60
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
61
61
|
};
|
|
62
62
|
customClass: {
|
|
63
63
|
type: import("vue").PropType<string>;
|
|
@@ -153,7 +153,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
153
153
|
type: import("vue").PropType<boolean>;
|
|
154
154
|
};
|
|
155
155
|
closeIcon: {
|
|
156
|
-
type: import("vue").PropType<string>;
|
|
156
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
157
157
|
};
|
|
158
158
|
customClass: {
|
|
159
159
|
type: import("vue").PropType<string>;
|
|
@@ -238,7 +238,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
238
238
|
type: import("vue").PropType<boolean>;
|
|
239
239
|
};
|
|
240
240
|
closeIcon: {
|
|
241
|
-
type: import("vue").PropType<string>;
|
|
241
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
242
242
|
};
|
|
243
243
|
customClass: {
|
|
244
244
|
type: import("vue").PropType<string>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from 'vft/es/components/icon';
|
|
1
2
|
export interface DialogContentProps {
|
|
2
3
|
center?: boolean;
|
|
3
4
|
alignCenter?: boolean;
|
|
4
|
-
closeIcon?: string;
|
|
5
|
+
closeIcon?: string | IconProps;
|
|
5
6
|
customClass?: string;
|
|
6
7
|
draggable?: boolean;
|
|
7
8
|
fullscreen?: boolean;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isBoolean as
|
|
1
|
+
import { defineComponent as A, getCurrentInstance as O, ref as k, computed as m, createBlock as h, openBlock as a, unref as e, withCtx as d, createVNode as y, Transition as N, withDirectives as M, createElementVNode as w, mergeProps as g, withModifiers as P, createElementBlock as n, createCommentVNode as s, normalizeClass as r, renderSlot as i, toDisplayString as q, vShow as H } from "vue";
|
|
2
|
+
import { isBoolean as U, singleAttrToObj as j } from "@vft/utils";
|
|
3
3
|
import "../dialog/index.js";
|
|
4
|
-
import
|
|
4
|
+
import G from "../focus-trap/focus-trap.vue.js";
|
|
5
5
|
import "../focus-trap/utils.js";
|
|
6
|
-
import { VftIcon as
|
|
7
|
-
import { VftOverlay as
|
|
8
|
-
import { UPDATE_MODEL_EVENT as
|
|
6
|
+
import { VftIcon as J } from "../icon/index.js";
|
|
7
|
+
import { VftOverlay as K } from "../overlay/index.js";
|
|
8
|
+
import { UPDATE_MODEL_EVENT as Q } from "../../constants/event.js";
|
|
9
9
|
import "@vueuse/core";
|
|
10
|
-
import { addUnit as
|
|
10
|
+
import { addUnit as W } from "../../utils/helper.js";
|
|
11
11
|
import "lodash-es";
|
|
12
12
|
import "../form/index.js";
|
|
13
|
-
import { useNamespace as
|
|
13
|
+
import { useNamespace as X } from "../../hooks/use-namespace/index.js";
|
|
14
14
|
import "../../hooks/use-model-toggle/index.js";
|
|
15
15
|
import "@popperjs/core";
|
|
16
16
|
import "../../hooks/use-z-index/index.js";
|
|
17
|
-
import { VftTeleport as
|
|
18
|
-
import { useDialog as
|
|
19
|
-
const
|
|
17
|
+
import { VftTeleport as Y } from "../teleport/index.js";
|
|
18
|
+
import { useDialog as Z } from "../dialog/hooks/use-dialog.js";
|
|
19
|
+
const _ = ["aria-label", "aria-labelledby", "aria-describedby"], x = ["id"], ee = ["id"], oe = A({
|
|
20
20
|
name: "vft-drawer"
|
|
21
|
-
}),
|
|
22
|
-
...
|
|
21
|
+
}), Re = /* @__PURE__ */ A({
|
|
22
|
+
...oe,
|
|
23
23
|
props: {
|
|
24
24
|
direction: { default: "rtl" },
|
|
25
25
|
size: { default: "30%" },
|
|
@@ -50,7 +50,7 @@ const Y = ["aria-label", "aria-labelledby", "aria-describedby"], Z = ["id"], _ =
|
|
|
50
50
|
title: { default: "" }
|
|
51
51
|
},
|
|
52
52
|
emits: {
|
|
53
|
-
[
|
|
53
|
+
[Q]: (l) => U(l),
|
|
54
54
|
open: () => !0,
|
|
55
55
|
opened: () => !0,
|
|
56
56
|
close: () => !0,
|
|
@@ -58,50 +58,52 @@ const Y = ["aria-label", "aria-labelledby", "aria-describedby"], Z = ["id"], _ =
|
|
|
58
58
|
openAutoFocus: () => !0,
|
|
59
59
|
closeAutoFocus: () => !0
|
|
60
60
|
},
|
|
61
|
-
setup(
|
|
62
|
-
const t =
|
|
63
|
-
afterEnter:
|
|
61
|
+
setup(l, { expose: E }) {
|
|
62
|
+
const t = X("drawer"), I = O(), u = k(), {
|
|
63
|
+
afterEnter: z,
|
|
64
64
|
afterLeave: R,
|
|
65
65
|
beforeLeave: V,
|
|
66
66
|
handleClose: f,
|
|
67
67
|
onModalClick: D,
|
|
68
|
-
close:
|
|
69
|
-
doClose:
|
|
70
|
-
onOpenAutoFocus:
|
|
71
|
-
onCloseAutoFocus:
|
|
68
|
+
close: te,
|
|
69
|
+
doClose: le,
|
|
70
|
+
onOpenAutoFocus: ae,
|
|
71
|
+
onCloseAutoFocus: se,
|
|
72
72
|
onCloseRequested: F,
|
|
73
|
-
onFocusoutPrevented:
|
|
73
|
+
onFocusoutPrevented: re,
|
|
74
74
|
titleId: c,
|
|
75
|
-
bodyId:
|
|
76
|
-
closed:
|
|
77
|
-
style:
|
|
78
|
-
overlayDialogStyle:
|
|
79
|
-
rendered:
|
|
75
|
+
bodyId: v,
|
|
76
|
+
closed: de,
|
|
77
|
+
style: ne,
|
|
78
|
+
overlayDialogStyle: ie,
|
|
79
|
+
rendered: S,
|
|
80
80
|
visible: p,
|
|
81
|
-
zIndex:
|
|
82
|
-
} =
|
|
81
|
+
zIndex: T
|
|
82
|
+
} = Z(I.props, u), C = k(), $ = m(() => l.direction === "rtl" || l.direction === "ltr"), b = m(() => W(l.size)), L = m(() => j(l.closeIcon, "icon", {
|
|
83
|
+
icon: "icon-close"
|
|
84
|
+
}));
|
|
83
85
|
return E({
|
|
84
86
|
close: f
|
|
85
|
-
}), (o, B) => (
|
|
87
|
+
}), (o, B) => (a(), h(e(Y), {
|
|
86
88
|
to: "body",
|
|
87
89
|
disabled: !o.appendToBody
|
|
88
90
|
}, {
|
|
89
91
|
default: d(() => [
|
|
90
|
-
|
|
92
|
+
y(N, {
|
|
91
93
|
name: e(t).b("fade"),
|
|
92
|
-
onAfterEnter: e(
|
|
94
|
+
onAfterEnter: e(z),
|
|
93
95
|
onAfterLeave: e(R),
|
|
94
96
|
onBeforeLeave: e(V)
|
|
95
97
|
}, {
|
|
96
98
|
default: d(() => [
|
|
97
|
-
|
|
99
|
+
M(y(e(K), {
|
|
98
100
|
mask: o.modal,
|
|
99
101
|
"overlay-class": o.modalClass,
|
|
100
|
-
"z-index": e(
|
|
102
|
+
"z-index": e(T),
|
|
101
103
|
onClick: e(D)
|
|
102
104
|
}, {
|
|
103
105
|
default: d(() => [
|
|
104
|
-
|
|
106
|
+
y(e(G), {
|
|
105
107
|
loop: "",
|
|
106
108
|
trapped: e(p),
|
|
107
109
|
"focus-trap-el": u.value,
|
|
@@ -109,29 +111,29 @@ const Y = ["aria-label", "aria-labelledby", "aria-describedby"], Z = ["id"], _ =
|
|
|
109
111
|
onReleaseRequested: e(F)
|
|
110
112
|
}, {
|
|
111
113
|
default: d(() => [
|
|
112
|
-
w("div",
|
|
114
|
+
w("div", g({
|
|
113
115
|
ref_key: "drawerRef",
|
|
114
116
|
ref: u,
|
|
115
117
|
"aria-modal": "true",
|
|
116
118
|
"aria-label": o.title || void 0,
|
|
117
119
|
"aria-labelledby": o.title ? void 0 : e(c),
|
|
118
|
-
"aria-describedby": e(
|
|
120
|
+
"aria-describedby": e(v)
|
|
119
121
|
}, o.$attrs, {
|
|
120
122
|
class: [e(t).b(), o.direction, e(p) && "open", o.customClass],
|
|
121
|
-
style: $.value ? "width: " +
|
|
123
|
+
style: $.value ? "width: " + b.value : "height: " + b.value,
|
|
122
124
|
role: "dialog",
|
|
123
|
-
onClick: B[0] || (B[0] =
|
|
125
|
+
onClick: B[0] || (B[0] = P(() => {
|
|
124
126
|
}, ["stop"]))
|
|
125
127
|
}), [
|
|
126
128
|
w("span", {
|
|
127
129
|
ref_key: "focusStartRef",
|
|
128
130
|
ref: C,
|
|
129
|
-
class:
|
|
131
|
+
class: r(e(t).e("sr-focus")),
|
|
130
132
|
tabindex: "-1"
|
|
131
133
|
}, null, 2),
|
|
132
|
-
o.withHeader ? (
|
|
134
|
+
o.withHeader ? (a(), n("header", {
|
|
133
135
|
key: 0,
|
|
134
|
-
class:
|
|
136
|
+
class: r(e(t).e("header"))
|
|
135
137
|
}, [
|
|
136
138
|
o.$slots.title ? i(o.$slots, "title", { key: 1 }) : i(o.$slots, "header", {
|
|
137
139
|
key: 0,
|
|
@@ -139,41 +141,41 @@ const Y = ["aria-label", "aria-labelledby", "aria-describedby"], Z = ["id"], _ =
|
|
|
139
141
|
titleId: e(c),
|
|
140
142
|
titleClass: e(t).e("title")
|
|
141
143
|
}, () => [
|
|
142
|
-
o.$slots.title ?
|
|
144
|
+
o.$slots.title ? s("", !0) : (a(), n("span", {
|
|
143
145
|
key: 0,
|
|
144
146
|
id: e(c),
|
|
145
147
|
role: "heading",
|
|
146
|
-
class:
|
|
147
|
-
},
|
|
148
|
+
class: r(e(t).e("title"))
|
|
149
|
+
}, q(o.title), 11, x))
|
|
148
150
|
]),
|
|
149
|
-
o.showClose ? (
|
|
151
|
+
o.showClose ? (a(), h(e(J), g({
|
|
150
152
|
key: 2,
|
|
151
|
-
onClick: e(f)
|
|
152
|
-
|
|
153
|
-
class:
|
|
154
|
-
}, null,
|
|
155
|
-
], 2)) :
|
|
156
|
-
e(
|
|
153
|
+
onClick: e(f)
|
|
154
|
+
}, L.value, {
|
|
155
|
+
class: e(t).e("close")
|
|
156
|
+
}), null, 16, ["onClick", "class"])) : s("", !0)
|
|
157
|
+
], 2)) : s("", !0),
|
|
158
|
+
e(S) ? (a(), n("div", {
|
|
157
159
|
key: 1,
|
|
158
|
-
id: e(
|
|
159
|
-
class:
|
|
160
|
+
id: e(v),
|
|
161
|
+
class: r(e(t).e("body"))
|
|
160
162
|
}, [
|
|
161
163
|
i(o.$slots, "default")
|
|
162
|
-
], 10,
|
|
163
|
-
o.$slots.footer ? (
|
|
164
|
+
], 10, ee)) : s("", !0),
|
|
165
|
+
o.$slots.footer ? (a(), n("div", {
|
|
164
166
|
key: 2,
|
|
165
|
-
class:
|
|
167
|
+
class: r(e(t).e("footer"))
|
|
166
168
|
}, [
|
|
167
169
|
i(o.$slots, "footer")
|
|
168
|
-
], 2)) :
|
|
169
|
-
], 16,
|
|
170
|
+
], 2)) : s("", !0)
|
|
171
|
+
], 16, _)
|
|
170
172
|
]),
|
|
171
173
|
_: 3
|
|
172
174
|
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
|
|
173
175
|
]),
|
|
174
176
|
_: 3
|
|
175
177
|
}, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
|
|
176
|
-
[
|
|
178
|
+
[H, e(p)]
|
|
177
179
|
])
|
|
178
180
|
]),
|
|
179
181
|
_: 3
|
|
@@ -184,5 +186,5 @@ const Y = ["aria-label", "aria-labelledby", "aria-describedby"], Z = ["id"], _ =
|
|
|
184
186
|
}
|
|
185
187
|
});
|
|
186
188
|
export {
|
|
187
|
-
|
|
189
|
+
Re as default
|
|
188
190
|
};
|
|
@@ -65,7 +65,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
65
65
|
type: import("vue").PropType<boolean>;
|
|
66
66
|
};
|
|
67
67
|
closeIcon: {
|
|
68
|
-
type: import("vue").PropType<string>;
|
|
68
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
69
69
|
};
|
|
70
70
|
customClass: {
|
|
71
71
|
type: import("vue").PropType<string>;
|
|
@@ -172,7 +172,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
172
172
|
type: import("vue").PropType<boolean>;
|
|
173
173
|
};
|
|
174
174
|
closeIcon: {
|
|
175
|
-
type: import("vue").PropType<string>;
|
|
175
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
176
176
|
};
|
|
177
177
|
customClass: {
|
|
178
178
|
type: import("vue").PropType<string>;
|
|
@@ -268,7 +268,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
268
268
|
type: import("vue").PropType<boolean>;
|
|
269
269
|
};
|
|
270
270
|
closeIcon: {
|
|
271
|
-
type: import("vue").PropType<string>;
|
|
271
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
272
272
|
};
|
|
273
273
|
customClass: {
|
|
274
274
|
type: import("vue").PropType<string>;
|
|
@@ -50,7 +50,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
50
50
|
default: boolean;
|
|
51
51
|
};
|
|
52
52
|
closeIcon: {
|
|
53
|
-
type: import("vue").PropType<string>;
|
|
53
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
54
54
|
};
|
|
55
55
|
appendToBody: {
|
|
56
56
|
type: import("vue").PropType<boolean>;
|
|
@@ -195,7 +195,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
195
195
|
default: boolean;
|
|
196
196
|
};
|
|
197
197
|
closeIcon: {
|
|
198
|
-
type: import("vue").PropType<string>;
|
|
198
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
199
199
|
};
|
|
200
200
|
appendToBody: {
|
|
201
201
|
type: import("vue").PropType<boolean>;
|
|
@@ -337,7 +337,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
337
337
|
default: boolean;
|
|
338
338
|
};
|
|
339
339
|
closeIcon: {
|
|
340
|
-
type: import("vue").PropType<string>;
|
|
340
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
341
341
|
};
|
|
342
342
|
appendToBody: {
|
|
343
343
|
type: import("vue").PropType<boolean>;
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
center?: boolean;
|
|
3
|
-
alignCenter?: boolean;
|
|
4
|
-
closeIcon?: string;
|
|
5
|
-
customClass?: string;
|
|
6
|
-
draggable?: boolean;
|
|
7
|
-
fullscreen?: boolean;
|
|
8
|
-
showClose?: boolean;
|
|
9
|
-
title?: string;
|
|
10
|
-
}
|
|
1
|
+
import type { DialogContentProps } from './types';
|
|
11
2
|
declare function __VLS_template(): {
|
|
12
3
|
header?(_: {}): any;
|
|
13
4
|
default?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("@vft/utils"),g=require("../icon/index.cjs");require("../focus-trap/focus-trap.vue2.cjs");const p=require("../focus-trap/tokens.cjs");require("../focus-trap/utils.cjs");require("@vueuse/core");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const C=require("../../utils/vue/refs.cjs");require("../form/index.cjs");const q=require("../../hooks/use-draggable/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const y=require("./constants.cjs"),b=["id"],k=e.defineComponent({name:"vft-dialog-content"}),B=e.defineComponent({...k,props:{center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{},customClass:{},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{default:""}},emits:["close"],setup(n){const{dialogRef:l,headerRef:s,bodyId:a,ns:r,style:i}=e.inject(y.dialogInjectionKey),{focusTrapRef:u}=e.inject(p.FOCUS_TRAP_INJECTION_KEY),c=C.composeRefs(u,l),f=e.computed(()=>n.draggable);q.useDraggable(l,s,f);const d=e.computed(()=>m.singleAttrToObj(n.closeIcon,"icon",{icon:"icon-close"}));return(o,t)=>(e.openBlock(),e.createElementBlock("div",{ref:e.unref(c),class:e.normalizeClass([e.unref(r).b(),e.unref(r).is("fullscreen",o.fullscreen),e.unref(r).is("draggable",o.draggable),e.unref(r).is("align-center",o.alignCenter),{[e.unref(r).m("center")]:o.center},o.customClass]),style:e.normalizeStyle(e.unref(i)),tabindex:"-1"},[e.createElementVNode("header",{ref_key:"headerRef",ref:s,class:e.normalizeClass(e.unref(r).e("header"))},[e.renderSlot(o.$slots,"header",{},()=>[e.createElementVNode("span",{role:"heading",class:e.normalizeClass(e.unref(r).e("title"))},e.toDisplayString(o.title),3)]),o.showClose?(e.openBlock(),e.createBlock(e.unref(g.VftIcon),e.mergeProps({key:0,onClick:t[0]||(t[0]=h=>o.$emit("close")),class:e.unref(r).e("close")},d.value,{size:"20"}),null,16,["class"])):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{id:e.unref(a),class:e.normalizeClass(e.unref(r).e("body"))},[e.renderSlot(o.$slots,"default")],10,b),o.$slots.footer?(e.openBlock(),e.createElementBlock("footer",{key:0,class:e.normalizeClass(e.unref(r).e("footer"))},[e.renderSlot(o.$slots,"footer")],2)):e.createCommentVNode("",!0)],6))}});exports.default=B;
|
|
@@ -57,7 +57,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
57
57
|
type: import("vue").PropType<boolean>;
|
|
58
58
|
};
|
|
59
59
|
closeIcon: {
|
|
60
|
-
type: import("vue").PropType<string>;
|
|
60
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
61
61
|
};
|
|
62
62
|
customClass: {
|
|
63
63
|
type: import("vue").PropType<string>;
|
|
@@ -153,7 +153,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
153
153
|
type: import("vue").PropType<boolean>;
|
|
154
154
|
};
|
|
155
155
|
closeIcon: {
|
|
156
|
-
type: import("vue").PropType<string>;
|
|
156
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
157
157
|
};
|
|
158
158
|
customClass: {
|
|
159
159
|
type: import("vue").PropType<string>;
|
|
@@ -238,7 +238,7 @@ export declare const VftDialog: import("vft/es/utils").SFCWithInstall<{
|
|
|
238
238
|
type: import("vue").PropType<boolean>;
|
|
239
239
|
};
|
|
240
240
|
closeIcon: {
|
|
241
|
-
type: import("vue").PropType<string>;
|
|
241
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
242
242
|
};
|
|
243
243
|
customClass: {
|
|
244
244
|
type: import("vue").PropType<string>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { IconProps } from 'vft/es/components/icon';
|
|
1
2
|
export interface DialogContentProps {
|
|
2
3
|
center?: boolean;
|
|
3
4
|
alignCenter?: boolean;
|
|
4
|
-
closeIcon?: string;
|
|
5
|
+
closeIcon?: string | IconProps;
|
|
5
6
|
customClass?: string;
|
|
6
7
|
draggable?: boolean;
|
|
7
8
|
fullscreen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("@vft/utils");require("../dialog/index.cjs");const g=require("../focus-trap/focus-trap.vue.cjs");require("../focus-trap/utils.cjs");const V=require("../icon/index.cjs"),E=require("../overlay/index.cjs"),z=require("../../constants/event.cjs");require("@vueuse/core");const S=require("../../utils/helper.cjs");require("lodash-es");require("../form/index.cjs");const N=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const $=require("../teleport/index.cjs"),A=require("../dialog/hooks/use-dialog.cjs"),I=["aria-label","aria-labelledby","aria-describedby"],D=["id"],R=["id"],T=e.defineComponent({name:"vft-drawer"}),O=e.defineComponent({...T,props:{direction:{default:"rtl"},size:{default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},beforeClose:{},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{default:0},closeDelay:{default:0},top:{},modelValue:{type:Boolean,default:!1},modalClass:{},width:{},zIndex:{},trapFocus:{type:Boolean,default:!1},center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{},customClass:{default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{default:""}},emits:{[z.UPDATE_MODEL_EVENT]:l=>c.isBoolean(l),open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,openAutoFocus:()=>!0,closeAutoFocus:()=>!0},setup(l,{expose:p}){const t=N.useNamespace("drawer"),m=e.getCurrentInstance(),r=e.ref(),{afterEnter:y,afterLeave:C,beforeLeave:B,handleClose:a,onModalClick:k,close:F,doClose:L,onOpenAutoFocus:M,onCloseAutoFocus:P,onCloseRequested:v,onFocusoutPrevented:H,titleId:n,bodyId:u,closed:j,style:U,overlayDialogStyle:G,rendered:b,visible:s,zIndex:h}=A.useDialog(m.props,r),d=e.ref(),q=e.computed(()=>l.direction==="rtl"||l.direction==="ltr"),i=e.computed(()=>S.addUnit(l.size)),w=e.computed(()=>c.singleAttrToObj(l.closeIcon,"icon",{icon:"icon-close"}));return p({close:a}),(o,f)=>(e.openBlock(),e.createBlock(e.unref($.VftTeleport),{to:"body",disabled:!o.appendToBody},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:e.unref(t).b("fade"),onAfterEnter:e.unref(y),onAfterLeave:e.unref(C),onBeforeLeave:e.unref(B)},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(E.VftOverlay),{mask:o.modal,"overlay-class":o.modalClass,"z-index":e.unref(h),onClick:e.unref(k)},{default:e.withCtx(()=>[e.createVNode(e.unref(g.default),{loop:"",trapped:e.unref(s),"focus-trap-el":r.value,"focus-start-el":d.value,onReleaseRequested:e.unref(v)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:r,"aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e.unref(n),"aria-describedby":e.unref(u)},o.$attrs,{class:[e.unref(t).b(),o.direction,e.unref(s)&&"open",o.customClass],style:q.value?"width: "+i.value:"height: "+i.value,role:"dialog",onClick:f[0]||(f[0]=e.withModifiers(()=>{},["stop"]))}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:d,class:e.normalizeClass(e.unref(t).e("sr-focus")),tabindex:"-1"},null,2),o.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass(e.unref(t).e("header"))},[o.$slots.title?e.renderSlot(o.$slots,"title",{key:1}):e.renderSlot(o.$slots,"header",{key:0,close:e.unref(a),titleId:e.unref(n),titleClass:e.unref(t).e("title")},()=>[o.$slots.title?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,id:e.unref(n),role:"heading",class:e.normalizeClass(e.unref(t).e("title"))},e.toDisplayString(o.title),11,D))]),o.showClose?(e.openBlock(),e.createBlock(e.unref(V.VftIcon),e.mergeProps({key:2,onClick:e.unref(a)},w.value,{class:e.unref(t).e("close")}),null,16,["onClick","class"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.unref(b)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(u),class:e.normalizeClass(e.unref(t).e("body"))},[e.renderSlot(o.$slots,"default")],10,R)):e.createCommentVNode("",!0),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(t).e("footer"))},[e.renderSlot(o.$slots,"footer")],2)):e.createCommentVNode("",!0)],16,I)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[e.vShow,e.unref(s)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["disabled"]))}});exports.default=O;
|
|
@@ -65,7 +65,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
65
65
|
type: import("vue").PropType<boolean>;
|
|
66
66
|
};
|
|
67
67
|
closeIcon: {
|
|
68
|
-
type: import("vue").PropType<string>;
|
|
68
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
69
69
|
};
|
|
70
70
|
customClass: {
|
|
71
71
|
type: import("vue").PropType<string>;
|
|
@@ -172,7 +172,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
172
172
|
type: import("vue").PropType<boolean>;
|
|
173
173
|
};
|
|
174
174
|
closeIcon: {
|
|
175
|
-
type: import("vue").PropType<string>;
|
|
175
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
176
176
|
};
|
|
177
177
|
customClass: {
|
|
178
178
|
type: import("vue").PropType<string>;
|
|
@@ -268,7 +268,7 @@ export declare const VftDrawer: import("vft/es/utils").SFCWithInstall<{
|
|
|
268
268
|
type: import("vue").PropType<boolean>;
|
|
269
269
|
};
|
|
270
270
|
closeIcon: {
|
|
271
|
-
type: import("vue").PropType<string>;
|
|
271
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
272
272
|
};
|
|
273
273
|
customClass: {
|
|
274
274
|
type: import("vue").PropType<string>;
|
|
@@ -50,7 +50,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
50
50
|
default: boolean;
|
|
51
51
|
};
|
|
52
52
|
closeIcon: {
|
|
53
|
-
type: import("vue").PropType<string>;
|
|
53
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
54
54
|
};
|
|
55
55
|
appendToBody: {
|
|
56
56
|
type: import("vue").PropType<boolean>;
|
|
@@ -195,7 +195,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
195
195
|
default: boolean;
|
|
196
196
|
};
|
|
197
197
|
closeIcon: {
|
|
198
|
-
type: import("vue").PropType<string>;
|
|
198
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
199
199
|
};
|
|
200
200
|
appendToBody: {
|
|
201
201
|
type: import("vue").PropType<boolean>;
|
|
@@ -337,7 +337,7 @@ export declare const VftModal: import("vft/es/utils").SFCWithInstall<{
|
|
|
337
337
|
default: boolean;
|
|
338
338
|
};
|
|
339
339
|
closeIcon: {
|
|
340
|
-
type: import("vue").PropType<string>;
|
|
340
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
341
341
|
};
|
|
342
342
|
appendToBody: {
|
|
343
343
|
type: import("vue").PropType<boolean>;
|