cy-element-ui 1.1.14 → 1.1.16

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 (526) hide show
  1. package/README.md +35 -5
  2. package/lib/alert.js +68 -68
  3. package/lib/aside.js +11 -11
  4. package/lib/autocomplete.js +287 -287
  5. package/lib/avatar.js +121 -121
  6. package/lib/backtop.js +91 -91
  7. package/lib/badge.js +32 -32
  8. package/lib/breadcrumb-item.js +33 -33
  9. package/lib/breadcrumb.js +27 -27
  10. package/lib/button-group.js +4 -4
  11. package/lib/button.js +53 -53
  12. package/lib/calendar.js +426 -426
  13. package/lib/card.js +11 -11
  14. package/lib/carousel-item.js +108 -108
  15. package/lib/carousel.js +244 -244
  16. package/lib/cascader-panel.js +1045 -1045
  17. package/lib/cascader.js +577 -577
  18. package/lib/checkbox-button.js +137 -137
  19. package/lib/checkbox-group.js +39 -39
  20. package/lib/checkbox.js +151 -151
  21. package/lib/col.js +64 -64
  22. package/lib/collapse-item.js +66 -66
  23. package/lib/collapse.js +63 -63
  24. package/lib/color-picker.js +944 -944
  25. package/lib/container.js +24 -24
  26. package/lib/date-picker.js +2968 -2967
  27. package/lib/descriptions-item.js +29 -29
  28. package/lib/descriptions.js +324 -324
  29. package/lib/dialog.js +170 -170
  30. package/lib/divider.js +20 -20
  31. package/lib/drawer.js +156 -156
  32. package/lib/dropdown-item.js +19 -19
  33. package/lib/dropdown-menu.js +56 -56
  34. package/lib/dropdown.js +329 -329
  35. package/lib/element-ui.common.js +44918 -0
  36. package/lib/empty.js +39 -39
  37. package/lib/footer.js +11 -11
  38. package/lib/form-item.js +369 -369
  39. package/lib/form.js +181 -181
  40. package/lib/header.js +11 -11
  41. package/lib/icon.js +7 -7
  42. package/lib/image.js +520 -520
  43. package/lib/index.js +1 -1
  44. package/lib/infinite-scroll.js +127 -127
  45. package/lib/input-number.js +260 -260
  46. package/lib/input.js +370 -370
  47. package/lib/link.js +28 -28
  48. package/lib/loading.js +219 -219
  49. package/lib/main.js +5 -5
  50. package/lib/menu-item-group.js +33 -33
  51. package/lib/menu-item.js +116 -116
  52. package/lib/menu.js +490 -490
  53. package/lib/message-box.js +421 -421
  54. package/lib/message.js +150 -150
  55. package/lib/notification.js +184 -184
  56. package/lib/option-group.js +46 -46
  57. package/lib/option.js +145 -145
  58. package/lib/page-header.js +14 -14
  59. package/lib/pagination.js +530 -530
  60. package/lib/popconfirm.js +68 -68
  61. package/lib/popover.js +225 -225
  62. package/lib/progress.js +183 -183
  63. package/lib/radio-button.js +78 -78
  64. package/lib/radio-group.js +103 -103
  65. package/lib/radio.js +86 -86
  66. package/lib/rate.js +283 -283
  67. package/lib/result.js +61 -61
  68. package/lib/row.js +32 -32
  69. package/lib/scrollbar.js +247 -247
  70. package/lib/select.js +999 -999
  71. package/lib/selectDisplayInput.js +61 -61
  72. package/lib/skeleton-item.js +19 -19
  73. package/lib/skeleton.js +53 -53
  74. package/lib/slider.js +550 -550
  75. package/lib/spinner.js +19 -19
  76. package/lib/statistic.js +198 -198
  77. package/lib/step.js +125 -125
  78. package/lib/steps.js +54 -54
  79. package/lib/subTitle.js +24 -24
  80. package/lib/submenu.js +405 -406
  81. package/lib/switch.js +135 -135
  82. package/lib/tab-pane.js +43 -43
  83. package/lib/tabDialog.js +508 -508
  84. package/lib/table-column.js +713 -713
  85. package/lib/table.js +3432 -3432
  86. package/lib/tabs.js +578 -578
  87. package/lib/tag.js +60 -60
  88. package/lib/time-picker.js +1350 -1350
  89. package/lib/time-select.js +949 -949
  90. package/lib/timeline-item.js +25 -25
  91. package/lib/timeline.js +30 -30
  92. package/lib/tooltip.js +255 -255
  93. package/lib/transfer.js +385 -385
  94. package/lib/tree.js +1547 -1547
  95. package/lib/treeSelect.js +2618 -2618
  96. package/lib/umd/locale/en.js +137 -137
  97. package/lib/umd/locale/zh-CN.js +137 -137
  98. package/lib/umd/locale/zh-TW.js +137 -137
  99. package/lib/upload.js +738 -738
  100. package/package.json +9 -7
  101. package/packages/alert/index.js +1 -1
  102. package/packages/alert/src/main.vue +82 -82
  103. package/packages/aside/index.js +1 -1
  104. package/packages/aside/src/main.vue +13 -13
  105. package/packages/autocomplete/index.js +1 -1
  106. package/packages/autocomplete/src/autocomplete-suggestions.vue +64 -64
  107. package/packages/autocomplete/src/autocomplete.vue +272 -272
  108. package/packages/avatar/index.js +1 -1
  109. package/packages/avatar/src/main.vue +88 -88
  110. package/packages/backtop/index.js +1 -1
  111. package/packages/backtop/src/main.vue +92 -92
  112. package/packages/badge/index.js +1 -1
  113. package/packages/badge/src/main.vue +41 -41
  114. package/packages/breadcrumb/index.js +1 -1
  115. package/packages/breadcrumb/src/breadcrumb-item.vue +35 -35
  116. package/packages/breadcrumb/src/breadcrumb.vue +27 -27
  117. package/packages/breadcrumb-item/index.js +1 -1
  118. package/packages/button/index.js +1 -1
  119. package/packages/button/src/button-group.vue +6 -6
  120. package/packages/button/src/button.vue +70 -70
  121. package/packages/button-group/index.js +1 -1
  122. package/packages/calendar/index.js +1 -1
  123. package/packages/calendar/src/date-table.vue +193 -193
  124. package/packages/calendar/src/main.vue +242 -242
  125. package/packages/card/index.js +1 -1
  126. package/packages/card/src/main.vue +18 -18
  127. package/packages/carousel/index.js +1 -1
  128. package/packages/carousel/src/item.vue +122 -122
  129. package/packages/carousel/src/main.vue +305 -305
  130. package/packages/carousel-item/index.js +1 -1
  131. package/packages/cascader/index.js +1 -1
  132. package/packages/cascader/src/cascader.vue +626 -626
  133. package/packages/cascader-panel/index.js +1 -1
  134. package/packages/cascader-panel/src/cascader-menu.vue +128 -128
  135. package/packages/cascader-panel/src/cascader-node.vue +244 -244
  136. package/packages/cascader-panel/src/cascader-panel.vue +334 -334
  137. package/packages/cascader-panel/src/node.js +157 -158
  138. package/packages/cascader-panel/src/store.js +49 -50
  139. package/packages/checkbox/index.js +1 -1
  140. package/packages/checkbox/src/checkbox-button.vue +195 -195
  141. package/packages/checkbox/src/checkbox-group.vue +43 -43
  142. package/packages/checkbox/src/checkbox.vue +218 -218
  143. package/packages/checkbox-button/index.js +1 -1
  144. package/packages/checkbox-group/index.js +1 -1
  145. package/packages/col/index.js +1 -1
  146. package/packages/col/src/col.js +63 -63
  147. package/packages/collapse/index.js +1 -1
  148. package/packages/collapse/src/collapse-item.vue +101 -101
  149. package/packages/collapse/src/collapse.vue +61 -61
  150. package/packages/collapse-item/index.js +1 -1
  151. package/packages/color-picker/index.js +1 -1
  152. package/packages/color-picker/src/color.js +263 -263
  153. package/packages/color-picker/src/components/alpha-slider.vue +127 -127
  154. package/packages/color-picker/src/components/hue-slider.vue +118 -118
  155. package/packages/color-picker/src/components/picker-dropdown.vue +105 -105
  156. package/packages/color-picker/src/components/predefine.vue +55 -55
  157. package/packages/color-picker/src/components/sv-panel.vue +95 -95
  158. package/packages/color-picker/src/draggable.js +27 -27
  159. package/packages/color-picker/src/main.vue +183 -183
  160. package/packages/container/index.js +1 -1
  161. package/packages/container/src/main.vue +25 -25
  162. package/packages/date-picker/index.js +1 -1
  163. package/packages/date-picker/src/basic/date-table.vue +435 -435
  164. package/packages/date-picker/src/basic/month-table.vue +239 -240
  165. package/packages/date-picker/src/basic/time-spinner.vue +279 -279
  166. package/packages/date-picker/src/basic/year-table.vue +99 -99
  167. package/packages/date-picker/src/panel/date-range.vue +675 -675
  168. package/packages/date-picker/src/panel/date.vue +604 -604
  169. package/packages/date-picker/src/panel/month-range.vue +260 -260
  170. package/packages/date-picker/src/panel/time-range.vue +242 -242
  171. package/packages/date-picker/src/panel/time-select.vue +173 -173
  172. package/packages/date-picker/src/panel/time.vue +181 -181
  173. package/packages/date-picker/src/picker/date-picker.js +29 -29
  174. package/packages/date-picker/src/picker/time-picker.js +28 -28
  175. package/packages/date-picker/src/picker/time-select.js +12 -12
  176. package/packages/date-picker/src/picker.vue +900 -900
  177. package/packages/descriptions/index.js +1 -1
  178. package/packages/descriptions/src/descriptions-item.js +28 -28
  179. package/packages/descriptions/src/descriptions-row.js +114 -114
  180. package/packages/descriptions/src/index.js +168 -168
  181. package/packages/descriptions-item/index.js +1 -1
  182. package/packages/dialog/index.js +1 -1
  183. package/packages/dialog/src/component.vue +207 -207
  184. package/packages/divider/index.js +1 -1
  185. package/packages/divider/src/main.vue +29 -29
  186. package/packages/drawer/index.js +1 -1
  187. package/packages/drawer/src/main.vue +195 -195
  188. package/packages/dropdown/index.js +1 -1
  189. package/packages/dropdown/src/dropdown-item.vue +29 -29
  190. package/packages/dropdown/src/dropdown-menu.vue +59 -59
  191. package/packages/dropdown/src/dropdown.vue +271 -271
  192. package/packages/dropdown-item/index.js +1 -1
  193. package/packages/dropdown-menu/index.js +1 -1
  194. package/packages/empty/index.js +1 -1
  195. package/packages/empty/src/img-empty.vue +124 -124
  196. package/packages/empty/src/index.vue +40 -40
  197. package/packages/footer/index.js +1 -1
  198. package/packages/footer/src/main.vue +13 -13
  199. package/packages/form/index.js +1 -1
  200. package/packages/form/src/form-item.vue +294 -294
  201. package/packages/form/src/form.vue +169 -169
  202. package/packages/form/src/label-wrap.vue +65 -65
  203. package/packages/form-item/index.js +1 -1
  204. package/packages/header/index.js +1 -1
  205. package/packages/header/src/main.vue +13 -13
  206. package/packages/icon/index.js +1 -1
  207. package/packages/icon/src/icon.vue +7 -7
  208. package/packages/image/index.js +1 -1
  209. package/packages/image/src/image-viewer.vue +309 -309
  210. package/packages/image/src/main.vue +242 -242
  211. package/packages/infinite-scroll/index.js +1 -1
  212. package/packages/infinite-scroll/src/main.js +113 -114
  213. package/packages/input/index.js +1 -1
  214. package/packages/input/src/calcTextareaHeight.js +70 -70
  215. package/packages/input/src/input.vue +416 -416
  216. package/packages/input-number/index.js +1 -1
  217. package/packages/input-number/src/input-number.vue +272 -272
  218. package/packages/link/index.js +1 -1
  219. package/packages/link/src/main.vue +40 -40
  220. package/packages/loading/index.js +6 -6
  221. package/packages/loading/src/directive.js +105 -105
  222. package/packages/loading/src/index.js +74 -74
  223. package/packages/loading/src/loading.vue +35 -35
  224. package/packages/main/index.js +1 -1
  225. package/packages/main/src/main.vue +7 -7
  226. package/packages/menu/index.js +1 -1
  227. package/packages/menu/src/menu-item-group.vue +38 -38
  228. package/packages/menu/src/menu-item.vue +103 -103
  229. package/packages/menu/src/menu-mixin.js +39 -39
  230. package/packages/menu/src/menu.vue +298 -298
  231. package/packages/menu/src/submenu.vue +330 -331
  232. package/packages/menu-item/index.js +1 -1
  233. package/packages/menu-item-group/index.js +1 -1
  234. package/packages/message/src/main.js +65 -65
  235. package/packages/message/src/main.vue +105 -105
  236. package/packages/message-box/src/main.js +172 -172
  237. package/packages/message-box/src/main.vue +309 -309
  238. package/packages/notification/src/main.js +63 -63
  239. package/packages/notification/src/main.vue +135 -135
  240. package/packages/option/index.js +1 -1
  241. package/packages/option-group/index.js +1 -1
  242. package/packages/page-header/index.js +1 -1
  243. package/packages/page-header/src/main.vue +21 -21
  244. package/packages/pagination/index.js +1 -1
  245. package/packages/pagination/src/pager.vue +158 -158
  246. package/packages/pagination/src/pagination.js +377 -377
  247. package/packages/popconfirm/index.js +1 -1
  248. package/packages/popconfirm/src/main.vue +94 -94
  249. package/packages/popover/index.js +2 -2
  250. package/packages/popover/src/directive.js +15 -15
  251. package/packages/popover/src/main.vue +214 -214
  252. package/packages/progress/index.js +1 -1
  253. package/packages/progress/src/progress.vue +228 -228
  254. package/packages/radio/index.js +1 -1
  255. package/packages/radio/src/radio-button.vue +106 -106
  256. package/packages/radio/src/radio-group.vue +101 -101
  257. package/packages/radio/src/radio.vue +122 -122
  258. package/packages/radio-button/index.js +1 -1
  259. package/packages/radio-group/index.js +1 -1
  260. package/packages/rate/index.js +1 -1
  261. package/packages/rate/src/main.vue +316 -316
  262. package/packages/result/index.js +1 -1
  263. package/packages/result/src/icon-error.vue +6 -6
  264. package/packages/result/src/icon-info.vue +6 -6
  265. package/packages/result/src/icon-success.vue +6 -6
  266. package/packages/result/src/icon-warning.vue +6 -6
  267. package/packages/result/src/index.vue +51 -51
  268. package/packages/row/index.js +1 -1
  269. package/packages/row/src/row.js +36 -36
  270. package/packages/scrollbar/index.js +1 -1
  271. package/packages/scrollbar/src/bar.js +86 -86
  272. package/packages/scrollbar/src/main.js +120 -120
  273. package/packages/scrollbar/src/util.js +27 -27
  274. package/packages/select/index.js +1 -1
  275. package/packages/select/src/navigation-mixin.js +47 -47
  276. package/packages/select/src/option-group.vue +55 -55
  277. package/packages/select/src/option.vue +163 -163
  278. package/packages/select/src/select-dropdown.vue +57 -57
  279. package/packages/select/src/select.vue +895 -895
  280. package/packages/selectDisplayInput/index.js +1 -1
  281. package/packages/selectDisplayInput/src/main.vue +61 -61
  282. package/packages/skeleton/index.js +1 -1
  283. package/packages/skeleton/src/img-placeholder.vue +9 -9
  284. package/packages/skeleton/src/index.vue +70 -70
  285. package/packages/skeleton/src/item.vue +17 -17
  286. package/packages/skeleton-item/index.js +1 -1
  287. package/packages/slider/index.js +1 -1
  288. package/packages/slider/src/button.vue +230 -230
  289. package/packages/slider/src/main.vue +422 -422
  290. package/packages/slider/src/marker.js +14 -14
  291. package/packages/spinner/index.js +1 -1
  292. package/packages/spinner/src/spinner.vue +23 -23
  293. package/packages/statistic/index.js +1 -1
  294. package/packages/statistic/src/main.vue +196 -197
  295. package/packages/step/index.js +1 -1
  296. package/packages/steps/index.js +1 -1
  297. package/packages/steps/src/step.vue +177 -177
  298. package/packages/steps/src/steps.vue +53 -53
  299. package/packages/subTitle/index.js +1 -1
  300. package/packages/subTitle/src/main.vue +29 -29
  301. package/packages/submenu/index.js +1 -1
  302. package/packages/switch/index.js +1 -1
  303. package/packages/switch/src/component.vue +169 -169
  304. package/packages/tab-pane/index.js +1 -1
  305. package/packages/tabDialog/index.js +10 -10
  306. package/packages/tabDialog/src/dialog/drag.js +50 -50
  307. package/packages/tabDialog/src/dialog/dragHeight.js +27 -27
  308. package/packages/tabDialog/src/dialog/dragWidth.js +23 -23
  309. package/packages/tabDialog/src/main.vue +257 -257
  310. package/packages/table/index.js +1 -1
  311. package/packages/table/src/config.js +108 -108
  312. package/packages/table/src/dropdown.js +19 -19
  313. package/packages/table/src/filter-panel.vue +189 -189
  314. package/packages/table/src/layout-observer.js +60 -60
  315. package/packages/table/src/store/current.js +65 -65
  316. package/packages/table/src/store/expand.js +57 -57
  317. package/packages/table/src/store/helper.js +32 -32
  318. package/packages/table/src/store/index.js +133 -133
  319. package/packages/table/src/store/tree.js +194 -194
  320. package/packages/table/src/store/watcher.js +366 -366
  321. package/packages/table/src/table-body.js +456 -456
  322. package/packages/table/src/table-column.js +311 -311
  323. package/packages/table/src/table-footer.js +139 -139
  324. package/packages/table/src/table-header.js +496 -496
  325. package/packages/table/src/table-layout.js +241 -241
  326. package/packages/table/src/table-row.js +97 -97
  327. package/packages/table/src/table.vue +666 -666
  328. package/packages/table/src/util.js +214 -214
  329. package/packages/table-column/index.js +1 -1
  330. package/packages/tabs/index.js +1 -1
  331. package/packages/tabs/src/tab-bar.vue +47 -47
  332. package/packages/tabs/src/tab-nav.vue +268 -268
  333. package/packages/tabs/src/tab-pane.vue +47 -47
  334. package/packages/tabs/src/tabs.vue +174 -174
  335. package/packages/tag/index.js +1 -1
  336. package/packages/tag/src/tag.vue +55 -55
  337. package/packages/theme-chalk/gulpfile.js +11 -11
  338. package/packages/theme-chalk/src/alert.scss +138 -138
  339. package/packages/theme-chalk/src/aside.scss +3 -3
  340. package/packages/theme-chalk/src/autocomplete.scss +58 -58
  341. package/packages/theme-chalk/src/avatar.scss +46 -46
  342. package/packages/theme-chalk/src/backtop.scss +16 -16
  343. package/packages/theme-chalk/src/badge.scss +47 -47
  344. package/packages/theme-chalk/src/breadcrumb.scss +49 -49
  345. package/packages/theme-chalk/src/button.scss +229 -229
  346. package/packages/theme-chalk/src/calendar.scss +57 -57
  347. package/packages/theme-chalk/src/card.scss +23 -23
  348. package/packages/theme-chalk/src/carousel-item.scss +41 -41
  349. package/packages/theme-chalk/src/carousel.scss +148 -148
  350. package/packages/theme-chalk/src/cascader-panel.scss +106 -106
  351. package/packages/theme-chalk/src/cascader.scss +173 -173
  352. package/packages/theme-chalk/src/checkbox.scss +346 -346
  353. package/packages/theme-chalk/src/col.scss +130 -130
  354. package/packages/theme-chalk/src/collapse.scss +52 -52
  355. package/packages/theme-chalk/src/color-picker.scss +364 -364
  356. package/packages/theme-chalk/src/common/popup.scss +22 -22
  357. package/packages/theme-chalk/src/common/transition.scss +33 -33
  358. package/packages/theme-chalk/src/common/var.scss +16 -16
  359. package/packages/theme-chalk/src/container.scss +9 -9
  360. package/packages/theme-chalk/src/cy/base.scss +1 -1
  361. package/packages/theme-chalk/src/date-picker/date-picker.scss +91 -91
  362. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +97 -97
  363. package/packages/theme-chalk/src/date-picker/date-table.scss +146 -146
  364. package/packages/theme-chalk/src/date-picker/month-table.scss +69 -69
  365. package/packages/theme-chalk/src/date-picker/picker-panel.scss +105 -105
  366. package/packages/theme-chalk/src/date-picker/picker.scss +188 -188
  367. package/packages/theme-chalk/src/date-picker/time-picker.scss +72 -72
  368. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +23 -23
  369. package/packages/theme-chalk/src/date-picker/time-spinner.scss +106 -106
  370. package/packages/theme-chalk/src/date-picker/year-table.scss +47 -47
  371. package/packages/theme-chalk/src/descriptions-item.scss +33 -33
  372. package/packages/theme-chalk/src/descriptions.scss +105 -105
  373. package/packages/theme-chalk/src/dialog.scss +104 -104
  374. package/packages/theme-chalk/src/display.scss +7 -7
  375. package/packages/theme-chalk/src/divider.scss +36 -36
  376. package/packages/theme-chalk/src/drawer.scss +185 -185
  377. package/packages/theme-chalk/src/dropdown.scss +172 -172
  378. package/packages/theme-chalk/src/empty.scss +34 -34
  379. package/packages/theme-chalk/src/footer.scss +3 -3
  380. package/packages/theme-chalk/src/form.scss +149 -149
  381. package/packages/theme-chalk/src/header.scss +3 -3
  382. package/packages/theme-chalk/src/icon.scss +309 -309
  383. package/packages/theme-chalk/src/image.scss +153 -153
  384. package/packages/theme-chalk/src/input-number.scss +255 -255
  385. package/packages/theme-chalk/src/input.scss +345 -345
  386. package/packages/theme-chalk/src/link.scss +67 -67
  387. package/packages/theme-chalk/src/loading.scss +67 -67
  388. package/packages/theme-chalk/src/main.scss +7 -7
  389. package/packages/theme-chalk/src/menu.scss +248 -248
  390. package/packages/theme-chalk/src/message-box.scss +205 -205
  391. package/packages/theme-chalk/src/message.scss +111 -111
  392. package/packages/theme-chalk/src/mixins/_button.scss +64 -64
  393. package/packages/theme-chalk/src/mixins/function.scss +18 -18
  394. package/packages/theme-chalk/src/mixins/mixins.scss +126 -126
  395. package/packages/theme-chalk/src/mixins/utils.scss +26 -26
  396. package/packages/theme-chalk/src/notification.scss +88 -88
  397. package/packages/theme-chalk/src/option-group.scss +31 -31
  398. package/packages/theme-chalk/src/option.scss +27 -27
  399. package/packages/theme-chalk/src/page-header.scss +31 -31
  400. package/packages/theme-chalk/src/pagination.scss +284 -284
  401. package/packages/theme-chalk/src/popconfirm.scss +11 -11
  402. package/packages/theme-chalk/src/popover.scss +30 -30
  403. package/packages/theme-chalk/src/popper.scss +82 -82
  404. package/packages/theme-chalk/src/progress.scss +128 -128
  405. package/packages/theme-chalk/src/radio-button.scss +94 -94
  406. package/packages/theme-chalk/src/radio-group.scss +4 -4
  407. package/packages/theme-chalk/src/radio.scss +192 -192
  408. package/packages/theme-chalk/src/rate.scss +38 -38
  409. package/packages/theme-chalk/src/reset.scss +39 -39
  410. package/packages/theme-chalk/src/result.scss +56 -56
  411. package/packages/theme-chalk/src/row.scss +31 -31
  412. package/packages/theme-chalk/src/scrollbar.scss +57 -57
  413. package/packages/theme-chalk/src/select-dropdown.scss +47 -47
  414. package/packages/theme-chalk/src/select.scss +140 -140
  415. package/packages/theme-chalk/src/skeleton-item.scss +75 -75
  416. package/packages/theme-chalk/src/skeleton.scss +27 -27
  417. package/packages/theme-chalk/src/slider.scss +238 -238
  418. package/packages/theme-chalk/src/spinner.scss +27 -27
  419. package/packages/theme-chalk/src/statistic.scss +32 -32
  420. package/packages/theme-chalk/src/step.scss +312 -312
  421. package/packages/theme-chalk/src/steps.scss +13 -13
  422. package/packages/theme-chalk/src/switch.scss +101 -101
  423. package/packages/theme-chalk/src/table-column.scss +87 -87
  424. package/packages/theme-chalk/src/table.scss +556 -556
  425. package/packages/theme-chalk/src/tabs.scss +576 -576
  426. package/packages/theme-chalk/src/tag.scss +155 -155
  427. package/packages/theme-chalk/src/time-select.scss +14 -14
  428. package/packages/theme-chalk/src/timeline-item.scss +71 -71
  429. package/packages/theme-chalk/src/timeline.scss +8 -8
  430. package/packages/theme-chalk/src/tooltip.scss +136 -136
  431. package/packages/theme-chalk/src/transfer.scss +214 -214
  432. package/packages/theme-chalk/src/tree.scss +110 -110
  433. package/packages/theme-chalk/src/upload.scss +587 -587
  434. package/packages/time-picker/index.js +1 -1
  435. package/packages/time-select/index.js +1 -1
  436. package/packages/timeline/index.js +1 -1
  437. package/packages/timeline/src/item.vue +56 -56
  438. package/packages/timeline/src/main.vue +28 -28
  439. package/packages/timeline-item/index.js +1 -1
  440. package/packages/tooltip/index.js +1 -1
  441. package/packages/tooltip/src/main.js +234 -234
  442. package/packages/transfer/index.js +1 -1
  443. package/packages/transfer/src/main.vue +225 -225
  444. package/packages/transfer/src/transfer-panel.vue +245 -245
  445. package/packages/tree/index.js +1 -1
  446. package/packages/tree/src/model/node.js +467 -467
  447. package/packages/tree/src/model/tree-store.js +335 -335
  448. package/packages/tree/src/model/util.js +17 -17
  449. package/packages/tree/src/tree-node.vue +247 -247
  450. package/packages/tree/src/tree.vue +491 -491
  451. package/packages/treeSelect/index.js +1 -1
  452. package/packages/treeSelect/src/main.vue +275 -275
  453. package/packages/upload/index.js +1 -1
  454. package/packages/upload/src/ajax.js +77 -77
  455. package/packages/upload/src/index.vue +304 -304
  456. package/packages/upload/src/upload-dragger.vue +65 -65
  457. package/packages/upload/src/upload-list.vue +96 -96
  458. package/packages/upload/src/upload.vue +194 -194
  459. package/src/directives/mousewheel.js +9 -9
  460. package/src/directives/repeat-click.js +20 -20
  461. package/src/index.js +209 -210
  462. package/src/locale/format.js +24 -25
  463. package/src/locale/index.js +25 -25
  464. package/src/locale/lang/en.js +121 -121
  465. package/src/locale/lang/zh-CN.js +121 -121
  466. package/src/locale/lang/zh-TW.js +121 -121
  467. package/src/mixins/emitter.js +26 -26
  468. package/src/mixins/focus.js +7 -7
  469. package/src/mixins/locale.js +5 -5
  470. package/src/mixins/migrating.js +28 -28
  471. package/src/transitions/collapse-transition.js +60 -60
  472. package/src/utils/after-leave.js +17 -17
  473. package/src/utils/aria-dialog.js +48 -48
  474. package/src/utils/aria-utils.js +64 -64
  475. package/src/utils/clickoutside.js +34 -34
  476. package/src/utils/date-util.js +163 -163
  477. package/src/utils/dom.js +165 -165
  478. package/src/utils/menu/aria-menubar.js +5 -5
  479. package/src/utils/menu/aria-menuitem.js +36 -36
  480. package/src/utils/menu/aria-submenu.js +44 -44
  481. package/src/utils/merge.js +12 -12
  482. package/src/utils/popup/index.js +203 -203
  483. package/src/utils/popup/popup-manager.js +169 -169
  484. package/src/utils/resize-event.js +20 -20
  485. package/src/utils/scroll-into-view.js +20 -20
  486. package/src/utils/scrollbar-width.js +18 -18
  487. package/src/utils/shared.js +3 -3
  488. package/src/utils/types.js +12 -12
  489. package/src/utils/util.js +157 -157
  490. package/src/utils/vdom.js +1 -1
  491. package/src/utils/vue-popper.js +179 -179
  492. package/lib/directives/mousewheel.js +0 -26
  493. package/lib/directives/repeat-click.js +0 -33
  494. package/lib/locale/format.js +0 -56
  495. package/lib/locale/index.js +0 -63
  496. package/lib/locale/lang/en.js +0 -126
  497. package/lib/locale/lang/zh-CN.js +0 -126
  498. package/lib/locale/lang/zh-TW.js +0 -126
  499. package/lib/mixins/emitter.js +0 -36
  500. package/lib/mixins/focus.js +0 -15
  501. package/lib/mixins/locale.js +0 -17
  502. package/lib/mixins/migrating.js +0 -69
  503. package/lib/transitions/collapse-transition.js +0 -91
  504. package/lib/utils/after-leave.js +0 -35
  505. package/lib/utils/aria-dialog.js +0 -104
  506. package/lib/utils/aria-utils.js +0 -126
  507. package/lib/utils/clickoutside.js +0 -79
  508. package/lib/utils/date-util.js +0 -310
  509. package/lib/utils/date.js +0 -369
  510. package/lib/utils/dom.js +0 -234
  511. package/lib/utils/lodash.js +0 -9421
  512. package/lib/utils/menu/aria-menubar.js +0 -24
  513. package/lib/utils/menu/aria-menuitem.js +0 -62
  514. package/lib/utils/menu/aria-submenu.js +0 -69
  515. package/lib/utils/merge.js +0 -21
  516. package/lib/utils/popper.js +0 -1261
  517. package/lib/utils/popup/index.js +0 -233
  518. package/lib/utils/popup/popup-manager.js +0 -205
  519. package/lib/utils/resize-event.js +0 -59
  520. package/lib/utils/scroll-into-view.js +0 -38
  521. package/lib/utils/scrollbar-width.js +0 -39
  522. package/lib/utils/shared.js +0 -12
  523. package/lib/utils/types.js +0 -52
  524. package/lib/utils/util.js +0 -272
  525. package/lib/utils/vdom.js +0 -13
  526. package/lib/utils/vue-popper.js +0 -202
