cy-element-ui 1.0.85 → 1.1.1

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 (957) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +148 -172
  3. package/lib/index.js +1 -1
  4. package/package.json +150 -159
  5. package/packages/alert/index.js +8 -8
  6. package/packages/alert/src/main.vue +94 -94
  7. package/packages/aside/index.js +8 -8
  8. package/packages/aside/src/main.vue +20 -20
  9. package/packages/autocomplete/index.js +8 -8
  10. package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -76
  11. package/packages/autocomplete/src/autocomplete.vue +285 -285
  12. package/packages/avatar/index.js +8 -8
  13. package/packages/avatar/src/main.vue +107 -107
  14. package/packages/backtop/index.js +8 -8
  15. package/packages/backtop/src/main.vue +110 -110
  16. package/packages/badge/index.js +8 -8
  17. package/packages/badge/src/main.vue +53 -53
  18. package/packages/breadcrumb/index.js +8 -8
  19. package/packages/breadcrumb/src/breadcrumb-item.vue +41 -41
  20. package/packages/breadcrumb/src/breadcrumb.vue +34 -34
  21. package/packages/breadcrumb-item/index.js +8 -8
  22. package/packages/button/index.js +8 -8
  23. package/packages/button/src/button-group.vue +10 -10
  24. package/packages/button/src/button.vue +78 -78
  25. package/packages/button-group/index.js +8 -8
  26. package/packages/calendar/index.js +8 -8
  27. package/packages/calendar/src/date-table.vue +200 -200
  28. package/packages/calendar/src/main.vue +280 -280
  29. package/packages/card/index.js +8 -8
  30. package/packages/card/src/main.vue +23 -23
  31. package/packages/carousel/index.js +8 -8
  32. package/packages/carousel/src/item.vue +138 -138
  33. package/packages/carousel/src/main.vue +315 -315
  34. package/packages/carousel-item/index.js +8 -8
  35. package/packages/cascader/index.js +8 -8
  36. package/packages/cascader/src/cascader.vue +663 -663
  37. package/packages/cascader-panel/index.js +8 -8
  38. package/packages/cascader-panel/src/cascader-menu.vue +138 -138
  39. package/packages/cascader-panel/src/cascader-node.vue +246 -246
  40. package/packages/cascader-panel/src/cascader-panel.vue +391 -391
  41. package/packages/cascader-panel/src/node.js +166 -165
  42. package/packages/cascader-panel/src/store.js +58 -57
  43. package/packages/checkbox/index.js +8 -8
  44. package/packages/checkbox/src/checkbox-button.vue +199 -199
  45. package/packages/checkbox/src/checkbox-group.vue +48 -48
  46. package/packages/checkbox/src/checkbox.vue +222 -222
  47. package/packages/checkbox-button/index.js +8 -8
  48. package/packages/checkbox-group/index.js +8 -8
  49. package/packages/col/index.js +9 -9
  50. package/packages/col/src/col.js +71 -71
  51. package/packages/collapse/index.js +9 -9
  52. package/packages/collapse/src/collapse-item.vue +114 -114
  53. package/packages/collapse/src/collapse.vue +73 -73
  54. package/packages/collapse-item/index.js +8 -8
  55. package/packages/color-picker/index.js +8 -8
  56. package/packages/color-picker/src/color.js +317 -317
  57. package/packages/color-picker/src/components/alpha-slider.vue +132 -132
  58. package/packages/color-picker/src/components/hue-slider.vue +123 -123
  59. package/packages/color-picker/src/components/picker-dropdown.vue +121 -121
  60. package/packages/color-picker/src/components/predefine.vue +61 -61
  61. package/packages/color-picker/src/components/sv-panel.vue +100 -100
  62. package/packages/color-picker/src/draggable.js +36 -36
  63. package/packages/color-picker/src/main.vue +188 -188
  64. package/packages/container/index.js +8 -8
  65. package/packages/container/src/main.vue +33 -33
  66. package/packages/date-picker/index.js +8 -8
  67. package/packages/date-picker/src/basic/date-table.vue +441 -441
  68. package/packages/date-picker/src/basic/month-table.vue +269 -268
  69. package/packages/date-picker/src/basic/time-spinner.vue +304 -304
  70. package/packages/date-picker/src/basic/year-table.vue +111 -111
  71. package/packages/date-picker/src/panel/date-range.vue +680 -680
  72. package/packages/date-picker/src/panel/date.vue +609 -609
  73. package/packages/date-picker/src/panel/month-range.vue +289 -289
  74. package/packages/date-picker/src/panel/time-range.vue +248 -248
  75. package/packages/date-picker/src/panel/time-select.vue +178 -178
  76. package/packages/date-picker/src/panel/time.vue +186 -186
  77. package/packages/date-picker/src/picker/date-picker.js +43 -43
  78. package/packages/date-picker/src/picker/time-picker.js +39 -39
  79. package/packages/date-picker/src/picker/time-select.js +21 -21
  80. package/packages/date-picker/src/picker.vue +932 -390
  81. package/packages/descriptions/index.js +8 -8
  82. package/packages/descriptions/src/descriptions-item.js +30 -30
  83. package/packages/descriptions/src/descriptions-row.js +116 -116
  84. package/packages/descriptions/src/index.js +180 -180
  85. package/packages/descriptions-item/index.js +8 -8
  86. package/packages/dialog/index.js +8 -8
  87. package/packages/dialog/src/component.vue +212 -212
  88. package/packages/divider/index.js +8 -8
  89. package/packages/divider/src/main.vue +37 -37
  90. package/packages/drawer/index.js +8 -8
  91. package/packages/drawer/src/main.vue +205 -205
  92. package/packages/dropdown/index.js +8 -8
  93. package/packages/dropdown/src/dropdown-item.vue +37 -37
  94. package/packages/dropdown/src/dropdown-menu.vue +63 -63
  95. package/packages/dropdown/src/dropdown.vue +293 -293
  96. package/packages/dropdown-item/index.js +8 -8
  97. package/packages/dropdown-menu/index.js +8 -8
  98. package/packages/empty/index.js +7 -7
  99. package/packages/empty/src/img-empty.vue +132 -132
  100. package/packages/empty/src/index.vue +50 -50
  101. package/packages/footer/index.js +8 -8
  102. package/packages/footer/src/main.vue +20 -20
  103. package/packages/form/index.js +8 -8
  104. package/packages/form/src/form-item.vue +294 -334
  105. package/packages/form/src/form.vue +182 -182
  106. package/packages/form/src/label-wrap.vue +78 -0
  107. package/packages/form-item/index.js +8 -8
  108. package/packages/header/index.js +8 -8
  109. package/packages/header/src/main.vue +20 -20
  110. package/packages/icon/index.js +8 -8
  111. package/packages/icon/src/icon.vue +13 -13
  112. package/packages/image/index.js +8 -8
  113. package/packages/image/src/image-viewer.vue +330 -330
  114. package/packages/image/src/main.vue +249 -249
  115. package/packages/infinite-scroll/index.js +8 -8
  116. package/packages/infinite-scroll/src/main.js +150 -149
  117. package/packages/input/index.js +8 -8
  118. package/packages/input/src/calcTextareaHeight.js +104 -104
  119. package/packages/input/src/input.vue +440 -440
  120. package/packages/input-number/index.js +8 -8
  121. package/packages/input-number/src/input-number.vue +286 -286
  122. package/packages/link/index.js +8 -8
  123. package/packages/link/src/main.vue +53 -53
  124. package/packages/loading/index.js +11 -11
  125. package/packages/loading/src/directive.js +133 -133
  126. package/packages/loading/src/index.js +106 -106
  127. package/packages/loading/src/loading.vue +41 -41
  128. package/packages/main/index.js +8 -8
  129. package/packages/main/src/main.vue +12 -12
  130. package/packages/menu/index.js +8 -8
  131. package/packages/menu/src/menu-item-group.vue +45 -45
  132. package/packages/menu/src/menu-item.vue +112 -112
  133. package/packages/menu/src/menu-mixin.js +44 -44
  134. package/packages/menu/src/menu.vue +325 -325
  135. package/packages/menu/src/submenu.vue +349 -348
  136. package/packages/menu-item/index.js +8 -8
  137. package/packages/menu-item-group/index.js +8 -8
  138. package/packages/message/index.js +2 -2
  139. package/packages/message/src/main.js +91 -91
  140. package/packages/message/src/main.vue +117 -117
  141. package/packages/message-box/index.js +2 -2
  142. package/packages/message-box/src/main.js +216 -216
  143. package/packages/message-box/src/main.vue +332 -332
  144. package/packages/notification/index.js +2 -2
  145. package/packages/notification/src/main.js +94 -94
  146. package/packages/notification/src/main.vue +152 -152
  147. package/packages/option/index.js +8 -8
  148. package/packages/option-group/index.js +8 -8
  149. package/packages/page-header/index.js +8 -8
  150. package/packages/page-header/src/main.vue +30 -30
  151. package/packages/pagination/index.js +8 -8
  152. package/packages/pagination/src/pager.vue +163 -163
  153. package/packages/pagination/src/pagination.js +386 -386
  154. package/packages/popconfirm/index.js +8 -8
  155. package/packages/popconfirm/src/main.vue +104 -104
  156. package/packages/popover/index.js +14 -14
  157. package/packages/popover/src/directive.js +20 -20
  158. package/packages/popover/src/main.vue +237 -237
  159. package/packages/progress/index.js +8 -8
  160. package/packages/progress/src/progress.vue +235 -235
  161. package/packages/radio/index.js +8 -8
  162. package/packages/radio/src/radio-button.vue +115 -115
  163. package/packages/radio/src/radio-group.vue +113 -113
  164. package/packages/radio/src/radio.vue +134 -134
  165. package/packages/radio-button/index.js +8 -8
  166. package/packages/radio-group/index.js +8 -8
  167. package/packages/rate/index.js +8 -8
  168. package/packages/rate/src/main.vue +348 -348
  169. package/packages/result/index.js +8 -8
  170. package/packages/result/src/icon-error.vue +13 -13
  171. package/packages/result/src/icon-info.vue +13 -13
  172. package/packages/result/src/icon-success.vue +13 -13
  173. package/packages/result/src/icon-warning.vue +13 -13
  174. package/packages/result/src/index.vue +65 -65
  175. package/packages/row/index.js +9 -9
  176. package/packages/row/src/row.js +44 -44
  177. package/packages/scrollbar/index.js +8 -8
  178. package/packages/scrollbar/src/bar.js +92 -92
  179. package/packages/scrollbar/src/main.js +130 -130
  180. package/packages/scrollbar/src/util.js +34 -34
  181. package/packages/select/index.js +8 -8
  182. package/packages/select/src/navigation-mixin.js +54 -54
  183. package/packages/select/src/option-group.vue +60 -60
  184. package/packages/select/src/option.vue +168 -168
  185. package/packages/select/src/select-dropdown.vue +74 -74
  186. package/packages/select/src/select.vue +900 -900
  187. package/packages/skeleton/index.js +8 -8
  188. package/packages/skeleton/src/img-placeholder.vue +16 -16
  189. package/packages/skeleton/src/index.vue +76 -76
  190. package/packages/skeleton/src/item.vue +22 -22
  191. package/packages/skeleton-item/index.js +8 -8
  192. package/packages/slider/index.js +8 -8
  193. package/packages/slider/src/button.vue +238 -238
  194. package/packages/slider/src/main.vue +427 -427
  195. package/packages/slider/src/marker.js +18 -18
  196. package/packages/spinner/index.js +8 -8
  197. package/packages/spinner/src/spinner.vue +27 -27
  198. package/packages/statistic/index.js +8 -8
  199. package/packages/statistic/src/main.vue +204 -203
  200. package/packages/step/index.js +8 -8
  201. package/packages/steps/README.md +69 -69
  202. package/packages/steps/index.js +8 -8
  203. package/packages/steps/src/step.vue +184 -184
  204. package/packages/steps/src/steps.vue +68 -68
  205. package/packages/submenu/index.js +8 -8
  206. package/packages/switch/index.js +9 -9
  207. package/packages/switch/src/component.vue +174 -174
  208. package/packages/tab-pane/index.js +8 -8
  209. package/packages/table/index.js +8 -8
  210. package/packages/table/src/config.js +124 -124
  211. package/packages/table/src/dropdown.js +28 -28
  212. package/packages/table/src/filter-panel.vue +194 -194
  213. package/packages/table/src/layout-observer.js +68 -68
  214. package/packages/table/src/store/current.js +76 -76
  215. package/packages/table/src/store/expand.js +65 -65
  216. package/packages/table/src/store/helper.js +41 -41
  217. package/packages/table/src/store/index.js +147 -147
  218. package/packages/table/src/store/tree.js +209 -209
  219. package/packages/table/src/store/watcher.js +381 -381
  220. package/packages/table/src/table-body.js +469 -469
  221. package/packages/table/src/table-column.js +319 -319
  222. package/packages/table/src/table-footer.js +153 -153
  223. package/packages/table/src/table-header.js +511 -511
  224. package/packages/table/src/table-layout.js +249 -249
  225. package/packages/table/src/table-row.js +101 -101
  226. package/packages/table/src/table.vue +712 -718
  227. package/packages/table/src/util.js +273 -273
  228. package/packages/table-column/index.js +8 -8
  229. package/packages/tabs/index.js +8 -8
  230. package/packages/tabs/src/tab-bar.vue +57 -57
  231. package/packages/tabs/src/tab-nav.vue +294 -294
  232. package/packages/tabs/src/tab-pane.vue +56 -56
  233. package/packages/tabs/src/tabs.vue +191 -191
  234. package/packages/tag/index.js +8 -8
  235. package/packages/tag/src/tag.vue +58 -58
  236. package/packages/theme-chalk/README.md +33 -33
  237. package/packages/theme-chalk/gulpfile.js +25 -27
  238. package/packages/theme-chalk/package.json +35 -35
  239. package/packages/theme-chalk/src/alert.scss +147 -147
  240. package/packages/theme-chalk/src/aside.scss +7 -7
  241. package/packages/theme-chalk/src/autocomplete.scss +80 -80
  242. package/packages/theme-chalk/src/avatar.scss +51 -51
  243. package/packages/theme-chalk/src/backtop.scss +22 -22
  244. package/packages/theme-chalk/src/badge.scss +57 -57
  245. package/packages/theme-chalk/src/base.scss +2 -2
  246. package/packages/theme-chalk/src/breadcrumb.scss +55 -55
  247. package/packages/theme-chalk/src/button.scss +262 -262
  248. package/packages/theme-chalk/src/calendar.scss +79 -79
  249. package/packages/theme-chalk/src/card.scss +32 -32
  250. package/packages/theme-chalk/src/carousel-item.scss +50 -50
  251. package/packages/theme-chalk/src/carousel.scss +161 -161
  252. package/packages/theme-chalk/src/cascader-panel.scss +120 -120
  253. package/packages/theme-chalk/src/cascader.scss +182 -182
  254. package/packages/theme-chalk/src/checkbox.scss +359 -359
  255. package/packages/theme-chalk/src/col.scss +156 -156
  256. package/packages/theme-chalk/src/collapse.scss +63 -63
  257. package/packages/theme-chalk/src/color-picker.scss +384 -384
  258. package/packages/theme-chalk/src/common/popup.scss +42 -42
  259. package/packages/theme-chalk/src/common/transition.scss +99 -99
  260. package/packages/theme-chalk/src/common/var.scss +1028 -1028
  261. package/packages/theme-chalk/src/container.scss +14 -14
  262. package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -97
  263. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +101 -101
  264. package/packages/theme-chalk/src/date-picker/date-table.scss +151 -151
  265. package/packages/theme-chalk/src/date-picker/month-table.scss +82 -82
  266. package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -117
  267. package/packages/theme-chalk/src/date-picker/picker.scss +197 -197
  268. package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -85
  269. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -31
  270. package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -110
  271. package/packages/theme-chalk/src/date-picker/year-table.scss +51 -51
  272. package/packages/theme-chalk/src/date-picker.scss +11 -11
  273. package/packages/theme-chalk/src/descriptions-item.scss +42 -42
  274. package/packages/theme-chalk/src/descriptions.scss +111 -111
  275. package/packages/theme-chalk/src/dialog.scss +123 -123
  276. package/packages/theme-chalk/src/display.scss +12 -12
  277. package/packages/theme-chalk/src/divider.scss +47 -47
  278. package/packages/theme-chalk/src/drawer.scss +219 -219
  279. package/packages/theme-chalk/src/dropdown.scss +182 -182
  280. package/packages/theme-chalk/src/empty.scss +45 -45
  281. package/packages/theme-chalk/src/footer.scss +8 -8
  282. package/packages/theme-chalk/src/form.scss +167 -167
  283. package/packages/theme-chalk/src/header.scss +8 -8
  284. package/packages/theme-chalk/src/icon.scss +1167 -1167
  285. package/packages/theme-chalk/src/image.scss +179 -179
  286. package/packages/theme-chalk/src/index.scss +87 -87
  287. package/packages/theme-chalk/src/input-number.scss +261 -180
  288. package/packages/theme-chalk/src/input.scss +360 -360
  289. package/packages/theme-chalk/src/link.scss +81 -81
  290. package/packages/theme-chalk/src/loading.scss +96 -96
  291. package/packages/theme-chalk/src/main.scss +12 -12
  292. package/packages/theme-chalk/src/menu.scss +289 -289
  293. package/packages/theme-chalk/src/message-box.scss +226 -226
  294. package/packages/theme-chalk/src/message.scss +120 -120
  295. package/packages/theme-chalk/src/mixins/_button.scss +81 -81
  296. package/packages/theme-chalk/src/mixins/config.scss +4 -4
  297. package/packages/theme-chalk/src/mixins/function.scss +44 -44
  298. package/packages/theme-chalk/src/mixins/mixins.scss +191 -190
  299. package/packages/theme-chalk/src/mixins/utils.scss +39 -39
  300. package/packages/theme-chalk/src/notification.scss +99 -99
  301. package/packages/theme-chalk/src/option-group.scss +42 -42
  302. package/packages/theme-chalk/src/option.scss +36 -36
  303. package/packages/theme-chalk/src/page-header.scss +41 -41
  304. package/packages/theme-chalk/src/pagination.scss +295 -295
  305. package/packages/theme-chalk/src/popconfirm.scss +16 -16
  306. package/packages/theme-chalk/src/popover.scss +40 -40
  307. package/packages/theme-chalk/src/popper.scss +101 -101
  308. package/packages/theme-chalk/src/progress.scss +141 -141
  309. package/packages/theme-chalk/src/radio-button.scss +113 -113
  310. package/packages/theme-chalk/src/radio-group.scss +9 -9
  311. package/packages/theme-chalk/src/radio.scss +199 -199
  312. package/packages/theme-chalk/src/rate.scss +49 -49
  313. package/packages/theme-chalk/src/reset.scss +79 -79
  314. package/packages/theme-chalk/src/result.scss +61 -61
  315. package/packages/theme-chalk/src/row.scss +43 -43
  316. package/packages/theme-chalk/src/scrollbar.scss +72 -72
  317. package/packages/theme-chalk/src/select-dropdown.scss +62 -62
  318. package/packages/theme-chalk/src/select.scss +152 -152
  319. package/packages/theme-chalk/src/skeleton-item.scss +84 -84
  320. package/packages/theme-chalk/src/skeleton.scss +40 -40
  321. package/packages/theme-chalk/src/slider.scss +250 -250
  322. package/packages/theme-chalk/src/spinner.scss +44 -44
  323. package/packages/theme-chalk/src/statistic.scss +38 -38
  324. package/packages/theme-chalk/src/step.scss +317 -317
  325. package/packages/theme-chalk/src/steps.scss +20 -20
  326. package/packages/theme-chalk/src/switch.scss +116 -116
  327. package/packages/theme-chalk/src/table-column.scss +97 -97
  328. package/packages/theme-chalk/src/table.scss +564 -564
  329. package/packages/theme-chalk/src/tabs.scss +602 -602
  330. package/packages/theme-chalk/src/tag.scss +163 -163
  331. package/packages/theme-chalk/src/time-picker.scss +8 -8
  332. package/packages/theme-chalk/src/time-select.scss +37 -37
  333. package/packages/theme-chalk/src/timeline-item.scss +86 -86
  334. package/packages/theme-chalk/src/timeline.scss +14 -14
  335. package/packages/theme-chalk/src/tooltip.scss +141 -141
  336. package/packages/theme-chalk/src/transfer.scss +227 -227
  337. package/packages/theme-chalk/src/tree.scss +123 -123
  338. package/packages/theme-chalk/src/upload.scss +603 -603
  339. package/packages/time-picker/index.js +8 -8
  340. package/packages/time-select/index.js +8 -8
  341. package/packages/timeline/index.js +8 -8
  342. package/packages/timeline/src/item.vue +73 -73
  343. package/packages/timeline/src/main.vue +33 -33
  344. package/packages/timeline-item/index.js +8 -8
  345. package/packages/tooltip/index.js +8 -8
  346. package/packages/tooltip/src/main.js +242 -242
  347. package/packages/transfer/index.js +8 -8
  348. package/packages/transfer/src/main.vue +231 -231
  349. package/packages/transfer/src/transfer-panel.vue +251 -251
  350. package/packages/tree/index.js +8 -8
  351. package/packages/tree/src/model/node.js +484 -484
  352. package/packages/tree/src/model/tree-store.js +340 -340
  353. package/packages/tree/src/model/util.js +27 -27
  354. package/packages/tree/src/tree-node.vue +279 -279
  355. package/packages/tree/src/tree.vue +496 -496
  356. package/packages/upload/index.js +8 -8
  357. package/packages/upload/src/ajax.js +85 -85
  358. package/packages/upload/src/index.vue +338 -338
  359. package/packages/upload/src/upload-dragger.vue +70 -70
  360. package/packages/upload/src/upload-list.vue +105 -105
  361. package/packages/upload/src/upload.vue +211 -211
  362. package/src/directives/mousewheel.js +18 -18
  363. package/src/directives/repeat-click.js +26 -26
  364. package/src/index.js +202 -216
  365. package/src/locale/format.js +46 -45
  366. package/src/locale/index.js +48 -48
  367. package/src/locale/lang/en.js +123 -123
  368. package/src/locale/lang/zh-CN.js +123 -123
  369. package/src/locale/lang/zh-TW.js +123 -123
  370. package/src/mixins/emitter.js +33 -33
  371. package/src/mixins/focus.js +9 -9
  372. package/src/mixins/locale.js +9 -9
  373. package/src/mixins/migrating.js +54 -54
  374. package/src/transitions/collapse-transition.js +77 -77
  375. package/src/utils/after-leave.js +27 -27
  376. package/src/utils/aria-dialog.js +90 -90
  377. package/src/utils/aria-utils.js +122 -122
  378. package/src/utils/clickoutside.js +76 -76
  379. package/src/utils/date-util.js +282 -282
  380. package/src/utils/date.js +368 -368
  381. package/src/utils/dom.js +227 -227
  382. package/src/utils/lodash.js +18075 -18075
  383. package/src/utils/menu/aria-menubar.js +14 -14
  384. package/src/utils/menu/aria-menuitem.js +49 -49
  385. package/src/utils/menu/aria-submenu.js +59 -59
  386. package/src/utils/merge.js +15 -15
  387. package/src/utils/popper.js +1276 -1276
  388. package/src/utils/popup/index.js +218 -218
  389. package/src/utils/popup/popup-manager.js +194 -194
  390. package/src/utils/resize-event.js +36 -36
  391. package/src/utils/scroll-into-view.js +27 -27
  392. package/src/utils/scrollbar-width.js +29 -29
  393. package/src/utils/shared.js +7 -7
  394. package/src/utils/types.js +40 -40
  395. package/src/utils/util.js +245 -245
  396. package/src/utils/vdom.js +5 -5
  397. package/src/utils/vue-popper.js +198 -198
  398. package/types/alert.d.ts +31 -31
  399. package/types/aside.d.ts +7 -7
  400. package/types/autocomplete.d.ts +78 -78
  401. package/types/avatar.d.ts +20 -20
  402. package/types/backtop.d.ts +16 -16
  403. package/types/badge.d.ts +16 -16
  404. package/types/breadcrumb-item.d.ts +10 -10
  405. package/types/breadcrumb.d.ts +10 -10
  406. package/types/button-group.d.ts +4 -4
  407. package/types/button.d.ts +37 -37
  408. package/types/calendar.d.ts +15 -15
  409. package/types/card.d.ts +26 -26
  410. package/types/carousel-item.d.ts +10 -10
  411. package/types/carousel.d.ts +57 -57
  412. package/types/cascader-panel.d.ts +72 -72
  413. package/types/cascader.d.ts +65 -65
  414. package/types/checkbox-button.d.ts +22 -22
  415. package/types/checkbox-group.d.ts +22 -22
  416. package/types/checkbox.d.ts +34 -34
  417. package/types/col.d.ts +46 -46
  418. package/types/collapse-item.d.ts +26 -26
  419. package/types/collapse.d.ts +10 -10
  420. package/types/color-picker.d.ts +21 -21
  421. package/types/component.d.ts +13 -13
  422. package/types/container.d.ts +7 -7
  423. package/types/date-picker.d.ts +124 -124
  424. package/types/descriptions-item.d.ts +37 -37
  425. package/types/descriptions.d.ts +52 -52
  426. package/types/dialog.d.ts +62 -62
  427. package/types/divider.d.ts +12 -12
  428. package/types/drawer.d.ts +63 -63
  429. package/types/dropdown-item.d.ts +16 -16
  430. package/types/dropdown-menu.d.ts +4 -4
  431. package/types/dropdown.d.ts +38 -38
  432. package/types/element-ui.d.ts +1 -22
  433. package/types/empty.d.ts +31 -31
  434. package/types/footer.d.ts +7 -7
  435. package/types/form-item.d.ts +37 -37
  436. package/types/form.d.ts +82 -82
  437. package/types/header.d.ts +7 -7
  438. package/types/icon.d.ts +7 -7
  439. package/types/image.d.ts +43 -43
  440. package/types/index.d.ts +4 -4
  441. package/types/infinite-scroll.d.ts +5 -5
  442. package/types/input-number.d.ts +47 -47
  443. package/types/input.d.ts +107 -107
  444. package/types/link.d.ts +25 -25
  445. package/types/loading.d.ts +62 -62
  446. package/types/main.d.ts +4 -4
  447. package/types/menu-item-group.d.ts +7 -7
  448. package/types/menu-item.d.ts +10 -10
  449. package/types/menu.d.ts +46 -46
  450. package/types/message-box.d.ts +176 -176
  451. package/types/message.d.ts +90 -90
  452. package/types/notification.d.ts +84 -84
  453. package/types/option-group.d.ts +10 -10
  454. package/types/option.d.ts +13 -13
  455. package/types/page-header.d.ts +10 -10
  456. package/types/pagination.d.ts +43 -43
  457. package/types/popconfirm.d.ts +29 -29
  458. package/types/popover.d.ts +71 -71
  459. package/types/progress.d.ts +37 -37
  460. package/types/radio-button.d.ts +16 -16
  461. package/types/radio-group.d.ts +18 -18
  462. package/types/radio.d.ts +19 -19
  463. package/types/rate.d.ts +64 -64
  464. package/types/result.d.ts +33 -33
  465. package/types/row.d.ts +25 -25
  466. package/types/select.d.ts +90 -90
  467. package/types/skeleton-item.d.ts +7 -7
  468. package/types/skeleton.d.ts +33 -33
  469. package/types/slider.d.ts +68 -68
  470. package/types/spinner.d.ts +16 -16
  471. package/types/statistic.d.ts +37 -37
  472. package/types/step.d.ts +34 -34
  473. package/types/steps.d.ts +28 -28
  474. package/types/submenu.d.ts +22 -22
  475. package/types/switch.d.ts +43 -43
  476. package/types/tab-pane.d.ts +19 -19
  477. package/types/table-column.d.ts +117 -117
  478. package/types/table.d.ts +177 -177
  479. package/types/tabs.d.ts +31 -31
  480. package/types/tag.d.ts +28 -28
  481. package/types/time-picker.d.ts +63 -63
  482. package/types/time-select.d.ts +56 -56
  483. package/types/timeline-item.d.ts +20 -20
  484. package/types/timeline.d.ts +6 -6
  485. package/types/tooltip.d.ts +52 -52
  486. package/types/transfer.d.ts +73 -73
  487. package/types/tree.d.ts +266 -266
  488. package/types/upload.d.ts +124 -124
  489. package/web-types.json +4195 -4195
  490. package/lib/alert.js +0 -402
  491. package/lib/aside.js +0 -270
  492. package/lib/autocomplete.js +0 -4651
  493. package/lib/avatar.js +0 -363
  494. package/lib/backtop.js +0 -386
  495. package/lib/badge.js +0 -313
  496. package/lib/breadcrumb-item.js +0 -309
  497. package/lib/breadcrumb.js +0 -287
  498. package/lib/button-group.js +0 -256
  499. package/lib/button.js +0 -332
  500. package/lib/calendar.js +0 -2373
  501. package/lib/card.js +0 -289
  502. package/lib/carousel-item.js +0 -755
  503. package/lib/carousel.js +0 -719
  504. package/lib/cascader-panel.js +0 -3623
  505. package/lib/cascader.js +0 -7498
  506. package/lib/checkbox-button.js +0 -573
  507. package/lib/checkbox-group.js +0 -344
  508. package/lib/checkbox.js +0 -603
  509. package/lib/col.js +0 -177
  510. package/lib/collapse-item.js +0 -1156
  511. package/lib/collapse.js +0 -323
  512. package/lib/color-picker.js +0 -5600
  513. package/lib/container.js +0 -281
  514. package/lib/date-picker.js +0 -9871
  515. package/lib/descriptions-item.js +0 -140
  516. package/lib/descriptions.js +0 -512
  517. package/lib/dialog.js +0 -1736
  518. package/lib/directives/mousewheel.js +0 -26
  519. package/lib/directives/repeat-click.js +0 -33
  520. package/lib/divider.js +0 -297
  521. package/lib/drawer.js +0 -1316
  522. package/lib/dropdown-item.js +0 -332
  523. package/lib/dropdown-menu.js +0 -2545
  524. package/lib/dropdown.js +0 -1579
  525. package/lib/element-ui.common.js +0 -54072
  526. package/lib/empty.js +0 -1186
  527. package/lib/fileUpload.js +0 -3276
  528. package/lib/footer.js +0 -270
  529. package/lib/form-item.js +0 -1129
  530. package/lib/form.js +0 -471
  531. package/lib/header.js +0 -270
  532. package/lib/icon.js +0 -260
  533. package/lib/image.js +0 -2386
  534. package/lib/infinite-scroll.js +0 -591
  535. package/lib/input-number.js +0 -2093
  536. package/lib/input.js +0 -1358
  537. package/lib/link.js +0 -308
  538. package/lib/loading.js +0 -1349
  539. package/lib/locale/format.js +0 -55
  540. package/lib/locale/index.js +0 -63
  541. package/lib/locale/lang/af-ZA.js +0 -126
  542. package/lib/locale/lang/ar.js +0 -125
  543. package/lib/locale/lang/az.js +0 -126
  544. package/lib/locale/lang/bg.js +0 -126
  545. package/lib/locale/lang/bn.js +0 -126
  546. package/lib/locale/lang/ca.js +0 -125
  547. package/lib/locale/lang/cs-CZ.js +0 -128
  548. package/lib/locale/lang/da.js +0 -125
  549. package/lib/locale/lang/de.js +0 -127
  550. package/lib/locale/lang/ee.js +0 -126
  551. package/lib/locale/lang/el.js +0 -126
  552. package/lib/locale/lang/en.js +0 -126
  553. package/lib/locale/lang/eo.js +0 -126
  554. package/lib/locale/lang/es.js +0 -125
  555. package/lib/locale/lang/eu.js +0 -126
  556. package/lib/locale/lang/fa.js +0 -126
  557. package/lib/locale/lang/fi.js +0 -126
  558. package/lib/locale/lang/fr.js +0 -125
  559. package/lib/locale/lang/he.js +0 -126
  560. package/lib/locale/lang/hr.js +0 -126
  561. package/lib/locale/lang/hu.js +0 -125
  562. package/lib/locale/lang/hy-AM.js +0 -126
  563. package/lib/locale/lang/id.js +0 -126
  564. package/lib/locale/lang/is.js +0 -126
  565. package/lib/locale/lang/it.js +0 -125
  566. package/lib/locale/lang/ja.js +0 -126
  567. package/lib/locale/lang/kg.js +0 -126
  568. package/lib/locale/lang/km.js +0 -126
  569. package/lib/locale/lang/ko.js +0 -126
  570. package/lib/locale/lang/ku.js +0 -126
  571. package/lib/locale/lang/kz.js +0 -126
  572. package/lib/locale/lang/lo-LA.js +0 -126
  573. package/lib/locale/lang/lt.js +0 -126
  574. package/lib/locale/lang/lv.js +0 -126
  575. package/lib/locale/lang/mn.js +0 -126
  576. package/lib/locale/lang/ms.js +0 -125
  577. package/lib/locale/lang/nb-NO.js +0 -125
  578. package/lib/locale/lang/nl.js +0 -126
  579. package/lib/locale/lang/pl.js +0 -126
  580. package/lib/locale/lang/pt-br.js +0 -126
  581. package/lib/locale/lang/pt.js +0 -126
  582. package/lib/locale/lang/ro.js +0 -126
  583. package/lib/locale/lang/ru-RU.js +0 -126
  584. package/lib/locale/lang/si.js +0 -126
  585. package/lib/locale/lang/sk.js +0 -128
  586. package/lib/locale/lang/sl.js +0 -126
  587. package/lib/locale/lang/sr-Latn.js +0 -126
  588. package/lib/locale/lang/sr.js +0 -126
  589. package/lib/locale/lang/sv-SE.js +0 -126
  590. package/lib/locale/lang/sw.js +0 -126
  591. package/lib/locale/lang/ta.js +0 -125
  592. package/lib/locale/lang/th.js +0 -126
  593. package/lib/locale/lang/tk.js +0 -126
  594. package/lib/locale/lang/tr-TR.js +0 -126
  595. package/lib/locale/lang/ua.js +0 -126
  596. package/lib/locale/lang/ug-CN.js +0 -126
  597. package/lib/locale/lang/uz-UZ.js +0 -126
  598. package/lib/locale/lang/vi.js +0 -126
  599. package/lib/locale/lang/zh-CN.js +0 -126
  600. package/lib/locale/lang/zh-TW.js +0 -126
  601. package/lib/main.js +0 -257
  602. package/lib/menu-item-group.js +0 -296
  603. package/lib/menu-item.js +0 -3344
  604. package/lib/menu.js +0 -1556
  605. package/lib/message-box.js +0 -3564
  606. package/lib/message.js +0 -1601
  607. package/lib/mixins/emitter.js +0 -36
  608. package/lib/mixins/focus.js +0 -15
  609. package/lib/mixins/locale.js +0 -17
  610. package/lib/mixins/migrating.js +0 -69
  611. package/lib/notification.js +0 -1662
  612. package/lib/option-group.js +0 -364
  613. package/lib/option.js +0 -835
  614. package/lib/page-header.js +0 -908
  615. package/lib/pagination.js +0 -6855
  616. package/lib/popconfirm.js +0 -3708
  617. package/lib/popover.js +0 -3118
  618. package/lib/progress.js +0 -542
  619. package/lib/radio-button.js +0 -456
  620. package/lib/radio-group.js +0 -412
  621. package/lib/radio.js +0 -482
  622. package/lib/rate.js +0 -1278
  623. package/lib/result.js +0 -528
  624. package/lib/row.js +0 -149
  625. package/lib/scrollbar.js +0 -1108
  626. package/lib/select.js +0 -6134
  627. package/lib/selectDisplayInput.js +0 -355
  628. package/lib/skeleton-item.js +0 -322
  629. package/lib/skeleton.js +0 -345
  630. package/lib/slider.js +0 -5231
  631. package/lib/spinner.js +0 -293
  632. package/lib/statistic.js +0 -9999
  633. package/lib/step.js +0 -476
  634. package/lib/steps.js +0 -745
  635. package/lib/subTitle.js +0 -284
  636. package/lib/submenu.js +0 -3021
  637. package/lib/switch.js +0 -970
  638. package/lib/tab-pane.js +0 -318
  639. package/lib/tabDialog.js +0 -2264
  640. package/lib/table-column.js +0 -1800
  641. package/lib/table.js +0 -8803
  642. package/lib/tabs.js +0 -1329
  643. package/lib/tag.js +0 -304
  644. package/lib/theme-chalk/README.md +0 -33
  645. package/lib/theme-chalk/base.css +0 -1
  646. package/lib/theme-chalk/element.css +0 -1
  647. package/lib/theme-chalk/fileUpload.css +0 -1
  648. package/lib/theme-chalk/gulpfile.js +0 -27
  649. package/lib/theme-chalk/index.css +0 -1
  650. package/lib/theme-chalk/package.json +0 -35
  651. package/lib/theme-chalk/selectDisplayInput.css +0 -1
  652. package/lib/theme-chalk/src/alert.scss +0 -147
  653. package/lib/theme-chalk/src/aside.scss +0 -7
  654. package/lib/theme-chalk/src/autocomplete.scss +0 -80
  655. package/lib/theme-chalk/src/avatar.scss +0 -51
  656. package/lib/theme-chalk/src/backtop.scss +0 -22
  657. package/lib/theme-chalk/src/badge.scss +0 -57
  658. package/lib/theme-chalk/src/base.scss +0 -2
  659. package/lib/theme-chalk/src/breadcrumb-item.scss +0 -0
  660. package/lib/theme-chalk/src/breadcrumb.scss +0 -55
  661. package/lib/theme-chalk/src/button-group.scss +0 -0
  662. package/lib/theme-chalk/src/button.scss +0 -262
  663. package/lib/theme-chalk/src/calendar.scss +0 -79
  664. package/lib/theme-chalk/src/card.scss +0 -32
  665. package/lib/theme-chalk/src/carousel-item.scss +0 -50
  666. package/lib/theme-chalk/src/carousel.scss +0 -161
  667. package/lib/theme-chalk/src/cascader-panel.scss +0 -120
  668. package/lib/theme-chalk/src/cascader.scss +0 -182
  669. package/lib/theme-chalk/src/checkbox-button.scss +0 -0
  670. package/lib/theme-chalk/src/checkbox-group.scss +0 -0
  671. package/lib/theme-chalk/src/checkbox.scss +0 -359
  672. package/lib/theme-chalk/src/col.scss +0 -156
  673. package/lib/theme-chalk/src/collapse-item.scss +0 -0
  674. package/lib/theme-chalk/src/collapse.scss +0 -63
  675. package/lib/theme-chalk/src/color-picker.scss +0 -384
  676. package/lib/theme-chalk/src/common/popup.scss +0 -42
  677. package/lib/theme-chalk/src/common/transition.scss +0 -99
  678. package/lib/theme-chalk/src/common/var.scss +0 -1028
  679. package/lib/theme-chalk/src/container.scss +0 -14
  680. package/lib/theme-chalk/src/date-picker/date-picker.scss +0 -97
  681. package/lib/theme-chalk/src/date-picker/date-range-picker.scss +0 -101
  682. package/lib/theme-chalk/src/date-picker/date-table.scss +0 -151
  683. package/lib/theme-chalk/src/date-picker/month-table.scss +0 -82
  684. package/lib/theme-chalk/src/date-picker/picker-panel.scss +0 -117
  685. package/lib/theme-chalk/src/date-picker/picker.scss +0 -197
  686. package/lib/theme-chalk/src/date-picker/time-picker.scss +0 -85
  687. package/lib/theme-chalk/src/date-picker/time-range-picker.scss +0 -31
  688. package/lib/theme-chalk/src/date-picker/time-spinner.scss +0 -110
  689. package/lib/theme-chalk/src/date-picker/year-table.scss +0 -51
  690. package/lib/theme-chalk/src/date-picker.scss +0 -12
  691. package/lib/theme-chalk/src/descriptions-item.scss +0 -42
  692. package/lib/theme-chalk/src/descriptions.scss +0 -111
  693. package/lib/theme-chalk/src/dialog.scss +0 -123
  694. package/lib/theme-chalk/src/display.scss +0 -12
  695. package/lib/theme-chalk/src/divider.scss +0 -47
  696. package/lib/theme-chalk/src/drawer.scss +0 -219
  697. package/lib/theme-chalk/src/dropdown-item.scss +0 -0
  698. package/lib/theme-chalk/src/dropdown-menu.scss +0 -0
  699. package/lib/theme-chalk/src/dropdown.scss +0 -182
  700. package/lib/theme-chalk/src/empty.scss +0 -45
  701. package/lib/theme-chalk/src/fonts/element-icons.ttf +0 -0
  702. package/lib/theme-chalk/src/fonts/element-icons.woff +0 -0
  703. package/lib/theme-chalk/src/footer.scss +0 -8
  704. package/lib/theme-chalk/src/form-item.scss +0 -0
  705. package/lib/theme-chalk/src/form.scss +0 -167
  706. package/lib/theme-chalk/src/header.scss +0 -8
  707. package/lib/theme-chalk/src/icon.scss +0 -1167
  708. package/lib/theme-chalk/src/image.scss +0 -179
  709. package/lib/theme-chalk/src/index.scss +0 -87
  710. package/lib/theme-chalk/src/infinite-scroll.scss +0 -0
  711. package/lib/theme-chalk/src/infiniteScroll.scss +0 -0
  712. package/lib/theme-chalk/src/input-number.scss +0 -180
  713. package/lib/theme-chalk/src/input.scss +0 -360
  714. package/lib/theme-chalk/src/link.scss +0 -81
  715. package/lib/theme-chalk/src/loading.scss +0 -96
  716. package/lib/theme-chalk/src/main.scss +0 -12
  717. package/lib/theme-chalk/src/menu-item-group.scss +0 -0
  718. package/lib/theme-chalk/src/menu-item.scss +0 -0
  719. package/lib/theme-chalk/src/menu.scss +0 -289
  720. package/lib/theme-chalk/src/message-box.scss +0 -226
  721. package/lib/theme-chalk/src/message.scss +0 -120
  722. package/lib/theme-chalk/src/mixins/_button.scss +0 -81
  723. package/lib/theme-chalk/src/mixins/config.scss +0 -4
  724. package/lib/theme-chalk/src/mixins/function.scss +0 -44
  725. package/lib/theme-chalk/src/mixins/mixins.scss +0 -190
  726. package/lib/theme-chalk/src/mixins/utils.scss +0 -39
  727. package/lib/theme-chalk/src/notification.scss +0 -99
  728. package/lib/theme-chalk/src/option-group.scss +0 -42
  729. package/lib/theme-chalk/src/option.scss +0 -36
  730. package/lib/theme-chalk/src/page-header.scss +0 -41
  731. package/lib/theme-chalk/src/pagination.scss +0 -295
  732. package/lib/theme-chalk/src/popconfirm.scss +0 -16
  733. package/lib/theme-chalk/src/popover.scss +0 -40
  734. package/lib/theme-chalk/src/popper.scss +0 -101
  735. package/lib/theme-chalk/src/progress.scss +0 -141
  736. package/lib/theme-chalk/src/radio-button.scss +0 -113
  737. package/lib/theme-chalk/src/radio-group.scss +0 -9
  738. package/lib/theme-chalk/src/radio.scss +0 -199
  739. package/lib/theme-chalk/src/rate.scss +0 -49
  740. package/lib/theme-chalk/src/reset.scss +0 -79
  741. package/lib/theme-chalk/src/result.scss +0 -61
  742. package/lib/theme-chalk/src/row.scss +0 -43
  743. package/lib/theme-chalk/src/scrollbar.scss +0 -72
  744. package/lib/theme-chalk/src/select-dropdown.scss +0 -62
  745. package/lib/theme-chalk/src/select.scss +0 -152
  746. package/lib/theme-chalk/src/skeleton-item.scss +0 -84
  747. package/lib/theme-chalk/src/skeleton.scss +0 -40
  748. package/lib/theme-chalk/src/slider.scss +0 -250
  749. package/lib/theme-chalk/src/spinner.scss +0 -44
  750. package/lib/theme-chalk/src/statistic.scss +0 -38
  751. package/lib/theme-chalk/src/step.scss +0 -317
  752. package/lib/theme-chalk/src/steps.scss +0 -20
  753. package/lib/theme-chalk/src/submenu.scss +0 -0
  754. package/lib/theme-chalk/src/switch.scss +0 -116
  755. package/lib/theme-chalk/src/tab-pane.scss +0 -0
  756. package/lib/theme-chalk/src/table-column.scss +0 -97
  757. package/lib/theme-chalk/src/table.scss +0 -564
  758. package/lib/theme-chalk/src/tabs.scss +0 -602
  759. package/lib/theme-chalk/src/tag.scss +0 -163
  760. package/lib/theme-chalk/src/time-picker.scss +0 -8
  761. package/lib/theme-chalk/src/time-select.scss +0 -37
  762. package/lib/theme-chalk/src/timeline-item.scss +0 -86
  763. package/lib/theme-chalk/src/timeline.scss +0 -14
  764. package/lib/theme-chalk/src/tooltip.scss +0 -141
  765. package/lib/theme-chalk/src/transfer.scss +0 -227
  766. package/lib/theme-chalk/src/tree.scss +0 -123
  767. package/lib/theme-chalk/src/upload.scss +0 -603
  768. package/lib/theme-chalk/subTitle.css +0 -1
  769. package/lib/theme-chalk/tabDialog.css +0 -1
  770. package/lib/theme-chalk/treeSelect.css +0 -1
  771. package/lib/theme-cy/base.css +0 -1
  772. package/lib/theme-cy/element.css +0 -1
  773. package/lib/theme-cy/fileUpload.css +0 -1
  774. package/lib/theme-cy/index.css +0 -1
  775. package/lib/theme-cy/selectDisplayInput.css +0 -1
  776. package/lib/theme-cy/subTitle.css +0 -1
  777. package/lib/theme-cy/tabDialog.css +0 -1
  778. package/lib/theme-cy/treeSelect.css +0 -1
  779. package/lib/time-picker.js +0 -6881
  780. package/lib/time-select.js +0 -5892
  781. package/lib/timeline-item.js +0 -329
  782. package/lib/timeline.js +0 -275
  783. package/lib/tooltip.js +0 -2950
  784. package/lib/transfer.js +0 -2998
  785. package/lib/transitions/collapse-transition.js +0 -91
  786. package/lib/tree.js +0 -3470
  787. package/lib/treeSelect.js +0 -4058
  788. package/lib/umd/locale/af-ZA.js +0 -142
  789. package/lib/umd/locale/ar.js +0 -141
  790. package/lib/umd/locale/az.js +0 -141
  791. package/lib/umd/locale/bg.js +0 -142
  792. package/lib/umd/locale/bn.js +0 -141
  793. package/lib/umd/locale/ca.js +0 -141
  794. package/lib/umd/locale/cs-CZ.js +0 -144
  795. package/lib/umd/locale/da.js +0 -141
  796. package/lib/umd/locale/de.js +0 -143
  797. package/lib/umd/locale/ee.js +0 -142
  798. package/lib/umd/locale/el.js +0 -142
  799. package/lib/umd/locale/en.js +0 -142
  800. package/lib/umd/locale/eo.js +0 -142
  801. package/lib/umd/locale/es.js +0 -141
  802. package/lib/umd/locale/eu.js +0 -142
  803. package/lib/umd/locale/fa.js +0 -142
  804. package/lib/umd/locale/fi.js +0 -142
  805. package/lib/umd/locale/fr.js +0 -141
  806. package/lib/umd/locale/he.js +0 -142
  807. package/lib/umd/locale/hr.js +0 -142
  808. package/lib/umd/locale/hu.js +0 -141
  809. package/lib/umd/locale/hy-AM.js +0 -142
  810. package/lib/umd/locale/id.js +0 -142
  811. package/lib/umd/locale/is.js +0 -142
  812. package/lib/umd/locale/it.js +0 -141
  813. package/lib/umd/locale/ja.js +0 -142
  814. package/lib/umd/locale/kg.js +0 -142
  815. package/lib/umd/locale/km.js +0 -142
  816. package/lib/umd/locale/ko.js +0 -142
  817. package/lib/umd/locale/ku.js +0 -142
  818. package/lib/umd/locale/kz.js +0 -142
  819. package/lib/umd/locale/lo-LA.js +0 -141
  820. package/lib/umd/locale/lt.js +0 -142
  821. package/lib/umd/locale/lv.js +0 -142
  822. package/lib/umd/locale/mn.js +0 -142
  823. package/lib/umd/locale/ms.js +0 -141
  824. package/lib/umd/locale/nb-NO.js +0 -141
  825. package/lib/umd/locale/nl.js +0 -142
  826. package/lib/umd/locale/pl.js +0 -142
  827. package/lib/umd/locale/pt-br.js +0 -142
  828. package/lib/umd/locale/pt.js +0 -142
  829. package/lib/umd/locale/ro.js +0 -142
  830. package/lib/umd/locale/ru-RU.js +0 -142
  831. package/lib/umd/locale/si.js +0 -142
  832. package/lib/umd/locale/sk.js +0 -144
  833. package/lib/umd/locale/sl.js +0 -142
  834. package/lib/umd/locale/sr-Latn.js +0 -142
  835. package/lib/umd/locale/sr.js +0 -142
  836. package/lib/umd/locale/sv-SE.js +0 -142
  837. package/lib/umd/locale/sw.js +0 -142
  838. package/lib/umd/locale/ta.js +0 -141
  839. package/lib/umd/locale/th.js +0 -142
  840. package/lib/umd/locale/tk.js +0 -142
  841. package/lib/umd/locale/tr-TR.js +0 -142
  842. package/lib/umd/locale/ua.js +0 -142
  843. package/lib/umd/locale/ug-CN.js +0 -142
  844. package/lib/umd/locale/uz-UZ.js +0 -142
  845. package/lib/umd/locale/vi.js +0 -142
  846. package/lib/umd/locale/zh-CN.js +0 -142
  847. package/lib/umd/locale/zh-TW.js +0 -142
  848. package/lib/upload.js +0 -2337
  849. package/lib/utils/after-leave.js +0 -35
  850. package/lib/utils/aria-dialog.js +0 -104
  851. package/lib/utils/aria-utils.js +0 -126
  852. package/lib/utils/clickoutside.js +0 -79
  853. package/lib/utils/date-util.js +0 -310
  854. package/lib/utils/date.js +0 -369
  855. package/lib/utils/dom.js +0 -234
  856. package/lib/utils/lodash.js +0 -9421
  857. package/lib/utils/menu/aria-menubar.js +0 -24
  858. package/lib/utils/menu/aria-menuitem.js +0 -62
  859. package/lib/utils/menu/aria-submenu.js +0 -69
  860. package/lib/utils/merge.js +0 -21
  861. package/lib/utils/popper.js +0 -1261
  862. package/lib/utils/popup/index.js +0 -233
  863. package/lib/utils/popup/popup-manager.js +0 -205
  864. package/lib/utils/resize-event.js +0 -59
  865. package/lib/utils/scroll-into-view.js +0 -38
  866. package/lib/utils/scrollbar-width.js +0 -39
  867. package/lib/utils/shared.js +0 -12
  868. package/lib/utils/types.js +0 -52
  869. package/lib/utils/util.js +0 -272
  870. package/lib/utils/vdom.js +0 -13
  871. package/lib/utils/vue-popper.js +0 -202
  872. package/packages/fileUpload/index.js +0 -8
  873. package/packages/fileUpload/src/main.vue +0 -430
  874. package/packages/selectDisplayInput/index.js +0 -8
  875. package/packages/selectDisplayInput/src/main.vue +0 -75
  876. package/packages/subTitle/index.js +0 -8
  877. package/packages/subTitle/src/main.vue +0 -33
  878. package/packages/tabDialog/index.js +0 -23
  879. package/packages/tabDialog/src/dialog/drag.js +0 -63
  880. package/packages/tabDialog/src/dialog/dragHeight.js +0 -34
  881. package/packages/tabDialog/src/dialog/dragWidth.js +0 -30
  882. package/packages/tabDialog/src/main.vue +0 -277
  883. package/packages/theme-cy/README.md +0 -38
  884. package/packages/theme-cy/gulpfile.js +0 -27
  885. package/packages/theme-cy/package.json +0 -35
  886. package/packages/theme-cy/src/base.scss +0 -3
  887. package/packages/theme-cy/src/element.scss +0 -45
  888. package/packages/theme-cy/src/fileUpload.scss +0 -30
  889. package/packages/theme-cy/src/index.scss +0 -7
  890. package/packages/theme-cy/src/selectDisplayInput.scss +0 -76
  891. package/packages/theme-cy/src/subTitle.scss +0 -26
  892. package/packages/theme-cy/src/tabDialog.scss +0 -43
  893. package/packages/theme-cy/src/treeSelect.scss +0 -98
  894. package/packages/treeSelect/index.js +0 -8
  895. package/packages/treeSelect/src/main.vue +0 -325
  896. package/src/locale/lang/af-ZA.js +0 -123
  897. package/src/locale/lang/ar.js +0 -122
  898. package/src/locale/lang/az.js +0 -126
  899. package/src/locale/lang/bg.js +0 -123
  900. package/src/locale/lang/bn.js +0 -126
  901. package/src/locale/lang/ca.js +0 -122
  902. package/src/locale/lang/cs-CZ.js +0 -125
  903. package/src/locale/lang/da.js +0 -122
  904. package/src/locale/lang/de.js +0 -124
  905. package/src/locale/lang/ee.js +0 -123
  906. package/src/locale/lang/el.js +0 -123
  907. package/src/locale/lang/eo.js +0 -123
  908. package/src/locale/lang/es.js +0 -122
  909. package/src/locale/lang/eu.js +0 -123
  910. package/src/locale/lang/fa.js +0 -123
  911. package/src/locale/lang/fi.js +0 -123
  912. package/src/locale/lang/fr.js +0 -122
  913. package/src/locale/lang/he.js +0 -123
  914. package/src/locale/lang/hr.js +0 -123
  915. package/src/locale/lang/hu.js +0 -122
  916. package/src/locale/lang/hy-AM.js +0 -123
  917. package/src/locale/lang/id.js +0 -123
  918. package/src/locale/lang/is.js +0 -124
  919. package/src/locale/lang/it.js +0 -122
  920. package/src/locale/lang/ja.js +0 -123
  921. package/src/locale/lang/kg.js +0 -123
  922. package/src/locale/lang/km.js +0 -123
  923. package/src/locale/lang/ko.js +0 -123
  924. package/src/locale/lang/ku.js +0 -123
  925. package/src/locale/lang/kz.js +0 -123
  926. package/src/locale/lang/lo-LA.js +0 -126
  927. package/src/locale/lang/lt.js +0 -123
  928. package/src/locale/lang/lv.js +0 -123
  929. package/src/locale/lang/mn.js +0 -123
  930. package/src/locale/lang/ms.js +0 -122
  931. package/src/locale/lang/nb-NO.js +0 -122
  932. package/src/locale/lang/nl.js +0 -123
  933. package/src/locale/lang/pl.js +0 -123
  934. package/src/locale/lang/pt-br.js +0 -123
  935. package/src/locale/lang/pt.js +0 -123
  936. package/src/locale/lang/ro.js +0 -123
  937. package/src/locale/lang/ru-RU.js +0 -123
  938. package/src/locale/lang/si.js +0 -123
  939. package/src/locale/lang/sk.js +0 -125
  940. package/src/locale/lang/sl.js +0 -123
  941. package/src/locale/lang/sr-Latn.js +0 -123
  942. package/src/locale/lang/sr.js +0 -123
  943. package/src/locale/lang/sv-SE.js +0 -123
  944. package/src/locale/lang/sw.js +0 -123
  945. package/src/locale/lang/ta.js +0 -122
  946. package/src/locale/lang/th.js +0 -123
  947. package/src/locale/lang/tk.js +0 -123
  948. package/src/locale/lang/tr-TR.js +0 -123
  949. package/src/locale/lang/ua.js +0 -123
  950. package/src/locale/lang/ug-CN.js +0 -123
  951. package/src/locale/lang/uz-UZ.js +0 -123
  952. package/src/locale/lang/vi.js +0 -123
  953. package/types/fileUpload.d.ts +0 -5
  954. package/types/selectDisplayInput.d.ts +0 -5
  955. package/types/subTitle.d.ts +0 -5
  956. package/types/tabDialog.d.ts +0 -5
  957. package/types/treeSelect.d.ts +0 -5
