@element-plus/nightly 0.0.20240307 → 0.0.20240309

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 (288) hide show
  1. package/dist/index.full.js +7 -3
  2. package/dist/index.full.min.js +2 -2
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +2 -2
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +7 -3
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/nb-no.js +1 -1
  152. package/dist/locale/nb-no.min.js +1 -1
  153. package/dist/locale/nb-no.min.mjs +1 -1
  154. package/dist/locale/nb-no.mjs +1 -1
  155. package/dist/locale/nl.js +1 -1
  156. package/dist/locale/nl.min.js +1 -1
  157. package/dist/locale/nl.min.mjs +1 -1
  158. package/dist/locale/nl.mjs +1 -1
  159. package/dist/locale/pa.js +1 -1
  160. package/dist/locale/pa.min.js +1 -1
  161. package/dist/locale/pa.min.mjs +1 -1
  162. package/dist/locale/pa.mjs +1 -1
  163. package/dist/locale/pl.js +1 -1
  164. package/dist/locale/pl.min.js +1 -1
  165. package/dist/locale/pl.min.mjs +1 -1
  166. package/dist/locale/pl.mjs +1 -1
  167. package/dist/locale/pt-br.js +1 -1
  168. package/dist/locale/pt-br.min.js +1 -1
  169. package/dist/locale/pt-br.min.mjs +1 -1
  170. package/dist/locale/pt-br.mjs +1 -1
  171. package/dist/locale/pt.js +1 -1
  172. package/dist/locale/pt.min.js +1 -1
  173. package/dist/locale/pt.min.mjs +1 -1
  174. package/dist/locale/pt.mjs +1 -1
  175. package/dist/locale/ro.js +1 -1
  176. package/dist/locale/ro.min.js +1 -1
  177. package/dist/locale/ro.min.mjs +1 -1
  178. package/dist/locale/ro.mjs +1 -1
  179. package/dist/locale/ru.js +1 -1
  180. package/dist/locale/ru.min.js +1 -1
  181. package/dist/locale/ru.min.mjs +1 -1
  182. package/dist/locale/ru.mjs +1 -1
  183. package/dist/locale/sk.js +1 -1
  184. package/dist/locale/sk.min.js +1 -1
  185. package/dist/locale/sk.min.mjs +1 -1
  186. package/dist/locale/sk.mjs +1 -1
  187. package/dist/locale/sl.js +1 -1
  188. package/dist/locale/sl.min.js +1 -1
  189. package/dist/locale/sl.min.mjs +1 -1
  190. package/dist/locale/sl.mjs +1 -1
  191. package/dist/locale/sr.js +1 -1
  192. package/dist/locale/sr.min.js +1 -1
  193. package/dist/locale/sr.min.mjs +1 -1
  194. package/dist/locale/sr.mjs +1 -1
  195. package/dist/locale/sv.js +1 -1
  196. package/dist/locale/sv.min.js +1 -1
  197. package/dist/locale/sv.min.mjs +1 -1
  198. package/dist/locale/sv.mjs +1 -1
  199. package/dist/locale/sw.js +1 -1
  200. package/dist/locale/sw.min.js +1 -1
  201. package/dist/locale/sw.min.mjs +1 -1
  202. package/dist/locale/sw.mjs +1 -1
  203. package/dist/locale/ta.js +1 -1
  204. package/dist/locale/ta.min.js +1 -1
  205. package/dist/locale/ta.min.mjs +1 -1
  206. package/dist/locale/ta.mjs +1 -1
  207. package/dist/locale/th.js +1 -1
  208. package/dist/locale/th.min.js +1 -1
  209. package/dist/locale/th.min.mjs +1 -1
  210. package/dist/locale/th.mjs +1 -1
  211. package/dist/locale/tk.js +1 -1
  212. package/dist/locale/tk.min.js +1 -1
  213. package/dist/locale/tk.min.mjs +1 -1
  214. package/dist/locale/tk.mjs +1 -1
  215. package/dist/locale/tr.js +1 -1
  216. package/dist/locale/tr.min.js +1 -1
  217. package/dist/locale/tr.min.mjs +1 -1
  218. package/dist/locale/tr.mjs +1 -1
  219. package/dist/locale/ug-cn.js +1 -1
  220. package/dist/locale/ug-cn.min.js +1 -1
  221. package/dist/locale/ug-cn.min.mjs +1 -1
  222. package/dist/locale/ug-cn.mjs +1 -1
  223. package/dist/locale/uk.js +1 -1
  224. package/dist/locale/uk.min.js +1 -1
  225. package/dist/locale/uk.min.mjs +1 -1
  226. package/dist/locale/uk.mjs +1 -1
  227. package/dist/locale/uz-uz.js +1 -1
  228. package/dist/locale/uz-uz.min.js +1 -1
  229. package/dist/locale/uz-uz.min.mjs +1 -1
  230. package/dist/locale/uz-uz.mjs +1 -1
  231. package/dist/locale/vi.js +1 -1
  232. package/dist/locale/vi.min.js +1 -1
  233. package/dist/locale/vi.min.mjs +1 -1
  234. package/dist/locale/vi.mjs +1 -1
  235. package/dist/locale/zh-cn.js +1 -1
  236. package/dist/locale/zh-cn.min.js +1 -1
  237. package/dist/locale/zh-cn.min.mjs +1 -1
  238. package/dist/locale/zh-cn.mjs +1 -1
  239. package/dist/locale/zh-tw.js +1 -1
  240. package/dist/locale/zh-tw.min.js +1 -1
  241. package/dist/locale/zh-tw.min.mjs +1 -1
  242. package/dist/locale/zh-tw.mjs +1 -1
  243. package/es/components/anchor/index.mjs +2 -2
  244. package/es/components/anchor/src/anchor.mjs +38 -193
  245. package/es/components/anchor/src/anchor.mjs.map +1 -1
  246. package/es/components/anchor/src/anchor2.mjs +193 -38
  247. package/es/components/anchor/src/anchor2.mjs.map +1 -1
  248. package/es/components/autocomplete/index.mjs +2 -2
  249. package/es/components/autocomplete/src/autocomplete.mjs +363 -81
  250. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  251. package/es/components/autocomplete/src/autocomplete2.mjs +81 -363
  252. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  253. package/es/components/index.mjs +3 -3
  254. package/es/components/scrollbar/index.mjs +2 -2
  255. package/es/components/scrollbar/src/scrollbar.mjs +160 -53
  256. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  257. package/es/components/scrollbar/src/scrollbar2.mjs +53 -160
  258. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  259. package/es/index.mjs +3 -3
  260. package/es/utils/dom/element.mjs +5 -1
  261. package/es/utils/dom/element.mjs.map +1 -1
  262. package/es/version.d.ts +1 -1
  263. package/es/version.mjs +1 -1
  264. package/es/version.mjs.map +1 -1
  265. package/lib/components/anchor/index.js +2 -2
  266. package/lib/components/anchor/src/anchor.js +38 -192
  267. package/lib/components/anchor/src/anchor.js.map +1 -1
  268. package/lib/components/anchor/src/anchor2.js +192 -38
  269. package/lib/components/anchor/src/anchor2.js.map +1 -1
  270. package/lib/components/autocomplete/index.js +2 -2
  271. package/lib/components/autocomplete/src/autocomplete.js +362 -81
  272. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  273. package/lib/components/autocomplete/src/autocomplete2.js +81 -362
  274. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  275. package/lib/components/index.js +3 -3
  276. package/lib/components/scrollbar/index.js +2 -2
  277. package/lib/components/scrollbar/src/scrollbar.js +160 -54
  278. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  279. package/lib/components/scrollbar/src/scrollbar2.js +54 -160
  280. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  281. package/lib/index.js +3 -3
  282. package/lib/utils/dom/element.js +5 -1
  283. package/lib/utils/dom/element.js.map +1 -1
  284. package/lib/version.d.ts +1 -1
  285. package/lib/version.js +1 -1
  286. package/lib/version.js.map +1 -1
  287. package/package.json +2 -2
  288. package/web-types.json +1 -1