@@ -232,7 +232,7 @@ module.exports = require("element-ui/lib/utils/scroll-into-view");
232
232
 
233
233
  "use strict";
234
234
 
235
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=a845df9c
235
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=2d3bd15e
236
236
  var render = function () {
237
237
  var _vm = this
238
238
  var _h = _vm.$createElement
@@ -410,7 +410,7 @@ var staticRenderFns = []
410
410
  render._withStripped = true
411
411
 
412
412
 
413
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=a845df9c
413
+ // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=2d3bd15e
414
414
 
415
415
  // EXTERNAL MODULE: external "vue"
416
416
  var external_vue_ = __webpack_require__(6);
@@ -535,205 +535,205 @@ var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
535
535
 
536
536
 
537
537
  var NewPopper = {
538
- props: {
539
- appendToBody: vue_popper_default.a.props.appendToBody,
540
- offset: vue_popper_default.a.props.offset,
541
- boundariesPadding: vue_popper_default.a.props.boundariesPadding,
542
- arrowOffset: vue_popper_default.a.props.arrowOffset,
543
- transformOrigin: vue_popper_default.a.props.transformOrigin
544
- },
545
- methods: vue_popper_default.a.methods,
546
- data: function data() {
547
- return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
548
- },
549
-
550
- beforeDestroy: vue_popper_default.a.beforeDestroy
538
+ props: {
539
+ appendToBody: vue_popper_default.a.props.appendToBody,
540
+ offset: vue_popper_default.a.props.offset,
541
+ boundariesPadding: vue_popper_default.a.props.boundariesPadding,
542
+ arrowOffset: vue_popper_default.a.props.arrowOffset,
543
+ transformOrigin: vue_popper_default.a.props.transformOrigin
544
+ },
545
+ methods: vue_popper_default.a.methods,
546
+ data: function data() {
547
+ return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
548
+ },
549
+
550
+ beforeDestroy: vue_popper_default.a.beforeDestroy
551
551
  };
552
552
 
553
553
  var DEFAULT_FORMATS = {
554
- date: 'yyyy-MM-dd',
555
- month: 'yyyy-MM',
556
- months: 'yyyy-MM',
557
- datetime: 'yyyy-MM-dd HH:mm:ss',
558
- time: 'HH:mm:ss',
559
- week: 'yyyywWW',
560
- timerange: 'HH:mm:ss',
561
- daterange: 'yyyy-MM-dd',
562
- monthrange: 'yyyy-MM',
563
- datetimerange: 'yyyy-MM-dd HH:mm:ss',
564
- year: 'yyyy',
565
- years: 'yyyy'
554
+ date: 'yyyy-MM-dd',
555
+ month: 'yyyy-MM',
556
+ months: 'yyyy-MM',
557
+ datetime: 'yyyy-MM-dd HH:mm:ss',
558
+ time: 'HH:mm:ss',
559
+ week: 'yyyywWW',
560
+ timerange: 'HH:mm:ss',
561
+ daterange: 'yyyy-MM-dd',
562
+ monthrange: 'yyyy-MM',
563
+ datetimerange: 'yyyy-MM-dd HH:mm:ss',
564
+ year: 'yyyy',
565
+ years: 'yyyy'
566
566
  };
567
567
  var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates', 'months', 'years'];
568
568
  var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
569
- if (format === 'timestamp') return value.getTime();
570
- return Object(date_util_["formatDate"])(value, format);
569
+ if (format === 'timestamp') return value.getTime();
570
+ return Object(date_util_["formatDate"])(value, format);
571
571
  };
