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.
- package/README.md +149 -187
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8182 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +30 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +59 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8060 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8159 -288
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1039 -1175
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8066 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +10 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7964 -157
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3644 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9144 -597
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +109 -75
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +7 -18
- package/statistic/index.umd.js +1 -1
- package/status/index.es.js +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7794 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10119 -1206
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +342 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7913 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/{anchor → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +4189 -1851
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +380 -123
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +18121 -23161
- package/vue-devui.umd.js +25 -15
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.d.ts +0 -7
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/package.json +0 -7
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.es.js +0 -8187
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -258
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/progress/index.es.js
CHANGED
|
@@ -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: `${
|
|
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,
|
|
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
|
-
|
|
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": "
|
|
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": "
|
|
162
|
+
"class": [ns.e("bar"), percentageTextPlacement],
|
|
103
163
|
"style": {
|
|
104
164
|
height,
|
|
105
165
|
borderRadius: height,
|
|
106
|
-
width: `${
|
|
166
|
+
width: `${normalPercentage}%`,
|
|
107
167
|
backgroundColor: barBgColor
|
|
108
168
|
}
|
|
109
|
-
}, null),
|
|
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
|
-
|
|
173
|
+
color: percentageTextColor
|
|
112
174
|
}
|
|
113
|
-
}, [
|
|
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": "
|
|
177
|
+
"class": ns.e("circle")
|
|
119
178
|
}, [createVNode("svg", {
|
|
120
|
-
"class": "
|
|
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":
|
|
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":
|
|
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.
|
|
204
|
+
app.component(Progress.name, Progress);
|
|
151
205
|
}
|
|
152
206
|
};
|
|
153
|
-
export { Progress, index as default };
|
|
207
|
+
export { Progress, index as default, progressProps };
|
package/progress/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
a ${
|
|
3
|
-
a ${
|
|
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"});
|
package/progress/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
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%)}
|