ep-craft 0.1.22 → 0.1.24
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/dist/components/affix/affix.d.ts +19 -19
- package/dist/components/affix/affix.js +61 -53
- package/dist/components/alert/alert.d.ts +71 -17
- package/dist/components/alert/alert.js +99 -43
- package/dist/components/anchor/anchor.d.ts +19 -19
- package/dist/components/anchor/anchor.js +166 -102
- package/dist/components/anchor/constants.d.ts +15 -0
- package/dist/components/anchor/constants.js +4 -0
- package/dist/components/anchor-link/anchor-link.d.ts +1 -1
- package/dist/components/anchor-link/anchor-link.js +39 -26
- package/dist/components/button/EpButton.vue.d.ts +8 -8
- package/dist/components/button/EpButton.vue.js +5 -5
- package/dist/components/button/constants.d.ts +7 -0
- package/dist/components/button/constants.js +6 -0
- package/dist/components/check-tag/EpCheckTag.vue.d.ts +1 -1
- package/dist/components/collapse-transition/index.js +2 -2
- package/dist/components/config-provider/src/constants.js +4 -0
- package/dist/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/dist/components/config-provider/src/hooks/use-global-config.js +24 -0
- package/dist/components/form/src/constants.js +2 -1
- package/dist/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/dist/components/form/src/hooks/use-form-common-props.js +17 -0
- package/dist/components/form/src/hooks/use-form-item.js +51 -0
- package/dist/components/icon/index.js +5 -5
- package/dist/components/menu/menu-collapse-transition.vue.js +10 -6
- package/dist/components/menu/menu.d.ts +47 -47
- package/dist/components/menu/menu.js +59 -52
- package/dist/components/menu/use-menu-color.d.ts +2 -0
- package/dist/components/menu/use-menu-color.js +11 -0
- package/dist/components/menu/use-menu-css-var.d.ts +2 -0
- package/dist/components/menu/use-menu-css-var.js +30 -0
- package/dist/components/menu/utils/menu-bar.d.ts +7 -0
- package/dist/components/menu/utils/menu-bar.js +15 -0
- package/dist/components/menu/utils/menu-item.d.ts +9 -0
- package/dist/components/menu/utils/menu-item.js +50 -0
- package/dist/components/menu/utils/submenu.d.ts +11 -0
- package/dist/components/menu/utils/submenu.js +49 -0
- package/dist/components/menu-item/EpMenuItem.vue.js +17 -13
- package/dist/components/menu-item-group/EpMenuItemGroup.vue.js +1 -1
- package/dist/components/popper/index.js +17 -18
- package/dist/components/popper/src/composables/use-content.d.ts +6 -6
- package/dist/components/popper/src/content.vue.d.ts +6 -6
- package/dist/components/popper/src/popper.d.ts +2 -2
- package/dist/components/radio/constants.d.ts +64 -0
- package/dist/components/radio/constants.js +4 -0
- package/dist/components/radio/radio.d.ts +98 -19
- package/dist/components/radio/radio.js +101 -43
- package/dist/components/radio/use-radio.d.ts +13 -0
- package/dist/components/radio/use-radio.js +43 -0
- package/dist/components/radio-button/radio-button.d.ts +46 -16
- package/dist/components/radio-button/radio-button.js +37 -29
- package/dist/components/radio-group/radio-group.d.ts +142 -28
- package/dist/components/radio-group/radio-group.js +136 -55
- package/dist/components/slot/src/only-child.js +23 -22
- package/dist/components/sub-menu/sub-menu.d.ts +19 -19
- package/dist/components/sub-menu/sub-menu.js +65 -58
- package/dist/components/tab-pane/tab-pane.d.ts +45 -8
- package/dist/components/tab-pane/tab-pane.js +66 -32
- package/dist/components/tabs/composables/use-tab-nav-touch.d.ts +19 -0
- package/dist/components/tabs/composables/use-tab-nav-touch.js +58 -0
- package/dist/components/tabs/constants.d.ts +63 -0
- package/dist/components/tabs/constants.js +4 -0
- package/dist/components/tabs/tab-bar.d.ts +97 -0
- package/dist/components/tabs/tab-bar.vue.d.ts +14 -0
- package/dist/components/tabs/tab-bar.vue.js +80 -0
- package/dist/components/tabs/tab-bar2.vue.js +4 -0
- package/dist/components/tabs/tab-nav.d.ts +295 -0
- package/dist/components/tabs/tab-nav.js +243 -0
- package/dist/components/tabs/tabs.d.ts +71 -28
- package/dist/components/tabs/tabs.js +165 -93
- package/dist/components/tag/EpTag.vue.d.ts +3 -3
- package/dist/components/tag/EpTag.vue.js +3 -3
- package/dist/components/tooltip/index.d.ts +34 -34
- package/dist/components/tooltip/index.js +12 -12
- package/dist/components/tooltip/src/content.vue.d.ts +8 -8
- package/dist/components/tooltip/src/tooltip.d.ts +2 -2
- package/dist/components/tooltip/src/tooltip.vue.d.ts +12 -12
- package/dist/components/tooltip/src/trigger.d.ts +1 -1
- package/dist/constants/event.js +5 -0
- package/dist/directives/click-outside/index.js +49 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-deprecated/index.js +25 -0
- package/dist/hooks/use-locale/index.js +24 -0
- package/dist/hooks/use-ordered-children/index.js +53 -0
- package/dist/hooks/use-popper/index.d.ts +6 -6
- package/dist/hooks/use-prop/index.js +11 -0
- package/dist/hooks/use-size/index.d.ts +3 -3
- package/dist/hooks/use-size/index.js +14 -6
- package/dist/hooks/use-wheel/defaults.d.ts +27 -0
- package/dist/hooks/use-wheel/defaults.js +4 -0
- package/dist/hooks/use-wheel/index.d.ts +13 -0
- package/dist/hooks/use-wheel/index.js +26 -0
- package/dist/utils/browser.js +6 -5
- package/dist/utils/dom/aria.js +13 -6
- package/dist/utils/dom/element.js +16 -0
- package/dist/utils/dom/position.js +18 -0
- package/dist/utils/dom/scroll.js +50 -0
- package/dist/utils/dom/style.js +40 -13
- package/dist/utils/easings.js +7 -0
- package/dist/utils/error.js +11 -7
- package/dist/utils/numbers.js +6 -0
- package/dist/utils/objects.js +7 -0
- package/dist/utils/raf.js +6 -0
- package/dist/utils/strings.js +8 -0
- package/dist/utils/throttleByRaf.js +15 -0
- package/dist/utils/types.js +19 -16
- package/dist/utils/typescript.js +4 -0
- package/dist/utils/vue/icon.js +20 -0
- package/dist/utils/vue/vnode.d.ts +4 -4
- package/dist/utils/vue/vnode.js +17 -0
- package/dist/vendored-components.d.ts +6 -3
- package/dist/vendored-components.js +11 -5
- package/package.json +4 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
export declare const affixProps: {
|
|
3
|
-
readonly zIndex: import("element-plus/
|
|
4
|
-
readonly target: import("element-plus/
|
|
5
|
-
readonly offset: import("element-plus/
|
|
6
|
-
readonly position: import("element-plus/
|
|
3
|
+
readonly zIndex: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown, 100, boolean>;
|
|
4
|
+
readonly target: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
5
|
+
readonly offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
6
|
+
readonly position: import("@element-plus/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
|
|
7
7
|
readonly teleported: BooleanConstructor;
|
|
8
|
-
readonly appendTo: import("element-plus/
|
|
8
|
+
readonly appendTo: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
|
|
9
9
|
};
|
|
10
10
|
export type AffixProps = ExtractPropTypes<typeof affixProps>;
|
|
11
11
|
export declare const affixEmits: {
|
|
@@ -17,12 +17,12 @@ export declare const affixEmits: {
|
|
|
17
17
|
};
|
|
18
18
|
export type AffixEmits = typeof affixEmits;
|
|
19
19
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
20
|
-
readonly zIndex: import("element-plus/
|
|
21
|
-
readonly target: import("element-plus/
|
|
22
|
-
readonly offset: import("element-plus/
|
|
23
|
-
readonly position: import("element-plus/
|
|
20
|
+
readonly zIndex: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown, 100, boolean>;
|
|
21
|
+
readonly target: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
22
|
+
readonly offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
23
|
+
readonly position: import("@element-plus/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
|
|
24
24
|
readonly teleported: BooleanConstructor;
|
|
25
|
-
readonly appendTo: import("element-plus/
|
|
25
|
+
readonly appendTo: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
|
|
26
26
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
27
27
|
[key: string]: any;
|
|
28
28
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -32,12 +32,12 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
32
32
|
}) => boolean;
|
|
33
33
|
change: (fixed: boolean) => boolean;
|
|
34
34
|
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
35
|
-
readonly zIndex: import("element-plus/
|
|
36
|
-
readonly target: import("element-plus/
|
|
37
|
-
readonly offset: import("element-plus/
|
|
38
|
-
readonly position: import("element-plus/
|
|
35
|
+
readonly zIndex: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown, 100, boolean>;
|
|
36
|
+
readonly target: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
37
|
+
readonly offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
|
|
38
|
+
readonly position: import("@element-plus/utils").EpPropFinalized<StringConstructor, "bottom" | "top", unknown, "top", boolean>;
|
|
39
39
|
readonly teleported: BooleanConstructor;
|
|
40
|
-
readonly appendTo: import("element-plus/
|
|
40
|
+
readonly appendTo: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
|
|
41
41
|
}>> & Readonly<{
|
|
42
42
|
onChange?: ((fixed: boolean) => any) | undefined;
|
|
43
43
|
onScroll?: ((args_0: {
|
|
@@ -45,11 +45,11 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
45
45
|
fixed: boolean;
|
|
46
46
|
}) => any) | undefined;
|
|
47
47
|
}>, {
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
48
|
+
readonly position: import("@element-plus/utils").EpPropMergeType<StringConstructor, "bottom" | "top", unknown>;
|
|
49
|
+
readonly zIndex: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
|
|
50
50
|
readonly offset: number;
|
|
51
|
-
readonly
|
|
52
|
-
readonly appendTo: import("element-plus/
|
|
51
|
+
readonly target: string;
|
|
52
|
+
readonly appendTo: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>;
|
|
53
53
|
readonly teleported: boolean;
|
|
54
54
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
55
55
|
export default _default;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { defineComponent as D, shallowRef as
|
|
2
|
-
import { CHANGE_EVENT as H } from "
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as D, shallowRef as r, ref as S, computed as T, watch as E, onMounted as C, onActivated as F, nextTick as R, onDeactivated as V, watchEffect as Y, h as z, Teleport as k, renderSlot as q } from "vue";
|
|
2
|
+
import { CHANGE_EVENT as H } from "../../constants/event.js";
|
|
3
|
+
import { isBoolean as W, isNumber as G } from "../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import { throwError as U } from "../../utils/error.js";
|
|
7
|
+
import "@vue/shared";
|
|
8
|
+
import { getScrollContainer as J } from "../../utils/dom/scroll.js";
|
|
9
|
+
import { addUnit as K } from "../../utils/dom/style.js";
|
|
10
|
+
import "@element-plus/icons-vue";
|
|
11
|
+
import { buildProps as Q, definePropType as A } from "../../utils/vue/props/runtime.js";
|
|
12
|
+
import { useNamespace as X } from "../../hooks/use-namespace/index.js";
|
|
5
13
|
const Z = (e) => {
|
|
6
14
|
const t = (e == null ? void 0 : e.value) ?? e;
|
|
7
15
|
return t && typeof t == "object" && "$el" in t ? t.$el : t;
|
|
@@ -9,8 +17,8 @@ const Z = (e) => {
|
|
|
9
17
|
let n;
|
|
10
18
|
const o = E(
|
|
11
19
|
e,
|
|
12
|
-
(
|
|
13
|
-
n == null || n.disconnect(), n = void 0,
|
|
20
|
+
(a) => {
|
|
21
|
+
n == null || n.disconnect(), n = void 0, a && typeof ResizeObserver < "u" && (n = new ResizeObserver(t), n.observe(a));
|
|
14
22
|
},
|
|
15
23
|
{ immediate: !0, flush: "post" }
|
|
16
24
|
);
|
|
@@ -21,53 +29,53 @@ const Z = (e) => {
|
|
|
21
29
|
};
|
|
22
30
|
}, te = (e, t, n) => {
|
|
23
31
|
let o;
|
|
24
|
-
const
|
|
32
|
+
const a = E(
|
|
25
33
|
e,
|
|
26
|
-
(
|
|
27
|
-
o == null || o.disconnect(), o = void 0,
|
|
34
|
+
(u) => {
|
|
35
|
+
o == null || o.disconnect(), o = void 0, u && typeof MutationObserver < "u" && (o = new MutationObserver(t), o.observe(u, n));
|
|
28
36
|
},
|
|
29
37
|
{ immediate: !0, flush: "post" }
|
|
30
38
|
);
|
|
31
39
|
return {
|
|
32
40
|
stop: () => {
|
|
33
|
-
o == null || o.disconnect(),
|
|
41
|
+
o == null || o.disconnect(), a();
|
|
34
42
|
}
|
|
35
43
|
};
|
|
36
44
|
};
|
|
37
45
|
function y(...e) {
|
|
38
|
-
const t = typeof e[0] == "string", n = t ? void 0 : e[0], o = t ? e[0] : e[1],
|
|
46
|
+
const t = typeof e[0] == "string", n = t ? void 0 : e[0], o = t ? e[0] : e[1], a = t ? e[1] : e[2], u = t ? e[2] : e[3], s = E(
|
|
39
47
|
() => {
|
|
40
48
|
if (t) return window;
|
|
41
|
-
const
|
|
42
|
-
return
|
|
49
|
+
const i = n.value;
|
|
50
|
+
return i instanceof Window, i;
|
|
43
51
|
},
|
|
44
|
-
(
|
|
45
|
-
|
|
52
|
+
(i, c, f) => {
|
|
53
|
+
i && (i.addEventListener(o, a, u), f(() => i.removeEventListener(o, a, u)));
|
|
46
54
|
},
|
|
47
55
|
{ immediate: !0 }
|
|
48
56
|
);
|
|
49
|
-
return () =>
|
|
57
|
+
return () => s();
|
|
50
58
|
}
|
|
51
59
|
const oe = () => {
|
|
52
|
-
const e =
|
|
60
|
+
const e = r(Number.POSITIVE_INFINITY), t = () => {
|
|
53
61
|
e.value = window.innerHeight;
|
|
54
62
|
};
|
|
55
63
|
return t(), y("resize", t, { passive: !0 }), { height: e };
|
|
56
64
|
}, B = (e, t = {}) => {
|
|
57
|
-
const { windowScroll: n = !0, windowResize: o = !0 } = t,
|
|
65
|
+
const { windowScroll: n = !0, windowResize: o = !0 } = t, a = r(0), u = r(0), s = r(0), i = r(0), c = r(0), f = r(0), d = () => {
|
|
58
66
|
const m = Z(e);
|
|
59
67
|
if (!m) {
|
|
60
|
-
|
|
68
|
+
a.value = 0, u.value = 0, s.value = 0, i.value = 0, c.value = 0, f.value = 0;
|
|
61
69
|
return;
|
|
62
70
|
}
|
|
63
71
|
const v = m.getBoundingClientRect();
|
|
64
|
-
|
|
72
|
+
a.value = v.height, u.value = v.bottom, s.value = v.left, i.value = v.right, c.value = v.top, f.value = v.width;
|
|
65
73
|
};
|
|
66
|
-
return ee(e, d), te(e, d, { attributeFilter: ["style", "class"] }), n && y("scroll", d, { capture: !0, passive: !0 }), o && y("resize", d, { passive: !0 }), C(d), { height:
|
|
67
|
-
}, ne =
|
|
74
|
+
return ee(e, d), te(e, d, { attributeFilter: ["style", "class"] }), n && y("scroll", d, { capture: !0, passive: !0 }), o && y("resize", d, { passive: !0 }), C(d), { height: a, bottom: u, left: s, right: i, top: c, width: f, update: d };
|
|
75
|
+
}, ne = Q({
|
|
68
76
|
/** affix element zIndex value */
|
|
69
77
|
zIndex: {
|
|
70
|
-
type:
|
|
78
|
+
type: A([Number, String]),
|
|
71
79
|
default: 100
|
|
72
80
|
},
|
|
73
81
|
/** target container. (CSS selector) */
|
|
@@ -90,31 +98,31 @@ const oe = () => {
|
|
|
90
98
|
teleported: Boolean,
|
|
91
99
|
/** which element the affix element appends to */
|
|
92
100
|
appendTo: {
|
|
93
|
-
type:
|
|
101
|
+
type: A([String, Object]),
|
|
94
102
|
default: "body"
|
|
95
103
|
}
|
|
96
|
-
}),
|
|
97
|
-
scroll: ({ scrollTop: e, fixed: t }) =>
|
|
98
|
-
[H]: (e) =>
|
|
99
|
-
},
|
|
104
|
+
}), ie = {
|
|
105
|
+
scroll: ({ scrollTop: e, fixed: t }) => G(e) && W(t),
|
|
106
|
+
[H]: (e) => W(e)
|
|
107
|
+
}, we = D({
|
|
100
108
|
name: "EpAffix",
|
|
101
109
|
props: ne,
|
|
102
|
-
emits:
|
|
110
|
+
emits: ie,
|
|
103
111
|
setup(e, { emit: t, slots: n, expose: o }) {
|
|
104
|
-
const
|
|
112
|
+
const a = X("affix"), u = r(), s = r(), i = r(), { height: c } = oe(), {
|
|
105
113
|
height: f,
|
|
106
114
|
width: d,
|
|
107
115
|
top: m,
|
|
108
116
|
bottom: v,
|
|
109
117
|
left: L,
|
|
110
118
|
update: g
|
|
111
|
-
} = B(
|
|
119
|
+
} = B(s, { windowScroll: !1 }), b = B(u), l = S(!1), N = S(0), x = S(0), M = T(() => !e.teleported || !l.value), P = T(() => ({
|
|
112
120
|
display: "flow-root",
|
|
113
|
-
height:
|
|
114
|
-
width:
|
|
121
|
+
height: l.value ? `${f.value}px` : "",
|
|
122
|
+
width: l.value ? `${d.value}px` : ""
|
|
115
123
|
})), _ = T(() => {
|
|
116
|
-
if (!
|
|
117
|
-
const p =
|
|
124
|
+
if (!l.value) return {};
|
|
125
|
+
const p = K(e.offset);
|
|
118
126
|
return {
|
|
119
127
|
height: `${f.value}px`,
|
|
120
128
|
width: `${d.value}px`,
|
|
@@ -125,39 +133,39 @@ const oe = () => {
|
|
|
125
133
|
zIndex: e.zIndex
|
|
126
134
|
};
|
|
127
135
|
}), O = () => {
|
|
128
|
-
if (!
|
|
129
|
-
N.value =
|
|
136
|
+
if (!i.value) return;
|
|
137
|
+
N.value = i.value instanceof Window ? document.documentElement.scrollTop : i.value.scrollTop || 0;
|
|
130
138
|
const { position: p, offset: h } = e, I = h + f.value;
|
|
131
139
|
if (p === "top")
|
|
132
140
|
if (e.target) {
|
|
133
141
|
const w = b.bottom.value - I;
|
|
134
|
-
|
|
142
|
+
l.value = h > m.value && b.bottom.value > 0, x.value = w < 0 ? w : 0;
|
|
135
143
|
} else
|
|
136
|
-
|
|
144
|
+
l.value = h > m.value;
|
|
137
145
|
else if (e.target) {
|
|
138
146
|
const w = c.value - b.top.value - I;
|
|
139
|
-
|
|
147
|
+
l.value = c.value - h < v.value && c.value > b.top.value, x.value = w < 0 ? -w : 0;
|
|
140
148
|
} else
|
|
141
|
-
|
|
149
|
+
l.value = c.value - h < v.value;
|
|
142
150
|
}, $ = async () => {
|
|
143
|
-
if (!
|
|
151
|
+
if (!l.value) {
|
|
144
152
|
g();
|
|
145
153
|
return;
|
|
146
154
|
}
|
|
147
|
-
|
|
155
|
+
l.value = !1, await R(), g(), l.value = !0;
|
|
148
156
|
}, j = async () => {
|
|
149
157
|
g(), await R(), t("scroll", {
|
|
150
158
|
scrollTop: N.value,
|
|
151
|
-
fixed:
|
|
159
|
+
fixed: l.value
|
|
152
160
|
});
|
|
153
161
|
};
|
|
154
|
-
return E(
|
|
155
|
-
e.target ? (
|
|
162
|
+
return E(l, (p) => t(H, p)), C(() => {
|
|
163
|
+
e.target ? (u.value = document.querySelector(e.target) ?? void 0, u.value || U("EpAffix", `Target does not exist: ${e.target}`)) : u.value = document.documentElement, i.value = J(s.value, !0), g();
|
|
156
164
|
}), F(() => {
|
|
157
165
|
R($);
|
|
158
166
|
}), V(() => {
|
|
159
|
-
|
|
160
|
-
}), y(
|
|
167
|
+
l.value = !1;
|
|
168
|
+
}), y(i, "scroll", j), Y(O), o({
|
|
161
169
|
/** update affix status */
|
|
162
170
|
update: O,
|
|
163
171
|
/** update rootRect info */
|
|
@@ -165,8 +173,8 @@ const oe = () => {
|
|
|
165
173
|
}), () => z(
|
|
166
174
|
"div",
|
|
167
175
|
{
|
|
168
|
-
ref:
|
|
169
|
-
class:
|
|
176
|
+
ref: s,
|
|
177
|
+
class: a.b(),
|
|
170
178
|
style: P.value
|
|
171
179
|
},
|
|
172
180
|
[
|
|
@@ -177,7 +185,7 @@ const oe = () => {
|
|
|
177
185
|
z(
|
|
178
186
|
"div",
|
|
179
187
|
{
|
|
180
|
-
class: { [
|
|
188
|
+
class: { [a.m("fixed")]: l.value },
|
|
181
189
|
style: _.value
|
|
182
190
|
},
|
|
183
191
|
[q(n, "default")]
|
|
@@ -189,7 +197,7 @@ const oe = () => {
|
|
|
189
197
|
}
|
|
190
198
|
});
|
|
191
199
|
export {
|
|
192
|
-
|
|
200
|
+
ie as affixEmits,
|
|
193
201
|
ne as affixProps,
|
|
194
|
-
|
|
202
|
+
we as default
|
|
195
203
|
};
|
|
@@ -1,39 +1,93 @@
|
|
|
1
|
+
import { TypeComponentsMap } from '@element-plus/utils/vue/icon';
|
|
2
|
+
/**
|
|
3
|
+
* EpAlert 的 props / emits 定义
|
|
4
|
+
* 从 element-plus alert 源码 vendored 而来(内联到本文件顶部)。
|
|
5
|
+
*/
|
|
6
|
+
export declare const alertEffects: readonly ["light", "dark"];
|
|
7
|
+
export interface AlertProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description alert title.
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description descriptive text.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description alert type.
|
|
18
|
+
*/
|
|
19
|
+
type?: keyof typeof TypeComponentsMap;
|
|
20
|
+
/**
|
|
21
|
+
* @description whether alert can be dismissed.
|
|
22
|
+
*/
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @description text for replacing x button
|
|
26
|
+
*/
|
|
27
|
+
closeText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @description whether show icon
|
|
30
|
+
*/
|
|
31
|
+
showIcon?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @description should content be placed in center.
|
|
34
|
+
*/
|
|
35
|
+
center?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @description theme style
|
|
38
|
+
*/
|
|
39
|
+
effect?: 'light' | 'dark';
|
|
40
|
+
}
|
|
41
|
+
export declare const alertProps: {
|
|
42
|
+
readonly title: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
43
|
+
readonly description: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
44
|
+
readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
|
|
45
|
+
readonly closable: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
46
|
+
readonly closeText: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
47
|
+
readonly showIcon: BooleanConstructor;
|
|
48
|
+
readonly center: BooleanConstructor;
|
|
49
|
+
readonly effect: import("@element-plus/utils").EpPropFinalized<StringConstructor, "dark" | "light", unknown, "light", boolean>;
|
|
50
|
+
};
|
|
51
|
+
export declare const alertEmits: {
|
|
52
|
+
close: (evt: MouseEvent) => boolean;
|
|
53
|
+
};
|
|
54
|
+
export type AlertEmits = typeof alertEmits;
|
|
1
55
|
/**
|
|
2
56
|
* EpAlert —— 从 element-plus 的 alert 源码 vendored 而来(el -> ep 命名),
|
|
3
57
|
* 样式复用仓库内置的 theme-chalk/src/alert.scss(命名空间为 el)。
|
|
4
58
|
*/
|
|
5
59
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
-
readonly title: import("element-plus/
|
|
7
|
-
readonly description: import("element-plus/
|
|
8
|
-
readonly type: import("element-plus/
|
|
9
|
-
readonly closable: import("element-plus/
|
|
10
|
-
readonly closeText: import("element-plus/
|
|
60
|
+
readonly title: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
61
|
+
readonly description: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
62
|
+
readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
|
|
63
|
+
readonly closable: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
64
|
+
readonly closeText: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
11
65
|
readonly showIcon: BooleanConstructor;
|
|
12
66
|
readonly center: BooleanConstructor;
|
|
13
|
-
readonly effect: import("element-plus/
|
|
67
|
+
readonly effect: import("@element-plus/utils").EpPropFinalized<StringConstructor, "dark" | "light", unknown, "light", boolean>;
|
|
14
68
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
15
69
|
[key: string]: any;
|
|
16
70
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
71
|
close: (evt: MouseEvent) => boolean;
|
|
18
72
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
-
readonly title: import("element-plus/
|
|
20
|
-
readonly description: import("element-plus/
|
|
21
|
-
readonly type: import("element-plus/
|
|
22
|
-
readonly closable: import("element-plus/
|
|
23
|
-
readonly closeText: import("element-plus/
|
|
73
|
+
readonly title: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
74
|
+
readonly description: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
75
|
+
readonly type: import("@element-plus/utils").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown, "info", boolean>;
|
|
76
|
+
readonly closable: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
77
|
+
readonly closeText: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
78
|
readonly showIcon: BooleanConstructor;
|
|
25
79
|
readonly center: BooleanConstructor;
|
|
26
|
-
readonly effect: import("element-plus/
|
|
80
|
+
readonly effect: import("@element-plus/utils").EpPropFinalized<StringConstructor, "dark" | "light", unknown, "light", boolean>;
|
|
27
81
|
}>> & Readonly<{
|
|
28
82
|
onClose?: ((evt: MouseEvent) => any) | undefined;
|
|
29
83
|
}>, {
|
|
30
|
-
readonly type: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "error" | "primary" | "success" | "info" | "warning", unknown>;
|
|
31
|
-
readonly title: string;
|
|
32
|
-
readonly center: boolean;
|
|
33
84
|
readonly description: string;
|
|
34
|
-
readonly
|
|
85
|
+
readonly center: boolean;
|
|
86
|
+
readonly title: string;
|
|
87
|
+
readonly type: import("@element-plus/utils").EpPropMergeType<StringConstructor, "error" | "primary" | "success" | "warning" | "info", unknown>;
|
|
88
|
+
readonly effect: import("@element-plus/utils").EpPropMergeType<StringConstructor, "dark" | "light", unknown>;
|
|
89
|
+
readonly closable: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
35
90
|
readonly closeText: string;
|
|
36
91
|
readonly showIcon: boolean;
|
|
37
|
-
readonly effect: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "dark" | "light", unknown>;
|
|
38
92
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
93
|
export default _default;
|
|
@@ -1,80 +1,133 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { useNamespace as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { defineComponent as h, ref as C, computed as f, h as n, Transition as b, withDirectives as g, renderSlot as c, vShow as S } from "vue";
|
|
2
|
+
import { ElIcon as m } from "../icon/index.js";
|
|
3
|
+
import { useNamespace as E } from "../../hooks/use-namespace/index.js";
|
|
4
|
+
import "@vue/shared";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { keysOf as T } from "../../utils/objects.js";
|
|
8
|
+
import { TypeComponentsMap as d, TypeComponents as w } from "../../utils/vue/icon.js";
|
|
9
|
+
import { flattedChildren as k, isComment as x } from "../../utils/vue/vnode.js";
|
|
10
|
+
import { buildProps as B } from "../../utils/vue/props/runtime.js";
|
|
11
|
+
const I = ["light", "dark"], A = B({
|
|
12
|
+
/**
|
|
13
|
+
* @description alert title.
|
|
14
|
+
*/
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* @description alert type.
|
|
25
|
+
*/
|
|
26
|
+
type: {
|
|
27
|
+
type: String,
|
|
28
|
+
values: T(d),
|
|
29
|
+
default: "info"
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @description whether alert can be dismissed.
|
|
33
|
+
*/
|
|
34
|
+
closable: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* @description text for replacing x button
|
|
40
|
+
*/
|
|
41
|
+
closeText: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* @description whether show icon
|
|
47
|
+
*/
|
|
48
|
+
showIcon: Boolean,
|
|
49
|
+
/**
|
|
50
|
+
* @description should content be placed in center.
|
|
51
|
+
*/
|
|
52
|
+
center: Boolean,
|
|
53
|
+
effect: {
|
|
54
|
+
type: String,
|
|
55
|
+
values: I,
|
|
56
|
+
default: "light"
|
|
57
|
+
}
|
|
58
|
+
}), D = {
|
|
59
|
+
close: (e) => e instanceof MouseEvent
|
|
60
|
+
}, H = h({
|
|
8
61
|
name: "EpAlert",
|
|
9
|
-
props:
|
|
10
|
-
emits:
|
|
11
|
-
setup(
|
|
12
|
-
const { Close: v } =
|
|
13
|
-
var
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
return
|
|
17
|
-
}), s = (
|
|
18
|
-
a.value = !1,
|
|
62
|
+
props: A,
|
|
63
|
+
emits: D,
|
|
64
|
+
setup(e, { emit: p, slots: l }) {
|
|
65
|
+
const { Close: v } = w, t = E("alert"), a = C(!0), r = f(() => d[e.type]), i = f(() => {
|
|
66
|
+
var u;
|
|
67
|
+
if (e.description) return !0;
|
|
68
|
+
const o = (u = l.default) == null ? void 0 : u.call(l);
|
|
69
|
+
return o ? k(o).some((y) => !x(y)) : !1;
|
|
70
|
+
}), s = (o) => {
|
|
71
|
+
a.value = !1, p("close", o);
|
|
19
72
|
};
|
|
20
73
|
return () => n(
|
|
21
|
-
|
|
22
|
-
{ name:
|
|
74
|
+
b,
|
|
75
|
+
{ name: t.b("fade") },
|
|
23
76
|
{
|
|
24
77
|
default: () => [
|
|
25
|
-
|
|
78
|
+
g(
|
|
26
79
|
n(
|
|
27
80
|
"div",
|
|
28
81
|
{
|
|
29
82
|
class: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
83
|
+
t.b(),
|
|
84
|
+
t.m(e.type),
|
|
85
|
+
t.is("center", e.center),
|
|
86
|
+
t.is(e.effect)
|
|
34
87
|
],
|
|
35
88
|
role: "alert"
|
|
36
89
|
},
|
|
37
90
|
[
|
|
38
|
-
|
|
39
|
-
|
|
91
|
+
e.showIcon && (l.icon || r.value) ? n(
|
|
92
|
+
m,
|
|
40
93
|
{
|
|
41
|
-
class: [
|
|
94
|
+
class: [t.e("icon"), t.is("big", i.value)]
|
|
42
95
|
},
|
|
43
96
|
{
|
|
44
|
-
default: () =>
|
|
97
|
+
default: () => c(l, "icon", {}, () => [
|
|
45
98
|
n(r.value)
|
|
46
99
|
])
|
|
47
100
|
}
|
|
48
101
|
) : null,
|
|
49
|
-
n("div", { class:
|
|
50
|
-
|
|
102
|
+
n("div", { class: t.e("content") }, [
|
|
103
|
+
e.title || l.title ? n(
|
|
51
104
|
"span",
|
|
52
105
|
{
|
|
53
106
|
class: [
|
|
54
|
-
|
|
55
|
-
{ "with-description":
|
|
107
|
+
t.e("title"),
|
|
108
|
+
{ "with-description": i.value }
|
|
56
109
|
]
|
|
57
110
|
},
|
|
58
111
|
[
|
|
59
|
-
|
|
112
|
+
c(l, "title", {}, () => [e.title])
|
|
60
113
|
]
|
|
61
114
|
) : null,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
115
|
+
i.value ? n("p", { class: t.e("description") }, [
|
|
116
|
+
c(l, "default", {}, () => [
|
|
117
|
+
e.description
|
|
65
118
|
])
|
|
66
119
|
]) : null,
|
|
67
|
-
|
|
120
|
+
e.closable ? e.closeText ? n(
|
|
68
121
|
"div",
|
|
69
122
|
{
|
|
70
|
-
class: [
|
|
123
|
+
class: [t.e("close-btn"), t.is("customed")],
|
|
71
124
|
onClick: s
|
|
72
125
|
},
|
|
73
|
-
|
|
126
|
+
e.closeText
|
|
74
127
|
) : n(
|
|
75
|
-
|
|
128
|
+
m,
|
|
76
129
|
{
|
|
77
|
-
class:
|
|
130
|
+
class: t.e("close-btn"),
|
|
78
131
|
onClick: s
|
|
79
132
|
},
|
|
80
133
|
{ default: () => [n(v)] }
|
|
@@ -82,7 +135,7 @@ const j = p({
|
|
|
82
135
|
])
|
|
83
136
|
]
|
|
84
137
|
),
|
|
85
|
-
[[
|
|
138
|
+
[[S, a.value]]
|
|
86
139
|
)
|
|
87
140
|
]
|
|
88
141
|
}
|
|
@@ -90,5 +143,8 @@ const j = p({
|
|
|
90
143
|
}
|
|
91
144
|
});
|
|
92
145
|
export {
|
|
93
|
-
|
|
146
|
+
I as alertEffects,
|
|
147
|
+
D as alertEmits,
|
|
148
|
+
A as alertProps,
|
|
149
|
+
H as default
|
|
94
150
|
};
|