element-sim 1.1.35 → 1.1.36

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 (463) hide show
  1. package/lib/index.js +1 -1
  2. package/package.json +1 -1
  3. package/packages/theme-chalk/gulpfile.js +25 -0
  4. package/packages/theme-chalk/src/fonts/icon-sim.ttf +0 -0
  5. package/packages/theme-chalk/src/fonts/icon-sim.woff +0 -0
  6. package/packages/theme-chalk/src/fonts/icon-sim.woff2 +0 -0
  7. package/packages/theme-chalk/src/icon.scss +12 -0
  8. package/src/index.js +1 -1
  9. package/CHANGELOG.en-US.md +0 -2085
  10. package/CHANGELOG.es.md +0 -2093
  11. package/CHANGELOG.fr-FR.md +0 -2085
  12. package/CHANGELOG.zh-CN.md +0 -131
  13. package/lib/alert.js +0 -420
  14. package/lib/aside.js +0 -277
  15. package/lib/autocomplete.js +0 -952
  16. package/lib/avatar.js +0 -363
  17. package/lib/backtop.js +0 -404
  18. package/lib/badge.js +0 -334
  19. package/lib/breadcrumb-item.js +0 -322
  20. package/lib/breadcrumb.js +0 -293
  21. package/lib/button-group.js +0 -262
  22. package/lib/button.js +0 -357
  23. package/lib/calendar.js +0 -933
  24. package/lib/card.js +0 -297
  25. package/lib/carousel-item.js +0 -434
  26. package/lib/carousel.js +0 -707
  27. package/lib/cascader-panel.js +0 -1558
  28. package/lib/cascader.js +0 -1439
  29. package/lib/checkbox-button.js +0 -583
  30. package/lib/checkbox-group.js +0 -313
  31. package/lib/checkbox.js +0 -627
  32. package/lib/col.js +0 -177
  33. package/lib/collapse-item.js +0 -497
  34. package/lib/collapse.js +0 -329
  35. package/lib/color-picker.js +0 -1943
  36. package/lib/container.js +0 -288
  37. package/lib/date-picker.js +0 -6335
  38. package/lib/descriptions-item.js +0 -140
  39. package/lib/descriptions.js +0 -457
  40. package/lib/dialog.js +0 -598
  41. package/lib/directives/mousewheel.js +0 -26
  42. package/lib/directives/repeat-click.js +0 -33
  43. package/lib/divider.js +0 -313
  44. package/lib/drawer.js +0 -603
  45. package/lib/dropdown-item.js +0 -316
  46. package/lib/dropdown-menu.js +0 -351
  47. package/lib/dropdown.js +0 -643
  48. package/lib/element-sim.common.js +0 -43542
  49. package/lib/empty.js +0 -730
  50. package/lib/footer.js +0 -277
  51. package/lib/form-item.js +0 -826
  52. package/lib/form.js +0 -466
  53. package/lib/header.js +0 -277
  54. package/lib/icon.js +0 -265
  55. package/lib/image.js +0 -1138
  56. package/lib/infinite-scroll.js +0 -301
  57. package/lib/input-number.js +0 -752
  58. package/lib/input.js +0 -1009
  59. package/lib/link.js +0 -332
  60. package/lib/loading.js +0 -631
  61. package/lib/locale/format.js +0 -56
  62. package/lib/locale/index.js +0 -63
  63. package/lib/locale/lang/af-ZA.js +0 -126
  64. package/lib/locale/lang/ar.js +0 -125
  65. package/lib/locale/lang/az.js +0 -126
  66. package/lib/locale/lang/bg.js +0 -126
  67. package/lib/locale/lang/bn.js +0 -126
  68. package/lib/locale/lang/ca.js +0 -125
  69. package/lib/locale/lang/cs-CZ.js +0 -128
  70. package/lib/locale/lang/da.js +0 -125
  71. package/lib/locale/lang/de.js +0 -127
  72. package/lib/locale/lang/ee.js +0 -126
  73. package/lib/locale/lang/el.js +0 -126
  74. package/lib/locale/lang/en.js +0 -126
  75. package/lib/locale/lang/eo.js +0 -126
  76. package/lib/locale/lang/es.js +0 -125
  77. package/lib/locale/lang/eu.js +0 -126
  78. package/lib/locale/lang/fa.js +0 -126
  79. package/lib/locale/lang/fi.js +0 -126
  80. package/lib/locale/lang/fr.js +0 -125
  81. package/lib/locale/lang/he.js +0 -126
  82. package/lib/locale/lang/hr.js +0 -126
  83. package/lib/locale/lang/hu.js +0 -125
  84. package/lib/locale/lang/hy-AM.js +0 -126
  85. package/lib/locale/lang/id.js +0 -126
  86. package/lib/locale/lang/is.js +0 -126
  87. package/lib/locale/lang/it.js +0 -125
  88. package/lib/locale/lang/ja.js +0 -126
  89. package/lib/locale/lang/kg.js +0 -126
  90. package/lib/locale/lang/km.js +0 -126
  91. package/lib/locale/lang/ko.js +0 -126
  92. package/lib/locale/lang/ku.js +0 -126
  93. package/lib/locale/lang/kz.js +0 -126
  94. package/lib/locale/lang/lo-LA.js +0 -126
  95. package/lib/locale/lang/lt.js +0 -126
  96. package/lib/locale/lang/lv.js +0 -126
  97. package/lib/locale/lang/mn.js +0 -126
  98. package/lib/locale/lang/ms.js +0 -125
  99. package/lib/locale/lang/nb-NO.js +0 -125
  100. package/lib/locale/lang/nl.js +0 -126
  101. package/lib/locale/lang/pl.js +0 -126
  102. package/lib/locale/lang/pt-br.js +0 -126
  103. package/lib/locale/lang/pt.js +0 -126
  104. package/lib/locale/lang/ro.js +0 -126
  105. package/lib/locale/lang/ru-RU.js +0 -126
  106. package/lib/locale/lang/si.js +0 -126
  107. package/lib/locale/lang/sk.js +0 -128
  108. package/lib/locale/lang/sl.js +0 -126
  109. package/lib/locale/lang/sr-Latn.js +0 -126
  110. package/lib/locale/lang/sr.js +0 -126
  111. package/lib/locale/lang/sv-SE.js +0 -126
  112. package/lib/locale/lang/sw.js +0 -126
  113. package/lib/locale/lang/ta.js +0 -125
  114. package/lib/locale/lang/th.js +0 -126
  115. package/lib/locale/lang/tk.js +0 -126
  116. package/lib/locale/lang/tr-TR.js +0 -126
  117. package/lib/locale/lang/ua.js +0 -126
  118. package/lib/locale/lang/ug-CN.js +0 -126
  119. package/lib/locale/lang/uz-UZ.js +0 -126
  120. package/lib/locale/lang/vi.js +0 -126
  121. package/lib/locale/lang/zh-CN.js +0 -126
  122. package/lib/locale/lang/zh-TW.js +0 -126
  123. package/lib/main.js +0 -264
  124. package/lib/menu-item-group.js +0 -308
  125. package/lib/menu-item.js +0 -491
  126. package/lib/menu.js +0 -865
  127. package/lib/message-box.js +0 -1192
  128. package/lib/message.js +0 -548
  129. package/lib/mixins/emitter.js +0 -36
  130. package/lib/mixins/focus.js +0 -15
  131. package/lib/mixins/locale.js +0 -17
  132. package/lib/mixins/migrating.js +0 -69
  133. package/lib/notification.js +0 -615
  134. package/lib/option-group.js +0 -344
  135. package/lib/option.js +0 -474
  136. package/lib/page-header.js +0 -319
  137. package/lib/pagination.js +0 -950
  138. package/lib/popconfirm.js +0 -457
  139. package/lib/popover.js +0 -617
  140. package/lib/progress.js +0 -595
  141. package/lib/radio-button.js +0 -463
  142. package/lib/radio-group.js +0 -391
  143. package/lib/radio.js +0 -495
  144. package/lib/rate.js +0 -670
  145. package/lib/result.js +0 -578
  146. package/lib/row.js +0 -149
  147. package/lib/scrollbar.js +0 -426
  148. package/lib/select.js +0 -2108
  149. package/lib/skeleton-item.js +0 -342
  150. package/lib/skeleton.js +0 -372
  151. package/lib/slider.js +0 -1199
  152. package/lib/spinner.js +0 -301
  153. package/lib/statistic.js +0 -533
  154. package/lib/step.js +0 -522
  155. package/lib/steps.js +0 -342
  156. package/lib/submenu.js +0 -701
  157. package/lib/switch.js +0 -554
  158. package/lib/tab-pane.js +0 -332
  159. package/lib/table-column.js +0 -952
  160. package/lib/table.js +0 -5021
  161. package/lib/tabs.js +0 -920
  162. package/lib/tag.js +0 -304
  163. package/lib/theme-chalk/alert.css +0 -1
  164. package/lib/theme-chalk/aside.css +0 -1
  165. package/lib/theme-chalk/autocomplete.css +0 -1
  166. package/lib/theme-chalk/avatar.css +0 -1
  167. package/lib/theme-chalk/backtop.css +0 -1
  168. package/lib/theme-chalk/badge.css +0 -1
  169. package/lib/theme-chalk/base.css +0 -1
  170. package/lib/theme-chalk/breadcrumb-item.css +0 -0
  171. package/lib/theme-chalk/breadcrumb.css +0 -1
  172. package/lib/theme-chalk/button-group.css +0 -0
  173. package/lib/theme-chalk/button.css +0 -1
  174. package/lib/theme-chalk/calendar.css +0 -1
  175. package/lib/theme-chalk/card.css +0 -1
  176. package/lib/theme-chalk/carousel-item.css +0 -1
  177. package/lib/theme-chalk/carousel.css +0 -1
  178. package/lib/theme-chalk/cascader-panel.css +0 -1
  179. package/lib/theme-chalk/cascader.css +0 -1
  180. package/lib/theme-chalk/checkbox-button.css +0 -0
  181. package/lib/theme-chalk/checkbox-group.css +0 -0
  182. package/lib/theme-chalk/checkbox.css +0 -1
  183. package/lib/theme-chalk/col.css +0 -1
  184. package/lib/theme-chalk/collapse-item.css +0 -0
  185. package/lib/theme-chalk/collapse.css +0 -1
  186. package/lib/theme-chalk/color-picker.css +0 -1
  187. package/lib/theme-chalk/container.css +0 -1
  188. package/lib/theme-chalk/date-picker.css +0 -1
  189. package/lib/theme-chalk/descriptions-item.css +0 -1
  190. package/lib/theme-chalk/descriptions.css +0 -1
  191. package/lib/theme-chalk/dialog.css +0 -1
  192. package/lib/theme-chalk/display.css +0 -1
  193. package/lib/theme-chalk/divider.css +0 -1
  194. package/lib/theme-chalk/drawer.css +0 -1
  195. package/lib/theme-chalk/dropdown-item.css +0 -0
  196. package/lib/theme-chalk/dropdown-menu.css +0 -0
  197. package/lib/theme-chalk/dropdown.css +0 -1
  198. package/lib/theme-chalk/empty.css +0 -1
  199. package/lib/theme-chalk/fonts/element-icons.ttf +0 -0
  200. package/lib/theme-chalk/fonts/element-icons.woff +0 -0
  201. package/lib/theme-chalk/fonts/icon-sim.ttf +0 -0
  202. package/lib/theme-chalk/fonts/icon-sim.woff +0 -0
  203. package/lib/theme-chalk/fonts/icon-sim.woff2 +0 -0
  204. package/lib/theme-chalk/footer.css +0 -1
  205. package/lib/theme-chalk/form-item.css +0 -0
  206. package/lib/theme-chalk/form.css +0 -1
  207. package/lib/theme-chalk/header.css +0 -1
  208. package/lib/theme-chalk/icon.css +0 -1
  209. package/lib/theme-chalk/image.css +0 -1
  210. package/lib/theme-chalk/index.css +0 -1
  211. package/lib/theme-chalk/infinite-scroll.css +0 -0
  212. package/lib/theme-chalk/infiniteScroll.css +0 -0
  213. package/lib/theme-chalk/input-number.css +0 -1
  214. package/lib/theme-chalk/input.css +0 -1
  215. package/lib/theme-chalk/link.css +0 -1
  216. package/lib/theme-chalk/loading.css +0 -1
  217. package/lib/theme-chalk/main.css +0 -1
  218. package/lib/theme-chalk/menu-item-group.css +0 -0
  219. package/lib/theme-chalk/menu-item.css +0 -0
  220. package/lib/theme-chalk/menu.css +0 -1
  221. package/lib/theme-chalk/message-box.css +0 -1
  222. package/lib/theme-chalk/message.css +0 -1
  223. package/lib/theme-chalk/notification.css +0 -1
  224. package/lib/theme-chalk/option-group.css +0 -1
  225. package/lib/theme-chalk/option.css +0 -1
  226. package/lib/theme-chalk/page-header.css +0 -1
  227. package/lib/theme-chalk/pagination.css +0 -1
  228. package/lib/theme-chalk/popconfirm.css +0 -1
  229. package/lib/theme-chalk/popover.css +0 -1
  230. package/lib/theme-chalk/popper.css +0 -1
  231. package/lib/theme-chalk/progress.css +0 -1
  232. package/lib/theme-chalk/radio-button.css +0 -1
  233. package/lib/theme-chalk/radio-group.css +0 -1
  234. package/lib/theme-chalk/radio.css +0 -1
  235. package/lib/theme-chalk/rate.css +0 -1
  236. package/lib/theme-chalk/reset.css +0 -1
  237. package/lib/theme-chalk/result.css +0 -1
  238. package/lib/theme-chalk/row.css +0 -1
  239. package/lib/theme-chalk/scrollbar.css +0 -1
  240. package/lib/theme-chalk/select-dropdown.css +0 -1
  241. package/lib/theme-chalk/select.css +0 -1
  242. package/lib/theme-chalk/skeleton-item.css +0 -1
  243. package/lib/theme-chalk/skeleton.css +0 -1
  244. package/lib/theme-chalk/slider.css +0 -1
  245. package/lib/theme-chalk/spinner.css +0 -1
  246. package/lib/theme-chalk/statistic.css +0 -1
  247. package/lib/theme-chalk/step.css +0 -1
  248. package/lib/theme-chalk/steps.css +0 -1
  249. package/lib/theme-chalk/submenu.css +0 -0
  250. package/lib/theme-chalk/switch.css +0 -1
  251. package/lib/theme-chalk/tab-pane.css +0 -0
  252. package/lib/theme-chalk/table-column.css +0 -1
  253. package/lib/theme-chalk/table.css +0 -1
  254. package/lib/theme-chalk/tabs.css +0 -1
  255. package/lib/theme-chalk/tag.css +0 -1
  256. package/lib/theme-chalk/time-picker.css +0 -1
  257. package/lib/theme-chalk/time-select.css +0 -1
  258. package/lib/theme-chalk/timeline-item.css +0 -1
  259. package/lib/theme-chalk/timeline.css +0 -1
  260. package/lib/theme-chalk/tooltip.css +0 -1
  261. package/lib/theme-chalk/transfer.css +0 -1
  262. package/lib/theme-chalk/tree.css +0 -1
  263. package/lib/theme-chalk/upload.css +0 -1
  264. package/lib/time-picker.js +0 -2967
  265. package/lib/time-select.js +0 -1765
  266. package/lib/timeline-item.js +0 -371
  267. package/lib/timeline.js +0 -275
  268. package/lib/tooltip.js +0 -425
  269. package/lib/transfer.js +0 -1102
  270. package/lib/transitions/collapse-transition.js +0 -91
  271. package/lib/tree.js +0 -2263
  272. package/lib/umd/locale/af-ZA.js +0 -142
  273. package/lib/umd/locale/ar.js +0 -141
  274. package/lib/umd/locale/az.js +0 -141
  275. package/lib/umd/locale/bg.js +0 -142
  276. package/lib/umd/locale/bn.js +0 -141
  277. package/lib/umd/locale/ca.js +0 -141
  278. package/lib/umd/locale/cs-CZ.js +0 -144
  279. package/lib/umd/locale/da.js +0 -141
  280. package/lib/umd/locale/de.js +0 -143
  281. package/lib/umd/locale/ee.js +0 -142
  282. package/lib/umd/locale/el.js +0 -142
  283. package/lib/umd/locale/en.js +0 -142
  284. package/lib/umd/locale/eo.js +0 -142
  285. package/lib/umd/locale/es.js +0 -141
  286. package/lib/umd/locale/eu.js +0 -142
  287. package/lib/umd/locale/fa.js +0 -142
  288. package/lib/umd/locale/fi.js +0 -142
  289. package/lib/umd/locale/fr.js +0 -141
  290. package/lib/umd/locale/he.js +0 -142
  291. package/lib/umd/locale/hr.js +0 -142
  292. package/lib/umd/locale/hu.js +0 -141
  293. package/lib/umd/locale/hy-AM.js +0 -142
  294. package/lib/umd/locale/id.js +0 -142
  295. package/lib/umd/locale/is.js +0 -142
  296. package/lib/umd/locale/it.js +0 -141
  297. package/lib/umd/locale/ja.js +0 -142
  298. package/lib/umd/locale/kg.js +0 -142
  299. package/lib/umd/locale/km.js +0 -142
  300. package/lib/umd/locale/ko.js +0 -142
  301. package/lib/umd/locale/ku.js +0 -142
  302. package/lib/umd/locale/kz.js +0 -142
  303. package/lib/umd/locale/lo-LA.js +0 -141
  304. package/lib/umd/locale/lt.js +0 -142
  305. package/lib/umd/locale/lv.js +0 -142
  306. package/lib/umd/locale/mn.js +0 -142
  307. package/lib/umd/locale/ms.js +0 -141
  308. package/lib/umd/locale/nb-NO.js +0 -141
  309. package/lib/umd/locale/nl.js +0 -142
  310. package/lib/umd/locale/pl.js +0 -142
  311. package/lib/umd/locale/pt-br.js +0 -142
  312. package/lib/umd/locale/pt.js +0 -142
  313. package/lib/umd/locale/ro.js +0 -142
  314. package/lib/umd/locale/ru-RU.js +0 -142
  315. package/lib/umd/locale/si.js +0 -142
  316. package/lib/umd/locale/sk.js +0 -144
  317. package/lib/umd/locale/sl.js +0 -142
  318. package/lib/umd/locale/sr-Latn.js +0 -142
  319. package/lib/umd/locale/sr.js +0 -142
  320. package/lib/umd/locale/sv-SE.js +0 -142
  321. package/lib/umd/locale/sw.js +0 -142
  322. package/lib/umd/locale/ta.js +0 -141
  323. package/lib/umd/locale/th.js +0 -142
  324. package/lib/umd/locale/tk.js +0 -142
  325. package/lib/umd/locale/tr-TR.js +0 -142
  326. package/lib/umd/locale/ua.js +0 -142
  327. package/lib/umd/locale/ug-CN.js +0 -142
  328. package/lib/umd/locale/uz-UZ.js +0 -142
  329. package/lib/umd/locale/vi.js +0 -142
  330. package/lib/umd/locale/zh-CN.js +0 -142
  331. package/lib/umd/locale/zh-TW.js +0 -142
  332. package/lib/upload.js +0 -1390
  333. package/lib/utils/after-leave.js +0 -35
  334. package/lib/utils/aria-dialog.js +0 -104
  335. package/lib/utils/aria-utils.js +0 -126
  336. package/lib/utils/clickoutside.js +0 -79
  337. package/lib/utils/date-util.js +0 -310
  338. package/lib/utils/date.js +0 -369
  339. package/lib/utils/dom.js +0 -234
  340. package/lib/utils/lodash.js +0 -9477
  341. package/lib/utils/menu/aria-menubar.js +0 -24
  342. package/lib/utils/menu/aria-menuitem.js +0 -62
  343. package/lib/utils/menu/aria-submenu.js +0 -69
  344. package/lib/utils/merge.js +0 -21
  345. package/lib/utils/popper.js +0 -1261
  346. package/lib/utils/popup/index.js +0 -233
  347. package/lib/utils/popup/popup-manager.js +0 -205
  348. package/lib/utils/resize-event.js +0 -59
  349. package/lib/utils/scroll-into-view.js +0 -38
  350. package/lib/utils/scrollbar-width.js +0 -39
  351. package/lib/utils/shared.js +0 -12
  352. package/lib/utils/types.js +0 -52
  353. package/lib/utils/util.js +0 -272
  354. package/lib/utils/vdom.js +0 -13
  355. package/lib/utils/vue-popper.js +0 -202
  356. package/packages/.DS_Store +0 -0
  357. package/packages/table/.DS_Store +0 -0
  358. package/packages/table/src/.DS_Store +0 -0
  359. package/packages/theme-chalk/lib/alert.css +0 -1
  360. package/packages/theme-chalk/lib/aside.css +0 -1
  361. package/packages/theme-chalk/lib/autocomplete.css +0 -1
  362. package/packages/theme-chalk/lib/avatar.css +0 -1
  363. package/packages/theme-chalk/lib/backtop.css +0 -1
  364. package/packages/theme-chalk/lib/badge.css +0 -1
  365. package/packages/theme-chalk/lib/base.css +0 -1
  366. package/packages/theme-chalk/lib/breadcrumb-item.css +0 -0
  367. package/packages/theme-chalk/lib/breadcrumb.css +0 -1
  368. package/packages/theme-chalk/lib/button-group.css +0 -0
  369. package/packages/theme-chalk/lib/button.css +0 -1
  370. package/packages/theme-chalk/lib/calendar.css +0 -1
  371. package/packages/theme-chalk/lib/card.css +0 -1
  372. package/packages/theme-chalk/lib/carousel-item.css +0 -1
  373. package/packages/theme-chalk/lib/carousel.css +0 -1
  374. package/packages/theme-chalk/lib/cascader-panel.css +0 -1
  375. package/packages/theme-chalk/lib/cascader.css +0 -1
  376. package/packages/theme-chalk/lib/checkbox-button.css +0 -0
  377. package/packages/theme-chalk/lib/checkbox-group.css +0 -0
  378. package/packages/theme-chalk/lib/checkbox.css +0 -1
  379. package/packages/theme-chalk/lib/col.css +0 -1
  380. package/packages/theme-chalk/lib/collapse-item.css +0 -0
  381. package/packages/theme-chalk/lib/collapse.css +0 -1
  382. package/packages/theme-chalk/lib/color-picker.css +0 -1
  383. package/packages/theme-chalk/lib/container.css +0 -1
  384. package/packages/theme-chalk/lib/date-picker.css +0 -1
  385. package/packages/theme-chalk/lib/descriptions-item.css +0 -1
  386. package/packages/theme-chalk/lib/descriptions.css +0 -1
  387. package/packages/theme-chalk/lib/dialog.css +0 -1
  388. package/packages/theme-chalk/lib/display.css +0 -1
  389. package/packages/theme-chalk/lib/divider.css +0 -1
  390. package/packages/theme-chalk/lib/drawer.css +0 -1
  391. package/packages/theme-chalk/lib/dropdown-item.css +0 -0
  392. package/packages/theme-chalk/lib/dropdown-menu.css +0 -0
  393. package/packages/theme-chalk/lib/dropdown.css +0 -1
  394. package/packages/theme-chalk/lib/empty.css +0 -1
  395. package/packages/theme-chalk/lib/fonts/element-icons.ttf +0 -0
  396. package/packages/theme-chalk/lib/fonts/element-icons.woff +0 -0
  397. package/packages/theme-chalk/lib/fonts/icon-sim.ttf +0 -0
  398. package/packages/theme-chalk/lib/fonts/icon-sim.woff +0 -0
  399. package/packages/theme-chalk/lib/fonts/icon-sim.woff2 +0 -0
  400. package/packages/theme-chalk/lib/footer.css +0 -1
  401. package/packages/theme-chalk/lib/form-item.css +0 -0
  402. package/packages/theme-chalk/lib/form.css +0 -1
  403. package/packages/theme-chalk/lib/header.css +0 -1
  404. package/packages/theme-chalk/lib/icon.css +0 -1
  405. package/packages/theme-chalk/lib/image.css +0 -1
  406. package/packages/theme-chalk/lib/index.css +0 -1
  407. package/packages/theme-chalk/lib/infinite-scroll.css +0 -0
  408. package/packages/theme-chalk/lib/infiniteScroll.css +0 -0
  409. package/packages/theme-chalk/lib/input-number.css +0 -1
  410. package/packages/theme-chalk/lib/input.css +0 -1
  411. package/packages/theme-chalk/lib/link.css +0 -1
  412. package/packages/theme-chalk/lib/loading.css +0 -1
  413. package/packages/theme-chalk/lib/main.css +0 -1
  414. package/packages/theme-chalk/lib/menu-item-group.css +0 -0
  415. package/packages/theme-chalk/lib/menu-item.css +0 -0
  416. package/packages/theme-chalk/lib/menu.css +0 -1
  417. package/packages/theme-chalk/lib/message-box.css +0 -1
  418. package/packages/theme-chalk/lib/message.css +0 -1
  419. package/packages/theme-chalk/lib/notification.css +0 -1
  420. package/packages/theme-chalk/lib/option-group.css +0 -1
  421. package/packages/theme-chalk/lib/option.css +0 -1
  422. package/packages/theme-chalk/lib/page-header.css +0 -1
  423. package/packages/theme-chalk/lib/pagination.css +0 -1
  424. package/packages/theme-chalk/lib/popconfirm.css +0 -1
  425. package/packages/theme-chalk/lib/popover.css +0 -1
  426. package/packages/theme-chalk/lib/popper.css +0 -1
  427. package/packages/theme-chalk/lib/progress.css +0 -1
  428. package/packages/theme-chalk/lib/radio-button.css +0 -1
  429. package/packages/theme-chalk/lib/radio-group.css +0 -1
  430. package/packages/theme-chalk/lib/radio.css +0 -1
  431. package/packages/theme-chalk/lib/rate.css +0 -1
  432. package/packages/theme-chalk/lib/reset.css +0 -1
  433. package/packages/theme-chalk/lib/result.css +0 -1
  434. package/packages/theme-chalk/lib/row.css +0 -1
  435. package/packages/theme-chalk/lib/scrollbar.css +0 -1
  436. package/packages/theme-chalk/lib/select-dropdown.css +0 -1
  437. package/packages/theme-chalk/lib/select.css +0 -1
  438. package/packages/theme-chalk/lib/skeleton-item.css +0 -1
  439. package/packages/theme-chalk/lib/skeleton.css +0 -1
  440. package/packages/theme-chalk/lib/slider.css +0 -1
  441. package/packages/theme-chalk/lib/spinner.css +0 -1
  442. package/packages/theme-chalk/lib/statistic.css +0 -1
  443. package/packages/theme-chalk/lib/step.css +0 -1
  444. package/packages/theme-chalk/lib/steps.css +0 -1
  445. package/packages/theme-chalk/lib/submenu.css +0 -0
  446. package/packages/theme-chalk/lib/switch.css +0 -1
  447. package/packages/theme-chalk/lib/tab-pane.css +0 -0
  448. package/packages/theme-chalk/lib/table-column.css +0 -1
  449. package/packages/theme-chalk/lib/table.css +0 -1
  450. package/packages/theme-chalk/lib/tabs.css +0 -1
  451. package/packages/theme-chalk/lib/tag.css +0 -1
  452. package/packages/theme-chalk/lib/time-picker.css +0 -1
  453. package/packages/theme-chalk/lib/time-select.css +0 -1
  454. package/packages/theme-chalk/lib/timeline-item.css +0 -1
  455. package/packages/theme-chalk/lib/timeline.css +0 -1
  456. package/packages/theme-chalk/lib/tooltip.css +0 -1
  457. package/packages/theme-chalk/lib/transfer.css +0 -1
  458. package/packages/theme-chalk/lib/tree.css +0 -1
  459. package/packages/theme-chalk/lib/upload.css +0 -1
  460. package/packages/theme-chalk/src/.DS_Store +0 -0
  461. package/packages/theme-chalk/src/fonts/.DS_Store +0 -0
  462. package/src/.DS_Store +0 -0
  463. package/src/utils/.DS_Store +0 -0
@@ -1,35 +0,0 @@
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
- */
@@ -1,104 +0,0 @@
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;
@@ -1,126 +0,0 @@
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;
@@ -1,79 +0,0 @@
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
- };
@@ -1,310 +0,0 @@
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
- };