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