@@ -2,64 +2,170 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var vue = require('vue');
6
+ var core = require('@vueuse/core');
5
7
  require('../../../utils/index.js');
6
- var runtime = require('../../../utils/vue/props/runtime.js');
8
+ require('../../../hooks/index.js');
9
+ var bar = require('./bar2.js');
10
+ var constants = require('./constants.js');
11
+ var scrollbar = require('./scrollbar2.js');
12
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
13
+ var index = require('../../../hooks/use-namespace/index.js');
14
+ var style = require('../../../utils/dom/style.js');
15
+ var shared = require('@vue/shared');
7
16
  var types = require('../../../utils/types.js');
17
+ var error = require('../../../utils/error.js');
8
18
 
9
- const scrollbarProps = runtime.buildProps({
10
- height: {
11
- type: [String, Number],
12
- default: ""
13
- },
14
- maxHeight: {
15
- type: [String, Number],
16
- default: ""
17
- },
18
- native: {
19
- type: Boolean,
20
- default: false
21
- },
22
- wrapStyle: {
23
- type: runtime.definePropType([String, Object, Array]),
24
- default: ""
25
- },
26
- wrapClass: {
27
- type: [String, Array],
28
- default: ""
29
- },
30
- viewClass: {
31
- type: [String, Array],
32
- default: ""
33
- },
34
- viewStyle: {
35
- type: [String, Array, Object],
36
- default: ""
37
- },
38
- noresize: Boolean,
39
- tag: {
40
- type: String,
41
- default: "div"
42
- },
43
- always: Boolean,
44
- minSize: {
45
- type: Number,
46
- default: 20
47
- },
48
- id: String,
49
- role: String,
50
- ariaLabel: String,
51
- ariaOrientation: {
52
- type: String,
53
- values: ["horizontal", "vertical"]
19
+ const COMPONENT_NAME = "ElScrollbar";
20
+ const __default__ = vue.defineComponent({
21
+ name: COMPONENT_NAME
22
+ });
23
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
24
+ ...__default__,
25
+ props: scrollbar.scrollbarProps,
26
+ emits: scrollbar.scrollbarEmits,
27
+ setup(__props, { expose, emit }) {
28
+ const props = __props;
29
+ const ns = index.useNamespace("scrollbar");
30
+ let stopResizeObserver = void 0;
31
+ let stopResizeListener = void 0;
32
+ const scrollbarRef = vue.ref();
33
+ const wrapRef = vue.ref();
34
+ const resizeRef = vue.ref();
35
+ const barRef = vue.ref();
36
+ const wrapStyle = vue.computed(() => {
37
+ const style$1 = {};
38
+ if (props.height)
39
+ style$1.height = style.addUnit(props.height);
40
+ if (props.maxHeight)
41
+ style$1.maxHeight = style.addUnit(props.maxHeight);
42
+ return [props.wrapStyle, style$1];
43
+ });
44
+ const wrapKls = vue.computed(() => {
45
+ return [
46
+ props.wrapClass,
47
+ ns.e("wrap"),
48
+ { [ns.em("wrap", "hidden-default")]: !props.native }
49
+ ];
50
+ });
51
+ const resizeKls = vue.computed(() => {
52
+ return [ns.e("view"), props.viewClass];
53
+ });
54
+ const handleScroll = () => {
55
+ var _a;
56
+ if (wrapRef.value) {
57
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
58
+ emit("scroll", {
59
+ scrollTop: wrapRef.value.scrollTop,
60
+ scrollLeft: wrapRef.value.scrollLeft
61
+ });
62
+ }
63
+ };
64
+ function scrollTo(arg1, arg2) {
65
+ if (shared.isObject(arg1)) {
66
+ wrapRef.value.scrollTo(arg1);
67
+ } else if (types.isNumber(arg1) && types.isNumber(arg2)) {
68
+ wrapRef.value.scrollTo(arg1, arg2);
69
+ }
70
+ }
71
+ const setScrollTop = (value) => {
72
+ if (!types.isNumber(value)) {
73
+ error.debugWarn(COMPONENT_NAME, "value must be a number");
74
+ return;
75
+ }
76
+ wrapRef.value.scrollTop = value;
77
+ };
78
+ const setScrollLeft = (value) => {
79
+ if (!types.isNumber(value)) {
80
+ error.debugWarn(COMPONENT_NAME, "value must be a number");
81
+ return;
82
+ }
83
+ wrapRef.value.scrollLeft = value;
84
+ };
85
+ const update = () => {
86
+ var _a;
87
+ (_a = barRef.value) == null ? void 0 : _a.update();
88
+ };
89
+ vue.watch(() => props.noresize, (noresize) => {
90
+ if (noresize) {
91
+ stopResizeObserver == null ? void 0 : stopResizeObserver();
92
+ stopResizeListener == null ? void 0 : stopResizeListener();
93
+ } else {
94
+ ;
95
+ ({ stop: stopResizeObserver } = core.useResizeObserver(resizeRef, update));
96
+ stopResizeListener = core.useEventListener("resize", update);
97
+ }
98
+ }, { immediate: true });
99
+ vue.watch(() => [props.maxHeight, props.height], () => {
100
+ if (!props.native)
101
+ vue.nextTick(() => {
102
+ var _a;
103
+ update();
104
+ if (wrapRef.value) {
105
+ (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
106
+ }
107
+ });
108
+ });
109
+ vue.provide(constants.scrollbarContextKey, vue.reactive({
110
+ scrollbarElement: scrollbarRef,
111
+ wrapElement: wrapRef
112
+ }));
113
+ vue.onMounted(() => {
114
+ if (!props.native)
115
+ vue.nextTick(() => {
116
+ update();
117
+ });
118
+ });
119
+ vue.onUpdated(() => update());
120
+ expose({
121
+ wrapRef,
122
+ update,
123
+ scrollTo,
124
+ setScrollTop,
125
+ setScrollLeft,
126
+ handleScroll
127
+ });
128
+ return (_ctx, _cache) => {
129
+ return vue.openBlock(), vue.createElementBlock("div", {
130
+ ref_key: "scrollbarRef",
131
+ ref: scrollbarRef,
132
+ class: vue.normalizeClass(vue.unref(ns).b())
133
+ }, [
134
+ vue.createElementVNode("div", {
135
+ ref_key: "wrapRef",
136
+ ref: wrapRef,
137
+ class: vue.normalizeClass(vue.unref(wrapKls)),
138
+ style: vue.normalizeStyle(vue.unref(wrapStyle)),
139
+ onScroll: handleScroll
140
+ }, [
141
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
142
+ id: _ctx.id,
143
+ ref_key: "resizeRef",
144
+ ref: resizeRef,
145
+ class: vue.normalizeClass(vue.unref(resizeKls)),
146
+ style: vue.normalizeStyle(_ctx.viewStyle),
147
+ role: _ctx.role,
148
+ "aria-label": _ctx.ariaLabel,
149
+ "aria-orientation": _ctx.ariaOrientation
150
+ }, {
151
+ default: vue.withCtx(() => [
152
+ vue.renderSlot(_ctx.$slots, "default")
153
+ ]),
154
+ _: 3
155
+ }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
156
+ ], 38),
157
+ !_ctx.native ? (vue.openBlock(), vue.createBlock(bar["default"], {
158
+ key: 0,
159
+ ref_key: "barRef",
160
+ ref: barRef,
161
+ always: _ctx.always,
162
+ "min-size": _ctx.minSize
163
+ }, null, 8, ["always", "min-size"])) : vue.createCommentVNode("v-if", true)
164
+ ], 2);
165
+ };
54
166
  }
55
167
  });
56
- const scrollbarEmits = {
57
- scroll: ({
58
- scrollTop,
59
- scrollLeft
60
- }) => [scrollTop, scrollLeft].every(types.isNumber)
61
- };
168
+ var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "scrollbar.vue"]]);
62
169
 
