mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
383 lines
44 KiB
383 lines
44 KiB
2 years ago
|
import{cs as V,h as t,b as L,c as h,e as C,d as M,y as R,ba as q,N as j,ct as de,cu as ce,an as ue,cv as fe,u as ge,x as Q,cw as Te,z as te,A as he,n as $e,q as G,b8 as ee,aU as Se,L as Le,M as De,cx as pe,r as W,v as ze,bJ as _e,bA as Fe,K as Z,cy as Ie,cz as Oe,b1 as Ue,bB as je,cA as re,f as U,cB as Ne,cC as Ee,o as Ae,t as F,s as Me,p as qe,cD as He,ab as We,R as ne,V as Xe,w as ie}from"./index-c17d3913.js";const Ve=V("attach",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),Ge=V("trash",t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},t("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),t("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),Ye=V("download",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),Ke=V("cancel",t("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("g",{fill:"currentColor","fill-rule":"nonzero"},t("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3
|
||
2 years ago
|
color: var(--n-icon-color);
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
`),C("line",`
|
||
|
width: 100%;
|
||
|
display: block;
|
||
|
`,[h("progress-content",`
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
`,[h("progress-graph",{flex:1})]),h("progress-custom-content",{marginLeft:"14px"}),h("progress-icon",`
|
||
|
width: 30px;
|
||
|
padding-left: 14px;
|
||
|
height: var(--n-icon-size-line);
|
||
|
line-height: var(--n-icon-size-line);
|
||
|
font-size: var(--n-icon-size-line);
|
||
|
`,[C("as-text",`
|
||
|
color: var(--n-text-color-line-outer);
|
||
|
text-align: center;
|
||
|
width: 40px;
|
||
|
font-size: var(--n-font-size);
|
||
|
padding-left: 4px;
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
`)])]),C("circle, dashboard",{width:"120px"},[h("progress-custom-content",`
|
||
|
position: absolute;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
transform: translateX(-50%) translateY(-50%);
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
`),h("progress-text",`
|
||
|
position: absolute;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
transform: translateX(-50%) translateY(-50%);
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
color: inherit;
|
||
|
font-size: var(--n-font-size-circle);
|
||
|
color: var(--n-text-color-circle);
|
||
|
font-weight: var(--n-font-weight-circle);
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
white-space: nowrap;
|
||
|
`),h("progress-icon",`
|
||
|
position: absolute;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
transform: translateX(-50%) translateY(-50%);
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
color: var(--n-icon-color);
|
||
|
font-size: var(--n-icon-size-circle);
|
||
|
`)]),C("multiple-circle",`
|
||
|
width: 200px;
|
||
|
color: inherit;
|
||
|
`,[h("progress-text",`
|
||
|
font-weight: var(--n-font-weight-circle);
|
||
|
color: var(--n-text-color-circle);
|
||
|
position: absolute;
|
||
|
left: 50%;
|
||
|
top: 50%;
|
||
|
transform: translateX(-50%) translateY(-50%);
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
`)]),h("progress-content",{position:"relative"}),h("progress-graph",{position:"relative"},[h("progress-graph-circle",[L("svg",{verticalAlign:"bottom"}),h("progress-graph-circle-fill",`
|
||
|
stroke: var(--n-fill-color);
|
||
|
transition:
|
||
|
opacity .3s var(--n-bezier),
|
||
|
stroke .3s var(--n-bezier),
|
||
|
stroke-dasharray .3s var(--n-bezier);
|
||
|
`,[C("empty",{opacity:0})]),h("progress-graph-circle-rail",`
|
||
|
transition: stroke .3s var(--n-bezier);
|
||
|
overflow: hidden;
|
||
|
stroke: var(--n-rail-color);
|
||
|
`)]),h("progress-graph-line",[C("indicator-inside",[h("progress-graph-line-rail",`
|
||
|
height: 16px;
|
||
|
line-height: 16px;
|
||
|
border-radius: 10px;
|
||
|
`,[h("progress-graph-line-fill",`
|
||
|
height: inherit;
|
||
|
border-radius: 10px;
|
||
|
`),h("progress-graph-line-indicator",`
|
||
|
background: #0000;
|
||
|
white-space: nowrap;
|
||
|
text-align: right;
|
||
|
margin-left: 14px;
|
||
|
margin-right: 14px;
|
||
|
height: inherit;
|
||
|
font-size: 12px;
|
||
|
color: var(--n-text-color-line-inner);
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
`)])]),C("indicator-inside-label",`
|
||
|
height: 16px;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
`,[h("progress-graph-line-rail",`
|
||
|
flex: 1;
|
||
|
transition: background-color .3s var(--n-bezier);
|
||
|
`),h("progress-graph-line-indicator",`
|
||
|
background: var(--n-fill-color);
|
||
|
font-size: 12px;
|
||
|
transform: translateZ(0);
|
||
|
display: flex;
|
||
|
vertical-align: middle;
|
||
|
height: 16px;
|
||
|
line-height: 16px;
|
||
|
padding: 0 10px;
|
||
|
border-radius: 10px;
|
||
|
position: absolute;
|
||
|
white-space: nowrap;
|
||
|
color: var(--n-text-color-line-inner);
|
||
|
transition:
|
||
|
right .2s var(--n-bezier),
|
||
|
color .3s var(--n-bezier),
|
||
|
background-color .3s var(--n-bezier);
|
||
|
`)]),h("progress-graph-line-rail",`
|
||
|
position: relative;
|
||
|
overflow: hidden;
|
||
|
height: var(--n-rail-height);
|
||
|
border-radius: 5px;
|
||
|
background-color: var(--n-rail-color);
|
||
|
transition: background-color .3s var(--n-bezier);
|
||
|
`,[h("progress-graph-line-fill",`
|
||
|
background: var(--n-fill-color);
|
||
|
position: relative;
|
||
|
border-radius: 5px;
|
||
|
height: inherit;
|
||
|
width: 100%;
|
||
|
max-width: 0%;
|
||
|
transition:
|
||
|
background-color .3s var(--n-bezier),
|
||
|
max-width .2s var(--n-bezier);
|
||
|
`,[C("processing",[L("&::after",`
|
||
|
content: "";
|
||
|
background-image: var(--n-line-bg-processing);
|
||
|
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
||
|
`)])])])])])]),L("@keyframes progress-processing-animation",`
|
||
|
0% {
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
bottom: 0;
|
||
|
right: 100%;
|
||
|
opacity: 1;
|
||
|
}
|
||
|
66% {
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
bottom: 0;
|
||
|
right: 0;
|
||
|
opacity: 0;
|
||
|
}
|
||
|
100% {
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
bottom: 0;
|
||
|
right: 0;
|
||
|
opacity: 0;
|
||
|
}
|
||
|
`)]),Qe={success:t(de,null),error:t(ce,null),warning:t(ue,null),info:t(fe,null)},et=M({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:i}){const r=R(()=>q(e.height)),n=R(()=>e.railBorderRadius!==void 0?q(e.railBorderRadius):e.height!==void 0?q(e.height,{c:.5}):""),o=R(()=>e.fillBorderRadius!==void 0?q(e.fillBorderRadius):e.railBorderRadius!==void 0?q(e.railBorderRadius):e.height!==void 0?q(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:s,railColor:c,railStyle:u,percentage:d,unit:a,indicatorTextColor:l,status:f,showIndicator:y,fillColor:p,processing:k,clsPrefix:v}=e;return t("div",{class:`${v}-progress-content`,role:"none"},t("div",{class:`${v}-progress-graph`,"aria-hidden":!0},t("div",{class:[`${v}-progress-graph-line`,{[`${v}-progress-graph-line--indicator-${s}`]:!0}]},t("div",{class:`${v}-progress-graph-line-rail`,style:[{backgroundColor:c,height:r.value,borderRadius:n.value},u]},t("div",{class:[`${v}-progress-graph-line-fill`,k&&`${v}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:p,height:r.value,lineHeight:r.value,borderRadius:o.value}},s==="inside"?t("div",{class:`${v}-progress-graph-line-indicator`,style:{color:l}},d,a):null)))),y&&s==="outside"?t("div",null,i.default?t("div",{class:`${v}-progress-custom-content`,style:{color:l},role:"none"},i.default()):f==="default"?t("div",{role:"none",class:`${v}-progress-icon ${v}-progress-icon--as-text`,style:{color:l}},d,a):t("div",{class:`${v}-progress-icon`,"aria-hidden":!0},t(j,{clsPrefix:v},{default:()=>Qe[f]}))):null)}}}),tt={success:t(de,null),error:t(ce,null),warning:t(ue,null),info:t(fe,null)},rt=M({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:i}){function r(n,o,s){const{gapDegree:c,viewBoxWidth:u,strokeWidth:d}=e,a=50,l=0,f=a,y=0,p=2*a,k=50+d/2,v=`M ${k},${k} m ${l},${f}
|
||
|
a ${a},${a} 0 1 1 ${y},${-p}
|
||
|
a ${a},${a} 0 1 1 ${-y},${p}`,B=Math.PI*2*a,D={stroke:s,strokeDasharray:`${n/100*(B-c)}px ${u*8}px`,strokeDashoffset:`-${c/2}px`,transformOrigin:o?"center":void 0,transform:o?`rotate(${o}deg)`:void 0};return{pathString:v,pathStyle:D}}return()=>{const{fillColor:n,railColor:o,strokeWidth:s,offsetDegree:c,status:u,percentage:d,showIndicator:a,indicatorTextColor:l,unit:f,gapOffsetDegree:y,clsPrefix:p}=e,{pathString:k,pathStyle:v}=r(100,0,o),{pathString:B,pathStyle:D}=r(d,c,n),T=100+s;return t("div",{class:`${p}-progress-content`,role:"none"},t("div",{class:`${p}-progress-graph`,"aria-hidden":!0},t("div",{class:`${p}-progress-graph-circle`,style:{transform:y?`rotate(${y}deg)`:void 0}},t("svg",{viewBox:`0 0 ${T} ${T}`},t("g",null,t("path",{class:`${p}-progress-graph-circle-rail`,d:k,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:v})),t("g",null,t("path",{class:[`${p}-progress-graph-circle-fill`,d===0&&`${p}-progress-graph-circle-fill--empty`],d:B,"stroke-width":s,"stroke-linecap":"round",fill:"none",style:D}))))),a?t("div",null,i.default?t("div",{class:`${p}-progress-custom-content`,role:"none"},i.default()):u!=="default"?t("div",{class:`${p}-progress-icon`,"aria-hidden":!0},t(j,{clsPrefix:p},{default:()=>tt[u]})):t("div",{class:`${p}-progress-text`,style:{color:l},role:"none"},t("span",{class:`${p}-progress-text__percentage`},d),t("span",{class:`${p}-progress-text__unit`},f))):null)}}});function oe(e,i,r=100){return`m ${r/2} ${r/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const nt=M({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:i}){const r=R(()=>e.percentage.map((o,s)=>`${Math.PI*o/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*s)-e.circleGap*s)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:n,strokeWidth:o,circleGap:s,showIndicator:c,fillColor:u,railColor:d,railStyle:a,percentage:l,clsPrefix:f}=e;return t("div",{class:`${f}-progress-content`,role:"none"},t("div",{class:`${f}-progress-graph`,"aria-hidden":!0},t("div",{class:`${f}-progress-graph-circle`},t("svg",{viewBox:`0 0 ${n} ${n}`},l.map((y,p)=>t("g",{key:p},t("path",{class:`${f}-progress-graph-circle-rail`,d:oe(n/2-o/2*(1+2*p)-s*p,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:d[p]},a[p]]}),t("path",{class:[`${f}-progress-graph-circle-fill`,y===0&&`${f}-progress-graph-circle-fill--empty`],d:oe(n/2-o/2*(1+2*p)-s*p,o,n),"stroke-width":o,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:r.value[p],strokeDashoffset:0,stroke:u[p]}})))))),c&&i.default?t("div",null,t("div",{class:`${f}-progress-text`},i.default())):null)}}}),it=Object.assign(Object.assign({},Q.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),ot=M({name:"Progress",props:it,setup(e){const i=R(()=>e.indicatorPlacement||e.indicatorPosition),r=R(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:n,inlineThemeDisabled:o}=ge(e),s=Q("Progress","-progress",Je,Te,e,n),c=R(()=>{const{status:d}=e,{common:{cubicBezierEaseInOut:a},self:{fontSize:l,fontSizeCircle:f,railColor:y,railHeight:p,iconSizeCircle:k,iconSizeLine:v,textColorCircle:B,textCo
|
||
|
display: block;
|
||
|
`)]),C("drag-over",[h("upload-dragger",`
|
||
|
border: var(--n-dragger-border-hover);
|
||
|
`)])]),h("upload-dragger",`
|
||
|
cursor: pointer;
|
||
|
box-sizing: border-box;
|
||
|
width: 100%;
|
||
|
text-align: center;
|
||
|
border-radius: var(--n-border-radius);
|
||
|
padding: 24px;
|
||
|
opacity: 1;
|
||
|
transition:
|
||
|
opacity .3s var(--n-bezier),
|
||
|
border-color .3s var(--n-bezier),
|
||
|
background-color .3s var(--n-bezier);
|
||
|
background-color: var(--n-dragger-color);
|
||
|
border: var(--n-dragger-border);
|
||
|
`,[L("&:hover",`
|
||
|
border: var(--n-dragger-border-hover);
|
||
|
`),C("disabled",`
|
||
|
cursor: not-allowed;
|
||
|
`)]),h("upload-trigger",`
|
||
|
display: inline-block;
|
||
|
box-sizing: border-box;
|
||
|
opacity: 1;
|
||
|
transition: opacity .3s var(--n-bezier);
|
||
|
`,[L("+",[h("upload-file-list","margin-top: 8px;")]),C("disabled",`
|
||
|
opacity: var(--n-item-disabled-opacity);
|
||
|
cursor: not-allowed;
|
||
|
`),C("image-card",`
|
||
|
width: 96px;
|
||
|
height: 96px;
|
||
|
`,[h("base-icon",`
|
||
|
font-size: 24px;
|
||
|
`),h("upload-dragger",`
|
||
|
padding: 0;
|
||
|
height: 100%;
|
||
|
width: 100%;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
`)])]),h("upload-file-list",`
|
||
|
line-height: var(--n-line-height);
|
||
|
opacity: 1;
|
||
|
transition: opacity .3s var(--n-bezier);
|
||
|
`,[L("a, img","outline: none;"),C("disabled",`
|
||
|
opacity: var(--n-item-disabled-opacity);
|
||
|
cursor: not-allowed;
|
||
|
`,[h("upload-file","cursor: not-allowed;")]),C("grid",`
|
||
|
display: grid;
|
||
|
grid-template-columns: repeat(auto-fill, 96px);
|
||
|
grid-gap: 8px;
|
||
|
margin-top: 0;
|
||
|
`),h("upload-file",`
|
||
|
display: block;
|
||
|
box-sizing: border-box;
|
||
|
cursor: default;
|
||
|
padding: 0px 12px 0 6px;
|
||
|
transition: background-color .3s var(--n-bezier);
|
||
|
border-radius: var(--n-border-radius);
|
||
|
`,[re(),h("progress",[re({foldPadding:!0})]),L("&:hover",`
|
||
|
background-color: var(--n-item-color-hover);
|
||
|
`,[h("upload-file-info",[U("action",`
|
||
|
opacity: 1;
|
||
|
`)])]),C("image-type",`
|
||
|
border-radius: var(--n-border-radius);
|
||
|
text-decoration: underline;
|
||
|
text-decoration-color: #0000;
|
||
|
`,[h("upload-file-info",`
|
||
|
padding-top: 0px;
|
||
|
padding-bottom: 0px;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
display: flex;
|
||
|
justify-content: space-between;
|
||
|
align-items: center;
|
||
|
padding: 6px 0;
|
||
|
`,[h("progress",`
|
||
|
padding: 2px 0;
|
||
|
margin-bottom: 0;
|
||
|
`),U("name",`
|
||
|
padding: 0 8px;
|
||
|
`),U("thumbnail",`
|
||
|
width: 32px;
|
||
|
height: 32px;
|
||
|
font-size: 28px;
|
||
|
display: flex;
|
||
|
justify-content: center;
|
||
|
align-items: center;
|
||
|
`,[L("img",`
|
||
|
width: 100%;
|
||
|
`)])])]),C("text-type",[h("progress",`
|
||
|
box-sizing: border-box;
|
||
|
padding-bottom: 6px;
|
||
|
margin-bottom: 6px;
|
||
|
`)]),C("image-card-type",`
|
||
|
position: relative;
|
||
|
width: 96px;
|
||
|
height: 96px;
|
||
|
border: var(--n-item-border-image-card);
|
||
|
border-radius: var(--n-border-radius);
|
||
|
padding: 0;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
|
||
|
border-radius: var(--n-border-radius);
|
||
|
overflow: hidden;
|
||
|
`,[h("progress",`
|
||
|
position: absolute;
|
||
|
left: 8px;
|
||
|
bottom: 8px;
|
||
|
right: 8px;
|
||
|
width: unset;
|
||
|
`),h("upload-file-info",`
|
||
|
padding: 0;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
`,[U("thumbnail",`
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
display: flex;
|
||
|
flex-direction: column;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
font-size: 36px;
|
||
|
`,[L("img",`
|
||
|
width: 100%;
|
||
|
`)])]),L("&::before",`
|
||
|
position: absolute;
|
||
|
z-index: 1;
|
||
|
left: 0;
|
||
|
right: 0;
|
||
|
top: 0;
|
||
|
bottom: 0;
|
||
|
border-radius: inherit;
|
||
|
opacity: 0;
|
||
|
transition: opacity .2s var(--n-bezier);
|
||
|
content: "";
|
||
|
`),L("&:hover",[L("&::before","opacity: 1;"),h("upload-file-info",[U("thumbnail","opacity: .12;")])])]),C("error-status",[L("&:hover",`
|
||
|
background-color: var(--n-item-color-hover-error);
|
||
|
`),h("upload-file-info",[U("name","color: var(--n-item-text-color-error);"),U("thumbnail","color: var(--n-item-text-color-error);")]),C("image-card-type",`
|
||
|
border: var(--n-item-border-image-card-error);
|
||
|
`)]),C("with-url",`
|
||
|
cursor: pointer;
|
||
|
`,[h("upload-file-info",[U("name",`
|
||
|
color: var(--n-item-text-color-success);
|
||
|
text-decoration-color: var(--n-item-text-color-success);
|
||
|
`,[L("a",`
|
||
|
text-decoration: underline;
|
||
|
`)])])]),h("upload-file-info",`
|
||
|
position: relative;
|
||
|
padding-top: 6px;
|
||
|
padding-bottom: 6px;
|
||
|
display: flex;
|
||
|
flex-wrap: nowrap;
|
||
|
`,[U("thumbnail",`
|
||
|
font-size: 18px;
|
||
|
opacity: 1;
|
||
|
transition: opacity .2s var(--n-bezier);
|
||
|
color: var(--n-item-icon-color);
|
||
|
`,[h("base-icon",`
|
||
|
margin-right: 2px;
|
||
|
vertical-align: middle;
|
||
|
transition: color .3s var(--n-bezier);
|
||
|
`)]),U("action",`
|
||
|
padding-top: inherit;
|
||
|
padding-bottom: inherit;
|
||
|
position: absolute;
|
||
|
right: 0;
|
||
|
top: 0;
|
||
|
bottom: 0;
|
||
|
width: 80px;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
transition: opacity .2s var(--n-bezier);
|
||
|
justify-content: flex-end;
|
||
|
opacity: 0;
|
||
|
`,[h("button",[L("&:not(:last-child)",{marginRight:"4px"}),h("base-icon",[L("svg",[Ne()])])]),C("image-type",`
|
||
|
position: relative;
|
||
|
max-width: 80px;
|
||
|
width: auto;
|
||
|
`),C("image-card-type",`
|
||
|
z-index: 2;
|
||
|
position: absolute;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
left: 0;
|
||
|
right: 0;
|
||
|
bottom: 0;
|
||
|
top: 0;
|
||
|
display: flex;
|
||
|
justify-content: center;
|
||
|
align-items: center;
|
||
|
`)]),U("name",`
|
||
|
color: var(--n-item-text-color);
|
||
|
flex: 1;
|
||
|
display: flex;
|
||
|
justify-content: center;
|
||
|
text-overflow: ellipsis;
|
||
|
overflow: hidden;
|
||
|
flex-direction: column;
|
||
|
text-decoration-color: #0000;
|
||
|
font-size: var(--n-font-size);
|
||
|
transition:
|
||
|
color .3s var(--n-bezier),
|
||
|
text-decoration-color .3s var(--n-bezier);
|
||
|
`,[L("a",`
|
||
|
color: inherit;
|
||
|
text-decoration: underline;
|
||
|
`)])])])]),h("upload-file-input",`
|
||
|
display: block;
|
||
|
width: 0;
|
||
|
height: 0;
|
||
|
opacity: 0;
|
||
|
`)]);var se=globalThis&&globalThis.__awaiter||function(e,i,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return new(r||(r=Promise))(function(s,c){function u(l){try{a(n.next(l))}catch(f){c(f)}}function d(l){try{a(n.throw(l))}catch(f){c(f)}}function a(l){l.done?s(l.value):o(l.value).then(u,d)}a((n=n.apply(e,i||[])).next())})};function xt(e,i,r){const{doChange:n,xhrMap:o}=e;let s=0;function c(d){var a;let l=Object.assign({},i,{status:"error",percentage:s});o.delete(i.id),l=X(((a=e.onError)===null||a===void 0?void 0:a.call(e,{file:l,event:d}))||l),n(l,d)}function u(d){var a;if(e.isErrorState){if(e.isErrorState(r)){c(d);return}}else if(r.status<200||r.status>=300){c(d);return}let l=Object.assign({},i,{status:"finished",percentage:s});o.delete(i.id),l=X(((a=e.onFinish)===null||a===void 0?void 0:a.call(e,{file:l,event:d}))||l),n(l,d)}return{handleXHRLoad:u,handleXHRError:c,handleXHRAbort(d){const a=Object.assign({},i,{status:"removed",file:null,percentage:s});o.delete(i.id),n(a,d)},handleXHRProgress(d){const a=Object.assign({},i,{status:"uploading"});if(d.lengthComputable){const l=Math.ceil(d.loaded/d.total*100);a.percentage=l,s=l}n(a,d)}}}function Ct(e){const{inst:i,file:r,data:n,headers:o,withCredentials:s,action:c,customRequest:u}=e,{doChange:d}=e.inst;let a=0;u({file:r,data:n,headers:o,withCredentials:s,action:c,onProgress(l){const f=Object.assign({},r,{status:"uploading"}),y=l.percent;f.percentage=y,a=y,d(f)},onFinish(){var l;let f=Object.assign({},r,{status:"finished",percentage:a});f=X(((l=i.onFinish)===null||l===void 0?void 0:l.call(i,{file:f}))||f),d(f)},onError(){var l;let f=Object.assign({},r,{status:"error",percentage:a});f=X(((l=i.onError)===null||l===void 0?void 0:l.call(i,{file:f}))||f),d(f)}})}function Rt(e,i,r){const n=xt(e,i,r);r.onabort=n.handleXHRAbort,r.onerror=n.handleXHRError,r.onload=n.handleXHRLoad,r.upload&&(r.upload.onprogress=n.handleXHRProgress)}function xe(e,i){return typeof e=="function"?e({file:i}):e||{}}function kt(e,i,r){const n=xe(i,r);n&&Object.keys(n).forEach(o=>{e.setRequestHeader(o,n[o])})}function Bt(e,i,r){const n=xe(i,r);n&&Object.keys(n).forEach(o=>{e.append(o,n[o])})}function Pt(e,i,r,{method:n,action:o,withCredentials:s,responseType:c,headers:u,data:d}){const a=new XMLHttpRequest;a.responseType=c,e.xhrMap.set(r.id,a),a.withCredentials=s;const l=new FormData;if(Bt(l,d,r),l.append(i,r.file),Rt(e,r,a),o!==void 0){a.open(n.toUpperCase(),o),kt(a,u,r),a.send(l);const f=Object.assign({},r,{status:"uploading"});e.doChange(f)}}const Tt=Object.assign(Object.assign({},Q.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>st?ye(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerStyle:[String,Object],renderIcon:Object}),St=M({name:"Upload",props:Tt,setup(e){e.abstract&&e.listType==="image-card"&&ee("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:i,inlineThemeDisabled:r}=ge(e),n=Q("Upload","-upload",wt,Ee,e,i),o=Ae(e),s=R(()=>{const{max:g}=e;return g!==void 0?p.v
|