ep-craft 0.1.30 → 0.1.32

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 (154) hide show
  1. package/dist/components/aside/aside.d.ts +26 -0
  2. package/dist/components/aside/aside.js +29 -0
  3. package/dist/components/aside/index.d.ts +2 -2
  4. package/dist/components/aside/index.js +4 -4
  5. package/dist/components/autocomplete/EpAutocomplete.d.ts +494 -0
  6. package/dist/components/autocomplete/EpAutocomplete.js +465 -0
  7. package/dist/components/autocomplete/autocomplete.d.ts +322 -0
  8. package/dist/components/autocomplete/autocomplete.js +120 -0
  9. package/dist/components/autocomplete/index.d.ts +23 -2
  10. package/dist/components/autocomplete/index.js +9 -3
  11. package/dist/components/autocomplete/instance.d.ts +70 -0
  12. package/dist/components/backtop/EpBacktop.vue.d.ts +55 -0
  13. package/dist/components/backtop/EpBacktop.vue.js +59 -0
  14. package/dist/components/backtop/EpBacktop2.vue.js +4 -0
  15. package/dist/components/backtop/backtop.d.ts +43 -0
  16. package/dist/components/backtop/backtop.js +36 -0
  17. package/dist/components/backtop/index.d.ts +35 -2
  18. package/dist/components/backtop/index.js +6 -3
  19. package/dist/components/backtop/instance.d.ts +10 -0
  20. package/dist/components/backtop/use-backtop.d.ts +13 -0
  21. package/dist/components/backtop/use-backtop.js +23 -0
  22. package/dist/components/checkbox/EpCheckbox.vue.d.ts +147 -0
  23. package/dist/components/checkbox/EpCheckbox.vue.js +101 -0
  24. package/dist/components/checkbox/EpCheckbox2.vue.js +4 -0
  25. package/dist/components/checkbox/index.d.ts +34 -2
  26. package/dist/components/checkbox/index.js +10 -4
  27. package/dist/components/checkbox/instance.d.ts +10 -0
  28. package/dist/components/checkbox/src/checkbox.d.ts +208 -0
  29. package/dist/components/checkbox/src/checkbox.js +119 -0
  30. package/dist/components/checkbox/src/composables/use-checkbox-disabled.d.ts +7 -0
  31. package/dist/components/checkbox/src/composables/use-checkbox-disabled.js +31 -0
  32. package/dist/components/checkbox/src/composables/use-checkbox-event.d.ts +9 -0
  33. package/dist/components/checkbox/src/composables/use-checkbox-event.js +48 -0
  34. package/dist/components/checkbox/src/composables/use-checkbox-model.d.ts +7 -0
  35. package/dist/components/checkbox/src/composables/use-checkbox-model.js +31 -0
  36. package/dist/components/checkbox/src/composables/use-checkbox-status.d.ts +12 -0
  37. package/dist/components/checkbox/src/composables/use-checkbox-status.js +33 -0
  38. package/dist/components/checkbox/src/composables/use-checkbox.d.ts +16 -0
  39. package/dist/components/checkbox/src/composables/use-checkbox.js +81 -0
  40. package/dist/components/checkbox/src/constants.d.ts +8 -0
  41. package/dist/components/checkbox/src/constants.js +4 -0
  42. package/dist/components/checkbox-button/EpCheckboxButton.vue.d.ts +147 -0
  43. package/dist/components/checkbox-button/EpCheckboxButton.vue.js +84 -0
  44. package/dist/components/checkbox-button/EpCheckboxButton2.vue.js +4 -0
  45. package/dist/components/checkbox-button/index.d.ts +24 -2
  46. package/dist/components/checkbox-button/index.js +6 -3
  47. package/dist/components/checkbox-button/instance.d.ts +10 -0
  48. package/dist/components/checkbox-group/EpCheckboxGroup.vue.d.ts +74 -0
  49. package/dist/components/checkbox-group/EpCheckboxGroup.vue.js +92 -0
  50. package/dist/components/checkbox-group/EpCheckboxGroup2.vue.js +4 -0
  51. package/dist/components/checkbox-group/index.d.ts +27 -2
  52. package/dist/components/checkbox-group/index.js +10 -4
  53. package/dist/components/checkbox-group/instance.d.ts +10 -0
  54. package/dist/components/checkbox-group/src/checkbox-group.d.ts +102 -0
  55. package/dist/components/checkbox-group/src/checkbox-group.js +84 -0
  56. package/dist/components/container/container.d.ts +35 -0
  57. package/dist/components/container/container.js +26 -0
  58. package/dist/components/container/index.d.ts +23 -2
  59. package/dist/components/container/index.js +13 -4
  60. package/dist/components/date-picker/src/date-picker.d.ts +5 -5
  61. package/dist/components/footer/footer.d.ts +28 -0
  62. package/dist/components/footer/footer.js +29 -0
  63. package/dist/components/footer/index.d.ts +2 -2
  64. package/dist/components/footer/index.js +4 -4
  65. package/dist/components/header/header.d.ts +28 -0
  66. package/dist/components/header/header.js +29 -0
  67. package/dist/components/header/index.d.ts +2 -2
  68. package/dist/components/header/index.js +4 -4
  69. package/dist/components/input/index.d.ts +177 -0
  70. package/dist/components/input/index.js +8 -6
  71. package/dist/components/input/input.d.ts +2 -2
  72. package/dist/components/input/input.js +6 -6
  73. package/dist/components/input-number/EpInputNumber.vue.d.ts +5 -5
  74. package/dist/components/input-number/input-number.d.ts +2 -2
  75. package/dist/components/main/index.d.ts +2 -2
  76. package/dist/components/main/index.js +3 -3
  77. package/dist/components/main/main.d.ts +14 -0
  78. package/dist/components/main/main.js +14 -0
  79. package/dist/components/pagination/index.d.ts +4 -2
  80. package/dist/components/pagination/index.js +9 -3
  81. package/dist/components/pagination/src/components/jumper.d.ts +13 -0
  82. package/dist/components/pagination/src/components/jumper.js +16 -0
  83. package/dist/components/pagination/src/components/jumper.vue.d.ts +16 -0
  84. package/dist/components/pagination/src/components/jumper.vue.js +58 -0
  85. package/dist/components/pagination/src/components/jumper2.vue.js +4 -0
  86. package/dist/components/pagination/src/components/next.d.ts +22 -0
  87. package/dist/components/pagination/src/components/next.js +26 -0
  88. package/dist/components/pagination/src/components/next.vue.d.ts +42 -0
  89. package/dist/components/pagination/src/components/next.vue.js +44 -0
  90. package/dist/components/pagination/src/components/next2.vue.js +4 -0
  91. package/dist/components/pagination/src/components/pager.d.ts +16 -0
  92. package/dist/components/pagination/src/components/pager.js +24 -0
  93. package/dist/components/pagination/src/components/pager.vue.d.ts +30 -0
  94. package/dist/components/pagination/src/components/pager.vue.js +148 -0
  95. package/dist/components/pagination/src/components/pager2.vue.js +4 -0
  96. package/dist/components/pagination/src/components/prev.d.ts +24 -0
  97. package/dist/components/pagination/src/components/prev.js +25 -0
  98. package/dist/components/pagination/src/components/prev.vue.d.ts +39 -0
  99. package/dist/components/pagination/src/components/prev.vue.js +44 -0
  100. package/dist/components/pagination/src/components/prev2.vue.js +4 -0
  101. package/dist/components/pagination/src/components/sizes.d.ts +35 -0
  102. package/dist/components/pagination/src/components/sizes.js +34 -0
  103. package/dist/components/pagination/src/components/sizes.vue.d.ts +68 -0
  104. package/dist/components/pagination/src/components/sizes.vue.js +73 -0
  105. package/dist/components/pagination/src/components/sizes2.vue.js +4 -0
  106. package/dist/components/pagination/src/components/total.d.ts +8 -0
  107. package/dist/components/pagination/src/components/total.js +15 -0
  108. package/dist/components/pagination/src/components/total.vue.d.ts +8 -0
  109. package/dist/components/pagination/src/components/total.vue.js +33 -0
  110. package/dist/components/pagination/src/components/total2.vue.js +4 -0
  111. package/dist/components/pagination/src/constants.d.ts +9 -0
  112. package/dist/components/pagination/src/constants.js +4 -0
  113. package/dist/components/pagination/src/pagination.d.ts +147 -0
  114. package/dist/components/pagination/src/pagination.js +314 -0
  115. package/dist/components/pagination/src/usePagination.d.ts +1 -0
  116. package/dist/components/pagination/src/usePagination.js +6 -0
  117. package/dist/components/popper/src/content.vue.d.ts +6 -6
  118. package/dist/components/scrollbar/index.d.ts +217 -6
  119. package/dist/components/scrollbar/index.js +12 -5
  120. package/dist/components/scrollbar/src/bar.d.ts +23 -0
  121. package/dist/components/scrollbar/src/bar.js +19 -0
  122. package/dist/components/scrollbar/src/bar.vue.d.ts +23 -0
  123. package/dist/components/scrollbar/src/bar.vue.js +43 -0
  124. package/dist/components/scrollbar/src/bar2.vue.js +4 -0
  125. package/dist/components/scrollbar/src/constants.d.ts +6 -0
  126. package/dist/components/scrollbar/src/constants.js +4 -0
  127. package/dist/components/scrollbar/src/scrollbar.d.ts +111 -6
  128. package/dist/components/scrollbar/src/scrollbar.js +108 -7
  129. package/dist/components/scrollbar/src/scrollbar.vue.d.ts +101 -0
  130. package/dist/components/scrollbar/src/scrollbar.vue.js +178 -0
  131. package/dist/components/scrollbar/src/scrollbar2.vue.js +4 -0
  132. package/dist/components/scrollbar/src/thumb.d.ts +29 -0
  133. package/dist/components/scrollbar/src/thumb.js +19 -0
  134. package/dist/components/scrollbar/src/thumb.vue.d.ts +27 -0
  135. package/dist/components/scrollbar/src/thumb.vue.js +109 -0
  136. package/dist/components/scrollbar/src/thumb2.vue.js +4 -0
  137. package/dist/components/scrollbar/src/util.d.ts +2 -14
  138. package/dist/components/scrollbar/src/util.js +12 -3
  139. package/dist/components/select/index.d.ts +2214 -0
  140. package/dist/components/select/index.js +10 -7
  141. package/dist/components/select/select.vue.d.ts +148 -90
  142. package/dist/components/select-v2/src/select.vue.d.ts +30 -30
  143. package/dist/components/time-picker/src/common/picker.vue.d.ts +5 -5
  144. package/dist/components/time-picker/src/time-picker.d.ts +5 -5
  145. package/dist/components/tooltip/index.d.ts +24 -24
  146. package/dist/components/tooltip/src/content.vue.d.ts +6 -6
  147. package/dist/components/tooltip/src/tooltip.vue.d.ts +8 -8
  148. package/dist/ep-craft.js +187 -179
  149. package/dist/index.css +1 -1
  150. package/dist/index.d.ts +18 -0
  151. package/dist/vendored-components.d.ts +5 -2
  152. package/dist/vendored-components.js +22 -1
  153. package/package.json +5 -2
  154. package/theme-chalk/src/float-label.scss +51 -26
