vue-devui 1.0.0-beta.2 → 1.0.0-beta.220808

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 (455) hide show
  1. package/README.md +163 -172
  2. package/alert/index.d.ts +7 -0
  3. package/alert/index.es.js +79 -51
  4. package/alert/index.umd.js +1 -1
  5. package/alert/style.css +1 -1
  6. package/auto-complete/index.d.ts +7 -0
  7. package/auto-complete/index.es.js +9053 -0
  8. package/auto-complete/index.umd.js +40 -0
  9. package/auto-complete/package.json +7 -0
  10. package/auto-complete/style.css +1 -0
  11. package/avatar/index.d.ts +7 -0
  12. package/avatar/index.es.js +154 -147
  13. package/avatar/index.umd.js +1 -1
  14. package/avatar/style.css +1 -1
  15. package/badge/index.d.ts +7 -0
  16. package/badge/index.es.js +46 -21
  17. package/badge/index.umd.js +1 -1
  18. package/badge/style.css +1 -1
  19. package/button/index.d.ts +7 -0
  20. package/button/index.es.js +5921 -146
  21. package/button/index.umd.js +27 -1
  22. package/button/style.css +1 -1
  23. package/card/index.d.ts +7 -0
  24. package/card/index.es.js +64 -36
  25. package/card/index.umd.js +1 -1
  26. package/card/style.css +1 -1
  27. package/checkbox/index.d.ts +7 -0
  28. package/checkbox/index.es.js +8122 -255
  29. package/checkbox/index.umd.js +38 -1
  30. package/checkbox/style.css +1 -1
  31. package/collapse/index.d.ts +7 -0
  32. package/collapse/index.es.js +195 -0
  33. package/collapse/index.umd.js +1 -0
  34. package/{cascader → collapse}/package.json +1 -1
  35. package/collapse/style.css +1 -0
  36. package/countdown/index.d.ts +7 -0
  37. package/countdown/index.es.js +217 -0
  38. package/countdown/index.umd.js +1 -0
  39. package/{accordion → countdown}/package.json +1 -1
  40. package/countdown/style.css +1 -0
  41. package/date-picker-pro/index.d.ts +7 -0
  42. package/date-picker-pro/index.es.js +12035 -0
  43. package/date-picker-pro/index.umd.js +38 -0
  44. package/date-picker-pro/package.json +7 -0
  45. package/date-picker-pro/style.css +1 -0
  46. package/drawer/index.d.ts +7 -0
  47. package/drawer/index.es.js +205 -154
  48. package/drawer/index.umd.js +1 -1
  49. package/drawer/style.css +1 -1
  50. package/dropdown/index.d.ts +7 -0
  51. package/dropdown/index.es.js +736 -0
  52. package/dropdown/index.umd.js +1 -0
  53. package/{carousel → dropdown}/package.json +1 -1
  54. package/dropdown/style.css +1 -0
  55. package/editable-select/index.d.ts +7 -0
  56. package/editable-select/index.es.js +908 -461
  57. package/editable-select/index.umd.js +1 -1
  58. package/editable-select/style.css +1 -1
  59. package/form/index.d.ts +7 -0
  60. package/form/index.es.js +2439 -1995
  61. package/form/index.umd.js +29 -18
  62. package/form/style.css +1 -1
  63. package/fullscreen/index.d.ts +7 -0
  64. package/fullscreen/index.es.js +138 -125
  65. package/fullscreen/index.umd.js +1 -1
  66. package/fullscreen/style.css +1 -1
  67. package/grid/index.d.ts +7 -0
  68. package/grid/index.es.js +271 -0
  69. package/grid/index.umd.js +1 -0
  70. package/{toast → grid}/package.json +1 -1
  71. package/grid/style.css +1 -0
  72. package/icon/index.d.ts +7 -0
  73. package/icon/index.es.js +200 -56
  74. package/icon/index.umd.js +1 -1
  75. package/icon/style.css +1 -0
  76. package/image-preview/index.d.ts +7 -0
  77. package/image-preview/index.es.js +154 -62
  78. package/image-preview/index.umd.js +1 -1
  79. package/image-preview/style.css +1 -1
  80. package/index.d.ts +7 -0
  81. package/input/index.d.ts +7 -0
  82. package/input/index.es.js +8269 -145
  83. package/input/index.umd.js +38 -1
  84. package/input/style.css +1 -1
  85. package/input-number/index.d.ts +7 -0
  86. package/input-number/index.es.js +260 -191
  87. package/input-number/index.umd.js +1 -1
  88. package/input-number/style.css +1 -1
  89. package/layout/index.d.ts +7 -0
  90. package/layout/index.es.js +41 -26
  91. package/layout/index.umd.js +1 -1
  92. package/layout/style.css +1 -1
  93. package/loading/index.d.ts +7 -0
  94. package/loading/index.es.js +89 -73
  95. package/loading/index.umd.js +1 -1
  96. package/loading/style.css +1 -1
  97. package/mention/index.d.ts +7 -0
  98. package/mention/index.es.js +8326 -0
  99. package/mention/index.umd.js +47 -0
  100. package/mention/package.json +7 -0
  101. package/mention/style.css +1 -0
  102. package/menu/index.d.ts +7 -0
  103. package/menu/index.es.js +891 -0
  104. package/menu/index.umd.js +1 -0
  105. package/{anchor → menu}/package.json +1 -1
  106. package/menu/style.css +1 -0
  107. package/message/index.d.ts +7 -0
  108. package/message/index.es.js +533 -0
  109. package/message/index.umd.js +1 -0
  110. package/message/package.json +7 -0
  111. package/message/style.css +1 -0
  112. package/modal/index.d.ts +7 -0
  113. package/modal/index.es.js +611 -877
  114. package/modal/index.umd.js +1 -1
  115. package/modal/style.css +1 -1
  116. package/notification/index.d.ts +7 -0
  117. package/notification/index.es.js +528 -0
  118. package/notification/index.umd.js +1 -0
  119. package/notification/package.json +7 -0
  120. package/notification/style.css +1 -0
  121. package/nuxt/components/Alert.js +3 -0
  122. package/nuxt/components/Aside.js +3 -0
  123. package/nuxt/components/AutoComplete.js +3 -0
  124. package/nuxt/components/Avatar.js +3 -0
  125. package/nuxt/components/Badge.js +3 -0
  126. package/nuxt/components/Button.js +3 -0
  127. package/nuxt/components/ButtonGroup.js +3 -0
  128. package/nuxt/components/Card.js +3 -0
  129. package/nuxt/components/Checkbox.js +3 -0
  130. package/nuxt/components/CheckboxButton.js +3 -0
  131. package/nuxt/components/CheckboxGroup.js +3 -0
  132. package/nuxt/components/Col.js +3 -0
  133. package/nuxt/components/Collapse.js +3 -0
  134. package/nuxt/components/CollapseItem.js +3 -0
  135. package/nuxt/components/Column.js +3 -0
  136. package/nuxt/components/Content.js +3 -0
  137. package/nuxt/components/Countdown.js +3 -0
  138. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  139. package/nuxt/components/DatePickerPro.js +3 -0
  140. package/nuxt/components/Drawer.js +3 -0
  141. package/nuxt/components/DrawerService.js +3 -0
  142. package/nuxt/components/Dropdown.js +3 -0
  143. package/nuxt/components/DropdownMenu.js +3 -0
  144. package/nuxt/components/DropdownPropsKey.js +3 -0
  145. package/nuxt/components/EditableSelect.js +3 -0
  146. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  147. package/nuxt/components/FORM_TOKEN.js +3 -0
  148. package/nuxt/components/FixedOverlay.js +3 -0
  149. package/nuxt/components/FlexibleOverlay.js +3 -0
  150. package/nuxt/components/Footer.js +3 -0
  151. package/nuxt/components/Form.js +3 -0
  152. package/nuxt/components/FormItem.js +3 -0
  153. package/nuxt/components/FormOperation.js +3 -0
  154. package/nuxt/components/Fullscreen.js +3 -0
  155. package/nuxt/components/Header.js +3 -0
  156. package/nuxt/components/IFileOptions.js +3 -0
  157. package/nuxt/components/IUploadOptions.js +3 -0
  158. package/nuxt/components/Icon.js +3 -0
  159. package/nuxt/components/IconGroup.js +3 -0
  160. package/nuxt/components/ImagePreviewService.js +3 -0
  161. package/nuxt/components/Input.js +3 -0
  162. package/nuxt/components/InputNumber.js +3 -0
  163. package/nuxt/components/LABEL_DATA.js +3 -0
  164. package/nuxt/components/Layout.js +3 -0
  165. package/nuxt/components/Loading.js +3 -0
  166. package/nuxt/components/LoadingOptions.js +3 -0
  167. package/nuxt/components/LoadingService.js +3 -0
  168. package/nuxt/components/Mention.js +3 -0
  169. package/nuxt/components/Menu.js +3 -0
  170. package/nuxt/components/MenuItem.js +3 -0
  171. package/nuxt/components/Message.js +3 -0
  172. package/nuxt/components/Modal.js +3 -0
  173. package/nuxt/components/Notification.js +3 -0
  174. package/nuxt/components/NotificationService.js +3 -0
  175. package/nuxt/components/Option.js +3 -0
  176. package/nuxt/components/OptionGroup.js +3 -0
  177. package/nuxt/components/Pagination.js +3 -0
  178. package/nuxt/components/Panel.js +3 -0
  179. package/nuxt/components/PanelBody.js +3 -0
  180. package/nuxt/components/PanelFooter.js +3 -0
  181. package/nuxt/components/PanelHeader.js +3 -0
  182. package/nuxt/components/Popover.js +3 -0
  183. package/nuxt/components/Progress.js +3 -0
  184. package/nuxt/components/Radio.js +3 -0
  185. package/nuxt/components/RadioButton.js +3 -0
  186. package/nuxt/components/RadioGroup.js +3 -0
  187. package/nuxt/components/Rate.js +3 -0
  188. package/nuxt/components/Result.js +3 -0
  189. package/nuxt/components/Row.js +3 -0
  190. package/nuxt/components/Search.js +3 -0
  191. package/nuxt/components/Select.js +3 -0
  192. package/nuxt/components/Skeleton.js +3 -0
  193. package/nuxt/components/SkeletonItem.js +3 -0
  194. package/nuxt/components/Slider.js +3 -0
  195. package/nuxt/components/Splitter.js +3 -0
  196. package/nuxt/components/Statistic.js +3 -0
  197. package/nuxt/components/Status.js +3 -0
  198. package/nuxt/components/Step.js +3 -0
  199. package/nuxt/components/Steps.js +3 -0
  200. package/nuxt/components/SubMenu.js +3 -0
  201. package/nuxt/components/Switch.js +3 -0
  202. package/nuxt/components/TABLE_TOKEN.js +3 -0
  203. package/nuxt/components/Tab.js +3 -0
  204. package/nuxt/components/Table.js +3 -0
  205. package/nuxt/components/Tabs.js +3 -0
  206. package/nuxt/components/Tag.js +3 -0
  207. package/nuxt/components/Textarea.js +3 -0
  208. package/nuxt/components/TimePicker.js +3 -0
  209. package/nuxt/components/TimeSelect.js +3 -0
  210. package/nuxt/components/Timeline.js +3 -0
  211. package/nuxt/components/TimelineItem.js +3 -0
  212. package/nuxt/components/Tooltip.js +3 -0
  213. package/nuxt/components/Tree.js +3 -0
  214. package/nuxt/components/Upload.js +3 -0
  215. package/nuxt/components/UploadStatus.js +3 -0
  216. package/nuxt/components/alertProps.js +3 -0
  217. package/nuxt/components/animationInjectionKey.js +3 -0
  218. package/nuxt/components/autoCompleteProps.js +3 -0
  219. package/nuxt/components/avatarProps.js +3 -0
  220. package/nuxt/components/badgeProps.js +3 -0
  221. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  222. package/nuxt/components/buttonGroupProps.js +3 -0
  223. package/nuxt/components/buttonProps.js +3 -0
  224. package/nuxt/components/cardProps.js +3 -0
  225. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  226. package/nuxt/components/checkboxGroupProps.js +3 -0
  227. package/nuxt/components/checkboxProps.js +3 -0
  228. package/nuxt/components/colProps.js +3 -0
  229. package/nuxt/components/colPropsBaseClass.js +3 -0
  230. package/nuxt/components/colPropsBaseStyle.js +3 -0
  231. package/nuxt/components/collapseItemProps.js +3 -0
  232. package/nuxt/components/collapseProps.js +3 -0
  233. package/nuxt/components/countdownProps.js +3 -0
  234. package/nuxt/components/datePickerProCommonProps.js +3 -0
  235. package/nuxt/components/datePickerProPanelProps.js +3 -0
  236. package/nuxt/components/datePickerProProps.js +3 -0
  237. package/nuxt/components/dropdownMenuProps.js +3 -0
  238. package/nuxt/components/editableSelectProps.js +3 -0
  239. package/nuxt/components/fixedOverlayProps.js +3 -0
  240. package/nuxt/components/flexibleOverlayProps.js +3 -0
  241. package/nuxt/components/formItemProps.js +3 -0
  242. package/nuxt/components/formProps.js +3 -0
  243. package/nuxt/components/fullscreenProps.js +3 -0
  244. package/nuxt/components/iconProps.js +3 -0
  245. package/nuxt/components/imagePreviewProps.js +3 -0
  246. package/nuxt/components/inputProps.js +3 -0
  247. package/nuxt/components/loadingProps.js +3 -0
  248. package/nuxt/components/mentionProps.js +3 -0
  249. package/nuxt/components/messageProps.js +3 -0
  250. package/nuxt/components/modalProps.js +3 -0
  251. package/nuxt/components/notificationProps.js +3 -0
  252. package/nuxt/components/paginationProps.js +3 -0
  253. package/nuxt/components/panelProps.js +3 -0
  254. package/nuxt/components/popoverProps.js +3 -0
  255. package/nuxt/components/progressProps.js +3 -0
  256. package/nuxt/components/rateProps.js +3 -0
  257. package/nuxt/components/resultProps.js +3 -0
  258. package/nuxt/components/roundInjectionKey.js +3 -0
  259. package/nuxt/components/rowProps.js +3 -0
  260. package/nuxt/components/screenSizes.js +3 -0
  261. package/nuxt/components/searchProps.js +3 -0
  262. package/nuxt/components/skeletonItemProps.js +3 -0
  263. package/nuxt/components/skeletonProps.js +3 -0
  264. package/nuxt/components/sliderProps.js +3 -0
  265. package/nuxt/components/splitterProps.js +3 -0
  266. package/nuxt/components/statisticProps.js +3 -0
  267. package/nuxt/components/stepProps.js +3 -0
  268. package/nuxt/components/stepsProps.js +3 -0
  269. package/nuxt/components/svgIconProps.js +3 -0
  270. package/nuxt/components/switchProps.js +3 -0
  271. package/nuxt/components/tableProps.js +3 -0
  272. package/nuxt/components/tabsProps.js +3 -0
  273. package/nuxt/components/tagProps.js +3 -0
  274. package/nuxt/components/textareaProps.js +3 -0
  275. package/nuxt/components/timeAxisProps.js +3 -0
  276. package/nuxt/components/timerPickerPanelProps.js +3 -0
  277. package/nuxt/components/tooltipProps.js +3 -0
  278. package/nuxt/components/treeNodeProps.js +3 -0
  279. package/nuxt/components/treeProps.js +3 -0
  280. package/nuxt/components/uploadProps.js +3 -0
  281. package/nuxt/index.js +13 -0
  282. package/overlay/index.d.ts +7 -0
  283. package/overlay/index.es.js +245 -303
  284. package/overlay/index.umd.js +1 -1
  285. package/overlay/style.css +1 -1
  286. package/package.json +16 -84
  287. package/pagination/index.d.ts +7 -0
  288. package/pagination/index.es.js +333 -155
  289. package/pagination/index.umd.js +1 -1
  290. package/pagination/style.css +1 -1
  291. package/panel/index.d.ts +7 -0
  292. package/panel/index.es.js +48 -35
  293. package/panel/index.umd.js +1 -1
  294. package/panel/style.css +1 -1
  295. package/popover/index.d.ts +7 -0
  296. package/popover/index.es.js +6035 -204
  297. package/popover/index.umd.js +27 -1
  298. package/popover/style.css +1 -1
  299. package/progress/index.d.ts +7 -0
  300. package/progress/index.es.js +111 -57
  301. package/progress/index.umd.js +3 -3
  302. package/progress/style.css +1 -1
  303. package/radio/index.d.ts +7 -0
  304. package/radio/index.es.js +8015 -182
  305. package/radio/index.umd.js +38 -1
  306. package/radio/style.css +1 -1
  307. package/rate/index.d.ts +7 -0
  308. package/rate/index.es.js +78 -56
  309. package/rate/index.umd.js +1 -1
  310. package/rate/style.css +1 -1
  311. package/result/index.d.ts +7 -0
  312. package/result/index.es.js +248 -0
  313. package/result/index.umd.js +1 -0
  314. package/{sticky → result}/package.json +1 -1
  315. package/result/style.css +1 -0
  316. package/ripple/index.d.ts +7 -0
  317. package/ripple/index.es.js +56 -61
  318. package/ripple/index.umd.js +1 -1
  319. package/search/index.d.ts +7 -0
  320. package/search/index.es.js +8381 -406
  321. package/search/index.umd.js +38 -1
  322. package/search/style.css +1 -1
  323. package/select/index.d.ts +7 -0
  324. package/select/index.es.js +9331 -576
  325. package/select/index.umd.js +38 -1
  326. package/select/style.css +1 -1
  327. package/skeleton/index.d.ts +7 -0
  328. package/skeleton/index.es.js +115 -145
  329. package/skeleton/index.umd.js +1 -1
  330. package/skeleton/style.css +1 -1
  331. package/slider/index.d.ts +7 -0
  332. package/slider/index.es.js +148 -142
  333. package/slider/index.umd.js +1 -1
  334. package/slider/style.css +1 -1
  335. package/splitter/index.d.ts +7 -0
  336. package/splitter/index.es.js +6308 -181
  337. package/splitter/index.umd.js +27 -1
  338. package/splitter/style.css +1 -1
  339. package/statistic/index.d.ts +7 -0
  340. package/statistic/index.es.js +253 -0
  341. package/statistic/index.umd.js +1 -0
  342. package/statistic/package.json +7 -0
  343. package/statistic/style.css +1 -0
  344. package/status/index.d.ts +7 -0
  345. package/status/index.es.js +29 -8
  346. package/status/index.umd.js +1 -1
  347. package/status/style.css +1 -1
  348. package/steps/index.d.ts +7 -0
  349. package/steps/index.es.js +386 -0
  350. package/steps/index.umd.js +1 -0
  351. package/steps/package.json +7 -0
  352. package/steps/style.css +1 -0
  353. package/style.css +1 -1
  354. package/switch/index.d.ts +7 -0
  355. package/switch/index.es.js +7819 -65
  356. package/switch/index.umd.js +38 -1
  357. package/switch/style.css +1 -1
  358. package/table/index.d.ts +7 -0
  359. package/table/index.es.js +11435 -204
  360. package/table/index.umd.js +38 -1
  361. package/table/style.css +1 -1
  362. package/tabs/index.d.ts +7 -0
  363. package/tabs/index.es.js +356 -143
  364. package/tabs/index.umd.js +1 -1
  365. package/tabs/style.css +1 -1
  366. package/tag/index.d.ts +7 -0
  367. package/tag/index.es.js +156 -0
  368. package/tag/index.umd.js +1 -0
  369. package/tag/package.json +7 -0
  370. package/tag/style.css +1 -0
  371. package/textarea/index.d.ts +7 -0
  372. package/textarea/index.es.js +7989 -0
  373. package/textarea/index.umd.js +46 -0
  374. package/textarea/package.json +7 -0
  375. package/textarea/style.css +1 -0
  376. package/{theme → theme/theme.scss} +0 -0
  377. package/time-picker/index.d.ts +7 -0
  378. package/time-picker/index.es.js +9126 -597
  379. package/time-picker/index.umd.js +38 -1
  380. package/time-picker/style.css +1 -1
  381. package/time-select/index.d.ts +7 -0
  382. package/time-select/index.es.js +9606 -0
  383. package/time-select/index.umd.js +38 -0
  384. package/{breadcrumb → time-select}/package.json +1 -1
  385. package/time-select/style.css +1 -0
  386. package/timeline/index.d.ts +7 -0
  387. package/timeline/index.es.js +427 -0
  388. package/timeline/index.umd.js +1 -0
  389. package/timeline/package.json +7 -0
  390. package/timeline/style.css +1 -0
  391. package/tooltip/index.d.ts +7 -0
  392. package/tooltip/index.es.js +5870 -141
  393. package/tooltip/index.umd.js +27 -1
  394. package/tooltip/style.css +1 -1
  395. package/tree/index.d.ts +7 -0
  396. package/tree/index.es.js +11504 -692
  397. package/tree/index.umd.js +38 -1
  398. package/tree/style.css +1 -1
  399. package/upload/index.d.ts +7 -0
  400. package/upload/index.es.js +968 -2748
  401. package/upload/index.umd.js +1 -1
  402. package/upload/style.css +1 -1
  403. package/vue-devui.es.js +22816 -16568
  404. package/vue-devui.umd.js +42 -20
  405. package/accordion/index.es.js +0 -190
  406. package/accordion/index.umd.js +0 -1
  407. package/accordion/style.css +0 -1
  408. package/anchor/index.es.js +0 -263
  409. package/anchor/index.umd.js +0 -1
  410. package/anchor/style.css +0 -1
  411. package/breadcrumb/index.es.js +0 -127
  412. package/breadcrumb/index.umd.js +0 -1
  413. package/breadcrumb/style.css +0 -1
  414. package/carousel/index.es.js +0 -328
  415. package/carousel/index.umd.js +0 -1
  416. package/carousel/style.css +0 -1
  417. package/cascader/index.es.js +0 -187
  418. package/cascader/index.umd.js +0 -1
  419. package/cascader/style.css +0 -1
  420. package/date-picker/index.es.js +0 -1171
  421. package/date-picker/index.umd.js +0 -1
  422. package/date-picker/package.json +0 -7
  423. package/date-picker/style.css +0 -1
  424. package/nav-sprite/index.es.js +0 -742
  425. package/nav-sprite/index.umd.js +0 -1
  426. package/nav-sprite/package.json +0 -7
  427. package/quadrant-diagram/index.es.js +0 -489
  428. package/quadrant-diagram/index.umd.js +0 -1
  429. package/quadrant-diagram/package.json +0 -7
  430. package/quadrant-diagram/style.css +0 -1
  431. package/steps-guide/index.es.js +0 -211
  432. package/steps-guide/index.umd.js +0 -1
  433. package/steps-guide/package.json +0 -7
  434. package/steps-guide/style.css +0 -1
  435. package/sticky/index.es.js +0 -197
  436. package/sticky/index.umd.js +0 -1
  437. package/tag-input/index.es.js +0 -341
  438. package/tag-input/index.umd.js +0 -1
  439. package/tag-input/package.json +0 -7
  440. package/tag-input/style.css +0 -1
  441. package/time-axis/index.es.js +0 -79
  442. package/time-axis/index.umd.js +0 -1
  443. package/time-axis/package.json +0 -7
  444. package/time-axis/style.css +0 -1
  445. package/toast/index.es.js +0 -2059
  446. package/toast/index.umd.js +0 -1
  447. package/toast/style.css +0 -1
  448. package/transfer/index.es.js +0 -1446
  449. package/transfer/index.umd.js +0 -1
  450. package/transfer/package.json +0 -7
  451. package/transfer/style.css +0 -1
  452. package/tree-select/index.es.js +0 -203
  453. package/tree-select/index.umd.js +0 -1
  454. package/tree-select/package.json +0 -7
  455. package/tree-select/style.css +0 -1