@@ -1,414 +1,956 @@
1
1
  <template>
2
- <el-input
3
- class="el-date-editor"
4
- :class="'el-date-editor--' + type"
5
- :readonly="!editable || readonly || type === 'dates' || type === 'week' || type === 'years' || type === 'months'"
6
- :disabled="pickerDisabled"
7
- :size="pickerSize"
8
- :name="name"
9
- v-bind="firstInputId"
10
- v-if="!ranged"
11
- v-clickoutside="handleClose"
12
- :placeholder="placeholder"
13
- @focus="handleFocus"
14
- @keydown.native="handleKeydown"
15
- :value="displayValue"
16
- @input="value => userInput = value"
17
- @change="handleChange"
18
- @mouseenter.native="handleMouseEnter"
19
- @mouseleave.native="showClose = false"
20
- :validateEvent="false"
21
- ref="reference">
22
- <i slot="prefix"
23
- class="el-input__icon"
24
- :class="triggerClass"
25
- @click="handleFocus">
26
- </i>
27
- <i slot="suffix"
28
- class="el-input__icon"
29
- @click="handleClickIcon"
30
- :class="[showClose ? '' + clearIcon : '']"
31
- v-if="haveTrigger">
32
- </i>
33
- </el-input>
34
- <div
35
- class="el-date-editor el-range-editor el-input__inner"
36
- :class="[
37
- 'el-date-editor--' + type,
38
- pickerSize ? `el-range-editor--${ pickerSize }` : '',
39
- pickerDisabled ? 'is-disabled' : '',
40
- pickerVisible ? 'is-active' : ''
41
- ]"
42
- @click="handleRangeClick"
43
- @mouseenter="handleMouseEnter"
44
- @mouseleave="showClose = false"
45
- @keydown="handleKeydown"
46
- ref="reference"
47
- v-clickoutside="handleClose"
48
- v-else>
49
- <i :class="['el-input__icon', 'el-range__icon', triggerClass]"></i>
50
- <input
51
- autocomplete="off"
52
- :placeholder="startPlaceholder"
53
- :value="displayValue && displayValue[0]"
54
- :disabled="pickerDisabled"
55
- v-bind="firstInputId"
56
- :readonly="!editable || readonly"
57
- :name="name && name[0]"
58
- @input="handleStartInput"
59
- @change="handleStartChange"
60
- @focus="handleFocus"
61
- class="el-range-input">
62
- <slot name="range-separator">
63
- <span class="el-range-separator">{{ rangeSeparator }}</span>
64
- </slot>
65
- <input
66
- autocomplete="off"
67
- :placeholder="endPlaceholder"
68
- :value="displayValue && displayValue[1]"
69
- :disabled="pickerDisabled"
70
- v-bind="secondInputId"
71
- :readonly="!editable || readonly"
72
- :name="name && name[1]"
73
- @input="handleEndInput"
74
- @change="handleEndChange"
75
- @focus="handleFocus"
76
- class="el-range-input">
77
- <i
78
- @click="handleClickIcon"
79
- v-if="haveTrigger"
80
- :class="[showClose ? '' + clearIcon : '']"
81
- class="el-input__icon el-range__close-icon">
82
- </i>
83
- </div>
2
+ <el-input
3
+ class="el-date-editor"
4
+ :class="'el-date-editor--' + type"
5
+ :readonly="!editable || readonly || type === 'dates' || type === 'week' || type === 'years' || type === 'months'"
6
+ :disabled="pickerDisabled"
7
+ :size="pickerSize"
8
+ :name="name"
9
+ v-bind="firstInputId"
10
+ v-if="!ranged"
11
+ v-clickoutside="handleClose"
12
+ :placeholder="placeholder"
13
+ @focus="handleFocus"
14
+ @keydown.native="handleKeydown"
15
+ :value="displayValue"
16
+ @input="value => userInput = value"
17
+ @change="handleChange"
18
+ @mouseenter.native="handleMouseEnter"
19
+ @mouseleave.native="showClose = false"
20
+ :validateEvent="false"
21
+ ref="reference">
22
+ <i slot="prefix"
23
+ class="el-input__icon"
24
+ :class="triggerClass"
25
+ @click="handleFocus">
26
+ </i>
27
+ <i slot="suffix"
28
+ class="el-input__icon"
29
+ @click="handleClickIcon"
30
+ :class="[showClose ? '' + clearIcon : '']"
31
+ v-if="haveTrigger">
32
+ </i>
33
+ </el-input>
34
+ <div
35
+ class="el-date-editor el-range-editor el-input__inner"
36
+ :class="[
37
+ 'el-date-editor--' + type,
38
+ pickerSize ? `el-range-editor--${ pickerSize }` : '',
39
+ pickerDisabled ? 'is-disabled' : '',
40
+ pickerVisible ? 'is-active' : ''
41
+ ]"
42
+ @click="handleRangeClick"
43
+ @mouseenter="handleMouseEnter"
44
+ @mouseleave="showClose = false"
45
+ @keydown="handleKeydown"
46
+ ref="reference"
47
+ v-clickoutside="handleClose"
48
+ v-else>
49
+ <i :class="['el-input__icon', 'el-range__icon', triggerClass]"></i>
50
+ <input
51
+ autocomplete="off"
52
+ :placeholder="startPlaceholder"
53
+ :value="displayValue && displayValue[0]"
54
+ :disabled="pickerDisabled"
55
+ v-bind="firstInputId"
56
+ :readonly="!editable || readonly"
57
+ :name="name && name[0]"
58
+ @input="handleStartInput"
59
+ @change="handleStartChange"
60
+ @focus="handleFocus"
61
+ class="el-range-input">
62
+ <slot name="range-separator">
63
+ <span class="el-range-separator">{{ rangeSeparator }}</span>
64
+ </slot>
65
+ <input
66
+ autocomplete="off"
67
+ :placeholder="endPlaceholder"
68
+ :value="displayValue && displayValue[1]"
69
+ :disabled="pickerDisabled"
70
+ v-bind="secondInputId"
71
+ :readonly="!editable || readonly"
72
+ :name="name && name[1]"
73
+ @input="handleEndInput"
74
+ @change="handleEndChange"
75
+ @focus="handleFocus"
76
+ class="el-range-input">
77
+ <i
78
+ @click="handleClickIcon"
79
+ v-if="haveTrigger"
80
+ :class="[showClose ? '' + clearIcon : '']"
81
+ class="el-input__icon el-range__close-icon">
82
+ </i>
83
+ </div>
84
84
  </template>
