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.
Files changed (113) hide show
  1. package/dist/components/affix/affix.d.ts +19 -19
  2. package/dist/components/affix/affix.js +61 -53
  3. package/dist/components/alert/alert.d.ts +71 -17
  4. package/dist/components/alert/alert.js +99 -43
  5. package/dist/components/anchor/anchor.d.ts +19 -19
  6. package/dist/components/anchor/anchor.js +166 -102
  7. package/dist/components/anchor/constants.d.ts +15 -0
  8. package/dist/components/anchor/constants.js +4 -0
  9. package/dist/components/anchor-link/anchor-link.d.ts +1 -1
  10. package/dist/components/anchor-link/anchor-link.js +39 -26
  11. package/dist/components/button/EpButton.vue.d.ts +8 -8
  12. package/dist/components/button/EpButton.vue.js +5 -5
  13. package/dist/components/button/constants.d.ts +7 -0
  14. package/dist/components/button/constants.js +6 -0
  15. package/dist/components/check-tag/EpCheckTag.vue.d.ts +1 -1
  16. package/dist/components/collapse-transition/index.js +2 -2
  17. package/dist/components/config-provider/src/constants.js +4 -0
  18. package/dist/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
  19. package/dist/components/config-provider/src/hooks/use-global-config.js +24 -0
  20. package/dist/components/form/src/constants.js +2 -1
  21. package/dist/components/form/src/hooks/use-form-common-props.d.ts +2 -2
  22. package/dist/components/form/src/hooks/use-form-common-props.js +17 -0
  23. package/dist/components/form/src/hooks/use-form-item.js +51 -0
  24. package/dist/components/icon/index.js +5 -5
  25. package/dist/components/menu/menu-collapse-transition.vue.js +10 -6
  26. package/dist/components/menu/menu.d.ts +47 -47
  27. package/dist/components/menu/menu.js +59 -52
  28. package/dist/components/menu/use-menu-color.d.ts +2 -0
  29. package/dist/components/menu/use-menu-color.js +11 -0
  30. package/dist/components/menu/use-menu-css-var.d.ts +2 -0
  31. package/dist/components/menu/use-menu-css-var.js +30 -0
  32. package/dist/components/menu/utils/menu-bar.d.ts +7 -0
  33. package/dist/components/menu/utils/menu-bar.js +15 -0
  34. package/dist/components/menu/utils/menu-item.d.ts +9 -0
  35. package/dist/components/menu/utils/menu-item.js +50 -0
  36. package/dist/components/menu/utils/submenu.d.ts +11 -0
  37. package/dist/components/menu/utils/submenu.js +49 -0
  38. package/dist/components/menu-item/EpMenuItem.vue.js +17 -13
  39. package/dist/components/menu-item-group/EpMenuItemGroup.vue.js +1 -1
  40. package/dist/components/popper/index.js +17 -18
  41. package/dist/components/popper/src/composables/use-content.d.ts +6 -6
  42. package/dist/components/popper/src/content.vue.d.ts +6 -6
  43. package/dist/components/popper/src/popper.d.ts +2 -2
  44. package/dist/components/radio/constants.d.ts +64 -0
  45. package/dist/components/radio/constants.js +4 -0
  46. package/dist/components/radio/radio.d.ts +98 -19
  47. package/dist/components/radio/radio.js +101 -43
  48. package/dist/components/radio/use-radio.d.ts +13 -0
  49. package/dist/components/radio/use-radio.js +43 -0
  50. package/dist/components/radio-button/radio-button.d.ts +46 -16
  51. package/dist/components/radio-button/radio-button.js +37 -29
  52. package/dist/components/radio-group/radio-group.d.ts +142 -28
  53. package/dist/components/radio-group/radio-group.js +136 -55
  54. package/dist/components/slot/src/only-child.js +23 -22
  55. package/dist/components/sub-menu/sub-menu.d.ts +19 -19
  56. package/dist/components/sub-menu/sub-menu.js +65 -58
  57. package/dist/components/tab-pane/tab-pane.d.ts +45 -8
  58. package/dist/components/tab-pane/tab-pane.js +66 -32
  59. package/dist/components/tabs/composables/use-tab-nav-touch.d.ts +19 -0
  60. package/dist/components/tabs/composables/use-tab-nav-touch.js +58 -0
  61. package/dist/components/tabs/constants.d.ts +63 -0
  62. package/dist/components/tabs/constants.js +4 -0
  63. package/dist/components/tabs/tab-bar.d.ts +97 -0
  64. package/dist/components/tabs/tab-bar.vue.d.ts +14 -0
  65. package/dist/components/tabs/tab-bar.vue.js +80 -0
  66. package/dist/components/tabs/tab-bar2.vue.js +4 -0
  67. package/dist/components/tabs/tab-nav.d.ts +295 -0
  68. package/dist/components/tabs/tab-nav.js +243 -0
  69. package/dist/components/tabs/tabs.d.ts +71 -28
  70. package/dist/components/tabs/tabs.js +165 -93
  71. package/dist/components/tag/EpTag.vue.d.ts +3 -3
  72. package/dist/components/tag/EpTag.vue.js +3 -3
  73. package/dist/components/tooltip/index.d.ts +34 -34
  74. package/dist/components/tooltip/index.js +12 -12
  75. package/dist/components/tooltip/src/content.vue.d.ts +8 -8
  76. package/dist/components/tooltip/src/tooltip.d.ts +2 -2
  77. package/dist/components/tooltip/src/tooltip.vue.d.ts +12 -12
  78. package/dist/components/tooltip/src/trigger.d.ts +1 -1
  79. package/dist/constants/event.js +5 -0
  80. package/dist/directives/click-outside/index.js +49 -0
  81. package/dist/hooks/index.d.ts +1 -0
  82. package/dist/hooks/use-deprecated/index.js +25 -0
  83. package/dist/hooks/use-locale/index.js +24 -0
  84. package/dist/hooks/use-ordered-children/index.js +53 -0
  85. package/dist/hooks/use-popper/index.d.ts +6 -6
  86. package/dist/hooks/use-prop/index.js +11 -0
  87. package/dist/hooks/use-size/index.d.ts +3 -3
  88. package/dist/hooks/use-size/index.js +14 -6
  89. package/dist/hooks/use-wheel/defaults.d.ts +27 -0
  90. package/dist/hooks/use-wheel/defaults.js +4 -0
  91. package/dist/hooks/use-wheel/index.d.ts +13 -0
  92. package/dist/hooks/use-wheel/index.js +26 -0
  93. package/dist/utils/browser.js +6 -5
  94. package/dist/utils/dom/aria.js +13 -6
  95. package/dist/utils/dom/element.js +16 -0
  96. package/dist/utils/dom/position.js +18 -0
  97. package/dist/utils/dom/scroll.js +50 -0
  98. package/dist/utils/dom/style.js +40 -13
  99. package/dist/utils/easings.js +7 -0
  100. package/dist/utils/error.js +11 -7
  101. package/dist/utils/numbers.js +6 -0
  102. package/dist/utils/objects.js +7 -0
  103. package/dist/utils/raf.js +6 -0
  104. package/dist/utils/strings.js +8 -0
  105. package/dist/utils/throttleByRaf.js +15 -0
  106. package/dist/utils/types.js +19 -16
  107. package/dist/utils/typescript.js +4 -0
  108. package/dist/utils/vue/icon.js +20 -0
  109. package/dist/utils/vue/vnode.d.ts +4 -4
  110. package/dist/utils/vue/vnode.js +17 -0
  111. package/dist/vendored-components.d.ts +6 -3
  112. package/dist/vendored-components.js +11 -5
  113. 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 与 EpAnchorLink
