@element-plus/nightly 0.0.20240530 → 0.0.20240601

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 (368) hide show
  1. package/dist/index.full.js +2 -2
  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 +2 -2
  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/affix/index.mjs +2 -2
  244. package/es/components/affix/src/affix.mjs +117 -26
  245. package/es/components/affix/src/affix.mjs.map +1 -1
  246. package/es/components/affix/src/affix2.mjs +26 -117
  247. package/es/components/affix/src/affix2.mjs.map +1 -1
  248. package/es/components/cascader/src/cascader.mjs +1 -1
  249. package/es/components/index.mjs +8 -8
  250. package/es/components/input/index.mjs +2 -2
  251. package/es/components/input/src/input.mjs +118 -462
  252. package/es/components/input/src/input.mjs.map +1 -1
  253. package/es/components/input/src/input2.mjs +462 -118
  254. package/es/components/input/src/input2.mjs.map +1 -1
  255. package/es/components/pagination/src/components/pager.mjs +17 -216
  256. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  257. package/es/components/pagination/src/components/pager2.mjs +216 -17
  258. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  259. package/es/components/pagination/src/components/sizes.mjs +23 -69
  260. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  261. package/es/components/pagination/src/components/sizes2.mjs +69 -23
  262. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  263. package/es/components/pagination/src/pagination.mjs +2 -2
  264. package/es/components/row/index.mjs +2 -2
  265. package/es/components/row/src/row.mjs +45 -29
  266. package/es/components/row/src/row.mjs.map +1 -1
  267. package/es/components/row/src/row2.mjs +29 -45
  268. package/es/components/row/src/row2.mjs.map +1 -1
  269. package/es/components/scrollbar/src/bar.mjs +64 -11
  270. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  271. package/es/components/scrollbar/src/bar2.mjs +11 -64
  272. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  273. package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
  274. package/es/components/select/src/select.mjs +1 -1
  275. package/es/components/select-v2/src/defaults.mjs +1 -1
  276. package/es/components/slider/index.mjs +2 -2
  277. package/es/components/slider/src/slider.mjs +242 -94
  278. package/es/components/slider/src/slider.mjs.map +1 -1
  279. package/es/components/slider/src/slider2.mjs +94 -242
  280. package/es/components/slider/src/slider2.mjs.map +1 -1
  281. package/es/components/steps/index.mjs +2 -2
  282. package/es/components/steps/src/steps.mjs +39 -36
  283. package/es/components/steps/src/steps.mjs.map +1 -1
  284. package/es/components/steps/src/steps2.mjs +36 -39
  285. package/es/components/steps/src/steps2.mjs.map +1 -1
  286. package/es/components/tabs/index.mjs +2 -2
  287. package/es/components/tabs/src/tab-pane.mjs +72 -13
  288. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  289. package/es/components/tabs/src/tab-pane2.mjs +13 -72
  290. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  291. package/es/components/tag/index.mjs +2 -2
  292. package/es/components/tag/src/tag.mjs +94 -29
  293. package/es/components/tag/src/tag.mjs.map +1 -1
  294. package/es/components/tag/src/tag2.mjs +29 -94
  295. package/es/components/tag/src/tag2.mjs.map +1 -1
  296. package/es/components/tooltip/index.mjs +2 -2
  297. package/es/components/tooltip/src/tooltip.mjs +170 -31
  298. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  299. package/es/components/tooltip/src/tooltip2.mjs +31 -170
  300. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  301. package/es/index.mjs +8 -8
  302. package/es/version.d.ts +1 -1
  303. package/es/version.mjs +1 -1
  304. package/es/version.mjs.map +1 -1
  305. package/lib/components/affix/index.js +2 -2
  306. package/lib/components/affix/src/affix.js +117 -27
  307. package/lib/components/affix/src/affix.js.map +1 -1
  308. package/lib/components/affix/src/affix2.js +27 -117
  309. package/lib/components/affix/src/affix2.js.map +1 -1
  310. package/lib/components/cascader/src/cascader.js +1 -1
  311. package/lib/components/index.js +8 -8
  312. package/lib/components/input/index.js +2 -2
  313. package/lib/components/input/src/input.js +118 -461
  314. package/lib/components/input/src/input.js.map +1 -1
  315. package/lib/components/input/src/input2.js +461 -118
  316. package/lib/components/input/src/input2.js.map +1 -1
  317. package/lib/components/pagination/src/components/pager.js +17 -216
  318. package/lib/components/pagination/src/components/pager.js.map +1 -1
  319. package/lib/components/pagination/src/components/pager2.js +216 -17
  320. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  321. package/lib/components/pagination/src/components/sizes.js +23 -69
  322. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  323. package/lib/components/pagination/src/components/sizes2.js +69 -23
  324. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  325. package/lib/components/pagination/src/pagination.js +2 -2
  326. package/lib/components/row/index.js +2 -2
  327. package/lib/components/row/src/row.js +45 -31
  328. package/lib/components/row/src/row.js.map +1 -1
  329. package/lib/components/row/src/row2.js +31 -45
  330. package/lib/components/row/src/row2.js.map +1 -1
  331. package/lib/components/scrollbar/src/bar.js +64 -11
  332. package/lib/components/scrollbar/src/bar.js.map +1 -1
  333. package/lib/components/scrollbar/src/bar2.js +11 -64
  334. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  335. package/lib/components/scrollbar/src/scrollbar2.js +1 -1
  336. package/lib/components/select/src/select.js +1 -1
  337. package/lib/components/select-v2/src/defaults.js +1 -1
  338. package/lib/components/slider/index.js +2 -2
  339. package/lib/components/slider/src/slider.js +242 -95
  340. package/lib/components/slider/src/slider.js.map +1 -1
  341. package/lib/components/slider/src/slider2.js +95 -242
  342. package/lib/components/slider/src/slider2.js.map +1 -1
  343. package/lib/components/steps/index.js +2 -2
  344. package/lib/components/steps/src/steps.js +39 -37
  345. package/lib/components/steps/src/steps.js.map +1 -1
  346. package/lib/components/steps/src/steps2.js +37 -39
  347. package/lib/components/steps/src/steps2.js.map +1 -1
  348. package/lib/components/tabs/index.js +2 -2
  349. package/lib/components/tabs/src/tab-pane.js +72 -13
  350. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  351. package/lib/components/tabs/src/tab-pane2.js +13 -72
  352. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  353. package/lib/components/tag/index.js +2 -2
  354. package/lib/components/tag/src/tag.js +94 -30
  355. package/lib/components/tag/src/tag.js.map +1 -1
  356. package/lib/components/tag/src/tag2.js +30 -94
  357. package/lib/components/tag/src/tag2.js.map +1 -1
  358. package/lib/components/tooltip/index.js +2 -2
  359. package/lib/components/tooltip/src/tooltip.js +170 -35
  360. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  361. package/lib/components/tooltip/src/tooltip2.js +35 -170
  362. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  363. package/lib/index.js +8 -8
  364. package/lib/version.d.ts +1 -1
  365. package/lib/version.js +1 -1
  366. package/lib/version.js.map +1 -1
  367. package/package.json +2 -2
  368. package/web-types.json +1 -1