85
85
 
86
86
  <script>
87
87
  import Vue from 'vue';
88
- import Clickoutside from 'src/utils/clickoutside';
89
- import { formatDate, parseDate, isDateObject, getWeekNumber } from 'src/utils/date-util';
90
- import Popper from 'src/utils/vue-popper';
91
- import Emitter from 'src/mixins/emitter';
92
- import ElInput from '../../input';
93
- import merge from 'src/utils/merge';
88
+ import Clickoutside from 'element-ui/src/utils/clickoutside';
89
+ import { formatDate, parseDate, isDateObject, getWeekNumber } from 'element-ui/src/utils/date-util';
90
+ import Popper from 'element-ui/src/utils/vue-popper';
91
+ import Emitter from 'element-ui/src/mixins/emitter';
92
+ import ElInput from 'element-ui/packages/input';
93
+ import merge from 'element-ui/src/utils/merge';
94
94
 
95
95
  const NewPopper = {
96
- props: {
97
- appendToBody: Popper.props.appendToBody,
98
- offset: Popper.props.offset,
99
- boundariesPadding: Popper.props.boundariesPadding,
100
- arrowOffset: Popper.props.arrowOffset,
101
- transformOrigin: Popper.props.transformOrigin
102
- },
103
- methods: Popper.methods,
104
- data() {
105
- return merge({ visibleArrow: true }, Popper.data);
106
- },
107
- beforeDestroy: Popper.beforeDestroy
96
+ props: {
97
+ appendToBody: Popper.props.appendToBody,
98
+ offset: Popper.props.offset,
99
+ boundariesPadding: Popper.props.boundariesPadding,
100
+ arrowOffset: Popper.props.arrowOffset,
101
+ transformOrigin: Popper.props.transformOrigin
102
+ },
103
+ methods: Popper.methods,
104
+ data() {
105
+ return merge({ visibleArrow: true }, Popper.data);
106
+ },
107
+ beforeDestroy: Popper.beforeDestroy
108
108
  };