7
- * 共用 element-plus constants.mjs 中的同一 Symbol,父子识别不受组件改名影响。
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/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>>;
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/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>;
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/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>>;
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/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>;
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
- 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>;
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
- 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>;
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 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 "element-plus/es/constants/event.mjs";
3
- import { getOffsetTopDistance as H } from "element-plus/es/utils/dom/position.mjs";
4
- import { isUndefined as V, isWindow as q } from "element-plus/es/utils/types.mjs";
5
- import { getScrollTop as B, getScrollElement as b, animateScrollTo as F } from "element-plus/es/utils/dom/scroll.mjs";
6
- import { getElement as g } from "element-plus/es/utils/dom/element.mjs";
7
- import { throttleByRaf as J } from "element-plus/es/utils/throttleByRaf.mjs";
8
- import { useNamespace as Q } from "element-plus/es/hooks/use-namespace/index.mjs";
9
- import { anchorEmits as X, anchorProps as Y } from "element-plus/es/components/anchor/src/anchor.mjs";
10
- import { anchorKey as Z } from "element-plus/es/components/anchor/src/constants.mjs";
11
- function ee(r, f, a, v) {
12
- const l = k(
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 = r.value;
78
+ const c = t.value;
15
79
  return c instanceof Window, c;
16
80
  },
17
- (c, h, m) => {
18
- c && (c.addEventListener(f, a, v), m(() => c.removeEventListener(f, a, v)));
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 () => l();
86
+ return () => a();
23
87
  }
24
- const fe = j({
88
+ const ye = D({
25
89
  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));
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 T = null, C = "";
43
- const _ = (e) => {
106
+ let E = null, S = "";
107
+ const $ = (e) => {
44
108
  if (!i.value) return;
45
- const o = g(e);
46
- if (!o) return;
47
- if (T) {
48
- if (C === e) return;
49
- T();
109
+ const r = g(e);
110
+ if (!r) return;
111
+ if (E) {
112
+ if (S === e) return;
113
+ E();
50
114
  }
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(
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
- w,
56
- U,
57
- r.duration,
119
+ b,
120
+ z,
121
+ t.duration,
58
122
  () => {
59
123
  setTimeout(() => {
60
- E = !1, C = "";
124
+ k = !1, S = "";
61
125
  }, 20);
62
126
  }
63
127
  );
64
- }, R = (e) => {
65
- e && (y(e), _(e));
66
- }, $ = (e, o) => {
67
- f("click", e, o), R(o);
68
- }, O = () => {
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 = 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)
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
- o.push({
79
- top: s - r.offset - r.bound,
80
- href: t
142
+ r.push({
143
+ top: f - t.offset - t.bound,
144
+ href: n
81
145
  });
82
146
  }
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;
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 = J(() => {
92
- i.value && (w = B(i.value));
93
- const e = O();
94
- E || V(e) || y(e);
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(r.container);
97
- !e || q(e) ? i.value = window : i.value = e;
160
+ const e = g(t.container);
161
+ !e || J(e) ? i.value = window : i.value = e;
98
162
  };
99
- ee(i, "scroll", x);
163
+ oe(i, "scroll", x);
100
164
  const L = () => {
101
- K(() => {
102
- if (!h.value || !m.value || !l.value) {
165
+ q(() => {
166
+ if (!v.value || !d.value || !a.value) {
103
167
  c.value = {};
104
168
  return;
105
169
  }
106
- const e = p[l.value];
170
+ const e = h[a.value];
107
171
  if (!e) {
108
172
  c.value = {};
109
173
  return;
110
174
  }
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`,
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: `${n.top - o.top + (n.height - t.height) / 2}px`,
181
+ top: `${o.top - r.top + (o.height - n.height) / 2}px`,
118
182
  opacity: 1
119
183
  };
120
184
  });
121
185
  };
122
- return k(l, L), k(() => {
186
+ return y(a, L), y(() => {
123
187
  var e;
124
- return (e = a.default) == null ? void 0 : e.call(a);
125
- }, L), D(() => {
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) ? R(e) : x();
129
- }), k(
130
- () => r.container,
192
+ g(e) ? T(e) : x();
193
+ }), y(
194
+ () => t.container,
131
195
  () => {
132
196
  A();
133
197
  }
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"),
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
- S("div", { class: u.e("list") }, [I(a, "default")])
211
+ C("div", { class: s.e("list") }, [V(u, "default")])
148
212
  ]);
149
213
  }
150
214
  });
151
215
  export {
152
- fe as default
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>;
@@ -0,0 +1,4 @@
1
+ const o = Symbol("anchor");
2
+ export {
3
+ o as anchorKey
4
+ };
@@ -3,7 +3,7 @@
3
3
  * 样式复用仓库内置的 theme-chalk/src/anchor.scss(命名空间为 el)。
4
4
  *
5
5
  * 通过 inject(anchorKey) 识别父级 EpAnchor,anchorKey 与 EpAnchor 共用
6
- * element-plus constants.mjs 中的同一 Symbol,父子识别不受组件改名影响。
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 m, ref as v, inject as C, computed as L, watch as x, nextTick as A, onMounted as b, onBeforeUnmount as E, h as r, renderSlot as a } from "vue";
2
- import { anchorKey as j } from "element-plus/es/components/anchor/src/constants.mjs";
3
- import { anchorLinkProps as w } from "element-plus/es/components/anchor/src/anchor-link.mjs";
4
- const K = m({
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: w,
19
+ props: E,
7
20
  setup(n, { slots: t }) {
8
- const c = v(), {
21
+ const r = v(), {
9
22
  ns: i,
10
23
  direction: h,
11
- currentAnchor: u,
12
- addLink: o,
24
+ currentAnchor: m,
25
+ addLink: c,
13
26
  removeLink: l,
14
- handleClick: k
15
- } = C(j), d = L(() => [
27
+ handleClick: u
28
+ } = p(g), s = C(() => [
16
29
  i.e("link"),
17
- i.is("active", u.value === n.href)
18
- ]), s = (e) => {
19
- k(e, n.href);
30
+ i.is("active", m.value === n.href)
31
+ ]), d = (e) => {
32
+ u(e, n.href);
20
33
  };
21
- return x(
34
+ return L(
22
35
  () => n.href,
23
36
  (e, f) => {
24
- A(() => {
25
- f && l(f), e && o({ href: e, el: c.value });
37
+ b(() => {
38
+ f && l(f), e && c({ href: e, el: r.value });
26
39
  });
27
40
  }
28
- ), b(() => {
41
+ ), x(() => {
29
42
  const { href: e } = n;
30
- e && o({ href: e, el: c.value });
31
- }), E(() => {
43
+ e && c({ href: e, el: r.value });
44
+ }), A(() => {
32
45
  const { href: e } = n;
33
46
  e && l(e);
34
- }), () => r("div", { class: i.e("item") }, [
35
- r(
47
+ }), () => o("div", { class: i.e("item") }, [
48
+ o(
36
49
  "a",
37
50
  {
38
- ref: c,
39
- class: d.value,
51
+ ref: r,
52
+ class: s.value,
40
53
  href: n.href,
41
- onClick: s
54
+ onClick: d
42
55
  },
43
56
  [a(t, "default", {}, () => [n.title])]
44
57
  ),
45
- t["sub-link"] && h === "vertical" ? r("div", { class: i.e("list") }, [a(t, "sub-link")]) : null
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
- K as default
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<"" | "default" | "small" | "large">;
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 autofocus: boolean;
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 "element-plus/es/components/icon/index.mjs";
3
- import { useFormSize as Z, useFormDisabled as G } from "element-plus/es/components/form/src/hooks/use-form-common-props.mjs";
4
- import { useFormItem as x } from "element-plus/es/components/form/src/hooks/use-form-item.mjs";
5
- import { useGlobalConfig as ee } from "element-plus/es/components/config-provider/src/hooks/use-global-config.mjs";
6
- import { buttonGroupContextKey as te } from "element-plus/es/components/button/src/constants.mjs";
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>;
@@ -0,0 +1,6 @@
1
+ const t = Symbol(
2
+ "buttonGroupContextKey"
3
+ );
4
+ export {
5
+ t as buttonGroupContextKey
6
+ };
@@ -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
  };
@@ -0,0 +1,4 @@
1
+ const o = Symbol();
2
+ export {
3
+ o as configProviderContextKey
4
+ };
@@ -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<"" | "default" | "small" | "large">;
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;