ep-craft 0.1.22 → 0.1.23

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