rappel-ui 1.0.28 → 1.0.29
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/README.md +1 -0
- package/README.zh.md +1 -0
- package/cjs/components/index.d.ts +2 -0
- package/cjs/components/index.js +1 -1
- package/cjs/components/message/index.d.ts +4 -0
- package/cjs/components/message/index.js +1 -0
- package/cjs/components/message/src/constants.d.ts +2 -0
- package/cjs/components/message/src/constants.js +1 -0
- package/cjs/components/message/src/create-message.d.ts +2 -0
- package/cjs/components/message/src/create-message.js +1 -0
- package/cjs/components/message/src/message.js +1 -0
- package/{es/components/tooltip/src/content.vue.d.ts → cjs/components/message/src/message.vue.d.ts} +15 -19
- package/cjs/components/message/src/message.vue_vue_type_script_setup_true_lang.js +6 -0
- package/cjs/components/message/src/types.d.ts +55 -0
- package/{es/components/tooltip/src/use-emit.d.ts → cjs/components/message/src/use-message-emit.d.ts} +2 -6
- package/cjs/components/message/src/use-message-emit.js +1 -0
- package/cjs/components/message/src/use-message.d.ts +2 -0
- package/cjs/components/message/src/use-message.js +1 -0
- package/cjs/components/message/style/css.d.ts +0 -0
- package/cjs/components/message/style/css.js +2 -0
- package/cjs/components/message/style/index.d.ts +0 -0
- package/cjs/components/message/style/index.js +2 -0
- package/cjs/components/popconfirm/index.d.ts +0 -20
- package/cjs/components/popconfirm/src/popconfirm.vue.d.ts +16 -24
- package/cjs/components/popconfirm/src/popconfirm.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/popconfirm/src/types.d.ts +2 -2
- package/cjs/components/{tooltip/src/use-emit.d.ts → popconfirm/src/use-popconfirm-emit.d.ts} +2 -6
- package/cjs/components/popconfirm/src/use-popconfirm-emit.js +1 -0
- package/cjs/components/popover/index.d.ts +1 -20
- package/cjs/components/popover/index.js +1 -1
- package/cjs/components/popover/src/popover.vue.d.ts +3 -11
- package/cjs/components/popover/src/popover.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/popover/src/types.d.ts +2 -2
- package/cjs/components/popover/src/use-popover-emit.d.ts +12 -0
- package/cjs/components/popover/src/use-popover-emit.js +1 -0
- package/cjs/components/tooltip/index.d.ts +24 -33
- package/cjs/components/tooltip/index.js +1 -1
- package/cjs/components/tooltip/src/tooltip.vue.d.ts +18 -15
- package/cjs/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/cjs/components/tooltip/src/types.d.ts +5 -40
- package/cjs/components/tooltip/src/use-tooltip-emit.d.ts +12 -0
- package/cjs/components/tooltip/src/use-tooltip-emit.js +1 -0
- package/cjs/components/transition/index.d.ts +67 -0
- package/cjs/components/transition/index.js +1 -0
- package/cjs/components/transition/src/transition.js +1 -0
- package/cjs/components/transition/src/transition.vue.d.ts +33 -0
- package/cjs/components/transition/src/transition.vue_vue_type_script_setup_true_lang.js +1 -0
- package/cjs/components/transition/src/types.d.ts +21 -0
- package/cjs/components/transition/src/use-transition-emit.d.ts +12 -0
- package/cjs/components/transition/src/use-transition-emit.js +1 -0
- package/cjs/components/transition/style/css.d.ts +0 -0
- package/cjs/components/transition/style/css.js +0 -0
- package/cjs/components/transition/style/index.d.ts +0 -0
- package/cjs/components/transition/style/index.js +0 -0
- package/cjs/index.d.ts +192 -77
- package/cjs/index.js +1 -1
- package/cjs/svg-icons/icon-names.d.ts +1 -1
- package/cjs/svg-icons/icon-names.js +1 -1
- package/cjs/svg-icons/index.d.ts +2 -0
- package/cjs/svg-icons/index.js +1 -1
- package/cjs/svg-icons/src/close-circle.d.ts +43 -0
- package/cjs/svg-icons/src/close-circle.js +1 -0
- package/cjs/svg-icons/src/info-circle.d.ts +43 -0
- package/cjs/svg-icons/src/info-circle.js +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +20 -10
- package/es/components/message/index.d.ts +4 -0
- package/es/components/message/index.mjs +6 -0
- package/es/components/message/src/constants.d.ts +2 -0
- package/es/components/message/src/constants.mjs +15 -0
- package/es/components/message/src/create-message.d.ts +2 -0
- package/es/components/message/src/create-message.mjs +136 -0
- package/es/components/message/src/message.mjs +5 -0
- package/{cjs/components/tooltip/src/content.vue.d.ts → es/components/message/src/message.vue.d.ts} +15 -19
- package/es/components/message/src/message.vue_vue_type_script_setup_true_lang.mjs +228 -0
- package/es/components/message/src/types.d.ts +55 -0
- package/es/components/message/src/use-message-emit.d.ts +12 -0
- package/es/components/message/src/use-message-emit.mjs +7 -0
- package/es/components/message/src/use-message.d.ts +2 -0
- package/es/components/message/src/use-message.mjs +7 -0
- package/es/components/message/style/css.d.ts +0 -0
- package/es/components/message/style/css.mjs +2 -0
- package/es/components/message/style/index.d.ts +0 -0
- package/es/components/message/style/index.mjs +2 -0
- package/es/components/popconfirm/index.d.ts +0 -20
- package/es/components/popconfirm/src/popconfirm.vue.d.ts +16 -24
- package/es/components/popconfirm/src/popconfirm.vue_vue_type_script_setup_true_lang.mjs +41 -48
- package/es/components/popconfirm/src/types.d.ts +2 -2
- package/es/components/popconfirm/src/use-popconfirm-emit.d.ts +12 -0
- package/es/components/popconfirm/src/use-popconfirm-emit.mjs +7 -0
- package/es/components/popover/index.d.ts +1 -20
- package/es/components/popover/index.mjs +4 -3
- package/es/components/popover/src/popover.vue.d.ts +3 -11
- package/es/components/popover/src/popover.vue_vue_type_script_setup_true_lang.mjs +21 -28
- package/es/components/popover/src/types.d.ts +2 -2
- package/es/components/popover/src/use-popover-emit.d.ts +12 -0
- package/es/components/popover/src/use-popover-emit.mjs +7 -0
- package/es/components/tooltip/index.d.ts +24 -33
- package/es/components/tooltip/index.mjs +2 -2
- package/es/components/tooltip/src/tooltip.vue.d.ts +18 -15
- package/es/components/tooltip/src/tooltip.vue_vue_type_script_setup_true_lang.mjs +137 -124
- package/es/components/tooltip/src/types.d.ts +5 -40
- package/es/components/tooltip/src/use-tooltip-emit.d.ts +12 -0
- package/es/components/tooltip/src/use-tooltip-emit.mjs +7 -0
- package/es/components/transition/index.d.ts +67 -0
- package/es/components/transition/index.mjs +8 -0
- package/es/components/transition/src/transition.mjs +5 -0
- package/es/components/transition/src/transition.vue.d.ts +33 -0
- package/es/components/transition/src/transition.vue_vue_type_script_setup_true_lang.mjs +83 -0
- package/es/components/transition/src/types.d.ts +21 -0
- package/es/components/transition/src/use-transition-emit.d.ts +12 -0
- package/es/components/{tooltip/src/use-emit.mjs → transition/src/use-transition-emit.mjs} +2 -6
- package/es/components/transition/style/css.d.ts +0 -0
- package/es/components/transition/style/css.mjs +0 -0
- package/es/components/transition/style/index.d.ts +0 -0
- package/es/components/transition/style/index.mjs +0 -0
- package/es/index.d.ts +192 -77
- package/es/index.mjs +69 -62
- package/es/svg-icons/icon-names.d.ts +1 -1
- package/es/svg-icons/icon-names.mjs +1 -1
- package/es/svg-icons/index.d.ts +2 -0
- package/es/svg-icons/index.mjs +10 -4
- package/es/svg-icons/src/close-circle.d.ts +43 -0
- package/es/svg-icons/src/close-circle.mjs +7 -0
- package/es/svg-icons/src/info-circle.d.ts +43 -0
- package/es/svg-icons/src/info-circle.mjs +7 -0
- package/package.json +2 -2
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/re-message.css +1 -0
- package/theme-chalk/src/css-vars/_message.scss +42 -0
- package/theme-chalk/src/index.scss +1 -0
- package/theme-chalk/src/message.scss +270 -0
- package/theme-chalk/src/mixins/_message.scss +51 -0
- package/cjs/components/tooltip/src/content.js +0 -1
- package/cjs/components/tooltip/src/content.vue_vue_type_script_setup_true_lang.js +0 -1
- package/cjs/components/tooltip/src/use-emit.js +0 -1
- package/es/components/tooltip/src/content.mjs +0 -5
- package/es/components/tooltip/src/content.vue_vue_type_script_setup_true_lang.mjs +0 -166
package/es/components/index.mjs
CHANGED
|
@@ -8,29 +8,39 @@ import { ReSecondaryColor as u } from "./secondary-color/index.mjs";
|
|
|
8
8
|
import { ReNeutralColor as d } from "./neutral-color/index.mjs";
|
|
9
9
|
import { ReFilterPanel as f } from "./filter-panel/index.mjs";
|
|
10
10
|
import { ReSvgIcon as p } from "./svg-icon/index.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { useTransitionEmits as m } from "./transition/src/use-transition-emit.mjs";
|
|
12
|
+
import { ReTransition as h } from "./transition/index.mjs";
|
|
13
|
+
import { useTooltipEmits as g } from "./tooltip/src/use-tooltip-emit.mjs";
|
|
14
|
+
import { ReTooltip as _ } from "./tooltip/index.mjs";
|
|
15
|
+
import { usePopoverEmits as v } from "./popover/src/use-popover-emit.mjs";
|
|
16
|
+
import { RePopover as y } from "./popover/index.mjs";
|
|
17
|
+
import { RePopconfirm as b } from "./popconfirm/index.mjs";
|
|
18
|
+
import { createMessage as x } from "./message/src/create-message.mjs";
|
|
19
|
+
import { ReMessage as S } from "./message/index.mjs";
|
|
15
20
|
//#region packages/components/index.ts
|
|
16
|
-
var
|
|
21
|
+
var C = e({
|
|
17
22
|
ReButton: () => a,
|
|
18
23
|
ReButtonGroup: () => o,
|
|
19
24
|
ReFilterPanel: () => f,
|
|
20
25
|
ReInput: () => s,
|
|
26
|
+
ReMessage: () => S,
|
|
21
27
|
ReNeutralColor: () => d,
|
|
22
|
-
RePopconfirm: () =>
|
|
23
|
-
RePopover: () =>
|
|
28
|
+
RePopconfirm: () => b,
|
|
29
|
+
RePopover: () => y,
|
|
24
30
|
RePrimaryColor: () => l,
|
|
25
31
|
ReSecondaryColor: () => u,
|
|
26
32
|
ReSvgIcon: () => p,
|
|
27
33
|
ReTabs: () => c,
|
|
28
|
-
ReTooltip: () =>
|
|
34
|
+
ReTooltip: () => _,
|
|
35
|
+
ReTransition: () => h,
|
|
29
36
|
_buttonGroupProps: () => t,
|
|
30
37
|
buttonNativeTypes: () => n,
|
|
31
38
|
buttonSizes: () => r,
|
|
32
39
|
buttonTypes: () => i,
|
|
33
|
-
|
|
40
|
+
createMessage: () => x,
|
|
41
|
+
usePopoverEmits: () => v,
|
|
42
|
+
useTooltipEmits: () => g,
|
|
43
|
+
useTransitionEmits: () => m
|
|
34
44
|
});
|
|
35
45
|
//#endregion
|
|
36
|
-
export { a as ReButton, o as ReButtonGroup, f as ReFilterPanel, s as ReInput, d as ReNeutralColor,
|
|
46
|
+
export { a as ReButton, o as ReButtonGroup, f as ReFilterPanel, s as ReInput, S as ReMessage, d as ReNeutralColor, b as RePopconfirm, y as RePopover, l as RePrimaryColor, u as ReSecondaryColor, p as ReSvgIcon, c as ReTabs, _ as ReTooltip, h as ReTransition, t as _buttonGroupProps, n as buttonNativeTypes, r as buttonSizes, i as buttonTypes, C as components_exports, x as createMessage, v as usePopoverEmits, g as useTooltipEmits, m as useTransitionEmits };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region packages/components/message/src/constants.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"primary",
|
|
4
|
+
"success",
|
|
5
|
+
"warning",
|
|
6
|
+
"error",
|
|
7
|
+
"info"
|
|
8
|
+
], t = [
|
|
9
|
+
"left-top",
|
|
10
|
+
"left-bottom",
|
|
11
|
+
"right-top",
|
|
12
|
+
"right-bottom"
|
|
13
|
+
];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as messageTypes, t as verticalPlacement };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { isPlainObject as e } from "../../../utils/util.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
3
|
+
import { useNamespace as t } from "../../../composables/use-namespace/index.mjs";
|
|
4
|
+
import "../../../composables/index.mjs";
|
|
5
|
+
import { messageTypes as n, verticalPlacement as r } from "./constants.mjs";
|
|
6
|
+
import i from "./message.mjs";
|
|
7
|
+
import { createVNode as a, nextTick as o, render as s, watch as c } from "vue";
|
|
8
|
+
import { useElementSize as l } from "@vueuse/core";
|
|
9
|
+
//#region packages/components/message/src/create-message.ts
|
|
10
|
+
var { ng: u } = t("message"), d = 0, f = {}, p = {}, m = (e, t) => {
|
|
11
|
+
let n = p[e] || [], r = t;
|
|
12
|
+
n.forEach((e) => {
|
|
13
|
+
var t;
|
|
14
|
+
(t = e.vnode) != null && (t = t.component) != null && (t = t.exposed) != null && t.setOffset && (e.vnode.component.exposed.setOffset(r), r += e.offset);
|
|
15
|
+
});
|
|
16
|
+
}, h = (e, t, n, i) => {
|
|
17
|
+
let a = n.getBoundingClientRect(), o = f[e];
|
|
18
|
+
if (!o) return;
|
|
19
|
+
let { vnode: s } = o, c = r.includes(t) ? t : t.split("-")[0];
|
|
20
|
+
switch (p[t] || (p[t] = []), c) {
|
|
21
|
+
case "left-top":
|
|
22
|
+
case "left-bottom":
|
|
23
|
+
case "right-top":
|
|
24
|
+
case "right-bottom":
|
|
25
|
+
case "top":
|
|
26
|
+
case "bottom": {
|
|
27
|
+
let n = i + a.height;
|
|
28
|
+
p[t].push({
|
|
29
|
+
offset: n,
|
|
30
|
+
id: e,
|
|
31
|
+
vnode: s
|
|
32
|
+
});
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case "left":
|
|
36
|
+
case "right": {
|
|
37
|
+
let n = i + a.width;
|
|
38
|
+
p[t].push({
|
|
39
|
+
offset: n,
|
|
40
|
+
id: e,
|
|
41
|
+
vnode: s
|
|
42
|
+
});
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
m(t, i);
|
|
47
|
+
}, g = (e, t) => {
|
|
48
|
+
let n = f[e];
|
|
49
|
+
if (!n || !n.placement) return;
|
|
50
|
+
let r = p[n.placement];
|
|
51
|
+
if (!r) return;
|
|
52
|
+
let i = r.findIndex((t) => t.id === e);
|
|
53
|
+
i > -1 && r.splice(i, 1), m(n.placement, t), r.length === 0 && delete p[n.placement];
|
|
54
|
+
}, _ = (e, t = 20) => (p[e] || []).reduce((e, t) => e + t.offset, 0) + t, v = (e, t, n, i) => {
|
|
55
|
+
let a = p[n];
|
|
56
|
+
if (!a) return;
|
|
57
|
+
let o = a.find((e) => e.id === t);
|
|
58
|
+
if (o) {
|
|
59
|
+
let t = r.includes(n) ? n : n.split("-")[0], a = e.getBoundingClientRect();
|
|
60
|
+
switch (t) {
|
|
61
|
+
case "left-top":
|
|
62
|
+
case "left-bottom":
|
|
63
|
+
case "right-top":
|
|
64
|
+
case "right-bottom":
|
|
65
|
+
case "top":
|
|
66
|
+
case "bottom":
|
|
67
|
+
o.offset = i + a.height;
|
|
68
|
+
break;
|
|
69
|
+
case "left":
|
|
70
|
+
case "right": o.offset = i + a.width;
|
|
71
|
+
}
|
|
72
|
+
m(n, i);
|
|
73
|
+
}
|
|
74
|
+
}, y = (e, t, n, r) => {
|
|
75
|
+
let { stop: i, width: a, height: o } = l(e), { stop: s } = c(() => [a.value, o.value], () => v(e, t, n, r));
|
|
76
|
+
return { stop: () => {
|
|
77
|
+
i(), s();
|
|
78
|
+
} };
|
|
79
|
+
}, b = (e) => {
|
|
80
|
+
var t;
|
|
81
|
+
let n = Object.assign({}, {
|
|
82
|
+
placement: "top",
|
|
83
|
+
offset: 10
|
|
84
|
+
}, e || {}), r = document.createElement("div"), c = u(`${d++}`), l = parseFloat(n.offset), p = _(n.placement, l), m = null, v = a(i, {
|
|
85
|
+
...n,
|
|
86
|
+
id: c,
|
|
87
|
+
offset: p,
|
|
88
|
+
onBeforeEnter(t) {
|
|
89
|
+
var r;
|
|
90
|
+
o(() => {
|
|
91
|
+
h(c, n.placement, t, l), m = y(t, c, n.placement, l);
|
|
92
|
+
}), e == null || (r = e.onShow) == null || r.call(e, t);
|
|
93
|
+
},
|
|
94
|
+
onAfterEnter(t) {
|
|
95
|
+
var n;
|
|
96
|
+
e == null || (n = e.onShown) == null || n.call(e, t);
|
|
97
|
+
},
|
|
98
|
+
onBeforeLeave(t) {
|
|
99
|
+
var n;
|
|
100
|
+
e == null || (n = e.onClose) == null || n.call(e, t), g(c, l);
|
|
101
|
+
},
|
|
102
|
+
onAfterLeave(t) {
|
|
103
|
+
var n, i;
|
|
104
|
+
s(null, r), delete f[c], e == null || (n = e.onClosed) == null || n.call(e, t), m == null || (i = m.stop) == null || i.call(m);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
return s(v, r), f[c] = {
|
|
108
|
+
id: c,
|
|
109
|
+
container: r,
|
|
110
|
+
vnode: v,
|
|
111
|
+
props: (v == null || (t = v.component) == null ? void 0 : t.props) || {},
|
|
112
|
+
placement: n.placement,
|
|
113
|
+
close() {
|
|
114
|
+
var e;
|
|
115
|
+
(e = v.component) == null || (e = e.exposed) == null || e.close();
|
|
116
|
+
},
|
|
117
|
+
show() {
|
|
118
|
+
var e;
|
|
119
|
+
(e = v.component) == null || (e = e.exposed) == null || e.show();
|
|
120
|
+
}
|
|
121
|
+
}, f[c];
|
|
122
|
+
}, x = (t) => typeof t == "string" ? { content: t } : e(t) ? t : {};
|
|
123
|
+
n.forEach((e) => {
|
|
124
|
+
b[e] = (t) => b({
|
|
125
|
+
...x(t),
|
|
126
|
+
type: e
|
|
127
|
+
});
|
|
128
|
+
}), b.closeAll = () => {
|
|
129
|
+
Object.values(f).forEach((e) => {
|
|
130
|
+
var t;
|
|
131
|
+
e == null || (t = e.close) == null || t.call(e);
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
var S = b;
|
|
135
|
+
//#endregion
|
|
136
|
+
export { S as createMessage };
|
package/{cjs/components/tooltip/src/content.vue.d.ts → es/components/message/src/message.vue.d.ts}
RENAMED
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type __VLS_Props =
|
|
4
|
-
declare const model: ModelRef<boolean, string, boolean, boolean>;
|
|
1
|
+
import { MessageOptions } from './types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
type __VLS_Props = MessageOptions;
|
|
5
4
|
type __VLS_ModelProps = {
|
|
6
|
-
|
|
5
|
+
'visible'?: boolean;
|
|
7
6
|
};
|
|
8
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
-
declare var
|
|
8
|
+
declare var __VLS_15: {}, __VLS_22: {};
|
|
10
9
|
type __VLS_Slots = {} & {
|
|
11
|
-
|
|
10
|
+
icon?: (props: typeof __VLS_15) => any;
|
|
11
|
+
} & {
|
|
12
|
+
close?: (props: typeof __VLS_22) => any;
|
|
12
13
|
};
|
|
13
14
|
declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
show: () => void;
|
|
16
|
+
setOffset: (offset: number | string) => void;
|
|
17
|
+
close: () => void;
|
|
16
18
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
|
-
beforeShow: (el: HTMLElement) => any;
|
|
18
|
-
show: (el: HTMLElement) => any;
|
|
19
|
-
beforeHide: (el: HTMLElement) => any;
|
|
20
|
-
hide: (el: HTMLElement) => any;
|
|
21
19
|
beforeEnter: (el: HTMLElement) => any;
|
|
22
20
|
enter: (el: HTMLElement, done: () => void) => any;
|
|
23
21
|
enterCancelled: (el: HTMLElement) => any;
|
|
@@ -26,12 +24,9 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
|
|
|
26
24
|
leave: (el: HTMLElement, done: () => void) => any;
|
|
27
25
|
leaveCancelled: (el: HTMLElement) => any;
|
|
28
26
|
afterLeave: (el: HTMLElement) => any;
|
|
29
|
-
"update:
|
|
27
|
+
"update:visible": (value: boolean) => any;
|
|
28
|
+
iconUpdated: (el: HTMLElement) => any;
|
|
30
29
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
-
onBeforeShow?: ((el: HTMLElement) => any) | undefined;
|
|
32
|
-
onShow?: ((el: HTMLElement) => any) | undefined;
|
|
33
|
-
onBeforeHide?: ((el: HTMLElement) => any) | undefined;
|
|
34
|
-
onHide?: ((el: HTMLElement) => any) | undefined;
|
|
35
30
|
onBeforeEnter?: ((el: HTMLElement) => any) | undefined;
|
|
36
31
|
onEnter?: ((el: HTMLElement, done: () => void) => any) | undefined;
|
|
37
32
|
onEnterCancelled?: ((el: HTMLElement) => any) | undefined;
|
|
@@ -40,7 +35,8 @@ declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
|
|
|
40
35
|
onLeave?: ((el: HTMLElement, done: () => void) => any) | undefined;
|
|
41
36
|
onLeaveCancelled?: ((el: HTMLElement) => any) | undefined;
|
|
42
37
|
onAfterLeave?: ((el: HTMLElement) => any) | undefined;
|
|
43
|
-
"onUpdate:
|
|
38
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
39
|
+
onIconUpdated?: ((el: HTMLElement) => any) | undefined;
|
|
44
40
|
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
45
41
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
46
42
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { toPx as e } from "../../../utils/util.mjs";
|
|
2
|
+
import "../../../utils/index.mjs";
|
|
3
|
+
import { useNamespace as t } from "../../../composables/use-namespace/index.mjs";
|
|
4
|
+
import { useZIndex as n } from "../../../composables/use-z-index/index.mjs";
|
|
5
|
+
import { useTheme as r } from "../../../composables/use-theme/index.mjs";
|
|
6
|
+
import "../../../composables/index.mjs";
|
|
7
|
+
import { ReTransition as i } from "../../transition/index.mjs";
|
|
8
|
+
import { verticalPlacement as a } from "./constants.mjs";
|
|
9
|
+
import { useMessageEmits as o } from "./use-message-emit.mjs";
|
|
10
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, defineComponent as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onMounted as v, onUnmounted as y, openBlock as b, ref as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useModel as E, watch as D, withCtx as O } from "vue";
|
|
11
|
+
import { CloseShort as k, InfoCircle as A } from "@rappel-ui/svg-icons";
|
|
12
|
+
//#region packages/components/message/src/message.vue?vue&type=script&setup=true&lang.ts
|
|
13
|
+
var j = ["data-placement"], M = ["innerHTML"], N = f({
|
|
14
|
+
name: "ReMessage",
|
|
15
|
+
__name: "message",
|
|
16
|
+
props: p({
|
|
17
|
+
content: { default: "" },
|
|
18
|
+
isHtml: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
stayDuration: { default: 3e3 },
|
|
23
|
+
theme: { default: "light" },
|
|
24
|
+
reverseTheme: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
type: { default: "" },
|
|
29
|
+
offset: { default: 20 },
|
|
30
|
+
zIndex: { default: () => void 0 },
|
|
31
|
+
width: { default: () => void 0 },
|
|
32
|
+
height: { default: () => void 0 },
|
|
33
|
+
maxWidth: { default: () => void 0 },
|
|
34
|
+
maxHeight: { default: () => void 0 },
|
|
35
|
+
floatingClass: { default: "" },
|
|
36
|
+
placement: { default: "top" },
|
|
37
|
+
closeIcon: { default: () => k },
|
|
38
|
+
showClose: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
icon: { default: () => A },
|
|
43
|
+
showIcon: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
},
|
|
47
|
+
onClose: { type: Function },
|
|
48
|
+
onClosed: { type: Function },
|
|
49
|
+
onShow: { type: Function },
|
|
50
|
+
onShown: { type: Function },
|
|
51
|
+
appendTo: { default: "body" },
|
|
52
|
+
teleported: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !0
|
|
55
|
+
},
|
|
56
|
+
defer: { type: Boolean },
|
|
57
|
+
transition: { default: "" },
|
|
58
|
+
mode: {},
|
|
59
|
+
cssTransition: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !0
|
|
62
|
+
},
|
|
63
|
+
cssDuration: { default: 300 },
|
|
64
|
+
appear: { type: Boolean }
|
|
65
|
+
}, {
|
|
66
|
+
visible: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
visibleModifiers: {}
|
|
71
|
+
}),
|
|
72
|
+
emits: p([
|
|
73
|
+
"iconUpdated",
|
|
74
|
+
"beforeEnter",
|
|
75
|
+
"enter",
|
|
76
|
+
"enterCancelled",
|
|
77
|
+
"afterEnter",
|
|
78
|
+
"beforeLeave",
|
|
79
|
+
"leave",
|
|
80
|
+
"leaveCancelled",
|
|
81
|
+
"afterLeave"
|
|
82
|
+
], ["update:visible"]),
|
|
83
|
+
setup(f, { expose: p, emit: k }) {
|
|
84
|
+
let { beforeEnter: A, enter: N, afterEnter: P, beforeLeave: F, leave: I, afterLeave: L } = o(k), { ns: R, n: z, nm: B, is: V } = t("message"), { currentTheme: H } = r(f.theme, f.reverseTheme), U = c(() => {
|
|
85
|
+
var e;
|
|
86
|
+
return (e = f.placement) == null || (e = e.split("-")) == null ? void 0 : e[0];
|
|
87
|
+
}), W = c(() => {
|
|
88
|
+
var e;
|
|
89
|
+
return (e = f.placement) == null || (e = e.split("-")) == null ? void 0 : e[1];
|
|
90
|
+
}), G = x(f.offset);
|
|
91
|
+
D(() => f.offset, (e) => {
|
|
92
|
+
G.value = e;
|
|
93
|
+
});
|
|
94
|
+
let K = (e) => {
|
|
95
|
+
G.value = e;
|
|
96
|
+
}, q = c(() => [{
|
|
97
|
+
width: e(f.width),
|
|
98
|
+
height: e(f.height),
|
|
99
|
+
maxWidth: e(f.maxWidth),
|
|
100
|
+
maxHeight: e(f.maxHeight),
|
|
101
|
+
zIndex: Y.value,
|
|
102
|
+
[a.includes(f.placement) ? W.value : U.value]: e(G.value),
|
|
103
|
+
position: "fixed",
|
|
104
|
+
transition: `opacity ${f.cssDuration / 2}ms,
|
|
105
|
+
transform ${f.cssDuration}ms,
|
|
106
|
+
bottom ${f.cssDuration}ms,
|
|
107
|
+
top ${f.cssDuration}ms,
|
|
108
|
+
left ${f.cssDuration}ms,
|
|
109
|
+
right ${f.cssDuration}ms`
|
|
110
|
+
}]), J = E(f, "visible"), Y = x(0), { zIndex: X } = n(), { stop: Z } = D(J, (e) => {
|
|
111
|
+
e && (Y.value = f.zIndex || X.value);
|
|
112
|
+
}), Q = [
|
|
113
|
+
"top",
|
|
114
|
+
"bottom",
|
|
115
|
+
"left",
|
|
116
|
+
"right"
|
|
117
|
+
].reduce((e, t) => (e[t] = {
|
|
118
|
+
pos: t,
|
|
119
|
+
enterFrom: `${t}-enter-from`,
|
|
120
|
+
enterActive: `${t}-enter-active`,
|
|
121
|
+
enterTo: `${t}-enter-to`,
|
|
122
|
+
leaveFrom: `${t}-leave-from`,
|
|
123
|
+
leaveActive: `${t}-leave-active`,
|
|
124
|
+
leaveTo: `${t}-leave-to`
|
|
125
|
+
}, e), {}), $ = () => {
|
|
126
|
+
J.value = !1;
|
|
127
|
+
let e = null;
|
|
128
|
+
h(() => {
|
|
129
|
+
J.value = !0, e && (clearTimeout(e), e = null), e = setTimeout(() => {
|
|
130
|
+
J.value = !1, e && (clearTimeout(e), e = null);
|
|
131
|
+
}, parseFloat(String(f.cssDuration)) + parseFloat(String(f.stayDuration)));
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return v(() => {
|
|
135
|
+
$();
|
|
136
|
+
}), y(() => {
|
|
137
|
+
Z();
|
|
138
|
+
}), p({
|
|
139
|
+
show: $,
|
|
140
|
+
setOffset: K,
|
|
141
|
+
close: () => {
|
|
142
|
+
J.value = !1;
|
|
143
|
+
}
|
|
144
|
+
}), (e, t) => (b(), l(T(i), m({
|
|
145
|
+
teleported: f.teleported,
|
|
146
|
+
"append-to": f.appendTo,
|
|
147
|
+
transition: f.transition,
|
|
148
|
+
"css-duration": f.cssDuration,
|
|
149
|
+
"css-transition": f.cssTransition,
|
|
150
|
+
"enter-from-class": T(Q)[U.value].enterFrom,
|
|
151
|
+
"enter-active-class": T(Q)[U.value].enterActive,
|
|
152
|
+
"enter-to-class": T(Q)[U.value].enterTo,
|
|
153
|
+
"leave-from-class": T(Q)[U.value].leaveFrom,
|
|
154
|
+
"leave-active-class": T(Q)[U.value].leaveActive,
|
|
155
|
+
"leave-to-class": T(Q)[U.value].leaveTo
|
|
156
|
+
}, e.$attrs, {
|
|
157
|
+
onBeforeEnter: T(A),
|
|
158
|
+
onEnter: T(N),
|
|
159
|
+
onAfterEnter: T(P),
|
|
160
|
+
onBeforeLeave: T(F),
|
|
161
|
+
onLeave: T(I),
|
|
162
|
+
onAfterLeave: T(L)
|
|
163
|
+
}), {
|
|
164
|
+
default: O(() => [J.value ? (b(), d("div", {
|
|
165
|
+
key: 0,
|
|
166
|
+
ref: "floatingRef",
|
|
167
|
+
style: _(q.value),
|
|
168
|
+
"data-placement": f.placement,
|
|
169
|
+
class: g([
|
|
170
|
+
T(z)(),
|
|
171
|
+
T(B)(f.type),
|
|
172
|
+
T(V)(T(H), !!T(H)),
|
|
173
|
+
f.floatingClass
|
|
174
|
+
])
|
|
175
|
+
}, [
|
|
176
|
+
S(e.$slots, "icon", {}, () => [f.showIcon ? (b(), d(s, { key: 0 }, [typeof f.icon == "string" ? (b(), d("i", {
|
|
177
|
+
key: 0,
|
|
178
|
+
class: g([T(R)("icon"), f.icon]),
|
|
179
|
+
"aria-hidden": "true"
|
|
180
|
+
}, null, 2)) : (b(), l(C(f.icon), {
|
|
181
|
+
key: 1,
|
|
182
|
+
class: g([T(R)("icon")]),
|
|
183
|
+
"aria-hidden": "true"
|
|
184
|
+
}, null, 8, ["class"]))], 64)) : u("", !0)]),
|
|
185
|
+
f.isHtml ? (b(), d("span", {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: g([T(R)("content")]),
|
|
188
|
+
innerHTML: f.content
|
|
189
|
+
}, null, 10, M)) : (b(), d("span", {
|
|
190
|
+
key: 1,
|
|
191
|
+
class: g([T(R)("content")])
|
|
192
|
+
}, w(f.content), 3)),
|
|
193
|
+
S(e.$slots, "close", {}, () => [f.showClose ? (b(), d(s, { key: 0 }, [typeof f.closeIcon == "string" ? (b(), d("i", {
|
|
194
|
+
key: 0,
|
|
195
|
+
class: g([T(R)("close"), f.closeIcon]),
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
onClick: t[0] || (t[0] = (e) => J.value = !1)
|
|
198
|
+
}, null, 2)) : (b(), l(C(f.closeIcon), {
|
|
199
|
+
key: 1,
|
|
200
|
+
class: g([T(R)("close")]),
|
|
201
|
+
"aria-hidden": "true",
|
|
202
|
+
onClick: t[1] || (t[1] = (e) => J.value = !1)
|
|
203
|
+
}, null, 8, ["class"]))], 64)) : u("", !0)])
|
|
204
|
+
], 14, j)) : u("", !0)]),
|
|
205
|
+
_: 3
|
|
206
|
+
}, 16, [
|
|
207
|
+
"teleported",
|
|
208
|
+
"append-to",
|
|
209
|
+
"transition",
|
|
210
|
+
"css-duration",
|
|
211
|
+
"css-transition",
|
|
212
|
+
"enter-from-class",
|
|
213
|
+
"enter-active-class",
|
|
214
|
+
"enter-to-class",
|
|
215
|
+
"leave-from-class",
|
|
216
|
+
"leave-active-class",
|
|
217
|
+
"leave-to-class",
|
|
218
|
+
"onBeforeEnter",
|
|
219
|
+
"onEnter",
|
|
220
|
+
"onAfterEnter",
|
|
221
|
+
"onBeforeLeave",
|
|
222
|
+
"onLeave",
|
|
223
|
+
"onAfterLeave"
|
|
224
|
+
]));
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
//#endregion
|
|
228
|
+
export { N as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createVNode, Component } from 'vue';
|
|
2
|
+
import { TransitionEmits, TransitionProps } from '../../transition';
|
|
3
|
+
import { Placement } from '../../tooltip';
|
|
4
|
+
import { Theme, MaybeClass } from '../../../types';
|
|
5
|
+
import { messageTypes, verticalPlacement } from './constants';
|
|
6
|
+
export type MesageVerticalPlacement = (typeof verticalPlacement)[number];
|
|
7
|
+
export type MessagePlacement = MesageVerticalPlacement | Placement;
|
|
8
|
+
export type MessageShortType = (typeof messageTypes)[number];
|
|
9
|
+
export type CreateMessageFn = (options: MessageOptionsOrString) => MessageInstance;
|
|
10
|
+
export type MessageShortcuts = Record<MessageShortType, (options: MessageOptionsOrString) => MessageInstance>;
|
|
11
|
+
export type CreateMessageType = CreateMessageFn & MessageShortcuts & {
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
};
|
|
14
|
+
export interface MessageOptions extends TransitionProps {
|
|
15
|
+
content?: string | HTMLElement;
|
|
16
|
+
isHtml?: boolean;
|
|
17
|
+
stayDuration?: number;
|
|
18
|
+
theme?: Theme;
|
|
19
|
+
reverseTheme?: boolean;
|
|
20
|
+
type?: (typeof messageTypes)[number];
|
|
21
|
+
offset?: number | string;
|
|
22
|
+
zIndex?: number;
|
|
23
|
+
width?: number | string;
|
|
24
|
+
height?: number | string;
|
|
25
|
+
maxWidth?: number | string;
|
|
26
|
+
maxHeight?: number | string;
|
|
27
|
+
floatingClass?: MaybeClass;
|
|
28
|
+
placement?: MessagePlacement;
|
|
29
|
+
closeIcon?: string | Component;
|
|
30
|
+
showClose?: boolean;
|
|
31
|
+
icon?: string | Component;
|
|
32
|
+
showIcon?: boolean;
|
|
33
|
+
onClose?: (el: HTMLElement) => void;
|
|
34
|
+
onClosed?: (el: HTMLElement) => void;
|
|
35
|
+
onShow?: (el: HTMLElement) => void;
|
|
36
|
+
onShown?: (el: HTMLElement) => void;
|
|
37
|
+
}
|
|
38
|
+
export type MessageOptionsOrString = MessageOptions | string;
|
|
39
|
+
export interface MessageInstance {
|
|
40
|
+
id: string;
|
|
41
|
+
container: HTMLElement;
|
|
42
|
+
vnode: ReturnType<typeof createVNode>;
|
|
43
|
+
props: MessageOptions;
|
|
44
|
+
placement?: MessagePlacement;
|
|
45
|
+
close: () => void;
|
|
46
|
+
show: () => void;
|
|
47
|
+
}
|
|
48
|
+
export interface OffsetItem {
|
|
49
|
+
id: string;
|
|
50
|
+
offset: number;
|
|
51
|
+
vnode: ReturnType<typeof createVNode>;
|
|
52
|
+
}
|
|
53
|
+
export interface MessageEmits extends TransitionEmits {
|
|
54
|
+
iconUpdated: [el: HTMLElement];
|
|
55
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmitFn } from 'vue';
|
|
2
|
+
import { MessageEmits } from './types';
|
|
3
|
+
export declare function useMessageEmits(emits: EmitFn<MessageEmits>): {
|
|
4
|
+
beforeEnter: (el: any) => void;
|
|
5
|
+
enter: (el: any, done: any) => void;
|
|
6
|
+
enterCancelled: (el: any) => void;
|
|
7
|
+
afterEnter: (el: any) => void;
|
|
8
|
+
beforeLeave: (el: any) => void;
|
|
9
|
+
leave: (el: any, done: any) => void;
|
|
10
|
+
leaveCancelled: (el: any) => void;
|
|
11
|
+
afterLeave: (el: any) => void;
|
|
12
|
+
};
|
|
File without changes
|
|
File without changes
|