109
109
 
110
110
  const DEFAULT_FORMATS = {
111
- date: 'yyyy-MM-dd',
112
- month: 'yyyy-MM',
113
- months: 'yyyy-MM',
114
- datetime: 'yyyy-MM-dd HH:mm:ss',
115
- time: 'HH:mm:ss',
116
- week: 'yyyywWW',
117
- timerange: 'HH:mm:ss',
118
- daterange: 'yyyy-MM-dd',
119
- monthrange: 'yyyy-MM',
120
- datetimerange: 'yyyy-MM-dd HH:mm:ss',
121
- year: 'yyyy',
122
- years: 'yyyy'
111
+ date: 'yyyy-MM-dd',
112
+ month: 'yyyy-MM',
113
+ months: 'yyyy-MM',
114
+ datetime: 'yyyy-MM-dd HH:mm:ss',
115
+ time: 'HH:mm:ss',
116
+ week: 'yyyywWW',
117
+ timerange: 'HH:mm:ss',
118
+ daterange: 'yyyy-MM-dd',
119
+ monthrange: 'yyyy-MM',
120
+ datetimerange: 'yyyy-MM-dd HH:mm:ss',
121
+ year: 'yyyy',
122
+ years: 'yyyy'
123
123
  };
124
124
  const HAVE_TRIGGER_TYPES = [
125
- 'date',
126
- 'datetime',
127
- 'time',
128
- 'time-select',
129
- 'week',
130
- 'month',
131
- 'year',
132
- 'daterange',
133
- 'monthrange',
134
- 'timerange',
135
- 'datetimerange',
136
- 'dates',
137
- 'months',
138
- 'years'
125
+ 'date',
126
+ 'datetime',
127
+ 'time',
128
+ 'time-select',
129
+ 'week',
130
+ 'month',
131
+ 'year',
132
+ 'daterange',
133
+ 'monthrange',
134
+ 'timerange',
135
+ 'datetimerange',
136
+ 'dates',
137
+ 'months',
138
+ 'years'
139
139
  ];