63
- exports.scrollbarEmits = scrollbarEmits;
64
- exports.scrollbarProps = scrollbarProps;
170
+ exports["default"] = Scrollbar;
65
171
  //# sourceMappingURL=scrollbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport const scrollbarProps = buildProps({\n /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: {\n type: Boolean,\n default: false,\n },\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\n minSize: {\n type: Number,\n default: 20,\n },\n /**\n * @description id of view\n */\n id: String,\n /**\n * @description role of view\n */\n role: String,\n /**\n * @description aria-label of view\n */\n ariaLabel: String,\n /**\n * @description aria-orientation of view\n */\n ariaOrientation: {\n type: String,\n values: ['horizontal', 'vertical'],\n },\n} as const)\nexport type ScrollbarProps = ExtractPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n scroll: ({\n scrollTop,\n scrollLeft,\n }: {\n scrollTop: number\n scrollLeft: number\n }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar>\n"],"names":["buildProps","definePropType","isNumber"],"mappings":";;;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AACjC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,MAAM,EAAE,CAAC;AACX,IAAI,SAAS;AACb,IAAI,UAAU;AACd,GAAG,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,KAAK,CAACC,cAAQ,CAAC;AAC/C;;;;;"}
1
+ {"version":3,"file":"scrollbar.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbarRef\" :class=\"ns.b()\">\n <div\n ref=\"wrapRef\"\n :class=\"wrapKls\"\n :style=\"wrapStyle\"\n @scroll=\"handleScroll\"\n >\n <component\n :is=\"tag\"\n :id=\"id\"\n ref=\"resizeRef\"\n :class=\"resizeKls\"\n :style=\"viewStyle\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n :aria-orientation=\"ariaOrientation\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar ref=\"barRef\" :always=\"always\" :min-size=\"minSize\" />\n </template>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { addUnit, debugWarn, isNumber, isObject } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport Bar from './bar.vue'\nimport { scrollbarContextKey } from './constants'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nconst COMPONENT_NAME = 'ElScrollbar'\n\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(scrollbarProps)\nconst emit = defineEmits(scrollbarEmits)\n\nconst ns = useNamespace('scrollbar')\n\nlet stopResizeObserver: (() => void) | undefined = undefined\nlet stopResizeListener: (() => void) | undefined = undefined\n\nconst scrollbarRef = ref<HTMLDivElement>()\nconst wrapRef = ref<HTMLDivElement>()\nconst resizeRef = ref<HTMLElement>()\nconst barRef = ref<BarInstance>()\n\nconst wrapStyle = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n})\n\nconst wrapKls = computed(() => {\n return [\n props.wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !props.native },\n ]\n})\n\nconst resizeKls = computed(() => {\n return [ns.e('view'), props.viewClass]\n})\n\nconst handleScroll = () => {\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n\n emit('scroll', {\n scrollTop: wrapRef.value.scrollTop,\n scrollLeft: wrapRef.value.scrollLeft,\n })\n }\n}\n\n// TODO: refactor method overrides, due to script setup dts\n// @ts-nocheck\nfunction scrollTo(xCord: number, yCord?: number): void\nfunction scrollTo(options: ScrollToOptions): void\nfunction scrollTo(arg1: unknown, arg2?: number) {\n if (isObject(arg1)) {\n wrapRef.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrapRef.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollLeft = value\n}\n\nconst update = () => {\n barRef.value?.update()\n}\n\nwatch(\n () => props.noresize,\n (noresize) => {\n if (noresize) {\n stopResizeObserver?.()\n stopResizeListener?.()\n } else {\n ;({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update))\n stopResizeListener = useEventListener('resize', update)\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => [props.maxHeight, props.height],\n () => {\n if (!props.native)\n nextTick(() => {\n update()\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbarRef,\n wrapElement: wrapRef,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrapRef,\n /** @description update scrollbar state manually */\n update,\n /** @description scrolls to a particular set of coordinates */\n scrollTo,\n /** @description set distance to scroll top */\n setScrollTop,\n /** @description set distance to scroll left */\n setScrollLeft,\n /** @description handle scroll event */\n handleScroll,\n})\n</script>\n"],"names":["useNamespace","ref","computed","style","addUnit","isObject","isNumber","debugWarn","watch","useResizeObserver","useEventListener","nextTick","provide","scrollbarContextKey","reactive","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AACnD,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,IAAA,MAAM,eAAeC,OAAoB,EAAA,CAAA;AACzC,IAAA,MAAM,UAAUA,OAAoB,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A;AAAA,IAEA,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MAEA,MAAA;AAAA,MAEA,QAAA;AAAA,MACD,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,170 +2,64 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var vue = require('vue');
6
- var core = require('@vueuse/core');
7
5
  require('../../../utils/index.js');
8
- require('../../../hooks/index.js');
9
- var bar = require('./bar2.js');
10
- var constants = require('./constants.js');
11
- var scrollbar = require('./scrollbar.js');
12
- var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
13
- var index = require('../../../hooks/use-namespace/index.js');
14
- var style = require('../../../utils/dom/style.js');
15
- var shared = require('@vue/shared');
6
+ var runtime = require('../../../utils/vue/props/runtime.js');
16
7
  var types = require('../../../utils/types.js');
17
- var error = require('../../../utils/error.js');
18
8
 
19
- const COMPONENT_NAME = "ElScrollbar";
20
- const __default__ = vue.defineComponent({
21
- name: COMPONENT_NAME
22
- });
23
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
24
- ...__default__,
25
- props: scrollbar.scrollbarProps,
26
- emits: scrollbar.scrollbarEmits,
27
- setup(__props, { expose, emit }) {
28
- const props = __props;
29
- const ns = index.useNamespace("scrollbar");
30
- let stopResizeObserver = void 0;
31
- let stopResizeListener = void 0;
32
- const scrollbarRef = vue.ref();
33
- const wrapRef = vue.ref();
34
- const resizeRef = vue.ref();
35
- const barRef = vue.ref();
36
- const wrapStyle = vue.computed(() => {
37
- const style$1 = {};
38
- if (props.height)
39
- style$1.height = style.addUnit(props.height);
40
- if (props.maxHeight)
41
- style$1.maxHeight = style.addUnit(props.maxHeight);
42
- return [props.wrapStyle, style$1];
43
- });
44
- const wrapKls = vue.computed(() => {
45
- return [
46
- props.wrapClass,
47
- ns.e("wrap"),
48
- { [ns.em("wrap", "hidden-default")]: !props.native }
49
- ];
50
- });
51
- const resizeKls = vue.computed(() => {
52
- return [ns.e("view"), props.viewClass];
53
- });
54
- const handleScroll = () => {
55
- var _a;
56
- if (wrapRef.value) {
57
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
58
- emit("scroll", {
59
- scrollTop: wrapRef.value.scrollTop,
60
- scrollLeft: wrapRef.value.scrollLeft
61
- });
62
- }
63
- };
64
- function scrollTo(arg1, arg2) {
65
- if (shared.isObject(arg1)) {
66
- wrapRef.value.scrollTo(arg1);
67
- } else if (types.isNumber(arg1) && types.isNumber(arg2)) {
68
- wrapRef.value.scrollTo(arg1, arg2);
69
- }
70
- }
71
- const setScrollTop = (value) => {
72
- if (!types.isNumber(value)) {
73
- error.debugWarn(COMPONENT_NAME, "value must be a number");
74
- return;
75
- }
76
- wrapRef.value.scrollTop = value;
77
- };
78
- const setScrollLeft = (value) => {
79
- if (!types.isNumber(value)) {
80
- error.debugWarn(COMPONENT_NAME, "value must be a number");
81
- return;
82
- }
83
- wrapRef.value.scrollLeft = value;
84
- };
85
- const update = () => {
86
- var _a;
87
- (_a = barRef.value) == null ? void 0 : _a.update();
88
- };
89
- vue.watch(() => props.noresize, (noresize) => {
90
- if (noresize) {
91
- stopResizeObserver == null ? void 0 : stopResizeObserver();
92
- stopResizeListener == null ? void 0 : stopResizeListener();
93
- } else {
94
- ;
95
- ({ stop: stopResizeObserver } = core.useResizeObserver(resizeRef, update));
96
- stopResizeListener = core.useEventListener("resize", update);
97
- }
98
- }, { immediate: true });
99
- vue.watch(() => [props.maxHeight, props.height], () => {
100
- if (!props.native)
101
- vue.nextTick(() => {
102
- var _a;
103
- update();
104
- if (wrapRef.value) {
105
- (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
106
- }
107
- });
108
- });
109
- vue.provide(constants.scrollbarContextKey, vue.reactive({
110
- scrollbarElement: scrollbarRef,
111
- wrapElement: wrapRef
112
- }));
113
- vue.onMounted(() => {
114
- if (!props.native)
115
- vue.nextTick(() => {
116
- update();
117
- });
118
- });
119
- vue.onUpdated(() => update());
120
- expose({
121
- wrapRef,
122
- update,
123
- scrollTo,
124
- setScrollTop,
125
- setScrollLeft,
126
- handleScroll
127
- });
128
- return (_ctx, _cache) => {
129
- return vue.openBlock(), vue.createElementBlock("div", {
130
- ref_key: "scrollbarRef",
131
- ref: scrollbarRef,
132
- class: vue.normalizeClass(vue.unref(ns).b())
133
- }, [
134
- vue.createElementVNode("div", {
135
- ref_key: "wrapRef",
136
- ref: wrapRef,
137
- class: vue.normalizeClass(vue.unref(wrapKls)),
138
- style: vue.normalizeStyle(vue.unref(wrapStyle)),
139
- onScroll: handleScroll
140
- }, [
141
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
142
- id: _ctx.id,
143
- ref_key: "resizeRef",
144
- ref: resizeRef,
145
- class: vue.normalizeClass(vue.unref(resizeKls)),
146
- style: vue.normalizeStyle(_ctx.viewStyle),
147
- role: _ctx.role,
148
- "aria-label": _ctx.ariaLabel,
149
- "aria-orientation": _ctx.ariaOrientation
150
- }, {
151
- default: vue.withCtx(() => [
152
- vue.renderSlot(_ctx.$slots, "default")
153
- ]),
154
- _: 3
155
- }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
156
- ], 38),
157
- !_ctx.native ? (vue.openBlock(), vue.createBlock(bar["default"], {
158
- key: 0,
159
- ref_key: "barRef",
160
- ref: barRef,
161
- always: _ctx.always,
162
- "min-size": _ctx.minSize
163
- }, null, 8, ["always", "min-size"])) : vue.createCommentVNode("v-if", true)
164
- ], 2);
165
- };
9
+ const scrollbarProps = runtime.buildProps({
10
+ height: {
11
+ type: [String, Number],
12
+ default: ""
13
+ },
14
+ maxHeight: {
15
+ type: [String, Number],
16
+ default: ""
17
+ },
18
+ native: {
19
+ type: Boolean,
20
+ default: false
21
+ },
22
+ wrapStyle: {
23
+ type: runtime.definePropType([String, Object, Array]),
24
+ default: ""
25
+ },
26
+ wrapClass: {
27
+ type: [String, Array],
28
+ default: ""
29
+ },
30
+ viewClass: {
31
+ type: [String, Array],
32
+ default: ""
33
+ },
34
+ viewStyle: {
35
+ type: [String, Array, Object],
36
+ default: ""
37
+ },
38
+ noresize: Boolean,
39
+ tag: {
40
+ type: String,
41
+ default: "div"
42
+ },
43
+ always: Boolean,
44
+ minSize: {
45
+ type: Number,
46
+ default: 20
47
+ },
48
+ id: String,
49
+ role: String,
50
+ ariaLabel: String,
51
+ ariaOrientation: {
52
+ type: String,
53
+ values: ["horizontal", "vertical"]
166
54
  }
167
55
  });
168
- var Scrollbar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "scrollbar.vue"]]);
56
+ const scrollbarEmits = {
57
+ scroll: ({
58
+ scrollTop,
59
+ scrollLeft
60
+ }) => [scrollTop, scrollLeft].every(types.isNumber)
61
+ };
169
62
 