572
572
  var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
573
- if (format === 'timestamp') return new Date(Number(text));
574
- return Object(date_util_["parseDate"])(text, format);
573
+ if (format === 'timestamp') return new Date(Number(text));
574
+ return Object(date_util_["parseDate"])(text, format);
575
575
  };
576
576
  var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
577
- if (Array.isArray(value) && value.length === 2) {
578
- var start = value[0];
579
- var end = value[1];
580
-
581
- if (start && end) {
582
- return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
583
- }
584
- }
585
- return '';
577
+ if (Array.isArray(value) && value.length === 2) {
578
+ var start = value[0];
579
+ var end = value[1];
580
+
581
+ if (start && end) {
582
+ return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
583
+ }
584
+ }
585
+ return '';
586
586
  };
587
587
  var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
588
- if (!Array.isArray(array)) {
589
- array = array.split(separator);
590
- }
591
- if (array.length === 2) {
592
- var range1 = array[0];
593
- var range2 = array[1];
594
-
595
- return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
596
- }
597
- return [];
588
+ if (!Array.isArray(array)) {
589
+ array = array.split(separator);
590
+ }
591
+ if (array.length === 2) {
592
+ var range1 = array[0];
593
+ var range2 = array[1];
594
+
595
+ return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
596
+ }
597
+ return [];
598
598
  };
