mirror of
https://github.com/silenty4ng/k5web
synced 2024-11-14 14:33:23 +00:00
211 lines
117 KiB
JavaScript
211 lines
117 KiB
JavaScript
import{u as ie,r as ue,_ as ce,o as Oa,i as Ta,h as We,a as Te,j as Ra,k as Na,C as Qe,E as Xe}from"./dialog.73c17aac.js";import{d as J,c as d,aI as l,aK as Pe,f as Z,w as de,t as ye,i as Va,n as Ke,o as et,bB as re,bs as Aa,bD as wa,bx as Ha,bn as Ka,bo as qa,bC as Xa,b as Za,aU as tt,h as Ga}from"./arco.f43727df.js";import{J as at,K as xe,A as ve,B as Fe,w as Me,af as _a,z as Ue,M as Ce,al as Ya,G as Ze,y as it}from"./index.d71b519a.js";import{I as Ja,u as fe,i as Ye,_ as he,c as T,a as ut,C as Wa,b as Pa,L as Re,m as Qa,y as en,f as oe}from"./index.ed276415.js";import{l as _e,c as nt,d as Ca,a as tn,h as an,b as nn,C as rn,B as Fa}from"./form-model.2f493ee1.js";import{v as ln,o as on,b as un,T as Ge,w as cn,x as sn,y as vn,c as dn,m as fn,z as gn,B as mn,i as pn,u as hn,D as yn,q as bn}from"./dep-6deb4e3a.4815796f.js";import{L as rt}from"./index.a213dd7f.js";import{B as pe}from"./index.d3682b1c.js";import{D as On}from"./index.39935f13.js";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 st(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 wn={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"}}]},_n=J({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(()=>st(st({},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 Sa=_n;function vt(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 dt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?vt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):vt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Pn={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"}}]},Cn=J({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(()=>dt(dt({},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 Fn=Cn;function ft(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 gt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ft(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ft(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Sn={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"}}]},jn=J({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(()=>gt(gt({},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(Sn,i.value)}});const xn=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 pt(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 In={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"}}]},Dn=J({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(()=>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(In,i.value)}});const zn=Dn;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 yt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ht(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ht(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var En={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"}}]},Un=J({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(()=>yt(yt({},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(En,i.value)}});const kn=Un;function bt(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 Ot(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?bt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):bt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ln={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"}}]},Mn=J({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(()=>Ot(Ot({},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(Ln,i.value)}});const Bn=Mn;function wt(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 _t(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):wt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var $n={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"}}]},Tn=J({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(()=>_t(_t({},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 Rn=Tn;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 Ct(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 Nn={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"}}]},Vn=J({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(()=>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(Nn,i.value)}});const ja=Vn;function Ft(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 St(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ft(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ft(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:"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"}}]},Hn=J({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(()=>St(St({},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 xa=Hn;function jt(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 xt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):jt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Kn={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"}}]},qn=J({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(()=>xt(xt({},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 It(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 Dt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?It(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):It(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:"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"}}]},Gn=J({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(()=>Dt(Dt({},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 Rl=Gn;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 Et(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){ce(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 Yn={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"}}]},Jn=J({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(()=>Et(Et({},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 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 kt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ut(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ut(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Qn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 23a11 11 0 110-22 11 11 0 010 22zm1-17.5h-2v6.91l4 4L16.41 15 13 11.59V5.5z"}}]},er=J({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(()=>kt(kt({},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 Ia=er;function Lt(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?Lt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Lt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var tr={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"}}]},ar=J({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(()=>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(tr,i.value)}});const nr=ar;function Bt(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 $t(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Bt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Bt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var rr={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"}}]},lr=J({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(()=>$t($t({},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(rr,i.value)}});const or=lr;function Tt(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 Rt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Tt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ir={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"}}]},ur=J({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(()=>Rt(Rt({},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(ir,i.value)}});const cr=ur;function Nt(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?Nt(Object(a),!0).forEach(function(n){ce(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Nt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var sr={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"}}]},vr=J({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(()=>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(sr,i.value)}});const dr=vr;/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var fr={align:{type:String,validator:function(e){return e?["start","end","center","baseline"].includes(e):!0}},breakLine:Boolean,direction:{type:String,default:"horizontal",validator:function(e){return e?["vertical","horizontal"].includes(e):!0}},separator:{type:[String,Function]},size:{type:[String,Number,Array],default:"medium"}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function At(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?At(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):At(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Kt={small:"8px",medium:"16px",large:"24px"},gr=Ja(),mr=J({name:"TSpace",props:Ht(Ht({},fr),{},{forceFlexGapPolyfill:Boolean}),setup:function(e){var a=fe("space"),n=ve(),r=ln(),o=d(function(){return e.forceFlexGapPolyfill||gr}),s=d(function(){var i="";at(e.size)?i=e.size.map(function(w){return Ye(w)?"".concat(w,"px"):xe(w)&&Kt[w]||w}).join(" "):xe(e.size)?i=Kt[e.size]||e.size:Ye(e.size)&&(i="".concat(e.size,"px"));var v={};if(o.value){var u=i.split(" "),f=he(u,2),y=f[0],m=f[1];v["--td-space-column-gap"]=y,v["--td-space-row-gap"]=m||y}else v.gap=i;return v});function c(){var i=r(),v=n("separator");return i.map(function(u,f){var y=f+1!==i.length&&v;return l(Pe,null,[l("div",{class:"".concat(a.value,"-item")},[u]),y&&l("div",{class:"".concat(a.value,"-item-separator")},[v])])})}return function(){var i=["".concat(a.value),T(T(T(T({},"".concat(a.value,"-align-").concat(e.align),e.align),"".concat(a.value,"-").concat(e.direction),e.direction),"".concat(a.value,"--break-line"),e.breakLine),"".concat(a.value,"--polyfill"),o.value)];return l("div",{class:i,style:s.value},[c()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var qt=Fe(mr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var pr=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp)/i,hr=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp|.dwg|.dxf|.svf|.tif|.tiff|.arw)/i,yr=/(.pdf)/i,br=/(.xlsx|.xls|.csv|.xlc|.xlm|.xlt|.xlw)/i,Or=/(.dox|docx|.document|.wps|.wdb|.msword)/i,wr=/(.ppt|.pptx|.key)/i,Da=/(.avi|.mp4|.wmv|.mpg|.mpeg|.mov|.rm|.ram|.swf|.flv|.rmvb|.flash|.mid|.3gp)/i,_r=/(.mp2|.mp3|.mp4|.ogg|.3gpp|.ac3|.au)/i,Xt={"audio/*":_r,"video/*":Da,"image/*":hr,".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 Pr(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 za(){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 Ee(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 Cr(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 Fr(t,e,a){var n=["B","KB","MB","GB"],r=1,o=n.indexOf(a);o===-1&&(_e.warn("Upload","`sizeLimit.unit` can only be one of ".concat(n.join())),o=r);var s=me[a];return t>e*s}function Sr(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 jr(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(Xt[c]&&Xt[c].test(n))return!0;var i=new RegExp(c,"i");if(i.test(n))return!0}return!1}function Ea(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],n=0;n<t.length;n++)jr(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 de([t],function(a,n){var r=he(a,1),o=r[0],s=he(n,1),c=s[0];if(c!==o){if(typeof o=="string"){e.value=o;return}Sr(o).then(function(i){e.value=i})}},{immediate:!0}),{previewUrl:e}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ge,xr=`
|
|
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
|
|
`,Ir=["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 Dr(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=Ir.map(function(s){return"".concat(s,":").concat(e.getPropertyValue(s))}).join(";");return{sizingStyle:o,paddingSize:n,borderSize:r,boxSizing:a}}}function Zt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;ge||(ge=document.createElement("textarea"),document.body.appendChild(ge));var n=Dr(t),r=n.paddingSize,o=n.borderSize,s=n.boxSizing,c=n.sizingStyle;ge.setAttribute("style","".concat(c,";").concat(xr)),ge.value=t.value||t.placeholder||"";var i=ge.scrollHeight,v={};s==="border-box"?i+=o:s==="content-box"&&(i-=r),ge.value="";var u=ge.scrollHeight-r;if(e!==null){var f=u*e;s==="border-box"&&(f=f+r+o),i=Math.max(f,i),v.minHeight="".concat(f,"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"),ge.parentNode&&ge.parentNode.removeChild(ge),ge=null,v}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var zr={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 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 Er(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){T(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}function Yt(t){var e={};return Object.keys(t).forEach(function(a){nn(t[a])||(e[a]=t[a])}),e}var Ur=J({name:"TTextarea",inheritAttrs:!1,props:Er({},zr),setup:function(e,a){var n=a.attrs,r=a.expose,o=fe(),s=fe("textarea"),c=d(function(){return"".concat(s.value,"__tips")}),i=d(function(){return"".concat(s.value,"__limit")}),v=ye(e),u=v.value,f=v.modelValue,y=nt(u,f,e.defaultValue,e.onChange),m=he(y,2),w=m[0],N=m[1],_=Ca(),M=Z({}),I=Z(),P=Z(!1),k=Z(!1),S=function(){var g;return(g=I.value)===null||g===void 0?void 0:g.focus()},b=function(){var g;return(g=I.value)===null||g===void 0?void 0:g.blur()},F=function(){var g;if(e.autosize===!0)M.value=Zt(I.value);else if(e.autosize&&Me(e.autosize)==="object"){var x=e.autosize,H=x.minRows,K=x.maxRows;M.value=Zt(I.value,H,K)}else n.rows?M.value={height:"auto",minHeight:"auto"}:n.style&&(g=I.value)!==null&&g!==void 0&&(g=g.style)!==null&&g!==void 0&&g.height&&(M.value={height:I.value.style.height})},j=function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",x=I.value,H=String(g);!x||x.value!==H&&(x.value=H,w.value=H)},C=function(g){var x=g.target,H=x.value;if(e.maxcharacter&&e.maxcharacter>=0){var K=ut(H,e.maxcharacter);H=Me(K)==="object"&&K.characters}!k.value&&N(H,{e:g}),Ke(function(){return j(H)}),F()},h=function(g){C(g)},D=function(){k.value=!0},Y=function(g){k.value=!1,C(g)},ee=function(g,x){var H;if(!_.value){var K="on".concat(g[0].toUpperCase()).concat(g.slice(1));(H=e[K])===null||H===void 0||H.call(e,w.value,{e:x})}},X=function(g){ee("keydown",g)},R=function(g){ee("keyup",g)},V=function(g){ee("keypress",g)},B=function(g){var x;F(),!_.value&&(P.value=!0,(x=e.onFocus)===null||x===void 0||x.call(e,w.value,{e:g}))},A=Va(tn,void 0),p=function(g){var x;F(),P.value=!1,(x=e.onBlur)===null||x===void 0||x.call(e,w.value,{e:g}),A==null||A.handleBlur()},z=d(function(){return[s.value,T(T({},"".concat(o.value,"-is-disabled"),_.value),"".concat(o.value,"-is-readonly"),e.readonly)]}),$=d(function(){return Yt({autofocus:e.autofocus,disabled:_.value,readonly:e.readonly,placeholder:e.placeholder,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0})}),W=d(function(){var O=ut(String(w.value||""));return Me(O)==="object"?O.length:O}),Q=d(function(){return{value:[void 0,null].includes(w.value)?void 0:String(w.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}),E=an(Q),U=E.tStatus;de(function(){return w.value},function(){return F()}),de(I,function(O){!O||F()}),de(function(){return e.autofocus},function(O){O&&I.value.focus()}),de(M,function(O){var g=n.style;Wa(I.value,_a(g,O))}),de(w,function(){Ke(function(){return F()})}),de(function(){return e.autosize},F,{deep:!0}),r({focus:S,blur:b}),et(function(){F()});var L=ve();return function(){var O,g=Yt({onFocus:B,onBlur:p,onKeydown:X,onKeyup:R,onKeypress:V}),x=Pa(),H=x.STATUS,K=d(function(){return["".concat(s.value,"__inner"),T(T(T(T({},"".concat(o.value,"-is-").concat(U.value),U.value),H.value.disabled,_.value),H.value.focused,P.value),"".concat(o.value,"-resize-none"),Me(e.autosize)==="object"),"narrow-scrollbar"]}),q=L("tips"),ae=q&&l("div",{class:"".concat(c.value," ").concat(s.value,"__tips--").concat(e.status||"normal")},[q]),le=e.maxcharacter&&l("span",{class:i.value},["".concat(W.value,"/").concat(e.maxcharacter)])||!e.maxcharacter&&e.maxlength&&l("span",{class:i.value},["".concat(w.value?(O=String(w.value))===null||O===void 0?void 0:O.length:0,"/").concat(e.maxlength)]);return l("div",re({class:z.value},on(n,["style"])),[l("textarea",re({onInput:h,onCompositionstart:D,onCompositionend:Y,ref:I,value:w.value,class:K.value},g,$.value),null),ae||le?l("div",{class:["".concat(s.value,"__info_wrapper"),T({},"".concat(s.value,"__info_wrapper_align"),!ae)]},[ae,le]):null])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Nl=Fe(Ur);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var kr={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 Lr=J({name:"TImage",props:kr,setup:function(e){var a=Z(null),n=Z(null),r=null,o=ye(e),s=o.src,c=ve();et(function(){var R;if((R=n.value)!==null&&R!==void 0&&R.complete&&!e.lazy&&I(),!(!e.lazy||!a.value)){var V=un(a.value,null,N,0);r=V}}),Aa(function(){a.value&&r&&r.unobserve(a.value)});var i=Ue("image"),v=i.classPrefix,u=i.globalConfig,f=Z(s.value);de([s,u],function(R){var V=he(R,2),B=V[0],A=V[1],p=A||{},z=p.replaceImageSrc,$=Ce(z)?z(e):B;$===f.value&&f.value||(f.value=$)},{immediate:!0});var y=qe(f),m=y.previewUrl;de([m],function(){P.value=!1,_.value=!1});var w=Z(!e.lazy),N=function(){w.value=!0},_=Z(!1),M=function(V){var B;_.value=!0,(B=e.onLoad)===null||B===void 0||B.call(e,{e:V})},I=function(){var V=new Event("load");Object.defineProperty(V,"target",{value:n.value,enumerable:!0}),M(V)},P=Z(!1),k=function(V){var B;P.value=!0,(B=e.onError)===null||B===void 0||B.call(e,{e:V}),e.fallback&&(f.value=e.fallback,P.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)},C=function(){var V=c("placeholder");return V?l("div",{class:"".concat(v.value,"-image__placeholder")},[V]):null},h=function(){return e.gallery?l("div",{class:"".concat(v.value,"-image__gallery-shadow")},null):null},D=function(){var V=X("overlayContent");return V?l("div",{class:["".concat(v.value,"-image__overlay-content"),!F.value&&"".concat(v.value,"-image__overlay-content--hidden")]},[V]):null};function Y(){return l("picture",null,[Object.entries(e.srcset).map(function(R){var V=he(R,2),B=V[0],A=V[1];return l("source",{type:B,srcset:A},null)}),ee()])}function ee(){var R=typeof f.value=="string"?f.value:m.value;return l("img",{ref:n,src:R,onError:k,onLoad:M,class:b.value,alt:e.alt,referrerpolicy:e.referrerpolicy},null)}var X=Ya();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},Oa(e,["src","alt","fit","position","shape","placeholder","loading","error","overlayTrigger","overlayContent","lazy","gallery","onLoad","onError"])),[C(),h(),(P.value||!w.value)&&l("div",{class:"".concat(v.value,"-image")},null),!(P.value||!w.value)&&(e.srcset&&Object.keys(e.srcset).length?Y():ee()),!(P.value||!w.value)&&!_.value&&l("div",{class:"".concat(v.value,"-image__loading")},[c("loading")||l(qt,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(xa,{size:"24px"},null),typeof e.loading=="string"?e.loading:u.value.loadingText]}})]),P.value&&l("div",{class:"".concat(v.value,"-image__error")},[X("error",{defaultNode:l(qt,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(ja,{size:"24px"},null),typeof e.error=="string"?e.error:u.value.errorText]}})})]),D()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var $e=Fe(Lr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Be={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 we=J({name:"TImageModalIcon",props:{disabled:Boolean,onClick:Function,label:String,icon:Function},setup:function(e){var a=fe(),n=ve(),r=d(function(){return["".concat(a.value,"-image-viewer__modal-icon"),T({},"".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 Jt(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 Mr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Jt(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Jt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Br=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),f=document.createElement("a");f.download=s,f.href=u,f.click(),f.remove(),URL.revokeObjectURL(u)})},o.src=e},$r=function(e){return!!e&&!xe(e)&&!(e instanceof File)},Tr=function(e){return at(e)?e.map(function(a){return $r(a)?Mr({download:!0,thumbnail:a.mainImage},a):{mainImage:a,thumbnail:a,download:!0}}):[]},Rr=function(e){return e.showOverlay!==void 0?e.showOverlay:e.mode==="modal"};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ua=J({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=fe(),n=d(function(){return e.currentImage.mainImage}),r=qe(n),o=r.previewUrl,s=Ue("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(we,{onClick:e.onMirror,icon:function(){return l(Xn,{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(we,{onClick:e.onRotate,icon:function(){return l(Wn,{size:"medium"},null)}},null)]}}),l(we,{icon:function(){return l(dr,{size:"medium"},null)},onClick:e.onZoomOut},null),l(we,{class:"".concat(a.value,"-image-viewer__utils-scale"),size:"medium",label:"".concat(cn(String(e.scale*100)),"%")},null),l(we,{icon:function(){return l(cr,{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(we,{icon:function(){return l(xa,{size:"medium"},null)},onClick:e.onReset},null)])]}}),e.currentImage.download&&l(we,{icon:function(){return l(Fn,{size:"medium"},null)},onClick:function(){Br(o.value)}},null)])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Wt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Nr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Wt(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Wt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Vr(t){var e=Z(t),a=function(o){var s=o.pageX,c=o.pageY,i=e.value,v=i.translateX,u=i.translateY,f=function(w){var N=w.pageX,_=w.pageY;e.value={translateX:v+N-s,translateY:u+_-c}},y=function m(){document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",m)};document.addEventListener("mousemove",f),document.addEventListener("mouseup",y)},n=function(){e.value=Nr({},t)};return{transform:e,mouseDownHandler:a,resetTransform:n}}function Ar(){var t=Z(1),e=function(){t.value*=-1},a=function(){t.value=1};return{mirror:t,onMirror:e,resetMirror:a}}function Hr(){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 f=sn(o.value,n);v(f)},c=function(){var f=vn(o.value,n);v(f)},i=function(){o.value=r!=null?r:1},v=function(f){var y=f;f<a&&(y=a),f>e&&(y=e),o.value=y};return de(function(){return t},function(){return i()}),{scale:o,onZoomIn:s,onZoomOut:c,resetScale:i}}function Kr(){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 ka=J({name:"TImageItem",props:{rotate:Number,scale:Number,mirror:Number,src:[String,Object],placementSrc:[String,Object]},setup:function(e){var a=ye(e),n=a.src,r=a.placementSrc,o=fe(),s=Z(!1),c=Z(!1),i=Vr({translateX:0,translateY:0}),v=i.transform,u=i.mouseDownHandler,f=Ue("imageViewer"),y=f.globalConfig,m=y.value.errorText,w=d(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:!e.placementSrc||c.value?"block":"none"}}),N=d(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:c.value?"none":"block"}}),_=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),P=I.previewUrl,k=qe(r),S=k.previewUrl;return de([P,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:_.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(ja,{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:N.value,alt:"image",draggable:"false"},null),!s.value&&P.value&&l("img",{class:"".concat(o.value,"-image-viewer__modal-image"),onMousedown:function(F){F.stopPropagation(),u(F)},src:P.value,onLoad:function(){return c.value=!0},onError:function(){return s.value=!0},style:w.value,alt:"image",draggable:"false"},null)])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var qr=J({name:"TImageViewerModal",props:{zIndex:Number,visible:Boolean,index:Number,images:Be.images,scale:Number,rotate:Number,mirror:Number,title:Be.title,currentImage:{type:Object,default:function(){return{}}},onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,onClose:Be.onClose,draggable:{type:Boolean,default:!0},viewerScale:{type:Object,default:function(){return{}}},showOverlay:Boolean,closeBtn:Be.closeBtn},setup:function(e){var a=fe(),n=ve(),r=d(function(){return{minWidth:e.viewerScale.minWidth,minHeight:e.viewerScale.minHeight}});return function(){return l(On,{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(Ua,{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(ka,{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 ze=function(t){return t.left="ArrowLeft",t.up="ArrowUp",t.right="ArrowRight",t.down="ArrowDown",t.esc="Escape",t}(ze||{});/**
|
|
* 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){T(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 Zr=J({name:"TImageViewer",props:Xr({},Be),setup:function(e){var a,n=fe(),r=fe("image-viewer"),o=ve(),s=Z(!0),c=d(function(){return Rr(e)}),i=ye(e),v=i.index,u=i.visible,f=i.modelValue,y=dn(v,(a=e.defaultIndex)!==null&&a!==void 0?a:0,e.onIndexChange,"index"),m=he(y,2),w=m[0],N=m[1],_=nt(u,f,e.defaultVisible,function(){},"visible"),M=he(_,2),I=M[0],P=M[1],k=Z(!0),S=Z(),b=d(function(){return[r.value,"".concat(r.value,"-preview-image"),T({},"".concat(n.value,"-is-hide"),!I.value)]}),F=d(function(){return["".concat(n.value,"-image-viewer__modal-header"),T({},"".concat(n.value,"-is-show"),s.value)]}),j=d(function(){var te;return(te=e.zIndex)!==null&&te!==void 0?te:2600}),C=function(){s.value=!s.value},h=Ar(),D=h.mirror,Y=h.onMirror,ee=h.resetMirror,X=Hr(e.imageScale),R=X.scale,V=X.onZoomIn,B=X.onZoomOut,A=X.resetScale,p=Kr(),z=p.rotate,$=p.onRotate,W=p.resetRotate,Q=function(){ee(),A(),W()},E=d(function(){return Tr(e.images)}),U=d(function(){var te;return(te=E.value[w.value])!==null&&te!==void 0?te:{mainImage:""}}),L=Ta("dialog",{visible:I}),O=L.isLastDialog,g=function(){var G=w.value-1;Q(),N(G<0?0:G,{trigger:"prev"})},x=function(){var G=w.value+1;Q(),N(G>=E.value.length?w.value:G,{trigger:"next"})},H=function(G){N(G,{trigger:"current"})},K=function(){P(!0)},q=function(G){var ne;P(!1),(ne=e.onClose)===null||ne===void 0||ne.call(e,G)},ae=function(G){q({e:G,trigger:"close-btn"})},le=function(G){e.closeOnOverlay&&q({e:G,trigger:"overlay"})},be=function(G){switch(G.stopPropagation(),G.code){case ze.left:g();break;case ze.right:x();break;case ze.up:V();break;case ze.down:B();break;case ze.esc:e.closeOnEscKeydown&&O()&&q({e:G,trigger:"esc"});break}},Se=Z();de(function(){return I.value},function(te){clearTimeout(S.value),te?(k.value=!1,Ke().then(function(){var G,ne;(G=Se.value)===null||G===void 0||(ne=G.focus)===null||ne===void 0||ne.call(G)}),Q()):S.value=setTimeout(function(){k.value=!0},200)});var Oe=function(G){G.preventDefault();var ne=G.deltaY;ne>0?B():V()},je=d(function(){return{transform:"translateX(calc(-".concat(w.value," * (40px / 9 * 16 + 4px)))")}}),ke=function(){return l("div",{class:F.value},[l(we,{icon:function(){return l(fn,null,null)},class:"".concat(r.value,"__header-pre-bt"),onClick:C},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"),T({},"".concat(n.value,"-is-active"),ne===w.value)]},[l($e,{src:G.thumbnail||G.mainImage,error:"",className:"".concat(r.value,"__header-img"),onClick:function(){return H(ne)}},null)])})])])])},Ie=function(G){var ne=G==="prev"?0:180,De=o("navigationArrow",l(gn,{style:{transform:"rotate(".concat(ne,"deg)")},size:"24px"},null));return l(we,{class:"".concat(r.value,"__modal-").concat(G,"-bt"),onClick:G==="prev"?g:x,icon:function(){return De}},null)},Le=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(We,{size:"24px"},null))])};return function(){return e.mode==="modeless"?l(Pe,null,[o("trigger",{params:{open:K}}),l(qr,{zIndex:j.value,visible:I.value,index:w.value,images:E.value,scale:R.value,rotate:z.value,mirror:D.value,currentImage:U.value,onRotate:$,onZoomIn:V,onZoomOut:B,onMirror:Y,onReset:Q,onClose:q,draggable:e.draggable,showOverlay:c.value,title:e.title},null)]):l(Pe,null,[o("trigger",{params:{open:K}}),l(wa,{to:"body"},{default:function(){return[l(Ha,null,{default:function(){return[(I.value||!k.value)&&Ka(l("div",{ref:Se,class:b.value,style:{zIndex:j.value},onWheel:Oe,tabindex:-1,onKeydown:be},[!!c.value&&l("div",{class:"".concat(r.value,"__modal-mask"),onClick:le},null),E.value.length>1&&l(Pe,null,[ke(),l("div",{class:"".concat(r.value,"__modal-index")},[e.title&&o("title"),"".concat(w.value+1,"/").concat(E.value.length)]),Ie("prev"),Ie("next")]),Le(),l(Ua,{onZoomIn:V,onZoomOut:B,onMirror:Y,onReset:Q,onRotate:$,scale:R.value,currentImage:U.value},null),l(ka,{scale:R.value,rotate:z.value,mirror:D.value,src:U.value.mainImage,placementSrc:U.value.thumbnail},null)]),[[qa,I.value]])]}})]}})])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var lt=Fe(Zr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var La={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 Ma=J({name:"TListItem",props:La,setup:function(){var e=fe("list-item"),a=ve();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 ea="load-more",Gr="loading";/**
|
|
* 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){T(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}function Yr(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=Jr(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 Jr(t,e){if(!!t){if(typeof t=="string")return na(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 na(t,e)}}function na(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 Wr=function(){var e=mn(),a=d(function(){var n=[],r=e("ListItem");if(at(r)){var o=Yr(r),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n.push(aa(aa({},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 Qr=function(e,a,n){var r=d(function(){return{data:n.value,scroll:e}}),o=pn(a,r),s=d(function(){return o.isVirtualScroll.value}),c=-1,i=function(y){var m=y.target||y.srcElement,w=m.scrollTop;c!==w?o.isVirtualScroll.value&&o.handleScroll():c=-1,c=w},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 ra(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 el(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ra(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var tl=J({name:"TList",props:el({},La),setup:function(e){var a=Z(),n=Ue("list"),r=n.globalConfig,o=fe("list"),s=Pa(),c=s.SIZE,i=ve(),v=Wr(),u=v.listItems,f=Qr(e.scroll,a,u),y=f.virtualConfig,m=f.cursorStyle,w=f.listStyle,N=f.isVirtualScroll,_=f.onInnerVirtualScroll,M=d(function(){return["".concat(o.value),c.value[e.size],T(T(T({},"".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"),C=i("footer"),h=y.isVirtualScroll.value;return l(Pe,null,[j?l("div",{class:"".concat(o.value,"__header")},[j]):null,h?l(Pe,null,[l("div",{style:m.value},null),l("ul",{class:"".concat(o.value,"__inner"),style:w.value},[y.visibleData.value.map(function(D){return l(Pe,null,[l(Ma,Oa(D,"slots"),D.slots)])})])]):l("ul",{class:"".concat(o.value,"__inner")},[i("default")]),C?l("div",{class:"".concat(o.value,"__footer")},[C]):null])},P=function(j){var C,h=j.target,D=h.scrollTop,Y=h.scrollHeight,ee=h.clientHeight;N.value&&_(j),(C=e.onScroll)===null||C===void 0||C.call(e,{e:j,scrollTop:D,scrollBottom:Y-ee-D})},k=d(function(){return xe(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&&xe(e.asyncLoading)){if(e.asyncLoading===Gr)return l("div",null,[l(Re,null,null),l("span",null,[r.value.loadingText])]);if(e.asyncLoading===ea)return l("span",null,[r.value.loadingMoreText])}return i("asyncLoading")},b=function(j){var C;xe(e.asyncLoading)&&e.asyncLoading!==ea||(C=e.onLoadMore)===null||C===void 0||C.call(e,{e:j})};return{COMPONENT_NAME:o,listClass:M,loadingClass:k,renderLoading:S,renderContent:I,handleScroll:P,handleLoadMore:b,listRef:a,isVirtualScroll:N}},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 al={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 nl=J({name:"TListItemMeta",props:al,setup:function(e,a){var n=fe("list-item__meta"),r=Ze(),o=ve(),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 xe(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 Vl=Fe(tl),Al=Fe(Ma);Fe(nl);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var rl={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 ll=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,f=v.y,y=document.documentElement.clientHeight,m=document.documentElement.clientWidth,w=8,N=8;if(a.value&&e.sizeDraggable){if(e.placement==="right"){var _=Math.min(Math.max(m-u+N,N),m);n.value="".concat(_,"px")}if(e.placement==="left"){var M=Math.min(Math.max(u+N,N),m);n.value="".concat(M,"px")}if(e.placement==="top"){var I=Math.min(Math.max(f+w,w),y);n.value="".concat(I,"px")}if(e.placement==="bottom"){var P=Math.min(Math.max(y-f+w,w),y);n.value="".concat(P,"px")}}},c=d(function(){var i=["right","left"].includes(e.placement),v={left:"right",right:"left",top:"bottom",bottom:"top"};return T(T(T(T({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 ol=1,il=J({name:"TDrawer",inheritAttrs:!1,props:rl,emits:["update:visible"],setup:function(e,a){var n=Z(!1),r=Z(!1),o=Z(),s=Z(),c=Ue("drawer"),i=c.globalConfig,v=Te({CloseIcon:We}),u=v.CloseIcon,f=ve(),y=Ze(),m=fe("drawer"),w=ll(e),N=w.draggedSizeValue,_=w.enableDrag,M=w.draggableLineStyles,I=Qa(function(){return e.attach}),P=function(U){var L;(L=e.onConfirm)===null||L===void 0||L.call(e,{e:U})},k=function(U){var L;(L=e.onCancel)===null||L===void 0||L.call(e,{e:U}),Q({trigger:"cancel",e:U})},S=Ra({confirmBtnAction:P,cancelBtnAction:k}),b=S.getConfirmBtn,F=S.getCancelBtn,j=Z(null),C=d(function(){return[m.value,"".concat(m.value,"--").concat(e.placement),T(T(T({},"".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(N.value)return N.value;var U=(E=e.size)!==null&&E!==void 0?E:i.value.size,L=isNaN(Number(U))?U:"".concat(U,"px");return{small:"300px",medium:"500px",large:"760px"}[U]||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()}),R=d(function(){return{display:"flex",justifyContent:e.placement==="right"?"flex-start":"flex-end"}}),V=function(U){var L;if(((L=e.closeOnEscKeydown)!==null&&L!==void 0?L:i.value.closeOnEscKeydown)&&U.key==="Escape"&&r.value){var O;(O=e.onEscKeydown)===null||O===void 0||O.call(e,{e:U}),Q({trigger:"esc",e:U})}},B=function(){clearTimeout(s.value),s.value=setTimeout(function(){var U,L;(U=o.value)===null||U===void 0||(U=U.parentNode)===null||U===void 0||(L=U.removeChild)===null||L===void 0||L.call(U,o.value)},150)},A=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 U={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+=U:ee.value.style.cssText=ee.value.style.cssText.replace(/margin:.+;/,"")}},z=function(){var U=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:R.value},[e.placement==="right"?U:null,L,e.placement!=="right"?U:null])};de(X,function(){A()},{immediate:!0}),de(function(){return e.visible},function(E){en||(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(U){var L;(L=e.onCloseBtnClick)===null||L===void 0||L.call(e,{e:U}),Q({trigger:"close-btn",e:U})},W=function(U){var L,O;(L=e.onOverlayClick)===null||L===void 0||L.call(e,{e:U}),((O=e.closeOnOverlayClick)!==null&&O!==void 0?O:i.value.closeOnOverlayClick)&&Q({trigger:"overlay",e:U})},Q=function(U){var L;(L=e.onClose)===null||L===void 0||L.call(e,U),a.emit("update:visible",!1)};return Xa(function(){p()}),et(function(){var E=document.documentElement.scrollHeight>document.documentElement.clientHeight,U=E?Na():0;o.value=document.createElement("style"),o.value.dataset.id="td_drawer_".concat(+new Date,"_").concat(ol+=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(U,"px);"),`
|
|
}
|
|
`),r.value&&!e.showInAttachedElement&&e.preventScrollThrough&&document.head.appendChild(o.value),window.addEventListener("keydown",V)}),Za(function(){B(),window.removeEventListener("keydown",V)}),function(){if(!n.value){var E=y("body","default"),U=f("header"),L=z();return l(wa,{disabled:!e.attach||!I.value,to:I.value},{default:function(){return[l("div",re({ref:j,class:C.value,style:{zIndex:e.zIndex},onKeydown:V,tabindex:0},a.attrs),[e.showOverlay&&l("div",{class:"".concat(m.value,"__mask"),onClick:W},null),l("div",{class:Y.value,style:D.value},[U&&l("div",{class:"".concat(m.value,"__header")},[U]),e.closeBtn&&l("div",{class:"".concat(m.value,"__close-btn"),onClick:$},[f("closeBtn",l(u,null,null))]),l("div",{class:["".concat(m.value,"__body"),"narrow-scrollbar"]},[E]),e.footer&&l("div",{class:"".concat(m.value,"__footer")},[f("footer",L)]),e.sizeDraggable&&l("div",{style:M.value,onMousedown:_},null)])])]}})}}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Hl=Fe(il);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ul={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 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 cl(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){T(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 sl(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!tt(t)}var vl=J({name:"UploadNormalFile",props:cl({multiple:Boolean},Ne),setup:function(e,a){var n=a.slots,r=ye(e),o=r.theme,s=r.disabled,c=r.classPrefix,i=d(function(){return e.locale}),v=Te({CloseIcon:We,TimeFilledIcon:Ia,CheckCircleFilledIcon:Qe,ErrorCircleFilledIcon:Xe,CloseCircleFilledIcon:rn}),u=v.CloseIcon,f=v.TimeFilledIcon,y=v.CheckCircleFilledIcon,m=v.ErrorCircleFilledIcon,w=v.CloseCircleFilledIcon,N=ve(),_="".concat(c.value,"-upload"),M=function(S){return l("div",{class:"".concat(_,"__single-progress")},[l(Re,null,null),e.showUploadProgress&&l("span",{class:"".concat(_,"__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 C=e.abridgeName&&F.name?Ee.apply(void 0,[F.name].concat(oe(e.abridgeName))):F.name;return l("div",{class:"".concat(_,"__single-display-text ").concat(_,"__display-text--margin"),key:F.name+j+F.percent+F.status},[F.url?l(rt,{href:F.url,target:"_blank",hover:"color",size:"small",class:"".concat(_,"__single-name")},sl(C)?C:{default:function(){return[C]}}):l("span",{class:"".concat(_,"__single-name")},[C]),F.status==="fail"&&l("div",{class:"".concat(_,"__flow-status ").concat(_,"__file-fail")},[l(m,null,null)]),F.status==="waiting"&&l("div",{class:"".concat(_,"__flow-status ").concat(_,"__file-waiting")},[l(f,null,null)]),F.status==="progress"&&M(F.percent),!s.value&&F.status!=="progress"&&l(u,{class:"".concat(_,"__icon-delete"),onClick:function(D){var Y=D.e;return e.onRemove({e:Y,file:F,index:j})}},null)])})},P=function(){var S;if(o.value==="file-input"){var b=e.displayFiles[0]||[],F=["".concat(c.value,"-input__inner"),T({},"".concat(_,"__placeholder"),!e.displayFiles[0])],j=s.value?"".concat(c.value,"-is-disabled"):"",C=(S=e.abridgeName)!==null&&S!==void 0&&S.length&&b!==null&&b!==void 0&&b.name?Ee.apply(void 0,[b.name].concat(oe(e.abridgeName))):b==null?void 0:b.name;return l("div",{class:"".concat(_,"__single-input-preview ").concat(c.value,"-input ").concat(j)},[l("div",{class:F},[l("span",{class:["".concat(_,"__single-input-text"),T({},e.placeholderClass,e.placeholder&&!(b!=null&&b.name))]},[b!=null&&b.name?C:e.placeholder]),(b==null?void 0:b.status)==="progress"&&M(b.percent),(b==null?void 0:b.status)==="waiting"&&l(f,{class:"".concat(_,"__status-icon ").concat(_,"__file-waiting")},null),b.status==="success"&&l(y,{class:"".concat(_,"__status-icon")},null),(b==null?void 0:b.name)&&b.status==="fail"&&l(m,{class:"".concat(_,"__status-icon ").concat(_,"__file-fail")},null),Boolean(!s.value&&b.name)&&l(w,{class:"".concat(_,"__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(_,"__single"),"".concat(_,"__single-").concat(o.value)],j=N("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 C=e.displayFiles;return l("div",{class:F},[o.value==="file-input"&&P(),(k=n.default)===null||k===void 0?void 0:k.call(n),o.value==="file"&&e.placeholder&&!C[0]&&l("small",{class:[e.tipsClasses,e.placeholderClass]},[e.placeholder]),j===null?null:j||I(C),!e.multiple&&((S=C[0])===null||S===void 0?void 0:S.status)==="fail"&&o.value==="file"?l("small",{class:[e.errorClasses,e.placeholderClass]},[((b=C[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 ot(t,e){var a=Z(null),n=Z(!1),r=function(v){var u;v.preventDefault(),n.value=!1;var f=v.dataTransfer.files,y=Ea(f,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 oa(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 ia(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?oa(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):oa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var dl=J({name:"UploadDraggerFile",props:ia(ia({},Ne),{},{trigger:Function,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,dragEvents:Object}),setup:function(e,a){var n=a.slots,r=ye(e),o=r.displayFiles,s=r.disabled,c=r.accept,i=d(function(){return e.locale}),v=ve(),u=hn(),f=u.sizeClassNames,y="".concat(e.classPrefix,"-upload"),m=ot(e.dragEvents,c),w=m.dragActive,N=Z(),_=d(function(){var C;return["".concat(y,"__dragger"),T({},"".concat(y,"__dragger-center"),!o.value[0]),T({},"".concat(y,"__dragger-error"),((C=o.value[0])===null||C===void 0?void 0:C.status)==="fail")]}),M=Te({CheckCircleFilledIcon:Qe,ErrorCircleFilledIcon:Xe}),I=M.CheckCircleFilledIcon,P=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(lt,re({images:[Y],trigger:function(X,R){var V=R.open;return l($e,{src:Y||D.raw,onClick:V,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?Ee.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(P,null,null)]),l("small",{class:"".concat(f.small),key:"size"},[i.value.file.fileSizeText,"\uFF1A",Cr(D.size)]),l("small",{class:"".concat(f.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(R){var V;return(V=e.cancelUpload)===null||V===void 0?void 0:V.call(e,{e:R,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 R;return(R=e.uploadFiles)===null||R===void 0?void 0:R.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(R){return e.onRemove({e:R,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 w.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 C;return l("div",{ref:N,class:_.value,onDrop:m.handleDrop,onDragenter:m.handleDragenter,onDragover:m.handleDragover,onDragleave:m.handleDragleave},[((C=e.trigger)===null||C===void 0?void 0:C.call(e,Ga,{files:o.value,dragActive:w.value}))||j()])}}});/**
|
|
* 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 ca(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){T(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 fl(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!tt(t)}var gl=J({name:"UploadImageCard",props:ca(ca({},Ne),{},{multiple:Boolean,max:Number,disabled:Boolean,showUploadProgress:Boolean,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,onPreview:Function,showImageFileName:Boolean}),setup:function(e){var a=ye(e),n=a.displayFiles,r=a.classPrefix,o=a.multiple,s=a.max,c=d(function(){return e.locale}),i=Te({AddIcon:yn,BrowseIcon:Fa,DeleteIcon:Sa,ErrorCircleFilledIcon:Xe}),v=i.BrowseIcon,u=i.DeleteIcon,f=i.AddIcon,y=i.ErrorCircleFilledIcon,m=ve(),w=d(function(){var I;return o.value?!s.value||n.value.length<s.value:!((I=n.value)!==null&&I!==void 0&&I[0])}),N=function(P,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:P.url||P.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(lt,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:P,index:k,e:Y}),j()}},null)}},e.imageViewerProps),null)]),!e.disabled&&l(Pe,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:P,index:k})}},null)])])])])},_=function(P,k){var S;return l("div",{class:[k,"".concat(r.value,"-upload__").concat(e.theme,"-").concat(P.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(P.percent,"%"):""])])},M=function(P,k,S){var b,F;return l("div",{class:S},[l(y,null,null),l("p",null,[((b=P.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(C){return C.stopPropagation()}},[l(u,{onClick:function(C){var h,D=C.e;return e==null||(h=e.onRemove)===null||h===void 0?void 0:h.call(e,{e:D,file:P,index:k})}},null)])])])};return function(){var I,P,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"),C="".concat(r.value,"-upload__card-container ").concat(r.value,"-upload__card-box"),h=e.abridgeName?Ee.apply(void 0,[b.name].concat(oe(e.abridgeName))):b.name;return l("li",{class:S,key:F},[b.status==="progress"&&_(b,C),b.status==="fail"&&M(b,F,C),!["progress","fail"].includes(b.status)&&N(b,F),Boolean(h&&e.showImageFileName)&&(b.url?l(rt,{href:b.url,class:j,target:"_blank",hover:"color",size:"small"},fl(h)?h:{default:function(){return[h]}}):l("span",{class:j},[h]))])}),w.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"),T({},"".concat(r.value,"-is-disabled"),e.disabled)]},[l(f,null,null),l("p",{class:["".concat(r.value,"-size-s"),"".concat(r.value,"-upload__add-text")]},[(P=c.value)===null||P===void 0||(P=P.triggerUploadText)===null||P===void 0?void 0:P.image])])])])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function sa(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 va(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?sa(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):sa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ml(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!tt(t)}var pl=J({name:"UploadMultipleFlowList",props:va(va({},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=ye(e),o=r.uploading,s=r.disabled,c=r.displayFiles,i=r.classPrefix,v=r.accept,u=d(function(){return"".concat(i.value,"-upload")}),f=d(function(){return e.locale}),y=ve(),m=Te({BrowseIcon:Fa,DeleteIcon:Sa,CheckCircleFilledIcon:Qe,ErrorCircleFilledIcon:Xe,TimeFilledIcon:Ia}),w=m.BrowseIcon,N=m.DeleteIcon,_=m.CheckCircleFilledIcon,M=m.ErrorCircleFilledIcon,I=m.TimeFilledIcon,P=ot(e.dragEvents,v),k=Z([]),S=Z(0),b=d(function(){return o.value?"".concat(f.value.progress.uploadingText):f.value.triggerUploadText.normal}),F=d(function(){var A=e.draggable===void 0?!0:e.draggable;return A?{onDrop:P.handleDrop,onDragenter:P.handleDragenter,onDragover:P.handleDragover,onDragleave:P.handleDragleave}:{}}),j=function(){var p={success:l(_,null,null),fail:l(M,null,null),progress:l(Re,null,null),waiting:l(I,null,null)},z=f.value.progress,$={success:z==null?void 0:z.successText,fail:z==null?void 0:z.failText,progress:z==null?void 0:z.uploadingText,waiting:z==null?void 0:z.waitingText};return{iconMap:p,textMap:$}},C=function(){return l("div",{class:"".concat(u.value,"__flow-empty")},[P.dragActive.value?f.value.dragger.dragDropText:f.value.dragger.clickAndDragText])},h=function(p,z){var $=j(),W=$.iconMap,Q=$.textMap,E=e.abridgeName&&p.name?Ee.apply(void 0,[p.name].concat(oe(e.abridgeName))):p.name;return l("li",{class:"".concat(u.value,"__card-item"),key:p.name+z+p.percent+p.status||"0"},[l("div",{class:["".concat(u.value,"__card-content"),T({},"".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)},[W[p.status],l("p",null,[Q[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(w,{onClick:function(L){var O,g=L.e;S.value=z,k.value=c.value,(O=e.onPreview)===null||O===void 0||O.call(e,{file:p,index:z,e:g})}},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:z,file:p})}},[l(N,null,null)])])]),e.showImageFileName&&l("p",{class:["".concat(u.value,"__card-name"),"".concat(u.value,"__flow-status")]},[["success","waiting"].includes(p.status)&&W[p.status],E])])},D=function(p){var z,$,W=j(),Q=W.iconMap,E=W.textMap;return l("div",{class:"".concat(u.value,"__flow-status")},[Q[p.status],l("span",{class:"".concat(u.value,"__").concat(e.theme,"-").concat(p.status)},[(z=p.response)!==null&&z!==void 0&&z.error&&(($=p.response)===null||$===void 0?void 0:$.error)||E[p.status],e.showUploadProgress&&p.status==="progress"?" ".concat(p.percent||0,"%"):""])])},Y=function(p,z){var $;return l("td",null,[l(pe,{theme:"primary",variant:"text",content:($=f.value)===null||$===void 0||($=$.triggerUploadText)===null||$===void 0?void 0:$.delete,class:"".concat(u.value,"__delete"),onClick:function(Q){return e.onRemove({e:Q,index:z,file:p})}},null)])},ee=function(p){var z;return p===0?l("td",{rowSpan:c.value.length,class:"".concat(u.value,"__flow-table__batch-row")},[l(pe,{theme:"primary",variant:"text",content:(z=f.value)===null||z===void 0||(z=z.triggerUploadText)===null||z===void 0?void 0:z.delete,class:"".concat(u.value,"__delete"),onClick:function(W){return e.onRemove({e:W,index:-1,file:void 0})}},null)]):null},X=function(p){return yr.test(p)?l(zn,null,null):br.test(p)?l(xn,null,null):Or.test(p)?l(Bn,null,null):wr.test(p)?l(kn,null,null):Da.test(p)?l(or,null,null):l(Rn,null,null)},R=function(p){if(!p||!p.raw&&p.url)return null;var z=p.raw.type,$="".concat(u.value,"__file-thumbnail");return pr.test(z)?l($e,{class:$,src:p.url||p.raw,fit:"scale-down",error:"",loading:"",onClick:function(Q){var E;Q.preventDefault(),k.value=[p],S.value=0,(E=e.onPreview)===null||E===void 0||E.call(e,{file:p,index:0,e:Q})}},null):l("div",{class:$},[X(z)])},V=function(){var p,z,$,W,Q=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 Q||e.fileListDisplay?Q:l("table",re({class:"".concat(u.value,"__flow-table")},F.value),[l("thead",null,[l("tr",null,[l("th",null,[(p=f.value.file)===null||p===void 0?void 0:p.fileNameText]),l("th",{style:{minWidth:"120px"}},[(z=f.value.file)===null||z===void 0?void 0:z.fileSizeText]),l("th",{style:{minWidth:"120px"}},[($=f.value.file)===null||$===void 0?void 0:$.fileStatusText]),s.value?null:l("th",null,[(W=f.value.file)===null||W===void 0?void 0:W.fileOperationText])])]),l("tbody",null,[!c.value.length&&l("tr",null,[l("td",{colSpan:4},[C()])]),c.value.map(function(E,U){var L,O=e.isBatchUpload,g=O&&c.value.every(function(q){return q.status==="success"||!q.status})?ee(U):Y(E,U),x=(L=e.abridgeName)!==null&&L!==void 0&&L.length?Ee.apply(void 0,[E.name].concat(oe(e.abridgeName))):E.name,H=e.showThumbnail?l("div",{class:"".concat(u.value,"__file-info")},[R(E),x]):x,K=E.url?l(rt,{href:E.url,target:"_blank",hover:"color"},ml(H)?H:{default:function(){return[H]}}):H;return l("tr",{key:E.name+U+E.size},[l("td",{class:"".concat(u.value,"__file-name"),key:E.name+E.url},[K]),l("td",null,[Pr(E.size)]),l("td",null,[D(E)]),s.value?null:g])})])])},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(z,$){return h(z,$)})])};return function(){var A,p,z,$="".concat(u.value,"__flow-card-area"),W=s.value||!o.value,Q=n.uploadButton||Ce(e.uploadButton),E=Boolean(s.value||o.value||!c.value.length),U=n.cancelUploadButton||Ce(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")},[(A=n.default)===null||A===void 0?void 0:A.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():C()]),e.theme==="file-flow"&&(c.value.length?V():l("div",re({class:$},F.value),[C()])),!e.autoUpload&&(e.uploadButton!==null||e.cancelUploadButton!==null)&&l("div",{class:"".concat(u.value,"__flow-bottom")},[e.cancelUploadButton!==null&&(Q?y("cancelUploadButton",{params:{disabled:W,cancelUploadText:(p=f.value)===null||p===void 0?void 0:p.cancelUploadText,cancelUpload:e.cancelUpload}}):l(pe,re({theme:"default",disabled:W,content:(z=f.value)===null||z===void 0?void 0:z.cancelUploadText,class:"".concat(u.value,"__cancel"),onClick:function(O){var g;return(g=e.cancelUpload)===null||g===void 0?void 0:g.call(e,{e:O})}},it(e.cancelUploadButton)?e.cancelUploadButton:{}),null)),e.uploadButton!==null&&(U?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)}},it(e.uploadButton)?e.uploadButton:{}),null))]),l(lt,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 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 Ae(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){T(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}function hl(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,f=t.file,y=t.files,m=y===void 0?[]:y,w=t.name,N=w===void 0?"file":w,_=t.useMockProgress,M=_===void 0?!0:_,I=t.mockProgressDuration,P=I===void 0?300:I,k=t.formatRequest,S=t.onError,b=t.onProgress,F=t.onSuccess,j=m||[],C=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(){C+10<100?(C=Math.max(C+10,C),m[0]&&C!==m[0].percent&&(m[0].percent=C,b({percent:C,file:f||j[0],files:j.map(function(B){return Ae(Ae({},B),{},{percent:C})}),type:"mock",XMLHttpRequest:h}))):clearInterval(D)},P),clearTimeout(ee)},P);var X={};if(u){var R=Ce(u)?u(j):u;Object.assign(X,R)}j.forEach(function(B,A){var p=j.length>1?"".concat(N,"[").concat(A,"]"):N;X[p]=B.raw}),j.length===1?X[N]=j[0].raw:X[N]=j.map(function(B){return B.raw}),X.length=j.length,k&&(X=k(X));var V=new FormData;return Object.keys(X).forEach(function(B){V.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:f,files:j,XMLHttpRequest:h}),clearInterval(D),clearTimeout(Y)},h.ontimeout=function(B){S({event:B,file:f,files:j,XMLHttpRequest:h})},h.upload&&(h.upload.onprogress=function(B){var A,p=0;if(B.total>0&&(p=Math.round(B.loaded/B.total*100)),C=Math.max(p,C),C!==p&&((A=j[0])===null||A===void 0?void 0:A.percent)!==C){var z=j.map(function($){return Ae(Ae({},$),{},{percent:C})});b({event:B,percent:C,file:f||z[0],files:z,type:"real",XMLHttpRequest:h})}}),h.onload=function(B){var A={};A.XMLHttpRequest=h;var p=h.status<200||h.status>=300;if(p)return S({event:B,file:f,files:j,response:A,XMLHttpRequest:h});var z=h.responseText||h.response;try{A=JSON.parse(z)}catch{A=z,_e.error("Upload","response does not a valid json")}clearInterval(D),clearTimeout(Y),j.forEach(function($){var W;$.percent=100,$.status="success",$.uploadTime=((W=A)===null||W===void 0?void 0:W.uploadTime)||za()}),Me(A)==="object"&&(A.XMLHttpRequest=h),F({event:B,file:f||j[0],files:oe(j),XMLHttpRequest:h,response:A})},h.send(V),h.upload.requestParams=X,h.upload.requestHeaders=i,h}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function fa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(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?fa(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):fa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function yl(t,e){var a=e.sizeLimit,n=e.beforeUpload,r=new Promise(function(i){var v=null;if(a){var u=Ye(a)?{size:a,unit:"KB"}:a,f=Fr(t.size,u.size,u.unit);f&&(v=u)}i(v)}),o=[r,void 0];if(Ce(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 ga(t){var e=t.event,a=t.files,n=t.response,r=t.XMLHttpRequest,o=t.formatResponse,s=n;return Ce(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 bl(t){var e=t.event,a=t.files,n=t.response,r=t.XMLHttpRequest;(a==null?void 0:a.length)<=0&&_e.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 Ol(t){return t?t.status?["success","fail"].includes(t.status)?(t.status==="success"&&(!t.response||!t.response.url&&!t.response.files)&&_e.warn("Upload","`requestMethodResponse.response.url` or `requestMethodResponse.response.files` is required if `status` is `success`"),!0):(_e.error("Upload","`requestMethodResponse.status` must be `success` or `fail`, examples `{ status: 'success', response: { url: '' } }`"),!1):(_e.error("Upload","`requestMethodResponse.status` is missing, which value only can be `success` or `fail`"),!1):(_e.error("Upload","`requestMethodResponse` is required."),!1)}function ma(t){var e=t.action,a=t.toUploadFiles,n=t.requestMethod;return new Promise(function(r){if(!e&&!n){_e.error("Upload","one of action and requestMethod must be exist."),r({});return}if(!a||!a.length){_e.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(!Ol(c)){r({});return}var i=c.response||{};Ce(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 w=a.find(function(N){return m.name&&N.name===m.name||m.raw&&N.raw===m.raw});return se(se(se({},w),m),{},{status:c.status,response:i})}):(a.forEach(function(m){var w;m.status=c.status,m.response=i,m.url=i.url,m.percent=c.status==="success"?100:0,m.uploadTime=((w=i)===null||w===void 0?void 0:w.uploadTime)||za()}),v=a);var u={response:i,file:v[0],files:v};if(c.status==="success"){var f;(f=t.onResponseSuccess)===null||f===void 0||f.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=hl({action:t.action,files:t.toUploadFiles,useMockProgress:t.useMockProgress,mockProgressDuration:t.mockProgressDuration,onError:function(i){var v,u=ga(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(Ce(v)&&(u=v(i.response,{file:i.file,currentFiles:i.files})),u.error){var f,y=ga(se(se({},i),{},{response:u}));(f=t.onResponseError)===null||f===void 0||f.call(t,y),r({status:"fail",data:y})}else{var m;i.file.response=u,i.files[0].response=u;var w=bl(se(se({},i),{},{response:u}));(m=t.onResponseSuccess)===null||m===void 0||m.call(t,w),r({status:"success",data:w})}},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 wl(t,e){for(var a=t.filter(function(c){return c.url}),n=a,r=function(){var i=e[o],v=t.findIndex(function(f){return f.raw&&f.raw===i.raw||f.name&&f.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 _l(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){ma(t).then(function(i){i.status==="success"&&(i.data.files=r||!t.multiple?i.data.files:wl(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 ma(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 f=t.autoUpload?n.concat(v):n,y=r||!t.multiple?v:f;s({status:v.length?"success":"fail",data:{files:y},failedFiles:u,list:i})})})}function Je(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;Ce(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 Pl(t){var e=t.files,a=t.uploadValue,n=t.max,r=t.allowUploadDuplicateFile;return new Promise(function(o){var s=e.filter(function(_){var M=a.find(function(I){return I.name===_.name});return r||!M}),c=!1;if(s.length<e.length&&(c=!0),!s.length){var i=Je(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 f=Je(s,t.format,t.autoUpload?"progress":"waiting"),y;if(t.beforeAllFilesUpload){var m,w=(m=t.beforeAllFilesUpload)===null||m===void 0?void 0:m.call(t,f);y=w instanceof Promise?w:new Promise(function(_){return _(w)})}var N=f.map(function(_){return new Promise(function(M){yl(_,{beforeUpload:t.beforeUpload,sizeLimit:t.sizeLimit}).then(function(I){var P=he(I,2),k=P[0],S=P[1];k?M({file:_,validateResult:{type:"FILE_OVER_SIZE_LIMIT",extra:k}}):S===!1&&M({file:_,validateResult:{type:"CUSTOM_BEFORE_UPLOAD"}}),M({file:_})})})});Promise.all([y].concat(N)).then(function(_){var M=bn(_),I=M[0],P=M.slice(1);o(I===!1?{lengthOverLimit:v,hasSameNameFile:c,validateResult:{type:"BEFORE_ALL_FILES_UPLOAD"},files:f}:{lengthOverLimit:v,hasSameNameFile:c,fileValidateList:P,files:f})})})}function Cl(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 Fl(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 Sl(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 pa(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?pa(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):pa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function jl(t){var e=Z(),a=ye(t),n=a.disabled,r=a.autoUpload,o=a.isBatchUpload,s=a.multiple,c=a.files,i=a.modelValue,v=a.defaultFiles,u=Ue("upload"),f=u.globalConfig,y=u.t,m=u.classPrefix,w=nt(c,i,v.value,t.onChange,"files"),N=he(w,2),_=N[0],M=N[1],I=Z([]),P=Z([]),k=Z(""),S=d(function(){return _a({},f.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"),C=d(function(){var O,g=Fl({isBatchUpload:o.value,multiple:s.value,status:(O=_.value)===null||O===void 0||(O=O[0])===null||O===void 0?void 0:O.status,autoUpload:r.value});return S.value.triggerUploadText[g]}),h=Z(!1),D=d(function(){return Sl({multiple:t.multiple,toUploadFiles:P.value,uploadValue:_.value,autoUpload:r.value,isBatchUpload:o.value})}),Y=function(g){var x=g.file,H=g.percent,K=r.value?P:_,q=K.value.findIndex(function(ae){return x.raw===ae.raw});K.value[q]=He(He({},K.value[q]),{},{percent:H})},ee=function(){t.autoUpload&&(P.value=oe(P.value))},X=function(g){var x;if(!(!g||!g.files||!g.files[0])){var H=g.response,K=g.event,q=g.files;ee(),(x=t.onOneFileFail)===null||x===void 0||x.call(t,{e:K,file:q==null?void 0:q[0],currentFiles:q,failedFiles:q,response:H}),(!t.multiple||t.isBatchUpload)&&M([],{trigger:"progress-fail",e:g.event,file:g.files[0]})}},R=function(g){var x;ee(),(x=t.onProgress)===null||x===void 0||x.call(t,{e:g.event,file:g.file,currentFiles:g.files,percent:g.percent,type:g.type,XMLHttpRequest:g.XMLHttpRequest})},V=function(g){if(t.multiple&&!t.uploadAllFilesInOneRequest){var x;ee(),(x=t.onOneFileSuccess)===null||x===void 0||x.call(t,{e:g.event,file:g.files[0],response:g.response})}};function B(O){var g=O;return g.message?y(g.message,{sizeLimit:g.size}):"".concat(y(S.value.sizeLimitMessage,{sizeLimit:g.size})," ").concat(g.unit)}var A=function(g){var x=t.multiple&&!o.value?_.value.concat(g):g;!x.length||(M(x,{trigger:"add",index:_.value.length,file:g[0],files:g}),P.value=[])},p=function(g){var x;if(!n.value){var H={currentSelectedFiles:Je(oe(g),t.format)};(x=t.onSelectChange)===null||x===void 0||x.call(t,oe(g),H),Pl({uploadValue:_.value,files:oe(g),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(K){var q;if(((q=K.validateResult)===null||q===void 0?void 0:q.type)==="BEFORE_ALL_FILES_UPLOAD"){var ae,le={type:"BEFORE_ALL_FILES_UPLOAD",files:K.files};(ae=t.onValidate)===null||ae===void 0||ae.call(t,le);return}if(K.lengthOverLimit){var be,Se={type:"FILES_OVER_LENGTH_LIMIT",files:K.files};if((be=t.onValidate)===null||be===void 0||be.call(t,Se),!K.files.length)return}if(K.hasSameNameFile){var Oe,je={type:"FILTER_FILE_SAME_NAME",files:K.files};(Oe=t.onValidate)===null||Oe===void 0||Oe.call(t,je)}if(K.fileValidateList instanceof Array){var ke,Ie=Cl(K.fileValidateList,B),Le=Ie.sizeLimitErrors,te=Ie.beforeUploadErrorFiles,G=Ie.toFiles,ne=r.value?G:P.value.concat(G);if(P.value=ne,(ke=t.onWaitingUploadFilesChange)===null||ke===void 0||ke.call(t,{files:ne,trigger:"validate"}),Le[0]){var De;k.value=Le[0].file.response.error,(De=t.onValidate)===null||De===void 0||De.call(t,{type:"FILE_OVER_SIZE_LIMIT",files:Le.map(function($a){return $a.file})})}else if(k.value="",te.length){var Ve,Ba={type:"CUSTOM_BEFORE_UPLOAD",files:te};(Ve=t.onValidate)===null||Ve===void 0||Ve.call(t,Ba)}r.value?Q(ne):A(ne)}}),e.value.value=null}},z=function(g){var x=Ea(g.target.files);p==null||p(x)};function $(O){p==null||p(O)}function W(O){p==null||p(oe(O.clipboardData.files))}function Q(O){var g=_.value.filter(function(H){return H.status!=="success"}),x=r.value?O||P.value:g;!x||!x.length||(h.value=!0,I.value=[],_l({action:t.action,headers:t.headers,method:t.method,name:t.name,withCredentials:t.withCredentials,uploadedFiles:_.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:R,onResponseSuccess:V,onResponseError:X,setXhrObject:function(K){var q;(q=K.files[0])!==null&&q!==void 0&&q.raw&&I.value.find(function(ae){var le;return((le=ae.files[0])===null||le===void 0?void 0:le.raw)===K.files[0].raw})||(I.value=I.value.concat(K))}}).then(function(H){var K=H.status,q=H.data,ae=H.list,le=H.failedFiles;if(h.value=!1,K==="success"){var be;M(oe(q.files),{trigger:"add",file:q.files[0]}),I.value=[],(be=t.onSuccess)===null||be===void 0||be.call(t,{fileList:q.files,currentFiles:x,file:x[0],results:ae==null?void 0:ae.map(function(je){return je.data}),response:q.response||ae.map(function(je){return je.data.response}),XMLHttpRequest:q.XMLHttpRequest})}else if(le!=null&&le[0]){var Se;(Se=t.onFail)===null||Se===void 0||Se.call(t,{e:q.event,file:le[0],failedFiles:le,currentFiles:x,response:q.response,XMLHttpRequest:q.XMLHttpRequest})}if(r.value){var Oe;P.value=le,(Oe=t.onWaitingUploadFilesChange)===null||Oe===void 0||Oe.call(t,{files:le,trigger:"uploaded"})}}))}function E(O){var g,x,H;k.value="",(g=(x=O.e).stopPropagation)===null||g===void 0||g.call(x);var K={e:O.e,trigger:"remove",index:O.index,file:O.file};if(t.isBatchUpload||!t.multiple){var q;P.value=[],(q=t.onWaitingUploadFilesChange)===null||q===void 0||q.call(t,{files:[],trigger:"remove"}),M([],K)}else if(!t.autoUpload)_.value.splice(O.index,1),M(oe(_.value),K);else if(O.index<_.value.length)_.value.splice(O.index,1),M(oe(_.value),K);else{var ae;P.value.splice(O.index-_.value.length,1),P.value=oe(P.value),(ae=t.onWaitingUploadFilesChange)===null||ae===void 0||ae.call(t,{files:oe(P.value),trigger:"remove"})}(H=t.onRemove)===null||H===void 0||H.call(t,O)}var U=function(g){var x;n.value||!e.value||(g==null||(x=g.stopPropagation)===null||x===void 0||x.call(g),e.value.click())},L=function(g){var x,H;(x=I.value)===null||x===void 0||x.forEach(function(K){var q;(q=K.xhrReq)===null||q===void 0||q.abort()}),h.value=!1,r.value?P.value=[]:M(_.value.map(function(K){return K.status!=="success"?He(He({},K),{},{status:"waiting"}):K}),{trigger:"abort"}),g!=null&&g.file&&!r.value&&(E==null||E({file:g.file,e:g.e,index:0})),(H=t.onCancelUpload)===null||H===void 0||H.call(t)};return{t:y,locale:S,classPrefix:m,triggerUploadText:C,toUploadFiles:P,uploadValue:_,displayFiles:D,sizeOverLimitMessage:k,uploading:h,tipsClasses:b,errorClasses:F,placeholderClass:j,inputRef:e,disabled:n,xhrReq:I,uploadFilePercent:Y,uploadFiles:Q,onFileChange:p,onNormalFileChange:z,onDragFileChange:$,onPasteFileChange:W,onInnerRemove:E,triggerUpload:U,cancelUpload:L}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ha(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ya(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ha(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ha(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var xl=J({name:"UploadCustomFile",props:ya(ya({},Ne),{},{dragEvents:Object,draggable:Boolean,dragContent:Function,trigger:Function,triggerUpload:Function,childrenNode:[String,Function]}),setup:function(e,a){var n=a.slots,r=ye(e),o=r.classPrefix,s=r.displayFiles,c=r.accept,i=ot(e.dragEvents,c),v=i.dragActive,u=Ze(),f=function(){var m,w={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:w})||((m=e.childrenNode)===null||m===void 0?void 0:m.call(e,w))])])};return function(){var y,m;return l(Pe,null,[e.draggable?f():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 ba(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 Il(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ba(Object(a),!0).forEach(function(n){T(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ba(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Dl=J({name:"TUpload",props:ul,setup:function(e,a){var n=a.slots,r=a.expose,o=Ze(),s=ve(),c=jl(e),i=c.locale,v=c.classPrefix,u=c.triggerUploadText,f=c.toUploadFiles,y=c.displayFiles,m=c.uploadValue,w=c.sizeOverLimitMessage,N=c.uploading,_=c.tipsClasses,M=c.errorClasses,I=c.placeholderClass,P=c.inputRef,k=c.onInnerRemove,S=c.uploadFiles,b=c.onNormalFileChange,F=c.onDragFileChange,j=c.onPasteFileChange,C=c.triggerUpload,h=c.cancelUpload,D=c.uploadFilePercent,Y=Ca();r({upload:P.value,uploading:N,triggerUpload:C,uploadFiles:S,cancelUpload:h,uploadFilePercent:D});var ee=function(){var Q=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(nr,null,null)}},e.triggerButtonProps),{default:function(){return[u.value]}})};return o("default","trigger",{params:{dragActive:!1,files:m.value}})||Q()},X=d(function(){return{accept:e.accept,files:m.value,toUploadFiles:f.value,displayFiles:y.value,theme:e.theme,placeholder:e.placeholder,disabled:Y.value,tips:e.tips,status:e.status,sizeOverLimitMessage:w.value,uploading:N.value,classPrefix:v.value,tipsClasses:_,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}}),R={onDragFileChange:F,onDragenter:e.onDragenter,onDragleave:e.onDragleave,onDrop:e.onDrop},V=d(function(){return["".concat(v.value,"-upload"),T({},"".concat(v.value,"-upload--theme-").concat(e.theme),e.theme==="file-input")]}),B=function(){return l(vl,re(X.value,{multiple:e.multiple}),{default:function(){return[l("div",{class:"".concat(v.value,"-upload__trigger"),onClick:C},[ee()])]},fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},A=function(){return l(dl,re(X.value,{dragEvents:R,trigger:e.trigger,cancelUpload:h,triggerUpload:C,uploadFiles:S,onCancelUpload:e.onCancelUpload}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},p=function(){return l(gl,re(X.value,{multiple:e.multiple,max:e.max,showUploadProgress:e.showUploadProgress,triggerUpload:C,uploadFiles:S,cancelUpload:h,onPreview:e.onPreview,showImageFileName:e.showImageFileName}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},z=function(){return l(pl,re(X.value,{isBatchUpload:e.isBatchUpload,draggable:e.draggable,dragEvents:R,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:C},[!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(xl,re(X.value,{draggable:e.draggable,dragContent:e.dragContent,dragEvents:R,triggerUpload:C,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:V.value,onPaste:e.uploadPastedFiles?j:void 0},[l("input",re({ref:P,type:"file",disabled:Y.value,onChange:b,multiple:e.multiple,accept:e.accept,hidden:!0},e.inputAttributes?Il({},e.inputAttributes):{}),null),["file","file-input"].includes(e.theme)&&!e.draggable&&B(),["file","image"].includes(e.theme)&&e.draggable&&A(),e.theme==="image"&&!e.draggable&&p(),["image-flow","file-flow"].includes(e.theme)&&z(),e.theme==="custom"&&$(),Boolean(e.tips||n.tips)&&l("small",{class:[_,T({},"".concat(v.value,"-upload__tips-").concat(e.status),e.status)]},[s("tips")]),w.value&&l("small",{class:M},[w.value])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Kl=Fe(Dl);export{Hl as D,Al as L,Rl as R,Nl as T,Kl as U,Vl as a};
|