170
- exports["default"] = Scrollbar;
63
+ exports.scrollbarEmits = scrollbarEmits;
64
+ exports.scrollbarProps = scrollbarProps;
171
65
  //# sourceMappingURL=scrollbar2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scrollbar2.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbarRef\" :class=\"ns.b()\">\n <div\n ref=\"wrapRef\"\n :class=\"wrapKls\"\n :style=\"wrapStyle\"\n @scroll=\"handleScroll\"\n >\n <component\n :is=\"tag\"\n :id=\"id\"\n ref=\"resizeRef\"\n :class=\"resizeKls\"\n :style=\"viewStyle\"\n :role=\"role\"\n :aria-label=\"ariaLabel\"\n :aria-orientation=\"ariaOrientation\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar ref=\"barRef\" :always=\"always\" :min-size=\"minSize\" />\n </template>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport {\n computed,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n reactive,\n ref,\n watch,\n} from 'vue'\nimport { useEventListener, useResizeObserver } from '@vueuse/core'\nimport { addUnit, debugWarn, isNumber, isObject } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport Bar from './bar.vue'\nimport { scrollbarContextKey } from './constants'\nimport { scrollbarEmits, scrollbarProps } from './scrollbar'\nimport type { BarInstance } from './bar'\nimport type { CSSProperties, StyleValue } from 'vue'\n\nconst COMPONENT_NAME = 'ElScrollbar'\n\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(scrollbarProps)\nconst emit = defineEmits(scrollbarEmits)\n\nconst ns = useNamespace('scrollbar')\n\nlet stopResizeObserver: (() => void) | undefined = undefined\nlet stopResizeListener: (() => void) | undefined = undefined\n\nconst scrollbarRef = ref<HTMLDivElement>()\nconst wrapRef = ref<HTMLDivElement>()\nconst resizeRef = ref<HTMLElement>()\nconst barRef = ref<BarInstance>()\n\nconst wrapStyle = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n})\n\nconst wrapKls = computed(() => {\n return [\n props.wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !props.native },\n ]\n})\n\nconst resizeKls = computed(() => {\n return [ns.e('view'), props.viewClass]\n})\n\nconst handleScroll = () => {\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n\n emit('scroll', {\n scrollTop: wrapRef.value.scrollTop,\n scrollLeft: wrapRef.value.scrollLeft,\n })\n }\n}\n\n// TODO: refactor method overrides, due to script setup dts\n// @ts-nocheck\nfunction scrollTo(xCord: number, yCord?: number): void\nfunction scrollTo(options: ScrollToOptions): void\nfunction scrollTo(arg1: unknown, arg2?: number) {\n if (isObject(arg1)) {\n wrapRef.value!.scrollTo(arg1)\n } else if (isNumber(arg1) && isNumber(arg2)) {\n wrapRef.value!.scrollTo(arg1, arg2)\n }\n}\n\nconst setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollTop = value\n}\n\nconst setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(COMPONENT_NAME, 'value must be a number')\n return\n }\n wrapRef.value!.scrollLeft = value\n}\n\nconst update = () => {\n barRef.value?.update()\n}\n\nwatch(\n () => props.noresize,\n (noresize) => {\n if (noresize) {\n stopResizeObserver?.()\n stopResizeListener?.()\n } else {\n ;({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update))\n stopResizeListener = useEventListener('resize', update)\n }\n },\n { immediate: true }\n)\n\nwatch(\n () => [props.maxHeight, props.height],\n () => {\n if (!props.native)\n nextTick(() => {\n update()\n if (wrapRef.value) {\n barRef.value?.handleScroll(wrapRef.value)\n }\n })\n }\n)\n\nprovide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbarRef,\n wrapElement: wrapRef,\n })\n)\n\nonMounted(() => {\n if (!props.native)\n nextTick(() => {\n update()\n })\n})\nonUpdated(() => update())\n\ndefineExpose({\n /** @description scrollbar wrap ref */\n wrapRef,\n /** @description update scrollbar state manually */\n update,\n /** @description scrolls to a particular set of coordinates */\n scrollTo,\n /** @description set distance to scroll top */\n setScrollTop,\n /** @description set distance to scroll left */\n setScrollLeft,\n /** @description handle scroll event */\n handleScroll,\n})\n</script>\n"],"names":["useNamespace","ref","computed","style","addUnit","isObject","isNumber","debugWarn","watch","useResizeObserver","useEventListener","nextTick","provide","scrollbarContextKey","reactive","onMounted","onUpdated"],"mappings":";;;;;;;;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,WAAW,CAAA,CAAA;AAEnC,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AACnD,IAAA,IAAI,kBAA+C,GAAA,KAAA,CAAA,CAAA;AAEnD,IAAA,MAAM,eAAeC,OAAoB,EAAA,CAAA;AACzC,IAAA,MAAM,UAAUA,OAAoB,EAAA,CA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IAEA,MAAA,CAAA;AAAA,MAEA,OAAA;AAAA,MAEA,MAAA;AAAA,MAEA,QAAA;AAAA,MACD,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"scrollbar2.js","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.ts"],"sourcesContent":["import { buildProps, definePropType, isNumber } from '@element-plus/utils'\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type Scrollbar from './scrollbar.vue'\n\nexport const scrollbarProps = buildProps({\n /**\n * @description height of scrollbar\n */\n height: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description max height of scrollbar\n */\n maxHeight: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether to use the native scrollbar\n */\n native: {\n type: Boolean,\n default: false,\n },\n /**\n * @description style of wrap\n */\n wrapStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n default: '',\n },\n /**\n * @description class of wrap\n */\n wrapClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description class of view\n */\n viewClass: {\n type: [String, Array],\n default: '',\n },\n /**\n * @description style of view\n */\n viewStyle: {\n type: [String, Array, Object],\n default: '',\n },\n /**\n * @description do not respond to container size changes, if the container size does not change, it is better to set it to optimize performance\n */\n noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能\n /**\n * @description element tag of the view\n */\n tag: {\n type: String,\n default: 'div',\n },\n /**\n * @description always show\n */\n always: Boolean,\n /**\n * @description minimum size of scrollbar\n */\n minSize: {\n type: Number,\n default: 20,\n },\n /**\n * @description id of view\n */\n id: String,\n /**\n * @description role of view\n */\n role: String,\n /**\n * @description aria-label of view\n */\n ariaLabel: String,\n /**\n * @description aria-orientation of view\n */\n ariaOrientation: {\n type: String,\n values: ['horizontal', 'vertical'],\n },\n} as const)\nexport type ScrollbarProps = ExtractPropTypes<typeof scrollbarProps>\n\nexport const scrollbarEmits = {\n scroll: ({\n scrollTop,\n scrollLeft,\n }: {\n scrollTop: number\n scrollLeft: number\n }) => [scrollTop, scrollLeft].every(isNumber),\n}\nexport type ScrollbarEmits = typeof scrollbarEmits\n\nexport type ScrollbarInstance = InstanceType<typeof Scrollbar>\n"],"names":["buildProps","definePropType","isNumber"],"mappings":";;;;;;;;AACY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;AACzB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AACjC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,MAAM;AACnB,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,MAAM,EAAE,CAAC;AACX,IAAI,SAAS;AACb,IAAI,UAAU;AACd,GAAG,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,KAAK,CAACC,cAAQ,CAAC;AAC/C;;;;;"}
