@varlet/ui 1.23.3-alpha.1 → 1.23.4-alpha.16

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 (627) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/es/action-sheet/index.js +1 -1
  3. package/es/back-top/BackTop.js +2 -2
  4. package/es/dialog/index.js +1 -1
  5. package/es/image-preview/index.js +1 -1
  6. package/es/index.d.ts +1 -0
  7. package/es/input/Input.js +36 -13
  8. package/es/list/List.js +1 -1
  9. package/es/popup/Popup.js +81 -59
  10. package/es/popup/index.js +1 -1
  11. package/es/popup/style/index.js +0 -1
  12. package/es/popup/style/less.js +0 -1
  13. package/es/pull-refresh/PullRefresh.js +1 -1
  14. package/es/sticky/Sticky.js +1 -1
  15. package/es/utils/components.js +7 -0
  16. package/es/utils/elements.js +2 -2
  17. package/es/utils/shared.js +1 -1
  18. package/highlight/web-types.json +1 -1
  19. package/lib/action-sheet/ActionSheet.js +149 -0
  20. package/{es/popup/PopupSfc.css → lib/action-sheet/ActionSheetSfc.css} +0 -0
  21. package/{es/popup/PopupSfc.less → lib/action-sheet/ActionSheetSfc.less} +0 -0
  22. package/lib/action-sheet/actionSheet.css +1 -0
  23. package/lib/action-sheet/actionSheet.less +68 -0
  24. package/lib/action-sheet/index.js +79 -0
  25. package/lib/action-sheet/props.js +37 -0
  26. package/lib/action-sheet/style/index.js +6 -0
  27. package/lib/action-sheet/style/less.js +6 -0
  28. package/lib/app-bar/AppBar.js +66 -0
  29. package/lib/app-bar/AppBarSfc.css +0 -0
  30. package/lib/app-bar/AppBarSfc.less +0 -0
  31. package/lib/app-bar/appBar.css +1 -0
  32. package/lib/app-bar/appBar.less +56 -0
  33. package/lib/app-bar/index.js +17 -0
  34. package/lib/app-bar/props.js +32 -0
  35. package/lib/app-bar/style/index.js +4 -0
  36. package/lib/app-bar/style/less.js +4 -0
  37. package/lib/back-top/BackTop.js +96 -0
  38. package/lib/back-top/BackTopSfc.css +0 -0
  39. package/lib/back-top/BackTopSfc.less +0 -0
  40. package/lib/back-top/backTop.css +1 -0
  41. package/lib/back-top/backTop.less +27 -0
  42. package/lib/back-top/index.js +17 -0
  43. package/lib/back-top/props.js +21 -0
  44. package/lib/back-top/style/index.js +5 -0
  45. package/lib/back-top/style/less.js +5 -0
  46. package/lib/badge/Badge.js +107 -0
  47. package/lib/badge/BadgeSfc.css +0 -0
  48. package/lib/badge/BadgeSfc.less +0 -0
  49. package/lib/badge/badge.css +1 -0
  50. package/lib/badge/badge.less +119 -0
  51. package/lib/badge/index.js +17 -0
  52. package/lib/badge/props.js +55 -0
  53. package/lib/badge/style/index.js +4 -0
  54. package/lib/badge/style/less.js +4 -0
  55. package/lib/button/Button.js +102 -0
  56. package/lib/button/ButtonSfc.css +0 -0
  57. package/lib/button/ButtonSfc.less +0 -0
  58. package/lib/button/button.css +1 -0
  59. package/lib/button/button.less +183 -0
  60. package/lib/button/index.js +17 -0
  61. package/lib/button/props.js +76 -0
  62. package/lib/button/style/index.js +6 -0
  63. package/lib/button/style/less.js +6 -0
  64. package/lib/card/Card.js +83 -0
  65. package/lib/card/CardSfc.css +0 -0
  66. package/lib/card/CardSfc.less +0 -0
  67. package/lib/card/card.css +1 -0
  68. package/lib/card/card.less +84 -0
  69. package/lib/card/index.js +17 -0
  70. package/lib/card/props.js +45 -0
  71. package/lib/card/style/index.js +5 -0
  72. package/lib/card/style/less.js +5 -0
  73. package/lib/cell/Cell.js +68 -0
  74. package/lib/cell/CellSfc.css +0 -0
  75. package/lib/cell/CellSfc.less +0 -0
  76. package/lib/cell/cell.css +1 -0
  77. package/lib/cell/cell.less +74 -0
  78. package/lib/cell/index.js +17 -0
  79. package/lib/cell/props.js +32 -0
  80. package/lib/cell/style/index.js +4 -0
  81. package/lib/cell/style/less.js +4 -0
  82. package/lib/checkbox/Checkbox.js +232 -0
  83. package/lib/checkbox/CheckboxSfc.css +0 -0
  84. package/lib/checkbox/CheckboxSfc.less +0 -0
  85. package/lib/checkbox/checkbox.css +1 -0
  86. package/lib/checkbox/checkbox.less +78 -0
  87. package/lib/checkbox/index.js +17 -0
  88. package/lib/checkbox/props.js +56 -0
  89. package/lib/checkbox/provide.js +23 -0
  90. package/lib/checkbox/style/index.js +5 -0
  91. package/lib/checkbox/style/less.js +5 -0
  92. package/lib/checkbox-group/CheckboxGroup.js +181 -0
  93. package/lib/checkbox-group/CheckboxGroupSfc.css +0 -0
  94. package/lib/checkbox-group/CheckboxGroupSfc.less +0 -0
  95. package/lib/checkbox-group/checkboxGroup.css +1 -0
  96. package/lib/checkbox-group/checkboxGroup.less +12 -0
  97. package/lib/checkbox-group/index.js +17 -0
  98. package/lib/checkbox-group/props.js +38 -0
  99. package/lib/checkbox-group/provide.js +27 -0
  100. package/lib/checkbox-group/style/index.js +4 -0
  101. package/lib/checkbox-group/style/less.js +4 -0
  102. package/lib/chip/Chip.js +95 -0
  103. package/lib/chip/ChipSfc.css +0 -0
  104. package/lib/chip/ChipSfc.less +0 -0
  105. package/lib/chip/chip.css +1 -0
  106. package/lib/chip/chip.less +182 -0
  107. package/lib/chip/index.js +17 -0
  108. package/lib/chip/props.js +56 -0
  109. package/lib/chip/style/index.js +4 -0
  110. package/lib/chip/style/less.js +4 -0
  111. package/lib/col/Col.js +68 -0
  112. package/lib/col/ColSfc.css +0 -0
  113. package/lib/col/ColSfc.less +0 -0
  114. package/lib/col/col.css +1 -0
  115. package/lib/col/col.less +17 -0
  116. package/lib/col/index.js +17 -0
  117. package/lib/col/props.js +18 -0
  118. package/lib/col/provide.js +28 -0
  119. package/lib/col/style/index.js +3 -0
  120. package/lib/col/style/less.js +3 -0
  121. package/lib/collapse/Collapse.js +126 -0
  122. package/lib/collapse/CollapseSfc.css +1 -0
  123. package/lib/collapse/CollapseSfc.less +1 -0
  124. package/lib/collapse/index.js +17 -0
  125. package/lib/collapse/props.js +24 -0
  126. package/lib/collapse/provide.js +27 -0
  127. package/lib/collapse/style/index.js +3 -0
  128. package/lib/collapse/style/less.js +3 -0
  129. package/lib/collapse-item/CollapseItem.js +155 -0
  130. package/lib/collapse-item/CollapseItemSfc.css +0 -0
  131. package/lib/collapse-item/CollapseItemSfc.less +0 -0
  132. package/lib/collapse-item/collapseItem.css +1 -0
  133. package/lib/collapse-item/collapseItem.less +105 -0
  134. package/lib/collapse-item/index.js +17 -0
  135. package/lib/collapse-item/props.js +21 -0
  136. package/lib/collapse-item/provide.js +28 -0
  137. package/lib/collapse-item/style/index.js +4 -0
  138. package/lib/collapse-item/style/less.js +4 -0
  139. package/lib/context/index.js +20 -0
  140. package/lib/context/lock.js +107 -0
  141. package/lib/context/style/index.js +0 -0
  142. package/lib/context/style/less.js +0 -0
  143. package/lib/context/zIndex.js +25 -0
  144. package/lib/countdown/Countdown.js +119 -0
  145. package/lib/countdown/CountdownSfc.css +0 -0
  146. package/lib/countdown/CountdownSfc.less +0 -0
  147. package/lib/countdown/index.js +17 -0
  148. package/lib/countdown/props.js +25 -0
  149. package/lib/countdown/style/index.js +2 -0
  150. package/lib/countdown/style/less.js +2 -0
  151. package/lib/counter/Counter.js +387 -0
  152. package/lib/counter/CounterSfc.css +0 -0
  153. package/lib/counter/CounterSfc.less +0 -0
  154. package/lib/counter/counter.css +1 -0
  155. package/lib/counter/counter.less +85 -0
  156. package/lib/counter/index.js +17 -0
  157. package/lib/counter/props.js +98 -0
  158. package/lib/counter/provide.js +3 -0
  159. package/lib/counter/style/index.js +7 -0
  160. package/lib/counter/style/less.js +7 -0
  161. package/lib/date-picker/DatePicker.js +469 -0
  162. package/lib/date-picker/DatePickerSfc.css +0 -0
  163. package/lib/date-picker/DatePickerSfc.less +0 -0
  164. package/lib/date-picker/date-picker.css +1 -0
  165. package/lib/date-picker/date-picker.less +330 -0
  166. package/lib/date-picker/index.js +17 -0
  167. package/lib/date-picker/props.js +107 -0
  168. package/lib/date-picker/src/day-picker-panel.js +355 -0
  169. package/lib/date-picker/src/month-picker-panel.js +289 -0
  170. package/lib/date-picker/src/panel-header.js +152 -0
  171. package/lib/date-picker/src/year-picker-panel.js +112 -0
  172. package/lib/date-picker/style/index.js +5 -0
  173. package/lib/date-picker/style/less.js +5 -0
  174. package/lib/dialog/Dialog.js +214 -0
  175. package/lib/dialog/DialogSfc.css +0 -0
  176. package/lib/dialog/DialogSfc.less +0 -0
  177. package/lib/dialog/dialog.css +1 -0
  178. package/lib/dialog/dialog.less +77 -0
  179. package/lib/dialog/index.js +85 -0
  180. package/lib/dialog/props.js +73 -0
  181. package/lib/dialog/style/index.js +5 -0
  182. package/lib/dialog/style/less.js +5 -0
  183. package/lib/divider/Divider.js +88 -0
  184. package/lib/divider/DividerSfc.css +0 -0
  185. package/lib/divider/DividerSfc.less +0 -0
  186. package/lib/divider/divider.css +1 -0
  187. package/lib/divider/divider.less +79 -0
  188. package/lib/divider/index.js +17 -0
  189. package/lib/divider/props.js +25 -0
  190. package/lib/divider/style/index.js +3 -0
  191. package/lib/divider/style/less.js +3 -0
  192. package/lib/form/Form.js +77 -0
  193. package/lib/form/FormSfc.css +0 -0
  194. package/lib/form/FormSfc.less +0 -0
  195. package/lib/form/index.js +17 -0
  196. package/lib/form/props.js +15 -0
  197. package/lib/form/provide.js +33 -0
  198. package/lib/form/style/index.js +2 -0
  199. package/lib/form/style/less.js +2 -0
  200. package/lib/form-details/FormDetails.js +45 -0
  201. package/lib/form-details/FormDetailsSfc.css +0 -0
  202. package/lib/form-details/FormDetailsSfc.less +0 -0
  203. package/lib/form-details/formDetails.css +1 -0
  204. package/lib/form-details/formDetails.less +48 -0
  205. package/lib/form-details/index.js +17 -0
  206. package/lib/form-details/props.js +15 -0
  207. package/lib/form-details/style/index.js +3 -0
  208. package/lib/form-details/style/less.js +3 -0
  209. package/lib/icon/Icon.js +83 -0
  210. package/lib/icon/IconSfc.css +0 -0
  211. package/lib/icon/IconSfc.less +0 -0
  212. package/lib/icon/icon.css +1 -0
  213. package/lib/icon/icon.less +25 -0
  214. package/lib/icon/index.js +17 -0
  215. package/lib/icon/props.js +27 -0
  216. package/lib/icon/style/index.js +3 -0
  217. package/lib/icon/style/less.js +3 -0
  218. package/lib/image/Image.js +113 -0
  219. package/lib/image/ImageSfc.css +0 -0
  220. package/lib/image/ImageSfc.less +0 -0
  221. package/lib/image/image.css +1 -0
  222. package/lib/image/image.less +9 -0
  223. package/lib/image/index.js +17 -0
  224. package/lib/image/props.js +60 -0
  225. package/lib/image/style/index.js +4 -0
  226. package/lib/image/style/less.js +4 -0
  227. package/lib/image-preview/ImagePreview.js +369 -0
  228. package/lib/image-preview/ImagePreviewSfc.css +0 -0
  229. package/lib/image-preview/ImagePreviewSfc.less +0 -0
  230. package/lib/image-preview/imagePreview.css +1 -0
  231. package/lib/image-preview/imagePreview.less +66 -0
  232. package/lib/image-preview/index.js +74 -0
  233. package/lib/image-preview/props.js +40 -0
  234. package/lib/image-preview/style/index.js +7 -0
  235. package/lib/image-preview/style/less.js +7 -0
  236. package/lib/index-anchor/IndexAnchor.js +99 -0
  237. package/lib/index-anchor/IndexAnchorSfc.css +1 -0
  238. package/lib/index-anchor/IndexAnchorSfc.less +1 -0
  239. package/lib/index-anchor/index.js +17 -0
  240. package/lib/index-anchor/props.js +10 -0
  241. package/lib/index-anchor/provide.js +28 -0
  242. package/lib/index-anchor/style/index.js +3 -0
  243. package/lib/index-anchor/style/less.js +3 -0
  244. package/lib/index-bar/IndexBar.js +186 -0
  245. package/lib/index-bar/IndexBarSfc.css +0 -0
  246. package/lib/index-bar/IndexBarSfc.less +0 -0
  247. package/lib/index-bar/index.js +17 -0
  248. package/lib/index-bar/indexBar.css +1 -0
  249. package/lib/index-bar/indexBar.less +43 -0
  250. package/lib/index-bar/props.js +40 -0
  251. package/lib/index-bar/provide.js +27 -0
  252. package/lib/index-bar/style/index.js +3 -0
  253. package/lib/index-bar/style/less.js +3 -0
  254. package/lib/index.d.ts +1 -0
  255. package/lib/index.js +195 -0
  256. package/lib/input/Input.js +327 -0
  257. package/lib/input/InputSfc.css +0 -0
  258. package/lib/input/InputSfc.less +0 -0
  259. package/lib/input/index.js +17 -0
  260. package/lib/input/input.css +1 -0
  261. package/lib/input/input.less +183 -0
  262. package/lib/input/props.js +96 -0
  263. package/lib/input/provide.js +3 -0
  264. package/lib/input/style/index.js +5 -0
  265. package/lib/input/style/less.js +5 -0
  266. package/lib/lazy/index.js +247 -0
  267. package/lib/lazy/style/index.js +0 -0
  268. package/lib/lazy/style/less.js +0 -0
  269. package/lib/less.js +62 -0
  270. package/lib/list/List.js +157 -0
  271. package/lib/list/ListSfc.css +0 -0
  272. package/lib/list/ListSfc.less +0 -0
  273. package/lib/list/index.js +17 -0
  274. package/lib/list/list.css +1 -0
  275. package/lib/list/list.less +63 -0
  276. package/lib/list/props.js +45 -0
  277. package/lib/list/style/index.js +5 -0
  278. package/lib/list/style/less.js +5 -0
  279. package/lib/loading/Loading.js +93 -0
  280. package/lib/loading/LoadingSfc.css +0 -0
  281. package/lib/loading/LoadingSfc.less +0 -0
  282. package/lib/loading/index.js +17 -0
  283. package/lib/loading/loading.css +1 -0
  284. package/lib/loading/loading.less +420 -0
  285. package/lib/loading/props.js +39 -0
  286. package/lib/loading/style/index.js +3 -0
  287. package/lib/loading/style/less.js +3 -0
  288. package/lib/locale/en-US.js +107 -0
  289. package/lib/locale/index.js +83 -0
  290. package/lib/locale/style/index.js +0 -0
  291. package/lib/locale/style/less.js +0 -0
  292. package/lib/locale/zh-CN.js +107 -0
  293. package/lib/menu/Menu.js +144 -0
  294. package/lib/menu/MenuSfc.css +0 -0
  295. package/lib/menu/MenuSfc.less +0 -0
  296. package/lib/menu/index.js +17 -0
  297. package/lib/menu/menu.css +1 -0
  298. package/lib/menu/menu.less +21 -0
  299. package/lib/menu/props.js +48 -0
  300. package/lib/menu/style/index.js +4 -0
  301. package/lib/menu/style/less.js +4 -0
  302. package/lib/option/Option.js +125 -0
  303. package/lib/option/OptionSfc.css +0 -0
  304. package/lib/option/OptionSfc.less +0 -0
  305. package/lib/option/index.js +17 -0
  306. package/lib/option/option.css +1 -0
  307. package/lib/option/option.less +37 -0
  308. package/lib/option/props.js +9 -0
  309. package/lib/option/provide.js +28 -0
  310. package/lib/option/style/index.js +6 -0
  311. package/lib/option/style/less.js +6 -0
  312. package/lib/pagination/Pagination.js +373 -0
  313. package/lib/pagination/PaginationSfc.css +0 -0
  314. package/lib/pagination/PaginationSfc.less +0 -0
  315. package/lib/pagination/index.js +17 -0
  316. package/lib/pagination/pagination.css +1 -0
  317. package/lib/pagination/pagination.less +178 -0
  318. package/lib/pagination/porps.js +48 -0
  319. package/lib/pagination/style/index.js +8 -0
  320. package/lib/pagination/style/less.js +8 -0
  321. package/lib/picker/Picker.js +446 -0
  322. package/lib/picker/PickerSfc.css +0 -0
  323. package/lib/picker/PickerSfc.less +0 -0
  324. package/lib/picker/index.js +98 -0
  325. package/lib/picker/picker.css +1 -0
  326. package/lib/picker/picker.less +103 -0
  327. package/lib/picker/props.js +68 -0
  328. package/lib/picker/style/index.js +5 -0
  329. package/lib/picker/style/less.js +5 -0
  330. package/lib/popup/Popup.js +141 -0
  331. package/lib/popup/index.js +17 -0
  332. package/lib/popup/popup.css +1 -0
  333. package/lib/popup/popup.less +125 -0
  334. package/lib/popup/props.js +67 -0
  335. package/lib/popup/style/index.js +2 -0
  336. package/lib/popup/style/less.js +2 -0
  337. package/lib/progress/Progress.js +154 -0
  338. package/lib/progress/ProgressSfc.css +0 -0
  339. package/lib/progress/ProgressSfc.less +0 -0
  340. package/lib/progress/index.js +17 -0
  341. package/lib/progress/progress.css +1 -0
  342. package/lib/progress/progress.less +98 -0
  343. package/lib/progress/props.js +61 -0
  344. package/lib/progress/style/index.js +3 -0
  345. package/lib/progress/style/less.js +3 -0
  346. package/lib/pull-refresh/PullRefresh.js +150 -0
  347. package/lib/pull-refresh/PullRefreshSfc.css +0 -0
  348. package/lib/pull-refresh/PullRefreshSfc.less +0 -0
  349. package/lib/pull-refresh/index.js +17 -0
  350. package/lib/pull-refresh/props.js +47 -0
  351. package/lib/pull-refresh/pullRefresh.css +1 -0
  352. package/lib/pull-refresh/pullRefresh.less +55 -0
  353. package/lib/pull-refresh/style/index.js +5 -0
  354. package/lib/pull-refresh/style/less.js +5 -0
  355. package/lib/radio/Radio.js +231 -0
  356. package/lib/radio/RadioSfc.css +0 -0
  357. package/lib/radio/RadioSfc.less +0 -0
  358. package/lib/radio/index.js +17 -0
  359. package/lib/radio/props.js +56 -0
  360. package/lib/radio/provide.js +23 -0
  361. package/lib/radio/radio.css +1 -0
  362. package/lib/radio/radio.less +78 -0
  363. package/lib/radio/style/index.js +6 -0
  364. package/lib/radio/style/less.js +6 -0
  365. package/lib/radio-group/RadioGroup.js +122 -0
  366. package/lib/radio-group/RadioGroupSfc.css +0 -0
  367. package/lib/radio-group/RadioGroupSfc.less +0 -0
  368. package/lib/radio-group/index.js +17 -0
  369. package/lib/radio-group/props.js +35 -0
  370. package/lib/radio-group/provide.js +27 -0
  371. package/lib/radio-group/radioGroup.css +1 -0
  372. package/lib/radio-group/radioGroup.less +12 -0
  373. package/lib/radio-group/style/index.js +4 -0
  374. package/lib/radio-group/style/less.js +4 -0
  375. package/lib/rate/Rate.js +235 -0
  376. package/lib/rate/RateSfc.css +0 -0
  377. package/lib/rate/RateSfc.less +0 -0
  378. package/lib/rate/index.js +17 -0
  379. package/lib/rate/props.js +69 -0
  380. package/lib/rate/provide.js +3 -0
  381. package/lib/rate/rate.css +1 -0
  382. package/lib/rate/rate.less +35 -0
  383. package/lib/rate/style/index.js +6 -0
  384. package/lib/rate/style/less.js +6 -0
  385. package/lib/ripple/index.js +187 -0
  386. package/lib/ripple/ripple.css +1 -0
  387. package/lib/ripple/ripple.less +17 -0
  388. package/lib/ripple/style/index.js +2 -0
  389. package/lib/ripple/style/less.js +2 -0
  390. package/lib/row/Row.js +102 -0
  391. package/lib/row/RowSfc.css +0 -0
  392. package/lib/row/RowSfc.less +0 -0
  393. package/lib/row/index.js +17 -0
  394. package/lib/row/props.js +33 -0
  395. package/lib/row/provide.js +27 -0
  396. package/lib/row/row.css +1 -0
  397. package/lib/row/row.less +4 -0
  398. package/lib/row/style/index.js +3 -0
  399. package/lib/row/style/less.js +3 -0
  400. package/lib/select/Select.js +492 -0
  401. package/lib/select/SelectSfc.css +0 -0
  402. package/lib/select/SelectSfc.less +0 -0
  403. package/lib/select/index.js +17 -0
  404. package/lib/select/props.js +93 -0
  405. package/lib/select/provide.js +27 -0
  406. package/lib/select/select.css +1 -0
  407. package/lib/select/select.less +181 -0
  408. package/lib/select/style/index.js +7 -0
  409. package/lib/select/style/less.js +7 -0
  410. package/lib/skeleton/Skeleton.js +134 -0
  411. package/lib/skeleton/SkeletonSfc.css +0 -0
  412. package/lib/skeleton/SkeletonSfc.less +0 -0
  413. package/lib/skeleton/index.js +17 -0
  414. package/lib/skeleton/props.js +44 -0
  415. package/lib/skeleton/skeleton.css +1 -0
  416. package/lib/skeleton/skeleton.less +138 -0
  417. package/lib/skeleton/style/index.js +3 -0
  418. package/lib/skeleton/style/less.js +3 -0
  419. package/lib/slider/Slider.js +386 -0
  420. package/lib/slider/SliderSfc.css +0 -0
  421. package/lib/slider/SliderSfc.less +0 -0
  422. package/lib/slider/index.js +17 -0
  423. package/lib/slider/props.js +77 -0
  424. package/lib/slider/provide.js +3 -0
  425. package/lib/slider/slider.css +1 -0
  426. package/lib/slider/slider.less +146 -0
  427. package/lib/slider/style/index.js +4 -0
  428. package/lib/slider/style/less.js +4 -0
  429. package/lib/snackbar/Snackbar.js +70 -0
  430. package/lib/snackbar/SnackbarSfc.css +0 -0
  431. package/lib/snackbar/SnackbarSfc.less +0 -0
  432. package/lib/snackbar/core.js +146 -0
  433. package/lib/snackbar/coreSfc.css +0 -0
  434. package/lib/snackbar/coreSfc.less +0 -0
  435. package/lib/snackbar/index.js +232 -0
  436. package/lib/snackbar/props.js +103 -0
  437. package/lib/snackbar/snackbar.css +1 -0
  438. package/lib/snackbar/snackbar.less +135 -0
  439. package/lib/snackbar/style/index.js +8 -0
  440. package/lib/snackbar/style/less.js +8 -0
  441. package/lib/space/Space.js +99 -0
  442. package/lib/space/index.js +17 -0
  443. package/lib/space/props.js +49 -0
  444. package/lib/space/space.css +1 -0
  445. package/lib/space/space.less +6 -0
  446. package/lib/space/style/index.js +2 -0
  447. package/lib/space/style/less.js +2 -0
  448. package/lib/step/Step.js +156 -0
  449. package/lib/step/StepSfc.css +0 -0
  450. package/lib/step/StepSfc.less +0 -0
  451. package/lib/step/index.js +17 -0
  452. package/lib/step/props.js +17 -0
  453. package/lib/step/provide.js +28 -0
  454. package/lib/step/step.css +1 -0
  455. package/lib/step/step.less +145 -0
  456. package/lib/step/style/index.js +4 -0
  457. package/lib/step/style/less.js +4 -0
  458. package/lib/steps/Steps.js +56 -0
  459. package/lib/steps/StepsSfc.css +1 -0
  460. package/lib/steps/StepsSfc.less +1 -0
  461. package/lib/steps/index.js +17 -0
  462. package/lib/steps/props.js +30 -0
  463. package/lib/steps/provide.js +27 -0
  464. package/lib/steps/style/index.js +2 -0
  465. package/lib/steps/style/less.js +2 -0
  466. package/lib/sticky/Sticky.js +145 -0
  467. package/lib/sticky/StickySfc.css +0 -0
  468. package/lib/sticky/StickySfc.less +0 -0
  469. package/lib/sticky/index.js +17 -0
  470. package/lib/sticky/props.js +26 -0
  471. package/lib/sticky/sticky.css +1 -0
  472. package/lib/sticky/sticky.less +8 -0
  473. package/lib/sticky/style/index.js +3 -0
  474. package/lib/sticky/style/less.js +3 -0
  475. package/lib/style-provider/StyleProvider.js +30 -0
  476. package/lib/style-provider/StyleProviderSfc.css +0 -0
  477. package/lib/style-provider/StyleProviderSfc.less +0 -0
  478. package/lib/style-provider/index.js +37 -0
  479. package/lib/style-provider/style/index.js +2 -0
  480. package/lib/style-provider/style/less.js +2 -0
  481. package/lib/style.css +1 -0
  482. package/lib/style.js +62 -0
  483. package/lib/styles/common.css +1 -0
  484. package/lib/styles/common.less +67 -0
  485. package/lib/styles/elevation.css +1 -0
  486. package/lib/styles/elevation.less +126 -0
  487. package/lib/styles/style/index.js +0 -0
  488. package/lib/styles/style/less.js +0 -0
  489. package/lib/styles/var.css +0 -0
  490. package/lib/styles/var.less +30 -0
  491. package/lib/swipe/Swipe.js +408 -0
  492. package/lib/swipe/SwipeSfc.css +0 -0
  493. package/lib/swipe/SwipeSfc.less +0 -0
  494. package/lib/swipe/index.js +17 -0
  495. package/lib/swipe/props.js +40 -0
  496. package/lib/swipe/provide.js +27 -0
  497. package/lib/swipe/style/index.js +3 -0
  498. package/lib/swipe/style/less.js +3 -0
  499. package/lib/swipe/swipe.css +1 -0
  500. package/lib/swipe/swipe.less +59 -0
  501. package/lib/swipe-item/SwipeItem.js +58 -0
  502. package/lib/swipe-item/SwipeItemSfc.css +0 -0
  503. package/lib/swipe-item/SwipeItemSfc.less +0 -0
  504. package/lib/swipe-item/index.js +17 -0
  505. package/lib/swipe-item/provide.js +28 -0
  506. package/lib/swipe-item/style/index.js +3 -0
  507. package/lib/swipe-item/style/less.js +3 -0
  508. package/lib/swipe-item/swipeItem.css +1 -0
  509. package/lib/swipe-item/swipeItem.less +5 -0
  510. package/lib/switch/Switch.js +185 -0
  511. package/lib/switch/SwitchSfc.css +0 -0
  512. package/lib/switch/SwitchSfc.less +0 -0
  513. package/lib/switch/index.js +17 -0
  514. package/lib/switch/props.js +57 -0
  515. package/lib/switch/provide.js +3 -0
  516. package/lib/switch/style/index.js +7 -0
  517. package/lib/switch/style/less.js +7 -0
  518. package/lib/switch/switch.css +1 -0
  519. package/lib/switch/switch.less +80 -0
  520. package/lib/tab/Tab.js +116 -0
  521. package/lib/tab/TabSfc.css +0 -0
  522. package/lib/tab/TabSfc.less +0 -0
  523. package/lib/tab/index.js +17 -0
  524. package/lib/tab/props.js +17 -0
  525. package/lib/tab/provide.js +28 -0
  526. package/lib/tab/style/index.js +4 -0
  527. package/lib/tab/style/less.js +4 -0
  528. package/lib/tab/tab.css +1 -0
  529. package/lib/tab/tab.less +46 -0
  530. package/lib/tab-item/TabItem.js +74 -0
  531. package/lib/tab-item/TabItemSfc.css +0 -0
  532. package/lib/tab-item/TabItemSfc.less +0 -0
  533. package/lib/tab-item/index.js +17 -0
  534. package/lib/tab-item/props.js +10 -0
  535. package/lib/tab-item/provide.js +28 -0
  536. package/lib/tab-item/style/index.js +4 -0
  537. package/lib/tab-item/style/less.js +4 -0
  538. package/lib/tab-item/tabItem.css +1 -0
  539. package/lib/tab-item/tabItem.less +6 -0
  540. package/lib/table/Table.js +53 -0
  541. package/lib/table/TableSfc.css +0 -0
  542. package/lib/table/TableSfc.less +0 -0
  543. package/lib/table/index.js +17 -0
  544. package/lib/table/style/index.js +4 -0
  545. package/lib/table/style/less.js +4 -0
  546. package/lib/table/table.css +1 -0
  547. package/lib/table/table.less +110 -0
  548. package/lib/tabs/Tabs.js +208 -0
  549. package/lib/tabs/TabsSfc.css +0 -0
  550. package/lib/tabs/TabsSfc.less +0 -0
  551. package/lib/tabs/index.js +17 -0
  552. package/lib/tabs/props.js +70 -0
  553. package/lib/tabs/provide.js +27 -0
  554. package/lib/tabs/style/index.js +5 -0
  555. package/lib/tabs/style/less.js +5 -0
  556. package/lib/tabs/tabs.css +1 -0
  557. package/lib/tabs/tabs.less +93 -0
  558. package/lib/tabs-items/TabsItems.js +107 -0
  559. package/lib/tabs-items/TabsItemsSfc.css +0 -0
  560. package/lib/tabs-items/TabsItemsSfc.less +0 -0
  561. package/lib/tabs-items/index.js +17 -0
  562. package/lib/tabs-items/props.js +22 -0
  563. package/lib/tabs-items/provide.js +27 -0
  564. package/lib/tabs-items/style/index.js +3 -0
  565. package/lib/tabs-items/style/less.js +3 -0
  566. package/lib/themes/dark/actionSheet.js +10 -0
  567. package/lib/themes/dark/badge.js +8 -0
  568. package/lib/themes/dark/button.js +8 -0
  569. package/lib/themes/dark/card.js +11 -0
  570. package/lib/themes/dark/cell.js +9 -0
  571. package/lib/themes/dark/checkbox.js +8 -0
  572. package/lib/themes/dark/chip.js +8 -0
  573. package/lib/themes/dark/collapse.js +10 -0
  574. package/lib/themes/dark/datePicker.js +10 -0
  575. package/lib/themes/dark/dialog.js +9 -0
  576. package/lib/themes/dark/divider.js +9 -0
  577. package/lib/themes/dark/index.js +75 -0
  578. package/lib/themes/dark/input.js +9 -0
  579. package/lib/themes/dark/pagination.js +12 -0
  580. package/lib/themes/dark/picker.js +10 -0
  581. package/lib/themes/dark/popup.js +8 -0
  582. package/lib/themes/dark/pullRefresh.js +8 -0
  583. package/lib/themes/dark/radio.js +8 -0
  584. package/lib/themes/dark/select.js +10 -0
  585. package/lib/themes/dark/skeleton.js +11 -0
  586. package/lib/themes/dark/steps.js +10 -0
  587. package/lib/themes/dark/switch.js +9 -0
  588. package/lib/themes/dark/tab-item.js +8 -0
  589. package/lib/themes/dark/tab.js +8 -0
  590. package/lib/themes/dark/table.js +12 -0
  591. package/lib/themes/dark/tabs.js +8 -0
  592. package/lib/themes/dark/timePicker.js +10 -0
  593. package/lib/themes/dark/uploader.js +12 -0
  594. package/lib/themes/style/index.js +0 -0
  595. package/lib/themes/style/less.js +0 -0
  596. package/lib/time-picker/TimePicker.js +413 -0
  597. package/lib/time-picker/TimePickerSfc.css +0 -0
  598. package/lib/time-picker/TimePickerSfc.less +0 -0
  599. package/lib/time-picker/clock.js +347 -0
  600. package/lib/time-picker/index.js +17 -0
  601. package/lib/time-picker/props.js +59 -0
  602. package/lib/time-picker/style/index.js +4 -0
  603. package/lib/time-picker/style/less.js +4 -0
  604. package/lib/time-picker/timePicker.css +1 -0
  605. package/lib/time-picker/timePicker.less +236 -0
  606. package/lib/time-picker/utils.js +148 -0
  607. package/lib/uploader/Uploader.js +433 -0
  608. package/lib/uploader/UploaderSfc.css +0 -0
  609. package/lib/uploader/UploaderSfc.less +0 -0
  610. package/lib/uploader/index.js +17 -0
  611. package/lib/uploader/props.js +74 -0
  612. package/lib/uploader/provide.js +3 -0
  613. package/lib/uploader/style/index.js +8 -0
  614. package/lib/uploader/style/less.js +8 -0
  615. package/lib/uploader/uploader.css +1 -0
  616. package/lib/uploader/uploader.less +219 -0
  617. package/lib/utils/components.js +285 -0
  618. package/lib/utils/elements.js +261 -0
  619. package/lib/utils/jest.js +252 -0
  620. package/lib/utils/shared.js +214 -0
  621. package/lib/utils/style/index.js +0 -0
  622. package/lib/utils/style/less.js +0 -0
  623. package/package.json +5 -3
  624. package/types/global.d.ts +1 -0
  625. package/types/index.d.ts +1 -0
  626. package/types/list.d.ts +21 -0
  627. package/umd/varlet.js +3 -2
