ep-craft 0.1.18 → 0.1.20

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.
Files changed (31) hide show
  1. package/dist/components/affix/affix.d.ts +55 -0
  2. package/dist/components/affix/affix.js +199 -0
  3. package/dist/components/affix/index.d.ts +2 -2
  4. package/dist/components/affix/index.js +3 -4
  5. package/dist/components/alert/alert.d.ts +39 -0
  6. package/dist/components/alert/alert.js +94 -0
  7. package/dist/components/alert/index.d.ts +2 -2
  8. package/dist/components/alert/index.js +3 -4
  9. package/dist/components/anchor/anchor.d.ts +54 -0
  10. package/dist/components/anchor/anchor.js +153 -0
  11. package/dist/components/anchor/index.d.ts +2 -2
  12. package/dist/components/anchor/index.js +3 -4
  13. package/dist/components/anchor-link/anchor-link.d.ts +17 -0
  14. package/dist/components/anchor-link/anchor-link.js +51 -0
  15. package/dist/components/anchor-link/index.d.ts +2 -2
  16. package/dist/components/anchor-link/index.js +6 -4
  17. package/dist/components/button/EpButton.vue.d.ts +7 -7
  18. package/dist/components/check-tag/EpCheckTag.vue.d.ts +1 -1
  19. package/dist/components/menu/menu.d.ts +6 -6
  20. package/dist/components/radio/radio.d.ts +2 -2
  21. package/dist/components/radio/radio.js +49 -37
  22. package/dist/components/radio-button/radio-button.d.ts +2 -2
  23. package/dist/components/radio-group/radio-group.d.ts +2 -2
  24. package/dist/components/tab-pane/tab-pane.d.ts +2 -2
  25. package/dist/components/tabs/tabs.d.ts +1 -1
  26. package/dist/components/tag/EpTag.vue.d.ts +4 -4
  27. package/dist/index.css +1 -1
  28. package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/anchor/src/anchor.vue_vue_type_script_setup_true_lang.js +8 -8
  29. package/package.json +1 -1
  30. package/theme-chalk/src/common/var.scss +11 -10
  31. package/theme-chalk/src/radio.scss +41 -56