package/lib/index.js CHANGED
@@ -13,7 +13,7 @@ var affix = require('./components/affix/src/affix.js');
13
13
  var index = require('./components/affix/index.js');
14
14
  var alert = require('./components/alert/src/alert.js');
15
15
  var index$1 = require('./components/alert/index.js');
16
- var autocomplete = require('./components/autocomplete/src/autocomplete.js');
16
+ var autocomplete = require('./components/autocomplete/src/autocomplete2.js');
17
17
  var index$2 = require('./components/autocomplete/index.js');
18
18
  var avatar = require('./components/avatar/src/avatar.js');
19
19
  var index$3 = require('./components/avatar/index.js');
@@ -138,7 +138,7 @@ var row = require('./components/row/src/row.js');
138
138
  var constants$c = require('./components/row/src/constants.js');
139
139
  var index$K = require('./components/row/index.js');
140
140
  var util = require('./components/scrollbar/src/util.js');
141
- var scrollbar = require('./components/scrollbar/src/scrollbar.js');
141
+ var scrollbar = require('./components/scrollbar/src/scrollbar2.js');
142
142
  var thumb = require('./components/scrollbar/src/thumb.js');
143
143
  var constants$d = require('./components/scrollbar/src/constants.js');
144
144
  var index$L = require('./components/scrollbar/index.js');