@@ -0,0 +1,387 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.render = render;
5
+ exports.default = void 0;
6
+
7
+ var _icon = _interopRequireDefault(require("../icon"));
8
+
9
+ var _formDetails = _interopRequireDefault(require("../form-details"));
10
+
11
+ var _ripple = _interopRequireDefault(require("../ripple"));
12
+
13
+ var _vue = require("vue");
14
+
15
+ var _decimal = require("decimal.js");
16
+
17
+ var _props = require("./props");
18
+
19
+ var _shared = require("../utils/shared");
20
+
21
+ var _elements = require("../utils/elements");
22
+
23
+ var _provide = require("../form/provide");
24
+
25
+ var _components = require("../utils/components");
26
+
27
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
+
29
+ var SPEED = 100;
30
+ var DELAY = 600;
31
+
32
+ var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
33
+
34
+ var _hoisted_1 = {
35
+ class: "var-counter var--box"
36
+ };
37
+ var _hoisted_2 = ["inputmode", "readonly", "disabled"];
38
+
39
+ function render(_ctx, _cache) {
40
+ var _component_var_icon = (0, _vue.resolveComponent)("var-icon");
41
+
42
+ var _component_var_form_details = (0, _vue.resolveComponent)("var-form-details");
43
+
44
+ var _directive_ripple = (0, _vue.resolveDirective)("ripple");
45
+
46
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [(0, _vue.createElementVNode)("div", (0, _vue.mergeProps)({
47
+ class: ["var-counter__controller var-elevation--2", [_ctx.disabled || _ctx.formDisabled ? 'var-counter--disabled' : null, _ctx.errorMessage ? 'var-counter--error' : null]],
48
+ style: {
49
+ background: _ctx.color ? _ctx.color : undefined
50
+ }
51
+ }, _ctx.$attrs), [(0, _vue.withDirectives)((0, _vue.createVNode)(_component_var_icon, {
52
+ class: (0, _vue.normalizeClass)(["var-counter__decrement-button", [!_ctx.decrementButton ? 'var-counter--hidden' : null]]),
53
+ "var-counter-cover": "",
54
+ name: "minus",
55
+ style: (0, _vue.normalizeStyle)({
56
+ width: _ctx.toSizeUnit(_ctx.buttonSize),
57
+ height: _ctx.toSizeUnit(_ctx.buttonSize)
58
+ }),
59
+ onClick: _ctx.decrement,
60
+ onTouchstart: _ctx.pressDecrement,
61
+ onTouchend: _ctx.releaseDecrement,
62
+ onTouchcancel: _ctx.releaseDecrement
63
+ }, null, 8
64
+ /* PROPS */
65
+ , ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]), [[_directive_ripple, {
66
+ disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.disableDecrement || !_ctx.decrementButton || _ctx.isMin
67
+ }]]), (0, _vue.withDirectives)((0, _vue.createElementVNode)("input", {
68
+ class: "var-counter__input",
69
+ style: (0, _vue.normalizeStyle)({
70
+ width: _ctx.toSizeUnit(_ctx.inputWidth),
71
+ fontSize: _ctx.toSizeUnit(_ctx.inputTextSize)
72
+ }),
73
+ inputmode: _ctx.toNumber(_ctx.decimalLength) === 0 ? 'numeric' : 'decimal',
74
+ readonly: _ctx.readonly || _ctx.formReadonly,
75
+ disabled: _ctx.disabled || _ctx.formDisabled || _ctx.disableInput,
76
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.inputValue = $event),
77
+ onChange: _cache[1] || (_cache[1] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
78
+ }, null, 44
79
+ /* STYLE, PROPS, HYDRATE_EVENTS */
80
+ , _hoisted_2), [[_vue.vModelText, _ctx.inputValue]]), (0, _vue.withDirectives)((0, _vue.createVNode)(_component_var_icon, {
81
+ class: (0, _vue.normalizeClass)(["var-counter__increment-button", [!_ctx.incrementButton ? 'var-counter--hidden' : null]]),
82
+ "var-counter-cover": "",
83
+ name: "plus",
84
+ style: (0, _vue.normalizeStyle)({
85
+ width: _ctx.toSizeUnit(_ctx.buttonSize),
86
+ height: _ctx.toSizeUnit(_ctx.buttonSize)
87
+ }),
88
+ onClick: _ctx.increment,
89
+ onTouchstart: _ctx.pressIncrement,
90
+ onTouchend: _ctx.releaseIncrement,
91
+ onTouchcancel: _ctx.releaseIncrement
92
+ }, null, 8
93
+ /* PROPS */
94
+ , ["class", "style", "onClick", "onTouchstart", "onTouchend", "onTouchcancel"]), [[_directive_ripple, {
95
+ disabled: !_ctx.ripple || _ctx.disabled || _ctx.readonly || _ctx.disableIncrement || !_ctx.incrementButton || _ctx.isMax
96
+ }]])], 16
97
+ /* FULL_PROPS */
98
+ ), (0, _vue.createVNode)(_component_var_form_details, {
99
+ "error-message": _ctx.errorMessage
100
+ }, null, 8
101
+ /* PROPS */
102
+ , ["error-message"])]);
103
+ }
104
+
105
+ var _default = (0, _vue.defineComponent)({
106
+ render,
107
+ name: 'VarCounter',
108
+ components: {
109
+ VarIcon: _icon.default,
110
+ VarFormDetails: _formDetails.default
111
+ },
112
+ directives: {
113
+ Ripple: _ripple.default
114
+ },
115
+ inheritAttrs: false,
116
+ props: _props.props,
117
+
118
+ setup(props) {
119
+ var inputValue = (0, _vue.ref)('');
120
+ var incrementTimer;
121
+ var decrementTimer;
122
+ var incrementDelayTimer;
123
+ var decrementDelayTimer;
124
+ var {
125
+ bindForm,
126
+ form
127
+ } = (0, _provide.useForm)();
128
+ var {
129
+ errorMessage,
130
+ validateWithTrigger: vt,
131
+ validate: v,
132
+ // expose
133
+ resetValidation
134
+ } = (0, _components.useValidation)();
135
+ var {
136
+ readonly: formReadonly,
137
+ disabled: formDisabled
138
+ } = form != null ? form : {}; // expose
139
+
140
+ var validate = () => v(props.rules, props.modelValue);
141
+
142
+ var validateWithTrigger = trigger => {
143
+ (0, _vue.nextTick)(() => {
144
+ var {
145
+ validateTrigger,
146
+ rules,
147
+ modelValue
148
+ } = props;
149
+ vt(validateTrigger, trigger, rules, modelValue);
150
+ });
151
+ }; // expose
152
+
153
+
154
+ var reset = () => {
155
+ var _props$onUpdateModel;
156
+
157
+ var {
158
+ min
159
+ } = props;
160
+ (_props$onUpdateModel = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel.call(props, min != null ? (0, _shared.toNumber)(min) : 0);
161
+ resetValidation();
162
+ };
163
+
164
+ var counterProvider = {
165
+ reset,
166
+ validate,
167
+ resetValidation
168
+ };
169
+ var isMax = (0, _vue.computed)(() => {
170
+ var {
171
+ max,
172
+ modelValue
173
+ } = props;
174
+ return max != null && (0, _shared.toNumber)(modelValue) >= (0, _shared.toNumber)(max);
175
+ });
176
+ var isMin = (0, _vue.computed)(() => {
177
+ var {
178
+ min,
179
+ modelValue
180
+ } = props;
181
+ return min != null && (0, _shared.toNumber)(modelValue) <= (0, _shared.toNumber)(min);
182
+ });
183
+
184
+ var normalizeValue = value => {
185
+ var {
186
+ decimalLength,
187
+ max,
188
+ min
189
+ } = props;
190
+ var num = (0, _shared.toNumber)(value);
191
+
192
+ if (max != null && num > (0, _shared.toNumber)(max)) {
193
+ num = (0, _shared.toNumber)(max);
194
+ }
195
+
196
+ if (min != null && num < (0, _shared.toNumber)(min)) {
197
+ num = (0, _shared.toNumber)(min);
198
+ }
199
+
200
+ value = String(num);
201
+
202
+ if (decimalLength != null) {
203
+ value = num.toFixed((0, _shared.toNumber)(decimalLength));
204
+ }
205
+
206
+ return value;
207
+ };
208
+
209
+ var handleChange = event => {
210
+ var {
211
+ lazyChange,
212
+ onBeforeChange
213
+ } = props;
214
+ var {
215
+ value
216
+ } = event.target;
217
+ var normalizedValue = normalizeValue(value);
218
+ lazyChange ? onBeforeChange == null ? void 0 : onBeforeChange((0, _shared.toNumber)(normalizedValue), change) : setNormalizedValue(normalizedValue);
219
+ validateWithTrigger('onInputChange');
220
+ };
221
+
222
+ var decrement = () => {
223
+ var {
224
+ disabled,
225
+ readonly,
226
+ disableDecrement,
227
+ decrementButton,
228
+ lazyChange,
229
+ step,
230
+ modelValue,
231
+ onDecrement,
232
+ onBeforeChange
233
+ } = props;
234
+
235
+ if (formDisabled != null && formDisabled.value || formReadonly != null && formReadonly.value || disabled || readonly || disableDecrement || !decrementButton) {
236
+ return;
237
+ }
238
+
239
+ if (isMin.value) {
240
+ return;
241
+ }
242
+
243
+ var value = new _decimal.Decimal((0, _shared.toNumber)(modelValue)).minus(new _decimal.Decimal((0, _shared.toNumber)(step))).toString();
244
+ var normalizedValue = normalizeValue(value);
245
+ var normalizedValueNum = (0, _shared.toNumber)(normalizedValue);
246
+ onDecrement == null ? void 0 : onDecrement(normalizedValueNum);
247
+
248
+ if (lazyChange) {
249
+ onBeforeChange == null ? void 0 : onBeforeChange(normalizedValueNum, change);
250
+ } else {
251
+ setNormalizedValue(normalizedValue);
252
+ validateWithTrigger('onDecrement');
253
+ }
254
+ };
255
+
256
+ var increment = () => {
257
+ var {
258
+ disabled,
259
+ readonly,
260
+ disableIncrement,
261
+ incrementButton,
262
+ lazyChange,
263
+ step,
264
+ modelValue,
265
+ onIncrement,
266
+ onBeforeChange
267
+ } = props;
268
+
269
+ if (formDisabled != null && formDisabled.value || formReadonly != null && formReadonly.value || disabled || readonly || disableIncrement || !incrementButton) {
270
+ return;
271
+ }
272
+
273
+ if (isMax.value) {
274
+ return;
275
+ }
276
+
277
+ var value = new _decimal.Decimal((0, _shared.toNumber)(modelValue)).plus(new _decimal.Decimal((0, _shared.toNumber)(step))).toString();
278
+ var normalizedValue = normalizeValue(value);
279
+ var normalizedValueNum = (0, _shared.toNumber)(normalizedValue);
280
+ onIncrement == null ? void 0 : onIncrement(normalizedValueNum);
281
+
282
+ if (lazyChange) {
283
+ onBeforeChange == null ? void 0 : onBeforeChange(normalizedValueNum, change);
284
+ } else {
285
+ setNormalizedValue(normalizedValue);
286
+ validateWithTrigger('onIncrement');
287
+ }
288
+ };
289
+
290
+ var pressDecrement = () => {
291
+ var {
292
+ press,
293
+ lazyChange
294
+ } = props;
295
+
296
+ if (!press || lazyChange) {
297
+ return;
298
+ }
299
+
300
+ decrementDelayTimer = window.setTimeout(() => {
301
+ continuedDecrement();
302
+ }, DELAY);
303
+ };
304
+
305
+ var pressIncrement = () => {
306
+ var {
307
+ press,
308
+ lazyChange
309
+ } = props;
310
+
311
+ if (!press || lazyChange) {
312
+ return;
313
+ }
314
+
315
+ incrementDelayTimer = window.setTimeout(() => {
316
+ continuedIncrement();
317
+ }, DELAY);
318
+ };
319
+
320
+ var releaseDecrement = () => {
321
+ decrementTimer && clearTimeout(decrementTimer);
322
+ decrementDelayTimer && clearTimeout(decrementDelayTimer);
323
+ };
324
+
325
+ var releaseIncrement = () => {
326
+ incrementTimer && clearTimeout(incrementTimer);
327
+ incrementDelayTimer && clearTimeout(incrementDelayTimer);
328
+ };
329
+
330
+ var continuedIncrement = () => {
331
+ incrementTimer = window.setTimeout(() => {
332
+ increment();
333
+ continuedIncrement();
334
+ }, SPEED);
335
+ };
336
+
337
+ var continuedDecrement = () => {
338
+ decrementTimer = window.setTimeout(() => {
339
+ decrement();
340
+ continuedDecrement();
341
+ }, SPEED);
342
+ };
343
+
344
+ var setNormalizedValue = normalizedValue => {
345
+ var _props$onUpdateModel2;
346
+
347
+ inputValue.value = normalizedValue;
348
+ var normalizedValueNum = (0, _shared.toNumber)(normalizedValue);
349
+ (_props$onUpdateModel2 = props['onUpdate:modelValue']) == null ? void 0 : _props$onUpdateModel2.call(props, normalizedValueNum);
350
+ };
351
+
352
+ var change = value => {
353
+ setNormalizedValue(normalizeValue(String(value)));
354
+ validateWithTrigger('onLazyChange');
355
+ };
356
+
357
+ bindForm == null ? void 0 : bindForm(counterProvider);
358
+ (0, _vue.watch)(() => props.modelValue, newValue => {
359
+ setNormalizedValue(normalizeValue(String(newValue)));
360
+ props.onChange == null ? void 0 : props.onChange((0, _shared.toNumber)(newValue));
361
+ });
362
+ setNormalizedValue(normalizeValue(String(props.modelValue)));
363
+ return {
364
+ inputValue,
365
+ errorMessage,
366
+ formDisabled,
367
+ formReadonly,
368
+ isMax,
369
+ isMin,
370
+ validate,
371
+ reset,
372
+ resetValidation,
373
+ handleChange,
374
+ decrement,
375
+ increment,
376
+ pressDecrement,
377
+ pressIncrement,
378
+ releaseDecrement,
379
+ releaseIncrement,
380
+ toSizeUnit: _elements.toSizeUnit,
381
+ toNumber: _shared.toNumber
382
+ };
383
+ }
384
+
385
+ });
386
+
387
+ exports.default = _default;
File without changes
File without changes
@@ -0,0 +1 @@
1
+ :root { --counter-padding: 0 4px; --counter-font-color: #fff; --counter-background: var(--color-primary); --counter-input-width: 28px; --counter-input-margin: 0 4px; --counter-input-font-size: 14px; --counter-button-size: 28px; --counter-button-icon-size: 100%; --counter-disabled-color: var(--color-text-disabled); --input-error-color: var(--color-danger);}.var-counter { display: inline-flex; flex-direction: column; align-items: flex-start;}.var-counter__controller { display: flex; align-items: center; color: var(--counter-font-color); border-radius: var(--counter-button-size); padding: var(--counter-padding); background: var(--counter-background); transition: background-color 0.25s;}.var-counter__decrement-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-counter__input { width: var(--counter-input-width); font-size: var(--counter-input-font-size); outline: none; border: none; background: transparent; padding: 0; text-align: center; color: var(--counter-font-color); margin: var(--counter-input-margin);}.var-counter__input[disabled] { background: transparent;}.var-counter__increment-button[var-counter-cover] { width: var(--counter-button-size); height: var(--counter-button-size); font-size: var(--counter-button-icon-size); border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-counter--disabled { background: var(--counter-disabled-color);}.var-counter--hidden { opacity: 0;}.var-counter--error { background: var(--color-danger);}
@@ -0,0 +1,85 @@
1
+ @counter-padding: 0 4px;
2
+ @counter-font-color: #fff;
3
+ @counter-background: var(--color-primary);
4
+ @counter-input-width: 28px;
5
+ @counter-input-margin: 0 4px;
6
+ @counter-input-font-size: 14px;
7
+ @counter-button-size: 28px;
8
+ @counter-button-icon-size: 100%;
9
+ @counter-disabled-color: var(--color-text-disabled);
10
+ @input-error-color: var(--color-danger);
11
+
12
+ :root {
13
+ --counter-padding: @counter-padding;
14
+ --counter-font-color: @counter-font-color;
15
+ --counter-background: @counter-background;
16
+ --counter-input-width: @counter-input-width;
17
+ --counter-input-margin: @counter-input-margin;
18
+ --counter-input-font-size: @counter-input-font-size;
19
+ --counter-button-size: @counter-button-size;
20
+ --counter-button-icon-size: @counter-button-icon-size;
21
+ --counter-disabled-color: @counter-disabled-color;
22
+ --input-error-color: @input-error-color;
23
+ }
24
+
25
+ .var-counter {
26
+ display: inline-flex;
27
+ flex-direction: column;
28
+ align-items: flex-start;
29
+
30
+ &__controller {
31
+ display: flex;
32
+ align-items: center;
33
+ color: var(--counter-font-color);
34
+ border-radius: var(--counter-button-size);
35
+ padding: var(--counter-padding);
36
+ background: var(--counter-background);
37
+ transition: background-color 0.25s;
38
+ }
39
+
40
+ &__decrement-button[var-counter-cover] {
41
+ width: var(--counter-button-size);
42
+ height: var(--counter-button-size);
43
+ font-size: var(--counter-button-icon-size);
44
+ border-radius: 50%;
45
+ cursor: pointer;
46
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
47
+ }
48
+
49
+ &__input {
50
+ width: var(--counter-input-width);
51
+ font-size: var(--counter-input-font-size);
52
+ outline: none;
53
+ border: none;
54
+ background: transparent;
55
+ padding: 0;
56
+ text-align: center;
57
+ color: var(--counter-font-color);
58
+ margin: var(--counter-input-margin);
59
+
60
+ &[disabled] {
61
+ background: transparent;
62
+ }
63
+ }
64
+
65
+ &__increment-button[var-counter-cover] {
66
+ width: var(--counter-button-size);
67
+ height: var(--counter-button-size);
68
+ font-size: var(--counter-button-icon-size);
69
+ border-radius: 50%;
70
+ cursor: pointer;
71
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
72
+ }
73
+
74
+ &--disabled {
75
+ background: var(--counter-disabled-color);
76
+ }
77
+
78
+ &--hidden {
79
+ opacity: 0;
80
+ }
81
+
82
+ &--error {
83
+ background: var(--color-danger);
84
+ }
85
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports._CounterComponent = void 0;
5
+
6
+ var _Counter = _interopRequireDefault(require("./Counter.js"));
7
+
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+
10
+ _Counter.default.install = function (app) {
11
+ app.component(_Counter.default.name, _Counter.default);
12
+ };
13
+
14
+ var _CounterComponent = _Counter.default;
15
+ exports._CounterComponent = _CounterComponent;
16
+ var _default = _Counter.default;
17
+ exports.default = _default;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.props = void 0;
5
+ var props = {
6
+ modelValue: {
7
+ type: [String, Number],
8
+ default: 0
9
+ },
10
+ min: {
11
+ type: [String, Number]
12
+ },
13
+ max: {
14
+ type: [String, Number]
15
+ },
16
+ step: {
17
+ type: [String, Number],
18
+ default: 1
19
+ },
20
+ color: {
21
+ type: String
22
+ },
23
+ inputWidth: {
24
+ type: [String, Number]
25
+ },
26
+ inputTextSize: {
27
+ type: [String, Number]
28
+ },
29
+ buttonSize: {
30
+ type: [String, Number]
31
+ },
32
+ decimalLength: {
33
+ type: [String, Number]
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ readonly: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ disableIncrement: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ disableDecrement: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ disableInput: {
52
+ type: Boolean,
53
+ default: false
54
+ },
55
+ lazyChange: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ incrementButton: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ decrementButton: {
64
+ type: Boolean,
65
+ default: true
66
+ },
67
+ press: {
68
+ type: Boolean,
69
+ default: true
70
+ },
71
+ ripple: {
72
+ type: Boolean,
73
+ default: true
74
+ },
75
+ validateTrigger: {
76
+ type: Array,
77
+ default: () => ['onInputChange', 'onLazyChange', 'onIncrement', 'onDecrement']
78
+ },
79
+ rules: {
80
+ type: Array
81
+ },
82
+ onBeforeChange: {
83
+ type: Function
84
+ },
85
+ onChange: {
86
+ type: Function
87
+ },
88
+ onIncrement: {
89
+ type: Function
90
+ },
91
+ onDecrement: {
92
+ type: Function
93
+ },
94
+ 'onUpdate:modelValue': {
95
+ type: Function
96
+ }
97
+ };
98
+ exports.props = props;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
@@ -0,0 +1,7 @@
1
+ require('../../styles/common.css')
2
+ require('../../styles/elevation.css')
3
+ require('../../icon/icon.css')
4
+ require('../../form-details/formDetails.css')
5
+ require('../../ripple/ripple.css')
6
+ require('../counter.css')
7
+ require('../CounterSfc.css')
@@ -0,0 +1,7 @@
1
+ require('../../styles/common.less')
2
+ require('../../styles/elevation.less')
3
+ require('../../icon/icon.less')
4
+ require('../../form-details/formDetails.less')
5
+ require('../../ripple/ripple.less')
6
+ require('../counter.less')
7
+ require('../CounterSfc.less')