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
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
* 样式复用仓库内置的 theme-chalk/src/anchor.scss(命名空间为 el)。
|
|
4
4
|
*
|
|
5
5
|
* 注意:anchor 依赖 @vueuse/core 的 useEventListener,本仓库未直接依赖
|
|
6
|
-
* @vueuse/core,按 affix 的做法内联了精简实现。anchorKey
|
|
7
|
-
*
|
|
6
|
+
* @vueuse/core,按 affix 的做法内联了精简实现。anchorKey 已 vendor 到本地
|
|
7
|
+
* ./constants,与 EpAnchorLink 共用同一 Symbol,父子识别不受组件改名影响。
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
10
|
container: {
|
|
11
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
11
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null) | (((new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null)) | null)[], unknown, unknown>>;
|
|
12
12
|
readonly required: false;
|
|
13
13
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
14
|
__epPropKey: true;
|
|
15
15
|
};
|
|
16
|
-
offset: import("element-plus/
|
|
17
|
-
bound: import("element-plus/
|
|
18
|
-
duration: import("element-plus/
|
|
19
|
-
marker: import("element-plus/
|
|
20
|
-
type: import("element-plus/
|
|
21
|
-
direction: import("element-plus/
|
|
16
|
+
offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
17
|
+
bound: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
18
|
+
duration: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
19
|
+
marker: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
20
|
+
type: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | (((new (...args: any[]) => "default" | "underline") | (() => "default" | "underline")) | null)[], unknown, unknown, string, boolean>;
|
|
21
|
+
direction: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown, string, boolean>;
|
|
22
22
|
selectScrollTop: BooleanConstructor;
|
|
23
23
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
24
24
|
[key: string]: any;
|
|
@@ -27,26 +27,26 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
27
27
|
click: (e: MouseEvent, href?: string) => boolean;
|
|
28
28
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
29
|
container: {
|
|
30
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
30
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null) | (((new (...args: any[]) => string | Window | HTMLElement) | (() => string | Window | HTMLElement | null)) | null)[], unknown, unknown>>;
|
|
31
31
|
readonly required: false;
|
|
32
32
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
33
33
|
__epPropKey: true;
|
|
34
34
|
};
|
|
35
|
-
offset: import("element-plus/
|
|
36
|
-
bound: import("element-plus/
|
|
37
|
-
duration: import("element-plus/
|
|
38
|
-
marker: import("element-plus/
|
|
39
|
-
type: import("element-plus/
|
|
40
|
-
direction: import("element-plus/
|
|
35
|
+
offset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
36
|
+
bound: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
37
|
+
duration: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
38
|
+
marker: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
39
|
+
type: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | (((new (...args: any[]) => "default" | "underline") | (() => "default" | "underline")) | null)[], unknown, unknown, string, boolean>;
|
|
40
|
+
direction: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown, string, boolean>;
|
|
41
41
|
selectScrollTop: BooleanConstructor;
|
|
42
42
|
}>> & Readonly<{
|
|
43
43
|
onChange?: ((href: string) => any) | undefined;
|
|
44
44
|
onClick?: ((e: MouseEvent, href?: string | undefined) => any) | undefined;
|
|
45
45
|
}>, {
|
|
46
|
-
|
|
46
|
+
direction: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown>;
|
|
47
|
+
marker: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
47
48
|
offset: number;
|
|
48
|
-
|
|
49
|
-
direction: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | ((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | null)[], unknown, unknown>;
|
|
49
|
+
type: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | (((new (...args: any[]) => "default" | "underline") | (() => "default" | "underline")) | null)[], unknown, unknown>;
|
|
50
50
|
duration: number;
|
|
51
51
|
bound: number;
|
|
52
52
|
selectScrollTop: boolean;
|
|
@@ -1,153 +1,217 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CHANGE_EVENT as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { throttleByRaf as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineComponent as D, ref as m, computed as G, watch as y, onMounted as I, provide as K, h as C, renderSlot as V, nextTick as q } from "vue";
|
|
2
|
+
import { CHANGE_EVENT as F } from "../../constants/event.js";
|
|
3
|
+
import { isUndefined as O, isWindow as J } from "../../utils/types.js";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import { isString as B } from "@vue/shared";
|
|
7
|
+
import { throttleByRaf as Q } from "../../utils/throttleByRaf.js";
|
|
8
|
+
import { getElement as g } from "../../utils/dom/element.js";
|
|
9
|
+
import { getOffsetTopDistance as H } from "../../utils/dom/position.js";
|
|
10
|
+
import { getScrollElement as N, animateScrollTo as X, getScrollTop as M } from "../../utils/dom/scroll.js";
|
|
11
|
+
import "@element-plus/icons-vue";
|
|
12
|
+
import { buildProps as Y, definePropType as R } from "../../utils/vue/props/runtime.js";
|
|
13
|
+
import { useNamespace as Z } from "../../hooks/use-namespace/index.js";
|
|
14
|
+
import { anchorKey as ee } from "./constants.js";
|
|
15
|
+
const te = Y({
|
|
16
|
+
/**
|
|
17
|
+
* @description scroll container
|
|
18
|
+
*/
|
|
19
|
+
container: {
|
|
20
|
+
type: R([
|
|
21
|
+
String,
|
|
22
|
+
Object
|
|
23
|
+
])
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* @description Set the offset of the anchor scroll
|
|
27
|
+
*/
|
|
28
|
+
offset: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @description The offset of the element starting to trigger the anchor
|
|
34
|
+
*/
|
|
35
|
+
bound: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 15
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* @description Set the scroll duration of the container when the anchor is clicked, in milliseconds
|
|
41
|
+
*/
|
|
42
|
+
duration: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 300
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* @description Whether to show the marker
|
|
48
|
+
*/
|
|
49
|
+
marker: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
},
|
|
53
|
+
/**
|
|
54
|
+
* @description Set Anchor type
|
|
55
|
+
*/
|
|
56
|
+
type: {
|
|
57
|
+
type: R(String),
|
|
58
|
+
default: "default"
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* @description Set Anchor direction
|
|
62
|
+
*/
|
|
63
|
+
direction: {
|
|
64
|
+
type: R(String),
|
|
65
|
+
default: "vertical"
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* @description Scroll whether link is selected at the top
|
|
69
|
+
*/
|
|
70
|
+
selectScrollTop: Boolean
|
|
71
|
+
}), ne = {
|
|
72
|
+
change: (t) => B(t),
|
|
73
|
+
click: (t, l) => t instanceof MouseEvent && (B(l) || O(l))
|
|
74
|
+
};
|
|
75
|
+
function oe(t, l, u, p) {
|
|
76
|
+
const a = y(
|
|
13
77
|
() => {
|
|
14
|
-
const c =
|
|
78
|
+
const c = t.value;
|
|
15
79
|
return c instanceof Window, c;
|
|
16
80
|
},
|
|
17
|
-
(c,
|
|
18
|
-
c && (c.addEventListener(
|
|
81
|
+
(c, v, d) => {
|
|
82
|
+
c && (c.addEventListener(l, u, p), d(() => c.removeEventListener(l, u, p)));
|
|
19
83
|
},
|
|
20
84
|
{ immediate: !0 }
|
|
21
85
|
);
|
|
22
|
-
return () =>
|
|
86
|
+
return () => a();
|
|
23
87
|
}
|
|
24
|
-
const
|
|
88
|
+
const ye = D({
|
|
25
89
|
name: "EpAnchor",
|
|
26
|
-
props:
|
|
27
|
-
emits:
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
30
|
-
let
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]),
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
delete
|
|
39
|
-
},
|
|
40
|
-
|
|
90
|
+
props: te,
|
|
91
|
+
emits: ne,
|
|
92
|
+
setup(t, { emit: l, slots: u, expose: p }) {
|
|
93
|
+
const a = m(""), c = m({}), v = m(), d = m(), i = m(), h = {};
|
|
94
|
+
let k = !1, b = 0;
|
|
95
|
+
const s = Z("anchor"), P = G(() => [
|
|
96
|
+
s.b(),
|
|
97
|
+
t.type === "underline" ? s.m("underline") : "",
|
|
98
|
+
s.m(t.direction)
|
|
99
|
+
]), W = (e) => {
|
|
100
|
+
h[e.href] = e.el;
|
|
101
|
+
}, _ = (e) => {
|
|
102
|
+
delete h[e];
|
|
103
|
+
}, w = (e) => {
|
|
104
|
+
a.value !== e && (a.value = e, l(F, e));
|
|
41
105
|
};
|
|
42
|
-
let
|
|
43
|
-
const
|
|
106
|
+
let E = null, S = "";
|
|
107
|
+
const $ = (e) => {
|
|
44
108
|
if (!i.value) return;
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
if (
|
|
48
|
-
if (
|
|
49
|
-
|
|
109
|
+
const r = g(e);
|
|
110
|
+
if (!r) return;
|
|
111
|
+
if (E) {
|
|
112
|
+
if (S === e) return;
|
|
113
|
+
E();
|
|
50
114
|
}
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
115
|
+
S = e, k = !0;
|
|
116
|
+
const n = N(r, i.value), o = H(r, n), f = n.scrollHeight - n.clientHeight, z = Math.min(o - t.offset, f);
|
|
117
|
+
E = X(
|
|
54
118
|
i.value,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
119
|
+
b,
|
|
120
|
+
z,
|
|
121
|
+
t.duration,
|
|
58
122
|
() => {
|
|
59
123
|
setTimeout(() => {
|
|
60
|
-
|
|
124
|
+
k = !1, S = "";
|
|
61
125
|
}, 20);
|
|
62
126
|
}
|
|
63
127
|
);
|
|
64
|
-
},
|
|
65
|
-
e && (
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
},
|
|
128
|
+
}, T = (e) => {
|
|
129
|
+
e && (w(e), $(e));
|
|
130
|
+
}, j = (e, r) => {
|
|
131
|
+
l("click", e, r), T(r);
|
|
132
|
+
}, U = () => {
|
|
69
133
|
if (!i.value) return;
|
|
70
|
-
const e =
|
|
71
|
-
for (const
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
134
|
+
const e = M(i.value), r = [];
|
|
135
|
+
for (const n of Object.keys(h)) {
|
|
136
|
+
const o = g(n);
|
|
137
|
+
if (!o) continue;
|
|
138
|
+
const f = H(
|
|
139
|
+
o,
|
|
140
|
+
N(o, i.value)
|
|
77
141
|
);
|
|
78
|
-
|
|
79
|
-
top:
|
|
80
|
-
href:
|
|
142
|
+
r.push({
|
|
143
|
+
top: f - t.offset - t.bound,
|
|
144
|
+
href: n
|
|
81
145
|
});
|
|
82
146
|
}
|
|
83
|
-
|
|
84
|
-
for (let
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
147
|
+
r.sort((n, o) => n.top - o.top);
|
|
148
|
+
for (let n = 0; n < r.length; n++) {
|
|
149
|
+
const o = r[n], f = r[n + 1];
|
|
150
|
+
if (n === 0 && e === 0)
|
|
151
|
+
return t.selectScrollTop ? o.href : "";
|
|
152
|
+
if (o.top <= e && (!f || f.top > e))
|
|
153
|
+
return o.href;
|
|
90
154
|
}
|
|
91
|
-
}, x =
|
|
92
|
-
i.value && (
|
|
93
|
-
const e =
|
|
94
|
-
|
|
155
|
+
}, x = Q(() => {
|
|
156
|
+
i.value && (b = M(i.value));
|
|
157
|
+
const e = U();
|
|
158
|
+
k || O(e) || w(e);
|
|
95
159
|
}), A = () => {
|
|
96
|
-
const e = g(
|
|
97
|
-
!e ||
|
|
160
|
+
const e = g(t.container);
|
|
161
|
+
!e || J(e) ? i.value = window : i.value = e;
|
|
98
162
|
};
|
|
99
|
-
|
|
163
|
+
oe(i, "scroll", x);
|
|
100
164
|
const L = () => {
|
|
101
|
-
|
|
102
|
-
if (!
|
|
165
|
+
q(() => {
|
|
166
|
+
if (!v.value || !d.value || !a.value) {
|
|
103
167
|
c.value = {};
|
|
104
168
|
return;
|
|
105
169
|
}
|
|
106
|
-
const e =
|
|
170
|
+
const e = h[a.value];
|
|
107
171
|
if (!e) {
|
|
108
172
|
c.value = {};
|
|
109
173
|
return;
|
|
110
174
|
}
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
left: `${
|
|
114
|
-
width: `${
|
|
175
|
+
const r = v.value.getBoundingClientRect(), n = d.value.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
176
|
+
t.direction === "horizontal" ? c.value = {
|
|
177
|
+
left: `${o.left - r.left}px`,
|
|
178
|
+
width: `${o.width}px`,
|
|
115
179
|
opacity: 1
|
|
116
180
|
} : c.value = {
|
|
117
|
-
top: `${
|
|
181
|
+
top: `${o.top - r.top + (o.height - n.height) / 2}px`,
|
|
118
182
|
opacity: 1
|
|
119
183
|
};
|
|
120
184
|
});
|
|
121
185
|
};
|
|
122
|
-
return
|
|
186
|
+
return y(a, L), y(() => {
|
|
123
187
|
var e;
|
|
124
|
-
return (e =
|
|
125
|
-
}, L),
|
|
188
|
+
return (e = u.default) == null ? void 0 : e.call(u);
|
|
189
|
+
}, L), I(() => {
|
|
126
190
|
A();
|
|
127
191
|
const e = decodeURIComponent(window.location.hash);
|
|
128
|
-
g(e) ?
|
|
129
|
-
}),
|
|
130
|
-
() =>
|
|
192
|
+
g(e) ? T(e) : x();
|
|
193
|
+
}), y(
|
|
194
|
+
() => t.container,
|
|
131
195
|
() => {
|
|
132
196
|
A();
|
|
133
197
|
}
|
|
134
|
-
),
|
|
135
|
-
ns:
|
|
136
|
-
direction:
|
|
137
|
-
currentAnchor:
|
|
138
|
-
addLink:
|
|
139
|
-
removeLink:
|
|
140
|
-
handleClick:
|
|
141
|
-
}),
|
|
142
|
-
|
|
143
|
-
ref:
|
|
144
|
-
class:
|
|
198
|
+
), K(ee, {
|
|
199
|
+
ns: s,
|
|
200
|
+
direction: t.direction,
|
|
201
|
+
currentAnchor: a,
|
|
202
|
+
addLink: W,
|
|
203
|
+
removeLink: _,
|
|
204
|
+
handleClick: j
|
|
205
|
+
}), p({ scrollTo: T }), () => C("div", { ref: v, class: P.value }, [
|
|
206
|
+
t.marker ? C("div", {
|
|
207
|
+
ref: d,
|
|
208
|
+
class: s.e("marker"),
|
|
145
209
|
style: c.value
|
|
146
210
|
}) : null,
|
|
147
|
-
|
|
211
|
+
C("div", { class: s.e("list") }, [V(u, "default")])
|
|
148
212
|
]);
|
|
149
213
|
}
|
|
150
214
|
});
|
|
151
215
|
export {
|
|
152
|
-
|
|
216
|
+
ye as default
|
|
153
217
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { UseNamespaceReturn } from '@element-plus/hooks';
|
|
3
|
+
export interface AnchorLinkState {
|
|
4
|
+
el: HTMLElement;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AnchorContext {
|
|
8
|
+
ns: UseNamespaceReturn;
|
|
9
|
+
direction: string;
|
|
10
|
+
currentAnchor: Ref<string>;
|
|
11
|
+
addLink(state: AnchorLinkState): void;
|
|
12
|
+
removeLink(href: string): void;
|
|
13
|
+
handleClick(e: MouseEvent, href?: string): void;
|
|
14
|
+
}
|
|
15
|
+
export declare const anchorKey: InjectionKey<AnchorContext>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 样式复用仓库内置的 theme-chalk/src/anchor.scss(命名空间为 el)。
|
|
4
4
|
*
|
|
5
5
|
* 通过 inject(anchorKey) 识别父级 EpAnchor,anchorKey 与 EpAnchor 共用
|
|
6
|
-
*
|
|
6
|
+
* 本地 ../anchor/constants 中的同一 Symbol,父子识别不受组件改名影响。
|
|
7
7
|
*/
|
|
8
8
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
9
9
|
title: StringConstructor;
|
|
@@ -1,51 +1,64 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as k, ref as v, inject as p, computed as C, watch as L, nextTick as b, onMounted as x, onBeforeUnmount as A, h as o, renderSlot as a } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { buildProps as S } from "../../utils/vue/props/runtime.js";
|
|
7
|
+
import { anchorKey as g } from "../anchor/constants.js";
|
|
8
|
+
const E = S({
|
|
9
|
+
/**
|
|
10
|
+
* @description the text content of the anchor link
|
|
11
|
+
*/
|
|
12
|
+
title: String,
|
|
13
|
+
/**
|
|
14
|
+
* @description The address of the anchor link
|
|
15
|
+
*/
|
|
16
|
+
href: String
|
|
17
|
+
}), M = k({
|
|
5
18
|
name: "EpAnchorLink",
|
|
6
|
-
props:
|
|
19
|
+
props: E,
|
|
7
20
|
setup(n, { slots: t }) {
|
|
8
|
-
const
|
|
21
|
+
const r = v(), {
|
|
9
22
|
ns: i,
|
|
10
23
|
direction: h,
|
|
11
|
-
currentAnchor:
|
|
12
|
-
addLink:
|
|
24
|
+
currentAnchor: m,
|
|
25
|
+
addLink: c,
|
|
13
26
|
removeLink: l,
|
|
14
|
-
handleClick:
|
|
15
|
-
} =
|
|
27
|
+
handleClick: u
|
|
28
|
+
} = p(g), s = C(() => [
|
|
16
29
|
i.e("link"),
|
|
17
|
-
i.is("active",
|
|
18
|
-
]),
|
|
19
|
-
|
|
30
|
+
i.is("active", m.value === n.href)
|
|
31
|
+
]), d = (e) => {
|
|
32
|
+
u(e, n.href);
|
|
20
33
|
};
|
|
21
|
-
return
|
|
34
|
+
return L(
|
|
22
35
|
() => n.href,
|
|
23
36
|
(e, f) => {
|
|
24
|
-
|
|
25
|
-
f && l(f), e &&
|
|
37
|
+
b(() => {
|
|
38
|
+
f && l(f), e && c({ href: e, el: r.value });
|
|
26
39
|
});
|
|
27
40
|
}
|
|
28
|
-
),
|
|
41
|
+
), x(() => {
|
|
29
42
|
const { href: e } = n;
|
|
30
|
-
e &&
|
|
31
|
-
}),
|
|
43
|
+
e && c({ href: e, el: r.value });
|
|
44
|
+
}), A(() => {
|
|
32
45
|
const { href: e } = n;
|
|
33
46
|
e && l(e);
|
|
34
|
-
}), () =>
|
|
35
|
-
|
|
47
|
+
}), () => o("div", { class: i.e("item") }, [
|
|
48
|
+
o(
|
|
36
49
|
"a",
|
|
37
50
|
{
|
|
38
|
-
ref:
|
|
39
|
-
class:
|
|
51
|
+
ref: r,
|
|
52
|
+
class: s.value,
|
|
40
53
|
href: n.href,
|
|
41
|
-
onClick:
|
|
54
|
+
onClick: d
|
|
42
55
|
},
|
|
43
56
|
[a(t, "default", {}, () => [n.title])]
|
|
44
57
|
),
|
|
45
|
-
t["sub-link"] && h === "vertical" ?
|
|
58
|
+
t["sub-link"] && h === "vertical" ? o("div", { class: i.e("list") }, [a(t, "sub-link")]) : null
|
|
46
59
|
]);
|
|
47
60
|
}
|
|
48
61
|
});
|
|
49
62
|
export {
|
|
50
|
-
|
|
63
|
+
M as default
|
|
51
64
|
};
|
|
@@ -65,7 +65,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
65
65
|
};
|
|
66
66
|
}>, {
|
|
67
67
|
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
68
|
-
size: import("vue").ComputedRef<"" | "
|
|
68
|
+
size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
|
69
69
|
type: import("vue").ComputedRef<any>;
|
|
70
70
|
disabled: import("vue").ComputedRef<boolean>;
|
|
71
71
|
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
@@ -131,22 +131,22 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
131
131
|
}>> & Readonly<{
|
|
132
132
|
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
133
133
|
}>, {
|
|
134
|
-
readonly type: "" | "default" | "text" | "primary" | "success" | "info" | "warning" | "danger";
|
|
135
134
|
readonly link: boolean;
|
|
136
|
-
readonly disabled: boolean;
|
|
137
|
-
readonly circle: boolean;
|
|
138
135
|
readonly text: boolean;
|
|
136
|
+
readonly round: boolean;
|
|
137
|
+
readonly dashed: boolean;
|
|
139
138
|
readonly dark: boolean;
|
|
140
|
-
readonly
|
|
139
|
+
readonly circle: boolean;
|
|
140
|
+
readonly disabled: boolean;
|
|
141
|
+
readonly type: "" | "default" | "text" | "primary" | "success" | "warning" | "info" | "danger";
|
|
141
142
|
readonly loading: boolean;
|
|
143
|
+
readonly tag: string | object;
|
|
144
|
+
readonly autofocus: boolean;
|
|
142
145
|
readonly nativeType: "button" | "reset" | "submit";
|
|
143
146
|
readonly loadingIcon: any;
|
|
144
147
|
readonly plain: boolean;
|
|
145
148
|
readonly bg: boolean;
|
|
146
|
-
readonly round: boolean;
|
|
147
|
-
readonly dashed: boolean;
|
|
148
149
|
readonly autoInsertSpace: boolean;
|
|
149
|
-
readonly tag: string | object;
|
|
150
150
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
151
151
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
152
152
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as L, useSlots as M, inject as O, computed as o, ref as Q, Text as R, openBlock as n, createBlock as u, resolveDynamicComponent as m, mergeProps as W, unref as f, withCtx as v, createElementBlock as E, Fragment as X, renderSlot as g, normalizeClass as z, createCommentVNode as F } from "vue";
|
|
2
|
-
import { ElIcon as Y } from "
|
|
3
|
-
import { useFormSize as Z, useFormDisabled as G } from "
|
|
4
|
-
import { useFormItem as x } from "
|
|
5
|
-
import { useGlobalConfig as ee } from "
|
|
6
|
-
import { buttonGroupContextKey as te } from "
|
|
2
|
+
import { ElIcon as Y } from "../icon/index.js";
|
|
3
|
+
import { useFormSize as Z, useFormDisabled as G } from "../form/src/hooks/use-form-common-props.js";
|
|
4
|
+
import { useFormItem as x } from "../form/src/hooks/use-form-item.js";
|
|
5
|
+
import { useGlobalConfig as ee } from "../config-provider/src/hooks/use-global-config.js";
|
|
6
|
+
import { buttonGroupContextKey as te } from "./constants.js";
|
|
7
7
|
import { buttonEmits as oe, buttonProps as se } from "./button.js";
|
|
8
8
|
import { useButtonCustomStyle as ne } from "./use-button-custom.js";
|
|
9
9
|
const y = "el", b = "button", me = /* @__PURE__ */ L({
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
import type { ButtonProps } from './button';
|
|
3
|
+
export interface ButtonGroupContext {
|
|
4
|
+
size?: ButtonProps['size'];
|
|
5
|
+
type?: ButtonProps['type'];
|
|
6
|
+
}
|
|
7
|
+
export declare const buttonGroupContextKey: InjectionKey<ButtonGroupContext>;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
25
25
|
onChange?: ((value: boolean) => any) | undefined;
|
|
26
26
|
"onUpdate:checked"?: ((value: boolean) => any) | undefined;
|
|
27
27
|
}>, {
|
|
28
|
-
readonly type: "primary" | "success" | "info" | "warning" | "danger";
|
|
29
28
|
readonly disabled: boolean;
|
|
29
|
+
readonly type: "primary" | "success" | "warning" | "info" | "danger";
|
|
30
30
|
readonly checked: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
32
32
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -6,8 +6,8 @@ import "@element-plus/icons-vue";
|
|
|
6
6
|
import "vue";
|
|
7
7
|
import { withInstall as i } from "../../utils/vue/install.js";
|
|
8
8
|
import t from "./src/collapse-transition.vue.js";
|
|
9
|
-
i(t);
|
|
10
|
-
const f = o(t, "ep-collapse-transition");
|
|
9
|
+
const c = i(t), f = o(t, "ep-collapse-transition");
|
|
11
10
|
export {
|
|
11
|
+
c as ElCollapseTransition,
|
|
12
12
|
f as EpCollapseTransition
|
|
13
13
|
};
|
|
@@ -27,6 +27,6 @@ export declare function useGlobalComponentSettings(block: string, sizeFallback?:
|
|
|
27
27
|
currentZIndex: import("vue").ComputedRef<number>;
|
|
28
28
|
nextZIndex: () => number;
|
|
29
29
|
};
|
|
30
|
-
size: import("vue").ComputedRef<"" | "
|
|
30
|
+
size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
|
31
31
|
};
|
|
32
32
|
export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContext>, app?: App, global?: boolean) => import("vue").ComputedRef<ConfigProviderContext> | undefined;
|