@laozei/element-ui 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/package.json +3 -3
  2. package/packages/table/src/table-footer.js +54 -23
  3. package/src/utils/util.js +4 -0
  4. package/lib/alert.js +0 -419
  5. package/lib/aside.js +0 -276
  6. package/lib/autocomplete.js +0 -951
  7. package/lib/avatar.js +0 -362
  8. package/lib/backtop.js +0 -400
  9. package/lib/badge.js +0 -333
  10. package/lib/breadcrumb-item.js +0 -321
  11. package/lib/breadcrumb.js +0 -292
  12. package/lib/button-group.js +0 -261
  13. package/lib/button.js +0 -356
  14. package/lib/calendar.js +0 -935
  15. package/lib/card.js +0 -296
  16. package/lib/carousel-item.js +0 -433
  17. package/lib/carousel.js +0 -705
  18. package/lib/cascader-panel.js +0 -1563
  19. package/lib/cascader.js +0 -1435
  20. package/lib/checkbox-button.js +0 -582
  21. package/lib/checkbox-group.js +0 -312
  22. package/lib/checkbox.js +0 -626
  23. package/lib/col.js +0 -176
  24. package/lib/collapse-item.js +0 -496
  25. package/lib/collapse.js +0 -328
  26. package/lib/color-picker.js +0 -1957
  27. package/lib/container.js +0 -287
  28. package/lib/date-picker.js +0 -6363
  29. package/lib/descriptions-item.js +0 -139
  30. package/lib/descriptions.js +0 -456
  31. package/lib/dialog.js +0 -597
  32. package/lib/directives/mousewheel.js +0 -26
  33. package/lib/directives/repeat-click.js +0 -33
  34. package/lib/divider.js +0 -312
  35. package/lib/drawer.js +0 -591
  36. package/lib/dropdown-item.js +0 -315
  37. package/lib/dropdown-menu.js +0 -350
  38. package/lib/dropdown.js +0 -642
  39. package/lib/element-ui.common.js +0 -43905
  40. package/lib/empty.js +0 -729
  41. package/lib/footer.js +0 -276
  42. package/lib/form-item.js +0 -828
  43. package/lib/form.js +0 -465
  44. package/lib/header.js +0 -276
  45. package/lib/icon.js +0 -264
  46. package/lib/image.js +0 -1139
  47. package/lib/index.js +0 -1
  48. package/lib/infinite-scroll.js +0 -299
  49. package/lib/input-number.js +0 -751
  50. package/lib/input.js +0 -997
  51. package/lib/link.js +0 -329
  52. package/lib/loading.js +0 -630
  53. package/lib/locale/format.js +0 -56
  54. package/lib/locale/index.js +0 -61
  55. package/lib/locale/lang/af-ZA.js +0 -126
  56. package/lib/locale/lang/ar.js +0 -125
  57. package/lib/locale/lang/az.js +0 -126
  58. package/lib/locale/lang/bg.js +0 -126
  59. package/lib/locale/lang/bn.js +0 -126
  60. package/lib/locale/lang/ca.js +0 -125
  61. package/lib/locale/lang/cs-CZ.js +0 -128
  62. package/lib/locale/lang/da.js +0 -125
  63. package/lib/locale/lang/de.js +0 -127
  64. package/lib/locale/lang/ee.js +0 -126
  65. package/lib/locale/lang/el.js +0 -126
  66. package/lib/locale/lang/en.js +0 -126
  67. package/lib/locale/lang/eo.js +0 -126
  68. package/lib/locale/lang/es.js +0 -125
  69. package/lib/locale/lang/eu.js +0 -126
  70. package/lib/locale/lang/fa.js +0 -126
  71. package/lib/locale/lang/fi.js +0 -126
  72. package/lib/locale/lang/fr.js +0 -125
  73. package/lib/locale/lang/he.js +0 -126
  74. package/lib/locale/lang/hr.js +0 -126
  75. package/lib/locale/lang/hu.js +0 -125
  76. package/lib/locale/lang/hy-AM.js +0 -126
  77. package/lib/locale/lang/id.js +0 -126
  78. package/lib/locale/lang/is.js +0 -126
  79. package/lib/locale/lang/it.js +0 -125
  80. package/lib/locale/lang/ja.js +0 -126
  81. package/lib/locale/lang/kg.js +0 -126
  82. package/lib/locale/lang/km.js +0 -126
  83. package/lib/locale/lang/ko.js +0 -126
  84. package/lib/locale/lang/ku.js +0 -126
  85. package/lib/locale/lang/kz.js +0 -126
  86. package/lib/locale/lang/lo-LA.js +0 -126
  87. package/lib/locale/lang/lt.js +0 -126
  88. package/lib/locale/lang/lv.js +0 -126
  89. package/lib/locale/lang/mn.js +0 -126
  90. package/lib/locale/lang/ms.js +0 -125
  91. package/lib/locale/lang/nb-NO.js +0 -125
  92. package/lib/locale/lang/nl.js +0 -126
  93. package/lib/locale/lang/pl.js +0 -126
  94. package/lib/locale/lang/pt-br.js +0 -126
  95. package/lib/locale/lang/pt.js +0 -126
  96. package/lib/locale/lang/ro.js +0 -126
  97. package/lib/locale/lang/ru-RU.js +0 -126
  98. package/lib/locale/lang/si.js +0 -126
  99. package/lib/locale/lang/sk.js +0 -128
  100. package/lib/locale/lang/sl.js +0 -126
  101. package/lib/locale/lang/sr-Latn.js +0 -126
  102. package/lib/locale/lang/sr.js +0 -126
  103. package/lib/locale/lang/sv-SE.js +0 -126
  104. package/lib/locale/lang/sw.js +0 -126
  105. package/lib/locale/lang/ta.js +0 -125
  106. package/lib/locale/lang/th.js +0 -126
  107. package/lib/locale/lang/tk.js +0 -126
  108. package/lib/locale/lang/tr-TR.js +0 -126
  109. package/lib/locale/lang/ua.js +0 -126
  110. package/lib/locale/lang/ug-CN.js +0 -126
  111. package/lib/locale/lang/uz-UZ.js +0 -126
  112. package/lib/locale/lang/vi.js +0 -126
  113. package/lib/locale/lang/zh-CN.js +0 -126
  114. package/lib/locale/lang/zh-TW.js +0 -126
  115. package/lib/main.js +0 -263
  116. package/lib/menu-item-group.js +0 -307
  117. package/lib/menu-item.js +0 -490
  118. package/lib/menu.js +0 -864
  119. package/lib/message-box.js +0 -1191
  120. package/lib/message.js +0 -547
  121. package/lib/mixins/emitter.js +0 -36
  122. package/lib/mixins/focus.js +0 -15
  123. package/lib/mixins/locale.js +0 -17
  124. package/lib/mixins/migrating.js +0 -69
  125. package/lib/notification.js +0 -614
  126. package/lib/option-group.js +0 -343
  127. package/lib/option.js +0 -474
  128. package/lib/page-header.js +0 -318
  129. package/lib/pagination.js +0 -946
  130. package/lib/popconfirm.js +0 -456
  131. package/lib/popover.js +0 -616
  132. package/lib/popper-offset.js +0 -16
  133. package/lib/progress.js +0 -592
  134. package/lib/radio-button.js +0 -462
  135. package/lib/radio-group.js +0 -390
  136. package/lib/radio.js +0 -496
  137. package/lib/rate.js +0 -669
  138. package/lib/result.js +0 -593
  139. package/lib/row.js +0 -148
  140. package/lib/scrollbar.js +0 -422
  141. package/lib/select.js +0 -2174
  142. package/lib/skeleton-item.js +0 -345
  143. package/lib/skeleton.js +0 -371
  144. package/lib/slider.js +0 -1201
  145. package/lib/spinner.js +0 -300
  146. package/lib/statistic.js +0 -533
  147. package/lib/step.js +0 -521
  148. package/lib/steps.js +0 -341
  149. package/lib/submenu.js +0 -700
  150. package/lib/switch.js +0 -553
  151. package/lib/tab-pane.js +0 -331
  152. package/lib/table-column.js +0 -951
  153. package/lib/table.js +0 -4996
  154. package/lib/tabs.js +0 -925
  155. package/lib/tag.js +0 -303
  156. package/lib/theme-chalk/alert.css +0 -1
  157. package/lib/theme-chalk/aside.css +0 -1
  158. package/lib/theme-chalk/autocomplete.css +0 -1
  159. package/lib/theme-chalk/avatar.css +0 -1
  160. package/lib/theme-chalk/backtop.css +0 -1
  161. package/lib/theme-chalk/badge.css +0 -1
  162. package/lib/theme-chalk/base.css +0 -1
  163. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  164. package/lib/theme-chalk/breadcrumb.css +0 -1
  165. package/lib/theme-chalk/button-group.css +0 -0
  166. package/lib/theme-chalk/button.css +0 -1
  167. package/lib/theme-chalk/calendar.css +0 -1
  168. package/lib/theme-chalk/card.css +0 -1
  169. package/lib/theme-chalk/carousel-item.css +0 -1
  170. package/lib/theme-chalk/carousel.css +0 -1
  171. package/lib/theme-chalk/cascader-panel.css +0 -1
  172. package/lib/theme-chalk/cascader.css +0 -1
  173. package/lib/theme-chalk/checkbox-button.css +0 -0
  174. package/lib/theme-chalk/checkbox-group.css +0 -0
  175. package/lib/theme-chalk/checkbox.css +0 -1
  176. package/lib/theme-chalk/col.css +0 -1
  177. package/lib/theme-chalk/collapse-item.css +0 -0
  178. package/lib/theme-chalk/collapse.css +0 -1
  179. package/lib/theme-chalk/color-picker.css +0 -1
  180. package/lib/theme-chalk/container.css +0 -1
  181. package/lib/theme-chalk/date-picker.css +0 -1
  182. package/lib/theme-chalk/descriptions-item.css +0 -1
  183. package/lib/theme-chalk/descriptions.css +0 -1
  184. package/lib/theme-chalk/dialog.css +0 -1
  185. package/lib/theme-chalk/display.css +0 -1
  186. package/lib/theme-chalk/divider.css +0 -1
  187. package/lib/theme-chalk/drawer.css +0 -1
  188. package/lib/theme-chalk/dropdown-item.css +0 -0
  189. package/lib/theme-chalk/dropdown-menu.css +0 -0
  190. package/lib/theme-chalk/dropdown.css +0 -1
  191. package/lib/theme-chalk/empty.css +0 -1
  192. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  193. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  194. package/lib/theme-chalk/footer.css +0 -1
  195. package/lib/theme-chalk/form-item.css +0 -0
  196. package/lib/theme-chalk/form.css +0 -1
  197. package/lib/theme-chalk/header.css +0 -1
  198. package/lib/theme-chalk/icon.css +0 -1
  199. package/lib/theme-chalk/image.css +0 -1
  200. package/lib/theme-chalk/index.css +0 -1
  201. package/lib/theme-chalk/infinite-scroll.css +0 -0
  202. package/lib/theme-chalk/infiniteScroll.css +0 -0
  203. package/lib/theme-chalk/input-number.css +0 -1
  204. package/lib/theme-chalk/input.css +0 -1
  205. package/lib/theme-chalk/link.css +0 -1
  206. package/lib/theme-chalk/loading.css +0 -1
  207. package/lib/theme-chalk/main.css +0 -1
  208. package/lib/theme-chalk/menu-item-group.css +0 -0
  209. package/lib/theme-chalk/menu-item.css +0 -0
  210. package/lib/theme-chalk/menu.css +0 -1
  211. package/lib/theme-chalk/message-box.css +0 -1
  212. package/lib/theme-chalk/message.css +0 -1
  213. package/lib/theme-chalk/notification.css +0 -1
  214. package/lib/theme-chalk/option-group.css +0 -1
  215. package/lib/theme-chalk/option.css +0 -1
  216. package/lib/theme-chalk/page-header.css +0 -1
  217. package/lib/theme-chalk/pagination.css +0 -1
  218. package/lib/theme-chalk/popconfirm.css +0 -1
  219. package/lib/theme-chalk/popover.css +0 -1
  220. package/lib/theme-chalk/popper.css +0 -1
  221. package/lib/theme-chalk/progress.css +0 -1
  222. package/lib/theme-chalk/radio-button.css +0 -1
  223. package/lib/theme-chalk/radio-group.css +0 -1
  224. package/lib/theme-chalk/radio.css +0 -1
  225. package/lib/theme-chalk/rate.css +0 -1
  226. package/lib/theme-chalk/reset.css +0 -1
  227. package/lib/theme-chalk/result.css +0 -1
  228. package/lib/theme-chalk/row.css +0 -1
  229. package/lib/theme-chalk/scrollbar.css +0 -1
  230. package/lib/theme-chalk/select-dropdown.css +0 -1
  231. package/lib/theme-chalk/select.css +0 -1
  232. package/lib/theme-chalk/skeleton-item.css +0 -1
  233. package/lib/theme-chalk/skeleton.css +0 -1
  234. package/lib/theme-chalk/slider.css +0 -1
  235. package/lib/theme-chalk/spinner.css +0 -1
  236. package/lib/theme-chalk/statistic.css +0 -1
  237. package/lib/theme-chalk/step.css +0 -1
  238. package/lib/theme-chalk/steps.css +0 -1
  239. package/lib/theme-chalk/submenu.css +0 -0
  240. package/lib/theme-chalk/switch.css +0 -1
  241. package/lib/theme-chalk/tab-pane.css +0 -0
  242. package/lib/theme-chalk/table-column.css +0 -1
  243. package/lib/theme-chalk/table.css +0 -1
  244. package/lib/theme-chalk/tabs.css +0 -1
  245. package/lib/theme-chalk/tag.css +0 -1
  246. package/lib/theme-chalk/time-picker.css +0 -1
  247. package/lib/theme-chalk/time-select.css +0 -1
  248. package/lib/theme-chalk/timeline-item.css +0 -1
  249. package/lib/theme-chalk/timeline.css +0 -1
  250. package/lib/theme-chalk/tooltip.css +0 -1
  251. package/lib/theme-chalk/transfer.css +0 -1
  252. package/lib/theme-chalk/tree.css +0 -1
  253. package/lib/theme-chalk/upload.css +0 -1
  254. package/lib/time-picker.js +0 -2983
  255. package/lib/time-select.js +0 -1782
  256. package/lib/timeline-item.js +0 -370
  257. package/lib/timeline.js +0 -274
  258. package/lib/tooltip.js +0 -423
  259. package/lib/transfer.js +0 -1104
  260. package/lib/transitions/collapse-transition.js +0 -91
  261. package/lib/tree.js +0 -2265
  262. package/lib/umd/locale/af-ZA.js +0 -142
  263. package/lib/umd/locale/ar.js +0 -141
  264. package/lib/umd/locale/az.js +0 -141
  265. package/lib/umd/locale/bg.js +0 -142
  266. package/lib/umd/locale/bn.js +0 -141
  267. package/lib/umd/locale/ca.js +0 -141
  268. package/lib/umd/locale/cs-CZ.js +0 -144
  269. package/lib/umd/locale/da.js +0 -141
  270. package/lib/umd/locale/de.js +0 -143
  271. package/lib/umd/locale/ee.js +0 -142
  272. package/lib/umd/locale/el.js +0 -142
  273. package/lib/umd/locale/en.js +0 -142
  274. package/lib/umd/locale/eo.js +0 -142
  275. package/lib/umd/locale/es.js +0 -141
  276. package/lib/umd/locale/eu.js +0 -142
  277. package/lib/umd/locale/fa.js +0 -142
  278. package/lib/umd/locale/fi.js +0 -142
  279. package/lib/umd/locale/fr.js +0 -141
  280. package/lib/umd/locale/he.js +0 -142
  281. package/lib/umd/locale/hr.js +0 -142
  282. package/lib/umd/locale/hu.js +0 -141
  283. package/lib/umd/locale/hy-AM.js +0 -142
  284. package/lib/umd/locale/id.js +0 -142
  285. package/lib/umd/locale/is.js +0 -142
  286. package/lib/umd/locale/it.js +0 -141
  287. package/lib/umd/locale/ja.js +0 -142
  288. package/lib/umd/locale/kg.js +0 -142
  289. package/lib/umd/locale/km.js +0 -142
  290. package/lib/umd/locale/ko.js +0 -142
  291. package/lib/umd/locale/ku.js +0 -142
  292. package/lib/umd/locale/kz.js +0 -142
  293. package/lib/umd/locale/lo-LA.js +0 -141
  294. package/lib/umd/locale/lt.js +0 -142
  295. package/lib/umd/locale/lv.js +0 -142
  296. package/lib/umd/locale/mn.js +0 -142
  297. package/lib/umd/locale/ms.js +0 -141
  298. package/lib/umd/locale/nb-NO.js +0 -141
  299. package/lib/umd/locale/nl.js +0 -142
  300. package/lib/umd/locale/pl.js +0 -142
  301. package/lib/umd/locale/pt-br.js +0 -142
  302. package/lib/umd/locale/pt.js +0 -142
  303. package/lib/umd/locale/ro.js +0 -142
  304. package/lib/umd/locale/ru-RU.js +0 -142
  305. package/lib/umd/locale/si.js +0 -142
  306. package/lib/umd/locale/sk.js +0 -144
  307. package/lib/umd/locale/sl.js +0 -142
  308. package/lib/umd/locale/sr-Latn.js +0 -142
  309. package/lib/umd/locale/sr.js +0 -142
  310. package/lib/umd/locale/sv-SE.js +0 -142
  311. package/lib/umd/locale/sw.js +0 -142
  312. package/lib/umd/locale/ta.js +0 -141
  313. package/lib/umd/locale/th.js +0 -142
  314. package/lib/umd/locale/tk.js +0 -142
  315. package/lib/umd/locale/tr-TR.js +0 -142
  316. package/lib/umd/locale/ua.js +0 -142
  317. package/lib/umd/locale/ug-CN.js +0 -142
  318. package/lib/umd/locale/uz-UZ.js +0 -142
  319. package/lib/umd/locale/vi.js +0 -142
  320. package/lib/umd/locale/zh-CN.js +0 -142
  321. package/lib/umd/locale/zh-TW.js +0 -142
  322. package/lib/upload.js +0 -1398
  323. package/lib/utils/after-leave.js +0 -35
  324. package/lib/utils/aria-dialog.js +0 -104
  325. package/lib/utils/aria-utils.js +0 -126
  326. package/lib/utils/clickoutside.js +0 -79
  327. package/lib/utils/date-util.js +0 -310
  328. package/lib/utils/date.js +0 -369
  329. package/lib/utils/dom.js +0 -234
  330. package/lib/utils/menu/aria-menubar.js +0 -24
  331. package/lib/utils/menu/aria-menuitem.js +0 -62
  332. package/lib/utils/menu/aria-submenu.js +0 -69
  333. package/lib/utils/merge.js +0 -21
  334. package/lib/utils/popper.js +0 -1291
  335. package/lib/utils/popup/index.js +0 -233
  336. package/lib/utils/popup/popup-manager.js +0 -205
  337. package/lib/utils/resize-event.js +0 -59
  338. package/lib/utils/scroll-into-view.js +0 -38
  339. package/lib/utils/scrollbar-width.js +0 -39
  340. package/lib/utils/shared.js +0 -12
  341. package/lib/utils/types.js +0 -52
  342. package/lib/utils/util.js +0 -290
  343. package/lib/utils/vdom.js +0 -13
  344. package/lib/utils/vue-popper.js +0 -202
