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.
Files changed (74) hide show
  1. package/README.md +41 -18
  2. package/accordion/style.css +1 -1
  3. package/alert/index.es.js +0 -3
  4. package/alert/index.umd.js +1 -1
  5. package/alert/style.css +1 -1
  6. package/auto-complete/index.d.ts +7 -0
  7. package/auto-complete/index.es.js +1121 -0
  8. package/auto-complete/index.umd.js +1 -0
  9. package/auto-complete/package.json +7 -0
  10. package/auto-complete/style.css +1 -0
  11. package/button/index.es.js +116 -113
  12. package/button/index.umd.js +1 -1
  13. package/button/style.css +1 -1
  14. package/carousel/index.es.js +5 -5
  15. package/carousel/index.umd.js +1 -1
  16. package/color-picker/index.d.ts +7 -0
  17. package/color-picker/index.es.js +2960 -0
  18. package/color-picker/index.umd.js +1 -0
  19. package/color-picker/package.json +7 -0
  20. package/color-picker/style.css +1 -0
  21. package/comment/index.es.js +3 -2
  22. package/comment/index.umd.js +1 -1
  23. package/comment/style.css +1 -1
  24. package/dragdrop/index.es.js +135 -10
  25. package/dragdrop/index.umd.js +1 -1
  26. package/drawer/index.es.js +142 -30
  27. package/drawer/index.umd.js +1 -1
  28. package/form/index.es.js +59 -17
  29. package/form/index.umd.js +1 -1
  30. package/gantt/index.es.js +3 -3
  31. package/gantt/index.umd.js +1 -1
  32. package/modal/index.es.js +120 -117
  33. package/modal/index.umd.js +1 -1
  34. package/modal/style.css +1 -1
  35. package/nuxt/components/AutoComplete.js +3 -0
  36. package/nuxt/components/CarouselItem.js +3 -0
  37. package/nuxt/components/ColorPicker.js +3 -0
  38. package/nuxt/components/DrawerService.js +3 -0
  39. package/package.json +21 -1
  40. package/popover/index.es.js +13 -4
  41. package/popover/index.umd.js +1 -1
  42. package/slider/index.es.js +2 -5
  43. package/slider/index.umd.js +1 -1
  44. package/slider/style.css +1 -1
  45. package/splitter/index.es.js +145 -14
  46. package/splitter/index.umd.js +1 -1
  47. package/splitter/style.css +1 -1
  48. package/statistic/index.es.js +17 -30
  49. package/statistic/index.umd.js +1 -1
  50. package/statistic/style.css +1 -1
  51. package/style.css +1 -1
  52. package/tag/index.es.js +2 -2
  53. package/tag/index.umd.js +1 -1
  54. package/tag/style.css +1 -1
  55. package/time-picker/index.es.js +117 -114
  56. package/time-picker/index.umd.js +1 -1
  57. package/time-picker/style.css +1 -1
  58. package/toast/index.es.js +7 -4
  59. package/toast/index.umd.js +1 -1
  60. package/tooltip/index.es.js +70 -116
  61. package/tooltip/index.umd.js +1 -1
  62. package/transfer/index.es.js +570 -172
  63. package/transfer/index.umd.js +1 -1
  64. package/transfer/style.css +1 -1
  65. package/tree/index.es.js +984 -21
  66. package/tree/index.umd.js +1 -1
  67. package/tree/style.css +1 -1
  68. package/tree-select/index.es.js +129 -34
  69. package/tree-select/index.umd.js +1 -1
  70. package/tree-select/style.css +1 -1
  71. package/upload/index.es.js +8 -5
  72. package/upload/index.umd.js +1 -1
  73. package/vue-devui.es.js +15984 -13220
  74. package/vue-devui.umd.js +17 -17
@@ -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
- contentStyle: {
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: false
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, showGroupSeparator) => {
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 + `${showGroupSeparator ? groupSeparator : ""}`;
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, showGroupSeparator) => {
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, showGroupSeparator) : separator(value.toFixed(fixedNumber).toString(), groupSeparator, showGroupSeparator);
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, showGroupSeparator) : separator(value.toString(), groupSeparator, showGroupSeparator);
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: props.delay,
208
+ delay: 0,
224
209
  duration: props.animationDuration,
225
- easing: props.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, props.showGroupSeparator);
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.contentStyle
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)) || props.extra]);
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
  });
