k5web/assets/index.9a6517bd.js

199 lines
115 KiB
JavaScript
Raw Normal View History

2024-07-01 14:33:25 +00:00
import{u as ie,r as ue,_ as ce,a as Te}from"./useGlobalIcon.e6846aca.js";import{d as Q,c as d,f as Z,w as ve,t as he,i as La,n as Ke,o as Je,aI as l,bC as re,bt as Ma,aK as Fe,bE as ma,by as Ba,bg as $a,bh as Ta,bD as Ra,b as Na,aU as We,h as Va}from"./arco.7f845a67.js";import{f as Le,af as pa,c as de,w as Se,d as Ee,J as _e,ap as Aa,i as ha,e as Be,b as Xe,G as lt}from"./index.e1698f3e.js";import{_ as Pe,b as ot,i as Ha}from"./helper.e7853506.js";import{u as ge,_ as q,a as ya,b as oe}from"./useConfig.3a51a7af.js";import{l as we,b as Qe,d as ba,a as Ka,e as qa,i as Xa,C as Za,B as Oa}from"./index.754948b2.js";import{o as Ga,e as Ya,T as Ge,v as Ja,w as Wa,x as Qa,f as en,n as tn,y as an,l as nn,u as rn,z as ln,r as on}from"./dep-6deb4e3a.716901b3.js";import{s as un,L as Re,u as cn,i as sn}from"./index.c9d9f013.js";import{o as wa,u as vn,b as et,f as dn,h as fn,C as tt,E as Ze}from"./dialog.4a111457.js";import{a as gn}from"./slot.62ee6927.js";import{L as at}from"./index.c9ce06d2.js";import{B as pe}from"./index.95128039.js";import{D as mn}from"./index.463930ae.js";import{S as it}from"./index.6b0b7b60.js";function ut(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ct(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ut(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ut(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var pn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7.5 1h9v3H22v2h-2.03l-.5 17H4.53l-.5-17H2V4h5.5V1zm2 3h5V3h-5v1zM6.03 6l.44 15h11.06l.44-15H6.03zM13 8v11h-2V8h2z"}}]},hn=Q({name:"DeleteIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=d(()=>t.size),{className:r,style:o}=ie(n),s=d(()=>["t-icon","t-icon-delete",r.value]),c=d(()=>ct(ct({},o.value),a.style)),i=d(()=>({class:s.value,style:c.value,onClick:v=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:v})}}));return()=>ue(pn,i.value)}});const _a=hn;function st(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function vt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?st(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):st(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var yn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M13 3v9.59l3.5-3.5 1.41 1.41L12 16.41 6.09 10.5 7.5 9.09l3.5 3.5V3h2zM4.5 14v5h15v-5h2v7h-19v-7h2z"}}]},bn=Q({name:"DownloadIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=d(()=>t.size),{className:r,style:o}=ie(n),s=d(()=>["t-icon","t-icon-download",r.value]),c=d(()=>vt(vt({},o.value),a.style)),i=d(()=>({class:s.value,style:c.value,onClick:v=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:v})}}));return()=>ue(yn,i.value)}});const On=bn;function dt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ft(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?dt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):dt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescripto
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var ur=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp)/i,cr=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp|.dwg|.dxf|.svf|.tif|.tiff|.arw)/i,sr=/(.pdf)/i,vr=/(.xlsx|.xls|.csv|.xlc|.xlm|.xlt|.xlw)/i,dr=/(.dox|docx|.document|.wps|.wdb|.msword)/i,fr=/(.ppt|.pptx|.key)/i,Sa=/(.avi|.mp4|.wmv|.mpg|.mpeg|.mov|.rm|.ram|.swf|.flv|.rmvb|.flash|.mid|.3gp)/i,gr=/(.mp2|.mp3|.mp4|.ogg|.3gpp|.ac3|.au)/i,Vt={"audio/*":gr,"video/*":Sa,"image/*":cr,".ico":/image\/vnd.microsoft.icon/i,".doc":/application\/msword/i,".docx":/application\/vnd.openxmlformats-officedocument.wordprocessingml.document/i,".xls":/application\/vnd.ms-excel/i,".xlsx":/application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet/i,".ppt":/application\/vnd.ms-powerpoint/i,".pptx":/application\/vnd.openxmlformats-officedocument.presentationml.presentation/i,".vsd":/application\/vnd.visio/i,".txt":/text\/plain/i,".abw":/application\/x-abiword/i,".avi":/video\/x-msvideo/i,".azw":/application\/vnd.amazon.ebook/i,".bin":/application\/octet-stream/i,".cda":/application\/x-cdf/i,".mpkg":/application\/vnd.apple.installer+xml/i,".odp":/application\/vnd.oasis.opendocument.presentation/i,".ods":/application\/vnd.oasis.opendocument.spreadsheet/i,".odt":/application\/vnd.oasis.opendocument.text/i,".oga":/audio\/ogg/i,".ogv":/video\/ogg/i,".ogx":/application\/ogg/i},me={B:1,KB:1024,MB:1048576,GB:1073741824};function mr(t){return t<me.KB?"".concat(t," Bytes"):t>=me.KB&&t<me.MB?"".concat((t/me.KB).toFixed(1)," KB"):t>=me.MB&&t<me.GB?"".concat((t/me.MB).toFixed(1)," MB"):t>=me.GB?"".concat((t/me.GB).toFixed(1)," GB"):""}function ja(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=new Date,a=e.getMonth()+1;a=a<10?"0".concat(a):a;var n="".concat(e.getFullYear(),"-").concat(a,"-").concat(e.getDate()),r="".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds());return t?[n,r].join(" "):n}function Ue(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:7,n=t,r=0,o=0;if(!n)return"";for(var s=0;s<n.length;s++){var c=n[s],i=escape(c).indexOf("%u")===0;s<e*2&&r<e?i?r+=1:r+=2:s>s-a&&o<a&&(i?o+=1:o+=2)}return n.replace(new RegExp("^(.{".concat(r,"})(.+)(.{").concat(o,"})$")),"$1\u2026$3")}function pr(t){return t<1024?"".concat(t," Bytes"):t>=1024&&t<1048576?"".concat((t/1024).toFixed(1)," KB"):t>=1048576?"".concat((t/1048576).toFixed(1)," MB"):""}function hr(t,e,a){var n=["B","KB","MB","GB"],r=1,o=n.indexOf(a);o===-1&&(we.warn("Upload","`sizeLimit.unit` can only be one of ".concat(n.join())),o=r);var s=me[a];return t>e*s}function yr(t){return new Promise(function(e){if(!t){e("");return}var a=new FileReader;a.readAsDataURL(t),a.onload=function(n){var r;e((r=n.target)===null||r===void 0?void 0:r.result)}})}function br(t,e,a){var n=e||a;if(!t)return!0;if(!n)return!1;for(var r=t.split(",").map(function(v){return v.trim()}),o=0,s=r.length;o<s;o++){var c=r[o];if(Vt[c]&&Vt[c].test(n))return!0;var i=new RegExp(c,"i");if(i.test(n))return!0}return!1}function xa(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],n=0;n<t.length;n++)br(e,t[n].type,t[n].name)&&a.push(t[n]);return a}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function qe(t){var e=Z("");return ve([t],function(a,n){var r=Pe(a,1),o=r[0],s=Pe(n,1),c=s[0];if(c!==o){if(typeof o=="string"){e.value=o;return}yr(o).then(function(i){e.value=i})}},{immediate:!0}),{previewUrl:e}}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var fe,Or=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow-y:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,wr=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function _r(t){if(!(typeof window>"u")){var e=window.getComputedStyle(t),a=e.getPropertyValue("box-sizing")||e.getPropertyValue("-moz-box-sizing")||e.getPropertyValue("-webkit-box-sizing"),n=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),r=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width")),o=wr.map(function(s){return"".concat(s,":").concat(e.getPropertyValue(s))}).join(";");return{sizingStyle:o,paddingSize:n,borderSize:r,boxSizing:a}}}function At(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;fe||(fe=document.createElement("textarea"),document.body.appendChild(fe));var n=_r(t),r=n.paddingSize,o=n.borderSize,s=n.boxSizing,c=n.sizingStyle;fe.setAttribute("style","".concat(c,";").concat(Or)),fe.value=t.value||t.placeholder||"";var i=fe.scrollHeight,v={};s==="border-box"?i+=o:s==="content-box"&&(i-=r),fe.value="";var u=fe.scrollHeight-r;if(e!==null){var g=u*e;s==="border-box"&&(g=g+r+o),i=Math.max(g,i),v.minHeight="".concat(g,"px")}if(a!==null){var y=u*a;s==="border-box"&&(y=y+r+o),i=Math.min(y,i)}return v.height="".concat(i,"px"),fe.parentNode&&fe.parentNode.removeChild(fe),fe=null,v}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Pr={allowInputOverMax:{type:Boolean,default:!1},autofocus:Boolean,autosize:{type:[Boolean,Object],default:!1},disabled:Boolean,maxcharacter:{type:Number},maxlength:{type:[Number,String]},name:{type:String,default:""},placeholder:{type:String,default:void 0},readonly:Boolean,status:{type:String,validator:function(e){return["default","success","warning","error"].includes(e)}},tips:{type:[String,Function]},value:{type:[String,Number]},modelValue:{type:[String,Number]},defaultValue:{type:[String,Number]},onBlur:Function,onChange:Function,onFocus:Function,onKeydown:Function,onKeypress:Function,onKeyup:Function,onValidate:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function Ht(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Cr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ht(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ht(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Kt(t){var e={};return Object.keys(t).forEach(function(a){Xa(t[a])||(e[a]=t[a])}),e}var Fr=Q({name:"TTextarea",inheritAttrs:!1,props:Cr({},Pr),setup:function(e,a){var n=a.attrs,r=a.expose,o=ge(),s=ge("textarea"),c=d(function(){return"".concat(s.value,"__tips")}),i=d(function(){return"".concat(s.value,"__limit")}),v=he(e),u=v.value,g=v.modelValue,y=Qe(u,g,e.defaultValue,e.onChange),m=Pe(y,2),C=m[0],R=m[1],w=ba(),M=Z({}),I=Z(),_=Z(!1),k=Z(!1),S=function(){var f;return(f=I.value)===null||f===void 0?void 0:f.focus()},b=function(){var f;return(f=I.value)===null||f===void 0?void 0:f.blur()},F=function(){var f;if(e.autosize===!0)M.value=At(I.value);else if(e.autosize&&Le(e.autosize)==="object"){var x=e.autosize,A=x.minRows,H=x.maxRows;M.value=At(I.value,A,H)}else n.rows?M.value={height:"auto",minHeight:"auto"}:n.style&&(f=I.value)!==null&&f!==void 0&&(f=f.style)!==null&&f!==void 0&&f.height&&(M.value={height:I.value.style.height})},j=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",x=I.value,A=String(f);!x||x.value!==A&&(x.value=A,C.value=A)},P=function(f){var x=f.target,A=x.value;if(e.maxcharacter&&e.maxcharacter>=0){var H=ot(A,e.maxcharacter);A=Le(H)==="object"&&H.characters}!k.value&&R(A,{e:f}),Ke(function(){return j(A)}),F()},h=function(f){P(f)},D=function(){k.value=!0},Y=function(f){k.value=!1,P(f)},ee=function(f,x){var A;if(!w.value){var H="on".concat(f[0].toUpperCase()).concat(f.slice(1));(A=e[H])===null||A===void 0||A.call(e,C.value,{e:x})}},X=function(f){ee("keydown",f)},T=function(f){ee("keyup",f)},N=function(f){ee("keypress",f)},B=function(f){var x;F(),!w.value&&(_.value=!0,(x=e.onFocus)===null||x===void 0||x.call(e,C.value,{e:f}))},V=La(Ka,void 0),p=function(f){var x;F(),_.value=!1,(x=e.onBlur)===null||x===void 0||x.call(e,C.value,{e:f}),V==null||V.handleBlur()},U=d(function(){return[s.value,q(q({},"".concat(o.value,"-is-disabled"),w.value),"".concat(o.value,"-is-readonly"),e.readonly)]}),$=d(function(){return Kt({autofocus:e.autofocus,disabled:w.value,readonly:e.readonly,placeholder:e.placeholder,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0})}),J=d(function(){var O=ot(String(C.value||""));return Le(O)==="object"?O.length:O}),W=d(function(){return{value:[void 0,null].includes(C.value)?void 0:String(C.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}),E=qa(W),z=E.tStatus;ve(function(){return C.value},function(){return F()}),ve(I,function(O){!O||F()}),ve(function(){return e.autofocus},function(O){O&&I.value.focus()}),ve(M,function(O){var f=n.style;un(I.value,pa(f,O))}),ve(C,function(){Ke(function(){return F()})}),ve(function(){return e.autosize},F,{deep:!0}),r({focus:S,blur:b}),Je(function(){F()});var L=de();return function(){var O,f=Kt({onFocus:B,onBlur:p,onKeydown:X,onKeyup:T,onKeypress:N}),x=ya(),A=x.STATUS,H=d(function(){return["".concat(s.value,"__inner"),q(q(q(q({},"".concat(o.value,"-is-").concat(z.value),z.value),A.value.disabled,w.value),A.value.focused,_.value),"".concat(o.value,"-resize-none"),Le(e.autosize)==="object"),"narrow-scrollbar"]}),K=L("tips"),ae=K&&l("div",{class:"".concat(c.value," ").concat(s.value,"__tips--").concat(e.status||"normal")},[K]),le=e.maxcharacter&&l("span",{class:i.value},["".concat(J.value,"/").concat(e.maxcharacter)])||!e.maxcharacter&&e.maxlength&&l("span",{class:i.value},["".concat(C.value?(O=String(C.value))===null||O===void 0?void 0:O.length:0,"/").concat(
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-28 22:52:55 +00:00
*/var $l=Se(Fr);/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Sr={alt:{type:String,default:""},error:{type:[String,Function]},fallback:{type:String,default:""},fit:{type:String,default:"fill",validator:function(e){return e?["contain","cover","fill","none","scale-down"].includes(e):!0}},gallery:Boolean,lazy:Boolean,loading:{type:[String,Function]},overlayContent:{type:[String,Function]},overlayTrigger:{type:String,default:"always",validator:function(e){return e?["always","hover"].includes(e):!0}},placeholder:{type:[String,Function]},position:{type:String,default:"center"},referrerpolicy:{type:String,default:"strict-origin-when-cross-origin",validator:function(e){return e?["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"].includes(e):!0}},shape:{type:String,default:"square",validator:function(e){return e?["circle","round","square"].includes(e):!0}},src:{type:[String,Object]},srcset:{type:Object},onError:Function,onLoad:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/var jr=Q({name:"TImage",props:Sr,setup:function(e){var a=Z(null),n=Z(null),r=null,o=he(e),s=o.src,c=de();Je(function(){var T;if((T=n.value)!==null&&T!==void 0&&T.complete&&!e.lazy&&I(),!(!e.lazy||!a.value)){var N=Ya(a.value,null,R,0);r=N}}),Ma(function(){a.value&&r&&r.unobserve(a.value)});var i=Ee("image"),v=i.classPrefix,u=i.globalConfig,g=Z(s.value);ve([s,u],function(T){var N=Pe(T,2),B=N[0],V=N[1],p=V||{},U=p.replaceImageSrc,$=_e(U)?U(e):B;$===g.value&&g.value||(g.value=$)},{immediate:!0});var y=qe(g),m=y.previewUrl;ve([m],function(){_.value=!1,w.value=!1});var C=Z(!e.lazy),R=function(){C.value=!0},w=Z(!1),M=function(N){var B;w.value=!0,(B=e.onLoad)===null||B===void 0||B.call(e,{e:N})},I=function(){var N=new Event("load");Object.defineProperty(N,"target",{value:n.value,enumerable:!0}),M(N)},_=Z(!1),k=function(N){var B;_.value=!0,(B=e.onError)===null||B===void 0||B.call(e,{e:N}),e.fallback&&(g.value=e.fallback,_.value=!1)},S=d(function(){return e.overlayTrigger==="hover"}),b=d(function(){return["".concat(v.value,"-image"),"".concat(v.value,"-image--fit-").concat(e.fit),"".concat(v.value,"-image--position-").concat(e.position)]}),F=Z(!S.value),j=function(){S.value&&(F.value=!F.value)},P=function(){var N=c("placeholder");return N?l("div",{class:"".concat(v.value,"-image__placeholder")},[N]):null},h=function(){return e.gallery?l("div",{class:"".concat(v.value,"-image__gallery-shadow")},null):null},D=function(){var N=X("overlayContent");return N?l("div",{class:["".concat(v.value,"-image__overlay-content"),!F.value&&"".concat(v.value,"-image__overlay-content--hidden")]},[N]):null};function Y(){return l("picture",null,[Object.entries(e.srcset).map(function(T){var N=Pe(T,2),B=N[0],V=N[1];return l("source",{type:B,srcset:V},null)}),ee()])}function ee(){var T=typeof g.value=="string"?g.value:m.value;return l("img",{ref:n,src:T,onError:k,onLoad:M,class:b.value,alt:e.alt,referrerpolicy:e.referrerpolicy},null)}var X=Aa();return function(){return l("div",re({ref:a,class:["".concat(v.value,"-image__wrapper"),"".concat(v.value,"-image__wrapper--shape-").concat(e.shape),e.gallery&&"".concat(v.value,"-image__wrapper--gallery"),S.value&&"".concat(v.value,"-image__wrapper--need-hover")],onMouseenter:j,onMouseleave:j},wa(e,["src","alt","fit","position","shape","placeholder","loading","error","overlayTrigger","overlayContent","lazy","gallery","onLoad","onError"])),[P(),h(),(_.value||!C.value)&&l("div",{class:"".concat(v.value,"-image")},null),!(_.value||!C.value)&&(e.srcset&&Object.keys(e.srcset).length?Y():ee()),!(_.value||!C.value)&&!w.value&&l("div",{class:"".concat(v.value,"-image__loading")},[c("loading")||l(it,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(Ca,{size:"24px"},null),typeof e.loading=="string"?e.loading:u.value.loadingText]}})]),_.value&&l("div",{class:"".concat(v.value,"-image__error")},[X("error",{defaultNode:l(it,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(Pa,{size:"24px"},null),typeof e.error=="string"?e.error:u.value.errorText]}})})]),D()])}}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var $e=Se(jr);/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Me={closeBtn:{type:[Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:!0},closeOnOverlay:Boolean,draggable:{type:Boolean,default:void 0},imageScale:{type:Object},images:{type:Array,default:function(){return[]}},index:{type:Number,default:void 0},defaultIndex:{type:Number,default:0},mode:{type:String,default:"modal",validator:function(e){return e?["modal","modeless"].includes(e):!0}},navigationArrow:{type:[Boolean,Function],default:!0},showOverlay:{type:Boolean,default:void 0},title:{type:[String,Function]},trigger:{type:[String,Function]},viewerScale:{type:Object},visible:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultVisible:Boolean,zIndex:{type:Number},onClose:Function,onIndexChange:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Oe=Q({name:"TImageModalIcon",props:{disabled:Boolean,onClick:Function,label:String,icon:Function},setup:function(e){var a=ge(),n=de(),r=d(function(){return["".concat(a.value,"-image-viewer__modal-icon"),q({},"".concat(a.value,"-is-disabled"),e.disabled)]});return function(){return l("div",{class:r.value,onClick:e.onClick},[n("icon"),e.label&&l("span",{class:"".concat(a.value,"-image-viewer__modal-icon-label")},[e.label])])}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function qt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function xr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?qt(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):qt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ir=function(e){var a,n,r,o=new Image,s=(e==null||(a=e.split)===null||a===void 0||(a=a.call(e,"?"))===null||a===void 0||(a=a[0])===null||a===void 0||(n=a.split)===null||n===void 0||(n=n.call(a,"#"))===null||n===void 0||(n=n[0])===null||n===void 0||(r=n.split)===null||r===void 0?void 0:r.call(n,"/").pop())||Math.random().toString(32).slice(2);o.setAttribute("crossOrigin","anonymous"),o.onload=function(){var c=document.createElement("canvas");c.width=o.width,c.height=o.height;var i=c.getContext("2d");i.drawImage(o,0,0,o.width,o.height),c.toBlob(function(v){var u=URL.createObjectURL(v),g=document.createElement("a");g.download=s,g.href=u,g.click(),g.remove(),URL.revokeObjectURL(u)})},o.src=e},Dr=function(e){return!!e&&!Be(e)&&!(e instanceof File)},Ur=function(e){return ha(e)?e.map(function(a){return Dr(a)?xr({download:!0,thumbnail:a.mainImage},a):{mainImage:a,thumbnail:a,download:!0}}):[]},Er=function(e){return e.showOverlay!==void 0?e.showOverlay:e.mode==="modal"};/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/var Ia=Q({name:"TImageViewerUtils",props:{scale:Number,onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,currentImage:{type:Object,default:function(){return{}}}},setup:function(e){var a=ge(),n=d(function(){return e.currentImage.mainImage}),r=qe(n),o=r.previewUrl,s=Ee("imageViewer"),c=s.globalConfig;return function(){return l("div",{class:"".concat(a.value,"-image-viewer__utils")},[l("div",{class:"".concat(a.value,"-image-viewer__utils-content")},[l(Ge,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.mirrorTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[l(Oe,{onClick:e.onMirror,icon:function(){return l(Vn,{size:"medium"},null)}},null)]}}),l(Ge,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.rotateTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[l(Oe,{onClick:e.onRotate,icon:function(){return l(Xn,{size:"medium"},null)}},null)]}}),l(Oe,{icon:function(){return l(ir,{size:"medium"},null)},onClick:e.onZoomOut},null),l(Oe,{class:"".concat(a.value,"-image-viewer__utils-scale"),size:"medium",label:"".concat(Ja(String(e.scale*100)),"%")},null),l(Oe,{icon:function(){return l(rr,{size:"medium"},null)},onClick:e.onZoomIn},null),l(Ge,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.originalSizeTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[l("div",{class:"".concat(a.value,"-image-viewer__modal-icon")},[l(Oe,{icon:function(){return l(Ca,{size:"medium"},null)},onClick:e.onReset},null)])]}}),e.currentImage.download&&l(Oe,{icon:function(){return l(On,{size:"medium"},null)},onClick:function(){Ir(o.value)}},null)])])}}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function Xt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function zr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Xt(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Xt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function kr(t){var e=Z(t),a=function(o){var s=o.pageX,c=o.pageY,i=e.value,v=i.translateX,u=i.translateY,g=function(C){var R=C.pageX,w=C.pageY;e.value={translateX:v+R-s,translateY:u+w-c}},y=function m(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",y)},n=function(){e.value=zr({},t)};return{transform:e,mouseDownHandler:a,resetTransform:n}}function Lr(){var t=Z(1),e=function(){t.value*=-1},a=function(){t.value=1};return{mirror:t,onMirror:e,resetMirror:a}}function Mr(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{max:2,min:.5,step:.5},e=t.max,a=t.min,n=t.step,r=t.defaultScale,o=Z(r!=null?r:1),s=function(){var g=Wa(o.value,n);v(g)},c=function(){var g=Qa(o.value,n);v(g)},i=function(){o.value=r!=null?r:1},v=function(g){var y=g;g<a&&(y=a),g>e&&(y=e),o.value=y};return ve(function(){return t},function(){return i()}),{scale:o,onZoomIn:s,onZoomOut:c,resetScale:i}}function Br(){var t=Z(0),e=90,a=function(){t.value+=e},n=function(){t.value=0};return{rotate:t,onRotate:a,resetRotate:n}}/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Da=Q({name:"TImageItem",props:{rotate:Number,scale:Number,mirror:Number,src:[String,Object],placementSrc:[String,Object]},setup:function(e){var a=he(e),n=a.src,r=a.placementSrc,o=ge(),s=Z(!1),c=Z(!1),i=kr({translateX:0,translateY:0}),v=i.transform,u=i.mouseDownHandler,g=Ee("imageViewer"),y=g.globalConfig,m=y.value.errorText,C=d(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:!e.placementSrc||c.value?"block":"none"}}),R=d(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:c.value?"none":"block"}}),w=d(function(){var b=v.value,F=b.translateX,j=b.translateY;return{transform:"translate(".concat(F,"px, ").concat(j,"px) scale(").concat(e.mirror,", 1)")}}),M=function(){s.value=!1,c.value=!1},I=qe(n),_=I.previewUrl,k=qe(r),S=k.previewUrl;return ve([_,S],function(){M()}),function(){return l("div",{class:"".concat(o.value,"-image-viewer__modal-pic")},[l("div",{class:"".concat(o.value,"-image-viewer__modal-box"),style:w.value},[s.value&&l("div",{class:"".concat(o.value,"-image-viewer__img-error")},[l("div",{class:"".concat(o.value,"-image-viewer__img-error-content")},[l(Pa,{size:"4em"},null),l("div",{class:"".concat(o.value,"-image-viewer__img-error-text")},[m])])]),!s.value&&!!e.placementSrc&&S.value&&l("img",{class:"".concat(o.value,"-image-viewer__modal-image"),onMousedown:function(F){F.stopPropagation(),u(F)},src:S.value,style:R.value,alt:"image",draggable:"false"},null),!s.value&&_.value&&l("img",{class:"".concat(o.value,"-image-viewer__modal-image"),onMousedown:function(F){F.stopPropagation(),u(F)},src:_.value,onLoad:function(){return c.value=!0},onError:function(){return s.value=!0},style:C.value,alt:"image",draggable:"false"},null)])])}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var $r=Q({name:"TImageViewerModal",props:{zIndex:Number,visible:Boolean,index:Number,images:Me.images,scale:Number,rotate:Number,mirror:Number,title:Me.title,currentImage:{type:Object,default:function(){return{}}},onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,onClose:Me.onClose,draggable:{type:Boolean,default:!0},viewerScale:{type:Object,default:function(){return{}}},showOverlay:Boolean,closeBtn:Me.closeBtn},setup:function(e){var a=ge(),n=de(),r=d(function(){return{minWidth:e.viewerScale.minWidth,minHeight:e.viewerScale.minHeight}});return function(){return l(mn,{destroyOnClose:!0,attach:"body",onClose:e.onClose,visible:e.visible,placement:"center",mode:"modeless",width:1e3,cancelBtn:null,confirmBtn:null,draggable:e.draggable,zIndex:e.zIndex,showOverlay:e.showOverlay,class:"".concat(a.value,"-image-viewer__dialog"),header:n("title",""),footer:function(){return l("div",{class:"".concat(a.value,"-image-viewer-mini__footer")},[l(Ia,{onZoomIn:e.onZoomIn,onZoomOut:e.onZoomOut,scale:e.scale,currentImage:e.currentImage,onRotate:e.onRotate,onMirror:e.onMirror,onReset:e.onReset},null)])}},{default:function(){return[l("div",{class:"".concat(a.value,"-image-viewer-mini__content"),style:r.value},[l(Da,{rotate:e.rotate,scale:e.scale,mirror:e.mirror,src:e.currentImage.mainImage,placementSrc:e.currentImage.thumbnail},null)])]}})}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var De=function(t){return t.left="ArrowLeft",t.up="ArrowUp",t.right="ArrowRight",t.down="ArrowDown",t.esc="Escape",t}(De||{});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function Zt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Tr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Zt(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Zt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Rr=Q({name:"TImageViewer",props:Tr({},Me),setup:function(e){var a,n=ge(),r=ge("image-viewer"),o=de(),s=Z(!0),c=d(function(){return Er(e)}),i=he(e),v=i.index,u=i.visible,g=i.modelValue,y=en(v,(a=e.defaultIndex)!==null&&a!==void 0?a:0,e.onIndexChange,"index"),m=Pe(y,2),C=m[0],R=m[1],w=Qe(u,g,e.defaultVisible,function(){},"visible"),M=Pe(w,2),I=M[0],_=M[1],k=Z(!0),S=Z(),b=d(function(){return[r.value,"".concat(r.value,"-preview-image"),q({},"".concat(n.value,"-is-hide"),!I.value)]}),F=d(function(){return["".concat(n.value,"-image-viewer__modal-header"),q({},"".concat(n.value,"-is-show"),s.value)]}),j=d(function(){var te;return(te=e.zIndex)!==null&&te!==void 0?te:2600}),P=function(){s.value=!s.value},h=Lr(),D=h.mirror,Y=h.onMirror,ee=h.resetMirror,X=Mr(e.imageScale),T=X.scale,N=X.onZoomIn,B=X.onZoomOut,V=X.resetScale,p=Br(),U=p.rotate,$=p.onRotate,J=p.resetRotate,W=function(){ee(),V(),J()},E=d(function(){return Ur(e.images)}),z=d(function(){var te;return(te=E.value[C.value])!==null&&te!==void 0?te:{mainImage:""}}),L=vn("dialog",{visible:I}),O=L.isLastDialog,f=function(){var G=C.value-1;W(),R(G<0?0:G,{trigger:"prev"})},x=function(){var G=C.value+1;W(),R(G>=E.value.length?C.value:G,{trigger:"next"})},A=function(G){R(G,{trigger:"current"})},H=function(){_(!0)},K=function(G){var ne;_(!1),(ne=e.onClose)===null||ne===void 0||ne.call(e,G)},ae=function(G){K({e:G,trigger:"close-btn"})},le=function(G){e.closeOnOverlay&&K({e:G,trigger:"overlay"})},ye=function(G){switch(G.stopPropagation(),G.code){case De.left:f();break;case De.right:x();break;case De.up:N();break;case De.down:B();break;case De.esc:e.closeOnEscKeydown&&O()&&K({e:G,trigger:"esc"});break}},Ce=Z();ve(function(){return I.value},function(te){clearTimeout(S.value),te?(k.value=!1,Ke().then(function(){var G,ne;(G=Ce.value)===null||G===void 0||(ne=G.focus)===null||ne===void 0||ne.call(G)}),W()):S.value=setTimeout(function(){k.value=!0},200)});var be=function(G){G.preventDefault();var ne=G.deltaY;ne>0?B():N()},je=d(function(){return{transform:"translateX(calc(-".concat(C.value," * (40px / 9 * 16 + 4px)))")}}),ze=function(){return l("div",{class:F.value},[l(Oe,{icon:function(){return l(tn,null,null)},class:"".concat(r.value,"__header-pre-bt"),onClick:P},null),l("div",{class:"".concat(r.value,"__header-prev")},[l("div",{class:"".concat(r.value,"__header-trans"),style:je.value},[E.value.map(function(G,ne){return l("div",{key:ne,class:["".concat(r.value,"__header-box"),q({},"".concat(n.value,"-is-active"),ne===C.value)]},[l($e,{src:G.thumbnail||G.mainImage,error:"",className:"".concat(r.value,"__header-img"),onClick:function(){return A(ne)}},null)])})])])])},xe=function(G){var ne=G==="prev"?0:180,Ie=o("navigationArrow",l(an,{style:{transform:"rotate(".concat(ne,"deg)")},size:"24px"},null));return l(Oe,{class:"".concat(r.value,"__modal-").concat(G,"-bt"),onClick:G==="prev"?f:x,icon:function(){return Ie}},null)},ke=function(){if(e.closeBtn!==!1)return l("div",{class:["".concat(r.value,"__modal-icon"),"".concat(r.value,"__modal-close-bt")],onClick:ae},[o("closeBtn",l(et,{size:"24px"},null))])};return function(){return e.mode==="modeless"?l(Fe,null,[o("trigger",{params:{open:H}}),l($r,{zIndex:j.value,visible:I.value,index:C.value,images:E.value,scale:T.value,rotate:U.value,mirror:D.value,currentImage:z.value,onRotate:$,onZoomIn:N,onZoomOut:B,onMirror:Y,onReset:W,onClose:K,draggable:e.draggable,showOverlay:c.value,title:e.title},null)]):l(Fe,null,[o("trigger",{params:{open:H}}),l(ma,{to:"body"},{default:function(){retur
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var nt=Se(Rr);/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Ua={asyncLoading:{type:[String,Function]},footer:{type:[String,Function]},header:{type:[String,Function]},layout:{type:String,default:"horizontal",validator:function(e){return e?["horizontal","vertical"].includes(e):!0}},scroll:{type:Object},size:{type:String,default:"medium",validator:function(e){return e?["small","medium","large"].includes(e):!0}},split:Boolean,stripe:Boolean,onLoadMore:Function,onScroll:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Ea=Q({name:"TListItem",props:Ua,setup:function(){var e=ge("list-item"),a=de();return function(){var n=a("content"),r=a("default"),o=a("action");return l("li",{class:e.value},[l("div",{class:"".concat(e.value,"-main")},[r||n,o&&l("li",{class:"".concat(e.value,"__action")},[o])])])}}});/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Gt="load-more",Nr="loading";/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function Yt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Jt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Yt(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Yt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Vr(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=Ar(t))||e&&t&&typeof t.length=="number"){a&&(t=a);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(v){throw v},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2024-06-30 15:21:13 +00:00
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,c;return{s:function(){a=a.call(t)},n:function(){var v=a.next();return o=v.done,v},e:function(v){s=!0,c=v},f:function(){try{!o&&a.return!=null&&a.return()}finally{if(s)throw c}}}}function Ar(t,e){if(!!t){if(typeof t=="string")return Wt(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Wt(t,e)}}function Wt(t,e){(e==null||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var Hr=function(){var e=gn(),a=d(function(){var n=[],r=e("ListItem");if(ha(r)){var o=Vr(r),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n.push(Jt(Jt({},c.props),{},{slots:c.children}))}}catch(i){o.e(i)}finally{o.f()}}return n});return{listItems:a}};/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/var Kr=function(e,a,n){var r=d(function(){return{data:n.value,scroll:e}}),o=nn(a,r),s=d(function(){return o.isVirtualScroll.value}),c=-1,i=function(y){var m=y.target||y.srcElement,C=m.scrollTop;c!==C?o.isVirtualScroll.value&&o.handleScroll():c=-1,c=C},v=d(function(){return{position:"absolute",width:"1px",height:"1px",transition:"transform 0.2s",transform:"translate(0, ".concat(o.scrollHeight.value,"px)"),"-ms-transform":"translate(0, ".concat(o.scrollHeight.value,"px)"),"-moz-transform":"translate(0, ".concat(o.scrollHeight.value,"px)"),"-webkit-transform":"translate(0, ".concat(o.scrollHeight.value,"px)")}}),u=d(function(){return{transform:"translate(0, ".concat(o.translateY.value,"px)"),"-ms-transform":"translate(0, ".concat(o.translateY.value,"px)"),"-moz-transform":"translate(0, ".concat(o.translateY.value,"px)"),"-webkit-transform":"translate(0, ".concat(o.translateY.value,"px)")}});return{virtualConfig:o,cursorStyle:v,listStyle:u,isVirtualScroll:s,onInnerVirtualScroll:i}};/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function Qt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function qr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Qt(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Qt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Xr=Q({name:"TList",props:qr({},Ua),setup:function(e){var a=Z(),n=Ee("list"),r=n.globalConfig,o=ge("list"),s=ya(),c=s.SIZE,i=de(),v=Hr(),u=v.listItems,g=Kr(e.scroll,a,u),y=g.virtualConfig,m=g.cursorStyle,C=g.listStyle,R=g.isVirtualScroll,w=g.onInnerVirtualScroll,M=d(function(){return["".concat(o.value),c.value[e.size],q(q(q({},"".concat(o.value,"--split"),e.split),"".concat(o.value,"--stripe"),e.stripe),"".concat(o.value,"--vertical-action"),e.layout==="vertical")]}),I=function(){var j=i("header"),P=i("footer"),h=y.isVirtualScroll.value;return l(Fe,null,[j?l("div",{class:"".concat(o.value,"__header")},[j]):null,h?l(Fe,null,[l("div",{style:m.value},null),l("ul",{class:"".concat(o.value,"__inner"),style:C.value},[y.visibleData.value.map(function(D){return l(Fe,null,[l(Ea,wa(D,"slots"),D.slots)])})])]):l("ul",{class:"".concat(o.value,"__inner")},[i("default")]),P?l("div",{class:"".concat(o.value,"__footer")},[P]):null])},_=function(j){var P,h=j.target,D=h.scrollTop,Y=h.scrollHeight,ee=h.clientHeight;R.value&&w(j),(P=e.onScroll)===null||P===void 0||P.call(e,{e:j,scrollTop:D,scrollBottom:Y-ee-D})},k=d(function(){return Be(e.asyncLoading)&&["loading","load-more"].includes(e.asyncLoading)?"".concat(o.value,"__load ").concat(o.value,"__load--").concat(e.asyncLoading):"".concat(o.value,"__load")}),S=function(){if(e.asyncLoading&&Be(e.asyncLoading)){if(e.asyncLoading===Nr)return l("div",null,[l(Re,null,null),l("span",null,[r.value.loadingText])]);if(e.asyncLoading===Gt)return l("span",null,[r.value.loadingMoreText])}return i("asyncLoading")},b=function(j){var P;Be(e.asyncLoading)&&e.asyncLoading!==Gt||(P=e.onLoadMore)===null||P===void 0||P.call(e,{e:j})};return{COMPONENT_NAME:o,listClass:M,loadingClass:k,renderLoading:S,renderContent:I,handleScroll:_,handleLoadMore:b,listRef:a,isVirtualScroll:R}},render:function(){var e=this.renderContent();return e=[e,l("div",{class:this.loadingClass,onClick:this.handleLoadMore},[this.renderLoading()])],l("div",{class:this.listClass,onScroll:this.handleScroll,ref:"listRef"},[e])}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Zr={avatar:{type:[String,Function]},description:{type:[String,Function]},image:{type:[String,Function]},title:{type:[String,Function]}};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/var Gr=Q({name:"TListItemMeta",props:Zr,setup:function(e,a){var n=ge("list-item__meta"),r=Xe(),o=de(),s=function(){(e.avatar||a.slots.avatar)&&console.warn("`avatar` is going to be deprecated, please use `image` instead");var i=r("avatar","image");if(!!i)return Be(i)?l("div",{class:"".concat(n.value,"-avatar")},[l("img",{src:i},null)]):l("div",{class:"".concat(n.value,"-avatar")},[i])};return function(){var c=o("title"),i=o("description"),v=[s(),l("div",{class:"".concat(n.value,"-content")},[c&&l("h3",{class:"".concat(n.value,"-title")},[c]),i&&l("p",{class:"".concat(n.value,"-description")},[i])])];return l("div",{class:n.value},[v])}}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-28 22:52:55 +00:00
*/var Tl=Se(Xr),Rl=Se(Ea);Se(Gr);/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Yr={attach:{type:[String,Function],default:""},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function],default:""},closeBtn:{type:[Boolean,String,Function]},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function],default:""},default:{type:[String,Function]},destroyOnClose:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"overlay",validator:function(e){return e?["overlay","push"].includes(e):!0}},placement:{type:String,default:"right",validator:function(e){return e?["left","right","top","bottom"].includes(e):!0}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},size:{type:String,default:void 0},sizeDraggable:Boolean,visible:Boolean,zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onConfirm:Function,onEscKeydown:Function,onOverlayClick:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Jr=function(e){var a=Z(!1),n=Z(null),r=function(){document.addEventListener("mouseup",o,!0),document.addEventListener("mousemove",s,!0),a.value=!0},o=function i(){document.removeEventListener("mouseup",i,!0),document.removeEventListener("mousemove",s,!0),a.value=!1},s=function(v){var u=v.x,g=v.y,y=document.documentElement.clientHeight,m=document.documentElement.clientWidth,C=8,R=8;if(a.value&&e.sizeDraggable){if(e.placement==="right"){var w=Math.min(Math.max(m-u+R,R),m);n.value="".concat(w,"px")}if(e.placement==="left"){var M=Math.min(Math.max(u+R,R),m);n.value="".concat(M,"px")}if(e.placement==="top"){var I=Math.min(Math.max(g+C,C),y);n.value="".concat(I,"px")}if(e.placement==="bottom"){var _=Math.min(Math.max(y-g+C,C),y);n.value="".concat(_,"px")}}},c=d(function(){var i=["right","left"].includes(e.placement),v={left:"right",right:"left",top:"bottom",bottom:"top"};return q(q(q(q({zIndex:1,position:"absolute",background:"transparent"},v[e.placement],0),"width",i?"16px":"100%"),"height",i?"100%":"16px"),"cursor",i?"col-resize":"row-resize")});return{draggedSizeValue:n,enableDrag:r,draggableLineStyles:c}};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/var Wr=1,Qr=Q({name:"TDrawer",inheritAttrs:!1,props:Yr,emits:["update:visible"],setup:function(e,a){var n=Z(!1),r=Z(!1),o=Z(),s=Z(),c=Ee("drawer"),i=c.globalConfig,v=Te({CloseIcon:et}),u=v.CloseIcon,g=de(),y=Xe(),m=ge("drawer"),C=Jr(e),R=C.draggedSizeValue,w=C.enableDrag,M=C.draggableLineStyles,I=cn(function(){return e.attach}),_=function(z){var L;(L=e.onConfirm)===null||L===void 0||L.call(e,{e:z})},k=function(z){var L;(L=e.onCancel)===null||L===void 0||L.call(e,{e:z}),W({trigger:"cancel",e:z})},S=dn({confirmBtnAction:_,cancelBtnAction:k}),b=S.getConfirmBtn,F=S.getCancelBtn,j=Z(null),P=d(function(){return[m.value,"".concat(m.value,"--").concat(e.placement),q(q(q({},"".concat(m.value,"--open"),r.value),"".concat(m.value,"--attach"),e.showInAttachedElement),"".concat(m.value,"--without-mask"),!e.showOverlay)]}),h=d(function(){var E;if(R.value)return R.value;var z=(E=e.size)!==null&&E!==void 0?E:i.value.size,L=isNaN(Number(z))?z:"".concat(z,"px");return{small:"300px",medium:"500px",large:"760px"}[z]||L}),D=d(function(){return{transform:r.value?"translateX(0)":void 0,width:["left","right"].includes(e.placement)?h.value:"",height:["top","bottom"].includes(e.placement)?h.value:""}}),Y=d(function(){return["".concat(m.value,"__content-wrapper"),"".concat(m.value,"__content-wrapper--").concat(e.placement)]}),ee=d(function(){return j.value&&j.value.parentNode}),X=d(function(){return[e.mode,e.placement].join()}),T=d(function(){return{display:"flex",justifyContent:e.placement==="right"?"flex-start":"flex-end"}}),N=function(z){var L;if(((L=e.closeOnEscKeydown)!==null&&L!==void 0?L:i.value.closeOnEscKeydown)&&z.key==="Escape"&&r.value){var O;(O=e.onEscKeydown)===null||O===void 0||O.call(e,{e:z}),W({trigger:"esc",e:z})}},B=function(){clearTimeout(s.value),s.value=setTimeout(function(){var z,L;(z=o.value)===null||z===void 0||(z=z.parentNode)===null||z===void 0||(L=z.removeChild)===null||L===void 0||L.call(z,o.value)},150)},V=function(){e.mode==="push"&&Ke(function(){!ee.value||(ee.value.style.cssText="transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;")})},p=function(){if(!!ee.value&&!(e.mode!=="push"||!ee.value)){var z={left:"margin: 0 0 0 ".concat(h.value),right:"margin: 0 0 0 -".concat(h.value),top:"margin: ".concat(h.value," 0 0 0"),bottom:"margin: -".concat(h.value," 0 0 0")}[e.placement];r.value?ee.value.style.cssText+=z:ee.value.style.cssText=ee.value.style.cssText.replace(/margin:.+;/,"")}},U=function(){var z=b({confirmBtn:e.confirmBtn,globalConfirm:i.value.confirm,className:"".concat(m.value,"__confirm")}),L=F({cancelBtn:e.cancelBtn,globalCancel:i.value.cancel,className:"".concat(m.value,"__cancel")});return l("div",{style:T.value},[e.placement==="right"?z:null,L,e.placement!=="right"?z:null])};ve(X,function(){V()},{immediate:!0}),ve(function(){return e.visible},function(E){sn||(E?!e.showInAttachedElement&&e.preventScrollThrough&&o.value&&document.head.appendChild(o.value):B(),e.destroyOnClose?E?(n.value=!1,setTimeout(function(){r.value=!0})):(r.value=!1,setTimeout(function(){n.value=!0},200)):n.value===!0&&E?(n.value=!1,setTimeout(function(){r.value=!0})):r.value=E)},{immediate:!0});var $=function(z){var L;(L=e.onCloseBtnClick)===null||L===void 0||L.call(e,{e:z}),W({trigger:"close-btn",e:z})},J=function(z){var L,O;(L=e.onOverlayClick)===null||L===void 0||L.call(e,{e:z}),((O=e.closeOnOverlayClick)!==null&&O!==void 0?O:i.value.closeOnOverlayClick)&&W({trigger:"overlay",e:z})},W=function(z){var L;(L=e.onClose)===null||L===void 0||L.call(e,z),a.emit("update:visible",!1)};return Ra(function(){p()}),Je(function(){var E=document.documentElement.scrollHeight>document.documentElement.clientHeight,z=E?fn():0;o.value=document.createElement("style"),o.value.dataset.id="td_drawer_".concat(+new Date,"_").concat(Wr+=1),o.value.innerHTML=`
2024-06-15 00:08:13 +00:00
html body {
overflow-y: hidden;
transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;
`.concat(e.mode==="push"?"":"width: calc(100% - ".concat(z,"px);"),`
}
2024-06-30 15:21:13 +00:00
`),r.value&&!e.showInAttachedElement&&e.preventScrollThrough&&document.head.appendChild(o.value),window.addEventListener("keydown",N)}),Na(function(){B(),window.removeEventListener("keydown",N)}),function(){if(!n.value){var E=y("body","default"),z=g("header"),L=U();return l(ma,{disabled:!e.attach||!I.value,to:I.value},{default:function(){return[l("div",re({ref:j,class:P.value,style:{zIndex:e.zIndex},onKeydown:N,tabindex:0},a.attrs),[e.showOverlay&&l("div",{class:"".concat(m.value,"__mask"),onClick:J},null),l("div",{class:Y.value,style:D.value},[z&&l("div",{class:"".concat(m.value,"__header")},[z]),e.closeBtn&&l("div",{class:"".concat(m.value,"__close-btn"),onClick:$},[g("closeBtn",l(u,null,null))]),l("div",{class:["".concat(m.value,"__body"),"narrow-scrollbar"]},[E]),e.footer&&l("div",{class:"".concat(m.value,"__footer")},[g("footer",L)]),e.sizeDraggable&&l("div",{style:M.value,onMousedown:w},null)])])]}})}}}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-28 22:52:55 +00:00
*/var Nl=Se(Qr);/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var el={abridgeName:{type:Array},accept:{type:String,default:""},action:{type:String,default:""},allowUploadDuplicateFile:Boolean,autoUpload:{type:Boolean,default:!0},beforeAllFilesUpload:{type:Function},beforeUpload:{type:Function},cancelUploadButton:{type:[Object,Function]},data:{type:Object},default:{type:[String,Function]},disabled:Boolean,dragContent:{type:[String,Function]},draggable:{type:Boolean,default:void 0},fileListDisplay:{type:Function},files:{type:Array,default:void 0},defaultFiles:{type:Array,default:function(){return[]}},format:{type:Function},formatRequest:{type:Function},formatResponse:{type:Function},headers:{type:Object},imageViewerProps:{type:Object},inputAttributes:{type:Object},isBatchUpload:Boolean,locale:{type:Object},max:{type:Number,default:0},method:{type:String,default:"POST",validator:function(e){return e?["POST","GET","PUT","OPTION","PATCH","post","get","put","option","patch"].includes(e):!0}},mockProgressDuration:{type:Number},multiple:Boolean,name:{type:String,default:"file"},placeholder:{type:String,default:""},requestMethod:{type:Function},showImageFileName:{type:Boolean,default:!0},showThumbnail:Boolean,showUploadProgress:{type:Boolean,default:!0},sizeLimit:{type:[Number,Object]},status:{type:String,validator:function(e){return e?["default","success","warning","error"].includes(e):!0}},theme:{type:String,default:"file",validator:function(e){return e?["custom","file","file-input","file-flow","image","image-flow"].includes(e):!0}},tips:{type:[String,Function]},trigger:{type:Function},triggerButtonProps:{type:Object},uploadAllFilesInOneRequest:Boolean,uploadButton:{type:[Object,Function]},uploadPastedFiles:{type:Boolean,default:!0},useMockProgress:{type:Boolean,default:!0},value:{type:Array,default:void 0},modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:function(){return[]}},withCredentials:Boolean,onCancelUpload:Function,onChange:Function,onDragenter:Function,onDragleave:Function,onDrop:Function,onFail:Function,onOneFileFail:Function,onOneFileSuccess:Function,onPreview:Function,onProgress:Function,onRemove:Function,onSelectChange:Function,onSuccess:Function,onValidate:Function,onWaitingUploadFilesChange:Function};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/var Ne={accept:String,files:Array,toUploadFiles:Array,displayFiles:Array,theme:String,abridgeName:Array,placeholder:String,classPrefix:String,tips:[String,Function],status:String,locale:Object,sizeOverLimitMessage:String,autoUpload:Boolean,uploadPastedFiles:Boolean,onPasteFileChange:Function,disabled:Boolean,uploading:Boolean,tipsClasses:[String,Array,Object],errorClasses:[String,Array,Object],placeholderClass:[String,Array,Object],showUploadProgress:Boolean,default:Function,fileListDisplay:Function,onRemove:Function,imageViewerProps:Object};/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function ea(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function tl(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ea(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function al(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!We(t)}var nl=Q({name:"UploadNormalFile",props:tl({multiple:Boolean},Ne),setup:function(e,a){var n=a.slots,r=he(e),o=r.theme,s=r.disabled,c=r.classPrefix,i=d(function(){return e.locale}),v=Te({CloseIcon:et,TimeFilledIcon:Fa,CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:Ze,CloseCircleFilledIcon:Za}),u=v.CloseIcon,g=v.TimeFilledIcon,y=v.CheckCircleFilledIcon,m=v.ErrorCircleFilledIcon,C=v.CloseCircleFilledIcon,R=de(),w="".concat(c.value,"-upload"),M=function(S){return l("div",{class:"".concat(w,"__single-progress")},[l(Re,null,null),e.showUploadProgress&&l("span",{class:"".concat(w,"__single-percent")},[S||0,"%"])])},I=function(S){var b;return o.value!=="file"||!e.multiple&&((b=S[0])===null||b===void 0?void 0:b.status)==="fail"&&e.autoUpload?null:S.map(function(F,j){var P=e.abridgeName&&F.name?Ue.apply(void 0,[F.name].concat(oe(e.abridgeName))):F.name;return l("div",{class:"".concat(w,"__single-display-text ").concat(w,"__display-text--margin"),key:F.name+j+F.percent+F.status},[F.url?l(at,{href:F.url,target:"_blank",hover:"color",size:"small",class:"".concat(w,"__single-name")},al(P)?P:{default:function(){return[P]}}):l("span",{class:"".concat(w,"__single-name")},[P]),F.status==="fail"&&l("div",{class:"".concat(w,"__flow-status ").concat(w,"__file-fail")},[l(m,null,null)]),F.status==="waiting"&&l("div",{class:"".concat(w,"__flow-status ").concat(w,"__file-waiting")},[l(g,null,null)]),F.status==="progress"&&M(F.percent),!s.value&&F.status!=="progress"&&l(u,{class:"".concat(w,"__icon-delete"),onClick:function(D){var Y=D.e;return e.onRemove({e:Y,file:F,index:j})}},null)])})},_=function(){var S;if(o.value==="file-input"){var b=e.displayFiles[0]||[],F=["".concat(c.value,"-input__inner"),q({},"".concat(w,"__placeholder"),!e.displayFiles[0])],j=s.value?"".concat(c.value,"-is-disabled"):"",P=(S=e.abridgeName)!==null&&S!==void 0&&S.length&&b!==null&&b!==void 0&&b.name?Ue.apply(void 0,[b.name].concat(oe(e.abridgeName))):b==null?void 0:b.name;return l("div",{class:"".concat(w,"__single-input-preview ").concat(c.value,"-input ").concat(j)},[l("div",{class:F},[l("span",{class:["".concat(w,"__single-input-text"),q({},e.placeholderClass,e.placeholder&&!(b!=null&&b.name))]},[b!=null&&b.name?P:e.placeholder]),(b==null?void 0:b.status)==="progress"&&M(b.percent),(b==null?void 0:b.status)==="waiting"&&l(g,{class:"".concat(w,"__status-icon ").concat(w,"__file-waiting")},null),b.status==="success"&&l(y,{class:"".concat(w,"__status-icon")},null),(b==null?void 0:b.name)&&b.status==="fail"&&l(m,{class:"".concat(w,"__status-icon ").concat(w,"__file-fail")},null),Boolean(!s.value&&b.name)&&l(C,{class:"".concat(w,"__single-input-clear"),onClick:function(D){var Y=D.e;return e.onRemove({e:Y,file:b,index:0})}},null)])])}};return function(){var k,S,b,F=["".concat(w,"__single"),"".concat(w,"__single-").concat(o.value)],j=R("fileListDisplay",{params:{onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles}});(e.fileListDisplay===null||j===null)&&(j=null);var P=e.displayFiles;return l("div",{class:F},[o.value==="file-input"&&_(),(k=n.default)===null||k===void 0?void 0:k.call(n),o.value==="file"&&e.placeholder&&!P[0]&&l("small",{class:[e.tipsClasses,e.placeholderClass]},[e.placeholder]),j===null?null:j||I(P),!e.multiple&&((S=P[0])===null||S===void 0?void 0:S.status)==="fail"&&o.value==="file"?l("small",{class:[e.errorCla
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function rt(t,e){var a=Z(null),n=Z(!1),r=function(v){var u;v.preventDefault(),n.value=!1;var g=v.dataTransfer.files,y=xa(g,e.value);if((u=t.onDrop)===null||u===void 0||u.call(t,{e:v}),y!=null&&y.length){var m;(m=t.onDragFileChange)===null||m===void 0||m.call(t,y)}},o=function(v){var u;v.preventDefault(),a.value=v.target,(u=t.onDragenter)===null||u===void 0||u.call(t,{e:v}),n.value=!0},s=function(v){var u;v.target===a.value&&(v.preventDefault(),(u=t.onDragleave)===null||u===void 0||u.call(t,{e:v}),n.value=!1)},c=function(v){v.preventDefault()};return{target:a,dragActive:n,handleDrop:r,handleDragenter:o,handleDragleave:s,handleDragover:c}}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function ta(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function aa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ta(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var rl=Q({name:"UploadDraggerFile",props:aa(aa({},Ne),{},{trigger:Function,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,dragEvents:Object}),setup:function(e,a){var n=a.slots,r=he(e),o=r.displayFiles,s=r.disabled,c=r.accept,i=d(function(){return e.locale}),v=de(),u=rn(),g=u.sizeClassNames,y="".concat(e.classPrefix,"-upload"),m=rt(e.dragEvents,c),C=m.dragActive,R=Z(),w=d(function(){var P;return["".concat(y,"__dragger"),q({},"".concat(y,"__dragger-center"),!o.value[0]),q({},"".concat(y,"__dragger-error"),((P=o.value[0])===null||P===void 0?void 0:P.status)==="fail")]}),M=Te({CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:Ze}),I=M.CheckCircleFilledIcon,_=M.ErrorCircleFilledIcon,k=function(){var h;if(!!e.displayFiles.length){var D=o.value[0];if(!D)return null;var Y=(D==null?void 0:D.url)||(D==null||(h=D.response)===null||h===void 0?void 0:h.url);return l("div",{class:"".concat(y,"__dragger-img-wrap")},[l(nt,re({images:[Y],trigger:function(X,T){var N=T.open;return l($e,{src:Y||D.raw,onClick:N,error:"",loading:""},null)}},e.imageViewerProps),null)])}},S=function(){if(!!e.displayFiles.length){var h=o.value[0];if(!h)return null;if((h==null?void 0:h.status)==="progress")return l("div",{class:"".concat(y,"__single-progress")},[l(Re,null,null),e.showUploadProgress&&l("span",{class:"".concat(y,"__single-percent")},[h.percent,"%"])])}},b=function(){var h,D=o.value[0],Y=e.abridgeName?Ue.apply(void 0,[D.name].concat(oe(e.abridgeName))):D.name,ee=[l("div",{class:"".concat(y,"__dragger-text"),key:"info"},[l("span",{class:"".concat(y,"__single-name")},[Y]),D.status==="progress"&&S(),D.status==="success"&&l(I,null,null),D.status==="fail"&&l(_,null,null)]),l("small",{class:"".concat(g.small),key:"size"},[i.value.file.fileSizeText,"\uFF1A",pr(D.size)]),l("small",{class:"".concat(g.small),key:"time"},[i.value.file.fileOperationDateText,"\uFF1A",D.uploadTime||"-"])];return l("div",{class:"".concat(y,"__dragger-progress")},[e.theme==="image"&&k(),l("div",{class:"".concat(y,"__dragger-progress-info")},[v("fileListDisplay",{params:{files:e.displayFiles}})||ee,l("div",{class:"".concat(y,"__dragger-btns")},[["progress","waiting"].includes(D.status)&&!s.value&&l(pe,{theme:"primary",variant:"text",class:"".concat(y,"__dragger-progress-cancel"),onClick:function(T){var N;return(N=e.cancelUpload)===null||N===void 0?void 0:N.call(e,{e:T,file:e.toUploadFiles[0]||e.files[0]})}},{default:function(){return[(h=i.value)===null||h===void 0?void 0:h.cancelUploadText]}}),!e.autoUpload&&D.status==="waiting"&&l(pe,{theme:"primary",variant:"text",disabled:s.value,onClick:function(){var T;return(T=e.uploadFiles)===null||T===void 0?void 0:T.call(e)},class:"".concat(y,"__dragger-upload-btn")},{default:function(){return[i.value.triggerUploadText.normal]}})]),["fail","success"].includes(D==null?void 0:D.status)&&!s.value&&l("div",{class:"".concat(y,"__dragger-btns")},[l(pe,{theme:"primary",variant:"text",disabled:s.value,class:"".concat(y,"__dragger-progress-cancel"),onClick:e.triggerUpload},{default:function(){return[i.value.triggerUploadText.reupload]}}),l(pe,{theme:"danger",variant:"text",disabled:s.value,class:"".concat(y,"__dragger-delete-btn"),onClick:function(T){return e.onRemove({e:T,index:0,file:D})}},{default:function(){return[i.value.triggerUploadText.delete]}})])])])},F=function(){var h,D=l("div",null,[l("span",{class:"".concat(y,"--highlight")},[(h=i.value.triggerUploadText)===null||h===void 0?void 0:h.normal]),l("span",null,["\xA0\xA0/\xA0\xA0",i.value.dragger.draggingText
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function na(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ra(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?na(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):na(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ll(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!We(t)}var ol=Q({name:"UploadImageCard",props:ra(ra({},Ne),{},{multiple:Boolean,max:Number,disabled:Boolean,showUploadProgress:Boolean,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,onPreview:Function,showImageFileName:Boolean}),setup:function(e){var a=he(e),n=a.displayFiles,r=a.classPrefix,o=a.multiple,s=a.max,c=d(function(){return e.locale}),i=Te({AddIcon:ln,BrowseIcon:Oa,DeleteIcon:_a,ErrorCircleFilledIcon:Ze}),v=i.BrowseIcon,u=i.DeleteIcon,g=i.AddIcon,y=i.ErrorCircleFilledIcon,m=de(),C=d(function(){var I;return o.value?!s.value||n.value.length<s.value:!((I=n.value)!==null&&I!==void 0&&I[0])}),R=function(_,k){return l("div",{class:"".concat(r.value,"-upload__card-content ").concat(r.value,"-upload__card-box")},[l($e,{class:"".concat(r.value,"-upload__card-image"),src:_.url||_.raw,error:""},null),l("div",{class:"".concat(r.value,"-upload__card-mask")},[l("span",{class:"".concat(r.value,"-upload__card-mask-item"),onClick:function(b){return b.stopPropagation()}},[l(nt,re({images:n.value.map(function(S){return S.url||S.raw}),defaultIndex:k,trigger:function(b,F){var j=F.open;return l(v,{onClick:function(h){var D,Y=h.e;(D=e.onPreview)===null||D===void 0||D.call(e,{file:_,index:k,e:Y}),j()}},null)}},e.imageViewerProps),null)]),!e.disabled&&l(Fe,null,[l("span",{class:"".concat(r.value,"-upload__card-mask-item-divider")},null),l("span",{class:"".concat(r.value,"-upload__card-mask-item"),onClick:function(b){return b.stopPropagation()}},[l(u,{onClick:function(b){var F,j=b.e;return e==null||(F=e.onRemove)===null||F===void 0?void 0:F.call(e,{e:j,file:_,index:k})}},null)])])])])},w=function(_,k){var S;return l("div",{class:[k,"".concat(r.value,"-upload__").concat(e.theme,"-").concat(_.status)]},[l(Re,{loading:!0,size:"medium"},null),l("p",null,[(S=c.value)===null||S===void 0||(S=S.progress)===null||S===void 0?void 0:S.uploadingText,e.showUploadProgress?" ".concat(_.percent,"%"):""])])},M=function(_,k,S){var b,F;return l("div",{class:S},[l(y,null,null),l("p",null,[((b=_.response)===null||b===void 0?void 0:b.error)||((F=c.value)===null||F===void 0||(F=F.progress)===null||F===void 0?void 0:F.failText)]),l("div",{class:"".concat(r.value,"-upload__card-mask")},[l("span",{class:"".concat(r.value,"-upload__card-mask-item"),onClick:function(P){return P.stopPropagation()}},[l(u,{onClick:function(P){var h,D=P.e;return e==null||(h=e.onRemove)===null||h===void 0?void 0:h.call(e,{e:D,file:_,index:k})}},null)])])])};return function(){var I,_,k=m("fileListDisplay",{params:{triggerUpload:e.triggerUpload,uploadFiles:e.uploadFiles,cancelUpload:e.cancelUpload,onPreview:e.onPreview,onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:n.value}});if(k)return k;var S="".concat(r.value,"-upload__card-item ").concat(r.value,"-is-background");return l("div",null,[l("ul",{class:"".concat(r.value,"-upload__card")},[(I=n.value)===null||I===void 0?void 0:I.map(function(b,F){var j="".concat(r.value,"-upload__card-name"),P="".concat(r.value,"-upload__card-container ").concat(r.value,"-upload__card-box"),h=e.abridgeName?Ue.apply(void 0,[b.name].concat(oe(e.abridgeName))):b.name;return l("li",{class:S,key:F},[b.status==="progress"&&w(b,P),b.status==="fail"&&M(b,F,P),!["progress","fail"].includes(b.status)&&R(b,F),Boolean(h&&e.showImageFileName)&&(b.url?l(at,{href:b.url,class:j,target:"_blank",hover:"color",size:"small"},l
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function la(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function oa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?la(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):la(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function il(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!We(t)}var ul=Q({name:"UploadMultipleFlowList",props:oa(oa({},Ne),{},{showThumbnail:Boolean,uploadFiles:Function,cancelUpload:Function,dragEvents:Object,disabled:Boolean,isBatchUpload:Boolean,draggable:Boolean,showImageFileName:Boolean,uploadButton:Object,cancelUploadButton:Object,onPreview:Function}),setup:function(e,a){var n=a.slots,r=he(e),o=r.uploading,s=r.disabled,c=r.displayFiles,i=r.classPrefix,v=r.accept,u=d(function(){return"".concat(i.value,"-upload")}),g=d(function(){return e.locale}),y=de(),m=Te({BrowseIcon:Oa,DeleteIcon:_a,CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:Ze,TimeFilledIcon:Fa}),C=m.BrowseIcon,R=m.DeleteIcon,w=m.CheckCircleFilledIcon,M=m.ErrorCircleFilledIcon,I=m.TimeFilledIcon,_=rt(e.dragEvents,v),k=Z([]),S=Z(0),b=d(function(){return o.value?"".concat(g.value.progress.uploadingText):g.value.triggerUploadText.normal}),F=d(function(){var V=e.draggable===void 0?!0:e.draggable;return V?{onDrop:_.handleDrop,onDragenter:_.handleDragenter,onDragover:_.handleDragover,onDragleave:_.handleDragleave}:{}}),j=function(){var p={success:l(w,null,null),fail:l(M,null,null),progress:l(Re,null,null),waiting:l(I,null,null)},U=g.value.progress,$={success:U==null?void 0:U.successText,fail:U==null?void 0:U.failText,progress:U==null?void 0:U.uploadingText,waiting:U==null?void 0:U.waitingText};return{iconMap:p,textMap:$}},P=function(){return l("div",{class:"".concat(u.value,"__flow-empty")},[_.dragActive.value?g.value.dragger.dragDropText:g.value.dragger.clickAndDragText])},h=function(p,U){var $=j(),J=$.iconMap,W=$.textMap,E=e.abridgeName&&p.name?Ue.apply(void 0,[p.name].concat(oe(e.abridgeName))):p.name;return l("li",{class:"".concat(u.value,"__card-item"),key:p.name+U+p.percent+p.status||"0"},[l("div",{class:["".concat(u.value,"__card-content"),q({},"".concat(i.value,"-is-bordered"),p.status!=="waiting")]},[["fail","progress"].includes(p.status)&&l("div",{class:"".concat(u.value,"__card-status-wrap ").concat(u.value,"__").concat(e.theme,"-").concat(p.status)},[J[p.status],l("p",null,[W[p.status],e.showUploadProgress&&p.status==="progress"?" ".concat(p.percent,"%"):""])]),(["waiting","success"].includes(p.status)||!p.status&&p.url)&&l($e,{class:"".concat(u.value,"__card-image"),src:p.url||p.raw,error:"",loading:""},null),l("div",{class:"".concat(u.value,"__card-mask")},[(p.url||p.raw)&&!["progress","fail"].includes(p.status)&&l("span",{class:"".concat(u.value,"__card-mask-item")},[l(C,{onClick:function(L){var O,f=L.e;S.value=U,k.value=c.value,(O=e.onPreview)===null||O===void 0||O.call(e,{file:p,index:U,e:f})}},null),l("span",{class:"".concat(u.value,"__card-mask-item-divider")},null)]),!s.value&&l("span",{class:"".concat(u.value,"__card-mask-item ").concat(u.value,"__delete"),onClick:function(L){return e.onRemove({e:L,index:U,file:p})}},[l(R,null,null)])])]),e.showImageFileName&&l("p",{class:["".concat(u.value,"__card-name"),"".concat(u.value,"__flow-status")]},[["success","waiting"].includes(p.status)&&J[p.status],E])])},D=function(p){var U,$,J=j(),W=J.iconMap,E=J.textMap;return l("div",{class:"".concat(u.value,"__flow-status")},[W[p.status],l("span",{class:"".concat(u.value,"__").concat(e.theme,"-").concat(p.status)},[(U=p.response)!==null&&U!==void 0&&U.error&&(($=p.response)===null||$===void 0?void 0:$.error)||E[p.status],e.showUploadProgress&&p.status==="progress"?" ".concat(p.percent||0,"%"):""])])},Y=function(p,U){var $;return l("td",null,[l(pe,{th
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
*/function ia(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ae(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ia(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ia(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function cl(t){var e,a=t.method,n=a===void 0?"POST":a,r=t.action,o=t.withCredentials,s=o===void 0?!1:o,c=t.headers,i=c===void 0?{}:c,v=t.data,u=v===void 0?{}:v,g=t.file,y=t.files,m=y===void 0?[]:y,C=t.name,R=C===void 0?"file":C,w=t.useMockProgress,M=w===void 0?!0:w,I=t.mockProgressDuration,_=I===void 0?300:I,k=t.formatRequest,S=t.onError,b=t.onProgress,F=t.onSuccess,j=m||[],P=0,h=new XMLHttpRequest;s&&(h.withCredentials=!0);var D,Y;if(M&&((e=m[0])===null||e===void 0?void 0:e.status)==="progress")var ee=setTimeout(function(){D=setInterval(function(){P+10<100?(P=Math.max(P+10,P),m[0]&&P!==m[0].percent&&(m[0].percent=P,b({percent:P,file:g||j[0],files:j.map(function(B){return Ae(Ae({},B),{},{percent:P})}),type:"mock",XMLHttpRequest:h}))):clearInterval(D)},_),clearTimeout(ee)},_);var X={};if(u){var T=_e(u)?u(j):u;Object.assign(X,T)}j.forEach(function(B,V){var p=j.length>1?"".concat(R,"[").concat(V,"]"):R;X[p]=B.raw}),j.length===1?X[R]=j[0].raw:X[R]=j.map(function(B){return B.raw}),X.length=j.length,k&&(X=k(X));var N=new FormData;return Object.keys(X).forEach(function(B){N.append(B,X[B])}),h.open(n,r,!0),Object.keys(i).forEach(function(B){h.setRequestHeader(B,i[B])}),h.onerror=function(B){S({event:B,file:g,files:j,XMLHttpRequest:h}),clearInterval(D),clearTimeout(Y)},h.ontimeout=function(B){S({event:B,file:g,files:j,XMLHttpRequest:h})},h.upload&&(h.upload.onprogress=function(B){var V,p=0;if(B.total>0&&(p=Math.round(B.loaded/B.total*100)),P=Math.max(p,P),P!==p&&((V=j[0])===null||V===void 0?void 0:V.percent)!==P){var U=j.map(function($){return Ae(Ae({},$),{},{percent:P})});b({event:B,percent:P,file:g||U[0],files:U,type:"real",XMLHttpRequest:h})}}),h.onload=function(B){var V={};V.XMLHttpRequest=h;var p=h.status<200||h.status>=300;if(p)return S({event:B,file:g,files:j,response:V,XMLHttpRequest:h});var U=h.responseText||h.response;try{V=JSON.parse(U)}catch{V=U,we.error("Upload","response does not a valid json")}clearInterval(D),clearTimeout(Y),j.forEach(function($){var J;$.percent=100,$.status="success",$.uploadTime=((J=V)===null||J===void 0?void 0:J.uploadTime)||ja()}),Le(V)==="object"&&(V.XMLHttpRequest=h),F({event:B,file:g||j[0],files:oe(j),XMLHttpRequest:h,response:V})},h.send(N),h.upload.requestParams=X,h.upload.requestHeaders=i,h}/**
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function ua(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function se(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ua(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ua(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function sl(t,e){var a=e.sizeLimit,n=e.beforeUpload,r=new Promise(function(i){var v=null;if(a){var u=Ha(a)?{size:a,unit:"KB"}:a,g=hr(t.size,u.size,u.unit);g&&(v=u)}i(v)}),o=[r,void 0];if(_e(n)){var s=n(t),c=s instanceof Promise?s:new Promise(function(i){return i(s)});o[1]=c}return new Promise(function(i){Promise.all(o).then(function(v){i(v)})})}function ca(t){var e=t.event,a=t.files,n=t.response,r=t.XMLHttpRequest,o=t.formatResponse,s=n;return _e(o)&&(s=o(n,{file:a[0],currentFiles:a})),a.forEach(function(c){c.status="fail",c.response=s}),{response:s,event:e,files:a,XMLHttpRequest:r}}function vl(t){var e=t.event,a=t.files,n=t.response,r=t.XMLHttpRequest;(a==null?void 0:a.length)<=0&&we.error("Upload","Empty File in Success Callback"),a.forEach(function(s){var c;s.percent=100,s.status="success",(c=s.response)===null||c===void 0||delete c.error});var o=n;return a[0].url=o.url||a[0].url,{response:o,event:e,files:a,XMLHttpRequest:r}}function dl(t){return t?t.status?["success","fail"].includes(t.status)?(t.status==="success"&&(!t.response||!t.response.url&&!t.response.files)&&we.warn("Upload","`requestMethodResponse.response.url` or `requestMethodResponse.response.files` is required if `status` is `success`"),!0):(we.error("Upload","`requestMethodResponse.status` must be `success` or `fail`, examples `{ status: 'success', response: { url: '' } }`"),!1):(we.error("Upload","`requestMethodResponse.status` is missing, which value only can be `success` or `fail`"),!1):(we.error("Upload","`requestMethodResponse` is required."),!1)}function sa(t){var e=t.action,a=t.toUploadFiles,n=t.requestMethod;return new Promise(function(r){if(!e&&!n){we.error("Upload","one of action and requestMethod must be exist."),r({});return}if(!a||!a.length){we.warn("Upload","No files need to be uploaded"),r({});return}if(a.forEach(function(c){c.status="progress"}),n)n(t.multiple?a:a[0]).then(function(c){if(!dl(c)){r({});return}var i=c.response||{};_e(t.formatResponse)&&(i=t.formatResponse(i,{file:a[0],currentFiles:a})),c.status==="fail"&&(i.error=c.error||i.error);var v=[];c.status==="success"&&i.files?v=i.files.map(function(m){var C=a.find(function(R){return m.name&&R.name===m.name||m.raw&&R.raw===m.raw});return se(se(se({},C),m),{},{status:c.status,response:i})}):(a.forEach(function(m){var C;m.status=c.status,m.response=i,m.url=i.url,m.percent=c.status==="success"?100:0,m.uploadTime=((C=i)===null||C===void 0?void 0:C.uploadTime)||ja()}),v=a);var u={response:i,file:v[0],files:v};if(c.status==="success"){var g;(g=t.onResponseSuccess)===null||g===void 0||g.call(t,u)}else if(c.status==="fail"){var y;(y=t.onResponseError)===null||y===void 0||y.call(t,u)}r({status:c.status,data:u})});else{var o,s=cl({action:t.action,files:t.toUploadFiles,useMockProgress:t.useMockProgress,mockProgressDuration:t.mockProgressDuration,onError:function(i){var v,u=ca(se(se({},i),{},{formatResponse:t.formatResponse}));(v=t.onResponseError)===null||v===void 0||v.call(t,u),r({status:"fail",data:u})},onProgress:t.onResponseProgress,onSuccess:function(i){var v=t.formatResponse,u=i.response;if(_e(v)&&(u=v(i.response,{file:i.file,currentFiles:i.files})),u.error){var g,y=ca(se(se({},i),{},{response:u}));(g=t.onResponseError)===null||g===void 0||g.call(t,y),r({status:"fail",data:y})}else{var m;i.file.response=u,i.files[0].response=u;var C=vl(se(se({},i),{},{response:u}));(m=t.onResponseSuccess)===null||m===void 0||m.call(t,C),r({status:"success",data:C})}},formatRequest:t.formatRequest,data:t.data,name:t.name,headers:t.header
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function va(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function He(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?va(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):va(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function bl(t){var e=Z(),a=he(t),n=a.disabled,r=a.autoUpload,o=a.isBatchUpload,s=a.multiple,c=a.files,i=a.modelValue,v=a.defaultFiles,u=Ee("upload"),g=u.globalConfig,y=u.t,m=u.classPrefix,C=Qe(c,i,v.value,t.onChange,"files"),R=Pe(C,2),w=R[0],M=R[1],I=Z([]),_=Z([]),k=Z(""),S=d(function(){return pa({},g.value,t.locale)}),b="".concat(m.value,"-upload__tips ").concat(m.value,"-size-s"),F=[b].concat("".concat(m.value,"-upload__tips-error")),j="".concat(m.value,"-upload__placeholder"),P=d(function(){var O,f=hl({isBatchUpload:o.value,multiple:s.value,status:(O=w.value)===null||O===void 0||(O=O[0])===null||O===void 0?void 0:O.status,autoUpload:r.value});return S.value.triggerUploadText[f]}),h=Z(!1),D=d(function(){return yl({multiple:t.multiple,toUploadFiles:_.value,uploadValue:w.value,autoUpload:r.value,isBatchUpload:o.value})}),Y=function(f){var x=f.file,A=f.percent,H=r.value?_:w,K=H.value.findIndex(function(ae){return x.raw===ae.raw});H.value[K]=He(He({},H.value[K]),{},{percent:A})},ee=function(){t.autoUpload&&(_.value=oe(_.value))},X=function(f){var x;if(!(!f||!f.files||!f.files[0])){var A=f.response,H=f.event,K=f.files;ee(),(x=t.onOneFileFail)===null||x===void 0||x.call(t,{e:H,file:K==null?void 0:K[0],currentFiles:K,failedFiles:K,response:A}),(!t.multiple||t.isBatchUpload)&&M([],{trigger:"progress-fail",e:f.event,file:f.files[0]})}},T=function(f){var x;ee(),(x=t.onProgress)===null||x===void 0||x.call(t,{e:f.event,file:f.file,currentFiles:f.files,percent:f.percent,type:f.type,XMLHttpRequest:f.XMLHttpRequest})},N=function(f){if(t.multiple&&!t.uploadAllFilesInOneRequest){var x;ee(),(x=t.onOneFileSuccess)===null||x===void 0||x.call(t,{e:f.event,file:f.files[0],response:f.response})}};function B(O){var f=O;return f.message?y(f.message,{sizeLimit:f.size}):"".concat(y(S.value.sizeLimitMessage,{sizeLimit:f.size})," ").concat(f.unit)}var V=function(f){var x=t.multiple&&!o.value?w.value.concat(f):f;!x.length||(M(x,{trigger:"add",index:w.value.length,file:f[0],files:f}),_.value=[])},p=function(f){var x;if(!n.value){var A={currentSelectedFiles:Ye(oe(f),t.format)};(x=t.onSelectChange)===null||x===void 0||x.call(t,oe(f),A),ml({uploadValue:w.value,files:oe(f),allowUploadDuplicateFile:t.allowUploadDuplicateFile,max:t.multiple?t.max:0,sizeLimit:t.sizeLimit,isBatchUpload:o.value,autoUpload:r.value,format:t.format,beforeUpload:t.beforeUpload,beforeAllFilesUpload:t.beforeAllFilesUpload}).then(function(H){var K;if(((K=H.validateResult)===null||K===void 0?void 0:K.type)==="BEFORE_ALL_FILES_UPLOAD"){var ae,le={type:"BEFORE_ALL_FILES_UPLOAD",files:H.files};(ae=t.onValidate)===null||ae===void 0||ae.call(t,le);return}if(H.lengthOverLimit){var ye,Ce={type:"FILES_OVER_LENGTH_LIMIT",files:H.files};if((ye=t.onValidate)===null||ye===void 0||ye.call(t,Ce),!H.files.length)return}if(H.hasSameNameFile){var be,je={type:"FILTER_FILE_SAME_NAME",files:H.files};(be=t.onValidate)===null||be===void 0||be.call(t,je)}if(H.fileValidateList instanceof Array){var ze,xe=pl(H.fileValidateList,B),ke=xe.sizeLimitErrors,te=xe.beforeUploadErrorFiles,G=xe.toFiles,ne=r.value?G:_.value.concat(G);if(_.value=ne,(ze=t.onWaitingUploadFilesChange)===null||ze===void 0||ze.call(t,{files:ne,trigger:"validate"}),ke[0]){var Ie;k.value=ke[0].file.response.error,(Ie=t.onValidate)===null||Ie===void 0||Ie.call(t,{type:"FILE_OVER_SIZE_LIMIT",files:ke.map(function(ka){return ka.file})})}else if(k.value="",te.length){var Ve,za={type:"CUSTOM_BEFORE_UPLOAD",files:te};(Ve=t.onValidate)===null||Ve===void 0||Ve.call(t,za)}r.value?W(ne)
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function da(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function fa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?da(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):da(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ol=Q({name:"UploadCustomFile",props:fa(fa({},Ne),{},{dragEvents:Object,draggable:Boolean,dragContent:Function,trigger:Function,triggerUpload:Function,childrenNode:[String,Function]}),setup:function(e,a){var n=a.slots,r=he(e),o=r.classPrefix,s=r.displayFiles,c=r.accept,i=rt(e.dragEvents,c),v=i.dragActive,u=Xe(),g=function(){var m,C={dragActive:v.value||!1,files:s.value};return l("div",{class:"".concat(o.value,"-upload__dragger ").concat(o.value,"-upload__dragger-center"),onDrop:i.handleDrop,onDragenter:i.handleDragenter,onDragover:i.handleDragover,onDragleave:i.handleDragleave,onClick:e.triggerUpload},[l("div",{class:"".concat(o.value,"-upload__trigger")},[u("dragContent","trigger",{params:C})||((m=e.childrenNode)===null||m===void 0?void 0:m.call(e,C))])])};return function(){var y,m;return l(Fe,null,[e.draggable?g():l("div",{class:"".concat(o.value,"-upload__trigger"),onClick:e.triggerUpload},[((y=e.childrenNode)===null||y===void 0?void 0:y.call(e,{files:s.value}))||((m=n.default)===null||m===void 0?void 0:m.call(n))])])}}});/**
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-30 15:21:13 +00:00
*/function ga(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function wl(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(a),!0).forEach(function(n){q(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ga(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var _l=Q({name:"TUpload",props:el,setup:function(e,a){var n=a.slots,r=a.expose,o=Xe(),s=de(),c=bl(e),i=c.locale,v=c.classPrefix,u=c.triggerUploadText,g=c.toUploadFiles,y=c.displayFiles,m=c.uploadValue,C=c.sizeOverLimitMessage,R=c.uploading,w=c.tipsClasses,M=c.errorClasses,I=c.placeholderClass,_=c.inputRef,k=c.onInnerRemove,S=c.uploadFiles,b=c.onNormalFileChange,F=c.onDragFileChange,j=c.onPasteFileChange,P=c.triggerUpload,h=c.cancelUpload,D=c.uploadFilePercent,Y=ba();r({upload:_.value,uploading:R,triggerUpload:P,uploadFiles:S,cancelUpload:h,uploadFilePercent:D});var ee=function(){var W=function(){return e.theme==="file-input"?l(pe,re({disabled:Y.value,variant:"outline"},e.triggerButtonProps),{default:function(){return[u.value]}}):l(pe,re({disabled:Y.value,variant:"outline",icon:function(){return l(Wn,null,null)}},e.triggerButtonProps),{default:function(){return[u.value]}})};return o("default","trigger",{params:{dragActive:!1,files:m.value}})||W()},X=d(function(){return{accept:e.accept,files:m.value,toUploadFiles:g.value,displayFiles:y.value,theme:e.theme,placeholder:e.placeholder,disabled:Y.value,tips:e.tips,status:e.status,sizeOverLimitMessage:C.value,uploading:R.value,classPrefix:v.value,tipsClasses:w,errorClasses:M,placeholderClass:I,locale:i.value,autoUpload:e.autoUpload,abridgeName:e.abridgeName,showUploadProgress:e.showUploadProgress,fileListDisplay:e.fileListDisplay,onRemove:k,uploadPastedFiles:e.uploadPastedFiles,onPasteFileChange:j,imageViewerProps:e.imageViewerProps}}),T={onDragFileChange:F,onDragenter:e.onDragenter,onDragleave:e.onDragleave,onDrop:e.onDrop},N=d(function(){return["".concat(v.value,"-upload"),q({},"".concat(v.value,"-upload--theme-").concat(e.theme),e.theme==="file-input")]}),B=function(){return l(nl,re(X.value,{multiple:e.multiple}),{default:function(){return[l("div",{class:"".concat(v.value,"-upload__trigger"),onClick:P},[ee()])]},fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},V=function(){return l(rl,re(X.value,{dragEvents:T,trigger:e.trigger,cancelUpload:h,triggerUpload:P,uploadFiles:S,onCancelUpload:e.onCancelUpload}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},p=function(){return l(ol,re(X.value,{multiple:e.multiple,max:e.max,showUploadProgress:e.showUploadProgress,triggerUpload:P,uploadFiles:S,cancelUpload:h,onPreview:e.onPreview,showImageFileName:e.showImageFileName}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},U=function(){return l(ul,re(X.value,{isBatchUpload:e.isBatchUpload,draggable:e.draggable,dragEvents:T,uploadFiles:S,cancelUpload:h,onPreview:e.onPreview,showImageFileName:e.showImageFileName,showThumbnail:e.showThumbnail,uploadButton:e.uploadButton,cancelUploadButton:e.cancelUploadButton}),{default:function(){return[l("div",{class:"".concat(v.value,"-upload__trigger"),onClick:P},[!e.draggable&&ee()])]},fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"],uploadButton:n.uploadButton,"upload-button":n["upload-button"],cancelUploadButton:n.cancelUploadButton,"cancel-upload-button":n["cancel-upload-button"]})},$=function(){return l(Ol,re(X.value,{draggable:e.draggable,dragContent:e.dragContent,dragEvents:T,triggerUpload:P,trigger:e.trigger,childrenNode:n.default}),{default:function(){return[ee()]},dragContent:n.dragContent,"drag-content":n["drag-content"],trigger:n.trigger})};return function(){return l("div",{class:N.value,onPaste:e.uploadPastedFiles?j:void 0},[l("input",re({ref:_,type:"file
2024-06-15 00:08:13 +00:00
* tdesign v1.9.4
* (c) 2024 tdesign
* @license MIT
2024-06-28 22:52:55 +00:00
*/var Vl=Se(_l);export{Nl as D,Rl as L,Bl as R,$l as T,Vl as U,Tl as a};