@@ -214,7 +214,7 @@ var watermark = require('./components/watermark/src/watermark.js');
214
214
  var index$16 = require('./components/watermark/index.js');
215
215
  var tour = require('./components/tour/src/tour.js');
216
216
  var index$17 = require('./components/tour/index.js');
217
- var anchor = require('./components/anchor/src/anchor2.js');
217
+ var anchor = require('./components/anchor/src/anchor.js');
218
218
  var index$18 = require('./components/anchor/index.js');
219
219
  var index$19 = require('./components/infinite-scroll/index.js');
220
220
  var index$1a = require('./components/loading/index.js');
@@ -11,7 +11,11 @@ const getElement = (target) => {
11
11
  if (!core.isClient || target === "")
12
12
  return null;
13
13
  if (shared.isString(target)) {
14
- return document.querySelector(target);
14
+ try {
15
+ return document.querySelector(target);
16
+ } catch (e) {
17
+ return null;
18
+ }
15
19
  }
16
20
  return target;
17
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"element.js","sources":["../../../../../packages/utils/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\nimport { isClient } from '../browser'\n\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\n target: T\n) => T extends string ? HTMLElement | null : T\n\nexport const getElement = ((\n target: string | HTMLElement | Window | null | undefined\n) => {\n if (!isClient || target === '') return null\n if (isString(target)) {\n return document.querySelector<HTMLElement>(target)\n }\n return target\n}) as GetElement\n"],"names":["isClient","isString"],"mappings":";;;;;;;;;AAEY,MAAC,UAAU,GAAG,CAAC,MAAM,KAAK;AACtC,EAAE,IAAI,CAACA,aAAQ,IAAI,MAAM,KAAK,EAAE;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,IAAIC,eAAQ,CAAC,MAAM,CAAC,EAAE;AACxB,IAAI,OAAO,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
1
+ {"version":3,"file":"element.js","sources":["../../../../../packages/utils/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\nimport { isClient } from '../browser'\n\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\n target: T\n) => T extends string ? HTMLElement | null : T\n\nexport const getElement = ((\n target: string | HTMLElement | Window | null | undefined\n) => {\n if (!isClient || target === '') return null\n if (isString(target)) {\n try {\n return document.querySelector<HTMLElement>(target)\n } catch {\n return null\n }\n }\n return target\n}) as GetElement\n"],"names":["isClient","isString"],"mappings":";;;;;;;;;AAEY,MAAC,UAAU,GAAG,CAAC,MAAM,KAAK;AACtC,EAAE,IAAI,CAACA,aAAQ,IAAI,MAAM,KAAK,EAAE;AAChC,IAAI,OAAO,IAAI,CAAC;AAChB,EAAE,IAAIC,eAAQ,CAAC,MAAM,CAAC,EAAE;AACxB,IAAI,IAAI;AACR,MAAM,OAAO,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAC5C,KAAK,CAAC,OAAO,CAAC,EAAE;AAChB,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20240307";
1
+ export declare const version = "0.0.20240309";
package/lib/version.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const version = "0.0.20240307";
5
+ const version = "0.0.20240309";
6
6
 
7
7
  exports.version = version;
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20240307'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20240309'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@element-plus/nightly",
3
- "version": "0.0.20240307",
3
+ "version": "0.0.20240309",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "keywords": [
6
6
  "element-plus",
@@ -112,5 +112,5 @@
112
112
  "not ie 11",
113
113
  "not op_mini all"
114
114
  ],
115
- "gitHead": "8ace97548c89c57c75a75a25e79cb8a2a0422cb4"
115
+ "gitHead": "fbf8da8f1fba6d49f1c598ff667f1fb3f3b95c8e"
116
116
  }