@@ -1,2983 +0,0 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "/dist/";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 74);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
92
-
93
- "use strict";
94
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
95
- /* globals __VUE_SSR_CONTEXT__ */
96
-
97
- // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
98
- // This module is a runtime utility for cleaner component module output and will
99
- // be included in the final webpack user bundle.
100
-
101
- function normalizeComponent (
102
- scriptExports,
103
- render,
104
- staticRenderFns,
105
- functionalTemplate,
106
- injectStyles,
107
- scopeId,
108
- moduleIdentifier, /* server only */
109
- shadowMode /* vue-cli only */
110
- ) {
111
- // Vue.extend constructor export interop
112
- var options = typeof scriptExports === 'function'
113
- ? scriptExports.options
114
- : scriptExports
115
-
116
- // render functions
117
- if (render) {
118
- options.render = render
119
- options.staticRenderFns = staticRenderFns
120
- options._compiled = true
121
- }
122
-
123
- // functional template
124
- if (functionalTemplate) {
125
- options.functional = true
126
- }
127
-
128
- // scopedId
129
- if (scopeId) {
130
- options._scopeId = 'data-v-' + scopeId
131
- }
132
-
133
- var hook
134
- if (moduleIdentifier) { // server build
135
- hook = function (context) {
136
- // 2.3 injection
137
- context =
138
- context || // cached call
139
- (this.$vnode && this.$vnode.ssrContext) || // stateful
140
- (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
141
- // 2.2 with runInNewContext: true
142
- if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
143
- context = __VUE_SSR_CONTEXT__
144
- }
145
- // inject component styles
146
- if (injectStyles) {
147
- injectStyles.call(this, context)
148
- }
149
- // register component module identifier for async chunk inferrence
150
- if (context && context._registeredComponents) {
151
- context._registeredComponents.add(moduleIdentifier)
152
- }
153
- }
154
- // used by ssr in case component is cached and beforeCreate
155
- // never gets called
156
- options._ssrRegister = hook
157
- } else if (injectStyles) {
158
- hook = shadowMode
159
- ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
160
- : injectStyles
161
- }
162
-
163
- if (hook) {
164
- if (options.functional) {
165
- // for template-only hot-reload because in that case the render fn doesn't
166
- // go through the normalizer
167
- options._injectStyles = hook
168
- // register for functioal component in vue file
169
- var originalRender = options.render
170
- options.render = function renderWithStyleInjection (h, context) {
171
- hook.call(context)
172
- return originalRender(h, context)
173
- }
174
- } else {
175
- // inject component registration as beforeCreate hook
176
- var existing = options.beforeCreate
177
- options.beforeCreate = existing
178
- ? [].concat(existing, hook)
179
- : [hook]
180
- }
181
- }
182
-
183
- return {
184
- exports: scriptExports,
185
- options: options
186
- }
187
- }
188
-
189
-
190
- /***/ }),
191
-
192
- /***/ 1:
193
- /***/ (function(module, exports) {
194
-
195
- module.exports = require("element-ui/lib/utils/date-util");
196
-
197
- /***/ }),
198
-
199
- /***/ 11:
200
- /***/ (function(module, exports) {
201
-
202
- module.exports = require("element-ui/lib/input");
203
-
204
- /***/ }),
205
-
206
- /***/ 13:
207
- /***/ (function(module, exports) {
208
-
209
- module.exports = require("element-ui/lib/utils/clickoutside");
210
-
211
- /***/ }),
212
-
213
- /***/ 16:
214
- /***/ (function(module, exports) {
215
-
216
- module.exports = require("element-ui/lib/scrollbar");
217
-
218
- /***/ }),
219
-
220
- /***/ 2:
221
- /***/ (function(module, exports) {
222
-
223
- module.exports = require("element-ui/lib/utils/dom");
224
-
225
- /***/ }),
226
-
227
- /***/ 26:
228
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
229
-
230
- "use strict";
231
-
232
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
233
- var render = function() {
234
- var _vm = this
235
- var _h = _vm.$createElement
236
- var _c = _vm._self._c || _h
237
- return _c(
238
- "transition",
239
- {
240
- attrs: { name: "el-zoom-in-top" },
241
- on: {
242
- "after-leave": function($event) {
243
- _vm.$emit("dodestroy")
244
- }
245
- }
246
- },
247
- [
248
- _c(
249
- "div",
250
- {
251
- directives: [
252
- {
253
- name: "show",
254
- rawName: "v-show",
255
- value: _vm.visible,
256
- expression: "visible"
257
- }
258
- ],
259
- staticClass: "el-time-panel el-popper",
260
- class: _vm.popperClass
261
- },
262
- [
263
- _c(
264
- "div",
265
- {
266
- staticClass: "el-time-panel__content",
267
- class: { "has-seconds": _vm.showSeconds }
268
- },
269
- [
270
- _c("time-spinner", {
271
- ref: "spinner",
272
- attrs: {
273
- "arrow-control": _vm.useArrow,
274
- "show-seconds": _vm.showSeconds,
275
- "am-pm-mode": _vm.amPmMode,
276
- date: _vm.date
277
- },
278
- on: {
279
- change: _vm.handleChange,
280
- "select-range": _vm.setSelectionRange
281
- }
282
- })
283
- ],
284
- 1
285
- ),
286
- _c("div", { staticClass: "el-time-panel__footer" }, [
287
- _c(
288
- "button",
289
- {
290
- staticClass: "el-time-panel__btn cancel",
291
- attrs: { type: "button" },
292
- on: { click: _vm.handleCancel }
293
- },
294
- [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
295
- ),
296
- _c(
297
- "button",
298
- {
299
- staticClass: "el-time-panel__btn",
300
- class: { confirm: !_vm.disabled },
301
- attrs: { type: "button" },
302
- on: {
303
- click: function($event) {
304
- _vm.handleConfirm()
305
- }
306
- }
307
- },
308
- [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
309
- )
310
- ])
311
- ]
312
- )
313
- ]
314
- )
315
- }
316
- var staticRenderFns = []
317
- render._withStripped = true
318
-
319
-
320
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
321
-
322
- // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
323
- var date_util_ = __webpack_require__(1);
324
-
325
- // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
326
- var locale_ = __webpack_require__(6);
327
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
328
-
329
- // EXTERNAL MODULE: ./packages/date-picker/src/basic/time-spinner.vue + 4 modules
330
- var time_spinner = __webpack_require__(33);
331
-
332
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
333
- //
334
- //
335
- //
336
- //
337
- //
338
- //
339
- //
340
- //
341
- //
342
- //
343
- //
344
- //
345
- //
346
- //
347
- //
348
- //
349
- //
350
- //
351
- //
352
- //
353
- //
354
- //
355
- //
356
- //
357
- //
358
- //
359
- //
360
- //
361
- //
362
- //
363
- //
364
- //
365
-
366
-
367
-
368
-
369
-
370
- /* harmony default export */ var timevue_type_script_lang_js_ = ({
371
- mixins: [locale_default.a],
372
-
373
- components: {
374
- TimeSpinner: time_spinner["a" /* default */]
375
- },
376
-
377
- props: {
378
- visible: Boolean,
379
- timeArrowControl: Boolean
380
- },
381
-
382
- watch: {
383
- visible: function visible(val) {
384
- var _this = this;
385
-
386
- if (val) {
387
- this.oldValue = this.value;
388
- this.$nextTick(function () {
389
- return _this.$refs.spinner.emitSelectRange('hours');
390
- });
391
- } else {
392
- this.needInitAdjust = true;
393
- }
394
- },
395
- value: function value(newVal) {
396
- var _this2 = this;
397
-
398
- var date = void 0;
399
- if (newVal instanceof Date) {
400
- date = Object(date_util_["limitTimeRange"])(newVal, this.selectableRange, this.format);
401
- } else if (!newVal) {
402
- date = this.defaultValue ? new Date(this.defaultValue) : new Date();
403
- }
404
-
405
- this.date = date;
406
- if (this.visible && this.needInitAdjust) {
407
- this.$nextTick(function (_) {
408
- return _this2.adjustSpinners();
409
- });
410
- this.needInitAdjust = false;
411
- }
412
- },
413
- selectableRange: function selectableRange(val) {
414
- this.$refs.spinner.selectableRange = val;
415
- },
416
- defaultValue: function defaultValue(val) {
417
- if (!Object(date_util_["isDate"])(this.value)) {
418
- this.date = val ? new Date(val) : new Date();
419
- }
420
- }
421
- },
422
-
423
- data: function data() {
424
- return {
425
- popperClass: '',
426
- format: 'HH:mm:ss',
427
- value: '',
428
- defaultValue: null,
429
- date: new Date(),
430
- oldValue: new Date(),
431
- selectableRange: [],
432
- selectionRange: [0, 2],
433
- disabled: false,
434
- arrowControl: false,
435
- needInitAdjust: true
436
- };
437
- },
438
-
439
-
440
- computed: {
441
- showSeconds: function showSeconds() {
442
- return (this.format || '').indexOf('ss') !== -1;
443
- },
444
- useArrow: function useArrow() {
445
- return this.arrowControl || this.timeArrowControl || false;
446
- },
447
- amPmMode: function amPmMode() {
448
- if ((this.format || '').indexOf('A') !== -1) return 'A';
449
- if ((this.format || '').indexOf('a') !== -1) return 'a';
450
- return '';
451
- }
452
- },
453
-
454
- methods: {
455
- handleCancel: function handleCancel() {
456
- this.$emit('pick', this.oldValue, false);
457
- },
458
- handleChange: function handleChange(date) {
459
- // this.visible avoids edge cases, when use scrolls during panel closing animation
460
- if (this.visible) {
461
- this.date = Object(date_util_["clearMilliseconds"])(date);
462
- // if date is out of range, do not emit
463
- if (this.isValidValue(this.date)) {
464
- this.$emit('pick', this.date, true);
465
- }
466
- }
467
- },
468
- setSelectionRange: function setSelectionRange(start, end) {
469
- this.$emit('select-range', start, end);
470
- this.selectionRange = [start, end];
471
- },
472
- handleConfirm: function handleConfirm() {
473
- var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
474
- var first = arguments[1];
475
-
476
- if (first) return;
477
- var date = Object(date_util_["clearMilliseconds"])(Object(date_util_["limitTimeRange"])(this.date, this.selectableRange, this.format));
478
- this.$emit('pick', date, visible, first);
479
- },
480
- handleKeydown: function handleKeydown(event) {
481
- var keyCode = event.keyCode;
482
- var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
483
-
484
- // Left or Right
485
- if (keyCode === 37 || keyCode === 39) {
486
- var step = mapping[keyCode];
487
- this.changeSelectionRange(step);
488
- event.preventDefault();
489
- return;
490
- }
491
-
492
- // Up or Down
493
- if (keyCode === 38 || keyCode === 40) {
494
- var _step = mapping[keyCode];
495
- this.$refs.spinner.scrollDown(_step);
496
- event.preventDefault();
497
- return;
498
- }
499
- },
500
- isValidValue: function isValidValue(date) {
501
- return Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format);
502
- },
503
- adjustSpinners: function adjustSpinners() {
504
- return this.$refs.spinner.adjustSpinners();
505
- },
506
- changeSelectionRange: function changeSelectionRange(step) {
507
- var list = [0, 3].concat(this.showSeconds ? [6] : []);
508
- var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
509
- var index = list.indexOf(this.selectionRange[0]);
510
- var next = (index + step + list.length) % list.length;
511
- this.$refs.spinner.emitSelectRange(mapping[next]);
512
- }
513
- },
514
-
515
- mounted: function mounted() {
516
- var _this3 = this;
517
-
518
- this.$nextTick(function () {
519
- return _this3.handleConfirm(true, true);
520
- });
521
- this.$emit('mounted');
522
- }
523
- });
524
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
525
- /* harmony default export */ var panel_timevue_type_script_lang_js_ = (timevue_type_script_lang_js_);
526
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
527
- var componentNormalizer = __webpack_require__(0);
528
-
529
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue
530
-
531
-
532
-
533
-
534
-
535
- /* normalize component */
536
-
537
- var component = Object(componentNormalizer["a" /* default */])(
538
- panel_timevue_type_script_lang_js_,
539
- render,
540
- staticRenderFns,
541
- false,
542
- null,
543
- null,
544
- null
545
-
546
- )
547
-
548
- /* hot reload */
549
- if (false) { var api; }
550
- component.options.__file = "packages/date-picker/src/panel/time.vue"
551
- /* harmony default export */ var time = __webpack_exports__["a"] = (component.exports);
552
-
553
- /***/ }),
554
-
555
- /***/ 29:
556
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
557
-
558
- "use strict";
559
- /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
560
- /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__);
561
- /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
562
- /* harmony import */ var element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__);
563
-
564
-
565
-
566
- /* harmony default export */ __webpack_exports__["a"] = ({
567
- bind: function bind(el, binding, vnode) {
568
- var interval = null;
569
- var startTime = void 0;
570
- var maxIntervals = Object(element_ui_src_utils_util__WEBPACK_IMPORTED_MODULE_1__["isMac"])() ? 100 : 200;
571
- var handler = function handler() {
572
- return vnode.context[binding.expression].apply();
573
- };
574
- var clear = function clear() {
575
- if (Date.now() - startTime < maxIntervals) {
576
- handler();
577
- }
578
- clearInterval(interval);
579
- interval = null;
580
- };
581
-
582
- Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["on"])(el, 'mousedown', function (e) {
583
- if (e.button !== 0) return;
584
- startTime = Date.now();
585
- Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["once"])(document, 'mouseup', clear);
586
- clearInterval(interval);
587
- interval = setInterval(handler, maxIntervals);
588
- });
589
- }
590
- });
591
-
592
- /***/ }),
593
-
594
- /***/ 3:
595
- /***/ (function(module, exports) {
596
-
597
- module.exports = require("element-ui/lib/utils/util");
598
-
599
- /***/ }),
600
-
601
- /***/ 31:
602
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
603
-
604
- "use strict";
605
-
606
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
607
- var render = function() {
608
- var _vm = this
609
- var _h = _vm.$createElement
610
- var _c = _vm._self._c || _h
611
- return !_vm.ranged
612
- ? _c(
613
- "el-input",
614
- _vm._b(
615
- {
616
- directives: [
617
- {
618
- name: "clickoutside",
619
- rawName: "v-clickoutside",
620
- value: _vm.handleClose,
621
- expression: "handleClose"
622
- }
623
- ],
624
- ref: "reference",
625
- staticClass: "el-date-editor",
626
- class: "el-date-editor--" + _vm.type,
627
- attrs: {
628
- readonly:
629
- !_vm.editable ||
630
- _vm.readonly ||
631
- _vm.type === "dates" ||
632
- _vm.type === "week" ||
633
- _vm.type === "years" ||
634
- _vm.type === "months",
635
- disabled: _vm.pickerDisabled,
636
- size: _vm.pickerSize,
637
- name: _vm.name,
638
- placeholder: _vm.placeholder,
639
- value: _vm.displayValue,
640
- validateEvent: false
641
- },
642
- on: {
643
- focus: _vm.handleFocus,
644
- input: function(value) {
645
- return (_vm.userInput = value)
646
- },
647
- change: _vm.handleChange
648
- },
649
- nativeOn: {
650
- keydown: function($event) {
651
- return _vm.handleKeydown($event)
652
- },
653
- mouseenter: function($event) {
654
- return _vm.handleMouseEnter($event)
655
- },
656
- mouseleave: function($event) {
657
- _vm.showClose = false
658
- }
659
- }
660
- },
661
- "el-input",
662
- _vm.firstInputId,
663
- false
664
- ),
665
- [
666
- _c("i", {
667
- staticClass: "el-input__icon",
668
- class: _vm.triggerClass,
669
- attrs: { slot: "prefix" },
670
- on: { click: _vm.handleFocus },
671
- slot: "prefix"
672
- }),
673
- _vm.haveTrigger
674
- ? _c("i", {
675
- staticClass: "el-input__icon",
676
- class: [_vm.showClose ? "" + _vm.clearIcon : ""],
677
- attrs: { slot: "suffix" },
678
- on: { click: _vm.handleClickIcon },
679
- slot: "suffix"
680
- })
681
- : _vm._e()
682
- ]
683
- )
684
- : _c(
685
- "div",
686
- {
687
- directives: [
688
- {
689
- name: "clickoutside",
690
- rawName: "v-clickoutside",
691
- value: _vm.handleClose,
692
- expression: "handleClose"
693
- }
694
- ],
695
- ref: "reference",
696
- staticClass: "el-date-editor el-range-editor el-input__inner",
697
- class: [
698
- "el-date-editor--" + _vm.type,
699
- _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
700
- _vm.pickerDisabled ? "is-disabled" : "",
701
- _vm.pickerVisible ? "is-active" : ""
702
- ],
703
- on: {
704
- click: _vm.handleRangeClick,
705
- mouseenter: _vm.handleMouseEnter,
706
- mouseleave: function($event) {
707
- _vm.showClose = false
708
- },
709
- keydown: _vm.handleKeydown
710
- }
711
- },
712
- [
713
- _c("i", {
714
- class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
715
- }),
716
- _c(
717
- "input",
718
- _vm._b(
719
- {
720
- staticClass: "el-range-input",
721
- attrs: {
722
- autocomplete: "off",
723
- placeholder: _vm.startPlaceholder,
724
- disabled: _vm.pickerDisabled,
725
- readonly: !_vm.editable || _vm.readonly,
726
- name: _vm.name && _vm.name[0]
727
- },
728
- domProps: { value: _vm.displayValue && _vm.displayValue[0] },
729
- on: {
730
- input: _vm.handleStartInput,
731
- change: _vm.handleStartChange,
732
- focus: _vm.handleFocus
733
- }
734
- },
735
- "input",
736
- _vm.firstInputId,
737
- false
738
- )
739
- ),
740
- _vm._t("range-separator", [
741
- _c("span", { staticClass: "el-range-separator" }, [
742
- _vm._v(_vm._s(_vm.rangeSeparator))
743
- ])
744
- ]),
745
- _c(
746
- "input",
747
- _vm._b(
748
- {
749
- staticClass: "el-range-input",
750
- attrs: {
751
- autocomplete: "off",
752
- placeholder: _vm.endPlaceholder,
753
- disabled: _vm.pickerDisabled,
754
- readonly: !_vm.editable || _vm.readonly,
755
- name: _vm.name && _vm.name[1]
756
- },
757
- domProps: { value: _vm.displayValue && _vm.displayValue[1] },
758
- on: {
759
- input: _vm.handleEndInput,
760
- change: _vm.handleEndChange,
761
- focus: _vm.handleFocus
762
- }
763
- },
764
- "input",
765
- _vm.secondInputId,
766
- false
767
- )
768
- ),
769
- _vm.haveTrigger
770
- ? _c("i", {
771
- staticClass: "el-input__icon el-range__close-icon",
772
- class: [_vm.showClose ? "" + _vm.clearIcon : ""],
773
- on: { click: _vm.handleClickIcon }
774
- })
775
- : _vm._e()
776
- ],
777
- 2
778
- )
779
- }
780
- var staticRenderFns = []
781
- render._withStripped = true
782
-
783
-
784
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
785
-
786
- // EXTERNAL MODULE: external "vue"
787
- var external_vue_ = __webpack_require__(7);
788
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
789
-
790
- // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
791
- var clickoutside_ = __webpack_require__(13);
792
- var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
793
-
794
- // EXTERNAL MODULE: external "element-ui/lib/utils/util"
795
- var util_ = __webpack_require__(3);
796
-
797
- // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
798
- var date_util_ = __webpack_require__(1);
799
-
800
- // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
801
- var vue_popper_ = __webpack_require__(5);
802
- var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
803
-
804
- // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
805
- var emitter_ = __webpack_require__(4);
806
- var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
807
-
808
- // EXTERNAL MODULE: external "element-ui/lib/input"
809
- var input_ = __webpack_require__(11);
810
- var input_default = /*#__PURE__*/__webpack_require__.n(input_);
811
-
812
- // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
813
- var merge_ = __webpack_require__(9);
814
- var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
815
-
816
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
817
- //
818
- //
819
- //
820
- //
821
- //
822
- //
823
- //
824
- //
825
- //
826
- //
827
- //
828
- //
829
- //
830
- //
831
- //
832
- //
833
- //
834
- //
835
- //
836
- //
837
- //
838
- //
839
- //
840
- //
841
- //
842
- //
843
- //
844
- //
845
- //
846
- //
847
- //
848
- //
849
- //
850
- //
851
- //
852
- //
853
- //
854
- //
855
- //
856
- //
857
- //
858
- //
859
- //
860
- //
861
- //
862
- //
863
- //
864
- //
865
- //
866
- //
867
- //
868
- //
869
- //
870
- //
871
- //
872
- //
873
- //
874
- //
875
- //
876
- //
877
- //
878
- //
879
- //
880
- //
881
- //
882
- //
883
- //
884
- //
885
- //
886
- //
887
- //
888
- //
889
- //
890
- //
891
- //
892
- //
893
- //
894
- //
895
- //
896
- //
897
- //
898
- //
899
- //
900
- //
901
- //
902
-
903
-
904
-
905
-
906
-
907
-
908
-
909
-
910
-
911
-
912
- var NewPopper = {
913
- props: {
914
- appendToBody: vue_popper_default.a.props.appendToBody,
915
- offset: vue_popper_default.a.props.offset,
916
- boundariesPadding: vue_popper_default.a.props.boundariesPadding,
917
- arrowOffset: vue_popper_default.a.props.arrowOffset,
918
- transformOrigin: vue_popper_default.a.props.transformOrigin
919
- },
920
- methods: vue_popper_default.a.methods,
921
- data: function data() {
922
- return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
923
- },
924
-
925
- beforeDestroy: vue_popper_default.a.beforeDestroy
926
- };
927
-
928
- var DEFAULT_FORMATS = {
929
- date: 'yyyy-MM-dd',
930
- month: 'yyyy-MM',
931
- months: 'yyyy-MM',
932
- datetime: 'yyyy-MM-dd HH:mm:ss',
933
- time: 'HH:mm:ss',
934
- week: 'yyyywWW',
935
- timerange: 'HH:mm:ss',
936
- daterange: 'yyyy-MM-dd',
937
- monthrange: 'yyyy-MM',
938
- datetimerange: 'yyyy-MM-dd HH:mm:ss',
939
- year: 'yyyy',
940
- years: 'yyyy'
941
- };
942
- var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates', 'months', 'years'];
943
- var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
944
- if (format === 'timestamp') return value.getTime();
945
- return Object(date_util_["formatDate"])(value, format);
946
- };
947
- var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
948
- if (format === 'timestamp') return new Date(Number(text));
949
- return Object(date_util_["parseDate"])(text, format);
950
- };
951
- var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
952
- if (Array.isArray(value) && value.length === 2) {
953
- var start = value[0];
954
- var end = value[1];
955
-
956
- if (start && end) {
957
- return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
958
- }
959
- }
960
- return '';
961
- };
962
- var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
963
- if (!Array.isArray(array)) {
964
- array = array.split(separator);
965
- }
966
- if (array.length === 2) {
967
- var range1 = array[0];
968
- var range2 = array[1];
969
-
970
- return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
971
- }
972
- return [];
973
- };
974
- var TYPE_VALUE_RESOLVER_MAP = {
975
- default: {
976
- formatter: function formatter(value) {
977
- if (!value) return '';
978
- return '' + value;
979
- },
980
- parser: function parser(text) {
981
- if (text === undefined || text === '') return null;
982
- return text;
983
- }
984
- },
985
- week: {
986
- formatter: function formatter(value, format) {
987
- var week = Object(date_util_["getWeekNumber"])(value);
988
- var month = value.getMonth();
989
- var trueDate = new Date(value);
990
- if (week === 1 && month === 11) {
991
- trueDate.setHours(0, 0, 0, 0);
992
- trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
993
- }
994
- var date = Object(date_util_["formatDate"])(trueDate, format);
995
-
996
- date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
997
- return date;
998
- },
999
- parser: function parser(text, format) {
1000
- // parse as if a normal date
1001
- return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
1002
- }
1003
- },
1004
- date: {
1005
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1006
- parser: pickervue_type_script_lang_js_DATE_PARSER
1007
- },
1008
- datetime: {
1009
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1010
- parser: pickervue_type_script_lang_js_DATE_PARSER
1011
- },
1012
- daterange: {
1013
- formatter: RANGE_FORMATTER,
1014
- parser: RANGE_PARSER
1015
- },
1016
- monthrange: {
1017
- formatter: RANGE_FORMATTER,
1018
- parser: RANGE_PARSER
1019
- },
1020
- datetimerange: {
1021
- formatter: RANGE_FORMATTER,
1022
- parser: RANGE_PARSER
1023
- },
1024
- timerange: {
1025
- formatter: RANGE_FORMATTER,
1026
- parser: RANGE_PARSER
1027
- },
1028
- time: {
1029
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1030
- parser: pickervue_type_script_lang_js_DATE_PARSER
1031
- },
1032
- month: {
1033
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1034
- parser: pickervue_type_script_lang_js_DATE_PARSER
1035
- },
1036
- year: {
1037
- formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
1038
- parser: pickervue_type_script_lang_js_DATE_PARSER
1039
- },
1040
- number: {
1041
- formatter: function formatter(value) {
1042
- if (!value) return '';
1043
- return '' + value;
1044
- },
1045
- parser: function parser(text) {
1046
- var result = Number(text);
1047
-
1048
- if (!isNaN(text)) {
1049
- return result;
1050
- } else {
1051
- return null;
1052
- }
1053
- }
1054
- },
1055
- dates: {
1056
- formatter: function formatter(value, format) {
1057
- return value.map(function (date) {
1058
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1059
- });
1060
- },
1061
- parser: function parser(value, format) {
1062
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1063
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1064
- });
1065
- }
1066
- },
1067
- months: {
1068
- formatter: function formatter(value, format) {
1069
- return value.map(function (date) {
1070
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1071
- });
1072
- },
1073
- parser: function parser(value, format) {
1074
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1075
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1076
- });
1077
- }
1078
- },
1079
- years: {
1080
- formatter: function formatter(value, format) {
1081
- return value.map(function (date) {
1082
- return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
1083
- });
1084
- },
1085
- parser: function parser(value, format) {
1086
- return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
1087
- return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
1088
- });
1089
- }
1090
- }
1091
- };
1092
- var PLACEMENT_MAP = {
1093
- left: 'bottom-start',
1094
- center: 'bottom',
1095
- right: 'bottom-end'
1096
- };
1097
-
1098
- var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
1099
- var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
1100
-
1101
- if (!value) return null;
1102
- var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
1103
- var format = customFormat || DEFAULT_FORMATS[type];
1104
- return parser(value, format, rangeSeparator);
1105
- };
1106
-
1107
- var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
1108
- if (!value) return null;
1109
- var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
1110
- var format = customFormat || DEFAULT_FORMATS[type];
1111
- return formatter(value, format);
1112
- };
1113
-
1114
- /*
1115
- * Considers:
1116
- * 1. Date object
1117
- * 2. date string
1118
- * 3. array of 1 or 2
1119
- */
1120
- var valueEquals = function valueEquals(a, b) {
1121
- // considers Date object and string
1122
- var dateEquals = function dateEquals(a, b) {
1123
- var aIsDate = a instanceof Date;
1124
- var bIsDate = b instanceof Date;
1125
- if (aIsDate && bIsDate) {
1126
- return a.getTime() === b.getTime();
1127
- }
1128
- if (!aIsDate && !bIsDate) {
1129
- return a === b;
1130
- }
1131
- return false;
1132
- };
1133
-
1134
- var aIsArray = a instanceof Array;
1135
- var bIsArray = b instanceof Array;
1136
- if (aIsArray && bIsArray) {
1137
- if (a.length !== b.length) {
1138
- return false;
1139
- }
1140
- return a.every(function (item, index) {
1141
- return dateEquals(item, b[index]);
1142
- });
1143
- }
1144
- if (!aIsArray && !bIsArray) {
1145
- return dateEquals(a, b);
1146
- }
1147
- return false;
1148
- };
1149
-
1150
- var isString = function isString(val) {
1151
- return typeof val === 'string' || val instanceof String;
1152
- };
1153
-
1154
- var validator = function validator(val) {
1155
- // either: String, Array of String, null / undefined
1156
- return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
1157
- };
1158
-
1159
- /* harmony default export */ var pickervue_type_script_lang_js_ = ({
1160
- mixins: [emitter_default.a, NewPopper],
1161
-
1162
- inject: {
1163
- elForm: {
1164
- default: ''
1165
- },
1166
- elFormItem: {
1167
- default: ''
1168
- }
1169
- },
1170
-
1171
- props: {
1172
- size: String,
1173
- format: String,
1174
- valueFormat: String,
1175
- readonly: Boolean,
1176
- placeholder: String,
1177
- startPlaceholder: String,
1178
- endPlaceholder: String,
1179
- prefixIcon: String,
1180
- clearIcon: {
1181
- type: String,
1182
- default: 'el-icon-circle-close'
1183
- },
1184
- name: {
1185
- default: '',
1186
- validator: validator
1187
- },
1188
- disabled: Boolean,
1189
- clearable: {
1190
- type: Boolean,
1191
- default: true
1192
- },
1193
- id: {
1194
- default: '',
1195
- validator: validator
1196
- },
1197
- popperClass: String,
1198
- editable: {
1199
- type: Boolean,
1200
- default: true
1201
- },
1202
- align: {
1203
- type: String,
1204
- default: 'left'
1205
- },
1206
- value: {},
1207
- defaultValue: {},
1208
- defaultTime: {},
1209
- rangeSeparator: {
1210
- default: '-'
1211
- },
1212
- pickerOptions: {},
1213
- unlinkPanels: Boolean,
1214
- validateEvent: {
1215
- type: Boolean,
1216
- default: true
1217
- }
1218
- },
1219
-
1220
- components: { ElInput: input_default.a },
1221
-
1222
- directives: { Clickoutside: clickoutside_default.a },
1223
-
1224
- data: function data() {
1225
- return {
1226
- pickerVisible: false,
1227
- showClose: false,
1228
- userInput: null,
1229
- valueOnOpen: null, // value when picker opens, used to determine whether to emit change
1230
- unwatchPickerOptions: null,
1231
- scale: 1
1232
- };
1233
- },
1234
-
1235
-
1236
- watch: {
1237
- pickerVisible: function pickerVisible(val) {
1238
- if (this.readonly || this.pickerDisabled) return;
1239
- if (val) {
1240
- this.showPicker();
1241
- this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
1242
- } else {
1243
- this.hidePicker();
1244
- this.emitChange(this.value);
1245
- this.userInput = null;
1246
- if (this.validateEvent) {
1247
- this.dispatch('ElFormItem', 'el.form.blur');
1248
- }
1249
- this.$emit('blur', this);
1250
- this.blur();
1251
- }
1252
- },
1253
-
1254
- parsedValue: {
1255
- immediate: true,
1256
- handler: function handler(val) {
1257
- if (this.picker) {
1258
- this.picker.value = val;
1259
- }
1260
- }
1261
- },
1262
- defaultValue: function defaultValue(val) {
1263
- // NOTE: should eventually move to jsx style picker + panel ?
1264
- if (this.picker) {
1265
- this.picker.defaultValue = val;
1266
- }
1267
- },
1268
- value: function value(val, oldVal) {
1269
- if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
1270
- this.dispatch('ElFormItem', 'el.form.change', val);
1271
- }
1272
- }
1273
- },
1274
-
1275
- computed: {
1276
- ranged: function ranged() {
1277
- return this.type.indexOf('range') > -1;
1278
- },
1279
- reference: function reference() {
1280
- var reference = this.$refs.reference;
1281
- return reference.$el || reference;
1282
- },
1283
- refInput: function refInput() {
1284
- if (this.reference) {
1285
- return [].slice.call(this.reference.querySelectorAll('input'));
1286
- }
1287
- return [];
1288
- },
1289
- valueIsEmpty: function valueIsEmpty() {
1290
- var val = this.value;
1291
- if (Array.isArray(val)) {
1292
- for (var i = 0, len = val.length; i < len; i++) {
1293
- if (val[i]) {
1294
- return false;
1295
- }
1296
- }
1297
- } else {
1298
- if (val) {
1299
- return false;
1300
- }
1301
- }
1302
- return true;
1303
- },
1304
- triggerClass: function triggerClass() {
1305
- return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
1306
- },
1307
- selectionMode: function selectionMode() {
1308
- if (this.type === 'week') {
1309
- return 'week';
1310
- } else if (this.type === 'month') {
1311
- return 'month';
1312
- } else if (this.type === 'year') {
1313
- return 'year';
1314
- } else if (this.type === 'dates') {
1315
- return 'dates';
1316
- } else if (this.type === 'months') {
1317
- return 'months';
1318
- } else if (this.type === 'years') {
1319
- return 'years';
1320
- }
1321
-
1322
- return 'day';
1323
- },
1324
- haveTrigger: function haveTrigger() {
1325
- if (typeof this.showTrigger !== 'undefined') {
1326
- return this.showTrigger;
1327
- }
1328
- return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
1329
- },
1330
- displayValue: function displayValue() {
1331
- var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
1332
- if (Array.isArray(this.userInput)) {
1333
- return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
1334
- } else if (this.userInput !== null) {
1335
- return this.userInput;
1336
- } else if (formattedValue) {
1337
- return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
1338
- } else {
1339
- return '';
1340
- }
1341
- },
1342
- parsedValue: function parsedValue() {
1343
- if (!this.value) return this.value; // component value is not set
1344
- if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
1345
-
1346
- var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
1347
- if (valueIsDateObject) {
1348
- return this.value;
1349
- }
1350
-
1351
- if (this.valueFormat) {
1352
- return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
1353
- }
1354
-
1355
- // NOTE: deal with common but incorrect usage, should remove in next major version
1356
- // user might provide string / timestamp without value-format, coerce them into date (or array of date)
1357
- return Array.isArray(this.value) ? this.value.map(function (val) {
1358
- return new Date(val);
1359
- }) : new Date(this.value);
1360
- },
1361
- _elFormItemSize: function _elFormItemSize() {
1362
- return (this.elFormItem || {}).elFormItemSize;
1363
- },
1364
- pickerSize: function pickerSize() {
1365
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
1366
- },
1367
- pickerDisabled: function pickerDisabled() {
1368
- return this.disabled || (this.elForm || {}).disabled;
1369
- },
1370
- firstInputId: function firstInputId() {
1371
- var obj = {};
1372
- var id = void 0;
1373
- if (this.ranged) {
1374
- id = this.id && this.id[0];
1375
- } else {
1376
- id = this.id;
1377
- }
1378
- if (id) obj.id = id;
1379
- return obj;
1380
- },
1381
- secondInputId: function secondInputId() {
1382
- var obj = {};
1383
- var id = void 0;
1384
- if (this.ranged) {
1385
- id = this.id && this.id[1];
1386
- }
1387
- if (id) obj.id = id;
1388
- return obj;
1389
- }
1390
- },
1391
-
1392
- created: function created() {
1393
- // vue-popper
1394
- this.popperOptions = {
1395
- boundariesPadding: 0,
1396
- gpuAcceleration: false
1397
- };
1398
- this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
1399
-
1400
- this.$on('fieldReset', this.handleFieldReset);
1401
- },
1402
- mounted: function mounted() {
1403
- this.scale = Object(util_["getExternalScalingRatio"])(window.offsetEl);
1404
- },
1405
-
1406
-
1407
- methods: {
1408
- focus: function focus() {
1409
- if (!this.ranged) {
1410
- this.$refs.reference.focus();
1411
- } else {
1412
- this.handleFocus();
1413
- }
1414
- },
1415
- blur: function blur() {
1416
- this.refInput.forEach(function (input) {
1417
- return input.blur();
1418
- });
1419
- },
1420
-
1421
-
1422
- // {parse, formatTo} Value deals maps component value with internal Date
1423
- parseValue: function parseValue(value) {
1424
- var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
1425
- if (this.valueFormat && !isParsed) {
1426
- return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
1427
- } else {
1428
- return value;
1429
- }
1430
- },
1431
- formatToValue: function formatToValue(date) {
1432
- var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
1433
- if (this.valueFormat && isFormattable) {
1434
- return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
1435
- } else {
1436
- return date;
1437
- }
1438
- },
1439
-
1440
-
1441
- // {parse, formatTo} String deals with user input
1442
- parseString: function parseString(value) {
1443
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1444
- return parseAsFormatAndType(value, this.format, type);
1445
- },
1446
- formatToString: function formatToString(value) {
1447
- var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
1448
- return formatAsFormatAndType(value, this.format, type);
1449
- },
1450
- handleMouseEnter: function handleMouseEnter() {
1451
- if (this.readonly || this.pickerDisabled) return;
1452
- if (!this.valueIsEmpty && this.clearable) {
1453
- this.showClose = true;
1454
- }
1455
- },
1456
- handleChange: function handleChange() {
1457
- if (this.userInput) {
1458
- var value = this.parseString(this.displayValue);
1459
- if (value) {
1460
- this.picker.value = value;
1461
- if (this.isValidValue(value)) {
1462
- this.emitInput(value);
1463
- this.userInput = null;
1464
- }
1465
- }
1466
- }
1467
- if (this.userInput === '') {
1468
- this.emitInput(null);
1469
- this.emitChange(null);
1470
- this.userInput = null;
1471
- }
1472
- },
1473
- handleStartInput: function handleStartInput(event) {
1474
- if (this.userInput) {
1475
- this.userInput = [event.target.value, this.userInput[1]];
1476
- } else {
1477
- this.userInput = [event.target.value, null];
1478
- }
1479
- },
1480
- handleEndInput: function handleEndInput(event) {
1481
- if (this.userInput) {
1482
- this.userInput = [this.userInput[0], event.target.value];
1483
- } else {
1484
- this.userInput = [null, event.target.value];
1485
- }
1486
- },
1487
- handleStartChange: function handleStartChange(event) {
1488
- var value = this.parseString(this.userInput && this.userInput[0]);
1489
- if (value) {
1490
- this.userInput = [this.formatToString(value), this.displayValue[1]];
1491
- var newValue = [value, this.picker.value && this.picker.value[1]];
1492
- this.picker.value = newValue;
1493
- if (this.isValidValue(newValue)) {
1494
- this.emitInput(newValue);
1495
- this.userInput = null;
1496
- }
1497
- }
1498
- },
1499
- handleEndChange: function handleEndChange(event) {
1500
- var value = this.parseString(this.userInput && this.userInput[1]);
1501
- if (value) {
1502
- this.userInput = [this.displayValue[0], this.formatToString(value)];
1503
- var newValue = [this.picker.value && this.picker.value[0], value];
1504
- this.picker.value = newValue;
1505
- if (this.isValidValue(newValue)) {
1506
- this.emitInput(newValue);
1507
- this.userInput = null;
1508
- }
1509
- }
1510
- },
1511
- handleClickIcon: function handleClickIcon(event) {
1512
- if (this.readonly || this.pickerDisabled) return;
1513
- if (this.showClose) {
1514
- this.valueOnOpen = this.value;
1515
- event.stopPropagation();
1516
- this.emitInput(null);
1517
- this.emitChange(null);
1518
- this.showClose = false;
1519
- if (this.picker && typeof this.picker.handleClear === 'function') {
1520
- this.picker.handleClear();
1521
- }
1522
- } else {
1523
- this.pickerVisible = !this.pickerVisible;
1524
- }
1525
- },
1526
- handleClose: function handleClose() {
1527
- if (!this.pickerVisible) return;
1528
- this.pickerVisible = false;
1529
-
1530
- if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
1531
- // restore to former value
1532
- var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
1533
- this.emitInput(oldValue);
1534
- }
1535
- },
1536
- handleFieldReset: function handleFieldReset(initialValue) {
1537
- this.userInput = initialValue === '' ? null : initialValue;
1538
- },
1539
- handleFocus: function handleFocus() {
1540
- var type = this.type;
1541
-
1542
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1543
- this.pickerVisible = true;
1544
- }
1545
- this.$emit('focus', this);
1546
- },
1547
- handleKeydown: function handleKeydown(event) {
1548
- var _this = this;
1549
-
1550
- var keyCode = event.keyCode;
1551
-
1552
- // ESC
1553
- if (keyCode === 27) {
1554
- this.pickerVisible = false;
1555
- event.stopPropagation();
1556
- return;
1557
- }
1558
-
1559
- // Tab
1560
- if (keyCode === 9) {
1561
- if (!this.ranged) {
1562
- this.handleChange();
1563
- this.pickerVisible = this.picker.visible = false;
1564
- this.blur();
1565
- event.stopPropagation();
1566
- } else {
1567
- // user may change focus between two input
1568
- setTimeout(function () {
1569
- if (_this.refInput.indexOf(document.activeElement) === -1) {
1570
- _this.pickerVisible = false;
1571
- _this.blur();
1572
- event.stopPropagation();
1573
- }
1574
- }, 0);
1575
- }
1576
- return;
1577
- }
1578
-
1579
- // Enter
1580
- if (keyCode === 13) {
1581
- if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
1582
- this.handleChange();
1583
- this.pickerVisible = this.picker.visible = false;
1584
- this.blur();
1585
- }
1586
- event.stopPropagation();
1587
- return;
1588
- }
1589
-
1590
- // if user is typing, do not let picker handle key input
1591
- if (this.userInput) {
1592
- event.stopPropagation();
1593
- return;
1594
- }
1595
-
1596
- // delegate other keys to panel
1597
- if (this.picker && this.picker.handleKeydown) {
1598
- this.picker.handleKeydown(event);
1599
- }
1600
- },
1601
- handleRangeClick: function handleRangeClick() {
1602
- var type = this.type;
1603
-
1604
- if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
1605
- this.pickerVisible = true;
1606
- }
1607
- this.$emit('focus', this);
1608
- },
1609
- hidePicker: function hidePicker() {
1610
- if (this.picker) {
1611
- this.picker.resetView && this.picker.resetView();
1612
- this.pickerVisible = this.picker.visible = false;
1613
- this.destroyPopper();
1614
- }
1615
- },
1616
- showPicker: function showPicker() {
1617
- var _this2 = this;
1618
-
1619
- if (this.$isServer) return;
1620
- if (!this.picker) {
1621
- this.mountPicker();
1622
- }
1623
- this.pickerVisible = this.picker.visible = true;
1624
-
1625
- this.updatePopper();
1626
-
1627
- this.picker.value = this.parsedValue;
1628
- this.picker.resetView && this.picker.resetView();
1629
-
1630
- this.$nextTick(function () {
1631
- _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
1632
- });
1633
- },
1634
- mountPicker: function mountPicker() {
1635
- var _this3 = this;
1636
-
1637
- this.picker = new external_vue_default.a(this.panel).$mount();
1638
- this.picker.defaultValue = this.defaultValue;
1639
- this.picker.defaultTime = this.defaultTime;
1640
- this.picker.popperClass = this.popperClass;
1641
- this.popperElm = this.picker.$el;
1642
- this.picker.width = this.reference.getBoundingClientRect().width;
1643
- this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
1644
- this.picker.selectionMode = this.selectionMode;
1645
- this.picker.unlinkPanels = this.unlinkPanels;
1646
- this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
1647
- this.$watch('format', function (format) {
1648
- _this3.picker.format = format;
1649
- });
1650
-
1651
- var updateOptions = function updateOptions() {
1652
- var options = _this3.pickerOptions;
1653
-
1654
- if (options && options.selectableRange) {
1655
- var ranges = options.selectableRange;
1656
- var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
1657
- var format = DEFAULT_FORMATS.timerange;
1658
-
1659
- ranges = Array.isArray(ranges) ? ranges : [ranges];
1660
- _this3.picker.selectableRange = ranges.map(function (range) {
1661
- return parser(range, format, _this3.rangeSeparator);
1662
- });
1663
- }
1664
-
1665
- for (var option in options) {
1666
- if (options.hasOwnProperty(option) &&
1667
- // 忽略 time-picker 的该配置项
1668
- option !== 'selectableRange') {
1669
- _this3.picker[option] = options[option];
1670
- }
1671
- }
1672
-
1673
- // main format must prevail over undocumented pickerOptions.format
1674
- if (_this3.format) {
1675
- _this3.picker.format = _this3.format;
1676
- }
1677
- };
1678
- updateOptions();
1679
- this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
1680
- return updateOptions();
1681
- }, { deep: true });
1682
- this.$el.appendChild(this.picker.$el);
1683
- this.picker.resetView && this.picker.resetView();
1684
-
1685
- this.picker.$on('dodestroy', this.doDestroy);
1686
- this.picker.$on('pick', function () {
1687
- var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1688
- var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1689
-
1690
- _this3.userInput = null;
1691
- _this3.pickerVisible = _this3.picker.visible = visible;
1692
- _this3.emitInput(date);
1693
- _this3.picker.resetView && _this3.picker.resetView();
1694
- });
1695
-
1696
- this.picker.$on('select-range', function (start, end, pos) {
1697
- if (_this3.refInput.length === 0) return;
1698
- if (!pos || pos === 'min') {
1699
- _this3.refInput[0].setSelectionRange(start, end);
1700
- _this3.refInput[0].focus();
1701
- } else if (pos === 'max') {
1702
- _this3.refInput[1].setSelectionRange(start, end);
1703
- _this3.refInput[1].focus();
1704
- }
1705
- });
1706
- },
1707
- unmountPicker: function unmountPicker() {
1708
- if (this.picker) {
1709
- this.picker.$destroy();
1710
- this.picker.$off();
1711
- if (typeof this.unwatchPickerOptions === 'function') {
1712
- this.unwatchPickerOptions();
1713
- }
1714
- this.picker.$el.parentNode.removeChild(this.picker.$el);
1715
- }
1716
- },
1717
- emitChange: function emitChange(val) {
1718
- // determine user real change only
1719
- if (!valueEquals(val, this.valueOnOpen)) {
1720
- this.$emit('change', val);
1721
- this.valueOnOpen = val;
1722
- if (this.validateEvent) {
1723
- this.dispatch('ElFormItem', 'el.form.change', val);
1724
- }
1725
- }
1726
- },
1727
- emitInput: function emitInput(val) {
1728
- var formatted = this.formatToValue(val);
1729
- if (!valueEquals(this.value, formatted)) {
1730
- this.$emit('input', formatted);
1731
- }
1732
- },
1733
- isValidValue: function isValidValue(value) {
1734
- if (!this.picker) {
1735
- this.mountPicker();
1736
- }
1737
- if (this.picker.isValidValue) {
1738
- return value && this.picker.isValidValue(value);
1739
- } else {
1740
- return true;
1741
- }
1742
- }
1743
- }
1744
- });
1745
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
1746
- /* harmony default export */ var src_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
1747
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
1748
- var componentNormalizer = __webpack_require__(0);
1749
-
1750
- // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
1751
-
1752
-
1753
-
1754
-
1755
-
1756
- /* normalize component */
1757
-
1758
- var component = Object(componentNormalizer["a" /* default */])(
1759
- src_pickervue_type_script_lang_js_,
1760
- render,
1761
- staticRenderFns,
1762
- false,
1763
- null,
1764
- null,
1765
- null
1766
-
1767
- )
1768
-
1769
- /* hot reload */
1770
- if (false) { var api; }
1771
- component.options.__file = "packages/date-picker/src/picker.vue"
1772
- /* harmony default export */ var picker = __webpack_exports__["a"] = (component.exports);
1773
-
1774
- /***/ }),
1775
-
1776
- /***/ 33:
1777
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1778
-
1779
- "use strict";
1780
-
1781
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
1782
- var render = function() {
1783
- var _vm = this
1784
- var _h = _vm.$createElement
1785
- var _c = _vm._self._c || _h
1786
- return _c(
1787
- "div",
1788
- {
1789
- staticClass: "el-time-spinner",
1790
- class: { "has-seconds": _vm.showSeconds }
1791
- },
1792
- [
1793
- !_vm.arrowControl
1794
- ? [
1795
- _c(
1796
- "el-scrollbar",
1797
- {
1798
- ref: "hours",
1799
- staticClass: "el-time-spinner__wrapper",
1800
- attrs: {
1801
- "wrap-style": "max-height: inherit;",
1802
- "view-class": "el-time-spinner__list",
1803
- noresize: "",
1804
- tag: "ul"
1805
- },
1806
- nativeOn: {
1807
- mouseenter: function($event) {
1808
- _vm.emitSelectRange("hours")
1809
- },
1810
- mousemove: function($event) {
1811
- _vm.adjustCurrentSpinner("hours")
1812
- }
1813
- }
1814
- },
1815
- _vm._l(_vm.hoursList, function(disabled, hour) {
1816
- return _c(
1817
- "li",
1818
- {
1819
- key: hour,
1820
- staticClass: "el-time-spinner__item",
1821
- class: { active: hour === _vm.hours, disabled: disabled },
1822
- on: {
1823
- click: function($event) {
1824
- _vm.handleClick("hours", {
1825
- value: hour,
1826
- disabled: disabled
1827
- })
1828
- }
1829
- }
1830
- },
1831
- [
1832
- _vm._v(
1833
- _vm._s(
1834
- ("0" + (_vm.amPmMode ? hour % 12 || 12 : hour)).slice(
1835
- -2
1836
- )
1837
- ) + _vm._s(_vm.amPm(hour))
1838
- )
1839
- ]
1840
- )
1841
- }),
1842
- 0
1843
- ),
1844
- _c(
1845
- "el-scrollbar",
1846
- {
1847
- ref: "minutes",
1848
- staticClass: "el-time-spinner__wrapper",
1849
- attrs: {
1850
- "wrap-style": "max-height: inherit;",
1851
- "view-class": "el-time-spinner__list",
1852
- noresize: "",
1853
- tag: "ul"
1854
- },
1855
- nativeOn: {
1856
- mouseenter: function($event) {
1857
- _vm.emitSelectRange("minutes")
1858
- },
1859
- mousemove: function($event) {
1860
- _vm.adjustCurrentSpinner("minutes")
1861
- }
1862
- }
1863
- },
1864
- _vm._l(_vm.minutesList, function(enabled, key) {
1865
- return _c(
1866
- "li",
1867
- {
1868
- key: key,
1869
- staticClass: "el-time-spinner__item",
1870
- class: { active: key === _vm.minutes, disabled: !enabled },
1871
- on: {
1872
- click: function($event) {
1873
- _vm.handleClick("minutes", {
1874
- value: key,
1875
- disabled: false
1876
- })
1877
- }
1878
- }
1879
- },
1880
- [_vm._v(_vm._s(("0" + key).slice(-2)))]
1881
- )
1882
- }),
1883
- 0
1884
- ),
1885
- _c(
1886
- "el-scrollbar",
1887
- {
1888
- directives: [
1889
- {
1890
- name: "show",
1891
- rawName: "v-show",
1892
- value: _vm.showSeconds,
1893
- expression: "showSeconds"
1894
- }
1895
- ],
1896
- ref: "seconds",
1897
- staticClass: "el-time-spinner__wrapper",
1898
- attrs: {
1899
- "wrap-style": "max-height: inherit;",
1900
- "view-class": "el-time-spinner__list",
1901
- noresize: "",
1902
- tag: "ul"
1903
- },
1904
- nativeOn: {
1905
- mouseenter: function($event) {
1906
- _vm.emitSelectRange("seconds")
1907
- },
1908
- mousemove: function($event) {
1909
- _vm.adjustCurrentSpinner("seconds")
1910
- }
1911
- }
1912
- },
1913
- _vm._l(60, function(second, key) {
1914
- return _c(
1915
- "li",
1916
- {
1917
- key: key,
1918
- staticClass: "el-time-spinner__item",
1919
- class: { active: key === _vm.seconds },
1920
- on: {
1921
- click: function($event) {
1922
- _vm.handleClick("seconds", {
1923
- value: key,
1924
- disabled: false
1925
- })
1926
- }
1927
- }
1928
- },
1929
- [_vm._v(_vm._s(("0" + key).slice(-2)))]
1930
- )
1931
- }),
1932
- 0
1933
- )
1934
- ]
1935
- : _vm._e(),
1936
- _vm.arrowControl
1937
- ? [
1938
- _c(
1939
- "div",
1940
- {
1941
- staticClass: "el-time-spinner__wrapper is-arrow",
1942
- on: {
1943
- mouseenter: function($event) {
1944
- _vm.emitSelectRange("hours")
1945
- }
1946
- }
1947
- },
1948
- [
1949
- _c("i", {
1950
- directives: [
1951
- {
1952
- name: "repeat-click",
1953
- rawName: "v-repeat-click",
1954
- value: _vm.decrease,
1955
- expression: "decrease"
1956
- }
1957
- ],
1958
- staticClass: "el-time-spinner__arrow el-icon-arrow-up"
1959
- }),
1960
- _c("i", {
1961
- directives: [
1962
- {
1963
- name: "repeat-click",
1964
- rawName: "v-repeat-click",
1965
- value: _vm.increase,
1966
- expression: "increase"
1967
- }
1968
- ],
1969
- staticClass: "el-time-spinner__arrow el-icon-arrow-down"
1970
- }),
1971
- _c(
1972
- "ul",
1973
- { ref: "hours", staticClass: "el-time-spinner__list" },
1974
- _vm._l(_vm.arrowHourList, function(hour, key) {
1975
- return _c(
1976
- "li",
1977
- {
1978
- key: key,
1979
- staticClass: "el-time-spinner__item",
1980
- class: {
1981
- active: hour === _vm.hours,
1982
- disabled: _vm.hoursList[hour]
1983
- }
1984
- },
1985
- [
1986
- _vm._v(
1987
- _vm._s(
1988
- hour === undefined
1989
- ? ""
1990
- : (
1991
- "0" + (_vm.amPmMode ? hour % 12 || 12 : hour)
1992
- ).slice(-2) + _vm.amPm(hour)
1993
- )
1994
- )
1995
- ]
1996
- )
1997
- }),
1998
- 0
1999
- )
2000
- ]
2001
- ),
2002
- _c(
2003
- "div",
2004
- {
2005
- staticClass: "el-time-spinner__wrapper is-arrow",
2006
- on: {
2007
- mouseenter: function($event) {
2008
- _vm.emitSelectRange("minutes")
2009
- }
2010
- }
2011
- },
2012
- [
2013
- _c("i", {
2014
- directives: [
2015
- {
2016
- name: "repeat-click",
2017
- rawName: "v-repeat-click",
2018
- value: _vm.decrease,
2019
- expression: "decrease"
2020
- }
2021
- ],
2022
- staticClass: "el-time-spinner__arrow el-icon-arrow-up"
2023
- }),
2024
- _c("i", {
2025
- directives: [
2026
- {
2027
- name: "repeat-click",
2028
- rawName: "v-repeat-click",
2029
- value: _vm.increase,
2030
- expression: "increase"
2031
- }
2032
- ],
2033
- staticClass: "el-time-spinner__arrow el-icon-arrow-down"
2034
- }),
2035
- _c(
2036
- "ul",
2037
- { ref: "minutes", staticClass: "el-time-spinner__list" },
2038
- _vm._l(_vm.arrowMinuteList, function(minute, key) {
2039
- return _c(
2040
- "li",
2041
- {
2042
- key: key,
2043
- staticClass: "el-time-spinner__item",
2044
- class: { active: minute === _vm.minutes }
2045
- },
2046
- [
2047
- _vm._v(
2048
- "\n " +
2049
- _vm._s(
2050
- minute === undefined
2051
- ? ""
2052
- : ("0" + minute).slice(-2)
2053
- ) +
2054
- "\n "
2055
- )
2056
- ]
2057
- )
2058
- }),
2059
- 0
2060
- )
2061
- ]
2062
- ),
2063
- _vm.showSeconds
2064
- ? _c(
2065
- "div",
2066
- {
2067
- staticClass: "el-time-spinner__wrapper is-arrow",
2068
- on: {
2069
- mouseenter: function($event) {
2070
- _vm.emitSelectRange("seconds")
2071
- }
2072
- }
2073
- },
2074
- [
2075
- _c("i", {
2076
- directives: [
2077
- {
2078
- name: "repeat-click",
2079
- rawName: "v-repeat-click",
2080
- value: _vm.decrease,
2081
- expression: "decrease"
2082
- }
2083
- ],
2084
- staticClass: "el-time-spinner__arrow el-icon-arrow-up"
2085
- }),
2086
- _c("i", {
2087
- directives: [
2088
- {
2089
- name: "repeat-click",
2090
- rawName: "v-repeat-click",
2091
- value: _vm.increase,
2092
- expression: "increase"
2093
- }
2094
- ],
2095
- staticClass: "el-time-spinner__arrow el-icon-arrow-down"
2096
- }),
2097
- _c(
2098
- "ul",
2099
- { ref: "seconds", staticClass: "el-time-spinner__list" },
2100
- _vm._l(_vm.arrowSecondList, function(second, key) {
2101
- return _c(
2102
- "li",
2103
- {
2104
- key: key,
2105
- staticClass: "el-time-spinner__item",
2106
- class: { active: second === _vm.seconds }
2107
- },
2108
- [
2109
- _vm._v(
2110
- "\n " +
2111
- _vm._s(
2112
- second === undefined
2113
- ? ""
2114
- : ("0" + second).slice(-2)
2115
- ) +
2116
- "\n "
2117
- )
2118
- ]
2119
- )
2120
- }),
2121
- 0
2122
- )
2123
- ]
2124
- )
2125
- : _vm._e()
2126
- ]
2127
- : _vm._e()
2128
- ],
2129
- 2
2130
- )
2131
- }
2132
- var staticRenderFns = []
2133
- render._withStripped = true
2134
-
2135
-
2136
- // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
2137
-
2138
- // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
2139
- var date_util_ = __webpack_require__(1);
2140
-
2141
- // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
2142
- var scrollbar_ = __webpack_require__(16);
2143
- var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
2144
-
2145
- // EXTERNAL MODULE: ./src/directives/repeat-click.js
2146
- var repeat_click = __webpack_require__(29);
2147
-
2148
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
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
- /* harmony default export */ var time_spinnervue_type_script_lang_js_ = ({
2257
- components: { ElScrollbar: scrollbar_default.a },
2258
-
2259
- directives: {
2260
- repeatClick: repeat_click["a" /* default */]
2261
- },
2262
-
2263
- props: {
2264
- date: {},
2265
- defaultValue: {}, // reserved for future use
2266
- showSeconds: {
2267
- type: Boolean,
2268
- default: true
2269
- },
2270
- arrowControl: Boolean,
2271
- amPmMode: {
2272
- type: String,
2273
- default: '' // 'a': am/pm; 'A': AM/PM
2274
- }
2275
- },
2276
-
2277
- computed: {
2278
- hours: function hours() {
2279
- return this.date.getHours();
2280
- },
2281
- minutes: function minutes() {
2282
- return this.date.getMinutes();
2283
- },
2284
- seconds: function seconds() {
2285
- return this.date.getSeconds();
2286
- },
2287
- hoursList: function hoursList() {
2288
- return Object(date_util_["getRangeHours"])(this.selectableRange);
2289
- },
2290
- minutesList: function minutesList() {
2291
- return Object(date_util_["getRangeMinutes"])(this.selectableRange, this.hours);
2292
- },
2293
- arrowHourList: function arrowHourList() {
2294
- var hours = this.hours;
2295
- return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
2296
- },
2297
- arrowMinuteList: function arrowMinuteList() {
2298
- var minutes = this.minutes;
2299
- return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
2300
- },
2301
- arrowSecondList: function arrowSecondList() {
2302
- var seconds = this.seconds;
2303
- return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
2304
- }
2305
- },
2306
-
2307
- data: function data() {
2308
- return {
2309
- selectableRange: [],
2310
- currentScrollbar: null
2311
- };
2312
- },
2313
- mounted: function mounted() {
2314
- var _this = this;
2315
-
2316
- this.$nextTick(function () {
2317
- !_this.arrowControl && _this.bindScrollEvent();
2318
- });
2319
- },
2320
-
2321
-
2322
- methods: {
2323
- increase: function increase() {
2324
- this.scrollDown(1);
2325
- },
2326
- decrease: function decrease() {
2327
- this.scrollDown(-1);
2328
- },
2329
- modifyDateField: function modifyDateField(type, value) {
2330
- switch (type) {
2331
- case 'hours':
2332
- this.$emit('change', Object(date_util_["modifyTime"])(this.date, value, this.minutes, this.seconds));break;
2333
- case 'minutes':
2334
- this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, value, this.seconds));break;
2335
- case 'seconds':
2336
- this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, this.minutes, value));break;
2337
- }
2338
- },
2339
- handleClick: function handleClick(type, _ref) {
2340
- var value = _ref.value,
2341
- disabled = _ref.disabled;
2342
-
2343
- if (!disabled) {
2344
- this.modifyDateField(type, value);
2345
- this.emitSelectRange(type);
2346
- this.adjustSpinner(type, value);
2347
- }
2348
- },
2349
- emitSelectRange: function emitSelectRange(type) {
2350
- if (type === 'hours') {
2351
- this.$emit('select-range', 0, 2);
2352
- } else if (type === 'minutes') {
2353
- this.$emit('select-range', 3, 5);
2354
- } else if (type === 'seconds') {
2355
- this.$emit('select-range', 6, 8);
2356
- }
2357
- this.currentScrollbar = type;
2358
- },
2359
- bindScrollEvent: function bindScrollEvent() {
2360
- var _this2 = this;
2361
-
2362
- var bindFunction = function bindFunction(type) {
2363
- _this2.$refs[type].wrap.onscroll = function (e) {
2364
- // TODO: scroll is emitted when set scrollTop programatically
2365
- // should find better solutions in the future!
2366
- _this2.handleScroll(type, e);
2367
- };
2368
- };
2369
- bindFunction('hours');
2370
- bindFunction('minutes');
2371
- bindFunction('seconds');
2372
- },
2373
- handleScroll: function handleScroll(type) {
2374
- var value = Math.min(Math.round((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), type === 'hours' ? 23 : 59);
2375
- this.modifyDateField(type, value);
2376
- },
2377
-
2378
-
2379
- // NOTE: used by datetime / date-range panel
2380
- // renamed from adjustScrollTop
2381
- // should try to refactory it
2382
- adjustSpinners: function adjustSpinners() {
2383
- this.adjustSpinner('hours', this.hours);
2384
- this.adjustSpinner('minutes', this.minutes);
2385
- this.adjustSpinner('seconds', this.seconds);
2386
- },
2387
- adjustCurrentSpinner: function adjustCurrentSpinner(type) {
2388
- this.adjustSpinner(type, this[type]);
2389
- },
2390
- adjustSpinner: function adjustSpinner(type, value) {
2391
- if (this.arrowControl) return;
2392
- var el = this.$refs[type].wrap;
2393
- if (el) {
2394
- el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
2395
- }
2396
- },
2397
- scrollDown: function scrollDown(step) {
2398
- var _this3 = this;
2399
-
2400
- if (!this.currentScrollbar) {
2401
- this.emitSelectRange('hours');
2402
- }
2403
-
2404
- var label = this.currentScrollbar;
2405
- var hoursList = this.hoursList;
2406
- var now = this[label];
2407
-
2408
- if (this.currentScrollbar === 'hours') {
2409
- var total = Math.abs(step);
2410
- step = step > 0 ? 1 : -1;
2411
- var length = hoursList.length;
2412
- while (length-- && total) {
2413
- now = (now + step + hoursList.length) % hoursList.length;
2414
- if (hoursList[now]) {
2415
- continue;
2416
- }
2417
- total--;
2418
- }
2419
- if (hoursList[now]) return;
2420
- } else {
2421
- now = (now + step + 60) % 60;
2422
- }
2423
-
2424
- this.modifyDateField(label, now);
2425
- this.adjustSpinner(label, now);
2426
- this.$nextTick(function () {
2427
- return _this3.emitSelectRange(_this3.currentScrollbar);
2428
- });
2429
- },
2430
- amPm: function amPm(hour) {
2431
- var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
2432
- if (!shouldShowAmPm) return '';
2433
- var isCapital = this.amPmMode === 'A';
2434
- var content = hour < 12 ? ' am' : ' pm';
2435
- if (isCapital) content = content.toUpperCase();
2436
- return content;
2437
- },
2438
- typeItemHeight: function typeItemHeight(type) {
2439
- return this.$refs[type].$el.querySelector('li').offsetHeight;
2440
- },
2441
- scrollBarHeight: function scrollBarHeight(type) {
2442
- return this.$refs[type].$el.offsetHeight;
2443
- }
2444
- }
2445
- });
2446
- // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
2447
- /* harmony default export */ var basic_time_spinnervue_type_script_lang_js_ = (time_spinnervue_type_script_lang_js_);
2448
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2449
- var componentNormalizer = __webpack_require__(0);
2450
-
2451
- // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue
2452
-
2453
-
2454
-
2455
-
2456
-
2457
- /* normalize component */
2458
-
2459
- var component = Object(componentNormalizer["a" /* default */])(
2460
- basic_time_spinnervue_type_script_lang_js_,
2461
- render,
2462
- staticRenderFns,
2463
- false,
2464
- null,
2465
- null,
2466
- null
2467
-
2468
- )
2469
-
2470
- /* hot reload */
2471
- if (false) { var api; }
2472
- component.options.__file = "packages/date-picker/src/basic/time-spinner.vue"
2473
- /* harmony default export */ var time_spinner = __webpack_exports__["a"] = (component.exports);
2474
-
2475
- /***/ }),
2476
-
2477
- /***/ 4:
2478
- /***/ (function(module, exports) {
2479
-
2480
- module.exports = require("element-ui/lib/mixins/emitter");
2481
-
2482
- /***/ }),
2483
-
2484
- /***/ 5:
2485
- /***/ (function(module, exports) {
2486
-
2487
- module.exports = require("element-ui/lib/utils/vue-popper");
2488
-
2489
- /***/ }),
2490
-
2491
- /***/ 6:
2492
- /***/ (function(module, exports) {
2493
-
2494
- module.exports = require("element-ui/lib/mixins/locale");
2495
-
2496
- /***/ }),
2497
-
2498
- /***/ 7:
2499
- /***/ (function(module, exports) {
2500
-
2501
- module.exports = require("vue");
2502
-
2503
- /***/ }),
2504
-
2505
- /***/ 74:
2506
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2507
-
2508
- "use strict";
2509
- __webpack_require__.r(__webpack_exports__);
2510
-
2511
- // EXTERNAL MODULE: ./packages/date-picker/src/picker.vue + 4 modules
2512
- var picker = __webpack_require__(31);
2513
-
2514
- // EXTERNAL MODULE: ./packages/date-picker/src/panel/time.vue + 4 modules
2515
- var time = __webpack_require__(26);
2516
-
2517
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
2518
- var render = function() {
2519
- var _vm = this
2520
- var _h = _vm.$createElement
2521
- var _c = _vm._self._c || _h
2522
- return _c(
2523
- "transition",
2524
- {
2525
- attrs: { name: "el-zoom-in-top" },
2526
- on: {
2527
- "after-leave": function($event) {
2528
- _vm.$emit("dodestroy")
2529
- }
2530
- }
2531
- },
2532
- [
2533
- _c(
2534
- "div",
2535
- {
2536
- directives: [
2537
- {
2538
- name: "show",
2539
- rawName: "v-show",
2540
- value: _vm.visible,
2541
- expression: "visible"
2542
- }
2543
- ],
2544
- staticClass: "el-time-range-picker el-picker-panel el-popper",
2545
- class: _vm.popperClass
2546
- },
2547
- [
2548
- _c("div", { staticClass: "el-time-range-picker__content" }, [
2549
- _c("div", { staticClass: "el-time-range-picker__cell" }, [
2550
- _c("div", { staticClass: "el-time-range-picker__header" }, [
2551
- _vm._v(_vm._s(_vm.t("el.datepicker.startTime")))
2552
- ]),
2553
- _c(
2554
- "div",
2555
- {
2556
- staticClass:
2557
- "el-time-range-picker__body el-time-panel__content",
2558
- class: {
2559
- "has-seconds": _vm.showSeconds,
2560
- "is-arrow": _vm.arrowControl
2561
- }
2562
- },
2563
- [
2564
- _c("time-spinner", {
2565
- ref: "minSpinner",
2566
- attrs: {
2567
- "show-seconds": _vm.showSeconds,
2568
- "am-pm-mode": _vm.amPmMode,
2569
- "arrow-control": _vm.arrowControl,
2570
- date: _vm.minDate
2571
- },
2572
- on: {
2573
- change: _vm.handleMinChange,
2574
- "select-range": _vm.setMinSelectionRange
2575
- }
2576
- })
2577
- ],
2578
- 1
2579
- )
2580
- ]),
2581
- _c("div", { staticClass: "el-time-range-picker__cell" }, [
2582
- _c("div", { staticClass: "el-time-range-picker__header" }, [
2583
- _vm._v(_vm._s(_vm.t("el.datepicker.endTime")))
2584
- ]),
2585
- _c(
2586
- "div",
2587
- {
2588
- staticClass:
2589
- "el-time-range-picker__body el-time-panel__content",
2590
- class: {
2591
- "has-seconds": _vm.showSeconds,
2592
- "is-arrow": _vm.arrowControl
2593
- }
2594
- },
2595
- [
2596
- _c("time-spinner", {
2597
- ref: "maxSpinner",
2598
- attrs: {
2599
- "show-seconds": _vm.showSeconds,
2600
- "am-pm-mode": _vm.amPmMode,
2601
- "arrow-control": _vm.arrowControl,
2602
- date: _vm.maxDate
2603
- },
2604
- on: {
2605
- change: _vm.handleMaxChange,
2606
- "select-range": _vm.setMaxSelectionRange
2607
- }
2608
- })
2609
- ],
2610
- 1
2611
- )
2612
- ])
2613
- ]),
2614
- _c("div", { staticClass: "el-time-panel__footer" }, [
2615
- _c(
2616
- "button",
2617
- {
2618
- staticClass: "el-time-panel__btn cancel",
2619
- attrs: { type: "button" },
2620
- on: {
2621
- click: function($event) {
2622
- _vm.handleCancel()
2623
- }
2624
- }
2625
- },
2626
- [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
2627
- ),
2628
- _c(
2629
- "button",
2630
- {
2631
- staticClass: "el-time-panel__btn confirm",
2632
- attrs: { type: "button", disabled: _vm.btnDisabled },
2633
- on: {
2634
- click: function($event) {
2635
- _vm.handleConfirm()
2636
- }
2637
- }
2638
- },
2639
- [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
2640
- )
2641
- ])
2642
- ]
2643
- )
2644
- ]
2645
- )
2646
- }
2647
- var staticRenderFns = []
2648
- render._withStripped = true
2649
-
2650
-
2651
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
2652
-
2653
- // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
2654
- var date_util_ = __webpack_require__(1);
2655
-
2656
- // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
2657
- var locale_ = __webpack_require__(6);
2658
- var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
2659
-
2660
- // EXTERNAL MODULE: ./packages/date-picker/src/basic/time-spinner.vue + 4 modules
2661
- var time_spinner = __webpack_require__(33);
2662
-
2663
- // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
2664
- //
2665
- //
2666
- //
2667
- //
2668
- //
2669
- //
2670
- //
2671
- //
2672
- //
2673
- //
2674
- //
2675
- //
2676
- //
2677
- //
2678
- //
2679
- //
2680
- //
2681
- //
2682
- //
2683
- //
2684
- //
2685
- //
2686
- //
2687
- //
2688
- //
2689
- //
2690
- //
2691
- //
2692
- //
2693
- //
2694
- //
2695
- //
2696
- //
2697
- //
2698
- //
2699
- //
2700
- //
2701
- //
2702
- //
2703
- //
2704
- //
2705
- //
2706
- //
2707
- //
2708
- //
2709
- //
2710
- //
2711
- //
2712
- //
2713
- //
2714
- //
2715
- //
2716
- //
2717
- //
2718
- //
2719
- //
2720
- //
2721
-
2722
-
2723
-
2724
-
2725
-
2726
- var MIN_TIME = Object(date_util_["parseDate"])('00:00:00', 'HH:mm:ss');
2727
- var MAX_TIME = Object(date_util_["parseDate"])('23:59:59', 'HH:mm:ss');
2728
-
2729
- var time_rangevue_type_script_lang_js_minTimeOfDay = function minTimeOfDay(date) {
2730
- return Object(date_util_["modifyDate"])(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
2731
- };
2732
-
2733
- var time_rangevue_type_script_lang_js_maxTimeOfDay = function maxTimeOfDay(date) {
2734
- return Object(date_util_["modifyDate"])(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
2735
- };
2736
-
2737
- // increase time by amount of milliseconds, but within the range of day
2738
- var advanceTime = function advanceTime(date, amount) {
2739
- return new Date(Math.min(date.getTime() + amount, time_rangevue_type_script_lang_js_maxTimeOfDay(date).getTime()));
2740
- };
2741
-
2742
- /* harmony default export */ var time_rangevue_type_script_lang_js_ = ({
2743
- mixins: [locale_default.a],
2744
-
2745
- components: { TimeSpinner: time_spinner["a" /* default */] },
2746
-
2747
- computed: {
2748
- showSeconds: function showSeconds() {
2749
- return (this.format || '').indexOf('ss') !== -1;
2750
- },
2751
- offset: function offset() {
2752
- return this.showSeconds ? 11 : 8;
2753
- },
2754
- spinner: function spinner() {
2755
- return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner;
2756
- },
2757
- btnDisabled: function btnDisabled() {
2758
- return this.minDate.getTime() > this.maxDate.getTime();
2759
- },
2760
- amPmMode: function amPmMode() {
2761
- if ((this.format || '').indexOf('A') !== -1) return 'A';
2762
- if ((this.format || '').indexOf('a') !== -1) return 'a';
2763
- return '';
2764
- }
2765
- },
2766
-
2767
- data: function data() {
2768
- return {
2769
- popperClass: '',
2770
- minDate: new Date(),
2771
- maxDate: new Date(),
2772
- value: [],
2773
- oldValue: [new Date(), new Date()],
2774
- defaultValue: null,
2775
- format: 'HH:mm:ss',
2776
- visible: false,
2777
- selectionRange: [0, 2],
2778
- arrowControl: false
2779
- };
2780
- },
2781
-
2782
-
2783
- watch: {
2784
- value: function value(_value) {
2785
- if (Array.isArray(_value)) {
2786
- this.minDate = new Date(_value[0]);
2787
- this.maxDate = new Date(_value[1]);
2788
- } else {
2789
- if (Array.isArray(this.defaultValue)) {
2790
- this.minDate = new Date(this.defaultValue[0]);
2791
- this.maxDate = new Date(this.defaultValue[1]);
2792
- } else if (this.defaultValue) {
2793
- this.minDate = new Date(this.defaultValue);
2794
- this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000);
2795
- } else {
2796
- this.minDate = new Date();
2797
- this.maxDate = advanceTime(new Date(), 60 * 60 * 1000);
2798
- }
2799
- }
2800
- },
2801
- visible: function visible(val) {
2802
- var _this = this;
2803
-
2804
- if (val) {
2805
- this.oldValue = this.value;
2806
- this.$nextTick(function () {
2807
- return _this.$refs.minSpinner.emitSelectRange('hours');
2808
- });
2809
- }
2810
- }
2811
- },
2812
-
2813
- methods: {
2814
- handleClear: function handleClear() {
2815
- this.$emit('pick', null);
2816
- },
2817
- handleCancel: function handleCancel() {
2818
- this.$emit('pick', this.oldValue);
2819
- },
2820
- handleMinChange: function handleMinChange(date) {
2821
- this.minDate = Object(date_util_["clearMilliseconds"])(date);
2822
- this.handleChange();
2823
- },
2824
- handleMaxChange: function handleMaxChange(date) {
2825
- this.maxDate = Object(date_util_["clearMilliseconds"])(date);
2826
- this.handleChange();
2827
- },
2828
- handleChange: function handleChange() {
2829
- if (this.isValidValue([this.minDate, this.maxDate])) {
2830
- this.$refs.minSpinner.selectableRange = [[time_rangevue_type_script_lang_js_minTimeOfDay(this.minDate), this.maxDate]];
2831
- this.$refs.maxSpinner.selectableRange = [[this.minDate, time_rangevue_type_script_lang_js_maxTimeOfDay(this.maxDate)]];
2832
- this.$emit('pick', [this.minDate, this.maxDate], true);
2833
- }
2834
- },
2835
- setMinSelectionRange: function setMinSelectionRange(start, end) {
2836
- this.$emit('select-range', start, end, 'min');
2837
- this.selectionRange = [start, end];
2838
- },
2839
- setMaxSelectionRange: function setMaxSelectionRange(start, end) {
2840
- this.$emit('select-range', start, end, 'max');
2841
- this.selectionRange = [start + this.offset, end + this.offset];
2842
- },
2843
- handleConfirm: function handleConfirm() {
2844
- var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2845
-
2846
- var minSelectableRange = this.$refs.minSpinner.selectableRange;
2847
- var maxSelectableRange = this.$refs.maxSpinner.selectableRange;
2848
-
2849
- this.minDate = Object(date_util_["limitTimeRange"])(this.minDate, minSelectableRange, this.format);
2850
- this.maxDate = Object(date_util_["limitTimeRange"])(this.maxDate, maxSelectableRange, this.format);
2851
-
2852
- this.$emit('pick', [this.minDate, this.maxDate], visible);
2853
- },
2854
- adjustSpinners: function adjustSpinners() {
2855
- this.$refs.minSpinner.adjustSpinners();
2856
- this.$refs.maxSpinner.adjustSpinners();
2857
- },
2858
- changeSelectionRange: function changeSelectionRange(step) {
2859
- var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
2860
- var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
2861
- var index = list.indexOf(this.selectionRange[0]);
2862
- var next = (index + step + list.length) % list.length;
2863
- var half = list.length / 2;
2864
- if (next < half) {
2865
- this.$refs.minSpinner.emitSelectRange(mapping[next]);
2866
- } else {
2867
- this.$refs.maxSpinner.emitSelectRange(mapping[next - half]);
2868
- }
2869
- },
2870
- isValidValue: function isValidValue(date) {
2871
- return Array.isArray(date) && Object(date_util_["timeWithinRange"])(this.minDate, this.$refs.minSpinner.selectableRange) && Object(date_util_["timeWithinRange"])(this.maxDate, this.$refs.maxSpinner.selectableRange);
2872
- },
2873
- handleKeydown: function handleKeydown(event) {
2874
- var keyCode = event.keyCode;
2875
- var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
2876
-
2877
- // Left or Right
2878
- if (keyCode === 37 || keyCode === 39) {
2879
- var step = mapping[keyCode];
2880
- this.changeSelectionRange(step);
2881
- event.preventDefault();
2882
- return;
2883
- }
2884
-
2885
- // Up or Down
2886
- if (keyCode === 38 || keyCode === 40) {
2887
- var _step = mapping[keyCode];
2888
- this.spinner.scrollDown(_step);
2889
- event.preventDefault();
2890
- return;
2891
- }
2892
- }
2893
- }
2894
- });
2895
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
2896
- /* harmony default export */ var panel_time_rangevue_type_script_lang_js_ = (time_rangevue_type_script_lang_js_);
2897
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
2898
- var componentNormalizer = __webpack_require__(0);
2899
-
2900
- // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue
2901
-
2902
-
2903
-
2904
-
2905
-
2906
- /* normalize component */
2907
-
2908
- var component = Object(componentNormalizer["a" /* default */])(
2909
- panel_time_rangevue_type_script_lang_js_,
2910
- render,
2911
- staticRenderFns,
2912
- false,
2913
- null,
2914
- null,
2915
- null
2916
-
2917
- )
2918
-
2919
- /* hot reload */
2920
- if (false) { var api; }
2921
- component.options.__file = "packages/date-picker/src/panel/time-range.vue"
2922
- /* harmony default export */ var time_range = (component.exports);
2923
- // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-picker.js
2924
-
2925
-
2926
-
2927
-
2928
- /* harmony default export */ var time_picker = ({
2929
- mixins: [picker["a" /* default */]],
2930
-
2931
- name: 'ElTimePicker',
2932
-
2933
- props: {
2934
- isRange: Boolean,
2935
- arrowControl: Boolean
2936
- },
2937
-
2938
- data: function data() {
2939
- return {
2940
- type: ''
2941
- };
2942
- },
2943
-
2944
-
2945
- watch: {
2946
- isRange: function isRange(_isRange) {
2947
- if (this.picker) {
2948
- this.unmountPicker();
2949
- this.type = _isRange ? 'timerange' : 'time';
2950
- this.panel = _isRange ? time_range : time["a" /* default */];
2951
- this.mountPicker();
2952
- } else {
2953
- this.type = _isRange ? 'timerange' : 'time';
2954
- this.panel = _isRange ? time_range : time["a" /* default */];
2955
- }
2956
- }
2957
- },
2958
-
2959
- created: function created() {
2960
- this.type = this.isRange ? 'timerange' : 'time';
2961
- this.panel = this.isRange ? time_range : time["a" /* default */];
2962
- }
2963
- });
2964
- // CONCATENATED MODULE: ./packages/time-picker/index.js
2965
-
2966
-
2967
- /* istanbul ignore next */
2968
- time_picker.install = function (Vue) {
2969
- Vue.component(time_picker.name, time_picker);
2970
- };
2971
-
2972
- /* harmony default export */ var packages_time_picker = __webpack_exports__["default"] = (time_picker);
2973
-
2974
- /***/ }),
2975
-
2976
- /***/ 9:
2977
- /***/ (function(module, exports) {
2978
-
2979
- module.exports = require("element-ui/lib/utils/merge");
2980
-
2981
- /***/ })
2982
-
2983
- /******/ });