vue-devui 1.0.0-rc.5 → 1.0.0-rc.8
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 +22 -8
- package/alert/index.es.js +37 -11
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +72 -26
- package/auto-complete/index.umd.js +5 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +32 -6
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +29 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5548 -76
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +56 -29
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +48 -30
- package/checkbox/index.umd.js +1 -1
- package/checkbox/style.css +1 -1
- package/date-picker/index.es.js +91 -145
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +28 -3
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +39 -13
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- 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.es.js +958 -1200
- package/form/index.umd.js +18 -18
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +68 -49
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/image-preview/index.es.js +34 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +91 -145
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +27 -5
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +34 -6
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +34 -10
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +41 -15
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +40 -13
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.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/treeProps.js +3 -0
- package/overlay/index.es.js +31 -9
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +135 -124
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/popover/index.es.js +53 -24
- package/popover/index.umd.js +13 -13
- package/popover/style.css +1 -1
- package/progress/index.es.js +76 -20
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +32 -7
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +34 -10
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/search/index.es.js +103 -153
- package/search/index.umd.js +14 -14
- package/search/style.css +1 -1
- package/select/index.es.js +74 -51
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +37 -12
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +52 -16
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +52 -24
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +30 -6
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +6267 -536
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +32 -8
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +27 -2
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +93 -76
- package/textarea/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/tooltip/index.es.js +42 -15
- package/tooltip/index.umd.js +12 -12
- package/tooltip/style.css +1 -1
- package/{comment → tree}/index.d.ts +0 -0
- package/tree/index.es.js +1030 -0
- package/tree/index.umd.js +1 -0
- package/{comment → tree}/package.json +1 -1
- package/tree/style.css +1 -0
- package/upload/index.es.js +53 -22
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +5296 -4916
- package/vue-devui.umd.js +22 -22
- 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/commentProps.js +0 -3
- package/nuxt/components/readTipProps.js +0 -3
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/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,8 +33,39 @@ 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
|
};
|
|
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) {
|
|
57
|
+
const namespace = `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
|
+
}
|
|
32
69
|
var progress = "";
|
|
33
70
|
var Progress = defineComponent({
|
|
34
71
|
name: "DProgress",
|
|
@@ -38,11 +75,17 @@ var Progress = defineComponent({
|
|
|
38
75
|
height,
|
|
39
76
|
percentage,
|
|
40
77
|
percentageText,
|
|
78
|
+
percentageTextPlacement,
|
|
79
|
+
percentageTextColor,
|
|
41
80
|
barBgColor,
|
|
42
81
|
isCircle,
|
|
43
82
|
strokeWidth,
|
|
44
83
|
showContent
|
|
45
84
|
} = toRefs(props);
|
|
85
|
+
const normalPercentage = ref(0);
|
|
86
|
+
effect(() => {
|
|
87
|
+
normalPercentage.value = middleNum(percentage.value);
|
|
88
|
+
});
|
|
46
89
|
const data = reactive({
|
|
47
90
|
pathString: "",
|
|
48
91
|
trailPath: null,
|
|
@@ -67,25 +110,28 @@ var Progress = defineComponent({
|
|
|
67
110
|
};
|
|
68
111
|
data.strokePath = {
|
|
69
112
|
stroke: barBgColor || null,
|
|
70
|
-
strokeDasharray: `${
|
|
113
|
+
strokeDasharray: `${normalPercentage.value / 100 * len}px ${len}px`,
|
|
71
114
|
strokeDashoffset: `0`,
|
|
72
115
|
transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
|
73
116
|
};
|
|
74
117
|
};
|
|
75
118
|
setCircleProgress();
|
|
76
|
-
watch([height,
|
|
119
|
+
watch([height, normalPercentage, percentageText, percentageTextPlacement, percentageTextColor, barBgColor, isCircle, strokeWidth, showContent], () => {
|
|
77
120
|
setCircleProgress();
|
|
78
121
|
});
|
|
79
122
|
return {
|
|
80
|
-
data
|
|
123
|
+
data,
|
|
124
|
+
normalPercentage
|
|
81
125
|
};
|
|
82
126
|
},
|
|
83
127
|
render() {
|
|
84
128
|
var _a;
|
|
85
129
|
const {
|
|
86
130
|
height,
|
|
87
|
-
|
|
131
|
+
normalPercentage,
|
|
88
132
|
percentageText,
|
|
133
|
+
percentageTextPlacement,
|
|
134
|
+
percentageTextColor,
|
|
89
135
|
barBgColor,
|
|
90
136
|
isCircle,
|
|
91
137
|
strokeWidth,
|
|
@@ -93,50 +139,60 @@ var Progress = defineComponent({
|
|
|
93
139
|
data,
|
|
94
140
|
$slots
|
|
95
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
|
+
};
|
|
96
153
|
const progressLine = createVNode("div", {
|
|
97
|
-
"class": "
|
|
154
|
+
"class": ns.e("content")
|
|
155
|
+
}, [createVNode("div", {
|
|
156
|
+
"class": ns.e("line"),
|
|
98
157
|
"style": {
|
|
99
158
|
height,
|
|
100
159
|
borderRadius: height
|
|
101
160
|
}
|
|
102
161
|
}, [createVNode("div", {
|
|
103
|
-
"class": "
|
|
162
|
+
"class": [ns.e("bar"), percentageTextPlacement],
|
|
104
163
|
"style": {
|
|
105
164
|
height,
|
|
106
165
|
borderRadius: height,
|
|
107
|
-
width: `${
|
|
166
|
+
width: `${normalPercentage}%`,
|
|
108
167
|
backgroundColor: barBgColor
|
|
109
168
|
}
|
|
110
|
-
}, null),
|
|
169
|
+
}, [!isOutside && !isInsideBg ? createPercentageText() : null]), isInsideBg ? createPercentageText() : null]), isOutside && !!percentageText ? createPercentageText() : null]);
|
|
170
|
+
const textElement = createVNode("span", {
|
|
171
|
+
"class": ns.e("circle-text"),
|
|
111
172
|
"style": {
|
|
112
|
-
|
|
173
|
+
color: percentageTextColor
|
|
113
174
|
}
|
|
114
|
-
}, [
|
|
115
|
-
const textElement = createVNode("span", {
|
|
116
|
-
"class": "devui-progress-circle-text"
|
|
117
|
-
}, [percentage, createTextVNode("%")]);
|
|
175
|
+
}, [normalPercentage, createTextVNode("%")]);
|
|
118
176
|
const progressCircle = createVNode("div", {
|
|
119
|
-
"class": "
|
|
177
|
+
"class": ns.e("circle")
|
|
120
178
|
}, [createVNode("svg", {
|
|
121
|
-
"class": "
|
|
179
|
+
"class": ns.e("circle"),
|
|
122
180
|
"viewBox": "0 0 100 100"
|
|
123
181
|
}, [createVNode("path", {
|
|
124
|
-
"class": "devui-progress-circle-trail",
|
|
125
182
|
"fill-opacity": "0",
|
|
126
183
|
"stroke-width": strokeWidth,
|
|
127
184
|
"style": data.trailPath,
|
|
128
185
|
"d": data.pathString
|
|
129
186
|
}, null), createVNode("path", {
|
|
130
|
-
"class": "devui-progress-circle-path",
|
|
131
187
|
"d": data.pathString,
|
|
132
188
|
"stroke-linecap": "round",
|
|
133
189
|
"fill-opacity": "0",
|
|
134
190
|
"stroke": barBgColor,
|
|
135
|
-
"stroke-width":
|
|
191
|
+
"stroke-width": normalPercentage ? strokeWidth : 0,
|
|
136
192
|
"style": data.strokePath
|
|
137
193
|
}, null)]), showContent && ((_a = $slots.default) == null ? void 0 : _a.call($slots)), showContent && !$slots.default && textElement]);
|
|
138
194
|
return createVNode("div", {
|
|
139
|
-
"class":
|
|
195
|
+
"class": ns.b()
|
|
140
196
|
}, [!isCircle ? progressLine : progressCircle]);
|
|
141
197
|
}
|
|
142
198
|
});
|
package/progress/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
a ${
|
|
3
|
-
a ${
|
|
1
|
+
(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";function N(t,s=0,i=100){let r=0;return r=Math.min(t,i),r=Math.max(r,s),r}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,s,i){let r=t;return s&&(r+=`__${s}`),i&&(r+=`--${i}`),r}function T(t){const s=`devui-${t}`;return{b:()=>P(s),e:a=>a?P(s,a):"",m:a=>a?P(s,"",a):"",em:(a,d)=>a&&d?P(s,a,d):""}}var S="",x=e.defineComponent({name:"DProgress",props:C,setup(t){const{height:s,percentage:i,percentageText:r,percentageTextPlacement:g,percentageTextColor:h,barBgColor:a,isCircle:d,strokeWidth:f,showContent:u}=e.toRefs(t),l=e.ref(0);e.effect(()=>{l.value=N(i.value)});const o=e.reactive({pathString:"",trailPath:null,strokePath:null}),y=()=>{if(!d)return;const c=50-f.value/2,k=-c,m=c*-2;o.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;o.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"},o.strokePath={stroke:a||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([s,l,r,g,h,a,d,f,u],()=>{y()}),{data:o,normalPercentage:l}},render(){var b;const{height:t,normalPercentage:s,percentageText:i,percentageTextPlacement:r,percentageTextColor:g,barBgColor:h,isCircle:a,strokeWidth:d,showContent:f,data:u,$slots:l}=this,o=T("progress"),y=r==="outside",c=r==="insideBg",k=()=>e.createVNode("span",{style:{lineHeight:t,color:g}},[i]),m=e.createVNode("div",{class:o.e("content")},[e.createVNode("div",{class:o.e("line"),style:{height:t,borderRadius:t}},[e.createVNode("div",{class:[o.e("bar"),r],style:{height:t,borderRadius:t,width:`${s}%`,backgroundColor:h}},[!y&&!c?k():null]),c?k():null]),y&&!!i?k():null]),p=e.createVNode("span",{class:o.e("circle-text"),style:{color:g}},[s,e.createTextVNode("%")]),V=e.createVNode("div",{class:o.e("circle")},[e.createVNode("svg",{class:o.e("circle"),viewBox:"0 0 100 100"},[e.createVNode("path",{"fill-opacity":"0","stroke-width":d,style:u.trailPath,d:u.pathString},null),e.createVNode("path",{d:u.pathString,"stroke-linecap":"round","fill-opacity":"0",stroke:h,"stroke-width":s?d:0,style:u.strokePath},null)]),f&&((b=l.default)==null?void 0:b.call(l)),f&&!l.default&&p]);return e.createVNode("div",{class:o.b()},[a?V:m])}}),$={title:"Progress \u8FDB\u5EA6\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(x.name,x)}};n.Progress=x,n.default=$,n.progressProps=C,Object.defineProperty(n,"__esModule",{value:!0}),n[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, #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/radio/index.es.js
CHANGED
|
@@ -54,6 +54,29 @@ const radioGroupProps = __spreadProps(__spreadValues({}, radioCommonProps), {
|
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
const radioGroupInjectionKey = Symbol("DRadioGroup");
|
|
57
|
+
function createBem(namespace, element, modifier) {
|
|
58
|
+
let cls = namespace;
|
|
59
|
+
if (element) {
|
|
60
|
+
cls += `__${element}`;
|
|
61
|
+
}
|
|
62
|
+
if (modifier) {
|
|
63
|
+
cls += `--${modifier}`;
|
|
64
|
+
}
|
|
65
|
+
return cls;
|
|
66
|
+
}
|
|
67
|
+
function useNamespace(block) {
|
|
68
|
+
const namespace = `devui-${block}`;
|
|
69
|
+
const b = () => createBem(namespace);
|
|
70
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
71
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
72
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
73
|
+
return {
|
|
74
|
+
b,
|
|
75
|
+
e,
|
|
76
|
+
m,
|
|
77
|
+
em
|
|
78
|
+
};
|
|
79
|
+
}
|
|
57
80
|
var radio = "";
|
|
58
81
|
var Radio = defineComponent({
|
|
59
82
|
name: "DRadio",
|
|
@@ -116,7 +139,8 @@ var Radio = defineComponent({
|
|
|
116
139
|
$slots,
|
|
117
140
|
handleChange
|
|
118
141
|
} = this;
|
|
119
|
-
const
|
|
142
|
+
const ns = useNamespace("radio");
|
|
143
|
+
const labelCls = [ns.b(), {
|
|
120
144
|
active: isChecked,
|
|
121
145
|
disabled
|
|
122
146
|
}];
|
|
@@ -125,13 +149,13 @@ var Radio = defineComponent({
|
|
|
125
149
|
}, [createVNode("input", {
|
|
126
150
|
"type": "radio",
|
|
127
151
|
"name": radioName,
|
|
128
|
-
"class": "
|
|
152
|
+
"class": ns.e("input"),
|
|
129
153
|
"disabled": disabled,
|
|
130
154
|
"onChange": handleChange,
|
|
131
155
|
"value": value,
|
|
132
156
|
"checked": isChecked
|
|
133
157
|
}, null), createVNode("span", {
|
|
134
|
-
"class": "
|
|
158
|
+
"class": ns.e("material")
|
|
135
159
|
}, [createVNode("svg", {
|
|
136
160
|
"height": "100%",
|
|
137
161
|
"width": "100%",
|
|
@@ -139,7 +163,7 @@ var Radio = defineComponent({
|
|
|
139
163
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
140
164
|
}, [createVNode("circle", {
|
|
141
165
|
"class": {
|
|
142
|
-
"
|
|
166
|
+
[ns.e("material-outer")]: true,
|
|
143
167
|
disabled
|
|
144
168
|
},
|
|
145
169
|
"cx": "512",
|
|
@@ -148,7 +172,7 @@ var Radio = defineComponent({
|
|
|
148
172
|
"stroke-width": "51"
|
|
149
173
|
}, null), createVNode("circle", {
|
|
150
174
|
"class": {
|
|
151
|
-
"
|
|
175
|
+
[ns.e("material-inner")]: true,
|
|
152
176
|
disabled
|
|
153
177
|
},
|
|
154
178
|
"cx": "512",
|
|
@@ -156,7 +180,7 @@ var Radio = defineComponent({
|
|
|
156
180
|
"cy": "512",
|
|
157
181
|
"r": "320"
|
|
158
182
|
}, null)])]), createVNode("span", {
|
|
159
|
-
"class": "
|
|
183
|
+
"class": ns.e("label")
|
|
160
184
|
}, [(_a = $slots.default) == null ? void 0 : _a.call($slots)])]);
|
|
161
185
|
}
|
|
162
186
|
});
|
|
@@ -188,6 +212,7 @@ var RadioGroup = defineComponent({
|
|
|
188
212
|
values,
|
|
189
213
|
direction
|
|
190
214
|
} = this;
|
|
215
|
+
const ns = useNamespace("radio-group");
|
|
191
216
|
const getContent = () => {
|
|
192
217
|
const defaultSlot = this.$slots.default;
|
|
193
218
|
if (defaultSlot) {
|
|
@@ -206,7 +231,7 @@ var RadioGroup = defineComponent({
|
|
|
206
231
|
}
|
|
207
232
|
};
|
|
208
233
|
return createVNode("div", {
|
|
209
|
-
"class": [
|
|
234
|
+
"class": [ns.b(), {
|
|
210
235
|
"is-row": direction === "row",
|
|
211
236
|
"is-column": direction === "column"
|
|
212
237
|
}]
|
package/radio/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty,P=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var N=(a,e,d)=>e in a?_(a,e,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[e]=d,b=(a,e)=>{for(var d in e||(e={}))x.call(e,d)&&N(a,d,e[d]);if(v)for(var d of v(e))D.call(e,d)&&N(a,d,e[d]);return a},y=(a,e)=>P(a,k(e));(function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const d={modelValue:{type:String,default:null},name:{type:String,default:null},beforeChange:{type:Function,default:null},disabled:{type:Boolean,default:!1}},R=y(b({},d),{value:{type:String,required:!0,default:null}}),w=y(b({},d),{values:{type:Array,default:null},direction:{type:String,default:"column"}}),C=Symbol("DRadioGroup");function m(n,o,t){let r=n;return o&&(r+=`__${o}`),t&&(r+=`--${t}`),r}function V(n){const o=`devui-${n}`;return{b:()=>m(o),e:l=>l?m(o,l):"",m:l=>l?m(o,"",l):"",em:(l,i)=>l&&i?m(o,l,i):""}}var G="",h=e.defineComponent({name:"DRadio",props:R,emits:["change","update:modelValue"],setup(n,{emit:o}){const t=e.inject(C,null),r=e.computed(()=>n.disabled||(t==null?void 0:t.disabled.value)),c=e.computed(()=>{const i=t?t.modelValue.value:n.modelValue;return n.value===i}),u=e.computed(()=>t?t.name.value:n.name||void 0),l=i=>{const s=n.beforeChange||(t?t.beforeChange:null);let f=Promise.resolve(!0);if(s){const g=s(i);if(typeof g=="undefined")return f;typeof g=="boolean"?f=Promise.resolve(g):f=g}return f};return{isChecked:c,radioName:u,disabled:r,handleChange:async i=>{const s=n.value;if(!await l(s)){i.preventDefault();return}t==null||t.emitChange(s),o("update:modelValue",s),o("change",s)}}},render(){var s;const{disabled:n,radioName:o,value:t,isChecked:r,$slots:c,handleChange:u}=this,l=V("radio"),i=[l.b(),{active:r,disabled:n}];return e.createVNode("label",{class:i},[e.createVNode("input",{type:"radio",name:o,class:l.e("input"),disabled:n,onChange:u,value:t,checked:r},null),e.createVNode("span",{class:l.e("material")},[e.createVNode("svg",{height:"100%",width:"100%",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("circle",{class:{[l.e("material-outer")]:!0,disabled:n},cx:"512",cy:"512",r:"486.5","stroke-width":"51"},null),e.createVNode("circle",{class:{[l.e("material-inner")]:!0,disabled:n},cx:"512","fill-rule":"nonzero",cy:"512",r:"320"},null)])]),e.createVNode("span",{class:l.e("label")},[(s=c.default)==null?void 0:s.call(c)])])}}),A="";function S(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}var p=e.defineComponent({name:"DRadioGroup",props:w,emits:["change","update:modelValue"],setup(n,{emit:o}){const t=r=>{o("update:modelValue",r),o("change",r)};e.provide(C,{modelValue:e.toRef(n,"modelValue"),name:e.toRef(n,"name"),disabled:e.toRef(n,"disabled"),beforeChange:n.beforeChange,emitChange:t})},render(){const{values:n,direction:o}=this,t=V("radio-group"),r=()=>{const c=this.$slots.default;return c?c():Array.isArray(n)?n.map(u=>e.createVNode(h,{key:u,value:u},S(u)?u:{default:()=>[u]})):""};return e.createVNode("div",{class:[t.b(),{"is-row":o==="row","is-column":o==="column"}]},[r()])}}),j={title:"Radio \u5355\u9009\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(n){n.component(h.name,h),n.component(p.name,p)}};a.Radio=h,a.RadioGroup=p,a.default=j,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/radio/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.devui-radio{display:flex;justify-content:flex-start;align-items:center;font-size:var(--devui-font-size, 12px);line-height:1.5;font-weight:400;cursor:pointer;color:var(--devui-text, #252b3a)}.devui-radio:hover .devui-
|
|
1
|
+
@charset "UTF-8";.devui-radio{display:flex;justify-content:flex-start;align-items:center;font-size:var(--devui-font-size, 12px);line-height:1.5;font-weight:400;cursor:pointer;color:var(--devui-text, #252b3a)}.devui-radio:hover .devui-radio__label{color:var(--devui-primary-hover, #7693f5)}.devui-radio:active .devui-radio__material-outer,.devui-radio:focus .devui-radio__material-outer,.devui-radio:hover .devui-radio__material-outer{stroke:var(--devui-form-control-line-active-hover, #344899)}.devui-radio:active .devui-radio__material-inner,.devui-radio:focus .devui-radio__material-inner,.devui-radio:hover .devui-radio__material-inner{fill:var(--devui-icon-fill-active-hover, #526ecc)}.devui-radio.active .devui-radio__material-outer{opacity:1;stroke:var(--devui-form-control-line-active-hover, #344899);transition:stroke 50ms var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.devui-radio.active .devui-radio__material-outer.disabled{stroke:var(--devui-icon-fill-active-disabled, #beccfa);fill:transparent}.devui-radio.active .devui-radio__material-inner{opacity:1;transform:scale(1);transition:transform var(--devui-animation-duration-base, .2s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95)),opacity var(--devui-animation-duration-base, .2s) var(--devui-animation-ease-in-out, cubic-bezier(.5, .05, .5, .95))}.devui-radio.active .devui-radio__material-inner.disabled{fill:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-radio.disabled{cursor:not-allowed}.devui-radio.disabled .devui-radio__material-outer{stroke:var(--devui-disabled-line, #dfe1e6);fill:var(--devui-disabled-bg, #f5f5f6)}.devui-radio.disabled .devui-radio__material-inner{fill:var(--devui-icon-fill-active-disabled, #beccfa)}.devui-radio.disabled .devui-radio__label{color:var(--devui-disabled-text, #adb0b8)}.devui-radio__material{vertical-align:middle;position:relative;display:inline-block;overflow:hidden;height:16px;width:16px;line-height:16px;user-select:none}.devui-radio__material-outer{opacity:1;transition:stroke 50ms cubic-bezier(.755,.05,.855,.06);stroke:var(--devui-line, #adb0b8);fill:transparent}.devui-radio__material-inner{opacity:0;transform:scale(0);transform-origin:50% 50%;transition:transform .2s cubic-bezier(.755,.05,.855,.06),opacity .2s cubic-bezier(.755,.05,.855,.06);fill:var(--devui-icon-fill-active, #5e7ce0)}.devui-radio__label{color:var(--devui-text, #252b3a);margin-left:8px;font-size:var(--devui-font-size, 12px);transition:color .3s cubic-bezier(.645,.045,.355,1)}.devui-radio__input{opacity:0;z-index:-1;width:0;height:0;display:none;overflow:hidden;pointer-events:none}.devui-radio-group{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:flex-start}.devui-radio-group.is-row{flex-direction:row}.devui-radio-group.is-column{flex-direction:column}.devui-radio-group .devui-radio{line-height:28px}.devui-radio-group .devui-radio:not(:last-child){padding-right:20px}
|
package/rate/index.es.js
CHANGED
|
@@ -41,6 +41,29 @@ const rateProps = {
|
|
|
41
41
|
default: void 0
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
+
function createBem(namespace, element, modifier) {
|
|
45
|
+
let cls = namespace;
|
|
46
|
+
if (element) {
|
|
47
|
+
cls += `__${element}`;
|
|
48
|
+
}
|
|
49
|
+
if (modifier) {
|
|
50
|
+
cls += `--${modifier}`;
|
|
51
|
+
}
|
|
52
|
+
return cls;
|
|
53
|
+
}
|
|
54
|
+
function useNamespace(block) {
|
|
55
|
+
const namespace = `devui-${block}`;
|
|
56
|
+
const b = () => createBem(namespace);
|
|
57
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
58
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
59
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
60
|
+
return {
|
|
61
|
+
b,
|
|
62
|
+
e,
|
|
63
|
+
m,
|
|
64
|
+
em
|
|
65
|
+
};
|
|
66
|
+
}
|
|
44
67
|
var rate = "";
|
|
45
68
|
var Rate = defineComponent({
|
|
46
69
|
name: "DRate",
|
|
@@ -127,22 +150,24 @@ var Rate = defineComponent({
|
|
|
127
150
|
selectValue,
|
|
128
151
|
onMouseleave
|
|
129
152
|
} = this;
|
|
153
|
+
const ns = useNamespace("rate");
|
|
130
154
|
return createVNode("div", {
|
|
131
|
-
"class":
|
|
132
|
-
"onMouseleave": onMouseleave
|
|
155
|
+
"class": ns.b(),
|
|
156
|
+
"onMouseleave": onMouseleave,
|
|
157
|
+
"style": `--star-color: ${color}`
|
|
133
158
|
}, [totalLevelArray.map((item, index2) => createVNode("div", {
|
|
134
|
-
"class":
|
|
159
|
+
"class": [ns.m("align"), ns.m("pointer"), read ? ns.m("only-read") : ""],
|
|
135
160
|
"key": index2,
|
|
136
161
|
"onMouseover": (e) => hoverToggle(e, index2),
|
|
137
162
|
"onClick": (e) => selectValue(e, index2)
|
|
138
163
|
}, [icon && !character && createVNode("span", {
|
|
139
|
-
"class": "
|
|
164
|
+
"class": ns.e("color")
|
|
140
165
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
141
166
|
"name": icon
|
|
142
167
|
}, null)]), character && !icon && createVNode("span", {
|
|
143
|
-
"class": "
|
|
168
|
+
"class": ns.e("color")
|
|
144
169
|
}, [character]), !icon && !character && createVNode("span", {
|
|
145
|
-
"class": "
|
|
170
|
+
"class": ns.e("color")
|
|
146
171
|
}, [createVNode("svg", {
|
|
147
172
|
"width": "16px",
|
|
148
173
|
"height": "16px",
|
|
@@ -161,7 +186,7 @@ var Rate = defineComponent({
|
|
|
161
186
|
}, [createVNode("polygon", {
|
|
162
187
|
"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"
|
|
163
188
|
}, null)])])])]), icon && !character && createVNode("span", {
|
|
164
|
-
"class":
|
|
189
|
+
"class": [ns.e("color-active"), ns.e("active-star"), ns.em("color", type)],
|
|
165
190
|
"style": {
|
|
166
191
|
width: item.width
|
|
167
192
|
}
|
|
@@ -169,15 +194,14 @@ var Rate = defineComponent({
|
|
|
169
194
|
"name": icon,
|
|
170
195
|
"color": color
|
|
171
196
|
}, null)]), character && !icon && createVNode("span", {
|
|
172
|
-
"class":
|
|
197
|
+
"class": [ns.e("color-active"), ns.e("active-star"), ns.em("color", type)],
|
|
173
198
|
"style": {
|
|
174
199
|
color,
|
|
175
200
|
width: item.width
|
|
176
201
|
}
|
|
177
202
|
}, [character]), !character && !icon && createVNode("span", {
|
|
178
|
-
"class":
|
|
203
|
+
"class": [ns.e("color-active"), ns.e("active-star"), !color ? ns.em("color", type) : ns.em("color", "customize")],
|
|
179
204
|
"style": {
|
|
180
|
-
color,
|
|
181
205
|
width: item.width
|
|
182
206
|
}
|
|
183
207
|
}, [createVNode("svg", {
|
package/rate/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis!="undefined"?globalThis:d||self,e(d.index={},d.Vue))})(this,function(d,e){"use strict";const y={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}};function g(o,a,c){let r=o;return a&&(r+=`__${a}`),c&&(r+=`--${c}`),r}function p(o){const a=`devui-${o}`;return{b:()=>g(a),e:i=>i?g(a,i):"",m:i=>i?g(a,"",i):"",em:(i,h)=>i&&h?g(a,i,h):""}}var N="",w=e.defineComponent({name:"DRate",props:y,emits:["change","update:modelValue"],setup(o,a){const c=e.reactive([]),r=e.ref(0),s=(n,t,f)=>{for(let m=n;m<t;m++)c[m].width=f},u=()=>{r.value=o.modelValue;const n=r.value%1,t=Math.floor(r.value);s(0,t,"100%"),n>0?(c[t].width=n*100+"%",s(t+1,o.count,"0")):s(t,o.count,"0")};e.onMounted(()=>{for(let n=0;n<o.count;n++)c.push({width:"0"});u()});const i=n=>{const t=n.target;return o.allowHalf&&n.offsetX*2<=t.clientWidth};return{totalLevelArray:c,chooseValue:r,hoverToggle:(n,t)=>{if(o.read)return;s(0,t+1,"100%");const f=i(n)?"50%":"100%";s(t,t+1,f),s(t+1,o.count,"0")},selectValue:(n,t)=>{o.read||(s(0,t,"100%"),i(n)?(s(t,t+1,"50%"),r.value=t-.5):(s(t,t+1,"100%"),r.value=t),s(t+1,o.count,"0"),o.onChange&&o.onChange(r.value+1),o.onTouched&&o.onTouched(),a.emit("update:modelValue",r.value+1))},onMouseleave:()=>{u()}}},render(){const{totalLevelArray:o,icon:a,character:c,read:r,type:s,color:u,hoverToggle:i,selectValue:h,onMouseleave:V}=this,l=p("rate");return e.createVNode("div",{class:l.b(),onMouseleave:V,style:`--star-color: ${u}`},[o.map((n,t)=>e.createVNode("div",{class:[l.m("align"),l.m("pointer"),r?l.m("only-read"):""],key:t,onMouseover:f=>i(f,t),onClick:f=>h(f,t)},[a&&!c&&e.createVNode("span",{class:l.e("color")},[e.createVNode(e.resolveComponent("d-icon"),{name:a},null)]),c&&!a&&e.createVNode("span",{class:l.e("color")},[c]),!a&&!c&&e.createVNode("span",{class:l.e("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)])])])]),a&&!c&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),l.em("color",s)],style:{width:n.width}},[e.createVNode(e.resolveComponent("d-icon"),{name:a,color:u},null)]),c&&!a&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),l.em("color",s)],style:{color:u,width:n.width}},[c]),!c&&!a&&e.createVNode("span",{class:[l.e("color-active"),l.e("active-star"),u?l.em("color","customize"):l.em("color",s)],style:{width:n.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(o){o.component(w.name,w)}};d.Rate=w,d.default=v,d.rateProps=y,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/rate/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
1
|
+
.devui-rate--align{font-size:var(--devui-font-size-icon, 16px);margin-right:5px;position:relative;line-height:1}.devui-rate--pointer{cursor:pointer}.devui-rate{display:inline-flex}.devui-rate__color-active{color:#6a81ed;line-height:1.5}.devui-rate__color-active svg g{fill:#6a81ed}.devui-rate__color--success{color:#3dcca6}.devui-rate__color--success svg g{fill:#3dcca6}.devui-rate__color--warning{color:#fac20a}.devui-rate__color--warning svg g{fill:#fac20a}.devui-rate__color--error{color:#f66f6a}.devui-rate__color--error svg g{fill:#f66f6a}.devui-rate__color--customize{color:var(--star-color)}.devui-rate__color--customize svg g{fill:var(--star-color)}.devui-rate__active-star{position:absolute;top:0;left:0;overflow:hidden}.devui-rate__color{color:var(--devui-dividing-line, #dfe1e6);line-height:1.5}.devui-rate__color .icon{color:var(--devui-dividing-line, #dfe1e6)!important}.devui-rate__color svg g{fill:var(--devui-dividing-line, #dfe1e6)}.devui-rate--only-read{cursor:not-allowed}
|