@@ -1,247 +1,99 @@
1
- import { defineComponent, reactive, computed, toRefs, provide, openBlock, createElementBlock, unref, normalizeClass, createElementVNode, normalizeStyle, createVNode, createBlock, createCommentVNode, Fragment, renderList } from 'vue';
2
- import { ElInputNumber } from '../../input-number/index.mjs';
3
- import '../../form/index.mjs';
1
+ import { placements } from '@popperjs/core';
2
+ import '../../../utils/index.mjs';
3
+ import '../../../constants/index.mjs';
4
4
  import '../../../hooks/index.mjs';
5
- import { sliderContextKey } from './constants.mjs';
6
- import { sliderProps, sliderEmits } from './slider.mjs';
7
- import SliderButton from './button2.mjs';
8
- import SliderMarker from './marker.mjs';
9
- import './composables/index.mjs';
10
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
11
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
12
- import { useLocale } from '../../../hooks/use-locale/index.mjs';
13
- import { useSlide } from './composables/use-slide.mjs';
14
- import { useStops } from './composables/use-stops.mjs';
15
- import { useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
16
- import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
17
- import { useMarks } from './composables/use-marks.mjs';
18
- import { useWatch } from './composables/use-watch.mjs';
19
- import { useLifecycle } from './composables/use-lifecycle.mjs';
20
- import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
5
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
6
+ import { useSizeProp } from '../../../hooks/use-size/index.mjs';
7
+ import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
8
+ import { isNumber } from '../../../utils/types.mjs';
9
+ import { isArray } from '@vue/shared';
10
+ import { UPDATE_MODEL_EVENT, INPUT_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
21
11
 
22
- const _hoisted_1 = ["id", "role", "aria-label", "aria-labelledby"];
23
- const _hoisted_2 = { key: 1 };
24
- const __default__ = defineComponent({
25
- name: "ElSlider"
12
+ const sliderProps = buildProps({
13
+ modelValue: {
14
+ type: definePropType([Number, Array]),
15
+ default: 0
16
+ },
17
+ id: {
18
+ type: String,
19
+ default: void 0
20
+ },
21
+ min: {
22
+ type: Number,
23
+ default: 0
24
+ },
25
+ max: {
26
+ type: Number,
27
+ default: 100
28
+ },
29
+ step: {
30
+ type: Number,
31
+ default: 1
32
+ },
33
+ showInput: Boolean,
34
+ showInputControls: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ size: useSizeProp,
39
+ inputSize: useSizeProp,
40
+ showStops: Boolean,
41
+ showTooltip: {
42
+ type: Boolean,
43
+ default: true
44
+ },
45
+ formatTooltip: {
46
+ type: definePropType(Function),
47
+ default: void 0
48
+ },
49
+ disabled: Boolean,
50
+ range: Boolean,
51
+ vertical: Boolean,
52
+ height: String,
53
+ debounce: {
54
+ type: Number,
55
+ default: 300
56
+ },
57
+ label: {
58
+ type: String,
59
+ default: void 0
60
+ },
61
+ rangeStartLabel: {
62
+ type: String,
63
+ default: void 0
64
+ },
65
+ rangeEndLabel: {
66
+ type: String,
67
+ default: void 0
68
+ },
69
+ formatValueText: {
70
+ type: definePropType(Function),
71
+ default: void 0
72
+ },
73
+ tooltipClass: {
74
+ type: String,
75
+ default: void 0
76
+ },
77
+ placement: {
78
+ type: String,
79
+ values: placements,
80
+ default: "top"
81
+ },
82
+ marks: {
83
+ type: definePropType(Object)
84
+ },
85
+ validateEvent: {
86
+ type: Boolean,
87
+ default: true
88
+ },
89
+ ...useAriaProps(["ariaLabel"])
26
90
  });
27
- const _sfc_main = /* @__PURE__ */ defineComponent({
28
- ...__default__,
29
- props: sliderProps,
30
- emits: sliderEmits,
31
- setup(__props, { expose, emit }) {
32
- const props = __props;
33
- const ns = useNamespace("slider");
34
- const { t } = useLocale();
35
- const initData = reactive({
36
- firstValue: 0,
37
- secondValue: 0,
38
- oldValue: 0,
39
- dragging: false,
40
- sliderSize: 1
41
- });
42
- const {
43
- elFormItem,
44
- slider,
45
- firstButton,
46
- secondButton,
47
- sliderDisabled,
48
- minValue,
49
- maxValue,
50
- runwayStyle,
51
- barStyle,
52
- resetSize,
53
- emitChange,
54
- onSliderWrapperPrevent,
55
- onSliderClick,
56
- onSliderDown,
57
- setFirstValue,
58
- setSecondValue
59
- } = useSlide(props, initData, emit);
60
- const { stops, getStopStyle } = useStops(props, initData, minValue, maxValue);
61
- const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
62
- formItemContext: elFormItem
63
- });
64
- const sliderWrapperSize = useFormSize();
65
- const sliderInputSize = computed(() => props.inputSize || sliderWrapperSize.value);
66
- const groupLabel = computed(() => {
67
- return props.label || props.ariaLabel || t("el.slider.defaultLabel", {
68
- min: props.min,
69
- max: props.max
70
- });
71
- });
72
- const firstButtonLabel = computed(() => {
73
- if (props.range) {
74
- return props.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
75
- } else {
76
- return groupLabel.value;
77
- }
78
- });
79
- const firstValueText = computed(() => {
80
- return props.formatValueText ? props.formatValueText(firstValue.value) : `${firstValue.value}`;
81
- });
82
- const secondButtonLabel = computed(() => {
83
- return props.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
84
- });
85
- const secondValueText = computed(() => {
86
- return props.formatValueText ? props.formatValueText(secondValue.value) : `${secondValue.value}`;
87
- });
88
- const sliderKls = computed(() => [
89
- ns.b(),
90
- ns.m(sliderWrapperSize.value),
91
- ns.is("vertical", props.vertical),
92
- { [ns.m("with-input")]: props.showInput }
93
- ]);
94
- const markList = useMarks(props);
95
- useWatch(props, initData, minValue, maxValue, emit, elFormItem);
96
- const precision = computed(() => {
97
- const precisions = [props.min, props.max, props.step].map((item) => {
98
- const decimal = `${item}`.split(".")[1];
99
- return decimal ? decimal.length : 0;
100
- });
101
- return Math.max.apply(null, precisions);
102
- });
103
- const { sliderWrapper } = useLifecycle(props, initData, resetSize);
104
- const { firstValue, secondValue, sliderSize } = toRefs(initData);
105
- const updateDragging = (val) => {
106
- initData.dragging = val;
107
- };
108
- provide(sliderContextKey, {
109
- ...toRefs(props),
110
- sliderSize,
111
- disabled: sliderDisabled,
112
- precision,
113
- emitChange,
114
- resetSize,
115
- updateDragging
116
- });
117
- useDeprecated({
118
- from: "label",
119
- replacement: "aria-label",
120
- version: "2.8.0",
121
- scope: "el-slider",
122
- ref: "https://element-plus.org/en-US/component/slider.html"
123
- }, computed(() => !!props.label));
124
- expose({
125
- onSliderClick
126
- });
127
- return (_ctx, _cache) => {
128
- var _a, _b;
129
- return openBlock(), createElementBlock("div", {
130
- id: _ctx.range ? unref(inputId) : void 0,
131
- ref_key: "sliderWrapper",
132
- ref: sliderWrapper,
133
- class: normalizeClass(unref(sliderKls)),
134
- role: _ctx.range ? "group" : void 0,
135
- "aria-label": _ctx.range && !unref(isLabeledByFormItem) ? unref(groupLabel) : void 0,
136
- "aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? (_a = unref(elFormItem)) == null ? void 0 : _a.labelId : void 0,
137
- onTouchstart: _cache[2] || (_cache[2] = (...args) => unref(onSliderWrapperPrevent) && unref(onSliderWrapperPrevent)(...args)),
138
- onTouchmove: _cache[3] || (_cache[3] = (...args) => unref(onSliderWrapperPrevent) && unref(onSliderWrapperPrevent)(...args))
139
- }, [
140
- createElementVNode("div", {
141
- ref_key: "slider",
142
- ref: slider,
143
- class: normalizeClass([
144
- unref(ns).e("runway"),
145
- { "show-input": _ctx.showInput && !_ctx.range },
146
- unref(ns).is("disabled", unref(sliderDisabled))
147
- ]),
148
- style: normalizeStyle(unref(runwayStyle)),
149
- onMousedown: _cache[0] || (_cache[0] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args)),
150
- onTouchstart: _cache[1] || (_cache[1] = (...args) => unref(onSliderDown) && unref(onSliderDown)(...args))
151
- }, [
152
- createElementVNode("div", {
153
- class: normalizeClass(unref(ns).e("bar")),
154
- style: normalizeStyle(unref(barStyle))
155
- }, null, 6),
156
- createVNode(SliderButton, {
157
- id: !_ctx.range ? unref(inputId) : void 0,
158
- ref_key: "firstButton",
159
- ref: firstButton,
160
- "model-value": unref(firstValue),
161
- vertical: _ctx.vertical,
162
- "tooltip-class": _ctx.tooltipClass,
163
- placement: _ctx.placement,
164
- role: "slider",
165
- "aria-label": _ctx.range || !unref(isLabeledByFormItem) ? unref(firstButtonLabel) : void 0,
166
- "aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? (_b = unref(elFormItem)) == null ? void 0 : _b.labelId : void 0,
167
- "aria-valuemin": _ctx.min,
168
- "aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max,
169
- "aria-valuenow": unref(firstValue),
170
- "aria-valuetext": unref(firstValueText),
171
- "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
172
- "aria-disabled": unref(sliderDisabled),
173
- "onUpdate:modelValue": unref(setFirstValue)
174
- }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
175
- _ctx.range ? (openBlock(), createBlock(SliderButton, {
176
- key: 0,
177
- ref_key: "secondButton",
178
- ref: secondButton,
179
- "model-value": unref(secondValue),
180
- vertical: _ctx.vertical,
181
- "tooltip-class": _ctx.tooltipClass,
182
- placement: _ctx.placement,
183
- role: "slider",
184
- "aria-label": unref(secondButtonLabel),
185
- "aria-valuemin": unref(firstValue),
186
- "aria-valuemax": _ctx.max,
187
- "aria-valuenow": unref(secondValue),
188
- "aria-valuetext": unref(secondValueText),
189
- "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
190
- "aria-disabled": unref(sliderDisabled),
191
- "onUpdate:modelValue": unref(setSecondValue)
192
- }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true),
193
- _ctx.showStops ? (openBlock(), createElementBlock("div", _hoisted_2, [
194
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(stops), (item, key) => {
195
- return openBlock(), createElementBlock("div", {
196
- key,
197
- class: normalizeClass(unref(ns).e("stop")),
198
- style: normalizeStyle(unref(getStopStyle)(item))
199
- }, null, 6);
200
- }), 128))
201
- ])) : createCommentVNode("v-if", true),
202
- unref(markList).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
203
- createElementVNode("div", null, [
204
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
205
- return openBlock(), createElementBlock("div", {
206
- key,
207
- style: normalizeStyle(unref(getStopStyle)(item.position)),
208
- class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")])
209
- }, null, 6);
210
- }), 128))
211
- ]),
212
- createElementVNode("div", {
213
- class: normalizeClass(unref(ns).e("marks"))
214
- }, [
215
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
216
- return openBlock(), createBlock(unref(SliderMarker), {
217
- key,
218
- mark: item.mark,
219
- style: normalizeStyle(unref(getStopStyle)(item.position))
220
- }, null, 8, ["mark", "style"]);
221
- }), 128))
222
- ], 2)
223
- ], 64)) : createCommentVNode("v-if", true)
224
- ], 38),
225
- _ctx.showInput && !_ctx.range ? (openBlock(), createBlock(unref(ElInputNumber), {
226
- key: 0,
227
- ref: "input",
228
- "model-value": unref(firstValue),
229
- class: normalizeClass(unref(ns).e("input")),
230
- step: _ctx.step,
231
- disabled: unref(sliderDisabled),
232
- controls: _ctx.showInputControls,
233
- min: _ctx.min,
234
- max: _ctx.max,
235
- debounce: _ctx.debounce,
236
- size: unref(sliderInputSize),
237
- "onUpdate:modelValue": unref(setFirstValue),
238
- onChange: unref(emitChange)
239
- }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "debounce", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true)
240
- ], 42, _hoisted_1);
241
- };
242
- }
243
- });
244
- var Slider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "slider.vue"]]);
91
+ const isValidValue = (value) => isNumber(value) || isArray(value) && value.every(isNumber);
92
+ const sliderEmits = {
93
+ [UPDATE_MODEL_EVENT]: isValidValue,
94
+ [INPUT_EVENT]: isValidValue,
95
+ [CHANGE_EVENT]: isValidValue
96
+ };
245
97
 
