@penggy/element-ui 2.4.11

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 (790) hide show
  1. package/CHANGELOG.en-US.md +748 -0
  2. package/CHANGELOG.es.md +756 -0
  3. package/CHANGELOG.zh-CN.md +748 -0
  4. package/LICENSE +21 -0
  5. package/README.md +237 -0
  6. package/lib/alert.js +343 -0
  7. package/lib/aside.js +277 -0
  8. package/lib/autocomplete.js +767 -0
  9. package/lib/badge.js +316 -0
  10. package/lib/breadcrumb-item.js +303 -0
  11. package/lib/breadcrumb.js +290 -0
  12. package/lib/button-group.js +267 -0
  13. package/lib/button.js +345 -0
  14. package/lib/card.js +280 -0
  15. package/lib/carousel-item.js +378 -0
  16. package/lib/carousel.js +532 -0
  17. package/lib/cascader.js +1338 -0
  18. package/lib/checkbox-button.js +446 -0
  19. package/lib/checkbox-group.js +310 -0
  20. package/lib/checkbox.js +481 -0
  21. package/lib/col.js +172 -0
  22. package/lib/collapse-item.js +404 -0
  23. package/lib/collapse.js +326 -0
  24. package/lib/color-picker.js +1826 -0
  25. package/lib/container.js +288 -0
  26. package/lib/date-picker.js +4396 -0
  27. package/lib/dialog.js +490 -0
  28. package/lib/directives/mousewheel.js +26 -0
  29. package/lib/directives/repeat-click.js +30 -0
  30. package/lib/dropdown-item.js +305 -0
  31. package/lib/dropdown-menu.js +330 -0
  32. package/lib/dropdown.js +623 -0
  33. package/lib/element-ui.common.js +32381 -0
  34. package/lib/footer.js +277 -0
  35. package/lib/form-item.js +610 -0
  36. package/lib/form.js +428 -0
  37. package/lib/header.js +277 -0
  38. package/lib/icon.js +270 -0
  39. package/lib/index.js +1 -0
  40. package/lib/input-number.js +590 -0
  41. package/lib/input.js +735 -0
  42. package/lib/loading.js +616 -0
  43. package/lib/locale/format.js +56 -0
  44. package/lib/locale/index.js +63 -0
  45. package/lib/locale/lang/af-ZA.js +112 -0
  46. package/lib/locale/lang/ar.js +111 -0
  47. package/lib/locale/lang/bg.js +112 -0
  48. package/lib/locale/lang/ca.js +111 -0
  49. package/lib/locale/lang/cs-CZ.js +114 -0
  50. package/lib/locale/lang/da.js +111 -0
  51. package/lib/locale/lang/de.js +113 -0
  52. package/lib/locale/lang/ee.js +112 -0
  53. package/lib/locale/lang/el.js +112 -0
  54. package/lib/locale/lang/en.js +112 -0
  55. package/lib/locale/lang/es.js +111 -0
  56. package/lib/locale/lang/eu.js +112 -0
  57. package/lib/locale/lang/fa.js +112 -0
  58. package/lib/locale/lang/fi.js +112 -0
  59. package/lib/locale/lang/fr.js +111 -0
  60. package/lib/locale/lang/he.js +112 -0
  61. package/lib/locale/lang/hu.js +111 -0
  62. package/lib/locale/lang/id.js +112 -0
  63. package/lib/locale/lang/it.js +111 -0
  64. package/lib/locale/lang/ja.js +112 -0
  65. package/lib/locale/lang/km.js +112 -0
  66. package/lib/locale/lang/ko.js +112 -0
  67. package/lib/locale/lang/ku.js +112 -0
  68. package/lib/locale/lang/kz.js +112 -0
  69. package/lib/locale/lang/lt.js +112 -0
  70. package/lib/locale/lang/lv.js +112 -0
  71. package/lib/locale/lang/mn.js +112 -0
  72. package/lib/locale/lang/nb-NO.js +111 -0
  73. package/lib/locale/lang/nl.js +112 -0
  74. package/lib/locale/lang/pl.js +112 -0
  75. package/lib/locale/lang/pt-br.js +112 -0
  76. package/lib/locale/lang/pt.js +112 -0
  77. package/lib/locale/lang/ro.js +112 -0
  78. package/lib/locale/lang/ru-RU.js +112 -0
  79. package/lib/locale/lang/sk.js +114 -0
  80. package/lib/locale/lang/sl.js +112 -0
  81. package/lib/locale/lang/sr.js +112 -0
  82. package/lib/locale/lang/sv-SE.js +112 -0
  83. package/lib/locale/lang/ta.js +111 -0
  84. package/lib/locale/lang/th.js +112 -0
  85. package/lib/locale/lang/tk.js +112 -0
  86. package/lib/locale/lang/tr-TR.js +112 -0
  87. package/lib/locale/lang/ua.js +112 -0
  88. package/lib/locale/lang/ug-CN.js +112 -0
  89. package/lib/locale/lang/vi.js +112 -0
  90. package/lib/locale/lang/zh-CN.js +112 -0
  91. package/lib/locale/lang/zh-TW.js +112 -0
  92. package/lib/main.js +269 -0
  93. package/lib/menu-item-group.js +302 -0
  94. package/lib/menu-item.js +444 -0
  95. package/lib/menu.js +915 -0
  96. package/lib/message-box.js +917 -0
  97. package/lib/message.js +483 -0
  98. package/lib/mixins/emitter.js +36 -0
  99. package/lib/mixins/focus.js +15 -0
  100. package/lib/mixins/locale.js +17 -0
  101. package/lib/mixins/migrating.js +64 -0
  102. package/lib/notification.js +539 -0
  103. package/lib/option-group.js +327 -0
  104. package/lib/option.js +443 -0
  105. package/lib/pagination.js +1000 -0
  106. package/lib/popover.js +545 -0
  107. package/lib/progress.js +406 -0
  108. package/lib/radio-button.js +389 -0
  109. package/lib/radio-group.js +370 -0
  110. package/lib/radio.js +402 -0
  111. package/lib/rate.js +607 -0
  112. package/lib/row.js +144 -0
  113. package/lib/scrollbar.js +441 -0
  114. package/lib/select.js +1691 -0
  115. package/lib/slider.js +938 -0
  116. package/lib/spinner.js +284 -0
  117. package/lib/step.js +439 -0
  118. package/lib/steps.js +338 -0
  119. package/lib/submenu.js +689 -0
  120. package/lib/switch.js +445 -0
  121. package/lib/tab-pane.js +316 -0
  122. package/lib/table-column.js +670 -0
  123. package/lib/table.js +3941 -0
  124. package/lib/tabs.js +960 -0
  125. package/lib/tag.js +292 -0
  126. package/lib/theme-chalk/alert.css +1 -0
  127. package/lib/theme-chalk/aside.css +1 -0
  128. package/lib/theme-chalk/autocomplete.css +1 -0
  129. package/lib/theme-chalk/badge.css +1 -0
  130. package/lib/theme-chalk/base.css +1 -0
  131. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  132. package/lib/theme-chalk/breadcrumb.css +1 -0
  133. package/lib/theme-chalk/button-group.css +0 -0
  134. package/lib/theme-chalk/button.css +1 -0
  135. package/lib/theme-chalk/card.css +1 -0
  136. package/lib/theme-chalk/carousel-item.css +1 -0
  137. package/lib/theme-chalk/carousel.css +1 -0
  138. package/lib/theme-chalk/cascader.css +1 -0
  139. package/lib/theme-chalk/checkbox-button.css +0 -0
  140. package/lib/theme-chalk/checkbox-group.css +0 -0
  141. package/lib/theme-chalk/checkbox.css +1 -0
  142. package/lib/theme-chalk/col.css +1 -0
  143. package/lib/theme-chalk/collapse-item.css +0 -0
  144. package/lib/theme-chalk/collapse.css +1 -0
  145. package/lib/theme-chalk/color-picker.css +1 -0
  146. package/lib/theme-chalk/container.css +1 -0
  147. package/lib/theme-chalk/date-picker.css +1 -0
  148. package/lib/theme-chalk/dialog.css +1 -0
  149. package/lib/theme-chalk/display.css +1 -0
  150. package/lib/theme-chalk/dropdown-item.css +0 -0
  151. package/lib/theme-chalk/dropdown-menu.css +0 -0
  152. package/lib/theme-chalk/dropdown.css +1 -0
  153. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  154. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  155. package/lib/theme-chalk/footer.css +1 -0
  156. package/lib/theme-chalk/form-item.css +0 -0
  157. package/lib/theme-chalk/form.css +1 -0
  158. package/lib/theme-chalk/header.css +1 -0
  159. package/lib/theme-chalk/icon.css +1 -0
  160. package/lib/theme-chalk/index.css +1 -0
  161. package/lib/theme-chalk/input-number.css +1 -0
  162. package/lib/theme-chalk/input.css +1 -0
  163. package/lib/theme-chalk/loading.css +1 -0
  164. package/lib/theme-chalk/main.css +1 -0
  165. package/lib/theme-chalk/menu-item-group.css +0 -0
  166. package/lib/theme-chalk/menu-item.css +0 -0
  167. package/lib/theme-chalk/menu.css +1 -0
  168. package/lib/theme-chalk/message-box.css +1 -0
  169. package/lib/theme-chalk/message.css +1 -0
  170. package/lib/theme-chalk/notification.css +1 -0
  171. package/lib/theme-chalk/option-group.css +1 -0
  172. package/lib/theme-chalk/option.css +1 -0
  173. package/lib/theme-chalk/pagination.css +1 -0
  174. package/lib/theme-chalk/popover.css +1 -0
  175. package/lib/theme-chalk/popper.css +1 -0
  176. package/lib/theme-chalk/progress.css +1 -0
  177. package/lib/theme-chalk/radio-button.css +1 -0
  178. package/lib/theme-chalk/radio-group.css +1 -0
  179. package/lib/theme-chalk/radio.css +1 -0
  180. package/lib/theme-chalk/rate.css +1 -0
  181. package/lib/theme-chalk/reset.css +1 -0
  182. package/lib/theme-chalk/row.css +1 -0
  183. package/lib/theme-chalk/scrollbar.css +1 -0
  184. package/lib/theme-chalk/select-dropdown.css +1 -0
  185. package/lib/theme-chalk/select.css +1 -0
  186. package/lib/theme-chalk/slider.css +1 -0
  187. package/lib/theme-chalk/spinner.css +1 -0
  188. package/lib/theme-chalk/step.css +1 -0
  189. package/lib/theme-chalk/steps.css +1 -0
  190. package/lib/theme-chalk/submenu.css +0 -0
  191. package/lib/theme-chalk/switch.css +1 -0
  192. package/lib/theme-chalk/tab-pane.css +0 -0
  193. package/lib/theme-chalk/table-column.css +1 -0
  194. package/lib/theme-chalk/table.css +1 -0
  195. package/lib/theme-chalk/tabs.css +1 -0
  196. package/lib/theme-chalk/tag.css +1 -0
  197. package/lib/theme-chalk/time-picker.css +1 -0
  198. package/lib/theme-chalk/time-select.css +1 -0
  199. package/lib/theme-chalk/tooltip.css +1 -0
  200. package/lib/theme-chalk/transfer.css +1 -0
  201. package/lib/theme-chalk/tree.css +1 -0
  202. package/lib/theme-chalk/upload.css +1 -0
  203. package/lib/time-picker.js +2553 -0
  204. package/lib/time-select.js +1839 -0
  205. package/lib/tooltip.js +397 -0
  206. package/lib/transfer.js +883 -0
  207. package/lib/transitions/collapse-transition.js +91 -0
  208. package/lib/tree.js +2138 -0
  209. package/lib/umd/locale/af-ZA.js +128 -0
  210. package/lib/umd/locale/ar.js +127 -0
  211. package/lib/umd/locale/bg.js +128 -0
  212. package/lib/umd/locale/ca.js +127 -0
  213. package/lib/umd/locale/cs-CZ.js +130 -0
  214. package/lib/umd/locale/da.js +127 -0
  215. package/lib/umd/locale/de.js +129 -0
  216. package/lib/umd/locale/ee.js +128 -0
  217. package/lib/umd/locale/el.js +128 -0
  218. package/lib/umd/locale/en.js +128 -0
  219. package/lib/umd/locale/es.js +127 -0
  220. package/lib/umd/locale/eu.js +128 -0
  221. package/lib/umd/locale/fa.js +128 -0
  222. package/lib/umd/locale/fi.js +128 -0
  223. package/lib/umd/locale/fr.js +127 -0
  224. package/lib/umd/locale/he.js +128 -0
  225. package/lib/umd/locale/hu.js +127 -0
  226. package/lib/umd/locale/id.js +128 -0
  227. package/lib/umd/locale/it.js +127 -0
  228. package/lib/umd/locale/ja.js +128 -0
  229. package/lib/umd/locale/km.js +128 -0
  230. package/lib/umd/locale/ko.js +128 -0
  231. package/lib/umd/locale/ku.js +128 -0
  232. package/lib/umd/locale/kz.js +128 -0
  233. package/lib/umd/locale/lt.js +128 -0
  234. package/lib/umd/locale/lv.js +128 -0
  235. package/lib/umd/locale/mn.js +128 -0
  236. package/lib/umd/locale/nb-NO.js +127 -0
  237. package/lib/umd/locale/nl.js +128 -0
  238. package/lib/umd/locale/pl.js +128 -0
  239. package/lib/umd/locale/pt-br.js +128 -0
  240. package/lib/umd/locale/pt.js +128 -0
  241. package/lib/umd/locale/ro.js +128 -0
  242. package/lib/umd/locale/ru-RU.js +128 -0
  243. package/lib/umd/locale/sk.js +130 -0
  244. package/lib/umd/locale/sl.js +128 -0
  245. package/lib/umd/locale/sr.js +128 -0
  246. package/lib/umd/locale/sv-SE.js +128 -0
  247. package/lib/umd/locale/ta.js +127 -0
  248. package/lib/umd/locale/th.js +128 -0
  249. package/lib/umd/locale/tk.js +128 -0
  250. package/lib/umd/locale/tr-TR.js +128 -0
  251. package/lib/umd/locale/ua.js +128 -0
  252. package/lib/umd/locale/ug-CN.js +128 -0
  253. package/lib/umd/locale/vi.js +128 -0
  254. package/lib/umd/locale/zh-CN.js +128 -0
  255. package/lib/umd/locale/zh-TW.js +128 -0
  256. package/lib/upload.js +1301 -0
  257. package/lib/utils/after-leave.js +35 -0
  258. package/lib/utils/aria-dialog.js +104 -0
  259. package/lib/utils/aria-utils.js +125 -0
  260. package/lib/utils/clickoutside.js +79 -0
  261. package/lib/utils/date.js +345 -0
  262. package/lib/utils/dom.js +188 -0
  263. package/lib/utils/menu/aria-menubar.js +24 -0
  264. package/lib/utils/menu/aria-menuitem.js +62 -0
  265. package/lib/utils/menu/aria-submenu.js +69 -0
  266. package/lib/utils/merge.js +21 -0
  267. package/lib/utils/popper.js +1261 -0
  268. package/lib/utils/popup/index.js +241 -0
  269. package/lib/utils/popup/popup-manager.js +205 -0
  270. package/lib/utils/resize-event.js +57 -0
  271. package/lib/utils/scroll-into-view.js +38 -0
  272. package/lib/utils/scrollbar-width.js +39 -0
  273. package/lib/utils/shared.js +12 -0
  274. package/lib/utils/util.js +138 -0
  275. package/lib/utils/vdom.js +20 -0
  276. package/lib/utils/vue-popper.js +204 -0
  277. package/package.json +143 -0
  278. package/packages/alert/index.js +8 -0
  279. package/packages/alert/src/main.vue +88 -0
  280. package/packages/aside/index.js +8 -0
  281. package/packages/aside/src/main.vue +20 -0
  282. package/packages/autocomplete/index.js +8 -0
  283. package/packages/autocomplete/src/autocomplete-suggestions.vue +76 -0
  284. package/packages/autocomplete/src/autocomplete.vue +269 -0
  285. package/packages/badge/index.js +8 -0
  286. package/packages/badge/src/main.vue +53 -0
  287. package/packages/breadcrumb/index.js +8 -0
  288. package/packages/breadcrumb/src/breadcrumb-item.vue +41 -0
  289. package/packages/breadcrumb/src/breadcrumb.vue +34 -0
  290. package/packages/breadcrumb-item/index.js +8 -0
  291. package/packages/button/index.js +8 -0
  292. package/packages/button/src/button-group.vue +10 -0
  293. package/packages/button/src/button.vue +78 -0
  294. package/packages/button-group/index.js +8 -0
  295. package/packages/card/index.js +8 -0
  296. package/packages/card/src/main.vue +23 -0
  297. package/packages/carousel/index.js +8 -0
  298. package/packages/carousel/src/item.vue +114 -0
  299. package/packages/carousel/src/main.vue +262 -0
  300. package/packages/carousel-item/index.js +8 -0
  301. package/packages/cascader/index.js +8 -0
  302. package/packages/cascader/src/main.vue +456 -0
  303. package/packages/cascader/src/menu.vue +376 -0
  304. package/packages/checkbox/index.js +8 -0
  305. package/packages/checkbox/src/checkbox-button.vue +191 -0
  306. package/packages/checkbox/src/checkbox-group.vue +48 -0
  307. package/packages/checkbox/src/checkbox.vue +219 -0
  308. package/packages/checkbox-button/index.js +8 -0
  309. package/packages/checkbox-group/index.js +8 -0
  310. package/packages/col/index.js +9 -0
  311. package/packages/col/src/col.js +71 -0
  312. package/packages/collapse/index.js +9 -0
  313. package/packages/collapse/src/collapse-item.vue +113 -0
  314. package/packages/collapse/src/collapse.vue +73 -0
  315. package/packages/collapse-item/index.js +8 -0
  316. package/packages/color-picker/index.js +8 -0
  317. package/packages/color-picker/src/color.js +316 -0
  318. package/packages/color-picker/src/components/alpha-slider.vue +132 -0
  319. package/packages/color-picker/src/components/hue-slider.vue +123 -0
  320. package/packages/color-picker/src/components/picker-dropdown.vue +121 -0
  321. package/packages/color-picker/src/components/predefine.vue +61 -0
  322. package/packages/color-picker/src/components/sv-panel.vue +100 -0
  323. package/packages/color-picker/src/draggable.js +36 -0
  324. package/packages/color-picker/src/main.vue +188 -0
  325. package/packages/container/index.js +8 -0
  326. package/packages/container/src/main.vue +33 -0
  327. package/packages/date-picker/index.js +8 -0
  328. package/packages/date-picker/src/basic/date-table.vue +437 -0
  329. package/packages/date-picker/src/basic/month-table.vue +105 -0
  330. package/packages/date-picker/src/basic/time-spinner.vue +301 -0
  331. package/packages/date-picker/src/basic/year-table.vue +101 -0
  332. package/packages/date-picker/src/panel/date-range.vue +640 -0
  333. package/packages/date-picker/src/panel/date.vue +579 -0
  334. package/packages/date-picker/src/panel/time-range.vue +248 -0
  335. package/packages/date-picker/src/panel/time-select.vue +177 -0
  336. package/packages/date-picker/src/panel/time.vue +186 -0
  337. package/packages/date-picker/src/picker/date-picker.js +40 -0
  338. package/packages/date-picker/src/picker/time-picker.js +39 -0
  339. package/packages/date-picker/src/picker/time-select.js +21 -0
  340. package/packages/date-picker/src/picker.vue +924 -0
  341. package/packages/date-picker/src/util/index.js +273 -0
  342. package/packages/dialog/index.js +8 -0
  343. package/packages/dialog/src/component.vue +201 -0
  344. package/packages/dropdown/index.js +8 -0
  345. package/packages/dropdown/src/dropdown-item.vue +35 -0
  346. package/packages/dropdown/src/dropdown-menu.vue +60 -0
  347. package/packages/dropdown/src/dropdown.vue +271 -0
  348. package/packages/dropdown-item/index.js +8 -0
  349. package/packages/dropdown-menu/index.js +8 -0
  350. package/packages/footer/index.js +8 -0
  351. package/packages/footer/src/main.vue +20 -0
  352. package/packages/form/index.js +8 -0
  353. package/packages/form/src/form-item.vue +290 -0
  354. package/packages/form/src/form.vue +148 -0
  355. package/packages/form-item/index.js +8 -0
  356. package/packages/header/index.js +8 -0
  357. package/packages/header/src/main.vue +20 -0
  358. package/packages/icon/index.js +8 -0
  359. package/packages/icon/src/icon.vue +13 -0
  360. package/packages/input/index.js +8 -0
  361. package/packages/input/src/calcTextareaHeight.js +104 -0
  362. package/packages/input/src/input.vue +349 -0
  363. package/packages/input-number/index.js +8 -0
  364. package/packages/input-number/src/input-number.vue +255 -0
  365. package/packages/loading/index.js +11 -0
  366. package/packages/loading/src/directive.js +128 -0
  367. package/packages/loading/src/index.js +106 -0
  368. package/packages/loading/src/loading.vue +41 -0
  369. package/packages/main/index.js +8 -0
  370. package/packages/main/src/main.vue +12 -0
  371. package/packages/menu/index.js +8 -0
  372. package/packages/menu/src/menu-item-group.vue +45 -0
  373. package/packages/menu/src/menu-item.vue +112 -0
  374. package/packages/menu/src/menu-mixin.js +44 -0
  375. package/packages/menu/src/menu.vue +311 -0
  376. package/packages/menu/src/submenu.vue +335 -0
  377. package/packages/menu-item/index.js +8 -0
  378. package/packages/menu-item-group/index.js +8 -0
  379. package/packages/message/index.js +2 -0
  380. package/packages/message/src/main.js +72 -0
  381. package/packages/message/src/main.vue +112 -0
  382. package/packages/message-box/index.js +2 -0
  383. package/packages/message-box/src/main.js +216 -0
  384. package/packages/message-box/src/main.vue +327 -0
  385. package/packages/notification/index.js +2 -0
  386. package/packages/notification/src/main.js +93 -0
  387. package/packages/notification/src/main.vue +152 -0
  388. package/packages/option/index.js +8 -0
  389. package/packages/option-group/index.js +8 -0
  390. package/packages/pagination/index.js +8 -0
  391. package/packages/pagination/src/pager.vue +163 -0
  392. package/packages/pagination/src/pagination.js +430 -0
  393. package/packages/popover/index.js +14 -0
  394. package/packages/popover/src/directive.js +20 -0
  395. package/packages/popover/src/main.vue +207 -0
  396. package/packages/progress/index.js +8 -0
  397. package/packages/progress/src/progress.vue +138 -0
  398. package/packages/radio/index.js +8 -0
  399. package/packages/radio/src/radio-button.vue +114 -0
  400. package/packages/radio/src/radio-group.vue +100 -0
  401. package/packages/radio/src/radio.vue +126 -0
  402. package/packages/radio-button/index.js +8 -0
  403. package/packages/radio-group/index.js +8 -0
  404. package/packages/rate/index.js +8 -0
  405. package/packages/rate/src/main.vue +350 -0
  406. package/packages/row/index.js +9 -0
  407. package/packages/row/src/row.js +47 -0
  408. package/packages/scrollbar/index.js +8 -0
  409. package/packages/scrollbar/src/bar.js +88 -0
  410. package/packages/scrollbar/src/main.js +130 -0
  411. package/packages/scrollbar/src/util.js +34 -0
  412. package/packages/select/index.js +8 -0
  413. package/packages/select/src/navigation-mixin.js +54 -0
  414. package/packages/select/src/option-group.vue +60 -0
  415. package/packages/select/src/option.vue +159 -0
  416. package/packages/select/src/select-dropdown.vue +74 -0
  417. package/packages/select/src/select.vue +878 -0
  418. package/packages/slider/index.js +8 -0
  419. package/packages/slider/src/button.vue +235 -0
  420. package/packages/slider/src/main.vue +385 -0
  421. package/packages/spinner/index.js +8 -0
  422. package/packages/spinner/src/spinner.vue +27 -0
  423. package/packages/step/index.js +8 -0
  424. package/packages/steps/README.md +69 -0
  425. package/packages/steps/index.js +8 -0
  426. package/packages/steps/src/step.vue +180 -0
  427. package/packages/steps/src/steps.vue +68 -0
  428. package/packages/submenu/index.js +8 -0
  429. package/packages/switch/index.js +9 -0
  430. package/packages/switch/src/component.vue +163 -0
  431. package/packages/tab-pane/index.js +8 -0
  432. package/packages/table/index.js +8 -0
  433. package/packages/table/src/dropdown.js +28 -0
  434. package/packages/table/src/filter-panel.vue +203 -0
  435. package/packages/table/src/layout-observer.js +68 -0
  436. package/packages/table/src/table-body.js +392 -0
  437. package/packages/table/src/table-column.js +462 -0
  438. package/packages/table/src/table-footer.js +147 -0
  439. package/packages/table/src/table-header.js +522 -0
  440. package/packages/table/src/table-layout.js +231 -0
  441. package/packages/table/src/table-store.js +657 -0
  442. package/packages/table/src/table.vue +660 -0
  443. package/packages/table/src/util.js +122 -0
  444. package/packages/table-column/index.js +8 -0
  445. package/packages/tabs/index.js +8 -0
  446. package/packages/tabs/src/tab-bar.vue +57 -0
  447. package/packages/tabs/src/tab-nav.vue +280 -0
  448. package/packages/tabs/src/tab-pane.vue +58 -0
  449. package/packages/tabs/src/tabs.vue +185 -0
  450. package/packages/tag/index.js +8 -0
  451. package/packages/tag/src/tag.vue +39 -0
  452. package/packages/theme-chalk/README.md +33 -0
  453. package/packages/theme-chalk/lib/alert.css +1 -0
  454. package/packages/theme-chalk/lib/aside.css +1 -0
  455. package/packages/theme-chalk/lib/autocomplete.css +1 -0
  456. package/packages/theme-chalk/lib/badge.css +1 -0
  457. package/packages/theme-chalk/lib/base.css +1 -0
  458. package/packages/theme-chalk/lib/breadcrumb-item.css +0 -0
  459. package/packages/theme-chalk/lib/breadcrumb.css +1 -0
  460. package/packages/theme-chalk/lib/button-group.css +0 -0
  461. package/packages/theme-chalk/lib/button.css +1 -0
  462. package/packages/theme-chalk/lib/card.css +1 -0
  463. package/packages/theme-chalk/lib/carousel-item.css +1 -0
  464. package/packages/theme-chalk/lib/carousel.css +1 -0
  465. package/packages/theme-chalk/lib/cascader.css +1 -0
  466. package/packages/theme-chalk/lib/checkbox-button.css +0 -0
  467. package/packages/theme-chalk/lib/checkbox-group.css +0 -0
  468. package/packages/theme-chalk/lib/checkbox.css +1 -0
  469. package/packages/theme-chalk/lib/col.css +1 -0
  470. package/packages/theme-chalk/lib/collapse-item.css +0 -0
  471. package/packages/theme-chalk/lib/collapse.css +1 -0
  472. package/packages/theme-chalk/lib/color-picker.css +1 -0
  473. package/packages/theme-chalk/lib/container.css +1 -0
  474. package/packages/theme-chalk/lib/date-picker.css +1 -0
  475. package/packages/theme-chalk/lib/dialog.css +1 -0
  476. package/packages/theme-chalk/lib/display.css +1 -0
  477. package/packages/theme-chalk/lib/dropdown-item.css +0 -0
  478. package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
  479. package/packages/theme-chalk/lib/dropdown.css +1 -0
  480. package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
  481. package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
  482. package/packages/theme-chalk/lib/footer.css +1 -0
  483. package/packages/theme-chalk/lib/form-item.css +0 -0
  484. package/packages/theme-chalk/lib/form.css +1 -0
  485. package/packages/theme-chalk/lib/header.css +1 -0
  486. package/packages/theme-chalk/lib/icon.css +1 -0
  487. package/packages/theme-chalk/lib/index.css +1 -0
  488. package/packages/theme-chalk/lib/input-number.css +1 -0
  489. package/packages/theme-chalk/lib/input.css +1 -0
  490. package/packages/theme-chalk/lib/loading.css +1 -0
  491. package/packages/theme-chalk/lib/main.css +1 -0
  492. package/packages/theme-chalk/lib/menu-item-group.css +0 -0
  493. package/packages/theme-chalk/lib/menu-item.css +0 -0
  494. package/packages/theme-chalk/lib/menu.css +1 -0
  495. package/packages/theme-chalk/lib/message-box.css +1 -0
  496. package/packages/theme-chalk/lib/message.css +1 -0
  497. package/packages/theme-chalk/lib/notification.css +1 -0
  498. package/packages/theme-chalk/lib/option-group.css +1 -0
  499. package/packages/theme-chalk/lib/option.css +1 -0
  500. package/packages/theme-chalk/lib/pagination.css +1 -0
  501. package/packages/theme-chalk/lib/popover.css +1 -0
  502. package/packages/theme-chalk/lib/popper.css +1 -0
  503. package/packages/theme-chalk/lib/progress.css +1 -0
  504. package/packages/theme-chalk/lib/radio-button.css +1 -0
  505. package/packages/theme-chalk/lib/radio-group.css +1 -0
  506. package/packages/theme-chalk/lib/radio.css +1 -0
  507. package/packages/theme-chalk/lib/rate.css +1 -0
  508. package/packages/theme-chalk/lib/reset.css +1 -0
  509. package/packages/theme-chalk/lib/row.css +1 -0
  510. package/packages/theme-chalk/lib/scrollbar.css +1 -0
  511. package/packages/theme-chalk/lib/select-dropdown.css +1 -0
  512. package/packages/theme-chalk/lib/select.css +1 -0
  513. package/packages/theme-chalk/lib/slider.css +1 -0
  514. package/packages/theme-chalk/lib/spinner.css +1 -0
  515. package/packages/theme-chalk/lib/step.css +1 -0
  516. package/packages/theme-chalk/lib/steps.css +1 -0
  517. package/packages/theme-chalk/lib/submenu.css +0 -0
  518. package/packages/theme-chalk/lib/switch.css +1 -0
  519. package/packages/theme-chalk/lib/tab-pane.css +0 -0
  520. package/packages/theme-chalk/lib/table-column.css +1 -0
  521. package/packages/theme-chalk/lib/table.css +1 -0
  522. package/packages/theme-chalk/lib/tabs.css +1 -0
  523. package/packages/theme-chalk/lib/tag.css +1 -0
  524. package/packages/theme-chalk/lib/time-picker.css +1 -0
  525. package/packages/theme-chalk/lib/time-select.css +1 -0
  526. package/packages/theme-chalk/lib/tooltip.css +1 -0
  527. package/packages/theme-chalk/lib/transfer.css +1 -0
  528. package/packages/theme-chalk/lib/tree.css +1 -0
  529. package/packages/theme-chalk/lib/upload.css +1 -0
  530. package/packages/theme-chalk/package.json +35 -0
  531. package/packages/theme-chalk/src/alert.scss +105 -0
  532. package/packages/theme-chalk/src/aside.scss +7 -0
  533. package/packages/theme-chalk/src/autocomplete.scss +82 -0
  534. package/packages/theme-chalk/src/badge.scss +57 -0
  535. package/packages/theme-chalk/src/base.scss +2 -0
  536. package/packages/theme-chalk/src/breadcrumb-item.scss +0 -0
  537. package/packages/theme-chalk/src/breadcrumb.scss +55 -0
  538. package/packages/theme-chalk/src/button-group.scss +0 -0
  539. package/packages/theme-chalk/src/button.scss +260 -0
  540. package/packages/theme-chalk/src/card.scss +32 -0
  541. package/packages/theme-chalk/src/carousel-item.scss +50 -0
  542. package/packages/theme-chalk/src/carousel.scss +134 -0
  543. package/packages/theme-chalk/src/cascader.scss +180 -0
  544. package/packages/theme-chalk/src/checkbox-button.scss +0 -0
  545. package/packages/theme-chalk/src/checkbox-group.scss +0 -0
  546. package/packages/theme-chalk/src/checkbox.scss +358 -0
  547. package/packages/theme-chalk/src/col.scss +156 -0
  548. package/packages/theme-chalk/src/collapse-item.scss +0 -0
  549. package/packages/theme-chalk/src/collapse.scss +57 -0
  550. package/packages/theme-chalk/src/color-picker.scss +384 -0
  551. package/packages/theme-chalk/src/common/popup.scss +41 -0
  552. package/packages/theme-chalk/src/common/transition.scss +99 -0
  553. package/packages/theme-chalk/src/common/var.scss +713 -0
  554. package/packages/theme-chalk/src/container.scss +14 -0
  555. package/packages/theme-chalk/src/date-picker/date-picker.scss +97 -0
  556. package/packages/theme-chalk/src/date-picker/date-range-picker.scss +104 -0
  557. package/packages/theme-chalk/src/date-picker/date-table.scss +151 -0
  558. package/packages/theme-chalk/src/date-picker/month-table.scss +40 -0
  559. package/packages/theme-chalk/src/date-picker/picker-panel.scss +117 -0
  560. package/packages/theme-chalk/src/date-picker/picker.scss +190 -0
  561. package/packages/theme-chalk/src/date-picker/time-picker.scss +85 -0
  562. package/packages/theme-chalk/src/date-picker/time-range-picker.scss +31 -0
  563. package/packages/theme-chalk/src/date-picker/time-spinner.scss +110 -0
  564. package/packages/theme-chalk/src/date-picker/year-table.scss +44 -0
  565. package/packages/theme-chalk/src/date-picker.scss +12 -0
  566. package/packages/theme-chalk/src/dialog.scss +122 -0
  567. package/packages/theme-chalk/src/display.scss +12 -0
  568. package/packages/theme-chalk/src/dropdown-item.scss +0 -0
  569. package/packages/theme-chalk/src/dropdown-menu.scss +0 -0
  570. package/packages/theme-chalk/src/dropdown.scss +169 -0
  571. package/packages/theme-chalk/src/fonts/element-icons.ttf +0 -0
  572. package/packages/theme-chalk/src/fonts/element-icons.woff +0 -0
  573. package/packages/theme-chalk/src/footer.scss +8 -0
  574. package/packages/theme-chalk/src/form-item.scss +0 -0
  575. package/packages/theme-chalk/src/form.scss +174 -0
  576. package/packages/theme-chalk/src/header.scss +8 -0
  577. package/packages/theme-chalk/src/icon.scss +186 -0
  578. package/packages/theme-chalk/src/index.scss +67 -0
  579. package/packages/theme-chalk/src/input-number.scss +180 -0
  580. package/packages/theme-chalk/src/input.scss +310 -0
  581. package/packages/theme-chalk/src/loading.scss +96 -0
  582. package/packages/theme-chalk/src/main.scss +12 -0
  583. package/packages/theme-chalk/src/menu-item-group.scss +0 -0
  584. package/packages/theme-chalk/src/menu-item.scss +0 -0
  585. package/packages/theme-chalk/src/menu.scss +289 -0
  586. package/packages/theme-chalk/src/message-box.scss +223 -0
  587. package/packages/theme-chalk/src/message.scss +120 -0
  588. package/packages/theme-chalk/src/mixins/_button.scss +81 -0
  589. package/packages/theme-chalk/src/mixins/config.scss +4 -0
  590. package/packages/theme-chalk/src/mixins/function.scss +44 -0
  591. package/packages/theme-chalk/src/mixins/mixins.scss +190 -0
  592. package/packages/theme-chalk/src/mixins/utils.scss +39 -0
  593. package/packages/theme-chalk/src/notification.scss +98 -0
  594. package/packages/theme-chalk/src/option-group.scss +42 -0
  595. package/packages/theme-chalk/src/option.scss +36 -0
  596. package/packages/theme-chalk/src/pagination.scss +295 -0
  597. package/packages/theme-chalk/src/popover.scss +39 -0
  598. package/packages/theme-chalk/src/popper.scss +101 -0
  599. package/packages/theme-chalk/src/progress.scss +130 -0
  600. package/packages/theme-chalk/src/radio-button.scss +113 -0
  601. package/packages/theme-chalk/src/radio-group.scss +9 -0
  602. package/packages/theme-chalk/src/radio.scss +198 -0
  603. package/packages/theme-chalk/src/rate.scss +49 -0
  604. package/packages/theme-chalk/src/reset.scss +79 -0
  605. package/packages/theme-chalk/src/row.scss +39 -0
  606. package/packages/theme-chalk/src/scrollbar.scss +71 -0
  607. package/packages/theme-chalk/src/select-dropdown.scss +59 -0
  608. package/packages/theme-chalk/src/select.scss +148 -0
  609. package/packages/theme-chalk/src/slider.scss +228 -0
  610. package/packages/theme-chalk/src/spinner.scss +44 -0
  611. package/packages/theme-chalk/src/step.scss +317 -0
  612. package/packages/theme-chalk/src/steps.scss +20 -0
  613. package/packages/theme-chalk/src/submenu.scss +0 -0
  614. package/packages/theme-chalk/src/switch.scss +116 -0
  615. package/packages/theme-chalk/src/tab-pane.scss +0 -0
  616. package/packages/theme-chalk/src/table-column.scss +97 -0
  617. package/packages/theme-chalk/src/table.scss +552 -0
  618. package/packages/theme-chalk/src/tabs.scss +587 -0
  619. package/packages/theme-chalk/src/tag.scss +146 -0
  620. package/packages/theme-chalk/src/time-picker.scss +8 -0
  621. package/packages/theme-chalk/src/time-select.scss +37 -0
  622. package/packages/theme-chalk/src/tooltip.scss +141 -0
  623. package/packages/theme-chalk/src/transfer.scss +227 -0
  624. package/packages/theme-chalk/src/tree.scss +122 -0
  625. package/packages/theme-chalk/src/upload.scss +602 -0
  626. package/packages/time-picker/index.js +8 -0
  627. package/packages/time-select/index.js +8 -0
  628. package/packages/tooltip/index.js +8 -0
  629. package/packages/tooltip/src/main.js +216 -0
  630. package/packages/transfer/index.js +8 -0
  631. package/packages/transfer/src/main.vue +231 -0
  632. package/packages/transfer/src/transfer-panel.vue +251 -0
  633. package/packages/tree/index.js +8 -0
  634. package/packages/tree/src/model/node.js +481 -0
  635. package/packages/tree/src/model/tree-store.js +333 -0
  636. package/packages/tree/src/model/util.js +27 -0
  637. package/packages/tree/src/tree-node.vue +277 -0
  638. package/packages/tree/src/tree.vue +495 -0
  639. package/packages/upload/index.js +8 -0
  640. package/packages/upload/src/ajax.js +85 -0
  641. package/packages/upload/src/index.vue +315 -0
  642. package/packages/upload/src/upload-dragger.vue +70 -0
  643. package/packages/upload/src/upload-list.vue +103 -0
  644. package/packages/upload/src/upload.vue +211 -0
  645. package/src/directives/mousewheel.js +18 -0
  646. package/src/directives/repeat-click.js +24 -0
  647. package/src/index.js +251 -0
  648. package/src/locale/format.js +46 -0
  649. package/src/locale/index.js +48 -0
  650. package/src/locale/lang/af-ZA.js +109 -0
  651. package/src/locale/lang/ar.js +108 -0
  652. package/src/locale/lang/bg.js +109 -0
  653. package/src/locale/lang/ca.js +108 -0
  654. package/src/locale/lang/cs-CZ.js +111 -0
  655. package/src/locale/lang/da.js +108 -0
  656. package/src/locale/lang/de.js +110 -0
  657. package/src/locale/lang/ee.js +109 -0
  658. package/src/locale/lang/el.js +109 -0
  659. package/src/locale/lang/en.js +109 -0
  660. package/src/locale/lang/es.js +108 -0
  661. package/src/locale/lang/eu.js +109 -0
  662. package/src/locale/lang/fa.js +109 -0
  663. package/src/locale/lang/fi.js +109 -0
  664. package/src/locale/lang/fr.js +108 -0
  665. package/src/locale/lang/he.js +109 -0
  666. package/src/locale/lang/hu.js +108 -0
  667. package/src/locale/lang/id.js +109 -0
  668. package/src/locale/lang/it.js +108 -0
  669. package/src/locale/lang/ja.js +109 -0
  670. package/src/locale/lang/km.js +109 -0
  671. package/src/locale/lang/ko.js +109 -0
  672. package/src/locale/lang/ku.js +109 -0
  673. package/src/locale/lang/kz.js +109 -0
  674. package/src/locale/lang/lt.js +109 -0
  675. package/src/locale/lang/lv.js +109 -0
  676. package/src/locale/lang/mn.js +109 -0
  677. package/src/locale/lang/nb-NO.js +108 -0
  678. package/src/locale/lang/nl.js +109 -0
  679. package/src/locale/lang/pl.js +109 -0
  680. package/src/locale/lang/pt-br.js +109 -0
  681. package/src/locale/lang/pt.js +109 -0
  682. package/src/locale/lang/ro.js +109 -0
  683. package/src/locale/lang/ru-RU.js +109 -0
  684. package/src/locale/lang/sk.js +111 -0
  685. package/src/locale/lang/sl.js +109 -0
  686. package/src/locale/lang/sr.js +109 -0
  687. package/src/locale/lang/sv-SE.js +109 -0
  688. package/src/locale/lang/ta.js +108 -0
  689. package/src/locale/lang/th.js +109 -0
  690. package/src/locale/lang/tk.js +109 -0
  691. package/src/locale/lang/tr-TR.js +109 -0
  692. package/src/locale/lang/ua.js +109 -0
  693. package/src/locale/lang/ug-CN.js +109 -0
  694. package/src/locale/lang/vi.js +109 -0
  695. package/src/locale/lang/zh-CN.js +109 -0
  696. package/src/locale/lang/zh-TW.js +109 -0
  697. package/src/mixins/emitter.js +33 -0
  698. package/src/mixins/focus.js +9 -0
  699. package/src/mixins/locale.js +9 -0
  700. package/src/mixins/migrating.js +51 -0
  701. package/src/transitions/collapse-transition.js +77 -0
  702. package/src/utils/after-leave.js +27 -0
  703. package/src/utils/aria-dialog.js +90 -0
  704. package/src/utils/aria-utils.js +121 -0
  705. package/src/utils/clickoutside.js +76 -0
  706. package/src/utils/date.js +344 -0
  707. package/src/utils/dom.js +174 -0
  708. package/src/utils/menu/aria-menubar.js +14 -0
  709. package/src/utils/menu/aria-menuitem.js +49 -0
  710. package/src/utils/menu/aria-submenu.js +59 -0
  711. package/src/utils/merge.js +15 -0
  712. package/src/utils/popper.js +1276 -0
  713. package/src/utils/popup/index.js +226 -0
  714. package/src/utils/popup/popup-manager.js +194 -0
  715. package/src/utils/resize-event.js +35 -0
  716. package/src/utils/scroll-into-view.js +27 -0
  717. package/src/utils/scrollbar-width.js +29 -0
  718. package/src/utils/shared.js +7 -0
  719. package/src/utils/util.js +122 -0
  720. package/src/utils/vdom.js +9 -0
  721. package/src/utils/vue-popper.js +200 -0
  722. package/types/alert.d.ts +27 -0
  723. package/types/aside.d.ts +7 -0
  724. package/types/autocomplete.d.ts +78 -0
  725. package/types/badge.d.ts +16 -0
  726. package/types/breadcrumb-item.d.ts +10 -0
  727. package/types/breadcrumb.d.ts +10 -0
  728. package/types/button-group.d.ts +4 -0
  729. package/types/button.d.ts +37 -0
  730. package/types/card.d.ts +26 -0
  731. package/types/carousel-item.d.ts +10 -0
  732. package/types/carousel.d.ts +53 -0
  733. package/types/cascader.d.ts +57 -0
  734. package/types/checkbox-button.d.ts +22 -0
  735. package/types/checkbox-group.d.ts +22 -0
  736. package/types/checkbox.d.ts +34 -0
  737. package/types/col.d.ts +46 -0
  738. package/types/collapse-item.d.ts +23 -0
  739. package/types/collapse.d.ts +10 -0
  740. package/types/color-picker.d.ts +21 -0
  741. package/types/component.d.ts +13 -0
  742. package/types/container.d.ts +7 -0
  743. package/types/date-picker.d.ts +124 -0
  744. package/types/dialog.d.ts +59 -0
  745. package/types/dropdown-item.d.ts +13 -0
  746. package/types/dropdown-menu.d.ts +4 -0
  747. package/types/dropdown.d.ts +26 -0
  748. package/types/element-ui.d.ts +294 -0
  749. package/types/footer.d.ts +7 -0
  750. package/types/form-item.d.ts +37 -0
  751. package/types/form.d.ts +82 -0
  752. package/types/header.d.ts +7 -0
  753. package/types/index.d.ts +4 -0
  754. package/types/input-number.d.ts +44 -0
  755. package/types/input.d.ts +98 -0
  756. package/types/loading.d.ts +62 -0
  757. package/types/main.d.ts +4 -0
  758. package/types/menu-item-group.d.ts +7 -0
  759. package/types/menu-item.d.ts +10 -0
  760. package/types/menu.d.ts +46 -0
  761. package/types/message-box.d.ts +176 -0
  762. package/types/message.d.ts +75 -0
  763. package/types/notification.d.ts +84 -0
  764. package/types/option-group.d.ts +10 -0
  765. package/types/option.d.ts +13 -0
  766. package/types/pagination.d.ts +40 -0
  767. package/types/popover.d.ts +65 -0
  768. package/types/progress.d.ts +31 -0
  769. package/types/radio-button.d.ts +16 -0
  770. package/types/radio-group.d.ts +18 -0
  771. package/types/radio.d.ts +19 -0
  772. package/types/rate.d.ts +52 -0
  773. package/types/row.d.ts +25 -0
  774. package/types/select.d.ts +90 -0
  775. package/types/slider.d.ts +62 -0
  776. package/types/step.d.ts +34 -0
  777. package/types/steps.d.ts +28 -0
  778. package/types/submenu.d.ts +22 -0
  779. package/types/switch.d.ts +40 -0
  780. package/types/tab-pane.d.ts +19 -0
  781. package/types/table-column.d.ts +117 -0
  782. package/types/table.d.ts +157 -0
  783. package/types/tabs.d.ts +31 -0
  784. package/types/tag.d.ts +24 -0
  785. package/types/time-picker.d.ts +63 -0
  786. package/types/time-select.d.ts +56 -0
  787. package/types/tooltip.d.ts +49 -0
  788. package/types/transfer.d.ts +73 -0
  789. package/types/tree.d.ts +264 -0
  790. package/types/upload.d.ts +124 -0