140
140
  const DATE_FORMATTER = function(value, format) {
141
- if (format === 'timestamp') return value.getTime();
142
- return formatDate(value, format);
141
+ if (format === 'timestamp') return value.getTime();
142
+ return formatDate(value, format);
143
143
  };
144
144
  const DATE_PARSER = function(text, format) {
145
- if (format === 'timestamp') return new Date(Number(text));
146
- return parseDate(text, format);
145
+ if (format === 'timestamp') return new Date(Number(text));
146
+ return parseDate(text, format);
147
147
  };
148
148
  const RANGE_FORMATTER = function(value, format) {
149
- if (Array.isArray(value) && value.length === 2) {
150
- const start = value[0];
151
- const end = value[1];
152
- if (isDateObject(start) && isDateObject(end)) {
153
- return [formatDate(start, format), formatDate(end, format)];
154
- }
155
- }
156
- return ['', ''];
149
+ if (Array.isArray(value) && value.length === 2) {
150
+ const start = value[0];
151
+ const end = value[1];
152
+
153
+ if (start && end) {
154
+ return [DATE_FORMATTER(start, format), DATE_FORMATTER(end, format)];
155
+ }
156
+ }
157
+ return '';
158
+ };
159
+ const RANGE_PARSER = function(array, format, separator) {
160
+ if (!Array.isArray(array)) {
161
+ array = array.split(separator);
162
+ }
163
+ if (array.length === 2) {
164
+ const range1 = array[0];
165
+ const range2 = array[1];
166
+
167
+ return [DATE_PARSER(range1, format), DATE_PARSER(range2, format)];
168
+ }
169
+ return [];
170
+ };
171
+ const TYPE_VALUE_RESOLVER_MAP = {
172
+ default: {
173
+ formatter(value) {
174
+ if (!value) return '';
175
+ return '' + value;
176
+ },
177
+ parser(text) {
178
+ if (text === undefined || text === '') return null;
179
+ return text;
180
+ }
181
+ },
182
+ week: {
183
+ formatter(value, format) {
184
+ let week = getWeekNumber(value);
185
+ let month = value.getMonth();
186
+ const trueDate = new Date(value);
187
+ if (week === 1 && month === 11) {
188
+ trueDate.setHours(0, 0, 0, 0);
189
+ trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
190
+ }
191
+ let date = formatDate(trueDate, format);
192
+
193
+ date = /WW/.test(date)
194
+ ? date.replace(/WW/, week < 10 ? '0' + week : week)
195
+ : date.replace(/W/, week);
196
+ return date;
197
+ },
198
+ parser(text, format) {
199
+ // parse as if a normal date
200
+ return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
201
+ }
202
+ },
203
+ date: {
204
+ formatter: DATE_FORMATTER,
205
+ parser: DATE_PARSER
206
+ },
207
+ datetime: {
208
+ formatter: DATE_FORMATTER,
209
+ parser: DATE_PARSER
210
+ },
211
+ daterange: {
212
+ formatter: RANGE_FORMATTER,
213
+ parser: RANGE_PARSER
214
+ },
215
+ monthrange: {
216
+ formatter: RANGE_FORMATTER,
217
+ parser: RANGE_PARSER
218
+ },
219
+ datetimerange: {
220
+ formatter: RANGE_FORMATTER,
221
+ parser: RANGE_PARSER
222
+ },
223
+ timerange: {
224
+ formatter: RANGE_FORMATTER,
225
+ parser: RANGE_PARSER
226
+ },
227
+ time: {
228
+ formatter: DATE_FORMATTER,
229
+ parser: DATE_PARSER
230
+ },
231
+ month: {
232
+ formatter: DATE_FORMATTER,
233
+ parser: DATE_PARSER
234
+ },
235
+ year: {
236
+ formatter: DATE_FORMATTER,
237
+ parser: DATE_PARSER
238
+ },
239
+ number: {
240
+ formatter(value) {
241
+ if (!value) return '';
242
+ return '' + value;
243
+ },
244
+ parser(text) {
245
+ let result = Number(text);
246
+
247
+ if (!isNaN(text)) {
248
+ return result;
249
+ } else {
250
+ return null;
251
+ }
252
+ }
253
+ },
254
+ dates: {
255
+ formatter(value, format) {
256
+ return value.map(date => DATE_FORMATTER(date, format));
257
+ },
258
+ parser(value, format) {
259
+ return (typeof value === 'string' ? value.split(', ') : value)
260
+ .map(date => date instanceof Date ? date : DATE_PARSER(date, format));
261
+ }
262
+ },
263
+ months: {
264
+ formatter(value, format) {
265
+ return value.map(date => DATE_FORMATTER(date, format));
266
+ },
267
+ parser(value, format) {
268
+ return (typeof value === 'string' ? value.split(', ') : value)
269
+ .map(date => date instanceof Date ? date : DATE_PARSER(date, format));
270
+ }
271
+ },
272
+ years: {
273
+ formatter(value, format) {
274
+ return value.map(date => DATE_FORMATTER(date, format));
275
+ },
276
+ parser(value, format) {
277
+ return (typeof value === 'string' ? value.split(', ') : value)
278
+ .map(date => date instanceof Date ? date : DATE_PARSER(date, format));
279
+ }
280
+ }
281
+ };
282
+ const PLACEMENT_MAP = {
283
+ left: 'bottom-start',
284
+ center: 'bottom',
285
+ right: 'bottom-end'
286
+ };
287
+
288
+ const parseAsFormatAndType = (value, customFormat, type, rangeSeparator = '-') => {
289
+ if (!value) return null;
290
+ const parser = (
291
+ TYPE_VALUE_RESOLVER_MAP[type] ||
292
+ TYPE_VALUE_RESOLVER_MAP['default']
293
+ ).parser;
294
+ const format = customFormat || DEFAULT_FORMATS[type];
295
+ return parser(value, format, rangeSeparator);
296
+ };
297
+
298
+ const formatAsFormatAndType = (value, customFormat, type) => {
299
+ if (!value) return null;
300
+ const formatter = (
301
+ TYPE_VALUE_RESOLVER_MAP[type] ||
302
+ TYPE_VALUE_RESOLVER_MAP['default']
303
+ ).formatter;
304
+ const format = customFormat || DEFAULT_FORMATS[type];
305
+ return formatter(value, format);
157
306
  };