@@ -0,0 +1,55 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ export declare const affixProps: {
3
+ readonly zIndex: import("element-plus/es/utils/index.mjs").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/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
5
+ readonly offset: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
6
+ readonly position: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
7
+ readonly teleported: BooleanConstructor;
8
+ readonly appendTo: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
9
+ };
10
+ export type AffixProps = ExtractPropTypes<typeof affixProps>;
11
+ export declare const affixEmits: {
12
+ scroll: ({ scrollTop, fixed }: {
13
+ scrollTop: number;
14
+ fixed: boolean;
15
+ }) => boolean;
16
+ change: (fixed: boolean) => boolean;
17
+ };
18
+ export type AffixEmits = typeof affixEmits;
19
+ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
20
+ readonly zIndex: import("element-plus/es/utils/index.mjs").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/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
22
+ readonly offset: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
23
+ readonly position: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
24
+ readonly teleported: BooleanConstructor;
25
+ readonly appendTo: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
26
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
27
+ [key: string]: any;
28
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
+ scroll: ({ scrollTop, fixed }: {
30
+ scrollTop: number;
31
+ fixed: boolean;
32
+ }) => boolean;
33
+ change: (fixed: boolean) => boolean;
34
+ }, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
35
+ readonly zIndex: import("element-plus/es/utils/index.mjs").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/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
37
+ readonly offset: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
38
+ readonly position: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "top", boolean>;
39
+ readonly teleported: BooleanConstructor;
40
+ readonly appendTo: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown, "body", boolean>;
41
+ }>> & Readonly<{
42
+ onChange?: ((fixed: boolean) => any) | undefined;
43
+ onScroll?: ((args_0: {
44
+ scrollTop: number;
45
+ fixed: boolean;
46
+ }) => any) | undefined;
47
+ }>, {
48
+ readonly zIndex: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number) | (((new (...args: any[]) => string | number) | (() => string | number)) | null)[], unknown, unknown>;
49
+ readonly target: string;
50
+ readonly offset: number;
51
+ readonly position: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
52
+ readonly appendTo: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement) | (((new (...args: any[]) => string | HTMLElement) | (() => string | HTMLElement)) | null)[], unknown, unknown>;
53
+ readonly teleported: boolean;
54
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
55
+ export default _default;
@@ -0,0 +1,199 @@
1
+ import { defineComponent as D, shallowRef as s, 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 "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/event.js";
3
+ import { isBoolean as W, isNumber as G } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/types.js";
4
+ import { throwError as U } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/error.js";
5
+ import { addUnit as J } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/style.js";
6
+ import { getScrollContainer as K } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/scroll.js";
7
+ import { buildProps as Q, definePropType as A } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/props/runtime.js";
8
+ import { useNamespace as X } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
9
+ const Z = (e) => {
10
+ const t = (e == null ? void 0 : e.value) ?? e;
11
+ return t && typeof t == "object" && "$el" in t ? t.$el : t;
12
+ }, ee = (e, t) => {
13
+ let n;
14
+ const o = E(
15
+ e,
16
+ (i) => {
17
+ n == null || n.disconnect(), n = void 0, i && typeof ResizeObserver < "u" && (n = new ResizeObserver(t), n.observe(i));
18
+ },
19
+ { immediate: !0, flush: "post" }
20
+ );
21
+ return {
22
+ stop: () => {
23
+ n == null || n.disconnect(), o();
24
+ }
25
+ };
26
+ }, te = (e, t, n) => {
27
+ let o;
28
+ const i = E(
29
+ e,
30
+ (u) => {
31
+ o == null || o.disconnect(), o = void 0, u && typeof MutationObserver < "u" && (o = new MutationObserver(t), o.observe(u, n));
32
+ },
33
+ { immediate: !0, flush: "post" }
34
+ );
35
+ return {
36
+ stop: () => {
37
+ o == null || o.disconnect(), i();
38
+ }
39
+ };
40
+ };
41
+ function y(...e) {
42
+ const t = typeof e[0] == "string", n = t ? void 0 : e[0], o = t ? e[0] : e[1], i = t ? e[1] : e[2], u = t ? e[2] : e[3], r = E(
43
+ () => {
44
+ if (t) return window;
45
+ const l = n.value;
46
+ return l instanceof Window, l;
47
+ },
48
+ (l, c, f) => {
49
+ l && (l.addEventListener(o, i, u), f(() => l.removeEventListener(o, i, u)));
50
+ },
51
+ { immediate: !0 }
52
+ );
53
+ return () => r();
54
+ }
55
+ const oe = () => {
56
+ const e = s(Number.POSITIVE_INFINITY), t = () => {
57
+ e.value = window.innerHeight;
58
+ };
59
+ return t(), y("resize", t, { passive: !0 }), { height: e };
60
+ }, B = (e, t = {}) => {
61
+ const { windowScroll: n = !0, windowResize: o = !0 } = t, i = s(0), u = s(0), r = s(0), l = s(0), c = s(0), f = s(0), d = () => {
62
+ const m = Z(e);
63
+ if (!m) {
64
+ i.value = 0, u.value = 0, r.value = 0, l.value = 0, c.value = 0, f.value = 0;
65
+ return;
66
+ }
67
+ const v = m.getBoundingClientRect();
68
+ i.value = v.height, u.value = v.bottom, r.value = v.left, l.value = v.right, c.value = v.top, f.value = v.width;
69
+ };
70
+ 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: i, bottom: u, left: r, right: l, top: c, width: f, update: d };
71
+ }, ne = Q({
72
+ /** affix element zIndex value */
73
+ zIndex: {
74
+ type: A([Number, String]),
75
+ default: 100
76
+ },
77
+ /** target container. (CSS selector) */
78
+ target: {
79
+ type: String,
80
+ default: ""
81
+ },
82
+ /** offset distance */
83
+ offset: {
84
+ type: Number,
85
+ default: 0
86
+ },
87
+ /** position of affix */
88
+ position: {
89
+ type: String,
90
+ values: ["top", "bottom"],
91
+ default: "top"
92
+ },
93
+ /** whether affix element is teleported, if `true` it will be teleported to where `append-to` sets */
94
+ teleported: Boolean,
95
+ /** which element the affix element appends to */
96
+ appendTo: {
97
+ type: A([String, Object]),
98
+ default: "body"
99
+ }
100
+ }), le = {
101
+ scroll: ({ scrollTop: e, fixed: t }) => G(e) && W(t),
102
+ [H]: (e) => W(e)
103
+ }, ve = D({
104
+ name: "EpAffix",
105
+ props: ne,
106
+ emits: le,
107
+ setup(e, { emit: t, slots: n, expose: o }) {
108
+ const i = X("affix"), u = s(), r = s(), l = s(), { height: c } = oe(), {
109
+ height: f,
110
+ width: d,
111
+ top: m,
112
+ bottom: v,
113
+ left: L,
114
+ update: g
115
+ } = B(r, { windowScroll: !1 }), b = B(u), a = S(!1), N = S(0), x = S(0), M = T(() => !e.teleported || !a.value), P = T(() => ({
116
+ display: "flow-root",
117
+ height: a.value ? `${f.value}px` : "",
118
+ width: a.value ? `${d.value}px` : ""
119
+ })), _ = T(() => {
120
+ if (!a.value) return {};
121
+ const p = J(e.offset);
122
+ return {
123
+ height: `${f.value}px`,
124
+ width: `${d.value}px`,
125
+ top: e.position === "top" ? p : "",
126
+ bottom: e.position === "bottom" ? p : "",
127
+ left: e.teleported ? `${L.value}px` : "",
128
+ transform: x.value ? `translateY(${x.value}px)` : "",
129
+ zIndex: e.zIndex
130
+ };
131
+ }), O = () => {
132
+ if (!l.value) return;
133
+ N.value = l.value instanceof Window ? document.documentElement.scrollTop : l.value.scrollTop || 0;
134
+ const { position: p, offset: h } = e, I = h + f.value;
135
+ if (p === "top")
136
+ if (e.target) {
137
+ const w = b.bottom.value - I;
138
+ a.value = h > m.value && b.bottom.value > 0, x.value = w < 0 ? w : 0;
139
+ } else
140
+ a.value = h > m.value;
141
+ else if (e.target) {
142
+ const w = c.value - b.top.value - I;
143
+ a.value = c.value - h < v.value && c.value > b.top.value, x.value = w < 0 ? -w : 0;
144
+ } else
145
+ a.value = c.value - h < v.value;
146
+ }, $ = async () => {
147
+ if (!a.value) {
148
+ g();
149
+ return;
150
+ }
151
+ a.value = !1, await R(), g(), a.value = !0;
152
+ }, j = async () => {
153
+ g(), await R(), t("scroll", {
154
+ scrollTop: N.value,
155
+ fixed: a.value
156
+ });
157
+ };
158
+ return E(a, (p) => t(H, p)), C(() => {
159
+ e.target ? (u.value = document.querySelector(e.target) ?? void 0, u.value || U("EpAffix", `Target does not exist: ${e.target}`)) : u.value = document.documentElement, l.value = K(r.value, !0), g();
160
+ }), F(() => {
161
+ R($);
162
+ }), V(() => {
163
+ a.value = !1;
164
+ }), y(l, "scroll", j), Y(O), o({
165
+ /** update affix status */
166
+ update: O,
167
+ /** update rootRect info */
168
+ updateRoot: $
169
+ }), () => z(
170
+ "div",
171
+ {
172
+ ref: r,
173
+ class: i.b(),
174
+ style: P.value
175
+ },
176
+ [
177
+ z(
178
+ k,
179
+ { disabled: M.value, to: e.appendTo },
180
+ [
181
+ z(
182
+ "div",
183
+ {
184
+ class: { [i.m("fixed")]: a.value },
185
+ style: _.value
186
+ },
187
+ [q(n, "default")]
188
+ )
189
+ ]
190
+ )
191
+ ]
192
+ );
193
+ }
194
+ });
195
+ export {
196
+ le as affixEmits,
197
+ ne as affixProps,
198
+ ve as default
199
+ };
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElAffix } from 'element-plus';
3
- export declare const EpAffix: typeof ElAffix & Plugin;
2
+ import _EpAffix from './affix';
3
+ export declare const EpAffix: typeof _EpAffix & Plugin;
4
4
  export default EpAffix;
