element-sim 1.0.4 → 1.0.5

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 (441) hide show
  1. package/lib/alert.js +420 -0
  2. package/lib/aside.js +277 -0
  3. package/lib/autocomplete.js +952 -0
  4. package/lib/avatar.js +363 -0
  5. package/lib/backtop.js +404 -0
  6. package/lib/badge.js +334 -0
  7. package/lib/breadcrumb-item.js +322 -0
  8. package/lib/breadcrumb.js +293 -0
  9. package/lib/button-group.js +262 -0
  10. package/lib/button.js +357 -0
  11. package/lib/calendar.js +933 -0
  12. package/lib/card.js +297 -0
  13. package/lib/carousel-item.js +434 -0
  14. package/lib/carousel.js +707 -0
  15. package/lib/cascader-panel.js +1558 -0
  16. package/lib/cascader.js +1439 -0
  17. package/lib/checkbox-button.js +583 -0
  18. package/lib/checkbox-group.js +313 -0
  19. package/lib/checkbox.js +627 -0
  20. package/lib/col.js +177 -0
  21. package/lib/collapse-item.js +497 -0
  22. package/lib/collapse.js +329 -0
  23. package/lib/color-picker.js +1943 -0
  24. package/lib/container.js +288 -0
  25. package/lib/date-picker.js +6335 -0
  26. package/lib/descriptions-item.js +140 -0
  27. package/lib/descriptions.js +457 -0
  28. package/lib/dialog.js +598 -0
  29. package/lib/directives/mousewheel.js +26 -0
  30. package/lib/directives/repeat-click.js +33 -0
  31. package/lib/divider.js +313 -0
  32. package/lib/drawer.js +592 -0
  33. package/lib/dropdown-item.js +316 -0
  34. package/lib/dropdown-menu.js +351 -0
  35. package/lib/dropdown.js +643 -0
  36. package/lib/element-sim.common.js +43578 -0
  37. package/lib/empty.js +730 -0
  38. package/lib/footer.js +277 -0
  39. package/lib/form-item.js +826 -0
  40. package/lib/form.js +466 -0
  41. package/lib/header.js +277 -0
  42. package/lib/icon.js +265 -0
  43. package/lib/image.js +1138 -0
  44. package/lib/index.js +1 -0
  45. package/lib/infinite-scroll.js +301 -0
  46. package/lib/input-number.js +752 -0
  47. package/lib/input.js +998 -0
  48. package/lib/link.js +332 -0
  49. package/lib/loading.js +631 -0
  50. package/lib/locale/format.js +56 -0
  51. package/lib/locale/index.js +63 -0
  52. package/lib/locale/lang/af-ZA.js +126 -0
  53. package/lib/locale/lang/ar.js +125 -0
  54. package/lib/locale/lang/az.js +126 -0
  55. package/lib/locale/lang/bg.js +126 -0
  56. package/lib/locale/lang/bn.js +126 -0
  57. package/lib/locale/lang/ca.js +125 -0
  58. package/lib/locale/lang/cs-CZ.js +128 -0
  59. package/lib/locale/lang/da.js +125 -0
  60. package/lib/locale/lang/de.js +127 -0
  61. package/lib/locale/lang/ee.js +126 -0
  62. package/lib/locale/lang/el.js +126 -0
  63. package/lib/locale/lang/en.js +126 -0
  64. package/lib/locale/lang/eo.js +126 -0
  65. package/lib/locale/lang/es.js +125 -0
  66. package/lib/locale/lang/eu.js +126 -0
  67. package/lib/locale/lang/fa.js +126 -0
  68. package/lib/locale/lang/fi.js +126 -0
  69. package/lib/locale/lang/fr.js +125 -0
  70. package/lib/locale/lang/he.js +126 -0
  71. package/lib/locale/lang/hr.js +126 -0
  72. package/lib/locale/lang/hu.js +125 -0
  73. package/lib/locale/lang/hy-AM.js +126 -0
  74. package/lib/locale/lang/id.js +126 -0
  75. package/lib/locale/lang/is.js +126 -0
  76. package/lib/locale/lang/it.js +125 -0
  77. package/lib/locale/lang/ja.js +126 -0
  78. package/lib/locale/lang/kg.js +126 -0
  79. package/lib/locale/lang/km.js +126 -0
  80. package/lib/locale/lang/ko.js +126 -0
  81. package/lib/locale/lang/ku.js +126 -0
  82. package/lib/locale/lang/kz.js +126 -0
  83. package/lib/locale/lang/lo-LA.js +126 -0
  84. package/lib/locale/lang/lt.js +126 -0
  85. package/lib/locale/lang/lv.js +126 -0
  86. package/lib/locale/lang/mn.js +126 -0
  87. package/lib/locale/lang/ms.js +125 -0
  88. package/lib/locale/lang/nb-NO.js +125 -0
  89. package/lib/locale/lang/nl.js +126 -0
  90. package/lib/locale/lang/pl.js +126 -0
  91. package/lib/locale/lang/pt-br.js +126 -0
  92. package/lib/locale/lang/pt.js +126 -0
  93. package/lib/locale/lang/ro.js +126 -0
  94. package/lib/locale/lang/ru-RU.js +126 -0
  95. package/lib/locale/lang/si.js +126 -0
  96. package/lib/locale/lang/sk.js +128 -0
  97. package/lib/locale/lang/sl.js +126 -0
  98. package/lib/locale/lang/sr-Latn.js +126 -0
  99. package/lib/locale/lang/sr.js +126 -0
  100. package/lib/locale/lang/sv-SE.js +126 -0
  101. package/lib/locale/lang/sw.js +126 -0
  102. package/lib/locale/lang/ta.js +125 -0
  103. package/lib/locale/lang/th.js +126 -0
  104. package/lib/locale/lang/tk.js +126 -0
  105. package/lib/locale/lang/tr-TR.js +126 -0
  106. package/lib/locale/lang/ua.js +126 -0
  107. package/lib/locale/lang/ug-CN.js +126 -0
  108. package/lib/locale/lang/uz-UZ.js +126 -0
  109. package/lib/locale/lang/vi.js +126 -0
  110. package/lib/locale/lang/zh-CN.js +126 -0
  111. package/lib/locale/lang/zh-TW.js +126 -0
  112. package/lib/main.js +264 -0
  113. package/lib/menu-item-group.js +308 -0
  114. package/lib/menu-item.js +491 -0
  115. package/lib/menu.js +865 -0
  116. package/lib/message-box.js +1192 -0
  117. package/lib/message.js +548 -0
  118. package/lib/mixins/emitter.js +36 -0
  119. package/lib/mixins/focus.js +15 -0
  120. package/lib/mixins/locale.js +17 -0
  121. package/lib/mixins/migrating.js +69 -0
  122. package/lib/notification.js +615 -0
  123. package/lib/option-group.js +344 -0
  124. package/lib/option.js +474 -0
  125. package/lib/page-header.js +319 -0
  126. package/lib/pagination.js +950 -0
  127. package/lib/popconfirm.js +457 -0
  128. package/lib/popover.js +617 -0
  129. package/lib/progress.js +595 -0
  130. package/lib/radio-button.js +463 -0
  131. package/lib/radio-group.js +391 -0
  132. package/lib/radio.js +497 -0
  133. package/lib/rate.js +670 -0
  134. package/lib/result.js +578 -0
  135. package/lib/row.js +149 -0
  136. package/lib/scrollbar.js +423 -0
  137. package/lib/select.js +2167 -0
  138. package/lib/skeleton-item.js +342 -0
  139. package/lib/skeleton.js +372 -0
  140. package/lib/slider.js +1199 -0
  141. package/lib/spinner.js +301 -0
  142. package/lib/statistic.js +533 -0
  143. package/lib/step.js +522 -0
  144. package/lib/steps.js +342 -0
  145. package/lib/submenu.js +701 -0
  146. package/lib/switch.js +554 -0
  147. package/lib/tab-pane.js +332 -0
  148. package/lib/table-column.js +952 -0
  149. package/lib/table.js +5010 -0
  150. package/lib/tabs.js +920 -0
  151. package/lib/tag.js +304 -0
  152. package/lib/theme-chalk/alert.css +1 -0
  153. package/lib/theme-chalk/aside.css +1 -0
  154. package/lib/theme-chalk/autocomplete.css +1 -0
  155. package/lib/theme-chalk/avatar.css +1 -0
  156. package/lib/theme-chalk/backtop.css +1 -0
  157. package/lib/theme-chalk/badge.css +1 -0
  158. package/lib/theme-chalk/base.css +1 -0
  159. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  160. package/lib/theme-chalk/breadcrumb.css +1 -0
  161. package/lib/theme-chalk/button-group.css +0 -0
  162. package/lib/theme-chalk/button.css +1 -0
  163. package/lib/theme-chalk/calendar.css +1 -0
  164. package/lib/theme-chalk/card.css +1 -0
  165. package/lib/theme-chalk/carousel-item.css +1 -0
  166. package/lib/theme-chalk/carousel.css +1 -0
  167. package/lib/theme-chalk/cascader-panel.css +1 -0
  168. package/lib/theme-chalk/cascader.css +1 -0
  169. package/lib/theme-chalk/checkbox-button.css +0 -0
  170. package/lib/theme-chalk/checkbox-group.css +0 -0
  171. package/lib/theme-chalk/checkbox.css +1 -0
  172. package/lib/theme-chalk/col.css +1 -0
  173. package/lib/theme-chalk/collapse-item.css +0 -0
  174. package/lib/theme-chalk/collapse.css +1 -0
  175. package/lib/theme-chalk/color-picker.css +1 -0
  176. package/lib/theme-chalk/container.css +1 -0
  177. package/lib/theme-chalk/date-picker.css +1 -0
  178. package/lib/theme-chalk/descriptions-item.css +1 -0
  179. package/lib/theme-chalk/descriptions.css +1 -0
  180. package/lib/theme-chalk/dialog.css +1 -0
  181. package/lib/theme-chalk/display.css +1 -0
  182. package/lib/theme-chalk/divider.css +1 -0
  183. package/lib/theme-chalk/drawer.css +1 -0
  184. package/lib/theme-chalk/dropdown-item.css +0 -0
  185. package/lib/theme-chalk/dropdown-menu.css +0 -0
  186. package/lib/theme-chalk/dropdown.css +1 -0
  187. package/lib/theme-chalk/empty.css +1 -0
  188. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  189. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  190. package/lib/theme-chalk/footer.css +1 -0
  191. package/lib/theme-chalk/form-item.css +0 -0
  192. package/lib/theme-chalk/form.css +1 -0
  193. package/lib/theme-chalk/header.css +1 -0
  194. package/lib/theme-chalk/icon.css +1 -0
  195. package/lib/theme-chalk/image.css +1 -0
  196. package/lib/theme-chalk/index.css +1 -0
  197. package/lib/theme-chalk/infinite-scroll.css +0 -0
  198. package/lib/theme-chalk/infiniteScroll.css +0 -0
  199. package/lib/theme-chalk/input-number.css +1 -0
  200. package/lib/theme-chalk/input.css +1 -0
  201. package/lib/theme-chalk/link.css +1 -0
  202. package/lib/theme-chalk/loading.css +1 -0
  203. package/lib/theme-chalk/main.css +1 -0
  204. package/lib/theme-chalk/menu-item-group.css +0 -0
  205. package/lib/theme-chalk/menu-item.css +0 -0
  206. package/lib/theme-chalk/menu.css +1 -0
  207. package/lib/theme-chalk/message-box.css +1 -0
  208. package/lib/theme-chalk/message.css +1 -0
  209. package/lib/theme-chalk/notification.css +1 -0
  210. package/lib/theme-chalk/option-group.css +1 -0
  211. package/lib/theme-chalk/option.css +1 -0
  212. package/lib/theme-chalk/page-header.css +1 -0
  213. package/lib/theme-chalk/pagination.css +1 -0
  214. package/lib/theme-chalk/popconfirm.css +1 -0
  215. package/lib/theme-chalk/popover.css +1 -0
  216. package/lib/theme-chalk/popper.css +1 -0
  217. package/lib/theme-chalk/progress.css +1 -0
  218. package/lib/theme-chalk/radio-button.css +1 -0
  219. package/lib/theme-chalk/radio-group.css +1 -0
  220. package/lib/theme-chalk/radio.css +1 -0
  221. package/lib/theme-chalk/rate.css +1 -0
  222. package/lib/theme-chalk/reset.css +1 -0
  223. package/lib/theme-chalk/result.css +1 -0
  224. package/lib/theme-chalk/row.css +1 -0
  225. package/lib/theme-chalk/scrollbar.css +1 -0
  226. package/lib/theme-chalk/select-dropdown.css +1 -0
  227. package/lib/theme-chalk/select.css +1 -0
  228. package/lib/theme-chalk/skeleton-item.css +1 -0
  229. package/lib/theme-chalk/skeleton.css +1 -0
  230. package/lib/theme-chalk/slider.css +1 -0
  231. package/lib/theme-chalk/spinner.css +1 -0
  232. package/lib/theme-chalk/statistic.css +1 -0
  233. package/lib/theme-chalk/step.css +1 -0
  234. package/lib/theme-chalk/steps.css +1 -0
  235. package/lib/theme-chalk/submenu.css +0 -0
  236. package/lib/theme-chalk/switch.css +1 -0
  237. package/lib/theme-chalk/tab-pane.css +0 -0
  238. package/lib/theme-chalk/table-column.css +1 -0
  239. package/lib/theme-chalk/table.css +1 -0
  240. package/lib/theme-chalk/tabs.css +1 -0
  241. package/lib/theme-chalk/tag.css +1 -0
  242. package/lib/theme-chalk/time-picker.css +1 -0
  243. package/lib/theme-chalk/time-select.css +1 -0
  244. package/lib/theme-chalk/timeline-item.css +1 -0
  245. package/lib/theme-chalk/timeline.css +1 -0
  246. package/lib/theme-chalk/tooltip.css +1 -0
  247. package/lib/theme-chalk/transfer.css +1 -0
  248. package/lib/theme-chalk/tree.css +1 -0
  249. package/lib/theme-chalk/upload.css +1 -0
  250. package/lib/time-picker.js +2967 -0
  251. package/lib/time-select.js +1765 -0
  252. package/lib/timeline-item.js +371 -0
  253. package/lib/timeline.js +275 -0
  254. package/lib/tooltip.js +425 -0
  255. package/lib/transfer.js +1102 -0
  256. package/lib/transitions/collapse-transition.js +91 -0
  257. package/lib/tree.js +2263 -0
  258. package/lib/umd/locale/af-ZA.js +142 -0
  259. package/lib/umd/locale/ar.js +141 -0
  260. package/lib/umd/locale/az.js +141 -0
  261. package/lib/umd/locale/bg.js +142 -0
  262. package/lib/umd/locale/bn.js +141 -0
  263. package/lib/umd/locale/ca.js +141 -0
  264. package/lib/umd/locale/cs-CZ.js +144 -0
  265. package/lib/umd/locale/da.js +141 -0
  266. package/lib/umd/locale/de.js +143 -0
  267. package/lib/umd/locale/ee.js +142 -0
  268. package/lib/umd/locale/el.js +142 -0
  269. package/lib/umd/locale/en.js +142 -0
  270. package/lib/umd/locale/eo.js +142 -0
  271. package/lib/umd/locale/es.js +141 -0
  272. package/lib/umd/locale/eu.js +142 -0
  273. package/lib/umd/locale/fa.js +142 -0
  274. package/lib/umd/locale/fi.js +142 -0
  275. package/lib/umd/locale/fr.js +141 -0
  276. package/lib/umd/locale/he.js +142 -0
  277. package/lib/umd/locale/hr.js +142 -0
  278. package/lib/umd/locale/hu.js +141 -0
  279. package/lib/umd/locale/hy-AM.js +142 -0
  280. package/lib/umd/locale/id.js +142 -0
  281. package/lib/umd/locale/is.js +142 -0
  282. package/lib/umd/locale/it.js +141 -0
  283. package/lib/umd/locale/ja.js +142 -0
  284. package/lib/umd/locale/kg.js +142 -0
  285. package/lib/umd/locale/km.js +142 -0
  286. package/lib/umd/locale/ko.js +142 -0
  287. package/lib/umd/locale/ku.js +142 -0
  288. package/lib/umd/locale/kz.js +142 -0
  289. package/lib/umd/locale/lo-LA.js +141 -0
  290. package/lib/umd/locale/lt.js +142 -0
  291. package/lib/umd/locale/lv.js +142 -0
  292. package/lib/umd/locale/mn.js +142 -0
  293. package/lib/umd/locale/ms.js +141 -0
  294. package/lib/umd/locale/nb-NO.js +141 -0
  295. package/lib/umd/locale/nl.js +142 -0
  296. package/lib/umd/locale/pl.js +142 -0
  297. package/lib/umd/locale/pt-br.js +142 -0
  298. package/lib/umd/locale/pt.js +142 -0
  299. package/lib/umd/locale/ro.js +142 -0
  300. package/lib/umd/locale/ru-RU.js +142 -0
  301. package/lib/umd/locale/si.js +142 -0
  302. package/lib/umd/locale/sk.js +144 -0
  303. package/lib/umd/locale/sl.js +142 -0
  304. package/lib/umd/locale/sr-Latn.js +142 -0
  305. package/lib/umd/locale/sr.js +142 -0
  306. package/lib/umd/locale/sv-SE.js +142 -0
  307. package/lib/umd/locale/sw.js +142 -0
  308. package/lib/umd/locale/ta.js +141 -0
  309. package/lib/umd/locale/th.js +142 -0
  310. package/lib/umd/locale/tk.js +142 -0
  311. package/lib/umd/locale/tr-TR.js +142 -0
  312. package/lib/umd/locale/ua.js +142 -0
  313. package/lib/umd/locale/ug-CN.js +142 -0
  314. package/lib/umd/locale/uz-UZ.js +142 -0
  315. package/lib/umd/locale/vi.js +142 -0
  316. package/lib/umd/locale/zh-CN.js +142 -0
  317. package/lib/umd/locale/zh-TW.js +142 -0
  318. package/lib/upload.js +1390 -0
  319. package/lib/utils/after-leave.js +35 -0
  320. package/lib/utils/aria-dialog.js +104 -0
  321. package/lib/utils/aria-utils.js +126 -0
  322. package/lib/utils/clickoutside.js +79 -0
  323. package/lib/utils/date-util.js +310 -0
  324. package/lib/utils/date.js +369 -0
  325. package/lib/utils/dom.js +234 -0
  326. package/lib/utils/lodash.js +9421 -0
  327. package/lib/utils/menu/aria-menubar.js +24 -0
  328. package/lib/utils/menu/aria-menuitem.js +62 -0
  329. package/lib/utils/menu/aria-submenu.js +69 -0
  330. package/lib/utils/merge.js +21 -0
  331. package/lib/utils/popper.js +1261 -0
  332. package/lib/utils/popup/index.js +233 -0
  333. package/lib/utils/popup/popup-manager.js +205 -0
  334. package/lib/utils/resize-event.js +59 -0
  335. package/lib/utils/scroll-into-view.js +38 -0
  336. package/lib/utils/scrollbar-width.js +39 -0
  337. package/lib/utils/shared.js +12 -0
  338. package/lib/utils/types.js +52 -0
  339. package/lib/utils/util.js +272 -0
  340. package/lib/utils/vdom.js +13 -0
  341. package/lib/utils/vue-popper.js +202 -0
  342. package/package.json +1 -1
  343. package/packages/theme-chalk/lib/alert.css +1 -0
  344. package/packages/theme-chalk/lib/aside.css +1 -0
  345. package/packages/theme-chalk/lib/autocomplete.css +1 -0
  346. package/packages/theme-chalk/lib/avatar.css +1 -0
  347. package/packages/theme-chalk/lib/backtop.css +1 -0
  348. package/packages/theme-chalk/lib/badge.css +1 -0
  349. package/packages/theme-chalk/lib/base.css +1 -0
  350. package/packages/theme-chalk/lib/breadcrumb-item.css +0 -0
  351. package/packages/theme-chalk/lib/breadcrumb.css +1 -0
  352. package/packages/theme-chalk/lib/button-group.css +0 -0
  353. package/packages/theme-chalk/lib/button.css +1 -0
  354. package/packages/theme-chalk/lib/calendar.css +1 -0
  355. package/packages/theme-chalk/lib/card.css +1 -0
  356. package/packages/theme-chalk/lib/carousel-item.css +1 -0
  357. package/packages/theme-chalk/lib/carousel.css +1 -0
  358. package/packages/theme-chalk/lib/cascader-panel.css +1 -0
  359. package/packages/theme-chalk/lib/cascader.css +1 -0
  360. package/packages/theme-chalk/lib/checkbox-button.css +0 -0
  361. package/packages/theme-chalk/lib/checkbox-group.css +0 -0
  362. package/packages/theme-chalk/lib/checkbox.css +1 -0
  363. package/packages/theme-chalk/lib/col.css +1 -0
  364. package/packages/theme-chalk/lib/collapse-item.css +0 -0
  365. package/packages/theme-chalk/lib/collapse.css +1 -0
  366. package/packages/theme-chalk/lib/color-picker.css +1 -0
  367. package/packages/theme-chalk/lib/container.css +1 -0
  368. package/packages/theme-chalk/lib/date-picker.css +1 -0
  369. package/packages/theme-chalk/lib/descriptions-item.css +1 -0
  370. package/packages/theme-chalk/lib/descriptions.css +1 -0
  371. package/packages/theme-chalk/lib/dialog.css +1 -0
  372. package/packages/theme-chalk/lib/display.css +1 -0
  373. package/packages/theme-chalk/lib/divider.css +1 -0
  374. package/packages/theme-chalk/lib/drawer.css +1 -0
  375. package/packages/theme-chalk/lib/dropdown-item.css +0 -0
  376. package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
  377. package/packages/theme-chalk/lib/dropdown.css +1 -0
  378. package/packages/theme-chalk/lib/empty.css +1 -0
  379. package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
  380. package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
  381. package/packages/theme-chalk/lib/footer.css +1 -0
  382. package/packages/theme-chalk/lib/form-item.css +0 -0
  383. package/packages/theme-chalk/lib/form.css +1 -0
  384. package/packages/theme-chalk/lib/header.css +1 -0
  385. package/packages/theme-chalk/lib/icon.css +1 -0
  386. package/packages/theme-chalk/lib/image.css +1 -0
  387. package/packages/theme-chalk/lib/index.css +1 -0
  388. package/packages/theme-chalk/lib/infinite-scroll.css +0 -0
  389. package/packages/theme-chalk/lib/infiniteScroll.css +0 -0
  390. package/packages/theme-chalk/lib/input-number.css +1 -0
  391. package/packages/theme-chalk/lib/input.css +1 -0
  392. package/packages/theme-chalk/lib/link.css +1 -0
  393. package/packages/theme-chalk/lib/loading.css +1 -0
  394. package/packages/theme-chalk/lib/main.css +1 -0
  395. package/packages/theme-chalk/lib/menu-item-group.css +0 -0
  396. package/packages/theme-chalk/lib/menu-item.css +0 -0
  397. package/packages/theme-chalk/lib/menu.css +1 -0
  398. package/packages/theme-chalk/lib/message-box.css +1 -0
  399. package/packages/theme-chalk/lib/message.css +1 -0
  400. package/packages/theme-chalk/lib/notification.css +1 -0
  401. package/packages/theme-chalk/lib/option-group.css +1 -0
  402. package/packages/theme-chalk/lib/option.css +1 -0
  403. package/packages/theme-chalk/lib/page-header.css +1 -0
  404. package/packages/theme-chalk/lib/pagination.css +1 -0
  405. package/packages/theme-chalk/lib/popconfirm.css +1 -0
  406. package/packages/theme-chalk/lib/popover.css +1 -0
  407. package/packages/theme-chalk/lib/popper.css +1 -0
  408. package/packages/theme-chalk/lib/progress.css +1 -0
  409. package/packages/theme-chalk/lib/radio-button.css +1 -0
  410. package/packages/theme-chalk/lib/radio-group.css +1 -0
  411. package/packages/theme-chalk/lib/radio.css +1 -0
  412. package/packages/theme-chalk/lib/rate.css +1 -0
  413. package/packages/theme-chalk/lib/reset.css +1 -0
  414. package/packages/theme-chalk/lib/result.css +1 -0
  415. package/packages/theme-chalk/lib/row.css +1 -0
  416. package/packages/theme-chalk/lib/scrollbar.css +1 -0
  417. package/packages/theme-chalk/lib/select-dropdown.css +1 -0
  418. package/packages/theme-chalk/lib/select.css +1 -0
  419. package/packages/theme-chalk/lib/skeleton-item.css +1 -0
  420. package/packages/theme-chalk/lib/skeleton.css +1 -0
  421. package/packages/theme-chalk/lib/slider.css +1 -0
  422. package/packages/theme-chalk/lib/spinner.css +1 -0
  423. package/packages/theme-chalk/lib/statistic.css +1 -0
  424. package/packages/theme-chalk/lib/step.css +1 -0
  425. package/packages/theme-chalk/lib/steps.css +1 -0
  426. package/packages/theme-chalk/lib/submenu.css +0 -0
  427. package/packages/theme-chalk/lib/switch.css +1 -0
  428. package/packages/theme-chalk/lib/tab-pane.css +0 -0
  429. package/packages/theme-chalk/lib/table-column.css +1 -0
  430. package/packages/theme-chalk/lib/table.css +1 -0
  431. package/packages/theme-chalk/lib/tabs.css +1 -0
  432. package/packages/theme-chalk/lib/tag.css +1 -0
  433. package/packages/theme-chalk/lib/time-picker.css +1 -0
  434. package/packages/theme-chalk/lib/time-select.css +1 -0
  435. package/packages/theme-chalk/lib/timeline-item.css +1 -0
  436. package/packages/theme-chalk/lib/timeline.css +1 -0
  437. package/packages/theme-chalk/lib/tooltip.css +1 -0
  438. package/packages/theme-chalk/lib/transfer.css +1 -0
  439. package/packages/theme-chalk/lib/tree.css +1 -0
  440. package/packages/theme-chalk/lib/upload.css +1 -0
  441. package/src/index.js +1 -1
