vue-devui 1.0.0-beta.12 → 1.0.0-beta.16
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 +41 -18
- package/accordion/style.css +1 -1
- package/alert/index.es.js +0 -3
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +1121 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/button/index.es.js +116 -113
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +5 -5
- package/carousel/index.umd.js +1 -1
- package/color-picker/index.d.ts +7 -0
- package/color-picker/index.es.js +2960 -0
- package/color-picker/index.umd.js +1 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.es.js +3 -2
- package/comment/index.umd.js +1 -1
- package/comment/style.css +1 -1
- package/dragdrop/index.es.js +135 -10
- package/dragdrop/index.umd.js +1 -1
- package/drawer/index.es.js +142 -30
- package/drawer/index.umd.js +1 -1
- package/form/index.es.js +59 -17
- package/form/index.umd.js +1 -1
- package/gantt/index.es.js +3 -3
- package/gantt/index.umd.js +1 -1
- package/modal/index.es.js +120 -117
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/CarouselItem.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/package.json +21 -1
- package/popover/index.es.js +13 -4
- package/popover/index.umd.js +1 -1
- package/slider/index.es.js +2 -5
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +145 -14
- package/splitter/index.umd.js +1 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +17 -30
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/style.css +1 -1
- package/tag/index.es.js +2 -2
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/time-picker/index.es.js +117 -114
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.es.js +7 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.es.js +70 -116
- package/tooltip/index.umd.js +1 -1
- package/transfer/index.es.js +570 -172
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +984 -21
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/tree-select/index.es.js +129 -34
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +8 -5
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +15984 -13220
- package/vue-devui.umd.js +17 -17
package/statistic/index.es.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { defineComponent, ref, computed, onMounted, watch, createVNode, mergeProps } from "vue";
|
|
7
|
+
import { defineComponent, ref, computed, onMounted, watch, createVNode, mergeProps, createTextVNode } from "vue";
|
|
8
8
|
const statisticProps = {
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
@@ -24,16 +24,9 @@ const statisticProps = {
|
|
|
24
24
|
},
|
|
25
25
|
groupSeparator: {
|
|
26
26
|
type: String,
|
|
27
|
-
default: "
|
|
28
|
-
},
|
|
29
|
-
showGroupSeparator: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
},
|
|
33
|
-
titleStyle: {
|
|
34
|
-
type: Object
|
|
27
|
+
default: ""
|
|
35
28
|
},
|
|
36
|
-
|
|
29
|
+
valueStyle: {
|
|
37
30
|
type: Object
|
|
38
31
|
},
|
|
39
32
|
animationDuration: {
|
|
@@ -49,25 +42,17 @@ const statisticProps = {
|
|
|
49
42
|
},
|
|
50
43
|
start: {
|
|
51
44
|
type: Boolean,
|
|
52
|
-
default:
|
|
45
|
+
default: true
|
|
53
46
|
},
|
|
54
47
|
extra: {
|
|
55
48
|
type: String,
|
|
56
49
|
default: ""
|
|
57
|
-
},
|
|
58
|
-
easing: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "easeOutCubic"
|
|
61
|
-
},
|
|
62
|
-
delay: {
|
|
63
|
-
type: Number,
|
|
64
|
-
default: 0
|
|
65
50
|
}
|
|
66
51
|
};
|
|
67
|
-
const separator = (SeparatorString, groupSeparator
|
|
52
|
+
const separator = (SeparatorString, groupSeparator) => {
|
|
68
53
|
const res = SeparatorString.replace(/\d+/, function(n) {
|
|
69
54
|
return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
|
|
70
|
-
return $1 + `${
|
|
55
|
+
return $1 + `${groupSeparator}`;
|
|
71
56
|
});
|
|
72
57
|
});
|
|
73
58
|
return res;
|
|
@@ -77,13 +62,13 @@ const isHasDot = (value) => {
|
|
|
77
62
|
return (value + "").indexOf(".") !== -1;
|
|
78
63
|
}
|
|
79
64
|
};
|
|
80
|
-
const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber
|
|
65
|
+
const analysisValueType = (value, propsValue, groupSeparator, splitPrecisionNumber) => {
|
|
81
66
|
const fixedNumber = propsValue.toString().indexOf(".") !== -1 ? propsValue.toString().length - propsValue.toString().indexOf(".") - 1 : 0;
|
|
82
67
|
if (typeof value === "number") {
|
|
83
68
|
if (isHasDot(value)) {
|
|
84
|
-
return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator
|
|
69
|
+
return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator);
|
|
85
70
|
} else {
|
|
86
|
-
return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator
|
|
71
|
+
return splitPrecisionNumber ? separator(value.toFixed(splitPrecisionNumber).toString(), groupSeparator) : separator(value.toString(), groupSeparator);
|
|
87
72
|
}
|
|
88
73
|
} else {
|
|
89
74
|
return value;
|
|
@@ -220,9 +205,9 @@ var Statistic = defineComponent({
|
|
|
220
205
|
to: {
|
|
221
206
|
value: to
|
|
222
207
|
},
|
|
223
|
-
delay:
|
|
208
|
+
delay: 0,
|
|
224
209
|
duration: props.animationDuration,
|
|
225
|
-
easing:
|
|
210
|
+
easing: "easeOutCubic",
|
|
226
211
|
onUpdate: (keys) => {
|
|
227
212
|
innerValue.value = keys.value;
|
|
228
213
|
},
|
|
@@ -234,7 +219,7 @@ var Statistic = defineComponent({
|
|
|
234
219
|
}
|
|
235
220
|
};
|
|
236
221
|
const statisticValue = computed(() => {
|
|
237
|
-
return analysisValueType(innerValue.value, props.value, props.groupSeparator, props.precision
|
|
222
|
+
return analysisValueType(innerValue.value, props.value, props.groupSeparator, props.precision);
|
|
238
223
|
});
|
|
239
224
|
onMounted(() => {
|
|
240
225
|
if (props.animation && props.start) {
|
|
@@ -247,7 +232,7 @@ var Statistic = defineComponent({
|
|
|
247
232
|
}
|
|
248
233
|
});
|
|
249
234
|
return () => {
|
|
250
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
235
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
251
236
|
return createVNode("div", mergeProps({
|
|
252
237
|
"class": "devui-statistic"
|
|
253
238
|
}, ctx.attrs), [createVNode("div", {
|
|
@@ -255,14 +240,16 @@ var Statistic = defineComponent({
|
|
|
255
240
|
"style": props.titleStyle
|
|
256
241
|
}, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
|
|
257
242
|
"class": "devui-statistic-content",
|
|
258
|
-
"style": props.
|
|
243
|
+
"style": props.valueStyle
|
|
259
244
|
}, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
|
|
260
245
|
"class": "devui-statistic-prefix"
|
|
261
246
|
}, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
|
|
262
247
|
"class": "devui-statistic--value"
|
|
263
248
|
}, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
|
|
264
249
|
"class": "devui-statistic-suffix"
|
|
265
|
-
}, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k))
|
|
250
|
+
}, [((_j = (_i = ctx.slots).suffix) == null ? void 0 : _j.call(_i)) || props.suffix]) : null]), props.extra || ((_l = (_k = ctx.slots).extra) == null ? void 0 : _l.call(_k)) ? createVNode("div", {
|
|
251
|
+
"class": "devui-statistic-extra"
|
|
252
|
+
}, [createTextVNode(" "), ((_n = (_m = ctx.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
|
|
266
253
|
};
|
|
267
254
|
}
|
|
268
255
|
});
|
package/statistic/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $=Object.defineProperty;var z=(a,e,f)=>e in a?$(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var n=(a,e,f)=>(z(a,typeof e!="symbol"?e+"":e,f),f);(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 f={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},valueStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,i)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(l){return l+`${i}`})}),C=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},D=(t,i,r,s)=>{const l=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?C(t)?y(s?t.toFixed(s).toString():t.toFixed(l).toString(),r):y(s?t.toFixed(s).toString():t.toString(),r):t},c=Math.pow,v=Math.sqrt,E=function(t){return 1-c(1-t,3)},A=t=>t,I=function(t){return t===1?1:1-c(2,-10*t)},M=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},_=function(t){return t===0?0:c(2,10*t-10)},U=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var j=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:E,linear:A,easeOutExpo:I,easeInOutExpo:M,easeInExpo:_,easeInOutCirc:U});class q{constructor(i){n(this,"from");n(this,"to");n(this,"duration");n(this,"delay");n(this,"easing");n(this,"onStart");n(this,"onUpdate");n(this,"onFinish");n(this,"startTime");n(this,"started");n(this,"finished");n(this,"timer");n(this,"time");n(this,"elapsed");n(this,"keys");const{from:r,to:s,duration:l,delay:g,easing:S,onStart:u,onUpdate:d,onFinish:h}=i;for(const o in r)s[o]===void 0&&(s[o]=r[o]);for(const o in s)r[o]===void 0&&(r[o]=s[o]);this.from=r,this.to=s,this.duration=l,this.delay=g,this.easing=S,this.onStart=u,this.onUpdate=d,this.onFinish=h,this.startTime=Date.now()+this.delay,this.started=!1,this.finished=!1,this.timer=null,this.keys={}}update(){if(this.time=Date.now(),!(this.time<this.startTime)&&!this.finished){if(this.elapsed===this.duration){this.finished||(this.finished=!0,this.onFinish&&this.onFinish(this.keys));return}this.elapsed=this.time-this.startTime,this.elapsed=this.elapsed>this.duration?this.duration:this.elapsed;for(const i in this.to)this.keys[i]=this.from[i]+(this.to[i]-this.from[i])*j[this.easing](this.elapsed/this.duration);this.started||(this.onStart&&this.onStart(this.keys),this.started=!0),this.onUpdate(this.keys)}}start(){this.startTime=Date.now()+this.delay;const i=()=>{this.update(),this.timer=requestAnimationFrame(i),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};i()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}var H="",m=e.defineComponent({name:"DStatistic",inheritAttrs:!1,props:f,setup(t,i){var S;const r=e.ref((S=t.valueFrom)!=null?S:t.value),s=e.ref(null),l=(u=(h=>(h=t.valueFrom)!=null?h:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{u!==d&&(s.value=new q({from:{value:u},to:{value:d},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:o=>{r.value=o.value},onFinish:()=>{r.value=d}}),s.value.start())},g=e.computed(()=>D(r.value,t.value,t.groupSeparator,t.precision));return e.onMounted(()=>{t.animation&&t.start&&l()}),e.watch(()=>t.start,u=>{u&&!s.value&&l()}),()=>{var u,d,h,o,x,F,p,O,b,N,T,k,V,w;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(u=i.slots).title)==null?void 0:d.call(u))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.valueStyle},[t.prefix||((o=(h=i.slots).prefix)==null?void 0:o.call(h))?e.createVNode("span",{class:"devui-statistic-prefix"},[((F=(x=i.slots).prefix)==null?void 0:F.call(x))||t.prefix]):null,e.createVNode("span",{class:"devui-statistic--value"},[g.value]),t.suffix||((O=(p=i.slots).suffix)==null?void 0:O.call(p))?e.createVNode("span",{class:"devui-statistic-suffix"},[((N=(b=i.slots).suffix)==null?void 0:N.call(b))||t.suffix]):null]),t.extra||((k=(T=i.slots).extra)==null?void 0:k.call(T))?e.createVNode("div",{class:"devui-statistic-extra"},[e.createTextVNode(" "),((w=(V=i.slots).extra)==null?void 0:w.call(V))||t.extra]):null])}}});m.install=function(t){t.component(m.name,m)};var B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(m)}};a.Statistic=m,a.default=B,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
|
package/statistic/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-statistic-title{margin-bottom:4px;
|
|
1
|
+
.devui-statistic{box-sizing:border-box;margin:0;padding:0;font-size:14px;line-height:1.5715;list-style:none}.devui-statistic-title{margin-bottom:4px;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center}.devui-statistic-prefix{margin-right:6px;display:flex;align-items:center}.devui-statistic-suffix{margin-left:6px;display:flex;align-items:center}.devui-statistic--value{display:inline-block}
|