vue-devui 1.0.0-pre.0 → 1.0.0-rc.10

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 (347) hide show
  1. package/README.md +149 -187
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8182 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +30 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5741 -127
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +59 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8060 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +379 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +5 -7
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8159 -288
  31. package/date-picker/index.umd.js +27 -1
  32. package/date-picker/style.css +1 -1
  33. package/drawer/index.es.js +31 -4
  34. package/drawer/index.umd.js +1 -1
  35. package/drawer/style.css +1 -1
  36. package/dropdown/index.es.js +297 -181
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +525 -154
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1039 -1175
  43. package/form/index.umd.js +15 -15
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +42 -21
  46. package/fullscreen/index.umd.js +1 -1
  47. package/fullscreen/style.css +1 -1
  48. package/grid/index.es.js +101 -86
  49. package/grid/index.umd.js +1 -1
  50. package/grid/style.css +1 -1
  51. package/icon/index.es.js +197 -56
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +55 -31
  55. package/image-preview/index.umd.js +1 -1
  56. package/image-preview/style.css +1 -1
  57. package/input/index.es.js +8066 -144
  58. package/input/index.umd.js +27 -1
  59. package/input/style.css +1 -1
  60. package/input-number/index.es.js +269 -183
  61. package/input-number/index.umd.js +1 -1
  62. package/input-number/style.css +1 -1
  63. package/layout/index.es.js +40 -25
  64. package/layout/index.umd.js +1 -1
  65. package/layout/style.css +1 -1
  66. package/loading/index.es.js +74 -35
  67. package/loading/index.umd.js +1 -1
  68. package/loading/style.css +1 -1
  69. package/modal/index.es.js +412 -204
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +307 -57
  73. package/notification/index.umd.js +1 -1
  74. package/notification/style.css +1 -1
  75. package/nuxt/components/ButtonGroup.js +3 -0
  76. package/nuxt/components/CheckboxButton.js +3 -0
  77. package/nuxt/components/CheckboxGroup.js +3 -0
  78. package/nuxt/components/Collapse.js +3 -0
  79. package/nuxt/components/CollapseItem.js +3 -0
  80. package/nuxt/components/DropdownPropsKey.js +3 -0
  81. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  82. package/nuxt/components/FORM_TOKEN.js +3 -0
  83. package/nuxt/components/Icon.js +1 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/LABEL_DATA.js +3 -0
  86. package/nuxt/components/LoadingOptions.js +3 -0
  87. package/nuxt/components/Option.js +3 -0
  88. package/nuxt/components/PanelBody.js +3 -0
  89. package/nuxt/components/PanelFooter.js +3 -0
  90. package/nuxt/components/PanelHeader.js +3 -0
  91. package/nuxt/components/RadioButton.js +3 -0
  92. package/nuxt/components/Tab.js +3 -0
  93. package/nuxt/components/Timeline.js +3 -0
  94. package/nuxt/components/TimelineItem.js +3 -0
  95. package/nuxt/components/alertProps.js +3 -0
  96. package/nuxt/components/autoCompleteProps.js +3 -0
  97. package/nuxt/components/avatarProps.js +3 -0
  98. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  99. package/nuxt/components/buttonGroupProps.js +3 -0
  100. package/nuxt/components/cardProps.js +3 -0
  101. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  102. package/nuxt/components/checkboxGroupProps.js +3 -0
  103. package/nuxt/components/checkboxProps.js +3 -0
  104. package/nuxt/components/colProps.js +3 -0
  105. package/nuxt/components/colPropsBaseClass.js +3 -0
  106. package/nuxt/components/colPropsBaseStyle.js +3 -0
  107. package/nuxt/components/collapseItemProps.js +3 -0
  108. package/nuxt/components/collapseProps.js +3 -0
  109. package/nuxt/components/countdownProps.js +3 -0
  110. package/nuxt/components/editableSelectProps.js +3 -0
  111. package/nuxt/components/formItemProps.js +3 -0
  112. package/nuxt/components/formProps.js +3 -0
  113. package/nuxt/components/fullscreenProps.js +3 -0
  114. package/nuxt/components/iconProps.js +3 -0
  115. package/nuxt/components/imagePreviewProps.js +3 -0
  116. package/nuxt/components/inputProps.js +3 -0
  117. package/nuxt/components/loadingProps.js +3 -0
  118. package/nuxt/components/modalProps.js +3 -0
  119. package/nuxt/components/paginationProps.js +3 -0
  120. package/nuxt/components/panelProps.js +3 -0
  121. package/nuxt/components/progressProps.js +3 -0
  122. package/nuxt/components/rateProps.js +3 -0
  123. package/nuxt/components/resultProps.js +3 -0
  124. package/nuxt/components/rowProps.js +3 -0
  125. package/nuxt/components/screenSizes.js +3 -0
  126. package/nuxt/components/searchProps.js +3 -0
  127. package/nuxt/components/skeletonProps.js +3 -0
  128. package/nuxt/components/sliderProps.js +3 -0
  129. package/nuxt/components/splitterProps.js +3 -0
  130. package/nuxt/components/statisticProps.js +3 -0
  131. package/nuxt/components/svgIconProps.js +3 -0
  132. package/nuxt/components/switchProps.js +3 -0
  133. package/nuxt/components/tabsProps.js +3 -0
  134. package/nuxt/components/tagProps.js +3 -0
  135. package/nuxt/components/textareaProps.js +3 -0
  136. package/nuxt/components/timeAxisProps.js +3 -0
  137. package/nuxt/components/treeProps.js +3 -0
  138. package/overlay/index.es.js +127 -149
  139. package/overlay/index.umd.js +1 -1
  140. package/overlay/style.css +1 -1
  141. package/package.json +10 -44
  142. package/pagination/index.es.js +158 -148
  143. package/pagination/index.umd.js +1 -1
  144. package/pagination/style.css +1 -1
  145. package/panel/index.es.js +45 -32
  146. package/panel/index.umd.js +1 -1
  147. package/panel/style.css +1 -1
  148. package/popover/index.es.js +317 -246
  149. package/popover/index.umd.js +15 -15
  150. package/popover/style.css +1 -1
  151. package/progress/index.es.js +110 -56
  152. package/progress/index.umd.js +3 -3
  153. package/progress/style.css +1 -1
  154. package/radio/index.es.js +7964 -157
  155. package/radio/index.umd.js +27 -1
  156. package/radio/style.css +1 -1
  157. package/rate/index.es.js +77 -55
  158. package/rate/index.umd.js +1 -1
  159. package/rate/style.css +1 -1
  160. package/result/index.es.js +184 -57
  161. package/result/index.umd.js +1 -1
  162. package/result/style.css +1 -1
  163. package/ripple/index.es.js +47 -42
  164. package/ripple/index.umd.js +1 -1
  165. package/search/index.es.js +3644 -1122
  166. package/search/index.umd.js +18 -18
  167. package/search/style.css +1 -1
  168. package/select/index.es.js +9144 -597
  169. package/select/index.umd.js +27 -1
  170. package/select/style.css +1 -1
  171. package/skeleton/index.es.js +63 -41
  172. package/skeleton/index.umd.js +1 -1
  173. package/skeleton/style.css +1 -1
  174. package/slider/index.es.js +109 -75
  175. package/slider/index.umd.js +1 -1
  176. package/slider/style.css +1 -1
  177. package/splitter/index.es.js +469 -349
  178. package/splitter/index.umd.js +15 -15
  179. package/splitter/style.css +1 -1
  180. package/statistic/index.es.js +7 -18
  181. package/statistic/index.umd.js +1 -1
  182. package/status/index.es.js +27 -6
  183. package/status/index.umd.js +1 -1
  184. package/status/style.css +1 -1
  185. package/style.css +1 -1
  186. package/switch/index.es.js +7794 -64
  187. package/switch/index.umd.js +27 -1
  188. package/switch/style.css +1 -1
  189. package/table/index.es.js +10119 -1206
  190. package/table/index.umd.js +27 -1
  191. package/table/style.css +1 -1
  192. package/tabs/index.es.js +342 -141
  193. package/tabs/index.umd.js +1 -1
  194. package/tabs/style.css +1 -1
  195. package/tag/index.es.js +49 -24
  196. package/tag/index.umd.js +1 -1
  197. package/tag/style.css +1 -1
  198. package/textarea/index.es.js +7913 -83
  199. package/textarea/index.umd.js +35 -1
  200. package/textarea/style.css +1 -1
  201. package/{anchor → timeline}/index.d.ts +0 -0
  202. package/timeline/index.es.js +425 -0
  203. package/timeline/index.umd.js +1 -0
  204. package/{back-top → timeline}/package.json +1 -1
  205. package/timeline/style.css +1 -0
  206. package/tooltip/index.es.js +308 -236
  207. package/tooltip/index.umd.js +15 -15
  208. package/tooltip/style.css +1 -1
  209. package/tree/index.es.js +4189 -1851
  210. package/tree/index.umd.js +18 -18
  211. package/tree/style.css +1 -1
  212. package/upload/index.es.js +380 -123
  213. package/upload/index.umd.js +1 -1
  214. package/upload/style.css +1 -1
  215. package/vue-devui.es.js +18121 -23161
  216. package/vue-devui.umd.js +25 -15
  217. package/accordion/index.es.js +0 -720
  218. package/accordion/index.umd.js +0 -1
  219. package/accordion/package.json +0 -7
  220. package/accordion/style.css +0 -1
  221. package/anchor/index.es.js +0 -263
  222. package/anchor/index.umd.js +0 -1
  223. package/anchor/style.css +0 -1
  224. package/back-top/index.d.ts +0 -7
  225. package/back-top/index.es.js +0 -128
  226. package/back-top/index.umd.js +0 -1
  227. package/back-top/style.css +0 -1
  228. package/breadcrumb/index.d.ts +0 -7
  229. package/breadcrumb/index.es.js +0 -127
  230. package/breadcrumb/index.umd.js +0 -1
  231. package/breadcrumb/package.json +0 -7
  232. package/breadcrumb/style.css +0 -1
  233. package/carousel/index.d.ts +0 -7
  234. package/carousel/index.es.js +0 -329
  235. package/carousel/index.umd.js +0 -1
  236. package/carousel/package.json +0 -7
  237. package/carousel/style.css +0 -1
  238. package/cascader/index.d.ts +0 -7
  239. package/cascader/index.es.js +0 -5963
  240. package/cascader/index.umd.js +0 -27
  241. package/cascader/package.json +0 -7
  242. package/cascader/style.css +0 -1
  243. package/color-picker/index.d.ts +0 -7
  244. package/color-picker/index.es.js +0 -8187
  245. package/color-picker/index.umd.js +0 -27
  246. package/color-picker/package.json +0 -7
  247. package/color-picker/style.css +0 -1
  248. package/comment/index.d.ts +0 -7
  249. package/comment/index.es.js +0 -86
  250. package/comment/index.umd.js +0 -1
  251. package/comment/package.json +0 -7
  252. package/comment/style.css +0 -1
  253. package/dragdrop/index.d.ts +0 -7
  254. package/dragdrop/index.es.js +0 -157
  255. package/dragdrop/index.umd.js +0 -1
  256. package/dragdrop/package.json +0 -7
  257. package/gantt/index.d.ts +0 -7
  258. package/gantt/index.es.js +0 -523
  259. package/gantt/index.umd.js +0 -1
  260. package/gantt/package.json +0 -7
  261. package/gantt/style.css +0 -1
  262. package/input-icon/index.d.ts +0 -7
  263. package/input-icon/index.es.js +0 -331
  264. package/input-icon/index.umd.js +0 -1
  265. package/input-icon/package.json +0 -7
  266. package/input-icon/style.css +0 -1
  267. package/list/index.d.ts +0 -7
  268. package/list/index.es.js +0 -39
  269. package/list/index.umd.js +0 -1
  270. package/list/package.json +0 -7
  271. package/list/style.css +0 -1
  272. package/nav-sprite/index.d.ts +0 -7
  273. package/nav-sprite/index.es.js +0 -68
  274. package/nav-sprite/index.umd.js +0 -1
  275. package/nav-sprite/package.json +0 -7
  276. package/nuxt/components/Accordion.js +0 -3
  277. package/nuxt/components/Anchor.js +0 -3
  278. package/nuxt/components/BackTop.js +0 -3
  279. package/nuxt/components/Breadcrumb.js +0 -3
  280. package/nuxt/components/Carousel.js +0 -3
  281. package/nuxt/components/CarouselItem.js +0 -3
  282. package/nuxt/components/Cascader.js +0 -3
  283. package/nuxt/components/ColorPicker.js +0 -3
  284. package/nuxt/components/Comment.js +0 -3
  285. package/nuxt/components/FormControl.js +0 -3
  286. package/nuxt/components/FormLabel.js +0 -3
  287. package/nuxt/components/Gantt.js +0 -3
  288. package/nuxt/components/InputIcon.js +0 -3
  289. package/nuxt/components/List.js +0 -3
  290. package/nuxt/components/ListItem.js +0 -3
  291. package/nuxt/components/NavSprite.js +0 -2
  292. package/nuxt/components/QuadrantDiagram.js +0 -3
  293. package/nuxt/components/ReadTip.js +0 -3
  294. package/nuxt/components/StepsGuide.js +0 -3
  295. package/nuxt/components/Sticky.js +0 -2
  296. package/nuxt/components/TagInput.js +0 -3
  297. package/nuxt/components/TimeAxis.js +0 -3
  298. package/nuxt/components/TimeAxisItem.js +0 -3
  299. package/nuxt/components/TimePicker.js +0 -3
  300. package/nuxt/components/Transfer.js +0 -3
  301. package/nuxt/components/TreeSelect.js +0 -3
  302. package/nuxt/components/overlayEmits.js +0 -3
  303. package/nuxt/components/overlayProps.js +0 -3
  304. package/quadrant-diagram/index.d.ts +0 -7
  305. package/quadrant-diagram/index.es.js +0 -5728
  306. package/quadrant-diagram/index.umd.js +0 -27
  307. package/quadrant-diagram/package.json +0 -7
  308. package/quadrant-diagram/style.css +0 -1
  309. package/read-tip/index.d.ts +0 -7
  310. package/read-tip/index.es.js +0 -258
  311. package/read-tip/index.umd.js +0 -1
  312. package/read-tip/package.json +0 -7
  313. package/read-tip/style.css +0 -1
  314. package/steps-guide/index.d.ts +0 -7
  315. package/steps-guide/index.es.js +0 -239
  316. package/steps-guide/index.umd.js +0 -1
  317. package/steps-guide/package.json +0 -7
  318. package/steps-guide/style.css +0 -1
  319. package/sticky/index.d.ts +0 -7
  320. package/sticky/index.es.js +0 -197
  321. package/sticky/index.umd.js +0 -1
  322. package/sticky/package.json +0 -7
  323. package/tag-input/index.d.ts +0 -7
  324. package/tag-input/index.es.js +0 -329
  325. package/tag-input/index.umd.js +0 -1
  326. package/tag-input/package.json +0 -7
  327. package/tag-input/style.css +0 -1
  328. package/time-axis/index.d.ts +0 -7
  329. package/time-axis/index.es.js +0 -299
  330. package/time-axis/index.umd.js +0 -1
  331. package/time-axis/package.json +0 -7
  332. package/time-axis/style.css +0 -1
  333. package/time-picker/index.d.ts +0 -7
  334. package/time-picker/index.es.js +0 -1237
  335. package/time-picker/index.umd.js +0 -1
  336. package/time-picker/package.json +0 -7
  337. package/time-picker/style.css +0 -1
  338. package/transfer/index.d.ts +0 -7
  339. package/transfer/index.es.js +0 -7608
  340. package/transfer/index.umd.js +0 -27
  341. package/transfer/package.json +0 -7
  342. package/transfer/style.css +0 -1
  343. package/tree-select/index.d.ts +0 -7
  344. package/tree-select/index.es.js +0 -623
  345. package/tree-select/index.umd.js +0 -1
  346. package/tree-select/package.json +0 -7
  347. package/tree-select/style.css +0 -1