@@ -1,7 +1,6 @@
1
- import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
2
1
  import { withInstall as f } from "../../utils/with-install.js";
3
- import { ElAffix as i } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/affix/index.js";
4
- const t = Object.assign({}, i, { name: "EpAffix" }), r = f(t, "ep-affix");
2
+ import i from "./affix.js";
3
+ const t = f(i, "ep-affix");
5
4
  export {
6
- r as EpAffix
5
+ t as EpAffix
7
6
  };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * EpAlert —— 从 element-plus 的 alert 源码 vendored 而来(el -> ep 命名),
3
+ * 样式复用仓库内置的 theme-chalk/src/alert.scss(命名空间为 el)。
4
+ */
5
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ readonly title: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
7
+ readonly description: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
8
+ readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "info" | "warning", unknown, "info", boolean>;
9
+ readonly closable: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
10
+ readonly closeText: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
11
+ readonly showIcon: BooleanConstructor;
12
+ readonly center: BooleanConstructor;
13
+ readonly effect: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "dark" | "light", unknown, "light", boolean>;
14
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
15
+ [key: string]: any;
16
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ close: (evt: MouseEvent) => boolean;
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ readonly title: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
20
+ readonly description: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
21
+ readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "error" | "primary" | "success" | "info" | "warning", unknown, "info", boolean>;
22
+ readonly closable: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
23
+ readonly closeText: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
24
+ readonly showIcon: BooleanConstructor;
25
+ readonly center: BooleanConstructor;
26
+ readonly effect: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "dark" | "light", unknown, "light", boolean>;
27
+ }>> & Readonly<{
28
+ onClose?: ((evt: MouseEvent) => any) | undefined;
29
+ }>, {
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
+ readonly description: string;
34
+ readonly closable: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
35
+ readonly closeText: string;
36
+ readonly showIcon: boolean;
37
+ readonly effect: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "dark" | "light", unknown>;
38
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
39
+ export default _default;
@@ -0,0 +1,94 @@
1
+ import { defineComponent as p, ref as b, computed as u, h as n, Transition as h, withDirectives as T, renderSlot as o, vShow as w } from "vue";
2
+ import { alertEmits as y, alertProps as E } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/alert/src/alert.js";
3
+ import { useNamespace as x } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
4
+ import { ElIcon as f } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.js";
5
+ import { TypeComponentsMap as k, TypeComponents as A } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/icon.js";
6
+ import { flattedChildren as D, isComment as I } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/vue/vnode.js";
7
+ const j = p({
8
+ name: "EpAlert",
9
+ props: E,
10
+ emits: y,
11
+ setup(t, { emit: d, slots: l }) {
12
+ const { Close: v } = A, e = x("alert"), a = b(!0), r = u(() => k[t.type]), c = u(() => {
13
+ var m;
14
+ if (t.description) return !0;
15
+ const i = (m = l.default) == null ? void 0 : m.call(l);
16
+ return i ? D(i).some((C) => !I(C)) : !1;
17
+ }), s = (i) => {
18
+ a.value = !1, d("close", i);
19
+ };
20
+ return () => n(
21
+ h,
22
+ { name: e.b("fade") },
23
+ {
24
+ default: () => [
25
+ T(
26
+ n(
27
+ "div",
28
+ {
29
+ class: [
30
+ e.b(),
31
+ e.m(t.type),
32
+ e.is("center", t.center),
33
+ e.is(t.effect)
34
+ ],
35
+ role: "alert"
36
+ },
37
+ [
38
+ t.showIcon && (l.icon || r.value) ? n(
39
+ f,
40
+ {
41
+ class: [e.e("icon"), e.is("big", c.value)]
42
+ },
43
+ {
44
+ default: () => o(l, "icon", {}, () => [
45
+ n(r.value)
46
+ ])
47
+ }
48
+ ) : null,
49
+ n("div", { class: e.e("content") }, [
50
+ t.title || l.title ? n(
51
+ "span",
52
+ {
53
+ class: [
54
+ e.e("title"),
55
+ { "with-description": c.value }
56
+ ]
57
+ },
58
+ [
59
+ o(l, "title", {}, () => [t.title])
60
+ ]
61
+ ) : null,
62
+ c.value ? n("p", { class: e.e("description") }, [
63
+ o(l, "default", {}, () => [
64
+ t.description
65
+ ])
66
+ ]) : null,
67
+ t.closable ? t.closeText ? n(
68
+ "div",
69
+ {
70
+ class: [e.e("close-btn"), e.is("customed")],
71
+ onClick: s
72
+ },
73
+ t.closeText
74
+ ) : n(
75
+ f,
76
+ {
77
+ class: e.e("close-btn"),
78
+ onClick: s
79
+ },
80
+ { default: () => [n(v)] }
81
+ ) : null
82
+ ])
83
+ ]
84
+ ),
85
+ [[w, a.value]]
86
+ )
87
+ ]
88
+ }
89
+ );
90
+ }
91
+ });
92
+ export {
93
+ j as default
94
+ };
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElAlert } from 'element-plus';
3
- export declare const EpAlert: typeof ElAlert & Plugin;
2
+ import _EpAlert from './alert';
3
+ export declare const EpAlert: typeof _EpAlert & Plugin;
4
4
  export default EpAlert;
