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,153 @@
1
- import{defineComponent as e,toRefs as t,reactive as s,watch as r,createVNode as a,createTextVNode as o}from"vue";var l=e({name:"DProgress",props:{height:{type:String,default:"20px"},percentage:{type:Number,default:0},percentageText:{type:String,default:""},barBgColor:{type:String,default:"#5170ff"},isCircle:{type:Boolean,default:!1},strokeWidth:{type:Number,default:6},showContent:{type:Boolean,default:!0}},setup(e){const{height:a,percentage:o,percentageText:l,barBgColor:i,isCircle:n,strokeWidth:d,showContent:h}=t(e),p=s({pathString:"",trailPath:null,strokePath:null}),u=()=>{if(!n)return;const e=50-d.value/2,t=-e,s=-2*e;p.pathString=`M 50,50 m 0,${t}\n a ${e},${e} 0 1 1 0,${-s}\n a ${e},${e} 0 1 1 0,${s}`;const r=2*Math.PI*e;p.trailPath={stroke:"#dfe1e6",strokeDasharray:`${r}px ${r}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},p.strokePath={stroke:i||null,strokeDasharray:`${o.value/100*r}px ${r}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return u(),r([a,o,l,i,n,d,h],(()=>{u()})),{data:p}},render(){var e;const{height:t,percentage:s,percentageText:r,barBgColor:l,isCircle:i,strokeWidth:n,showContent:d,data:h,$slots:p}=this,u=a("div",{className:"devui-progress--line",style:{height:t,borderRadius:t}},[a("div",{className:"devui-progress-bar",style:{height:t,borderRadius:t,width:`${s}%`,backgroundColor:l}},null),a("span",{style:{lineHeight:t}},[r])]),c=a("span",{className:"devui-progress-circle-text"},[s,o("%")]),g=a("div",{className:"devui-progress-circle"},[a("svg",{className:"devui-progress-circle",viewBox:"0 0 100 100"},[a("path",{className:"devui-progress-circle-trail","fill-opacity":"0","stroke-width":n,style:h.trailPath,d:h.pathString},null),a("path",{className:"devui-progress-circle-path",d:h.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:l,"stroke-width":s?n:0,style:h.strokePath},null)]),d&&(null==(e=p.default)?void 0:e.call(p)),d&&!p.default&&c]);return a("div",{className:"devui-progress"},[i?g:u])}});l.install=function(e){e.component(l.name,l)};var i={title:"Progress 进度条",category:"反馈",status:"已完成",install(e){e.use(l)}};export{l as Progress,i as default};
1
+ import { defineComponent, toRefs, reactive, watch, createVNode, createTextVNode } from "vue";
2
+ var progress = "";
3
+ var Progress = defineComponent({
4
+ name: "DProgress",
5
+ props: {
6
+ height: {
7
+ type: String,
8
+ default: "20px"
9
+ },
10
+ percentage: {
11
+ type: Number,
12
+ default: 0
13
+ },
14
+ percentageText: {
15
+ type: String,
16
+ default: ""
17
+ },
18
+ barBgColor: {
19
+ type: String,
20
+ default: "#5170ff"
21
+ },
22
+ isCircle: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ strokeWidth: {
27
+ type: Number,
28
+ default: 6
29
+ },
30
+ showContent: {
31
+ type: Boolean,
32
+ default: true
33
+ }
34
+ },
35
+ setup(props) {
36
+ const {
37
+ height,
38
+ percentage,
39
+ percentageText,
40
+ barBgColor,
41
+ isCircle,
42
+ strokeWidth,
43
+ showContent
44
+ } = toRefs(props);
45
+ const data = reactive({
46
+ pathString: "",
47
+ trailPath: null,
48
+ strokePath: null
49
+ });
50
+ const setCircleProgress = () => {
51
+ if (!isCircle) {
52
+ return;
53
+ }
54
+ const radius = 50 - strokeWidth.value / 2;
55
+ const beginPositionY = -radius;
56
+ const endPositionY = radius * -2;
57
+ data.pathString = `M 50,50 m 0,${beginPositionY}
58
+ a ${radius},${radius} 0 1 1 0,${-endPositionY}
59
+ a ${radius},${radius} 0 1 1 0,${endPositionY}`;
60
+ const len = Math.PI * 2 * radius;
61
+ data.trailPath = {
62
+ stroke: "#dfe1e6",
63
+ strokeDasharray: `${len}px ${len}px`,
64
+ strokeDashoffset: `0`,
65
+ transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"
66
+ };
67
+ data.strokePath = {
68
+ stroke: barBgColor || null,
69
+ strokeDasharray: `${percentage.value / 100 * len}px ${len}px`,
70
+ strokeDashoffset: `0`,
71
+ transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
72
+ };
73
+ };
74
+ setCircleProgress();
75
+ watch([height, percentage, percentageText, barBgColor, isCircle, strokeWidth, showContent], () => {
76
+ setCircleProgress();
77
+ });
78
+ return {
79
+ data
80
+ };
81
+ },
82
+ render() {
83
+ var _a;
84
+ const {
85
+ height,
86
+ percentage,
87
+ percentageText,
88
+ barBgColor,
89
+ isCircle,
90
+ strokeWidth,
91
+ showContent,
92
+ data,
93
+ $slots
94
+ } = this;
95
+ const progressLine = createVNode("div", {
96
+ "class": "devui-progress--line",
97
+ "style": {
98
+ height,
99
+ borderRadius: height
100
+ }
101
+ }, [createVNode("div", {
102
+ "class": "devui-progress-bar",
103
+ "style": {
104
+ height,
105
+ borderRadius: height,
106
+ width: `${percentage}%`,
107
+ backgroundColor: barBgColor
108
+ }
109
+ }, null), createVNode("span", {
110
+ "style": {
111
+ lineHeight: height
112
+ }
113
+ }, [percentageText])]);
114
+ const textElement = createVNode("span", {
115
+ "class": "devui-progress-circle-text"
116
+ }, [percentage, createTextVNode("%")]);
117
+ const progressCircle = createVNode("div", {
118
+ "class": "devui-progress-circle"
119
+ }, [createVNode("svg", {
120
+ "class": "devui-progress-circle",
121
+ "viewBox": "0 0 100 100"
122
+ }, [createVNode("path", {
123
+ "class": "devui-progress-circle-trail",
124
+ "fill-opacity": "0",
125
+ "stroke-width": strokeWidth,
126
+ "style": data.trailPath,
127
+ "d": data.pathString
128
+ }, null), createVNode("path", {
129
+ "class": "devui-progress-circle-path",
130
+ "d": data.pathString,
131
+ "stroke-linecap": "round",
132
+ "fill-opacity": "0",
133
+ "stroke": barBgColor,
134
+ "stroke-width": percentage ? strokeWidth : 0,
135
+ "style": data.strokePath
136
+ }, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
137
+ return createVNode("div", {
138
+ "class": "devui-progress"
139
+ }, [!isCircle ? progressLine : progressCircle]);
140
+ }
141
+ });
142
+ Progress.install = function(app) {
143
+ app.component(Progress.name, Progress);
144
+ };
145
+ var index = {
146
+ title: "Progress \u8FDB\u5EA6\u6761",
147
+ category: "\u6570\u636E\u5C55\u793A",
148
+ status: "100%",
149
+ install(app) {
150
+ app.use(Progress);
151
+ }
152
+ };
153
+ export { Progress, index as default };
@@ -1 +1,3 @@
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";var s=t.defineComponent({name:"DProgress",props:{height:{type:String,default:"20px"},percentage:{type:Number,default:0},percentageText:{type:String,default:""},barBgColor:{type:String,default:"#5170ff"},isCircle:{type:Boolean,default:!1},strokeWidth:{type:Number,default:6},showContent:{type:Boolean,default:!0}},setup(e){const{height:s,percentage:r,percentageText:a,barBgColor:o,isCircle:i,strokeWidth:l,showContent:n}=t.toRefs(e),d=t.reactive({pathString:"",trailPath:null,strokePath:null}),c=()=>{if(!i)return;const e=50-l.value/2,t=-e,s=-2*e;d.pathString=`M 50,50 m 0,${t}\n a ${e},${e} 0 1 1 0,${-s}\n a ${e},${e} 0 1 1 0,${s}`;const a=2*Math.PI*e;d.trailPath={stroke:"#dfe1e6",strokeDasharray:`${a}px ${a}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},d.strokePath={stroke:o||null,strokeDasharray:`${r.value/100*a}px ${a}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return c(),t.watch([s,r,a,o,i,l,n],(()=>{c()})),{data:d}},render(){var e;const{height:s,percentage:r,percentageText:a,barBgColor:o,isCircle:i,strokeWidth:l,showContent:n,data:d,$slots:c}=this,u=t.createVNode("div",{className:"devui-progress--line",style:{height:s,borderRadius:s}},[t.createVNode("div",{className:"devui-progress-bar",style:{height:s,borderRadius:s,width:`${r}%`,backgroundColor:o}},null),t.createVNode("span",{style:{lineHeight:s}},[a])]),p=t.createVNode("span",{className:"devui-progress-circle-text"},[r,t.createTextVNode("%")]),h=t.createVNode("div",{className:"devui-progress-circle"},[t.createVNode("svg",{className:"devui-progress-circle",viewBox:"0 0 100 100"},[t.createVNode("path",{className:"devui-progress-circle-trail","fill-opacity":"0","stroke-width":l,style:d.trailPath,d:d.pathString},null),t.createVNode("path",{className:"devui-progress-circle-path",d:d.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:o,"stroke-width":r?l:0,style:d.strokePath},null)]),n&&(null==(e=c.default)?void 0:e.call(c)),n&&!c.default&&p]);return t.createVNode("div",{className:"devui-progress"},[i?h:u])}});s.install=function(e){e.component(s.name,s)};var r={title:"Progress 进度条",category:"反馈",status:"已完成",install(e){e.use(s)}};e.Progress=s,e.default=r,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ (function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";var P="",i=e.defineComponent({name:"DProgress",props:{height:{type:String,default:"20px"},percentage:{type:Number,default:0},percentageText:{type:String,default:""},barBgColor:{type:String,default:"#5170ff"},isCircle:{type:Boolean,default:!1},strokeWidth:{type:Number,default:6},showContent:{type:Boolean,default:!0}},setup(t){const{height:n,percentage:p,percentageText:u,barBgColor:h,isCircle:l,strokeWidth:d,showContent:a}=e.toRefs(t),r=e.reactive({pathString:"",trailPath:null,strokePath:null}),g=()=>{if(!l)return;const o=50-d.value/2,k=-o,c=o*-2;r.pathString=`M 50,50 m 0,${k}
2
+ a ${o},${o} 0 1 1 0,${-c}
3
+ a ${o},${o} 0 1 1 0,${c}`;const f=Math.PI*2*o;r.trailPath={stroke:"#dfe1e6",strokeDasharray:`${f}px ${f}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},r.strokePath={stroke:h||null,strokeDasharray:`${p.value/100*f}px ${f}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return g(),e.watch([n,p,u,h,l,d,a],()=>{g()}),{data:r}},render(){var c;const{height:t,percentage:n,percentageText:p,barBgColor:u,isCircle:h,strokeWidth:l,showContent:d,data:a,$slots:r}=this,g=e.createVNode("div",{class:"devui-progress--line",style:{height:t,borderRadius:t}},[e.createVNode("div",{class:"devui-progress-bar",style:{height:t,borderRadius:t,width:`${n}%`,backgroundColor:u}},null),e.createVNode("span",{style:{lineHeight:t}},[p])]),o=e.createVNode("span",{class:"devui-progress-circle-text"},[n,e.createTextVNode("%")]),k=e.createVNode("div",{class:"devui-progress-circle"},[e.createVNode("svg",{class:"devui-progress-circle",viewBox:"0 0 100 100"},[e.createVNode("path",{class:"devui-progress-circle-trail","fill-opacity":"0","stroke-width":l,style:a.trailPath,d:a.pathString},null),e.createVNode("path",{class:"devui-progress-circle-path",d:a.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:u,"stroke-width":n?l:0,style:a.strokePath},null)]),d&&((c=r.default)==null?void 0:c.call(r)),d&&!r.default&&o]);return e.createVNode("div",{class:"devui-progress"},[h?k:g])}});i.install=function(t){t.component(i.name,i)};var y={title:"Progress \u8FDB\u5EA6\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(i)}};s.Progress=i,s.default=y,Object.defineProperty(s,"__esModule",{value:!0}),s[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;
@@ -1 +1,489 @@
1
- import{defineComponent as i,toRefs as e,ref as a,reactive as t,onMounted as n,watch as s,createVNode as l}from"vue";const r={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},u={diagramId:{type:String,default:"1"},axisConfigs:{type:Object,default:r},view:{type:Object,default:{height:900,width:950}}},x={diagramId:{type:String},axisConfigs:{type:Object},view:{type:Object}};var o="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,c=o||g||Function("return this")(),v=c.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,T=v?v.toStringTag:void 0;var m=Object.prototype.toString;var y=v?v.toStringTag:void 0;function h(i){return null==i?void 0===i?"[object Undefined]":"[object Null]":y&&y in Object(i)?function(i){var e=d.call(i,T),a=i[T];try{i[T]=void 0;var t=!0}catch(s){}var n=p.call(i);return t&&(e?i[T]=a:delete i[T]),n}(i):function(i){return m.call(i)}(i)}var O=/\s/;var b=/^\s+/;function k(i){return i?i.slice(0,function(i){for(var e=i.length;e--&&O.test(i.charAt(e)););return e}(i)+1).replace(b,""):i}function A(i){var e=typeof i;return null!=i&&("object"==e||"function"==e)}var S=/^[-+]0x[0-9a-f]+$/i,w=/^0b[01]+$/i,N=/^0o[0-7]+$/i,R=parseInt;function j(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]"==h(i)}(i))return NaN;if(A(i)){var e="function"==typeof i.valueOf?i.valueOf():i;i=A(e)?e+"":e}if("string"!=typeof i)return 0===i?i:+i;i=k(i);var a=w.test(i);return a||N.test(i)?R(i.slice(2),a?2:8):S.test(i)?NaN:+i}var M=function(){return c.Date.now()},W=Math.max,I=Math.min;function P(i,e,a){var t,n,s,l,r,u,x=0,o=!1,g=!1,c=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function v(e){var a=t,s=n;return t=n=void 0,x=e,l=i.apply(s,a)}function f(i){return x=i,r=setTimeout(p,e),o?v(i):l}function d(i){var a=i-u;return void 0===u||a>=e||a<0||g&&i-x>=s}function p(){var i=M();if(d(i))return T(i);r=setTimeout(p,function(i){var a=e-(i-u);return g?I(a,s-(i-x)):a}(i))}function T(i){return r=void 0,c&&t?v(i):(t=n=void 0,l)}function m(){var i=M(),a=d(i);if(t=arguments,n=this,u=i,a){if(void 0===r)return f(u);if(g)return clearTimeout(r),r=setTimeout(p,e),v(u)}return void 0===r&&(r=setTimeout(p,e)),l}return e=j(e)||0,A(a)&&(o=!!a.leading,s=(g="maxWait"in a)?W(j(a.maxWait)||0,e):s,c="trailing"in a?!!a.trailing:c),m.cancel=function(){void 0!==r&&clearTimeout(r),x=0,t=u=n=r=void 0},m.flush=function(){return void 0===r?l:T(M())},m}var C=i({name:"DQuadrantDiagramAxis",props:x,setup(i){const{diagramId:l,view:r,axisConfigs:u}=e(i),x=a("#0000ff"),o=a("#ff0000"),g=a(),c=a(),v=t({axisOrigin:{x:0,y:0},axisTop:0,axisRight:0,axisWidth:0,axisHeight:0,yAxisTicksNum:0,xAxisTicksNum:0,xTickSpacing:0,yTickSpacing:0}),f=u.value;n((()=>{d()})),s(r.value,(()=>{d()}));const d=P((()=>{p(),T(),m(),k()}),200),p=()=>{g.value=document.querySelector("#devui-quadrant-axis-"+l.value)},T=()=>{c.value=g.value.getContext("2d"),v.axisOrigin=f.axisOrigin,v.axisTop=f.axisTop,v.axisRight=f.axisRight,v.axisWidth=f.axisWidth,v.axisHeight=f.axisHeight,v.yAxisTicksNum=f.yAxisTicksNum,v.xAxisTicksNum=f.xAxisTicksNum,v.xTickSpacing=f.xTickSpacing,v.yTickSpacing=f.yTickSpacing},m=()=>{c.value.save(),c.value.fillStyle=x.value,c.value.strokeStyle=x.value,h(),y(),c.value.lineWidth=.5,O(),b(),c.value.restore()},y=()=>{c.value.beginPath(),c.value.moveTo(v.axisOrigin.x,v.axisOrigin.y),c.value.lineTo(v.axisOrigin.x,v.axisTop-f.axisMargin),c.value.stroke(),c.value.moveTo(v.axisOrigin.x,v.axisTop-f.axisMargin),c.value.lineTo(v.axisOrigin.x+5,v.axisTop-f.axisMargin+10),c.value.lineTo(v.axisOrigin.x-5,v.axisTop-f.axisMargin+10),c.value.fill()},h=()=>{c.value.beginPath(),c.value.moveTo(v.axisOrigin.x,v.axisOrigin.y),c.value.lineTo(v.axisRight+f.axisMargin-10,v.axisOrigin.y),c.value.stroke(),c.value.moveTo(v.axisRight+f.axisMargin,v.axisOrigin.y),c.value.lineTo(v.axisRight+f.axisMargin-10,v.axisOrigin.y+5),c.value.lineTo(v.axisRight+f.axisMargin-10,v.axisOrigin.y-5),c.value.fill()},O=()=>{let i;for(let e=1;e<v.xAxisTicksNum;e++)c.value.beginPath(),i=e%f.xAxisRange.step==0?f.tickWidth:f.tickWidth/2,c.value.moveTo(v.axisOrigin.x+e*v.xTickSpacing,v.axisOrigin.y-i),c.value.lineTo(v.axisOrigin.x+e*v.xTickSpacing,v.axisOrigin.y+i),c.value.stroke()},b=()=>{let i;for(let e=1;e<v.yAxisTicksNum;e++)c.value.beginPath(),i=e%f.yAxisRange.step==0?f.tickWidth:f.tickWidth/2,c.value.moveTo(v.axisOrigin.x-i,v.axisOrigin.y-e*v.yTickSpacing),c.value.lineTo(v.axisOrigin.x+i,v.axisOrigin.y-e*v.yTickSpacing),c.value.stroke()},k=()=>{c.value.save(),c.value.fillStyle=o.value,A(),S(),c.value.restore(),w()},A=()=>{c.value.textAlign="center",c.value.textBaseline="top";for(let i=0;i<=v.xAxisTicksNum;i++)i%f.xAxisRange.step==0&&c.value.fillText(i,v.axisOrigin.x+i*v.xTickSpacing,v.axisOrigin.y+f.spaceBetweenLabelsAxis)},S=()=>{c.value.textAlign="center",c.value.textBaseline="middle";for(let i=0;i<=v.yAxisTicksNum;i++)i%f.yAxisRange.step==0&&c.value.fillText(i,v.axisOrigin.x-f.spaceBetweenLabelsAxis,v.axisOrigin.y-i*v.yTickSpacing)},w=()=>{c.value.font="12px Microsoft YaHei",c.value.textAlign="left",c.value.fillStyle=o.value;const i=c.value.measureText(f.xAxisLabel).width;N(f.xAxisLabel,v.axisRight+f.axisMargin/2,v.axisOrigin.y-i-15),c.value.fillText(f.yAxisLabel,v.axisOrigin.x+15,v.axisTop-f.axisMargin/2)},N=(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]/)?(c.value.save(),c.value.translate(e,a),c.value.rotate(Math.PI/180*90),c.value.textBaseline="bottom",c.value.fillText(n,0,0),c.value.restore(),a+=c.value.measureText(n).width):n.match(/[\u4E00-\u9FA5]/)&&(c.value.save(),c.value.textBaseline="top",c.value.fillText(n,e,a),c.value.restore(),a+=c.value.measureText(n).width)}}},render(){const{diagramId:i,view:e}=this;return l("div",null,[l("canvas",{id:"devui-quadrant-axis-"+i,height:e.height,width:e.width},null)])}}),L=i({name:"DQuadrantDiagram",props:u,setup(i){const{diagramId:a,axisConfigs:n,view:l}=e(i),u=t({axisOrigin:{x:null,y:null},axisTop:null,axisRight:null,axisWidth:null,axisHeight:null,yAxisTicksNum:null,xAxisTicksNum:null,xTickSpacing:null,yTickSpacing:null}),x=()=>{const i=Object.keys(r);for(let e=0;e<i.length;e++)void 0===u[i[e]]&&(u[i[e]]=r[i[e]]);u.axisOrigin={x:n.value.originPosition.left,y:l.value.height-n.value.originPosition.bottom},u.axisTop=n.value.axisMargin,u.axisRight=l.value.width-n.value.axisMargin,u.axisWidth=u.axisRight-u.axisOrigin.x,u.axisHeight=u.axisOrigin.y-u.axisTop,u.yAxisTicksNum=n.value.yAxisRange.max-n.value.yAxisRange.min,u.xAxisTicksNum=n.value.xAxisRange.max-n.value.xAxisRange.min,u.xTickSpacing=u.axisWidth/u.xAxisTicksNum,u.yTickSpacing=u.axisHeight/u.yAxisTicksNum};return x(),s(l.value,(()=>{x()})),{diagramId:a,calAxisConfig:u}},render(){const{diagramId:i,calAxisConfig:e,view:a}=this;return l("div",{class:"devui-quadrant-diagram",id:i},[l(C,{diagramId:i,axisConfigs:e,view:a},null)])}});L.install=function(i){i.component(L.name,L)};var B={title:"QuadrantDiagram 象限图",category:"数据展示",status:"10%",install(i){i.use(L)}};export{L as QuadrantDiagram,B as default};
1
+ import { defineComponent, toRefs, ref, reactive, onMounted, watch, createVNode } from "vue";
2
+ const DEFAULT_AXIS_CONFIGS = {
3
+ tickWidth: 10,
4
+ spaceBetweenLabelsAxis: 20,
5
+ xAxisLabel: "\u7D27\u6025\u5EA6",
6
+ yAxisLabel: "\u91CD\u8981\u5EA6",
7
+ xAxisRange: {
8
+ min: 0,
9
+ max: 100,
10
+ step: 10
11
+ },
12
+ yAxisRange: {
13
+ min: 0,
14
+ max: 50,
15
+ step: 5
16
+ },
17
+ originPosition: {
18
+ left: 30,
19
+ bottom: 30
20
+ },
21
+ axisMargin: 35,
22
+ xWeight: 1,
23
+ yWeight: 1
24
+ };
25
+ const DEFAULT_VIEW_CONFIGS = {
26
+ height: 900,
27
+ width: 950
28
+ };
29
+ const AXIS_TITLE_SPACE = 15;
30
+ const quadrantDiagramProps = {
31
+ diagramId: {
32
+ type: String,
33
+ default: "1"
34
+ },
35
+ axisConfigs: {
36
+ type: Object,
37
+ default: DEFAULT_AXIS_CONFIGS
38
+ },
39
+ view: {
40
+ type: Object,
41
+ default: DEFAULT_VIEW_CONFIGS
42
+ }
43
+ };
44
+ const quadrantDiagramAxisProps = {
45
+ diagramId: {
46
+ type: String
47
+ },
48
+ axisConfigs: {
49
+ type: Object
50
+ },
51
+ view: {
52
+ type: Object
53
+ }
54
+ };
55
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
56
+ var freeGlobal$1 = freeGlobal;
57
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
58
+ var root = freeGlobal$1 || freeSelf || Function("return this")();
59
+ var root$1 = root;
60
+ var Symbol$1 = root$1.Symbol;
61
+ var Symbol$2 = Symbol$1;
62
+ var objectProto$1 = Object.prototype;
63
+ var hasOwnProperty = objectProto$1.hasOwnProperty;
64
+ var nativeObjectToString$1 = objectProto$1.toString;
65
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
66
+ function getRawTag(value) {
67
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
68
+ try {
69
+ value[symToStringTag$1] = void 0;
70
+ var unmasked = true;
71
+ } catch (e) {
72
+ }
73
+ var result = nativeObjectToString$1.call(value);
74
+ if (unmasked) {
75
+ if (isOwn) {
76
+ value[symToStringTag$1] = tag;
77
+ } else {
78
+ delete value[symToStringTag$1];
79
+ }
80
+ }
81
+ return result;
82
+ }
83
+ var objectProto = Object.prototype;
84
+ var nativeObjectToString = objectProto.toString;
85
+ function objectToString(value) {
86
+ return nativeObjectToString.call(value);
87
+ }
88
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
89
+ var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
90
+ function baseGetTag(value) {
91
+ if (value == null) {
92
+ return value === void 0 ? undefinedTag : nullTag;
93
+ }
94
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
95
+ }
96
+ function isObjectLike(value) {
97
+ return value != null && typeof value == "object";
98
+ }
99
+ var symbolTag = "[object Symbol]";
100
+ function isSymbol(value) {
101
+ return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
102
+ }
103
+ var reWhitespace = /\s/;
104
+ function trimmedEndIndex(string) {
105
+ var index2 = string.length;
106
+ while (index2-- && reWhitespace.test(string.charAt(index2))) {
107
+ }
108
+ return index2;
109
+ }
110
+ var reTrimStart = /^\s+/;
111
+ function baseTrim(string) {
112
+ return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
113
+ }
114
+ function isObject(value) {
115
+ var type = typeof value;
116
+ return value != null && (type == "object" || type == "function");
117
+ }
118
+ var NAN = 0 / 0;
119
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
120
+ var reIsBinary = /^0b[01]+$/i;
121
+ var reIsOctal = /^0o[0-7]+$/i;
122
+ var freeParseInt = parseInt;
123
+ function toNumber(value) {
124
+ if (typeof value == "number") {
125
+ return value;
126
+ }
127
+ if (isSymbol(value)) {
128
+ return NAN;
129
+ }
130
+ if (isObject(value)) {
131
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
132
+ value = isObject(other) ? other + "" : other;
133
+ }
134
+ if (typeof value != "string") {
135
+ return value === 0 ? value : +value;
136
+ }
137
+ value = baseTrim(value);
138
+ var isBinary = reIsBinary.test(value);
139
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
140
+ }
141
+ var now = function() {
142
+ return root$1.Date.now();
143
+ };
144
+ var now$1 = now;
145
+ var FUNC_ERROR_TEXT = "Expected a function";
146
+ var nativeMax = Math.max, nativeMin = Math.min;
147
+ function debounce(func, wait, options) {
148
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
149
+ if (typeof func != "function") {
150
+ throw new TypeError(FUNC_ERROR_TEXT);
151
+ }
152
+ wait = toNumber(wait) || 0;
153
+ if (isObject(options)) {
154
+ leading = !!options.leading;
155
+ maxing = "maxWait" in options;
156
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
157
+ trailing = "trailing" in options ? !!options.trailing : trailing;
158
+ }
159
+ function invokeFunc(time) {
160
+ var args = lastArgs, thisArg = lastThis;
161
+ lastArgs = lastThis = void 0;
162
+ lastInvokeTime = time;
163
+ result = func.apply(thisArg, args);
164
+ return result;
165
+ }
166
+ function leadingEdge(time) {
167
+ lastInvokeTime = time;
168
+ timerId = setTimeout(timerExpired, wait);
169
+ return leading ? invokeFunc(time) : result;
170
+ }
171
+ function remainingWait(time) {
172
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
173
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
174
+ }
175
+ function shouldInvoke(time) {
176
+ var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
177
+ return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
178
+ }
179
+ function timerExpired() {
180
+ var time = now$1();
181
+ if (shouldInvoke(time)) {
182
+ return trailingEdge(time);
183
+ }
184
+ timerId = setTimeout(timerExpired, remainingWait(time));
185
+ }
186
+ function trailingEdge(time) {
187
+ timerId = void 0;
188
+ if (trailing && lastArgs) {
189
+ return invokeFunc(time);
190
+ }
191
+ lastArgs = lastThis = void 0;
192
+ return result;
193
+ }
194
+ function cancel() {
195
+ if (timerId !== void 0) {
196
+ clearTimeout(timerId);
197
+ }
198
+ lastInvokeTime = 0;
199
+ lastArgs = lastCallTime = lastThis = timerId = void 0;
200
+ }
201
+ function flush() {
202
+ return timerId === void 0 ? result : trailingEdge(now$1());
203
+ }
204
+ function debounced() {
205
+ var time = now$1(), isInvoking = shouldInvoke(time);
206
+ lastArgs = arguments;
207
+ lastThis = this;
208
+ lastCallTime = time;
209
+ if (isInvoking) {
210
+ if (timerId === void 0) {
211
+ return leadingEdge(lastCallTime);
212
+ }
213
+ if (maxing) {
214
+ clearTimeout(timerId);
215
+ timerId = setTimeout(timerExpired, wait);
216
+ return invokeFunc(lastCallTime);
217
+ }
218
+ }
219
+ if (timerId === void 0) {
220
+ timerId = setTimeout(timerExpired, wait);
221
+ }
222
+ return result;
223
+ }
224
+ debounced.cancel = cancel;
225
+ debounced.flush = flush;
226
+ return debounced;
227
+ }
228
+ var index$1 = "";
229
+ var DQuadrantDiagramAxis = defineComponent({
230
+ name: "DQuadrantDiagramAxis",
231
+ props: quadrantDiagramAxisProps,
232
+ setup(props) {
233
+ const {
234
+ diagramId,
235
+ view,
236
+ axisConfigs
237
+ } = toRefs(props);
238
+ const AXIS_COLOR = ref("#0000ff");
239
+ const AXIS_LABEL_COLOR = ref("#ff0000");
240
+ const quadrantAxis = ref();
241
+ const context = ref();
242
+ const axisInnerAttr = reactive({
243
+ axisOrigin: {
244
+ x: 0,
245
+ y: 0
246
+ },
247
+ axisTop: 0,
248
+ axisRight: 0,
249
+ axisWidth: 0,
250
+ axisHeight: 0,
251
+ yAxisTicksNum: 0,
252
+ xAxisTicksNum: 0,
253
+ xTickSpacing: 0,
254
+ yTickSpacing: 0
255
+ });
256
+ const axisConfigsVal = axisConfigs.value;
257
+ onMounted(() => {
258
+ resetAxis();
259
+ });
260
+ watch(view.value, () => {
261
+ resetAxis();
262
+ });
263
+ const resetAxis = debounce(() => {
264
+ initAxisData();
265
+ setAxisData();
266
+ drawAxis();
267
+ drawAxisLabels();
268
+ }, 200);
269
+ const initAxisData = () => {
270
+ quadrantAxis.value = document.querySelector("#devui-quadrant-axis-" + diagramId.value);
271
+ };
272
+ const setAxisData = () => {
273
+ context.value = quadrantAxis.value.getContext("2d");
274
+ axisInnerAttr.axisOrigin = axisConfigsVal.axisOrigin;
275
+ axisInnerAttr.axisTop = axisConfigsVal.axisTop;
276
+ axisInnerAttr.axisRight = axisConfigsVal.axisRight;
277
+ axisInnerAttr.axisWidth = axisConfigsVal.axisWidth;
278
+ axisInnerAttr.axisHeight = axisConfigsVal.axisHeight;
279
+ axisInnerAttr.yAxisTicksNum = axisConfigsVal.yAxisTicksNum;
280
+ axisInnerAttr.xAxisTicksNum = axisConfigsVal.xAxisTicksNum;
281
+ axisInnerAttr.xTickSpacing = axisConfigsVal.xTickSpacing;
282
+ axisInnerAttr.yTickSpacing = axisConfigsVal.yTickSpacing;
283
+ };
284
+ const drawAxis = () => {
285
+ context.value.save();
286
+ context.value.fillStyle = AXIS_COLOR.value;
287
+ context.value.strokeStyle = AXIS_COLOR.value;
288
+ drawXAxis();
289
+ drawYAxis();
290
+ context.value.lineWidth = 0.5;
291
+ drawXAxisTicks();
292
+ drawYAxisTicks();
293
+ context.value.restore();
294
+ };
295
+ const drawYAxis = () => {
296
+ context.value.beginPath();
297
+ context.value.moveTo(axisInnerAttr.axisOrigin.x, axisInnerAttr.axisOrigin.y);
298
+ context.value.lineTo(axisInnerAttr.axisOrigin.x, axisInnerAttr.axisTop - axisConfigsVal.axisMargin);
299
+ context.value.stroke();
300
+ context.value.moveTo(axisInnerAttr.axisOrigin.x, axisInnerAttr.axisTop - axisConfigsVal.axisMargin);
301
+ context.value.lineTo(axisInnerAttr.axisOrigin.x + 5, axisInnerAttr.axisTop - axisConfigsVal.axisMargin + 10);
302
+ context.value.lineTo(axisInnerAttr.axisOrigin.x - 5, axisInnerAttr.axisTop - axisConfigsVal.axisMargin + 10);
303
+ context.value.fill();
304
+ };
305
+ const drawXAxis = () => {
306
+ context.value.beginPath();
307
+ context.value.moveTo(axisInnerAttr.axisOrigin.x, axisInnerAttr.axisOrigin.y);
308
+ context.value.lineTo(axisInnerAttr.axisRight + axisConfigsVal.axisMargin - 10, axisInnerAttr.axisOrigin.y);
309
+ context.value.stroke();
310
+ context.value.moveTo(axisInnerAttr.axisRight + axisConfigsVal.axisMargin, axisInnerAttr.axisOrigin.y);
311
+ context.value.lineTo(axisInnerAttr.axisRight + axisConfigsVal.axisMargin - 10, axisInnerAttr.axisOrigin.y + 5);
312
+ context.value.lineTo(axisInnerAttr.axisRight + axisConfigsVal.axisMargin - 10, axisInnerAttr.axisOrigin.y - 5);
313
+ context.value.fill();
314
+ };
315
+ const drawXAxisTicks = () => {
316
+ let deltaY;
317
+ for (let i = 1; i < axisInnerAttr.xAxisTicksNum; i++) {
318
+ context.value.beginPath();
319
+ if (i % axisConfigsVal.xAxisRange.step === 0) {
320
+ deltaY = axisConfigsVal.tickWidth;
321
+ } else {
322
+ deltaY = axisConfigsVal.tickWidth / 2;
323
+ }
324
+ context.value.moveTo(axisInnerAttr.axisOrigin.x + i * axisInnerAttr.xTickSpacing, axisInnerAttr.axisOrigin.y - deltaY);
325
+ context.value.lineTo(axisInnerAttr.axisOrigin.x + i * axisInnerAttr.xTickSpacing, axisInnerAttr.axisOrigin.y + deltaY);
326
+ context.value.stroke();
327
+ }
328
+ };
329
+ const drawYAxisTicks = () => {
330
+ let deltaX;
331
+ for (let i = 1; i < axisInnerAttr.yAxisTicksNum; i++) {
332
+ context.value.beginPath();
333
+ if (i % axisConfigsVal.yAxisRange.step === 0) {
334
+ deltaX = axisConfigsVal.tickWidth;
335
+ } else {
336
+ deltaX = axisConfigsVal.tickWidth / 2;
337
+ }
338
+ context.value.moveTo(axisInnerAttr.axisOrigin.x - deltaX, axisInnerAttr.axisOrigin.y - i * axisInnerAttr.yTickSpacing);
339
+ context.value.lineTo(axisInnerAttr.axisOrigin.x + deltaX, axisInnerAttr.axisOrigin.y - i * axisInnerAttr.yTickSpacing);
340
+ context.value.stroke();
341
+ }
342
+ };
343
+ const drawAxisLabels = () => {
344
+ context.value.save();
345
+ context.value.fillStyle = AXIS_LABEL_COLOR.value;
346
+ drawXTicksLabels();
347
+ drawYTicksLabels();
348
+ context.value.restore();
349
+ drawAxisTitle();
350
+ };
351
+ const drawXTicksLabels = () => {
352
+ context.value.textAlign = "center";
353
+ context.value.textBaseline = "top";
354
+ for (let i = 0; i <= axisInnerAttr.xAxisTicksNum; i++) {
355
+ if (i % axisConfigsVal.xAxisRange.step === 0) {
356
+ context.value.fillText(i, axisInnerAttr.axisOrigin.x + i * axisInnerAttr.xTickSpacing, axisInnerAttr.axisOrigin.y + axisConfigsVal.spaceBetweenLabelsAxis);
357
+ }
358
+ }
359
+ };
360
+ const drawYTicksLabels = () => {
361
+ context.value.textAlign = "center";
362
+ context.value.textBaseline = "middle";
363
+ for (let i = 0; i <= axisInnerAttr.yAxisTicksNum; i++) {
364
+ if (i % axisConfigsVal.yAxisRange.step === 0) {
365
+ context.value.fillText(i, axisInnerAttr.axisOrigin.x - axisConfigsVal.spaceBetweenLabelsAxis, axisInnerAttr.axisOrigin.y - i * axisInnerAttr.yTickSpacing);
366
+ }
367
+ }
368
+ };
369
+ const drawAxisTitle = () => {
370
+ context.value.font = "12px Microsoft YaHei";
371
+ context.value.textAlign = "left";
372
+ context.value.fillStyle = AXIS_LABEL_COLOR.value;
373
+ const xLabelWidth = context.value.measureText(axisConfigsVal.xAxisLabel).width;
374
+ rotateLabel(axisConfigsVal.xAxisLabel, axisInnerAttr.axisRight + axisConfigsVal.axisMargin / 2, axisInnerAttr.axisOrigin.y - xLabelWidth - AXIS_TITLE_SPACE);
375
+ context.value.fillText(axisConfigsVal.yAxisLabel, axisInnerAttr.axisOrigin.x + AXIS_TITLE_SPACE, axisInnerAttr.axisTop - axisConfigsVal.axisMargin / 2);
376
+ };
377
+ const rotateLabel = (name, x, y) => {
378
+ for (let i = 0; i < name.length; i++) {
379
+ const str = name.slice(i, i + 1).toString();
380
+ if (str.match(/[A-Za-z0-9]/)) {
381
+ context.value.save();
382
+ context.value.translate(x, y);
383
+ context.value.rotate(Math.PI / 180 * 90);
384
+ context.value.textBaseline = "bottom";
385
+ context.value.fillText(str, 0, 0);
386
+ context.value.restore();
387
+ y += context.value.measureText(str).width;
388
+ } else if (str.match(/[\u4E00-\u9FA5]/)) {
389
+ context.value.save();
390
+ context.value.textBaseline = "top";
391
+ context.value.fillText(str, x, y);
392
+ context.value.restore();
393
+ y += context.value.measureText(str).width;
394
+ }
395
+ }
396
+ };
397
+ },
398
+ render() {
399
+ const {
400
+ diagramId,
401
+ view
402
+ } = this;
403
+ return createVNode("div", null, [createVNode("canvas", {
404
+ "id": "devui-quadrant-axis-" + diagramId,
405
+ "height": view.height,
406
+ "width": view.width
407
+ }, null)]);
408
+ }
409
+ });
410
+ var QuadrantDiagram = defineComponent({
411
+ name: "DQuadrantDiagram",
412
+ props: quadrantDiagramProps,
413
+ setup(props) {
414
+ const {
415
+ diagramId,
416
+ axisConfigs,
417
+ view
418
+ } = toRefs(props);
419
+ const calAxisConfig = reactive({
420
+ axisOrigin: {
421
+ x: null,
422
+ y: null
423
+ },
424
+ axisTop: null,
425
+ axisRight: null,
426
+ axisWidth: null,
427
+ axisHeight: null,
428
+ yAxisTicksNum: null,
429
+ xAxisTicksNum: null,
430
+ xTickSpacing: null,
431
+ yTickSpacing: null
432
+ });
433
+ const initAxisData = () => {
434
+ const axisConfigKeys = Object.keys(DEFAULT_AXIS_CONFIGS);
435
+ for (let i = 0; i < axisConfigKeys.length; i++) {
436
+ if (calAxisConfig[axisConfigKeys[i]] === void 0) {
437
+ calAxisConfig[axisConfigKeys[i]] = DEFAULT_AXIS_CONFIGS[axisConfigKeys[i]];
438
+ }
439
+ }
440
+ calAxisConfig.axisOrigin = {
441
+ x: axisConfigs.value.originPosition.left,
442
+ y: view.value.height - axisConfigs.value.originPosition.bottom
443
+ };
444
+ calAxisConfig.axisTop = axisConfigs.value.axisMargin;
445
+ calAxisConfig.axisRight = view.value.width - axisConfigs.value.axisMargin;
446
+ calAxisConfig.axisWidth = calAxisConfig.axisRight - calAxisConfig.axisOrigin.x;
447
+ calAxisConfig.axisHeight = calAxisConfig.axisOrigin.y - calAxisConfig.axisTop;
448
+ calAxisConfig.yAxisTicksNum = axisConfigs.value.yAxisRange.max - axisConfigs.value.yAxisRange.min;
449
+ calAxisConfig.xAxisTicksNum = axisConfigs.value.xAxisRange.max - axisConfigs.value.xAxisRange.min;
450
+ calAxisConfig.xTickSpacing = calAxisConfig.axisWidth / calAxisConfig.xAxisTicksNum;
451
+ calAxisConfig.yTickSpacing = calAxisConfig.axisHeight / calAxisConfig.yAxisTicksNum;
452
+ };
453
+ initAxisData();
454
+ watch(view.value, () => {
455
+ initAxisData();
456
+ });
457
+ return {
458
+ diagramId,
459
+ calAxisConfig
460
+ };
461
+ },
462
+ render() {
463
+ const {
464
+ diagramId,
465
+ calAxisConfig,
466
+ view
467
+ } = this;
468
+ return createVNode("div", {
469
+ "class": "devui-quadrant-diagram",
470
+ "id": diagramId
471
+ }, [createVNode(DQuadrantDiagramAxis, {
472
+ "diagramId": diagramId,
473
+ "axisConfigs": calAxisConfig,
474
+ "view": view
475
+ }, null)]);
476
+ }
477
+ });
478
+ QuadrantDiagram.install = function(app) {
479
+ app.component(QuadrantDiagram.name, QuadrantDiagram);
480
+ };
481
+ var index = {
482
+ title: "QuadrantDiagram \u8C61\u9650\u56FE",
483
+ category: "\u6570\u636E\u5C55\u793A",
484
+ status: "10%",
485
+ install(app) {
486
+ app.use(QuadrantDiagram);
487
+ }
488
+ };
489
+ export { QuadrantDiagram, index as default };