246
- export { Slider as default };
98
+ export { sliderEmits, sliderProps };
247
99
  //# sourceMappingURL=slider2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"slider2.mjs","sources":["../../../../../../packages/components/slider/src/slider.vue"],"sourcesContent":["<template>\n <div\n :id=\"range ? inputId : undefined\"\n ref=\"sliderWrapper\"\n :class=\"sliderKls\"\n :role=\"range ? 'group' : undefined\"\n :aria-label=\"range && !isLabeledByFormItem ? groupLabel : undefined\"\n :aria-labelledby=\"\n range && isLabeledByFormItem ? elFormItem?.labelId : undefined\n \"\n @touchstart=\"onSliderWrapperPrevent\"\n @touchmove=\"onSliderWrapperPrevent\"\n >\n <div\n ref=\"slider\"\n :class=\"[\n ns.e('runway'),\n { 'show-input': showInput && !range },\n ns.is('disabled', sliderDisabled),\n ]\"\n :style=\"runwayStyle\"\n @mousedown=\"onSliderDown\"\n @touchstart=\"onSliderDown\"\n >\n <div :class=\"ns.e('bar')\" :style=\"barStyle\" />\n <slider-button\n :id=\"!range ? inputId : undefined\"\n ref=\"firstButton\"\n :model-value=\"firstValue\"\n :vertical=\"vertical\"\n :tooltip-class=\"tooltipClass\"\n :placement=\"placement\"\n role=\"slider\"\n :aria-label=\"\n range || !isLabeledByFormItem ? firstButtonLabel : undefined\n \"\n :aria-labelledby=\"\n !range && isLabeledByFormItem ? elFormItem?.labelId : undefined\n \"\n :aria-valuemin=\"min\"\n :aria-valuemax=\"range ? secondValue : max\"\n :aria-valuenow=\"firstValue\"\n :aria-valuetext=\"firstValueText\"\n :aria-orientation=\"vertical ? 'vertical' : 'horizontal'\"\n :aria-disabled=\"sliderDisabled\"\n @update:model-value=\"setFirstValue\"\n />\n <slider-button\n v-if=\"range\"\n ref=\"secondButton\"\n :model-value=\"secondValue\"\n :vertical=\"vertical\"\n :tooltip-class=\"tooltipClass\"\n :placement=\"placement\"\n role=\"slider\"\n :aria-label=\"secondButtonLabel\"\n :aria-valuemin=\"firstValue\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"secondValue\"\n :aria-valuetext=\"secondValueText\"\n :aria-orientation=\"vertical ? 'vertical' : 'horizontal'\"\n :aria-disabled=\"sliderDisabled\"\n @update:model-value=\"setSecondValue\"\n />\n <div v-if=\"showStops\">\n <div\n v-for=\"(item, key) in stops\"\n :key=\"key\"\n :class=\"ns.e('stop')\"\n :style=\"getStopStyle(item)\"\n />\n </div>\n <template v-if=\"markList.length > 0\">\n <div>\n <div\n v-for=\"(item, key) in markList\"\n :key=\"key\"\n :style=\"getStopStyle(item.position)\"\n :class=\"[ns.e('stop'), ns.e('marks-stop')]\"\n />\n </div>\n <div :class=\"ns.e('marks')\">\n <slider-marker\n v-for=\"(item, key) in markList\"\n :key=\"key\"\n :mark=\"item.mark\"\n :style=\"getStopStyle(item.position)\"\n />\n </div>\n </template>\n </div>\n <el-input-number\n v-if=\"showInput && !range\"\n ref=\"input\"\n :model-value=\"firstValue\"\n :class=\"ns.e('input')\"\n :step=\"step\"\n :disabled=\"sliderDisabled\"\n :controls=\"showInputControls\"\n :min=\"min\"\n :max=\"max\"\n :debounce=\"debounce\"\n :size=\"sliderInputSize\"\n @update:model-value=\"setFirstValue\"\n @change=\"emitChange\"\n />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, toRefs } from 'vue'\nimport ElInputNumber from '@element-plus/components/input-number'\nimport { useFormItemInputId, useFormSize } from '@element-plus/components/form'\nimport { useDeprecated, useLocale, useNamespace } from '@element-plus/hooks'\nimport { sliderContextKey } from './constants'\nimport { sliderEmits, sliderProps } from './slider'\nimport SliderButton from './button.vue'\nimport SliderMarker from './marker'\nimport {\n useLifecycle,\n useMarks,\n useSlide,\n useStops,\n useWatch,\n} from './composables'\nimport type { SliderInitData } from './slider'\n\ndefineOptions({\n name: 'ElSlider',\n})\n\nconst props = defineProps(sliderProps)\nconst emit = defineEmits(sliderEmits)\n\nconst ns = useNamespace('slider')\nconst { t } = useLocale()\n\nconst initData = reactive<SliderInitData>({\n firstValue: 0,\n secondValue: 0,\n oldValue: 0,\n dragging: false,\n sliderSize: 1,\n})\n\nconst {\n elFormItem,\n slider,\n firstButton,\n secondButton,\n sliderDisabled,\n minValue,\n maxValue,\n runwayStyle,\n barStyle,\n resetSize,\n emitChange,\n onSliderWrapperPrevent,\n onSliderClick,\n onSliderDown,\n setFirstValue,\n setSecondValue,\n} = useSlide(props, initData, emit)\n\nconst { stops, getStopStyle } = useStops(props, initData, minValue, maxValue)\n\nconst { inputId, isLabeledByFormItem } = useFormItemInputId(props, {\n formItemContext: elFormItem,\n})\n\nconst sliderWrapperSize = useFormSize()\nconst sliderInputSize = computed(\n () => props.inputSize || sliderWrapperSize.value\n)\n\nconst groupLabel = computed<string>(() => {\n return (\n props.label ||\n props.ariaLabel ||\n t('el.slider.defaultLabel', {\n min: props.min,\n max: props.max,\n })\n )\n})\n\nconst firstButtonLabel = computed<string>(() => {\n if (props.range) {\n return props.rangeStartLabel || t('el.slider.defaultRangeStartLabel')\n } else {\n return groupLabel.value\n }\n})\n\nconst firstValueText = computed<string>(() => {\n return props.formatValueText\n ? props.formatValueText(firstValue.value)\n : `${firstValue.value}`\n})\n\nconst secondButtonLabel = computed<string>(() => {\n return props.rangeEndLabel || t('el.slider.defaultRangeEndLabel')\n})\n\nconst secondValueText = computed<string>(() => {\n return props.formatValueText\n ? props.formatValueText(secondValue.value)\n : `${secondValue.value}`\n})\n\nconst sliderKls = computed(() => [\n ns.b(),\n ns.m(sliderWrapperSize.value),\n ns.is('vertical', props.vertical),\n { [ns.m('with-input')]: props.showInput },\n])\n\nconst markList = useMarks(props)\n\nuseWatch(props, initData, minValue, maxValue, emit, elFormItem!)\n\nconst precision = computed(() => {\n const precisions = [props.min, props.max, props.step].map((item) => {\n const decimal = `${item}`.split('.')[1]\n return decimal ? decimal.length : 0\n })\n return Math.max.apply(null, precisions)\n})\n\nconst { sliderWrapper } = useLifecycle(props, initData, resetSize)\n\nconst { firstValue, secondValue, sliderSize } = toRefs(initData)\n\nconst updateDragging = (val: boolean) => {\n initData.dragging = val\n}\n\nprovide(sliderContextKey, {\n ...toRefs(props),\n sliderSize,\n disabled: sliderDisabled,\n precision,\n emitChange,\n resetSize,\n updateDragging,\n})\n\nuseDeprecated(\n {\n from: 'label',\n replacement: 'aria-label',\n version: '2.8.0',\n scope: 'el-slider',\n ref: 'https://element-plus.org/en-US/component/slider.html',\n },\n computed(() => !!props.label)\n)\n\ndefineExpose({\n onSliderClick,\n})\n</script>\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"slider2.mjs","sources":["../../../../../../packages/components/slider/src/slider.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport {\n buildProps,\n definePropType,\n isArray,\n isNumber,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { SliderMarkerProps } from './marker'\nimport type Slider from './slider.vue'\n\ntype SliderMarks = Record<number, string | SliderMarkerProps['mark']>\n\nexport interface SliderInitData {\n firstValue: number\n secondValue: number\n oldValue?: Arrayable<number>\n dragging: boolean\n sliderSize: number\n}\n\nexport const sliderProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<Arrayable<number>>([Number, Array]),\n default: 0,\n },\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description minimum value\n */\n min: {\n type: Number,\n default: 0,\n },\n /**\n * @description maximum value\n */\n max: {\n type: Number,\n default: 100,\n },\n /**\n * @description step size\n */\n step: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether to display an input box, works when `range` is false\n */\n showInput: Boolean,\n /**\n * @description whether to display control buttons when `show-input` is true\n */\n showInputControls: {\n type: Boolean,\n default: true,\n },\n /**\n * @description size of the slider wrapper, will not work in vertical mode\n */\n size: useSizeProp,\n /**\n * @description size of the input box, when set `size`, the default is the value of `size`\n */\n inputSize: useSizeProp,\n /**\n * @description whether to display breakpoints\n */\n showStops: Boolean,\n /**\n * @description whether to display tooltip value\n */\n showTooltip: {\n type: Boolean,\n default: true,\n },\n /**\n * @description format to display tooltip value\n */\n formatTooltip: {\n type: definePropType<(val: number) => number | string>(Function),\n default: undefined,\n },\n /**\n * @description whether Slider is disabled\n */\n disabled: Boolean,\n /**\n * @description whether to select a range\n */\n range: Boolean,\n /**\n * @description vertical mode\n */\n vertical: Boolean,\n /**\n * @description slider height, required in vertical mode\n */\n height: String,\n /**\n * @description debounce delay when typing, in milliseconds, works when `show-input` is true\n */\n debounce: {\n type: Number,\n default: 300,\n },\n /**\n * @deprecated label for screen reader\n */\n label: {\n type: String,\n default: undefined,\n },\n /**\n * @description when `range` is true, screen reader label for the start of the range\n */\n rangeStartLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description when `range` is true, screen reader label for the end of the range\n */\n rangeEndLabel: {\n type: String,\n default: undefined,\n },\n /**\n * @description format to display the `aria-valuenow` attribute for screen readers\n */\n formatValueText: {\n type: definePropType<(val: number) => string>(Function),\n default: undefined,\n },\n /**\n * @description custom class name for the tooltip\n */\n tooltipClass: {\n type: String,\n default: undefined,\n },\n /**\n * @description position of Tooltip\n */\n placement: {\n type: String,\n values: placements,\n default: 'top',\n },\n /**\n * @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style\n */\n marks: {\n type: definePropType<SliderMarks>(Object),\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n ...useAriaProps(['ariaLabel']),\n} as const)\nexport type SliderProps = ExtractPropTypes<typeof sliderProps>\n\nconst isValidValue = (value: Arrayable<number>) =>\n isNumber(value) || (isArray(value) && value.every(isNumber))\nexport const sliderEmits = {\n [UPDATE_MODEL_EVENT]: isValidValue,\n [INPUT_EVENT]: isValidValue,\n [CHANGE_EVENT]: isValidValue,\n}\nexport type SliderEmits = typeof sliderEmits\n\nexport type SliderInstance = InstanceType<typeof Slider>\n"],"names":[],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import '../../utils/index.mjs';