@@ -1 +1 @@
1
- var q=Object.defineProperty;var B=(a,e,f)=>e in a?q(a,e,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[e]=f;var s=(a,e,f)=>(B(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:","},showGroupSeparator:{type:Boolean,default:!1},titleStyle:{type:Object},contentStyle:{type:Object},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!1},extra:{type:String,default:""},easing:{type:String,default:"easeOutCubic"},delay:{type:Number,default:0}},g=(t,i,n)=>t.replace(/\d+/,function(u){return u.replace(/(\d)(?=(\d{3})+$)/g,function(h){return h+`${n?i:""}`})}),w=t=>{if(!isNaN(t))return(t+"").indexOf(".")!==-1},C=(t,i,n,r,u)=>{const h=i.toString().indexOf(".")!==-1?i.toString().length-i.toString().indexOf(".")-1:0;return typeof t=="number"?w(t)?g(r?t.toFixed(r).toString():t.toFixed(h).toString(),n,u):g(r?t.toFixed(r).toString():t.toString(),n,u):t},c=Math.pow,v=Math.sqrt,D=function(t){return 1-c(1-t,3)},E=t=>t,V=function(t){return t===1?1:1-c(2,-10*t)},A=function(t){return t===0?0:t===1?1:t<.5?c(2,20*t-10)/2:(2-c(2,-20*t+10))/2},I=function(t){return t===0?0:c(2,10*t-10)},M=function(t){return t<.5?(1-v(1-c(2*t,2)))/2:(v(1-c(-2*t+2,2))+1)/2};var _=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",easeOutCubic:D,linear:E,easeOutExpo:V,easeInOutExpo:A,easeInExpo:I,easeInOutCirc:M});class j{constructor(i){s(this,"from");s(this,"to");s(this,"duration");s(this,"delay");s(this,"easing");s(this,"onStart");s(this,"onUpdate");s(this,"onFinish");s(this,"startTime");s(this,"started");s(this,"finished");s(this,"timer");s(this,"time");s(this,"elapsed");s(this,"keys");const{from:n,to:r,duration:u,delay:h,easing:S,onStart:l,onUpdate:d,onFinish:m}=i;for(const o in n)r[o]===void 0&&(r[o]=n[o]);for(const o in r)n[o]===void 0&&(n[o]=r[o]);this.from=n,this.to=r,this.duration=u,this.delay=h,this.easing=S,this.onStart=l,this.onUpdate=d,this.onFinish=m,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])*_[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 $="",y=e.defineComponent({name:"DStatistic",inheritAttrs:!1,props:f,setup(t,i){var S;const n=e.ref((S=t.valueFrom)!=null?S:t.value),r=e.ref(null),u=(l=(m=>(m=t.valueFrom)!=null?m:0)(),d=typeof t.value=="number"?t.value:Number(t.value))=>{l!==d&&(r.value=new j({from:{value:l},to:{value:d},delay:t.delay,duration:t.animationDuration,easing:t.easing,onUpdate:o=>{n.value=o.value},onFinish:()=>{n.value=d}}),r.value.start())},h=e.computed(()=>C(n.value,t.value,t.groupSeparator,t.precision,t.showGroupSeparator));return e.onMounted(()=>{t.animation&&t.start&&u()}),e.watch(()=>t.start,l=>{l&&!r.value&&u()}),()=>{var l,d,m,o,x,F,O,b,p,N,T,k;return e.createVNode("div",e.mergeProps({class:"devui-statistic"},i.attrs),[e.createVNode("div",{class:"devui-statistic-title",style:t.titleStyle},[((d=(l=i.slots).title)==null?void 0:d.call(l))||t.title]),e.createVNode("div",{class:"devui-statistic-content",style:t.contentStyle},[t.prefix||((o=(m=i.slots).prefix)==null?void 0:o.call(m))?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"},[h.value]),t.suffix||((b=(O=i.slots).suffix)==null?void 0:b.call(O))?e.createVNode("span",{class:"devui-statistic-suffix"},[((N=(p=i.slots).suffix)==null?void 0:N.call(p))||t.suffix]):null]),((k=(T=i.slots).extra)==null?void 0:k.call(T))||t.extra])}}});y.install=function(t){t.component(y.name,y)};var U={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(y)}};a.Statistic=y,a.default=U,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
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"});
@@ -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;opacity:.7;font-size:14px}.devui-statistic-content{font-size:24px;display:flex;align-items:center}.devui-statistic-prefix{margin-right:6px;display:flex}.devui-statistic-suffix{margin-left:6px;display:flex}.devui-statistic--value{display:inline-block}
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}