@@ -1,7 +1,6 @@
1
- import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
2
1
  import { withInstall as t } from "../../utils/with-install.js";
3
- import { ElAlert as r } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/alert/index.js";
4
- const e = Object.assign({}, r, { name: "EpAlert" }), m = t(e, "ep-alert");
2
+ import r from "./alert.js";
3
+ const e = t(r, "ep-alert");
5
4
  export {
6
- m as EpAlert
5
+ e as EpAlert
7
6
  };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * EpAnchor —— 从 element-plus 的 anchor 源码 vendored 而来(el -> ep 命名),
3
+ * 样式复用仓库内置的 theme-chalk/src/anchor.scss(命名空间为 el)。
4
+ *
5
+ * 注意:anchor 依赖 @vueuse/core 的 useEventListener,本仓库未直接依赖
6
+ * @vueuse/core,按 affix 的做法内联了精简实现。anchorKey 与 EpAnchorLink
7
+ * 共用 element-plus constants.mjs 中的同一 Symbol,父子识别不受组件改名影响。
8
+ */
9
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ container: {
11
+ readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").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
+ readonly required: false;
13
+ readonly validator: ((val: unknown) => boolean) | undefined;
14
+ __epPropKey: true;
15
+ };
16
+ offset: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
17
+ bound: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
18
+ duration: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
19
+ marker: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
20
+ type: import("element-plus/es/utils/index.mjs").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/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown, string, boolean>;
22
+ selectScrollTop: BooleanConstructor;
23
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
+ [key: string]: any;
25
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ change: (href: string) => boolean;
27
+ click: (e: MouseEvent, href?: string) => boolean;
28
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ container: {
30
+ readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").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
+ readonly required: false;
32
+ readonly validator: ((val: unknown) => boolean) | undefined;
33
+ __epPropKey: true;
34
+ };
35
+ offset: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
36
+ bound: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
37
+ duration: import("element-plus/es/utils/index.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
38
+ marker: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
39
+ type: import("element-plus/es/utils/index.mjs").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/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | (((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical")) | null)[], unknown, unknown, string, boolean>;
41
+ selectScrollTop: BooleanConstructor;
42
+ }>> & Readonly<{
43
+ onChange?: ((href: string) => any) | undefined;
44
+ onClick?: ((e: MouseEvent, href?: string | undefined) => any) | undefined;
45
+ }>, {
46
+ type: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | ((new (...args: any[]) => "default" | "underline") | (() => "default" | "underline") | null)[], unknown, unknown>;
47
+ offset: number;
48
+ marker: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
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>;
50
+ duration: number;
51
+ bound: number;
52
+ selectScrollTop: boolean;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
+ export default _default;
@@ -0,0 +1,153 @@
1
+ import { defineComponent as j, ref as d, computed as z, watch as k, onMounted as D, provide as G, h as S, renderSlot as I, nextTick as K } from "vue";
2
+ import { CHANGE_EVENT as P } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/event.js";
3
+ import { getOffsetTopDistance as H } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/position.js";
4
+ import { isWindow as V, isUndefined as q } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/types.js";
5
+ import { getScrollElement as B, animateScrollTo as F, getScrollTop as b } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/scroll.js";
6
+ import { getElement as g } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/element.js";
7
+ import { throttleByRaf as J } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/throttleByRaf.js";
8
+ import { useNamespace as Q } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
9
+ import { anchorEmits as X, anchorProps as Y } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/anchor/src/anchor.js";
10
+ import { anchorKey as Z } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/anchor/src/constants.js";
11
+ function ee(r, f, a, v) {
12
+ const l = k(
13
+ () => {
14
+ const c = r.value;
15
+ return c instanceof Window, c;
16
+ },
17
+ (c, h, m) => {
18
+ c && (c.addEventListener(f, a, v), m(() => c.removeEventListener(f, a, v)));
19
+ },
20
+ { immediate: !0 }
21
+ );
22
+ return () => l();
23
+ }
24
+ const fe = j({
25
+ name: "EpAnchor",
26
+ props: Y,
27
+ emits: X,
28
+ setup(r, { emit: f, slots: a, expose: v }) {
29
+ const l = d(""), c = d({}), h = d(), m = d(), i = d(), p = {};
30
+ let E = !1, w = 0;
31
+ const u = Q("anchor"), M = z(() => [
32
+ u.b(),
33
+ r.type === "underline" ? u.m("underline") : "",
34
+ u.m(r.direction)
35
+ ]), N = (e) => {
36
+ p[e.href] = e.el;
37
+ }, W = (e) => {
38
+ delete p[e];
39
+ }, y = (e) => {
40
+ l.value !== e && (l.value = e, f(P, e));
41
+ };
42
+ let T = null, C = "";
43
+ const _ = (e) => {
44
+ if (!i.value) return;
45
+ const o = g(e);
46
+ if (!o) return;
47
+ if (T) {
48
+ if (C === e) return;
49
+ T();
50
+ }
51
+ C = e, E = !0;
52
+ const t = B(o, i.value), n = H(o, t), s = t.scrollHeight - t.clientHeight, U = Math.min(n - r.offset, s);
53
+ T = F(
54
+ i.value,
55
+ w,
56
+ U,
57
+ r.duration,
58
+ () => {
59
+ setTimeout(() => {
60
+ E = !1, C = "";
61
+ }, 20);
62
+ }
63
+ );
64
+ }, R = (e) => {
65
+ e && (y(e), _(e));
66
+ }, $ = (e, o) => {
67
+ f("click", e, o), R(o);
68
+ }, O = () => {
69
+ if (!i.value) return;
70
+ const e = b(i.value), o = [];
71
+ for (const t of Object.keys(p)) {
72
+ const n = g(t);
73
+ if (!n) continue;
74
+ const s = H(
75
+ n,
76
+ B(n, i.value)
77
+ );
78
+ o.push({
79
+ top: s - r.offset - r.bound,
80
+ href: t
81
+ });
82
+ }
83
+ o.sort((t, n) => t.top - n.top);
84
+ for (let t = 0; t < o.length; t++) {
85
+ const n = o[t], s = o[t + 1];
86
+ if (t === 0 && e === 0)
87
+ return r.selectScrollTop ? n.href : "";
88
+ if (n.top <= e && (!s || s.top > e))
89
+ return n.href;
90
+ }
91
+ }, x = J(() => {
92
+ i.value && (w = b(i.value));
93
+ const e = O();
94
+ E || q(e) || y(e);
95
+ }), A = () => {
96
+ const e = g(r.container);
97
+ !e || V(e) ? i.value = window : i.value = e;
98
+ };
99
+ ee(i, "scroll", x);
100
+ const L = () => {
101
+ K(() => {
102
+ if (!h.value || !m.value || !l.value) {
103
+ c.value = {};
104
+ return;
105
+ }
106
+ const e = p[l.value];
107
+ if (!e) {
108
+ c.value = {};
109
+ return;
110
+ }
111
+ const o = h.value.getBoundingClientRect(), t = m.value.getBoundingClientRect(), n = e.getBoundingClientRect();
112
+ r.direction === "horizontal" ? c.value = {
113
+ left: `${n.left - o.left}px`,
114
+ width: `${n.width}px`,
115
+ opacity: 1
116
+ } : c.value = {
117
+ top: `${n.top - o.top + (n.height - t.height) / 2}px`,
118
+ opacity: 1
119
+ };
120
+ });
121
+ };
122
+ return k(l, L), k(() => {
123
+ var e;
124
+ return (e = a.default) == null ? void 0 : e.call(a);
125
+ }, L), D(() => {
126
+ A();
127
+ const e = decodeURIComponent(window.location.hash);
128
+ g(e) ? R(e) : x();
129
+ }), k(
130
+ () => r.container,
131
+ () => {
132
+ A();
133
+ }
134
+ ), G(Z, {
135
+ ns: u,
136
+ direction: r.direction,
137
+ currentAnchor: l,
138
+ addLink: N,
139
+ removeLink: W,
140
+ handleClick: $
141
+ }), v({ scrollTo: R }), () => S("div", { ref: h, class: M.value }, [
142
+ r.marker ? S("div", {
143
+ ref: m,
144
+ class: u.e("marker"),
145
+ style: c.value
146
+ }) : null,
147
+ S("div", { class: u.e("list") }, [I(a, "default")])
148
+ ]);
149
+ }
150
+ });
151
+ export {
152
+ fe as default
153
+ };
@@ -1,4 +1,4 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElAnchor } from 'element-plus';
3
- export declare const EpAnchor: typeof ElAnchor & Plugin;
2
+ import _EpAnchor from './anchor';
3
+ export declare const EpAnchor: typeof _EpAnchor & Plugin;
4
4
  export default EpAnchor;