2
- import Steps from './src/steps2.mjs';
2
+ import Steps from './src/steps.mjs';
3
3
  import Step from './src/item2.mjs';
4
4
  export { stepProps } from './src/item.mjs';
5
- export { stepsEmits, stepsProps } from './src/steps.mjs';
5
+ export { stepsEmits, stepsProps } from './src/steps2.mjs';
6
6
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
7
7
 
8
8
  const ElSteps = withInstall(Steps, {
@@ -1,43 +1,46 @@
1
+ import { defineComponent, getCurrentInstance, watch, provide, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
1
2
  import '../../../constants/index.mjs';
2
- import '../../../utils/index.mjs';
3
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
3
+ import '../../../hooks/index.mjs';
4
+ import { stepsProps, stepsEmits } from './steps2.mjs';
5
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
7
+ import { useOrderedChildren } from '../../../hooks/use-ordered-children/index.mjs';
4
8
  import { CHANGE_EVENT } from '../../../constants/event.mjs';
5
- import { isNumber } from '../../../utils/types.mjs';
6
9
 
7
- const stepsProps = buildProps({
8
- space: {
9
- type: [Number, String],
10
- default: ""
11
- },
12
- active: {
13
- type: Number,
14
- default: 0
15
- },
16
- direction: {
17
- type: String,
18
- default: "horizontal",
19
- values: ["horizontal", "vertical"]
20
- },
21
- alignCenter: {
22
- type: Boolean
23
- },
24
- simple: {
25
- type: Boolean
26
- },
27
- finishStatus: {
28
- type: String,
29
- values: ["wait", "process", "finish", "error", "success"],
30
- default: "finish"
31
- },
32
- processStatus: {
33
- type: String,
34
- values: ["wait", "process", "finish", "error", "success"],
35
- default: "process"
10
+ const __default__ = defineComponent({
11
+ name: "ElSteps"
12
+ });
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ ...__default__,
15
+ props: stepsProps,
16
+ emits: stepsEmits,
17
+ setup(__props, { emit }) {
18
+ const props = __props;
19
+ const ns = useNamespace("steps");
20
+ const {
21
+ children: steps,
22
+ addChild: addStep,
23
+ removeChild: removeStep
24
+ } = useOrderedChildren(getCurrentInstance(), "ElStep");
25
+ watch(steps, () => {
26
+ steps.value.forEach((instance, index) => {
27
+ instance.setIndex(index);
28
+ });
29
+ });
30
+ provide("ElSteps", { props, steps, addStep, removeStep });
31
+ watch(() => props.active, (newVal, oldVal) => {
32
+ emit(CHANGE_EVENT, newVal, oldVal);
33
+ });
34
+ return (_ctx, _cache) => {
35
+ return openBlock(), createElementBlock("div", {
36
+ class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.simple ? "simple" : _ctx.direction)])
37
+ }, [
38
+ renderSlot(_ctx.$slots, "default")
39
+ ], 2);
40
+ };
36
41
  }
37
42
  });
38
- const stepsEmits = {
39
- [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber)
40
- };
43
+ var Steps = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "steps.vue"]]);
41
44
 
