vue-devui 1.0.0-alpha.6 → 1.0.0-beta.12

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 (344) hide show
  1. package/README.md +32 -35
  2. package/accordion/index.d.ts +7 -0
  3. package/accordion/index.es.js +508 -1
  4. package/accordion/index.umd.js +1 -1
  5. package/accordion/style.css +1 -1
  6. package/alert/index.d.ts +7 -0
  7. package/alert/index.es.js +178 -1
  8. package/alert/index.umd.js +1 -1
  9. package/alert/style.css +1 -1
  10. package/anchor/index.d.ts +7 -0
  11. package/anchor/index.es.js +263 -1
  12. package/anchor/index.umd.js +1 -1
  13. package/avatar/index.d.ts +7 -0
  14. package/avatar/index.es.js +301 -1
  15. package/avatar/index.umd.js +1 -1
  16. package/back-top/index.d.ts +7 -0
  17. package/back-top/index.es.js +128 -0
  18. package/back-top/index.umd.js +1 -0
  19. package/back-top/package.json +7 -0
  20. package/back-top/style.css +1 -0
  21. package/badge/index.d.ts +7 -0
  22. package/badge/index.es.js +95 -1
  23. package/badge/index.umd.js +1 -1
  24. package/breadcrumb/index.d.ts +7 -0
  25. package/breadcrumb/index.es.js +127 -1
  26. package/breadcrumb/index.umd.js +1 -1
  27. package/button/index.d.ts +7 -0
  28. package/button/index.es.js +392 -1
  29. package/button/index.umd.js +1 -1
  30. package/button/style.css +1 -1
  31. package/card/index.d.ts +7 -0
  32. package/card/index.es.js +61 -1
  33. package/card/index.umd.js +1 -1
  34. package/carousel/index.d.ts +7 -0
  35. package/carousel/index.es.js +329 -1
  36. package/carousel/index.umd.js +1 -1
  37. package/cascader/index.d.ts +7 -0
  38. package/cascader/index.es.js +1343 -1
  39. package/cascader/index.umd.js +1 -1
  40. package/cascader/style.css +1 -1
  41. package/checkbox/index.d.ts +7 -0
  42. package/checkbox/index.es.js +377 -1
  43. package/checkbox/index.umd.js +1 -1
  44. package/comment/index.d.ts +7 -0
  45. package/comment/index.es.js +85 -0
  46. package/comment/index.umd.js +1 -0
  47. package/comment/package.json +7 -0
  48. package/comment/style.css +1 -0
  49. package/countdown/index.d.ts +7 -0
  50. package/countdown/index.es.js +176 -0
  51. package/countdown/index.umd.js +1 -0
  52. package/countdown/package.json +7 -0
  53. package/countdown/style.css +1 -0
  54. package/date-picker/index.d.ts +7 -0
  55. package/date-picker/index.es.js +1172 -1
  56. package/date-picker/index.umd.js +1 -1
  57. package/date-picker/style.css +1 -1
  58. package/dragdrop/index.d.ts +7 -0
  59. package/dragdrop/index.es.js +32 -0
  60. package/dragdrop/index.umd.js +1 -0
  61. package/dragdrop/package.json +7 -0
  62. package/drawer/index.d.ts +7 -0
  63. package/drawer/index.es.js +287 -0
  64. package/drawer/index.umd.js +1 -0
  65. package/drawer/package.json +7 -0
  66. package/drawer/style.css +1 -0
  67. package/dropdown/index.d.ts +7 -0
  68. package/dropdown/index.es.js +535 -0
  69. package/dropdown/index.umd.js +1 -0
  70. package/dropdown/package.json +7 -0
  71. package/dropdown/style.css +1 -0
  72. package/editable-select/index.d.ts +7 -0
  73. package/editable-select/index.es.js +5857 -1
  74. package/editable-select/index.umd.js +27 -1
  75. package/editable-select/style.css +1 -1
  76. package/form/index.d.ts +7 -0
  77. package/form/index.es.js +2244 -0
  78. package/form/index.umd.js +1 -0
  79. package/form/package.json +7 -0
  80. package/form/style.css +1 -0
  81. package/fullscreen/index.d.ts +7 -0
  82. package/fullscreen/index.es.js +163 -1
  83. package/fullscreen/index.umd.js +1 -1
  84. package/gantt/index.d.ts +7 -0
  85. package/gantt/index.es.js +535 -0
  86. package/gantt/index.umd.js +1 -0
  87. package/gantt/package.json +7 -0
  88. package/gantt/style.css +1 -0
  89. package/grid/index.d.ts +7 -0
  90. package/grid/index.es.js +269 -0
  91. package/grid/index.umd.js +1 -0
  92. package/grid/package.json +7 -0
  93. package/grid/style.css +1 -0
  94. package/icon/index.d.ts +7 -0
  95. package/icon/index.es.js +75 -1
  96. package/icon/index.umd.js +1 -1
  97. package/image-preview/index.d.ts +7 -0
  98. package/image-preview/index.es.js +498 -1
  99. package/image-preview/index.umd.js +1 -1
  100. package/image-preview/style.css +1 -1
  101. package/index.d.ts +7 -0
  102. package/input/index.d.ts +7 -0
  103. package/input/index.es.js +190 -1
  104. package/input/index.umd.js +1 -1
  105. package/input-icon/index.d.ts +7 -0
  106. package/input-icon/index.es.js +332 -0
  107. package/input-icon/index.umd.js +1 -0
  108. package/input-icon/package.json +7 -0
  109. package/input-icon/style.css +1 -0
  110. package/input-number/index.d.ts +7 -0
  111. package/input-number/index.es.js +240 -1
  112. package/input-number/index.umd.js +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +100 -0
  115. package/layout/index.umd.js +1 -0
  116. package/layout/package.json +7 -0
  117. package/layout/style.css +1 -0
  118. package/loading/index.d.ts +7 -0
  119. package/loading/index.es.js +256 -1
  120. package/loading/index.umd.js +1 -1
  121. package/modal/index.d.ts +7 -0
  122. package/modal/index.es.js +1225 -1
  123. package/modal/index.umd.js +1 -1
  124. package/modal/style.css +1 -1
  125. package/nav-sprite/index.d.ts +7 -0
  126. package/nav-sprite/index.es.js +742 -0
  127. package/nav-sprite/index.umd.js +1 -0
  128. package/nav-sprite/package.json +7 -0
  129. package/nuxt/components/Accordion.js +3 -0
  130. package/nuxt/components/Alert.js +3 -0
  131. package/nuxt/components/Anchor.js +3 -0
  132. package/nuxt/components/Aside.js +3 -0
  133. package/nuxt/components/Avatar.js +3 -0
  134. package/nuxt/components/BackTop.js +3 -0
  135. package/nuxt/components/Badge.js +3 -0
  136. package/nuxt/components/Breadcrumb.js +3 -0
  137. package/nuxt/components/Button.js +3 -0
  138. package/nuxt/components/Card.js +3 -0
  139. package/nuxt/components/Carousel.js +3 -0
  140. package/nuxt/components/Cascader.js +3 -0
  141. package/nuxt/components/Checkbox.js +3 -0
  142. package/nuxt/components/Col.js +3 -0
  143. package/nuxt/components/Column.js +3 -0
  144. package/nuxt/components/Comment.js +3 -0
  145. package/nuxt/components/Content.js +3 -0
  146. package/nuxt/components/Countdown.js +3 -0
  147. package/nuxt/components/DatePicker.js +3 -0
  148. package/nuxt/components/Drawer.js +3 -0
  149. package/nuxt/components/Dropdown.js +3 -0
  150. package/nuxt/components/EditableSelect.js +3 -0
  151. package/nuxt/components/FixedOverlay.js +3 -0
  152. package/nuxt/components/FlexibleOverlay.js +3 -0
  153. package/nuxt/components/Footer.js +3 -0
  154. package/nuxt/components/Form.js +3 -0
  155. package/nuxt/components/FormControl.js +3 -0
  156. package/nuxt/components/FormItem.js +3 -0
  157. package/nuxt/components/FormLabel.js +3 -0
  158. package/nuxt/components/FormOperation.js +3 -0
  159. package/nuxt/components/Fullscreen.js +3 -0
  160. package/nuxt/components/Gantt.js +3 -0
  161. package/nuxt/components/Header.js +3 -0
  162. package/nuxt/components/Icon.js +2 -0
  163. package/nuxt/components/ImagePreviewService.js +3 -0
  164. package/nuxt/components/Input.js +3 -0
  165. package/nuxt/components/InputIcon.js +3 -0
  166. package/nuxt/components/InputNumber.js +3 -0
  167. package/nuxt/components/Layout.js +3 -0
  168. package/nuxt/components/Loading.js +3 -0
  169. package/nuxt/components/LoadingService.js +3 -0
  170. package/nuxt/components/Modal.js +3 -0
  171. package/nuxt/components/NavSprite.js +2 -0
  172. package/nuxt/components/Pagination.js +3 -0
  173. package/nuxt/components/Panel.js +3 -0
  174. package/nuxt/components/Popover.js +3 -0
  175. package/nuxt/components/Progress.js +3 -0
  176. package/nuxt/components/QuadrantDiagram.js +3 -0
  177. package/nuxt/components/Radio.js +3 -0
  178. package/nuxt/components/RadioGroup.js +3 -0
  179. package/nuxt/components/Rate.js +3 -0
  180. package/nuxt/components/ReadTip.js +3 -0
  181. package/nuxt/components/Result.js +3 -0
  182. package/nuxt/components/Row.js +3 -0
  183. package/nuxt/components/Search.js +3 -0
  184. package/nuxt/components/Select.js +3 -0
  185. package/nuxt/components/Skeleton.js +3 -0
  186. package/nuxt/components/SkeletonItem.js +3 -0
  187. package/nuxt/components/Slider.js +3 -0
  188. package/nuxt/components/Splitter.js +3 -0
  189. package/nuxt/components/Statistic.js +3 -0
  190. package/nuxt/components/Status.js +3 -0
  191. package/nuxt/components/StepsGuide.js +3 -0
  192. package/nuxt/components/StickSlider.js +3 -0
  193. package/nuxt/components/Sticky.js +2 -0
  194. package/nuxt/components/Switch.js +3 -0
  195. package/nuxt/components/Table.js +3 -0
  196. package/nuxt/components/Tabs.js +3 -0
  197. package/nuxt/components/Tag.js +3 -0
  198. package/nuxt/components/TagInput.js +3 -0
  199. package/nuxt/components/Textarea.js +3 -0
  200. package/nuxt/components/TimeAxis.js +3 -0
  201. package/nuxt/components/TimeAxisItem.js +3 -0
  202. package/nuxt/components/TimePicker.js +3 -0
  203. package/nuxt/components/Toast.js +3 -0
  204. package/nuxt/components/ToastService.js +3 -0
  205. package/nuxt/components/Tooltip.js +3 -0
  206. package/nuxt/components/Transfer.js +3 -0
  207. package/nuxt/components/Tree.js +3 -0
  208. package/nuxt/components/TreeSelect.js +3 -0
  209. package/nuxt/components/Upload.js +3 -0
  210. package/nuxt/components/buttonProps.js +3 -0
  211. package/nuxt/index.js +13 -0
  212. package/overlay/index.d.ts +7 -0
  213. package/overlay/index.es.js +368 -1
  214. package/overlay/index.umd.js +1 -1
  215. package/overlay/style.css +1 -1
  216. package/package.json +6 -47
  217. package/pagination/index.d.ts +7 -0
  218. package/pagination/index.es.js +642 -1
  219. package/pagination/index.umd.js +1 -1
  220. package/panel/index.d.ts +7 -0
  221. package/panel/index.es.js +205 -1
  222. package/panel/index.umd.js +1 -1
  223. package/panel/style.css +1 -1
  224. package/popover/index.d.ts +7 -0
  225. package/popover/index.es.js +236 -1
  226. package/popover/index.umd.js +1 -1
  227. package/progress/index.d.ts +7 -0
  228. package/progress/index.es.js +153 -1
  229. package/progress/index.umd.js +3 -1
  230. package/quadrant-diagram/index.d.ts +7 -0
  231. package/quadrant-diagram/index.es.js +489 -1
  232. package/quadrant-diagram/index.umd.js +1 -1
  233. package/radio/index.d.ts +7 -0
  234. package/radio/index.es.js +225 -1
  235. package/radio/index.umd.js +1 -1
  236. package/rate/index.d.ts +7 -0
  237. package/rate/index.es.js +220 -1
  238. package/rate/index.umd.js +1 -1
  239. package/read-tip/index.d.ts +7 -0
  240. package/read-tip/index.es.js +258 -0
  241. package/read-tip/index.umd.js +1 -0
  242. package/read-tip/package.json +7 -0
  243. package/read-tip/style.css +1 -0
  244. package/result/index.d.ts +7 -0
  245. package/result/index.es.js +119 -0
  246. package/result/index.umd.js +1 -0
  247. package/result/package.json +7 -0
  248. package/result/style.css +1 -0
  249. package/ripple/index.d.ts +7 -0
  250. package/ripple/index.es.js +181 -1
  251. package/ripple/index.umd.js +1 -1
  252. package/search/index.d.ts +7 -0
  253. package/search/index.es.js +543 -1
  254. package/search/index.umd.js +1 -1
  255. package/select/index.d.ts +7 -0
  256. package/select/index.es.js +706 -1
  257. package/select/index.umd.js +1 -1
  258. package/skeleton/index.d.ts +7 -0
  259. package/skeleton/index.es.js +297 -1
  260. package/skeleton/index.umd.js +1 -1
  261. package/skeleton/style.css +1 -1
  262. package/slider/index.d.ts +7 -0
  263. package/slider/index.es.js +199 -1
  264. package/slider/index.umd.js +1 -1
  265. package/slider/style.css +1 -1
  266. package/splitter/index.d.ts +7 -0
  267. package/splitter/index.es.js +636 -1
  268. package/splitter/index.umd.js +1 -1
  269. package/statistic/index.d.ts +7 -0
  270. package/statistic/index.es.js +280 -0
  271. package/statistic/index.umd.js +1 -0
  272. package/statistic/package.json +7 -0
  273. package/statistic/style.css +1 -0
  274. package/status/index.d.ts +7 -0
  275. package/status/index.es.js +42 -1
  276. package/status/index.umd.js +1 -1
  277. package/steps-guide/index.d.ts +7 -0
  278. package/steps-guide/index.es.js +239 -1
  279. package/steps-guide/index.umd.js +1 -1
  280. package/steps-guide/style.css +1 -1
  281. package/sticky/index.d.ts +7 -0
  282. package/sticky/index.es.js +197 -1
  283. package/sticky/index.umd.js +1 -1
  284. package/style.css +1 -1
  285. package/switch/index.d.ts +7 -0
  286. package/switch/index.es.js +100 -1
  287. package/switch/index.umd.js +1 -1
  288. package/switch/style.css +1 -1
  289. package/table/index.d.ts +7 -0
  290. package/table/index.es.js +1836 -1
  291. package/table/index.umd.js +1 -1
  292. package/table/style.css +1 -1
  293. package/tabs/index.d.ts +7 -0
  294. package/tabs/index.es.js +195 -1
  295. package/tabs/index.umd.js +1 -1
  296. package/tabs/style.css +1 -1
  297. package/tag/index.d.ts +7 -0
  298. package/tag/index.es.js +131 -0
  299. package/tag/index.umd.js +1 -0
  300. package/tag/package.json +7 -0
  301. package/tag/style.css +1 -0
  302. package/tag-input/index.d.ts +7 -0
  303. package/tag-input/index.es.js +329 -1
  304. package/tag-input/index.umd.js +1 -1
  305. package/textarea/index.d.ts +7 -0
  306. package/textarea/index.es.js +132 -0
  307. package/textarea/index.umd.js +1 -0
  308. package/textarea/package.json +7 -0
  309. package/textarea/style.css +1 -0
  310. package/time-axis/index.d.ts +7 -0
  311. package/time-axis/index.es.js +299 -0
  312. package/time-axis/index.umd.js +1 -0
  313. package/time-axis/package.json +7 -0
  314. package/time-axis/style.css +1 -0
  315. package/time-picker/index.d.ts +7 -0
  316. package/time-picker/index.es.js +1260 -1
  317. package/time-picker/index.umd.js +1 -1
  318. package/time-picker/style.css +1 -1
  319. package/toast/index.d.ts +7 -0
  320. package/toast/index.es.js +2060 -1
  321. package/toast/index.umd.js +1 -1
  322. package/toast/style.css +1 -1
  323. package/tooltip/index.d.ts +7 -0
  324. package/tooltip/index.es.js +171 -1
  325. package/tooltip/index.umd.js +1 -1
  326. package/transfer/index.d.ts +7 -0
  327. package/transfer/index.es.js +1725 -1
  328. package/transfer/index.umd.js +1 -1
  329. package/transfer/style.css +1 -1
  330. package/tree/index.d.ts +7 -0
  331. package/tree/index.es.js +907 -1
  332. package/tree/index.umd.js +1 -1
  333. package/tree/style.css +1 -1
  334. package/tree-select/index.d.ts +7 -0
  335. package/tree-select/index.es.js +528 -0
  336. package/tree-select/index.umd.js +1 -0
  337. package/tree-select/package.json +7 -0
  338. package/tree-select/style.css +1 -0
  339. package/upload/index.d.ts +7 -0
  340. package/upload/index.es.js +2834 -1
  341. package/upload/index.umd.js +1 -1
  342. package/upload/style.css +1 -1
  343. package/vue-devui.es.js +27777 -1
  344. package/vue-devui.umd.js +29 -1