package/lib/slider.js ADDED
@@ -0,0 +1,1199 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "/dist/";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 64);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ({
89
+
90
+ /***/ 0:
91
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
+
93
+ "use strict";
94
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
+ /* globals __VUE_SSR_CONTEXT__ */
96
+
97
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
+ // This module is a runtime utility for cleaner component module output and will
99
+ // be included in the final webpack user bundle.
100
+
101
+ function normalizeComponent(
102
+ scriptExports,
103
+ render,
104
+ staticRenderFns,
105
+ functionalTemplate,
106
+ injectStyles,
107
+ scopeId,
108
+ moduleIdentifier /* server only */,
109
+ shadowMode /* vue-cli only */
110
+ ) {
111
+ // Vue.extend constructor export interop
112
+ var options =
113
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
114
+
115
+ // render functions
116
+ if (render) {
117
+ options.render = render
118
+ options.staticRenderFns = staticRenderFns
119
+ options._compiled = true
120
+ }
121
+
122
+ // functional template
123
+ if (functionalTemplate) {
124
+ options.functional = true
125
+ }
126
+
127
+ // scopedId
128
+ if (scopeId) {
129
+ options._scopeId = 'data-v-' + scopeId
130
+ }
131
+
132
+ var hook
133
+ if (moduleIdentifier) {
134
+ // server build
135
+ hook = function (context) {
136
+ // 2.3 injection
137
+ context =
138
+ context || // cached call
139
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
140
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
+ // 2.2 with runInNewContext: true
142
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
+ context = __VUE_SSR_CONTEXT__
144
+ }
145
+ // inject component styles
146
+ if (injectStyles) {
147
+ injectStyles.call(this, context)
148
+ }
149
+ // register component module identifier for async chunk inferrence
150
+ if (context && context._registeredComponents) {
151
+ context._registeredComponents.add(moduleIdentifier)
152
+ }
153
+ }
154
+ // used by ssr in case component is cached and beforeCreate
155
+ // never gets called
156
+ options._ssrRegister = hook
157
+ } else if (injectStyles) {
158
+ hook = shadowMode
159
+ ? function () {
160
+ injectStyles.call(
161
+ this,
162
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
163
+ )
164
+ }
165
+ : injectStyles
166
+ }
167
+
168
+ if (hook) {
169
+ if (options.functional) {
170
+ // for template-only hot-reload because in that case the render fn doesn't
171
+ // go through the normalizer
172
+ options._injectStyles = hook
173
+ // register for functional component in vue file
174
+ var originalRender = options.render
175
+ options.render = function renderWithStyleInjection(h, context) {
176
+ hook.call(context)
177
+ return originalRender(h, context)
178
+ }
179
+ } else {
180
+ // inject component registration as beforeCreate hook
181
+ var existing = options.beforeCreate
182
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
183
+ }
184
+ }
185
+
186
+ return {
187
+ exports: scriptExports,
188
+ options: options
189
+ }
190
+ }
191
+
192
+
193
+ /***/ }),
194
+
195
+ /***/ 29:
196
+ /***/ (function(module, exports) {
197
+
198
+ module.exports = require("element-sim/lib/tooltip");
199
+
200
+ /***/ }),
201
+
202
+ /***/ 4:
203
+ /***/ (function(module, exports) {
204
+
205
+ module.exports = require("element-sim/lib/mixins/emitter");
206
+
207
+ /***/ }),
208
+
209
+ /***/ 50:
210
+ /***/ (function(module, exports) {
211
+
212
+ module.exports = require("element-sim/lib/input-number");
213
+
214
+ /***/ }),
215
+
216
+ /***/ 64:
217
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
218
+
219
+ "use strict";
220
+ // ESM COMPAT FLAG
221
+ __webpack_require__.r(__webpack_exports__);
222
+
223
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=template&id=7cecf2b4
224
+ var render = function () {
225
+ var _vm = this
226
+ var _h = _vm.$createElement
227
+ var _c = _vm._self._c || _h
228
+ return _c(
229
+ "div",
230
+ {
231
+ staticClass: "el-slider",
232
+ class: {
233
+ "is-vertical": _vm.vertical,
234
+ "el-slider--with-input": _vm.showInput,
235
+ },
236
+ attrs: {
237
+ role: "slider",
238
+ "aria-valuemin": _vm.min,
239
+ "aria-valuemax": _vm.max,
240
+ "aria-orientation": _vm.vertical ? "vertical" : "horizontal",
241
+ "aria-disabled": _vm.sliderDisabled,
242
+ },
243
+ },
244
+ [
245
+ _vm.showInput && !_vm.range
246
+ ? _c("el-input-number", {
247
+ ref: "input",
248
+ staticClass: "el-slider__input",
249
+ attrs: {
250
+ step: _vm.step,
251
+ disabled: _vm.sliderDisabled,
252
+ controls: _vm.showInputControls,
253
+ min: _vm.min,
254
+ max: _vm.max,
255
+ debounce: _vm.debounce,
256
+ size: _vm.inputSize,
257
+ },
258
+ on: { change: _vm.emitChange },
259
+ model: {
260
+ value: _vm.firstValue,
261
+ callback: function ($$v) {
262
+ _vm.firstValue = $$v
263
+ },
264
+ expression: "firstValue",
265
+ },
266
+ })
267
+ : _vm._e(),
268
+ _c(
269
+ "div",
270
+ {
271
+ ref: "slider",
272
+ staticClass: "el-slider__runway",
273
+ class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
274
+ style: _vm.runwayStyle,
275
+ on: { click: _vm.onSliderClick },
276
+ },
277
+ [
278
+ _c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
279
+ _c("slider-button", {
280
+ ref: "button1",
281
+ attrs: {
282
+ vertical: _vm.vertical,
283
+ "tooltip-class": _vm.tooltipClass,
284
+ },
285
+ model: {
286
+ value: _vm.firstValue,
287
+ callback: function ($$v) {
288
+ _vm.firstValue = $$v
289
+ },
290
+ expression: "firstValue",
291
+ },
292
+ }),
293
+ _vm.range
294
+ ? _c("slider-button", {
295
+ ref: "button2",
296
+ attrs: {
297
+ vertical: _vm.vertical,
298
+ "tooltip-class": _vm.tooltipClass,
299
+ },
300
+ model: {
301
+ value: _vm.secondValue,
302
+ callback: function ($$v) {
303
+ _vm.secondValue = $$v
304
+ },
305
+ expression: "secondValue",
306
+ },
307
+ })
308
+ : _vm._e(),
309
+ _vm._l(_vm.stops, function (item, key) {
310
+ return _vm.showStops
311
+ ? _c("div", {
312
+ key: key,
313
+ staticClass: "el-slider__stop",
314
+ style: _vm.getStopStyle(item),
315
+ })
316
+ : _vm._e()
317
+ }),
318
+ _vm.markList.length > 0
319
+ ? [
320
+ _c(
321
+ "div",
322
+ _vm._l(_vm.markList, function (item, key) {
323
+ return _c("div", {
324
+ key: key,
325
+ staticClass: "el-slider__stop el-slider__marks-stop",
326
+ style: _vm.getStopStyle(item.position),
327
+ })
328
+ }),
329
+ 0
330
+ ),
331
+ _c(
332
+ "div",
333
+ { staticClass: "el-slider__marks" },
334
+ _vm._l(_vm.markList, function (item, key) {
335
+ return _c("slider-marker", {
336
+ key: key,
337
+ style: _vm.getStopStyle(item.position),
338
+ attrs: { mark: item.mark },
339
+ })
340
+ }),
341
+ 1
342
+ ),
343
+ ]
344
+ : _vm._e(),
345
+ ],
346
+ 2
347
+ ),
348
+ ],
349
+ 1
350
+ )
351
+ }
352
+ var staticRenderFns = []
353
+ render._withStripped = true
354
+
355
+
356
+ // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=7cecf2b4
357
+
358
+ // EXTERNAL MODULE: external "element-sim/lib/input-number"
359
+ var input_number_ = __webpack_require__(50);
360
+ var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
361
+
362
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=template&id=38f267f4
363
+ var buttonvue_type_template_id_38f267f4_render = function () {
364
+ var _vm = this
365
+ var _h = _vm.$createElement
366
+ var _c = _vm._self._c || _h
367
+ return _c(
368
+ "div",
369
+ {
370
+ ref: "button",
371
+ staticClass: "el-slider__button-wrapper",
372
+ class: { hover: _vm.hovering, dragging: _vm.dragging },
373
+ style: _vm.wrapperStyle,
374
+ attrs: { tabindex: "0" },
375
+ on: {
376
+ mouseenter: _vm.handleMouseEnter,
377
+ mouseleave: _vm.handleMouseLeave,
378
+ mousedown: _vm.onButtonDown,
379
+ touchstart: _vm.onButtonDown,
380
+ focus: _vm.handleMouseEnter,
381
+ blur: _vm.handleMouseLeave,
382
+ keydown: [
383
+ function ($event) {
384
+ if (
385
+ !("button" in $event) &&
386
+ _vm._k($event.keyCode, "left", 37, $event.key, [
387
+ "Left",
388
+ "ArrowLeft",
389
+ ])
390
+ ) {
391
+ return null
392
+ }
393
+ if ("button" in $event && $event.button !== 0) {
394
+ return null
395
+ }
396
+ return _vm.onLeftKeyDown($event)
397
+ },
398
+ function ($event) {
399
+ if (
400
+ !("button" in $event) &&
401
+ _vm._k($event.keyCode, "right", 39, $event.key, [
402
+ "Right",
403
+ "ArrowRight",
404
+ ])
405
+ ) {
406
+ return null
407
+ }
408
+ if ("button" in $event && $event.button !== 2) {
409
+ return null
410
+ }
411
+ return _vm.onRightKeyDown($event)
412
+ },
413
+ function ($event) {
414
+ if (
415
+ !("button" in $event) &&
416
+ _vm._k($event.keyCode, "down", 40, $event.key, [
417
+ "Down",
418
+ "ArrowDown",
419
+ ])
420
+ ) {
421
+ return null
422
+ }
423
+ $event.preventDefault()
424
+ return _vm.onLeftKeyDown($event)
425
+ },
426
+ function ($event) {
427
+ if (
428
+ !("button" in $event) &&
429
+ _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
430
+ ) {
431
+ return null
432
+ }
433
+ $event.preventDefault()
434
+ return _vm.onRightKeyDown($event)
435
+ },
436
+ ],
437
+ },
438
+ },
439
+ [
440
+ _c(
441
+ "el-tooltip",
442
+ {
443
+ ref: "tooltip",
444
+ attrs: {
445
+ placement: "top",
446
+ "popper-class": _vm.tooltipClass,
447
+ disabled: !_vm.showTooltip,
448
+ },
449
+ },
450
+ [
451
+ _c("span", { attrs: { slot: "content" }, slot: "content" }, [
452
+ _vm._v(_vm._s(_vm.formatValue)),
453
+ ]),
454
+ _c("div", {
455
+ staticClass: "el-slider__button",
456
+ class: { hover: _vm.hovering, dragging: _vm.dragging },
457
+ }),
458
+ ]
459
+ ),
460
+ ],
461
+ 1
462
+ )
463
+ }
464
+ var buttonvue_type_template_id_38f267f4_staticRenderFns = []
465
+ buttonvue_type_template_id_38f267f4_render._withStripped = true
466
+
467
+
468
+ // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=38f267f4
469
+
470
+ // EXTERNAL MODULE: external "element-sim/lib/tooltip"
471
+ var tooltip_ = __webpack_require__(29);
472
+ var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
473
+
474
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=script&lang=js
475
+ //
476
+ //
477
+ //
478
+ //
479
+ //
480
+ //
481
+ //
482
+ //
483
+ //
484
+ //
485
+ //
486
+ //
487
+ //
488
+ //
489
+ //
490
+ //
491
+ //
492
+ //
493
+ //
494
+ //
495
+ //
496
+ //
497
+ //
498
+ //
499
+ //
500
+ //
501
+ //
502
+ //
503
+ //
504
+
505
+
506
+
507
+ /* harmony default export */ var buttonvue_type_script_lang_js = ({
508
+ name: 'ElSliderButton',
509
+
510
+ components: {
511
+ ElTooltip: tooltip_default.a
512
+ },
513
+
514
+ props: {
515
+ value: {
516
+ type: Number,
517
+ default: 0
518
+ },
519
+ vertical: {
520
+ type: Boolean,
521
+ default: false
522
+ },
523
+ tooltipClass: String
524
+ },
525
+
526
+ data: function data() {
527
+ return {
528
+ hovering: false,
529
+ dragging: false,
530
+ isClick: false,
531
+ startX: 0,
532
+ currentX: 0,
533
+ startY: 0,
534
+ currentY: 0,
535
+ startPosition: 0,
536
+ newPosition: null,
537
+ oldValue: this.value
538
+ };
539
+ },
540
+
541
+
542
+ computed: {
543
+ disabled: function disabled() {
544
+ return this.$parent.sliderDisabled;
545
+ },
546
+ max: function max() {
547
+ return this.$parent.max;
548
+ },
549
+ min: function min() {
550
+ return this.$parent.min;
551
+ },
552
+ step: function step() {
553
+ return this.$parent.step;
554
+ },
555
+ showTooltip: function showTooltip() {
556
+ return this.$parent.showTooltip;
557
+ },
558
+ precision: function precision() {
559
+ return this.$parent.precision;
560
+ },
561
+ currentPosition: function currentPosition() {
562
+ return (this.value - this.min) / (this.max - this.min) * 100 + '%';
563
+ },
564
+ enableFormat: function enableFormat() {
565
+ return this.$parent.formatTooltip instanceof Function;
566
+ },
567
+ formatValue: function formatValue() {
568
+ return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
569
+ },
570
+ wrapperStyle: function wrapperStyle() {
571
+ return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
572
+ }
573
+ },
574
+
575
+ watch: {
576
+ dragging: function dragging(val) {
577
+ this.$parent.dragging = val;
578
+ }
579
+ },
580
+
581
+ methods: {
582
+ displayTooltip: function displayTooltip() {
583
+ this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
584
+ },
585
+ hideTooltip: function hideTooltip() {
586
+ this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
587
+ },
588
+ handleMouseEnter: function handleMouseEnter() {
589
+ this.hovering = true;
590
+ this.displayTooltip();
591
+ },
592
+ handleMouseLeave: function handleMouseLeave() {
593
+ this.hovering = false;
594
+ this.hideTooltip();
595
+ },
596
+ onButtonDown: function onButtonDown(event) {
597
+ if (this.disabled) return;
598
+ event.preventDefault();
599
+ this.onDragStart(event);
600
+ window.addEventListener('mousemove', this.onDragging);
601
+ window.addEventListener('touchmove', this.onDragging);
602
+ window.addEventListener('mouseup', this.onDragEnd);
603
+ window.addEventListener('touchend', this.onDragEnd);
604
+ window.addEventListener('contextmenu', this.onDragEnd);
605
+ },
606
+ onLeftKeyDown: function onLeftKeyDown() {
607
+ if (this.disabled) return;
608
+ this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
609
+ this.setPosition(this.newPosition);
610
+ this.$parent.emitChange();
611
+ },
612
+ onRightKeyDown: function onRightKeyDown() {
613
+ if (this.disabled) return;
614
+ this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
615
+ this.setPosition(this.newPosition);
616
+ this.$parent.emitChange();
617
+ },
618
+ onDragStart: function onDragStart(event) {
619
+ this.dragging = true;
620
+ this.isClick = true;
621
+ if (event.type === 'touchstart') {
622
+ event.clientY = event.touches[0].clientY;
623
+ event.clientX = event.touches[0].clientX;
624
+ }
625
+ if (this.vertical) {
626
+ this.startY = event.clientY;
627
+ } else {
628
+ this.startX = event.clientX;
629
+ }
630
+ this.startPosition = parseFloat(this.currentPosition);
631
+ this.newPosition = this.startPosition;
632
+ },
633
+ onDragging: function onDragging(event) {
634
+ if (this.dragging) {
635
+ this.isClick = false;
636
+ this.displayTooltip();
637
+ this.$parent.resetSize();
638
+ var diff = 0;
639
+ if (event.type === 'touchmove') {
640
+ event.clientY = event.touches[0].clientY;
641
+ event.clientX = event.touches[0].clientX;
642
+ }
643
+ if (this.vertical) {
644
+ this.currentY = event.clientY;
645
+ diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
646
+ } else {
647
+ this.currentX = event.clientX;
648
+ diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
649
+ }
650
+ this.newPosition = this.startPosition + diff;
651
+ this.setPosition(this.newPosition);
652
+ }
653
+ },
654
+ onDragEnd: function onDragEnd() {
655
+ var _this = this;
656
+
657
+ if (this.dragging) {
658
+ /*
659
+ * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
660
+ * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
661
+ */
662
+ setTimeout(function () {
663
+ _this.dragging = false;
664
+ _this.hideTooltip();
665
+ if (!_this.isClick) {
666
+ _this.setPosition(_this.newPosition);
667
+ _this.$parent.emitChange();
668
+ }
669
+ }, 0);
670
+ window.removeEventListener('mousemove', this.onDragging);
671
+ window.removeEventListener('touchmove', this.onDragging);
672
+ window.removeEventListener('mouseup', this.onDragEnd);
673
+ window.removeEventListener('touchend', this.onDragEnd);
674
+ window.removeEventListener('contextmenu', this.onDragEnd);
675
+ }
676
+ },
677
+ setPosition: function setPosition(newPosition) {
678
+ var _this2 = this;
679
+
680
+ if (newPosition === null || isNaN(newPosition)) return;
681
+ if (newPosition < 0) {
682
+ newPosition = 0;
683
+ } else if (newPosition > 100) {
684
+ newPosition = 100;
685
+ }
686
+ var lengthPerStep = 100 / ((this.max - this.min) / this.step);
687
+ var steps = Math.round(newPosition / lengthPerStep);
688
+ var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
689
+ value = parseFloat(value.toFixed(this.precision));
690
+ this.$emit('input', value);
691
+ this.$nextTick(function () {
692
+ _this2.displayTooltip();
693
+ _this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
694
+ });
695
+ if (!this.dragging && this.value !== this.oldValue) {
696
+ this.oldValue = this.value;
697
+ }
698
+ }
699
+ }
700
+ });
701
+ // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js
702
+ /* harmony default export */ var src_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
703
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
704
+ var componentNormalizer = __webpack_require__(0);
705
+
706
+ // CONCATENATED MODULE: ./packages/slider/src/button.vue
707
+
708
+
709
+
710
+
711
+
712
+ /* normalize component */
713
+
714
+ var component = Object(componentNormalizer["a" /* default */])(
715
+ src_buttonvue_type_script_lang_js,
716
+ buttonvue_type_template_id_38f267f4_render,
717
+ buttonvue_type_template_id_38f267f4_staticRenderFns,
718
+ false,
719
+ null,
720
+ null,
721
+ null
722
+
723
+ )
724
+
725
+ /* harmony default export */ var src_button = (component.exports);
726
+ // CONCATENATED MODULE: ./packages/slider/src/marker.js
727
+ /* harmony default export */ var marker = ({
728
+ name: 'ElMarker',
729
+
730
+ props: {
731
+ mark: {
732
+ type: [String, Object]
733
+ }
734
+ },
735
+ render: function render() {
736
+ var h = arguments[0];
737
+
738
+ var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
739
+
740
+ return h(
741
+ 'div',
742
+ { 'class': 'el-slider__marks-text', style: this.mark.style || {} },
743
+ [label]
744
+ );
745
+ }
746
+ });
747
+ // EXTERNAL MODULE: external "element-sim/lib/mixins/emitter"
748
+ var emitter_ = __webpack_require__(4);
749
+ var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
750
+
751
+ // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=script&lang=js
752
+ //
753
+ //
754
+ //
755
+ //
756
+ //
757
+ //
758
+ //
759
+ //
760
+ //
761
+ //
762
+ //
763
+ //
764
+ //
765
+ //
766
+ //
767
+ //
768
+ //
769
+ //
770
+ //
771
+ //
772
+ //
773
+ //
774
+ //
775
+ //
776
+ //
777
+ //
778
+ //
779
+ //
780
+ //
781
+ //
782
+ //
783
+ //
784
+ //
785
+ //
786
+ //
787
+ //
788
+ //
789
+ //
790
+ //
791
+ //
792
+ //
793
+ //
794
+ //
795
+ //
796
+ //
797
+ //
798
+ //
799
+ //
800
+ //
801
+ //
802
+ //
803
+ //
804
+ //
805
+ //
806
+ //
807
+ //
808
+ //
809
+ //
810
+ //
811
+ //
812
+ //
813
+ //
814
+ //
815
+ //
816
+ //
817
+ //
818
+ //
819
+ //
820
+ //
821
+ //
822
+ //
823
+ //
824
+ //
825
+ //
826
+ //
827
+
828
+
829
+
830
+
831
+
832
+
833
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
834
+ name: 'ElSlider',
835
+
836
+ mixins: [emitter_default.a],
837
+
838
+ inject: {
839
+ elForm: {
840
+ default: ''
841
+ }
842
+ },
843
+
844
+ props: {
845
+ min: {
846
+ type: Number,
847
+ default: 0
848
+ },
849
+ max: {
850
+ type: Number,
851
+ default: 100
852
+ },
853
+ step: {
854
+ type: Number,
855
+ default: 1
856
+ },
857
+ value: {
858
+ type: [Number, Array],
859
+ default: 0
860
+ },
861
+ showInput: {
862
+ type: Boolean,
863
+ default: false
864
+ },
865
+ showInputControls: {
866
+ type: Boolean,
867
+ default: true
868
+ },
869
+ inputSize: {
870
+ type: String,
871
+ default: 'small'
872
+ },
873
+ showStops: {
874
+ type: Boolean,
875
+ default: false
876
+ },
877
+ showTooltip: {
878
+ type: Boolean,
879
+ default: true
880
+ },
881
+ formatTooltip: Function,
882
+ disabled: {
883
+ type: Boolean,
884
+ default: false
885
+ },
886
+ range: {
887
+ type: Boolean,
888
+ default: false
889
+ },
890
+ vertical: {
891
+ type: Boolean,
892
+ default: false
893
+ },
894
+ height: {
895
+ type: String
896
+ },
897
+ debounce: {
898
+ type: Number,
899
+ default: 300
900
+ },
901
+ label: {
902
+ type: String
903
+ },
904
+ tooltipClass: String,
905
+ marks: Object
906
+ },
907
+
908
+ components: {
909
+ ElInputNumber: input_number_default.a,
910
+ SliderButton: src_button,
911
+ SliderMarker: marker
912
+ },
913
+
914
+ data: function data() {
915
+ return {
916
+ firstValue: null,
917
+ secondValue: null,
918
+ oldValue: null,
919
+ dragging: false,
920
+ sliderSize: 1
921
+ };
922
+ },
923
+
924
+
925
+ watch: {
926
+ value: function value(val, oldVal) {
927
+ if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
928
+ return item === oldVal[index];
929
+ })) {
930
+ return;
931
+ }
932
+ this.setValues();
933
+ },
934
+ dragging: function dragging(val) {
935
+ if (!val) {
936
+ this.setValues();
937
+ }
938
+ },
939
+ firstValue: function firstValue(val) {
940
+ if (this.range) {
941
+ this.$emit('input', [this.minValue, this.maxValue]);
942
+ } else {
943
+ this.$emit('input', val);
944
+ }
945
+ },
946
+ secondValue: function secondValue() {
947
+ if (this.range) {
948
+ this.$emit('input', [this.minValue, this.maxValue]);
949
+ }
950
+ },
951
+ min: function min() {
952
+ this.setValues();
953
+ },
954
+ max: function max() {
955
+ this.setValues();
956
+ }
957
+ },
958
+
959
+ methods: {
960
+ valueChanged: function valueChanged() {
961
+ var _this = this;
962
+
963
+ if (this.range) {
964
+ return ![this.minValue, this.maxValue].every(function (item, index) {
965
+ return item === _this.oldValue[index];
966
+ });
967
+ } else {
968
+ return this.value !== this.oldValue;
969
+ }
970
+ },
971
+ setValues: function setValues() {
972
+ if (this.min > this.max) {
973
+ console.error('[Element Error][Slider]min should not be greater than max.');
974
+ return;
975
+ }
976
+ var val = this.value;
977
+ if (this.range && Array.isArray(val)) {
978
+ if (val[1] < this.min) {
979
+ this.$emit('input', [this.min, this.min]);
980
+ } else if (val[0] > this.max) {
981
+ this.$emit('input', [this.max, this.max]);
982
+ } else if (val[0] < this.min) {
983
+ this.$emit('input', [this.min, val[1]]);
984
+ } else if (val[1] > this.max) {
985
+ this.$emit('input', [val[0], this.max]);
986
+ } else {
987
+ this.firstValue = val[0];
988
+ this.secondValue = val[1];
989
+ if (this.valueChanged()) {
990
+ this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
991
+ this.oldValue = val.slice();
992
+ }
993
+ }
994
+ } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
995
+ if (val < this.min) {
996
+ this.$emit('input', this.min);
997
+ } else if (val > this.max) {
998
+ this.$emit('input', this.max);
999
+ } else {
1000
+ this.firstValue = val;
1001
+ if (this.valueChanged()) {
1002
+ this.dispatch('ElFormItem', 'el.form.change', val);
1003
+ this.oldValue = val;
1004
+ }
1005
+ }
1006
+ }
1007
+ },
1008
+ setPosition: function setPosition(percent) {
1009
+ var targetValue = this.min + percent * (this.max - this.min) / 100;
1010
+ if (!this.range) {
1011
+ this.$refs.button1.setPosition(percent);
1012
+ return;
1013
+ }
1014
+ var button = void 0;
1015
+ if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
1016
+ button = this.firstValue < this.secondValue ? 'button1' : 'button2';
1017
+ } else {
1018
+ button = this.firstValue > this.secondValue ? 'button1' : 'button2';
1019
+ }
1020
+ this.$refs[button].setPosition(percent);
1021
+ },
1022
+ onSliderClick: function onSliderClick(event) {
1023
+ if (this.sliderDisabled || this.dragging) return;
1024
+ this.resetSize();
1025
+ if (this.vertical) {
1026
+ var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
1027
+ this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
1028
+ } else {
1029
+ var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
1030
+ this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
1031
+ }
1032
+ this.emitChange();
1033
+ },
1034
+ resetSize: function resetSize() {
1035
+ if (this.$refs.slider) {
1036
+ this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
1037
+ }
1038
+ },
1039
+ emitChange: function emitChange() {
1040
+ var _this2 = this;
1041
+
1042
+ this.$nextTick(function () {
1043
+ _this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
1044
+ });
1045
+ },
1046
+ getStopStyle: function getStopStyle(position) {
1047
+ return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
1048
+ }
1049
+ },
1050
+
1051
+ computed: {
1052
+ stops: function stops() {
1053
+ var _this3 = this;
1054
+
1055
+ if (!this.showStops || this.min > this.max) return [];
1056
+ if (this.step === 0) {
1057
+ false && false;
1058
+ return [];
1059
+ }
1060
+ var stopCount = (this.max - this.min) / this.step;
1061
+ var stepWidth = 100 * this.step / (this.max - this.min);
1062
+ var result = [];
1063
+ for (var i = 1; i < stopCount; i++) {
1064
+ result.push(i * stepWidth);
1065
+ }
1066
+ if (this.range) {
1067
+ return result.filter(function (step) {
1068
+ return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
1069
+ });
1070
+ } else {
1071
+ return result.filter(function (step) {
1072
+ return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
1073
+ });
1074
+ }
1075
+ },
1076
+ markList: function markList() {
1077
+ var _this4 = this;
1078
+
1079
+ if (!this.marks) {
1080
+ return [];
1081
+ }
1082
+
1083
+ var marksKeys = Object.keys(this.marks);
1084
+ return marksKeys.map(parseFloat).sort(function (a, b) {
1085
+ return a - b;
1086
+ }).filter(function (point) {
1087
+ return point <= _this4.max && point >= _this4.min;
1088
+ }).map(function (point) {
1089
+ return {
1090
+ point: point,
1091
+ position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
1092
+ mark: _this4.marks[point]
1093
+ };
1094
+ });
1095
+ },
1096
+ minValue: function minValue() {
1097
+ return Math.min(this.firstValue, this.secondValue);
1098
+ },
1099
+ maxValue: function maxValue() {
1100
+ return Math.max(this.firstValue, this.secondValue);
1101
+ },
1102
+ barSize: function barSize() {
1103
+ return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
1104
+ },
1105
+ barStart: function barStart() {
1106
+ return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
1107
+ },
1108
+ precision: function precision() {
1109
+ var precisions = [this.min, this.max, this.step].map(function (item) {
1110
+ var decimal = ('' + item).split('.')[1];
1111
+ return decimal ? decimal.length : 0;
1112
+ });
1113
+ return Math.max.apply(null, precisions);
1114
+ },
1115
+ runwayStyle: function runwayStyle() {
1116
+ return this.vertical ? { height: this.height } : {};
1117
+ },
1118
+ barStyle: function barStyle() {
1119
+ return this.vertical ? {
1120
+ height: this.barSize,
1121
+ bottom: this.barStart
1122
+ } : {
1123
+ width: this.barSize,
1124
+ left: this.barStart
1125
+ };
1126
+ },
1127
+ sliderDisabled: function sliderDisabled() {
1128
+ return this.disabled || (this.elForm || {}).disabled;
1129
+ }
1130
+ },
1131
+
1132
+ mounted: function mounted() {
1133
+ var valuetext = void 0;
1134
+ if (this.range) {
1135
+ if (Array.isArray(this.value)) {
1136
+ this.firstValue = Math.max(this.min, this.value[0]);
1137
+ this.secondValue = Math.min(this.max, this.value[1]);
1138
+ } else {
1139
+ this.firstValue = this.min;
1140
+ this.secondValue = this.max;
1141
+ }
1142
+ this.oldValue = [this.firstValue, this.secondValue];
1143
+ valuetext = this.firstValue + '-' + this.secondValue;
1144
+ } else {
1145
+ if (typeof this.value !== 'number' || isNaN(this.value)) {
1146
+ this.firstValue = this.min;
1147
+ } else {
1148
+ this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
1149
+ }
1150
+ this.oldValue = this.firstValue;
1151
+ valuetext = this.firstValue;
1152
+ }
1153
+ this.$el.setAttribute('aria-valuetext', valuetext);
1154
+
1155
+ // label screen reader
1156
+ this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
1157
+
1158
+ this.resetSize();
1159
+ window.addEventListener('resize', this.resetSize);
1160
+ },
1161
+ beforeDestroy: function beforeDestroy() {
1162
+ window.removeEventListener('resize', this.resetSize);
1163
+ }
1164
+ });
1165
+ // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js
1166
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
1167
+ // CONCATENATED MODULE: ./packages/slider/src/main.vue
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+ /* normalize component */
1174
+
1175
+ var main_component = Object(componentNormalizer["a" /* default */])(
1176
+ src_mainvue_type_script_lang_js,
1177
+ render,
1178
+ staticRenderFns,
1179
+ false,
1180
+ null,
1181
+ null,
1182
+ null
1183
+
1184
+ )
1185
+
1186
+ /* harmony default export */ var main = (main_component.exports);
1187
+ // CONCATENATED MODULE: ./packages/slider/index.js
1188
+
1189
+
1190
+ /* istanbul ignore next */
1191
+ main.install = function (Vue) {
1192
+ Vue.component(main.name, main);
1193
+ };
1194
+
1195
+ /* harmony default export */ var slider = __webpack_exports__["default"] = (main);
1196
+
1197
+ /***/ })
1198
+
1199
+ /******/ });