42
- export { stepsEmits, stepsProps };
45
+ export { Steps as default };
43
46
  //# sourceMappingURL=steps.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"steps.mjs","sources":["../../../../../../packages/components/steps/src/steps.ts"],"sourcesContent":["import { CHANGE_EVENT } from '@element-plus/constants'\nimport { buildProps, isNumber } from '@element-plus/utils'\nimport type Steps from './steps.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const stepsProps = buildProps({\n /**\n * @description the spacing of each step, will be responsive if omitted. Supports percentage.\n */\n space: {\n type: [Number, String],\n default: '',\n },\n /**\n * @description current activation step\n */\n active: {\n type: Number,\n default: 0,\n },\n /**\n * @description display direction\n */\n direction: {\n type: String,\n default: 'horizontal',\n values: ['horizontal', 'vertical'],\n },\n /**\n * @description center title and description\n */\n alignCenter: {\n type: Boolean,\n },\n /**\n * @description whether to apply simple theme\n */\n simple: {\n type: Boolean,\n },\n /**\n * @description status of end step\n */\n finishStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'finish',\n },\n /**\n * @description status of current step\n */\n processStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'process',\n },\n} as const)\nexport type StepsProps = ExtractPropTypes<typeof stepsProps>\n\nexport const stepsEmits = {\n [CHANGE_EVENT]: (newVal: number, oldVal: number) =>\n [newVal, oldVal].every(isNumber),\n}\nexport type StepsEmits = typeof stepsEmits\n\nexport type StepsInstance = InstanceType<typeof Steps>\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;AACtE;;;;"}