599
599
  var TYPE_VALUE_RESOLVER_MAP = {
600
- default: {
601
- formatter: function formatter(value) {
602
- if (!value) return '';
603
- return '' + value;
604
- },
605
- parser: function parser(text) {
606
- if (text === undefined || text === '') return null;
607
- return text;
608
- }
609
- },
610
- week: {
611
- formatter: function formatter(value, format) {
612
- var week = Object(date_util_["getWeekNumber"])(value);
613
- var month = value.getMonth();
614
- var trueDate = new Date(value);
615
- if (week === 1 && month === 11) {
616
- trueDate.setHours(0, 0, 0, 0);
617
- trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
618
- }
619
- var date = Object(date_util_["formatDate"])(trueDate, format);
620
-
621
- date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
622
- return date;
623
- },
624
- parser: function parser(text, format) {
625
- // parse as if a normal date
626
- return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
627
- }
628
- },
629
- date: {
630
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
631
- parser: pickervue_type_script_lang_js_DATE_PARSER
632
- },
633
- datetime: {
634
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
635
- parser: pickervue_type_script_lang_js_DATE_PARSER
636
- },
637
- daterange: {
638
- formatter: RANGE_FORMATTER,
639
- parser: RANGE_PARSER
640
- },
641
- monthrange: {
642
- formatter: RANGE_FORMATTER,
643
- parser: RANGE_PARSER
644
- },
645
- datetimerange: {
646
- formatter: RANGE_FORMATTER,
647
- parser: RANGE_PARSER
648
- },
649
- timerange: {
650
- formatter: RANGE_FORMATTER,
651
- parser: RANGE_PARSER
652
- },
653
- time: {
654
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
655
- parser: pickervue_type_script_lang_js_DATE_PARSER
656
- },
657
- month: {
658
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
659
- parser: pickervue_type_script_lang_js_DATE_PARSER
660
- },
661
- year: {
662
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
663
- parser: pickervue_type_script_lang_js_DATE_PARSER
664
- },
665
- number: {
666
- formatter: function formatter(value) {
667
- if (!value) return '';
668
- return '' + value;
669
- },
670
- parser: function parser(text) {
671
- var result = Number(text);
672
-
673
- if (!isNaN(text)) {
674
- return result;
675
- } else {
676
- return null;
677
- }
678
- }
679
- },
680
- dates: {
681
- formatter: function formatter(value, format) {
682
- return value.map(function (date) {
683
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
684
- });
685
- },
686
- parser: function parser(value, format) {
687
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
688
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
689
- });
690
- }
691
- },
692
- months: {
693
- formatter: function formatter(value, format) {
694
- return value.map(function (date) {
695
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
696
- });
697
- },
698
- parser: function parser(value, format) {
699
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
700
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
701
- });
702
- }
703
- },
704
- years: {
705
- formatter: function formatter(value, format) {
706
- return value.map(function (date) {
707
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
708
- });
709
- },
710
- parser: function parser(value, format) {
711
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
712
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
713
- });
714
- }
715
- }
600
+ default: {
601
+ formatter: function formatter(value) {
602
+ if (!value) return '';
603
+ return '' + value;
604
+ },
605
+ parser: function parser(text) {
606
+ if (text === undefined || text === '') return null;
607
+ return text;
608
+ }
609
+ },
610
+ week: {
611
+ formatter: function formatter(value, format) {
612
+ var week = Object(date_util_["getWeekNumber"])(value);
613
+ var month = value.getMonth();
614
+ var trueDate = new Date(value);
615
+ if (week === 1 && month === 11) {
616
+ trueDate.setHours(0, 0, 0, 0);
617
+ trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
618
+ }
619
+ var date = Object(date_util_["formatDate"])(trueDate, format);
620
+
621
+ date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
622
+ return date;
623
+ },
624
+ parser: function parser(text, format) {
625
+ // parse as if a normal date
626
+ return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
627
+ }
628
+ },
629
+ date: {
630
+ formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
631
+ parser: pickervue_type_script_lang_js_DATE_PARSER
632
+ },
633
+ datetime: {
634
+ formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
635
+ parser: pickervue_type_script_lang_js_DATE_PARSER
636
+ },
637
+ daterange: {
638
+ formatter: RANGE_FORMATTER,
639
+ parser: RANGE_PARSER
640
+ },
641
+ monthrange: {
642
+ formatter: RANGE_FORMATTER,
643
+ parser: RANGE_PARSER
644
+ },
645
+ datetimerange: {
646
+ formatter: RANGE_FORMATTER,
647
+ parser: RANGE_PARSER
648
+ },
649
+ timerange: {
650
+ formatter: RANGE_FORMATTER,
651
+ parser: RANGE_PARSER
652
+ },
653
+ time: {
654
+ formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
655
+ parser: pickervue_type_script_lang_js_DATE_PARSER
656
+ },
657
+ month: {
658
+ formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
659
+ parser: pickervue_type_script_lang_js_DATE_PARSER
660
+ },
661
+ year: {
662
+ formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
663
+ parser: pickervue_type_script_lang_js_DATE_PARSER
664
+ },
665
+ number: {
666
+ formatter: function formatter(value) {
667
+ if (!value) return '';
668
+ return '' + value;
669
+ },
670
+ parser: function parser(text) {
671
+ var result = Number(text);
672
+
673
+ if (!isNaN(text)) {
674
+ return result;
675
+ } else {
676
+ return null;
677
+ }
678
+ }
679
+ },
680
+ dates: {
681
+ formatter: function formatter(value, format) {
682
+ return value.map(function (date) {
683
+ return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
684
+ });
685
+ },
686
+ parser: function parser(value, format) {
687
+ return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
688
+ return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
689
+ });
690
+ }
691
+ },
692
+ months: {
693
+ formatter: function formatter(value, format) {
694
+ return value.map(function (date) {
695
+ return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
696
+ });
697
+ },
698
+ parser: function parser(value, format) {
699
+ return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
700
+ return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
701
+ });
702
+ }
703
+ },
704
+ years: {
705
+ formatter: function formatter(value, format) {
706
+ return value.map(function (date) {
707
+ return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
708
+ });
709
+ },
710
+ parser: function parser(value, format) {
711
+ return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
712
+ return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
713
+ });
714
+ }
715
+ }
716
716
  };
717
717
  var PLACEMENT_MAP = {
718
- left: 'bottom-start',
719
- center: 'bottom',
720
- right: 'bottom-end'
718
+ left: 'bottom-start',
719
+ center: 'bottom',
720
+ right: 'bottom-end'
721
721
  };
722
722
 
723
723
  var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
724
- var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
724
+ var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
725
725
 
726
- if (!value) return null;
727
- var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
728
- var format = customFormat || DEFAULT_FORMATS[type];
729
- return parser(value, format, rangeSeparator);
726
+ if (!value) return null;
727
+ var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
728
+ var format = customFormat || DEFAULT_FORMATS[type];
729
+ return parser(value, format, rangeSeparator);
730
730
  };
731
731
 
732
732
  var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
733
- if (!value) return null;
734
- var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
735
- var format = customFormat || DEFAULT_FORMATS[type];
736
- return formatter(value, format);
733
+ if (!value) return null;
734
+ var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
735
+ var format = customFormat || DEFAULT_FORMATS[type];
736
+ return formatter(value, format);
737
737
  };
738
738
 
739
739
  /*
@@ -743,625 +743,625 @@ var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat,
743
743
  * 3. array of 1 or 2
744
744
  */
745
745
  var valueEquals = function valueEquals(a, b) {
746
- // considers Date object and string
747
- var dateEquals = function dateEquals(a, b) {
748
- var aIsDate = a instanceof Date;
749
- var bIsDate = b instanceof Date;
750
- if (aIsDate && bIsDate) {
751
- return a.getTime() === b.getTime();
752
- }
753
- if (!aIsDate && !bIsDate) {
754
- return a === b;
755
- }
756
- return false;
757
- };
758
-
759
- var aIsArray = a instanceof Array;
760
- var bIsArray = b instanceof Array;
761
- if (aIsArray && bIsArray) {
762
- if (a.length !== b.length) {
763
- return false;
764
- }
765
- return a.every(function (item, index) {
766
- return dateEquals(item, b[index]);
767
- });
768
- }
769
- if (!aIsArray && !bIsArray) {
770
- return dateEquals(a, b);
771
- }
772
- return false;
746
+ // considers Date object and string
747
+ var dateEquals = function dateEquals(a, b) {
748
+ var aIsDate = a instanceof Date;
749
+ var bIsDate = b instanceof Date;
750
+ if (aIsDate && bIsDate) {
751
+ return a.getTime() === b.getTime();
752
+ }
753
+ if (!aIsDate && !bIsDate) {
754
+ return a === b;
755
+ }
756
+ return false;
757
+ };
758
+
759
+ var aIsArray = a instanceof Array;
760
+ var bIsArray = b instanceof Array;
761
+ if (aIsArray && bIsArray) {
762
+ if (a.length !== b.length) {
763
+ return false;
764
+ }
765
+ return a.every(function (item, index) {
766
+ return dateEquals(item, b[index]);
767
+ });
768
+ }
769
+ if (!aIsArray && !bIsArray) {
770
+ return dateEquals(a, b);
771
+ }
772
+ return false;
773
773
  };
774
774
 
775
775
  var isString = function isString(val) {
776
- return typeof val === 'string' || val instanceof String;
776
+ return typeof val === 'string' || val instanceof String;
777
777
  };
778
778
 
779
779
  var validator = function validator(val) {
780
- // either: String, Array of String, null / undefined
781
- return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
780
+ // either: String, Array of String, null / undefined
781
+ return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
782
782
  };
783
783
 