@@ -0,0 +1,43 @@
1
+ import { defineComponent as W, inject as x, ref as a, openBlock as _, createElementBlock as w, Fragment as S, createVNode as g } from "vue";
2
+ import { barProps as $ } from "./bar.js";
3
+ import { GAP as s } from "./util.js";
4
+ import z from "./thumb.vue.js";
5
+ import { scrollbarContextKey as b } from "./constants.js";
6
+ const Y = /* @__PURE__ */ W({
7
+ __name: "bar",
8
+ props: $,
9
+ setup(y, { expose: H }) {
10
+ const u = y, n = x(b), h = a(0), v = a(0), p = a(""), d = a(""), r = a(1), c = a(1);
11
+ return H({
12
+ handleScroll: (e) => {
13
+ if (e) {
14
+ const t = e.offsetHeight - s, o = e.offsetWidth - s;
15
+ v.value = e.scrollTop * 100 / t * r.value, h.value = e.scrollLeft * 100 / o * c.value;
16
+ }
17
+ },
18
+ update: () => {
19
+ const e = n == null ? void 0 : n.wrapElement;
20
+ if (!e) return;
21
+ const t = e.offsetHeight - s, o = e.offsetWidth - s, f = t ** 2 / e.scrollHeight, m = o ** 2 / e.scrollWidth, i = Math.max(f, u.minSize), l = Math.max(m, u.minSize);
22
+ r.value = f / (t - f) / (i / (t - i)), c.value = m / (o - m) / (l / (o - l)), d.value = i + s < t ? `${i}px` : "", p.value = l + s < o ? `${l}px` : "";
23
+ }
24
+ }), (e, t) => (_(), w(S, null, [
25
+ g(z, {
26
+ move: h.value,
27
+ ratio: c.value,
28
+ size: p.value,
29
+ always: e.always
30
+ }, null, 8, ["move", "ratio", "size", "always"]),
31
+ g(z, {
32
+ move: v.value,
33
+ ratio: r.value,
34
+ size: d.value,
35
+ vertical: "",
36
+ always: e.always
37
+ }, null, 8, ["move", "ratio", "size", "always"])
38
+ ], 64));
39
+ }
40
+ });
41
+ export {
42
+ Y as default
43
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./bar.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,6 @@
1
+ import type { InjectionKey } from 'vue';
2
+ export interface ScrollbarContext {
3
+ scrollbarElement: HTMLDivElement | undefined;
4
+ wrapElement: HTMLDivElement | undefined;
5
+ }
6
+ export declare const scrollbarContextKey: InjectionKey<ScrollbarContext>;
@@ -0,0 +1,4 @@
1
+ const o = Symbol("scrollbarContextKey");
2
+ export {
3
+ o as scrollbarContextKey
4
+ };
@@ -1,10 +1,115 @@
1
- import type { Ref } from 'vue';
1
+ import type { ExtractPublicPropTypes, Ref, StyleValue } from 'vue';
2
+ export interface ScrollbarProps {
3
+ /**
4
+ * @description trigger distance(px)
5
+ * @default 0
6
+ */
7
+ distance?: number;
8
+ /**
9
+ * @description height of scrollbar
10
+ * @default ''
11
+ */
12
+ height?: number | string;
13
+ /**
14
+ * @description max height of scrollbar
15
+ * @default ''
16
+ */
17
+ maxHeight?: number | string;
18
+ /**
19
+ * @description whether to use the native scrollbar
20
+ */
21
+ native?: boolean;
22
+ /**
23
+ * @description style of wrap
24
+ * @default ''
25
+ */
26
+ wrapStyle?: StyleValue;
27
+ /**
28
+ * @description class of wrap
29
+ * @default ''
30
+ */
31
+ wrapClass?: string | string[];
32
+ /**
33
+ * @description class of view
34
+ * @default ''
35
+ */
36
+ viewClass?: string | string[];
37
+ /**
38
+ * @description style of view
39
+ * @default ''
40
+ */
41
+ viewStyle?: StyleValue;
42
+ /**
43
+ * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance
44
+ */
45
+ noresize?: boolean;
46
+ /**
47
+ * @description element tag of the view
48
+ * @default 'div'
49
+ */
50
+ tag?: keyof HTMLElementTagNameMap | (string & {});
51
+ /**
52
+ * @description always show
53
+ */
54
+ always?: boolean;
55
+ /**
56
+ * @description minimum size of scrollbar
57
+ * @default 20
58
+ */
59
+ minSize?: number;
60
+ /**
61
+ * @description Wrap tabindex
62
+ * @default undefined
63
+ */
64
+ tabindex?: number | string;
65
+ /**
66
+ * @description id of view
67
+ */
68
+ id?: string;
69
+ /**
70
+ * @description role of view
71
+ */
72
+ role?: string;
73
+ /**
74
+ * @description native `aria-label` attribute
75
+ */
76
+ ariaLabel?: string;
77
+ /**
78
+ * @description native `aria-orientation` attribute
79
+ */
80
+ ariaOrientation?: 'horizontal' | 'vertical' | 'undefined';
81
+ }
82
+ /**
83
+ * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
84
+ */
85
+ export declare const scrollbarProps: {
86
+ readonly ariaLabel: StringConstructor;
87
+ readonly ariaOrientation: {
88
+ readonly type: import("vue").PropType<string>;
89
+ readonly required: false;
90
+ readonly validator: ((val: unknown) => boolean) | undefined;
91
+ __epPropKey: true;
92
+ };
93
+ readonly distance: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
94
+ readonly height: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
95
+ readonly maxHeight: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
96
+ readonly native: BooleanConstructor;
97
+ readonly wrapStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
98
+ readonly wrapClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
99
+ readonly viewClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
100
+ readonly viewStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | import("vue").CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
101
+ readonly noresize: BooleanConstructor;
102
+ readonly tag: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
103
+ readonly always: BooleanConstructor;
104
+ readonly minSize: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 20, boolean>;
105
+ readonly tabindex: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, undefined, boolean>;
106
+ readonly id: StringConstructor;
107
+ readonly role: StringConstructor;
108
+ };
2
109
  /**
3
- * scrollbar 源码化子集 —— 仅为 select 提供 `scrollbarEmits` 与实例类型。
4
- *
5
- * scrollbar 组件本体仍走薄包装(见 index.ts),此处不 vendor 完整组件;
6
- * 仅补齐 select.vue / select.ts 依赖的命名导出与实例类型。
110
+ * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
7
111
  */
112
+ export type ScrollbarPropsPublic = ExtractPublicPropTypes<typeof scrollbarProps>;
8
113
  export declare const scrollbarEmits: {
9
114
  readonly 'end-reached': (direction: ScrollbarDirection) => boolean;
10
115
  readonly scroll: ({ scrollTop, scrollLeft, }: {
@@ -14,7 +119,7 @@ export declare const scrollbarEmits: {
14
119
  };
15
120
  export type ScrollbarEmits = typeof scrollbarEmits;
16
121
  export type ScrollbarDirection = 'top' | 'bottom' | 'left' | 'right';
17
- /** el-scrollbar 暴露的实例 API(EpScrollbar 薄包装透传自 element-plus) */
122
+ /** el-scrollbar 暴露的实例 API(由本地自持的 scrollbar.vue 提供) */
18
123
  export interface ScrollbarInstance {
19
124
  wrapRef: Ref<HTMLDivElement | undefined>;
20
125
  update: () => void;
@@ -1,16 +1,117 @@
1
- import { isNumber as t } from "../../../utils/types.js";
1
+ import { isNumber as i } from "../../../utils/types.js";
2
2
  import "lodash-unified";
3
3
  import "@vueuse/core";
4
4
  import "@vue/shared";
5
5
  import "@element-plus/icons-vue";
6
+ import { buildProps as o, definePropType as r } from "../../../utils/vue/props/runtime.js";
6
7
  import "vue";
7
- const c = {
8
- "end-reached": (r) => ["left", "right", "top", "bottom"].includes(r),
8
+ import "../../../hooks/use-size/index.js";
9
+ import "@popperjs/core";
10
+ import "../../../hooks/use-z-index/index.js";
11
+ import "../../../hooks/use-delayed-toggle/index.js";
12
+ import { useAriaProps as a } from "../../../hooks/use-aria/index.js";
13
+ import "../../../hooks/use-model-toggle/index.js";
14
+ import "../../../hooks/use-empty-values/index.js";
15
+ const N = o({
16
+ /**
17
+ * @description trigger distance(px)
18
+ */
19
+ distance: {
20
+ type: Number,
21
+ default: 0
22
+ },
23
+ /**
24
+ * @description height of scrollbar
25
+ */
26
+ height: {
27
+ type: [String, Number],
28
+ default: ""
29
+ },
30
+ /**
31
+ * @description max height of scrollbar
32
+ */
33
+ maxHeight: {
34
+ type: [String, Number],
35
+ default: ""
36
+ },
37
+ /**
38
+ * @description whether to use the native scrollbar
39
+ */
40
+ native: Boolean,
41
+ /**
42
+ * @description style of wrap
43
+ */
44
+ wrapStyle: {
45
+ type: r([String, Object, Array, Boolean]),
46
+ default: ""
47
+ },
48
+ /**
49
+ * @description class of wrap
50
+ */
51
+ wrapClass: {
52
+ type: [String, Array],
53
+ default: ""
54
+ },
55
+ /**
56
+ * @description class of view
57
+ */
58
+ viewClass: {
59
+ type: [String, Array],
60
+ default: ""
61
+ },
62
+ /**
63
+ * @description style of view
64
+ */
65
+ viewStyle: {
66
+ type: r([String, Object, Array, Boolean]),
67
+ default: ""
68
+ },
69
+ /**
70
+ * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance
71
+ */
72
+ noresize: Boolean,
73
+ /**
74
+ * @description element tag of the view
75
+ */
76
+ tag: {
77
+ type: String,
78
+ default: "div"
79
+ },
80
+ /**
81
+ * @description always show
82
+ */
83
+ always: Boolean,
84
+ /**
85
+ * @description minimum size of scrollbar
86
+ */
87
+ minSize: {
88
+ type: Number,
89
+ default: 20
90
+ },
91
+ /**
92
+ * @description Wrap tabindex
93
+ */
94
+ tabindex: {
95
+ type: [String, Number],
96
+ default: void 0
97
+ },
98
+ /**
99
+ * @description id of view
100
+ */
101
+ id: String,
102
+ /**
103
+ * @description role of view
104
+ */
105
+ role: String,
106
+ ...a(["ariaLabel", "ariaOrientation"])
107
+ }), h = {
108
+ "end-reached": (t) => ["left", "right", "top", "bottom"].includes(t),
9
109
  scroll: ({
10
- scrollTop: r,
11
- scrollLeft: o
12
- }) => [r, o].every(t)
110
+ scrollTop: t,
111
+ scrollLeft: e
112
+ }) => [t, e].every(i)
13
113
  };
14
114
  export {
15
- c as scrollbarEmits
115
+ h as scrollbarEmits,
116
+ N as scrollbarProps
16
117
  };
@@ -0,0 +1,101 @@
1
+ import type { ScrollbarDirection } from './scrollbar';
2
+ import type { CSSProperties, StyleValue } from 'vue';
3
+ declare function scrollTo(xCord: number, yCord?: number): void;
4
+ declare function scrollTo(options: ScrollToOptions): void;
5
+ declare var __VLS_7: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_7) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ readonly ariaLabel: StringConstructor;
11
+ readonly ariaOrientation: {
12
+ readonly type: import("vue").PropType<string>;
13
+ readonly required: false;
14
+ readonly validator: ((val: unknown) => boolean) | undefined;
15
+ __epPropKey: true;
16
+ };
17
+ readonly distance: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
18
+ readonly height: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
19
+ readonly maxHeight: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
20
+ readonly native: BooleanConstructor;
21
+ readonly wrapStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
22
+ readonly wrapClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
23
+ readonly viewClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
24
+ readonly viewStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
25
+ readonly noresize: BooleanConstructor;
26
+ readonly tag: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
27
+ readonly always: BooleanConstructor;
28
+ readonly minSize: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 20, boolean>;
29
+ readonly tabindex: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, undefined, boolean>;
30
+ readonly id: StringConstructor;
31
+ readonly role: StringConstructor;
32
+ }>, {
33
+ /** @description scrollbar wrap ref */
34
+ wrapRef: import("vue").Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
35
+ /** @description update scrollbar state manually */
36
+ update: () => void;
37
+ /** @description scrolls to a particular set of coordinates */
38
+ scrollTo: typeof scrollTo;
39
+ /** @description set distance to scroll top */
40
+ setScrollTop: (value: number) => void;
41
+ /** @description set distance to scroll left */
42
+ setScrollLeft: (value: number) => void;
43
+ /** @description handle scroll event */
44
+ handleScroll: () => void;
45
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
+ scroll: (args_0: {
47
+ scrollTop: number;
48
+ scrollLeft: number;
49
+ }) => void;
50
+ "end-reached": (direction: ScrollbarDirection) => void;
51
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
52
+ readonly ariaLabel: StringConstructor;
53
+ readonly ariaOrientation: {
54
+ readonly type: import("vue").PropType<string>;
55
+ readonly required: false;
56
+ readonly validator: ((val: unknown) => boolean) | undefined;
57
+ __epPropKey: true;
58
+ };
59
+ readonly distance: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
60
+ readonly height: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
61
+ readonly maxHeight: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, "", boolean>;
62
+ readonly native: BooleanConstructor;
63
+ readonly wrapStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
64
+ readonly wrapClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
65
+ readonly viewClass: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, ArrayConstructor], unknown, unknown, "", boolean>;
66
+ readonly viewStyle: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, "", boolean>;
67
+ readonly noresize: BooleanConstructor;
68
+ readonly tag: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "div", boolean>;
69
+ readonly always: BooleanConstructor;
70
+ readonly minSize: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 20, boolean>;
71
+ readonly tabindex: import("@element-plus/utils").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, undefined, boolean>;
72
+ readonly id: StringConstructor;
73
+ readonly role: StringConstructor;
74
+ }>> & Readonly<{
75
+ onScroll?: ((args_0: {
76
+ scrollTop: number;
77
+ scrollLeft: number;
78
+ }) => any) | undefined;
79
+ "onEnd-reached"?: ((direction: ScrollbarDirection) => any) | undefined;
80
+ }>, {
81
+ readonly always: boolean;
82
+ readonly height: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
83
+ readonly maxHeight: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
84
+ readonly tabindex: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
85
+ readonly tag: string;
86
+ readonly minSize: number;
87
+ readonly distance: number;
88
+ readonly wrapStyle: StyleValue;
89
+ readonly wrapClass: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, ArrayConstructor], unknown, unknown>;
90
+ readonly viewClass: import("@element-plus/utils").EpPropMergeType<readonly [StringConstructor, ArrayConstructor], unknown, unknown>;
91
+ readonly viewStyle: StyleValue;
92
+ readonly native: boolean;
93
+ readonly noresize: boolean;
94
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
95
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
96
+ export default _default;
97
+ type __VLS_WithSlots<T, S> = T & {
98
+ new (): {
99
+ $slots: S;
100
+ };
101
+ };
@@ -0,0 +1,178 @@
1
+ import { defineComponent as G, ref as h, computed as S, watch as z, nextTick as L, provide as q, reactive as F, onActivated as J, onMounted as Q, onUpdated as X, openBlock as w, createElementBlock as Y, normalizeClass as y, unref as Z, createElementVNode as ee, normalizeStyle as N, createBlock as R, resolveDynamicComponent as te, withCtx as oe, renderSlot as re, createCommentVNode as le } from "vue";
2
+ import { useResizeObserver as H, useEventListener as ie } from "@vueuse/core";
3
+ import { isNumber as b } from "../../../utils/types.js";
4
+ import "lodash-unified";
5
+ import { debugWarn as _ } from "../../../utils/error.js";
6
+ import { isObject as ae } from "@vue/shared";
7
+ import { isGreaterThan as A } from "../../../utils/numbers.js";
8
+ import { addUnit as D } from "../../../utils/dom/style.js";
9
+ import "@element-plus/icons-vue";
10
+ import { useNamespace as se } from "../../../hooks/use-namespace/index.js";
11
+ import "../../../hooks/use-size/index.js";
12
+ import "@popperjs/core";
13
+ import "../../../hooks/use-z-index/index.js";
14
+ import "../../../hooks/use-delayed-toggle/index.js";
15
+ import "../../../hooks/use-aria/index.js";
16
+ import "../../../hooks/use-model-toggle/index.js";
17
+ import "../../../hooks/use-empty-values/index.js";
18
+ import ne from "./bar.vue.js";
19
+ import { scrollbarContextKey as ce } from "./constants.js";
20
+ import { scrollbarEmits as fe, scrollbarProps as me } from "./scrollbar.js";
21
+ const pe = ["tabindex"], g = "ElScrollbar", De = /* @__PURE__ */ G({
22
+ name: g,
23
+ __name: "scrollbar",
24
+ props: me,
25
+ emits: fe,
26
+ setup(O, { expose: B, emit: I }) {
27
+ const r = O, T = I, f = se("scrollbar");
28
+ let m, p, u, s = 0, i = 0, l = "";
29
+ const c = {
30
+ bottom: !1,
31
+ top: !1,
32
+ right: !1,
33
+ left: !1
34
+ }, k = h(), t = h(), C = h(), d = h(), K = S(() => {
35
+ const e = {}, o = D(r.height), a = D(r.maxHeight);
36
+ return o && (e.height = o), a && (e.maxHeight = a), [r.wrapStyle, e];
37
+ }), M = S(() => [
38
+ r.wrapClass,
39
+ f.e("wrap"),
40
+ { [f.em("wrap", "hidden-default")]: !r.native }
41
+ ]), P = S(() => [f.e("view"), r.viewClass]), x = (e) => c[e] ?? !1, U = {
42
+ top: "bottom",
43
+ bottom: "top",
44
+ left: "right",
45
+ right: "left"
46
+ }, V = (e) => {
47
+ const o = U[l];
48
+ if (!o) return;
49
+ const a = e[l], v = e[o];
50
+ a && !c[l] && (c[l] = !0), !v && c[o] && (c[o] = !1);
51
+ }, E = () => {
52
+ var e;
53
+ if (t.value) {
54
+ (e = d.value) == null || e.handleScroll(t.value);
55
+ const o = s, a = i;
56
+ s = t.value.scrollTop, i = t.value.scrollLeft;
57
+ const v = {
58
+ bottom: !A(
59
+ t.value.scrollHeight - r.distance,
60
+ t.value.clientHeight + s
61
+ ),
62
+ top: s <= r.distance && o !== 0,
63
+ right: !A(
64
+ t.value.scrollWidth - r.distance,
65
+ t.value.clientWidth + i
66
+ ) && a !== i,
67
+ left: i <= r.distance && a !== 0
68
+ };
69
+ if (T("scroll", {
70
+ scrollTop: s,
71
+ scrollLeft: i
72
+ }), o !== s && (l = s > o ? "bottom" : "top"), a !== i && (l = i > a ? "right" : "left"), r.distance > 0) {
73
+ if (x(l))
74
+ return;
75
+ V(v);
76
+ }
77
+ v[l] && T("end-reached", l);
78
+ }
79
+ };
80
+ function W(e, o) {
81
+ ae(e) ? t.value.scrollTo(e) : b(e) && b(o) && t.value.scrollTo(e, o);
82
+ }
83
+ const $ = (e) => {
84
+ if (!b(e)) {
85
+ _(g, "value must be a number");
86
+ return;
87
+ }
88
+ t.value.scrollTop = e;
89
+ }, j = (e) => {
90
+ if (!b(e)) {
91
+ _(g, "value must be a number");
92
+ return;
93
+ }
94
+ t.value.scrollLeft = e;
95
+ }, n = () => {
96
+ var e, o;
97
+ (e = d.value) == null || e.update(), c[l] = !1, t.value && ((o = d.value) == null || o.handleScroll(t.value));
98
+ };
99
+ return z(
100
+ () => r.noresize,
101
+ (e) => {
102
+ e ? (m == null || m(), p == null || p(), u == null || u()) : ({ stop: m } = H(C, n), { stop: p } = H(t, n), u = ie("resize", n));
103
+ },
104
+ { immediate: !0 }
105
+ ), z(
106
+ () => [r.maxHeight, r.height],
107
+ () => {
108
+ r.native || L(() => {
109
+ n();
110
+ });
111
+ }
112
+ ), q(
113
+ ce,
114
+ F({
115
+ scrollbarElement: k,
116
+ wrapElement: t
117
+ })
118
+ ), J(() => {
119
+ t.value && (t.value.scrollTop = s, t.value.scrollLeft = i);
120
+ }), Q(() => {
121
+ r.native || L(() => {
122
+ n();
123
+ });
124
+ }), X(() => n()), B({
125
+ /** @description scrollbar wrap ref */
126
+ wrapRef: t,
127
+ /** @description update scrollbar state manually */
128
+ update: n,
129
+ /** @description scrolls to a particular set of coordinates */
130
+ scrollTo: W,
131
+ /** @description set distance to scroll top */
132
+ setScrollTop: $,
133
+ /** @description set distance to scroll left */
134
+ setScrollLeft: j,
135
+ /** @description handle scroll event */
136
+ handleScroll: E
137
+ }), (e, o) => (w(), Y("div", {
138
+ ref_key: "scrollbarRef",
139
+ ref: k,
140
+ class: y(Z(f).b())
141
+ }, [
142
+ ee("div", {
143
+ ref_key: "wrapRef",
144
+ ref: t,
145
+ class: y(M.value),
146
+ style: N(K.value),
147
+ tabindex: e.tabindex,
148
+ onScroll: E
149
+ }, [
150
+ (w(), R(te(e.tag), {
151
+ id: e.id,
152
+ ref_key: "resizeRef",
153
+ ref: C,
154
+ class: y(P.value),
155
+ style: N(e.viewStyle),
156
+ role: e.role,
157
+ "aria-label": e.ariaLabel,
158
+ "aria-orientation": e.ariaOrientation
159
+ }, {
160
+ default: oe(() => [
161
+ re(e.$slots, "default")
162
+ ]),
163
+ _: 3
164
+ }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
165
+ ], 46, pe),
166
+ e.native ? le("", !0) : (w(), R(ne, {
167
+ key: 0,
168
+ ref_key: "barRef",
169
+ ref: d,
170
+ always: e.always,
171
+ "min-size": e.minSize
172
+ }, null, 8, ["always", "min-size"]))
173
+ ], 2));
174
+ }
175
+ });
176
+ export {
177
+ De as default
178
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./scrollbar.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,29 @@
1
+ import type { ExtractPublicPropTypes } from 'vue';
2
+ import type Thumb from './thumb.vue';
3
+ export interface ThumbProps {
4
+ vertical?: boolean;
5
+ size?: string;
6
+ move?: number;
7
+ ratio: number;
8
+ always?: boolean;
9
+ }
10
+ /**
11
+ * @deprecated Removed after 3.0.0, Use `ThumbProps` instead.
12
+ */
13
+ export declare const thumbProps: {
14
+ readonly vertical: BooleanConstructor;
15
+ readonly size: StringConstructor;
16
+ readonly move: NumberConstructor;
17
+ readonly ratio: {
18
+ readonly type: import("vue").PropType<number>;
19
+ readonly required: true;
20
+ readonly validator: ((val: unknown) => boolean) | undefined;
21
+ __epPropKey: true;
22
+ };
23
+ readonly always: BooleanConstructor;
24
+ };
25
+ /**
26
+ * @deprecated Removed after 3.0.0, Use `ThumbProps` instead.
27
+ */
28
+ export type ThumbPropsPublic = ExtractPublicPropTypes<typeof thumbProps>;
29
+ export type ThumbInstance = InstanceType<typeof Thumb> & unknown;
@@ -0,0 +1,19 @@
1
+ import "@vue/shared";
2
+ import "lodash-unified";
3
+ import "@vueuse/core";
4
+ import "@element-plus/icons-vue";
5
+ import { buildProps as r } from "../../../utils/vue/props/runtime.js";
6
+ import "vue";
7
+ const a = r({
8
+ vertical: Boolean,
9
+ size: String,
10
+ move: Number,
11
+ ratio: {
12
+ type: Number,
13
+ required: !0
14
+ },
15
+ always: Boolean
16
+ });
17
+ export {
18
+ a as thumbProps
19
+ };