1
+ {"version":3,"file":"steps.mjs","sources":["../../../../../../packages/components/steps/src/steps.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.b(), ns.m(simple ? 'simple' : direction)]\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, provide, watch } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { stepsEmits, stepsProps } from './steps'\n\nimport type { StepItemState } from './item.vue'\n\ndefineOptions({\n name: 'ElSteps',\n})\n\nconst props = defineProps(stepsProps)\nconst emit = defineEmits(stepsEmits)\n\nconst ns = useNamespace('steps')\nconst {\n children: steps,\n addChild: addStep,\n removeChild: removeStep,\n} = useOrderedChildren<StepItemState>(getCurrentInstance()!, 'ElStep')\n\nwatch(steps, () => {\n steps.value.forEach((instance: StepItemState, index: number) => {\n instance.setIndex(index)\n })\n})\n\nprovide('ElSteps', { props, steps, addStep, removeStep })\n\nwatch(\n () => props.active,\n (newVal: number, oldVal: number) => {\n emit(CHANGE_EVENT, newVal, oldVal)\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCAcc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA;AAAA,MACJ,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,OAAA;AAAA,MACV,WAAa,EAAA,UAAA;AAAA,KACX,GAAA,kBAAA,CAAkC,kBAAmB,EAAA,EAAI,QAAQ,CAAA,CAAA;AAErE,IAAA,KAAA,CAAM,OAAO,MAAM;AACjB,MAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,CAAC,QAAA,EAAyB,KAAkB,KAAA;AAC9D,QAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AAAA,OACxB,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,WAAW,EAAE,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,YAAY,CAAA,CAAA;AAExD,IAAA,KAAA,CACE,MAAM,KAAA,CAAM,MACZ,EAAA,CAAC,QAAgB,MAAmB,KAAA;AAClC,MAAK,IAAA,CAAA,YAAA,EAAc,QAAQ,MAAM,CAAA,CAAA;AAAA,KAErC,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -1,46 +1,43 @@
1
- import { defineComponent, getCurrentInstance, watch, provide, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
2
1
  import '../../../constants/index.mjs';
3
- import '../../../hooks/index.mjs';
4
- import { stepsProps, stepsEmits } from './steps.mjs';
5
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
6
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
7
- import { useOrderedChildren } from '../../../hooks/use-ordered-children/index.mjs';
2
+ import '../../../utils/index.mjs';
3
+ import { buildProps } from '../../../utils/vue/props/runtime.mjs';
8
4
  import { CHANGE_EVENT } from '../../../constants/event.mjs';
5
+ import { isNumber } from '../../../utils/types.mjs';
9
6
 
10
- const __default__ = defineComponent({
11
- name: "ElSteps"
12
- });
13
- const _sfc_main = /* @__PURE__ */ defineComponent({
14
- ...__default__,
15
- props: stepsProps,
16
- emits: stepsEmits,
17
- setup(__props, { emit }) {
18
- const props = __props;
19
- const ns = useNamespace("steps");
20
- const {
21
- children: steps,
22
- addChild: addStep,
23
- removeChild: removeStep
24
- } = useOrderedChildren(getCurrentInstance(), "ElStep");
25
- watch(steps, () => {
26
- steps.value.forEach((instance, index) => {
27
- instance.setIndex(index);
28
- });
29
- });
30
- provide("ElSteps", { props, steps, addStep, removeStep });
31
- watch(() => props.active, (newVal, oldVal) => {
32
- emit(CHANGE_EVENT, newVal, oldVal);
33
- });
34
- return (_ctx, _cache) => {
35
- return openBlock(), createElementBlock("div", {
36
- class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.simple ? "simple" : _ctx.direction)])
37
- }, [
38
- renderSlot(_ctx.$slots, "default")
39
- ], 2);
40
- };
7
+ const stepsProps = buildProps({
8
+ space: {
9
+ type: [Number, String],
10
+ default: ""
11
+ },
12
+ active: {
13
+ type: Number,
14
+ default: 0
15
+ },
16
+ direction: {
17
+ type: String,
18
+ default: "horizontal",
19
+ values: ["horizontal", "vertical"]
20
+ },
21
+ alignCenter: {
22
+ type: Boolean
23
+ },
24
+ simple: {
25
+ type: Boolean
26
+ },
27
+ finishStatus: {
28
+ type: String,
29
+ values: ["wait", "process", "finish", "error", "success"],
30
+ default: "finish"
31
+ },
32
+ processStatus: {
33
+ type: String,
34
+ values: ["wait", "process", "finish", "error", "success"],
35
+ default: "process"
41
36
  }
42
37
  });
43
- var Steps = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "steps.vue"]]);
38
+ const stepsEmits = {
39
+ [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber)
40
+ };
44
41
 
