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