158
- const RANGE_PARSER = function(text, format) {
159
- if (Array.isArray(text) && text.length === 2) {
160
- return [parseDate(text[0], format), parseDate(text[1], format)];
161
- }
162
- return [];
307
+
308
+ /*
309
+ * Considers:
310
+ * 1. Date object
311
+ * 2. date string
312
+ * 3. array of 1 or 2
313
+ */
314
+ const valueEquals = function(a, b) {
315
+ // considers Date object and string
316
+ const dateEquals = function(a, b) {
317
+ const aIsDate = a instanceof Date;
318
+ const bIsDate = b instanceof Date;
319
+ if (aIsDate && bIsDate) {
320
+ return a.getTime() === b.getTime();
321
+ }
322
+ if (!aIsDate && !bIsDate) {
323
+ return a === b;
324
+ }
325
+ return false;
326
+ };
327
+
328
+ const aIsArray = a instanceof Array;
329
+ const bIsArray = b instanceof Array;
330
+ if (aIsArray && bIsArray) {
331
+ if (a.length !== b.length) {
332
+ return false;
333
+ }
334
+ return a.every((item, index) => dateEquals(item, b[index]));
335
+ }
336
+ if (!aIsArray && !bIsArray) {
337
+ return dateEquals(a, b);
338
+ }
339
+ return false;
340
+ };
341
+
342
+ const isString = function(val) {
343
+ return typeof val === 'string' || val instanceof String;
344
+ };
345
+
346
+ const validator = function(val) {
347
+ // either: String, Array of String, null / undefined
348
+ return (
349
+ val === null ||
350
+ val === undefined ||
351
+ isString(val) ||
352
+ (Array.isArray(val) && val.length === 2 && val.every(isString))
353
+ );
163
354
  };
164
355
 
165
356
  export default {
166
- name: 'ElDatePicker',
167
-
168
- componentName: 'ElDatePicker',
169
-
170
- mixins: [Emitter],
171
-
172
- props: {
173
- modelValue: {
174
- default: ''
175
- },
176
- value: {
177
- default: ''
178
- },
179
- readonly: Boolean,
180
- disabled: Boolean,
181
- size: String,
182
- editable: {
183
- type: Boolean,
184
- default: true
185
- },
186
- type: {
187
- type: String,
188
- default: 'date',
189
- validator(val) {
190
- return [
191
- 'date',
192
- 'dates',
193
- 'datetime',
194
- 'week',
195
- 'month',
196
- 'months',
197
- 'year',
198
- 'years',
199
- 'datetimerange',
200
- 'daterange',
201
- 'monthrange',
202
- 'timerange'
203
- ].indexOf(val) > -1;
204
- }
205
- },
206
- format: String,
207
- align: {
208
- type: String,
209
- default: 'left'
210
- },
211
- pickerOptions: Object,
212
- rangeSeparator: {
213
- type: String,
214
- default: '-'
215
- },
216
- startPlaceholder: String,
217
- endPlaceholder: String,
218
- placeholder: String,
219
- timeArrowControl: Boolean,
220
- name: [String, Array],
221
- autocomplete: {
222
- type: String,
223
- default: 'off'
224
- },
225
- popperClass: String,
226
- teleported: {
227
- type: Boolean,
228
- default: true
229
- },
230
- validateEvent: {
231
- type: Boolean,
232
- default: true
233
- },
234
- dateRangeSeparator: {
235
- type: String,
236
- default: '-'
237
- }
238
- },
239
-
240
- data() {
241
- return {
242
- pickerVisible: false,
243
- userInput: '',
244
- showClose: false,
245
- pickerDate: null,
246
- selectionMode: 'date',
247
- dateRangeSeparator: this.rangeSeparator
248
- };
249
- },
250
-
251
- computed: {
252
- actualValue: {
253
- get() {
254
- return this.modelValue !== undefined ? this.modelValue : this.value;
255
- },
256
- set(value) {
257
- this.$emit('update:modelValue', value);
258
- this.$emit('input', value);
259
- }
260
- },
261
- ranged() {
262
- return this.type === 'daterange' || this.type === 'monthrange' || this.type === 'datetimerange' || this.type === 'timerange';
263
- },
264
- pickerSize() {
265
- return this.size || (this.$ELEMENT || {}).size;
266
- },
267
- pickerDisabled() {
268
- return this.disabled || (this.elForm || {}).disabled;
269
- },
270
- haveTrigger() {
271
- return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
272
- },
273
- triggerClass() {
274
- return this.pickerVisible ? 'el-icon-d-arrow-down' : 'el-icon-calendar';
275
- },
276
- elForm() {
277
- let parent = this.$parent;
278
- while (parent) {
279
- if (parent.$options.componentName === 'ElForm') {
280
- return parent;
281
- }
282
- parent = parent.$parent;
283
- }
284
- return null;
285
- },
286
- displayFormat() {
287
- return this.format || DEFAULT_FORMATS[this.type];
288
- },
289
- displayValue() {
290
- const value = this.actualValue;
291
- if (this.ranged) {
292
- if (Array.isArray(value) && value.length === 2) {
293
- const start = value[0];
294
- const end = value[1];
295
- if (isDateObject(start) && isDateObject(end)) {
296
- return [formatDate(start, this.displayFormat), formatDate(end, this.displayFormat)];
297
- }
298
- }
299
- return ['', ''];
300
- } else {
301
- if (isDateObject(value)) {
302
- return formatDate(value, this.displayFormat);
303
- }
304
- return '';
305
- }
306
- },
307
- clearIcon() {
308
- return 'el-icon-circle-close';
309
- },
310
- firstInputId() {
311
- return this.name ? { id: `el-date-picker-${ this.name }` } : {};
312
- },
313
- secondInputId() {
314
- return this.name && Array.isArray(this.name) ? { id: `el-date-picker-${ this.name[1] }` } : {};
315
- }
316
- },
317
-
318
- watch: {
319
- pickerVisible(val) {
320
- if (val) {
321
- this.$emit('visible-change', true);
322
- this.$nextTick(() => {
323
- this.updateScrollBar();
324
- });
325
- } else {
326
- this.$emit('visible-change', false);
327
- }
328
- },
329
- actualValue(val) {
330
- if (this.ranged) {
331
- if (Array.isArray(val) && val.length === 2) {
332
- this.pickerDate = val[0];
333
- }
334
- } else {
335
- this.pickerDate = val;
336
- }
337
- this.userInput = '';
338
- }
339
- },
340
-
341
- methods: {
342
- handleFocus(e) {
343
- if (this.pickerDisabled) return;
344
- this.pickerVisible = true;
345
- this.$emit('focus', e);
346
- },
347
- handleClose() {
348
- this.pickerVisible = false;
349
- this.showClose = false;
350
- },
351
- handleKeydown(e) {
352
- if (e.keyCode === 27) {
353
- this.handleClose();
354
- }
355
- },
356
- handleClickIcon() {
357
- if (this.showClose) {
358
- this.handleClear();
359
- } else {
360
- this.handleFocus();
361
- }
362
- },
363
- handleClear() {
364
- this.actualValue = this.ranged ? ['', ''] : '';
365
- this.showClose = false;
366
- this.$emit('clear');
367
- },
368
- handleChange(e) {
369
- this.$emit('change', e);
370
- },
371
- handleStartInput(value) {
372
- this.userInput = value;
373
- },
374
- handleEndInput(value) {
375
- this.userInput = value;
376
- },
377
- handleStartChange(value) {
378
- this.$emit('change', value);
379
- },
380
- handleEndChange(value) {
381
- this.$emit('change', value);
382
- },
383
- handleRangeClick(e) {
384
- if (this.pickerDisabled) return;
385
- const target = e.target;
386
- const isInput = target.tagName === 'INPUT';
387
- if (!isInput) {
388
- this.pickerVisible = !this.pickerVisible;
389
- }
390
- },
391
- handleMouseEnter() {
392
- if (this.actualValue) {
393
- this.showClose = true;
394
- }
395
- },
396
- updateScrollBar() {
397
- this.$nextTick(() => {
398
- const scrollbar = this.$refs.reference && this.$refs.reference.$el;
399
- if (scrollbar) {
400
- scrollbar.scrollLeft = 0;
401
- }
402
- });
403
- }
404
- },
405
-
406
- directives: {
407
- clickoutside: Clickoutside
408
- },
409
-
410
- components: {
411
- ElInput
412
- }
357
+ mixins: [Emitter, NewPopper],
358
+
359
+ inject: {
360
+ elForm: {
361
+ default: ''
362
+ },
363
+ elFormItem: {
364
+ default: ''
365
+ }
366
+ },
367
+
368
+ props: {
369
+ size: String,
370
+ format: String,
371
+ valueFormat: String,
372
+ readonly: Boolean,
373
+ placeholder: String,
374
+ startPlaceholder: String,
375
+ endPlaceholder: String,
376
+ prefixIcon: String,
377
+ clearIcon: {
378
+ type: String,
379
+ default: 'el-icon-circle-close'
380
+ },
381
+ name: {
382
+ default: '',
383
+ validator
384
+ },
385
+ disabled: Boolean,
386
+ clearable: {
387
+ type: Boolean,
388
+ default: true
389
+ },
390
+ id: {
391
+ default: '',
392
+ validator
393
+ },
394
+ popperClass: String,
395
+ editable: {
396
+ type: Boolean,
397
+ default: true
398
+ },
399
+ align: {
400
+ type: String,
401
+ default: 'left'
402
+ },
403
+ value: {},
404
+ defaultValue: {},
405
+ defaultTime: {},
406
+ rangeSeparator: {
407
+ default: '-'
408
+ },
409
+ pickerOptions: {},
410
+ unlinkPanels: Boolean,
411
+ validateEvent: {
412
+ type: Boolean,
413
+ default: true
414
+ }
415
+ },
416
+
417
+ components: { ElInput },
418
+
419
+ directives: { Clickoutside },
420
+
421
+ data() {
422
+ return {
423
+ pickerVisible: false,
424
+ showClose: false,
425
+ userInput: null,
426
+ valueOnOpen: null, // value when picker opens, used to determine whether to emit change
427
+ unwatchPickerOptions: null
428
+ };
429
+ },
430
+
431
+ watch: {
432
+ pickerVisible(val) {
433
+ if (this.readonly || this.pickerDisabled) return;
434
+ if (val) {
435
+ this.showPicker();
436
+ this.valueOnOpen = Array.isArray(this.value) ? [...this.value] : this.value;
437
+ } else {
438
+ this.hidePicker();
439
+ this.emitChange(this.value);
440
+ this.userInput = null;
441
+ if (this.validateEvent) {
442
+ this.dispatch('ElFormItem', 'el.form.blur');
443
+ }
444
+ this.$emit('blur', this);
445
+ this.blur();
446
+ }
447
+ },
448
+ parsedValue: {
449
+ immediate: true,
450
+ handler(val) {
451
+ if (this.picker) {
452
+ this.picker.value = val;
453
+ }
454
+ }
455
+ },
456
+ defaultValue(val) {
457
+ // NOTE: should eventually move to jsx style picker + panel ?
458
+ if (this.picker) {
459
+ this.picker.defaultValue = val;
460
+ }
461
+ },
462
+ value(val, oldVal) {
463
+ if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
464
+ this.dispatch('ElFormItem', 'el.form.change', val);
465
+ }
466
+ }
467
+ },
468
+
469
+ computed: {
470
+ ranged() {
471
+ return this.type.indexOf('range') > -1;
472
+ },
473
+
474
+ reference() {
475
+ const reference = this.$refs.reference;
476
+ return reference.$el || reference;
477
+ },
478
+
479
+ refInput() {
480
+ if (this.reference) {
481
+ return [].slice.call(this.reference.querySelectorAll('input'));
482
+ }
483
+ return [];
484
+ },
485
+
486
+ valueIsEmpty() {
487
+ const val = this.value;
488
+ if (Array.isArray(val)) {
489
+ for (let i = 0, len = val.length; i < len; i++) {
490
+ if (val[i]) {
491
+ return false;
492
+ }
493
+ }
494
+ } else {
495
+ if (val) {
496
+ return false;
497
+ }
498
+ }
499
+ return true;
500
+ },
501
+
502
+ triggerClass() {
503
+ return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
504
+ },
505
+
506
+ selectionMode() {
507
+ if (this.type === 'week') {
508
+ return 'week';
509
+ } else if (this.type === 'month') {
510
+ return 'month';
511
+ } else if (this.type === 'year') {
512
+ return 'year';
513
+ } else if (this.type === 'dates') {
514
+ return 'dates';
515
+ } else if (this.type === 'months') {
516
+ return 'months';
517
+ } else if (this.type === 'years') {
518
+ return 'years';
519
+ }
520
+
521
+ return 'day';
522
+ },
523
+
524
+ haveTrigger() {
525
+ if (typeof this.showTrigger !== 'undefined') {
526
+ return this.showTrigger;
527
+ }
528
+ return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
529
+ },
530
+
531
+ displayValue() {
532
+ const formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
533
+ if (Array.isArray(this.userInput)) {
534
+ return [
535
+ this.userInput[0] || (formattedValue && formattedValue[0]) || '',
536
+ this.userInput[1] || (formattedValue && formattedValue[1]) || ''
537
+ ];
538
+ } else if (this.userInput !== null) {
539
+ return this.userInput;
540
+ } else if (formattedValue) {
541
+ return (this.type === 'dates' || this.type === 'years' || this.type === 'months')
542
+ ? formattedValue.join(', ')
543
+ : formattedValue;
544
+ } else {
545
+ return '';
546
+ }
547
+ },
548
+
549
+ parsedValue() {
550
+ if (!this.value) return this.value; // component value is not set
551
+ if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
552
+
553
+ const valueIsDateObject = isDateObject(this.value) || (Array.isArray(this.value) && this.value.every(isDateObject));
554
+ if (valueIsDateObject) {
555
+ return this.value;
556
+ }
557
+
558
+ if (this.valueFormat) {
559
+ return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
560
+ }
561
+
562
+ // NOTE: deal with common but incorrect usage, should remove in next major version
563
+ // user might provide string / timestamp without value-format, coerce them into date (or array of date)
564
+ return Array.isArray(this.value) ? this.value.map(val => new Date(val)) : new Date(this.value);
565
+ },
566
+
567
+ _elFormItemSize() {
568
+ return (this.elFormItem || {}).elFormItemSize;
569
+ },
570
+
571
+ pickerSize() {
572
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
573
+ },
574
+
575
+ pickerDisabled() {
576
+ return this.disabled || (this.elForm || {}).disabled;
577
+ },
578
+
579
+ firstInputId() {
580
+ const obj = {};
581
+ let id;
582
+ if (this.ranged) {
583
+ id = this.id && this.id[0];
584
+ } else {
585
+ id = this.id;
586
+ }
587
+ if (id) obj.id = id;
588
+ return obj;
589
+ },
590
+
591
+ secondInputId() {
592
+ const obj = {};
593
+ let id;
594
+ if (this.ranged) {
595
+ id = this.id && this.id[1];
596
+ }
597
+ if (id) obj.id = id;
598
+ return obj;
599
+ }
600
+ },
601
+
602
+ created() {
603
+ // vue-popper
604
+ this.popperOptions = {
605
+ boundariesPadding: 0,
606
+ gpuAcceleration: false
607
+ };
608
+ this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
609
+
610
+ this.$on('fieldReset', this.handleFieldReset);
611
+ },
612
+
613
+ methods: {
614
+ focus() {
615
+ if (!this.ranged) {
616
+ this.$refs.reference.focus();
617
+ } else {
618
+ this.handleFocus();
619
+ }
620
+ },
621
+
622
+ blur() {
623
+ this.refInput.forEach(input => input.blur());
624
+ },
625
+
626
+ // {parse, formatTo} Value deals maps component value with internal Date
627
+ parseValue(value) {
628
+ const isParsed = isDateObject(value) || (Array.isArray(value) && value.every(isDateObject));
629
+ if (this.valueFormat && !isParsed) {
630
+ return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
631
+ } else {
632
+ return value;
633
+ }
634
+ },
635
+
636
+ formatToValue(date) {
637
+ const isFormattable = isDateObject(date) || (Array.isArray(date) && date.every(isDateObject));
638
+ if (this.valueFormat && isFormattable) {
639
+ return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
640
+ } else {
641
+ return date;
642
+ }
643
+ },
644
+
645
+ // {parse, formatTo} String deals with user input
646
+ parseString(value) {
647
+ const type = Array.isArray(value) ? this.type : this.type.replace('range', '');
648
+ return parseAsFormatAndType(value, this.format, type);
649
+ },
650
+
651
+ formatToString(value) {
652
+ const type = Array.isArray(value) ? this.type : this.type.replace('range', '');
653
+ return formatAsFormatAndType(value, this.format, type);
654
+ },
655
+
656
+ handleMouseEnter() {
657
+ if (this.readonly || this.pickerDisabled) return;
658
+ if (!this.valueIsEmpty && this.clearable) {
659
+ this.showClose = true;
660
+ }
661
+ },
662
+
663
+ handleChange() {
664
+ if (this.userInput) {
665
+ const value = this.parseString(this.displayValue);
666
+ if (value) {
667
+ this.picker.value = value;
668
+ if (this.isValidValue(value)) {
669
+ this.emitInput(value);
670
+ this.userInput = null;
671
+ }
672
+ }
673
+ }
674
+ if (this.userInput === '') {
675
+ this.emitInput(null);
676
+ this.emitChange(null);
677
+ this.userInput = null;
678
+ }
679
+ },
680
+
681
+ handleStartInput(event) {
682
+ if (this.userInput) {
683
+ this.userInput = [event.target.value, this.userInput[1]];
684
+ } else {
685
+ this.userInput = [event.target.value, null];
686
+ }
687
+ },
688
+
689
+ handleEndInput(event) {
690
+ if (this.userInput) {
691
+ this.userInput = [this.userInput[0], event.target.value];
692
+ } else {
693
+ this.userInput = [null, event.target.value];
694
+ }
695
+ },
696
+
697
+ handleStartChange(event) {
698
+ const value = this.parseString(this.userInput && this.userInput[0]);
699
+ if (value) {
700
+ this.userInput = [this.formatToString(value), this.displayValue[1]];
701
+ const newValue = [value, this.picker.value && this.picker.value[1]];
702
+ this.picker.value = newValue;
703
+ if (this.isValidValue(newValue)) {
704
+ this.emitInput(newValue);
705
+ this.userInput = null;
706
+ }
707
+ }
708
+ },
709
+
710
+ handleEndChange(event) {
711
+ const value = this.parseString(this.userInput && this.userInput[1]);
712
+ if (value) {
713
+ this.userInput = [this.displayValue[0], this.formatToString(value)];
714
+ const newValue = [this.picker.value && this.picker.value[0], value];
715
+ this.picker.value = newValue;
716
+ if (this.isValidValue(newValue)) {
717
+ this.emitInput(newValue);
718
+ this.userInput = null;
719
+ }
720
+ }
721
+ },
722
+
723
+ handleClickIcon(event) {
724
+ if (this.readonly || this.pickerDisabled) return;
725
+ if (this.showClose) {
726
+ this.valueOnOpen = this.value;
727
+ event.stopPropagation();
728
+ this.emitInput(null);
729
+ this.emitChange(null);
730
+ this.showClose = false;
731
+ if (this.picker && typeof this.picker.handleClear === 'function') {
732
+ this.picker.handleClear();
733
+ }
734
+ } else {
735
+ this.pickerVisible = !this.pickerVisible;
736
+ }
737
+ },
738
+
739
+ handleClose() {
740
+ if (!this.pickerVisible) return;
741
+ this.pickerVisible = false;
742
+
743
+ if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
744
+ // restore to former value
745
+ const oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
746
+ this.emitInput(oldValue);
747
+ }
748
+ },
749
+
750
+ handleFieldReset(initialValue) {
751
+ this.userInput = initialValue === '' ? null : initialValue;
752
+ },
753
+
754
+ handleFocus() {
755
+ const type = this.type;
756
+
757
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
758
+ this.pickerVisible = true;
759
+ }
760
+ this.$emit('focus', this);
761
+ },
762
+
763
+ handleKeydown(event) {
764
+ const keyCode = event.keyCode;
765
+
766
+ // ESC
767
+ if (keyCode === 27) {
768
+ this.pickerVisible = false;
769
+ event.stopPropagation();
770
+ return;
771
+ }
772
+
773
+ // Tab
774
+ if (keyCode === 9) {
775
+ if (!this.ranged) {
776
+ this.handleChange();
777
+ this.pickerVisible = this.picker.visible = false;
778
+ this.blur();
779
+ event.stopPropagation();
780
+ } else {
781
+ // user may change focus between two input
782
+ setTimeout(() => {
783
+ if (this.refInput.indexOf(document.activeElement) === -1) {
784
+ this.pickerVisible = false;
785
+ this.blur();
786
+ event.stopPropagation();
787
+ }
788
+ }, 0);
789
+ }
790
+ return;
791
+ }
792
+
793
+ // Enter
794
+ if (keyCode === 13) {
795
+ if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
796
+ this.handleChange();
797
+ this.pickerVisible = this.picker.visible = false;
798
+ this.blur();
799
+ }
800
+ event.stopPropagation();
801
+ return;
802
+ }
803
+
804
+ // if user is typing, do not let picker handle key input
805
+ if (this.userInput) {
806
+ event.stopPropagation();
807
+ return;
808
+ }
809
+
810
+ // delegate other keys to panel
811
+ if (this.picker && this.picker.handleKeydown) {
812
+ this.picker.handleKeydown(event);
813
+ }
814
+ },
815
+
816
+ handleRangeClick() {
817
+ const type = this.type;
818
+
819
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
820
+ this.pickerVisible = true;
821
+ }
822
+ this.$emit('focus', this);
823
+ },
824
+
825
+ hidePicker() {
826
+ if (this.picker) {
827
+ this.picker.resetView && this.picker.resetView();
828
+ this.pickerVisible = this.picker.visible = false;
829
+ this.destroyPopper();
830
+ }
831
+ },
832
+
833
+ showPicker() {
834
+ if (this.$isServer) return;
835
+ if (!this.picker) {
836
+ this.mountPicker();
837
+ }
838
+ this.pickerVisible = this.picker.visible = true;
839
+
840
+ this.updatePopper();
841
+
842
+ this.picker.value = this.parsedValue;
843
+ this.picker.resetView && this.picker.resetView();
844
+
845
+ this.$nextTick(() => {
846
+ this.picker.adjustSpinners && this.picker.adjustSpinners();
847
+ });
848
+ },
849
+
850
+ mountPicker() {
851
+ this.picker = new Vue(this.panel).$mount();
852
+ this.picker.defaultValue = this.defaultValue;
853
+ this.picker.defaultTime = this.defaultTime;
854
+ this.picker.popperClass = this.popperClass;
855
+ this.popperElm = this.picker.$el;
856
+ this.picker.width = this.reference.getBoundingClientRect().width;
857
+ this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
858
+ this.picker.selectionMode = this.selectionMode;
859
+ this.picker.unlinkPanels = this.unlinkPanels;
860
+ this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
861
+ this.$watch('format', (format) => {
862
+ this.picker.format = format;
863
+ });
864
+
865
+ const updateOptions = () => {
866
+ const options = this.pickerOptions;
867
+
868
+ if (options && options.selectableRange) {
869
+ let ranges = options.selectableRange;
870
+ const parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
871
+ const format = DEFAULT_FORMATS.timerange;
872
+
873
+ ranges = Array.isArray(ranges) ? ranges : [ranges];
874
+ this.picker.selectableRange = ranges.map(range => parser(range, format, this.rangeSeparator));
875
+ }
876
+
877
+ for (const option in options) {
878
+ if (options.hasOwnProperty(option) &&
879
+ // 忽略 time-picker 的该配置项
880
+ option !== 'selectableRange') {
881
+ this.picker[option] = options[option];
882
+ }
883
+ }
884
+
885
+ // main format must prevail over undocumented pickerOptions.format
886
+ if (this.format) {
887
+ this.picker.format = this.format;
888
+ }
889
+ };
890
+ updateOptions();
891
+ this.unwatchPickerOptions = this.$watch('pickerOptions', () => updateOptions(), { deep: true });
892
+ this.$el.appendChild(this.picker.$el);
893
+ this.picker.resetView && this.picker.resetView();
894
+
895
+ this.picker.$on('dodestroy', this.doDestroy);
896
+ this.picker.$on('pick', (date = '', visible = false) => {
897
+ this.userInput = null;
898
+ this.pickerVisible = this.picker.visible = visible;
899
+ this.emitInput(date);
900
+ this.picker.resetView && this.picker.resetView();
901
+ });
902
+
903
+ this.picker.$on('select-range', (start, end, pos) => {
904
+ if (this.refInput.length === 0) return;
905
+ if (!pos || pos === 'min') {
906
+ this.refInput[0].setSelectionRange(start, end);
907
+ this.refInput[0].focus();
908
+ } else if (pos === 'max') {
909
+ this.refInput[1].setSelectionRange(start, end);
910
+ this.refInput[1].focus();
911
+ }
912
+ });
913
+ },
914
+
915
+ unmountPicker() {
916
+ if (this.picker) {
917
+ this.picker.$destroy();
918
+ this.picker.$off();
919
+ if (typeof this.unwatchPickerOptions === 'function') {
920
+ this.unwatchPickerOptions();
921
+ }
922
+ this.picker.$el.parentNode.removeChild(this.picker.$el);
923
+ }
924
+ },
925
+
926
+ emitChange(val) {
927
+ // determine user real change only
928
+ if (!valueEquals(val, this.valueOnOpen)) {
929
+ this.$emit('change', val);
930
+ this.valueOnOpen = val;
931
+ if (this.validateEvent) {
932
+ this.dispatch('ElFormItem', 'el.form.change', val);
933
+ }
934
+ }
935
+ },
936
+
937
+ emitInput(val) {
938
+ const formatted = this.formatToValue(val);
939
+ if (!valueEquals(this.value, formatted)) {
940
+ this.$emit('input', formatted);
941
+ }
942
+ },
943
+
944
+ isValidValue(value) {
945
+ if (!this.picker) {
946
+ this.mountPicker();
947
+ }
948
+ if (this.picker.isValidValue) {
949
+ return value && this.picker.isValidValue(value);
950
+ } else {
951
+ return true;
952
+ }
953
+ }
954
+ }
413
955
  };
414
956
  </script>