45
- export { Steps as default };
42
+ export { stepsEmits, stepsProps };
46
43
  //# sourceMappingURL=steps2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"steps2.mjs","sources":["../../../../../../packages/components/steps/src/steps.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.b(), ns.m(simple ? 'simple' : direction)]\">\n <slot />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, provide, watch } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { stepsEmits, stepsProps } from './steps'\n\nimport type { StepItemState } from './item.vue'\n\ndefineOptions({\n name: 'ElSteps',\n})\n\nconst props = defineProps(stepsProps)\nconst emit = defineEmits(stepsEmits)\n\nconst ns = useNamespace('steps')\nconst {\n children: steps,\n addChild: addStep,\n removeChild: removeStep,\n} = useOrderedChildren<StepItemState>(getCurrentInstance()!, 'ElStep')\n\nwatch(steps, () => {\n steps.value.forEach((instance: StepItemState, index: number) => {\n instance.setIndex(index)\n })\n})\n\nprovide('ElSteps', { props, steps, addStep, removeStep })\n\nwatch(\n () => props.active,\n (newVal: number, oldVal: number) => {\n emit(CHANGE_EVENT, newVal, oldVal)\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCAcc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA;AAAA,MACJ,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,OAAA;AAAA,MACV,WAAa,EAAA,UAAA;AAAA,KACX,GAAA,kBAAA,CAAkC,kBAAmB,EAAA,EAAI,QAAQ,CAAA,CAAA;AAErE,IAAA,KAAA,CAAM,OAAO,MAAM;AACjB,MAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,CAAC,QAAA,EAAyB,KAAkB,KAAA;AAC9D,QAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AAAA,OACxB,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,WAAW,EAAE,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,YAAY,CAAA,CAAA;AAExD,IAAA,KAAA,CACE,MAAM,KAAA,CAAM,MACZ,EAAA,CAAC,QAAgB,MAAmB,KAAA;AAClC,MAAK,IAAA,CAAA,YAAA,EAAc,QAAQ,MAAM,CAAA,CAAA;AAAA,KAErC,CAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"steps2.mjs","sources":["../../../../../../packages/components/steps/src/steps.ts"],"sourcesContent":["import { CHANGE_EVENT } from '@element-plus/constants'\nimport { buildProps, isNumber } from '@element-plus/utils'\nimport type Steps from './steps.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const stepsProps = buildProps({\n /**\n * @description the spacing of each step, will be responsive if omitted. Supports percentage.\n */\n space: {\n type: [Number, String],\n default: '',\n },\n /**\n * @description current activation step\n */\n active: {\n type: Number,\n default: 0,\n },\n /**\n * @description display direction\n */\n direction: {\n type: String,\n default: 'horizontal',\n values: ['horizontal', 'vertical'],\n },\n /**\n * @description center title and description\n */\n alignCenter: {\n type: Boolean,\n },\n /**\n * @description whether to apply simple theme\n */\n simple: {\n type: Boolean,\n },\n /**\n * @description status of end step\n */\n finishStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'finish',\n },\n /**\n * @description status of current step\n */\n processStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'process',\n },\n} as const)\nexport type StepsProps = ExtractPropTypes<typeof stepsProps>\n\nexport const stepsEmits = {\n [CHANGE_EVENT]: (newVal: number, oldVal: number) =>\n [newVal, oldVal].every(isNumber),\n}\nexport type StepsEmits = typeof stepsEmits\n\nexport type StepsInstance = InstanceType<typeof Steps>\n"],"names":[],"mappings":";;;;;;AAEY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;AACtE;;;;"}
@@ -1,10 +1,10 @@
1
1
  import '../../utils/index.mjs';
2
2
  import Tabs from './src/tabs.mjs';
3
3
  export { tabsEmits, tabsProps } from './src/tabs.mjs';
4
- import TabPane from './src/tab-pane2.mjs';
4
+ import TabPane from './src/tab-pane.mjs';
5
5
  export { tabBarProps } from './src/tab-bar.mjs';
6
6
  export { tabNavEmits, tabNavProps } from './src/tab-nav.mjs';
7
- export { tabPaneProps } from './src/tab-pane.mjs';
7
+ export { tabPaneProps } from './src/tab-pane2.mjs';
8
8
  export { tabsRootContextKey } from './src/constants.mjs';
9
9
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
10
10