tlvant 0.0.22 → 0.0.24

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 (827) hide show
  1. package/es/action-sheet/index.css +1 -0
  2. package/es/action-sheet/index.js +177 -0
  3. package/es/action-sheet/index.less +112 -0
  4. package/es/action-sheet/style/index.js +7 -0
  5. package/es/action-sheet/style/less.js +7 -0
  6. package/es/area/index.js +321 -0
  7. package/es/area/style/index.js +3 -0
  8. package/es/area/style/less.js +3 -0
  9. package/es/button/index.css +1 -0
  10. package/es/button/index.js +171 -0
  11. package/es/button/index.less +238 -0
  12. package/es/button/style/index.js +5 -0
  13. package/es/button/style/less.js +5 -0
  14. package/es/calendar/components/Header.js +55 -0
  15. package/es/calendar/components/Month.js +326 -0
  16. package/es/calendar/index.css +1 -0
  17. package/es/calendar/index.js +539 -0
  18. package/es/calendar/index.less +210 -0
  19. package/es/calendar/style/index.js +9 -0
  20. package/es/calendar/style/less.js +9 -0
  21. package/es/calendar/utils.js +66 -0
  22. package/es/cell/index.css +1 -0
  23. package/es/cell/index.js +121 -0
  24. package/es/cell/index.less +103 -0
  25. package/es/cell/shared.js +24 -0
  26. package/es/cell/style/index.js +4 -0
  27. package/es/cell/style/less.js +4 -0
  28. package/es/cell-group/index.css +1 -0
  29. package/es/cell-group/index.js +34 -0
  30. package/es/cell-group/index.less +12 -0
  31. package/es/cell-group/style/index.js +2 -0
  32. package/es/cell-group/style/less.js +2 -0
  33. package/es/checkbox/index.css +1 -0
  34. package/es/checkbox/index.js +80 -0
  35. package/es/checkbox/index.less +85 -0
  36. package/es/checkbox/style/index.js +4 -0
  37. package/es/checkbox/style/less.js +4 -0
  38. package/es/checkbox-group/index.css +1 -0
  39. package/es/checkbox-group/index.js +64 -0
  40. package/es/checkbox-group/index.less +8 -0
  41. package/es/checkbox-group/style/index.js +2 -0
  42. package/es/checkbox-group/style/less.js +2 -0
  43. package/es/collapse/index.js +39 -0
  44. package/es/collapse/style/index.js +1 -0
  45. package/es/collapse/style/less.js +1 -0
  46. package/es/collapse-item/index.css +1 -0
  47. package/es/collapse-item/index.js +198 -0
  48. package/es/collapse-item/index.less +67 -0
  49. package/es/collapse-item/style/index.js +5 -0
  50. package/es/collapse-item/style/less.js +5 -0
  51. package/es/contact-card/index.css +1 -0
  52. package/es/contact-card/index.js +59 -0
  53. package/es/contact-card/index.less +42 -0
  54. package/es/contact-card/style/index.js +5 -0
  55. package/es/contact-card/style/less.js +5 -0
  56. package/es/contact-edit/index.css +1 -0
  57. package/es/contact-edit/index.js +193 -0
  58. package/es/contact-edit/index.less +30 -0
  59. package/es/contact-edit/style/index.js +14 -0
  60. package/es/contact-edit/style/less.js +14 -0
  61. package/es/contact-list/index.css +1 -0
  62. package/es/contact-list/index.js +119 -0
  63. package/es/contact-list/index.less +54 -0
  64. package/es/contact-list/style/index.js +10 -0
  65. package/es/contact-list/style/less.js +10 -0
  66. package/es/datetime-picker/DatePicker.js +246 -0
  67. package/es/datetime-picker/TimePicker.js +104 -0
  68. package/es/datetime-picker/index.js +29 -0
  69. package/es/datetime-picker/shared.js +110 -0
  70. package/es/datetime-picker/style/index.js +3 -0
  71. package/es/datetime-picker/style/less.js +3 -0
  72. package/es/datetime-picker/utils.js +29 -0
  73. package/es/demo-button/index-sfc.css +1 -0
  74. package/es/demo-button/index-sfc.less +9 -0
  75. package/es/demo-button/index.js +27 -0
  76. package/es/demo-button/style/index.js +1 -0
  77. package/es/demo-button/style/less.js +1 -0
  78. package/es/dialog/Dialog.js +246 -0
  79. package/es/dialog/index.css +1 -0
  80. package/es/dialog/index.js +104 -0
  81. package/es/dialog/index.less +153 -0
  82. package/es/dialog/style/index.js +10 -0
  83. package/es/dialog/style/less.js +10 -0
  84. package/es/dropdown-item/index.css +1 -0
  85. package/es/dropdown-item/index.js +210 -0
  86. package/es/dropdown-item/index.less +39 -0
  87. package/es/dropdown-item/style/index.js +7 -0
  88. package/es/dropdown-item/style/less.js +7 -0
  89. package/es/dropdown-menu/index.css +1 -0
  90. package/es/dropdown-menu/index.js +132 -0
  91. package/es/dropdown-menu/index.less +77 -0
  92. package/es/dropdown-menu/style/index.js +2 -0
  93. package/es/dropdown-menu/style/less.js +2 -0
  94. package/es/empty/Network.js +193 -0
  95. package/es/empty/index.css +1 -0
  96. package/es/empty/index.js +81 -0
  97. package/es/empty/index.less +32 -0
  98. package/es/empty/style/index.js +2 -0
  99. package/es/empty/style/less.js +2 -0
  100. package/es/field/index.css +1 -0
  101. package/es/field/index.js +623 -0
  102. package/es/field/index.less +172 -0
  103. package/es/field/style/index.js +5 -0
  104. package/es/field/style/less.js +5 -0
  105. package/es/form/index.js +200 -0
  106. package/es/form/style/index.js +1 -0
  107. package/es/form/style/less.js +1 -0
  108. package/es/goods-action/index.css +1 -0
  109. package/es/goods-action/index.js +24 -0
  110. package/es/goods-action/index.less +19 -0
  111. package/es/goods-action/style/index.js +2 -0
  112. package/es/goods-action/style/less.js +2 -0
  113. package/es/goods-action-button/index.css +1 -0
  114. package/es/goods-action-button/index.js +57 -0
  115. package/es/goods-action-button/index.less +34 -0
  116. package/es/goods-action-button/style/index.js +6 -0
  117. package/es/goods-action-button/style/less.js +6 -0
  118. package/es/icon/index.css +1 -0
  119. package/es/icon/index.js +74 -0
  120. package/es/icon/index.less +11 -0
  121. package/es/icon/local.css +1 -0
  122. package/es/icon/local.less +1 -0
  123. package/es/icon/style/index.js +3 -0
  124. package/es/icon/style/less.js +3 -0
  125. package/es/image/index.css +1 -0
  126. package/es/image/index.js +189 -0
  127. package/es/image/index.less +47 -0
  128. package/es/image/style/index.js +4 -0
  129. package/es/image/style/less.js +4 -0
  130. package/es/image-preview/ImagePreview.js +234 -0
  131. package/es/image-preview/ImagePreviewItem.js +242 -0
  132. package/es/image-preview/index.css +1 -0
  133. package/es/image-preview/index.js +86 -0
  134. package/es/image-preview/index.less +103 -0
  135. package/es/image-preview/shared.js +7 -0
  136. package/es/image-preview/style/index.js +10 -0
  137. package/es/image-preview/style/less.js +10 -0
  138. package/es/index-anchor/index.css +1 -0
  139. package/es/index-anchor/index.js +83 -0
  140. package/es/index-anchor/index.less +21 -0
  141. package/es/index-anchor/style/index.js +2 -0
  142. package/es/index-anchor/style/less.js +2 -0
  143. package/es/index-bar/index.css +1 -0
  144. package/es/index-bar/index.js +222 -0
  145. package/es/index-bar/index.less +27 -0
  146. package/es/index-bar/style/index.js +2 -0
  147. package/es/index-bar/style/less.js +2 -0
  148. package/es/index.js +80 -0
  149. package/es/info/index.css +1 -0
  150. package/es/info/index.js +30 -0
  151. package/es/info/index.less +29 -0
  152. package/es/info/style/index.js +2 -0
  153. package/es/info/style/less.js +2 -0
  154. package/es/lazyload/index.js +2 -0
  155. package/es/lazyload/style/index.js +1 -0
  156. package/es/lazyload/style/less.js +1 -0
  157. package/es/list/index.css +1 -0
  158. package/es/list/index.js +178 -0
  159. package/es/list/index.less +21 -0
  160. package/es/list/style/index.js +3 -0
  161. package/es/list/style/less.js +3 -0
  162. package/es/loading/index.css +1 -0
  163. package/es/loading/index.js +86 -0
  164. package/es/loading/index.less +103 -0
  165. package/es/loading/style/index.js +2 -0
  166. package/es/loading/style/less.js +2 -0
  167. package/es/locale/index.js +27 -0
  168. package/es/locale/lang/de-DE-formal.js +90 -0
  169. package/es/locale/lang/de-DE.js +90 -0
  170. package/es/locale/lang/en-US.js +90 -0
  171. package/es/locale/lang/es-ES.js +90 -0
  172. package/es/locale/lang/ja-JP.js +91 -0
  173. package/es/locale/lang/nb-NO.js +90 -0
  174. package/es/locale/lang/ro-RO.js +90 -0
  175. package/es/locale/lang/tr-TR.js +90 -0
  176. package/es/locale/lang/zh-CN.js +91 -0
  177. package/es/locale/lang/zh-HK.js +91 -0
  178. package/es/locale/lang/zh-TW.js +91 -0
  179. package/es/locale/style/index.js +1 -0
  180. package/es/locale/style/less.js +1 -0
  181. package/es/mixins/bind-event.js +29 -0
  182. package/es/mixins/checkbox.js +139 -0
  183. package/es/mixins/click-outside.js +33 -0
  184. package/es/mixins/close-on-popstate.js +38 -0
  185. package/es/mixins/field.js +24 -0
  186. package/es/mixins/popup/context.js +10 -0
  187. package/es/mixins/popup/index.js +208 -0
  188. package/es/mixins/popup/overlay.js +76 -0
  189. package/es/mixins/popup/type.js +0 -0
  190. package/es/mixins/portal.js +48 -0
  191. package/es/mixins/relation.js +76 -0
  192. package/es/mixins/slots.js +23 -0
  193. package/es/mixins/touch.js +58 -0
  194. package/es/nav-bar/index.css +1 -0
  195. package/es/nav-bar/index.js +124 -0
  196. package/es/nav-bar/index.less +77 -0
  197. package/es/nav-bar/style/index.js +4 -0
  198. package/es/nav-bar/style/less.js +4 -0
  199. package/es/number-keyboard/CollapseIcon.js +16 -0
  200. package/es/number-keyboard/DeleteIcon.js +16 -0
  201. package/es/number-keyboard/Key.js +121 -0
  202. package/es/number-keyboard/index.css +1 -0
  203. package/es/number-keyboard/index.js +409 -0
  204. package/es/number-keyboard/index.less +191 -0
  205. package/es/number-keyboard/style/index.js +3 -0
  206. package/es/number-keyboard/style/less.js +3 -0
  207. package/es/overlay/index.css +1 -0
  208. package/es/overlay/index.js +53 -0
  209. package/es/overlay/index.less +11 -0
  210. package/es/overlay/style/index.js +2 -0
  211. package/es/overlay/style/less.js +2 -0
  212. package/es/password-input/index.css +1 -0
  213. package/es/password-input/index.js +84 -0
  214. package/es/password-input/index.less +83 -0
  215. package/es/password-input/style/index.js +2 -0
  216. package/es/password-input/style/less.js +2 -0
  217. package/es/picker/PickerColumn.js +300 -0
  218. package/es/picker/index.css +1 -0
  219. package/es/picker/index.js +383 -0
  220. package/es/picker/index.less +118 -0
  221. package/es/picker/shared.js +22 -0
  222. package/es/picker/style/index.js +3 -0
  223. package/es/picker/style/less.js +3 -0
  224. package/es/popover/index.css +1 -0
  225. package/es/popover/index.js +211 -0
  226. package/es/popover/index.less +270 -0
  227. package/es/popover/style/index.js +6 -0
  228. package/es/popover/style/less.js +6 -0
  229. package/es/popup/index.css +1 -0
  230. package/es/popup/index.js +111 -0
  231. package/es/popup/index.less +140 -0
  232. package/es/popup/style/index.js +5 -0
  233. package/es/popup/style/less.js +5 -0
  234. package/es/pull-refresh/index.css +1 -0
  235. package/es/pull-refresh/index.js +213 -0
  236. package/es/pull-refresh/index.less +25 -0
  237. package/es/pull-refresh/style/index.js +3 -0
  238. package/es/pull-refresh/style/less.js +3 -0
  239. package/es/radio/index.css +1 -0
  240. package/es/radio/index.js +32 -0
  241. package/es/radio/index.less +86 -0
  242. package/es/radio/style/index.js +4 -0
  243. package/es/radio/style/less.js +4 -0
  244. package/es/radio-group/index.css +1 -0
  245. package/es/radio-group/index.js +32 -0
  246. package/es/radio-group/index.less +8 -0
  247. package/es/radio-group/style/index.js +2 -0
  248. package/es/radio-group/style/less.js +2 -0
  249. package/es/rate/index.css +1 -0
  250. package/es/rate/index.js +227 -0
  251. package/es/rate/index.less +46 -0
  252. package/es/rate/style/index.js +4 -0
  253. package/es/rate/style/less.js +4 -0
  254. package/es/search/index.css +1 -0
  255. package/es/search/index.js +114 -0
  256. package/es/search/index.less +68 -0
  257. package/es/search/style/index.js +6 -0
  258. package/es/search/style/less.js +6 -0
  259. package/es/slider/index.css +1 -0
  260. package/es/slider/index.js +289 -0
  261. package/es/slider/index.less +94 -0
  262. package/es/slider/style/index.js +2 -0
  263. package/es/slider/style/less.js +2 -0
  264. package/es/step/index.css +1 -0
  265. package/es/step/index.js +115 -0
  266. package/es/step/index.less +151 -0
  267. package/es/step/style/index.js +4 -0
  268. package/es/step/style/less.js +4 -0
  269. package/es/stepper/index.css +1 -0
  270. package/es/stepper/index.js +355 -0
  271. package/es/stepper/index.less +129 -0
  272. package/es/stepper/style/index.js +2 -0
  273. package/es/stepper/style/less.js +2 -0
  274. package/es/steps/index.css +1 -0
  275. package/es/steps/index.js +35 -0
  276. package/es/steps/index.less +21 -0
  277. package/es/steps/style/index.js +2 -0
  278. package/es/steps/style/less.js +2 -0
  279. package/es/sticky/index.css +1 -0
  280. package/es/sticky/index.js +146 -0
  281. package/es/sticky/index.less +11 -0
  282. package/es/sticky/style/index.js +2 -0
  283. package/es/sticky/style/less.js +2 -0
  284. package/es/style/animation.css +1 -0
  285. package/es/style/animation.less +139 -0
  286. package/es/style/base.css +1 -0
  287. package/es/style/base.less +10 -0
  288. package/es/style/clearfix.css +1 -0
  289. package/es/style/clearfix.less +5 -0
  290. package/es/style/ellipsis.css +1 -0
  291. package/es/style/ellipsis.less +13 -0
  292. package/es/style/hairline.css +1 -0
  293. package/es/style/hairline.less +47 -0
  294. package/es/style/iconfont.css +1 -0
  295. package/es/style/iconfont.less +910 -0
  296. package/es/style/mixins/clearfix.css +0 -0
  297. package/es/style/mixins/clearfix.less +7 -0
  298. package/es/style/mixins/ellipsis.css +0 -0
  299. package/es/style/mixins/ellipsis.less +15 -0
  300. package/es/style/mixins/hairline.css +0 -0
  301. package/es/style/mixins/hairline.less +39 -0
  302. package/es/style/normalize.css +1 -0
  303. package/es/style/normalize.less +38 -0
  304. package/es/style/reset.css +1 -0
  305. package/es/style/reset.less +171 -0
  306. package/es/style/var.css +0 -0
  307. package/es/style/var.less +983 -0
  308. package/es/swipe/index.css +1 -0
  309. package/es/swipe/index.js +429 -0
  310. package/es/swipe/index.less +56 -0
  311. package/es/swipe/style/index.js +2 -0
  312. package/es/swipe/style/less.js +2 -0
  313. package/es/swipe-item/index.css +1 -0
  314. package/es/swipe-item/index.js +78 -0
  315. package/es/swipe-item/index.less +8 -0
  316. package/es/swipe-item/style/index.js +2 -0
  317. package/es/swipe-item/style/less.js +2 -0
  318. package/es/switch/index.css +1 -0
  319. package/es/switch/index.js +74 -0
  320. package/es/switch/index.less +57 -0
  321. package/es/switch/shared.js +19 -0
  322. package/es/switch/style/index.js +3 -0
  323. package/es/switch/style/less.js +3 -0
  324. package/es/tab/index.css +1 -0
  325. package/es/tab/index.js +102 -0
  326. package/es/tab/index.less +24 -0
  327. package/es/tab/style/index.js +2 -0
  328. package/es/tab/style/less.js +2 -0
  329. package/es/tabs/Content.js +78 -0
  330. package/es/tabs/Title.js +92 -0
  331. package/es/tabs/index.css +1 -0
  332. package/es/tabs/index.js +419 -0
  333. package/es/tabs/index.less +153 -0
  334. package/es/tabs/style/index.js +4 -0
  335. package/es/tabs/style/less.js +4 -0
  336. package/es/tabs/utils.js +43 -0
  337. package/es/tag/index.css +1 -0
  338. package/es/tag/index.js +74 -0
  339. package/es/tag/index.less +97 -0
  340. package/es/tag/style/index.js +4 -0
  341. package/es/tag/style/less.js +4 -0
  342. package/es/toast/Toast.js +155 -0
  343. package/es/toast/index.css +1 -0
  344. package/es/toast/index.js +189 -0
  345. package/es/toast/index.less +76 -0
  346. package/es/toast/lock-click.js +16 -0
  347. package/es/toast/style/index.js +7 -0
  348. package/es/toast/style/less.js +7 -0
  349. package/es/types/address-edit.d.js +11 -0
  350. package/es/types/area.d.js +11 -0
  351. package/es/types/calendar.d.js +11 -0
  352. package/es/types/checkbox-group.d.js +11 -0
  353. package/es/types/checkbox.d.js +11 -0
  354. package/es/types/collapse-item.d.js +11 -0
  355. package/es/types/component.d.js +11 -0
  356. package/es/types/count-down.d.js +11 -0
  357. package/es/types/datetime-picker.d.js +11 -0
  358. package/es/types/dialog.d.js +1 -0
  359. package/es/types/dropdown-item.d.js +11 -0
  360. package/es/types/field.d.js +11 -0
  361. package/es/types/form.d.js +11 -0
  362. package/es/types/image-preview.d.js +12 -0
  363. package/es/types/index-bar.d.js +11 -0
  364. package/es/types/index.d.js +590 -0
  365. package/es/types/jsx.d.js +0 -0
  366. package/es/types/lazyload.d.js +1 -0
  367. package/es/types/list.d.js +11 -0
  368. package/es/types/locale.d.js +1 -0
  369. package/es/types/mixins/popup.d.js +1 -0
  370. package/es/types/notify.d.js +2 -0
  371. package/es/types/picker.d.js +11 -0
  372. package/es/types/progress.d.js +11 -0
  373. package/es/types/sku.d.js +11 -0
  374. package/es/types/swipe-cell.d.js +11 -0
  375. package/es/types/swipe.d.js +11 -0
  376. package/es/types/tabs.d.js +11 -0
  377. package/es/types/toast.d.js +2 -0
  378. package/es/types/uploader.d.js +11 -0
  379. package/es/uploader/index.css +1 -0
  380. package/es/uploader/index.js +451 -0
  381. package/es/uploader/index.less +159 -0
  382. package/es/uploader/style/index.js +11 -0
  383. package/es/uploader/style/less.js +11 -0
  384. package/es/uploader/utils.js +57 -0
  385. package/es/utils/constant.js +10 -0
  386. package/es/utils/create/bem.js +39 -0
  387. package/es/utils/create/component.js +57 -0
  388. package/es/utils/create/i18n.js +16 -0
  389. package/es/utils/create/index.js +7 -0
  390. package/es/utils/deep-assign.js +24 -0
  391. package/es/utils/deep-clone.js +14 -0
  392. package/es/utils/dom/event.js +48 -0
  393. package/es/utils/dom/node.js +7 -0
  394. package/es/utils/dom/raf.js +36 -0
  395. package/es/utils/dom/reset-scroll.js +14 -0
  396. package/es/utils/dom/scroll.js +69 -0
  397. package/es/utils/dom/style.js +9 -0
  398. package/es/utils/format/number.js +47 -0
  399. package/es/utils/format/string.js +19 -0
  400. package/es/utils/format/unit.js +59 -0
  401. package/es/utils/functional.js +56 -0
  402. package/es/utils/index.js +29 -0
  403. package/es/utils/interceptor.js +22 -0
  404. package/es/utils/router.js +36 -0
  405. package/es/utils/types.js +0 -0
  406. package/es/utils/validate/date.js +4 -0
  407. package/es/utils/validate/email.js +5 -0
  408. package/es/utils/validate/mobile.js +4 -0
  409. package/es/utils/validate/number.js +11 -0
  410. package/es/utils/validate/system.js +9 -0
  411. package/es/utils/vnodes.js +36 -0
  412. package/lib/action-sheet/index.css +1 -0
  413. package/lib/action-sheet/index.js +194 -0
  414. package/lib/action-sheet/index.less +112 -0
  415. package/lib/action-sheet/style/index.js +7 -0
  416. package/lib/action-sheet/style/less.js +7 -0
  417. package/lib/area/index.js +331 -0
  418. package/lib/area/style/index.js +3 -0
  419. package/lib/area/style/less.js +3 -0
  420. package/lib/button/index.css +1 -0
  421. package/lib/button/index.js +188 -0
  422. package/lib/button/index.less +238 -0
  423. package/lib/button/style/index.js +5 -0
  424. package/lib/button/style/less.js +5 -0
  425. package/lib/calendar/components/Header.js +63 -0
  426. package/lib/calendar/components/Month.js +336 -0
  427. package/lib/calendar/index.css +1 -0
  428. package/lib/calendar/index.js +557 -0
  429. package/lib/calendar/index.less +210 -0
  430. package/lib/calendar/style/index.js +9 -0
  431. package/lib/calendar/style/less.js +9 -0
  432. package/lib/calendar/utils.js +91 -0
  433. package/lib/cell/index.css +1 -0
  434. package/lib/cell/index.js +137 -0
  435. package/lib/cell/index.less +103 -0
  436. package/lib/cell/shared.js +29 -0
  437. package/lib/cell/style/index.js +4 -0
  438. package/lib/cell/style/less.js +4 -0
  439. package/lib/cell-group/index.css +1 -0
  440. package/lib/cell-group/index.js +47 -0
  441. package/lib/cell-group/index.less +12 -0
  442. package/lib/cell-group/style/index.js +2 -0
  443. package/lib/cell-group/style/less.js +2 -0
  444. package/lib/checkbox/index.css +1 -0
  445. package/lib/checkbox/index.js +88 -0
  446. package/lib/checkbox/index.less +85 -0
  447. package/lib/checkbox/style/index.js +4 -0
  448. package/lib/checkbox/style/less.js +4 -0
  449. package/lib/checkbox-group/index.css +1 -0
  450. package/lib/checkbox-group/index.js +73 -0
  451. package/lib/checkbox-group/index.less +8 -0
  452. package/lib/checkbox-group/style/index.js +2 -0
  453. package/lib/checkbox-group/style/less.js +2 -0
  454. package/lib/collapse/index.js +48 -0
  455. package/lib/collapse/style/index.js +1 -0
  456. package/lib/collapse/style/less.js +1 -0
  457. package/lib/collapse-item/index.css +1 -0
  458. package/lib/collapse-item/index.js +213 -0
  459. package/lib/collapse-item/index.less +67 -0
  460. package/lib/collapse-item/style/index.js +5 -0
  461. package/lib/collapse-item/style/less.js +5 -0
  462. package/lib/contact-card/index.css +1 -0
  463. package/lib/contact-card/index.js +72 -0
  464. package/lib/contact-card/index.less +42 -0
  465. package/lib/contact-card/style/index.js +5 -0
  466. package/lib/contact-card/style/less.js +5 -0
  467. package/lib/contact-edit/index.css +1 -0
  468. package/lib/contact-edit/index.js +210 -0
  469. package/lib/contact-edit/index.less +30 -0
  470. package/lib/contact-edit/style/index.js +14 -0
  471. package/lib/contact-edit/style/less.js +14 -0
  472. package/lib/contact-list/index.css +1 -0
  473. package/lib/contact-list/index.js +138 -0
  474. package/lib/contact-list/index.less +54 -0
  475. package/lib/contact-list/style/index.js +10 -0
  476. package/lib/contact-list/style/less.js +10 -0
  477. package/lib/datetime-picker/DatePicker.js +261 -0
  478. package/lib/datetime-picker/TimePicker.js +117 -0
  479. package/lib/datetime-picker/index.js +41 -0
  480. package/lib/datetime-picker/shared.js +124 -0
  481. package/lib/datetime-picker/style/index.js +3 -0
  482. package/lib/datetime-picker/style/less.js +3 -0
  483. package/lib/datetime-picker/utils.js +39 -0
  484. package/lib/demo-button/index-sfc.css +1 -0
  485. package/lib/demo-button/index-sfc.less +9 -0
  486. package/lib/demo-button/index.js +33 -0
  487. package/lib/demo-button/style/index.js +1 -0
  488. package/lib/demo-button/style/less.js +1 -0
  489. package/lib/dialog/Dialog.js +261 -0
  490. package/lib/dialog/index.css +1 -0
  491. package/lib/dialog/index.js +116 -0
  492. package/lib/dialog/index.less +153 -0
  493. package/lib/dialog/style/index.js +10 -0
  494. package/lib/dialog/style/less.js +10 -0
  495. package/lib/dropdown-item/index.css +1 -0
  496. package/lib/dropdown-item/index.js +225 -0
  497. package/lib/dropdown-item/index.less +39 -0
  498. package/lib/dropdown-item/style/index.js +7 -0
  499. package/lib/dropdown-item/style/less.js +7 -0
  500. package/lib/dropdown-menu/index.css +1 -0
  501. package/lib/dropdown-menu/index.js +142 -0
  502. package/lib/dropdown-menu/index.less +77 -0
  503. package/lib/dropdown-menu/style/index.js +2 -0
  504. package/lib/dropdown-menu/style/less.js +2 -0
  505. package/lib/empty/Network.js +198 -0
  506. package/lib/empty/index.css +1 -0
  507. package/lib/empty/index.js +92 -0
  508. package/lib/empty/index.less +32 -0
  509. package/lib/empty/style/index.js +2 -0
  510. package/lib/empty/style/less.js +2 -0
  511. package/lib/field/index.css +1 -0
  512. package/lib/field/index.js +639 -0
  513. package/lib/field/index.less +172 -0
  514. package/lib/field/style/index.js +5 -0
  515. package/lib/field/style/less.js +5 -0
  516. package/lib/form/index.js +208 -0
  517. package/lib/form/style/index.js +1 -0
  518. package/lib/form/style/less.js +1 -0
  519. package/lib/goods-action/index.css +1 -0
  520. package/lib/goods-action/index.js +32 -0
  521. package/lib/goods-action/index.less +19 -0
  522. package/lib/goods-action/style/index.js +2 -0
  523. package/lib/goods-action/style/less.js +2 -0
  524. package/lib/goods-action-button/index.css +1 -0
  525. package/lib/goods-action-button/index.js +70 -0
  526. package/lib/goods-action-button/index.less +34 -0
  527. package/lib/goods-action-button/style/index.js +6 -0
  528. package/lib/goods-action-button/style/less.js +6 -0
  529. package/lib/icon/index.css +1 -0
  530. package/lib/icon/index.js +87 -0
  531. package/lib/icon/index.less +11 -0
  532. package/lib/icon/local.css +1 -0
  533. package/lib/icon/local.less +1 -0
  534. package/lib/icon/style/index.js +3 -0
  535. package/lib/icon/style/less.js +3 -0
  536. package/lib/image/index.css +1 -0
  537. package/lib/image/index.js +199 -0
  538. package/lib/image/index.less +47 -0
  539. package/lib/image/style/index.js +4 -0
  540. package/lib/image/style/less.js +4 -0
  541. package/lib/image-preview/ImagePreview.js +250 -0
  542. package/lib/image-preview/ImagePreviewItem.js +256 -0
  543. package/lib/image-preview/index.css +1 -0
  544. package/lib/image-preview/index.js +96 -0
  545. package/lib/image-preview/index.less +103 -0
  546. package/lib/image-preview/shared.js +13 -0
  547. package/lib/image-preview/style/index.js +10 -0
  548. package/lib/image-preview/style/less.js +10 -0
  549. package/lib/index-anchor/index.css +1 -0
  550. package/lib/index-anchor/index.js +93 -0
  551. package/lib/index-anchor/index.less +21 -0
  552. package/lib/index-anchor/style/index.js +2 -0
  553. package/lib/index-anchor/style/less.js +2 -0
  554. package/lib/index-bar/index.css +1 -0
  555. package/lib/index-bar/index.js +235 -0
  556. package/lib/index-bar/index.less +27 -0
  557. package/lib/index-bar/style/index.js +2 -0
  558. package/lib/index-bar/style/less.js +2 -0
  559. package/lib/index.css +1 -0
  560. package/lib/index.js +262 -0
  561. package/lib/index.less +52 -0
  562. package/lib/info/index.css +1 -0
  563. package/lib/info/index.js +42 -0
  564. package/lib/info/index.less +29 -0
  565. package/lib/info/style/index.js +2 -0
  566. package/lib/info/style/less.js +2 -0
  567. package/lib/lazyload/index.js +11 -0
  568. package/lib/lazyload/style/index.js +1 -0
  569. package/lib/lazyload/style/less.js +1 -0
  570. package/lib/list/index.css +1 -0
  571. package/lib/list/index.js +191 -0
  572. package/lib/list/index.less +21 -0
  573. package/lib/list/style/index.js +3 -0
  574. package/lib/list/style/less.js +3 -0
  575. package/lib/loading/index.css +1 -0
  576. package/lib/loading/index.js +98 -0
  577. package/lib/loading/index.less +103 -0
  578. package/lib/loading/style/index.js +2 -0
  579. package/lib/loading/style/less.js +2 -0
  580. package/lib/locale/index.js +38 -0
  581. package/lib/locale/lang/de-DE-formal.js +95 -0
  582. package/lib/locale/lang/de-DE.js +95 -0
  583. package/lib/locale/lang/en-US.js +95 -0
  584. package/lib/locale/lang/es-ES.js +95 -0
  585. package/lib/locale/lang/ja-JP.js +96 -0
  586. package/lib/locale/lang/nb-NO.js +95 -0
  587. package/lib/locale/lang/ro-RO.js +95 -0
  588. package/lib/locale/lang/tr-TR.js +95 -0
  589. package/lib/locale/lang/zh-CN.js +96 -0
  590. package/lib/locale/lang/zh-HK.js +96 -0
  591. package/lib/locale/lang/zh-TW.js +96 -0
  592. package/lib/locale/style/index.js +1 -0
  593. package/lib/locale/style/less.js +1 -0
  594. package/lib/mixins/bind-event.js +36 -0
  595. package/lib/mixins/checkbox.js +152 -0
  596. package/lib/mixins/click-outside.js +41 -0
  597. package/lib/mixins/close-on-popstate.js +46 -0
  598. package/lib/mixins/field.js +29 -0
  599. package/lib/mixins/popup/context.js +15 -0
  600. package/lib/mixins/popup/index.js +224 -0
  601. package/lib/mixins/popup/overlay.js +95 -0
  602. package/lib/mixins/popup/type.js +1 -0
  603. package/lib/mixins/portal.js +53 -0
  604. package/lib/mixins/relation.js +84 -0
  605. package/lib/mixins/slots.js +29 -0
  606. package/lib/mixins/touch.js +65 -0
  607. package/lib/nav-bar/index.css +1 -0
  608. package/lib/nav-bar/index.js +135 -0
  609. package/lib/nav-bar/index.less +77 -0
  610. package/lib/nav-bar/style/index.js +4 -0
  611. package/lib/nav-bar/style/less.js +4 -0
  612. package/lib/number-keyboard/CollapseIcon.js +21 -0
  613. package/lib/number-keyboard/DeleteIcon.js +21 -0
  614. package/lib/number-keyboard/Key.js +134 -0
  615. package/lib/number-keyboard/index.css +1 -0
  616. package/lib/number-keyboard/index.js +423 -0
  617. package/lib/number-keyboard/index.less +191 -0
  618. package/lib/number-keyboard/style/index.js +3 -0
  619. package/lib/number-keyboard/style/less.js +3 -0
  620. package/lib/overlay/index.css +1 -0
  621. package/lib/overlay/index.js +67 -0
  622. package/lib/overlay/index.less +11 -0
  623. package/lib/overlay/style/index.js +2 -0
  624. package/lib/overlay/style/less.js +2 -0
  625. package/lib/password-input/index.css +1 -0
  626. package/lib/password-input/index.js +97 -0
  627. package/lib/password-input/index.less +83 -0
  628. package/lib/password-input/style/index.js +2 -0
  629. package/lib/password-input/style/less.js +2 -0
  630. package/lib/picker/PickerColumn.js +314 -0
  631. package/lib/picker/index.css +1 -0
  632. package/lib/picker/index.js +399 -0
  633. package/lib/picker/index.less +118 -0
  634. package/lib/picker/shared.js +28 -0
  635. package/lib/picker/style/index.js +3 -0
  636. package/lib/picker/style/less.js +3 -0
  637. package/lib/popover/index.css +1 -0
  638. package/lib/popover/index.js +226 -0
  639. package/lib/popover/index.less +270 -0
  640. package/lib/popover/style/index.js +6 -0
  641. package/lib/popover/style/less.js +6 -0
  642. package/lib/popup/index.css +1 -0
  643. package/lib/popup/index.js +122 -0
  644. package/lib/popup/index.less +140 -0
  645. package/lib/popup/style/index.js +5 -0
  646. package/lib/popup/style/less.js +5 -0
  647. package/lib/pull-refresh/index.css +1 -0
  648. package/lib/pull-refresh/index.js +227 -0
  649. package/lib/pull-refresh/index.less +25 -0
  650. package/lib/pull-refresh/style/index.js +3 -0
  651. package/lib/pull-refresh/style/less.js +3 -0
  652. package/lib/radio/index.css +1 -0
  653. package/lib/radio/index.js +40 -0
  654. package/lib/radio/index.less +86 -0
  655. package/lib/radio/style/index.js +4 -0
  656. package/lib/radio/style/less.js +4 -0
  657. package/lib/radio-group/index.css +1 -0
  658. package/lib/radio-group/index.js +41 -0
  659. package/lib/radio-group/index.less +8 -0
  660. package/lib/radio-group/style/index.js +2 -0
  661. package/lib/radio-group/style/less.js +2 -0
  662. package/lib/rate/index.css +1 -0
  663. package/lib/rate/index.js +240 -0
  664. package/lib/rate/index.less +46 -0
  665. package/lib/rate/style/index.js +4 -0
  666. package/lib/rate/style/less.js +4 -0
  667. package/lib/search/index.css +1 -0
  668. package/lib/search/index.js +128 -0
  669. package/lib/search/index.less +68 -0
  670. package/lib/search/style/index.js +6 -0
  671. package/lib/search/style/less.js +6 -0
  672. package/lib/slider/index.css +1 -0
  673. package/lib/slider/index.js +300 -0
  674. package/lib/slider/index.less +94 -0
  675. package/lib/slider/style/index.js +2 -0
  676. package/lib/slider/style/less.js +2 -0
  677. package/lib/step/index.css +1 -0
  678. package/lib/step/index.js +127 -0
  679. package/lib/step/index.less +151 -0
  680. package/lib/step/style/index.js +4 -0
  681. package/lib/step/style/less.js +4 -0
  682. package/lib/stepper/index.css +1 -0
  683. package/lib/stepper/index.js +369 -0
  684. package/lib/stepper/index.less +129 -0
  685. package/lib/stepper/style/index.js +2 -0
  686. package/lib/stepper/style/less.js +2 -0
  687. package/lib/steps/index.css +1 -0
  688. package/lib/steps/index.js +43 -0
  689. package/lib/steps/index.less +21 -0
  690. package/lib/steps/style/index.js +2 -0
  691. package/lib/steps/style/less.js +2 -0
  692. package/lib/sticky/index.css +1 -0
  693. package/lib/sticky/index.js +157 -0
  694. package/lib/sticky/index.less +11 -0
  695. package/lib/sticky/style/index.js +2 -0
  696. package/lib/sticky/style/less.js +2 -0
  697. package/lib/style/animation.css +1 -0
  698. package/lib/style/animation.less +139 -0
  699. package/lib/style/base.css +1 -0
  700. package/lib/style/base.less +10 -0
  701. package/lib/style/clearfix.css +1 -0
  702. package/lib/style/clearfix.less +5 -0
  703. package/lib/style/ellipsis.css +1 -0
  704. package/lib/style/ellipsis.less +13 -0
  705. package/lib/style/hairline.css +1 -0
  706. package/lib/style/hairline.less +47 -0
  707. package/lib/style/iconfont.css +1 -0
  708. package/lib/style/iconfont.less +910 -0
  709. package/lib/style/mixins/clearfix.css +0 -0
  710. package/lib/style/mixins/clearfix.less +7 -0
  711. package/lib/style/mixins/ellipsis.css +0 -0
  712. package/lib/style/mixins/ellipsis.less +15 -0
  713. package/lib/style/mixins/hairline.css +0 -0
  714. package/lib/style/mixins/hairline.less +39 -0
  715. package/lib/style/normalize.css +1 -0
  716. package/lib/style/normalize.less +38 -0
  717. package/lib/style/reset.css +1 -0
  718. package/lib/style/reset.less +171 -0
  719. package/lib/style/var.css +0 -0
  720. package/lib/style/var.less +983 -0
  721. package/lib/swipe/index.css +1 -0
  722. package/lib/swipe/index.js +443 -0
  723. package/lib/swipe/index.less +56 -0
  724. package/lib/swipe/style/index.js +2 -0
  725. package/lib/swipe/style/less.js +2 -0
  726. package/lib/swipe-item/index.css +1 -0
  727. package/lib/swipe-item/index.js +89 -0
  728. package/lib/swipe-item/index.less +8 -0
  729. package/lib/swipe-item/style/index.js +2 -0
  730. package/lib/swipe-item/style/less.js +2 -0
  731. package/lib/switch/index.css +1 -0
  732. package/lib/switch/index.js +86 -0
  733. package/lib/switch/index.less +57 -0
  734. package/lib/switch/shared.js +25 -0
  735. package/lib/switch/style/index.js +3 -0
  736. package/lib/switch/style/less.js +3 -0
  737. package/lib/tab/index.css +1 -0
  738. package/lib/tab/index.js +114 -0
  739. package/lib/tab/index.less +24 -0
  740. package/lib/tab/style/index.js +2 -0
  741. package/lib/tab/style/less.js +2 -0
  742. package/lib/tabs/Content.js +90 -0
  743. package/lib/tabs/Title.js +102 -0
  744. package/lib/tabs/index.css +1 -0
  745. package/lib/tabs/index.js +441 -0
  746. package/lib/tabs/index.less +153 -0
  747. package/lib/tabs/style/index.js +4 -0
  748. package/lib/tabs/style/less.js +4 -0
  749. package/lib/tabs/utils.js +53 -0
  750. package/lib/tag/index.css +1 -0
  751. package/lib/tag/index.js +87 -0
  752. package/lib/tag/index.less +97 -0
  753. package/lib/tag/style/index.js +4 -0
  754. package/lib/tag/style/less.js +4 -0
  755. package/lib/tlvant.js +16647 -0
  756. package/lib/tlvant.min.js +7 -0
  757. package/lib/toast/Toast.js +168 -0
  758. package/lib/toast/index.css +1 -0
  759. package/lib/toast/index.js +200 -0
  760. package/lib/toast/index.less +76 -0
  761. package/lib/toast/lock-click.js +21 -0
  762. package/lib/toast/style/index.js +7 -0
  763. package/lib/toast/style/less.js +7 -0
  764. package/lib/types/address-edit.d.js +22 -0
  765. package/lib/types/area.d.js +22 -0
  766. package/lib/types/calendar.d.js +22 -0
  767. package/lib/types/checkbox-group.d.js +22 -0
  768. package/lib/types/checkbox.d.js +22 -0
  769. package/lib/types/collapse-item.d.js +22 -0
  770. package/lib/types/component.d.js +22 -0
  771. package/lib/types/count-down.d.js +22 -0
  772. package/lib/types/datetime-picker.d.js +22 -0
  773. package/lib/types/dialog.d.js +6 -0
  774. package/lib/types/dropdown-item.d.js +22 -0
  775. package/lib/types/field.d.js +22 -0
  776. package/lib/types/form.d.js +22 -0
  777. package/lib/types/image-preview.d.js +24 -0
  778. package/lib/types/index-bar.d.js +22 -0
  779. package/lib/types/index.d.js +862 -0
  780. package/lib/types/jsx.d.js +1 -0
  781. package/lib/types/lazyload.d.js +6 -0
  782. package/lib/types/list.d.js +22 -0
  783. package/lib/types/locale.d.js +6 -0
  784. package/lib/types/mixins/popup.d.js +8 -0
  785. package/lib/types/notify.d.js +11 -0
  786. package/lib/types/picker.d.js +22 -0
  787. package/lib/types/progress.d.js +22 -0
  788. package/lib/types/sku.d.js +22 -0
  789. package/lib/types/swipe-cell.d.js +22 -0
  790. package/lib/types/swipe.d.js +22 -0
  791. package/lib/types/tabs.d.js +22 -0
  792. package/lib/types/toast.d.js +11 -0
  793. package/lib/types/uploader.d.js +22 -0
  794. package/lib/uploader/index.css +1 -0
  795. package/lib/uploader/index.js +467 -0
  796. package/lib/uploader/index.less +159 -0
  797. package/lib/uploader/style/index.js +11 -0
  798. package/lib/uploader/style/less.js +11 -0
  799. package/lib/uploader/utils.js +71 -0
  800. package/lib/utils/constant.js +22 -0
  801. package/lib/utils/create/bem.js +44 -0
  802. package/lib/utils/create/component.js +70 -0
  803. package/lib/utils/create/i18n.js +27 -0
  804. package/lib/utils/create/index.js +15 -0
  805. package/lib/utils/deep-assign.js +30 -0
  806. package/lib/utils/deep-clone.js +20 -0
  807. package/lib/utils/dom/event.js +62 -0
  808. package/lib/utils/dom/node.js +12 -0
  809. package/lib/utils/dom/raf.js +47 -0
  810. package/lib/utils/dom/reset-scroll.js +21 -0
  811. package/lib/utils/dom/scroll.js +89 -0
  812. package/lib/utils/dom/style.js +14 -0
  813. package/lib/utils/format/number.js +53 -0
  814. package/lib/utils/format/string.js +26 -0
  815. package/lib/utils/format/unit.js +68 -0
  816. package/lib/utils/functional.js +68 -0
  817. package/lib/utils/index.js +56 -0
  818. package/lib/utils/interceptor.js +28 -0
  819. package/lib/utils/router.js +46 -0
  820. package/lib/utils/types.js +1 -0
  821. package/lib/utils/validate/date.js +10 -0
  822. package/lib/utils/validate/email.js +10 -0
  823. package/lib/utils/validate/mobile.js +9 -0
  824. package/lib/utils/validate/number.js +18 -0
  825. package/lib/utils/validate/system.js +17 -0
  826. package/lib/utils/vnodes.js +41 -0
  827. package/package.json +2 -1