784
784
  /* harmony default export */ var pickervue_type_script_lang_js = ({
785
- mixins: [emitter_default.a, NewPopper],
786
-
787
- inject: {
788
- elForm: {
789
- default: ''
790
- },
791
- elFormItem: {
792
- default: ''
793
- }
794
- },
795
-
796
- props: {
797
- size: String,
798
- format: String,
799
- valueFormat: String,
800
- readonly: Boolean,
801
- placeholder: String,
802
- startPlaceholder: String,
803
- endPlaceholder: String,
804
- prefixIcon: String,
805
- clearIcon: {
806
- type: String,
807
- default: 'el-icon-circle-close'
808
- },
809
- name: {
810
- default: '',
811
- validator: validator
812
- },
813
- disabled: Boolean,
814
- clearable: {
815
- type: Boolean,
816
- default: true
817
- },
818
- id: {
819
- default: '',
820
- validator: validator
821
- },
822
- popperClass: String,
823
- editable: {
824
- type: Boolean,
825
- default: true
826
- },
827
- align: {
828
- type: String,
829
- default: 'left'
830
- },
831
- value: {},
832
- defaultValue: {},
833
- defaultTime: {},
834
- rangeSeparator: {
835
- default: '-'
836
- },
837
- pickerOptions: {},
838
- unlinkPanels: Boolean,
839
- validateEvent: {
840
- type: Boolean,
841
- default: true
842
- }
843
- },
844
-
845
- components: { ElInput: input_default.a },
846
-
847
- directives: { Clickoutside: clickoutside_default.a },
848
-
849
- data: function data() {
850
- return {
851
- pickerVisible: false,
852
- showClose: false,
853
- userInput: null,
854
- valueOnOpen: null, // value when picker opens, used to determine whether to emit change
855
- unwatchPickerOptions: null
856
- };
857
- },
858
-
859
-
860
- watch: {
861
- pickerVisible: function pickerVisible(val) {
862
- if (this.readonly || this.pickerDisabled) return;
863
- if (val) {
864
- this.showPicker();
865
- this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
866
- } else {
867
- this.hidePicker();
868
- this.emitChange(this.value);
869
- this.userInput = null;
870
- if (this.validateEvent) {
871
- this.dispatch('ElFormItem', 'el.form.blur');
872
- }
873
- this.$emit('blur', this);
874
- this.blur();
875
- }
876
- },
877
-
878
- parsedValue: {
879
- immediate: true,
880
- handler: function handler(val) {
881
- if (this.picker) {
882
- this.picker.value = val;
883
- }
884
- }
885
- },
886
- defaultValue: function defaultValue(val) {
887
- // NOTE: should eventually move to jsx style picker + panel ?
888
- if (this.picker) {
889
- this.picker.defaultValue = val;
890
- }
891
- },
892
- value: function value(val, oldVal) {
893
- if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
894
- this.dispatch('ElFormItem', 'el.form.change', val);
895
- }
896
- }
897
- },
898
-
899
- computed: {
900
- ranged: function ranged() {
901
- return this.type.indexOf('range') > -1;
902
- },
903
- reference: function reference() {
904
- var reference = this.$refs.reference;
905
- return reference.$el || reference;
906
- },
907
- refInput: function refInput() {
908
- if (this.reference) {
909
- return [].slice.call(this.reference.querySelectorAll('input'));
910
- }
911
- return [];
912
- },
913
- valueIsEmpty: function valueIsEmpty() {
914
- var val = this.value;
915
- if (Array.isArray(val)) {
916
- for (var i = 0, len = val.length; i < len; i++) {
917
- if (val[i]) {
918
- return false;
919
- }
920
- }
921
- } else {
922
- if (val) {
923
- return false;
924
- }
925
- }
926
- return true;
927
- },
928
- triggerClass: function triggerClass() {
929
- return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
930
- },
931
- selectionMode: function selectionMode() {
932
- if (this.type === 'week') {
933
- return 'week';
934
- } else if (this.type === 'month') {
935
- return 'month';
936
- } else if (this.type === 'year') {
937
- return 'year';
938
- } else if (this.type === 'dates') {
939
- return 'dates';
940
- } else if (this.type === 'months') {
941
- return 'months';
942
- } else if (this.type === 'years') {
943
- return 'years';
944
- }
945
-
946
- return 'day';
947
- },
948
- haveTrigger: function haveTrigger() {
949
- if (typeof this.showTrigger !== 'undefined') {
950
- return this.showTrigger;
951
- }
952
- return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
953
- },
954
- displayValue: function displayValue() {
955
- var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
956
- if (Array.isArray(this.userInput)) {
957
- return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
958
- } else if (this.userInput !== null) {
959
- return this.userInput;
960
- } else if (formattedValue) {
961
- return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
962
- } else {
963
- return '';
964
- }
965
- },
966
- parsedValue: function parsedValue() {
967
- if (!this.value) return this.value; // component value is not set
968
- if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
969
-
970
- var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
971
- if (valueIsDateObject) {
972
- return this.value;
973
- }
974
-
975
- if (this.valueFormat) {
976
- return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
977
- }
978
-
979
- // NOTE: deal with common but incorrect usage, should remove in next major version
980
- // user might provide string / timestamp without value-format, coerce them into date (or array of date)
981
- return Array.isArray(this.value) ? this.value.map(function (val) {
982
- return new Date(val);
983
- }) : new Date(this.value);
984
- },
985
- _elFormItemSize: function _elFormItemSize() {
986
- return (this.elFormItem || {}).elFormItemSize;
987
- },
988
- pickerSize: function pickerSize() {
989
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
990
- },
991
- pickerDisabled: function pickerDisabled() {
992
- return this.disabled || (this.elForm || {}).disabled;
993
- },
994
- firstInputId: function firstInputId() {
995
- var obj = {};
996
- var id = void 0;
997
- if (this.ranged) {
998
- id = this.id && this.id[0];
999
- } else {
1000
- id = this.id;
1001
- }
1002
- if (id) obj.id = id;
1003
- return obj;
1004
- },
1005
- secondInputId: function secondInputId() {
1006
- var obj = {};
1007
- var id = void 0;
1008
- if (this.ranged) {
1009
- id = this.id && this.id[1];
1010
- }
1011
- if (id) obj.id = id;
1012
- return obj;
1013
- }
1014
- },
1015
-
1016
- created: function created() {
1017
- // vue-popper
1018
- this.popperOptions = {
1019
- boundariesPadding: 0,
1020
- gpuAcceleration: false
1021
- };
1022
- this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
1023
-
1024
- this.$on('fieldReset', this.handleFieldReset);
1025
- },
1026
-
1027
-
1028
- methods: {
1029
- focus: function focus() {
1030
- if (!this.ranged) {
1031
- this.$refs.reference.focus();
1032
- } else {
1033
- this.handleFocus();
1034
- }
1035
- },
1036
- blur: function blur() {
1037
- this.refInput.forEach(function (input) {
1038
- return input.blur();
1039
- });
1040
- },
1041
-
1042
-
1043
- // {parse, formatTo} Value deals maps component value with internal Date
1044
- parseValue: function parseValue(value) {
1045
- var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
1046
- if (this.valueFormat && !isParsed) {
1047
- return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
1048
- } else {
1049
- return value;
1050
- }
1051
- },
1052
- formatToValue: function formatToValue(date) {
1053
- var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
1054
- if (this.valueFormat && isFormattable) {
1055
- return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
1056
- } else {
1057
- return date;
1058
- }
1059
- },
1060
-
1061
-
1062
- // {parse, formatTo} String deals with user input
1063
- parseString: function parseString(value) {
1064
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1065
- return parseAsFormatAndType(value, this.format, type);
1066
- },
1067
- formatToString: function formatToString(value) {
1068
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1069
- return formatAsFormatAndType(value, this.format, type);
1070
- },
1071
- handleMouseEnter: function handleMouseEnter() {
1072
- if (this.readonly || this.pickerDisabled) return;
1073
- if (!this.valueIsEmpty && this.clearable) {
1074
- this.showClose = true;
1075
- }
1076
- },
1077
- handleChange: function handleChange() {
1078
- if (this.userInput) {
1079
- var value = this.parseString(this.displayValue);
1080
- if (value) {
1081
- this.picker.value = value;
1082
- if (this.isValidValue(value)) {
1083
- this.emitInput(value);
1084
- this.userInput = null;
1085
- }
1086
- }
1087
- }
1088
- if (this.userInput === '') {
1089
- this.emitInput(null);
1090
- this.emitChange(null);
1091
- this.userInput = null;
1092
- }
1093
- },
1094
- handleStartInput: function handleStartInput(event) {
1095
- if (this.userInput) {
1096
- this.userInput = [event.target.value, this.userInput[1]];
1097
- } else {
1098
- this.userInput = [event.target.value, null];
1099
- }
1100
- },
1101
- handleEndInput: function handleEndInput(event) {
1102
- if (this.userInput) {
1103
- this.userInput = [this.userInput[0], event.target.value];
1104
- } else {
1105
- this.userInput = [null, event.target.value];
1106
- }
1107
- },
1108
- handleStartChange: function handleStartChange(event) {
1109
- var value = this.parseString(this.userInput && this.userInput[0]);
1110
- if (value) {
1111
- this.userInput = [this.formatToString(value), this.displayValue[1]];
1112
- var newValue = [value, this.picker.value && this.picker.value[1]];
1113
- this.picker.value = newValue;
1114
- if (this.isValidValue(newValue)) {
1115
- this.emitInput(newValue);
1116
- this.userInput = null;
1117
- }
1118
- }
1119
- },
1120
- handleEndChange: function handleEndChange(event) {
1121
- var value = this.parseString(this.userInput && this.userInput[1]);
1122
- if (value) {
1123
- this.userInput = [this.displayValue[0], this.formatToString(value)];
1124
- var newValue = [this.picker.value && this.picker.value[0], value];
1125
- this.picker.value = newValue;
1126
- if (this.isValidValue(newValue)) {
1127
- this.emitInput(newValue);
1128
- this.userInput = null;
1129
- }
1130
- }
1131
- },
1132
- handleClickIcon: function handleClickIcon(event) {
1133
- if (this.readonly || this.pickerDisabled) return;
1134
- if (this.showClose) {
1135
- this.valueOnOpen = this.value;
1136
- event.stopPropagation();
1137
- this.emitInput(null);
1138
- this.emitChange(null);
1139
- this.showClose = false;
1140
- if (this.picker && typeof this.picker.handleClear === 'function') {
1141
- this.picker.handleClear();
1142
- }
1143
- } else {
1144
- this.pickerVisible = !this.pickerVisible;
1145
- }
1146
- },
1147
- handleClose: function handleClose() {
1148
- if (!this.pickerVisible) return;
1149
- this.pickerVisible = false;
1150
-
1151
- if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
1152
- // restore to former value
1153
- var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
1154
- this.emitInput(oldValue);
1155
- }
1156
- },
1157
- handleFieldReset: function handleFieldReset(initialValue) {
1158
- this.userInput = initialValue === '' ? null : initialValue;
1159
- },
1160
- handleFocus: function handleFocus() {
1161
- var type = this.type;
1162
-
1163
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1164
- this.pickerVisible = true;
1165
- }
1166
- this.$emit('focus', this);
1167
- },
1168
- handleKeydown: function handleKeydown(event) {
1169
- var _this = this;
1170
-
1171
- var keyCode = event.keyCode;
1172
-
1173
- // ESC
1174
- if (keyCode === 27) {
1175
- this.pickerVisible = false;
1176
- event.stopPropagation();
1177
- return;
1178
- }
1179
-
1180
- // Tab
1181
- if (keyCode === 9) {
1182
- if (!this.ranged) {
1183
- this.handleChange();
1184
- this.pickerVisible = this.picker.visible = false;
1185
- this.blur();
1186
- event.stopPropagation();
1187
- } else {
1188
- // user may change focus between two input
1189
- setTimeout(function () {
1190
- if (_this.refInput.indexOf(document.activeElement) === -1) {
1191
- _this.pickerVisible = false;
1192
- _this.blur();
1193
- event.stopPropagation();
1194
- }
1195
- }, 0);
1196
- }
1197
- return;
1198
- }
1199
-
1200
- // Enter
1201
- if (keyCode === 13) {
1202
- if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
1203
- this.handleChange();
1204
- this.pickerVisible = this.picker.visible = false;
1205
- this.blur();
1206
- }
1207
- event.stopPropagation();
1208
- return;
1209
- }
1210
-
1211
- // if user is typing, do not let picker handle key input
1212
- if (this.userInput) {
1213
- event.stopPropagation();
1214
- return;
1215
- }
1216
-
1217
- // delegate other keys to panel
1218
- if (this.picker && this.picker.handleKeydown) {
1219
- this.picker.handleKeydown(event);
1220
- }
1221
- },
1222
- handleRangeClick: function handleRangeClick() {
1223
- var type = this.type;
1224
-
1225
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1226
- this.pickerVisible = true;
1227
- }
1228
- this.$emit('focus', this);
1229
- },
1230
- hidePicker: function hidePicker() {
1231
- if (this.picker) {
1232
- this.picker.resetView && this.picker.resetView();
1233
- this.pickerVisible = this.picker.visible = false;
1234
- this.destroyPopper();
1235
- }
1236
- },
1237
- showPicker: function showPicker() {
1238
- var _this2 = this;
1239
-
1240
- if (this.$isServer) return;
1241
- if (!this.picker) {
1242
- this.mountPicker();
1243
- }
1244
- this.pickerVisible = this.picker.visible = true;
1245
-
1246
- this.updatePopper();
1247
-
1248
- this.picker.value = this.parsedValue;
1249
- this.picker.resetView && this.picker.resetView();
1250
-
1251
- this.$nextTick(function () {
1252
- _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
1253
- });
1254
- },
1255
- mountPicker: function mountPicker() {
1256
- var _this3 = this;
1257
-
1258
- this.picker = new external_vue_default.a(this.panel).$mount();
1259
- this.picker.defaultValue = this.defaultValue;
1260
- this.picker.defaultTime = this.defaultTime;
1261
- this.picker.popperClass = this.popperClass;
1262
- this.popperElm = this.picker.$el;
1263
- this.picker.width = this.reference.getBoundingClientRect().width;
1264
- this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
1265
- this.picker.selectionMode = this.selectionMode;
1266
- this.picker.unlinkPanels = this.unlinkPanels;
1267
- this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
1268
- this.$watch('format', function (format) {
1269
- _this3.picker.format = format;
1270
- });
1271
-
1272
- var updateOptions = function updateOptions() {
1273
- var options = _this3.pickerOptions;
1274
-
1275
- if (options && options.selectableRange) {
1276
- var ranges = options.selectableRange;
1277
- var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
1278
- var format = DEFAULT_FORMATS.timerange;
1279
-
1280
- ranges = Array.isArray(ranges) ? ranges : [ranges];
1281
- _this3.picker.selectableRange = ranges.map(function (range) {
1282
- return parser(range, format, _this3.rangeSeparator);
1283
- });
1284
- }
1285
-
1286
- for (var option in options) {
1287
- if (options.hasOwnProperty(option) &&
1288
- // 忽略 time-picker 的该配置项
1289
- option !== 'selectableRange') {
1290
- _this3.picker[option] = options[option];
1291
- }
1292
- }
1293
-
1294
- // main format must prevail over undocumented pickerOptions.format
1295
- if (_this3.format) {
1296
- _this3.picker.format = _this3.format;
1297
- }
1298
- };
1299
- updateOptions();
1300
- this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
1301
- return updateOptions();
1302
- }, { deep: true });
1303
- this.$el.appendChild(this.picker.$el);
1304
- this.picker.resetView && this.picker.resetView();
1305
-
1306
- this.picker.$on('dodestroy', this.doDestroy);
1307
- this.picker.$on('pick', function () {
1308
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1309
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1310
-
1311
- _this3.userInput = null;
1312
- _this3.pickerVisible = _this3.picker.visible = visible;
1313
- _this3.emitInput(date);
1314
- _this3.picker.resetView && _this3.picker.resetView();
1315
- });
1316
-
1317
- this.picker.$on('select-range', function (start, end, pos) {
1318
- if (_this3.refInput.length === 0) return;
1319
- if (!pos || pos === 'min') {
1320
- _this3.refInput[0].setSelectionRange(start, end);
1321
- _this3.refInput[0].focus();
1322
- } else if (pos === 'max') {
1323
- _this3.refInput[1].setSelectionRange(start, end);
1324
- _this3.refInput[1].focus();
1325
- }
1326
- });
1327
- },
1328
- unmountPicker: function unmountPicker() {
1329
- if (this.picker) {
1330
- this.picker.$destroy();
1331
- this.picker.$off();
1332
- if (typeof this.unwatchPickerOptions === 'function') {
1333
- this.unwatchPickerOptions();
1334
- }
1335
- this.picker.$el.parentNode.removeChild(this.picker.$el);
1336
- }
1337
- },
1338
- emitChange: function emitChange(val) {
1339
- // determine user real change only
1340
- if (!valueEquals(val, this.valueOnOpen)) {
1341
- this.$emit('change', val);
1342
- this.valueOnOpen = val;
1343
- if (this.validateEvent) {
1344
- this.dispatch('ElFormItem', 'el.form.change', val);
1345
- }
1346
- }
1347
- },
1348
- emitInput: function emitInput(val) {
1349
- var formatted = this.formatToValue(val);
1350
- if (!valueEquals(this.value, formatted)) {
1351
- this.$emit('input', formatted);
1352
- }
1353
- },
1354
- isValidValue: function isValidValue(value) {
1355
- if (!this.picker) {
1356
- this.mountPicker();
1357
- }
1358
- if (this.picker.isValidValue) {
1359
- return value && this.picker.isValidValue(value);
1360
- } else {
1361
- return true;
1362
- }
1363
- }
1364
- }
785
+ mixins: [emitter_default.a, NewPopper],
786
+
787
+ inject: {
788
+ elForm: {
789
+ default: ''
790
+ },
791
+ elFormItem: {
792
+ default: ''
793
+ }
794
+ },
795
+
796
+ props: {
797
+ size: String,
798
+ format: String,
799
+ valueFormat: String,
800
+ readonly: Boolean,
801
+ placeholder: String,
802
+ startPlaceholder: String,
803
+ endPlaceholder: String,
804
+ prefixIcon: String,
805
+ clearIcon: {
806
+ type: String,
807
+ default: 'el-icon-circle-close'
808
+ },
809
+ name: {
810
+ default: '',
811
+ validator: validator
812
+ },
813
+ disabled: Boolean,
814
+ clearable: {
815
+ type: Boolean,
816
+ default: true
817
+ },
818
+ id: {
819
+ default: '',
820
+ validator: validator
821
+ },
822
+ popperClass: String,
823
+ editable: {
824
+ type: Boolean,
825
+ default: true
826
+ },
827
+ align: {
828
+ type: String,
829
+ default: 'left'
830
+ },
831
+ value: {},
832
+ defaultValue: {},
833
+ defaultTime: {},
834
+ rangeSeparator: {
835
+ default: '-'
836
+ },
837
+ pickerOptions: {},
838
+ unlinkPanels: Boolean,
839
+ validateEvent: {
840
+ type: Boolean,
841
+ default: true
842
+ }
843
+ },
844
+
845
+ components: { ElInput: input_default.a },
846
+
847
+ directives: { Clickoutside: clickoutside_default.a },
848
+
849
+ data: function data() {
850
+ return {
851
+ pickerVisible: false,
852
+ showClose: false,
853
+ userInput: null,
854
+ valueOnOpen: null, // value when picker opens, used to determine whether to emit change
855
+ unwatchPickerOptions: null
856
+ };
857
+ },
858
+
859
+
860
+ watch: {
861
+ pickerVisible: function pickerVisible(val) {
862
+ if (this.readonly || this.pickerDisabled) return;
863
+ if (val) {
864
+ this.showPicker();
865
+ this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
866
+ } else {
867
+ this.hidePicker();
868
+ this.emitChange(this.value);
869
+ this.userInput = null;
870
+ if (this.validateEvent) {
871
+ this.dispatch('ElFormItem', 'el.form.blur');
872
+ }
873
+ this.$emit('blur', this);
874
+ this.blur();
875
+ }
876
+ },
877
+
878
+ parsedValue: {
879
+ immediate: true,
880
+ handler: function handler(val) {
881
+ if (this.picker) {
882
+ this.picker.value = val;
883
+ }
884
+ }
885
+ },
886
+ defaultValue: function defaultValue(val) {
887
+ // NOTE: should eventually move to jsx style picker + panel ?
888
+ if (this.picker) {
889
+ this.picker.defaultValue = val;
890
+ }
891
+ },
892
+ value: function value(val, oldVal) {
893
+ if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
894
+ this.dispatch('ElFormItem', 'el.form.change', val);
895
+ }
896
+ }
897
+ },
898
+
899
+ computed: {
900
+ ranged: function ranged() {
901
+ return this.type.indexOf('range') > -1;
902
+ },
903
+ reference: function reference() {
904
+ var reference = this.$refs.reference;
905
+ return reference.$el || reference;
906
+ },
907
+ refInput: function refInput() {
908
+ if (this.reference) {
909
+ return [].slice.call(this.reference.querySelectorAll('input'));
910
+ }
911
+ return [];
912
+ },
913
+ valueIsEmpty: function valueIsEmpty() {
914
+ var val = this.value;
915
+ if (Array.isArray(val)) {
916
+ for (var i = 0, len = val.length; i < len; i++) {
917
+ if (val[i]) {
918
+ return false;
919
+ }
920
+ }
921
+ } else {
922
+ if (val) {
923
+ return false;
924
+ }
925
+ }
926
+ return true;
927
+ },
928
+ triggerClass: function triggerClass() {
929
+ return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
930
+ },
931
+ selectionMode: function selectionMode() {
932
+ if (this.type === 'week') {
933
+ return 'week';
934
+ } else if (this.type === 'month') {
935
+ return 'month';
936
+ } else if (this.type === 'year') {
937
+ return 'year';
938
+ } else if (this.type === 'dates') {
939
+ return 'dates';
940
+ } else if (this.type === 'months') {
941
+ return 'months';
942
+ } else if (this.type === 'years') {
943
+ return 'years';
944
+ }
945
+
946
+ return 'day';
947
+ },
948
+ haveTrigger: function haveTrigger() {
949
+ if (typeof this.showTrigger !== 'undefined') {
950
+ return this.showTrigger;
951
+ }
952
+ return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
953
+ },
954
+ displayValue: function displayValue() {
955
+ var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
956
+ if (Array.isArray(this.userInput)) {
957
+ return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
958
+ } else if (this.userInput !== null) {
959
+ return this.userInput;
960
+ } else if (formattedValue) {
961
+ return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
962
+ } else {
963
+ return '';
964
+ }
965
+ },
966
+ parsedValue: function parsedValue() {
967
+ if (!this.value) return this.value; // component value is not set
968
+ if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
969
+
970
+ var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
971
+ if (valueIsDateObject) {
972
+ return this.value;
973
+ }
974
+
975
+ if (this.valueFormat) {
976
+ return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
977
+ }
978
+
979
+ // NOTE: deal with common but incorrect usage, should remove in next major version
980
+ // user might provide string / timestamp without value-format, coerce them into date (or array of date)
981
+ return Array.isArray(this.value) ? this.value.map(function (val) {
982
+ return new Date(val);
983
+ }) : new Date(this.value);
984
+ },
985
+ _elFormItemSize: function _elFormItemSize() {
986
+ return (this.elFormItem || {}).elFormItemSize;
987
+ },
988
+ pickerSize: function pickerSize() {
989
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
990
+ },
991
+ pickerDisabled: function pickerDisabled() {
992
+ return this.disabled || (this.elForm || {}).disabled;
993
+ },
994
+ firstInputId: function firstInputId() {
995
+ var obj = {};
996
+ var id = void 0;
997
+ if (this.ranged) {
998
+ id = this.id && this.id[0];
999
+ } else {
1000
+ id = this.id;
1001
+ }
1002
+ if (id) obj.id = id;
1003
+ return obj;
1004
+ },
1005
+ secondInputId: function secondInputId() {
1006
+ var obj = {};
1007
+ var id = void 0;
1008
+ if (this.ranged) {
1009
+ id = this.id && this.id[1];
1010
+ }
1011
+ if (id) obj.id = id;
1012
+ return obj;
1013
+ }
1014
+ },
1015
+
1016
+ created: function created() {
1017
+ // vue-popper
1018
+ this.popperOptions = {
1019
+ boundariesPadding: 0,
1020
+ gpuAcceleration: false
1021
+ };
1022
+ this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
1023
+
1024
+ this.$on('fieldReset', this.handleFieldReset);
1025
+ },
1026
+
1027
+
1028
+ methods: {
1029
+ focus: function focus() {
1030
+ if (!this.ranged) {
1031
+ this.$refs.reference.focus();
1032
+ } else {
1033
+ this.handleFocus();
1034
+ }
1035
+ },
1036
+ blur: function blur() {
1037
+ this.refInput.forEach(function (input) {
1038
+ return input.blur();
1039
+ });
1040
+ },
1041
+
1042
+
1043
+ // {parse, formatTo} Value deals maps component value with internal Date
1044
+ parseValue: function parseValue(value) {
1045
+ var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
1046
+ if (this.valueFormat && !isParsed) {
1047
+ return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
1048
+ } else {
1049
+ return value;
1050
+ }
1051
+ },
1052
+ formatToValue: function formatToValue(date) {
1053
+ var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
1054
+ if (this.valueFormat && isFormattable) {
1055
+ return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
1056
+ } else {
1057
+ return date;
1058
+ }
1059
+ },
1060
+
1061
+
1062
+ // {parse, formatTo} String deals with user input
1063
+ parseString: function parseString(value) {
1064
+ var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1065
+ return parseAsFormatAndType(value, this.format, type);
1066
+ },
1067
+ formatToString: function formatToString(value) {
1068
+ var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1069
+ return formatAsFormatAndType(value, this.format, type);
1070
+ },
1071
+ handleMouseEnter: function handleMouseEnter() {
1072
+ if (this.readonly || this.pickerDisabled) return;
1073
+ if (!this.valueIsEmpty && this.clearable) {
1074
+ this.showClose = true;
1075
+ }
1076
+ },
1077
+ handleChange: function handleChange() {
1078
+ if (this.userInput) {
1079
+ var value = this.parseString(this.displayValue);
1080
+ if (value) {
1081
+ this.picker.value = value;
1082
+ if (this.isValidValue(value)) {
1083
+ this.emitInput(value);
1084
+ this.userInput = null;
1085
+ }
1086
+ }
1087
+ }
1088
+ if (this.userInput === '') {
1089
+ this.emitInput(null);
1090
+ this.emitChange(null);
1091
+ this.userInput = null;
1092
+ }
1093
+ },
1094
+ handleStartInput: function handleStartInput(event) {
1095
+ if (this.userInput) {
1096
+ this.userInput = [event.target.value, this.userInput[1]];
1097
+ } else {
1098
+ this.userInput = [event.target.value, null];
1099
+ }
1100
+ },
1101
+ handleEndInput: function handleEndInput(event) {
1102
+ if (this.userInput) {
1103
+ this.userInput = [this.userInput[0], event.target.value];
1104
+ } else {
1105
+ this.userInput = [null, event.target.value];
1106
+ }
1107
+ },
1108
+ handleStartChange: function handleStartChange(event) {
1109
+ var value = this.parseString(this.userInput && this.userInput[0]);
1110
+ if (value) {
1111
+ this.userInput = [this.formatToString(value), this.displayValue[1]];
1112
+ var newValue = [value, this.picker.value && this.picker.value[1]];
1113
+ this.picker.value = newValue;
1114
+ if (this.isValidValue(newValue)) {
1115
+ this.emitInput(newValue);
1116
+ this.userInput = null;
1117
+ }
1118
+ }
1119
+ },
1120
+ handleEndChange: function handleEndChange(event) {
1121
+ var value = this.parseString(this.userInput && this.userInput[1]);
1122
+ if (value) {
1123
+ this.userInput = [this.displayValue[0], this.formatToString(value)];
1124
+ var newValue = [this.picker.value && this.picker.value[0], value];
1125
+ this.picker.value = newValue;
1126
+ if (this.isValidValue(newValue)) {
1127
+ this.emitInput(newValue);
1128
+ this.userInput = null;
1129
+ }
1130
+ }
1131
+ },
1132
+ handleClickIcon: function handleClickIcon(event) {
1133
+ if (this.readonly || this.pickerDisabled) return;
1134
+ if (this.showClose) {
1135
+ this.valueOnOpen = this.value;
1136
+ event.stopPropagation();
1137
+ this.emitInput(null);
1138
+ this.emitChange(null);
1139
+ this.showClose = false;
1140
+ if (this.picker && typeof this.picker.handleClear === 'function') {
1141
+ this.picker.handleClear();
1142
+ }
1143
+ } else {
1144
+ this.pickerVisible = !this.pickerVisible;
1145
+ }
1146
+ },
1147
+ handleClose: function handleClose() {
1148
+ if (!this.pickerVisible) return;
1149
+ this.pickerVisible = false;
1150
+
1151
+ if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
1152
+ // restore to former value
1153
+ var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
1154
+ this.emitInput(oldValue);
1155
+ }
1156
+ },
1157
+ handleFieldReset: function handleFieldReset(initialValue) {
1158
+ this.userInput = initialValue === '' ? null : initialValue;
1159
+ },
1160
+ handleFocus: function handleFocus() {
1161
+ var type = this.type;
1162
+
1163
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1164
+ this.pickerVisible = true;
1165
+ }
1166
+ this.$emit('focus', this);
1167
+ },
1168
+ handleKeydown: function handleKeydown(event) {
1169
+ var _this = this;
1170
+
1171
+ var keyCode = event.keyCode;
1172
+
1173
+ // ESC
1174
+ if (keyCode === 27) {
1175
+ this.pickerVisible = false;
1176
+ event.stopPropagation();
1177
+ return;
1178
+ }
1179
+
1180
+ // Tab
1181
+ if (keyCode === 9) {
1182
+ if (!this.ranged) {
1183
+ this.handleChange();
1184
+ this.pickerVisible = this.picker.visible = false;
1185
+ this.blur();
1186
+ event.stopPropagation();
1187
+ } else {
1188
+ // user may change focus between two input
1189
+ setTimeout(function () {
1190
+ if (_this.refInput.indexOf(document.activeElement) === -1) {
1191
+ _this.pickerVisible = false;
1192
+ _this.blur();
1193
+ event.stopPropagation();
1194
+ }
1195
+ }, 0);
1196
+ }
1197
+ return;
1198
+ }
1199
+
1200
+ // Enter
1201
+ if (keyCode === 13) {
1202
+ if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
1203
+ this.handleChange();
1204
+ this.pickerVisible = this.picker.visible = false;
1205
+ this.blur();
1206
+ }
1207
+ event.stopPropagation();
1208
+ return;
1209
+ }
1210
+
1211
+ // if user is typing, do not let picker handle key input
1212
+ if (this.userInput) {
1213
+ event.stopPropagation();
1214
+ return;
1215
+ }
1216
+
1217
+ // delegate other keys to panel
1218
+ if (this.picker && this.picker.handleKeydown) {
1219
+ this.picker.handleKeydown(event);
1220
+ }
1221
+ },
1222
+ handleRangeClick: function handleRangeClick() {
1223
+ var type = this.type;
1224
+
1225
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1226
+ this.pickerVisible = true;
1227
+ }
1228
+ this.$emit('focus', this);
1229
+ },
1230
+ hidePicker: function hidePicker() {
1231
+ if (this.picker) {
1232
+ this.picker.resetView && this.picker.resetView();
1233
+ this.pickerVisible = this.picker.visible = false;
1234
+ this.destroyPopper();
1235
+ }
1236
+ },
1237
+ showPicker: function showPicker() {
1238
+ var _this2 = this;
1239
+
1240
+ if (this.$isServer) return;
1241
+ if (!this.picker) {
1242
+ this.mountPicker();
1243
+ }
1244
+ this.pickerVisible = this.picker.visible = true;
1245
+
1246
+ this.updatePopper();
1247
+
1248
+ this.picker.value = this.parsedValue;
1249
+ this.picker.resetView && this.picker.resetView();
1250
+
1251
+ this.$nextTick(function () {
1252
+ _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
1253
+ });
1254
+ },
1255
+ mountPicker: function mountPicker() {
1256
+ var _this3 = this;
1257
+
1258
+ this.picker = new external_vue_default.a(this.panel).$mount();
1259
+ this.picker.defaultValue = this.defaultValue;
1260
+ this.picker.defaultTime = this.defaultTime;
1261
+ this.picker.popperClass = this.popperClass;
1262
+ this.popperElm = this.picker.$el;
1263
+ this.picker.width = this.reference.getBoundingClientRect().width;
1264
+ this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
1265
+ this.picker.selectionMode = this.selectionMode;
1266
+ this.picker.unlinkPanels = this.unlinkPanels;
1267
+ this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
1268
+ this.$watch('format', function (format) {
1269
+ _this3.picker.format = format;
1270
+ });
1271
+
1272
+ var updateOptions = function updateOptions() {
1273
+ var options = _this3.pickerOptions;
1274
+
1275
+ if (options && options.selectableRange) {
1276
+ var ranges = options.selectableRange;
1277
+ var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
1278
+ var format = DEFAULT_FORMATS.timerange;
1279
+
1280
+ ranges = Array.isArray(ranges) ? ranges : [ranges];
1281
+ _this3.picker.selectableRange = ranges.map(function (range) {
1282
+ return parser(range, format, _this3.rangeSeparator);
1283
+ });
1284
+ }
1285
+
1286
+ for (var option in options) {
1287
+ if (options.hasOwnProperty(option) &&
1288
+ // 忽略 time-picker 的该配置项
1289
+ option !== 'selectableRange') {
1290
+ _this3.picker[option] = options[option];
1291
+ }
1292
+ }
1293
+
1294
+ // main format must prevail over undocumented pickerOptions.format
1295
+ if (_this3.format) {
1296
+ _this3.picker.format = _this3.format;
1297
+ }
1298
+ };
1299
+ updateOptions();
1300
+ this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
1301
+ return updateOptions();
1302
+ }, { deep: true });
1303
+ this.$el.appendChild(this.picker.$el);
1304
+ this.picker.resetView && this.picker.resetView();
1305
+
1306
+ this.picker.$on('dodestroy', this.doDestroy);
1307
+ this.picker.$on('pick', function () {
1308
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1309
+ var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1310
+
1311
+ _this3.userInput = null;
1312
+ _this3.pickerVisible = _this3.picker.visible = visible;
1313
+ _this3.emitInput(date);
1314
+ _this3.picker.resetView && _this3.picker.resetView();
1315
+ });
1316
+
1317
+ this.picker.$on('select-range', function (start, end, pos) {
1318
+ if (_this3.refInput.length === 0) return;
1319
+ if (!pos || pos === 'min') {
1320
+ _this3.refInput[0].setSelectionRange(start, end);
1321
+ _this3.refInput[0].focus();
1322
+ } else if (pos === 'max') {
1323
+ _this3.refInput[1].setSelectionRange(start, end);
1324
+ _this3.refInput[1].focus();
1325
+ }
1326
+ });
1327
+ },
1328
+ unmountPicker: function unmountPicker() {
1329
+ if (this.picker) {
1330
+ this.picker.$destroy();
1331
+ this.picker.$off();
1332
+ if (typeof this.unwatchPickerOptions === 'function') {
1333
+ this.unwatchPickerOptions();
1334
+ }
1335
+ this.picker.$el.parentNode.removeChild(this.picker.$el);
1336
+ }
1337
+ },
1338
+ emitChange: function emitChange(val) {
1339
+ // determine user real change only
1340
+ if (!valueEquals(val, this.valueOnOpen)) {
1341
+ this.$emit('change', val);
1342
+ this.valueOnOpen = val;
1343
+ if (this.validateEvent) {
1344
+ this.dispatch('ElFormItem', 'el.form.change', val);
1345
+ }
1346
+ }
1347
+ },
1348
+ emitInput: function emitInput(val) {
1349
+ var formatted = this.formatToValue(val);
1350
+ if (!valueEquals(this.value, formatted)) {
1351
+ this.$emit('input', formatted);
1352
+ }
1353
+ },
1354
+ isValidValue: function isValidValue(value) {
1355
+ if (!this.picker) {
1356
+ this.mountPicker();
1357
+ }
1358
+ if (this.picker.isValidValue) {
1359
+ return value && this.picker.isValidValue(value);
1360
+ } else {
1361
+ return true;
1362
+ }
1363
+ }
1364
+ }
1365
1365
  });
