vue-devui 1.0.0-rc.8 → 1.0.1
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 +188 -149
- package/alert/index.es.js +14 -9
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8392 -418
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +10 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +191 -53
- package/button/index.umd.js +17 -17
- package/button/style.css +1 -1
- package/card/index.es.js +7 -3
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8050 -241
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12022 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +24 -7
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +190 -165
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +785 -145
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +399 -300
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +185 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8220 -45
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +279 -204
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +3 -3
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +53 -53
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8319 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +921 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +539 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +451 -173
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +212 -70
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/paginationInjectionKey.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +89 -142
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -4
- package/pagination/index.es.js +10180 -129
- package/pagination/index.umd.js +27 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +4 -0
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +262 -229
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/progress/style.css +1 -1
- package/radio/index.es.js +7954 -156
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3829 -1042
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9202 -495
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +89 -263
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +118 -145
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +454 -233
- package/splitter/index.umd.js +13 -13
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +6 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +387 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7787 -62
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5225 -1726
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +303 -102
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +11 -8
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7876 -41
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9607 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +170 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -238
- package/tooltip/index.umd.js +14 -14
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11342 -793
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +458 -102
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20475 -11072
- package/vue-devui.umd.js +31 -24
- package/date-picker/index.es.js +0 -1097
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Loading.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
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,
|
|
7
|
+
import { defineComponent, ref, computed, onMounted, watch, createVNode, createTextVNode } from "vue";
|
|
8
8
|
const statisticProps = {
|
|
9
9
|
title: {
|
|
10
10
|
type: String,
|
|
@@ -26,9 +26,6 @@ const statisticProps = {
|
|
|
26
26
|
type: String,
|
|
27
27
|
default: ""
|
|
28
28
|
},
|
|
29
|
-
valueStyle: {
|
|
30
|
-
type: Object
|
|
31
|
-
},
|
|
32
29
|
animationDuration: {
|
|
33
30
|
type: Number,
|
|
34
31
|
default: 2e3
|
|
@@ -179,15 +176,38 @@ class Tween {
|
|
|
179
176
|
this.timer = null;
|
|
180
177
|
}
|
|
181
178
|
}
|
|
179
|
+
function createBem(namespace, element, modifier) {
|
|
180
|
+
let cls = namespace;
|
|
181
|
+
if (element) {
|
|
182
|
+
cls += `__${element}`;
|
|
183
|
+
}
|
|
184
|
+
if (modifier) {
|
|
185
|
+
cls += `--${modifier}`;
|
|
186
|
+
}
|
|
187
|
+
return cls;
|
|
188
|
+
}
|
|
189
|
+
function useNamespace(block, needDot = false) {
|
|
190
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
191
|
+
const b = () => createBem(namespace);
|
|
192
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
193
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
194
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
195
|
+
return {
|
|
196
|
+
b,
|
|
197
|
+
e,
|
|
198
|
+
m,
|
|
199
|
+
em
|
|
200
|
+
};
|
|
201
|
+
}
|
|
182
202
|
var statistic = "";
|
|
183
203
|
var Statistic = defineComponent({
|
|
184
204
|
name: "DStatistic",
|
|
185
|
-
inheritAttrs: false,
|
|
186
205
|
props: statisticProps,
|
|
187
206
|
setup(props, ctx) {
|
|
188
207
|
var _a;
|
|
189
208
|
const innerValue = ref((_a = props.valueFrom) != null ? _a : props.value);
|
|
190
209
|
const tween = ref(null);
|
|
210
|
+
const ns = useNamespace("statistic");
|
|
191
211
|
const animation = (from = ((_b) => (_b = props.valueFrom) != null ? _b : 0)(), to = typeof props.value === "number" ? props.value : Number(props.value)) => {
|
|
192
212
|
if (from !== to) {
|
|
193
213
|
tween.value = new Tween({
|
|
@@ -225,22 +245,20 @@ var Statistic = defineComponent({
|
|
|
225
245
|
});
|
|
226
246
|
return () => {
|
|
227
247
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
228
|
-
return createVNode("div",
|
|
229
|
-
"class":
|
|
230
|
-
},
|
|
231
|
-
"class": "
|
|
232
|
-
"style": props.titleStyle
|
|
248
|
+
return createVNode("div", {
|
|
249
|
+
"class": ns.b()
|
|
250
|
+
}, [createVNode("div", {
|
|
251
|
+
"class": ns.e("title")
|
|
233
252
|
}, [((_b = (_a2 = ctx.slots).title) == null ? void 0 : _b.call(_a2)) || props.title]), createVNode("div", {
|
|
234
|
-
"class": "
|
|
235
|
-
"style": props.valueStyle
|
|
253
|
+
"class": ns.e("content")
|
|
236
254
|
}, [props.prefix || ((_d = (_c = ctx.slots).prefix) == null ? void 0 : _d.call(_c)) ? createVNode("span", {
|
|
237
|
-
"class": "
|
|
255
|
+
"class": ns.e("prefix")
|
|
238
256
|
}, [((_f = (_e = ctx.slots).prefix) == null ? void 0 : _f.call(_e)) || props.prefix]) : null, createVNode("span", {
|
|
239
|
-
"class": "
|
|
257
|
+
"class": ns.e("value")
|
|
240
258
|
}, [statisticValue.value]), props.suffix || ((_h = (_g = ctx.slots).suffix) == null ? void 0 : _h.call(_g)) ? createVNode("span", {
|
|
241
|
-
"class": "
|
|
259
|
+
"class": ns.e("suffix")
|
|
242
260
|
}, [((_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", {
|
|
243
|
-
"class": "
|
|
261
|
+
"class": ns.e("extra")
|
|
244
262
|
}, [createTextVNode(" "), ((_n = (_m = ctx.slots).extra) == null ? void 0 : _n.call(_m)) || props.extra]) : null]);
|
|
245
263
|
};
|
|
246
264
|
}
|
package/statistic/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var _=Object.defineProperty;var j=(a,i,c)=>i in a?_(a,i,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[i]=c;var r=(a,i,c)=>(j(a,typeof i!="symbol"?i+"":i,c),c);(function(a,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(a=typeof globalThis!="undefined"?globalThis:a||self,i(a.index={},a.Vue))})(this,function(a,i){"use strict";const c={title:{type:String,default:""},value:{type:[Number,String]},prefix:{type:String},suffix:{type:String},precision:{type:Number},groupSeparator:{type:String,default:""},animationDuration:{type:Number,default:2e3},valueFrom:{type:Number},animation:{type:Boolean,default:!1},start:{type:Boolean,default:!0},extra:{type:String,default:""}},y=(t,e)=>t.replace(/\d+/,function(s){return s.replace(/(\d)(?=(\d{3})+$)/g,function(o){return o+`${e}`})}),$=t=>isNaN(t)?!1:(t+"").indexOf(".")!==-1,A=(t,e,n,s)=>{const o=(e==null?void 0:e.toString().indexOf("."))!==-1?(e==null?void 0:e.toString().length)-(e==null?void 0:e.toString().indexOf("."))-1:0;return typeof t=="number"?$(t)?y(s?t.toFixed(s).toString():t.toFixed(o).toString(),n):y(s?t.toFixed(s).toString():t.toString(),n):t},l=Math.pow,v=Math.sqrt;var M={easeOutCubic:function(t){return 1-l(1-t,3)},linear:t=>t,easeOutExpo:function(t){return t===1?1:1-l(2,-10*t)},easeInOutExpo:function(t){return t===0?0:t===1?1:t<.5?l(2,20*t-10)/2:(2-l(2,-20*t+10))/2},easeInExpo:function(t){return t===0?0:l(2,10*t-10)},easeInOutCirc:function(t){return t<.5?(1-v(1-l(2*t,2)))/2:(v(1-l(-2*t+2,2))+1)/2}};class U{constructor(e){r(this,"from");r(this,"to");r(this,"duration");r(this,"delay");r(this,"easing");r(this,"onStart");r(this,"onUpdate");r(this,"onFinish");r(this,"startTime");r(this,"started");r(this,"finished");r(this,"timer");r(this,"time");r(this,"elapsed");r(this,"keys");const{from:n,to:s,duration:o,delay:m,easing:S,onStart:u,onUpdate:f,onFinish:h}=e;for(const d in n)s[d]===void 0&&(s[d]=n[d]);for(const d in s)n[d]===void 0&&(n[d]=s[d]);this.from=n,this.to=s,this.duration=o,this.delay=m,this.easing=S,this.onStart=u,this.onUpdate=f,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 e in this.to)this.keys[e]=this.from[e]+(this.to[e]-this.from[e])*M[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 e=()=>{this.update(),this.timer=requestAnimationFrame(e),this.finished&&(cancelAnimationFrame(this.timer),this.timer=null)};e()}stop(){cancelAnimationFrame(this.timer),this.timer=null}}function g(t,e,n){let s=t;return e&&(s+=`__${e}`),n&&(s+=`--${n}`),s}function q(t,e=!1){const n=e?`.devui-${t}`:`devui-${t}`;return{b:()=>g(n),e:u=>u?g(n,u):"",m:u=>u?g(n,"",u):"",em:(u,f)=>u&&f?g(n,u,f):""}}var P="",F=i.defineComponent({name:"DStatistic",props:c,setup(t,e){var u;const n=i.ref((u=t.valueFrom)!=null?u:t.value),s=i.ref(null),o=q("statistic"),m=(f=(d=>(d=t.valueFrom)!=null?d:0)(),h=typeof t.value=="number"?t.value:Number(t.value))=>{f!==h&&(s.value=new U({from:{value:f},to:{value:h},delay:0,duration:t.animationDuration,easing:"easeOutCubic",onUpdate:x=>{n.value=x.value},onFinish:()=>{n.value=h}}),s.value.start())},S=i.computed(()=>A(n.value,t.value,t.groupSeparator,t.precision));return i.onMounted(()=>{t.animation&&t.start&&m()}),i.watch(()=>t.start,f=>{f&&!s.value&&m()}),()=>{var f,h,d,x,N,O,b,T,k,w,C,D,E,I;return i.createVNode("div",{class:o.b()},[i.createVNode("div",{class:o.e("title")},[((h=(f=e.slots).title)==null?void 0:h.call(f))||t.title]),i.createVNode("div",{class:o.e("content")},[t.prefix||((x=(d=e.slots).prefix)==null?void 0:x.call(d))?i.createVNode("span",{class:o.e("prefix")},[((O=(N=e.slots).prefix)==null?void 0:O.call(N))||t.prefix]):null,i.createVNode("span",{class:o.e("value")},[S.value]),t.suffix||((T=(b=e.slots).suffix)==null?void 0:T.call(b))?i.createVNode("span",{class:o.e("suffix")},[((w=(k=e.slots).suffix)==null?void 0:w.call(k))||t.suffix]):null]),t.extra||((D=(C=e.slots).extra)==null?void 0:D.call(C))?i.createVNode("div",{class:o.e("extra")},[i.createTextVNode(" "),((I=(E=e.slots).extra)==null?void 0:I.call(E))||t.extra]):null])}}}),B={title:"Statistic \u7EDF\u8BA1\u6570\u503C",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.component(F.name,F)}};a.Statistic=F,a.default=B,a.statisticProps=c,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-
|
|
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}
|
package/status/index.es.js
CHANGED
|
@@ -9,8 +9,8 @@ function createBem(namespace, element, modifier) {
|
|
|
9
9
|
}
|
|
10
10
|
return cls;
|
|
11
11
|
}
|
|
12
|
-
function useNamespace(block) {
|
|
13
|
-
const namespace = `devui-${block}`;
|
|
12
|
+
function useNamespace(block, needDot = false) {
|
|
13
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
14
14
|
const b = () => createBem(namespace);
|
|
15
15
|
const e = (element) => element ? createBem(namespace, element) : "";
|
|
16
16
|
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
@@ -56,6 +56,10 @@ var index = {
|
|
|
56
56
|
title: "Status \u72B6\u6001",
|
|
57
57
|
category: "\u901A\u7528",
|
|
58
58
|
status: "100%",
|
|
59
|
+
deprecated: {
|
|
60
|
+
value: true,
|
|
61
|
+
reason: "Status \u662F\u65E0\u5185\u5BB9\u5305\u88F9\u72B6\u6001\u4E0B\u7684 Badge \u7EC4\u4EF6\uFF0C\u5E94\u8BE5\u4F7F\u7528 Badge \u66FF\u4EE3\u3002"
|
|
62
|
+
},
|
|
59
63
|
install(app) {
|
|
60
64
|
app.component(Status.name, Status);
|
|
61
65
|
}
|
package/status/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(t=typeof globalThis!="undefined"?globalThis:t||self,s(t.index={},t.Vue))})(this,function(t,s){"use strict";function c(u,a,e){let i=u;return a&&(i+=`__${a}`),e&&(i+=`--${e}`),i}function f(u,a=!1){const e=a?`.devui-${u}`:`devui-${u}`;return{b:()=>c(e),e:n=>n?c(e,n):"",m:n=>n?c(e,"",n):"",em:(n,p)=>n&&p?c(e,n,p):""}}var v="",d=s.defineComponent({name:"DStatus",props:{type:{default:"invalid",type:String}},setup(u,a){const e=f("status"),i=s.computed(()=>{const{type:o}=u,r=["success","error","initial","warning","waiting","running","invalid"];let l=`${e.b()} ${e.em("bg","invalid")}`;return r.includes(o)&&(l=`${e.b()} ${e.em("bg",o)}`),l});return()=>{var o,r;return s.createVNode("span",{class:i.value},[(r=(o=a.slots).default)==null?void 0:r.call(o)])}}}),m={title:"Status \u72B6\u6001",category:"\u901A\u7528",status:"100%",deprecated:{value:!0,reason:"Status \u662F\u65E0\u5185\u5BB9\u5305\u88F9\u72B6\u6001\u4E0B\u7684 Badge \u7EC4\u4EF6\uFF0C\u5E94\u8BE5\u4F7F\u7528 Badge \u66FF\u4EE3\u3002"},install(u){u.component(d.name,d)}};t.Status=d,t.default=m,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
|
package/status/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status__bg--success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status__bg--error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status__bg--warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status__bg--initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status__bg--waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status__bg--running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status__bg--invalid:before{background-color:var(--devui-dividing-line, #
|
|
1
|
+
.devui-status{line-height:20px;height:20px;display:flex;align-items:center}.devui-status:before{display:inline-block;content:"";width:10px;height:10px;margin-right:5px;border-radius:100%}.devui-status.devui-status__bg--success:before{background-color:var(--devui-success, #50d4ab)}.devui-status.devui-status__bg--error:before{background-color:var(--devui-danger, #f66f6a)}.devui-status.devui-status__bg--warning:before{background-color:var(--devui-warning, #fac20a)}.devui-status.devui-status__bg--initial:before{background-color:var(--devui-initial, #e9edfa)}.devui-status.devui-status__bg--waiting:before{background-color:var(--devui-waiting, #9faad7)}.devui-status.devui-status__bg--running:before{background-color:var(--devui-info, #5e7ce0)}.devui-status.devui-status__bg--invalid:before{background-color:var(--devui-dividing-line, #f2f2f3)}
|
package/steps/index.d.ts
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { defineComponent, toRefs, ref, provide, watch, computed, createVNode, resolveDynamicComponent, mergeProps, getCurrentInstance, inject, Fragment } from "vue";
|
|
2
|
+
const stepsProps = {
|
|
3
|
+
modelValue: {
|
|
4
|
+
type: Number,
|
|
5
|
+
default: 0
|
|
6
|
+
},
|
|
7
|
+
space: {
|
|
8
|
+
type: Number
|
|
9
|
+
},
|
|
10
|
+
alignCenter: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
14
|
+
direction: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "horizontal"
|
|
17
|
+
},
|
|
18
|
+
simple: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function createBem(namespace, element, modifier) {
|
|
24
|
+
let cls = namespace;
|
|
25
|
+
if (element) {
|
|
26
|
+
cls += `__${element}`;
|
|
27
|
+
}
|
|
28
|
+
if (modifier) {
|
|
29
|
+
cls += `--${modifier}`;
|
|
30
|
+
}
|
|
31
|
+
return cls;
|
|
32
|
+
}
|
|
33
|
+
function useNamespace(block, needDot = false) {
|
|
34
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
35
|
+
const b = () => createBem(namespace);
|
|
36
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
37
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
38
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
39
|
+
return {
|
|
40
|
+
b,
|
|
41
|
+
e,
|
|
42
|
+
m,
|
|
43
|
+
em
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var steps = "";
|
|
47
|
+
const ACTIVE_STEP = "active-step";
|
|
48
|
+
const STEPS = "steps";
|
|
49
|
+
const STEPS_PROPS = "steps-props";
|
|
50
|
+
var Steps = defineComponent({
|
|
51
|
+
name: "DSteps",
|
|
52
|
+
props: stepsProps,
|
|
53
|
+
emits: ["update:modelValue"],
|
|
54
|
+
setup(props, {
|
|
55
|
+
slots
|
|
56
|
+
}) {
|
|
57
|
+
const {
|
|
58
|
+
modelValue,
|
|
59
|
+
direction,
|
|
60
|
+
simple
|
|
61
|
+
} = toRefs(props);
|
|
62
|
+
const ns = useNamespace("steps");
|
|
63
|
+
const activeStep = ref(modelValue.value);
|
|
64
|
+
provide(ACTIVE_STEP, activeStep);
|
|
65
|
+
provide(STEPS_PROPS, props);
|
|
66
|
+
const steps2 = ref([]);
|
|
67
|
+
provide(STEPS, steps2);
|
|
68
|
+
watch(modelValue, (newVal) => {
|
|
69
|
+
activeStep.value = newVal;
|
|
70
|
+
});
|
|
71
|
+
const stepsClass = computed(() => {
|
|
72
|
+
const directionClass = direction.value === "vertical" ? " vertical" : "";
|
|
73
|
+
const simpleClass = simple.value ? " simple" : "";
|
|
74
|
+
return `${ns.b()}${directionClass}${simpleClass}`;
|
|
75
|
+
});
|
|
76
|
+
return () => {
|
|
77
|
+
var _a;
|
|
78
|
+
return createVNode("div", {
|
|
79
|
+
"class": stepsClass.value
|
|
80
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const stepProps = {
|
|
85
|
+
title: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: true
|
|
88
|
+
},
|
|
89
|
+
description: {
|
|
90
|
+
type: String
|
|
91
|
+
},
|
|
92
|
+
icon: {
|
|
93
|
+
type: String
|
|
94
|
+
},
|
|
95
|
+
status: {
|
|
96
|
+
type: String
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const DEFAULT_PREFIX = "icon";
|
|
100
|
+
const iconProps = {
|
|
101
|
+
name: {
|
|
102
|
+
type: String,
|
|
103
|
+
default: "",
|
|
104
|
+
required: true
|
|
105
|
+
},
|
|
106
|
+
size: {
|
|
107
|
+
type: [Number, String],
|
|
108
|
+
default: "inherit"
|
|
109
|
+
},
|
|
110
|
+
color: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "inherit"
|
|
113
|
+
},
|
|
114
|
+
component: {
|
|
115
|
+
type: Object,
|
|
116
|
+
default: null
|
|
117
|
+
},
|
|
118
|
+
classPrefix: {
|
|
119
|
+
type: String,
|
|
120
|
+
default: DEFAULT_PREFIX
|
|
121
|
+
},
|
|
122
|
+
operable: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
},
|
|
126
|
+
disabled: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false
|
|
129
|
+
},
|
|
130
|
+
rotate: {
|
|
131
|
+
type: [Number, String]
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const svgIconProps = {
|
|
135
|
+
name: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: "",
|
|
138
|
+
required: true
|
|
139
|
+
},
|
|
140
|
+
color: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: "inherit"
|
|
143
|
+
},
|
|
144
|
+
size: {
|
|
145
|
+
type: [Number, String],
|
|
146
|
+
default: "inherit"
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var icon = "";
|
|
150
|
+
var svgIcon = defineComponent({
|
|
151
|
+
name: "DSvgIcon",
|
|
152
|
+
props: svgIconProps,
|
|
153
|
+
setup(props) {
|
|
154
|
+
const {
|
|
155
|
+
name,
|
|
156
|
+
color,
|
|
157
|
+
size
|
|
158
|
+
} = toRefs(props);
|
|
159
|
+
const ns = useNamespace("svg-icon");
|
|
160
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
161
|
+
const iconSize = computed(() => {
|
|
162
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
163
|
+
});
|
|
164
|
+
const styles = {
|
|
165
|
+
width: iconSize.value,
|
|
166
|
+
height: iconSize.value
|
|
167
|
+
};
|
|
168
|
+
return () => {
|
|
169
|
+
return createVNode("svg", {
|
|
170
|
+
"class": ns.b(),
|
|
171
|
+
"style": styles
|
|
172
|
+
}, [createVNode("use", {
|
|
173
|
+
"xlink:href": iconName.value,
|
|
174
|
+
"fill": color.value
|
|
175
|
+
}, null)]);
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
function isUrl(value) {
|
|
180
|
+
return /^((http|https):)?\/\//.test(value);
|
|
181
|
+
}
|
|
182
|
+
function useIconDom(props, ctx) {
|
|
183
|
+
const {
|
|
184
|
+
component,
|
|
185
|
+
name,
|
|
186
|
+
size,
|
|
187
|
+
color,
|
|
188
|
+
classPrefix,
|
|
189
|
+
rotate
|
|
190
|
+
} = toRefs(props);
|
|
191
|
+
const ns = useNamespace("icon");
|
|
192
|
+
const iconSize = computed(() => {
|
|
193
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
194
|
+
});
|
|
195
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
196
|
+
const imgIconDom = () => {
|
|
197
|
+
return createVNode("img", mergeProps({
|
|
198
|
+
"src": name.value,
|
|
199
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
200
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
201
|
+
"style": {
|
|
202
|
+
width: iconSize.value || "",
|
|
203
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
204
|
+
verticalAlign: "middle"
|
|
205
|
+
}
|
|
206
|
+
}, ctx.attrs), null);
|
|
207
|
+
};
|
|
208
|
+
const svgIconDom = () => {
|
|
209
|
+
return createVNode(IconComponent, mergeProps({
|
|
210
|
+
"name": name.value,
|
|
211
|
+
"color": color.value,
|
|
212
|
+
"size": iconSize.value,
|
|
213
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
214
|
+
"style": {
|
|
215
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
216
|
+
}
|
|
217
|
+
}, ctx.attrs), null);
|
|
218
|
+
};
|
|
219
|
+
const fontIconDom = () => {
|
|
220
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
221
|
+
return createVNode("i", mergeProps({
|
|
222
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
223
|
+
"style": {
|
|
224
|
+
fontSize: iconSize.value,
|
|
225
|
+
color: color.value,
|
|
226
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
227
|
+
}
|
|
228
|
+
}, ctx.attrs), null);
|
|
229
|
+
};
|
|
230
|
+
const iconDom = () => {
|
|
231
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
232
|
+
};
|
|
233
|
+
return {
|
|
234
|
+
iconDom
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
var Icon = defineComponent({
|
|
238
|
+
name: "DIcon",
|
|
239
|
+
props: iconProps,
|
|
240
|
+
emits: ["click"],
|
|
241
|
+
setup(props, ctx) {
|
|
242
|
+
const {
|
|
243
|
+
disabled,
|
|
244
|
+
operable
|
|
245
|
+
} = toRefs(props);
|
|
246
|
+
const {
|
|
247
|
+
iconDom
|
|
248
|
+
} = useIconDom(props, ctx);
|
|
249
|
+
const ns = useNamespace("icon");
|
|
250
|
+
const wrapClassed = computed(() => ({
|
|
251
|
+
[ns.e("container")]: true,
|
|
252
|
+
[ns.m("disabled")]: disabled.value,
|
|
253
|
+
[ns.m("operable")]: operable.value,
|
|
254
|
+
[ns.m("no-slots")]: !Object.keys(ctx.slots).length
|
|
255
|
+
}));
|
|
256
|
+
const onClick = (e) => {
|
|
257
|
+
if (disabled.value) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
ctx.emit("click", e);
|
|
261
|
+
};
|
|
262
|
+
return () => {
|
|
263
|
+
var _a, _b, _c, _d;
|
|
264
|
+
return createVNode("div", {
|
|
265
|
+
"class": wrapClassed.value,
|
|
266
|
+
"onClick": onClick
|
|
267
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
var iconGroup = "";
|
|
272
|
+
defineComponent({
|
|
273
|
+
name: "DIconGroup",
|
|
274
|
+
setup(_, ctx) {
|
|
275
|
+
const ns = useNamespace("icon-group");
|
|
276
|
+
return () => {
|
|
277
|
+
var _a, _b;
|
|
278
|
+
return createVNode("div", {
|
|
279
|
+
"class": ns.b()
|
|
280
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
var step = "";
|
|
285
|
+
var Step = defineComponent({
|
|
286
|
+
name: "DStep",
|
|
287
|
+
props: stepProps,
|
|
288
|
+
setup(props, {
|
|
289
|
+
slots
|
|
290
|
+
}) {
|
|
291
|
+
const {
|
|
292
|
+
title,
|
|
293
|
+
description,
|
|
294
|
+
icon: icon2,
|
|
295
|
+
status
|
|
296
|
+
} = toRefs(props);
|
|
297
|
+
const ns = useNamespace("step");
|
|
298
|
+
const instance = getCurrentInstance();
|
|
299
|
+
const activeStep = inject(ACTIVE_STEP);
|
|
300
|
+
const steps2 = inject(STEPS);
|
|
301
|
+
steps2.value.push(instance);
|
|
302
|
+
const stepsProps2 = inject(STEPS_PROPS);
|
|
303
|
+
const currentStepIndex = steps2.value.indexOf(instance);
|
|
304
|
+
const stepClass = computed(() => {
|
|
305
|
+
const activeClass = activeStep.value === currentStepIndex ? " active" : "";
|
|
306
|
+
const finishedClass = activeStep.value > currentStepIndex ? " finished" : "";
|
|
307
|
+
const centerClass = stepsProps2.alignCenter ? " center" : "";
|
|
308
|
+
const statusClass = (status == null ? void 0 : status.value) ? ` ${status == null ? void 0 : status.value}` : "";
|
|
309
|
+
const simpleClass = stepsProps2.simple ? ` ${ns.m("simple")}` : "";
|
|
310
|
+
return `${ns.b()}${activeClass}${finishedClass}${centerClass}${statusClass}${simpleClass}`;
|
|
311
|
+
});
|
|
312
|
+
const stepStyle = computed(() => {
|
|
313
|
+
const styleObj = {};
|
|
314
|
+
if (stepsProps2.space) {
|
|
315
|
+
styleObj.width = `${stepsProps2.space}px`;
|
|
316
|
+
} else {
|
|
317
|
+
styleObj.flexBasis = stepsProps2.alignCenter || stepsProps2.simple ? `${100 / steps2.value.length}%` : `${100 / (steps2.value.length - 1)}%`;
|
|
318
|
+
}
|
|
319
|
+
return styleObj;
|
|
320
|
+
});
|
|
321
|
+
const iconColor = computed(() => {
|
|
322
|
+
const isActive = activeStep.value === currentStepIndex;
|
|
323
|
+
const isFinished = activeStep.value > currentStepIndex;
|
|
324
|
+
return isActive ? "var(--devui-brand)" : isFinished ? "var(--devui-success)" : "var(--devui-placeholder)";
|
|
325
|
+
});
|
|
326
|
+
const statusMap = {
|
|
327
|
+
finish: createVNode(Icon, {
|
|
328
|
+
"name": "right-o",
|
|
329
|
+
"color": "var(--devui-success)",
|
|
330
|
+
"size": "24px"
|
|
331
|
+
}, null),
|
|
332
|
+
success: createVNode(Icon, {
|
|
333
|
+
"name": "right-o",
|
|
334
|
+
"color": "var(--devui-success)",
|
|
335
|
+
"size": "24px"
|
|
336
|
+
}, null),
|
|
337
|
+
error: createVNode(Icon, {
|
|
338
|
+
"name": "error-o",
|
|
339
|
+
"color": "var(--devui-danger)",
|
|
340
|
+
"size": "24px"
|
|
341
|
+
}, null)
|
|
342
|
+
};
|
|
343
|
+
const renderDot = () => {
|
|
344
|
+
var _a;
|
|
345
|
+
return slots.icon ? (_a = slots.icon) == null ? void 0 : _a.call(slots, iconColor.value) : icon2.value ? createVNode(Icon, {
|
|
346
|
+
"name": icon2.value,
|
|
347
|
+
"color": iconColor.value,
|
|
348
|
+
"size": "24px"
|
|
349
|
+
}, null) : status.value && statusMap[status.value] ? statusMap[status.value] : activeStep.value > steps2.value.indexOf(instance) ? createVNode(Icon, {
|
|
350
|
+
"name": "right-o",
|
|
351
|
+
"color": "var(--devui-success)",
|
|
352
|
+
"size": "24px"
|
|
353
|
+
}, null) : createVNode("span", {
|
|
354
|
+
"class": ns.e("dot")
|
|
355
|
+
}, [currentStepIndex + 1]);
|
|
356
|
+
};
|
|
357
|
+
return () => {
|
|
358
|
+
return createVNode(Fragment, null, [stepsProps2.simple ? createVNode("div", {
|
|
359
|
+
"class": stepClass.value,
|
|
360
|
+
"style": stepStyle.value
|
|
361
|
+
}, [title.value]) : createVNode("div", {
|
|
362
|
+
"class": stepClass.value,
|
|
363
|
+
"style": stepStyle.value
|
|
364
|
+
}, [createVNode("div", {
|
|
365
|
+
"class": ns.e("dot-container")
|
|
366
|
+
}, [renderDot(), createVNode("div", {
|
|
367
|
+
"class": ns.e("line")
|
|
368
|
+
}, null)]), createVNode("div", {
|
|
369
|
+
"class": ns.e("content")
|
|
370
|
+
}, [createVNode("span", {
|
|
371
|
+
"class": ns.e("title")
|
|
372
|
+
}, [title.value]), description.value && createVNode("span", {
|
|
373
|
+
"class": ns.e("description")
|
|
374
|
+
}, [description.value])])])]);
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
var index = {
|
|
379
|
+
title: "Steps \u6B65\u9AA4\u6761",
|
|
380
|
+
category: "\u6570\u636E\u5C55\u793A",
|
|
381
|
+
status: "100%",
|
|
382
|
+
install(app) {
|
|
383
|
+
app.component(Steps.name, Steps);
|
|
384
|
+
app.component(Step.name, Step);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
export { Step, Steps, index as default, stepProps, stepsProps };
|
|
@@ -0,0 +1 @@
|
|
|
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 P={modelValue:{type:Number,default:0},space:{type:Number},alignCenter:{type:Boolean,default:!1},direction:{type:String,default:"horizontal"},simple:{type:Boolean,default:!1}};function y(a,n,o){let s=a;return n&&(s+=`__${n}`),o&&(s+=`--${o}`),s}function v(a,n=!1){const o=n?`.devui-${a}`:`devui-${a}`;return{b:()=>y(o),e:t=>t?y(o,t):"",m:t=>t?y(o,"",t):"",em:(t,r)=>t&&r?y(o,t,r):""}}var w="";const D="active-step",I="steps",z="steps-props";var C=e.defineComponent({name:"DSteps",props:P,emits:["update:modelValue"],setup(a,{slots:n}){const{modelValue:o,direction:s,simple:u}=e.toRefs(a),l=v("steps"),c=e.ref(o.value);e.provide(D,c),e.provide(z,a);const t=e.ref([]);e.provide(I,t),e.watch(o,i=>{c.value=i});const r=e.computed(()=>{const i=s.value==="vertical"?" vertical":"",p=u.value?" simple":"";return`${l.b()}${i}${p}`});return()=>{var i;return e.createVNode("div",{class:r.value},[(i=n.default)==null?void 0:i.call(n)])}}});const x={title:{type:String,required:!0},description:{type:String},icon:{type:String},status:{type:String}},E={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},T={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};var M="",_=e.defineComponent({name:"DSvgIcon",props:T,setup(a){const{name:n,color:o,size:s}=e.toRefs(a),u=v("svg-icon"),l=e.computed(()=>`#icon-${n.value}`),c=e.computed(()=>typeof s.value=="number"?`${s.value}px`:s.value),t={width:c.value,height:c.value};return()=>e.createVNode("svg",{class:u.b(),style:t},[e.createVNode("use",{"xlink:href":l.value,fill:o.value},null)])}});function j(a){return/^((http|https):)?\/\//.test(a)}function A(a,n){const{component:o,name:s,size:u,color:l,classPrefix:c,rotate:t}=e.toRefs(a),r=v("icon"),i=e.computed(()=>typeof u.value=="number"?`${u.value}px`:u.value),p=o.value?e.resolveDynamicComponent(o.value):e.resolveDynamicComponent(_),m=()=>e.createVNode("img",e.mergeProps({src:s.value,alt:s.value.split("/")[s.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{width:i.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`,verticalAlign:"middle"}},n.attrs),null),S=()=>e.createVNode(p,e.mergeProps({name:s.value,color:l.value,size:i.value,class:[(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},n.attrs),null),h=()=>{const N=/^icon-/.test(s.value)?s.value:`${c.value}-${s.value}`;return e.createVNode("i",e.mergeProps({class:[c.value,N,(t==null?void 0:t.value)==="infinite"&&r.m("spin")],style:{fontSize:i.value,color:l.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},n.attrs),null)};return{iconDom:()=>o.value?S():j(s.value)?m():h()}}var g=e.defineComponent({name:"DIcon",props:E,emits:["click"],setup(a,n){const{disabled:o,operable:s}=e.toRefs(a),{iconDom:u}=A(a,n),l=v("icon"),c=e.computed(()=>({[l.e("container")]:!0,[l.m("disabled")]:o.value,[l.m("operable")]:s.value,[l.m("no-slots")]:!Object.keys(n.slots).length})),t=r=>{o.value||n.emit("click",r)};return()=>{var r,i,p,m;return e.createVNode("div",{class:c.value,onClick:t},[(i=(r=n.slots).prefix)==null?void 0:i.call(r),u(),(m=(p=n.slots).suffix)==null?void 0:m.call(p)])}}}),U="";e.defineComponent({name:"DIconGroup",setup(a,n){const o=v("icon-group");return()=>{var s,u;return e.createVNode("div",{class:o.b()},[(u=(s=n.slots).default)==null?void 0:u.call(s)])}}});var G="",V=e.defineComponent({name:"DStep",props:x,setup(a,{slots:n}){const{title:o,description:s,icon:u,status:l}=e.toRefs(a),c=v("step"),t=e.getCurrentInstance(),r=e.inject(D),i=e.inject(I);i.value.push(t);const p=e.inject(z),m=i.value.indexOf(t),S=e.computed(()=>{const f=r.value===m?" active":"",b=r.value>m?" finished":"",O=p.alignCenter?" center":"",F=(l==null?void 0:l.value)?` ${l==null?void 0:l.value}`:"",k=p.simple?` ${c.m("simple")}`:"";return`${c.b()}${f}${b}${O}${F}${k}`}),h=e.computed(()=>{const f={};return p.space?f.width=`${p.space}px`:f.flexBasis=p.alignCenter||p.simple?`${100/i.value.length}%`:`${100/(i.value.length-1)}%`,f}),$=e.computed(()=>{const f=r.value===m,b=r.value>m;return f?"var(--devui-brand)":b?"var(--devui-success)":"var(--devui-placeholder)"}),N={finish:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),success:e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null),error:e.createVNode(g,{name:"error-o",color:"var(--devui-danger)",size:"24px"},null)},B=()=>{var f;return n.icon?(f=n.icon)==null?void 0:f.call(n,$.value):u.value?e.createVNode(g,{name:u.value,color:$.value,size:"24px"},null):l.value&&N[l.value]?N[l.value]:r.value>i.value.indexOf(t)?e.createVNode(g,{name:"right-o",color:"var(--devui-success)",size:"24px"},null):e.createVNode("span",{class:c.e("dot")},[m+1])};return()=>e.createVNode(e.Fragment,null,[p.simple?e.createVNode("div",{class:S.value,style:h.value},[o.value]):e.createVNode("div",{class:S.value,style:h.value},[e.createVNode("div",{class:c.e("dot-container")},[B(),e.createVNode("div",{class:c.e("line")},null)]),e.createVNode("div",{class:c.e("content")},[e.createVNode("span",{class:c.e("title")},[o.value]),s.value&&e.createVNode("span",{class:c.e("description")},[s.value])])])])}}),R={title:"Steps \u6B65\u9AA4\u6761",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.component(C.name,C),a.component(V.name,V)}};d.Step=V,d.Steps=C,d.default=R,d.stepProps=x,d.stepsProps=P,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
package/steps/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.devui-steps{display:flex}.devui-steps.vertical{flex-direction:column;height:100%}.devui-steps.vertical .devui-step{flex-direction:row}.devui-steps.vertical .devui-step__line{width:1px;height:100%;left:12px;top:24px}.devui-steps.vertical .devui-step__content{margin-left:8px;padding-top:2px}.devui-steps.simple .devui-step{position:relative;height:36px;line-height:36px;text-align:center;background-color:var(--devui-brand-foil, #f2f2f3);color:var(--devui-text, #252b3a)}.devui-steps.simple .devui-step:not(:first-child){margin-left:18px}.devui-steps.simple .devui-step:not(:last-child){margin-right:18px}.devui-steps.simple .devui-step:not(:first-child):before{content:"";width:0;height:0;position:absolute;left:-28px;top:0;border:solid 18px transparent;border-top-color:var(--devui-brand-foil, #f2f2f3);border-right-color:var(--devui-brand-foil, #f2f2f3);border-bottom-color:var(--devui-brand-foil, #f2f2f3)}.devui-steps.simple .devui-step:after{content:"";width:0;height:0;position:absolute;right:-36px;top:0;border:solid 18px transparent;border-left-color:var(--devui-brand-foil, #f2f2f3)}.devui-steps.simple .devui-step.active{background-color:var(--devui-brand, #5e7ce0);color:var(--devui-light-text, #ffffff)}.devui-steps.simple .devui-step.active:before{border-top-color:var(--devui-brand, #5e7ce0);border-right-color:var(--devui-brand, #5e7ce0);border-bottom-color:var(--devui-brand, #5e7ce0)}.devui-steps.simple .devui-step.active:after{border-left-color:var(--devui-brand, #5e7ce0)}.devui-steps.simple .devui-step.finished{background-color:var(--devui-success, #50d4ab);color:var(--devui-light-text, #ffffff)}.devui-steps.simple .devui-step.finished:before{border-top-color:var(--devui-success, #50d4ab);border-right-color:var(--devui-success, #50d4ab);border-bottom-color:var(--devui-success, #50d4ab)}.devui-steps.simple .devui-step.finished:after{border-left-color:var(--devui-success, #50d4ab)}.devui-icon__container{display:inline-block;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--no-slots i,.devui-icon--no-slots img{display:block}.devui-icon--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #adb0b8)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 2px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-step{display:flex;flex-direction:column;flex-shrink:1}.devui-step:last-child{flex-shrink:0}.devui-step:last-child:not(.center):not(.devui-step--simple){flex-basis:auto!important}.devui-step:last-child .devui-step__line{display:none}.devui-step__dot-container{position:relative}.devui-step__content{display:flex;flex-direction:column}.devui-step__dot{display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;border-radius:50%;background-color:var(--devui-brand-foil, #f2f2f3);color:var(--devui-text, #252b3a)}.devui-step__line{position:absolute;top:12px;left:24px;width:calc(100% - 24px);height:1px;background-color:var(--devui-line, #d7d8da)}.devui-step__title{color:var(--devui-placeholder, #babbc0)}.devui-step__description{color:var(--devui-placeholder, #babbc0);font-size:12px}.devui-step.active .devui-step__dot{background-color:var(--devui-brand, #5e7ce0);color:var(--devui-light-text, #ffffff)}.devui-step.active .devui-step__title,.devui-step.active .devui-step__description{color:var(--devui-brand, #5e7ce0)}.devui-step.finished .devui-step__dot{background-color:var(--devui-success, #50d4ab)}.devui-step.finished .devui-step__title,.devui-step.finished .devui-step__description{color:var(--devui-success, #50d4ab)}.devui-step.center{text-align:center}.devui-step.center .devui-step__line{left:calc(50% + 12px)}.devui-step.wait .devui-step__dot{background-color:var(--devui-brand-foil, #f2f2f3);color:var(--devui-text, #252b3a)}.devui-step.wait .devui-step__title{color:var(--devui-placeholder, #babbc0)}.devui-step.process .devui-step__dot{background-color:var(--devui-brand, #5e7ce0);color:var(--devui-light-text, #ffffff)}.devui-step.process .devui-step__title{color:var(--devui-brand, #5e7ce0)}.devui-step.finish .devui-step__dot{background-color:var(--devui-success, #50d4ab);color:var(--devui-light-text, #ffffff)}.devui-step.finish .devui-step__title{color:var(--devui-success, #50d4ab)}.devui-step.success .devui-step__dot{background-color:var(--devui-success, #50d4ab);color:var(--devui-light-text, #ffffff)}.devui-step.success .devui-step__title{color:var(--devui-success, #50d4ab)}.devui-step.error .devui-step__dot{background-color:var(--devui-danger, #f66f6a);color:var(--devui-light-text, #ffffff)}.devui-step.error .devui-step__title{color:var(--devui-danger, #f66f6a)}
|