@@ -1 +1 @@
1
- !function(i,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],e):e((i="undefined"!=typeof globalThis?globalThis:i||self).index={},i.Vue)}(this,(function(i,e){"use strict";const a={tickWidth:10,spaceBetweenLabelsAxis:20,xAxisLabel:"紧急度",yAxisLabel:"重要度",xAxisRange:{min:0,max:100,step:10},yAxisRange:{min:0,max:50,step:5},originPosition:{left:30,bottom:30},axisMargin:35,xWeight:1,yWeight:1},t={diagramId:{type:String,default:"1"},axisConfigs:{type:Object,default:a},view:{type:Object,default:{height:900,width:950}}},n={diagramId:{type:String},axisConfigs:{type:Object},view:{type:Object}};var s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,r=s||l||Function("return this")(),u=r.Symbol,o=Object.prototype,x=o.hasOwnProperty,c=o.toString,g=u?u.toStringTag:void 0;var v=Object.prototype.toString;var f=u?u.toStringTag:void 0;function d(i){return null==i?void 0===i?"[object Undefined]":"[object Null]":f&&f in Object(i)?function(i){var e=x.call(i,g),a=i[g];try{i[g]=void 0;var t=!0}catch(s){}var n=c.call(i);return t&&(e?i[g]=a:delete i[g]),n}(i):function(i){return v.call(i)}(i)}var p=/\s/;var y=/^\s+/;function T(i){return i?i.slice(0,function(i){for(var e=i.length;e--&&p.test(i.charAt(e)););return e}(i)+1).replace(y,""):i}function m(i){var e=typeof i;return null!=i&&("object"==e||"function"==e)}var h=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,b=/^0o[0-7]+$/i,k=parseInt;function A(i){if("number"==typeof i)return i;if(function(i){return"symbol"==typeof i||function(i){return null!=i&&"object"==typeof i}(i)&&"[object Symbol]"==d(i)}(i))return NaN;if(m(i)){var e="function"==typeof i.valueOf?i.valueOf():i;i=m(e)?e+"":e}if("string"!=typeof i)return 0===i?i:+i;i=T(i);var a=O.test(i);return a||b.test(i)?k(i.slice(2),a?2:8):h.test(i)?NaN:+i}var S=function(){return r.Date.now()},N=Math.max,w=Math.min;function R(i,e,a){var t,n,s,l,r,u,o=0,x=!1,c=!1,g=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function v(e){var a=t,s=n;return t=n=void 0,o=e,l=i.apply(s,a)}function f(i){return o=i,r=setTimeout(p,e),x?v(i):l}function d(i){var a=i-u;return void 0===u||a>=e||a<0||c&&i-o>=s}function p(){var i=S();if(d(i))return y(i);r=setTimeout(p,function(i){var a=e-(i-u);return c?w(a,s-(i-o)):a}(i))}function y(i){return r=void 0,g&&t?v(i):(t=n=void 0,l)}function T(){var i=S(),a=d(i);if(t=arguments,n=this,u=i,a){if(void 0===r)return f(u);if(c)return clearTimeout(r),r=setTimeout(p,e),v(u)}return void 0===r&&(r=setTimeout(p,e)),l}return e=A(e)||0,m(a)&&(x=!!a.leading,s=(c="maxWait"in a)?N(A(a.maxWait)||0,e):s,g="trailing"in a?!!a.trailing:g),T.cancel=function(){void 0!==r&&clearTimeout(r),o=0,t=u=n=r=void 0},T.flush=function(){return void 0===r?l:y(S())},T}var j=e.defineComponent({name:"DQuadrantDiagramAxis",props:n,setup(i){const{diagramId:a,view:t,axisConfigs:n}=e.toRefs(i),s=e.ref("#0000ff"),l=e.ref("#ff0000"),r=e.ref(),u=e.ref(),o=e.reactive({axisOrigin:{x:0,y:0},axisTop:0,axisRight:0,axisWidth:0,axisHeight:0,yAxisTicksNum:0,xAxisTicksNum:0,xTickSpacing:0,yTickSpacing:0}),x=n.value;e.onMounted((()=>{c()})),e.watch(t.value,(()=>{c()}));const c=R((()=>{g(),v(),f(),m()}),200),g=()=>{r.value=document.querySelector("#devui-quadrant-axis-"+a.value)},v=()=>{u.value=r.value.getContext("2d"),o.axisOrigin=x.axisOrigin,o.axisTop=x.axisTop,o.axisRight=x.axisRight,o.axisWidth=x.axisWidth,o.axisHeight=x.axisHeight,o.yAxisTicksNum=x.yAxisTicksNum,o.xAxisTicksNum=x.xAxisTicksNum,o.xTickSpacing=x.xTickSpacing,o.yTickSpacing=x.yTickSpacing},f=()=>{u.value.save(),u.value.fillStyle=s.value,u.value.strokeStyle=s.value,p(),d(),u.value.lineWidth=.5,y(),T(),u.value.restore()},d=()=>{u.value.beginPath(),u.value.moveTo(o.axisOrigin.x,o.axisOrigin.y),u.value.lineTo(o.axisOrigin.x,o.axisTop-x.axisMargin),u.value.stroke(),u.value.moveTo(o.axisOrigin.x,o.axisTop-x.axisMargin),u.value.lineTo(o.axisOrigin.x+5,o.axisTop-x.axisMargin+10),u.value.lineTo(o.axisOrigin.x-5,o.axisTop-x.axisMargin+10),u.value.fill()},p=()=>{u.value.beginPath(),u.value.moveTo(o.axisOrigin.x,o.axisOrigin.y),u.value.lineTo(o.axisRight+x.axisMargin-10,o.axisOrigin.y),u.value.stroke(),u.value.moveTo(o.axisRight+x.axisMargin,o.axisOrigin.y),u.value.lineTo(o.axisRight+x.axisMargin-10,o.axisOrigin.y+5),u.value.lineTo(o.axisRight+x.axisMargin-10,o.axisOrigin.y-5),u.value.fill()},y=()=>{let i;for(let e=1;e<o.xAxisTicksNum;e++)u.value.beginPath(),i=e%x.xAxisRange.step==0?x.tickWidth:x.tickWidth/2,u.value.moveTo(o.axisOrigin.x+e*o.xTickSpacing,o.axisOrigin.y-i),u.value.lineTo(o.axisOrigin.x+e*o.xTickSpacing,o.axisOrigin.y+i),u.value.stroke()},T=()=>{let i;for(let e=1;e<o.yAxisTicksNum;e++)u.value.beginPath(),i=e%x.yAxisRange.step==0?x.tickWidth:x.tickWidth/2,u.value.moveTo(o.axisOrigin.x-i,o.axisOrigin.y-e*o.yTickSpacing),u.value.lineTo(o.axisOrigin.x+i,o.axisOrigin.y-e*o.yTickSpacing),u.value.stroke()},m=()=>{u.value.save(),u.value.fillStyle=l.value,h(),O(),u.value.restore(),b()},h=()=>{u.value.textAlign="center",u.value.textBaseline="top";for(let i=0;i<=o.xAxisTicksNum;i++)i%x.xAxisRange.step==0&&u.value.fillText(i,o.axisOrigin.x+i*o.xTickSpacing,o.axisOrigin.y+x.spaceBetweenLabelsAxis)},O=()=>{u.value.textAlign="center",u.value.textBaseline="middle";for(let i=0;i<=o.yAxisTicksNum;i++)i%x.yAxisRange.step==0&&u.value.fillText(i,o.axisOrigin.x-x.spaceBetweenLabelsAxis,o.axisOrigin.y-i*o.yTickSpacing)},b=()=>{u.value.font="12px Microsoft YaHei",u.value.textAlign="left",u.value.fillStyle=l.value;const i=u.value.measureText(x.xAxisLabel).width;k(x.xAxisLabel,o.axisRight+x.axisMargin/2,o.axisOrigin.y-i-15),u.value.fillText(x.yAxisLabel,o.axisOrigin.x+15,o.axisTop-x.axisMargin/2)},k=(i,e,a)=>{for(let t=0;t<i.length;t++){const n=i.slice(t,t+1).toString();n.match(/[A-Za-z0-9]/)?(u.value.save(),u.value.translate(e,a),u.value.rotate(Math.PI/180*90),u.value.textBaseline="bottom",u.value.fillText(n,0,0),u.value.restore(),a+=u.value.measureText(n).width):n.match(/[\u4E00-\u9FA5]/)&&(u.value.save(),u.value.textBaseline="top",u.value.fillText(n,e,a),u.value.restore(),a+=u.value.measureText(n).width)}}},render(){const{diagramId:i,view:a}=this;return e.createVNode("div",null,[e.createVNode("canvas",{id:"devui-quadrant-axis-"+i,height:a.height,width:a.width},null)])}}),M=e.defineComponent({name:"DQuadrantDiagram",props:t,setup(i){const{diagramId:t,axisConfigs:n,view:s}=e.toRefs(i),l=e.reactive({axisOrigin:{x:null,y:null},axisTop:null,axisRight:null,axisWidth:null,axisHeight:null,yAxisTicksNum:null,xAxisTicksNum:null,xTickSpacing:null,yTickSpacing:null}),r=()=>{const i=Object.keys(a);for(let e=0;e<i.length;e++)void 0===l[i[e]]&&(l[i[e]]=a[i[e]]);l.axisOrigin={x:n.value.originPosition.left,y:s.value.height-n.value.originPosition.bottom},l.axisTop=n.value.axisMargin,l.axisRight=s.value.width-n.value.axisMargin,l.axisWidth=l.axisRight-l.axisOrigin.x,l.axisHeight=l.axisOrigin.y-l.axisTop,l.yAxisTicksNum=n.value.yAxisRange.max-n.value.yAxisRange.min,l.xAxisTicksNum=n.value.xAxisRange.max-n.value.xAxisRange.min,l.xTickSpacing=l.axisWidth/l.xAxisTicksNum,l.yTickSpacing=l.axisHeight/l.yAxisTicksNum};return r(),e.watch(s.value,(()=>{r()})),{diagramId:t,calAxisConfig:l}},render(){const{diagramId:i,calAxisConfig:a,view:t}=this;return e.createVNode("div",{class:"devui-quadrant-diagram",id:i},[e.createVNode(j,{diagramId:i,axisConfigs:a,view:t},null)])}});M.install=function(i){i.component(M.name,M)};var W={title:"QuadrantDiagram 象限图",category:"数据展示",status:"10%",install(i){i.use(M)}};i.QuadrantDiagram=M,i.default=W,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"}));
1
+ (function(f,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(f=typeof globalThis!="undefined"?globalThis:f||self,o(f.index={},f.Vue))})(this,function(f,o){"use strict";const j={tickWidth:10,spaceBetweenLabelsAxis:20,xAxisLabel:"\u7D27\u6025\u5EA6",yAxisLabel:"\u91CD\u8981\u5EA6",xAxisRange:{min:0,max:100,step:10},yAxisRange:{min:0,max:50,step:5},originPosition:{left:30,bottom:30},axisMargin:35,xWeight:1,yWeight:1},X={height:900,width:950},E=15,q={diagramId:{type:String,default:"1"},axisConfigs:{type:Object,default:j},view:{type:Object,default:X}},H={diagramId:{type:String},axisConfigs:{type:Object},view:{type:Object}};var V=typeof global=="object"&&global&&global.Object===Object&&global,Q=V,G=typeof self=="object"&&self&&self.Object===Object&&self,Y=Q||G||Function("return this")(),P=Y,U=P.Symbol,S=U,_=Object.prototype,z=_.hasOwnProperty,K=_.toString,p=S?S.toStringTag:void 0;function Z(e){var r=z.call(e,p),l=e[p];try{e[p]=void 0;var c=!0}catch{}var s=K.call(e);return c&&(r?e[p]=l:delete e[p]),s}var J=Object.prototype,ii=J.toString;function ei(e){return ii.call(e)}var ai="[object Null]",ti="[object Undefined]",$=S?S.toStringTag:void 0;function ni(e){return e==null?e===void 0?ti:ai:$&&$ in Object(e)?Z(e):ei(e)}function si(e){return e!=null&&typeof e=="object"}var ri="[object Symbol]";function li(e){return typeof e=="symbol"||si(e)&&ni(e)==ri}var oi=/\s/;function xi(e){for(var r=e.length;r--&&oi.test(e.charAt(r)););return r}var ui=/^\s+/;function ci(e){return e&&e.slice(0,xi(e)+1).replace(ui,"")}function N(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var B=0/0,gi=/^[-+]0x[0-9a-f]+$/i,di=/^0b[01]+$/i,fi=/^0o[0-7]+$/i,vi=parseInt;function F(e){if(typeof e=="number")return e;if(li(e))return B;if(N(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=N(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=ci(e);var l=di.test(e);return l||fi.test(e)?vi(e.slice(2),l?2:8):gi.test(e)?B:+e}var Ti=function(){return P.Date.now()},L=Ti,mi="Expected a function",yi=Math.max,pi=Math.min;function hi(e,r,l){var c,s,d,g,i,a,t=0,A=!1,v=!1,b=!0;if(typeof e!="function")throw new TypeError(mi);r=F(r)||0,N(l)&&(A=!!l.leading,v="maxWait"in l,d=v?yi(F(l.maxWait)||0,r):d,b="trailing"in l?!!l.trailing:b);function O(x){var n=c,u=s;return c=s=void 0,t=x,g=e.apply(u,n),g}function C(x){return t=x,i=setTimeout(m,r),A?O(x):g}function M(x){var n=x-a,u=x-t,T=r-n;return v?pi(T,d-u):T}function w(x){var n=x-a,u=x-t;return a===void 0||n>=r||n<0||v&&u>=d}function m(){var x=L();if(w(x))return I(x);i=setTimeout(m,M(x))}function I(x){return i=void 0,b&&c?O(x):(c=s=void 0,g)}function W(){i!==void 0&&clearTimeout(i),t=0,c=a=s=i=void 0}function D(){return i===void 0?g:I(L())}function k(){var x=L(),n=w(x);if(c=arguments,s=this,a=x,n){if(i===void 0)return C(a);if(v)return clearTimeout(i),i=setTimeout(m,r),O(a)}return i===void 0&&(i=setTimeout(m,r)),g}return k.cancel=W,k.flush=D,k}var Oi="",Ai=o.defineComponent({name:"DQuadrantDiagramAxis",props:H,setup(e){const{diagramId:r,view:l,axisConfigs:c}=o.toRefs(e),s=o.ref("#0000ff"),d=o.ref("#ff0000"),g=o.ref(),i=o.ref(),a=o.reactive({axisOrigin:{x:0,y:0},axisTop:0,axisRight:0,axisWidth:0,axisHeight:0,yAxisTicksNum:0,xAxisTicksNum:0,xTickSpacing:0,yTickSpacing:0}),t=c.value;o.onMounted(()=>{A()}),o.watch(l.value,()=>{A()});const A=hi(()=>{v(),b(),O(),I()},200),v=()=>{g.value=document.querySelector("#devui-quadrant-axis-"+r.value)},b=()=>{i.value=g.value.getContext("2d"),a.axisOrigin=t.axisOrigin,a.axisTop=t.axisTop,a.axisRight=t.axisRight,a.axisWidth=t.axisWidth,a.axisHeight=t.axisHeight,a.yAxisTicksNum=t.yAxisTicksNum,a.xAxisTicksNum=t.xAxisTicksNum,a.xTickSpacing=t.xTickSpacing,a.yTickSpacing=t.yTickSpacing},O=()=>{i.value.save(),i.value.fillStyle=s.value,i.value.strokeStyle=s.value,M(),C(),i.value.lineWidth=.5,w(),m(),i.value.restore()},C=()=>{i.value.beginPath(),i.value.moveTo(a.axisOrigin.x,a.axisOrigin.y),i.value.lineTo(a.axisOrigin.x,a.axisTop-t.axisMargin),i.value.stroke(),i.value.moveTo(a.axisOrigin.x,a.axisTop-t.axisMargin),i.value.lineTo(a.axisOrigin.x+5,a.axisTop-t.axisMargin+10),i.value.lineTo(a.axisOrigin.x-5,a.axisTop-t.axisMargin+10),i.value.fill()},M=()=>{i.value.beginPath(),i.value.moveTo(a.axisOrigin.x,a.axisOrigin.y),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y),i.value.stroke(),i.value.moveTo(a.axisRight+t.axisMargin,a.axisOrigin.y),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y+5),i.value.lineTo(a.axisRight+t.axisMargin-10,a.axisOrigin.y-5),i.value.fill()},w=()=>{let n;for(let u=1;u<a.xAxisTicksNum;u++)i.value.beginPath(),u%t.xAxisRange.step==0?n=t.tickWidth:n=t.tickWidth/2,i.value.moveTo(a.axisOrigin.x+u*a.xTickSpacing,a.axisOrigin.y-n),i.value.lineTo(a.axisOrigin.x+u*a.xTickSpacing,a.axisOrigin.y+n),i.value.stroke()},m=()=>{let n;for(let u=1;u<a.yAxisTicksNum;u++)i.value.beginPath(),u%t.yAxisRange.step==0?n=t.tickWidth:n=t.tickWidth/2,i.value.moveTo(a.axisOrigin.x-n,a.axisOrigin.y-u*a.yTickSpacing),i.value.lineTo(a.axisOrigin.x+n,a.axisOrigin.y-u*a.yTickSpacing),i.value.stroke()},I=()=>{i.value.save(),i.value.fillStyle=d.value,W(),D(),i.value.restore(),k()},W=()=>{i.value.textAlign="center",i.value.textBaseline="top";for(let n=0;n<=a.xAxisTicksNum;n++)n%t.xAxisRange.step==0&&i.value.fillText(n,a.axisOrigin.x+n*a.xTickSpacing,a.axisOrigin.y+t.spaceBetweenLabelsAxis)},D=()=>{i.value.textAlign="center",i.value.textBaseline="middle";for(let n=0;n<=a.yAxisTicksNum;n++)n%t.yAxisRange.step==0&&i.value.fillText(n,a.axisOrigin.x-t.spaceBetweenLabelsAxis,a.axisOrigin.y-n*a.yTickSpacing)},k=()=>{i.value.font="12px Microsoft YaHei",i.value.textAlign="left",i.value.fillStyle=d.value;const n=i.value.measureText(t.xAxisLabel).width;x(t.xAxisLabel,a.axisRight+t.axisMargin/2,a.axisOrigin.y-n-E),i.value.fillText(t.yAxisLabel,a.axisOrigin.x+E,a.axisTop-t.axisMargin/2)},x=(n,u,T)=>{for(let R=0;R<n.length;R++){const y=n.slice(R,R+1).toString();y.match(/[A-Za-z0-9]/)?(i.value.save(),i.value.translate(u,T),i.value.rotate(Math.PI/180*90),i.value.textBaseline="bottom",i.value.fillText(y,0,0),i.value.restore(),T+=i.value.measureText(y).width):y.match(/[\u4E00-\u9FA5]/)&&(i.value.save(),i.value.textBaseline="top",i.value.fillText(y,u,T),i.value.restore(),T+=i.value.measureText(y).width)}}},render(){const{diagramId:e,view:r}=this;return o.createVNode("div",null,[o.createVNode("canvas",{id:"devui-quadrant-axis-"+e,height:r.height,width:r.width},null)])}}),h=o.defineComponent({name:"DQuadrantDiagram",props:q,setup(e){const{diagramId:r,axisConfigs:l,view:c}=o.toRefs(e),s=o.reactive({axisOrigin:{x:null,y:null},axisTop:null,axisRight:null,axisWidth:null,axisHeight:null,yAxisTicksNum:null,xAxisTicksNum:null,xTickSpacing:null,yTickSpacing:null}),d=()=>{const g=Object.keys(j);for(let i=0;i<g.length;i++)s[g[i]]===void 0&&(s[g[i]]=j[g[i]]);s.axisOrigin={x:l.value.originPosition.left,y:c.value.height-l.value.originPosition.bottom},s.axisTop=l.value.axisMargin,s.axisRight=c.value.width-l.value.axisMargin,s.axisWidth=s.axisRight-s.axisOrigin.x,s.axisHeight=s.axisOrigin.y-s.axisTop,s.yAxisTicksNum=l.value.yAxisRange.max-l.value.yAxisRange.min,s.xAxisTicksNum=l.value.xAxisRange.max-l.value.xAxisRange.min,s.xTickSpacing=s.axisWidth/s.xAxisTicksNum,s.yTickSpacing=s.axisHeight/s.yAxisTicksNum};return d(),o.watch(c.value,()=>{d()}),{diagramId:r,calAxisConfig:s}},render(){const{diagramId:e,calAxisConfig:r,view:l}=this;return o.createVNode("div",{class:"devui-quadrant-diagram",id:e},[o.createVNode(Ai,{diagramId:e,axisConfigs:r,view:l},null)])}});h.install=function(e){e.component(h.name,h)};var bi={title:"QuadrantDiagram \u8C61\u9650\u56FE",category:"\u6570\u636E\u5C55\u793A",status:"10%",install(e){e.use(h)}};f.QuadrantDiagram=h,f.default=bi,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
@@ -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;
package/radio/index.es.js CHANGED
@@ -1 +1,225 @@
1
- var e=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,o=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t,i=(e,a)=>{for(var l in a||(a={}))r.call(a,l)&&o(e,l,a[l]);if(t)for(var l of t(a))n.call(a,l)&&o(e,l,a[l]);return e},u=(e,t)=>a(e,l(t));"undefined"!=typeof require&&require;import{defineComponent as d,inject as s,computed as c,createVNode as p,provide as m,toRef as v,isVNode as f}from"vue";const b={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},y=u(i({},b),{value:{type:String,required:!0,default:null}}),g=u(i({},b),{values:{type:Array,default:null},cssStyle:{type:String,default:"column"}}),h=Symbol("DRadioGroup");var w=d({name:"DRadio",props:y,emits:["change","update:modelValue"],setup(e,{emit:a}){const l=s(h,null),t=c((()=>e.disabled||(null==l?void 0:l.disabled.value))),r=c((()=>{const a=l?l.modelValue.value:e.modelValue;return e.value===a})),n=c((()=>l?l.name.value:e.name));return{isChecked:r,radioName:n,disabled:t,handleChange:async t=>{const r=e.value;await(a=>{const t=e.beforeChange||(l?l.beforeChange:null);let r=Promise.resolve(!0);if(t){const e=t(a);if(void 0===e)return r;r="boolean"==typeof e?Promise.resolve(e):e}return r})(r)?(null==l||l.emitChange(r),a("update:modelValue",r),a("change",r)):t.preventDefault()}}},render(){var e;const{disabled:a,radioName:l,value:t,isChecked:r,$slots:n,handleChange:o}=this;return p("label",{class:["devui-radio",{active:r,disabled:a}]},[p("input",{type:"radio",name:l,class:"devui-radio-input",disabled:a,onChange:o,value:t,checked:r},null),p("span",{class:"devui-radio-material"},[p("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[p("circle",{class:"devui-radio-material-outer",cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),p("circle",{class:"devui-radio-material-inner",cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),p("span",{class:"devui-radio-label"},[null==(e=n.default)?void 0:e.call(n)])])}});var C=d({name:"DRadioGroup",props:g,emits:["change","update:modelValue"],setup(e,{emit:a}){m(h,{modelValue:v(e,"modelValue"),name:v(e,"name"),disabled:v(e,"disabled"),beforeChange:e.beforeChange,emitChange:e=>{a("update:modelValue",e),a("change",e)}})},render(){const{cssStyle:e,values:a}=this;return p("div",{class:["devui-radio-group",{"is-row":"row"===e,"is-column":"column"===e}]},[(()=>{const e=this.$slots.default;return e?e():Array.isArray(a)?a.map((e=>{return p(w,{key:e,value:e},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!f(a)?e:{default:()=>[e]});var a})):""})()])}});w.install=function(e){e.component(w.name,w)},C.install=function(e){e.component(C.name,C)};var O={title:"Radio 单选框",category:"数据录入",status:"已完成",install(e){e.use(w),e.use(C)}};export{w as Radio,C as RadioGroup,O as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { defineComponent, inject, computed, createVNode, provide, toRef, isVNode } from "vue";
21
+ const radioCommonProps = {
22
+ modelValue: {
23
+ type: String,
24
+ default: null
25
+ },
26
+ name: {
27
+ type: String,
28
+ default: null
29
+ },
30
+ beforeChange: {
31
+ type: Function,
32
+ default: null
33
+ },
34
+ disabled: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ };
39
+ const radioProps = __spreadProps(__spreadValues({}, radioCommonProps), {
40
+ value: {
41
+ type: String,
42
+ required: true,
43
+ default: null
44
+ }
45
+ });
46
+ const radioGroupProps = __spreadProps(__spreadValues({}, radioCommonProps), {
47
+ values: {
48
+ type: Array,
49
+ default: null
50
+ },
51
+ direction: {
52
+ type: String,
53
+ default: "column"
54
+ }
55
+ });
56
+ const radioGroupInjectionKey = Symbol("DRadioGroup");
57
+ var radio = "";
58
+ var Radio = defineComponent({
59
+ name: "DRadio",
60
+ props: radioProps,
61
+ emits: ["change", "update:modelValue"],
62
+ setup(props, {
63
+ emit
64
+ }) {
65
+ const radioGroupConf = inject(radioGroupInjectionKey, null);
66
+ const isDisabled = computed(() => {
67
+ return props.disabled || (radioGroupConf == null ? void 0 : radioGroupConf.disabled.value);
68
+ });
69
+ const isChecked = computed(() => {
70
+ const _value = radioGroupConf ? radioGroupConf.modelValue.value : props.modelValue;
71
+ return props.value === _value;
72
+ });
73
+ const radioName = computed(() => {
74
+ return radioGroupConf ? radioGroupConf.name.value : props.name;
75
+ });
76
+ const judgeCanChange = (_value) => {
77
+ const beforeChange = props.beforeChange || (radioGroupConf ? radioGroupConf.beforeChange : null);
78
+ let flag = Promise.resolve(true);
79
+ if (beforeChange) {
80
+ const canChange = beforeChange(_value);
81
+ if (typeof canChange === "undefined") {
82
+ return flag;
83
+ }
84
+ if (typeof canChange === "boolean") {
85
+ flag = Promise.resolve(canChange);
86
+ } else {
87
+ flag = canChange;
88
+ }
89
+ }
90
+ return flag;
91
+ };
92
+ return {
93
+ isChecked,
94
+ radioName,
95
+ disabled: isDisabled,
96
+ handleChange: async (event) => {
97
+ const _value = props.value;
98
+ const canChange = await judgeCanChange(_value);
99
+ if (!canChange) {
100
+ event.preventDefault();
101
+ return;
102
+ }
103
+ radioGroupConf == null ? void 0 : radioGroupConf.emitChange(_value);
104
+ emit("update:modelValue", _value);
105
+ emit("change", _value);
106
+ }
107
+ };
108
+ },
109
+ render() {
110
+ var _a;
111
+ const {
112
+ disabled,
113
+ radioName,
114
+ value,
115
+ isChecked,
116
+ $slots,
117
+ handleChange
118
+ } = this;
119
+ const labelCls = ["devui-radio", {
120
+ active: isChecked,
121
+ disabled
122
+ }];
123
+ return createVNode("label", {
124
+ "class": labelCls
125
+ }, [createVNode("input", {
126
+ "type": "radio",
127
+ "name": radioName,
128
+ "class": "devui-radio-input",
129
+ "disabled": disabled,
130
+ "onChange": handleChange,
131
+ "value": value,
132
+ "checked": isChecked
133
+ }, null), createVNode("span", {
134
+ "class": "devui-radio-material"
135
+ }, [createVNode("svg", {
136
+ "height": "100%",
137
+ "width": "100%",
138
+ "viewBox": "0 0 1024 1024",
139
+ "xmlns": "http://www.w3.org/2000/svg"
140
+ }, [createVNode("circle", {
141
+ "class": "devui-radio-material-outer",
142
+ "cx": "512",
143
+ "cy": "512",
144
+ "r": "486.5",
145
+ "stroke-width": "51"
146
+ }, null), createVNode("circle", {
147
+ "class": "devui-radio-material-inner",
148
+ "cx": "512",
149
+ "fill-rule": "nonzero",
150
+ "cy": "512",
151
+ "r": "320"
152
+ }, null)])]), createVNode("span", {
153
+ "class": "devui-radio-label"
154
+ }, [(_a = $slots.default) == null ? void 0 : _a.call($slots)])]);
155
+ }
156
+ });
157
+ var radioGroup = "";
158
+ function _isSlot(s) {
159
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
160
+ }
161
+ var RadioGroup = defineComponent({
162
+ name: "DRadioGroup",
163
+ props: radioGroupProps,
164
+ emits: ["change", "update:modelValue"],
165
+ setup(props, {
166
+ emit
167
+ }) {
168
+ const emitChange = (radioValue) => {
169
+ emit("update:modelValue", radioValue);
170
+ emit("change", radioValue);
171
+ };
172
+ provide(radioGroupInjectionKey, {
173
+ modelValue: toRef(props, "modelValue"),
174
+ name: toRef(props, "name"),
175
+ disabled: toRef(props, "disabled"),
176
+ beforeChange: props.beforeChange,
177
+ emitChange
178
+ });
179
+ },
180
+ render() {
181
+ const {
182
+ values,
183
+ direction
184
+ } = this;
185
+ const getContent = () => {
186
+ const defaultSlot = this.$slots.default;
187
+ if (defaultSlot) {
188
+ return defaultSlot();
189
+ } else if (Array.isArray(values)) {
190
+ return values.map((item) => {
191
+ return createVNode(Radio, {
192
+ "key": item,
193
+ "value": item
194
+ }, _isSlot(item) ? item : {
195
+ default: () => [item]
196
+ });
197
+ });
198
+ } else {
199
+ return "";
200
+ }
201
+ };
202
+ return createVNode("div", {
203
+ "class": ["devui-radio-group", {
204
+ "is-row": direction === "row",
205
+ "is-column": direction === "column"
206
+ }]
207
+ }, [getContent()]);
208
+ }
209
+ });
210
+ Radio.install = function(app) {
211
+ app.component(Radio.name, Radio);
212
+ };
213
+ RadioGroup.install = function(app) {
214
+ app.component(RadioGroup.name, RadioGroup);
215
+ };
216
+ var index = {
217
+ title: "Radio \u5355\u9009\u6846",
218
+ category: "\u6570\u636E\u5F55\u5165",
219
+ status: "100%",
220
+ install(app) {
221
+ app.use(Radio);
222
+ app.use(RadioGroup);
223
+ }
224
+ };
225
+ export { Radio, RadioGroup, index as default };
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,o,a)=>o in e?__defProp(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,__spreadValues=(e,o)=>{for(var a in o||(o={}))__hasOwnProp.call(o,a)&&__defNormalProp(e,a,o[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(o))__propIsEnum.call(o,a)&&__defNormalProp(e,a,o[a]);return e},__spreadProps=(e,o)=>__defProps(e,__getOwnPropDescs(o)),__require="undefined"!=typeof require?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,o){"use strict";const a={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},r=__spreadProps(__spreadValues({},a),{value:{type:String,required:!0,default:null}}),t=__spreadProps(__spreadValues({},a),{values:{type:Array,default:null},cssStyle:{type:String,default:"column"}}),l=Symbol("DRadioGroup");var n=o.defineComponent({name:"DRadio",props:r,emits:["change","update:modelValue"],setup(e,{emit:a}){const r=o.inject(l,null),t=o.computed((()=>e.disabled||(null==r?void 0:r.disabled.value))),n=o.computed((()=>{const o=r?r.modelValue.value:e.modelValue;return e.value===o})),d=o.computed((()=>r?r.name.value:e.name));return{isChecked:n,radioName:d,disabled:t,handleChange:async o=>{const t=e.value;await(o=>{const a=e.beforeChange||(r?r.beforeChange:null);let t=Promise.resolve(!0);if(a){const e=a(o);if(void 0===e)return t;t="boolean"==typeof e?Promise.resolve(e):e}return t})(t)?(null==r||r.emitChange(t),a("update:modelValue",t),a("change",t)):o.preventDefault()}}},render(){var e;const{disabled:a,radioName:r,value:t,isChecked:l,$slots:n,handleChange:d}=this,i=["devui-radio",{active:l,disabled:a}];return o.createVNode("label",{class:i},[o.createVNode("input",{type:"radio",name:r,class:"devui-radio-input",disabled:a,onChange:d,value:t,checked:l},null),o.createVNode("span",{class:"devui-radio-material"},[o.createVNode("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[o.createVNode("circle",{class:"devui-radio-material-outer",cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),o.createVNode("circle",{class:"devui-radio-material-inner",cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),o.createVNode("span",{class:"devui-radio-label"},[null==(e=n.default)?void 0:e.call(n)])])}});var d=o.defineComponent({name:"DRadioGroup",props:t,emits:["change","update:modelValue"],setup(e,{emit:a}){o.provide(l,{modelValue:o.toRef(e,"modelValue"),name:o.toRef(e,"name"),disabled:o.toRef(e,"disabled"),beforeChange:e.beforeChange,emitChange:e=>{a("update:modelValue",e),a("change",e)}})},render(){const{cssStyle:e,values:a}=this;return o.createVNode("div",{class:["devui-radio-group",{"is-row":"row"===e,"is-column":"column"===e}]},[(()=>{const e=this.$slots.default;return e?e():Array.isArray(a)?a.map((e=>{return o.createVNode(n,{key:e,value:e},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!o.isVNode(a)?e:{default:()=>[e]});var a})):""})()])}});n.install=function(e){e.component(n.name,n)},d.install=function(e){e.component(d.name,d)};var i={title:"Radio 单选框",category:"数据录入",status:"已完成",install(e){e.use(n),e.use(d)}};e.Radio=n,e.RadioGroup=d,e.default=i,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ var S=Object.defineProperty,j=Object.defineProperties;var P=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var V=(n,e,o)=>e in n?S(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,p=(n,e)=>{for(var o in e||(e={}))k.call(e,o)&&V(n,o,e[o]);if(C)for(var o of C(e))x.call(e,o)&&V(n,o,e[o]);return n},y=(n,e)=>j(n,P(e));(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 o={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},v=y(p({},o),{value:{type:String,required:!0,default:null}}),N=y(p({},o),{values:{type:Array,default:null},direction:{type:String,default:"column"}}),b=Symbol("DRadioGroup");var D="",s=e.defineComponent({name:"DRadio",props:v,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=e.inject(b,null),i=e.computed(()=>a.disabled||(t==null?void 0:t.disabled.value)),l=e.computed(()=>{const r=t?t.modelValue.value:a.modelValue;return a.value===r}),h=e.computed(()=>t?t.name.value:a.name),g=r=>{const u=a.beforeChange||(t?t.beforeChange:null);let f=Promise.resolve(!0);if(u){const m=u(r);if(typeof m=="undefined")return f;typeof m=="boolean"?f=Promise.resolve(m):f=m}return f};return{isChecked:l,radioName:h,disabled:i,handleChange:async r=>{const u=a.value;if(!await g(u)){r.preventDefault();return}t==null||t.emitChange(u),d("update:modelValue",u),d("change",u)}}},render(){var r;const{disabled:a,radioName:d,value:t,isChecked:i,$slots:l,handleChange:h}=this,g=["devui-radio",{active:i,disabled:a}];return e.createVNode("label",{class:g},[e.createVNode("input",{type:"radio",name:d,class:"devui-radio-input",disabled:a,onChange:h,value:t,checked:i},null),e.createVNode("span",{class:"devui-radio-material"},[e.createVNode("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("circle",{class:"devui-radio-material-outer",cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),e.createVNode("circle",{class:"devui-radio-material-inner",cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),e.createVNode("span",{class:"devui-radio-label"},[(r=l.default)==null?void 0:r.call(l)])])}}),_="";function R(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Object]"&&!e.isVNode(a)}var c=e.defineComponent({name:"DRadioGroup",props:N,emits:["change","update:modelValue"],setup(a,{emit:d}){const t=i=>{d("update:modelValue",i),d("change",i)};e.provide(b,{modelValue:e.toRef(a,"modelValue"),name:e.toRef(a,"name"),disabled:e.toRef(a,"disabled"),beforeChange:a.beforeChange,emitChange:t})},render(){const{values:a,direction:d}=this,t=()=>{const i=this.$slots.default;return i?i():Array.isArray(a)?a.map(l=>e.createVNode(s,{key:l,value:l},R(l)?l:{default:()=>[l]})):""};return e.createVNode("div",{class:["devui-radio-group",{"is-row":d==="row","is-column":d==="column"}]},[t()])}});s.install=function(a){a.component(s.name,s)},c.install=function(a){a.component(c.name,c)};var w={title:"Radio \u5355\u9009\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(a){a.use(s),a.use(c)}};n.Radio=s,n.RadioGroup=c,n.default=w,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
@@ -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;
package/rate/index.es.js CHANGED
@@ -1 +1,220 @@
1
- import{defineComponent as e,reactive as t,ref as o,onMounted as l,createVNode as a,resolveComponent as n}from"vue";var i=e({name:"DRate",props:{modelValue:{type:Number},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}},emits:["change","update:modelValue"],setup(e,a){const n=t([]),i=o(0),r=(e,t,o)=>{for(let l=e;l<t;l++)n[l].width=o};l((()=>{for(let t=0;t<e.count;t++)n.push({width:"0"});(()=>{if(!e.modelValue)return;i.value=e.modelValue-1;const t=i.value%1,o=Math.floor(i.value);r(0,o+1,"100%"),t>0?(n[o+1].width=100*t+"%",r(o+2,e.count,"0")):r(o+1,e.count,"0")})()}));return{totalLevelArray:n,chooseValue:i,hoverToggle:(t,o,l=!1)=>{e.read||(l?i.value>=0?(r(0,i.value+1,"100%"),r(i.value+1,e.count,"0")):r(0,e.count,"0"):(r(0,o+1,"100%"),e.allowHalf&&2*t.offsetX<=t.target.clientWidth?r(o,o+1,"50%"):r(o,o+1,"100%"),r(o+1,e.count,"0")))},selectValue:(t,o)=>{e.read||(r(0,o,"100%"),e.allowHalf&&2*t.offsetX<=t.target.clientWidth?(r(o,o+1,"50%"),i.value=o-.5):(r(o,o+1,"100%"),i.value=o),r(o+1,e.count,"0"),o=i.value,e.onChange&&e.onChange(o+1),e.onTouched&&e.onTouched(),a.emit("update:modelValue",o+1))}}},render(){const{totalLevelArray:e,chooseValue:t,icon:o,character:l,read:i,type:r,color:s,hoverToggle:u,selectValue:d}=this;return a("div",{class:"devui-star-container",onMouseleave:e=>u(e,t,!0)},[e.map(((e,t)=>a("div",{class:"devui-star-align devui-pointer "+(i?"devui-only-read":""),key:t,onMouseover:e=>u(e,t),onClick:e=>d(e,t)},[o&&!l&&a("span",{class:"devui-star-color"},[a(n("d-icon"),{name:o},null)]),l&&!o&&a("span",{class:"devui-star-color"},[l]),!o&&!l&&a("span",{class:"devui-star-color"},[a("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[a("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[a("g",{fill:"#E3E5E9",id:"Mask"},[a("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),o&&!l&&a("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{width:e.width}},[a(n("d-icon"),{name:o,color:s},null)]),l&&!o&&a("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{color:s,width:e.width}},[l]),!l&&!o&&a("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{color:s,width:e.width}},[a("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[a("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[a("g",{id:"Mask"},[a("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])])))])}});i.install=function(e){e.component(i.name,i)};var r={title:"Rate 评分",category:"数据录入",status:"已完成",install(e){e.use(i)}};export{i as Rate,r as default};
1
+ import { defineComponent, reactive, ref, onMounted, createVNode, resolveComponent } from "vue";
2
+ const rateProps = {
3
+ modelValue: {
4
+ type: Number
5
+ },
6
+ read: {
7
+ type: Boolean,
8
+ default: false
9
+ },
10
+ count: {
11
+ type: Number,
12
+ default: 5
13
+ },
14
+ type: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ color: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ icon: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ character: {
27
+ type: String,
28
+ default: ""
29
+ },
30
+ allowHalf: {
31
+ type: Boolean,
32
+ default: false
33
+ },
34
+ onChange: {
35
+ type: Function,
36
+ default: void 0
37
+ },
38
+ onTouched: {
39
+ type: Function,
40
+ default: void 0
41
+ }
42
+ };
43
+ var rate = "";
44
+ var Rate = defineComponent({
45
+ name: "DRate",
46
+ props: rateProps,
47
+ emits: ["change", "update:modelValue"],
48
+ setup(props, ctx) {
49
+ const totalLevelArray = reactive([]);
50
+ const chooseValue = ref(0);
51
+ const setChange = (start, end, width) => {
52
+ for (let i = start; i < end; i++) {
53
+ totalLevelArray[i]["width"] = width;
54
+ }
55
+ };
56
+ const initRating = () => {
57
+ if (!props.modelValue) {
58
+ return;
59
+ }
60
+ chooseValue.value = props.modelValue - 1;
61
+ const halfStar = chooseValue.value % 1;
62
+ const intCurrentLevel = Math.floor(chooseValue.value);
63
+ setChange(0, intCurrentLevel + 1, "100%");
64
+ if (halfStar > 0) {
65
+ totalLevelArray[intCurrentLevel + 1]["width"] = halfStar * 100 + "%";
66
+ setChange(intCurrentLevel + 2, props.count, "0");
67
+ } else {
68
+ setChange(intCurrentLevel + 1, props.count, "0");
69
+ }
70
+ };
71
+ onMounted(() => {
72
+ for (let i = 0; i < props.count; i++) {
73
+ totalLevelArray.push({
74
+ width: "0"
75
+ });
76
+ }
77
+ initRating();
78
+ });
79
+ const hoverToggle = (e, index2, reset = false) => {
80
+ if (props.read) {
81
+ return;
82
+ }
83
+ if (reset) {
84
+ if (chooseValue.value >= 0) {
85
+ setChange(0, chooseValue.value + 1, "100%");
86
+ setChange(chooseValue.value + 1, props.count, "0");
87
+ } else {
88
+ setChange(0, props.count, "0");
89
+ }
90
+ } else {
91
+ setChange(0, index2 + 1, "100%");
92
+ if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
93
+ setChange(index2, index2 + 1, "50%");
94
+ } else {
95
+ setChange(index2, index2 + 1, "100%");
96
+ }
97
+ setChange(index2 + 1, props.count, "0");
98
+ }
99
+ };
100
+ const selectValue = (e, index2) => {
101
+ if (props.read) {
102
+ return;
103
+ }
104
+ setChange(0, index2, "100%");
105
+ if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
106
+ setChange(index2, index2 + 1, "50%");
107
+ chooseValue.value = index2 - 0.5;
108
+ } else {
109
+ setChange(index2, index2 + 1, "100%");
110
+ chooseValue.value = index2;
111
+ }
112
+ setChange(index2 + 1, props.count, "0");
113
+ index2 = chooseValue.value;
114
+ props.onChange && props.onChange(index2 + 1);
115
+ props.onTouched && props.onTouched();
116
+ ctx.emit("update:modelValue", index2 + 1);
117
+ };
118
+ return {
119
+ totalLevelArray,
120
+ chooseValue,
121
+ hoverToggle,
122
+ selectValue
123
+ };
124
+ },
125
+ render() {
126
+ const {
127
+ totalLevelArray,
128
+ chooseValue,
129
+ icon,
130
+ character,
131
+ read,
132
+ type,
133
+ color,
134
+ hoverToggle,
135
+ selectValue
136
+ } = this;
137
+ return createVNode("div", {
138
+ "class": "devui-star-container",
139
+ "onMouseleave": (e) => hoverToggle(e, chooseValue, true)
140
+ }, [totalLevelArray.map((item, index2) => createVNode("div", {
141
+ "class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
142
+ "key": index2,
143
+ "onMouseover": (e) => hoverToggle(e, index2),
144
+ "onClick": (e) => selectValue(e, index2)
145
+ }, [icon && !character && createVNode("span", {
146
+ "class": "devui-star-color"
147
+ }, [createVNode(resolveComponent("d-icon"), {
148
+ "name": icon
149
+ }, null)]), character && !icon && createVNode("span", {
150
+ "class": "devui-star-color"
151
+ }, [character]), !icon && !character && createVNode("span", {
152
+ "class": "devui-star-color"
153
+ }, [createVNode("svg", {
154
+ "width": "16px",
155
+ "height": "16px",
156
+ "viewBox": "0 0 16 16",
157
+ "version": "1.1",
158
+ "xmlns": "http://www.w3.org/2000/svg",
159
+ "xmlns-xlink": "http://www.w3.org/1999/xlink"
160
+ }, [createVNode("g", {
161
+ "stroke": "none",
162
+ "stroke-width": "1",
163
+ "fill": "none",
164
+ "fill-rule": "evenodd"
165
+ }, [createVNode("g", {
166
+ "fill": "#E3E5E9",
167
+ "id": "Mask"
168
+ }, [createVNode("polygon", {
169
+ "points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
170
+ }, null)])])])]), icon && !character && createVNode("span", {
171
+ "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
172
+ "style": {
173
+ width: item.width
174
+ }
175
+ }, [createVNode(resolveComponent("d-icon"), {
176
+ "name": icon,
177
+ "color": color
178
+ }, null)]), character && !icon && createVNode("span", {
179
+ "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
180
+ "style": {
181
+ color,
182
+ width: item.width
183
+ }
184
+ }, [character]), !character && !icon && createVNode("span", {
185
+ "class": `devui-star-color-active devui-active-star devui-star-color-${type}`,
186
+ "style": {
187
+ color,
188
+ width: item.width
189
+ }
190
+ }, [createVNode("svg", {
191
+ "width": "16px",
192
+ "height": "16px",
193
+ "viewBox": "0 0 16 16",
194
+ "version": "1.1",
195
+ "xmlns": "http://www.w3.org/2000/svg",
196
+ "xmlns-xlink": "http://www.w3.org/1999/xlink"
197
+ }, [createVNode("g", {
198
+ "stroke": "none",
199
+ "stroke-width": "1",
200
+ "fill": "none",
201
+ "fill-rule": "evenodd"
202
+ }, [createVNode("g", {
203
+ "id": "Mask"
204
+ }, [createVNode("polygon", {
205
+ "points": "8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"
206
+ }, null)])])])])]))]);
207
+ }
208
+ });
209
+ Rate.install = function(app) {
210
+ app.component(Rate.name, Rate);
211
+ };
212
+ var index = {
213
+ title: "Rate \u8BC4\u5206",
214
+ category: "\u6570\u636E\u5C55\u793A",
215
+ status: "100%",
216
+ install(app) {
217
+ app.use(Rate);
218
+ }
219
+ };
220
+ export { Rate, index as default };
package/rate/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,t){"use strict";const o={modelValue:{type:Number},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}};var a=t.defineComponent({name:"DRate",props:o,emits:["change","update:modelValue"],setup(e,o){const a=t.reactive([]),l=t.ref(0),n=(e,t,o)=>{for(let l=e;l<t;l++)a[l].width=o};t.onMounted((()=>{for(let t=0;t<e.count;t++)a.push({width:"0"});(()=>{if(!e.modelValue)return;l.value=e.modelValue-1;const t=l.value%1,o=Math.floor(l.value);n(0,o+1,"100%"),t>0?(a[o+1].width=100*t+"%",n(o+2,e.count,"0")):n(o+1,e.count,"0")})()}));return{totalLevelArray:a,chooseValue:l,hoverToggle:(t,o,a=!1)=>{e.read||(a?l.value>=0?(n(0,l.value+1,"100%"),n(l.value+1,e.count,"0")):n(0,e.count,"0"):(n(0,o+1,"100%"),e.allowHalf&&2*t.offsetX<=t.target.clientWidth?n(o,o+1,"50%"):n(o,o+1,"100%"),n(o+1,e.count,"0")))},selectValue:(t,a)=>{e.read||(n(0,a,"100%"),e.allowHalf&&2*t.offsetX<=t.target.clientWidth?(n(a,a+1,"50%"),l.value=a-.5):(n(a,a+1,"100%"),l.value=a),n(a+1,e.count,"0"),a=l.value,e.onChange&&e.onChange(a+1),e.onTouched&&e.onTouched(),o.emit("update:modelValue",a+1))}}},render(){const{totalLevelArray:e,chooseValue:o,icon:a,character:l,read:n,type:r,color:d,hoverToggle:i,selectValue:u}=this;return t.createVNode("div",{class:"devui-star-container",onMouseleave:e=>i(e,o,!0)},[e.map(((e,o)=>t.createVNode("div",{class:"devui-star-align devui-pointer "+(n?"devui-only-read":""),key:o,onMouseover:e=>i(e,o),onClick:e=>u(e,o)},[a&&!l&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode(t.resolveComponent("d-icon"),{name:a},null)]),l&&!a&&t.createVNode("span",{class:"devui-star-color"},[l]),!a&&!l&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[t.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),a&&!l&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{width:e.width}},[t.createVNode(t.resolveComponent("d-icon"),{name:a,color:d},null)]),l&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{color:d,width:e.width}},[l]),!l&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${r}`,style:{color:d,width:e.width}},[t.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{id:"Mask"},[t.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])])))])}});a.install=function(e){e.component(a.name,a)};var l={title:"Rate 评分",category:"数据录入",status:"已完成",install(e){e.use(a)}};e.Rate=a,e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ (function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue))})(this,function(i,t){"use strict";const g={modelValue:{type:Number},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}};var V="",d=t.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(o,h){const r=t.reactive([]),a=t.ref(0),l=(n,e,c)=>{for(let s=n;s<e;s++)r[s].width=c},u=()=>{if(!o.modelValue)return;a.value=o.modelValue-1;const n=a.value%1,e=Math.floor(a.value);l(0,e+1,"100%"),n>0?(r[e+1].width=n*100+"%",l(e+2,o.count,"0")):l(e+1,o.count,"0")};return t.onMounted(()=>{for(let n=0;n<o.count;n++)r.push({width:"0"});u()}),{totalLevelArray:r,chooseValue:a,hoverToggle:(n,e,c=!1)=>{o.read||(c?a.value>=0?(l(0,a.value+1,"100%"),l(a.value+1,o.count,"0")):l(0,o.count,"0"):(l(0,e+1,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?l(e,e+1,"50%"):l(e,e+1,"100%"),l(e+1,o.count,"0")))},selectValue:(n,e)=>{o.read||(l(0,e,"100%"),o.allowHalf&&n.offsetX*2<=n.target.clientWidth?(l(e,e+1,"50%"),a.value=e-.5):(l(e,e+1,"100%"),a.value=e),l(e+1,o.count,"0"),e=a.value,o.onChange&&o.onChange(e+1),o.onTouched&&o.onTouched(),h.emit("update:modelValue",e+1))}}},render(){const{totalLevelArray:o,chooseValue:h,icon:r,character:a,read:l,type:u,color:f,hoverToggle:v,selectValue:n}=this;return t.createVNode("div",{class:"devui-star-container",onMouseleave:e=>v(e,h,!0)},[o.map((e,c)=>t.createVNode("div",{class:`devui-star-align devui-pointer ${l?"devui-only-read":""}`,key:c,onMouseover:s=>v(s,c),onClick:s=>n(s,c)},[r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode(t.resolveComponent("d-icon"),{name:r},null)]),a&&!r&&t.createVNode("span",{class:"devui-star-color"},[a]),!r&&!a&&t.createVNode("span",{class:"devui-star-color"},[t.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[t.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),r&&!a&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{width:e.width}},[t.createVNode(t.resolveComponent("d-icon"),{name:r,color:f},null)]),a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[a]),!a&&!r&&t.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${u}`,style:{color:f,width:e.width}},[t.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[t.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[t.createVNode("g",{id:"Mask"},[t.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])]))])}});d.install=function(o){o.component(d.name,d)};var w={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(o){o.use(d)}};i.Rate=d,i.default=w,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
@@ -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;