element-sim 1.0.4 → 1.0.6

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 (442) hide show
  1. package/lib/alert.js +420 -0
  2. package/lib/aside.js +277 -0
  3. package/lib/autocomplete.js +952 -0
  4. package/lib/avatar.js +363 -0
  5. package/lib/backtop.js +404 -0
  6. package/lib/badge.js +334 -0
  7. package/lib/breadcrumb-item.js +322 -0
  8. package/lib/breadcrumb.js +293 -0
  9. package/lib/button-group.js +262 -0
  10. package/lib/button.js +357 -0
  11. package/lib/calendar.js +933 -0
  12. package/lib/card.js +297 -0
  13. package/lib/carousel-item.js +434 -0
  14. package/lib/carousel.js +707 -0
  15. package/lib/cascader-panel.js +1558 -0
  16. package/lib/cascader.js +1439 -0
  17. package/lib/checkbox-button.js +583 -0
  18. package/lib/checkbox-group.js +313 -0
  19. package/lib/checkbox.js +627 -0
  20. package/lib/col.js +177 -0
  21. package/lib/collapse-item.js +497 -0
  22. package/lib/collapse.js +329 -0
  23. package/lib/color-picker.js +1943 -0
  24. package/lib/container.js +288 -0
  25. package/lib/date-picker.js +6335 -0
  26. package/lib/descriptions-item.js +140 -0
  27. package/lib/descriptions.js +457 -0
  28. package/lib/dialog.js +598 -0
  29. package/lib/directives/mousewheel.js +26 -0
  30. package/lib/directives/repeat-click.js +33 -0
  31. package/lib/divider.js +313 -0
  32. package/lib/drawer.js +592 -0
  33. package/lib/dropdown-item.js +316 -0
  34. package/lib/dropdown-menu.js +351 -0
  35. package/lib/dropdown.js +643 -0
  36. package/lib/element-sim.common.js +43578 -0
  37. package/lib/empty.js +730 -0
  38. package/lib/footer.js +277 -0
  39. package/lib/form-item.js +826 -0
  40. package/lib/form.js +466 -0
  41. package/lib/header.js +277 -0
  42. package/lib/icon.js +265 -0
  43. package/lib/image.js +1138 -0
  44. package/lib/index.js +1 -0
  45. package/lib/infinite-scroll.js +301 -0
  46. package/lib/input-number.js +752 -0
  47. package/lib/input.js +998 -0
  48. package/lib/link.js +332 -0
  49. package/lib/loading.js +631 -0
  50. package/lib/locale/format.js +56 -0
  51. package/lib/locale/index.js +63 -0
  52. package/lib/locale/lang/af-ZA.js +126 -0
  53. package/lib/locale/lang/ar.js +125 -0
  54. package/lib/locale/lang/az.js +126 -0
  55. package/lib/locale/lang/bg.js +126 -0
  56. package/lib/locale/lang/bn.js +126 -0
  57. package/lib/locale/lang/ca.js +125 -0
  58. package/lib/locale/lang/cs-CZ.js +128 -0
  59. package/lib/locale/lang/da.js +125 -0
  60. package/lib/locale/lang/de.js +127 -0
  61. package/lib/locale/lang/ee.js +126 -0
  62. package/lib/locale/lang/el.js +126 -0
  63. package/lib/locale/lang/en.js +126 -0
  64. package/lib/locale/lang/eo.js +126 -0
  65. package/lib/locale/lang/es.js +125 -0
  66. package/lib/locale/lang/eu.js +126 -0
  67. package/lib/locale/lang/fa.js +126 -0
  68. package/lib/locale/lang/fi.js +126 -0
  69. package/lib/locale/lang/fr.js +125 -0
  70. package/lib/locale/lang/he.js +126 -0
  71. package/lib/locale/lang/hr.js +126 -0
  72. package/lib/locale/lang/hu.js +125 -0
  73. package/lib/locale/lang/hy-AM.js +126 -0
  74. package/lib/locale/lang/id.js +126 -0
  75. package/lib/locale/lang/is.js +126 -0
  76. package/lib/locale/lang/it.js +125 -0
  77. package/lib/locale/lang/ja.js +126 -0
  78. package/lib/locale/lang/kg.js +126 -0
  79. package/lib/locale/lang/km.js +126 -0
  80. package/lib/locale/lang/ko.js +126 -0
  81. package/lib/locale/lang/ku.js +126 -0
  82. package/lib/locale/lang/kz.js +126 -0
  83. package/lib/locale/lang/lo-LA.js +126 -0
  84. package/lib/locale/lang/lt.js +126 -0
  85. package/lib/locale/lang/lv.js +126 -0
  86. package/lib/locale/lang/mn.js +126 -0
  87. package/lib/locale/lang/ms.js +125 -0
  88. package/lib/locale/lang/nb-NO.js +125 -0
  89. package/lib/locale/lang/nl.js +126 -0
  90. package/lib/locale/lang/pl.js +126 -0
  91. package/lib/locale/lang/pt-br.js +126 -0
  92. package/lib/locale/lang/pt.js +126 -0
  93. package/lib/locale/lang/ro.js +126 -0
  94. package/lib/locale/lang/ru-RU.js +126 -0
  95. package/lib/locale/lang/si.js +126 -0
  96. package/lib/locale/lang/sk.js +128 -0
  97. package/lib/locale/lang/sl.js +126 -0
  98. package/lib/locale/lang/sr-Latn.js +126 -0
  99. package/lib/locale/lang/sr.js +126 -0
  100. package/lib/locale/lang/sv-SE.js +126 -0
  101. package/lib/locale/lang/sw.js +126 -0
  102. package/lib/locale/lang/ta.js +125 -0
  103. package/lib/locale/lang/th.js +126 -0
  104. package/lib/locale/lang/tk.js +126 -0
  105. package/lib/locale/lang/tr-TR.js +126 -0
  106. package/lib/locale/lang/ua.js +126 -0
  107. package/lib/locale/lang/ug-CN.js +126 -0
  108. package/lib/locale/lang/uz-UZ.js +126 -0
  109. package/lib/locale/lang/vi.js +126 -0
  110. package/lib/locale/lang/zh-CN.js +126 -0
  111. package/lib/locale/lang/zh-TW.js +126 -0
  112. package/lib/main.js +264 -0
  113. package/lib/menu-item-group.js +308 -0
  114. package/lib/menu-item.js +491 -0
  115. package/lib/menu.js +865 -0
  116. package/lib/message-box.js +1192 -0
  117. package/lib/message.js +548 -0
  118. package/lib/mixins/emitter.js +36 -0
  119. package/lib/mixins/focus.js +15 -0
  120. package/lib/mixins/locale.js +17 -0
  121. package/lib/mixins/migrating.js +69 -0
  122. package/lib/notification.js +615 -0
  123. package/lib/option-group.js +344 -0
  124. package/lib/option.js +474 -0
  125. package/lib/page-header.js +319 -0
  126. package/lib/pagination.js +950 -0
  127. package/lib/popconfirm.js +457 -0
  128. package/lib/popover.js +617 -0
  129. package/lib/progress.js +595 -0
  130. package/lib/radio-button.js +463 -0
  131. package/lib/radio-group.js +391 -0
  132. package/lib/radio.js +497 -0
  133. package/lib/rate.js +670 -0
  134. package/lib/result.js +578 -0
  135. package/lib/row.js +149 -0
  136. package/lib/scrollbar.js +423 -0
  137. package/lib/select.js +2167 -0
  138. package/lib/skeleton-item.js +342 -0
  139. package/lib/skeleton.js +372 -0
  140. package/lib/slider.js +1199 -0
  141. package/lib/spinner.js +301 -0
  142. package/lib/statistic.js +533 -0
  143. package/lib/step.js +522 -0
  144. package/lib/steps.js +342 -0
  145. package/lib/submenu.js +701 -0
  146. package/lib/switch.js +554 -0
  147. package/lib/tab-pane.js +332 -0
  148. package/lib/table-column.js +952 -0
  149. package/lib/table.js +5010 -0
  150. package/lib/tabs.js +920 -0
  151. package/lib/tag.js +304 -0
  152. package/lib/theme-chalk/alert.css +1 -0
  153. package/lib/theme-chalk/aside.css +1 -0
  154. package/lib/theme-chalk/autocomplete.css +1 -0
  155. package/lib/theme-chalk/avatar.css +1 -0
  156. package/lib/theme-chalk/backtop.css +1 -0
  157. package/lib/theme-chalk/badge.css +1 -0
  158. package/lib/theme-chalk/base.css +1 -0
  159. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  160. package/lib/theme-chalk/breadcrumb.css +1 -0
  161. package/lib/theme-chalk/button-group.css +0 -0
  162. package/lib/theme-chalk/button.css +1 -0
  163. package/lib/theme-chalk/calendar.css +1 -0
  164. package/lib/theme-chalk/card.css +1 -0
  165. package/lib/theme-chalk/carousel-item.css +1 -0
  166. package/lib/theme-chalk/carousel.css +1 -0
  167. package/lib/theme-chalk/cascader-panel.css +1 -0
  168. package/lib/theme-chalk/cascader.css +1 -0
  169. package/lib/theme-chalk/checkbox-button.css +0 -0
  170. package/lib/theme-chalk/checkbox-group.css +0 -0
  171. package/lib/theme-chalk/checkbox.css +1 -0
  172. package/lib/theme-chalk/col.css +1 -0
  173. package/lib/theme-chalk/collapse-item.css +0 -0
  174. package/lib/theme-chalk/collapse.css +1 -0
  175. package/lib/theme-chalk/color-picker.css +1 -0
  176. package/lib/theme-chalk/container.css +1 -0
  177. package/lib/theme-chalk/date-picker.css +1 -0
  178. package/lib/theme-chalk/descriptions-item.css +1 -0
  179. package/lib/theme-chalk/descriptions.css +1 -0
  180. package/lib/theme-chalk/dialog.css +1 -0
  181. package/lib/theme-chalk/display.css +1 -0
  182. package/lib/theme-chalk/divider.css +1 -0
  183. package/lib/theme-chalk/drawer.css +1 -0
  184. package/lib/theme-chalk/dropdown-item.css +0 -0
  185. package/lib/theme-chalk/dropdown-menu.css +0 -0
  186. package/lib/theme-chalk/dropdown.css +1 -0
  187. package/lib/theme-chalk/empty.css +1 -0
  188. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  189. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  190. package/lib/theme-chalk/footer.css +1 -0
  191. package/lib/theme-chalk/form-item.css +0 -0
  192. package/lib/theme-chalk/form.css +1 -0
  193. package/lib/theme-chalk/header.css +1 -0
  194. package/lib/theme-chalk/icon.css +1 -0
  195. package/lib/theme-chalk/image.css +1 -0
  196. package/lib/theme-chalk/index.css +1 -0
  197. package/lib/theme-chalk/infinite-scroll.css +0 -0
  198. package/lib/theme-chalk/infiniteScroll.css +0 -0
  199. package/lib/theme-chalk/input-number.css +1 -0
  200. package/lib/theme-chalk/input.css +1 -0
  201. package/lib/theme-chalk/link.css +1 -0
  202. package/lib/theme-chalk/loading.css +1 -0
  203. package/lib/theme-chalk/main.css +1 -0
  204. package/lib/theme-chalk/menu-item-group.css +0 -0
  205. package/lib/theme-chalk/menu-item.css +0 -0
  206. package/lib/theme-chalk/menu.css +1 -0
  207. package/lib/theme-chalk/message-box.css +1 -0
  208. package/lib/theme-chalk/message.css +1 -0
  209. package/lib/theme-chalk/notification.css +1 -0
  210. package/lib/theme-chalk/option-group.css +1 -0
  211. package/lib/theme-chalk/option.css +1 -0
  212. package/lib/theme-chalk/page-header.css +1 -0
  213. package/lib/theme-chalk/pagination.css +1 -0
  214. package/lib/theme-chalk/popconfirm.css +1 -0
  215. package/lib/theme-chalk/popover.css +1 -0
  216. package/lib/theme-chalk/popper.css +1 -0
  217. package/lib/theme-chalk/progress.css +1 -0
  218. package/lib/theme-chalk/radio-button.css +1 -0
  219. package/lib/theme-chalk/radio-group.css +1 -0
  220. package/lib/theme-chalk/radio.css +1 -0
  221. package/lib/theme-chalk/rate.css +1 -0
  222. package/lib/theme-chalk/reset.css +1 -0
  223. package/lib/theme-chalk/result.css +1 -0
  224. package/lib/theme-chalk/row.css +1 -0
  225. package/lib/theme-chalk/scrollbar.css +1 -0
  226. package/lib/theme-chalk/select-dropdown.css +1 -0
  227. package/lib/theme-chalk/select.css +1 -0
  228. package/lib/theme-chalk/skeleton-item.css +1 -0
  229. package/lib/theme-chalk/skeleton.css +1 -0
  230. package/lib/theme-chalk/slider.css +1 -0
  231. package/lib/theme-chalk/spinner.css +1 -0
  232. package/lib/theme-chalk/statistic.css +1 -0
  233. package/lib/theme-chalk/step.css +1 -0
  234. package/lib/theme-chalk/steps.css +1 -0
  235. package/lib/theme-chalk/submenu.css +0 -0
  236. package/lib/theme-chalk/switch.css +1 -0
  237. package/lib/theme-chalk/tab-pane.css +0 -0
  238. package/lib/theme-chalk/table-column.css +1 -0
  239. package/lib/theme-chalk/table.css +1 -0
  240. package/lib/theme-chalk/tabs.css +1 -0
  241. package/lib/theme-chalk/tag.css +1 -0
  242. package/lib/theme-chalk/time-picker.css +1 -0
  243. package/lib/theme-chalk/time-select.css +1 -0
  244. package/lib/theme-chalk/timeline-item.css +1 -0
  245. package/lib/theme-chalk/timeline.css +1 -0
  246. package/lib/theme-chalk/tooltip.css +1 -0
  247. package/lib/theme-chalk/transfer.css +1 -0
  248. package/lib/theme-chalk/tree.css +1 -0
  249. package/lib/theme-chalk/upload.css +1 -0
  250. package/lib/time-picker.js +2967 -0
  251. package/lib/time-select.js +1765 -0
  252. package/lib/timeline-item.js +371 -0
  253. package/lib/timeline.js +275 -0
  254. package/lib/tooltip.js +425 -0
  255. package/lib/transfer.js +1102 -0
  256. package/lib/transitions/collapse-transition.js +91 -0
  257. package/lib/tree.js +2263 -0
  258. package/lib/umd/locale/af-ZA.js +142 -0
  259. package/lib/umd/locale/ar.js +141 -0
  260. package/lib/umd/locale/az.js +141 -0
  261. package/lib/umd/locale/bg.js +142 -0
  262. package/lib/umd/locale/bn.js +141 -0
  263. package/lib/umd/locale/ca.js +141 -0
  264. package/lib/umd/locale/cs-CZ.js +144 -0
  265. package/lib/umd/locale/da.js +141 -0
  266. package/lib/umd/locale/de.js +143 -0
  267. package/lib/umd/locale/ee.js +142 -0
  268. package/lib/umd/locale/el.js +142 -0
  269. package/lib/umd/locale/en.js +142 -0
  270. package/lib/umd/locale/eo.js +142 -0
  271. package/lib/umd/locale/es.js +141 -0
  272. package/lib/umd/locale/eu.js +142 -0
  273. package/lib/umd/locale/fa.js +142 -0
  274. package/lib/umd/locale/fi.js +142 -0
  275. package/lib/umd/locale/fr.js +141 -0
  276. package/lib/umd/locale/he.js +142 -0
  277. package/lib/umd/locale/hr.js +142 -0
  278. package/lib/umd/locale/hu.js +141 -0
  279. package/lib/umd/locale/hy-AM.js +142 -0
  280. package/lib/umd/locale/id.js +142 -0
  281. package/lib/umd/locale/is.js +142 -0
  282. package/lib/umd/locale/it.js +141 -0
  283. package/lib/umd/locale/ja.js +142 -0
  284. package/lib/umd/locale/kg.js +142 -0
  285. package/lib/umd/locale/km.js +142 -0
  286. package/lib/umd/locale/ko.js +142 -0
  287. package/lib/umd/locale/ku.js +142 -0
  288. package/lib/umd/locale/kz.js +142 -0
  289. package/lib/umd/locale/lo-LA.js +141 -0
  290. package/lib/umd/locale/lt.js +142 -0
  291. package/lib/umd/locale/lv.js +142 -0
  292. package/lib/umd/locale/mn.js +142 -0
  293. package/lib/umd/locale/ms.js +141 -0
  294. package/lib/umd/locale/nb-NO.js +141 -0
  295. package/lib/umd/locale/nl.js +142 -0
  296. package/lib/umd/locale/pl.js +142 -0
  297. package/lib/umd/locale/pt-br.js +142 -0
  298. package/lib/umd/locale/pt.js +142 -0
  299. package/lib/umd/locale/ro.js +142 -0
  300. package/lib/umd/locale/ru-RU.js +142 -0
  301. package/lib/umd/locale/si.js +142 -0
  302. package/lib/umd/locale/sk.js +144 -0
  303. package/lib/umd/locale/sl.js +142 -0
  304. package/lib/umd/locale/sr-Latn.js +142 -0
  305. package/lib/umd/locale/sr.js +142 -0
  306. package/lib/umd/locale/sv-SE.js +142 -0
  307. package/lib/umd/locale/sw.js +142 -0
  308. package/lib/umd/locale/ta.js +141 -0
  309. package/lib/umd/locale/th.js +142 -0
  310. package/lib/umd/locale/tk.js +142 -0
  311. package/lib/umd/locale/tr-TR.js +142 -0
  312. package/lib/umd/locale/ua.js +142 -0
  313. package/lib/umd/locale/ug-CN.js +142 -0
  314. package/lib/umd/locale/uz-UZ.js +142 -0
  315. package/lib/umd/locale/vi.js +142 -0
  316. package/lib/umd/locale/zh-CN.js +142 -0
  317. package/lib/umd/locale/zh-TW.js +142 -0
  318. package/lib/upload.js +1390 -0
  319. package/lib/utils/after-leave.js +35 -0
  320. package/lib/utils/aria-dialog.js +104 -0
  321. package/lib/utils/aria-utils.js +126 -0
  322. package/lib/utils/clickoutside.js +79 -0
  323. package/lib/utils/date-util.js +310 -0
  324. package/lib/utils/date.js +369 -0
  325. package/lib/utils/dom.js +234 -0
  326. package/lib/utils/lodash.js +9421 -0
  327. package/lib/utils/menu/aria-menubar.js +24 -0
  328. package/lib/utils/menu/aria-menuitem.js +62 -0
  329. package/lib/utils/menu/aria-submenu.js +69 -0
  330. package/lib/utils/merge.js +21 -0
  331. package/lib/utils/popper.js +1261 -0
  332. package/lib/utils/popup/index.js +233 -0
  333. package/lib/utils/popup/popup-manager.js +205 -0
  334. package/lib/utils/resize-event.js +59 -0
  335. package/lib/utils/scroll-into-view.js +38 -0
  336. package/lib/utils/scrollbar-width.js +39 -0
  337. package/lib/utils/shared.js +12 -0
  338. package/lib/utils/types.js +52 -0
  339. package/lib/utils/util.js +272 -0
  340. package/lib/utils/vdom.js +13 -0
  341. package/lib/utils/vue-popper.js +202 -0
  342. package/package.json +1 -1
  343. package/packages/theme-chalk/lib/alert.css +1 -0
  344. package/packages/theme-chalk/lib/aside.css +1 -0
  345. package/packages/theme-chalk/lib/autocomplete.css +1 -0
  346. package/packages/theme-chalk/lib/avatar.css +1 -0
  347. package/packages/theme-chalk/lib/backtop.css +1 -0
  348. package/packages/theme-chalk/lib/badge.css +1 -0
  349. package/packages/theme-chalk/lib/base.css +1 -0
  350. package/packages/theme-chalk/lib/breadcrumb-item.css +0 -0
  351. package/packages/theme-chalk/lib/breadcrumb.css +1 -0
  352. package/packages/theme-chalk/lib/button-group.css +0 -0
  353. package/packages/theme-chalk/lib/button.css +1 -0
  354. package/packages/theme-chalk/lib/calendar.css +1 -0
  355. package/packages/theme-chalk/lib/card.css +1 -0
  356. package/packages/theme-chalk/lib/carousel-item.css +1 -0
  357. package/packages/theme-chalk/lib/carousel.css +1 -0
  358. package/packages/theme-chalk/lib/cascader-panel.css +1 -0
  359. package/packages/theme-chalk/lib/cascader.css +1 -0
  360. package/packages/theme-chalk/lib/checkbox-button.css +0 -0
  361. package/packages/theme-chalk/lib/checkbox-group.css +0 -0
  362. package/packages/theme-chalk/lib/checkbox.css +1 -0
  363. package/packages/theme-chalk/lib/col.css +1 -0
  364. package/packages/theme-chalk/lib/collapse-item.css +0 -0
  365. package/packages/theme-chalk/lib/collapse.css +1 -0
  366. package/packages/theme-chalk/lib/color-picker.css +1 -0
  367. package/packages/theme-chalk/lib/container.css +1 -0
  368. package/packages/theme-chalk/lib/date-picker.css +1 -0
  369. package/packages/theme-chalk/lib/descriptions-item.css +1 -0
  370. package/packages/theme-chalk/lib/descriptions.css +1 -0
  371. package/packages/theme-chalk/lib/dialog.css +1 -0
  372. package/packages/theme-chalk/lib/display.css +1 -0
  373. package/packages/theme-chalk/lib/divider.css +1 -0
  374. package/packages/theme-chalk/lib/drawer.css +1 -0
  375. package/packages/theme-chalk/lib/dropdown-item.css +0 -0
  376. package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
  377. package/packages/theme-chalk/lib/dropdown.css +1 -0
  378. package/packages/theme-chalk/lib/empty.css +1 -0
  379. package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
  380. package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
  381. package/packages/theme-chalk/lib/footer.css +1 -0
  382. package/packages/theme-chalk/lib/form-item.css +0 -0
  383. package/packages/theme-chalk/lib/form.css +1 -0
  384. package/packages/theme-chalk/lib/header.css +1 -0
  385. package/packages/theme-chalk/lib/icon.css +1 -0
  386. package/packages/theme-chalk/lib/image.css +1 -0
  387. package/packages/theme-chalk/lib/index.css +1 -0
  388. package/packages/theme-chalk/lib/infinite-scroll.css +0 -0
  389. package/packages/theme-chalk/lib/infiniteScroll.css +0 -0
  390. package/packages/theme-chalk/lib/input-number.css +1 -0
  391. package/packages/theme-chalk/lib/input.css +1 -0
  392. package/packages/theme-chalk/lib/link.css +1 -0
  393. package/packages/theme-chalk/lib/loading.css +1 -0
  394. package/packages/theme-chalk/lib/main.css +1 -0
  395. package/packages/theme-chalk/lib/menu-item-group.css +0 -0
  396. package/packages/theme-chalk/lib/menu-item.css +0 -0
  397. package/packages/theme-chalk/lib/menu.css +1 -0
  398. package/packages/theme-chalk/lib/message-box.css +1 -0
  399. package/packages/theme-chalk/lib/message.css +1 -0
  400. package/packages/theme-chalk/lib/notification.css +1 -0
  401. package/packages/theme-chalk/lib/option-group.css +1 -0
  402. package/packages/theme-chalk/lib/option.css +1 -0
  403. package/packages/theme-chalk/lib/page-header.css +1 -0
  404. package/packages/theme-chalk/lib/pagination.css +1 -0
  405. package/packages/theme-chalk/lib/popconfirm.css +1 -0
  406. package/packages/theme-chalk/lib/popover.css +1 -0
  407. package/packages/theme-chalk/lib/popper.css +1 -0
  408. package/packages/theme-chalk/lib/progress.css +1 -0
  409. package/packages/theme-chalk/lib/radio-button.css +1 -0
  410. package/packages/theme-chalk/lib/radio-group.css +1 -0
  411. package/packages/theme-chalk/lib/radio.css +1 -0
  412. package/packages/theme-chalk/lib/rate.css +1 -0
  413. package/packages/theme-chalk/lib/reset.css +1 -0
  414. package/packages/theme-chalk/lib/result.css +1 -0
  415. package/packages/theme-chalk/lib/row.css +1 -0
  416. package/packages/theme-chalk/lib/scrollbar.css +1 -0
  417. package/packages/theme-chalk/lib/select-dropdown.css +1 -0
  418. package/packages/theme-chalk/lib/select.css +1 -0
  419. package/packages/theme-chalk/lib/skeleton-item.css +1 -0
  420. package/packages/theme-chalk/lib/skeleton.css +1 -0
  421. package/packages/theme-chalk/lib/slider.css +1 -0
  422. package/packages/theme-chalk/lib/spinner.css +1 -0
  423. package/packages/theme-chalk/lib/statistic.css +1 -0
  424. package/packages/theme-chalk/lib/step.css +1 -0
  425. package/packages/theme-chalk/lib/steps.css +1 -0
  426. package/packages/theme-chalk/lib/submenu.css +0 -0
  427. package/packages/theme-chalk/lib/switch.css +1 -0
  428. package/packages/theme-chalk/lib/tab-pane.css +0 -0
  429. package/packages/theme-chalk/lib/table-column.css +1 -0
  430. package/packages/theme-chalk/lib/table.css +1 -0
  431. package/packages/theme-chalk/lib/tabs.css +1 -0
  432. package/packages/theme-chalk/lib/tag.css +1 -0
  433. package/packages/theme-chalk/lib/time-picker.css +1 -0
  434. package/packages/theme-chalk/lib/time-select.css +1 -0
  435. package/packages/theme-chalk/lib/timeline-item.css +1 -0
  436. package/packages/theme-chalk/lib/timeline.css +1 -0
  437. package/packages/theme-chalk/lib/tooltip.css +1 -0
  438. package/packages/theme-chalk/lib/transfer.css +1 -0
  439. package/packages/theme-chalk/lib/tree.css +1 -0
  440. package/packages/theme-chalk/lib/upload.css +1 -0
  441. package/packages/theme-chalk/src/form.scss +6 -3
  442. package/src/index.js +1 -1
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ exports.default = function (instance, callback) {
6
+ var speed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
7
+ var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8
+
9
+ if (!instance || !callback) throw new Error('instance & callback is required');
10
+ var called = false;
11
+ var afterLeaveCallback = function afterLeaveCallback() {
12
+ if (called) return;
13
+ called = true;
14
+ if (callback) {
15
+ callback.apply(null, arguments);
16
+ }
17
+ };
18
+ if (once) {
19
+ instance.$once('after-leave', afterLeaveCallback);
20
+ } else {
21
+ instance.$on('after-leave', afterLeaveCallback);
22
+ }
23
+ setTimeout(function () {
24
+ afterLeaveCallback();
25
+ }, speed + 100);
26
+ };
27
+
28
+ ; /**
29
+ * Bind after-leave event for vue instance. Make sure after-leave is called in any browsers.
30
+ *
31
+ * @param {Vue} instance Vue instance.
32
+ * @param {Function} callback callback of after-leave event
33
+ * @param {Number} speed the speed of transition, default value is 300ms
34
+ * @param {Boolean} once weather bind after-leave once. default value is false.
35
+ */
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
6
+
7
+ var _ariaUtils = require('./aria-utils');
8
+
9
+ var _ariaUtils2 = _interopRequireDefault(_ariaUtils);
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
13
+ /**
14
+ * @constructor
15
+ * @desc Dialog object providing modal focus management.
16
+ *
17
+ * Assumptions: The element serving as the dialog container is present in the
18
+ * DOM and hidden. The dialog container has role='dialog'.
19
+ *
20
+ * @param dialogId
21
+ * The ID of the element serving as the dialog container.
22
+ * @param focusAfterClosed
23
+ * Either the DOM node or the ID of the DOM node to focus when the
24
+ * dialog closes.
25
+ * @param focusFirst
26
+ * Optional parameter containing either the DOM node or the ID of the
27
+ * DOM node to focus when the dialog opens. If not specified, the
28
+ * first focusable element in the dialog will receive focus.
29
+ */
30
+ var aria = aria || {};
31
+ var tabEvent;
32
+
33
+ aria.Dialog = function (dialog, focusAfterClosed, focusFirst) {
34
+ var _this = this;
35
+
36
+ this.dialogNode = dialog;
37
+ if (this.dialogNode === null || this.dialogNode.getAttribute('role') !== 'dialog') {
38
+ throw new Error('Dialog() requires a DOM element with ARIA role of dialog.');
39
+ }
40
+
41
+ if (typeof focusAfterClosed === 'string') {
42
+ this.focusAfterClosed = document.getElementById(focusAfterClosed);
43
+ } else if ((typeof focusAfterClosed === 'undefined' ? 'undefined' : _typeof(focusAfterClosed)) === 'object') {
44
+ this.focusAfterClosed = focusAfterClosed;
45
+ } else {
46
+ this.focusAfterClosed = null;
47
+ }
48
+
49
+ if (typeof focusFirst === 'string') {
50
+ this.focusFirst = document.getElementById(focusFirst);
51
+ } else if ((typeof focusFirst === 'undefined' ? 'undefined' : _typeof(focusFirst)) === 'object') {
52
+ this.focusFirst = focusFirst;
53
+ } else {
54
+ this.focusFirst = null;
55
+ }
56
+
57
+ if (this.focusFirst) {
58
+ this.focusFirst.focus();
59
+ } else {
60
+ _ariaUtils2.default.focusFirstDescendant(this.dialogNode);
61
+ }
62
+
63
+ this.lastFocus = document.activeElement;
64
+ tabEvent = function tabEvent(e) {
65
+ _this.trapFocus(e);
66
+ };
67
+ this.addListeners();
68
+ };
69
+
70
+ aria.Dialog.prototype.addListeners = function () {
71
+ document.addEventListener('focus', tabEvent, true);
72
+ };
73
+
74
+ aria.Dialog.prototype.removeListeners = function () {
75
+ document.removeEventListener('focus', tabEvent, true);
76
+ };
77
+
78
+ aria.Dialog.prototype.closeDialog = function () {
79
+ var _this2 = this;
80
+
81
+ this.removeListeners();
82
+ if (this.focusAfterClosed) {
83
+ setTimeout(function () {
84
+ _this2.focusAfterClosed.focus();
85
+ });
86
+ }
87
+ };
88
+
89
+ aria.Dialog.prototype.trapFocus = function (event) {
90
+ if (_ariaUtils2.default.IgnoreUtilFocusChanges) {
91
+ return;
92
+ }
93
+ if (this.dialogNode.contains(event.target)) {
94
+ this.lastFocus = event.target;
95
+ } else {
96
+ _ariaUtils2.default.focusFirstDescendant(this.dialogNode);
97
+ if (this.lastFocus === document.activeElement) {
98
+ _ariaUtils2.default.focusLastDescendant(this.dialogNode);
99
+ }
100
+ this.lastFocus = document.activeElement;
101
+ }
102
+ };
103
+
104
+ exports.default = aria.Dialog;
@@ -0,0 +1,126 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ var aria = aria || {};
5
+
6
+ aria.Utils = aria.Utils || {};
7
+
8
+ /**
9
+ * @desc Set focus on descendant nodes until the first focusable element is
10
+ * found.
11
+ * @param element
12
+ * DOM node for which to find the first focusable descendant.
13
+ * @returns
14
+ * true if a focusable element is found and focus is set.
15
+ */
16
+ aria.Utils.focusFirstDescendant = function (element) {
17
+ for (var i = 0; i < element.childNodes.length; i++) {
18
+ var child = element.childNodes[i];
19
+ if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
20
+ return true;
21
+ }
22
+ }
23
+ return false;
24
+ };
25
+
26
+ /**
27
+ * @desc Find the last descendant node that is focusable.
28
+ * @param element
29
+ * DOM node for which to find the last focusable descendant.
30
+ * @returns
31
+ * true if a focusable element is found and focus is set.
32
+ */
33
+
34
+ aria.Utils.focusLastDescendant = function (element) {
35
+ for (var i = element.childNodes.length - 1; i >= 0; i--) {
36
+ var child = element.childNodes[i];
37
+ if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
42
+ };
43
+
44
+ /**
45
+ * @desc Set Attempt to set focus on the current node.
46
+ * @param element
47
+ * The node to attempt to focus on.
48
+ * @returns
49
+ * true if element is focused.
50
+ */
51
+ aria.Utils.attemptFocus = function (element) {
52
+ if (!aria.Utils.isFocusable(element)) {
53
+ return false;
54
+ }
55
+ aria.Utils.IgnoreUtilFocusChanges = true;
56
+ try {
57
+ element.focus();
58
+ } catch (e) {}
59
+ aria.Utils.IgnoreUtilFocusChanges = false;
60
+ return document.activeElement === element;
61
+ };
62
+
63
+ aria.Utils.isFocusable = function (element) {
64
+ if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
65
+ return true;
66
+ }
67
+
68
+ if (element.disabled) {
69
+ return false;
70
+ }
71
+
72
+ switch (element.nodeName) {
73
+ case 'A':
74
+ return !!element.href && element.rel !== 'ignore';
75
+ case 'INPUT':
76
+ return element.type !== 'hidden' && element.type !== 'file';
77
+ case 'BUTTON':
78
+ case 'SELECT':
79
+ case 'TEXTAREA':
80
+ return true;
81
+ default:
82
+ return false;
83
+ }
84
+ };
85
+
86
+ /**
87
+ * 触发一个事件
88
+ * mouseenter, mouseleave, mouseover, keyup, change, click 等
89
+ * @param {Element} elm
90
+ * @param {String} name
91
+ * @param {*} opts
92
+ */
93
+ aria.Utils.triggerEvent = function (elm, name) {
94
+ var eventName = void 0;
95
+
96
+ if (/^mouse|click/.test(name)) {
97
+ eventName = 'MouseEvents';
98
+ } else if (/^key/.test(name)) {
99
+ eventName = 'KeyboardEvent';
100
+ } else {
101
+ eventName = 'HTMLEvents';
102
+ }
103
+ var evt = document.createEvent(eventName);
104
+
105
+ for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
106
+ opts[_key - 2] = arguments[_key];
107
+ }
108
+
109
+ evt.initEvent.apply(evt, [name].concat(opts));
110
+ elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
111
+
112
+ return elm;
113
+ };
114
+
115
+ aria.Utils.keys = {
116
+ tab: 9,
117
+ enter: 13,
118
+ space: 32,
119
+ left: 37,
120
+ up: 38,
121
+ right: 39,
122
+ down: 40,
123
+ esc: 27
124
+ };
125
+
126
+ exports.default = aria.Utils;
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+
5
+ var _vue = require('vue');
6
+
7
+ var _vue2 = _interopRequireDefault(_vue);
8
+
9
+ var _dom = require('element-sim/lib/utils/dom');
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
13
+ var nodeList = [];
14
+ var ctx = '@@clickoutsideContext';
15
+
16
+ var startClick = void 0;
17
+ var seed = 0;
18
+
19
+ !_vue2.default.prototype.$isServer && (0, _dom.on)(document, 'mousedown', function (e) {
20
+ return startClick = e;
21
+ });
22
+
23
+ !_vue2.default.prototype.$isServer && (0, _dom.on)(document, 'mouseup', function (e) {
24
+ nodeList.forEach(function (node) {
25
+ return node[ctx].documentHandler(e, startClick);
26
+ });
27
+ });
28
+
29
+ function createDocumentHandler(el, binding, vnode) {
30
+ return function () {
31
+ var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32
+ var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33
+
34
+ if (!vnode || !vnode.context || !mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || vnode.context.popperElm && (vnode.context.popperElm.contains(mouseup.target) || vnode.context.popperElm.contains(mousedown.target))) return;
35
+
36
+ if (binding.expression && el[ctx].methodName && vnode.context[el[ctx].methodName]) {
37
+ vnode.context[el[ctx].methodName]();
38
+ } else {
39
+ el[ctx].bindingFn && el[ctx].bindingFn();
40
+ }
41
+ };
42
+ }
43
+
44
+ /**
45
+ * v-clickoutside
46
+ * @desc 点击元素外面才会触发的事件
47
+ * @example
48
+ * ```vue
49
+ * <div v-element-clickoutside="handleClose">
50
+ * ```
51
+ */
52
+ exports.default = {
53
+ bind: function bind(el, binding, vnode) {
54
+ nodeList.push(el);
55
+ var id = seed++;
56
+ el[ctx] = {
57
+ id: id,
58
+ documentHandler: createDocumentHandler(el, binding, vnode),
59
+ methodName: binding.expression,
60
+ bindingFn: binding.value
61
+ };
62
+ },
63
+ update: function update(el, binding, vnode) {
64
+ el[ctx].documentHandler = createDocumentHandler(el, binding, vnode);
65
+ el[ctx].methodName = binding.expression;
66
+ el[ctx].bindingFn = binding.value;
67
+ },
68
+ unbind: function unbind(el) {
69
+ var len = nodeList.length;
70
+
71
+ for (var i = 0; i < len; i++) {
72
+ if (nodeList[i][ctx].id === el[ctx].id) {
73
+ nodeList.splice(i, 1);
74
+ break;
75
+ }
76
+ }
77
+ delete el[ctx];
78
+ }
79
+ };
@@ -0,0 +1,310 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ exports.validateRangeInOneMonth = exports.extractTimeFormat = exports.extractDateFormat = exports.nextYear = exports.prevYear = exports.nextMonth = exports.prevMonth = exports.changeYearMonthAndClampDate = exports.timeWithinRange = exports.limitTimeRange = exports.clearMilliseconds = exports.clearTime = exports.modifyWithTimeString = exports.modifyTime = exports.modifyDate = exports.range = exports.getRangeMinutes = exports.getMonthDays = exports.getPrevMonthLastDays = exports.getRangeHours = exports.getWeekNumber = exports.getStartDateOfMonth = exports.nextDate = exports.prevDate = exports.getFirstDayOfMonth = exports.getDayCountOfYear = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isDateObject = exports.isDate = exports.toDate = exports.getI18nSettings = undefined;
5
+
6
+ var _date = require('element-sim/lib/utils/date');
7
+
8
+ var _date2 = _interopRequireDefault(_date);
9
+
10
+ var _locale = require('element-sim/lib/locale');
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ var weeks = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
15
+ var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
16
+
17
+ var newArray = function newArray(start, end) {
18
+ var result = [];
19
+ for (var i = start; i <= end; i++) {
20
+ result.push(i);
21
+ }
22
+ return result;
23
+ };
24
+
25
+ var getI18nSettings = exports.getI18nSettings = function getI18nSettings() {
26
+ return {
27
+ dayNamesShort: weeks.map(function (week) {
28
+ return (0, _locale.t)('el.datepicker.weeks.' + week);
29
+ }),
30
+ dayNames: weeks.map(function (week) {
31
+ return (0, _locale.t)('el.datepicker.weeks.' + week);
32
+ }),
33
+ monthNamesShort: months.map(function (month) {
34
+ return (0, _locale.t)('el.datepicker.months.' + month);
35
+ }),
36
+ monthNames: months.map(function (month, index) {
37
+ return (0, _locale.t)('el.datepicker.month' + (index + 1));
38
+ }),
39
+ amPm: ['am', 'pm']
40
+ };
41
+ };
42
+
43
+ var toDate = exports.toDate = function toDate(date) {
44
+ return isDate(date) ? new Date(date) : null;
45
+ };
46
+
47
+ var isDate = exports.isDate = function isDate(date) {
48
+ if (date === null || date === undefined) return false;
49
+ if (isNaN(new Date(date).getTime())) return false;
50
+ if (Array.isArray(date)) return false; // deal with `new Date([ new Date() ]) -> new Date()`
51
+ return true;
52
+ };
53
+
54
+ var isDateObject = exports.isDateObject = function isDateObject(val) {
55
+ return val instanceof Date;
56
+ };
57
+
58
+ var formatDate = exports.formatDate = function formatDate(date, format) {
59
+ date = toDate(date);
60
+ if (!date) return '';
61
+ return _date2.default.format(date, format || 'yyyy-MM-dd', getI18nSettings());
62
+ };
63
+
64
+ var parseDate = exports.parseDate = function parseDate(string, format) {
65
+ return _date2.default.parse(string, format || 'yyyy-MM-dd', getI18nSettings());
66
+ };
67
+
68
+ var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {
69
+ if (isNaN(+month)) return 31;
70
+
71
+ return new Date(year, +month + 1, 0).getDate();
72
+ };
73
+
74
+ var getDayCountOfYear = exports.getDayCountOfYear = function getDayCountOfYear(year) {
75
+ var isLeapYear = year % 400 === 0 || year % 100 !== 0 && year % 4 === 0;
76
+ return isLeapYear ? 366 : 365;
77
+ };
78
+
79
+ var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {
80
+ var temp = new Date(date.getTime());
81
+ temp.setDate(1);
82
+ return temp.getDay();
83
+ };
84
+
85
+ // see: https://stackoverflow.com/questions/3674539/incrementing-a-date-in-javascript
86
+ // {prev, next} Date should work for Daylight Saving Time
87
+ // Adding 24 * 60 * 60 * 1000 does not work in the above scenario
88
+ var prevDate = exports.prevDate = function prevDate(date) {
89
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
90
+
91
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() - amount);
92
+ };
93
+
94
+ var nextDate = exports.nextDate = function nextDate(date) {
95
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
96
+
97
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate() + amount);
98
+ };
99
+
100
+ var getStartDateOfMonth = exports.getStartDateOfMonth = function getStartDateOfMonth(year, month) {
101
+ var result = new Date(year, month, 1);
102
+ var day = result.getDay();
103
+
104
+ if (day === 0) {
105
+ return prevDate(result, 7);
106
+ } else {
107
+ return prevDate(result, day);
108
+ }
109
+ };
110
+
111
+ var getWeekNumber = exports.getWeekNumber = function getWeekNumber(src) {
112
+ if (!isDate(src)) return null;
113
+ var date = new Date(src.getTime());
114
+ date.setHours(0, 0, 0, 0);
115
+ // Thursday in current week decides the year.
116
+ date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
117
+ // January 4 is always in week 1.
118
+ var week1 = new Date(date.getFullYear(), 0, 4);
119
+ // Adjust to Thursday in week 1 and count number of weeks from date to week 1.
120
+ // Rounding should be fine for Daylight Saving Time. Its shift should never be more than 12 hours.
121
+ return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);
122
+ };
123
+
124
+ var getRangeHours = exports.getRangeHours = function getRangeHours(ranges) {
125
+ var hours = [];
126
+ var disabledHours = [];
127
+
128
+ (ranges || []).forEach(function (range) {
129
+ var value = range.map(function (date) {
130
+ return date.getHours();
131
+ });
132
+
133
+ disabledHours = disabledHours.concat(newArray(value[0], value[1]));
134
+ });
135
+
136
+ if (disabledHours.length) {
137
+ for (var i = 0; i < 24; i++) {
138
+ hours[i] = disabledHours.indexOf(i) === -1;
139
+ }
140
+ } else {
141
+ for (var _i = 0; _i < 24; _i++) {
142
+ hours[_i] = false;
143
+ }
144
+ }
145
+
146
+ return hours;
147
+ };
148
+
149
+ var getPrevMonthLastDays = exports.getPrevMonthLastDays = function getPrevMonthLastDays(date, amount) {
150
+ if (amount <= 0) return [];
151
+ var temp = new Date(date.getTime());
152
+ temp.setDate(0);
153
+ var lastDay = temp.getDate();
154
+ return range(amount).map(function (_, index) {
155
+ return lastDay - (amount - index - 1);
156
+ });
157
+ };
158
+
159
+ var getMonthDays = exports.getMonthDays = function getMonthDays(date) {
160
+ var temp = new Date(date.getFullYear(), date.getMonth() + 1, 0);
161
+ var days = temp.getDate();
162
+ return range(days).map(function (_, index) {
163
+ return index + 1;
164
+ });
165
+ };
166
+
167
+ function setRangeData(arr, start, end, value) {
168
+ for (var i = start; i < end; i++) {
169
+ arr[i] = value;
170
+ }
171
+ }
172
+
173
+ var getRangeMinutes = exports.getRangeMinutes = function getRangeMinutes(ranges, hour) {
174
+ var minutes = new Array(60);
175
+
176
+ if (ranges.length > 0) {
177
+ ranges.forEach(function (range) {
178
+ var start = range[0];
179
+ var end = range[1];
180
+ var startHour = start.getHours();
181
+ var startMinute = start.getMinutes();
182
+ var endHour = end.getHours();
183
+ var endMinute = end.getMinutes();
184
+ if (startHour === hour && endHour !== hour) {
185
+ setRangeData(minutes, startMinute, 60, true);
186
+ } else if (startHour === hour && endHour === hour) {
187
+ setRangeData(minutes, startMinute, endMinute + 1, true);
188
+ } else if (startHour !== hour && endHour === hour) {
189
+ setRangeData(minutes, 0, endMinute + 1, true);
190
+ } else if (startHour < hour && endHour > hour) {
191
+ setRangeData(minutes, 0, 60, true);
192
+ }
193
+ });
194
+ } else {
195
+ setRangeData(minutes, 0, 60, true);
196
+ }
197
+ return minutes;
198
+ };
199
+
200
+ var range = exports.range = function range(n) {
201
+ // see https://stackoverflow.com/questions/3746725/create-a-javascript-array-containing-1-n
202
+ return Array.apply(null, { length: n }).map(function (_, n) {
203
+ return n;
204
+ });
205
+ };
206
+
207
+ var modifyDate = exports.modifyDate = function modifyDate(date, y, m, d) {
208
+ return new Date(y, m, d, date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
209
+ };
210
+
211
+ var modifyTime = exports.modifyTime = function modifyTime(date, h, m, s) {
212
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), h, m, s, date.getMilliseconds());
213
+ };
214
+
215
+ var modifyWithTimeString = exports.modifyWithTimeString = function modifyWithTimeString(date, time) {
216
+ if (date == null || !time) {
217
+ return date;
218
+ }
219
+ time = parseDate(time, 'HH:mm:ss');
220
+ return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
221
+ };
222
+
223
+ var clearTime = exports.clearTime = function clearTime(date) {
224
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
225
+ };
226
+
227
+ var clearMilliseconds = exports.clearMilliseconds = function clearMilliseconds(date) {
228
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
229
+ };
230
+
231
+ var limitTimeRange = exports.limitTimeRange = function limitTimeRange(date, ranges) {
232
+ var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'HH:mm:ss';
233
+
234
+ // TODO: refactory a more elegant solution
235
+ if (ranges.length === 0) return date;
236
+ var normalizeDate = function normalizeDate(date) {
237
+ return _date2.default.parse(_date2.default.format(date, format), format);
238
+ };
239
+ var ndate = normalizeDate(date);
240
+ var nranges = ranges.map(function (range) {
241
+ return range.map(normalizeDate);
242
+ });
243
+ if (nranges.some(function (nrange) {
244
+ return ndate >= nrange[0] && ndate <= nrange[1];
245
+ })) return date;
246
+
247
+ var minDate = nranges[0][0];
248
+ var maxDate = nranges[0][0];
249
+
250
+ nranges.forEach(function (nrange) {
251
+ minDate = new Date(Math.min(nrange[0], minDate));
252
+ maxDate = new Date(Math.max(nrange[1], minDate));
253
+ });
254
+
255
+ var ret = ndate < minDate ? minDate : maxDate;
256
+ // preserve Year/Month/Date
257
+ return modifyDate(ret, date.getFullYear(), date.getMonth(), date.getDate());
258
+ };
259
+
260
+ var timeWithinRange = exports.timeWithinRange = function timeWithinRange(date, selectableRange, format) {
261
+ var limitedDate = limitTimeRange(date, selectableRange, format);
262
+ return limitedDate.getTime() === date.getTime();
263
+ };
264
+
265
+ var changeYearMonthAndClampDate = exports.changeYearMonthAndClampDate = function changeYearMonthAndClampDate(date, year, month) {
266
+ // clamp date to the number of days in `year`, `month`
267
+ // eg: (2010-1-31, 2010, 2) => 2010-2-28
268
+ var monthDate = Math.min(date.getDate(), getDayCountOfMonth(year, month));
269
+ return modifyDate(date, year, month, monthDate);
270
+ };
271
+
272
+ var prevMonth = exports.prevMonth = function prevMonth(date) {
273
+ var year = date.getFullYear();
274
+ var month = date.getMonth();
275
+ return month === 0 ? changeYearMonthAndClampDate(date, year - 1, 11) : changeYearMonthAndClampDate(date, year, month - 1);
276
+ };
277
+
278
+ var nextMonth = exports.nextMonth = function nextMonth(date) {
279
+ var year = date.getFullYear();
280
+ var month = date.getMonth();
281
+ return month === 11 ? changeYearMonthAndClampDate(date, year + 1, 0) : changeYearMonthAndClampDate(date, year, month + 1);
282
+ };
283
+
284
+ var prevYear = exports.prevYear = function prevYear(date) {
285
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
286
+
287
+ var year = date.getFullYear();
288
+ var month = date.getMonth();
289
+ return changeYearMonthAndClampDate(date, year - amount, month);
290
+ };
291
+
292
+ var nextYear = exports.nextYear = function nextYear(date) {
293
+ var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
294
+
295
+ var year = date.getFullYear();
296
+ var month = date.getMonth();
297
+ return changeYearMonthAndClampDate(date, year + amount, month);
298
+ };
299
+
300
+ var extractDateFormat = exports.extractDateFormat = function extractDateFormat(format) {
301
+ return format.replace(/\W?m{1,2}|\W?ZZ/g, '').replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, '').trim();
302
+ };
303
+
304
+ var extractTimeFormat = exports.extractTimeFormat = function extractTimeFormat(format) {
305
+ return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g, '').trim();
306
+ };
307
+
308
+ var validateRangeInOneMonth = exports.validateRangeInOneMonth = function validateRangeInOneMonth(start, end) {
309
+ return start.getMonth() === end.getMonth() && start.getFullYear() === end.getFullYear();
310
+ };