@@ -1,47 +1,91 @@
1
- import { defineComponent, toRefs, reactive, watch, createVNode, createTextVNode } from "vue";
1
+ import { defineComponent, toRefs, ref, effect, reactive, watch, createVNode, createTextVNode } from "vue";
2
+ function middleNum(num, min = 0, max = 100) {
3
+ let middle = 0;
4
+ middle = Math.min(num, max);
5
+ middle = Math.max(middle, min);
6
+ return middle;
7
+ }
8
+ const progressProps = {
9
+ height: {
10
+ type: String,
11
+ default: "20px"
12
+ },
13
+ percentage: {
14
+ type: Number,
15
+ default: 0
16
+ },
17
+ percentageText: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ barBgColor: {
22
+ type: String,
23
+ default: "#5170ff"
24
+ },
25
+ isCircle: {
26
+ type: Boolean,
27
+ default: false
28
+ },
29
+ strokeWidth: {
30
+ type: Number,
31
+ default: 6
32
+ },
33
+ showContent: {
34
+ type: Boolean,
35
+ default: true
36
+ },
37
+ percentageTextPlacement: {
38
+ type: String,
39
+ default: "inside"
40
+ },
41
+ percentageTextColor: {
42
+ type: String,
43
+ default: ""
44
+ }
45
+ };
46
+ function createBem(namespace, element, modifier) {
47
+ let cls = namespace;
48
+ if (element) {
49
+ cls += `__${element}`;
50
+ }
51
+ if (modifier) {
52
+ cls += `--${modifier}`;
53
+ }
54
+ return cls;
55
+ }
56
+ function useNamespace(block, needDot = false) {
57
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
58
+ const b = () => createBem(namespace);
59
+ const e = (element) => element ? createBem(namespace, element) : "";
60
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
61
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
62
+ return {
63
+ b,
64
+ e,
65
+ m,
66
+ em
67
+ };
68
+ }
2
69
  var progress = "";