@@ -0,0 +1,4396 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, {
41
+ /******/ configurable: false,
42
+ /******/ enumerable: true,
43
+ /******/ get: getter
44
+ /******/ });
45
+ /******/ }
46
+ /******/ };
47
+ /******/
48
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
49
+ /******/ __webpack_require__.n = function(module) {
50
+ /******/ var getter = module && module.__esModule ?
51
+ /******/ function getDefault() { return module['default']; } :
52
+ /******/ function getModuleExports() { return module; };
53
+ /******/ __webpack_require__.d(getter, 'a', getter);
54
+ /******/ return getter;
55
+ /******/ };
56
+ /******/
57
+ /******/ // Object.prototype.hasOwnProperty.call
58
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
59
+ /******/
60
+ /******/ // __webpack_public_path__
61
+ /******/ __webpack_require__.p = "/dist/";
62
+ /******/
63
+ /******/ // Load entry module and return exports
64
+ /******/ return __webpack_require__(__webpack_require__.s = 176);
65
+ /******/ })
66
+ /************************************************************************/
67
+ /******/ ({
68
+
69
+ /***/ 0:
70
+ /***/ (function(module, exports) {
71
+
72
+ /* globals __VUE_SSR_CONTEXT__ */
73
+
74
+ // IMPORTANT: Do NOT use ES2015 features in this file.
75
+ // This module is a runtime utility for cleaner component module output and will
76
+ // be included in the final webpack user bundle.
77
+
78
+ module.exports = function normalizeComponent (
79
+ rawScriptExports,
80
+ compiledTemplate,
81
+ functionalTemplate,
82
+ injectStyles,
83
+ scopeId,
84
+ moduleIdentifier /* server only */
85
+ ) {
86
+ var esModule
87
+ var scriptExports = rawScriptExports = rawScriptExports || {}
88
+
89
+ // ES6 modules interop
90
+ var type = typeof rawScriptExports.default
91
+ if (type === 'object' || type === 'function') {
92
+ esModule = rawScriptExports
93
+ scriptExports = rawScriptExports.default
94
+ }
95
+
96
+ // Vue.extend constructor export interop
97
+ var options = typeof scriptExports === 'function'
98
+ ? scriptExports.options
99
+ : scriptExports
100
+
101
+ // render functions
102
+ if (compiledTemplate) {
103
+ options.render = compiledTemplate.render
104
+ options.staticRenderFns = compiledTemplate.staticRenderFns
105
+ options._compiled = true
106
+ }
107
+
108
+ // functional template
109
+ if (functionalTemplate) {
110
+ options.functional = true
111
+ }
112
+
113
+ // scopedId
114
+ if (scopeId) {
115
+ options._scopeId = scopeId
116
+ }
117
+
118
+ var hook
119
+ if (moduleIdentifier) { // server build
120
+ hook = function (context) {
121
+ // 2.3 injection
122
+ context =
123
+ context || // cached call
124
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
125
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
126
+ // 2.2 with runInNewContext: true
127
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
128
+ context = __VUE_SSR_CONTEXT__
129
+ }
130
+ // inject component styles
131
+ if (injectStyles) {
132
+ injectStyles.call(this, context)
133
+ }
134
+ // register component module identifier for async chunk inferrence
135
+ if (context && context._registeredComponents) {
136
+ context._registeredComponents.add(moduleIdentifier)
137
+ }
138
+ }
139
+ // used by ssr in case component is cached and beforeCreate
140
+ // never gets called
141
+ options._ssrRegister = hook
142
+ } else if (injectStyles) {
143
+ hook = injectStyles
144
+ }
145
+
146
+ if (hook) {
147
+ var functional = options.functional
148
+ var existing = functional
149
+ ? options.render
150
+ : options.beforeCreate
151
+
152
+ if (!functional) {
153
+ // inject component registration as beforeCreate hook
154
+ options.beforeCreate = existing
155
+ ? [].concat(existing, hook)
156
+ : [hook]
157
+ } else {
158
+ // for template-only hot-reload because in that case the render fn doesn't
159
+ // go through the normalizer
160
+ options._injectStyles = hook
161
+ // register for functioal component in vue file
162
+ options.render = function renderWithStyleInjection (h, context) {
163
+ hook.call(context)
164
+ return existing(h, context)
165
+ }
166
+ }
167
+ }
168
+
169
+ return {
170
+ esModule: esModule,
171
+ exports: scriptExports,
172
+ options: options
173
+ }
174
+ }
175
+
176
+
177
+ /***/ }),
178
+
179
+ /***/ 1:
180
+ /***/ (function(module, exports) {
181
+
182
+ module.exports = require("element-ui/lib/mixins/emitter");
183
+
184
+ /***/ }),
185
+
186
+ /***/ 10:
187
+ /***/ (function(module, exports) {
188
+
189
+ module.exports = require("element-ui/lib/utils/clickoutside");
190
+
191
+ /***/ }),
192
+
193
+ /***/ 11:
194
+ /***/ (function(module, exports, __webpack_require__) {
195
+
196
+ "use strict";
197
+
198
+
199
+ exports.__esModule = true;
200
+ exports.extractTimeFormat = exports.extractDateFormat = exports.nextYear = exports.prevYear = exports.nextMonth = exports.prevMonth = exports.changeYearMonthAndClampDate = exports.timeWithinRange = exports.limitTimeRange = exports.clearMilliseconds = exports.clearTime = exports.modifyWithTimeString = exports.modifyTime = exports.modifyDate = exports.range = exports.getRangeMinutes = exports.getRangeHours = exports.getWeekNumber = exports.getStartDateOfMonth = exports.nextDate = exports.prevDate = exports.getFirstDayOfMonth = exports.getDayCountOfYear = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isDateObject = exports.isDate = exports.toDate = undefined;
201
+
202
+ var _date = __webpack_require__(29);
203
+
204
+ var _date2 = _interopRequireDefault(_date);
205
+
206
+ var _locale = __webpack_require__(12);
207
+
208
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
209
+
210
+ var weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
211
+ var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
212
+ var getI18nSettings = function getI18nSettings() {
213
+ return {
214
+ dayNamesShort: weeks.map(function (week) {
215
+ return (0, _locale.t)('el.datepicker.weeks.' + week);
216
+ }),
217
+ dayNames: weeks.map(function (week) {
218
+ return (0, _locale.t)('el.datepicker.weeks.' + week);
219
+ }),
220
+ monthNamesShort: months.map(function (month) {
221
+ return (0, _locale.t)('el.datepicker.months.' + month);
222
+ }),
223
+ monthNames: months.map(function (month, index) {
224
+ return (0, _locale.t)('el.datepicker.month' + (index + 1));
225
+ }),
226
+ amPm: ['am', 'pm']
227
+ };
228
+ };
229
+
230
+ var newArray = function newArray(start, end) {
231
+ var result = [];
232
+ for (var i = start; i <= end; i++) {
233
+ result.push(i);
234
+ }
235
+ return result;
236
+ };
237
+
238
+ var toDate = exports.toDate = function toDate(date) {
239
+ return isDate(date) ? new Date(date) : null;
240
+ };
241
+
242
+ var isDate = exports.isDate = function isDate(date) {
243
+ if (date === null || date === undefined) return false;
244
+ if (isNaN(new Date(date).getTime())) return false;
245
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
246
+ return true;
247
+ };
248
+
249
+ var isDateObject = exports.isDateObject = function isDateObject(val) {
250
+ return val instanceof Date;
251
+ };
252
+
253
+ var formatDate = exports.formatDate = function formatDate(date, format) {
254
+ date = toDate(date);
255
+ if (!date) return '';
256
+ return _date2.default.format(date, format || 'yyyy-MM-dd', getI18nSettings());
257
+ };
258
+
259
+ var parseDate = exports.parseDate = function parseDate(string, format) {
260
+ return _date2.default.parse(string, format || 'yyyy-MM-dd', getI18nSettings());
261
+ };
262
+
263
+ var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {
264
+ if (month === 3 || month === 5 || month === 8 || month === 10) {
265
+ return 30;
266
+ }
267
+
268
+ if (month === 1) {
269
+ if (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) {
270
+ return 29;
271
+ } else {
272
+ return 28;
273
+ }
274
+ }
275
+
276
+ return 31;
277
+ };
278
+
279
+ var getDayCountOfYear = exports.getDayCountOfYear = function getDayCountOfYear(year) {
280
+ var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
281
+ return isLeapYear ? 366 : 365;
282
+ };
283
+
284
+ var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {
285
+ var temp = new Date(date.getTime());
286
+ temp.setDate(1);
287
+ return temp.getDay();
288
+ };
289
+
290
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
291
+ // {prev, next} Date should work for Daylight Saving Time
292
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
293
+ var prevDate = exports.prevDate = function prevDate(date) {
294
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
295
+
296
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
297
+ };
298
+
299
+ var nextDate = exports.nextDate = function nextDate(date) {
300
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
301
+
302
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
303
+ };
304
+
305
+ var getStartDateOfMonth = exports.getStartDateOfMonth = function getStartDateOfMonth(year, month) {
306
+ var result = new Date(year, month, 1);
307
+ var day = result.getDay();
308
+
309
+ if (day === 0) {
310
+ return prevDate(result, 7);
311
+ } else {
312
+ return prevDate(result, day);
313
+ }
314
+ };
315
+
316
+ var getWeekNumber = exports.getWeekNumber = function getWeekNumber(src) {
317
+ if (!isDate(src)) return null;
318
+ var date = new Date(src.getTime());
319
+ date.setHours(0, 0, 0, 0);
320
+ // Thursday in current week decides the year.
321
+ date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
322
+ // January 4 is always in week 1.
323
+ var week1 = new Date(date.getFullYear(), 0, 4);
324
+ // Adjust to Thursday in week 1 and count number of weeks from date to week 1.
325
+ // Rounding should be fine for Daylight Saving Time. Its shift should never be more than 12 hours.
326
+ return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);
327
+ };
328
+
329
+ var getRangeHours = exports.getRangeHours = function getRangeHours(ranges) {
330
+ var hours = [];
331
+ var disabledHours = [];
332
+
333
+ (ranges || []).forEach(function (range) {
334
+ var value = range.map(function (date) {
335
+ return date.getHours();
336
+ });
337
+
338
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
339
+ });
340
+
341
+ if (disabledHours.length) {
342
+ for (var i = 0; i < 24; i++) {
343
+ hours[i] = disabledHours.indexOf(i) === -1;
344
+ }
345
+ } else {
346
+ for (var _i = 0; _i < 24; _i++) {
347
+ hours[_i] = false;
348
+ }
349
+ }
350
+
351
+ return hours;
352
+ };
353
+
354
+ function setRangeData(arr, start, end, value) {
355
+ for (var i = start; i < end; i++) {
356
+ arr[i] = value;
357
+ }
358
+ }
359
+
360
+ var getRangeMinutes = exports.getRangeMinutes = function getRangeMinutes(ranges, hour) {
361
+ var minutes = new Array(60);
362
+
363
+ if (ranges.length > 0) {
364
+ ranges.forEach(function (range) {
365
+ var start = range[0];
366
+ var end = range[1];
367
+ var startHour = start.getHours();
368
+ var startMinute = start.getMinutes();
369
+ var endHour = end.getHours();
370
+ var endMinute = end.getMinutes();
371
+ if (startHour === hour && endHour !== hour) {
372
+ setRangeData(minutes, startMinute, 60, true);
373
+ } else if (startHour === hour && endHour === hour) {
374
+ setRangeData(minutes, startMinute, endMinute + 1, true);
375
+ } else if (startHour !== hour && endHour === hour) {
376
+ setRangeData(minutes, 0, endMinute + 1, true);
377
+ } else if (startHour < hour && endHour > hour) {
378
+ setRangeData(minutes, 0, 60, true);
379
+ }
380
+ });
381
+ } else {
382
+ setRangeData(minutes, 0, 60, true);
383
+ }
384
+ return minutes;
385
+ };
386
+
387
+ var range = exports.range = function range(n) {
388
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
389
+ return Array.apply(null, { length: n }).map(function (_, n) {
390
+ return n;
391
+ });
392
+ };
393
+
394
+ var modifyDate = exports.modifyDate = function modifyDate(date, y, m, d) {
395
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
396
+ };
397
+
398
+ var modifyTime = exports.modifyTime = function modifyTime(date, h, m, s) {
399
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
400
+ };
401
+
402
+ var modifyWithTimeString = exports.modifyWithTimeString = function modifyWithTimeString(date, time) {
403
+ if (date == null || !time) {
404
+ return date;
405
+ }
406
+ time = parseDate(time, 'HH:mm:ss');
407
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
408
+ };
409
+
410
+ var clearTime = exports.clearTime = function clearTime(date) {
411
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
412
+ };
413
+
414
+ var clearMilliseconds = exports.clearMilliseconds = function clearMilliseconds(date) {
415
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
416
+ };
417
+
418
+ var limitTimeRange = exports.limitTimeRange = function limitTimeRange(date, ranges) {
419
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
420
+
421
+ // TODO: refactory a more elegant solution
422
+ if (ranges.length === 0) return date;
423
+ var normalizeDate = function normalizeDate(date) {
424
+ return _date2.default.parse(_date2.default.format(date, format), format);
425
+ };
426
+ var ndate = normalizeDate(date);
427
+ var nranges = ranges.map(function (range) {
428
+ return range.map(normalizeDate);
429
+ });
430
+ if (nranges.some(function (nrange) {
431
+ return ndate >= nrange[0] && ndate <= nrange[1];
432
+ })) return date;
433
+
434
+ var minDate = nranges[0][0];
435
+ var maxDate = nranges[0][0];
436
+
437
+ nranges.forEach(function (nrange) {
438
+ minDate = new Date(Math.min(nrange[0], minDate));
439
+ maxDate = new Date(Math.max(nrange[1], minDate));
440
+ });
441
+
442
+ var ret = ndate < minDate ? minDate : maxDate;
443
+ // preserve Year/Month/Date
444
+ return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
445
+ };
446
+
447
+ var timeWithinRange = exports.timeWithinRange = function timeWithinRange(date, selectableRange, format) {
448
+ var limitedDate = limitTimeRange(date, selectableRange, format);
449
+ return limitedDate.getTime() === date.getTime();
450
+ };
451
+
452
+ var changeYearMonthAndClampDate = exports.changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
453
+ // clamp date to the number of days in `year`, `month`
454
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
455
+ var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
456
+ return modifyDate(date, year, month, monthDate);
457
+ };
458
+
459
+ var prevMonth = exports.prevMonth = function prevMonth(date) {
460
+ var year = date.getFullYear();
461
+ var month = date.getMonth();
462
+ return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
463
+ };
464
+
465
+ var nextMonth = exports.nextMonth = function nextMonth(date) {
466
+ var year = date.getFullYear();
467
+ var month = date.getMonth();
468
+ return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
469
+ };
470
+
471
+ var prevYear = exports.prevYear = function prevYear(date) {
472
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
473
+
474
+ var year = date.getFullYear();
475
+ var month = date.getMonth();
476
+ return changeYearMonthAndClampDate(date, year - amount, month);
477
+ };
478
+
479
+ var nextYear = exports.nextYear = function nextYear(date) {
480
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
481
+
482
+ var year = date.getFullYear();
483
+ var month = date.getMonth();
484
+ return changeYearMonthAndClampDate(date, year + amount, month);
485
+ };
486
+
487
+ var extractDateFormat = exports.extractDateFormat = function extractDateFormat(format) {
488
+ return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
489
+ };
490
+
491
+ var extractTimeFormat = exports.extractTimeFormat = function extractTimeFormat(format) {
492
+ return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
493
+ };
494
+
495
+ /***/ }),
496
+
497
+ /***/ 12:
498
+ /***/ (function(module, exports) {
499
+
500
+ module.exports = require("element-ui/lib/locale");
501
+
502
+ /***/ }),
503
+
504
+ /***/ 15:
505
+ /***/ (function(module, exports) {
506
+
507
+ module.exports = require("element-ui/lib/button");
508
+
509
+ /***/ }),
510
+
511
+ /***/ 17:
512
+ /***/ (function(module, exports) {
513
+
514
+ module.exports = require("element-ui/lib/scrollbar");
515
+
516
+ /***/ }),
517
+
518
+ /***/ 176:
519
+ /***/ (function(module, exports, __webpack_require__) {
520
+
521
+ "use strict";
522
+
523
+
524
+ exports.__esModule = true;
525
+
526
+ var _datePicker = __webpack_require__(177);
527
+
528
+ var _datePicker2 = _interopRequireDefault(_datePicker);
529
+
530
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
531
+
532
+ /* istanbul ignore next */
533
+ _datePicker2.default.install = function install(Vue) {
534
+ Vue.component(_datePicker2.default.name, _datePicker2.default);
535
+ };
536
+
537
+ exports.default = _datePicker2.default;
538
+
539
+ /***/ }),
540
+
541
+ /***/ 177:
542
+ /***/ (function(module, exports, __webpack_require__) {
543
+
544
+ "use strict";
545
+
546
+
547
+ exports.__esModule = true;
548
+
549
+ var _picker = __webpack_require__(27);
550
+
551
+ var _picker2 = _interopRequireDefault(_picker);
552
+
553
+ var _date = __webpack_require__(178);
554
+
555
+ var _date2 = _interopRequireDefault(_date);
556
+
557
+ var _dateRange = __webpack_require__(189);
558
+
559
+ var _dateRange2 = _interopRequireDefault(_dateRange);
560
+
561
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
562
+
563
+ var getPanel = function getPanel(type) {
564
+ if (type === 'daterange' || type === 'datetimerange') {
565
+ return _dateRange2.default;
566
+ }
567
+ return _date2.default;
568
+ };
569
+
570
+ exports.default = {
571
+ mixins: [_picker2.default],
572
+
573
+ name: 'ElDatePicker',
574
+
575
+ props: {
576
+ type: {
577
+ type: String,
578
+ default: 'date'
579
+ },
580
+ timeArrowControl: Boolean
581
+ },
582
+
583
+ watch: {
584
+ type: function type(_type) {
585
+ if (this.picker) {
586
+ this.unmountPicker();
587
+ this.panel = getPanel(_type);
588
+ this.mountPicker();
589
+ } else {
590
+ this.panel = getPanel(_type);
591
+ }
592
+ }
593
+ },
594
+
595
+ created: function created() {
596
+ this.panel = getPanel(this.type);
597
+ }
598
+ };
599
+
600
+ /***/ }),
601
+
602
+ /***/ 178:
603
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
604
+
605
+ "use strict";
606
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
607
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__ = __webpack_require__(179);
608
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__);
609
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f6496d7_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__ = __webpack_require__(188);
610
+ var normalizeComponent = __webpack_require__(0)
611
+ /* script */
612
+
613
+ /* template */
614
+
615
+ /* template functional */
616
+ var __vue_template_functional__ = false
617
+ /* styles */
618
+ var __vue_styles__ = null
619
+ /* scopeId */
620
+ var __vue_scopeId__ = null
621
+ /* moduleIdentifier (server only) */
622
+ var __vue_module_identifier__ = null
623
+ var Component = normalizeComponent(
624
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default.a,
625
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f6496d7_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__["a" /* default */],
626
+ __vue_template_functional__,
627
+ __vue_styles__,
628
+ __vue_scopeId__,
629
+ __vue_module_identifier__
630
+ )
631
+
632
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
633
+
634
+
635
+ /***/ }),
636
+
637
+ /***/ 179:
638
+ /***/ (function(module, exports, __webpack_require__) {
639
+
640
+ "use strict";
641
+
642
+
643
+ exports.__esModule = true;
644
+
645
+ var _util = __webpack_require__(11);
646
+
647
+ var _clickoutside = __webpack_require__(10);
648
+
649
+ var _clickoutside2 = _interopRequireDefault(_clickoutside);
650
+
651
+ var _locale = __webpack_require__(5);
652
+
653
+ var _locale2 = _interopRequireDefault(_locale);
654
+
655
+ var _input = __webpack_require__(6);
656
+
657
+ var _input2 = _interopRequireDefault(_input);
658
+
659
+ var _button = __webpack_require__(15);
660
+
661
+ var _button2 = _interopRequireDefault(_button);
662
+
663
+ var _time = __webpack_require__(31);
664
+
665
+ var _time2 = _interopRequireDefault(_time);
666
+
667
+ var _yearTable = __webpack_require__(180);
668
+
669
+ var _yearTable2 = _interopRequireDefault(_yearTable);
670
+
671
+ var _monthTable = __webpack_require__(183);
672
+
673
+ var _monthTable2 = _interopRequireDefault(_monthTable);
674
+
675
+ var _dateTable = __webpack_require__(49);
676
+
677
+ var _dateTable2 = _interopRequireDefault(_dateTable);
678
+
679
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
680
+
681
+ exports.default = {
682
+ mixins: [_locale2.default],
683
+
684
+ directives: { Clickoutside: _clickoutside2.default },
685
+
686
+ watch: {
687
+ showTime: function showTime(val) {
688
+ var _this = this;
689
+
690
+ /* istanbul ignore if */
691
+ if (!val) return;
692
+ this.$nextTick(function (_) {
693
+ var inputElm = _this.$refs.input.$el;
694
+ if (inputElm) {
695
+ _this.pickerWidth = inputElm.getBoundingClientRect().width + 10;
696
+ }
697
+ });
698
+ },
699
+ value: function value(val) {
700
+ if (this.selectionMode === 'dates' && this.value) return;
701
+ if ((0, _util.isDate)(val)) {
702
+ this.date = new Date(val);
703
+ } else {
704
+ this.date = this.getDefaultValue();
705
+ }
706
+ },
707
+ defaultValue: function defaultValue(val) {
708
+ if (!(0, _util.isDate)(this.value)) {
709
+ this.date = val ? new Date(val) : new Date();
710
+ }
711
+ },
712
+ timePickerVisible: function timePickerVisible(val) {
713
+ var _this2 = this;
714
+
715
+ if (val) this.$nextTick(function () {
716
+ return _this2.$refs.timepicker.adjustSpinners();
717
+ });
718
+ },
719
+ selectionMode: function selectionMode(newVal) {
720
+ if (newVal === 'month') {
721
+ /* istanbul ignore next */
722
+ if (this.currentView !== 'year' || this.currentView !== 'month') {
723
+ this.currentView = 'month';
724
+ }
725
+ } else if (newVal === 'dates') {
726
+ this.currentView = 'date';
727
+ }
728
+ }
729
+ },
730
+
731
+ methods: {
732
+ proxyTimePickerDataProperties: function proxyTimePickerDataProperties() {
733
+ var _this3 = this;
734
+
735
+ var format = function format(timeFormat) {
736
+ _this3.$refs.timepicker.format = timeFormat;
737
+ };
738
+ var value = function value(_value) {
739
+ _this3.$refs.timepicker.value = _value;
740
+ };
741
+ var date = function date(_date) {
742
+ _this3.$refs.timepicker.date = _date;
743
+ };
744
+
745
+ this.$watch('value', value);
746
+ this.$watch('date', date);
747
+
748
+ format(this.timeFormat);
749
+ value(this.value);
750
+ date(this.date);
751
+ },
752
+ handleClear: function handleClear() {
753
+ this.date = this.getDefaultValue();
754
+ this.$emit('pick', null);
755
+ },
756
+ emit: function emit(value) {
757
+ var _this4 = this;
758
+
759
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
760
+ args[_key - 1] = arguments[_key];
761
+ }
762
+
763
+ if (!value) {
764
+ this.$emit.apply(this, ['pick', value].concat(args));
765
+ } else if (Array.isArray(value)) {
766
+ var dates = value.map(function (date) {
767
+ return _this4.showTime ? (0, _util.clearMilliseconds)(date) : (0, _util.clearTime)(date);
768
+ });
769
+ this.$emit.apply(this, ['pick', dates].concat(args));
770
+ } else {
771
+ this.$emit.apply(this, ['pick', this.showTime ? (0, _util.clearMilliseconds)(value) : (0, _util.clearTime)(value)].concat(args));
772
+ }
773
+ this.userInputDate = null;
774
+ this.userInputTime = null;
775
+ },
776
+
777
+
778
+ // resetDate() {
779
+ // this.date = new Date(this.date);
780
+ // },
781
+
782
+ showMonthPicker: function showMonthPicker() {
783
+ this.currentView = 'month';
784
+ },
785
+ showYearPicker: function showYearPicker() {
786
+ this.currentView = 'year';
787
+ },
788
+
789
+
790
+ // XXX: 没用到
791
+ // handleLabelClick() {
792
+ // if (this.currentView === 'date') {
793
+ // this.showMonthPicker();
794
+ // } else if (this.currentView === 'month') {
795
+ // this.showYearPicker();
796
+ // }
797
+ // },
798
+
799
+ prevMonth: function prevMonth() {
800
+ this.date = (0, _util.prevMonth)(this.date);
801
+ },
802
+ nextMonth: function nextMonth() {
803
+ this.date = (0, _util.nextMonth)(this.date);
804
+ },
805
+ prevYear: function prevYear() {
806
+ if (this.currentView === 'year') {
807
+ this.date = (0, _util.prevYear)(this.date, 10);
808
+ } else {
809
+ this.date = (0, _util.prevYear)(this.date);
810
+ }
811
+ },
812
+ nextYear: function nextYear() {
813
+ if (this.currentView === 'year') {
814
+ this.date = (0, _util.nextYear)(this.date, 10);
815
+ } else {
816
+ this.date = (0, _util.nextYear)(this.date);
817
+ }
818
+ },
819
+ handleShortcutClick: function handleShortcutClick(shortcut) {
820
+ if (shortcut.onClick) {
821
+ shortcut.onClick(this);
822
+ }
823
+ },
824
+ handleTimePick: function handleTimePick(value, visible, first) {
825
+ if ((0, _util.isDate)(value)) {
826
+ var newDate = this.value ? (0, _util.modifyTime)(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : (0, _util.modifyWithTimeString)(this.getDefaultValue(), this.defaultTime);
827
+ this.date = newDate;
828
+ this.emit(this.date, true);
829
+ } else {
830
+ this.emit(value, true);
831
+ }
832
+ if (!first) {
833
+ this.timePickerVisible = visible;
834
+ }
835
+ },
836
+ handleTimePickClose: function handleTimePickClose() {
837
+ this.timePickerVisible = false;
838
+ },
839
+ handleMonthPick: function handleMonthPick(month) {
840
+ if (this.selectionMode === 'month') {
841
+ this.date = (0, _util.modifyDate)(this.date, this.year, month, 1);
842
+ this.emit(this.date);
843
+ } else {
844
+ this.date = (0, _util.changeYearMonthAndClampDate)(this.date, this.year, month);
845
+ // TODO: should emit intermediate value ??
846
+ // this.emit(this.date);
847
+ this.currentView = 'date';
848
+ }
849
+ },
850
+ handleDatePick: function handleDatePick(value) {
851
+ if (this.selectionMode === 'day') {
852
+ this.date = this.value ? (0, _util.modifyDate)(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : (0, _util.modifyWithTimeString)(value, this.defaultTime);
853
+ this.emit(this.date, this.showTime);
854
+ } else if (this.selectionMode === 'week') {
855
+ this.emit(value.date);
856
+ } else if (this.selectionMode === 'dates') {
857
+ this.emit(value, true); // set false to keep panel open
858
+ }
859
+ },
860
+ handleYearPick: function handleYearPick(year) {
861
+ if (this.selectionMode === 'year') {
862
+ this.date = (0, _util.modifyDate)(this.date, year, 0, 1);
863
+ this.emit(this.date);
864
+ } else {
865
+ this.date = (0, _util.changeYearMonthAndClampDate)(this.date, year, this.month);
866
+ // TODO: should emit intermediate value ??
867
+ // this.emit(this.date, true);
868
+ this.currentView = 'month';
869
+ }
870
+ },
871
+ changeToNow: function changeToNow() {
872
+ // NOTE: not a permanent solution
873
+ // consider disable "now" button in the future
874
+ if (!this.disabledDate || !this.disabledDate(new Date())) {
875
+ this.date = new Date();
876
+ this.emit(this.date);
877
+ }
878
+ },
879
+ confirm: function confirm() {
880
+ if (this.selectionMode === 'dates') {
881
+ this.emit(this.value);
882
+ } else {
883
+ // value were emitted in handle{Date,Time}Pick, nothing to update here
884
+ // deal with the scenario where: user opens the picker, then confirm without doing anything
885
+ var value = this.value ? this.value : (0, _util.modifyWithTimeString)(this.getDefaultValue(), this.defaultTime);
886
+ this.date = new Date(value); // refresh date
887
+ this.emit(value);
888
+ }
889
+ },
890
+ resetView: function resetView() {
891
+ if (this.selectionMode === 'month') {
892
+ this.currentView = 'month';
893
+ } else if (this.selectionMode === 'year') {
894
+ this.currentView = 'year';
895
+ } else {
896
+ this.currentView = 'date';
897
+ }
898
+ },
899
+ handleEnter: function handleEnter() {
900
+ document.body.addEventListener('keydown', this.handleKeydown);
901
+ },
902
+ handleLeave: function handleLeave() {
903
+ this.$emit('dodestroy');
904
+ document.body.removeEventListener('keydown', this.handleKeydown);
905
+ },
906
+ handleKeydown: function handleKeydown(event) {
907
+ var keyCode = event.keyCode;
908
+ var list = [38, 40, 37, 39];
909
+ if (this.visible && !this.timePickerVisible) {
910
+ if (list.indexOf(keyCode) !== -1) {
911
+ this.handleKeyControl(keyCode);
912
+ event.stopPropagation();
913
+ event.preventDefault();
914
+ }
915
+ if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) {
916
+ // Enter
917
+ this.emit(this.date, false);
918
+ }
919
+ }
920
+ },
921
+ handleKeyControl: function handleKeyControl(keyCode) {
922
+ var mapping = {
923
+ 'year': {
924
+ 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
925
+ return date.setFullYear(date.getFullYear() + step);
926
+ }
927
+ },
928
+ 'month': {
929
+ 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
930
+ return date.setMonth(date.getMonth() + step);
931
+ }
932
+ },
933
+ 'week': {
934
+ 38: -1, 40: 1, 37: -1, 39: 1, offset: function offset(date, step) {
935
+ return date.setDate(date.getDate() + step * 7);
936
+ }
937
+ },
938
+ 'day': {
939
+ 38: -7, 40: 7, 37: -1, 39: 1, offset: function offset(date, step) {
940
+ return date.setDate(date.getDate() + step);
941
+ }
942
+ }
943
+ };
944
+ var mode = this.selectionMode;
945
+ var year = 3.1536e10;
946
+ var now = this.date.getTime();
947
+ var newDate = new Date(this.date.getTime());
948
+ while (Math.abs(now - newDate.getTime()) <= year) {
949
+ var map = mapping[mode];
950
+ map.offset(newDate, map[keyCode]);
951
+ if (typeof this.disabledDate === 'function' && this.disabledDate(newDate)) {
952
+ continue;
953
+ }
954
+ this.date = newDate;
955
+ this.$emit('pick', newDate, true);
956
+ break;
957
+ }
958
+ },
959
+ handleVisibleTimeChange: function handleVisibleTimeChange(value) {
960
+ var time = (0, _util.parseDate)(value, this.timeFormat);
961
+ if (time) {
962
+ this.date = (0, _util.modifyDate)(time, this.year, this.month, this.monthDate);
963
+ this.userInputTime = null;
964
+ this.$refs.timepicker.value = this.date;
965
+ this.timePickerVisible = false;
966
+ this.emit(this.date, true);
967
+ }
968
+ },
969
+ handleVisibleDateChange: function handleVisibleDateChange(value) {
970
+ var date = (0, _util.parseDate)(value, this.dateFormat);
971
+ if (date) {
972
+ if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
973
+ return;
974
+ }
975
+ this.date = (0, _util.modifyTime)(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
976
+ this.userInputDate = null;
977
+ this.resetView();
978
+ this.emit(this.date, true);
979
+ }
980
+ },
981
+ isValidValue: function isValidValue(value) {
982
+ return value && !isNaN(value) && (typeof this.disabledDate === 'function' ? !this.disabledDate(value) : true);
983
+ },
984
+ getDefaultValue: function getDefaultValue() {
985
+ // if default-value is set, return it
986
+ // otherwise, return now (the moment this method gets called)
987
+ return this.defaultValue ? new Date(this.defaultValue) : new Date();
988
+ }
989
+ },
990
+
991
+ components: {
992
+ TimePicker: _time2.default, YearTable: _yearTable2.default, MonthTable: _monthTable2.default, DateTable: _dateTable2.default, ElInput: _input2.default, ElButton: _button2.default
993
+ },
994
+
995
+ data: function data() {
996
+ return {
997
+ popperClass: '',
998
+ date: new Date(),
999
+ value: '',
1000
+ defaultValue: null, // use getDefaultValue() for time computation
1001
+ defaultTime: null,
1002
+ showTime: false,
1003
+ selectionMode: 'day',
1004
+ shortcuts: '',
1005
+ visible: false,
1006
+ currentView: 'date',
1007
+ disabledDate: '',
1008
+ firstDayOfWeek: 7,
1009
+ showWeekNumber: false,
1010
+ timePickerVisible: false,
1011
+ format: '',
1012
+ arrowControl: false,
1013
+ userInputDate: null,
1014
+ userInputTime: null
1015
+ };
1016
+ },
1017
+
1018
+
1019
+ computed: {
1020
+ year: function year() {
1021
+ return this.date.getFullYear();
1022
+ },
1023
+ month: function month() {
1024
+ return this.date.getMonth();
1025
+ },
1026
+ week: function week() {
1027
+ return (0, _util.getWeekNumber)(this.date);
1028
+ },
1029
+ monthDate: function monthDate() {
1030
+ return this.date.getDate();
1031
+ },
1032
+ footerVisible: function footerVisible() {
1033
+ return this.showTime || this.selectionMode === 'dates';
1034
+ },
1035
+ visibleTime: function visibleTime() {
1036
+ if (this.userInputTime !== null) {
1037
+ return this.userInputTime;
1038
+ } else {
1039
+ return (0, _util.formatDate)(this.value || this.defaultValue, this.timeFormat);
1040
+ }
1041
+ },
1042
+ visibleDate: function visibleDate() {
1043
+ if (this.userInputDate !== null) {
1044
+ return this.userInputDate;
1045
+ } else {
1046
+ return (0, _util.formatDate)(this.value || this.defaultValue, this.dateFormat);
1047
+ }
1048
+ },
1049
+ yearLabel: function yearLabel() {
1050
+ var yearTranslation = this.t('el.datepicker.year');
1051
+ if (this.currentView === 'year') {
1052
+ var startYear = Math.floor(this.year / 10) * 10;
1053
+ if (yearTranslation) {
1054
+ return startYear + ' ' + yearTranslation + ' - ' + (startYear + 9) + ' ' + yearTranslation;
1055
+ }
1056
+ return startYear + ' - ' + (startYear + 9);
1057
+ }
1058
+ return this.year + ' ' + yearTranslation;
1059
+ },
1060
+ timeFormat: function timeFormat() {
1061
+ if (this.format) {
1062
+ return (0, _util.extractTimeFormat)(this.format);
1063
+ } else {
1064
+ return 'HH:mm:ss';
1065
+ }
1066
+ },
1067
+ dateFormat: function dateFormat() {
1068
+ if (this.format) {
1069
+ return (0, _util.extractDateFormat)(this.format);
1070
+ } else {
1071
+ return 'yyyy-MM-dd';
1072
+ }
1073
+ }
1074
+ }
1075
+ }; //
1076
+ //
1077
+ //
1078
+ //
1079
+ //
1080
+ //
1081
+ //
1082
+ //
1083
+ //
1084
+ //
1085
+ //
1086
+ //
1087
+ //
1088
+ //
1089
+ //
1090
+ //
1091
+ //
1092
+ //
1093
+ //
1094
+ //
1095
+ //
1096
+ //
1097
+ //
1098
+ //
1099
+ //
1100
+ //
1101
+ //
1102
+ //
1103
+ //
1104
+ //
1105
+ //
1106
+ //
1107
+ //
1108
+ //
1109
+ //
1110
+ //
1111
+ //
1112
+ //
1113
+ //
1114
+ //
1115
+ //
1116
+ //
1117
+ //
1118
+ //
1119
+ //
1120
+ //
1121
+ //
1122
+ //
1123
+ //
1124
+ //
1125
+ //
1126
+ //
1127
+ //
1128
+ //
1129
+ //
1130
+ //
1131
+ //
1132
+ //
1133
+ //
1134
+ //
1135
+ //
1136
+ //
1137
+ //
1138
+ //
1139
+ //
1140
+ //
1141
+ //
1142
+ //
1143
+ //
1144
+ //
1145
+ //
1146
+ //
1147
+ //
1148
+ //
1149
+ //
1150
+ //
1151
+ //
1152
+ //
1153
+ //
1154
+ //
1155
+ //
1156
+ //
1157
+ //
1158
+ //
1159
+ //
1160
+ //
1161
+ //
1162
+ //
1163
+ //
1164
+ //
1165
+ //
1166
+ //
1167
+ //
1168
+ //
1169
+ //
1170
+ //
1171
+ //
1172
+ //
1173
+ //
1174
+ //
1175
+ //
1176
+ //
1177
+ //
1178
+ //
1179
+ //
1180
+ //
1181
+ //
1182
+ //
1183
+ //
1184
+ //
1185
+ //
1186
+ //
1187
+ //
1188
+ //
1189
+ //
1190
+ //
1191
+ //
1192
+ //
1193
+ //
1194
+ //
1195
+ //
1196
+ //
1197
+ //
1198
+ //
1199
+ //
1200
+ //
1201
+ //
1202
+ //
1203
+ //
1204
+ //
1205
+ //
1206
+ //
1207
+ //
1208
+ //
1209
+ //
1210
+ //
1211
+ //
1212
+ //
1213
+ //
1214
+ //
1215
+ //
1216
+ //
1217
+ //
1218
+
1219
+ /***/ }),
1220
+
1221
+ /***/ 180:
1222
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1223
+
1224
+ "use strict";
1225
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1226
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__ = __webpack_require__(181);
1227
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__);
1228
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c7e813d_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__ = __webpack_require__(182);
1229
+ var normalizeComponent = __webpack_require__(0)
1230
+ /* script */
1231
+
1232
+ /* template */
1233
+
1234
+ /* template functional */
1235
+ var __vue_template_functional__ = false
1236
+ /* styles */
1237
+ var __vue_styles__ = null
1238
+ /* scopeId */
1239
+ var __vue_scopeId__ = null
1240
+ /* moduleIdentifier (server only) */
1241
+ var __vue_module_identifier__ = null
1242
+ var Component = normalizeComponent(
1243
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default.a,
1244
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c7e813d_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__["a" /* default */],
1245
+ __vue_template_functional__,
1246
+ __vue_styles__,
1247
+ __vue_scopeId__,
1248
+ __vue_module_identifier__
1249
+ )
1250
+
1251
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
1252
+
1253
+
1254
+ /***/ }),
1255
+
1256
+ /***/ 181:
1257
+ /***/ (function(module, exports, __webpack_require__) {
1258
+
1259
+ "use strict";
1260
+
1261
+
1262
+ exports.__esModule = true;
1263
+
1264
+ var _dom = __webpack_require__(3);
1265
+
1266
+ var _util = __webpack_require__(11);
1267
+
1268
+ var _util2 = __webpack_require__(2);
1269
+
1270
+ var datesInYear = function datesInYear(year) {
1271
+ var numOfDays = (0, _util.getDayCountOfYear)(year);
1272
+ var firstDay = new Date(year, 0, 1);
1273
+ return (0, _util.range)(numOfDays).map(function (n) {
1274
+ return (0, _util.nextDate)(firstDay, n);
1275
+ });
1276
+ }; //
1277
+ //
1278
+ //
1279
+ //
1280
+ //
1281
+ //
1282
+ //
1283
+ //
1284
+ //
1285
+ //
1286
+ //
1287
+ //
1288
+ //
1289
+ //
1290
+ //
1291
+ //
1292
+ //
1293
+ //
1294
+ //
1295
+ //
1296
+ //
1297
+ //
1298
+ //
1299
+ //
1300
+ //
1301
+ //
1302
+ //
1303
+ //
1304
+ //
1305
+ //
1306
+ //
1307
+ //
1308
+ //
1309
+ //
1310
+ //
1311
+ //
1312
+ //
1313
+ //
1314
+ //
1315
+ //
1316
+ //
1317
+ //
1318
+ //
1319
+ //
1320
+ //
1321
+
1322
+ exports.default = {
1323
+ props: {
1324
+ disabledDate: {},
1325
+ value: {},
1326
+ defaultValue: {
1327
+ validator: function validator(val) {
1328
+ // null or valid Date Object
1329
+ return val === null || val instanceof Date && (0, _util.isDate)(val);
1330
+ }
1331
+ },
1332
+ date: {}
1333
+ },
1334
+
1335
+ computed: {
1336
+ startYear: function startYear() {
1337
+ return Math.floor(this.date.getFullYear() / 10) * 10;
1338
+ }
1339
+ },
1340
+
1341
+ methods: {
1342
+ getCellStyle: function getCellStyle(year) {
1343
+ var style = {};
1344
+ var today = new Date();
1345
+
1346
+ style.disabled = typeof this.disabledDate === 'function' ? datesInYear(year).every(this.disabledDate) : false;
1347
+ style.current = (0, _util2.arrayFindIndex)((0, _util2.coerceTruthyValueToArray)(this.value), function (date) {
1348
+ return date.getFullYear() === year;
1349
+ }) >= 0;
1350
+ style.today = today.getFullYear() === year;
1351
+ style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
1352
+
1353
+ return style;
1354
+ },
1355
+ handleYearTableClick: function handleYearTableClick(event) {
1356
+ var target = event.target;
1357
+ if (target.tagName === 'A') {
1358
+ if ((0, _dom.hasClass)(target.parentNode, 'disabled')) return;
1359
+ var year = target.textContent || target.innerText;
1360
+ this.$emit('pick', Number(year));
1361
+ }
1362
+ }
1363
+ }
1364
+ };
1365
+
1366
+ /***/ }),
1367
+
1368
+ /***/ 182:
1369
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1370
+
1371
+ "use strict";
1372
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table',{staticClass:"el-year-table",on:{"click":_vm.handleYearTableClick}},[_c('tbody',[_c('tr',[_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 0)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 1)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 1))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 2)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 2))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 3)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 3))])])]),_c('tr',[_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 4)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 4))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 5)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 5))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 6)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 6))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 7)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 7))])])]),_c('tr',[_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 8)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 8))])]),_c('td',{staticClass:"available",class:_vm.getCellStyle(_vm.startYear + 9)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.startYear + 9))])]),_c('td'),_c('td')])])])}
1373
+ var staticRenderFns = []
1374
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
1375
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
1376
+
1377
+ /***/ }),
1378
+
1379
+ /***/ 183:
1380
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1381
+
1382
+ "use strict";
1383
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1384
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__ = __webpack_require__(184);
1385
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__);
1386
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_332101d2_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__ = __webpack_require__(185);
1387
+ var normalizeComponent = __webpack_require__(0)
1388
+ /* script */
1389
+
1390
+ /* template */
1391
+
1392
+ /* template functional */
1393
+ var __vue_template_functional__ = false
1394
+ /* styles */
1395
+ var __vue_styles__ = null
1396
+ /* scopeId */
1397
+ var __vue_scopeId__ = null
1398
+ /* moduleIdentifier (server only) */
1399
+ var __vue_module_identifier__ = null
1400
+ var Component = normalizeComponent(
1401
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default.a,
1402
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_332101d2_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__["a" /* default */],
1403
+ __vue_template_functional__,
1404
+ __vue_styles__,
1405
+ __vue_scopeId__,
1406
+ __vue_module_identifier__
1407
+ )
1408
+
1409
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
1410
+
1411
+
1412
+ /***/ }),
1413
+
1414
+ /***/ 184:
1415
+ /***/ (function(module, exports, __webpack_require__) {
1416
+
1417
+ "use strict";
1418
+
1419
+
1420
+ exports.__esModule = true;
1421
+
1422
+ var _locale = __webpack_require__(5);
1423
+
1424
+ var _locale2 = _interopRequireDefault(_locale);
1425
+
1426
+ var _util = __webpack_require__(11);
1427
+
1428
+ var _dom = __webpack_require__(3);
1429
+
1430
+ var _util2 = __webpack_require__(2);
1431
+
1432
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1433
+
1434
+ //
1435
+ //
1436
+ //
1437
+ //
1438
+ //
1439
+ //
1440
+ //
1441
+ //
1442
+ //
1443
+ //
1444
+ //
1445
+ //
1446
+ //
1447
+ //
1448
+ //
1449
+ //
1450
+ //
1451
+ //
1452
+ //
1453
+ //
1454
+ //
1455
+ //
1456
+ //
1457
+ //
1458
+ //
1459
+ //
1460
+ //
1461
+ //
1462
+ //
1463
+ //
1464
+ //
1465
+ //
1466
+ //
1467
+ //
1468
+ //
1469
+ //
1470
+ //
1471
+ //
1472
+ //
1473
+ //
1474
+ //
1475
+ //
1476
+ //
1477
+ //
1478
+ //
1479
+ //
1480
+ //
1481
+ //
1482
+ //
1483
+
1484
+ var datesInMonth = function datesInMonth(year, month) {
1485
+ var numOfDays = (0, _util.getDayCountOfMonth)(year, month);
1486
+ var firstDay = new Date(year, month, 1);
1487
+ return (0, _util.range)(numOfDays).map(function (n) {
1488
+ return (0, _util.nextDate)(firstDay, n);
1489
+ });
1490
+ };
1491
+
1492
+ exports.default = {
1493
+ props: {
1494
+ disabledDate: {},
1495
+ value: {},
1496
+ defaultValue: {
1497
+ validator: function validator(val) {
1498
+ // null or valid Date Object
1499
+ return val === null || val instanceof Date && (0, _util.isDate)(val);
1500
+ }
1501
+ },
1502
+ date: {}
1503
+ },
1504
+ mixins: [_locale2.default],
1505
+ methods: {
1506
+ getCellStyle: function getCellStyle(month) {
1507
+ var style = {};
1508
+ var year = this.date.getFullYear();
1509
+ var today = new Date();
1510
+
1511
+ style.disabled = typeof this.disabledDate === 'function' ? datesInMonth(year, month).every(this.disabledDate) : false;
1512
+ style.current = (0, _util2.arrayFindIndex)((0, _util2.coerceTruthyValueToArray)(this.value), function (date) {
1513
+ return date.getFullYear() === year && date.getMonth() === month;
1514
+ }) >= 0;
1515
+ style.today = today.getFullYear() === year && today.getMonth() === month;
1516
+ style.default = this.defaultValue && this.defaultValue.getFullYear() === year && this.defaultValue.getMonth() === month;
1517
+
1518
+ return style;
1519
+ },
1520
+ handleMonthTableClick: function handleMonthTableClick(event) {
1521
+ var target = event.target;
1522
+ if (target.tagName !== 'A') return;
1523
+ if ((0, _dom.hasClass)(target.parentNode, 'disabled')) return;
1524
+ var column = target.parentNode.cellIndex;
1525
+ var row = target.parentNode.parentNode.rowIndex;
1526
+ var month = row * 4 + column;
1527
+
1528
+ this.$emit('pick', month);
1529
+ }
1530
+ }
1531
+ };
1532
+
1533
+ /***/ }),
1534
+
1535
+ /***/ 185:
1536
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1537
+
1538
+ "use strict";
1539
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table',{staticClass:"el-month-table",on:{"click":_vm.handleMonthTableClick}},[_c('tbody',[_c('tr',[_c('td',{class:_vm.getCellStyle(0)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.jan')))])]),_c('td',{class:_vm.getCellStyle(1)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.feb')))])]),_c('td',{class:_vm.getCellStyle(2)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.mar')))])]),_c('td',{class:_vm.getCellStyle(3)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.apr')))])])]),_c('tr',[_c('td',{class:_vm.getCellStyle(4)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.may')))])]),_c('td',{class:_vm.getCellStyle(5)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.jun')))])]),_c('td',{class:_vm.getCellStyle(6)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.jul')))])]),_c('td',{class:_vm.getCellStyle(7)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.aug')))])])]),_c('tr',[_c('td',{class:_vm.getCellStyle(8)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.sep')))])]),_c('td',{class:_vm.getCellStyle(9)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.oct')))])]),_c('td',{class:_vm.getCellStyle(10)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.nov')))])]),_c('td',{class:_vm.getCellStyle(11)},[_c('a',{staticClass:"cell"},[_vm._v(_vm._s(_vm.t('el.datepicker.months.dec')))])])])])])}
1540
+ var staticRenderFns = []
1541
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
1542
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
1543
+
1544
+ /***/ }),
1545
+
1546
+ /***/ 186:
1547
+ /***/ (function(module, exports, __webpack_require__) {
1548
+
1549
+ "use strict";
1550
+
1551
+
1552
+ exports.__esModule = true;
1553
+
1554
+ var _util = __webpack_require__(11);
1555
+
1556
+ var _locale = __webpack_require__(5);
1557
+
1558
+ var _locale2 = _interopRequireDefault(_locale);
1559
+
1560
+ var _util2 = __webpack_require__(2);
1561
+
1562
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1563
+
1564
+ var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; //
1565
+ //
1566
+ //
1567
+ //
1568
+ //
1569
+ //
1570
+ //
1571
+ //
1572
+ //
1573
+ //
1574
+ //
1575
+ //
1576
+ //
1577
+ //
1578
+ //
1579
+ //
1580
+ //
1581
+ //
1582
+ //
1583
+ //
1584
+ //
1585
+ //
1586
+ //
1587
+ //
1588
+ //
1589
+ //
1590
+ //
1591
+ //
1592
+ //
1593
+ //
1594
+ //
1595
+ //
1596
+ //
1597
+
1598
+ var getDateTimestamp = function getDateTimestamp(time) {
1599
+ if (typeof time === 'number' || typeof time === 'string') {
1600
+ return (0, _util.clearTime)(new Date(time)).getTime();
1601
+ } else if (time instanceof Date) {
1602
+ return (0, _util.clearTime)(time).getTime();
1603
+ } else {
1604
+ return NaN;
1605
+ }
1606
+ };
1607
+
1608
+ // remove the first element that satisfies `pred` from arr
1609
+ // return a new array if modification occurs
1610
+ // return the original array otherwise
1611
+ var removeFromArray = function removeFromArray(arr, pred) {
1612
+ var idx = typeof pred === 'function' ? (0, _util2.arrayFindIndex)(arr, pred) : arr.indexOf(pred);
1613
+ return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
1614
+ };
1615
+
1616
+ exports.default = {
1617
+ mixins: [_locale2.default],
1618
+
1619
+ props: {
1620
+ firstDayOfWeek: {
1621
+ default: 7,
1622
+ type: Number,
1623
+ validator: function validator(val) {
1624
+ return val >= 1 && val <= 7;
1625
+ }
1626
+ },
1627
+
1628
+ value: {},
1629
+
1630
+ defaultValue: {
1631
+ validator: function validator(val) {
1632
+ // either: null, valid Date object, Array of valid Date objects
1633
+ return val === null || (0, _util.isDate)(val) || Array.isArray(val) && val.every(_util.isDate);
1634
+ }
1635
+ },
1636
+
1637
+ date: {},
1638
+
1639
+ selectionMode: {
1640
+ default: 'day'
1641
+ },
1642
+
1643
+ showWeekNumber: {
1644
+ type: Boolean,
1645
+ default: false
1646
+ },
1647
+
1648
+ disabledDate: {},
1649
+
1650
+ minDate: {},
1651
+
1652
+ maxDate: {},
1653
+
1654
+ rangeState: {
1655
+ default: function _default() {
1656
+ return {
1657
+ endDate: null,
1658
+ selecting: false
1659
+ };
1660
+ }
1661
+ }
1662
+ },
1663
+
1664
+ computed: {
1665
+ offsetDay: function offsetDay() {
1666
+ var week = this.firstDayOfWeek;
1667
+ // 周日为界限,左右偏移的天数,3217654 例如周一就是 -1,目的是调整前两行日期的位置
1668
+ return week > 3 ? 7 - week : -week;
1669
+ },
1670
+ WEEKS: function WEEKS() {
1671
+ var week = this.firstDayOfWeek;
1672
+ return _WEEKS.concat(_WEEKS).slice(week, week + 7);
1673
+ },
1674
+ year: function year() {
1675
+ return this.date.getFullYear();
1676
+ },
1677
+ month: function month() {
1678
+ return this.date.getMonth();
1679
+ },
1680
+ startDate: function startDate() {
1681
+ return (0, _util.getStartDateOfMonth)(this.year, this.month);
1682
+ },
1683
+ rows: function rows() {
1684
+ var _this = this;
1685
+
1686
+ // TODO: refactory rows / getCellClasses
1687
+ var date = new Date(this.year, this.month, 1);
1688
+ var day = (0, _util.getFirstDayOfMonth)(date); // day of first day
1689
+ var dateCountOfMonth = (0, _util.getDayCountOfMonth)(date.getFullYear(), date.getMonth());
1690
+ var dateCountOfLastMonth = (0, _util.getDayCountOfMonth)(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
1691
+
1692
+ day = day === 0 ? 7 : day;
1693
+
1694
+ var offset = this.offsetDay;
1695
+ var rows = this.tableRows;
1696
+ var count = 1;
1697
+ var firstDayPosition = void 0;
1698
+
1699
+ var startDate = this.startDate;
1700
+ var disabledDate = this.disabledDate;
1701
+ var selectedDate = this.selectionMode === 'dates' ? (0, _util2.coerceTruthyValueToArray)(this.value) : [];
1702
+ var now = getDateTimestamp(new Date());
1703
+
1704
+ for (var i = 0; i < 6; i++) {
1705
+ var row = rows[i];
1706
+
1707
+ if (this.showWeekNumber) {
1708
+ if (!row[0]) {
1709
+ row[0] = { type: 'week', text: (0, _util.getWeekNumber)((0, _util.nextDate)(startDate, i * 7 + 1)) };
1710
+ }
1711
+ }
1712
+
1713
+ var _loop = function _loop(j) {
1714
+ var cell = row[_this.showWeekNumber ? j + 1 : j];
1715
+ if (!cell) {
1716
+ cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
1717
+ }
1718
+
1719
+ cell.type = 'normal';
1720
+
1721
+ var index = i * 7 + j;
1722
+ var time = (0, _util.nextDate)(startDate, index - offset).getTime();
1723
+ cell.inRange = time >= getDateTimestamp(_this.minDate) && time <= getDateTimestamp(_this.maxDate);
1724
+ cell.start = _this.minDate && time === getDateTimestamp(_this.minDate);
1725
+ cell.end = _this.maxDate && time === getDateTimestamp(_this.maxDate);
1726
+ var isToday = time === now;
1727
+
1728
+ if (isToday) {
1729
+ cell.type = 'today';
1730
+ }
1731
+
1732
+ if (i >= 0 && i <= 1) {
1733
+ if (j + i * 7 >= day + offset) {
1734
+ cell.text = count++;
1735
+ if (count === 2) {
1736
+ firstDayPosition = i * 7 + j;
1737
+ }
1738
+ } else {
1739
+ cell.text = dateCountOfLastMonth - (day + offset - j % 7) + 1 + i * 7;
1740
+ cell.type = 'prev-month';
1741
+ }
1742
+ } else {
1743
+ if (count <= dateCountOfMonth) {
1744
+ cell.text = count++;
1745
+ if (count === 2) {
1746
+ firstDayPosition = i * 7 + j;
1747
+ }
1748
+ } else {
1749
+ cell.text = count++ - dateCountOfMonth;
1750
+ cell.type = 'next-month';
1751
+ }
1752
+ }
1753
+
1754
+ var cellDate = new Date(time);
1755
+ cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
1756
+ cell.selected = (0, _util2.arrayFind)(selectedDate, function (date) {
1757
+ return date.getTime() === cellDate.getTime();
1758
+ });
1759
+
1760
+ _this.$set(row, _this.showWeekNumber ? j + 1 : j, cell);
1761
+ };
1762
+
1763
+ for (var j = 0; j < 7; j++) {
1764
+ _loop(j);
1765
+ }
1766
+
1767
+ if (this.selectionMode === 'week') {
1768
+ var start = this.showWeekNumber ? 1 : 0;
1769
+ var end = this.showWeekNumber ? 7 : 6;
1770
+ var isWeekActive = this.isWeekActive(row[start + 1]);
1771
+
1772
+ row[start].inRange = isWeekActive;
1773
+ row[start].start = isWeekActive;
1774
+ row[end].inRange = isWeekActive;
1775
+ row[end].end = isWeekActive;
1776
+ }
1777
+ }
1778
+
1779
+ rows.firstDayPosition = firstDayPosition;
1780
+
1781
+ return rows;
1782
+ }
1783
+ },
1784
+
1785
+ watch: {
1786
+ 'rangeState.endDate': function rangeStateEndDate(newVal) {
1787
+ this.markRange(this.minDate, newVal);
1788
+ },
1789
+ minDate: function minDate(newVal, oldVal) {
1790
+ if (getDateTimestamp(newVal) !== getDateTimestamp(oldVal)) {
1791
+ this.markRange(this.minDate, this.maxDate);
1792
+ }
1793
+ },
1794
+ maxDate: function maxDate(newVal, oldVal) {
1795
+ if (getDateTimestamp(newVal) !== getDateTimestamp(oldVal)) {
1796
+ this.markRange(this.minDate, this.maxDate);
1797
+ }
1798
+ }
1799
+ },
1800
+
1801
+ data: function data() {
1802
+ return {
1803
+ tableRows: [[], [], [], [], [], []],
1804
+ lastRow: null,
1805
+ lastColumn: null
1806
+ };
1807
+ },
1808
+
1809
+
1810
+ methods: {
1811
+ cellMatchesDate: function cellMatchesDate(cell, date) {
1812
+ var value = new Date(date);
1813
+ return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
1814
+ },
1815
+ getCellClasses: function getCellClasses(cell) {
1816
+ var _this2 = this;
1817
+
1818
+ var selectionMode = this.selectionMode;
1819
+ var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
1820
+
1821
+ var classes = [];
1822
+ if ((cell.type === 'normal' || cell.type === 'today') && !cell.disabled) {
1823
+ classes.push('available');
1824
+ if (cell.type === 'today') {
1825
+ classes.push('today');
1826
+ }
1827
+ } else {
1828
+ classes.push(cell.type);
1829
+ }
1830
+
1831
+ if (cell.type === 'normal' && defaultValue.some(function (date) {
1832
+ return _this2.cellMatchesDate(cell, date);
1833
+ })) {
1834
+ classes.push('default');
1835
+ }
1836
+
1837
+ if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) {
1838
+ classes.push('current');
1839
+ }
1840
+
1841
+ if (cell.inRange && (cell.type === 'normal' || cell.type === 'today' || this.selectionMode === 'week')) {
1842
+ classes.push('in-range');
1843
+
1844
+ if (cell.start) {
1845
+ classes.push('start-date');
1846
+ }
1847
+
1848
+ if (cell.end) {
1849
+ classes.push('end-date');
1850
+ }
1851
+ }
1852
+
1853
+ if (cell.disabled) {
1854
+ classes.push('disabled');
1855
+ }
1856
+
1857
+ if (cell.selected) {
1858
+ classes.push('selected');
1859
+ }
1860
+
1861
+ return classes.join(' ');
1862
+ },
1863
+ getDateOfCell: function getDateOfCell(row, column) {
1864
+ var offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
1865
+ return (0, _util.nextDate)(this.startDate, offsetFromStart);
1866
+ },
1867
+ isWeekActive: function isWeekActive(cell) {
1868
+ if (this.selectionMode !== 'week') return false;
1869
+ var newDate = new Date(this.year, this.month, 1);
1870
+ var year = newDate.getFullYear();
1871
+ var month = newDate.getMonth();
1872
+
1873
+ if (cell.type === 'prev-month') {
1874
+ newDate.setMonth(month === 0 ? 11 : month - 1);
1875
+ newDate.setFullYear(month === 0 ? year - 1 : year);
1876
+ }
1877
+
1878
+ if (cell.type === 'next-month') {
1879
+ newDate.setMonth(month === 11 ? 0 : month + 1);
1880
+ newDate.setFullYear(month === 11 ? year + 1 : year);
1881
+ }
1882
+
1883
+ newDate.setDate(parseInt(cell.text, 10));
1884
+
1885
+ var valueYear = (0, _util.isDate)(this.value) ? this.value.getFullYear() : null;
1886
+ return year === valueYear && (0, _util.getWeekNumber)(newDate) === (0, _util.getWeekNumber)(this.value);
1887
+ },
1888
+ markRange: function markRange(minDate, maxDate) {
1889
+ minDate = getDateTimestamp(minDate);
1890
+ maxDate = getDateTimestamp(maxDate) || minDate;
1891
+ var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
1892
+ minDate = _ref[0];
1893
+ maxDate = _ref[1];
1894
+
1895
+
1896
+ var startDate = this.startDate;
1897
+ var rows = this.rows;
1898
+ for (var i = 0, k = rows.length; i < k; i++) {
1899
+ var row = rows[i];
1900
+ for (var j = 0, l = row.length; j < l; j++) {
1901
+ if (this.showWeekNumber && j === 0) continue;
1902
+
1903
+ var _cell = row[j];
1904
+ var index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
1905
+ var time = (0, _util.nextDate)(startDate, index - this.offsetDay).getTime();
1906
+
1907
+ _cell.inRange = minDate && time >= minDate && time <= maxDate;
1908
+ _cell.start = minDate && time === minDate;
1909
+ _cell.end = maxDate && time === maxDate;
1910
+ }
1911
+ }
1912
+ },
1913
+ handleMouseMove: function handleMouseMove(event) {
1914
+ if (!this.rangeState.selecting) return;
1915
+
1916
+ var target = event.target;
1917
+ if (target.tagName === 'SPAN') {
1918
+ target = target.parentNode.parentNode;
1919
+ }
1920
+ if (target.tagName === 'DIV') {
1921
+ target = target.parentNode;
1922
+ }
1923
+ if (target.tagName !== 'TD') return;
1924
+
1925
+ var row = target.parentNode.rowIndex - 1;
1926
+ var column = target.cellIndex;
1927
+
1928
+ // can not select disabled date
1929
+ if (this.rows[row][column].disabled) return;
1930
+
1931
+ // only update rangeState when mouse moves to a new cell
1932
+ // this avoids frequent Date object creation and improves performance
1933
+ if (row !== this.lastRow || column !== this.lastColumn) {
1934
+ this.lastRow = row;
1935
+ this.lastColumn = column;
1936
+ this.$emit('changerange', {
1937
+ minDate: this.minDate,
1938
+ maxDate: this.maxDate,
1939
+ rangeState: {
1940
+ selecting: true,
1941
+ endDate: this.getDateOfCell(row, column)
1942
+ }
1943
+ });
1944
+ }
1945
+ },
1946
+ handleClick: function handleClick(event) {
1947
+ var target = event.target;
1948
+ if (target.tagName === 'SPAN') {
1949
+ target = target.parentNode.parentNode;
1950
+ }
1951
+ if (target.tagName === 'DIV') {
1952
+ target = target.parentNode;
1953
+ }
1954
+
1955
+ if (target.tagName !== 'TD') return;
1956
+
1957
+ var row = target.parentNode.rowIndex - 1;
1958
+ var column = this.selectionMode === 'week' ? 1 : target.cellIndex;
1959
+ var cell = this.rows[row][column];
1960
+
1961
+ if (cell.disabled || cell.type === 'week') return;
1962
+
1963
+ var newDate = this.getDateOfCell(row, column);
1964
+
1965
+ if (this.selectionMode === 'range') {
1966
+ if (!this.rangeState.selecting) {
1967
+ this.$emit('pick', { minDate: newDate, maxDate: null });
1968
+ this.rangeState.selecting = true;
1969
+ } else {
1970
+ if (newDate >= this.minDate) {
1971
+ this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
1972
+ } else {
1973
+ this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
1974
+ }
1975
+ this.rangeState.selecting = false;
1976
+ }
1977
+ } else if (this.selectionMode === 'day') {
1978
+ this.$emit('pick', newDate);
1979
+ } else if (this.selectionMode === 'week') {
1980
+ var weekNumber = (0, _util.getWeekNumber)(newDate);
1981
+ var value = newDate.getFullYear() + 'w' + weekNumber;
1982
+ this.$emit('pick', {
1983
+ year: newDate.getFullYear(),
1984
+ week: weekNumber,
1985
+ value: value,
1986
+ date: newDate
1987
+ });
1988
+ } else if (this.selectionMode === 'dates') {
1989
+ var _value = this.value || [];
1990
+ var newValue = cell.selected ? removeFromArray(_value, function (date) {
1991
+ return date.getTime() === newDate.getTime();
1992
+ }) : [].concat(_value, [newDate]);
1993
+ this.$emit('pick', newValue);
1994
+ }
1995
+ }
1996
+ }
1997
+ };
1998
+
1999
+ /***/ }),
2000
+
2001
+ /***/ 187:
2002
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2003
+
2004
+ "use strict";
2005
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('table',{staticClass:"el-date-table",class:{ 'is-week-mode': _vm.selectionMode === 'week' },attrs:{"cellspacing":"0","cellpadding":"0"},on:{"click":_vm.handleClick,"mousemove":_vm.handleMouseMove}},[_c('tbody',[_c('tr',[(_vm.showWeekNumber)?_c('th',[_vm._v(_vm._s(_vm.t('el.datepicker.week')))]):_vm._e(),_vm._l((_vm.WEEKS),function(week,key){return _c('th',{key:key},[_vm._v(_vm._s(_vm.t('el.datepicker.weeks.' + week)))])})],2),_vm._l((_vm.rows),function(row,key){return _c('tr',{key:key,staticClass:"el-date-table__row",class:{ current: _vm.isWeekActive(row[1]) }},_vm._l((row),function(cell,key){return _c('td',{key:key,class:_vm.getCellClasses(cell)},[_c('div',[_c('span',[_vm._v("\n "+_vm._s(cell.text)+"\n ")])])])}))})],2)])}
2006
+ var staticRenderFns = []
2007
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
2008
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
2009
+
2010
+ /***/ }),
2011
+
2012
+ /***/ 188:
2013
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2014
+
2015
+ "use strict";
2016
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"},on:{"after-enter":_vm.handleEnter,"after-leave":_vm.handleLeave}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-picker-panel el-date-picker el-popper",class:[{
2017
+ 'has-sidebar': _vm.$slots.sidebar || _vm.shortcuts,
2018
+ 'has-time': _vm.showTime
2019
+ }, _vm.popperClass]},[_c('div',{staticClass:"el-picker-panel__body-wrapper"},[_vm._t("sidebar"),(_vm.shortcuts)?_c('div',{staticClass:"el-picker-panel__sidebar"},_vm._l((_vm.shortcuts),function(shortcut,key){return _c('button',{key:key,staticClass:"el-picker-panel__shortcut",attrs:{"type":"button"},on:{"click":function($event){_vm.handleShortcutClick(shortcut)}}},[_vm._v(_vm._s(shortcut.text))])})):_vm._e(),_c('div',{staticClass:"el-picker-panel__body"},[(_vm.showTime)?_c('div',{staticClass:"el-date-picker__time-header"},[_c('span',{staticClass:"el-date-picker__editor-wrap"},[_c('el-input',{attrs:{"placeholder":_vm.t('el.datepicker.selectDate'),"value":_vm.visibleDate,"size":"small"},on:{"input":function (val) { return _vm.userInputDate = val; },"change":_vm.handleVisibleDateChange}})],1),_c('span',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleTimePickClose),expression:"handleTimePickClose"}],staticClass:"el-date-picker__editor-wrap"},[_c('el-input',{ref:"input",attrs:{"placeholder":_vm.t('el.datepicker.selectTime'),"value":_vm.visibleTime,"size":"small"},on:{"focus":function($event){_vm.timePickerVisible = true},"input":function (val) { return _vm.userInputTime = val; },"change":_vm.handleVisibleTimeChange}}),_c('time-picker',{ref:"timepicker",attrs:{"time-arrow-control":_vm.arrowControl,"visible":_vm.timePickerVisible},on:{"pick":_vm.handleTimePick,"mounted":_vm.proxyTimePickerDataProperties}})],1)]):_vm._e(),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView !== 'time'),expression:"currentView !== 'time'"}],staticClass:"el-date-picker__header",class:{ 'el-date-picker__header--bordered': _vm.currentView === 'year' || _vm.currentView === 'month' }},[_c('button',{staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",attrs:{"type":"button","aria-label":_vm.t("el.datepicker.prevYear")},on:{"click":_vm.prevYear}}),_c('button',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'date'),expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",attrs:{"type":"button","aria-label":_vm.t("el.datepicker.prevMonth")},on:{"click":_vm.prevMonth}}),_c('span',{staticClass:"el-date-picker__header-label",attrs:{"role":"button"},on:{"click":_vm.showYearPicker}},[_vm._v(_vm._s(_vm.yearLabel))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'date'),expression:"currentView === 'date'"}],staticClass:"el-date-picker__header-label",class:{ active: _vm.currentView === 'month' },attrs:{"role":"button"},on:{"click":_vm.showMonthPicker}},[_vm._v(_vm._s(_vm.t(("el.datepicker.month" + (_vm.month + 1)))))]),_c('button',{staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",attrs:{"type":"button","aria-label":_vm.t("el.datepicker.nextYear")},on:{"click":_vm.nextYear}}),_c('button',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'date'),expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",attrs:{"type":"button","aria-label":_vm.t("el.datepicker.nextMonth")},on:{"click":_vm.nextMonth}})]),_c('div',{staticClass:"el-picker-panel__content"},[_c('date-table',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'date'),expression:"currentView === 'date'"}],attrs:{"selection-mode":_vm.selectionMode,"first-day-of-week":_vm.firstDayOfWeek,"value":_vm.value,"default-value":_vm.defaultValue ? new Date(_vm.defaultValue) : null,"date":_vm.date,"disabled-date":_vm.disabledDate},on:{"pick":_vm.handleDatePick}}),_c('year-table',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'year'),expression:"currentView === 'year'"}],attrs:{"value":_vm.value,"default-value":_vm.defaultValue ? new Date(_vm.defaultValue) : null,"date":_vm.date,"disabled-date":_vm.disabledDate},on:{"pick":_vm.handleYearPick}}),_c('month-table',{directives:[{name:"show",rawName:"v-show",value:(_vm.currentView === 'month'),expression:"currentView === 'month'"}],attrs:{"value":_vm.value,"default-value":_vm.defaultValue ? new Date(_vm.defaultValue) : null,"date":_vm.date,"disabled-date":_vm.disabledDate},on:{"pick":_vm.handleMonthPick}})],1)])],2),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.footerVisible && _vm.currentView === 'date'),expression:"footerVisible && currentView === 'date'"}],staticClass:"el-picker-panel__footer"},[_c('el-button',{directives:[{name:"show",rawName:"v-show",value:(_vm.selectionMode !== 'dates'),expression:"selectionMode !== 'dates'"}],staticClass:"el-picker-panel__link-btn",attrs:{"size":"mini","type":"text"},on:{"click":_vm.changeToNow}},[_vm._v("\n "+_vm._s(_vm.t('el.datepicker.now'))+"\n ")]),_c('el-button',{staticClass:"el-picker-panel__link-btn",attrs:{"plain":"","size":"mini"},on:{"click":_vm.confirm}},[_vm._v("\n "+_vm._s(_vm.t('el.datepicker.confirm'))+"\n ")])],1)])])}
2020
+ var staticRenderFns = []
2021
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
2022
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
2023
+
2024
+ /***/ }),
2025
+
2026
+ /***/ 189:
2027
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2028
+
2029
+ "use strict";
2030
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
2031
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__ = __webpack_require__(190);
2032
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__);
2033
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_51f33e72_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__ = __webpack_require__(191);
2034
+ var normalizeComponent = __webpack_require__(0)
2035
+ /* script */
2036
+
2037
+ /* template */
2038
+
2039
+ /* template functional */
2040
+ var __vue_template_functional__ = false
2041
+ /* styles */
2042
+ var __vue_styles__ = null
2043
+ /* scopeId */
2044
+ var __vue_scopeId__ = null
2045
+ /* moduleIdentifier (server only) */
2046
+ var __vue_module_identifier__ = null
2047
+ var Component = normalizeComponent(
2048
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default.a,
2049
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_51f33e72_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__["a" /* default */],
2050
+ __vue_template_functional__,
2051
+ __vue_styles__,
2052
+ __vue_scopeId__,
2053
+ __vue_module_identifier__
2054
+ )
2055
+
2056
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
2057
+
2058
+
2059
+ /***/ }),
2060
+
2061
+ /***/ 190:
2062
+ /***/ (function(module, exports, __webpack_require__) {
2063
+
2064
+ "use strict";
2065
+
2066
+
2067
+ exports.__esModule = true;
2068
+
2069
+ var _util = __webpack_require__(11);
2070
+
2071
+ var _clickoutside = __webpack_require__(10);
2072
+
2073
+ var _clickoutside2 = _interopRequireDefault(_clickoutside);
2074
+
2075
+ var _locale = __webpack_require__(5);
2076
+
2077
+ var _locale2 = _interopRequireDefault(_locale);
2078
+
2079
+ var _time = __webpack_require__(31);
2080
+
2081
+ var _time2 = _interopRequireDefault(_time);
2082
+
2083
+ var _dateTable = __webpack_require__(49);
2084
+
2085
+ var _dateTable2 = _interopRequireDefault(_dateTable);
2086
+
2087
+ var _input = __webpack_require__(6);
2088
+
2089
+ var _input2 = _interopRequireDefault(_input);
2090
+
2091
+ var _button = __webpack_require__(15);
2092
+
2093
+ var _button2 = _interopRequireDefault(_button);
2094
+
2095
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2096
+
2097
+ var advanceDate = function advanceDate(date, amount) {
2098
+ return new Date(new Date(date).getTime() + amount);
2099
+ }; //
2100
+ //
2101
+ //
2102
+ //
2103
+ //
2104
+ //
2105
+ //
2106
+ //
2107
+ //
2108
+ //
2109
+ //
2110
+ //
2111
+ //
2112
+ //
2113
+ //
2114
+ //
2115
+ //
2116
+ //
2117
+ //
2118
+ //
2119
+ //
2120
+ //
2121
+ //
2122
+ //
2123
+ //
2124
+ //
2125
+ //
2126
+ //
2127
+ //
2128
+ //
2129
+ //
2130
+ //
2131
+ //
2132
+ //
2133
+ //
2134
+ //
2135
+ //
2136
+ //
2137
+ //
2138
+ //
2139
+ //
2140
+ //
2141
+ //
2142
+ //
2143
+ //
2144
+ //
2145
+ //
2146
+ //
2147
+ //
2148
+ //
2149
+ //
2150
+ //
2151
+ //
2152
+ //
2153
+ //
2154
+ //
2155
+ //
2156
+ //
2157
+ //
2158
+ //
2159
+ //
2160
+ //
2161
+ //
2162
+ //
2163
+ //
2164
+ //
2165
+ //
2166
+ //
2167
+ //
2168
+ //
2169
+ //
2170
+ //
2171
+ //
2172
+ //
2173
+ //
2174
+ //
2175
+ //
2176
+ //
2177
+ //
2178
+ //
2179
+ //
2180
+ //
2181
+ //
2182
+ //
2183
+ //
2184
+ //
2185
+ //
2186
+ //
2187
+ //
2188
+ //
2189
+ //
2190
+ //
2191
+ //
2192
+ //
2193
+ //
2194
+ //
2195
+ //
2196
+ //
2197
+ //
2198
+ //
2199
+ //
2200
+ //
2201
+ //
2202
+ //
2203
+ //
2204
+ //
2205
+ //
2206
+ //
2207
+ //
2208
+ //
2209
+ //
2210
+ //
2211
+ //
2212
+ //
2213
+ //
2214
+ //
2215
+ //
2216
+ //
2217
+ //
2218
+ //
2219
+ //
2220
+ //
2221
+ //
2222
+ //
2223
+ //
2224
+ //
2225
+ //
2226
+ //
2227
+ //
2228
+ //
2229
+ //
2230
+ //
2231
+ //
2232
+ //
2233
+ //
2234
+ //
2235
+ //
2236
+ //
2237
+ //
2238
+ //
2239
+ //
2240
+ //
2241
+ //
2242
+ //
2243
+ //
2244
+ //
2245
+ //
2246
+ //
2247
+ //
2248
+ //
2249
+ //
2250
+ //
2251
+ //
2252
+ //
2253
+ //
2254
+ //
2255
+ //
2256
+ //
2257
+ //
2258
+ //
2259
+ //
2260
+ //
2261
+ //
2262
+ //
2263
+ //
2264
+ //
2265
+ //
2266
+ //
2267
+ //
2268
+ //
2269
+ //
2270
+ //
2271
+ //
2272
+ //
2273
+ //
2274
+ //
2275
+ //
2276
+ //
2277
+ //
2278
+ //
2279
+ //
2280
+ //
2281
+ //
2282
+ //
2283
+ //
2284
+ //
2285
+
2286
+ var calcDefaultValue = function calcDefaultValue(defaultValue) {
2287
+ if (Array.isArray(defaultValue)) {
2288
+ return [new Date(defaultValue[0]), new Date(defaultValue[1])];
2289
+ } else if (defaultValue) {
2290
+ return [new Date(defaultValue), advanceDate(defaultValue, 24 * 60 * 60 * 1000)];
2291
+ } else {
2292
+ return [new Date(), advanceDate(Date.now(), 24 * 60 * 60 * 1000)];
2293
+ }
2294
+ };
2295
+
2296
+ exports.default = {
2297
+ mixins: [_locale2.default],
2298
+
2299
+ directives: { Clickoutside: _clickoutside2.default },
2300
+
2301
+ computed: {
2302
+ btnDisabled: function btnDisabled() {
2303
+ return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
2304
+ },
2305
+ leftLabel: function leftLabel() {
2306
+ return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.leftDate.getMonth() + 1));
2307
+ },
2308
+ rightLabel: function rightLabel() {
2309
+ return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.rightDate.getMonth() + 1));
2310
+ },
2311
+ leftYear: function leftYear() {
2312
+ return this.leftDate.getFullYear();
2313
+ },
2314
+ leftMonth: function leftMonth() {
2315
+ return this.leftDate.getMonth();
2316
+ },
2317
+ leftMonthDate: function leftMonthDate() {
2318
+ return this.leftDate.getDate();
2319
+ },
2320
+ rightYear: function rightYear() {
2321
+ return this.rightDate.getFullYear();
2322
+ },
2323
+ rightMonth: function rightMonth() {
2324
+ return this.rightDate.getMonth();
2325
+ },
2326
+ rightMonthDate: function rightMonthDate() {
2327
+ return this.rightDate.getDate();
2328
+ },
2329
+ minVisibleDate: function minVisibleDate() {
2330
+ return this.minDate ? (0, _util.formatDate)(this.minDate, this.dateFormat) : '';
2331
+ },
2332
+ maxVisibleDate: function maxVisibleDate() {
2333
+ return this.maxDate || this.minDate ? (0, _util.formatDate)(this.maxDate || this.minDate, this.dateFormat) : '';
2334
+ },
2335
+ minVisibleTime: function minVisibleTime() {
2336
+ return this.minDate ? (0, _util.formatDate)(this.minDate, this.timeFormat) : '';
2337
+ },
2338
+ maxVisibleTime: function maxVisibleTime() {
2339
+ return this.maxDate || this.minDate ? (0, _util.formatDate)(this.maxDate || this.minDate, this.timeFormat) : '';
2340
+ },
2341
+ timeFormat: function timeFormat() {
2342
+ if (this.format) {
2343
+ return (0, _util.extractTimeFormat)(this.format);
2344
+ } else {
2345
+ return 'HH:mm:ss';
2346
+ }
2347
+ },
2348
+ dateFormat: function dateFormat() {
2349
+ if (this.format) {
2350
+ return (0, _util.extractDateFormat)(this.format);
2351
+ } else {
2352
+ return 'yyyy-MM-dd';
2353
+ }
2354
+ },
2355
+ enableMonthArrow: function enableMonthArrow() {
2356
+ var nextMonth = (this.leftMonth + 1) % 12;
2357
+ var yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
2358
+ return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
2359
+ },
2360
+ enableYearArrow: function enableYearArrow() {
2361
+ return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
2362
+ }
2363
+ },
2364
+
2365
+ data: function data() {
2366
+ return {
2367
+ popperClass: '',
2368
+ value: [],
2369
+ defaultValue: null,
2370
+ defaultTime: null,
2371
+ minDate: '',
2372
+ maxDate: '',
2373
+ leftDate: new Date(),
2374
+ rightDate: (0, _util.nextMonth)(new Date()),
2375
+ rangeState: {
2376
+ endDate: null,
2377
+ selecting: false,
2378
+ row: null,
2379
+ column: null
2380
+ },
2381
+ showTime: false,
2382
+ shortcuts: '',
2383
+ visible: '',
2384
+ disabledDate: '',
2385
+ firstDayOfWeek: 7,
2386
+ minTimePickerVisible: false,
2387
+ maxTimePickerVisible: false,
2388
+ format: '',
2389
+ arrowControl: false,
2390
+ unlinkPanels: false
2391
+ };
2392
+ },
2393
+
2394
+
2395
+ watch: {
2396
+ minDate: function minDate(val) {
2397
+ var _this = this;
2398
+
2399
+ this.$nextTick(function () {
2400
+ if (_this.$refs.maxTimePicker && _this.maxDate && _this.maxDate < _this.minDate) {
2401
+ var format = 'HH:mm:ss';
2402
+ _this.$refs.maxTimePicker.selectableRange = [[(0, _util.parseDate)((0, _util.formatDate)(_this.minDate, format), format), (0, _util.parseDate)('23:59:59', format)]];
2403
+ }
2404
+ });
2405
+ if (val && this.$refs.minTimePicker) {
2406
+ this.$refs.minTimePicker.date = val;
2407
+ this.$refs.minTimePicker.value = val;
2408
+ }
2409
+ },
2410
+ maxDate: function maxDate(val) {
2411
+ if (val && this.$refs.maxTimePicker) {
2412
+ this.$refs.maxTimePicker.date = val;
2413
+ this.$refs.maxTimePicker.value = val;
2414
+ }
2415
+ },
2416
+ minTimePickerVisible: function minTimePickerVisible(val) {
2417
+ var _this2 = this;
2418
+
2419
+ if (val) {
2420
+ this.$nextTick(function () {
2421
+ _this2.$refs.minTimePicker.date = _this2.minDate;
2422
+ _this2.$refs.minTimePicker.value = _this2.minDate;
2423
+ _this2.$refs.minTimePicker.adjustSpinners();
2424
+ });
2425
+ }
2426
+ },
2427
+ maxTimePickerVisible: function maxTimePickerVisible(val) {
2428
+ var _this3 = this;
2429
+
2430
+ if (val) {
2431
+ this.$nextTick(function () {
2432
+ _this3.$refs.maxTimePicker.date = _this3.maxDate;
2433
+ _this3.$refs.maxTimePicker.value = _this3.maxDate;
2434
+ _this3.$refs.maxTimePicker.adjustSpinners();
2435
+ });
2436
+ }
2437
+ },
2438
+ value: function value(newVal) {
2439
+ if (!newVal) {
2440
+ this.minDate = null;
2441
+ this.maxDate = null;
2442
+ } else if (Array.isArray(newVal)) {
2443
+ this.minDate = (0, _util.isDate)(newVal[0]) ? new Date(newVal[0]) : null;
2444
+ this.maxDate = (0, _util.isDate)(newVal[1]) ? new Date(newVal[1]) : null;
2445
+ if (this.minDate) {
2446
+ this.leftDate = this.minDate;
2447
+ if (this.unlinkPanels && this.maxDate) {
2448
+ var minDateYear = this.minDate.getFullYear();
2449
+ var minDateMonth = this.minDate.getMonth();
2450
+ var maxDateYear = this.maxDate.getFullYear();
2451
+ var maxDateMonth = this.maxDate.getMonth();
2452
+ this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? (0, _util.nextMonth)(this.maxDate) : this.maxDate;
2453
+ } else {
2454
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2455
+ }
2456
+ } else {
2457
+ this.leftDate = calcDefaultValue(this.defaultValue)[0];
2458
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2459
+ }
2460
+ }
2461
+ },
2462
+ defaultValue: function defaultValue(val) {
2463
+ if (!Array.isArray(this.value)) {
2464
+ var _calcDefaultValue = calcDefaultValue(val),
2465
+ left = _calcDefaultValue[0],
2466
+ right = _calcDefaultValue[1];
2467
+
2468
+ this.leftDate = left;
2469
+ this.rightDate = val && val[1] && this.unlinkPanels ? right : (0, _util.nextMonth)(this.leftDate);
2470
+ }
2471
+ }
2472
+ },
2473
+
2474
+ methods: {
2475
+ handleClear: function handleClear() {
2476
+ this.minDate = null;
2477
+ this.maxDate = null;
2478
+ this.leftDate = calcDefaultValue(this.defaultValue)[0];
2479
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2480
+ this.$emit('pick', null);
2481
+ },
2482
+ handleChangeRange: function handleChangeRange(val) {
2483
+ this.minDate = val.minDate;
2484
+ this.maxDate = val.maxDate;
2485
+ this.rangeState = val.rangeState;
2486
+ },
2487
+ handleDateInput: function handleDateInput(event, type) {
2488
+ var value = event.target.value;
2489
+ if (value.length !== this.dateFormat.length) return;
2490
+ var parsedValue = (0, _util.parseDate)(value, this.dateFormat);
2491
+
2492
+ if (parsedValue) {
2493
+ if (typeof this.disabledDate === 'function' && this.disabledDate(new Date(parsedValue))) {
2494
+ return;
2495
+ }
2496
+ if (type === 'min') {
2497
+ this.minDate = new Date(parsedValue);
2498
+ this.leftDate = new Date(parsedValue);
2499
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2500
+ } else {
2501
+ this.maxDate = new Date(parsedValue);
2502
+ this.leftDate = (0, _util.prevMonth)(parsedValue);
2503
+ this.rightDate = new Date(parsedValue);
2504
+ }
2505
+ }
2506
+ },
2507
+ handleDateChange: function handleDateChange(event, type) {
2508
+ var value = event.target.value;
2509
+ var parsedValue = (0, _util.parseDate)(value, this.dateFormat);
2510
+ if (parsedValue) {
2511
+ if (type === 'min') {
2512
+ this.minDate = (0, _util.modifyDate)(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
2513
+ if (this.minDate > this.maxDate) {
2514
+ this.maxDate = this.minDate;
2515
+ }
2516
+ } else {
2517
+ this.maxDate = (0, _util.modifyDate)(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
2518
+ if (this.maxDate < this.minDate) {
2519
+ this.minDate = this.maxDate;
2520
+ }
2521
+ }
2522
+ }
2523
+ },
2524
+ handleTimeChange: function handleTimeChange(event, type) {
2525
+ var value = event.target.value;
2526
+ var parsedValue = (0, _util.parseDate)(value, this.timeFormat);
2527
+ if (parsedValue) {
2528
+ if (type === 'min') {
2529
+ this.minDate = (0, _util.modifyTime)(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
2530
+ if (this.minDate > this.maxDate) {
2531
+ this.maxDate = this.minDate;
2532
+ }
2533
+ this.$refs.minTimePicker.value = this.minDate;
2534
+ this.minTimePickerVisible = false;
2535
+ } else {
2536
+ this.maxDate = (0, _util.modifyTime)(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
2537
+ if (this.maxDate < this.minDate) {
2538
+ this.minDate = this.maxDate;
2539
+ }
2540
+ this.$refs.maxTimePicker.value = this.minDate;
2541
+ this.maxTimePickerVisible = false;
2542
+ }
2543
+ }
2544
+ },
2545
+ handleRangePick: function handleRangePick(val) {
2546
+ var _this4 = this;
2547
+
2548
+ var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2549
+
2550
+ var defaultTime = this.defaultTime || [];
2551
+ var minDate = (0, _util.modifyWithTimeString)(val.minDate, defaultTime[0]);
2552
+ var maxDate = (0, _util.modifyWithTimeString)(val.maxDate, defaultTime[1]);
2553
+
2554
+ if (this.maxDate === maxDate && this.minDate === minDate) {
2555
+ return;
2556
+ }
2557
+ this.onPick && this.onPick(val);
2558
+ this.maxDate = maxDate;
2559
+ this.minDate = minDate;
2560
+
2561
+ // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
2562
+ setTimeout(function () {
2563
+ _this4.maxDate = maxDate;
2564
+ _this4.minDate = minDate;
2565
+ }, 10);
2566
+ if (!close || this.showTime) return;
2567
+ this.handleConfirm();
2568
+ },
2569
+ handleShortcutClick: function handleShortcutClick(shortcut) {
2570
+ if (shortcut.onClick) {
2571
+ shortcut.onClick(this);
2572
+ }
2573
+ },
2574
+ handleMinTimePick: function handleMinTimePick(value, visible, first) {
2575
+ this.minDate = this.minDate || new Date();
2576
+ if (value) {
2577
+ this.minDate = (0, _util.modifyTime)(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
2578
+ }
2579
+
2580
+ if (!first) {
2581
+ this.minTimePickerVisible = visible;
2582
+ }
2583
+
2584
+ if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
2585
+ this.maxDate = new Date(this.minDate);
2586
+ }
2587
+ },
2588
+ handleMinTimeClose: function handleMinTimeClose() {
2589
+ this.minTimePickerVisible = false;
2590
+ },
2591
+ handleMaxTimePick: function handleMaxTimePick(value, visible, first) {
2592
+ if (this.maxDate && value) {
2593
+ this.maxDate = (0, _util.modifyTime)(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
2594
+ }
2595
+
2596
+ if (!first) {
2597
+ this.maxTimePickerVisible = visible;
2598
+ }
2599
+
2600
+ if (this.maxDate && this.minDate && this.minDate.getTime() > this.maxDate.getTime()) {
2601
+ this.minDate = new Date(this.maxDate);
2602
+ }
2603
+ },
2604
+ handleMaxTimeClose: function handleMaxTimeClose() {
2605
+ this.maxTimePickerVisible = false;
2606
+ },
2607
+
2608
+
2609
+ // leftPrev*, rightNext* need to take care of `unlinkPanels`
2610
+ leftPrevYear: function leftPrevYear() {
2611
+ this.leftDate = (0, _util.prevYear)(this.leftDate);
2612
+ if (!this.unlinkPanels) {
2613
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2614
+ }
2615
+ },
2616
+ leftPrevMonth: function leftPrevMonth() {
2617
+ this.leftDate = (0, _util.prevMonth)(this.leftDate);
2618
+ if (!this.unlinkPanels) {
2619
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2620
+ }
2621
+ },
2622
+ rightNextYear: function rightNextYear() {
2623
+ if (!this.unlinkPanels) {
2624
+ this.leftDate = (0, _util.nextYear)(this.leftDate);
2625
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2626
+ } else {
2627
+ this.rightDate = (0, _util.nextYear)(this.rightDate);
2628
+ }
2629
+ },
2630
+ rightNextMonth: function rightNextMonth() {
2631
+ if (!this.unlinkPanels) {
2632
+ this.leftDate = (0, _util.nextMonth)(this.leftDate);
2633
+ this.rightDate = (0, _util.nextMonth)(this.leftDate);
2634
+ } else {
2635
+ this.rightDate = (0, _util.nextMonth)(this.rightDate);
2636
+ }
2637
+ },
2638
+
2639
+
2640
+ // leftNext*, rightPrev* are called when `unlinkPanels` is true
2641
+ leftNextYear: function leftNextYear() {
2642
+ this.leftDate = (0, _util.nextYear)(this.leftDate);
2643
+ },
2644
+ leftNextMonth: function leftNextMonth() {
2645
+ this.leftDate = (0, _util.nextMonth)(this.leftDate);
2646
+ },
2647
+ rightPrevYear: function rightPrevYear() {
2648
+ this.rightDate = (0, _util.prevYear)(this.rightDate);
2649
+ },
2650
+ rightPrevMonth: function rightPrevMonth() {
2651
+ this.rightDate = (0, _util.prevMonth)(this.rightDate);
2652
+ },
2653
+ handleConfirm: function handleConfirm() {
2654
+ var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2655
+
2656
+ if (this.isValidValue([this.minDate, this.maxDate])) {
2657
+ this.$emit('pick', [this.minDate, this.maxDate], visible);
2658
+ }
2659
+ },
2660
+ isValidValue: function isValidValue(value) {
2661
+ return Array.isArray(value) && value && value[0] && value[1] && (0, _util.isDate)(value[0]) && (0, _util.isDate)(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === 'function' ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
2662
+ },
2663
+ resetView: function resetView() {
2664
+ // NOTE: this is a hack to reset {min, max}Date on picker open.
2665
+ // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
2666
+ // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
2667
+ this.minDate = this.value && (0, _util.isDate)(this.value[0]) ? new Date(this.value[0]) : null;
2668
+ this.maxDate = this.value && (0, _util.isDate)(this.value[0]) ? new Date(this.value[1]) : null;
2669
+ }
2670
+ },
2671
+
2672
+ components: { TimePicker: _time2.default, DateTable: _dateTable2.default, ElInput: _input2.default, ElButton: _button2.default }
2673
+ };
2674
+
2675
+ /***/ }),
2676
+
2677
+ /***/ 191:
2678
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2679
+
2680
+ "use strict";
2681
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"},on:{"after-leave":function($event){_vm.$emit('dodestroy')}}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{
2682
+ 'has-sidebar': _vm.$slots.sidebar || _vm.shortcuts,
2683
+ 'has-time': _vm.showTime
2684
+ }, _vm.popperClass]},[_c('div',{staticClass:"el-picker-panel__body-wrapper"},[_vm._t("sidebar"),(_vm.shortcuts)?_c('div',{staticClass:"el-picker-panel__sidebar"},_vm._l((_vm.shortcuts),function(shortcut,key){return _c('button',{key:key,staticClass:"el-picker-panel__shortcut",attrs:{"type":"button"},on:{"click":function($event){_vm.handleShortcutClick(shortcut)}}},[_vm._v(_vm._s(shortcut.text))])})):_vm._e(),_c('div',{staticClass:"el-picker-panel__body"},[(_vm.showTime)?_c('div',{staticClass:"el-date-range-picker__time-header"},[_c('span',{staticClass:"el-date-range-picker__editors-wrap"},[_c('span',{staticClass:"el-date-range-picker__time-picker-wrap"},[_c('el-input',{ref:"minInput",staticClass:"el-date-range-picker__editor",attrs:{"size":"small","disabled":_vm.rangeState.selecting,"placeholder":_vm.t('el.datepicker.startDate'),"value":_vm.minVisibleDate},nativeOn:{"input":function($event){_vm.handleDateInput($event, 'min')},"change":function($event){_vm.handleDateChange($event, 'min')}}})],1),_c('span',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleMinTimeClose),expression:"handleMinTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[_c('el-input',{staticClass:"el-date-range-picker__editor",attrs:{"size":"small","disabled":_vm.rangeState.selecting,"placeholder":_vm.t('el.datepicker.startTime'),"value":_vm.minVisibleTime},on:{"focus":function($event){_vm.minTimePickerVisible = true}},nativeOn:{"change":function($event){_vm.handleTimeChange($event, 'min')}}}),_c('time-picker',{ref:"minTimePicker",attrs:{"time-arrow-control":_vm.arrowControl,"visible":_vm.minTimePickerVisible},on:{"pick":_vm.handleMinTimePick,"mounted":function($event){_vm.$refs.minTimePicker.format=_vm.timeFormat}}})],1)]),_c('span',{staticClass:"el-icon-arrow-right"}),_c('span',{staticClass:"el-date-range-picker__editors-wrap is-right"},[_c('span',{staticClass:"el-date-range-picker__time-picker-wrap"},[_c('el-input',{staticClass:"el-date-range-picker__editor",attrs:{"size":"small","disabled":_vm.rangeState.selecting,"placeholder":_vm.t('el.datepicker.endDate'),"value":_vm.maxVisibleDate,"readonly":!_vm.minDate},nativeOn:{"input":function($event){_vm.handleDateInput($event, 'max')},"change":function($event){_vm.handleDateChange($event, 'max')}}})],1),_c('span',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleMaxTimeClose),expression:"handleMaxTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[_c('el-input',{ref:"maxInput",staticClass:"el-date-range-picker__editor",attrs:{"size":"small","disabled":_vm.rangeState.selecting,"placeholder":_vm.t('el.datepicker.endTime'),"value":_vm.maxVisibleTime,"readonly":!_vm.minDate},on:{"focus":function($event){_vm.minDate && (_vm.maxTimePickerVisible = true)}},nativeOn:{"change":function($event){_vm.handleTimeChange($event, 'max')}}}),_c('time-picker',{ref:"maxTimePicker",attrs:{"time-arrow-control":_vm.arrowControl,"visible":_vm.maxTimePickerVisible},on:{"pick":_vm.handleMaxTimePick,"mounted":function($event){_vm.$refs.maxTimePicker.format=_vm.timeFormat}}})],1)])]):_vm._e(),_c('div',{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[_c('div',{staticClass:"el-date-range-picker__header"},[_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{"type":"button"},on:{"click":_vm.leftPrevYear}}),_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",attrs:{"type":"button"},on:{"click":_vm.leftPrevMonth}}),(_vm.unlinkPanels)?_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{ 'is-disabled': !_vm.enableYearArrow },attrs:{"type":"button","disabled":!_vm.enableYearArrow},on:{"click":_vm.leftNextYear}}):_vm._e(),(_vm.unlinkPanels)?_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",class:{ 'is-disabled': !_vm.enableMonthArrow },attrs:{"type":"button","disabled":!_vm.enableMonthArrow},on:{"click":_vm.leftNextMonth}}):_vm._e(),_c('div',[_vm._v(_vm._s(_vm.leftLabel))])]),_c('date-table',{attrs:{"selection-mode":"range","date":_vm.leftDate,"default-value":_vm.defaultValue,"min-date":_vm.minDate,"max-date":_vm.maxDate,"range-state":_vm.rangeState,"disabled-date":_vm.disabledDate,"first-day-of-week":_vm.firstDayOfWeek},on:{"changerange":_vm.handleChangeRange,"pick":_vm.handleRangePick}})],1),_c('div',{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[_c('div',{staticClass:"el-date-range-picker__header"},[(_vm.unlinkPanels)?_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{ 'is-disabled': !_vm.enableYearArrow },attrs:{"type":"button","disabled":!_vm.enableYearArrow},on:{"click":_vm.rightPrevYear}}):_vm._e(),(_vm.unlinkPanels)?_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",class:{ 'is-disabled': !_vm.enableMonthArrow },attrs:{"type":"button","disabled":!_vm.enableMonthArrow},on:{"click":_vm.rightPrevMonth}}):_vm._e(),_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{"type":"button"},on:{"click":_vm.rightNextYear}}),_c('button',{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",attrs:{"type":"button"},on:{"click":_vm.rightNextMonth}}),_c('div',[_vm._v(_vm._s(_vm.rightLabel))])]),_c('date-table',{attrs:{"selection-mode":"range","date":_vm.rightDate,"default-value":_vm.defaultValue,"min-date":_vm.minDate,"max-date":_vm.maxDate,"range-state":_vm.rangeState,"disabled-date":_vm.disabledDate,"first-day-of-week":_vm.firstDayOfWeek},on:{"changerange":_vm.handleChangeRange,"pick":_vm.handleRangePick}})],1)])],2),(_vm.showTime)?_c('div',{staticClass:"el-picker-panel__footer"},[_c('el-button',{staticClass:"el-picker-panel__link-btn",attrs:{"size":"mini","type":"text"},on:{"click":_vm.handleClear}},[_vm._v("\n "+_vm._s(_vm.t('el.datepicker.clear'))+"\n ")]),_c('el-button',{staticClass:"el-picker-panel__link-btn",attrs:{"plain":"","size":"mini","disabled":_vm.btnDisabled},on:{"click":function($event){_vm.handleConfirm(false)}}},[_vm._v("\n "+_vm._s(_vm.t('el.datepicker.confirm'))+"\n ")])],1):_vm._e()])])}
2685
+ var staticRenderFns = []
2686
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
2687
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
2688
+
2689
+ /***/ }),
2690
+
2691
+ /***/ 2:
2692
+ /***/ (function(module, exports) {
2693
+
2694
+ module.exports = require("element-ui/lib/utils/util");
2695
+
2696
+ /***/ }),
2697
+
2698
+ /***/ 24:
2699
+ /***/ (function(module, exports, __webpack_require__) {
2700
+
2701
+ "use strict";
2702
+
2703
+
2704
+ exports.__esModule = true;
2705
+
2706
+ var _dom = __webpack_require__(3);
2707
+
2708
+ exports.default = {
2709
+ bind: function bind(el, binding, vnode) {
2710
+ var interval = null;
2711
+ var startTime = void 0;
2712
+ var handler = function handler() {
2713
+ return vnode.context[binding.expression].apply();
2714
+ };
2715
+ var clear = function clear() {
2716
+ if (new Date() - startTime < 100) {
2717
+ handler();
2718
+ }
2719
+ clearInterval(interval);
2720
+ interval = null;
2721
+ };
2722
+
2723
+ (0, _dom.on)(el, 'mousedown', function (e) {
2724
+ if (e.button !== 0) return;
2725
+ startTime = new Date();
2726
+ (0, _dom.once)(document, 'mouseup', clear);
2727
+ clearInterval(interval);
2728
+ interval = setInterval(handler, 100);
2729
+ });
2730
+ }
2731
+ };
2732
+
2733
+ /***/ }),
2734
+
2735
+ /***/ 27:
2736
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
2737
+
2738
+ "use strict";
2739
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
2740
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__ = __webpack_require__(28);
2741
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__);
2742
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_66b1c70c_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__ = __webpack_require__(30);
2743
+ var normalizeComponent = __webpack_require__(0)
2744
+ /* script */
2745
+
2746
+ /* template */
2747
+
2748
+ /* template functional */
2749
+ var __vue_template_functional__ = false
2750
+ /* styles */
2751
+ var __vue_styles__ = null
2752
+ /* scopeId */
2753
+ var __vue_scopeId__ = null
2754
+ /* moduleIdentifier (server only) */
2755
+ var __vue_module_identifier__ = null
2756
+ var Component = normalizeComponent(
2757
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default.a,
2758
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_66b1c70c_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["a" /* default */],
2759
+ __vue_template_functional__,
2760
+ __vue_styles__,
2761
+ __vue_scopeId__,
2762
+ __vue_module_identifier__
2763
+ )
2764
+
2765
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
2766
+
2767
+
2768
+ /***/ }),
2769
+
2770
+ /***/ 28:
2771
+ /***/ (function(module, exports, __webpack_require__) {
2772
+
2773
+ "use strict";
2774
+
2775
+
2776
+ exports.__esModule = true;
2777
+
2778
+ var _vue = __webpack_require__(4);
2779
+
2780
+ var _vue2 = _interopRequireDefault(_vue);
2781
+
2782
+ var _clickoutside = __webpack_require__(10);
2783
+
2784
+ var _clickoutside2 = _interopRequireDefault(_clickoutside);
2785
+
2786
+ var _util = __webpack_require__(11);
2787
+
2788
+ var _vuePopper = __webpack_require__(7);
2789
+
2790
+ var _vuePopper2 = _interopRequireDefault(_vuePopper);
2791
+
2792
+ var _emitter = __webpack_require__(1);
2793
+
2794
+ var _emitter2 = _interopRequireDefault(_emitter);
2795
+
2796
+ var _input = __webpack_require__(6);
2797
+
2798
+ var _input2 = _interopRequireDefault(_input);
2799
+
2800
+ var _merge = __webpack_require__(9);
2801
+
2802
+ var _merge2 = _interopRequireDefault(_merge);
2803
+
2804
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2805
+
2806
+ var NewPopper = {
2807
+ props: {
2808
+ appendToBody: _vuePopper2.default.props.appendToBody,
2809
+ offset: _vuePopper2.default.props.offset,
2810
+ boundariesPadding: _vuePopper2.default.props.boundariesPadding,
2811
+ arrowOffset: _vuePopper2.default.props.arrowOffset
2812
+ },
2813
+ methods: _vuePopper2.default.methods,
2814
+ data: function data() {
2815
+ return (0, _merge2.default)({ visibleArrow: true }, _vuePopper2.default.data);
2816
+ },
2817
+
2818
+ beforeDestroy: _vuePopper2.default.beforeDestroy
2819
+ }; //
2820
+ //
2821
+ //
2822
+ //
2823
+ //
2824
+ //
2825
+ //
2826
+ //
2827
+ //
2828
+ //
2829
+ //
2830
+ //
2831
+ //
2832
+ //
2833
+ //
2834
+ //
2835
+ //
2836
+ //
2837
+ //
2838
+ //
2839
+ //
2840
+ //
2841
+ //
2842
+ //
2843
+ //
2844
+ //
2845
+ //
2846
+ //
2847
+ //
2848
+ //
2849
+ //
2850
+ //
2851
+ //
2852
+ //
2853
+ //
2854
+ //
2855
+ //
2856
+ //
2857
+ //
2858
+ //
2859
+ //
2860
+ //
2861
+ //
2862
+ //
2863
+ //
2864
+ //
2865
+ //
2866
+ //
2867
+ //
2868
+ //
2869
+ //
2870
+ //
2871
+ //
2872
+ //
2873
+ //
2874
+ //
2875
+ //
2876
+ //
2877
+ //
2878
+ //
2879
+ //
2880
+ //
2881
+ //
2882
+ //
2883
+ //
2884
+ //
2885
+ //
2886
+ //
2887
+ //
2888
+ //
2889
+ //
2890
+ //
2891
+ //
2892
+ //
2893
+ //
2894
+ //
2895
+ //
2896
+ //
2897
+ //
2898
+ //
2899
+ //
2900
+ //
2901
+ //
2902
+ //
2903
+ //
2904
+
2905
+ var DEFAULT_FORMATS = {
2906
+ date: 'yyyy-MM-dd',
2907
+ month: 'yyyy-MM',
2908
+ datetime: 'yyyy-MM-dd HH:mm:ss',
2909
+ time: 'HH:mm:ss',
2910
+ week: 'yyyywWW',
2911
+ timerange: 'HH:mm:ss',
2912
+ daterange: 'yyyy-MM-dd',
2913
+ datetimerange: 'yyyy-MM-dd HH:mm:ss',
2914
+ year: 'yyyy'
2915
+ };
2916
+ var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'timerange', 'datetimerange', 'dates'];
2917
+ var DATE_FORMATTER = function DATE_FORMATTER(value, format) {
2918
+ if (format === 'timestamp') return value.getTime();
2919
+ return (0, _util.formatDate)(value, format);
2920
+ };
2921
+ var DATE_PARSER = function DATE_PARSER(text, format) {
2922
+ if (format === 'timestamp') return new Date(Number(text));
2923
+ return (0, _util.parseDate)(text, format);
2924
+ };
2925
+ var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
2926
+ if (Array.isArray(value) && value.length === 2) {
2927
+ var start = value[0];
2928
+ var end = value[1];
2929
+
2930
+ if (start && end) {
2931
+ return [DATE_FORMATTER(start, format), DATE_FORMATTER(end, format)];
2932
+ }
2933
+ }
2934
+ return '';
2935
+ };
2936
+ var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
2937
+ if (!Array.isArray(array)) {
2938
+ array = array.split(separator);
2939
+ }
2940
+ if (array.length === 2) {
2941
+ var range1 = array[0];
2942
+ var range2 = array[1];
2943
+
2944
+ return [DATE_PARSER(range1, format), DATE_PARSER(range2, format)];
2945
+ }
2946
+ return [];
2947
+ };
2948
+ var TYPE_VALUE_RESOLVER_MAP = {
2949
+ default: {
2950
+ formatter: function formatter(value) {
2951
+ if (!value) return '';
2952
+ return '' + value;
2953
+ },
2954
+ parser: function parser(text) {
2955
+ if (text === undefined || text === '') return null;
2956
+ return text;
2957
+ }
2958
+ },
2959
+ week: {
2960
+ formatter: function formatter(value, format) {
2961
+ var week = (0, _util.getWeekNumber)(value);
2962
+ var month = value.getMonth();
2963
+ var trueDate = new Date(value);
2964
+ if (week === 1 && month === 11) {
2965
+ trueDate.setHours(0, 0, 0, 0);
2966
+ trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
2967
+ }
2968
+ var date = (0, _util.formatDate)(trueDate, format);
2969
+
2970
+ date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
2971
+ return date;
2972
+ },
2973
+ parser: function parser(text) {
2974
+ var array = (text || '').split('w');
2975
+ if (array.length === 2) {
2976
+ var year = Number(array[0]);
2977
+ var month = Number(array[1]);
2978
+
2979
+ if (!isNaN(year) && !isNaN(month) && month < 54) {
2980
+ return text;
2981
+ }
2982
+ }
2983
+ return null;
2984
+ }
2985
+ },
2986
+ date: {
2987
+ formatter: DATE_FORMATTER,
2988
+ parser: DATE_PARSER
2989
+ },
2990
+ datetime: {
2991
+ formatter: DATE_FORMATTER,
2992
+ parser: DATE_PARSER
2993
+ },
2994
+ daterange: {
2995
+ formatter: RANGE_FORMATTER,
2996
+ parser: RANGE_PARSER
2997
+ },
2998
+ datetimerange: {
2999
+ formatter: RANGE_FORMATTER,
3000
+ parser: RANGE_PARSER
3001
+ },
3002
+ timerange: {
3003
+ formatter: RANGE_FORMATTER,
3004
+ parser: RANGE_PARSER
3005
+ },
3006
+ time: {
3007
+ formatter: DATE_FORMATTER,
3008
+ parser: DATE_PARSER
3009
+ },
3010
+ month: {
3011
+ formatter: DATE_FORMATTER,
3012
+ parser: DATE_PARSER
3013
+ },
3014
+ year: {
3015
+ formatter: DATE_FORMATTER,
3016
+ parser: DATE_PARSER
3017
+ },
3018
+ number: {
3019
+ formatter: function formatter(value) {
3020
+ if (!value) return '';
3021
+ return '' + value;
3022
+ },
3023
+ parser: function parser(text) {
3024
+ var result = Number(text);
3025
+
3026
+ if (!isNaN(text)) {
3027
+ return result;
3028
+ } else {
3029
+ return null;
3030
+ }
3031
+ }
3032
+ },
3033
+ dates: {
3034
+ formatter: function formatter(value, format) {
3035
+ return value.map(function (date) {
3036
+ return DATE_FORMATTER(date, format);
3037
+ });
3038
+ },
3039
+ parser: function parser(value, format) {
3040
+ return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
3041
+ return date instanceof Date ? date : DATE_PARSER(date, format);
3042
+ });
3043
+ }
3044
+ }
3045
+ };
3046
+ var PLACEMENT_MAP = {
3047
+ left: 'bottom-start',
3048
+ center: 'bottom',
3049
+ right: 'bottom-end'
3050
+ };
3051
+
3052
+ var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
3053
+ var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
3054
+
3055
+ if (!value) return null;
3056
+ var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
3057
+ var format = customFormat || DEFAULT_FORMATS[type];
3058
+ return parser(value, format, rangeSeparator);
3059
+ };
3060
+
3061
+ var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
3062
+ if (!value) return null;
3063
+ var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
3064
+ var format = customFormat || DEFAULT_FORMATS[type];
3065
+ return formatter(value, format);
3066
+ };
3067
+
3068
+ /*
3069
+ * Considers:
3070
+ * 1. Date object
3071
+ * 2. date string
3072
+ * 3. array of 1 or 2
3073
+ */
3074
+ var valueEquals = function valueEquals(a, b) {
3075
+ // considers Date object and string
3076
+ var dateEquals = function dateEquals(a, b) {
3077
+ var aIsDate = a instanceof Date;
3078
+ var bIsDate = b instanceof Date;
3079
+ if (aIsDate && bIsDate) {
3080
+ return a.getTime() === b.getTime();
3081
+ }
3082
+ if (!aIsDate && !bIsDate) {
3083
+ return a === b;
3084
+ }
3085
+ return false;
3086
+ };
3087
+
3088
+ var aIsArray = a instanceof Array;
3089
+ var bIsArray = b instanceof Array;
3090
+ if (aIsArray && bIsArray) {
3091
+ if (a.length !== b.length) {
3092
+ return false;
3093
+ }
3094
+ return a.every(function (item, index) {
3095
+ return dateEquals(item, b[index]);
3096
+ });
3097
+ }
3098
+ if (!aIsArray && !bIsArray) {
3099
+ return dateEquals(a, b);
3100
+ }
3101
+ return false;
3102
+ };
3103
+
3104
+ var isString = function isString(val) {
3105
+ return typeof val === 'string' || val instanceof String;
3106
+ };
3107
+
3108
+ var validator = function validator(val) {
3109
+ // either: String, Array of String, null / undefined
3110
+ return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
3111
+ };
3112
+
3113
+ exports.default = {
3114
+ mixins: [_emitter2.default, NewPopper],
3115
+
3116
+ inject: {
3117
+ elForm: {
3118
+ default: ''
3119
+ },
3120
+ elFormItem: {
3121
+ default: ''
3122
+ }
3123
+ },
3124
+
3125
+ props: {
3126
+ size: String,
3127
+ format: String,
3128
+ valueFormat: String,
3129
+ readonly: Boolean,
3130
+ placeholder: String,
3131
+ startPlaceholder: String,
3132
+ endPlaceholder: String,
3133
+ prefixIcon: String,
3134
+ clearIcon: {
3135
+ type: String,
3136
+ default: 'el-icon-circle-close'
3137
+ },
3138
+ name: {
3139
+ default: '',
3140
+ validator: validator
3141
+ },
3142
+ disabled: Boolean,
3143
+ clearable: {
3144
+ type: Boolean,
3145
+ default: true
3146
+ },
3147
+ id: {
3148
+ default: '',
3149
+ validator: validator
3150
+ },
3151
+ popperClass: String,
3152
+ editable: {
3153
+ type: Boolean,
3154
+ default: true
3155
+ },
3156
+ align: {
3157
+ type: String,
3158
+ default: 'left'
3159
+ },
3160
+ value: {},
3161
+ defaultValue: {},
3162
+ defaultTime: {},
3163
+ rangeSeparator: {
3164
+ default: '-'
3165
+ },
3166
+ pickerOptions: {},
3167
+ unlinkPanels: Boolean
3168
+ },
3169
+
3170
+ components: { ElInput: _input2.default },
3171
+
3172
+ directives: { Clickoutside: _clickoutside2.default },
3173
+
3174
+ data: function data() {
3175
+ return {
3176
+ pickerVisible: false,
3177
+ showClose: false,
3178
+ userInput: null,
3179
+ valueOnOpen: null, // value when picker opens, used to determine whether to emit change
3180
+ unwatchPickerOptions: null
3181
+ };
3182
+ },
3183
+
3184
+
3185
+ watch: {
3186
+ pickerVisible: function pickerVisible(val) {
3187
+ if (this.readonly || this.pickerDisabled) return;
3188
+ if (val) {
3189
+ this.showPicker();
3190
+ this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
3191
+ } else {
3192
+ this.hidePicker();
3193
+ this.emitChange(this.value);
3194
+ this.userInput = null;
3195
+ this.dispatch('ElFormItem', 'el.form.blur');
3196
+ this.$emit('blur', this);
3197
+ this.blur();
3198
+ }
3199
+ },
3200
+
3201
+ parsedValue: {
3202
+ immediate: true,
3203
+ handler: function handler(val) {
3204
+ if (this.picker) {
3205
+ this.picker.value = val;
3206
+ }
3207
+ }
3208
+ },
3209
+ defaultValue: function defaultValue(val) {
3210
+ // NOTE: should eventually move to jsx style picker + panel ?
3211
+ if (this.picker) {
3212
+ this.picker.defaultValue = val;
3213
+ }
3214
+ },
3215
+ value: function value(val, oldVal) {
3216
+ if (!valueEquals(val, oldVal) && !this.pickerVisible) {
3217
+ this.dispatch('ElFormItem', 'el.form.change', val);
3218
+ }
3219
+ }
3220
+ },
3221
+
3222
+ computed: {
3223
+ ranged: function ranged() {
3224
+ return this.type.indexOf('range') > -1;
3225
+ },
3226
+ reference: function reference() {
3227
+ var reference = this.$refs.reference;
3228
+ return reference.$el || reference;
3229
+ },
3230
+ refInput: function refInput() {
3231
+ if (this.reference) {
3232
+ return [].slice.call(this.reference.querySelectorAll('input'));
3233
+ }
3234
+ return [];
3235
+ },
3236
+ valueIsEmpty: function valueIsEmpty() {
3237
+ var val = this.value;
3238
+ if (Array.isArray(val)) {
3239
+ for (var i = 0, len = val.length; i < len; i++) {
3240
+ if (val[i]) {
3241
+ return false;
3242
+ }
3243
+ }
3244
+ } else {
3245
+ if (val) {
3246
+ return false;
3247
+ }
3248
+ }
3249
+ return true;
3250
+ },
3251
+ triggerClass: function triggerClass() {
3252
+ return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
3253
+ },
3254
+ selectionMode: function selectionMode() {
3255
+ if (this.type === 'week') {
3256
+ return 'week';
3257
+ } else if (this.type === 'month') {
3258
+ return 'month';
3259
+ } else if (this.type === 'year') {
3260
+ return 'year';
3261
+ } else if (this.type === 'dates') {
3262
+ return 'dates';
3263
+ }
3264
+
3265
+ return 'day';
3266
+ },
3267
+ haveTrigger: function haveTrigger() {
3268
+ if (typeof this.showTrigger !== 'undefined') {
3269
+ return this.showTrigger;
3270
+ }
3271
+ return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
3272
+ },
3273
+ displayValue: function displayValue() {
3274
+ var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
3275
+ if (Array.isArray(this.userInput)) {
3276
+ return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
3277
+ } else if (this.userInput !== null) {
3278
+ return this.userInput;
3279
+ } else if (formattedValue) {
3280
+ return this.type === 'dates' ? formattedValue.join(', ') : formattedValue;
3281
+ } else {
3282
+ return '';
3283
+ }
3284
+ },
3285
+ parsedValue: function parsedValue() {
3286
+ if (!this.value) return this.value; // component value is not set
3287
+ if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
3288
+
3289
+ var valueIsDateObject = (0, _util.isDateObject)(this.value) || Array.isArray(this.value) && this.value.every(_util.isDateObject);
3290
+ if (valueIsDateObject) {
3291
+ return this.value;
3292
+ }
3293
+
3294
+ if (this.valueFormat) {
3295
+ return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
3296
+ }
3297
+
3298
+ // NOTE: deal with common but incorrect usage, should remove in next major version
3299
+ // user might provide string / timestamp without value-format, coerce them into date (or array of date)
3300
+ return Array.isArray(this.value) ? this.value.map(function (val) {
3301
+ return new Date(val);
3302
+ }) : new Date(this.value);
3303
+ },
3304
+ _elFormItemSize: function _elFormItemSize() {
3305
+ return (this.elFormItem || {}).elFormItemSize;
3306
+ },
3307
+ pickerSize: function pickerSize() {
3308
+ return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
3309
+ },
3310
+ pickerDisabled: function pickerDisabled() {
3311
+ return this.disabled || (this.elForm || {}).disabled;
3312
+ },
3313
+ firstInputId: function firstInputId() {
3314
+ var obj = {};
3315
+ var id = void 0;
3316
+ if (this.ranged) {
3317
+ id = this.id && this.id[0];
3318
+ } else {
3319
+ id = this.id;
3320
+ }
3321
+ if (id) obj.id = id;
3322
+ return obj;
3323
+ },
3324
+ secondInputId: function secondInputId() {
3325
+ var obj = {};
3326
+ var id = void 0;
3327
+ if (this.ranged) {
3328
+ id = this.id && this.id[1];
3329
+ }
3330
+ if (id) obj.id = id;
3331
+ return obj;
3332
+ }
3333
+ },
3334
+
3335
+ created: function created() {
3336
+ // vue-popper
3337
+ this.popperOptions = {
3338
+ boundariesPadding: 0,
3339
+ gpuAcceleration: false
3340
+ };
3341
+ this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
3342
+
3343
+ this.$on('fieldReset', this.handleFieldReset);
3344
+ },
3345
+
3346
+
3347
+ methods: {
3348
+ focus: function focus() {
3349
+ if (!this.ranged) {
3350
+ this.$refs.reference.focus();
3351
+ } else {
3352
+ this.handleFocus();
3353
+ }
3354
+ },
3355
+ blur: function blur() {
3356
+ this.refInput.forEach(function (input) {
3357
+ return input.blur();
3358
+ });
3359
+ },
3360
+
3361
+
3362
+ // {parse, formatTo} Value deals maps component value with internal Date
3363
+ parseValue: function parseValue(value) {
3364
+ var isParsed = (0, _util.isDateObject)(value) || Array.isArray(value) && value.every(_util.isDateObject);
3365
+ if (this.valueFormat && !isParsed) {
3366
+ return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
3367
+ } else {
3368
+ return value;
3369
+ }
3370
+ },
3371
+ formatToValue: function formatToValue(date) {
3372
+ var isFormattable = (0, _util.isDateObject)(date) || Array.isArray(date) && date.every(_util.isDateObject);
3373
+ if (this.valueFormat && isFormattable) {
3374
+ return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
3375
+ } else {
3376
+ return date;
3377
+ }
3378
+ },
3379
+
3380
+
3381
+ // {parse, formatTo} String deals with user input
3382
+ parseString: function parseString(value) {
3383
+ var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
3384
+ return parseAsFormatAndType(value, this.format, type);
3385
+ },
3386
+ formatToString: function formatToString(value) {
3387
+ var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
3388
+ return formatAsFormatAndType(value, this.format, type);
3389
+ },
3390
+ handleMouseEnter: function handleMouseEnter() {
3391
+ if (this.readonly || this.pickerDisabled) return;
3392
+ if (!this.valueIsEmpty && this.clearable) {
3393
+ this.showClose = true;
3394
+ }
3395
+ },
3396
+ handleChange: function handleChange() {
3397
+ if (this.userInput) {
3398
+ var value = this.parseString(this.displayValue);
3399
+ if (value) {
3400
+ this.picker.value = value;
3401
+ if (this.isValidValue(value)) {
3402
+ this.emitInput(value);
3403
+ this.userInput = null;
3404
+ }
3405
+ }
3406
+ }
3407
+ if (this.userInput === '') {
3408
+ this.emitInput(null);
3409
+ this.emitChange(null);
3410
+ this.userInput = null;
3411
+ }
3412
+ },
3413
+ handleStartInput: function handleStartInput(event) {
3414
+ if (this.userInput) {
3415
+ this.userInput = [event.target.value, this.userInput[1]];
3416
+ } else {
3417
+ this.userInput = [event.target.value, null];
3418
+ }
3419
+ },
3420
+ handleEndInput: function handleEndInput(event) {
3421
+ if (this.userInput) {
3422
+ this.userInput = [this.userInput[0], event.target.value];
3423
+ } else {
3424
+ this.userInput = [null, event.target.value];
3425
+ }
3426
+ },
3427
+ handleStartChange: function handleStartChange(event) {
3428
+ var value = this.parseString(this.userInput && this.userInput[0]);
3429
+ if (value) {
3430
+ this.userInput = [this.formatToString(value), this.displayValue[1]];
3431
+ var newValue = [value, this.picker.value && this.picker.value[1]];
3432
+ this.picker.value = newValue;
3433
+ if (this.isValidValue(newValue)) {
3434
+ this.emitInput(newValue);
3435
+ this.userInput = null;
3436
+ }
3437
+ }
3438
+ },
3439
+ handleEndChange: function handleEndChange(event) {
3440
+ var value = this.parseString(this.userInput && this.userInput[1]);
3441
+ if (value) {
3442
+ this.userInput = [this.displayValue[0], this.formatToString(value)];
3443
+ var newValue = [this.picker.value && this.picker.value[0], value];
3444
+ this.picker.value = newValue;
3445
+ if (this.isValidValue(newValue)) {
3446
+ this.emitInput(newValue);
3447
+ this.userInput = null;
3448
+ }
3449
+ }
3450
+ },
3451
+ handleClickIcon: function handleClickIcon(event) {
3452
+ if (this.readonly || this.pickerDisabled) return;
3453
+ if (this.showClose) {
3454
+ this.valueOnOpen = this.value;
3455
+ event.stopPropagation();
3456
+ this.emitInput(null);
3457
+ this.emitChange(null);
3458
+ this.showClose = false;
3459
+ if (this.picker && typeof this.picker.handleClear === 'function') {
3460
+ this.picker.handleClear();
3461
+ }
3462
+ } else {
3463
+ this.pickerVisible = !this.pickerVisible;
3464
+ }
3465
+ },
3466
+ handleClose: function handleClose() {
3467
+ if (!this.pickerVisible) return;
3468
+ this.pickerVisible = false;
3469
+
3470
+ if (this.type === 'dates') {
3471
+ // restore to former value
3472
+ var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
3473
+ this.emitInput(oldValue);
3474
+ }
3475
+ },
3476
+ handleFieldReset: function handleFieldReset(initialValue) {
3477
+ this.userInput = initialValue === '' ? null : initialValue;
3478
+ },
3479
+ handleFocus: function handleFocus() {
3480
+ var type = this.type;
3481
+
3482
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
3483
+ this.pickerVisible = true;
3484
+ }
3485
+ this.$emit('focus', this);
3486
+ },
3487
+ handleKeydown: function handleKeydown(event) {
3488
+ var _this = this;
3489
+
3490
+ var keyCode = event.keyCode;
3491
+
3492
+ // ESC
3493
+ if (keyCode === 27) {
3494
+ this.pickerVisible = false;
3495
+ event.stopPropagation();
3496
+ return;
3497
+ }
3498
+
3499
+ // Tab
3500
+ if (keyCode === 9) {
3501
+ if (!this.ranged) {
3502
+ this.handleChange();
3503
+ this.pickerVisible = this.picker.visible = false;
3504
+ this.blur();
3505
+ event.stopPropagation();
3506
+ } else {
3507
+ // user may change focus between two input
3508
+ setTimeout(function () {
3509
+ if (_this.refInput.indexOf(document.activeElement) === -1) {
3510
+ _this.pickerVisible = false;
3511
+ _this.blur();
3512
+ event.stopPropagation();
3513
+ }
3514
+ }, 0);
3515
+ }
3516
+ return;
3517
+ }
3518
+
3519
+ // Enter
3520
+ if (keyCode === 13) {
3521
+ if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
3522
+ this.handleChange();
3523
+ this.pickerVisible = this.picker.visible = false;
3524
+ this.blur();
3525
+ }
3526
+ event.stopPropagation();
3527
+ return;
3528
+ }
3529
+
3530
+ // if user is typing, do not let picker handle key input
3531
+ if (this.userInput) {
3532
+ event.stopPropagation();
3533
+ return;
3534
+ }
3535
+
3536
+ // delegate other keys to panel
3537
+ if (this.picker && this.picker.handleKeydown) {
3538
+ this.picker.handleKeydown(event);
3539
+ }
3540
+ },
3541
+ handleRangeClick: function handleRangeClick() {
3542
+ var type = this.type;
3543
+
3544
+ if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
3545
+ this.pickerVisible = true;
3546
+ }
3547
+ this.$emit('focus', this);
3548
+ },
3549
+ hidePicker: function hidePicker() {
3550
+ if (this.picker) {
3551
+ this.picker.resetView && this.picker.resetView();
3552
+ this.pickerVisible = this.picker.visible = false;
3553
+ this.destroyPopper();
3554
+ }
3555
+ },
3556
+ showPicker: function showPicker() {
3557
+ var _this2 = this;
3558
+
3559
+ if (this.$isServer) return;
3560
+ if (!this.picker) {
3561
+ this.mountPicker();
3562
+ }
3563
+ this.pickerVisible = this.picker.visible = true;
3564
+
3565
+ this.updatePopper();
3566
+
3567
+ this.picker.value = this.parsedValue;
3568
+ this.picker.resetView && this.picker.resetView();
3569
+
3570
+ this.$nextTick(function () {
3571
+ _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
3572
+ });
3573
+ },
3574
+ mountPicker: function mountPicker() {
3575
+ var _this3 = this;
3576
+
3577
+ this.picker = new _vue2.default(this.panel).$mount();
3578
+ this.picker.defaultValue = this.defaultValue;
3579
+ this.picker.defaultTime = this.defaultTime;
3580
+ this.picker.popperClass = this.popperClass;
3581
+ this.popperElm = this.picker.$el;
3582
+ this.picker.width = this.reference.getBoundingClientRect().width;
3583
+ this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
3584
+ this.picker.selectionMode = this.selectionMode;
3585
+ this.picker.unlinkPanels = this.unlinkPanels;
3586
+ this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
3587
+ this.$watch('format', function (format) {
3588
+ _this3.picker.format = format;
3589
+ });
3590
+
3591
+ var updateOptions = function updateOptions() {
3592
+ var options = _this3.pickerOptions;
3593
+
3594
+ if (options && options.selectableRange) {
3595
+ (function () {
3596
+ var ranges = options.selectableRange;
3597
+ var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
3598
+ var format = DEFAULT_FORMATS.timerange;
3599
+
3600
+ ranges = Array.isArray(ranges) ? ranges : [ranges];
3601
+ _this3.picker.selectableRange = ranges.map(function (range) {
3602
+ return parser(range, format, _this3.rangeSeparator);
3603
+ });
3604
+ })();
3605
+ }
3606
+
3607
+ for (var option in options) {
3608
+ if (options.hasOwnProperty(option) &&
3609
+ // 忽略 time-picker 的该配置项
3610
+ option !== 'selectableRange') {
3611
+ _this3.picker[option] = options[option];
3612
+ }
3613
+ }
3614
+
3615
+ // main format must prevail over undocumented pickerOptions.format
3616
+ if (_this3.format) {
3617
+ _this3.picker.format = _this3.format;
3618
+ }
3619
+ };
3620
+ updateOptions();
3621
+ this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
3622
+ return updateOptions();
3623
+ }, { deep: true });
3624
+
3625
+ this.$el.appendChild(this.picker.$el);
3626
+ this.picker.resetView && this.picker.resetView();
3627
+
3628
+ this.picker.$on('dodestroy', this.doDestroy);
3629
+ this.picker.$on('pick', function () {
3630
+ var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3631
+ var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3632
+
3633
+ _this3.userInput = null;
3634
+ _this3.pickerVisible = _this3.picker.visible = visible;
3635
+ _this3.emitInput(date);
3636
+ _this3.picker.resetView && _this3.picker.resetView();
3637
+ });
3638
+
3639
+ this.picker.$on('select-range', function (start, end, pos) {
3640
+ if (_this3.refInput.length === 0) return;
3641
+ if (!pos || pos === 'min') {
3642
+ _this3.refInput[0].setSelectionRange(start, end);
3643
+ _this3.refInput[0].focus();
3644
+ } else if (pos === 'max') {
3645
+ _this3.refInput[1].setSelectionRange(start, end);
3646
+ _this3.refInput[1].focus();
3647
+ }
3648
+ });
3649
+ },
3650
+ unmountPicker: function unmountPicker() {
3651
+ if (this.picker) {
3652
+ this.picker.$destroy();
3653
+ this.picker.$off();
3654
+ if (typeof this.unwatchPickerOptions === 'function') {
3655
+ this.unwatchPickerOptions();
3656
+ }
3657
+ this.picker.$el.parentNode.removeChild(this.picker.$el);
3658
+ }
3659
+ },
3660
+ emitChange: function emitChange(val) {
3661
+ // determine user real change only
3662
+ if (!valueEquals(val, this.valueOnOpen)) {
3663
+ this.$emit('change', val);
3664
+ this.dispatch('ElFormItem', 'el.form.change', val);
3665
+ this.valueOnOpen = val;
3666
+ }
3667
+ },
3668
+ emitInput: function emitInput(val) {
3669
+ var formatted = this.formatToValue(val);
3670
+ if (!valueEquals(this.value, formatted)) {
3671
+ this.$emit('input', formatted);
3672
+ }
3673
+ },
3674
+ isValidValue: function isValidValue(value) {
3675
+ if (!this.picker) {
3676
+ this.mountPicker();
3677
+ }
3678
+ if (this.picker.isValidValue) {
3679
+ return value && this.picker.isValidValue(value);
3680
+ } else {
3681
+ return true;
3682
+ }
3683
+ }
3684
+ }
3685
+ };
3686
+
3687
+ /***/ }),
3688
+
3689
+ /***/ 29:
3690
+ /***/ (function(module, exports) {
3691
+
3692
+ module.exports = require("element-ui/lib/utils/date");
3693
+
3694
+ /***/ }),
3695
+
3696
+ /***/ 3:
3697
+ /***/ (function(module, exports) {
3698
+
3699
+ module.exports = require("element-ui/lib/utils/dom");
3700
+
3701
+ /***/ }),
3702
+
3703
+ /***/ 30:
3704
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3705
+
3706
+ "use strict";
3707
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.ranged)?_c('el-input',_vm._b({directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleClose),expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor",class:'el-date-editor--' + _vm.type,attrs:{"readonly":!_vm.editable || _vm.readonly || _vm.type === 'dates',"disabled":_vm.pickerDisabled,"size":_vm.pickerSize,"name":_vm.name,"placeholder":_vm.placeholder,"value":_vm.displayValue,"validateEvent":false},on:{"focus":_vm.handleFocus,"input":function (value) { return _vm.userInput = value; },"change":_vm.handleChange},nativeOn:{"keydown":function($event){_vm.handleKeydown($event)},"mouseenter":function($event){_vm.handleMouseEnter($event)},"mouseleave":function($event){_vm.showClose = false}}},'el-input',_vm.firstInputId,false),[_c('i',{staticClass:"el-input__icon",class:_vm.triggerClass,attrs:{"slot":"prefix"},on:{"click":_vm.handleFocus},slot:"prefix"}),(_vm.haveTrigger)?_c('i',{staticClass:"el-input__icon",class:[_vm.showClose ? '' + _vm.clearIcon : ''],attrs:{"slot":"suffix"},on:{"click":_vm.handleClickIcon},slot:"suffix"}):_vm._e()]):_c('div',{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:(_vm.handleClose),expression:"handleClose"}],ref:"reference",staticClass:"el-date-editor el-range-editor el-input__inner",class:[
3708
+ 'el-date-editor--' + _vm.type,
3709
+ _vm.pickerSize ? ("el-range-editor--" + _vm.pickerSize) : '',
3710
+ _vm.pickerDisabled ? 'is-disabled' : '',
3711
+ _vm.pickerVisible ? 'is-active' : ''
3712
+ ],on:{"click":_vm.handleRangeClick,"mouseenter":_vm.handleMouseEnter,"mouseleave":function($event){_vm.showClose = false},"keydown":_vm.handleKeydown}},[_c('i',{class:['el-input__icon', 'el-range__icon', _vm.triggerClass]}),_c('input',_vm._b({staticClass:"el-range-input",attrs:{"autocomplete":"off","placeholder":_vm.startPlaceholder,"disabled":_vm.pickerDisabled,"readonly":!_vm.editable || _vm.readonly,"name":_vm.name && _vm.name[0]},domProps:{"value":_vm.displayValue && _vm.displayValue[0]},on:{"input":_vm.handleStartInput,"change":_vm.handleStartChange,"focus":_vm.handleFocus}},'input',_vm.firstInputId,false)),_vm._t("range-separator",[_c('span',{staticClass:"el-range-separator"},[_vm._v(_vm._s(_vm.rangeSeparator))])]),_c('input',_vm._b({staticClass:"el-range-input",attrs:{"autocomplete":"off","placeholder":_vm.endPlaceholder,"disabled":_vm.pickerDisabled,"readonly":!_vm.editable || _vm.readonly,"name":_vm.name && _vm.name[1]},domProps:{"value":_vm.displayValue && _vm.displayValue[1]},on:{"input":_vm.handleEndInput,"change":_vm.handleEndChange,"focus":_vm.handleFocus}},'input',_vm.secondInputId,false)),(_vm.haveTrigger)?_c('i',{staticClass:"el-input__icon el-range__close-icon",class:[_vm.showClose ? '' + _vm.clearIcon : ''],on:{"click":_vm.handleClickIcon}}):_vm._e()],2)}
3713
+ var staticRenderFns = []
3714
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
3715
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
3716
+
3717
+ /***/ }),
3718
+
3719
+ /***/ 31:
3720
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3721
+
3722
+ "use strict";
3723
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
3724
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(41);
3725
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__);
3726
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ee915b14_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(44);
3727
+ var normalizeComponent = __webpack_require__(0)
3728
+ /* script */
3729
+
3730
+ /* template */
3731
+
3732
+ /* template functional */
3733
+ var __vue_template_functional__ = false
3734
+ /* styles */
3735
+ var __vue_styles__ = null
3736
+ /* scopeId */
3737
+ var __vue_scopeId__ = null
3738
+ /* moduleIdentifier (server only) */
3739
+ var __vue_module_identifier__ = null
3740
+ var Component = normalizeComponent(
3741
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a,
3742
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ee915b14_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["a" /* default */],
3743
+ __vue_template_functional__,
3744
+ __vue_styles__,
3745
+ __vue_scopeId__,
3746
+ __vue_module_identifier__
3747
+ )
3748
+
3749
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
3750
+
3751
+
3752
+ /***/ }),
3753
+
3754
+ /***/ 32:
3755
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3756
+
3757
+ "use strict";
3758
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
3759
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__ = __webpack_require__(42);
3760
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__);
3761
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_72da32d8_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__ = __webpack_require__(43);
3762
+ var normalizeComponent = __webpack_require__(0)
3763
+ /* script */
3764
+
3765
+ /* template */
3766
+
3767
+ /* template functional */
3768
+ var __vue_template_functional__ = false
3769
+ /* styles */
3770
+ var __vue_styles__ = null
3771
+ /* scopeId */
3772
+ var __vue_scopeId__ = null
3773
+ /* moduleIdentifier (server only) */
3774
+ var __vue_module_identifier__ = null
3775
+ var Component = normalizeComponent(
3776
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default.a,
3777
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_72da32d8_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["a" /* default */],
3778
+ __vue_template_functional__,
3779
+ __vue_styles__,
3780
+ __vue_scopeId__,
3781
+ __vue_module_identifier__
3782
+ )
3783
+
3784
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
3785
+
3786
+
3787
+ /***/ }),
3788
+
3789
+ /***/ 4:
3790
+ /***/ (function(module, exports) {
3791
+
3792
+ module.exports = require("vue");
3793
+
3794
+ /***/ }),
3795
+
3796
+ /***/ 41:
3797
+ /***/ (function(module, exports, __webpack_require__) {
3798
+
3799
+ "use strict";
3800
+
3801
+
3802
+ exports.__esModule = true;
3803
+
3804
+ var _util = __webpack_require__(11);
3805
+
3806
+ var _locale = __webpack_require__(5);
3807
+
3808
+ var _locale2 = _interopRequireDefault(_locale);
3809
+
3810
+ var _timeSpinner = __webpack_require__(32);
3811
+
3812
+ var _timeSpinner2 = _interopRequireDefault(_timeSpinner);
3813
+
3814
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3815
+
3816
+ exports.default = {
3817
+ mixins: [_locale2.default],
3818
+
3819
+ components: {
3820
+ TimeSpinner: _timeSpinner2.default
3821
+ },
3822
+
3823
+ props: {
3824
+ visible: Boolean,
3825
+ timeArrowControl: Boolean
3826
+ },
3827
+
3828
+ watch: {
3829
+ visible: function visible(val) {
3830
+ var _this = this;
3831
+
3832
+ if (val) {
3833
+ this.oldValue = this.value;
3834
+ this.$nextTick(function () {
3835
+ return _this.$refs.spinner.emitSelectRange('hours');
3836
+ });
3837
+ } else {
3838
+ this.needInitAdjust = true;
3839
+ }
3840
+ },
3841
+ value: function value(newVal) {
3842
+ var _this2 = this;
3843
+
3844
+ var date = void 0;
3845
+ if (newVal instanceof Date) {
3846
+ date = (0, _util.limitTimeRange)(newVal, this.selectableRange, this.format);
3847
+ } else if (!newVal) {
3848
+ date = this.defaultValue ? new Date(this.defaultValue) : new Date();
3849
+ }
3850
+
3851
+ this.date = date;
3852
+ if (this.visible && this.needInitAdjust) {
3853
+ this.$nextTick(function (_) {
3854
+ return _this2.adjustSpinners();
3855
+ });
3856
+ this.needInitAdjust = false;
3857
+ }
3858
+ },
3859
+ selectableRange: function selectableRange(val) {
3860
+ this.$refs.spinner.selectableRange = val;
3861
+ },
3862
+ defaultValue: function defaultValue(val) {
3863
+ if (!(0, _util.isDate)(this.value)) {
3864
+ this.date = val ? new Date(val) : new Date();
3865
+ }
3866
+ }
3867
+ },
3868
+
3869
+ data: function data() {
3870
+ return {
3871
+ popperClass: '',
3872
+ format: 'HH:mm:ss',
3873
+ value: '',
3874
+ defaultValue: null,
3875
+ date: new Date(),
3876
+ oldValue: new Date(),
3877
+ selectableRange: [],
3878
+ selectionRange: [0, 2],
3879
+ disabled: false,
3880
+ arrowControl: false,
3881
+ needInitAdjust: true
3882
+ };
3883
+ },
3884
+
3885
+
3886
+ computed: {
3887
+ showSeconds: function showSeconds() {
3888
+ return (this.format || '').indexOf('ss') !== -1;
3889
+ },
3890
+ useArrow: function useArrow() {
3891
+ return this.arrowControl || this.timeArrowControl || false;
3892
+ },
3893
+ amPmMode: function amPmMode() {
3894
+ if ((this.format || '').indexOf('A') !== -1) return 'A';
3895
+ if ((this.format || '').indexOf('a') !== -1) return 'a';
3896
+ return '';
3897
+ }
3898
+ },
3899
+
3900
+ methods: {
3901
+ handleCancel: function handleCancel() {
3902
+ this.$emit('pick', this.oldValue, false);
3903
+ },
3904
+ handleChange: function handleChange(date) {
3905
+ // this.visible avoids edge cases, when use scrolls during panel closing animation
3906
+ if (this.visible) {
3907
+ this.date = (0, _util.clearMilliseconds)(date);
3908
+ // if date is out of range, do not emit
3909
+ if (this.isValidValue(this.date)) {
3910
+ this.$emit('pick', this.date, true);
3911
+ }
3912
+ }
3913
+ },
3914
+ setSelectionRange: function setSelectionRange(start, end) {
3915
+ this.$emit('select-range', start, end);
3916
+ this.selectionRange = [start, end];
3917
+ },
3918
+ handleConfirm: function handleConfirm() {
3919
+ var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3920
+ var first = arguments[1];
3921
+
3922
+ if (first) return;
3923
+ var date = (0, _util.clearMilliseconds)((0, _util.limitTimeRange)(this.date, this.selectableRange, this.format));
3924
+ this.$emit('pick', date, visible, first);
3925
+ },
3926
+ handleKeydown: function handleKeydown(event) {
3927
+ var keyCode = event.keyCode;
3928
+ var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
3929
+
3930
+ // Left or Right
3931
+ if (keyCode === 37 || keyCode === 39) {
3932
+ var step = mapping[keyCode];
3933
+ this.changeSelectionRange(step);
3934
+ event.preventDefault();
3935
+ return;
3936
+ }
3937
+
3938
+ // Up or Down
3939
+ if (keyCode === 38 || keyCode === 40) {
3940
+ var _step = mapping[keyCode];
3941
+ this.$refs.spinner.scrollDown(_step);
3942
+ event.preventDefault();
3943
+ return;
3944
+ }
3945
+ },
3946
+ isValidValue: function isValidValue(date) {
3947
+ return (0, _util.timeWithinRange)(date, this.selectableRange, this.format);
3948
+ },
3949
+ adjustSpinners: function adjustSpinners() {
3950
+ return this.$refs.spinner.adjustSpinners();
3951
+ },
3952
+ changeSelectionRange: function changeSelectionRange(step) {
3953
+ var list = [0, 3].concat(this.showSeconds ? [6] : []);
3954
+ var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
3955
+ var index = list.indexOf(this.selectionRange[0]);
3956
+ var next = (index + step + list.length) % list.length;
3957
+ this.$refs.spinner.emitSelectRange(mapping[next]);
3958
+ }
3959
+ },
3960
+
3961
+ mounted: function mounted() {
3962
+ var _this3 = this;
3963
+
3964
+ this.$nextTick(function () {
3965
+ return _this3.handleConfirm(true, true);
3966
+ });
3967
+ this.$emit('mounted');
3968
+ }
3969
+ }; //
3970
+ //
3971
+ //
3972
+ //
3973
+ //
3974
+ //
3975
+ //
3976
+ //
3977
+ //
3978
+ //
3979
+ //
3980
+ //
3981
+ //
3982
+ //
3983
+ //
3984
+ //
3985
+ //
3986
+ //
3987
+ //
3988
+ //
3989
+ //
3990
+ //
3991
+ //
3992
+ //
3993
+ //
3994
+ //
3995
+ //
3996
+ //
3997
+ //
3998
+ //
3999
+ //
4000
+ //
4001
+
4002
+ /***/ }),
4003
+
4004
+ /***/ 42:
4005
+ /***/ (function(module, exports, __webpack_require__) {
4006
+
4007
+ "use strict";
4008
+
4009
+
4010
+ exports.__esModule = true;
4011
+
4012
+ var _util = __webpack_require__(11);
4013
+
4014
+ var _scrollbar = __webpack_require__(17);
4015
+
4016
+ var _scrollbar2 = _interopRequireDefault(_scrollbar);
4017
+
4018
+ var _repeatClick = __webpack_require__(24);
4019
+
4020
+ var _repeatClick2 = _interopRequireDefault(_repeatClick);
4021
+
4022
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4023
+
4024
+ exports.default = {
4025
+ components: { ElScrollbar: _scrollbar2.default },
4026
+
4027
+ directives: {
4028
+ repeatClick: _repeatClick2.default
4029
+ },
4030
+
4031
+ props: {
4032
+ date: {},
4033
+ defaultValue: {}, // reserved for future use
4034
+ showSeconds: {
4035
+ type: Boolean,
4036
+ default: true
4037
+ },
4038
+ arrowControl: Boolean,
4039
+ amPmMode: {
4040
+ type: String,
4041
+ default: '' // 'a': am/pm; 'A': AM/PM
4042
+ }
4043
+ },
4044
+
4045
+ computed: {
4046
+ hours: function hours() {
4047
+ return this.date.getHours();
4048
+ },
4049
+ minutes: function minutes() {
4050
+ return this.date.getMinutes();
4051
+ },
4052
+ seconds: function seconds() {
4053
+ return this.date.getSeconds();
4054
+ },
4055
+ hoursList: function hoursList() {
4056
+ return (0, _util.getRangeHours)(this.selectableRange);
4057
+ },
4058
+ minutesList: function minutesList() {
4059
+ return (0, _util.getRangeMinutes)(this.selectableRange, this.hours);
4060
+ },
4061
+ arrowHourList: function arrowHourList() {
4062
+ var hours = this.hours;
4063
+ return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
4064
+ },
4065
+ arrowMinuteList: function arrowMinuteList() {
4066
+ var minutes = this.minutes;
4067
+ return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
4068
+ },
4069
+ arrowSecondList: function arrowSecondList() {
4070
+ var seconds = this.seconds;
4071
+ return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
4072
+ }
4073
+ },
4074
+
4075
+ data: function data() {
4076
+ return {
4077
+ selectableRange: [],
4078
+ currentScrollbar: null
4079
+ };
4080
+ },
4081
+ mounted: function mounted() {
4082
+ var _this = this;
4083
+
4084
+ this.$nextTick(function () {
4085
+ !_this.arrowControl && _this.bindScrollEvent();
4086
+ });
4087
+ },
4088
+
4089
+
4090
+ methods: {
4091
+ increase: function increase() {
4092
+ this.scrollDown(1);
4093
+ },
4094
+ decrease: function decrease() {
4095
+ this.scrollDown(-1);
4096
+ },
4097
+ modifyDateField: function modifyDateField(type, value) {
4098
+ switch (type) {
4099
+ case 'hours':
4100
+ this.$emit('change', (0, _util.modifyTime)(this.date, value, this.minutes, this.seconds));break;
4101
+ case 'minutes':
4102
+ this.$emit('change', (0, _util.modifyTime)(this.date, this.hours, value, this.seconds));break;
4103
+ case 'seconds':
4104
+ this.$emit('change', (0, _util.modifyTime)(this.date, this.hours, this.minutes, value));break;
4105
+ }
4106
+ },
4107
+ handleClick: function handleClick(type, _ref) {
4108
+ var value = _ref.value,
4109
+ disabled = _ref.disabled;
4110
+
4111
+ if (!disabled) {
4112
+ this.modifyDateField(type, value);
4113
+ this.emitSelectRange(type);
4114
+ this.adjustSpinner(type, value);
4115
+ }
4116
+ },
4117
+ emitSelectRange: function emitSelectRange(type) {
4118
+ if (type === 'hours') {
4119
+ this.$emit('select-range', 0, 2);
4120
+ } else if (type === 'minutes') {
4121
+ this.$emit('select-range', 3, 5);
4122
+ } else if (type === 'seconds') {
4123
+ this.$emit('select-range', 6, 8);
4124
+ }
4125
+ this.currentScrollbar = type;
4126
+ },
4127
+ bindScrollEvent: function bindScrollEvent() {
4128
+ var _this2 = this;
4129
+
4130
+ var bindFuntion = function bindFuntion(type) {
4131
+ _this2.$refs[type].wrap.onscroll = function (e) {
4132
+ // TODO: scroll is emitted when set scrollTop programatically
4133
+ // should find better solutions in the future!
4134
+ _this2.handleScroll(type, e);
4135
+ };
4136
+ };
4137
+ bindFuntion('hours');
4138
+ bindFuntion('minutes');
4139
+ bindFuntion('seconds');
4140
+ },
4141
+ handleScroll: function handleScroll(type) {
4142
+ var value = Math.min(Math.floor((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), type === 'hours' ? 23 : 59);
4143
+ this.modifyDateField(type, value);
4144
+ },
4145
+
4146
+
4147
+ // NOTE: used by datetime / date-range panel
4148
+ // renamed from adjustScrollTop
4149
+ // should try to refactory it
4150
+ adjustSpinners: function adjustSpinners() {
4151
+ this.adjustSpinner('hours', this.hours);
4152
+ this.adjustSpinner('minutes', this.minutes);
4153
+ this.adjustSpinner('seconds', this.seconds);
4154
+ },
4155
+ adjustCurrentSpinner: function adjustCurrentSpinner(type) {
4156
+ this.adjustSpinner(type, this[type]);
4157
+ },
4158
+ adjustSpinner: function adjustSpinner(type, value) {
4159
+ if (this.arrowControl) return;
4160
+ var el = this.$refs[type].wrap;
4161
+ if (el) {
4162
+ el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
4163
+ }
4164
+ },
4165
+ scrollDown: function scrollDown(step) {
4166
+ if (!this.currentScrollbar) {
4167
+ this.emitSelectRange('hours');
4168
+ }
4169
+
4170
+ var label = this.currentScrollbar;
4171
+ var hoursList = this.hoursList;
4172
+ var now = this[label];
4173
+
4174
+ if (this.currentScrollbar === 'hours') {
4175
+ var total = Math.abs(step);
4176
+ step = step > 0 ? 1 : -1;
4177
+ var length = hoursList.length;
4178
+ while (length-- && total) {
4179
+ now = (now + step + hoursList.length) % hoursList.length;
4180
+ if (hoursList[now]) {
4181
+ continue;
4182
+ }
4183
+ total--;
4184
+ }
4185
+ if (hoursList[now]) return;
4186
+ } else {
4187
+ now = (now + step + 60) % 60;
4188
+ }
4189
+
4190
+ this.modifyDateField(label, now);
4191
+ this.adjustSpinner(label, now);
4192
+ },
4193
+ amPm: function amPm(hour) {
4194
+ var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
4195
+ if (!shouldShowAmPm) return '';
4196
+ var isCapital = this.amPmMode === 'A';
4197
+ var content = hour < 12 ? ' am' : ' pm';
4198
+ if (isCapital) content = content.toUpperCase();
4199
+ return content;
4200
+ },
4201
+ typeItemHeight: function typeItemHeight(type) {
4202
+ return this.$refs[type].$el.querySelector('li').offsetHeight;
4203
+ },
4204
+ scrollBarHeight: function scrollBarHeight(type) {
4205
+ return this.$refs[type].$el.offsetHeight;
4206
+ }
4207
+ }
4208
+ }; //
4209
+ //
4210
+ //
4211
+ //
4212
+ //
4213
+ //
4214
+ //
4215
+ //
4216
+ //
4217
+ //
4218
+ //
4219
+ //
4220
+ //
4221
+ //
4222
+ //
4223
+ //
4224
+ //
4225
+ //
4226
+ //
4227
+ //
4228
+ //
4229
+ //
4230
+ //
4231
+ //
4232
+ //
4233
+ //
4234
+ //
4235
+ //
4236
+ //
4237
+ //
4238
+ //
4239
+ //
4240
+ //
4241
+ //
4242
+ //
4243
+ //
4244
+ //
4245
+ //
4246
+ //
4247
+ //
4248
+ //
4249
+ //
4250
+ //
4251
+ //
4252
+ //
4253
+ //
4254
+ //
4255
+ //
4256
+ //
4257
+ //
4258
+ //
4259
+ //
4260
+ //
4261
+ //
4262
+ //
4263
+ //
4264
+ //
4265
+ //
4266
+ //
4267
+ //
4268
+ //
4269
+ //
4270
+ //
4271
+ //
4272
+ //
4273
+ //
4274
+ //
4275
+ //
4276
+ //
4277
+ //
4278
+ //
4279
+ //
4280
+ //
4281
+ //
4282
+ //
4283
+ //
4284
+ //
4285
+ //
4286
+ //
4287
+ //
4288
+ //
4289
+ //
4290
+ //
4291
+ //
4292
+ //
4293
+ //
4294
+ //
4295
+ //
4296
+ //
4297
+ //
4298
+ //
4299
+ //
4300
+ //
4301
+ //
4302
+ //
4303
+ //
4304
+ //
4305
+ //
4306
+ //
4307
+ //
4308
+
4309
+ /***/ }),
4310
+
4311
+ /***/ 43:
4312
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4313
+
4314
+ "use strict";
4315
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"el-time-spinner",class:{ 'has-seconds': _vm.showSeconds }},[(!_vm.arrowControl)?[_c('el-scrollbar',{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('hours')},"mousemove":function($event){_vm.adjustCurrentSpinner('hours')}}},_vm._l((_vm.hoursList),function(disabled,hour){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': hour === _vm.hours, 'disabled': disabled },on:{"click":function($event){_vm.handleClick('hours', { value: hour, disabled: disabled })}}},[_vm._v(_vm._s(('0' + (_vm.amPmMode ? (hour % 12 || 12) : hour )).slice(-2))+_vm._s(_vm.amPm(hour)))])})),_c('el-scrollbar',{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('minutes')},"mousemove":function($event){_vm.adjustCurrentSpinner('minutes')}}},_vm._l((_vm.minutesList),function(enabled,key){return _c('li',{staticClass:"el-time-spinner__item",class:{ 'active': key === _vm.minutes, disabled: !enabled },on:{"click":function($event){_vm.handleClick('minutes', { value: key, disabled: false })}}},[_vm._v(_vm._s(('0' + key).slice(-2)))])})),_c('el-scrollbar',{directives:[{name:"show",rawName:"v-show",value:(_vm.showSeconds),expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list","noresize":"","tag":"ul"},nativeOn:{"mouseenter":function($event){_vm.emitSelectRange('seconds')},"mousemove":function($event){_vm.adjustCurrentSpinner('seconds')}}},_vm._l((60),function(second,key){return _c('li',{key:key,staticClass:"el-time-spinner__item",class:{ 'active': key === _vm.seconds },on:{"click":function($event){_vm.handleClick('seconds', { value: key, disabled: false })}}},[_vm._v(_vm._s(('0' + key).slice(-2)))])}))]:_vm._e(),(_vm.arrowControl)?[_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('hours')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"hours",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowHourList),function(hour,key){return _c('li',{key:key,staticClass:"el-time-spinner__item",class:{ 'active': hour === _vm.hours, 'disabled': _vm.hoursList[hour] }},[_vm._v(_vm._s(hour === undefined ? '' : ('0' + (_vm.amPmMode ? (hour % 12 || 12) : hour )).slice(-2) + _vm.amPm(hour)))])}))]),_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('minutes')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"minutes",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowMinuteList),function(minute,key){return _c('li',{key:key,staticClass:"el-time-spinner__item",class:{ 'active': minute === _vm.minutes }},[_vm._v("\n "+_vm._s(minute === undefined ? '' : ('0' + minute).slice(-2))+"\n ")])}))]),(_vm.showSeconds)?_c('div',{staticClass:"el-time-spinner__wrapper is-arrow",on:{"mouseenter":function($event){_vm.emitSelectRange('seconds')}}},[_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.decrease),expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),_c('i',{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:(_vm.increase),expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),_c('ul',{ref:"seconds",staticClass:"el-time-spinner__list"},_vm._l((_vm.arrowSecondList),function(second,key){return _c('li',{key:key,staticClass:"el-time-spinner__item",class:{ 'active': second === _vm.seconds }},[_vm._v("\n "+_vm._s(second === undefined ? '' : ('0' + second).slice(-2))+"\n ")])}))]):_vm._e()]:_vm._e()],2)}
4316
+ var staticRenderFns = []
4317
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
4318
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
4319
+
4320
+ /***/ }),
4321
+
4322
+ /***/ 44:
4323
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4324
+
4325
+ "use strict";
4326
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"el-zoom-in-top"},on:{"after-leave":function($event){_vm.$emit('dodestroy')}}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.visible),expression:"visible"}],staticClass:"el-time-panel el-popper",class:_vm.popperClass},[_c('div',{staticClass:"el-time-panel__content",class:{ 'has-seconds': _vm.showSeconds }},[_c('time-spinner',{ref:"spinner",attrs:{"arrow-control":_vm.useArrow,"show-seconds":_vm.showSeconds,"am-pm-mode":_vm.amPmMode,"date":_vm.date},on:{"change":_vm.handleChange,"select-range":_vm.setSelectionRange}})],1),_c('div',{staticClass:"el-time-panel__footer"},[_c('button',{staticClass:"el-time-panel__btn cancel",attrs:{"type":"button"},on:{"click":_vm.handleCancel}},[_vm._v(_vm._s(_vm.t('el.datepicker.cancel')))]),_c('button',{staticClass:"el-time-panel__btn",class:{confirm: !_vm.disabled},attrs:{"type":"button"},on:{"click":function($event){_vm.handleConfirm()}}},[_vm._v(_vm._s(_vm.t('el.datepicker.confirm')))])])])])}
4327
+ var staticRenderFns = []
4328
+ var esExports = { render: render, staticRenderFns: staticRenderFns }
4329
+ /* harmony default export */ __webpack_exports__["a"] = (esExports);
4330
+
4331
+ /***/ }),
4332
+
4333
+ /***/ 49:
4334
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4335
+
4336
+ "use strict";
4337
+ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
4338
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__ = __webpack_require__(186);
4339
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__);
4340
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0dd30f6e_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__ = __webpack_require__(187);
4341
+ var normalizeComponent = __webpack_require__(0)
4342
+ /* script */
4343
+
4344
+ /* template */
4345
+
4346
+ /* template functional */
4347
+ var __vue_template_functional__ = false
4348
+ /* styles */
4349
+ var __vue_styles__ = null
4350
+ /* scopeId */
4351
+ var __vue_scopeId__ = null
4352
+ /* moduleIdentifier (server only) */
4353
+ var __vue_module_identifier__ = null
4354
+ var Component = normalizeComponent(
4355
+ __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default.a,
4356
+ __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0dd30f6e_hasScoped_false_preserveWhitespace_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__["a" /* default */],
4357
+ __vue_template_functional__,
4358
+ __vue_styles__,
4359
+ __vue_scopeId__,
4360
+ __vue_module_identifier__
4361
+ )
4362
+
4363
+ /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
4364
+
4365
+
4366
+ /***/ }),
4367
+
4368
+ /***/ 5:
4369
+ /***/ (function(module, exports) {
4370
+
4371
+ module.exports = require("element-ui/lib/mixins/locale");
4372
+
4373
+ /***/ }),
4374
+
4375
+ /***/ 6:
4376
+ /***/ (function(module, exports) {
4377
+
4378
+ module.exports = require("element-ui/lib/input");
4379
+
4380
+ /***/ }),
4381
+
4382
+ /***/ 7:
4383
+ /***/ (function(module, exports) {
4384
+
4385
+ module.exports = require("element-ui/lib/utils/vue-popper");
4386
+
4387
+ /***/ }),
4388
+
4389
+ /***/ 9:
4390
+ /***/ (function(module, exports) {
4391
+
4392
+ module.exports = require("element-ui/lib/utils/merge");
4393
+
4394
+ /***/ })
4395
+
4396
+ /******/ });