@@ -1,24 +1,7 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- import { defineComponent, createVNode, Fragment, ref, computed } from "vue";
1
+ import { createVNode, computed, ref, toRefs, reactive, watch, defineComponent, mergeProps } from "vue";
18
2
  const inputNumberProps = {
19
3
  placeholder: {
20
- type: String,
21
- default: void 0
4
+ type: String
22
5
  },
23
6
  disabled: {
24
7
  type: Boolean,
@@ -26,7 +9,7 @@ const inputNumberProps = {
26
9
  },
27
10
  step: {
28
11
  type: Number,
29
- default: 0
12
+ default: 1
30
13
  },
31
14
  max: {
32
15
  type: Number,
@@ -41,199 +24,285 @@ const inputNumberProps = {
41
24
  default: ""
42
25
  },
43
26
  modelValue: {
44
- type: Number,
45
- default: 0
46
- },
47
- "onUpdate:modelValue": {
48
- type: Function,
49
- default: void 0
27
+ type: Number
50
28
  },
51
- "onChange": {
52
- type: Function,
53
- default: void 0
54
- },
55
- "onKeydown": {
56
- type: Function,
57
- default: void 0
58
- },
59
- "onFocus": {
60
- type: Function,
61
- default: void 0
62
- },
63
- "onBlur": {
64
- type: Function,
65
- default: void 0
29
+ precision: {
30
+ type: Number
66
31
  }
67
32
  };
68
- var inputNumber = "";
69
- var Icon = defineComponent({
70
- name: "DIcon",
71
- props: {
72
- name: {
73
- type: String,
74
- required: true
75
- },
76
- size: {
77
- type: String,
78
- default: "inherit"
79
- },
80
- color: {
81
- type: String,
82
- default: "inherit"
33
+ function createBem(namespace, element, modifier) {
34
+ let cls = namespace;
35
+ if (element) {
36
+ cls += `__${element}`;
37
+ }
38
+ if (modifier) {
39
+ cls += `--${modifier}`;
40
+ }
41
+ return cls;
42
+ }
43
+ function useNamespace(block, needDot = false) {
44
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
45
+ const b = () => createBem(namespace);
46
+ const e = (element) => element ? createBem(namespace, element) : "";
47
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
48
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
49
+ return {
50
+ b,
51
+ e,
52
+ m,
53
+ em
54
+ };
55
+ }
56
+ const ns$1 = useNamespace("input-number");
57
+ function IncIcon() {
58
+ return createVNode("svg", {
59
+ "class": ns$1.e("icon-arrow"),
60
+ "width": "1em",
61
+ "height": "1em",
62
+ "viewBox": "0 0 16 16",
63
+ "version": "1.1",
64
+ "xmlns": "http://www.w3.org/2000/svg"
65
+ }, [createVNode("g", {
66
+ "stroke": "none",
67
+ "stroke-width": "1",
68
+ "fill": "none",
69
+ "fill-rule": "evenodd"
70
+ }, [createVNode("path", {
71
+ "d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
72
+ "fill-rule": "nonzero"
73
+ }, null)])]);
74
+ }
75
+ function DecIcon() {
76
+ return createVNode("svg", {
77
+ "class": ns$1.e("icon-arrow"),
78
+ "width": "1em",
79
+ "height": "1em",
80
+ "viewBox": "0 0 16 16",
81
+ "version": "1.1",
82
+ "xmlns": "http://www.w3.org/2000/svg"
83
+ }, [createVNode("g", {
84
+ "stroke": "none",
85
+ "stroke-width": "1",
86
+ "fill": "none",
87
+ "fill-rule": "evenodd"
88
+ }, [createVNode("path", {
89
+ "d": "M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z",
90
+ "fill-rule": "nonzero"
91
+ }, null)])]);
92
+ }
93
+ const isNumber = (value) => typeof value === "number";
94
+ const isUndefined = (value) => value === void 0;
95
+ const isNull = (value) => value === null;
96
+ const ns = useNamespace("input-number");
97
+ function useRender(props, ctx) {
98
+ const { style, class: customClass, ...otherAttrs } = ctx.attrs;
99
+ const customStyle = { style };
100
+ const wrapClass = computed(() => [
101
+ {
102
+ [ns.b()]: true
83
103
  },
84
- classPrefix: {
85
- type: String,
86
- default: "icon"
87
- }
88
- },
89
- setup(props) {
90
- return __spreadValues({}, props);
91
- },
92
- render() {
93
- const {
94
- name,
95
- size,
96
- color,
97
- classPrefix
98
- } = this;
99
- return createVNode(Fragment, null, [/^((https?):)?\/\//.test(name) ? createVNode("img", {
100
- "src": name,
101
- "alt": name.split("/")[name.split("/").length - 1],
102
- "style": {
103
- width: size
104
- }
105
- }, null) : createVNode("i", {
106
- "class": `${classPrefix} ${classPrefix}-${name}`,
107
- "style": {
108
- fontSize: size,
109
- color
110
- }
111
- }, null)]);
104
+ customClass
105
+ ]);
106
+ const controlButtonsClass = computed(() => ({
107
+ [ns.e("control-buttons")]: true,
108
+ disabled: props.disabled,
109
+ [ns.m(props.size)]: true
110
+ }));
111
+ const inputWrapClass = computed(() => ({
112
+ [ns.e("input-wrap")]: true,
113
+ [ns.m(props.size)]: true
114
+ }));
115
+ const inputInnerClass = computed(() => ({
116
+ [ns.e("input-box")]: true,
117
+ disabled: props.disabled
118
+ }));
119
+ return { wrapClass, customStyle, otherAttrs, controlButtonsClass, inputWrapClass, inputInnerClass };
120
+ }
121
+ function useExpose(ctx) {
122
+ const inputRef = ref();
123
+ const focus = () => {
124
+ inputRef.value.focus();
125
+ };
126
+ const blur = () => {
127
+ inputRef.value.blur();
128
+ };
129
+ const select = () => {
130
+ inputRef.value.select();
131
+ };
132
+ ctx.expose({ focus, blur, select });
133
+ return { inputRef };
134
+ }
135
+ function getPrecision(pre) {
136
+ let precision = 0;
137
+ if (isUndefined(pre)) {
138
+ return precision;
112
139
  }
113
- });
140
+ const preString = pre.toString();
141
+ const dotIndex = preString.indexOf(".");
142
+ if (dotIndex !== -1) {
143
+ precision = preString.length - dotIndex - 1;
144
+ }
145
+ return precision;
146
+ }
147
+ function useEvent(props, ctx, inputRef) {
148
+ const { min, max, step, disabled } = toRefs(props);
149
+ const state = reactive({
150
+ currentValue: props.modelValue || "",
151
+ userInputValue: void 0
152
+ });
153
+ const numPrecision = computed(() => {
154
+ if (!isUndefined(props.precision)) {
155
+ return props.precision;
156
+ } else {
157
+ return Math.max(getPrecision(props.modelValue), getPrecision(step.value));
158
+ }
159
+ });
160
+ const inputVal = computed(() => {
161
+ if (!isUndefined(state.userInputValue)) {
162
+ return state.userInputValue;
163
+ }
164
+ let currentValue = state.currentValue;
165
+ if (currentValue === "" || isUndefined(currentValue) || Number.isNaN(currentValue)) {
166
+ return "";
167
+ }
168
+ if (isNumber(currentValue)) {
169
+ currentValue = currentValue.toFixed(numPrecision.value);
170
+ }
171
+ return currentValue;
172
+ });
173
+ const toPrecision = (num) => {
174
+ return Number.parseFloat(num.toFixed(numPrecision.value));
175
+ };
176
+ const computeByStep = (val, addOrNot = 1) => {
177
+ if (!isNumber(val)) {
178
+ return state.currentValue;
179
+ }
180
+ return toPrecision(val + step.value * addOrNot);
181
+ };
182
+ const correctValue = (value, shouldUpdate) => {
183
+ if (value === "" || isUndefined(value) || isNull(value) || Number.isNaN(value)) {
184
+ return void 0;
185
+ }
186
+ let newVal = Number(value);
187
+ newVal = toPrecision(newVal);
188
+ if (newVal > max.value || newVal < min.value) {
189
+ newVal = newVal > max.value ? max.value : min.value;
190
+ shouldUpdate && ctx.emit("update:modelValue", newVal);
191
+ }
192
+ return newVal;
193
+ };
194
+ const setCurrentValue = (value) => {
195
+ const oldVal = state.currentValue;
196
+ const newVal = correctValue(value);
197
+ if (oldVal === newVal) {
198
+ return;
199
+ }
200
+ state.userInputValue = void 0;
201
+ ctx.emit("update:modelValue", newVal);
202
+ ctx.emit("input", newVal);
203
+ ctx.emit("change", newVal, oldVal);
204
+ state.currentValue = newVal;
205
+ };
206
+ const minDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue, -1) < props.min);
207
+ const maxDisabled = computed(() => isNumber(state.currentValue) && computeByStep(state.currentValue) > props.max);
208
+ const onAdd = () => {
209
+ if (disabled.value || maxDisabled.value) {
210
+ return;
211
+ }
212
+ inputRef.value.focus();
213
+ const newVal = computeByStep(state.currentValue || 0);
214
+ setCurrentValue(newVal);
215
+ };
216
+ const onSubtract = () => {
217
+ if (disabled.value || minDisabled.value) {
218
+ return;
219
+ }
220
+ inputRef.value.focus();
221
+ const newVal = computeByStep(state.currentValue || 0, -1);
222
+ setCurrentValue(newVal);
223
+ };
224
+ watch(() => props.modelValue, (val) => {
225
+ state.currentValue = correctValue(val, true);
226
+ state.userInputValue = void 0;
227
+ }, { immediate: true });
228
+ const onInput = (event) => {
229
+ const value = event.target.value;
230
+ state.userInputValue = value;
231
+ };
232
+ const onChange = (event) => {
233
+ const value = event.target.value;
234
+ const newVal = value !== "" ? Number(value) : "";
235
+ if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
236
+ setCurrentValue(newVal);
237
+ }
238
+ state.userInputValue = void 0;
239
+ };
240
+ return { inputVal, minDisabled, maxDisabled, onAdd, onSubtract, onInput, onChange };
241
+ }
242
+ var inputNumber = "";
114
243
  var InputNumber = defineComponent({
115
244
  name: "DInputNumber",
116
245
  props: inputNumberProps,
117
- emits: ["update:modelValue", "change", "input", "focus", "blur", "keydown"],
246
+ emits: ["update:modelValue", "change", "input"],
118
247
  setup(props, ctx) {
119
- const inputVal = ref(props.modelValue);
120
- const focusVal = ref("");
121
- const isSize = computed(() => {
122
- return `devui-input-number-${props.size}`;
123
- });
124
- const isDisabled = computed(() => {
125
- return props.disabled;
126
- });
127
- const add = () => {
128
- if (props.disabled)
129
- return;
130
- if (inputVal.value >= props.max)
131
- return;
132
- inputVal.value += props.step != 0 ? props.step : 1;
133
- focusVal.value = "active";
134
- ctx.emit("change", inputVal.value);
135
- ctx.emit("update:modelValue", inputVal.value);
136
- };
137
- const subtract = () => {
138
- if (props.disabled)
139
- return;
140
- if (inputVal.value <= props.min)
141
- return;
142
- inputVal.value -= props.step != 0 ? props.step : 1;
143
- focusVal.value = "active";
144
- ctx.emit("change", inputVal.value);
145
- ctx.emit("update:modelValue", inputVal.value);
146
- };
147
- const onInput = (val) => {
148
- inputVal.value = parseInt(val.data);
149
- ctx.emit("input", val.data);
150
- ctx.emit("update:modelValue", val.data);
151
- };
152
- const onFocus = ($event) => {
153
- focusVal.value = "active";
154
- ctx.emit("focus", $event);
155
- };
156
- const onBlur = ($event) => {
157
- focusVal.value = "";
158
- ctx.emit("blur", $event);
159
- };
160
- const onChange = ($event) => {
161
- ctx.emit("change", $event.target.value);
162
- };
163
- const onKeydown = ($event) => {
164
- ctx.emit("keydown", $event);
165
- };
166
- return {
167
- inputVal,
168
- focusVal,
169
- isDisabled,
170
- isSize,
171
- add,
172
- subtract,
173
- onInput,
174
- onChange,
175
- onKeydown,
176
- onBlur,
177
- onFocus
178
- };
179
- },
180
- render() {
181
248
  const {
182
- focusVal,
183
- placeholder,
184
- add,
249
+ disabled
250
+ } = toRefs(props);
251
+ const {
252
+ wrapClass,
253
+ customStyle,
254
+ otherAttrs,
255
+ controlButtonsClass,
256
+ inputWrapClass,
257
+ inputInnerClass
258
+ } = useRender(props, ctx);
259
+ const {
260
+ inputRef
261
+ } = useExpose(ctx);
262
+ const {
185
263
  inputVal,
186
- isDisabled,
187
- isSize,
188
- subtract,
264
+ minDisabled,
265
+ maxDisabled,
266
+ onAdd,
267
+ onSubtract,
189
268
  onInput,
190
- onChange,
191
- onKeydown,
192
- onBlur,
193
- onFocus
194
- } = this;
195
- const dInputNum = ["devui-input-number", isDisabled ? "devui-input-disabled" : "", isSize];
196
- return createVNode("div", {
197
- "class": dInputNum
198
- }, [createVNode("div", {
199
- "onBlur": onBlur,
200
- "tabindex": "1",
201
- "class": ["devui-control-buttons", focusVal.value]
269
+ onChange
270
+ } = useEvent(props, ctx, inputRef);
271
+ return () => createVNode("div", mergeProps({
272
+ "class": wrapClass.value
273
+ }, customStyle), [createVNode("div", {
274
+ "class": controlButtonsClass.value
202
275
  }, [createVNode("span", {
203
- "onClick": add
204
- }, [createVNode(Icon, {
205
- "size": "12px",
206
- "name": "chevron-up"
207
- }, null)]), createVNode("span", {
208
- "onClick": subtract
209
- }, [createVNode(Icon, {
210
- "size": "12px",
211
- "name": "chevron-down"
212
- }, null)])]), createVNode("div", {
213
- "class": "devui-input-item"
214
- }, [createVNode("input", {
276
+ "class": ["control-button control-inc", {
277
+ disabled: maxDisabled.value
278
+ }],
279
+ "onClick": onAdd
280
+ }, [createVNode(IncIcon, null, null)]), createVNode("span", {
281
+ "class": ["control-button control-dec", {
282
+ disabled: minDisabled.value
283
+ }],
284
+ "onClick": onSubtract
285
+ }, [createVNode(DecIcon, null, null)])]), createVNode("div", {
286
+ "class": inputWrapClass.value
287
+ }, [createVNode("input", mergeProps({
215
288
  "type": "number",
216
- "value": inputVal,
217
- "placeholder": placeholder,
218
- "disabled": isDisabled,
219
- "class": ["devui-input-style devui-input-box", focusVal.value],
289
+ "ref": inputRef,
290
+ "value": inputVal.value,
291
+ "placeholder": props.placeholder,
292
+ "disabled": disabled.value,
293
+ "class": inputInnerClass.value
294
+ }, otherAttrs, {
220
295
  "onInput": onInput,
221
- "onChange": onChange,
222
- "onFocus": onFocus,
223
- "onBlur": onBlur,
224
- "onKeydown": onKeydown
225
- }, null)])]);
296
+ "onChange": onChange
297
+ }), null)])]);
226
298
  }