1366
1366
  // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js
1367
1367
  /* harmony default export */ var src_pickervue_type_script_lang_js = (pickervue_type_script_lang_js);
@@ -1422,7 +1422,7 @@ __webpack_require__.r(__webpack_exports__);
1422
1422
  // EXTERNAL MODULE: ./packages/date-picker/src/picker.vue + 4 modules
1423
1423
  var picker = __webpack_require__(32);
1424
1424
 
1425
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=cc8deade
1425
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=c5c70a18
1426
1426
  var render = function () {
1427
1427
  var _vm = this
1428
1428
  var _h = _vm.$createElement
@@ -1494,7 +1494,7 @@ var staticRenderFns = []
1494
1494
  render._withStripped = true
1495
1495
 
1496
1496
 
1497
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=cc8deade
1497
+ // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=c5c70a18
1498
1498
 
1499
1499
  // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
1500
1500
  var scrollbar_ = __webpack_require__(16);
@@ -1530,171 +1530,171 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
1530
1530
 
1531
1531
 
1532
1532
  var parseTime = function parseTime(time) {
1533
- var values = (time || '').split(':');
1534
- if (values.length >= 2) {
1535
- var hours = parseInt(values[0], 10);
1536
- var minutes = parseInt(values[1], 10);
1537
-
1538
- return {
1539
- hours: hours,
1540
- minutes: minutes
1541
- };
1542
- }
1543
- /* istanbul ignore next */
1544
- return null;
1533
+ var values = (time || '').split(':');
1534
+ if (values.length >= 2) {
1535
+ var hours = parseInt(values[0], 10);
1536
+ var minutes = parseInt(values[1], 10);
1537
+
1538
+ return {
1539
+ hours: hours,
1540
+ minutes: minutes
1541
+ };
1542
+ }
1543
+ /* istanbul ignore next */
1544
+ return null;
1545
1545
  };
1546
1546
 
1547
1547
  var compareTime = function compareTime(time1, time2) {
1548
- var value1 = parseTime(time1);
1549
- var value2 = parseTime(time2);
1548
+ var value1 = parseTime(time1);
1549
+ var value2 = parseTime(time2);
1550
1550
 
1551
- var minutes1 = value1.minutes + value1.hours * 60;
1552
- var minutes2 = value2.minutes + value2.hours * 60;
1551
+ var minutes1 = value1.minutes + value1.hours * 60;
1552
+ var minutes2 = value2.minutes + value2.hours * 60;
1553
1553
 
1554
- if (minutes1 === minutes2) {
1555
- return 0;
1556
- }
1554
+ if (minutes1 === minutes2) {
1555
+ return 0;
1556
+ }
1557
1557
 
1558
- return minutes1 > minutes2 ? 1 : -1;
1558
+ return minutes1 > minutes2 ? 1 : -1;
1559
1559
  };
1560
1560
 
1561
1561
  var formatTime = function formatTime(time) {
1562
- return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
1562
+ return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
1563
1563
  };
1564
1564
 
1565
1565
  var nextTime = function nextTime(time, step) {
1566
- var timeValue = parseTime(time);
1567
- var stepValue = parseTime(step);
1566
+ var timeValue = parseTime(time);
1567
+ var stepValue = parseTime(step);
1568
1568
 
1569
- var next = {
1570
- hours: timeValue.hours,
1571
- minutes: timeValue.minutes
1572
- };
1569
+ var next = {
1570
+ hours: timeValue.hours,
1571
+ minutes: timeValue.minutes
1572
+ };
1573
1573
 
1574
- next.minutes += stepValue.minutes;
1575
- next.hours += stepValue.hours;
1574
+ next.minutes += stepValue.minutes;
1575
+ next.hours += stepValue.hours;
1576
1576
 
1577
- next.hours += Math.floor(next.minutes / 60);
1578
- next.minutes = next.minutes % 60;
1577
+ next.hours += Math.floor(next.minutes / 60);
1578
+ next.minutes = next.minutes % 60;
1579
1579
 
1580
- return formatTime(next);
1580
+ return formatTime(next);
1581
1581
  };
1582
1582
 
1583
1583
  /* harmony default export */ var time_selectvue_type_script_lang_js = ({
1584
- components: { ElScrollbar: scrollbar_default.a },
1585
-
1586
- watch: {
1587
- value: function value(val) {
1588
- var _this = this;
1589
-
1590
- if (!val) return;
1591
- this.$nextTick(function () {
1592
- return _this.scrollToOption();
1593
- });
1594
- }
1595
- },
1596
-
1597
- methods: {
1598
- handleClick: function handleClick(item) {
1599
- if (!item.disabled) {
1600
- this.$emit('pick', item.value);
1601
- }
1602
- },
1603
- handleClear: function handleClear() {
1604
- this.$emit('pick', null);
1605
- },
1606
- scrollToOption: function scrollToOption() {
1607
- var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
1608
-
1609
- var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
1610
- scroll_into_view_default()(menu, menu.querySelector(selector));
1611
- },
1612
- handleMenuEnter: function handleMenuEnter() {
1613
- var _this2 = this;
1614
-
1615
- var selected = this.items.map(function (item) {
1616
- return item.value;
1617
- }).indexOf(this.value) !== -1;
1618
- var hasDefault = this.items.map(function (item) {
1619
- return item.value;
1620
- }).indexOf(this.defaultValue) !== -1;
1621
- var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
1622
- this.$nextTick(function () {
1623
- return _this2.scrollToOption(option);
1624
- });
1625
- },
1626
- scrollDown: function scrollDown(step) {
1627
- var items = this.items;
1628
- var length = items.length;
1629
- var total = items.length;
1630
- var index = items.map(function (item) {
1631
- return item.value;
1632
- }).indexOf(this.value);
1633
- while (total--) {
1634
- index = (index + step + length) % length;
1635
- if (!items[index].disabled) {
1636
- this.$emit('pick', items[index].value, true);
1637
- return;
1638
- }
1639
- }
1640
- },
1641
- isValidValue: function isValidValue(date) {
1642
- return this.items.filter(function (item) {
1643
- return !item.disabled;
1644
- }).map(function (item) {
1645
- return item.value;
1646
- }).indexOf(date) !== -1;
1647
- },
1648
- handleKeydown: function handleKeydown(event) {
1649
- var keyCode = event.keyCode;
1650
- if (keyCode === 38 || keyCode === 40) {
1651
- var mapping = { 40: 1, 38: -1 };
1652
- var offset = mapping[keyCode.toString()];
1653
- this.scrollDown(offset);
1654
- event.stopPropagation();
1655
- return;
1656
- }
1657
- }
1658
- },
1659
-
1660
- data: function data() {
1661
- return {
1662
- popperClass: '',
1663
- start: '09:00',
1664
- end: '18:00',
1665
- step: '00:30',
1666
- value: '',
1667
- defaultValue: '',
1668
- visible: false,
1669
- minTime: '',
1670
- maxTime: '',
1671
- width: 0
1672
- };
1673
- },
1674
-
1675
-
1676
- computed: {
1677
- items: function items() {
1678
- var start = this.start;
1679
- var end = this.end;
1680
- var step = this.step;
1681
-
1682
- var result = [];
1683
-
1684
- if (start && end && step) {
1685
- var current = start;
1686
- while (compareTime(current, end) <= 0) {
1687
- result.push({
1688
- value: current,
1689
- disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
1690
- });
1691
- current = nextTime(current, step);
1692
- }
1693
- }
1694
-
1695
- return result;
1696
- }
1697
- }
1584
+ components: { ElScrollbar: scrollbar_default.a },
1585
+
1586
+ watch: {
1587
+ value: function value(val) {
1588
+ var _this = this;
1589
+
1590
+ if (!val) return;
1591
+ this.$nextTick(function () {
1592
+ return _this.scrollToOption();
1593
+ });
1594
+ }
1595
+ },
1596
+
1597
+ methods: {
1598
+ handleClick: function handleClick(item) {
1599
+ if (!item.disabled) {
1600
+ this.$emit('pick', item.value);
1601
+ }
1602
+ },
1603
+ handleClear: function handleClear() {
1604
+ this.$emit('pick', null);
1605
+ },
1606
+ scrollToOption: function scrollToOption() {
1607
+ var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
1608
+
1609
+ var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
1610
+ scroll_into_view_default()(menu, menu.querySelector(selector));
1611
+ },
1612
+ handleMenuEnter: function handleMenuEnter() {
1613
+ var _this2 = this;
1614
+
1615
+ var selected = this.items.map(function (item) {
1616
+ return item.value;
1617
+ }).indexOf(this.value) !== -1;
1618
+ var hasDefault = this.items.map(function (item) {
1619
+ return item.value;
1620
+ }).indexOf(this.defaultValue) !== -1;
1621
+ var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
1622
+ this.$nextTick(function () {
1623
+ return _this2.scrollToOption(option);
1624
+ });
1625
+ },
1626
+ scrollDown: function scrollDown(step) {
1627
+ var items = this.items;
1628
+ var length = items.length;
1629
+ var total = items.length;
1630
+ var index = items.map(function (item) {
1631
+ return item.value;
1632
+ }).indexOf(this.value);
1633
+ while (total--) {
1634
+ index = (index + step + length) % length;
1635
+ if (!items[index].disabled) {
1636
+ this.$emit('pick', items[index].value, true);
1637
+ return;
1638
+ }
1639
+ }
1640
+ },
1641
+ isValidValue: function isValidValue(date) {
1642
+ return this.items.filter(function (item) {
1643
+ return !item.disabled;
1644
+ }).map(function (item) {
1645
+ return item.value;
1646
+ }).indexOf(date) !== -1;
1647
+ },
1648
+ handleKeydown: function handleKeydown(event) {
1649
+ var keyCode = event.keyCode;
1650
+ if (keyCode === 38 || keyCode === 40) {
1651
+ var mapping = { 40: 1, 38: -1 };
1652
+ var offset = mapping[keyCode.toString()];
1653
+ this.scrollDown(offset);
1654
+ event.stopPropagation();
1655
+ return;
1656
+ }
1657
+ }
1658
+ },
1659
+
1660
+ data: function data() {
1661
+ return {
1662
+ popperClass: '',
1663
+ start: '09:00',
1664
+ end: '18:00',
1665
+ step: '00:30',
1666
+ value: '',
1667
+ defaultValue: '',
1668
+ visible: false,
1669
+ minTime: '',
1670
+ maxTime: '',
1671
+ width: 0
1672
+ };
1673
+ },
1674
+
1675
+
1676
+ computed: {
1677
+ items: function items() {
1678
+ var start = this.start;
1679
+ var end = this.end;
1680
+ var step = this.step;
1681
+
1682
+ var result = [];
1683
+
1684
+ if (start && end && step) {
1685
+ var current = start;
1686
+ while (compareTime(current, end) <= 0) {
1687
+ result.push({
1688
+ value: current,
1689
+ disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
1690
+ });
1691
+ current = nextTime(current, step);
1692
+ }
1693
+ }
1694
+
1695
+ return result;
1696
+ }
1697
+ }
1698
1698
  });
1699
1699
  // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js
1700
1700
  /* harmony default export */ var panel_time_selectvue_type_script_lang_js = (time_selectvue_type_script_lang_js);
@@ -1726,29 +1726,29 @@ var component = Object(componentNormalizer["a" /* default */])(
1726
1726
 
1727
1727
 
1728
1728
  /* harmony default export */ var picker_time_select = ({
1729
- mixins: [picker["a" /* default */]],
1729
+ mixins: [picker["a" /* default */]],
1730
1730
 
1731
- name: 'ElTimeSelect',
1731
+ name: 'ElTimeSelect',
1732
1732
 
1733
- componentName: 'ElTimeSelect',
1733
+ componentName: 'ElTimeSelect',
1734
1734
 
1735
- props: {
1736
- type: {
1737
- type: String,
1738
- default: 'time-select'
1739
- }
1740
- },
1735
+ props: {
1736
+ type: {
1737
+ type: String,
1738
+ default: 'time-select'
1739
+ }
1740
+ },
1741
1741
 
1742
- beforeCreate: function beforeCreate() {
1743
- this.panel = time_select;
1744
- }
1742
+ beforeCreate: function beforeCreate() {
1743
+ this.panel = time_select;
1744
+ }
1745
1745
  });
1746
1746
  // CONCATENATED MODULE: ./packages/time-select/index.js
1747
1747
 
1748
1748
 
1749
1749
  /* istanbul ignore next */
1750
1750
  picker_time_select.install = function (Vue) {
1751
- Vue.component(picker_time_select.name, picker_time_select);
1751
+ Vue.component(picker_time_select.name, picker_time_select);
1752
1752
  };
1753
1753
 
1754
1754
  /* harmony default export */ var packages_time_select = __webpack_exports__["default"] = (picker_time_select);