@@ -0,0 +1,246 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { createNamespace } from '../utils';
3
+ import { isDate } from '../utils/validate/date';
4
+ import { padZero } from '../utils/format/string';
5
+ import { getTrueValue, getMonthEndDay } from './utils';
6
+ import { sharedProps, TimePickerMixin } from './shared';
7
+ var currentYear = new Date().getFullYear();
8
+
9
+ var _createNamespace = createNamespace('date-picker'),
10
+ createComponent = _createNamespace[0];
11
+
12
+ export default createComponent({
13
+ mixins: [TimePickerMixin],
14
+ props: _extends({}, sharedProps, {
15
+ type: {
16
+ type: String,
17
+ default: 'datetime'
18
+ },
19
+ minDate: {
20
+ type: Date,
21
+ default: function _default() {
22
+ return new Date(currentYear - 10, 0, 1);
23
+ },
24
+ validator: isDate
25
+ },
26
+ maxDate: {
27
+ type: Date,
28
+ default: function _default() {
29
+ return new Date(currentYear + 10, 11, 31);
30
+ },
31
+ validator: isDate
32
+ }
33
+ }),
34
+ watch: {
35
+ filter: 'updateInnerValue',
36
+ minDate: 'updateInnerValue',
37
+ maxDate: 'updateInnerValue',
38
+ value: function value(val) {
39
+ val = this.formatValue(val);
40
+
41
+ if (val.valueOf() !== this.innerValue.valueOf()) {
42
+ this.innerValue = val;
43
+ }
44
+ }
45
+ },
46
+ computed: {
47
+ ranges: function ranges() {
48
+ var _this$getBoundary = this.getBoundary('max', this.innerValue),
49
+ maxYear = _this$getBoundary.maxYear,
50
+ maxDate = _this$getBoundary.maxDate,
51
+ maxMonth = _this$getBoundary.maxMonth,
52
+ maxHour = _this$getBoundary.maxHour,
53
+ maxMinute = _this$getBoundary.maxMinute;
54
+
55
+ var _this$getBoundary2 = this.getBoundary('min', this.innerValue),
56
+ minYear = _this$getBoundary2.minYear,
57
+ minDate = _this$getBoundary2.minDate,
58
+ minMonth = _this$getBoundary2.minMonth,
59
+ minHour = _this$getBoundary2.minHour,
60
+ minMinute = _this$getBoundary2.minMinute;
61
+
62
+ var result = [{
63
+ type: 'year',
64
+ range: [minYear, maxYear]
65
+ }, {
66
+ type: 'month',
67
+ range: [minMonth, maxMonth]
68
+ }, {
69
+ type: 'day',
70
+ range: [minDate, maxDate]
71
+ }, {
72
+ type: 'hour',
73
+ range: [minHour, maxHour]
74
+ }, {
75
+ type: 'minute',
76
+ range: [minMinute, maxMinute]
77
+ }];
78
+
79
+ switch (this.type) {
80
+ case 'date':
81
+ result = result.slice(0, 3);
82
+ break;
83
+
84
+ case 'year-month':
85
+ result = result.slice(0, 2);
86
+ break;
87
+
88
+ case 'month-day':
89
+ result = result.slice(1, 3);
90
+ break;
91
+
92
+ case 'datehour':
93
+ result = result.slice(0, 4);
94
+ break;
95
+ }
96
+
97
+ if (this.columnsOrder) {
98
+ var columnsOrder = this.columnsOrder.concat(result.map(function (column) {
99
+ return column.type;
100
+ }));
101
+ result.sort(function (a, b) {
102
+ return columnsOrder.indexOf(a.type) - columnsOrder.indexOf(b.type);
103
+ });
104
+ }
105
+
106
+ return result;
107
+ }
108
+ },
109
+ methods: {
110
+ formatValue: function formatValue(value) {
111
+ if (!isDate(value)) {
112
+ value = this.minDate;
113
+ }
114
+
115
+ value = Math.max(value, this.minDate.getTime());
116
+ value = Math.min(value, this.maxDate.getTime());
117
+ return new Date(value);
118
+ },
119
+ getBoundary: function getBoundary(type, value) {
120
+ var _ref;
121
+
122
+ var boundary = this[type + "Date"];
123
+ var year = boundary.getFullYear();
124
+ var month = 1;
125
+ var date = 1;
126
+ var hour = 0;
127
+ var minute = 0;
128
+
129
+ if (type === 'max') {
130
+ month = 12;
131
+ date = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
132
+ hour = 23;
133
+ minute = 59;
134
+ }
135
+
136
+ if (value.getFullYear() === year) {
137
+ month = boundary.getMonth() + 1;
138
+
139
+ if (value.getMonth() + 1 === month) {
140
+ date = boundary.getDate();
141
+
142
+ if (value.getDate() === date) {
143
+ hour = boundary.getHours();
144
+
145
+ if (value.getHours() === hour) {
146
+ minute = boundary.getMinutes();
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+ return _ref = {}, _ref[type + "Year"] = year, _ref[type + "Month"] = month, _ref[type + "Date"] = date, _ref[type + "Hour"] = hour, _ref[type + "Minute"] = minute, _ref;
153
+ },
154
+ updateInnerValue: function updateInnerValue() {
155
+ var _this = this;
156
+
157
+ var type = this.type;
158
+ var indexes = this.getPicker().getIndexes();
159
+
160
+ var getValue = function getValue(type) {
161
+ var index = 0;
162
+
163
+ _this.originColumns.forEach(function (column, columnIndex) {
164
+ if (type === column.type) {
165
+ index = columnIndex;
166
+ }
167
+ });
168
+
169
+ var values = _this.originColumns[index].values;
170
+ return getTrueValue(values[indexes[index]]);
171
+ };
172
+
173
+ var year;
174
+ var month;
175
+ var day;
176
+
177
+ if (type === 'month-day') {
178
+ year = this.innerValue.getFullYear();
179
+ month = getValue('month');
180
+ day = getValue('day');
181
+ } else {
182
+ year = getValue('year');
183
+ month = getValue('month');
184
+ day = type === 'year-month' ? 1 : getValue('day');
185
+ }
186
+
187
+ var maxDay = getMonthEndDay(year, month);
188
+ day = day > maxDay ? maxDay : day;
189
+ var hour = 0;
190
+ var minute = 0;
191
+
192
+ if (type === 'datehour') {
193
+ hour = getValue('hour');
194
+ }
195
+
196
+ if (type === 'datetime') {
197
+ hour = getValue('hour');
198
+ minute = getValue('minute');
199
+ }
200
+
201
+ var value = new Date(year, month - 1, day, hour, minute);
202
+ this.innerValue = this.formatValue(value);
203
+ },
204
+ onChange: function onChange(picker) {
205
+ var _this2 = this;
206
+
207
+ this.updateInnerValue();
208
+ this.$nextTick(function () {
209
+ _this2.$nextTick(function () {
210
+ _this2.$emit('change', picker);
211
+ });
212
+ });
213
+ },
214
+ updateColumnValue: function updateColumnValue() {
215
+ var _this3 = this;
216
+
217
+ var value = this.innerValue;
218
+ var formatter = this.formatter;
219
+ var values = this.originColumns.map(function (column) {
220
+ switch (column.type) {
221
+ case 'year':
222
+ return formatter('year', "" + value.getFullYear());
223
+
224
+ case 'month':
225
+ return formatter('month', padZero(value.getMonth() + 1));
226
+
227
+ case 'day':
228
+ return formatter('day', padZero(value.getDate()));
229
+
230
+ case 'hour':
231
+ return formatter('hour', padZero(value.getHours()));
232
+
233
+ case 'minute':
234
+ return formatter('minute', padZero(value.getMinutes()));
235
+
236
+ default:
237
+ // no default
238
+ return null;
239
+ }
240
+ });
241
+ this.$nextTick(function () {
242
+ _this3.getPicker().setValues(values);
243
+ });
244
+ }
245
+ }
246
+ });
@@ -0,0 +1,104 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { createNamespace } from '../utils';
3
+ import { padZero } from '../utils/format/string';
4
+ import { range } from '../utils/format/number';
5
+ import { sharedProps, TimePickerMixin } from './shared';
6
+
7
+ var _createNamespace = createNamespace('time-picker'),
8
+ createComponent = _createNamespace[0];
9
+
10
+ export default createComponent({
11
+ mixins: [TimePickerMixin],
12
+ props: _extends({}, sharedProps, {
13
+ minHour: {
14
+ type: [Number, String],
15
+ default: 0
16
+ },
17
+ maxHour: {
18
+ type: [Number, String],
19
+ default: 23
20
+ },
21
+ minMinute: {
22
+ type: [Number, String],
23
+ default: 0
24
+ },
25
+ maxMinute: {
26
+ type: [Number, String],
27
+ default: 59
28
+ }
29
+ }),
30
+ computed: {
31
+ ranges: function ranges() {
32
+ return [{
33
+ type: 'hour',
34
+ range: [+this.minHour, +this.maxHour]
35
+ }, {
36
+ type: 'minute',
37
+ range: [+this.minMinute, +this.maxMinute]
38
+ }];
39
+ }
40
+ },
41
+ watch: {
42
+ filter: 'updateInnerValue',
43
+ minHour: 'updateInnerValue',
44
+ maxHour: 'updateInnerValue',
45
+ minMinute: 'updateInnerValue',
46
+ maxMinute: 'updateInnerValue',
47
+ value: function value(val) {
48
+ val = this.formatValue(val);
49
+
50
+ if (val !== this.innerValue) {
51
+ this.innerValue = val;
52
+ this.updateColumnValue();
53
+ }
54
+ }
55
+ },
56
+ methods: {
57
+ formatValue: function formatValue(value) {
58
+ if (!value) {
59
+ value = padZero(this.minHour) + ":" + padZero(this.minMinute);
60
+ }
61
+
62
+ var _value$split = value.split(':'),
63
+ hour = _value$split[0],
64
+ minute = _value$split[1];
65
+
66
+ hour = padZero(range(hour, this.minHour, this.maxHour));
67
+ minute = padZero(range(minute, this.minMinute, this.maxMinute));
68
+ return hour + ":" + minute;
69
+ },
70
+ updateInnerValue: function updateInnerValue() {
71
+ var _this$getPicker$getIn = this.getPicker().getIndexes(),
72
+ hourIndex = _this$getPicker$getIn[0],
73
+ minuteIndex = _this$getPicker$getIn[1];
74
+
75
+ var _this$originColumns = this.originColumns,
76
+ hourColumn = _this$originColumns[0],
77
+ minuteColumn = _this$originColumns[1];
78
+ var hour = hourColumn.values[hourIndex] || hourColumn.values[0];
79
+ var minute = minuteColumn.values[minuteIndex] || minuteColumn.values[0];
80
+ this.innerValue = this.formatValue(hour + ":" + minute);
81
+ this.updateColumnValue();
82
+ },
83
+ onChange: function onChange(picker) {
84
+ var _this = this;
85
+
86
+ this.updateInnerValue();
87
+ this.$nextTick(function () {
88
+ _this.$nextTick(function () {
89
+ _this.$emit('change', picker);
90
+ });
91
+ });
92
+ },
93
+ updateColumnValue: function updateColumnValue() {
94
+ var _this2 = this;
95
+
96
+ var formatter = this.formatter;
97
+ var pair = this.innerValue.split(':');
98
+ var values = [formatter('hour', pair[0]), formatter('minute', pair[1])];
99
+ this.$nextTick(function () {
100
+ _this2.getPicker().setValues(values);
101
+ });
102
+ }
103
+ }
104
+ });
@@ -0,0 +1,29 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { createNamespace } from '../utils';
3
+ import TimePicker from './TimePicker';
4
+ import DatePicker from './DatePicker';
5
+
6
+ var _createNamespace = createNamespace('datetime-picker'),
7
+ createComponent = _createNamespace[0],
8
+ bem = _createNamespace[1];
9
+
10
+ export default createComponent({
11
+ props: _extends({}, TimePicker.props, DatePicker.props),
12
+ methods: {
13
+ // @exposed-api
14
+ getPicker: function getPicker() {
15
+ return this.$refs.root.getPicker();
16
+ }
17
+ },
18
+ render: function render() {
19
+ var h = arguments[0];
20
+ var Component = this.type === 'time' ? TimePicker : DatePicker;
21
+ return h(Component, {
22
+ "ref": "root",
23
+ "class": bem(),
24
+ "scopedSlots": this.$scopedSlots,
25
+ "props": _extends({}, this.$props),
26
+ "on": _extends({}, this.$listeners)
27
+ });
28
+ }
29
+ });
@@ -0,0 +1,110 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { times } from './utils';
3
+ import { padZero } from '../utils/format/string';
4
+ import { pickerProps } from '../picker/shared';
5
+ import Picker from '../picker';
6
+ export var sharedProps = _extends({}, pickerProps, {
7
+ value: null,
8
+ filter: Function,
9
+ columnsOrder: Array,
10
+ showToolbar: {
11
+ type: Boolean,
12
+ default: true
13
+ },
14
+ formatter: {
15
+ type: Function,
16
+ default: function _default(type, value) {
17
+ return value;
18
+ }
19
+ }
20
+ });
21
+ export var TimePickerMixin = {
22
+ data: function data() {
23
+ return {
24
+ innerValue: this.formatValue(this.value)
25
+ };
26
+ },
27
+ computed: {
28
+ originColumns: function originColumns() {
29
+ var _this = this;
30
+
31
+ return this.ranges.map(function (_ref) {
32
+ var type = _ref.type,
33
+ rangeArr = _ref.range;
34
+ var values = times(rangeArr[1] - rangeArr[0] + 1, function (index) {
35
+ var value = padZero(rangeArr[0] + index);
36
+ return value;
37
+ });
38
+
39
+ if (_this.filter) {
40
+ values = _this.filter(type, values);
41
+ }
42
+
43
+ return {
44
+ type: type,
45
+ values: values
46
+ };
47
+ });
48
+ },
49
+ columns: function columns() {
50
+ var _this2 = this;
51
+
52
+ return this.originColumns.map(function (column) {
53
+ return {
54
+ values: column.values.map(function (value) {
55
+ return _this2.formatter(column.type, value);
56
+ })
57
+ };
58
+ });
59
+ }
60
+ },
61
+ watch: {
62
+ columns: 'updateColumnValue',
63
+ innerValue: function innerValue(val) {
64
+ this.$emit('input', val);
65
+ }
66
+ },
67
+ mounted: function mounted() {
68
+ var _this3 = this;
69
+
70
+ this.updateColumnValue();
71
+ this.$nextTick(function () {
72
+ _this3.updateInnerValue();
73
+ });
74
+ },
75
+ methods: {
76
+ // @exposed-api
77
+ getPicker: function getPicker() {
78
+ return this.$refs.picker;
79
+ },
80
+ onConfirm: function onConfirm() {
81
+ this.$emit('confirm', this.innerValue);
82
+ },
83
+ onCancel: function onCancel() {
84
+ this.$emit('cancel');
85
+ }
86
+ },
87
+ render: function render() {
88
+ var _this4 = this;
89
+
90
+ var h = arguments[0];
91
+ var props = {};
92
+ Object.keys(pickerProps).forEach(function (key) {
93
+ props[key] = _this4[key];
94
+ });
95
+ return h(Picker, {
96
+ "ref": "picker",
97
+ "attrs": {
98
+ "columns": this.columns,
99
+ "readonly": this.readonly
100
+ },
101
+ "scopedSlots": this.$scopedSlots,
102
+ "on": {
103
+ "change": this.onChange,
104
+ "confirm": this.onConfirm,
105
+ "cancel": this.onCancel
106
+ },
107
+ "props": _extends({}, props)
108
+ });
109
+ }
110
+ };
@@ -0,0 +1,3 @@
1
+ import '../../style/base.css';
2
+ import '../../loading/index.css';
3
+ import '../../picker/index.css';
@@ -0,0 +1,3 @@
1
+ import '../../style/base.less';
2
+ import '../../loading/index.less';
3
+ import '../../picker/index.less';
@@ -0,0 +1,29 @@
1
+ import { isNaN } from '../utils/validate/number';
2
+ export function times(n, iteratee) {
3
+ var index = -1;
4
+ var result = Array(n);
5
+
6
+ while (++index < n) {
7
+ result[index] = iteratee(index);
8
+ }
9
+
10
+ return result;
11
+ }
12
+ export function getTrueValue(value) {
13
+ if (!value) {
14
+ return 0;
15
+ }
16
+
17
+ while (isNaN(parseInt(value, 10))) {
18
+ if (value.length > 1) {
19
+ value = value.slice(1);
20
+ } else {
21
+ return 0;
22
+ }
23
+ }
24
+
25
+ return parseInt(value, 10);
26
+ }
27
+ export function getMonthEndDay(year, month) {
28
+ return 32 - new Date(year, month - 1, 32).getDate();
29
+ }
@@ -0,0 +1 @@
1
+ .demo-button{min-width:120px;color:#fff;font-size:16px;line-height:36px;border:none;border-radius:30px}
@@ -0,0 +1,9 @@
1
+ .demo-button {
2
+ min-width: 120px;
3
+ color: #fff;
4
+ font-size: 16px;
5
+ line-height: 36px;
6
+ /* background-color: #f44; */
7
+ border: none;
8
+ border-radius: 30px;
9
+ }
@@ -0,0 +1,27 @@
1
+ import './index-sfc.css';
2
+
3
+ var __vue_render__ = function __vue_render__() {
4
+ var _vm = this;
5
+
6
+ var _h = _vm.$createElement;
7
+
8
+ var _c = _vm._self._c || _h;
9
+
10
+ return _c('button', {
11
+ staticClass: "demo-button"
12
+ }, [_vm._t("default")], 2);
13
+ };
14
+
15
+ var __vue_staticRenderFns__ = [];
16
+ export default {
17
+ render: __vue_render__,
18
+ staticRenderFns: __vue_staticRenderFns__,
19
+ name: 'demo-button',
20
+ props: {
21
+ color: String,
22
+ type: {
23
+ type: String,
24
+ default: 'primary'
25
+ }
26
+ }
27
+ };
@@ -0,0 +1 @@
1
+ import '../../style/base.css';
@@ -0,0 +1 @@
1
+ import '../../style/base.less';