227
299
  });
228
- InputNumber.install = function(app) {
229
- app.component(InputNumber.name, InputNumber);
230
- };
231
300
  var index = {
232
301
  title: "InputNumber \u6570\u5B57\u8F93\u5165\u6846",
233
302
  category: "\u6570\u636E\u5F55\u5165",
234
303
  status: "50%",
235
304
  install(app) {
236
- app.use(InputNumber);
305
+ app.component(InputNumber.name, InputNumber);
237
306
  }
238
307
  };
239
308
  export { InputNumber, index as default };
@@ -1 +1 @@
1
- var F=Object.defineProperty;var V=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var N=(n,e,a)=>e in n?F(n,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[e]=a,g=(n,e)=>{for(var a in e||(e={}))S.call(e,a)&&N(n,a,e[a]);if(V)for(var a of V(e))w.call(e,a)&&N(n,a,e[a]);return n};(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const a={placeholder:{type:String,default:void 0},disabled:{type:Boolean,default:!1},step:{type:Number,default:0},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},size:{type:String,default:""},modelValue:{type:Number,default:0},"onUpdate:modelValue":{type:Function,default:void 0},onChange:{type:Function,default:void 0},onKeydown:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},onBlur:{type:Function,default:void 0}};var z="",p=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return g({},t)},render(){const{name:t,size:u,color:i,classPrefix:d}=this;return e.createVNode(e.Fragment,null,[/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:u}},null):e.createVNode("i",{class:`${d} ${d}-${t}`,style:{fontSize:u,color:i}},null)])}}),l=e.defineComponent({name:"DInputNumber",props:a,emits:["update:modelValue","change","input","focus","blur","keydown"],setup(t,u){const i=e.ref(t.modelValue),d=e.ref(""),r=e.computed(()=>`devui-input-number-${t.size}`),s=e.computed(()=>t.disabled);return{inputVal:i,focusVal:d,isDisabled:s,isSize:r,add:()=>{t.disabled||i.value>=t.max||(i.value+=t.step!=0?t.step:1,d.value="active",u.emit("change",i.value),u.emit("update:modelValue",i.value))},subtract:()=>{t.disabled||i.value<=t.min||(i.value-=t.step!=0?t.step:1,d.value="active",u.emit("change",i.value),u.emit("update:modelValue",i.value))},onInput:o=>{i.value=parseInt(o.data),u.emit("input",o.data),u.emit("update:modelValue",o.data)},onChange:o=>{u.emit("change",o.target.value)},onKeydown:o=>{u.emit("keydown",o)},onBlur:o=>{d.value="",u.emit("blur",o)},onFocus:o=>{d.value="active",u.emit("focus",o)}}},render(){const{focusVal:t,placeholder:u,add:i,inputVal:d,isDisabled:r,isSize:s,subtract:m,onInput:f,onChange:y,onKeydown:b,onBlur:c,onFocus:v}=this,h=["devui-input-number",r?"devui-input-disabled":"",s];return e.createVNode("div",{class:h},[e.createVNode("div",{onBlur:c,tabindex:"1",class:["devui-control-buttons",t.value]},[e.createVNode("span",{onClick:i},[e.createVNode(p,{size:"12px",name:"chevron-up"},null)]),e.createVNode("span",{onClick:m},[e.createVNode(p,{size:"12px",name:"chevron-down"},null)])]),e.createVNode("div",{class:"devui-input-item"},[e.createVNode("input",{type:"number",value:d,placeholder:u,disabled:r,class:["devui-input-style devui-input-box",t.value],onInput:f,onChange:y,onFocus:v,onBlur:c,onKeydown:b},null)])])}});l.install=function(t){t.component(l.name,l)};var I={title:"InputNumber \u6570\u5B57\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"50%",install(t){t.use(l)}};n.InputNumber=l,n.default=I,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
1
+ (function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue))})(this,function(d,t){"use strict";const L={placeholder:{type:String},disabled:{type:Boolean,default:!1},step:{type:Number,default:1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},size:{type:String,default:""},modelValue:{type:Number},precision:{type:Number}};function v(e,o,r){let s=e;return o&&(s+=`__${o}`),r&&(s+=`--${r}`),s}function B(e,o=!1){const r=o?`.devui-${e}`:`devui-${e}`;return{b:()=>v(r),e:n=>n?v(r,n):"",m:n=>n?v(r,"",n):"",em:(n,i)=>n&&i?v(r,n,i):""}}const P=B("input-number");function k(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}function z(){return t.createVNode("svg",{class:P.e("icon-arrow"),width:"1em",height:"1em",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("path",{d:"M12.1464466,6.85355339 L8.35355339,10.6464466 C8.15829124,10.8417088 7.84170876,10.8417088 7.64644661,10.6464466 L3.85355339,6.85355339 C3.65829124,6.65829124 3.65829124,6.34170876 3.85355339,6.14644661 C3.94732158,6.05267842 4.07449854,6 4.20710678,6 L11.7928932,6 C12.0690356,6 12.2928932,6.22385763 12.2928932,6.5 C12.2928932,6.63260824 12.2402148,6.7597852 12.1464466,6.85355339 Z","fill-rule":"nonzero"},null)])])}const N=e=>typeof e=="number",h=e=>e===void 0,F=e=>e===null,f=B("input-number");function M(e,o){const{style:r,class:s,...c}=o.attrs,m={style:r},p=t.computed(()=>[{[f.b()]:!0},s]),n=t.computed(()=>({[f.e("control-buttons")]:!0,disabled:e.disabled,[f.m(e.size)]:!0})),i=t.computed(()=>({[f.e("input-wrap")]:!0,[f.m(e.size)]:!0})),V=t.computed(()=>({[f.e("input-box")]:!0,disabled:e.disabled}));return{wrapClass:p,customStyle:m,otherAttrs:c,controlButtonsClass:n,inputWrapClass:i,inputInnerClass:V}}function $(e){const o=t.ref(),r=()=>{o.value.focus()},s=()=>{o.value.blur()},c=()=>{o.value.select()};return e.expose({focus:r,blur:s,select:c}),{inputRef:o}}function D(e){let o=0;if(h(e))return o;const r=e.toString(),s=r.indexOf(".");return s!==-1&&(o=r.length-s-1),o}function A(e,o,r){const{min:s,max:c,step:m,disabled:p}=t.toRefs(e),n=t.reactive({currentValue:e.modelValue||"",userInputValue:void 0}),i=t.computed(()=>h(e.precision)?Math.max(D(e.modelValue),D(m.value)):e.precision),V=t.computed(()=>{if(!h(n.userInputValue))return n.userInputValue;let u=n.currentValue;return u===""||h(u)||Number.isNaN(u)?"":(N(u)&&(u=u.toFixed(i.value)),u)}),C=u=>Number.parseFloat(u.toFixed(i.value)),b=(u,a=1)=>N(u)?C(u+m.value*a):n.currentValue,w=(u,a)=>{if(u===""||h(u)||F(u)||Number.isNaN(u))return;let l=Number(u);return l=C(l),(l>c.value||l<s.value)&&(l=l>c.value?c.value:s.value,a&&o.emit("update:modelValue",l)),l},g=u=>{const a=n.currentValue,l=w(u);a!==l&&(n.userInputValue=void 0,o.emit("update:modelValue",l),o.emit("input",l),o.emit("change",l,a),n.currentValue=l)},I=t.computed(()=>N(n.currentValue)&&b(n.currentValue,-1)<e.min),y=t.computed(()=>N(n.currentValue)&&b(n.currentValue)>e.max),S=()=>{if(p.value||y.value)return;r.value.focus();const u=b(n.currentValue||0);g(u)},_=()=>{if(p.value||I.value)return;r.value.focus();const u=b(n.currentValue||0,-1);g(u)};return t.watch(()=>e.modelValue,u=>{n.currentValue=w(u,!0),n.userInputValue=void 0},{immediate:!0}),{inputVal:V,minDisabled:I,maxDisabled:y,onAdd:S,onSubtract:_,onInput:u=>{const a=u.target.value;n.userInputValue=a},onChange:u=>{const a=u.target.value,l=a!==""?Number(a):"";(N(l)&&!Number.isNaN(l)||a==="")&&g(l),n.userInputValue=void 0}}}var E="",x=t.defineComponent({name:"DInputNumber",props:L,emits:["update:modelValue","change","input"],setup(e,o){const{disabled:r}=t.toRefs(e),{wrapClass:s,customStyle:c,otherAttrs:m,controlButtonsClass:p,inputWrapClass:n,inputInnerClass:i}=M(e,o),{inputRef:V}=$(o),{inputVal:C,minDisabled:b,maxDisabled:w,onAdd:g,onSubtract:I,onInput:y,onChange:S}=A(e,o,V);return()=>t.createVNode("div",t.mergeProps({class:s.value},c),[t.createVNode("div",{class:p.value},[t.createVNode("span",{class:["control-button control-inc",{disabled:w.value}],onClick:g},[t.createVNode(k,null,null)]),t.createVNode("span",{class:["control-button control-dec",{disabled:b.value}],onClick:I},[t.createVNode(z,null,null)])]),t.createVNode("div",{class:n.value},[t.createVNode("input",t.mergeProps({type:"number",ref:V,value:C.value,placeholder:e.placeholder,disabled:r.value,class:i.value},m,{onInput:y,onChange:S}),null)])])}}),R={title:"InputNumber \u6570\u5B57\u8F93\u5165\u6846",category:"\u6570\u636E\u5F55\u5165",status:"50%",install(e){e.component(x.name,x)}};d.InputNumber=x,d.default=R,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1 +1 @@
1
- .devui-input-number{position:relative;display:inline-block;width:80px;line-height:38px;margin-right:12px}.devui-input-number:hover:not(.devui-input-disabled) .devui-input-box{border-color:var(--devui-form-control-line-hover)}.devui-input-number:hover:not(.devui-input-disabled) .devui-control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-hover)}.devui-input-number:focus-within .devui-control-buttons{display:flex}.devui-input-number .active{border:1px solid var(--devui-form-control-line-active)!important;display:flex!important}.devui-input-number.devui-input-disabled .devui-subtract,.devui-input-number.devui-input-disabled .devui-add,.devui-input-number.devui-input-disabled .devui-input-style{cursor:not-allowed;border-color:#e4e7ed;color:#e4e7ed}.devui-input-number.devui-input-disabled .devui-input-style{border-color:var(--devui-disabled-line)!important;color:var(--devui-disabled-text)!important;background-color:var(--devui-disabled-bg)!important}.devui-input-number.devui-input-number-sm .devui-subtract,.devui-input-number.devui-input-number-sm .devui-add{width:40px;height:34px;line-height:34px}.devui-input-number.devui-input-number-sm .devui-input-style{height:34px;line-height:34px}.devui-input-number.devui-input-number-lg .devui-subtract,.devui-input-number.devui-input-number-lg .devui-add{width:60px}.devui-input-number .devui-input-item{line-height:100%}.devui-input-number .devui-input-style::-webkit-outer-spin-button,.devui-input-number .devui-input-style::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.devui-input-number .devui-add,.devui-input-number .devui-subtract{display:inline-block;width:50px;height:38px;line-height:38px;text-align:center;font-size:16px;color:#333;background:#f5f7fa;cursor:pointer;border:1px solid #dcdfe6}.devui-input-number .devui-add{float:right;margin-left:-1px;border-radius:0 4px 4px 0}.devui-input-number .devui-subtract{float:left;margin-right:-1px;border-radius:4px 0 0 4px}.devui-input-number .devui-input-style{display:block;-moz-appearance:textfield}.devui-input-number .devui-input-style{outline:none;background-color:var(--devui-base-bg);border:1px solid var(--devui-form-control-line);border-radius:var(--devui-border-radius);padding:4px 8px;line-height:18px;font-size:var(--devui-font-size);color:var(--devui-text);width:100%;display:block;cursor:text;height:28px;transition:border-color .3s var(--devui-animation-ease-in-out-smooth)}.devui-input-number .devui-input-box{box-sizing:border-box;padding:4px 8px;font-size:var(--devui-font-size);vertical-align:middle;border-radius:var(--devui-border-radius);outline:none;width:100%;line-height:20px;height:28px;border-width:1px;border-style:solid}.devui-input-number .devui-input-box:not(.disabled){background-color:var(--devui-base-bg);border-color:var(--devui-line);color:var(--devui-text)}.devui-input-number .disabled{cursor:not-allowed}.devui-input-number .devui-control-buttons{display:none;position:absolute;right:0;width:22px;height:100%;flex-direction:column;justify-content:center;align-items:center;border-left:1px solid var(--devui-line);box-sizing:border-box;line-height:100%;border-radius:0 var(--devui-border-radius) var(--devui-border-radius) 0}.devui-input-number .devui-control-buttons:not(.disabled){cursor:pointer}.devui-input-number .devui-control-buttons>span{display:flex}
1
+ .devui-input-number{position:relative;display:inline-block;width:80px}.devui-input-number:hover .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-hover, #575d6c);padding-right:24px}.devui-input-number:hover .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-hover, #575d6c)}.devui-input-number:focus-within .devui-input-number__input-box:not(.disabled){border:1px solid var(--devui-form-control-line-active, #5e7ce0);padding-right:24px}.devui-input-number:focus-within .devui-input-number__control-buttons:not(.disabled){display:flex;border-color:var(--devui-form-control-line-active, #5e7ce0)}.devui-input-number.devui-input-number--md{width:80px}.devui-input-number.devui-input-number--md .devui-input-number__input-box{height:32px;line-height:32px}.devui-input-number .devui-input-number__input-box{box-sizing:border-box;padding:4px 8px;font-size:var(--devui-font-size, 14px);border-radius:var(--devui-border-radius, 4px);border:1px solid var(--devui-form-control-line, #d7d8da);outline:none;width:100%;line-height:20px;height:28px;display:block;cursor:text;-moz-appearance:textfield;transition:border-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-input-number .devui-input-number__input-box:not(.disabled){background-color:var(--devui-base-bg, #ffffff);border-color:var(--devui-line, #d7d8da);color:var(--devui-text, #252b3a)}.devui-input-number .devui-input-number__input-box::-webkit-inner-spin-button,.devui-input-number .devui-input-number__input-box::-webkit-outer-spin-button{-webkit-appearance:none}.devui-input-number .devui-input-number__control-buttons{display:none;position:absolute;right:0;width:22px;height:100%;flex-direction:column;justify-content:center;align-items:center;border:1px solid transparent;border-left-color:var(--devui-line, #d7d8da);box-sizing:border-box;line-height:100%;border-radius:0 var(--devui-border-radius, 4px) var(--devui-border-radius, 4px) 0}.devui-input-number .devui-input-number__control-buttons.disabled{border-left-color:var(--devui-disabled-line, #dfe1e6)}.devui-input-number .devui-input-number__control-buttons .control-button{user-select:none;box-sizing:border-box;height:50%;line-height:50%;border-width:0 1px;transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1));display:flex;justify-content:center;align-items:center;background-color:var(--devui-base-bg, #ffffff)}.devui-input-number .devui-input-number__control-buttons .control-button.control-inc svg{position:relative;top:2px;transform:rotate(180deg)}.devui-input-number .devui-input-number__control-buttons .control-button.control-dec svg{position:relative;bottom:2px}.devui-input-number .devui-input-number__control-buttons .control-button svg path{fill:var(--devui-text-weak, #575d6c)}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled){cursor:pointer}.devui-input-number .devui-input-number__control-buttons .control-button:not(.disabled):hover>svg path{fill:var(--devui-icon-fill-active-hover, #252b3a)}.devui-input-number .devui-input-number__control-buttons .control-button.disabled>svg path{fill:var(--devui-disabled-text, #adb0b8)}.devui-input-number .devui-input-number--lg>.devui-input-number__input-box{font-size:var(--devui-font-size-lg, 14px);line-height:24px;height:46px}.devui-input-number .devui-input-number--lg.devui-input-number__control-buttons .control-button .devui-input-number__icon-arrow{width:16px;height:16px}.devui-input-number .devui-input-number--md>.devui-input-number__input-box{font-size:var(--devui-font-size, 14px);line-height:20px;height:28px}.devui-input-number .devui-input-number--sm>.devui-input-number__input-box{font-size:var(--devui-font-size-sm, 12px);line-height:18px;height:26px}.devui-input-number .devui-input-number--sm.devui-input-number__control-buttons .control-button:first-child .devui-input-number__icon-arrow{width:14px;height:14px}.devui-input-number .devui-input-number--sm.devui-input-number__control-buttons .control-button:last-child .devui-input-number__icon-arrow{width:14px;height:14px}.devui-input-number .devui-input-number__input-wrap{line-height:100%}.devui-input-number .disabled{cursor:not-allowed}
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ declare function install(app: App): void
3
+ declare const _default: {
4
+ install: typeof install;
5
+ version: string;
6
+ };
7
+ export default _default;