vue-devui 1.0.0-rc.4 → 1.0.0-rc.7
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 +21 -7
- package/auto-complete/index.es.js +26 -4
- package/auto-complete/index.umd.js +3 -3
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +2 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +4 -3
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/card/index.es.js +35 -29
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +1 -1
- package/{comment → date-picker}/index.d.ts +0 -0
- package/date-picker/index.es.js +1145 -0
- package/date-picker/index.umd.js +1 -0
- package/date-picker/package.json +7 -0
- package/date-picker/style.css +1 -0
- package/{read-tip → drawer}/index.d.ts +0 -0
- package/drawer/index.es.js +236 -0
- package/drawer/index.umd.js +1 -0
- package/{comment → drawer}/package.json +1 -1
- package/drawer/style.css +1 -0
- package/{tag-input → dropdown}/index.d.ts +0 -0
- package/dropdown/index.es.js +718 -0
- package/dropdown/index.umd.js +1 -0
- package/{read-tip → dropdown}/package.json +1 -1
- package/dropdown/style.css +1 -0
- package/editable-select/index.es.js +14 -14
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +7511 -0
- package/form/index.umd.js +27 -0
- package/{tag-input → form}/package.json +1 -1
- package/form/style.css +1 -0
- package/fullscreen/index.es.js +1 -1
- package/fullscreen/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +13 -19
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +251 -0
- package/input-number/index.umd.js +1 -0
- package/input-number/package.json +7 -0
- package/input-number/style.css +1 -0
- package/loading/style.css +1 -1
- package/modal/index.es.js +15 -3
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/formControlProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +15 -3
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +2 -2
- package/pagination/index.es.js +80 -96
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/popover/index.es.js +15 -3
- package/popover/index.umd.js +9 -9
- package/popover/style.css +1 -1
- package/progress/index.es.js +48 -14
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/rate/index.es.js +29 -36
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/search/index.es.js +15 -19
- package/search/index.umd.js +12 -12
- package/search/style.css +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +696 -0
- package/select/index.umd.js +1 -0
- package/select/package.json +7 -0
- package/select/style.css +1 -0
- package/slider/index.es.js +18 -6
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +15 -3
- package/splitter/index.umd.js +11 -11
- package/splitter/style.css +1 -1
- package/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +2662 -0
- package/table/index.umd.js +1 -0
- package/table/package.json +7 -0
- package/table/style.css +1 -0
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +194 -0
- package/tabs/index.umd.js +1 -0
- package/tabs/package.json +7 -0
- package/tabs/style.css +1 -0
- package/textarea/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +5847 -0
- package/tooltip/index.umd.js +27 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +1021 -0
- package/tree/index.umd.js +1 -0
- package/tree/package.json +7 -0
- package/tree/style.css +1 -0
- package/upload/style.css +1 -1
- package/vue-devui.es.js +11482 -6434
- package/vue-devui.umd.js +24 -24
- package/comment/index.es.js +0 -84
- package/comment/index.umd.js +0 -1
- package/comment/style.css +0 -1
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/commentProps.js +0 -3
- package/nuxt/components/readTipProps.js +0 -3
- package/nuxt/components/tagInputProps.js +0 -3
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/style.css +0 -1
- package/tag-input/index.es.js +0 -328
- package/tag-input/index.umd.js +0 -1
- package/tag-input/style.css +0 -1
package/progress/index.es.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
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
|
+
}
|
|
2
8
|
const progressProps = {
|
|
3
9
|
height: {
|
|
4
10
|
type: String,
|
|
@@ -27,6 +33,14 @@ const progressProps = {
|
|
|
27
33
|
showContent: {
|
|
28
34
|
type: Boolean,
|
|
29
35
|
default: true
|
|
36
|
+
},
|
|
37
|
+
percentageTextPlacement: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "inside"
|
|
40
|
+
},
|
|
41
|
+
percentageTextColor: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
30
44
|
}
|
|
31
45
|
};
|
|
32
46
|
var progress = "";
|
|
@@ -38,11 +52,17 @@ var Progress = defineComponent({
|
|
|
38
52
|
height,
|
|
39
53
|
percentage,
|
|
40
54
|
percentageText,
|
|
55
|
+
percentageTextPlacement,
|
|
56
|
+
percentageTextColor,
|
|
41
57
|
barBgColor,
|
|
42
58
|
isCircle,
|
|
43
59
|
strokeWidth,
|
|
44
60
|
showContent
|
|
45
61
|
} = toRefs(props);
|
|
62
|
+
const normalPercentage = ref(0);
|
|
63
|
+
effect(() => {
|
|
64
|
+
normalPercentage.value = middleNum(percentage.value);
|
|
65
|
+
});
|
|
46
66
|
const data = reactive({
|
|
47
67
|
pathString: "",
|
|
48
68
|
trailPath: null,
|
|
@@ -67,25 +87,28 @@ var Progress = defineComponent({
|
|
|
67
87
|
};
|
|
68
88
|
data.strokePath = {
|
|
69
89
|
stroke: barBgColor || null,
|
|
70
|
-
strokeDasharray: `${
|
|
90
|
+
strokeDasharray: `${normalPercentage.value / 100 * len}px ${len}px`,
|
|
71
91
|
strokeDashoffset: `0`,
|
|
72
92
|
transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
|
73
93
|
};
|
|
74
94
|
};
|
|
75
95
|
setCircleProgress();
|
|
76
|
-
watch([height,
|
|
96
|
+
watch([height, normalPercentage, percentageText, percentageTextPlacement, percentageTextColor, barBgColor, isCircle, strokeWidth, showContent], () => {
|
|
77
97
|
setCircleProgress();
|
|
78
98
|
});
|
|
79
99
|
return {
|
|
80
|
-
data
|
|
100
|
+
data,
|
|
101
|
+
normalPercentage
|
|
81
102
|
};
|
|
82
103
|
},
|
|
83
104
|
render() {
|
|
84
105
|
var _a;
|
|
85
106
|
const {
|
|
86
107
|
height,
|
|
87
|
-
|
|
108
|
+
normalPercentage,
|
|
88
109
|
percentageText,
|
|
110
|
+
percentageTextPlacement,
|
|
111
|
+
percentageTextColor,
|
|
89
112
|
barBgColor,
|
|
90
113
|
isCircle,
|
|
91
114
|
strokeWidth,
|
|
@@ -93,28 +116,39 @@ var Progress = defineComponent({
|
|
|
93
116
|
data,
|
|
94
117
|
$slots
|
|
95
118
|
} = this;
|
|
119
|
+
const isOutside = percentageTextPlacement === "outside";
|
|
120
|
+
const isInsideBg = percentageTextPlacement === "insideBg";
|
|
121
|
+
const createPercentageText = () => {
|
|
122
|
+
return createVNode("span", {
|
|
123
|
+
"style": {
|
|
124
|
+
lineHeight: height,
|
|
125
|
+
color: percentageTextColor
|
|
126
|
+
}
|
|
127
|
+
}, [percentageText]);
|
|
128
|
+
};
|
|
96
129
|
const progressLine = createVNode("div", {
|
|
130
|
+
"class": "devui-progress-content"
|
|
131
|
+
}, [createVNode("div", {
|
|
97
132
|
"class": "devui-progress--line",
|
|
98
133
|
"style": {
|
|
99
134
|
height,
|
|
100
135
|
borderRadius: height
|
|
101
136
|
}
|
|
102
137
|
}, [createVNode("div", {
|
|
103
|
-
"class": "devui-progress-bar",
|
|
138
|
+
"class": ["devui-progress-bar", percentageTextPlacement],
|
|
104
139
|
"style": {
|
|
105
140
|
height,
|
|
106
141
|
borderRadius: height,
|
|
107
|
-
width: `${
|
|
142
|
+
width: `${normalPercentage}%`,
|
|
108
143
|
backgroundColor: barBgColor
|
|
109
144
|
}
|
|
110
|
-
}, null),
|
|
145
|
+
}, [!isOutside && !isInsideBg ? createPercentageText() : null]), isInsideBg ? createPercentageText() : null]), isOutside && !!percentageText ? createPercentageText() : null]);
|
|
146
|
+
const textElement = createVNode("span", {
|
|
147
|
+
"class": "devui-progress-circle-text",
|
|
111
148
|
"style": {
|
|
112
|
-
|
|
149
|
+
color: percentageTextColor
|
|
113
150
|
}
|
|
114
|
-
}, [
|
|
115
|
-
const textElement = createVNode("span", {
|
|
116
|
-
"class": "devui-progress-circle-text"
|
|
117
|
-
}, [percentage, createTextVNode("%")]);
|
|
151
|
+
}, [normalPercentage, createTextVNode("%")]);
|
|
118
152
|
const progressCircle = createVNode("div", {
|
|
119
153
|
"class": "devui-progress-circle"
|
|
120
154
|
}, [createVNode("svg", {
|
|
@@ -132,7 +166,7 @@ var Progress = defineComponent({
|
|
|
132
166
|
"stroke-linecap": "round",
|
|
133
167
|
"fill-opacity": "0",
|
|
134
168
|
"stroke": barBgColor,
|
|
135
|
-
"stroke-width":
|
|
169
|
+
"stroke-width": normalPercentage ? strokeWidth : 0,
|
|
136
170
|
"style": data.strokePath
|
|
137
171
|
}, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
|
|
138
172
|
return createVNode("div", {
|
package/progress/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
a ${
|
|
3
|
-
a ${
|
|
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";function v(t,n=0,l=100){let o=0;return o=Math.min(t,l),o=Math.max(o,n),o}const x={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:""}};var T="",P=e.defineComponent({name:"DProgress",props:x,setup(t){const{height:n,percentage:l,percentageText:o,percentageTextPlacement:h,percentageTextColor:f,barBgColor:y,isCircle:p,strokeWidth:g,showContent:d}=e.toRefs(t),a=e.ref(0);e.effect(()=>{a.value=v(l.value)});const i=e.reactive({pathString:"",trailPath:null,strokePath:null}),u=()=>{if(!p)return;const r=50-g.value/2,m=-r,k=r*-2;i.pathString=`M 50,50 m 0,${m}
|
|
2
|
+
a ${r},${r} 0 1 1 0,${-k}
|
|
3
|
+
a ${r},${r} 0 1 1 0,${k}`;const c=Math.PI*2*r;i.trailPath={stroke:"var(--devui-dividing-line, #dfe1e6)",strokeDasharray:`${c}px ${c}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s"},i.strokePath={stroke:y||null,strokeDasharray:`${a.value/100*c}px ${c}px`,strokeDashoffset:"0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"}};return u(),e.watch([n,a,o,h,f,y,p,g,d],()=>{u()}),{data:i,normalPercentage:a}},render(){var C;const{height:t,normalPercentage:n,percentageText:l,percentageTextPlacement:o,percentageTextColor:h,barBgColor:f,isCircle:y,strokeWidth:p,showContent:g,data:d,$slots:a}=this,i=o==="outside",u=o==="insideBg",r=()=>e.createVNode("span",{style:{lineHeight:t,color:h}},[l]),m=e.createVNode("div",{class:"devui-progress-content"},[e.createVNode("div",{class:"devui-progress--line",style:{height:t,borderRadius:t}},[e.createVNode("div",{class:["devui-progress-bar",o],style:{height:t,borderRadius:t,width:`${n}%`,backgroundColor:f}},[!i&&!u?r():null]),u?r():null]),i&&!!l?r():null]),k=e.createVNode("span",{class:"devui-progress-circle-text",style:{color:h}},[n,e.createTextVNode("%")]),c=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":p,style:d.trailPath,d:d.pathString},null),e.createVNode("path",{class:"devui-progress-circle-path",d:d.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:f,"stroke-width":n?p:0,style:d.strokePath},null)]),g&&((C=a.default)==null?void 0:C.call(a)),g&&!a.default&&k]);return e.createVNode("div",{class:"devui-progress"},[y?c:m])}}),N={title:"Progress \u8FDB\u5EA6\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(P.name,P)}};s.Progress=P,s.default=N,s.progressProps=x,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
|
package/progress/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-progress--line{position:relative;background:var(--devui-dividing-line, #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: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-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%)}
|
|
1
|
+
.devui-progress-content{display:flex;flex-wrap:nowrap}.devui-progress-content .devui-progress--line{width:100%;position:relative;background:var(--devui-dividing-line, #dfe1e6)}.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%)}
|
package/rate/index.es.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent, reactive, ref, onMounted, createVNode, resolveComponent } from "vue";
|
|
2
2
|
const rateProps = {
|
|
3
3
|
modelValue: {
|
|
4
|
-
type: Number
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 0
|
|
5
6
|
},
|
|
6
7
|
read: {
|
|
7
8
|
type: Boolean,
|
|
@@ -54,18 +55,15 @@ var Rate = defineComponent({
|
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
57
|
const initRating = () => {
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
chooseValue.value = props.modelValue - 1;
|
|
58
|
+
chooseValue.value = props.modelValue;
|
|
61
59
|
const halfStar = chooseValue.value % 1;
|
|
62
60
|
const intCurrentLevel = Math.floor(chooseValue.value);
|
|
63
|
-
setChange(0, intCurrentLevel
|
|
61
|
+
setChange(0, intCurrentLevel, "100%");
|
|
64
62
|
if (halfStar > 0) {
|
|
65
|
-
totalLevelArray[intCurrentLevel
|
|
66
|
-
setChange(intCurrentLevel + 2, props.count, "0");
|
|
67
|
-
} else {
|
|
63
|
+
totalLevelArray[intCurrentLevel]["width"] = halfStar * 100 + "%";
|
|
68
64
|
setChange(intCurrentLevel + 1, props.count, "0");
|
|
65
|
+
} else {
|
|
66
|
+
setChange(intCurrentLevel, props.count, "0");
|
|
69
67
|
}
|
|
70
68
|
};
|
|
71
69
|
onMounted(() => {
|
|
@@ -76,33 +74,28 @@ var Rate = defineComponent({
|
|
|
76
74
|
}
|
|
77
75
|
initRating();
|
|
78
76
|
});
|
|
79
|
-
const
|
|
77
|
+
const isSemiSelected = (e) => {
|
|
78
|
+
const target = e.target;
|
|
79
|
+
return props.allowHalf && e.offsetX * 2 <= target.clientWidth;
|
|
80
|
+
};
|
|
81
|
+
const hoverToggle = (e, index2) => {
|
|
80
82
|
if (props.read) {
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} else {
|
|
91
|
-
setChange(0, index2 + 1, "100%");
|
|
92
|
-
if (props.allowHalf && e.offsetX * 2 <= e.target.clientWidth) {
|
|
93
|
-
setChange(index2, index2 + 1, "50%");
|
|
94
|
-
} else {
|
|
95
|
-
setChange(index2, index2 + 1, "100%");
|
|
96
|
-
}
|
|
97
|
-
setChange(index2 + 1, props.count, "0");
|
|
98
|
-
}
|
|
85
|
+
setChange(0, index2 + 1, "100%");
|
|
86
|
+
const width = isSemiSelected(e) ? "50%" : "100%";
|
|
87
|
+
setChange(index2, index2 + 1, width);
|
|
88
|
+
setChange(index2 + 1, props.count, "0");
|
|
89
|
+
};
|
|
90
|
+
const onMouseleave = () => {
|
|
91
|
+
initRating();
|
|
99
92
|
};
|
|
100
93
|
const selectValue = (e, index2) => {
|
|
101
94
|
if (props.read) {
|
|
102
95
|
return;
|
|
103
96
|
}
|
|
104
97
|
setChange(0, index2, "100%");
|
|
105
|
-
if (
|
|
98
|
+
if (isSemiSelected(e)) {
|
|
106
99
|
setChange(index2, index2 + 1, "50%");
|
|
107
100
|
chooseValue.value = index2 - 0.5;
|
|
108
101
|
} else {
|
|
@@ -110,33 +103,34 @@ var Rate = defineComponent({
|
|
|
110
103
|
chooseValue.value = index2;
|
|
111
104
|
}
|
|
112
105
|
setChange(index2 + 1, props.count, "0");
|
|
113
|
-
|
|
114
|
-
props.onChange && props.onChange(index2 + 1);
|
|
106
|
+
props.onChange && props.onChange(chooseValue.value + 1);
|
|
115
107
|
props.onTouched && props.onTouched();
|
|
116
|
-
ctx.emit("update:modelValue",
|
|
108
|
+
ctx.emit("update:modelValue", chooseValue.value + 1);
|
|
117
109
|
};
|
|
118
110
|
return {
|
|
119
111
|
totalLevelArray,
|
|
120
112
|
chooseValue,
|
|
121
113
|
hoverToggle,
|
|
122
|
-
selectValue
|
|
114
|
+
selectValue,
|
|
115
|
+
onMouseleave
|
|
123
116
|
};
|
|
124
117
|
},
|
|
125
118
|
render() {
|
|
126
119
|
const {
|
|
127
120
|
totalLevelArray,
|
|
128
|
-
chooseValue,
|
|
129
121
|
icon,
|
|
130
122
|
character,
|
|
131
123
|
read,
|
|
132
124
|
type,
|
|
133
125
|
color,
|
|
134
126
|
hoverToggle,
|
|
135
|
-
selectValue
|
|
127
|
+
selectValue,
|
|
128
|
+
onMouseleave
|
|
136
129
|
} = this;
|
|
137
130
|
return createVNode("div", {
|
|
138
131
|
"class": "devui-star-container",
|
|
139
|
-
"onMouseleave":
|
|
132
|
+
"onMouseleave": onMouseleave,
|
|
133
|
+
"style": `--star-color: ${color}`
|
|
140
134
|
}, [totalLevelArray.map((item, index2) => createVNode("div", {
|
|
141
135
|
"class": `devui-star-align devui-pointer ${read ? "devui-only-read" : ""}`,
|
|
142
136
|
"key": index2,
|
|
@@ -182,9 +176,8 @@ var Rate = defineComponent({
|
|
|
182
176
|
width: item.width
|
|
183
177
|
}
|
|
184
178
|
}, [character]), !character && !icon && createVNode("span", {
|
|
185
|
-
"class":
|
|
179
|
+
"class": ["devui-star-color-active", "devui-active-star", !color ? `devui-star-color-${type}` : "devui-star-color-customize"],
|
|
186
180
|
"style": {
|
|
187
|
-
color,
|
|
188
181
|
width: item.width
|
|
189
182
|
}
|
|
190
183
|
}, [createVNode("svg", {
|
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r.index={},r.Vue))})(this,function(r,e){"use strict";const g={modelValue:{type:Number,default:0},read:{type:Boolean,default:!1},count:{type:Number,default:5},type:{type:String,default:""},color:{type:String,default:""},icon:{type:String,default:""},character:{type:String,default:""},allowHalf:{type:Boolean,default:!1},onChange:{type:Function,default:void 0},onTouched:{type:Function,default:void 0}};var m="",f=e.defineComponent({name:"DRate",props:g,emits:["change","update:modelValue"],setup(a,i){const n=e.reactive([]),c=e.ref(0),l=(o,t,h)=>{for(let v=o;v<t;v++)n[v].width=h},s=()=>{c.value=a.modelValue;const o=c.value%1,t=Math.floor(c.value);l(0,t,"100%"),o>0?(n[t].width=o*100+"%",l(t+1,a.count,"0")):l(t,a.count,"0")};e.onMounted(()=>{for(let o=0;o<a.count;o++)n.push({width:"0"});s()});const d=o=>{const t=o.target;return a.allowHalf&&o.offsetX*2<=t.clientWidth};return{totalLevelArray:n,chooseValue:c,hoverToggle:(o,t)=>{if(a.read)return;l(0,t+1,"100%");const h=d(o)?"50%":"100%";l(t,t+1,h),l(t+1,a.count,"0")},selectValue:(o,t)=>{a.read||(l(0,t,"100%"),d(o)?(l(t,t+1,"50%"),c.value=t-.5):(l(t,t+1,"100%"),c.value=t),l(t+1,a.count,"0"),a.onChange&&a.onChange(c.value+1),a.onTouched&&a.onTouched(),i.emit("update:modelValue",c.value+1))},onMouseleave:()=>{s()}}},render(){const{totalLevelArray:a,icon:i,character:n,read:c,type:l,color:s,hoverToggle:d,selectValue:w,onMouseleave:y}=this;return e.createVNode("div",{class:"devui-star-container",onMouseleave:y,style:`--star-color: ${s}`},[a.map((u,o)=>e.createVNode("div",{class:`devui-star-align devui-pointer ${c?"devui-only-read":""}`,key:o,onMouseover:t=>d(t,o),onClick:t=>w(t,o)},[i&&!n&&e.createVNode("span",{class:"devui-star-color"},[e.createVNode(e.resolveComponent("d-icon"),{name:i},null)]),n&&!i&&e.createVNode("span",{class:"devui-star-color"},[n]),!i&&!n&&e.createVNode("span",{class:"devui-star-color"},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{fill:"#E3E5E9",id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])]),i&&!n&&e.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${l}`,style:{width:u.width}},[e.createVNode(e.resolveComponent("d-icon"),{name:i,color:s},null)]),n&&!i&&e.createVNode("span",{class:`devui-star-color-active devui-active-star devui-star-color-${l}`,style:{color:s,width:u.width}},[n]),!n&&!i&&e.createVNode("span",{class:["devui-star-color-active","devui-active-star",s?"devui-star-color-customize":`devui-star-color-${l}`],style:{width:u.width}},[e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns-xlink":"http://www.w3.org/1999/xlink"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{id:"Mask"},[e.createVNode("polygon",{points:"8 12.7603585 3.67376208 14.3147912 3.81523437 9.71994835 1 6.0857977 5.41367261 4.80046131 8 1 10.5863274 4.80046131 15 6.0857977 12.1847656 9.71994835 12.3262379 14.3147912"},null)])])])])]))])}}),V={title:"Rate \u8BC4\u5206",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(f.name,f)}};r.Rate=f,r.default=V,r.rateProps=g,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"});
|
package/rate/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-star-align{font-size:var(--devui-font-size-icon, 16px);margin-right:5px;position:relative;line-height:1}.devui-pointer{cursor:pointer}.devui-star-container{display:inline-flex}.devui-star-color-active{color:#6a81ed;line-height:1.5}.devui-star-color-active svg g{fill:#6a81ed}.devui-star-color-success{color:#3dcca6}.devui-star-color-success svg g{fill:#3dcca6}.devui-star-color-warning{color:#fac20a}.devui-star-color-warning svg g{fill:#fac20a}.devui-star-color-error{color:#f66f6a}.devui-star-color-error svg g{fill:#f66f6a}.devui-active-star{position:absolute;top:0;left:0;overflow:hidden}.devui-star-color{color:var(--devui-dividing-line, #dfe1e6);line-height:1.5}.devui-star-color .icon{color:var(--devui-dividing-line, #dfe1e6)!important}.devui-star-color svg g{fill:var(--devui-dividing-line, #dfe1e6)}.devui-only-read{cursor:not-allowed}
|
|
1
|
+
.devui-star-align{font-size:var(--devui-font-size-icon, 16px);margin-right:5px;position:relative;line-height:1}.devui-pointer{cursor:pointer}.devui-star-container{display:inline-flex}.devui-star-color-active{color:#6a81ed;line-height:1.5}.devui-star-color-active svg g{fill:#6a81ed}.devui-star-color-success{color:#3dcca6}.devui-star-color-success svg g{fill:#3dcca6}.devui-star-color-warning{color:#fac20a}.devui-star-color-warning svg g{fill:#fac20a}.devui-star-color-error{color:#f66f6a}.devui-star-color-error svg g{fill:#f66f6a}.devui-star-color-customize{color:var(--star-color)}.devui-star-color-customize svg g{fill:var(--star-color)}.devui-active-star{position:absolute;top:0;left:0;overflow:hidden}.devui-star-color{color:var(--devui-dividing-line, #dfe1e6);line-height:1.5}.devui-star-color .icon{color:var(--devui-dividing-line, #dfe1e6)!important}.devui-star-color svg g{fill:var(--devui-dividing-line, #dfe1e6)}.devui-only-read{cursor:not-allowed}
|
package/search/index.es.js
CHANGED
|
@@ -51,6 +51,7 @@ const searchProps = {
|
|
|
51
51
|
};
|
|
52
52
|
const SIZE_CLASS = {
|
|
53
53
|
lg: "lg",
|
|
54
|
+
md: "md",
|
|
54
55
|
sm: "sm"
|
|
55
56
|
};
|
|
56
57
|
const ICON_POSITION = {
|
|
@@ -5580,13 +5581,8 @@ const inputProps = {
|
|
|
5580
5581
|
default: void 0
|
|
5581
5582
|
}
|
|
5582
5583
|
};
|
|
5584
|
+
const FORM_ITEM_TOKEN = Symbol("dFormItem");
|
|
5583
5585
|
var input = "";
|
|
5584
|
-
const formItemInjectionKey = Symbol("dFormItem");
|
|
5585
|
-
const dFormItemEvents = {
|
|
5586
|
-
blur: "d.form.blur",
|
|
5587
|
-
change: "d.form.change",
|
|
5588
|
-
input: "d.form.input"
|
|
5589
|
-
};
|
|
5590
5586
|
var DInput = defineComponent({
|
|
5591
5587
|
name: "DInput",
|
|
5592
5588
|
directives: {
|
|
@@ -5601,19 +5597,17 @@ var DInput = defineComponent({
|
|
|
5601
5597
|
props: inputProps,
|
|
5602
5598
|
emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
|
|
5603
5599
|
setup(props, ctx) {
|
|
5604
|
-
const
|
|
5605
|
-
const hasFormItem = Object.keys(formItem).length > 0;
|
|
5600
|
+
const formItemContext = inject(FORM_ITEM_TOKEN);
|
|
5606
5601
|
const sizeCls = computed(() => `devui-input-${props.size}`);
|
|
5607
5602
|
const showPwdIcon = ref(false);
|
|
5608
5603
|
const inputType = ref("text");
|
|
5609
|
-
const
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
});
|
|
5604
|
+
const isValidateError = computed(() => (formItemContext == null ? void 0 : formItemContext.validateState) === "error");
|
|
5605
|
+
const inputCls = computed(() => ({
|
|
5606
|
+
"devui-error": props.error || isValidateError.value,
|
|
5607
|
+
[props.cssClass]: true,
|
|
5608
|
+
"devui-input-restore": showPwdIcon.value,
|
|
5609
|
+
[sizeCls.value]: props.size !== ""
|
|
5610
|
+
}));
|
|
5617
5611
|
const showPreviewIcon = computed(() => inputType.value === "password");
|
|
5618
5612
|
watch(() => props.showPassword, (flg) => {
|
|
5619
5613
|
inputType.value = flg ? "password" : "text";
|
|
@@ -5621,17 +5615,18 @@ var DInput = defineComponent({
|
|
|
5621
5615
|
}, {
|
|
5622
5616
|
immediate: true
|
|
5623
5617
|
});
|
|
5618
|
+
watch(() => props.modelValue, () => {
|
|
5619
|
+
formItemContext == null ? void 0 : formItemContext.validate("change").catch((err) => console.warn(err));
|
|
5620
|
+
});
|
|
5624
5621
|
const onInput = ($event) => {
|
|
5625
5622
|
ctx.emit("update:modelValue", $event.target.value);
|
|
5626
|
-
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.input);
|
|
5627
5623
|
}, onFocus = () => {
|
|
5628
5624
|
ctx.emit("focus");
|
|
5629
5625
|
}, onBlur = () => {
|
|
5630
5626
|
ctx.emit("blur");
|
|
5631
|
-
|
|
5627
|
+
formItemContext == null ? void 0 : formItemContext.validate("blur").catch((err) => console.warn(err));
|
|
5632
5628
|
}, onChange = ($event) => {
|
|
5633
5629
|
ctx.emit("change", $event.target.value);
|
|
5634
|
-
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.change);
|
|
5635
5630
|
}, onKeydown = ($event) => {
|
|
5636
5631
|
ctx.emit("keydown", $event);
|
|
5637
5632
|
}, onChangeInputType = () => {
|
|
@@ -5729,6 +5724,7 @@ var Search = defineComponent({
|
|
|
5729
5724
|
autoFocus: props.autoFocus,
|
|
5730
5725
|
modelValue: keywords.value,
|
|
5731
5726
|
placeholder: props.placeholder,
|
|
5727
|
+
maxLength: props.maxLength,
|
|
5732
5728
|
cssClass: props.cssClass,
|
|
5733
5729
|
onKeydown: onInputKeydown,
|
|
5734
5730
|
"onUpdate:modelValue": onInputUpdate
|