mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
202 lines
118 KiB
JavaScript
202 lines
118 KiB
JavaScript
import{P as ie,Q as ue,S as ce,n as Ce,b as he,e as ba,f as V,W as ut,p as Me,al as Ta,aW as Oa,c as wa,i as de,w as xe,d as ze,a3 as Fe,m as Se,an as _a,aA as Ra,k as Pa,aX as Ca,aY as Na,ax as et,ac as Re,h as Ge,Z as ke,aZ as Va,am as Aa,a_ as Ha,$ as tt,a0 as We,g as oe,O as Oe,Y as ct,l as Ka}from"./index.a0309a28.js";import{d as Y,c as g,j as K,w as ve,t as we,i as qa,n as Xe,o as Ye,aI as r,aV as ne,aY as Xa,aK as je,aW as Fa,a_ as Za,a$ as Ga,b0 as Wa,aZ as Ya,b as Ja,aU as at,h as Qa}from"./arco.b087a425.js";import{l as Pe,b as nt,a as en,e as tn,i as an,C as nn,B as Sa}from"./index.e1e291ce.js";import{o as ln,e as rn,v as on,w as un,T as Je,x as cn,f as sn,n as vn,y as dn,l as fn,u as gn,z as mn,r as pn}from"./dep-71c4f289.8a8673b4.js";import{a as hn}from"./slot.ff9cd5b8.js";import{L as lt}from"./index.0cdd9cfb.js";import{S as st}from"./index.e8fb17a9.js";import{_ as vt,r as Ae}from"./form-model.7bb64fbd.js";import{D as yn}from"./index.9bcc2d7d.js";function dt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).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.getOwnPropertyDescriptor(a,n))})}return t}var bn={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"}}]},On=Y({name:"DeleteIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-delete",l.value]),c=g(()=>ft(ft({},o.value),a.style)),i=g(()=>({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(bn,i.value)}});const ja=On;function gt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function mt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?gt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):gt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var wn={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"}}]},_n=Y({name:"DownloadIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-download",l.value]),c=g(()=>mt(mt({},o.value),a.style)),i=g(()=>({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(wn,i.value)}});const Pn=_n;function pt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function ht(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?pt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):pt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Cn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 1h12.41L21 6.59V23H3V1zm2 2v18h14V9h-6V3H5zm10 .41V7h3.59L15 3.41zM15 10v1.65a2 2 0 01-.61 1.44l-.95.91.95.91c.39.38.61.9.61 1.44V18h-2v-1.65l-1-.96-1 .96V18H9v-1.65a2 2 0 01.61-1.44l.95-.91-.95-.91A2 2 0 019 11.65V10h2v1.65l1 .96 1-.96V10h2z"}}]},Fn=Y({name:"FileExcelIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-file-excel",l.value]),c=g(()=>ht(ht({},o.value),a.style)),i=g(()=>({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(Cn,i.value)}});const Sn=Fn;function yt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function bt(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){ce(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}var jn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 1h12.41L21 6.59V11h-2V9h-6V3H5v18h16v2H3V1zm12 2.41V7h3.59L15 3.41zM6 12h3.71c.71 0 1.29.58 1.29 1.29v2.42c0 .71-.58 1.29-1.29 1.29H8v3H6v-8zm2 3h1v-1H8v1zm3.5-3h3.71c.71 0 1.29.58 1.29 1.29v5.42c0 .71-.58 1.29-1.29 1.29H11.5v-8zm2 2v4h1v-4h-1zm3.5-.71c0-.71.58-1.29 1.29-1.29h3.38v2H19v1h2.67v2H19v3h-2v-6.71z"}}]},xn=Y({name:"FilePdfIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-file-pdf",l.value]),c=g(()=>bt(bt({},o.value),a.style)),i=g(()=>({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(jn,i.value)}});const In=xn;function Ot(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function wt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ot(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ot(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Dn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 1h12.41L21 6.59V23H3V1zm2 2v18h14V9h-6V3H5zm10 .41V7h3.59L15 3.41zM9 10h4a2 2 0 012 2v1.6a2 2 0 01-2 2h-2V18H9v-8zm2 3.6h2V12h-2v1.6z"}}]},En=Y({name:"FilePowerpointIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-file-powerpoint",l.value]),c=g(()=>wt(wt({},o.value),a.style)),i=g(()=>({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(Dn,i.value)}});const Un=En;function _t(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Pt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_t(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_t(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var zn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 1h12.41L21 6.59V23H3V1zm2 2v18h14V9h-6V3H5zm10 .41V7h3.59L15 3.41zM10 11v5h1v-5h2v5h1v-5h2v5a2 2 0 01-2 2h-4a2 2 0 01-2-2v-5h2z"}}]},kn=Y({name:"FileWordIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-file-word",l.value]),c=g(()=>Pt(Pt({},o.value),a.style)),i=g(()=>({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(zn,i.value)}});const Ln=kn;function Ct(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).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?Ct(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ct(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Bn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 1h12.41L21 6.59V23H3V1zm2 2v18h14V9h-6V3H5zm10 .41V7h3.59L15 3.41z"}}]},Mn=Y({name:"FileIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-file",l.value]),c=g(()=>Ft(Ft({},o.value),a.style)),i=g(()=>({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(Bn,i.value)}});const $n=Mn;function St(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).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?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 Tn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.59l5-5L14.41 14 13 15.41l-4-4-5 5V20h8v2H2V2zm13.55 5a1 1 0 100 2 1 1 0 000-2zm-3 1a3 3 0 116 0 3 3 0 01-6 0zm3.62 6.76L19 17.59l2.83-2.83 1.41 1.41L20.41 19l2.83 2.83-1.41 1.41L19 20.41l-2.83 2.83-1.41-1.41L17.59 19l-2.83-2.83 1.41-1.41z"}}]},Rn=Y({name:"ImageErrorIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-image-error",l.value]),c=g(()=>jt(jt({},o.value),a.style)),i=g(()=>({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(Tn,i.value)}});const xa=Rn;function xt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function It(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){ce(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}var Nn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 18h13.59L9 11.41l-5 5V20zm16-.41V4H4v9.59l5-5 11 11zM15.55 7a1 1 0 100 2 1 1 0 000-2zm-3 1a3 3 0 116 0 3 3 0 01-6 0z"}}]},Vn=Y({name:"ImageIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-image",l.value]),c=g(()=>It(It({},o.value),a.style)),i=g(()=>({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(Nn,i.value)}});const Ia=Vn;function Dt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Et(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.getOwnPropertyDescriptor(a,n))})}return t}var An={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M13 2v20h-2V2h2zM9 4.64V18.5H1.3L9 4.64zm6 0l7.7 13.86H15V4.64zM4.7 16.5H7v-4.14L4.7 16.5zM17 12.36v4.14h2.3L17 12.36z"}}]},Hn=Y({name:"MirrorIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-mirror",l.value]),c=g(()=>Et(Et({},o.value),a.style)),i=g(()=>({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(An,i.value)}});const Kn=Hn;function Ut(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function zt(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 qn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M20.5 5.83A10.49 10.49 0 001.56 10.9l-.1.99 1.98.2.1-.99a8.5 8.5 0 0115.67-3.6H15.5v2h7v-7h-2v3.33zm.06 6.07l-.1 1a8.5 8.5 0 01-15.67 3.6H8.5v-2h-7v7h2v-3.33a10.48 10.48 0 0018.94-5.07l.1-.99-1.98-.2z"}}]},Xn=Y({name:"RefreshIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-refresh",l.value]),c=g(()=>zt(zt({},o.value),a.style)),i=g(()=>({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(qn,i.value)}});const Mr=Xn;function kt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Lt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?kt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):kt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Zn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M4 2v9a9 9 0 019 9h9v2H2V2h2zm0 18h7a7 7 0 00-7-7v7z"}}]},Gn=Y({name:"RotationIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-rotation",l.value]),c=g(()=>Lt(Lt({},o.value),a.style)),i=g(()=>({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(Zn,i.value)}});const Wn=Gn;function Bt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Mt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Bt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Bt(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:"M12 23a11 11 0 110-22 11 11 0 010 22zm1-17.5h-2v6.91l4 4L16.41 15 13 11.59V5.5z"}}]},Jn=Y({name:"TimeFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-time-filled",l.value]),c=g(()=>Mt(Mt({},o.value),a.style)),i=g(()=>({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 Da=Jn;function $t(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Tt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?$t(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):$t(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Qn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 2.59l5.91 5.91-1.41 1.41-3.5-3.5V16h-2V6.41l-3.5 3.5L6.09 8.5 12 2.59zM4.5 14v5h15v-5h2v7h-19v-7h2z"}}]},el=Y({name:"UploadIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-upload",l.value]),c=g(()=>Tt(Tt({},o.value),a.style)),i=g(()=>({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(Qn,i.value)}});const tl=el;function Rt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Nt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Rt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Rt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var al={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 2v16h16V4H4zm4 2.37L17.75 12 8 17.63V6.37zm2 3.46v4.34L13.75 12 10 9.83z"}}]},nl=Y({name:"VideoIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-video",l.value]),c=g(()=>Nt(Nt({},o.value),a.style)),i=g(()=>({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(al,i.value)}});const ll=nl;function Vt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function At(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Vt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Vt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var rl={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15.1 5.9a6.5 6.5 0 10-9.2 9.2 6.5 6.5 0 009.2-9.2zM4.49 4.5a8.5 8.5 0 0112.69 11.27l5.34 5.35-1.41 1.41-5.35-5.34A8.5 8.5 0 014.5 4.49zM11.5 6.5v3h3v2h-3v3h-2v-3h-3v-2h3v-3h2z"}}]},ol=Y({name:"ZoomInIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-zoom-in",l.value]),c=g(()=>At(At({},o.value),a.style)),i=g(()=>({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(rl,i.value)}});const il=ol;function Ht(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Kt(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){ce(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}var ul={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15.1 5.9a6.5 6.5 0 10-9.2 9.2 6.5 6.5 0 009.2-9.2zM4.49 4.5a8.5 8.5 0 0112.69 11.27l5.34 5.35-1.41 1.41-5.35-5.34A8.5 8.5 0 014.5 4.49zM6.5 11.5v-2h8v2h-8z"}}]},cl=Y({name:"ZoomOutIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=g(()=>t.size),{className:l,style:o}=ie(n),s=g(()=>["t-icon","t-icon-zoom-out",l.value]),c=g(()=>Kt(Kt({},o.value),a.style)),i=g(()=>({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(ul,i.value)}});const sl=cl;/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var vl=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp)/i,dl=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp|.dwg|.dxf|.svf|.tif|.tiff|.arw)/i,fl=/(.pdf)/i,gl=/(.xlsx|.xls|.csv|.xlc|.xlm|.xlt|.xlw)/i,ml=/(.dox|docx|.document|.wps|.wdb|.msword)/i,pl=/(.ppt|.pptx|.key)/i,Ea=/(.avi|.mp4|.wmv|.mpg|.mpeg|.mov|.rm|.ram|.swf|.flv|.rmvb|.flash|.mid|.3gp)/i,hl=/(.mp2|.mp3|.mp4|.ogg|.3gpp|.ac3|.au)/i,qt={"audio/*":hl,"video/*":Ea,"image/*":dl,".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},be={B:1,KB:1024,MB:1048576,GB:1073741824};function yl(t){return t<be.KB?"".concat(t," Bytes"):t>=be.KB&&t<be.MB?"".concat((t/be.KB).toFixed(1)," KB"):t>=be.MB&&t<be.GB?"".concat((t/be.MB).toFixed(1)," MB"):t>=be.GB?"".concat((t/be.GB).toFixed(1)," GB"):""}function Ua(){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()),l="".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds());return t?[n,l].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,l=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&&l<e?i?l+=1:l+=2:s>s-a&&o<a&&(i?o+=1:o+=2)}return n.replace(new RegExp("^(.{".concat(l,"})(.+)(.{").concat(o,"})$")),"$1\u2026$3")}function bl(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 Ol(t,e,a){var n=["B","KB","MB","GB"],l=1,o=n.indexOf(a);o===-1&&(Pe.warn("Upload","`sizeLimit.unit` can only be one of ".concat(n.join())),o=l);var s=be[a];return t>e*s}function wl(t){return new Promise(function(e){if(!t){e("");return}var a=new FileReader;a.readAsDataURL(t),a.onload=function(n){var l;e((l=n.target)===null||l===void 0?void 0:l.result)}})}function _l(t,e,a){var n=e||a;if(!t)return!0;if(!n)return!1;for(var l=t.split(",").map(function(v){return v.trim()}),o=0,s=l.length;o<s;o++){var c=l[o];if(qt[c]&&qt[c].test(n))return!0;var i=new RegExp(c,"i");if(i.test(n))return!0}return!1}function za(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],n=0;n<t.length;n++)_l(e,t[n].type,t[n].name)&&a.push(t[n]);return a}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Ze(t){var e=K("");return ve([t],function(a,n){var l=Ce(a,1),o=l[0],s=Ce(n,1),c=s[0];if(c!==o){if(typeof o=="string"){e.value=o;return}wl(o).then(function(i){e.value=i})}},{immediate:!0}),{previewUrl:e}}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var pe,Pl=`
|
|
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
|
|
`,Cl=["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 Fl(t){if(!(typeof window>"u"||!t)){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")),l=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width")),o=Cl.map(function(s){return"".concat(s,":").concat(e.getPropertyValue(s))}).join(";");return{sizingStyle:o,paddingSize:n,borderSize:l,boxSizing:a}}}function Xt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;pe||(pe=document.createElement("textarea"),document.body.appendChild(pe));var n=Fl(t),l=n.paddingSize,o=n.borderSize,s=n.boxSizing,c=n.sizingStyle;pe.setAttribute("style","".concat(c,";").concat(Pl)),pe.value=t.value||t.placeholder||"";var i=pe.scrollHeight,v={};s==="border-box"?i+=o:s==="content-box"&&(i-=l),pe.value="";var u=pe.scrollHeight-l;if(e!==null){var h=u*e;s==="border-box"&&(h=h+l+o),i=Math.max(h,i),v.minHeight="".concat(h,"px")}if(a!==null){var _=u*a;s==="border-box"&&(_=_+l+o),i=Math.min(_,i)}return v.height="".concat(i,"px"),pe.parentNode&&pe.parentNode.removeChild(pe),pe=null,v}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Sl={allowInputOverMax:{type:Boolean,default:!1},autofocus:Boolean,autosize:{type:[Boolean,Object],default:!1},disabled:{type:Boolean,default:void 0},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.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Zt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function jl(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){V(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}function Gt(t){var e={};return Object.keys(t).forEach(function(a){an(t[a])||(e[a]=t[a])}),e}var xl=Y({name:"TTextarea",inheritAttrs:!1,props:jl({},Sl),setup:function(e,a){var n=a.attrs,l=a.expose,o=he(),s=he("textarea"),c=g(function(){return"".concat(s.value,"__tips")}),i=g(function(){return"".concat(s.value,"__limit")}),v=we(e),u=v.value,h=v.modelValue,_=nt(u,h,e.defaultValue,e.onChange),p=Ce(_,2),S=p[0],N=p[1],P=ba(),$=K({}),U=K(),j=K(!1),M=K(!1),D=function(){var f;return(f=U.value)===null||f===void 0?void 0:f.focus()},w=function(){var f;return(f=U.value)===null||f===void 0?void 0:f.blur()},x=function(){var f;if(e.autosize===!0)$.value=Xt(U.value);else if(e.autosize&&Me(e.autosize)==="object"){var F=e.autosize,E=F.minRows,R=F.maxRows;$.value=Xt(U.value,E,R)}else n.rows?$.value={height:"auto",minHeight:"auto"}:n.style&&(f=U.value)!==null&&f!==void 0&&(f=f.style)!==null&&f!==void 0&&f.height&&($.value={height:U.value.style.height})},I=function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",F=U.value,E=String(f);!F||F.value!==E&&(F.value=E,S.value=E)},O=function(f){var F=f.target,E=F.value;if(e.maxcharacter&&e.maxcharacter>=0){var R=ut(E,e.maxcharacter);E=Me(R)==="object"&&R.characters}!M.value&&N(E,{e:f}),Xe(function(){return I(E)}),x()},m=function(f){O(f)},C=function(){M.value=!0},q=function(f){M.value=!1,O(f)},H=function(f,F){var E;if(!P.value){var R="on".concat(f[0].toUpperCase()).concat(f.slice(1));(E=e[R])===null||E===void 0||E.call(e,S.value,{e:F})}},G=function(f){H("keydown",f)},L=function(f){H("keyup",f)},T=function(f){H("keypress",f)},z=function(f){var F;x(),!P.value&&(j.value=!0,(F=e.onFocus)===null||F===void 0||F.call(e,S.value,{e:f}))},A=qa(en,void 0),W=function(f){var F;x(),j.value=!1,(F=e.onBlur)===null||F===void 0||F.call(e,S.value,{e:f}),A==null||A.handleBlur()},Q=g(function(){return[s.value,V(V({},"".concat(o.value,"-is-disabled"),P.value),"".concat(o.value,"-is-readonly"),e.readonly)]}),te=g(function(){return Gt({autofocus:e.autofocus,disabled:P.value,readonly:e.readonly,placeholder:e.placeholder,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0})}),le=g(function(){var b=ut(String(S.value||""));return Me(b)==="object"?b.length:b}),ae=g(function(){return{value:[void 0,null].includes(S.value)?void 0:String(S.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}),k=tn(ae),d=k.tStatus;ve(function(){return S.value},function(){return x()}),ve(U,function(b){!b||x()}),ve(function(){return e.autofocus},function(b){b&&U.value.focus()}),ve($,function(b){var f=n.style;Ta(U.value,Oa(f,b))}),ve(S,function(){Xe(function(){return x()})}),ve(function(){return e.autosize},x,{deep:!0}),l({focus:D,blur:w}),Ye(function(){x()});var y=de();return function(){var b,f=Gt({onFocus:z,onBlur:W,onKeydown:G,onKeyup:L,onKeypress:T}),F=wa(),E=F.STATUS,R=g(function(){return["".concat(s.value,"__inner"),V(V(V(V({},"".concat(o.value,"-is-").concat(d.value),d.value),E.value.disabled,P.value),E.value.focused,j.value),"".concat(o.value,"-resize-none"),Me(e.autosize)==="object"),"narrow-scrollbar"]}),B=y("tips"),X=B&&r("div",{class:"".concat(c.value," ").concat(s.value,"__tips--").concat(e.status||"normal")},[B]),ee=e.maxcharacter&&r("span",{class:i.value},["".concat(le.value,"/").concat(e.maxcharacter)])||!e.maxcharacter&&e.maxlength&&r("span",{class:i.value},["".concat(S.value?(b=String(S.value))===null||b===void 0?void 0:b.length:0,"/").concat(e.maxlength)]);return r("div",ne({class:Q.value},ln(n,["style"])),[r("textarea",ne({onInput:m,onCompositionstart:C,onCompositionend:q,ref:U,value:S.value,class:R.value},f,te.value),null),X||ee?r("div",{class:["".concat(s.value,"__info_wrapper"),V({},"".concat(s.value,"__info_wrapper_align"),!X)]},[X,ee]):null])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var $r=xe(xl);/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Il={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.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Dl=Y({name:"TImage",props:Il,setup:function(e){var a=K(null),n=K(null),l=null,o=we(e),s=o.src,c=de();Ye(function(){var L;if((L=n.value)!==null&&L!==void 0&&L.complete&&!e.lazy&&U(),!(!e.lazy||!a.value)){var T=rn(a.value,null,N,0);l=T}}),Xa(function(){a.value&&l&&l.unobserve(a.value)});var i=ze("image"),v=i.classPrefix,u=i.globalConfig,h=K(s.value);ve([s,u],function(L){var T=Ce(L,2),z=T[0],A=T[1],W=A||{},Q=W.replaceImageSrc,te=Fe(Q)?Q(e):z;te===h.value&&h.value||(h.value=te)},{immediate:!0});var _=Ze(h),p=_.previewUrl;ve([p],function(){j.value=!1,P.value=!1});var S=K(!e.lazy),N=function(){S.value=!0},P=K(!1),$=function(T){var z;P.value=!0,(z=e.onLoad)===null||z===void 0||z.call(e,{e:T})},U=function(){var T=new Event("load");Object.defineProperty(T,"target",{value:n.value,enumerable:!0}),$(T)},j=K(!1),M=function(T){var z;j.value=!0,(z=e.onError)===null||z===void 0||z.call(e,{e:T}),e.fallback&&(h.value=e.fallback,j.value=!1)},D=g(function(){return e.overlayTrigger==="hover"}),w=g(function(){return["".concat(v.value,"-image"),"".concat(v.value,"-image--fit-").concat(e.fit),"".concat(v.value,"-image--position-").concat(e.position)]}),x=K(!D.value),I=function(){D.value&&(x.value=!x.value)},O=function(){var T=c("placeholder");return T?r("div",{class:"".concat(v.value,"-image__placeholder")},[T]):null},m=function(){return e.gallery?r("div",{class:"".concat(v.value,"-image__gallery-shadow")},null):null},C=function(){var T=G("overlayContent");return T?r("div",{class:["".concat(v.value,"-image__overlay-content"),!x.value&&"".concat(v.value,"-image__overlay-content--hidden")]},[T]):null};function q(){return r("picture",null,[Object.entries(e.srcset).map(function(L){var T=Ce(L,2),z=T[0],A=T[1];return r("source",{type:z,srcset:A},null)}),H()])}function H(){var L=Se(h.value)?h.value:p.value;return r("img",{ref:n,src:L,onError:M,onLoad:$,class:w.value,alt:e.alt,referrerpolicy:e.referrerpolicy},null)}var G=Ra();return function(){return r("div",ne({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"),D.value&&"".concat(v.value,"-image__wrapper--need-hover")],onMouseenter:I,onMouseleave:I},_a(e,["src","alt","fit","position","shape","placeholder","loading","error","overlayTrigger","overlayContent","lazy","gallery","onLoad","onError"])),[O(),m(),(j.value||!S.value)&&r("div",{class:"".concat(v.value,"-image")},null),!(j.value||!S.value)&&(e.srcset&&Object.keys(e.srcset).length?q():H()),!(j.value||!S.value)&&!P.value&&r("div",{class:"".concat(v.value,"-image__loading")},[c("loading")||r(st,{direction:"vertical",size:8,align:"center"},{default:function(){return[r(Ia,{size:"24px"},null),Se(e.loading)?e.loading:u.value.loadingText]}})]),j.value&&r("div",{class:"".concat(v.value,"-image__error")},[G("error",{defaultNode:r(st,{direction:"vertical",size:8,align:"center"},{default:function(){return[r(xa,{size:"24px"},null),Se(e.error)?e.error:u.value.errorText]}})})]),C()])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Te=xe(Dl);/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Wt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function El(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Wt(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Wt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Ul(t){var e=K(t),a=function(o){var s=o.pageX,c=o.pageY,i=e.value,v=i.translateX,u=i.translateY,h=function(S){var N=S.pageX,P=S.pageY;e.value={translateX:v+N-s,translateY:u+P-c}},_=function(){document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",_)},n=function(){e.value=El({},t)};return{transform:e,mouseDownHandler:a,resetTransform:n}}function zl(){var t=K(1),e=function(){t.value*=-1},a=function(){t.value=1};return{mirror:t,onMirror:e,resetMirror:a}}function kl(){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,l=t.defaultScale,o=K(l!=null?l:1),s=function(){var h=on(o.value,n);v(h)},c=function(){var h=un(o.value,n);v(h)},i=function(){o.value=l!=null?l:1},v=function(h){var _=h;h<a&&(_=a),h>e&&(_=e),o.value=_};return ve(function(){return t},function(){return i()}),{scale:o,onZoomIn:s,onZoomOut:c,resetScale:i}}function Ll(){var t=K(0),e=90,a=function(){t.value+=e},n=function(){t.value=0};return{rotate:t,onRotate:a,resetRotate:n}}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ka=Y({name:"TImageItem",props:{rotate:Number,scale:Number,mirror:Number,src:[String,Object],placementSrc:[String,Object],isSvg:Boolean},setup:function(e){var a=we(e),n=a.src,l=a.placementSrc,o=a.isSvg,s=he(),c=K(!1),i=K(!1),v=Ul({translateX:0,translateY:0}),u=v.transform,h=v.mouseDownHandler,_=ze("imageViewer"),p=_.globalConfig,S=p.value.errorText,N=K(),P=g(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:!e.placementSrc||i.value?"block":"none"}}),$=g(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:i.value?"none":"block"}}),U=g(function(){var O=u.value,m=O.translateX,C=O.translateY;return{transform:"translate(".concat(m,"px, ").concat(C,"px) scale(").concat(e.mirror,", 1)")}}),j=function(){c.value=!1,i.value=!1,o.value&&M(w.value)},M=function(){var O=vt(Ae.mark(function m(C){var q,H,G,L,T,z,A,W,Q,te,le,ae,k;return Ae.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,fetch(C);case 2:if(H=y.sent,H.ok){y.next=6;break}throw c.value=!0,new Error("Failed to fetch SVG: ".concat(H.statusText));case 6:return y.next=8,H.text();case 8:G=y.sent,L=N.value,L.innerHTML="",(q=L.classList)===null||q===void 0||q.add("".concat(s.value,"-image-viewer__modal-image-svg")),T=L.attachShadow({mode:"closed"}),z=document.createElement("div"),z.style.background="transparent",z.innerHTML=G,T.appendChild(z),A=z.querySelector("svg"),A&&(W=A.getAttribute("viewBox"),W?(Q=W.split(/[\s\,]/).filter(function(b){return b}).map(parseFloat),te=Q[2],le=Q[3],z.style.width="".concat(te,"px"),z.style.height="".concat(le,"px")):(ae=A.getBBox(),k="".concat(ae.x," ").concat(ae.y," ").concat(ae.width," ").concat(ae.height),A.setAttribute("viewBox",k),z.style.width="".concat(ae.width,"px"),z.style.height="".concat(ae.height,"px"))),i.value=!0;case 20:case"end":return y.stop()}},m)}));return function(C){return O.apply(this,arguments)}}(),D=Ze(n),w=D.previewUrl,x=Ze(l),I=x.previewUrl;return ve([w,I],function(){j()}),Ye(vt(Ae.mark(function O(){return Ae.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:if(!o.value){C.next=3;break}return C.next=3,M(w.value);case 3:case"end":return C.stop()}},O)}))),function(){return r("div",{class:"".concat(s.value,"-image-viewer__modal-pic")},[r("div",{class:"".concat(s.value,"-image-viewer__modal-box"),style:U.value},[c.value&&r("div",{class:"".concat(s.value,"-image-viewer__img-error")},[r("div",{class:"".concat(s.value,"-image-viewer__img-error-content")},[r(xa,{size:"4em"},null),r("div",{class:"".concat(s.value,"-image-viewer__img-error-text")},[S])])]),!c.value&&!!e.placementSrc&&I.value&&r("img",{class:"".concat(s.value,"-image-viewer__modal-image"),onMousedown:function(m){m.stopPropagation(),h(m)},src:I.value,style:$.value,alt:"image",draggable:"false"},null),!c.value&&w.value&&!o.value&&r("img",{class:"".concat(s.value,"-image-viewer__modal-image"),onMousedown:function(m){m.stopPropagation(),h(m)},src:w.value,onLoad:function(){return i.value=!0},onError:function(){return c.value=!0},style:P.value,alt:"image",draggable:"false"},null),!c.value&&w.value&&o.value&&r("div",{ref:N,class:"".concat(s.value,"-image-viewer__modal-image"),onMousedown:function(m){m.stopPropagation(),h(m)},"data-alt":"svg",style:P.value,draggable:"false"},null)])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var _e=Y({name:"TImageModalIcon",props:{disabled:Boolean,onClick:Function,label:String,icon:Function},setup:function(e){var a=he(),n=de(),l=g(function(){return["".concat(a.value,"-image-viewer__modal-icon"),V({},"".concat(a.value,"-is-disabled"),e.disabled)]});return function(){return r("div",{class:l.value,onClick:e.onClick},[n("icon"),e.label&&r("span",{class:"".concat(a.value,"-image-viewer__modal-icon-label")},[e.label])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var $e={attach:{type:[String,Function],default:"body"},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.9
|
|
* (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(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Bl(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){V(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}var Ml=function(e){var a,n,l,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||(l=n.split)===null||l===void 0?void 0:l.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),h=document.createElement("a");h.download=s,h.href=u,h.click(),h.remove(),URL.revokeObjectURL(u)})},o.src=e},$l=function(e){return!!e&&!Se(e)&&!(e instanceof File)},Tl=function(e){return Pa(e)?e.map(function(a){return $l(a)?Bl({download:!0,thumbnail:a.mainImage},a):{mainImage:a,thumbnail:a,download:!0}}):[]},Rl=function(e){return e.showOverlay!==void 0?e.showOverlay:e.mode==="modal"};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var La=Y({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=he(),n=g(function(){return e.currentImage.mainImage}),l=Ze(n),o=l.previewUrl,s=ze("imageViewer"),c=s.globalConfig;return function(){return r("div",{class:"".concat(a.value,"-image-viewer__utils")},[r("div",{class:"".concat(a.value,"-image-viewer__utils-content")},[r(Je,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.mirrorTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[r(_e,{onClick:e.onMirror,icon:function(){return r(Kn,{size:"medium"},null)}},null)]}}),r(Je,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.rotateTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[r(_e,{onClick:e.onRotate,icon:function(){return r(Wn,{size:"medium"},null)}},null)]}}),r(_e,{icon:function(){return r(sl,{size:"medium"},null)},onClick:e.onZoomOut},null),r(_e,{class:"".concat(a.value,"-image-viewer__utils-scale"),size:"medium",label:"".concat(cn(String(e.scale*100)),"%")},null),r(_e,{icon:function(){return r(il,{size:"medium"},null)},onClick:e.onZoomIn},null),r(Je,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.originalSizeTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[r("div",{class:"".concat(a.value,"-image-viewer__modal-icon")},[r(_e,{icon:function(){return r(Ia,{size:"medium"},null)},onClick:e.onReset},null)])]}}),e.currentImage.download&&r(_e,{icon:function(){return r(Pn,{size:"medium"},null)},onClick:function(){Ml(o.value)}},null)])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Nl=Y({name:"TImageViewerModal",props:{zIndex:Number,visible:Boolean,index:Number,images:$e.images,scale:Number,rotate:Number,mirror:Number,title:$e.title,currentImage:{type:Object,default:function(){return{}}},onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,onClose:$e.onClose,draggable:{type:Boolean,default:!0},viewerScale:{type:Object,default:function(){return{}}},showOverlay:Boolean,closeBtn:$e.closeBtn},setup:function(e){var a=he(),n=de(),l=g(function(){return{minWidth:e.viewerScale.minWidth,minHeight:e.viewerScale.minHeight}});return function(){return r(yn,{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 r("div",{class:"".concat(a.value,"-image-viewer-mini__footer")},[r(La,{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[r("div",{class:"".concat(a.value,"-image-viewer-mini__content"),style:l.value},[r(ka,{rotate:e.rotate,scale:e.scale,mirror:e.mirror,src:e.currentImage.mainImage,placementSrc:e.currentImage.thumbnail,isSvg:e.currentImage.isSvg},null)])]}})}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ee=function(t){return t.left="ArrowLeft",t.up="ArrowUp",t.right="ArrowRight",t.down="ArrowDown",t.esc="Escape",t}(Ee||{});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Jt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Vl(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Jt(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Jt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Al=Y({name:"TImageViewer",props:Vl({},$e),setup:function(e){var a,n=he(),l=he("image-viewer"),o=de(),s=K(!0),c=g(function(){return Rl(e)}),i=we(e),v=i.index,u=i.visible,h=i.modelValue,_=sn(v,(a=e.defaultIndex)!==null&&a!==void 0?a:0,e.onIndexChange,"index"),p=Ce(_,2),S=p[0],N=p[1],P=nt(u,h,e.defaultVisible,function(){},"visible"),$=Ce(P,2),U=$[0],j=$[1],M=K(!0),D=K(),w=Ca(function(){return e.attach}),x=g(function(){return[l.value,"".concat(l.value,"-preview-image"),V({},"".concat(n.value,"-is-hide"),!U.value)]}),I=g(function(){return["".concat(n.value,"-image-viewer__modal-header"),V({},"".concat(n.value,"-is-show"),s.value)]}),O=g(function(){var J;return(J=e.zIndex)!==null&&J!==void 0?J:2600}),m=function(){s.value=!s.value},C=zl(),q=C.mirror,H=C.onMirror,G=C.resetMirror,L=kl(e.imageScale),T=L.scale,z=L.onZoomIn,A=L.onZoomOut,W=L.resetScale,Q=Ll(),te=Q.rotate,le=Q.onRotate,ae=Q.resetRotate,k=function(){G(),W(),ae()},d=g(function(){return Tl(e.images)}),y=g(function(){var J;return(J=d.value[S.value])!==null&&J!==void 0?J:{mainImage:""}}),b=Na("dialog",{visible:U}),f=b.isLastDialog,F=function(){var Z=S.value-1;k(),N(Z<0?0:Z,{trigger:"prev"})},E=function(){var Z=S.value+1;k(),N(Z>=d.value.length?S.value:Z,{trigger:"next"})},R=function(Z){N(Z,{trigger:"current"})},B=function(){j(!0)},X=function(Z){var re;j(!1),(re=e.onClose)===null||re===void 0||re.call(e,Z)},ee=function(Z){X({e:Z,trigger:"close-btn"})},fe=function(Z){e.closeOnOverlay&&X({e:Z,trigger:"overlay"})},ge=function(Z){switch(Z.stopPropagation(),Z.code){case Ee.left:F();break;case Ee.right:E();break;case Ee.up:z();break;case Ee.down:A();break;case Ee.esc:e.closeOnEscKeydown&&f()&&X({e:Z,trigger:"esc"});break}},me=K();ve(function(){return U.value},function(J){clearTimeout(D.value),J?(M.value=!1,Xe().then(function(){var Z,re;(Z=me.value)===null||Z===void 0||(re=Z.focus)===null||re===void 0||re.call(Z)}),k()):D.value=setTimeout(function(){M.value=!0},200)});var ye=function(Z){Z.preventDefault();var re=Z.deltaY;re>0?A():z()},Le=g(function(){return{transform:"translateX(calc(-".concat(S.value," * (40px / 9 * 16 + 4px)))")}}),Be=function(){return r("div",{class:I.value},[r(_e,{icon:function(){return r(vn,null,null)},class:"".concat(l.value,"__header-pre-bt"),onClick:m},null),r("div",{class:"".concat(l.value,"__header-prev")},[r("div",{class:"".concat(l.value,"__header-trans"),style:Le.value},[d.value.map(function(Z,re){return r("div",{key:re,class:["".concat(l.value,"__header-box"),V({},"".concat(n.value,"-is-active"),re===S.value)]},[r(Te,{src:Z.thumbnail||Z.mainImage,error:"",className:"".concat(l.value,"__header-img"),onClick:function(){return R(re)}},null)])})])])])},Ie=function(Z){var re=Z==="prev"?0:180,De=o("navigationArrow",r(dn,{style:{transform:"rotate(".concat(re,"deg)")},size:"24px"},null));return r(_e,{class:"".concat(l.value,"__modal-").concat(Z,"-bt"),onClick:Z==="prev"?F:E,icon:function(){return De}},null)},Ve=function(){if(e.closeBtn!==!1)return r("div",{class:["".concat(l.value,"__modal-icon"),"".concat(l.value,"__modal-close-bt")],onClick:ee},[o("closeBtn",r(et,{size:"24px"},null))])};return function(){return e.mode==="modeless"?r(je,null,[o("trigger",{params:{open:B}}),r(Nl,{zIndex:O.value,visible:U.value,index:S.value,images:d.value,scale:T.value,rotate:te.value,mirror:q.value,currentImage:y.value,onRotate:le,onZoomIn:z,onZoomOut:A,onMirror:H,onReset:k,onClose:X,draggable:e.draggable,showOverlay:c.value,title:e.title},null)]):r(je,null,[o("trigger",{params:{open:B}}),r(Fa,{disabled:!e.attach||!w.value,to:w.value},{default:function(){return[r(Za,null,{default:function(){return[(U.value||!M.value)&&Ga(r("div",{ref:me,class:x.value,style:{zIndex:O.value},onWheel:ye,tabindex:-1,onKeydown:ge},[!!c.value&&r("div",{class:"".concat(l.value,"__modal-mask"),onClick:fe},null),d.value.length>1&&r(je,null,[Be(),r("div",{class:"".concat(l.value,"__modal-index")},[e.title&&o("title"),"".concat(S.value+1,"/").concat(d.value.length)]),Ie("prev"),Ie("next")]),Ve(),r(La,{onZoomIn:z,onZoomOut:A,onMirror:H,onReset:k,onRotate:le,scale:T.value,currentImage:y.value},null),r(ka,{scale:T.value,rotate:te.value,mirror:q.value,src:y.value.mainImage,placementSrc:y.value.thumbnail,isSvg:y.value.isSvg},null)]),[[Wa,U.value]])]}})]}})])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var rt=xe(Al);/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ba={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.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ma=Y({name:"TListItem",props:Ba,setup:function(){var e=he("list-item"),a=de();return function(){var n=a("content"),l=a("default"),o=a("action");return r("li",{class:e.value},[r("div",{class:"".concat(e.value,"-main")},[l||n,o&&r("li",{class:"".concat(e.value,"__action")},[o])])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Qt="load-more",Hl="loading";/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ea(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function ta(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){V(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 Kl(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=ql(t))||e&&t&&typeof t.length=="number"){a&&(t=a);var n=0,l=function(){};return{s:l,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(v){throw v},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,s=!0,c=!1;return{s:function(){a=a.call(t)},n:function(){var v=a.next();return s=v.done,v},e:function(v){c=!0,o=v},f:function(){try{s||a.return==null||a.return()}finally{if(c)throw o}}}}function ql(t,e){if(t){if(typeof t=="string")return aa(t,e);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?aa(t,e):void 0}}function aa(t,e){(e==null||e>t.length)&&(e=t.length);for(var a=0,n=Array(e);a<e;a++)n[a]=t[a];return n}var Xl=function(){var e=hn(),a=g(function(){var n=[],l=e("ListItem");if(Pa(l)){var o=Kl(l),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n.push(ta(ta({},c.props),{},{slots:c.children}))}}catch(i){o.e(i)}finally{o.f()}}return n});return{listItems:a}};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Zl=function(e,a,n){var l=g(function(){return{data:n.value,scroll:e}}),o=fn(a,l),s=g(function(){return o.isVirtualScroll.value}),c=-1,i=function(_){var p=_.target||_.srcElement,S=p.scrollTop;c!==S?o.isVirtualScroll.value&&o.handleScroll():c=-1,c=S},v=g(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=g(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}};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function na(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Gl(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){V(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}var Wl=Y({name:"TList",props:Gl({},Ba),setup:function(e){var a=K(),n=ze("list"),l=n.globalConfig,o=he("list"),s=wa(),c=s.SIZE,i=de(),v=Xl(),u=v.listItems,h=Zl(e.scroll,a,u),_=h.virtualConfig,p=h.cursorStyle,S=h.listStyle,N=h.isVirtualScroll,P=h.onInnerVirtualScroll,$=g(function(){return["".concat(o.value),c.value[e.size],V(V(V({},"".concat(o.value,"--split"),e.split),"".concat(o.value,"--stripe"),e.stripe),"".concat(o.value,"--vertical-action"),e.layout==="vertical")]}),U=function(){var I=i("header"),O=i("footer"),m=_.isVirtualScroll.value;return r(je,null,[I?r("div",{class:"".concat(o.value,"__header")},[I]):null,m?r(je,null,[r("div",{style:p.value},null),r("ul",{class:"".concat(o.value,"__inner"),style:S.value},[_.visibleData.value.map(function(C){return r(je,null,[r(Ma,_a(C,"slots"),C.slots)])})])]):r("ul",{class:"".concat(o.value,"__inner")},[i("default")]),O?r("div",{class:"".concat(o.value,"__footer")},[O]):null])},j=function(I){var O,m=I.target,C=m.scrollTop,q=m.scrollHeight,H=m.clientHeight;N.value&&P(I),(O=e.onScroll)===null||O===void 0||O.call(e,{e:I,scrollTop:C,scrollBottom:q-H-C})},M=g(function(){return Se(e.asyncLoading)&&["loading","load-more"].includes(e.asyncLoading)?"".concat(o.value,"__load ").concat(o.value,"__load--").concat(e.asyncLoading):"".concat(o.value,"__load")}),D=function(){if(e.asyncLoading&&Se(e.asyncLoading)){if(e.asyncLoading===Hl)return r("div",null,[r(Re,null,null),r("span",null,[l.value.loadingText])]);if(e.asyncLoading===Qt)return r("span",null,[l.value.loadingMoreText])}return i("asyncLoading")},w=function(I){var O;Se(e.asyncLoading)&&e.asyncLoading!==Qt||(O=e.onLoadMore)===null||O===void 0||O.call(e,{e:I})};return{COMPONENT_NAME:o,listClass:$,loadingClass:M,renderLoading:D,renderContent:U,handleScroll:j,handleLoadMore:w,listRef:a,isVirtualScroll:N}},render:function(){var e=this.renderContent();return e=[e,r("div",{class:this.loadingClass,onClick:this.handleLoadMore},[this.renderLoading()])],r("div",{class:this.listClass,onScroll:this.handleScroll,ref:"listRef",style:this.isVirtualScroll?"position:relative":void 0},[e])}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Yl={avatar:{type:[String,Function]},description:{type:[String,Function]},image:{type:[String,Function]},title:{type:[String,Function]}};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Jl=Y({name:"TListItemMeta",props:Yl,setup:function(e,a){var n=he("list-item__meta"),l=Ge(),o=de(),s=function(){(e.avatar||a.slots.avatar)&&console.warn("`avatar` is going to be deprecated, please use `image` instead");var i=l("avatar","image");if(!!i)return Se(i)?r("div",{class:"".concat(n.value,"-avatar")},[r("img",{src:i},null)]):r("div",{class:"".concat(n.value,"-avatar")},[i])};return function(){var c=o("title"),i=o("description"),v=[s(),r("div",{class:"".concat(n.value,"-content")},[c&&r("h3",{class:"".concat(n.value,"-title")},[c]),i&&r("p",{class:"".concat(n.value,"-description")},[i])])];return r("div",{class:n.value},[v])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Tr=xe(Wl),Rr=xe(Ma);xe(Jl);/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ql={attach:{type:[String,Function]},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function]},closeBtn:{type:[String,Boolean,Function]},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function]},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:{type:[Boolean,Object],default:!1},visible:Boolean,zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onConfirm:Function,onEscKeydown:Function,onOverlayClick:Function,onSizeDragEnd:Function};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function er(t,e){return typeof t=="boolean"?{allowSizeDraggable:t,max:e.max,min:e.min}:{allowSizeDraggable:!0,max:t.max,min:t.min}}function He(t,e,a){return Math.min(Math.max(t,e),a)}function tr(t,e){var a=e.x,n=e.y,l=e.max,o=e.min,s=e.maxWidth,c=e.maxHeight,i;switch(t){case"right":i=He(s-a,o,l);break;case"left":i=He(a,o,l);break;case"top":i=He(n,o,l);break;case"bottom":i=He(c-n,o,l);break;default:return i}return i}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ar=function(e){var a=K(!1),n=K(null),l=function(){document.addEventListener("mouseup",o,!0),document.addEventListener("mousemove",s,!0),a.value=!0},o=function(){document.removeEventListener("mouseup",o,!0),document.removeEventListener("mousemove",s,!0),a.value=!1},s=function(v){var u,h=v.x,_=v.y,p=document.documentElement.clientHeight,S=document.documentElement.clientWidth,N=8,P=8,$=e.placement==="left"||e.placement==="right"?S:p,U=e.placement==="left"||e.placement==="right"?P:N,j=er(e.sizeDraggable,{max:$,min:U}),M=j.allowSizeDraggable,D=j.max,w=j.min;if(!(!M||!a.value)){var x=tr(e.placement,{x:h,y:_,maxWidth:S,maxHeight:p,max:D,min:w});typeof x>"u"||(n.value="".concat(x,"px"),(u=e.onSizeDragEnd)===null||u===void 0||u.call(e,{e:v,size:x}))}},c=g(function(){var i=["right","left"].includes(e.placement),v={left:"right",right:"left",top:"bottom",bottom:"top"};return V(V(V(V({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:l,draggableLineStyles:c}};/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var nr=1,lr=Y({name:"TDrawer",inheritAttrs:!1,props:Ql,emits:["update:visible"],setup:function(e,a){var n=K(!1),l=K(!1),o=K(),s=K(),c=ze("drawer"),i=c.globalConfig,v=ke({CloseIcon:et}),u=v.CloseIcon,h=de(),_=Ge(),p=he("drawer"),S=ar(e),N=S.draggedSizeValue,P=S.enableDrag,$=S.draggableLineStyles,U=Ca(function(){return e.attach}),j=function(d){var y;(y=e.onConfirm)===null||y===void 0||y.call(e,{e:d})},M=function(d){var y;(y=e.onCancel)===null||y===void 0||y.call(e,{e:d}),ae({trigger:"cancel",e:d})},D=Va({confirmBtnAction:j,cancelBtnAction:M}),w=D.getConfirmBtn,x=D.getCancelBtn,I=K(null),O=g(function(){return[p.value,"".concat(p.value,"--").concat(e.placement),V(V(V({},"".concat(p.value,"--open"),l.value),"".concat(p.value,"--attach"),e.showInAttachedElement),"".concat(p.value,"--without-mask"),!e.showOverlay)]}),m=g(function(){var k;if(N.value)return N.value;var d=(k=e.size)!==null&&k!==void 0?k:i.value.size,y=isNaN(Number(d))?d:"".concat(d,"px");return{small:"300px",medium:"500px",large:"760px"}[d]||y}),C=g(function(){return{transform:l.value?"translateX(0)":void 0,width:["left","right"].includes(e.placement)?m.value:"",height:["top","bottom"].includes(e.placement)?m.value:""}}),q=g(function(){return["".concat(p.value,"__content-wrapper"),"".concat(p.value,"__content-wrapper--").concat(e.placement)]}),H=g(function(){return I.value&&I.value.parentNode}),G=g(function(){return[e.mode,e.placement].join()}),L=g(function(){return{display:"flex",justifyContent:e.placement==="right"?"flex-start":"flex-end"}}),T=function(d){var y;if(((y=e.closeOnEscKeydown)!==null&&y!==void 0?y:i.value.closeOnEscKeydown)&&d.key==="Escape"&&l.value){var b;(b=e.onEscKeydown)===null||b===void 0||b.call(e,{e:d}),ae({trigger:"esc",e:d})}},z=function(){clearTimeout(s.value),s.value=setTimeout(function(){var d,y;(d=o.value)===null||d===void 0||(d=d.parentNode)===null||d===void 0||(y=d.removeChild)===null||y===void 0||y.call(d,o.value)},150)},A=function(){e.mode==="push"&&Xe(function(){!H.value||(H.value.style.cssText="transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;")})},W=function(){if(!!H.value&&!(e.mode!=="push"||!H.value)){var d={left:"margin: 0 0 0 ".concat(m.value),right:"margin: 0 0 0 -".concat(m.value),top:"margin: ".concat(m.value," 0 0 0"),bottom:"margin: -".concat(m.value," 0 0 0")}[e.placement];l.value?H.value.style.cssText+=d:H.value.style.cssText=H.value.style.cssText.replace(/margin:.+;/,"")}},Q=function(){var d=w({confirmBtn:e.confirmBtn,globalConfirm:i.value.confirm,className:"".concat(p.value,"__confirm")}),y=x({cancelBtn:e.cancelBtn,globalCancel:i.value.cancel,className:"".concat(p.value,"__cancel")});return r("div",{style:L.value},[e.placement==="right"?d:null,y,e.placement!=="right"?d:null])};ve(G,function(){A()},{immediate:!0}),ve(function(){return e.visible},function(k){Aa||(k?!e.showInAttachedElement&&e.preventScrollThrough&&o.value&&document.head.appendChild(o.value):z(),e.destroyOnClose?k?(n.value=!1,setTimeout(function(){l.value=!0})):(l.value=!1,setTimeout(function(){n.value=!0},200)):n.value===!0&&k?(n.value=!1,setTimeout(function(){l.value=!0})):l.value=k)},{immediate:!0});var te=function(d){var y;(y=e.onCloseBtnClick)===null||y===void 0||y.call(e,{e:d}),ae({trigger:"close-btn",e:d})},le=function(d){var y,b;(y=e.onOverlayClick)===null||y===void 0||y.call(e,{e:d}),((b=e.closeOnOverlayClick)!==null&&b!==void 0?b:i.value.closeOnOverlayClick)&&ae({trigger:"overlay",e:d})},ae=function(d){var y;(y=e.onClose)===null||y===void 0||y.call(e,d),a.emit("update:visible",!1)};return Ya(function(){W()}),Ye(function(){var k=document.documentElement.scrollHeight>document.documentElement.clientHeight,d=k?Ha():0;o.value=document.createElement("style"),o.value.dataset.id="td_drawer_".concat(+new Date,"_").concat(nr+=1),o.value.innerHTML=`
|
|
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(d,"px);"),`
|
|
}
|
|
`),l.value&&!e.showInAttachedElement&&e.preventScrollThrough&&document.head.appendChild(o.value),window.addEventListener("keydown",T)}),Ja(function(){z(),window.removeEventListener("keydown",T)}),function(){if(!n.value){var k=_("body","default"),d=h("header"),y=Q();return r(Fa,{disabled:!e.attach||!U.value,to:U.value},{default:function(){return[r("div",ne({ref:I,class:O.value,style:{zIndex:e.zIndex},onKeydown:T,tabindex:0},a.attrs),[e.showOverlay&&r("div",{class:"".concat(p.value,"__mask"),onClick:le},null),r("div",{class:q.value,style:C.value},[d&&r("div",{class:"".concat(p.value,"__header")},[d]),e.closeBtn&&r("div",{class:"".concat(p.value,"__close-btn"),onClick:te},[h("closeBtn",r(u,null,null))]),r("div",{class:["".concat(p.value,"__body"),"narrow-scrollbar"]},[k]),e.footer&&r("div",{class:"".concat(p.value,"__footer")},[h("footer",y)]),e.sizeDraggable&&r("div",{style:$.value,onMousedown:P},null)])])]}})}}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Nr=xe(lr);/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var rr={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,Function]},default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},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.9
|
|
* (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.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function la(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function or(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){V(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 ir(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!at(t)}var ur=Y({name:"UploadNormalFile",props:or({multiple:Boolean},Ne),setup:function(e,a){var n=a.slots,l=we(e),o=l.theme,s=l.disabled,c=l.classPrefix,i=g(function(){return e.locale}),v=ke({CloseIcon:et,TimeFilledIcon:Da,CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:We,CloseCircleFilledIcon:nn}),u=v.CloseIcon,h=v.TimeFilledIcon,_=v.CheckCircleFilledIcon,p=v.ErrorCircleFilledIcon,S=v.CloseCircleFilledIcon,N=de(),P="".concat(c.value,"-upload"),$=function(D){return r("div",{class:"".concat(P,"__single-progress")},[r(Re,null,null),e.showUploadProgress&&r("span",{class:"".concat(P,"__single-percent")},[D||0,"%"])])},U=function(D){var w;return o.value!=="file"||!e.multiple&&((w=D[0])===null||w===void 0?void 0:w.status)==="fail"&&e.autoUpload?null:D.map(function(x,I){var O=e.abridgeName&&x.name?Ue.apply(void 0,[x.name].concat(oe(e.abridgeName))):x.name;return r("div",{class:"".concat(P,"__single-display-text ").concat(P,"__display-text--margin"),key:x.name+I+x.percent+x.status},[x.url?r(lt,{href:x.url,target:"_blank",hover:"color",size:"small",class:"".concat(P,"__single-name")},ir(O)?O:{default:function(){return[O]}}):r("span",{class:"".concat(P,"__single-name")},[O]),x.status==="fail"&&r("div",{class:"".concat(P,"__flow-status ").concat(P,"__file-fail")},[r(p,null,null)]),x.status==="waiting"&&r("div",{class:"".concat(P,"__flow-status ").concat(P,"__file-waiting")},[r(h,null,null)]),x.status==="progress"&&$(x.percent),!s.value&&x.status!=="progress"&&r(u,{class:"".concat(P,"__icon-delete"),onClick:function(C){var q=C.e;return e.onRemove({e:q,file:x,index:I})}},null)])})},j=function(){var D;if(o.value==="file-input"){var w=e.displayFiles[0]||[],x=["".concat(c.value,"-input__inner"),V({},"".concat(P,"__placeholder"),!e.displayFiles[0])],I=s.value?"".concat(c.value,"-is-disabled"):"",O=(D=e.abridgeName)!==null&&D!==void 0&&D.length&&w!==null&&w!==void 0&&w.name?Ue.apply(void 0,[w.name].concat(oe(e.abridgeName))):w==null?void 0:w.name;return r("div",{class:"".concat(P,"__single-input-preview ").concat(c.value,"-input ").concat(I)},[r("div",{class:x},[r("span",{class:["".concat(P,"__single-input-text"),V({},e.placeholderClass,e.placeholder&&!(w!=null&&w.name))]},[w!=null&&w.name?O:e.placeholder]),(w==null?void 0:w.status)==="progress"&&$(w.percent),(w==null?void 0:w.status)==="waiting"&&r(h,{class:"".concat(P,"__status-icon ").concat(P,"__file-waiting")},null),w.status==="success"&&r(_,{class:"".concat(P,"__status-icon")},null),(w==null?void 0:w.name)&&w.status==="fail"&&r(p,{class:"".concat(P,"__status-icon ").concat(P,"__file-fail")},null),Boolean(!s.value&&w.name)&&r(S,{class:"".concat(P,"__single-input-clear"),onClick:function(C){var q=C.e;return e.onRemove({e:q,file:w,index:0})}},null)])])}};return function(){var M,D,w,x=["".concat(P,"__single"),"".concat(P,"__single-").concat(o.value)],I=N("fileListDisplay",{params:{onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles}});(e.fileListDisplay===null||I===null)&&(I=null);var O=e.displayFiles;return r("div",{class:x},[o.value==="file-input"&&j(),(M=n.default)===null||M===void 0?void 0:M.call(n),o.value==="file"&&e.placeholder&&!O[0]&&r("small",{class:[e.tipsClasses,e.placeholderClass]},[e.placeholder]),I===null?null:I||U(O),!e.multiple&&((D=O[0])===null||D===void 0?void 0:D.status)==="fail"&&o.value==="file"?r("small",{class:[e.errorClasses,e.placeholderClass]},[((w=O[0].response)===null||w===void 0?void 0:w.error)||i.value.progress.failText]):null])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ot(t,e){var a=K(null),n=K(!1),l=function(v){var u;v.preventDefault(),n.value=!1;var h=v.dataTransfer.files,_=za(h,e.value);if((u=t.onDrop)===null||u===void 0||u.call(t,{e:v}),_!=null&&_.length){var p;(p=t.onDragFileChange)===null||p===void 0||p.call(t,_)}},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:l,handleDragenter:o,handleDragleave:s,handleDragover:c}}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ra(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).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?ra(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ra(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var cr=Y({name:"UploadDraggerFile",props:oa(oa({},Ne),{},{trigger:Function,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,dragEvents:Object}),setup:function(e,a){var n=a.slots,l=we(e),o=l.displayFiles,s=l.disabled,c=l.accept,i=g(function(){return e.locale}),v=de(),u=gn(),h=u.sizeClassNames,_="".concat(e.classPrefix,"-upload"),p=ot(e.dragEvents,c),S=p.dragActive,N=K(),P=g(function(){var O;return["".concat(_,"__dragger"),V({},"".concat(_,"__dragger-center"),!o.value[0]),V({},"".concat(_,"__dragger-error"),((O=o.value[0])===null||O===void 0?void 0:O.status)==="fail")]}),$=ke({CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:We}),U=$.CheckCircleFilledIcon,j=$.ErrorCircleFilledIcon,M=function(){var m;if(!!e.displayFiles.length){var C=o.value[0];if(!C)return null;var q=(C==null?void 0:C.url)||(C==null||(m=C.response)===null||m===void 0?void 0:m.url);return r("div",{class:"".concat(_,"__dragger-img-wrap")},[r(rt,ne({images:[q],trigger:function(G,L){var T=L.open;return r(Te,{src:q||C.raw,onClick:T,error:"",loading:""},null)}},e.imageViewerProps),null)])}},D=function(){if(!!e.displayFiles.length){var m=o.value[0];if(!m)return null;if((m==null?void 0:m.status)==="progress")return r("div",{class:"".concat(_,"__single-progress")},[r(Re,null,null),e.showUploadProgress&&r("span",{class:"".concat(_,"__single-percent")},[m.percent,"%"])])}},w=function(){var m,C=o.value[0],q=e.abridgeName?Ue.apply(void 0,[C.name].concat(oe(e.abridgeName))):C.name,H=[r("div",{class:"".concat(_,"__dragger-text"),key:"info"},[r("span",{class:"".concat(_,"__single-name")},[q]),C.status==="progress"&&D(),C.status==="success"&&r(U,null,null),C.status==="fail"&&r(j,null,null)]),r("small",{class:"".concat(h.small),key:"size"},[i.value.file.fileSizeText,"\uFF1A",bl(C.size)]),r("small",{class:"".concat(h.small),key:"time"},[i.value.file.fileOperationDateText,"\uFF1A",C.uploadTime||"-"])];return r("div",{class:"".concat(_,"__dragger-progress")},[e.theme==="image"&&M(),r("div",{class:"".concat(_,"__dragger-progress-info")},[v("fileListDisplay",{params:{files:e.displayFiles}})||H,r("div",{class:"".concat(_,"__dragger-btns")},[["progress","waiting"].includes(C.status)&&!s.value&&r(Oe,{theme:"primary",variant:"text",class:"".concat(_,"__dragger-progress-cancel"),onClick:function(L){var T;return(T=e.cancelUpload)===null||T===void 0?void 0:T.call(e,{e:L,file:e.toUploadFiles[0]||e.files[0]})}},{default:function(){return[(m=i.value)===null||m===void 0?void 0:m.cancelUploadText]}}),!e.autoUpload&&C.status==="waiting"&&r(Oe,{theme:"primary",variant:"text",disabled:s.value,onClick:function(){var L;return(L=e.uploadFiles)===null||L===void 0?void 0:L.call(e)},class:"".concat(_,"__dragger-upload-btn")},{default:function(){return[i.value.triggerUploadText.normal]}})]),["fail","success"].includes(C==null?void 0:C.status)&&!s.value&&r("div",{class:"".concat(_,"__dragger-btns")},[r(Oe,{theme:"primary",variant:"text",disabled:s.value,class:"".concat(_,"__dragger-progress-cancel"),onClick:e.triggerUpload},{default:function(){return[i.value.triggerUploadText.reupload]}}),r(Oe,{theme:"danger",variant:"text",disabled:s.value,class:"".concat(_,"__dragger-delete-btn"),onClick:function(L){return e.onRemove({e:L,index:0,file:C})}},{default:function(){return[i.value.triggerUploadText.delete]}})])])])},x=function(){var m,C=r("div",null,[r("span",{class:"".concat(_,"--highlight")},[(m=i.value.triggerUploadText)===null||m===void 0?void 0:m.normal]),r("span",null,["\xA0\xA0/\xA0\xA0",i.value.dragger.draggingText])]),q=r("div",null,[i.value.dragger.dragDropText]);return S.value?q:C},I=function(){var m,C=o.value[0];return C&&(["progress","success","fail","waiting"].includes(C.status)||!C.status)?w():r("div",{class:"".concat(_,"__trigger"),onClick:e.triggerUpload},[((m=n.default)===null||m===void 0?void 0:m.call(n))||x()])};return function(){var O;return r("div",{ref:N,class:P.value,onDrop:p.handleDrop,onDragenter:p.handleDragenter,onDragover:p.handleDragover,onDragleave:p.handleDragleave},[((O=e.trigger)===null||O===void 0?void 0:O.call(e,Qa,{files:o.value,dragActive:S.value}))||I()])}}});/**
|
|
* tdesign v1.9.9
|
|
* (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(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function ua(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){V(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 sr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!at(t)}var vr=Y({name:"UploadImageCard",props:ua(ua({},Ne),{},{multiple:Boolean,max:Number,disabled:Boolean,showUploadProgress:Boolean,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,onPreview:Function,showImageFileName:Boolean}),setup:function(e){var a=we(e),n=a.displayFiles,l=a.classPrefix,o=a.multiple,s=a.max,c=g(function(){return e.locale}),i=ke({AddIcon:mn,BrowseIcon:Sa,DeleteIcon:ja,ErrorCircleFilledIcon:We}),v=i.BrowseIcon,u=i.DeleteIcon,h=i.AddIcon,_=i.ErrorCircleFilledIcon,p=de(),S=g(function(){var U;return o.value?!s.value||n.value.length<s.value:!((U=n.value)!==null&&U!==void 0&&U[0])}),N=function(j,M){return r("div",{class:"".concat(l.value,"-upload__card-content ").concat(l.value,"-upload__card-box")},[r(Te,{class:"".concat(l.value,"-upload__card-image"),src:j.url||j.raw,error:""},null),r("div",{class:"".concat(l.value,"-upload__card-mask")},[r("span",{class:"".concat(l.value,"-upload__card-mask-item"),onClick:function(w){return w.stopPropagation()}},[r(rt,ne({images:n.value.map(function(D){return D.url||D.raw}),defaultIndex:M,trigger:function(w,x){var I=x.open;return r(v,{onClick:function(m){var C,q=m.e;(C=e.onPreview)===null||C===void 0||C.call(e,{file:j,index:M,e:q}),I()}},null)}},e.imageViewerProps),null)]),!e.disabled&&r(je,null,[r("span",{class:"".concat(l.value,"-upload__card-mask-item-divider")},null),r("span",{class:"".concat(l.value,"-upload__card-mask-item"),onClick:function(w){return w.stopPropagation()}},[r(u,{onClick:function(w){var x,I=w.e;return e==null||(x=e.onRemove)===null||x===void 0?void 0:x.call(e,{e:I,file:j,index:M})}},null)])])])])},P=function(j,M){var D;return r("div",{class:[M,"".concat(l.value,"-upload__").concat(e.theme,"-").concat(j.status)]},[r(Re,{loading:!0,size:"medium"},null),r("p",null,[(D=c.value)===null||D===void 0||(D=D.progress)===null||D===void 0?void 0:D.uploadingText,e.showUploadProgress?" ".concat(j.percent,"%"):""])])},$=function(j,M,D){var w,x;return r("div",{class:D},[r(_,null,null),r("p",null,[((w=j.response)===null||w===void 0?void 0:w.error)||((x=c.value)===null||x===void 0||(x=x.progress)===null||x===void 0?void 0:x.failText)]),r("div",{class:"".concat(l.value,"-upload__card-mask")},[r("span",{class:"".concat(l.value,"-upload__card-mask-item"),onClick:function(O){return O.stopPropagation()}},[r(u,{onClick:function(O){var m,C=O.e;return e==null||(m=e.onRemove)===null||m===void 0?void 0:m.call(e,{e:C,file:j,index:M})}},null)])])])};return function(){var U,j,M=p("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(M)return M;var D="".concat(l.value,"-upload__card-item ").concat(l.value,"-is-background");return r("div",null,[r("ul",{class:"".concat(l.value,"-upload__card")},[(U=n.value)===null||U===void 0?void 0:U.map(function(w,x){var I="".concat(l.value,"-upload__card-name"),O="".concat(l.value,"-upload__card-container ").concat(l.value,"-upload__card-box"),m=e.abridgeName?Ue.apply(void 0,[w.name].concat(oe(e.abridgeName))):w.name;return r("li",{class:D,key:x},[w.status==="progress"&&P(w,O),w.status==="fail"&&$(w,x,O),!["progress","fail"].includes(w.status)&&N(w,x),Boolean(m&&e.showImageFileName)&&(w.url?r(lt,{href:w.url,class:I,target:"_blank",hover:"color",size:"small"},sr(m)?m:{default:function(){return[m]}}):r("span",{class:I},[m]))])}),S.value&&r("li",{class:D,onClick:e.triggerUpload},[r("div",{class:["".concat(l.value,"-upload__image-add"),"".concat(l.value,"-upload__card-container"),"".concat(l.value,"-upload__card-box"),V({},"".concat(l.value,"-is-disabled"),e.disabled)]},[r(h,null,null),r("p",{class:["".concat(l.value,"-size-s"),"".concat(l.value,"-upload__add-text")]},[(j=c.value)===null||j===void 0||(j=j.triggerUploadText)===null||j===void 0?void 0:j.image])])])])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ca(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function sa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ca(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ca(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function dr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!at(t)}var fr=Y({name:"UploadMultipleFlowList",props:sa(sa({},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,l=we(e),o=l.uploading,s=l.disabled,c=l.displayFiles,i=l.classPrefix,v=l.accept,u=g(function(){return"".concat(i.value,"-upload")}),h=g(function(){return e.locale}),_=de(),p=ke({BrowseIcon:Sa,DeleteIcon:ja,CheckCircleFilledIcon:tt,ErrorCircleFilledIcon:We,TimeFilledIcon:Da,FileExcelIcon:Sn,FilePdfIcon:In,FileWordIcon:Ln,FilePowerpointIcon:Un,FileIcon:$n,VideoIcon:ll}),S=p.BrowseIcon,N=p.DeleteIcon,P=p.CheckCircleFilledIcon,$=p.ErrorCircleFilledIcon,U=p.TimeFilledIcon,j=p.FileExcelIcon,M=p.FilePdfIcon,D=p.FileWordIcon,w=p.FilePowerpointIcon,x=p.FileIcon,I=p.VideoIcon,O=ot(e.dragEvents,v),m=K([]),C=K(0),q=g(function(){return o.value?"".concat(h.value.progress.uploadingText):h.value.triggerUploadText.normal}),H=g(function(){var k=e.draggable===void 0?!0:e.draggable;return k?{onDrop:O.handleDrop,onDragenter:O.handleDragenter,onDragover:O.handleDragover,onDragleave:O.handleDragleave}:{}}),G=function(){var d={success:r(P,null,null),fail:r($,null,null),progress:r(Re,null,null),waiting:r(U,null,null)},y=h.value.progress,b={success:y==null?void 0:y.successText,fail:y==null?void 0:y.failText,progress:y==null?void 0:y.uploadingText,waiting:y==null?void 0:y.waitingText};return{iconMap:d,textMap:b}},L=function(){return r("div",{class:"".concat(u.value,"__flow-empty")},[O.dragActive.value?h.value.dragger.dragDropText:h.value.dragger.clickAndDragText])},T=function(d,y){var b=G(),f=b.iconMap,F=b.textMap,E=e.abridgeName&&d.name?Ue.apply(void 0,[d.name].concat(oe(e.abridgeName))):d.name;return r("li",{class:"".concat(u.value,"__card-item"),key:d.name+y+d.percent+d.status||"0"},[r("div",{class:["".concat(u.value,"__card-content"),V({},"".concat(i.value,"-is-bordered"),d.status!=="waiting")]},[["fail","progress"].includes(d.status)&&r("div",{class:"".concat(u.value,"__card-status-wrap ").concat(u.value,"__").concat(e.theme,"-").concat(d.status)},[f[d.status],r("p",null,[F[d.status],e.showUploadProgress&&d.status==="progress"?" ".concat(d.percent,"%"):""])]),(["waiting","success"].includes(d.status)||!d.status&&d.url)&&r(Te,{class:"".concat(u.value,"__card-image"),src:d.url||d.raw,error:"",loading:""},null),r("div",{class:"".concat(u.value,"__card-mask")},[(d.url||d.raw)&&!["progress","fail"].includes(d.status)&&r("span",{class:"".concat(u.value,"__card-mask-item")},[r(S,{onClick:function(B){var X,ee=B.e;C.value=y,m.value=c.value,(X=e.onPreview)===null||X===void 0||X.call(e,{file:d,index:y,e:ee})}},null),r("span",{class:"".concat(u.value,"__card-mask-item-divider")},null)]),!s.value&&r("span",{class:"".concat(u.value,"__card-mask-item ").concat(u.value,"__delete"),onClick:function(B){return e.onRemove({e:B,index:y,file:d})}},[r(N,null,null)])])]),e.showImageFileName&&r("p",{class:["".concat(u.value,"__card-name"),"".concat(u.value,"__flow-status")]},[["success","waiting"].includes(d.status)&&f[d.status],E])])},z=function(d){var y,b,f=G(),F=f.iconMap,E=f.textMap;return r("div",{class:"".concat(u.value,"__flow-status")},[F[d.status],r("span",{class:"".concat(u.value,"__").concat(e.theme,"-").concat(d.status)},[(y=d.response)!==null&&y!==void 0&&y.error&&((b=d.response)===null||b===void 0?void 0:b.error)||E[d.status],e.showUploadProgress&&d.status==="progress"?" ".concat(d.percent||0,"%"):""])])},A=function(d,y){var b;return r("td",null,[r(Oe,{theme:"primary",variant:"text",content:(b=h.value)===null||b===void 0||(b=b.triggerUploadText)===null||b===void 0?void 0:b.delete,class:"".concat(u.value,"__delete"),onClick:function(F){return e.onRemove({e:F,index:y,file:d})}},null)])},W=function(d){var y;return d===0?r("td",{rowSpan:c.value.length,class:"".concat(u.value,"__flow-table__batch-row")},[r(Oe,{theme:"primary",variant:"text",content:(y=h.value)===null||y===void 0||(y=y.triggerUploadText)===null||y===void 0?void 0:y.delete,class:"".concat(u.value,"__delete"),onClick:function(f){return e.onRemove({e:f,index:-1,file:void 0})}},null)]):null},Q=function(d){return fl.test(d)?r(M,null,null):gl.test(d)?r(j,null,null):ml.test(d)?r(D,null,null):pl.test(d)?r(w,null,null):Ea.test(d)?r(I,null,null):r(x,null,null)},te=function(d){if(!d||!d.raw&&d.url)return null;var y=d.raw.type,b="".concat(u.value,"__file-thumbnail");return vl.test(y)?r(Te,{class:b,src:d.url||d.raw,fit:"scale-down",error:"",loading:"",onClick:function(F){var E;F.preventDefault(),m.value=[d],C.value=0,(E=e.onPreview)===null||E===void 0||E.call(e,{file:d,index:0,e:F})}},null):r("div",{class:b},[Q(y)])},le=function(){var d,y,b,f,F=_("fileListDisplay",{params:{cancelUpload:e.cancelUpload,uploadFiles:e.uploadFiles,onPreview:e.onPreview,onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles,dragEvents:H.value}});return F||e.fileListDisplay?F:r("table",ne({class:"".concat(u.value,"__flow-table")},H.value),[r("thead",null,[r("tr",null,[r("th",null,[(d=h.value.file)===null||d===void 0?void 0:d.fileNameText]),r("th",{style:{minWidth:"120px"}},[(y=h.value.file)===null||y===void 0?void 0:y.fileSizeText]),r("th",{style:{minWidth:"120px"}},[(b=h.value.file)===null||b===void 0?void 0:b.fileStatusText]),s.value?null:r("th",null,[(f=h.value.file)===null||f===void 0?void 0:f.fileOperationText])])]),r("tbody",null,[!c.value.length&&r("tr",null,[r("td",{colSpan:4},[L()])]),c.value.map(function(E,R){var B,X=e.isBatchUpload,ee=X&&c.value.every(function(ye){return ye.status==="success"||!ye.status})?W(R):A(E,R),fe=(B=e.abridgeName)!==null&&B!==void 0&&B.length?Ue.apply(void 0,[E.name].concat(oe(e.abridgeName))):E.name,ge=e.showThumbnail?r("div",{class:"".concat(u.value,"__file-info")},[te(E),fe]):fe,me=E.url?r(lt,{href:E.url,target:"_blank",hover:"color"},dr(ge)?ge:{default:function(){return[ge]}}):ge;return r("tr",{key:E.name+R+E.size},[r("td",{class:"".concat(u.value,"__file-name"),key:E.name+E.url},[me]),r("td",null,[yl(E.size)]),r("td",null,[z(E)]),s.value?null:ee])})])])},ae=function(){var d=_("fileListDisplay",{params:{cancelUpload:e.cancelUpload,uploadFiles:e.uploadFiles,onRemove:e.onRemove,onPreview:e.onPreview,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles,dragEvents:H.value}});return d||e.fileListDisplay?d:r("ul",{class:"".concat(u.value,"__card clearfix")},[e.displayFiles.map(function(y,b){return T(y,b)})])};return function(){var k,d,y,b="".concat(u.value,"__flow-card-area"),f=s.value||!o.value,F=n.uploadButton||Fe(e.uploadButton),E=Boolean(s.value||o.value||!c.value.length),R=n.cancelUploadButton||Fe(e.cancelUploadButton);return r("div",{class:"".concat(u.value,"__flow ").concat(u.value,"__flow-").concat(e.theme)},[r("div",{class:"".concat(u.value,"__flow-op")},[(k=n.default)===null||k===void 0?void 0:k.call(n),e.placeholder&&r("small",{class:"".concat(u.value,"__flow-placeholder ").concat(u.value,"__placeholder")},[e.placeholder])]),e.theme==="image-flow"&&r("div",ne({class:b},H.value),[c.value.length?ae():L()]),e.theme==="file-flow"&&(c.value.length?le():r("div",ne({class:b},H.value),[L()])),!e.autoUpload&&(e.uploadButton!==null||e.cancelUploadButton!==null)&&r("div",{class:"".concat(u.value,"__flow-bottom")},[e.cancelUploadButton!==null&&(F?_("cancelUploadButton",{params:{disabled:f,cancelUploadText:(d=h.value)===null||d===void 0?void 0:d.cancelUploadText,cancelUpload:e.cancelUpload}}):r(Oe,ne({theme:"default",disabled:f,content:(y=h.value)===null||y===void 0?void 0:y.cancelUploadText,class:"".concat(u.value,"__cancel"),onClick:function(X){var ee;return(ee=e.cancelUpload)===null||ee===void 0?void 0:ee.call(e,{e:X})}},ct(e.cancelUploadButton)?e.cancelUploadButton:{}),null)),e.uploadButton!==null&&(R?_("uploadButton",{params:{disabled:E,uploading:o.value,uploadText:q.value,uploadFiles:e.uploadFiles}}):r(Oe,ne({disabled:E,theme:"primary",loading:o.value,class:"".concat(u.value,"__continue"),content:q.value,onClick:function(){var X;return(X=e.uploadFiles)===null||X===void 0?void 0:X.call(e)}},ct(e.uploadButton)?e.uploadButton:{}),null))]),r(rt,ne({images:m.value.map(function(B){return B.url||B.raw}),visible:!!m.value.length,onClose:function(){m.value=[]},index:C.value,onIndexChange:function(X){return C.value=X}},e.imageViewerProps),null)])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function va(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function da(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){V(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}var gr=Y({name:"UploadCustomFile",props:da(da({},Ne),{},{dragEvents:Object,draggable:Boolean,dragContent:Function,trigger:Function,triggerUpload:Function,childrenNode:[String,Function]}),setup:function(e,a){var n=a.slots,l=we(e),o=l.classPrefix,s=l.displayFiles,c=l.accept,i=ot(e.dragEvents,c),v=i.dragActive,u=Ge(),h=function(){var p,S={dragActive:v.value||!1,files:s.value};return r("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},[r("div",{class:"".concat(o.value,"-upload__trigger")},[u("dragContent","trigger",{params:S})||((p=e.childrenNode)===null||p===void 0?void 0:p.call(e,S))])])};return function(){var _,p;return r(je,null,[e.draggable?h():r("div",{class:"".concat(o.value,"-upload__trigger"),onClick:e.triggerUpload},[((_=e.childrenNode)===null||_===void 0?void 0:_.call(e,{files:s.value}))||((p=n.default)===null||p===void 0?void 0:p.call(n))])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function fa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Ke(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?fa(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):fa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function mr(t){var e,a=t.method,n=a===void 0?"POST":a,l=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,h=t.file,_=t.files,p=_===void 0?[]:_,S=t.name,N=S===void 0?"file":S,P=t.useMockProgress,$=P===void 0?!0:P,U=t.mockProgressDuration,j=U===void 0?300:U,M=t.formatRequest,D=t.onError,w=t.onProgress,x=t.onSuccess,I=p||[],O=0,m=new XMLHttpRequest;s&&(m.withCredentials=!0);var C,q;if($&&((e=p[0])===null||e===void 0?void 0:e.status)==="progress")var H=setTimeout(function(){C=setInterval(function(){O+10<100?(O=Math.max(O+10,O),p[0]&&O!==p[0].percent&&(p[0].percent=O,w({percent:O,file:h||I[0],files:I.map(function(z){return Ke(Ke({},z),{},{percent:O})}),type:"mock",XMLHttpRequest:m}))):clearInterval(C)},j),clearTimeout(H)},j);var G={};if(u){var L=Fe(u)?u(I):u;Object.assign(G,L)}I.forEach(function(z,A){var W=I.length>1?"".concat(N,"[").concat(A,"]"):N;G[W]=z.raw}),I.length===1?G[N]=I[0].raw:G[N]=I.map(function(z){return z.raw}),G.length=I.length,M&&(G=M(G));var T=new FormData;return Object.keys(G).forEach(function(z){T.append(z,G[z])}),m.open(n,l,!0),Object.keys(i).forEach(function(z){m.setRequestHeader(z,i[z])}),m.onerror=function(z){D({event:z,file:h,files:I,XMLHttpRequest:m}),clearInterval(C),clearTimeout(q)},m.ontimeout=function(z){D({event:z,file:h,files:I,XMLHttpRequest:m})},m.upload&&(m.upload.onprogress=function(z){var A,W=0;if(z.total>0&&(W=Math.round(z.loaded/z.total*100)),O=Math.max(W,O),O!==W&&((A=I[0])===null||A===void 0?void 0:A.percent)!==O){var Q=I.map(function(te){return Ke(Ke({},te),{},{percent:O})});w({event:z,percent:O,file:h||Q[0],files:Q,type:"real",XMLHttpRequest:m})}}),m.onload=function(z){var A={};A.XMLHttpRequest=m;var W=m.status<200||m.status>=300;if(W)return D({event:z,file:h,files:I,response:A,XMLHttpRequest:m});var Q=m.responseText||m.response;try{A=JSON.parse(Q)}catch{A=Q,Pe.error("Upload","response does not a valid json")}clearInterval(C),clearTimeout(q),I.forEach(function(te){var le;te.percent=100,te.status="success",te.uploadTime=((le=A)===null||le===void 0?void 0:le.uploadTime)||Ua()}),Me(A)==="object"&&(A.XMLHttpRequest=m),x({event:z,file:h||I[0],files:oe(I),XMLHttpRequest:m,response:A})},m.send(T),m.upload.requestParams=G,m.upload.requestHeaders=i,m}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ga(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).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?ga(Object(a),!0).forEach(function(n){V(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}function pr(t,e){var a=e.sizeLimit,n=e.beforeUpload,l=new Promise(function(i){var v=null;if(a){var u=Ka(a)?{size:a,unit:"KB"}:a,h=Ol(t.size,u.size,u.unit);h&&(v=u)}i(v)}),o=[l,void 0];if(Fe(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 ma(t){var e=t.event,a=t.files,n=t.response,l=t.XMLHttpRequest,o=t.formatResponse,s=n;return Fe(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:l}}function hr(t){var e=t.event,a=t.files,n=t.response,l=t.XMLHttpRequest;(a==null?void 0:a.length)<=0&&Pe.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:l}}function yr(t){return t?t.status?["success","fail"].includes(t.status)?(t.status==="success"&&(!t.response||!t.response.url&&!t.response.files)&&Pe.warn("Upload","`requestMethodResponse.response.url` or `requestMethodResponse.response.files` is required if `status` is `success`"),!0):(Pe.error("Upload","`requestMethodResponse.status` must be `success` or `fail`, examples `{ status: 'success', response: { url: '' } }`"),!1):(Pe.error("Upload","`requestMethodResponse.status` is missing, which value only can be `success` or `fail`"),!1):(Pe.error("Upload","`requestMethodResponse` is required."),!1)}function pa(t){var e=t.action,a=t.toUploadFiles,n=t.requestMethod;return new Promise(function(l){if(!e&&!n){Pe.error("Upload","one of action and requestMethod must be exist."),l({});return}if(!a||!a.length){Pe.warn("Upload","No files need to be uploaded"),l({});return}if(a.forEach(function(c){c.status="progress"}),n)n(t.multiple?a:a[0]).then(function(c){if(!yr(c)){l({});return}var i=c.response||{};Fe(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(p){var S=a.find(function(N){return p.name&&N.name===p.name||p.raw&&N.raw===p.raw});return se(se(se({},S),p),{},{status:c.status,response:i})}):(a.forEach(function(p){var S;p.status=c.status,p.response=i,p.url=i.url,p.percent=c.status==="success"?100:0,p.uploadTime=((S=i)===null||S===void 0?void 0:S.uploadTime)||Ua()}),v=a);var u={response:i,file:v[0],files:v};if(c.status==="success"){var h;(h=t.onResponseSuccess)===null||h===void 0||h.call(t,u)}else if(c.status==="fail"){var _;(_=t.onResponseError)===null||_===void 0||_.call(t,u)}l({status:c.status,data:u})});else{var o,s=mr({action:t.action,files:t.toUploadFiles,useMockProgress:t.useMockProgress,mockProgressDuration:t.mockProgressDuration,onError:function(i){var v,u=ma(se(se({},i),{},{formatResponse:t.formatResponse}));(v=t.onResponseError)===null||v===void 0||v.call(t,u),l({status:"fail",data:u})},onProgress:t.onResponseProgress,onSuccess:function(i){var v=t.formatResponse,u=i.response;if(Fe(v)&&(u=v(i.response,{file:i.file,currentFiles:i.files})),u.error){var h,_=ma(se(se({},i),{},{response:u}));(h=t.onResponseError)===null||h===void 0||h.call(t,_),l({status:"fail",data:_})}else{var p;i.file.response=u,i.files[0].response=u;var S=hr(se(se({},i),{},{response:u}));(p=t.onResponseSuccess)===null||p===void 0||p.call(t,S),l({status:"success",data:S})}},formatRequest:t.formatRequest,data:t.data,name:t.name,headers:t.headers,withCredentials:t.withCredentials,method:t.method});(o=t.setXhrObject)===null||o===void 0||o.call(t,{files:t.toUploadFiles,xhrReq:s})}})}function br(t,e){for(var a=t.filter(function(c){return c.url}),n=a,l=function(){var i=e[o],v=t.findIndex(function(h){return h.raw&&h.raw===i.raw||h.name&&h.name===i.name}),u=v>=0?se(se({},t[v]),i):i;n.push(u)},o=0,s=e.length;o<s;o++)l();return n}function Or(t){var e=t.uploadAllFilesInOneRequest,a=t.toUploadFiles,n=t.uploadedFiles,l=t.isBatchUpload,o=a.filter(function(s){return!s.response||s.response&&!s.response.error});return new Promise(function(s){if(e||!t.multiple){pa(t).then(function(i){i.status==="success"&&(i.data.files=l||!t.multiple?i.data.files:br(n,i.data.files));var v=i.status==="fail"?i.data.files:[];s(se(se({},i),{},{failedFiles:v}))});return}var c=o.map(function(i){return pa(se(se({},t),{},{toUploadFiles:[i]}))});Promise.all(c).then(function(i){var v=[],u=[];i.forEach(function(p){p.status==="success"?v.push(p.data.files[0]):p.status==="fail"&&u.push(p.data.files[0])});var h=t.autoUpload?n.concat(v):n,_=l||!t.multiple?v:h;s({status:v.length?"success":"fail",data:{files:_},failedFiles:u,list:i})})})}function Qe(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return t.map(function(l){var o=l;Fe(e)&&(o=e(l));var s=se({raw:l,lastModified:l.lastModified,name:l.name,size:l.size,type:l.type,percent:n,status:a},o);return s})}function wr(t){var e=t.files,a=t.uploadValue,n=t.max,l=t.allowUploadDuplicateFile;return new Promise(function(o){var s=e.filter(function(P){var $=a.find(function(U){return U.name===P.name});return l||!$}),c=!1;if(s.length<e.length&&(c=!0),!s.length){var i=Qe(e,t.format,t.autoUpload?"progress":"waiting");o({hasSameNameFile:c,file:i==null?void 0:i[0],files:i,validateResult:{type:"FILTER_FILE_SAME_NAME"}});return}var v=!1;if(n&&s.length&&!t.isBatchUpload){var u=s.length;s=s.slice(0,n-a.length),u+a.length>n&&(v=!0)}var h=Qe(s,t.format,t.autoUpload?"progress":"waiting"),_;if(t.beforeAllFilesUpload){var p,S=(p=t.beforeAllFilesUpload)===null||p===void 0?void 0:p.call(t,h);_=S instanceof Promise?S:new Promise(function(P){return P(S)})}var N=h.map(function(P){return new Promise(function($){pr(P,{beforeUpload:t.beforeUpload,sizeLimit:t.sizeLimit}).then(function(U){var j=Ce(U,2),M=j[0],D=j[1];M?$({file:P,validateResult:{type:"FILE_OVER_SIZE_LIMIT",extra:M}}):D===!1&&$({file:P,validateResult:{type:"CUSTOM_BEFORE_UPLOAD"}}),$({file:P})})})});Promise.all([_].concat(N)).then(function(P){var $=pn(P),U=$[0],j=$.slice(1);o(U===!1?{lengthOverLimit:v,hasSameNameFile:c,validateResult:{type:"BEFORE_ALL_FILES_UPLOAD"},files:h}:{lengthOverLimit:v,hasSameNameFile:c,fileValidateList:j,files:h})})})}function _r(t,e){var a=[],n=[],l=[];return t.forEach(function(o){var s,c;if(((s=o.validateResult)===null||s===void 0?void 0:s.type)==="CUSTOM_BEFORE_UPLOAD"){n.push(o.file);return}if(((c=o.validateResult)===null||c===void 0?void 0:c.type)==="FILE_OVER_SIZE_LIMIT"){o.file.response||(o.file.response={}),o.file.response.error=o.file.response.error||e(o.validateResult.extra),a.push(o);return}l.push(o.file)}),{sizeLimitErrors:a,beforeUploadErrorFiles:n,toFiles:l}}function Pr(t){return t.isBatchUpload&&t.status||t.status==="fail"?"reupload":t.status==="progress"?"uploading":t.status==="success"||!t.autoUpload&&t.status==="waiting"?t.multiple?"continueUpload":"reupload":"fileInput"}function Cr(t){var e=t.multiple,a=t.uploadValue,n=t.toUploadFiles,l=t.autoUpload,o=l?n:n.filter(function(s){return s.status!=="success"});return e&&!t.isBatchUpload?l?(o.length?a.concat(o):a)||[]:a:(o.length?o:a)||[]}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ha(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function qe(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ha(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ha(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Fr(t){var e=K(),a=we(t),n=a.disabled,l=a.autoUpload,o=a.isBatchUpload,s=a.multiple,c=a.files,i=a.modelValue,v=a.defaultFiles,u=ze("upload"),h=u.globalConfig,_=u.t,p=u.classPrefix,S=nt(c,i,v.value,t.onChange,"files"),N=Ce(S,2),P=N[0],$=N[1],U=K([]),j=K([]),M=K(""),D=g(function(){return Oa({},h.value,t.locale)}),w="".concat(p.value,"-upload__tips ").concat(p.value,"-size-s"),x=[w].concat("".concat(p.value,"-upload__tips-error")),I="".concat(p.value,"-upload__placeholder"),O=g(function(){var b,f=Pr({isBatchUpload:o.value,multiple:s.value,status:(b=P.value)===null||b===void 0||(b=b[0])===null||b===void 0?void 0:b.status,autoUpload:l.value});return D.value.triggerUploadText[f]}),m=K(!1),C=g(function(){return Cr({multiple:t.multiple,toUploadFiles:j.value,uploadValue:P.value,autoUpload:l.value,isBatchUpload:o.value})}),q=function(f){var F=f.file,E=f.percent,R=l.value?j:P,B=R.value.findIndex(function(X){return F.raw===X.raw});R.value[B]=qe(qe({},R.value[B]),{},{percent:E})},H=function(){t.autoUpload&&(j.value=oe(j.value))},G=function(f){var F;if(!(!f||!f.files||!f.files[0])){var E=f.response,R=f.event,B=f.files;H(),(F=t.onOneFileFail)===null||F===void 0||F.call(t,{e:R,file:B==null?void 0:B[0],currentFiles:B,failedFiles:B,response:E}),(!t.multiple||t.isBatchUpload)&&$([],{trigger:"progress-fail",e:f.event,file:f.files[0]})}},L=function(f){var F;H(),(F=t.onProgress)===null||F===void 0||F.call(t,{e:f.event,file:f.file,currentFiles:f.files,percent:f.percent,type:f.type,XMLHttpRequest:f.XMLHttpRequest})},T=function(f){if(t.multiple&&!t.uploadAllFilesInOneRequest){var F;H(),(F=t.onOneFileSuccess)===null||F===void 0||F.call(t,{e:f.event,file:f.files[0],response:f.response})}};function z(b){var f=b;return f.message?_(f.message,{sizeLimit:f.size}):"".concat(_(D.value.sizeLimitMessage,{sizeLimit:f.size})," ").concat(f.unit)}var A=function(f){var F=t.multiple&&!o.value?P.value.concat(f):f;!F.length||($(F,{trigger:"add",index:P.value.length,file:f[0],files:f}),j.value=[])},W=function(f){var F;if(!n.value){var E={currentSelectedFiles:Qe(oe(f),t.format)};(F=t.onSelectChange)===null||F===void 0||F.call(t,oe(f),E),wr({uploadValue:P.value,files:oe(f),allowUploadDuplicateFile:t.allowUploadDuplicateFile,max:t.multiple?t.max:0,sizeLimit:t.sizeLimit,isBatchUpload:o.value,autoUpload:l.value,format:t.format,beforeUpload:t.beforeUpload,beforeAllFilesUpload:t.beforeAllFilesUpload}).then(function(R){var B;if(((B=R.validateResult)===null||B===void 0?void 0:B.type)==="BEFORE_ALL_FILES_UPLOAD"){var X,ee={type:"BEFORE_ALL_FILES_UPLOAD",files:R.files};(X=t.onValidate)===null||X===void 0||X.call(t,ee);return}if(R.lengthOverLimit){var fe,ge={type:"FILES_OVER_LENGTH_LIMIT",files:R.files};if((fe=t.onValidate)===null||fe===void 0||fe.call(t,ge),!R.files.length)return}if(R.hasSameNameFile){var me,ye={type:"FILTER_FILE_SAME_NAME",files:R.files};(me=t.onValidate)===null||me===void 0||me.call(t,ye)}if(R.fileValidateList instanceof Array){var Le,Be=_r(R.fileValidateList,z),Ie=Be.sizeLimitErrors,Ve=Be.beforeUploadErrorFiles,J=Be.toFiles,Z=l.value?J:j.value.concat(J);if(j.value=Z,(Le=t.onWaitingUploadFilesChange)===null||Le===void 0||Le.call(t,{files:Z,trigger:"validate"}),Ie[0]){var re;M.value=Ie[0].file.response.error,(re=t.onValidate)===null||re===void 0||re.call(t,{type:"FILE_OVER_SIZE_LIMIT",files:Ie.map(function($a){return $a.file})})}else if(M.value="",Ve.length){var De,it={type:"CUSTOM_BEFORE_UPLOAD",files:Ve};(De=t.onValidate)===null||De===void 0||De.call(t,it)}l.value?ae(Z):A(Z)}}),e.value.value=null}},Q=function(f){var F=za(f.target.files);W==null||W(F)};function te(b){W==null||W(b)}function le(b){W==null||W(oe(b.clipboardData.files))}function ae(b){var f=P.value.filter(function(E){return E.status!=="success"}),F=l.value?b||j.value:f;!F||!F.length||(m.value=!0,U.value=[],Or({action:t.action,headers:t.headers,method:t.method,name:t.name,withCredentials:t.withCredentials,uploadedFiles:P.value,toUploadFiles:F,multiple:t.multiple,isBatchUpload:o.value,autoUpload:t.autoUpload,uploadAllFilesInOneRequest:t.uploadAllFilesInOneRequest,useMockProgress:t.useMockProgress,data:t.data,mockProgressDuration:t.mockProgressDuration,requestMethod:t.requestMethod,formatRequest:t.formatRequest,formatResponse:t.formatResponse,onResponseProgress:L,onResponseSuccess:T,onResponseError:G,setXhrObject:function(R){var B;(B=R.files[0])!==null&&B!==void 0&&B.raw&&U.value.find(function(X){var ee;return((ee=X.files[0])===null||ee===void 0?void 0:ee.raw)===R.files[0].raw})||(U.value=U.value.concat(R))}}).then(function(E){var R=E.status,B=E.data,X=E.list,ee=E.failedFiles;if(m.value=!1,R==="success"){var fe;$(oe(B.files),{trigger:"add",file:B.files[0]}),U.value=[],(fe=t.onSuccess)===null||fe===void 0||fe.call(t,{fileList:B.files,currentFiles:F,file:F[0],results:X==null?void 0:X.map(function(ye){return ye.data}),response:B.response||X.map(function(ye){return ye.data.response}),XMLHttpRequest:B.XMLHttpRequest})}else if(ee!=null&&ee[0]){var ge;(ge=t.onFail)===null||ge===void 0||ge.call(t,{e:B.event,file:ee[0],failedFiles:ee,currentFiles:F,response:B.response,XMLHttpRequest:B.XMLHttpRequest})}if(l.value){var me;j.value=ee,(me=t.onWaitingUploadFilesChange)===null||me===void 0||me.call(t,{files:ee,trigger:"uploaded"})}}))}function k(b){var f,F,E;M.value="",(f=(F=b.e).stopPropagation)===null||f===void 0||f.call(F);var R={e:b.e,trigger:"remove",index:b.index,file:b.file};if(t.isBatchUpload||!t.multiple){var B;j.value=[],(B=t.onWaitingUploadFilesChange)===null||B===void 0||B.call(t,{files:[],trigger:"remove"}),$([],R)}else if(!t.autoUpload)P.value.splice(b.index,1),$(oe(P.value),R);else if(b.index<P.value.length)P.value.splice(b.index,1),$(oe(P.value),R);else{var X;j.value.splice(b.index-P.value.length,1),j.value=oe(j.value),(X=t.onWaitingUploadFilesChange)===null||X===void 0||X.call(t,{files:oe(j.value),trigger:"remove"})}(E=t.onRemove)===null||E===void 0||E.call(t,b)}var d=function(f){var F;n.value||!e.value||(f==null||(F=f.stopPropagation)===null||F===void 0||F.call(f),e.value.click())},y=function(f){var F,E;(F=U.value)===null||F===void 0||F.forEach(function(R){var B;(B=R.xhrReq)===null||B===void 0||B.abort()}),m.value=!1,l.value?j.value=[]:$(P.value.map(function(R){return R.status!=="success"?qe(qe({},R),{},{status:"waiting"}):R}),{trigger:"abort"}),f!=null&&f.file&&!l.value&&(k==null||k({file:f.file,e:f.e,index:0})),(E=t.onCancelUpload)===null||E===void 0||E.call(t)};return{t:_,locale:D,classPrefix:p,triggerUploadText:O,toUploadFiles:j,uploadValue:P,displayFiles:C,sizeOverLimitMessage:M,uploading:m,tipsClasses:w,errorClasses:x,placeholderClass:I,inputRef:e,disabled:n,xhrReq:U,uploadFilePercent:q,uploadFiles:ae,onFileChange:W,onNormalFileChange:Q,onDragFileChange:te,onPasteFileChange:le,onInnerRemove:k,triggerUpload:d,cancelUpload:y}}/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ya(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),a.push.apply(a,n)}return a}function Sr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ya(Object(a),!0).forEach(function(n){V(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ya(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var jr=Y({name:"TUpload",props:rr,setup:function(e,a){var n=a.slots,l=a.expose,o=Ge(),s=de(),c=Fr(e),i=c.locale,v=c.classPrefix,u=c.triggerUploadText,h=c.toUploadFiles,_=c.displayFiles,p=c.uploadValue,S=c.sizeOverLimitMessage,N=c.uploading,P=c.tipsClasses,$=c.errorClasses,U=c.placeholderClass,j=c.inputRef,M=c.onInnerRemove,D=c.uploadFiles,w=c.onNormalFileChange,x=c.onDragFileChange,I=c.onPasteFileChange,O=c.triggerUpload,m=c.cancelUpload,C=c.uploadFilePercent,q=ba(),H=ke({UploadIcon:tl}),G=H.UploadIcon,L=g(function(){var d,y;return((d=e.triggerButtonProps)===null||d===void 0?void 0:d.default)||((y=e.triggerButtonProps)===null||y===void 0?void 0:y.content)||u.value});l({upload:j.value,uploading:N,triggerUpload:O,uploadFiles:D,cancelUpload:m,uploadFilePercent:C});var T=function(){var y=function(){return e.theme==="file-input"?r(Oe,ne({disabled:q.value,variant:"outline"},e.triggerButtonProps),{default:function(){return[L.value]}}):r(Oe,ne({disabled:q.value,variant:"outline",icon:function(){return r(G,null,null)}},e.triggerButtonProps),{default:function(){return[L.value]}})};return o("default","trigger",{params:{dragActive:!1,files:p.value}})||y()},z=g(function(){return{accept:e.accept,files:p.value,toUploadFiles:h.value,displayFiles:_.value,theme:e.theme,placeholder:e.placeholder,disabled:q.value,tips:e.tips,status:e.status,sizeOverLimitMessage:S.value,uploading:N.value,classPrefix:v.value,tipsClasses:P,errorClasses:$,placeholderClass:U,locale:i.value,autoUpload:e.autoUpload,abridgeName:e.abridgeName,showUploadProgress:e.showUploadProgress,fileListDisplay:e.fileListDisplay,onRemove:M,uploadPastedFiles:e.uploadPastedFiles,onPasteFileChange:I,imageViewerProps:e.imageViewerProps}}),A={onDragFileChange:x,onDragenter:e.onDragenter,onDragleave:e.onDragleave,onDrop:e.onDrop},W=g(function(){return["".concat(v.value,"-upload"),V({},"".concat(v.value,"-upload--theme-").concat(e.theme),e.theme==="file-input")]}),Q=function(){return r(ur,ne(z.value,{multiple:e.multiple}),{default:function(){return[r("div",{class:"".concat(v.value,"-upload__trigger"),onClick:O},[T()])]},fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},te=function(){return r(cr,ne(z.value,{dragEvents:A,trigger:e.trigger,cancelUpload:m,triggerUpload:O,uploadFiles:D,onCancelUpload:e.onCancelUpload}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},le=function(){return r(vr,ne(z.value,{multiple:e.multiple,max:e.max,showUploadProgress:e.showUploadProgress,triggerUpload:O,uploadFiles:D,cancelUpload:m,onPreview:e.onPreview,showImageFileName:e.showImageFileName}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},ae=function(){return r(fr,ne(z.value,{isBatchUpload:e.isBatchUpload,draggable:e.draggable,dragEvents:A,uploadFiles:D,cancelUpload:m,onPreview:e.onPreview,showImageFileName:e.showImageFileName,showThumbnail:e.showThumbnail,uploadButton:e.uploadButton,cancelUploadButton:e.cancelUploadButton}),{default:function(){return[r("div",{class:"".concat(v.value,"-upload__trigger"),onClick:O},[!e.draggable&&T()])]},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"]})},k=function(){return r(gr,ne(z.value,{draggable:e.draggable,dragContent:e.dragContent,dragEvents:A,triggerUpload:O,trigger:e.trigger,childrenNode:n.default}),{default:function(){return[T()]},dragContent:n.dragContent,"drag-content":n["drag-content"],trigger:n.trigger})};return function(){return r("div",{class:W.value,onPaste:e.uploadPastedFiles?I:void 0},[r("input",ne({ref:j,type:"file",disabled:q.value,onChange:w,multiple:e.multiple,accept:e.accept,hidden:!0},e.inputAttributes?Sr({},e.inputAttributes):{}),null),["file","file-input"].includes(e.theme)&&!e.draggable&&Q(),["file","image"].includes(e.theme)&&e.draggable&&te(),e.theme==="image"&&!e.draggable&&le(),["image-flow","file-flow"].includes(e.theme)&&ae(),e.theme==="custom"&&k(),Boolean(e.tips||n.tips)&&r("small",{class:[P,V({},"".concat(v.value,"-upload__tips-").concat(e.status),e.status)]},[s("tips")]),S.value&&r("small",{class:$},[S.value])])}}});/**
|
|
* tdesign v1.9.9
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Vr=xe(jr);export{Nr as D,Rr as L,Mr as R,$r as T,Vr as U,Tr as a};
|