3
70
  var Progress = defineComponent({
4
71
  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
- },
72
+ props: progressProps,
35
73
  setup(props) {
36
74
  const {
37
75
  height,
38
76
  percentage,
39
77
  percentageText,
78
+ percentageTextPlacement,
79
+ percentageTextColor,
40
80
  barBgColor,
41
81
  isCircle,
42
82
  strokeWidth,
43
83
  showContent
44
84
  } = toRefs(props);
85
+ const normalPercentage = ref(0);
86
+ effect(() => {
87
+ normalPercentage.value = middleNum(percentage.value);
88
+ });
45
89
  const data = reactive({
46
90
  pathString: "",
47
91
  trailPath: null,
@@ -59,32 +103,35 @@ var Progress = defineComponent({
59
103
  a ${radius},${radius} 0 1 1 0,${endPositionY}`;
60
104
  const len = Math.PI * 2 * radius;
61
105
  data.trailPath = {
62
- stroke: "#dfe1e6",
106
+ stroke: "var(--devui-dividing-line, #dfe1e6)",
63
107
  strokeDasharray: `${len}px ${len}px`,
64
108
  strokeDashoffset: `0`,
65
109
  transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"
66
110
  };
67
111
  data.strokePath = {
68
112
  stroke: barBgColor || null,
69
- strokeDasharray: `${percentage.value / 100 * len}px ${len}px`,
113
+ strokeDasharray: `${normalPercentage.value / 100 * len}px ${len}px`,
70
114
  strokeDashoffset: `0`,
71
115
  transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
72
116
  };
73
117
  };
74
118
  setCircleProgress();
75
- watch([height, percentage, percentageText, barBgColor, isCircle, strokeWidth, showContent], () => {
119
+ watch([height, normalPercentage, percentageText, percentageTextPlacement, percentageTextColor, barBgColor, isCircle, strokeWidth, showContent], () => {
76
120
  setCircleProgress();
77
121
  });
78
122
  return {
79
- data
123
+ data,
124
+ normalPercentage
80
125
  };
81
126
  },
82
127
  render() {
83
128
  var _a;
84
129
  const {
85
130
  height,
86
- percentage,
131
+ normalPercentage,
87
132
  percentageText,
133
+ percentageTextPlacement,
134
+ percentageTextColor,
88
135
  barBgColor,
89
136
  isCircle,
90
137
  strokeWidth,
@@ -92,62 +139,69 @@ var Progress = defineComponent({
92
139
  data,
93
140
  $slots
94
141
  } = this;
142
+ const ns = useNamespace("progress");
143
+ const isOutside = percentageTextPlacement === "outside";
144
+ const isInsideBg = percentageTextPlacement === "insideBg";
145
+ const createPercentageText = () => {
146
+ return createVNode("span", {
147
+ "style": {
148
+ lineHeight: height,
149
+ color: percentageTextColor
150
+ }
151
+ }, [percentageText]);
152
+ };
95
153
  const progressLine = createVNode("div", {
96
- "class": "devui-progress--line",
154
+ "class": ns.e("content")
155
+ }, [createVNode("div", {
156
+ "class": ns.e("line"),
97
157
  "style": {
98
158
  height,
99
159
  borderRadius: height
100
160
  }
101
161
  }, [createVNode("div", {
102
- "class": "devui-progress-bar",
162
+ "class": [ns.e("bar"), percentageTextPlacement],
103
163
  "style": {
104
164
  height,
105
165
  borderRadius: height,
106
- width: `${percentage}%`,
166
+ width: `${normalPercentage}%`,
107
167
  backgroundColor: barBgColor
108
168
  }
109
- }, null), createVNode("span", {
169
+ }, [!isOutside && !isInsideBg ? createPercentageText() : null]), isInsideBg ? createPercentageText() : null]), isOutside && !!percentageText ? createPercentageText() : null]);
170
+ const textElement = createVNode("span", {
171
+ "class": ns.e("circle-text"),
110
172
  "style": {
111
- lineHeight: height
173
+ color: percentageTextColor
112
174
  }
113
- }, [percentageText])]);
114
- const textElement = createVNode("span", {
115
- "class": "devui-progress-circle-text"
116
- }, [percentage, createTextVNode("%")]);
175
+ }, [normalPercentage, createTextVNode("%")]);
117
176
  const progressCircle = createVNode("div", {
118
- "class": "devui-progress-circle"
177
+ "class": ns.e("circle")
119
178
  }, [createVNode("svg", {
120
- "class": "devui-progress-circle",
179
+ "class": ns.e("circle"),
121
180
  "viewBox": "0 0 100 100"
122
181
  }, [createVNode("path", {
123
- "class": "devui-progress-circle-trail",
124
182
  "fill-opacity": "0",
125
183
  "stroke-width": strokeWidth,
126
184
  "style": data.trailPath,
127
185
  "d": data.pathString
128
186
  }, null), createVNode("path", {
129
- "class": "devui-progress-circle-path",
130
187
  "d": data.pathString,
131
188
  "stroke-linecap": "round",
132
189
  "fill-opacity": "0",
133
190
  "stroke": barBgColor,
134
- "stroke-width": percentage ? strokeWidth : 0,
191
+ "stroke-width": normalPercentage ? strokeWidth : 0,
135
192
  "style": data.strokePath
136
193
  }, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
137
194
  return createVNode("div", {
138
- "class": "devui-progress"
195
+ "class": ns.b()
139
196
  }, [!isCircle ? progressLine : progressCircle]);
140
197
  }
141
198
  });
142
- Progress.install = function(app) {
143
- app.component(Progress.name, Progress);
144
- };
145
199
  var index = {
146
200
  title: "Progress \u8FDB\u5EA6\u6761",
147
201
  category: "\u6570\u636E\u5C55\u793A",
148
202
  status: "100%",
149
203
  install(app) {
150
- app.use(Progress);
204
+ app.component(Progress.name, Progress);
151
205
  }
152
206
  };
153
- export { Progress, index as default };
207
+ export { Progress, index as default, progressProps };
@@ -1,3 +1,3 @@
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"});
1
+ (function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";function $(t,o=0,r=100){let s=0;return s=Math.min(t,r),s=Math.max(s,o),s}const C={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},percentageTextPlacement:{type:String,default:"inside"},percentageTextColor:{type:String,default:""}};function P(t,o,r){let s=t;return o&&(s+=`__${o}`),r&&(s+=`--${r}`),s}function b(t,o=!1){const r=o?`.devui-${t}`:`devui-${t}`;return{b:()=>P(r),e:a=>a?P(r,a):"",m:a=>a?P(r,"",a):"",em:(a,d)=>a&&d?P(r,a,d):""}}var S="",x=e.defineComponent({name:"DProgress",props:C,setup(t){const{height:o,percentage:r,percentageText:s,percentageTextPlacement:g,percentageTextColor:h,barBgColor:f,isCircle:a,strokeWidth:d,showContent:u}=e.toRefs(t),l=e.ref(0);e.effect(()=>{l.value=$(r.value)});const n=e.reactive({pathString:"",trailPath:null,strokePath:null}),y=()=>{if(!a)return;const c=50-d.value/2,k=-c,m=c*-2;n.pathString=`M 50,50 m 0,${k}
2
+ a ${c},${c} 0 1 1 0,${-m}
3
+ a ${c},${c} 0 1 1 0,${m}`;const p=Math.PI*2*c;n.trailPath={stroke:"var(--devui-dividing-line, #dfe1e6)",strokeDasharray:`${p}px ${p}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},n.strokePath={stroke:f||null,strokeDasharray:`${l.value/100*p}px ${p}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return y(),e.watch([o,l,s,g,h,f,a,d,u],()=>{y()}),{data:n,normalPercentage:l}},render(){var N;const{height:t,normalPercentage:o,percentageText:r,percentageTextPlacement:s,percentageTextColor:g,barBgColor:h,isCircle:f,strokeWidth:a,showContent:d,data:u,$slots:l}=this,n=b("progress"),y=s==="outside",c=s==="insideBg",k=()=>e.createVNode("span",{style:{lineHeight:t,color:g}},[r]),m=e.createVNode("div",{class:n.e("content")},[e.createVNode("div",{class:n.e("line"),style:{height:t,borderRadius:t}},[e.createVNode("div",{class:[n.e("bar"),s],style:{height:t,borderRadius:t,width:`${o}%`,backgroundColor:h}},[!y&&!c?k():null]),c?k():null]),y&&!!r?k():null]),p=e.createVNode("span",{class:n.e("circle-text"),style:{color:g}},[o,e.createTextVNode("%")]),V=e.createVNode("div",{class:n.e("circle")},[e.createVNode("svg",{class:n.e("circle"),viewBox:"0 0 100 100"},[e.createVNode("path",{"fill-opacity":"0","stroke-width":a,style:u.trailPath,d:u.pathString},null),e.createVNode("path",{d:u.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:h,"stroke-width":o?a:0,style:u.strokePath},null)]),d&&((N=l.default)==null?void 0:N.call(l)),d&&!l.default&&p]);return e.createVNode("div",{class:n.b()},[f?V:m])}}),T={title:"Progress \u8FDB\u5EA6\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(x.name,x)}};i.Progress=x,i.default=T,i.progressProps=C,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
@@ -1 +1 @@
1
- .devui-progress--line{position:relative;background:#dfe1e6}.devui-progress--line .devui-progress-bar{width:0;height:100%;transition:width .6s ease;background-color:#5e7ce0}.devui-progress--line>span{display:block;white-space:nowrap;color:#fff;text-align:center;position:absolute;left:0;top:0;height:100%;width:100%;font-size:12px;line-height:1.5}.devui-progress-circle{position:relative}.devui-progress-circle .devui-progress-circle-text{position:absolute;top:50%;left:50%;width:100%;margin:0;padding:0;color:#252b3a;line-height:1;white-space:normal;text-align:center;transform:translate(-50%,-50%)}
1
+ .devui-progress__content{display:flex;flex-wrap:nowrap}.devui-progress__content .devui-progress__line{width:100%;position:relative;background:var(--devui-dividing-line, #f2f2f3)}.devui-progress__content .devui-progress__line .devui-progress__bar{width:0;height:100%;transition:width .6s ease;background-color:#5e7ce0}.devui-progress__content .devui-progress__line .devui-progress__bar>span{display:block;white-space:nowrap;color:var(--devui-light-text, #ffffff);font-size:12px;line-height:1.5;padding:0 10px}.devui-progress__content .devui-progress__line>span{display:block;white-space:nowrap;color:var(--devui-light-text, #ffffff);text-align:center;position:absolute;left:0;top:0;height:100%;width:100%;font-size:12px;line-height:1.5}.devui-progress__content .devui-progress__line .inside{text-align:center}.devui-progress__content .devui-progress__line .insideLeft{text-align:left}.devui-progress__content .devui-progress__line .insideRight{text-align:right}.devui-progress__content>span{min-width:46px;padding:0 5px;text-align:center}.devui-progress__circle{position:relative}.devui-progress__circle .devui-progress__circle-text{position:absolute;top:50%;left:50%;width:100%;margin:0;padding:0;color:var(--devui-text, #252b3a);line-height:1;white-space:normal;text-align:center;transform:translate(-50%,-50%)}