mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
210 lines
124 KiB
JavaScript
210 lines
124 KiB
JavaScript
import{E as ot,F as De,x as fe,y as je,N as Re,a4 as xa,w as $e,G as Se,ak as Xa,B as et,t as gt,e as Za,u as Ga,ar as Ya,_ as Ja}from"./index.28b8c38d.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as W,c as f,aI as l,aK as he,f as G,w as ge,t as we,i as Wa,n as We,o as it,bB as re,bs as Qa,bD as Ia,bx as en,bn as tn,bo as an,bC as nn,b as ln,aU as ut,h as rn,r as mt,bP as on,bH as un,C as Ze,D as Ge,aH as Y,G as Le,u as ke,aM as de,aN as ze,aJ as cn,b9 as sn,bQ as vn,bR as dn,bI as fn,bL as gn,be as mn,bf as pn}from"./arco.f43727df.js";import{f as hn}from"./vue.cbdb927d.js";import{u as ue,r as ce,_ as se,o as Da,C as ct,a as He}from"./dep-281dbb92.b7bdc3eb.js";import{q as yn,o as bn,r as On,s as wn,t as _n,b as Fn,k as Cn,v as Pn,w as Sn,u as jn,x as xn,P as In,T as Dn}from"./index.c6a389a9.js";import{B as ye}from"./index.d796ce09.js";import{L as tt,F as En,a as Un}from"./index.6cb0bdc2.js";import{I as kn,u as me,i as lt,_ as Oe,c as N,a as pt,C as zn,b as Ea,L as Ke,k as Ln,y as Bn,f as ie}from"./index.3c6542a6.js";import{o as Mn,T as nt,u as $n,_ as Tn}from"./dep-6deb4e3a.c77b8e7e.js";import{u as An,c as Rn,d as Nn,C as st,E as at}from"./dialog.d73192f7.js";import{l as Pe,b as vt,c as Ua,a as Vn,f as Hn,i as Kn,C as qn,B as ka,I as Xn}from"./dep-f6f516d9.c729faf9.js";import{D as Zn}from"./index.d0a42ed1.js";import"./chart.3c227ebb.js";import"./form-model.17724711.js";function ht(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function yt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ht(Object(a),!0).forEach(function(n){se(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 Gn={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"}}]},Yn=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}=ue(n),v=f(()=>["t-icon","t-icon-delete",r.value]),c=f(()=>yt(yt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Gn,i.value)}});const za=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 Ot(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?bt(Object(a),!0).forEach(function(n){se(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 Jn={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"}}]},Wn=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}=ue(n),v=f(()=>["t-icon","t-icon-download",r.value]),c=f(()=>Ot(Ot({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Jn,i.value)}});const Qn=Wn;function wt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function _t(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):wt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var el={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"}}]},tl=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}=ue(n),v=f(()=>["t-icon","t-icon-file-excel",r.value]),c=f(()=>_t(_t({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(el,i.value)}});const al=tl;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 Ct(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){se(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 nl={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"}}]},ll=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}=ue(n),v=f(()=>["t-icon","t-icon-file-pdf",r.value]),c=f(()=>Ct(Ct({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(nl,i.value)}});const rl=ll;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 St(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){se(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 ol={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"}}]},il=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}=ue(n),v=f(()=>["t-icon","t-icon-file-powerpoint",r.value]),c=f(()=>St(St({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(ol,i.value)}});const ul=il;function jt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function xt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):jt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var cl={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"}}]},sl=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}=ue(n),v=f(()=>["t-icon","t-icon-file-word",r.value]),c=f(()=>xt(xt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(cl,i.value)}});const vl=sl;function It(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Dt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?It(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):It(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var dl={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"}}]},fl=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}=ue(n),v=f(()=>["t-icon","t-icon-file",r.value]),c=f(()=>Dt(Dt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(dl,i.value)}});const gl=fl;function Et(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ut(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Et(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ml={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"}}]},pl=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}=ue(n),v=f(()=>["t-icon","t-icon-image-error",r.value]),c=f(()=>Ut(Ut({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(ml,i.value)}});const La=pl;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 zt(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){se(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 hl={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"}}]},yl=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}=ue(n),v=f(()=>["t-icon","t-icon-image",r.value]),c=f(()=>zt(zt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(hl,i.value)}});const Ba=yl;function Lt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Bt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Lt(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Lt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var bl={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"}}]},Ol=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}=ue(n),v=f(()=>["t-icon","t-icon-mirror",r.value]),c=f(()=>Bt(Bt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(bl,i.value)}});const wl=Ol;function Mt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function $t(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Mt(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Mt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var _l={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"}}]},Fl=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}=ue(n),v=f(()=>["t-icon","t-icon-refresh",r.value]),c=f(()=>$t($t({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(_l,i.value)}});const Cl=Fl;function Tt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function At(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(a),!0).forEach(function(n){se(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Tt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Pl={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"}}]},Sl=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}=ue(n),v=f(()=>["t-icon","t-icon-rotation",r.value]),c=f(()=>At(At({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Pl,i.value)}});const jl=Sl;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){se(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 xl={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"}}]},Il=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}=ue(n),v=f(()=>["t-icon","t-icon-time-filled",r.value]),c=f(()=>Nt(Nt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(xl,i.value)}});const Ma=Il;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 Ht(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){se(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 Dl={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 2.59l5.91 5.91-1.41 1.41-3.5-3.5V16h-2V6.41l-3.5 3.5L6.09 8.5 12 2.59zM4.5 14v5h15v-5h2v7h-19v-7h2z"}}]},El=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}=ue(n),v=f(()=>["t-icon","t-icon-upload",r.value]),c=f(()=>Ht(Ht({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Dl,i.value)}});const Ul=El;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 qt(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){se(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 kl={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"}}]},zl=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}=ue(n),v=f(()=>["t-icon","t-icon-video",r.value]),c=f(()=>qt(qt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(kl,i.value)}});const Ll=zl;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 Zt(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){se(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 Bl={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"}}]},Ml=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}=ue(n),v=f(()=>["t-icon","t-icon-zoom-in",r.value]),c=f(()=>Zt(Zt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Bl,i.value)}});const $l=Ml;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 Yt(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){se(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 Tl={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"}}]},Al=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}=ue(n),v=f(()=>["t-icon","t-icon-zoom-out",r.value]),c=f(()=>Yt(Yt({},o.value),a.style)),i=f(()=>({class:v.value,style:c.value,onClick:s=>{var u;return(u=t.onClick)===null||u===void 0?void 0:u.call(t,{e:s})}}));return()=>ce(Tl,i.value)}});const Rl=Al;/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Nl={align:{type:String,validator:function(e){return e?["start","end","center","baseline"].includes(e):!0}},breakLine:Boolean,direction:{type:String,default:"horizontal",validator:function(e){return e?["vertical","horizontal"].includes(e):!0}},separator:{type:[String,Function]},size:{type:[String,Number,Array],default:"medium"}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function 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 Wt(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){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Jt(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Qt={small:"8px",medium:"16px",large:"24px"},Vl=kn(),Hl=W({name:"TSpace",props:Wt(Wt({},Nl),{},{forceFlexGapPolyfill:Boolean}),setup:function(e){var a=me("space"),n=fe(),r=yn(),o=f(function(){return e.forceFlexGapPolyfill||Vl}),v=f(function(){var i="";ot(e.size)?i=e.size.map(function(b){return lt(b)?"".concat(b,"px"):De(b)&&Qt[b]||b}).join(" "):De(e.size)?i=Qt[e.size]||e.size:lt(e.size)&&(i="".concat(e.size,"px"));var s={};if(o.value){var u=i.split(" "),d=Oe(u,2),y=d[0],g=d[1];s["--td-space-column-gap"]=y,s["--td-space-row-gap"]=g||y}else s.gap=i;return s});function c(){var i=r(),s=n("separator");return i.map(function(u,d){var y=d+1!==i.length&&s;return l(he,null,[l("div",{class:"".concat(a.value,"-item")},[u]),y&&l("div",{class:"".concat(a.value,"-item-separator")},[s])])})}return function(){var i=["".concat(a.value),N(N(N(N({},"".concat(a.value,"-align-").concat(e.align),e.align),"".concat(a.value,"-").concat(e.direction),e.direction),"".concat(a.value,"--break-line"),e.breakLine),"".concat(a.value,"--polyfill"),o.value)];return l("div",{class:i,style:v.value},[c()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ea=je(Hl);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Kl=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp)/i,ql=/(.png|.jpg|.jpeg|.jpe|.webp|.avif|.svg|.gif|.bmp|.dwg|.dxf|.svf|.tif|.tiff|.arw)/i,Xl=/(.pdf)/i,Zl=/(.xlsx|.xls|.csv|.xlc|.xlm|.xlt|.xlw)/i,Gl=/(.dox|docx|.document|.wps|.wdb|.msword)/i,Yl=/(.ppt|.pptx|.key)/i,$a=/(.avi|.mp4|.wmv|.mpg|.mpeg|.mov|.rm|.ram|.swf|.flv|.rmvb|.flash|.mid|.3gp)/i,Jl=/(.mp2|.mp3|.mp4|.ogg|.3gpp|.ac3|.au)/i,ta={"audio/*":Jl,"video/*":$a,"image/*":ql,".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 Wl(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 Ta(){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 Me(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 v=0;v<n.length;v++){var c=n[v],i=escape(c).indexOf("%u")===0;v<e*2&&r<e?i?r+=1:r+=2:v>v-a&&o<a&&(i?o+=1:o+=2)}return n.replace(new RegExp("^(.{".concat(r,"})(.+)(.{").concat(o,"})$")),"$1\u2026$3")}function Ql(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 er(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 v=be[a];return t>e*v}function tr(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 ar(t,e,a){var n=e||a;if(!t)return!0;if(!n)return!1;for(var r=t.split(",").map(function(s){return s.trim()}),o=0,v=r.length;o<v;o++){var c=r[o];if(ta[c]&&ta[c].test(n))return!0;var i=new RegExp(c,"i");if(i.test(n))return!0}return!1}function Aa(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=[],n=0;n<t.length;n++)ar(e,t[n].type,t[n].name)&&a.push(t[n]);return a}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Qe(t){var e=G("");return ge([t],function(a,n){var r=Oe(a,1),o=r[0],v=Oe(n,1),c=v[0];if(c!==o){if(typeof o=="string"){e.value=o;return}tr(o).then(function(i){e.value=i})}},{immediate:!0}),{previewUrl:e}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var pe,nr=`
|
|
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
|
|
`,lr=["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 rr(t){if(!(typeof window>"u")){var e=window.getComputedStyle(t),a=e.getPropertyValue("box-sizing")||e.getPropertyValue("-moz-box-sizing")||e.getPropertyValue("-webkit-box-sizing"),n=parseFloat(e.getPropertyValue("padding-bottom"))+parseFloat(e.getPropertyValue("padding-top")),r=parseFloat(e.getPropertyValue("border-bottom-width"))+parseFloat(e.getPropertyValue("border-top-width")),o=lr.map(function(v){return"".concat(v,":").concat(e.getPropertyValue(v))}).join(";");return{sizingStyle:o,paddingSize:n,borderSize:r,boxSizing:a}}}function aa(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=rr(t),r=n.paddingSize,o=n.borderSize,v=n.boxSizing,c=n.sizingStyle;pe.setAttribute("style","".concat(c,";").concat(nr)),pe.value=t.value||t.placeholder||"";var i=pe.scrollHeight,s={};v==="border-box"?i+=o:v==="content-box"&&(i-=r),pe.value="";var u=pe.scrollHeight-r;if(e!==null){var d=u*e;v==="border-box"&&(d=d+r+o),i=Math.max(d,i),s.minHeight="".concat(d,"px")}if(a!==null){var y=u*a;v==="border-box"&&(y=y+r+o),i=Math.min(y,i)}return s.height="".concat(i,"px"),pe.parentNode&&pe.parentNode.removeChild(pe),pe=null,s}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var or={allowInputOverMax:{type:Boolean,default:!1},autofocus:Boolean,autosize:{type:[Boolean,Object],default:!1},disabled:Boolean,maxcharacter:{type:Number},maxlength:{type:[Number,String]},name:{type:String,default:""},placeholder:{type:String,default:void 0},readonly:Boolean,status:{type:String,validator:function(e){return["default","success","warning","error"].includes(e)}},tips:{type:[String,Function]},value:{type:[String,Number]},modelValue:{type:[String,Number]},defaultValue:{type:[String,Number]},onBlur:Function,onChange:Function,onFocus:Function,onKeydown:Function,onKeypress:Function,onKeyup:Function,onValidate:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function na(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ir(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?na(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):na(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function la(t){var e={};return Object.keys(t).forEach(function(a){Kn(t[a])||(e[a]=t[a])}),e}var ur=W({name:"TTextarea",inheritAttrs:!1,props:ir({},or),setup:function(e,a){var n=a.attrs,r=a.expose,o=me(),v=me("textarea"),c=f(function(){return"".concat(v.value,"__tips")}),i=f(function(){return"".concat(v.value,"__limit")}),s=we(e),u=s.value,d=s.modelValue,y=vt(u,d,e.defaultValue,e.onChange),g=Oe(y,2),b=g[0],$=g[1],_=Ua(),M=G({}),x=G(),F=G(!1),L=G(!1),S=function(){var m;return(m=x.value)===null||m===void 0?void 0:m.focus()},O=function(){var m;return(m=x.value)===null||m===void 0?void 0:m.blur()},P=function(){var m;if(e.autosize===!0)M.value=aa(x.value);else if(e.autosize&&Re(e.autosize)==="object"){var D=e.autosize,H=D.minRows,K=D.maxRows;M.value=aa(x.value,H,K)}else n.rows?M.value={height:"auto",minHeight:"auto"}:n.style&&(m=x.value)!==null&&m!==void 0&&(m=m.style)!==null&&m!==void 0&&m.height&&(M.value={height:x.value.style.height})},j=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",D=x.value,H=String(m);!D||D.value!==H&&(D.value=H,b.value=H)},C=function(m){var D=m.target,H=D.value;if(e.maxcharacter&&e.maxcharacter>=0){var K=pt(H,e.maxcharacter);H=Re(K)==="object"&&K.characters}!L.value&&$(H,{e:m}),We(function(){return j(H)}),P()},p=function(m){C(m)},I=function(){L.value=!0},Z=function(m){L.value=!1,C(m)},Q=function(m,D){var H;if(!_.value){var K="on".concat(m[0].toUpperCase()).concat(m.slice(1));(H=e[K])===null||H===void 0||H.call(e,b.value,{e:D})}},X=function(m){Q("keydown",m)},A=function(m){Q("keyup",m)},E=function(m){Q("keypress",m)},T=function(m){var D;P(),!_.value&&(F.value=!0,(D=e.onFocus)===null||D===void 0||D.call(e,b.value,{e:m}))},V=Wa(Vn,void 0),h=function(m){var D;P(),F.value=!1,(D=e.onBlur)===null||D===void 0||D.call(e,b.value,{e:m}),V==null||V.handleBlur()},U=f(function(){return[v.value,N(N({},"".concat(o.value,"-is-disabled"),_.value),"".concat(o.value,"-is-readonly"),e.readonly)]}),R=f(function(){return la({autofocus:e.autofocus,disabled:_.value,readonly:e.readonly,placeholder:e.placeholder,maxlength:!e.allowInputOverMax&&e.maxlength||void 0,name:e.name||void 0})}),ee=f(function(){var w=pt(String(b.value||""));return Re(w)==="object"?w.length:w}),te=f(function(){return{value:[void 0,null].includes(b.value)?void 0:String(b.value),status:e.status,maxlength:Number(e.maxlength),maxcharacter:e.maxcharacter,allowInputOverMax:e.allowInputOverMax,onValidate:e.onValidate}}),k=Hn(te),z=k.tStatus;ge(function(){return b.value},function(){return P()}),ge(x,function(w){!w||P()}),ge(function(){return e.autofocus},function(w){w&&x.value.focus()}),ge(M,function(w){var m=n.style;zn(x.value,xa(m,w))}),ge(b,function(){We(function(){return P()})}),ge(function(){return e.autosize},P,{deep:!0}),r({focus:S,blur:O}),it(function(){P()});var B=fe();return function(){var w,m=la({onFocus:T,onBlur:h,onKeydown:X,onKeyup:A,onKeypress:E}),D=Ea(),H=D.STATUS,K=f(function(){return["".concat(v.value,"__inner"),N(N(N(N({},"".concat(o.value,"-is-").concat(z.value),z.value),H.value.disabled,_.value),H.value.focused,F.value),"".concat(o.value,"-resize-none"),Re(e.autosize)==="object"),"narrow-scrollbar"]}),q=B("tips"),ne=q&&l("div",{class:"".concat(c.value," ").concat(v.value,"__tips--").concat(e.status||"normal")},[q]),oe=e.maxcharacter&&l("span",{class:i.value},["".concat(ee.value,"/").concat(e.maxcharacter)])||!e.maxcharacter&&e.maxlength&&l("span",{class:i.value},["".concat(b.value?(w=String(b.value))===null||w===void 0?void 0:w.length:0,"/").concat(e.maxlength)]);return l("div",re({class:U.value},Mn(n,["style"])),[l("textarea",re({onInput:p,onCompositionstart:I,onCompositionend:Z,ref:x,value:b.value,class:K.value},m,R.value),null),ne||oe?l("div",{class:["".concat(v.value,"__info_wrapper"),N({},"".concat(v.value,"__info_wrapper_align"),!ne)]},[ne,oe]):null])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var cr=je(ur);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var sr={alt:{type:String,default:""},error:{type:[String,Function]},fallback:{type:String,default:""},fit:{type:String,default:"fill",validator:function(e){return e?["contain","cover","fill","none","scale-down"].includes(e):!0}},gallery:Boolean,lazy:Boolean,loading:{type:[String,Function]},overlayContent:{type:[String,Function]},overlayTrigger:{type:String,default:"always",validator:function(e){return e?["always","hover"].includes(e):!0}},placeholder:{type:[String,Function]},position:{type:String,default:"center"},referrerpolicy:{type:String,default:"strict-origin-when-cross-origin",validator:function(e){return e?["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"].includes(e):!0}},shape:{type:String,default:"square",validator:function(e){return e?["circle","round","square"].includes(e):!0}},src:{type:[String,Object]},srcset:{type:Object},onError:Function,onLoad:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var vr=W({name:"TImage",props:sr,setup:function(e){var a=G(null),n=G(null),r=null,o=we(e),v=o.src,c=fe();it(function(){var A;if((A=n.value)!==null&&A!==void 0&&A.complete&&!e.lazy&&x(),!(!e.lazy||!a.value)){var E=bn(a.value,null,$,0);r=E}}),Qa(function(){a.value&&r&&r.unobserve(a.value)});var i=$e("image"),s=i.classPrefix,u=i.globalConfig,d=G(v.value);ge([v,u],function(A){var E=Oe(A,2),T=E[0],V=E[1],h=V||{},U=h.replaceImageSrc,R=Se(U)?U(e):T;R===d.value&&d.value||(d.value=R)},{immediate:!0});var y=Qe(d),g=y.previewUrl;ge([g],function(){F.value=!1,_.value=!1});var b=G(!e.lazy),$=function(){b.value=!0},_=G(!1),M=function(E){var T;_.value=!0,(T=e.onLoad)===null||T===void 0||T.call(e,{e:E})},x=function(){var E=new Event("load");Object.defineProperty(E,"target",{value:n.value,enumerable:!0}),M(E)},F=G(!1),L=function(E){var T;F.value=!0,(T=e.onError)===null||T===void 0||T.call(e,{e:E}),e.fallback&&(d.value=e.fallback,F.value=!1)},S=f(function(){return e.overlayTrigger==="hover"}),O=f(function(){return["".concat(s.value,"-image"),"".concat(s.value,"-image--fit-").concat(e.fit),"".concat(s.value,"-image--position-").concat(e.position)]}),P=G(!S.value),j=function(){S.value&&(P.value=!P.value)},C=function(){var E=c("placeholder");return E?l("div",{class:"".concat(s.value,"-image__placeholder")},[E]):null},p=function(){return e.gallery?l("div",{class:"".concat(s.value,"-image__gallery-shadow")},null):null},I=function(){var E=X("overlayContent");return E?l("div",{class:["".concat(s.value,"-image__overlay-content"),!P.value&&"".concat(s.value,"-image__overlay-content--hidden")]},[E]):null};function Z(){return l("picture",null,[Object.entries(e.srcset).map(function(A){var E=Oe(A,2),T=E[0],V=E[1];return l("source",{type:T,srcset:V},null)}),Q()])}function Q(){var A=typeof d.value=="string"?d.value:g.value;return l("img",{ref:n,src:A,onError:L,onLoad:M,class:O.value,alt:e.alt,referrerpolicy:e.referrerpolicy},null)}var X=Xa();return function(){return l("div",re({ref:a,class:["".concat(s.value,"-image__wrapper"),"".concat(s.value,"-image__wrapper--shape-").concat(e.shape),e.gallery&&"".concat(s.value,"-image__wrapper--gallery"),S.value&&"".concat(s.value,"-image__wrapper--need-hover")],onMouseenter:j,onMouseleave:j},Da(e,["src","alt","fit","position","shape","placeholder","loading","error","overlayTrigger","overlayContent","lazy","gallery","onLoad","onError"])),[C(),p(),(F.value||!b.value)&&l("div",{class:"".concat(s.value,"-image")},null),!(F.value||!b.value)&&(e.srcset&&Object.keys(e.srcset).length?Z():Q()),!(F.value||!b.value)&&!_.value&&l("div",{class:"".concat(s.value,"-image__loading")},[c("loading")||l(ea,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(Ba,{size:"24px"},null),typeof e.loading=="string"?e.loading:u.value.loadingText]}})]),F.value&&l("div",{class:"".concat(s.value,"-image__error")},[X("error",{defaultNode:l(ea,{direction:"vertical",size:8,align:"center"},{default:function(){return[l(La,{size:"24px"},null),typeof e.error=="string"?e.error:u.value.errorText]}})})]),I()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ve=je(vr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ne={closeBtn:{type:[Boolean,Function],default:!0},closeOnEscKeydown:{type:Boolean,default:!0},closeOnOverlay:Boolean,draggable:{type:Boolean,default:void 0},imageScale:{type:Object},images:{type:Array,default:function(){return[]}},index:{type:Number,default:void 0},defaultIndex:{type:Number,default:0},mode:{type:String,default:"modal",validator:function(e){return e?["modal","modeless"].includes(e):!0}},navigationArrow:{type:[Boolean,Function],default:!0},showOverlay:{type:Boolean,default:void 0},title:{type:[String,Function]},trigger:{type:[String,Function]},viewerScale:{type:Object},visible:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultVisible:Boolean,zIndex:{type:Number},onClose:Function,onIndexChange:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ce=W({name:"TImageModalIcon",props:{disabled:Boolean,onClick:Function,label:String,icon:Function},setup:function(e){var a=me(),n=fe(),r=f(function(){return["".concat(a.value,"-image-viewer__modal-icon"),N({},"".concat(a.value,"-is-disabled"),e.disabled)]});return function(){return l("div",{class:r.value,onClick:e.onClick},[n("icon"),e.label&&l("span",{class:"".concat(a.value,"-image-viewer__modal-icon-label")},[e.label])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ra(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function dr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ra(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var fr=function(e){var a,n,r,o=new Image,v=(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(s){var u=URL.createObjectURL(s),d=document.createElement("a");d.download=v,d.href=u,d.click(),d.remove(),URL.revokeObjectURL(u)})},o.src=e},gr=function(e){return!!e&&!De(e)&&!(e instanceof File)},mr=function(e){return ot(e)?e.map(function(a){return gr(a)?dr({download:!0,thumbnail:a.mainImage},a):{mainImage:a,thumbnail:a,download:!0}}):[]},pr=function(e){return e.showOverlay!==void 0?e.showOverlay:e.mode==="modal"};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ra=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=me(),n=f(function(){return e.currentImage.mainImage}),r=Qe(n),o=r.previewUrl,v=$e("imageViewer"),c=v.globalConfig;return function(){return l("div",{class:"".concat(a.value,"-image-viewer__utils")},[l("div",{class:"".concat(a.value,"-image-viewer__utils-content")},[l(nt,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.mirrorTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[l(Ce,{onClick:e.onMirror,icon:function(){return l(wl,{size:"medium"},null)}},null)]}}),l(nt,{overlayClassName:"".concat(a.value,"-image-viewer__utils--tip"),content:c.value.rotateTipText,destroyOnClose:!0,placement:"top",showArrow:!0,theme:"default"},{default:function(){return[l(Ce,{onClick:e.onRotate,icon:function(){return l(jl,{size:"medium"},null)}},null)]}}),l(Ce,{icon:function(){return l(Rl,{size:"medium"},null)},onClick:e.onZoomOut},null),l(Ce,{class:"".concat(a.value,"-image-viewer__utils-scale"),size:"medium",label:"".concat(On(String(e.scale*100)),"%")},null),l(Ce,{icon:function(){return l($l,{size:"medium"},null)},onClick:e.onZoomIn},null),l(nt,{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(Ce,{icon:function(){return l(Ba,{size:"medium"},null)},onClick:e.onReset},null)])]}}),e.currentImage.download&&l(Ce,{icon:function(){return l(Qn,{size:"medium"},null)},onClick:function(){fr(o.value)}},null)])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function oa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function hr(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){N(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 yr(t){var e=G(t),a=function(o){var v=o.pageX,c=o.pageY,i=e.value,s=i.translateX,u=i.translateY,d=function(b){var $=b.pageX,_=b.pageY;e.value={translateX:s+$-v,translateY:u+_-c}},y=function g(){document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",y)},n=function(){e.value=hr({},t)};return{transform:e,mouseDownHandler:a,resetTransform:n}}function br(){var t=G(1),e=function(){t.value*=-1},a=function(){t.value=1};return{mirror:t,onMirror:e,resetMirror:a}}function Or(){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=G(r!=null?r:1),v=function(){var d=wn(o.value,n);s(d)},c=function(){var d=_n(o.value,n);s(d)},i=function(){o.value=r!=null?r:1},s=function(d){var y=d;d<a&&(y=a),d>e&&(y=e),o.value=y};return ge(function(){return t},function(){return i()}),{scale:o,onZoomIn:v,onZoomOut:c,resetScale:i}}function wr(){var t=G(0),e=90,a=function(){t.value+=e},n=function(){t.value=0};return{rotate:t,onRotate:a,resetRotate:n}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Na=W({name:"TImageItem",props:{rotate:Number,scale:Number,mirror:Number,src:[String,Object],placementSrc:[String,Object]},setup:function(e){var a=we(e),n=a.src,r=a.placementSrc,o=me(),v=G(!1),c=G(!1),i=yr({translateX:0,translateY:0}),s=i.transform,u=i.mouseDownHandler,d=$e("imageViewer"),y=d.globalConfig,g=y.value.errorText,b=f(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:!e.placementSrc||c.value?"block":"none"}}),$=f(function(){return{transform:"rotate(".concat(e.rotate,"deg) scale(").concat(e.scale,")"),display:c.value?"none":"block"}}),_=f(function(){var O=s.value,P=O.translateX,j=O.translateY;return{transform:"translate(".concat(P,"px, ").concat(j,"px) scale(").concat(e.mirror,", 1)")}}),M=function(){v.value=!1,c.value=!1},x=Qe(n),F=x.previewUrl,L=Qe(r),S=L.previewUrl;return ge([F,S],function(){M()}),function(){return l("div",{class:"".concat(o.value,"-image-viewer__modal-pic")},[l("div",{class:"".concat(o.value,"-image-viewer__modal-box"),style:_.value},[v.value&&l("div",{class:"".concat(o.value,"-image-viewer__img-error")},[l("div",{class:"".concat(o.value,"-image-viewer__img-error-content")},[l(La,{size:"4em"},null),l("div",{class:"".concat(o.value,"-image-viewer__img-error-text")},[g])])]),!v.value&&!!e.placementSrc&&S.value&&l("img",{class:"".concat(o.value,"-image-viewer__modal-image"),onMousedown:function(P){P.stopPropagation(),u(P)},src:S.value,style:$.value,alt:"image",draggable:"false"},null),!v.value&&F.value&&l("img",{class:"".concat(o.value,"-image-viewer__modal-image"),onMousedown:function(P){P.stopPropagation(),u(P)},src:F.value,onLoad:function(){return c.value=!0},onError:function(){return v.value=!0},style:b.value,alt:"image",draggable:"false"},null)])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var _r=W({name:"TImageViewerModal",props:{zIndex:Number,visible:Boolean,index:Number,images:Ne.images,scale:Number,rotate:Number,mirror:Number,title:Ne.title,currentImage:{type:Object,default:function(){return{}}},onRotate:Function,onZoomIn:Function,onZoomOut:Function,onMirror:Function,onReset:Function,onClose:Ne.onClose,draggable:{type:Boolean,default:!0},viewerScale:{type:Object,default:function(){return{}}},showOverlay:Boolean,closeBtn:Ne.closeBtn},setup:function(e){var a=me(),n=fe(),r=f(function(){return{minWidth:e.viewerScale.minWidth,minHeight:e.viewerScale.minHeight}});return function(){return l(Zn,{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(Ra,{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(Na,{rotate:e.rotate,scale:e.scale,mirror:e.mirror,src:e.currentImage.mainImage,placementSrc:e.currentImage.thumbnail},null)])]}})}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Be=function(t){return t.left="ArrowLeft",t.up="ArrowUp",t.right="ArrowRight",t.down="ArrowDown",t.esc="Escape",t}(Be||{});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ia(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Fr(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){N(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 Cr=W({name:"TImageViewer",props:Fr({},Ne),setup:function(e){var a,n=me(),r=me("image-viewer"),o=fe(),v=G(!0),c=f(function(){return pr(e)}),i=we(e),s=i.index,u=i.visible,d=i.modelValue,y=Fn(s,(a=e.defaultIndex)!==null&&a!==void 0?a:0,e.onIndexChange,"index"),g=Oe(y,2),b=g[0],$=g[1],_=vt(u,d,e.defaultVisible,function(){},"visible"),M=Oe(_,2),x=M[0],F=M[1],L=G(!0),S=G(),O=f(function(){return[r.value,"".concat(r.value,"-preview-image"),N({},"".concat(n.value,"-is-hide"),!x.value)]}),P=f(function(){return["".concat(n.value,"-image-viewer__modal-header"),N({},"".concat(n.value,"-is-show"),v.value)]}),j=f(function(){var ae;return(ae=e.zIndex)!==null&&ae!==void 0?ae:2600}),C=function(){v.value=!v.value},p=br(),I=p.mirror,Z=p.onMirror,Q=p.resetMirror,X=Or(e.imageScale),A=X.scale,E=X.onZoomIn,T=X.onZoomOut,V=X.resetScale,h=wr(),U=h.rotate,R=h.onRotate,ee=h.resetRotate,te=function(){Q(),V(),ee()},k=f(function(){return mr(e.images)}),z=f(function(){var ae;return(ae=k.value[b.value])!==null&&ae!==void 0?ae:{mainImage:""}}),B=An("dialog",{visible:x}),w=B.isLastDialog,m=function(){var J=b.value-1;te(),$(J<0?0:J,{trigger:"prev"})},D=function(){var J=b.value+1;te(),$(J>=k.value.length?b.value:J,{trigger:"next"})},H=function(J){$(J,{trigger:"current"})},K=function(){F(!0)},q=function(J){var le;F(!1),(le=e.onClose)===null||le===void 0||le.call(e,J)},ne=function(J){q({e:J,trigger:"close-btn"})},oe=function(J){e.closeOnOverlay&&q({e:J,trigger:"overlay"})},_e=function(J){switch(J.stopPropagation(),J.code){case Be.left:m();break;case Be.right:D();break;case Be.up:E();break;case Be.down:T();break;case Be.esc:e.closeOnEscKeydown&&w()&&q({e:J,trigger:"esc"});break}},xe=G();ge(function(){return x.value},function(ae){clearTimeout(S.value),ae?(L.value=!1,We().then(function(){var J,le;(J=xe.value)===null||J===void 0||(le=J.focus)===null||le===void 0||le.call(J)}),te()):S.value=setTimeout(function(){L.value=!0},200)});var Fe=function(J){J.preventDefault();var le=J.deltaY;le>0?T():E()},Ie=f(function(){return{transform:"translateX(calc(-".concat(b.value," * (40px / 9 * 16 + 4px)))")}}),Te=function(){return l("div",{class:P.value},[l(Ce,{icon:function(){return l(Cn,null,null)},class:"".concat(r.value,"__header-pre-bt"),onClick:C},null),l("div",{class:"".concat(r.value,"__header-prev")},[l("div",{class:"".concat(r.value,"__header-trans"),style:Ie.value},[k.value.map(function(J,le){return l("div",{key:le,class:["".concat(r.value,"__header-box"),N({},"".concat(n.value,"-is-active"),le===b.value)]},[l(Ve,{src:J.thumbnail||J.mainImage,error:"",className:"".concat(r.value,"__header-img"),onClick:function(){return H(le)}},null)])})])])])},Ee=function(J){var le=J==="prev"?0:180,Ue=o("navigationArrow",l(Pn,{style:{transform:"rotate(".concat(le,"deg)")},size:"24px"},null));return l(Ce,{class:"".concat(r.value,"__modal-").concat(J,"-bt"),onClick:J==="prev"?m:D,icon:function(){return Ue}},null)},Ae=function(){if(e.closeBtn!==!1)return l("div",{class:["".concat(r.value,"__modal-icon"),"".concat(r.value,"__modal-close-bt")],onClick:ne},[o("closeBtn",l(ct,{size:"24px"},null))])};return function(){return e.mode==="modeless"?l(he,null,[o("trigger",{params:{open:K}}),l(_r,{zIndex:j.value,visible:x.value,index:b.value,images:k.value,scale:A.value,rotate:U.value,mirror:I.value,currentImage:z.value,onRotate:R,onZoomIn:E,onZoomOut:T,onMirror:Z,onReset:te,onClose:q,draggable:e.draggable,showOverlay:c.value,title:e.title},null)]):l(he,null,[o("trigger",{params:{open:K}}),l(Ia,{to:"body"},{default:function(){return[l(en,null,{default:function(){return[(x.value||!L.value)&&tn(l("div",{ref:xe,class:O.value,style:{zIndex:j.value},onWheel:Fe,tabindex:-1,onKeydown:_e},[!!c.value&&l("div",{class:"".concat(r.value,"__modal-mask"),onClick:oe},null),k.value.length>1&&l(he,null,[Te(),l("div",{class:"".concat(r.value,"__modal-index")},[e.title&&o("title"),"".concat(b.value+1,"/").concat(k.value.length)]),Ee("prev"),Ee("next")]),Ae(),l(Ra,{onZoomIn:E,onZoomOut:T,onMirror:Z,onReset:te,onRotate:R,scale:A.value,currentImage:z.value},null),l(Na,{scale:A.value,rotate:U.value,mirror:I.value,src:z.value.mainImage,placementSrc:z.value.thumbnail},null)]),[[an,x.value]])]}})]}})])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var dt=je(Cr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Va={asyncLoading:{type:[String,Function]},footer:{type:[String,Function]},header:{type:[String,Function]},layout:{type:String,default:"horizontal",validator:function(e){return e?["horizontal","vertical"].includes(e):!0}},scroll:{type:Object},size:{type:String,default:"medium",validator:function(e){return e?["small","medium","large"].includes(e):!0}},split:Boolean,stripe:Boolean,onLoadMore:Function,onScroll:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ha=W({name:"TListItem",props:Va,setup:function(){var e=me("list-item"),a=fe();return function(){var n=a("content"),r=a("default"),o=a("action");return l("li",{class:e.value},[l("div",{class:"".concat(e.value,"-main")},[r||n,o&&l("li",{class:"".concat(e.value,"__action")},[o])])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ua="load-more",Pr="loading";/**
|
|
* tdesign v1.9.4
|
|
* (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){N(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 Sr(t,e){var a=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=jr(t))||e&&t&&typeof t.length=="number"){a&&(t=a);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(s){throw s},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,v=!1,c;return{s:function(){a=a.call(t)},n:function(){var s=a.next();return o=s.done,s},e:function(s){v=!0,c=s},f:function(){try{!o&&a.return!=null&&a.return()}finally{if(v)throw c}}}}function jr(t,e){if(!!t){if(typeof t=="string")return va(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return va(t,e)}}function va(t,e){(e==null||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var xr=function(){var e=Sn(),a=f(function(){var n=[],r=e("ListItem");if(ot(r)){var o=Sr(r),v;try{for(o.s();!(v=o.n()).done;){var c=v.value;n.push(sa(sa({},c.props),{},{slots:c.children}))}}catch(i){o.e(i)}finally{o.f()}}return n});return{listItems:a}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ir=function(e,a,n){var r=f(function(){return{data:n.value,scroll:e}}),o=$n(a,r),v=f(function(){return o.isVirtualScroll.value}),c=-1,i=function(y){var g=y.target||y.srcElement,b=g.scrollTop;c!==b?o.isVirtualScroll.value&&o.handleScroll():c=-1,c=b},s=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:s,listStyle:u,isVirtualScroll:v,onInnerVirtualScroll:i}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function da(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Dr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?da(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):da(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Er=W({name:"TList",props:Dr({},Va),setup:function(e){var a=G(),n=$e("list"),r=n.globalConfig,o=me("list"),v=Ea(),c=v.SIZE,i=fe(),s=xr(),u=s.listItems,d=Ir(e.scroll,a,u),y=d.virtualConfig,g=d.cursorStyle,b=d.listStyle,$=d.isVirtualScroll,_=d.onInnerVirtualScroll,M=f(function(){return["".concat(o.value),c.value[e.size],N(N(N({},"".concat(o.value,"--split"),e.split),"".concat(o.value,"--stripe"),e.stripe),"".concat(o.value,"--vertical-action"),e.layout==="vertical")]}),x=function(){var j=i("header"),C=i("footer"),p=y.isVirtualScroll.value;return l(he,null,[j?l("div",{class:"".concat(o.value,"__header")},[j]):null,p?l(he,null,[l("div",{style:g.value},null),l("ul",{class:"".concat(o.value,"__inner"),style:b.value},[y.visibleData.value.map(function(I){return l(he,null,[l(Ha,Da(I,"slots"),I.slots)])})])]):l("ul",{class:"".concat(o.value,"__inner")},[i("default")]),C?l("div",{class:"".concat(o.value,"__footer")},[C]):null])},F=function(j){var C,p=j.target,I=p.scrollTop,Z=p.scrollHeight,Q=p.clientHeight;$.value&&_(j),(C=e.onScroll)===null||C===void 0||C.call(e,{e:j,scrollTop:I,scrollBottom:Z-Q-I})},L=f(function(){return De(e.asyncLoading)&&["loading","load-more"].includes(e.asyncLoading)?"".concat(o.value,"__load ").concat(o.value,"__load--").concat(e.asyncLoading):"".concat(o.value,"__load")}),S=function(){if(e.asyncLoading&&De(e.asyncLoading)){if(e.asyncLoading===Pr)return l("div",null,[l(Ke,null,null),l("span",null,[r.value.loadingText])]);if(e.asyncLoading===ua)return l("span",null,[r.value.loadingMoreText])}return i("asyncLoading")},O=function(j){var C;De(e.asyncLoading)&&e.asyncLoading!==ua||(C=e.onLoadMore)===null||C===void 0||C.call(e,{e:j})};return{COMPONENT_NAME:o,listClass:M,loadingClass:L,renderLoading:S,renderContent:x,handleScroll:F,handleLoadMore:O,listRef:a,isVirtualScroll:$}},render:function(){var e=this.renderContent();return e=[e,l("div",{class:this.loadingClass,onClick:this.handleLoadMore},[this.renderLoading()])],l("div",{class:this.listClass,onScroll:this.handleScroll,ref:"listRef"},[e])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ur={avatar:{type:[String,Function]},description:{type:[String,Function]},image:{type:[String,Function]},title:{type:[String,Function]}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var kr=W({name:"TListItemMeta",props:Ur,setup:function(e,a){var n=me("list-item__meta"),r=et(),o=fe(),v=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 De(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"),s=[v(),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},[s])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var zr=je(Er),Lr=je(Ha);je(kr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Br={attach:{type:[String,Function],default:""},body:{type:[String,Function]},cancelBtn:{type:[String,Object,Function],default:""},closeBtn:{type:[Boolean,String,Function]},closeOnEscKeydown:{type:Boolean,default:void 0},closeOnOverlayClick:{type:Boolean,default:void 0},confirmBtn:{type:[String,Object,Function],default:""},default:{type:[String,Function]},destroyOnClose:Boolean,footer:{type:[Boolean,Function],default:!0},header:{type:[String,Boolean,Function],default:!0},mode:{type:String,default:"overlay",validator:function(e){return e?["overlay","push"].includes(e):!0}},placement:{type:String,default:"right",validator:function(e){return e?["left","right","top","bottom"].includes(e):!0}},preventScrollThrough:{type:Boolean,default:!0},showInAttachedElement:Boolean,showOverlay:{type:Boolean,default:!0},size:{type:String,default:void 0},sizeDraggable:Boolean,visible:Boolean,zIndex:{type:Number},onCancel:Function,onClose:Function,onCloseBtnClick:Function,onConfirm:Function,onEscKeydown:Function,onOverlayClick:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Mr=function(e){var a=G(!1),n=G(null),r=function(){document.addEventListener("mouseup",o,!0),document.addEventListener("mousemove",v,!0),a.value=!0},o=function i(){document.removeEventListener("mouseup",i,!0),document.removeEventListener("mousemove",v,!0),a.value=!1},v=function(s){var u=s.x,d=s.y,y=document.documentElement.clientHeight,g=document.documentElement.clientWidth,b=8,$=8;if(a.value&&e.sizeDraggable){if(e.placement==="right"){var _=Math.min(Math.max(g-u+$,$),g);n.value="".concat(_,"px")}if(e.placement==="left"){var M=Math.min(Math.max(u+$,$),g);n.value="".concat(M,"px")}if(e.placement==="top"){var x=Math.min(Math.max(d+b,b),y);n.value="".concat(x,"px")}if(e.placement==="bottom"){var F=Math.min(Math.max(y-d+b,b),y);n.value="".concat(F,"px")}}},c=f(function(){var i=["right","left"].includes(e.placement),s={left:"right",right:"left",top:"bottom",bottom:"top"};return N(N(N(N({zIndex:1,position:"absolute",background:"transparent"},s[e.placement],0),"width",i?"16px":"100%"),"height",i?"100%":"16px"),"cursor",i?"col-resize":"row-resize")});return{draggedSizeValue:n,enableDrag:r,draggableLineStyles:c}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var $r=1,Tr=W({name:"TDrawer",inheritAttrs:!1,props:Br,emits:["update:visible"],setup:function(e,a){var n=G(!1),r=G(!1),o=G(),v=G(),c=$e("drawer"),i=c.globalConfig,s=He({CloseIcon:ct}),u=s.CloseIcon,d=fe(),y=et(),g=me("drawer"),b=Mr(e),$=b.draggedSizeValue,_=b.enableDrag,M=b.draggableLineStyles,x=Ln(function(){return e.attach}),F=function(z){var B;(B=e.onConfirm)===null||B===void 0||B.call(e,{e:z})},L=function(z){var B;(B=e.onCancel)===null||B===void 0||B.call(e,{e:z}),te({trigger:"cancel",e:z})},S=Rn({confirmBtnAction:F,cancelBtnAction:L}),O=S.getConfirmBtn,P=S.getCancelBtn,j=G(null),C=f(function(){return[g.value,"".concat(g.value,"--").concat(e.placement),N(N(N({},"".concat(g.value,"--open"),r.value),"".concat(g.value,"--attach"),e.showInAttachedElement),"".concat(g.value,"--without-mask"),!e.showOverlay)]}),p=f(function(){var k;if($.value)return $.value;var z=(k=e.size)!==null&&k!==void 0?k:i.value.size,B=isNaN(Number(z))?z:"".concat(z,"px");return{small:"300px",medium:"500px",large:"760px"}[z]||B}),I=f(function(){return{transform:r.value?"translateX(0)":void 0,width:["left","right"].includes(e.placement)?p.value:"",height:["top","bottom"].includes(e.placement)?p.value:""}}),Z=f(function(){return["".concat(g.value,"__content-wrapper"),"".concat(g.value,"__content-wrapper--").concat(e.placement)]}),Q=f(function(){return j.value&&j.value.parentNode}),X=f(function(){return[e.mode,e.placement].join()}),A=f(function(){return{display:"flex",justifyContent:e.placement==="right"?"flex-start":"flex-end"}}),E=function(z){var B;if(((B=e.closeOnEscKeydown)!==null&&B!==void 0?B:i.value.closeOnEscKeydown)&&z.key==="Escape"&&r.value){var w;(w=e.onEscKeydown)===null||w===void 0||w.call(e,{e:z}),te({trigger:"esc",e:z})}},T=function(){clearTimeout(v.value),v.value=setTimeout(function(){var z,B;(z=o.value)===null||z===void 0||(z=z.parentNode)===null||z===void 0||(B=z.removeChild)===null||B===void 0||B.call(z,o.value)},150)},V=function(){e.mode==="push"&&We(function(){!Q.value||(Q.value.style.cssText="transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;")})},h=function(){if(!!Q.value&&!(e.mode!=="push"||!Q.value)){var z={left:"margin: 0 0 0 ".concat(p.value),right:"margin: 0 0 0 -".concat(p.value),top:"margin: ".concat(p.value," 0 0 0"),bottom:"margin: -".concat(p.value," 0 0 0")}[e.placement];r.value?Q.value.style.cssText+=z:Q.value.style.cssText=Q.value.style.cssText.replace(/margin:.+;/,"")}},U=function(){var z=O({confirmBtn:e.confirmBtn,globalConfirm:i.value.confirm,className:"".concat(g.value,"__confirm")}),B=P({cancelBtn:e.cancelBtn,globalCancel:i.value.cancel,className:"".concat(g.value,"__cancel")});return l("div",{style:A.value},[e.placement==="right"?z:null,B,e.placement!=="right"?z:null])};ge(X,function(){V()},{immediate:!0}),ge(function(){return e.visible},function(k){Bn||(k?!e.showInAttachedElement&&e.preventScrollThrough&&o.value&&document.head.appendChild(o.value):T(),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 R=function(z){var B;(B=e.onCloseBtnClick)===null||B===void 0||B.call(e,{e:z}),te({trigger:"close-btn",e:z})},ee=function(z){var B,w;(B=e.onOverlayClick)===null||B===void 0||B.call(e,{e:z}),((w=e.closeOnOverlayClick)!==null&&w!==void 0?w:i.value.closeOnOverlayClick)&&te({trigger:"overlay",e:z})},te=function(z){var B;(B=e.onClose)===null||B===void 0||B.call(e,z),a.emit("update:visible",!1)};return nn(function(){h()}),it(function(){var k=document.documentElement.scrollHeight>document.documentElement.clientHeight,z=k?Nn():0;o.value=document.createElement("style"),o.value.dataset.id="td_drawer_".concat(+new Date,"_").concat($r+=1),o.value.innerHTML=`
|
|
html body {
|
|
overflow-y: hidden;
|
|
transition: margin 300ms cubic-bezier(0.7, 0.3, 0.1, 1) 0s;
|
|
`.concat(e.mode==="push"?"":"width: calc(100% - ".concat(z,"px);"),`
|
|
}
|
|
`),r.value&&!e.showInAttachedElement&&e.preventScrollThrough&&document.head.appendChild(o.value),window.addEventListener("keydown",E)}),ln(function(){T(),window.removeEventListener("keydown",E)}),function(){if(!n.value){var k=y("body","default"),z=d("header"),B=U();return l(Ia,{disabled:!e.attach||!x.value,to:x.value},{default:function(){return[l("div",re({ref:j,class:C.value,style:{zIndex:e.zIndex},onKeydown:E,tabindex:0},a.attrs),[e.showOverlay&&l("div",{class:"".concat(g.value,"__mask"),onClick:ee},null),l("div",{class:Z.value,style:I.value},[z&&l("div",{class:"".concat(g.value,"__header")},[z]),e.closeBtn&&l("div",{class:"".concat(g.value,"__close-btn"),onClick:R},[d("closeBtn",l(u,null,null))]),l("div",{class:["".concat(g.value,"__body"),"narrow-scrollbar"]},[k]),e.footer&&l("div",{class:"".concat(g.value,"__footer")},[d("footer",B)]),e.sizeDraggable&&l("div",{style:M.value,onMousedown:_},null)])])]}})}}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Ar=je(Tr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Rr={abridgeName:{type:Array},accept:{type:String,default:""},action:{type:String,default:""},allowUploadDuplicateFile:Boolean,autoUpload:{type:Boolean,default:!0},beforeAllFilesUpload:{type:Function},beforeUpload:{type:Function},cancelUploadButton:{type:[Object,Function]},data:{type:Object},default:{type:[String,Function]},disabled:Boolean,dragContent:{type:[String,Function]},draggable:{type:Boolean,default:void 0},fileListDisplay:{type:Function},files:{type:Array,default:void 0},defaultFiles:{type:Array,default:function(){return[]}},format:{type:Function},formatRequest:{type:Function},formatResponse:{type:Function},headers:{type:Object},imageViewerProps:{type:Object},inputAttributes:{type:Object},isBatchUpload:Boolean,locale:{type:Object},max:{type:Number,default:0},method:{type:String,default:"POST",validator:function(e){return e?["POST","GET","PUT","OPTION","PATCH","post","get","put","option","patch"].includes(e):!0}},mockProgressDuration:{type:Number},multiple:Boolean,name:{type:String,default:"file"},placeholder:{type:String,default:""},requestMethod:{type:Function},showImageFileName:{type:Boolean,default:!0},showThumbnail:Boolean,showUploadProgress:{type:Boolean,default:!0},sizeLimit:{type:[Number,Object]},status:{type:String,validator:function(e){return e?["default","success","warning","error"].includes(e):!0}},theme:{type:String,default:"file",validator:function(e){return e?["custom","file","file-input","file-flow","image","image-flow"].includes(e):!0}},tips:{type:[String,Function]},trigger:{type:Function},triggerButtonProps:{type:Object},uploadAllFilesInOneRequest:Boolean,uploadButton:{type:[Object,Function]},uploadPastedFiles:{type:Boolean,default:!0},useMockProgress:{type:Boolean,default:!0},value:{type:Array,default:void 0},modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:function(){return[]}},withCredentials:Boolean,onCancelUpload:Function,onChange:Function,onDragenter:Function,onDragleave:Function,onDrop:Function,onFail:Function,onOneFileFail:Function,onOneFileSuccess:Function,onPreview:Function,onProgress:Function,onRemove:Function,onSelectChange:Function,onSuccess:Function,onValidate:Function,onWaitingUploadFilesChange:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var qe={accept:String,files:Array,toUploadFiles:Array,displayFiles:Array,theme:String,abridgeName:Array,placeholder:String,classPrefix:String,tips:[String,Function],status:String,locale:Object,sizeOverLimitMessage:String,autoUpload:Boolean,uploadPastedFiles:Boolean,onPasteFileChange:Function,disabled:Boolean,uploading:Boolean,tipsClasses:[String,Array,Object],errorClasses:[String,Array,Object],placeholderClass:[String,Array,Object],showUploadProgress:Boolean,default:Function,fileListDisplay:Function,onRemove:Function,imageViewerProps:Object};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function 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 Nr(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){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):fa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Vr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!ut(t)}var Hr=W({name:"UploadNormalFile",props:Nr({multiple:Boolean},qe),setup:function(e,a){var n=a.slots,r=we(e),o=r.theme,v=r.disabled,c=r.classPrefix,i=f(function(){return e.locale}),s=He({CloseIcon:ct,TimeFilledIcon:Ma,CheckCircleFilledIcon:st,ErrorCircleFilledIcon:at,CloseCircleFilledIcon:qn}),u=s.CloseIcon,d=s.TimeFilledIcon,y=s.CheckCircleFilledIcon,g=s.ErrorCircleFilledIcon,b=s.CloseCircleFilledIcon,$=fe(),_="".concat(c.value,"-upload"),M=function(S){return l("div",{class:"".concat(_,"__single-progress")},[l(Ke,null,null),e.showUploadProgress&&l("span",{class:"".concat(_,"__single-percent")},[S||0,"%"])])},x=function(S){var O;return o.value!=="file"||!e.multiple&&((O=S[0])===null||O===void 0?void 0:O.status)==="fail"&&e.autoUpload?null:S.map(function(P,j){var C=e.abridgeName&&P.name?Me.apply(void 0,[P.name].concat(ie(e.abridgeName))):P.name;return l("div",{class:"".concat(_,"__single-display-text ").concat(_,"__display-text--margin"),key:P.name+j+P.percent+P.status},[P.url?l(tt,{href:P.url,target:"_blank",hover:"color",size:"small",class:"".concat(_,"__single-name")},Vr(C)?C:{default:function(){return[C]}}):l("span",{class:"".concat(_,"__single-name")},[C]),P.status==="fail"&&l("div",{class:"".concat(_,"__flow-status ").concat(_,"__file-fail")},[l(g,null,null)]),P.status==="waiting"&&l("div",{class:"".concat(_,"__flow-status ").concat(_,"__file-waiting")},[l(d,null,null)]),P.status==="progress"&&M(P.percent),!v.value&&P.status!=="progress"&&l(u,{class:"".concat(_,"__icon-delete"),onClick:function(I){var Z=I.e;return e.onRemove({e:Z,file:P,index:j})}},null)])})},F=function(){var S;if(o.value==="file-input"){var O=e.displayFiles[0]||[],P=["".concat(c.value,"-input__inner"),N({},"".concat(_,"__placeholder"),!e.displayFiles[0])],j=v.value?"".concat(c.value,"-is-disabled"):"",C=(S=e.abridgeName)!==null&&S!==void 0&&S.length&&O!==null&&O!==void 0&&O.name?Me.apply(void 0,[O.name].concat(ie(e.abridgeName))):O==null?void 0:O.name;return l("div",{class:"".concat(_,"__single-input-preview ").concat(c.value,"-input ").concat(j)},[l("div",{class:P},[l("span",{class:["".concat(_,"__single-input-text"),N({},e.placeholderClass,e.placeholder&&!(O!=null&&O.name))]},[O!=null&&O.name?C:e.placeholder]),(O==null?void 0:O.status)==="progress"&&M(O.percent),(O==null?void 0:O.status)==="waiting"&&l(d,{class:"".concat(_,"__status-icon ").concat(_,"__file-waiting")},null),O.status==="success"&&l(y,{class:"".concat(_,"__status-icon")},null),(O==null?void 0:O.name)&&O.status==="fail"&&l(g,{class:"".concat(_,"__status-icon ").concat(_,"__file-fail")},null),Boolean(!v.value&&O.name)&&l(b,{class:"".concat(_,"__single-input-clear"),onClick:function(I){var Z=I.e;return e.onRemove({e:Z,file:O,index:0})}},null)])])}};return function(){var L,S,O,P=["".concat(_,"__single"),"".concat(_,"__single-").concat(o.value)],j=$("fileListDisplay",{params:{onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles}});(e.fileListDisplay===null||j===null)&&(j=null);var C=e.displayFiles;return l("div",{class:P},[o.value==="file-input"&&F(),(L=n.default)===null||L===void 0?void 0:L.call(n),o.value==="file"&&e.placeholder&&!C[0]&&l("small",{class:[e.tipsClasses,e.placeholderClass]},[e.placeholder]),j===null?null:j||x(C),!e.multiple&&((S=C[0])===null||S===void 0?void 0:S.status)==="fail"&&o.value==="file"?l("small",{class:[e.errorClasses,e.placeholderClass]},[((O=C[0].response)===null||O===void 0?void 0:O.error)||i.value.progress.failText]):null])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ft(t,e){var a=G(null),n=G(!1),r=function(s){var u;s.preventDefault(),n.value=!1;var d=s.dataTransfer.files,y=Aa(d,e.value);if((u=t.onDrop)===null||u===void 0||u.call(t,{e:s}),y!=null&&y.length){var g;(g=t.onDragFileChange)===null||g===void 0||g.call(t,y)}},o=function(s){var u;s.preventDefault(),a.value=s.target,(u=t.onDragenter)===null||u===void 0||u.call(t,{e:s}),n.value=!0},v=function(s){var u;s.target===a.value&&(s.preventDefault(),(u=t.onDragleave)===null||u===void 0||u.call(t,{e:s}),n.value=!1)},c=function(s){s.preventDefault()};return{target:a,dragActive:n,handleDrop:r,handleDragenter:o,handleDragleave:v,handleDragover:c}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ga(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ma(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ga(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ga(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Kr=W({name:"UploadDraggerFile",props:ma(ma({},qe),{},{trigger:Function,triggerUpload:Function,uploadFiles:Function,cancelUpload:Function,dragEvents:Object}),setup:function(e,a){var n=a.slots,r=we(e),o=r.displayFiles,v=r.disabled,c=r.accept,i=f(function(){return e.locale}),s=fe(),u=jn(),d=u.sizeClassNames,y="".concat(e.classPrefix,"-upload"),g=ft(e.dragEvents,c),b=g.dragActive,$=G(),_=f(function(){var C;return["".concat(y,"__dragger"),N({},"".concat(y,"__dragger-center"),!o.value[0]),N({},"".concat(y,"__dragger-error"),((C=o.value[0])===null||C===void 0?void 0:C.status)==="fail")]}),M=He({CheckCircleFilledIcon:st,ErrorCircleFilledIcon:at}),x=M.CheckCircleFilledIcon,F=M.ErrorCircleFilledIcon,L=function(){var p;if(!!e.displayFiles.length){var I=o.value[0];if(!I)return null;var Z=(I==null?void 0:I.url)||(I==null||(p=I.response)===null||p===void 0?void 0:p.url);return l("div",{class:"".concat(y,"__dragger-img-wrap")},[l(dt,re({images:[Z],trigger:function(X,A){var E=A.open;return l(Ve,{src:Z||I.raw,onClick:E,error:"",loading:""},null)}},e.imageViewerProps),null)])}},S=function(){if(!!e.displayFiles.length){var p=o.value[0];if(!p)return null;if((p==null?void 0:p.status)==="progress")return l("div",{class:"".concat(y,"__single-progress")},[l(Ke,null,null),e.showUploadProgress&&l("span",{class:"".concat(y,"__single-percent")},[p.percent,"%"])])}},O=function(){var p,I=o.value[0],Z=e.abridgeName?Me.apply(void 0,[I.name].concat(ie(e.abridgeName))):I.name,Q=[l("div",{class:"".concat(y,"__dragger-text"),key:"info"},[l("span",{class:"".concat(y,"__single-name")},[Z]),I.status==="progress"&&S(),I.status==="success"&&l(x,null,null),I.status==="fail"&&l(F,null,null)]),l("small",{class:"".concat(d.small),key:"size"},[i.value.file.fileSizeText,"\uFF1A",Ql(I.size)]),l("small",{class:"".concat(d.small),key:"time"},[i.value.file.fileOperationDateText,"\uFF1A",I.uploadTime||"-"])];return l("div",{class:"".concat(y,"__dragger-progress")},[e.theme==="image"&&L(),l("div",{class:"".concat(y,"__dragger-progress-info")},[s("fileListDisplay",{params:{files:e.displayFiles}})||Q,l("div",{class:"".concat(y,"__dragger-btns")},[["progress","waiting"].includes(I.status)&&!v.value&&l(ye,{theme:"primary",variant:"text",class:"".concat(y,"__dragger-progress-cancel"),onClick:function(A){var E;return(E=e.cancelUpload)===null||E===void 0?void 0:E.call(e,{e:A,file:e.toUploadFiles[0]||e.files[0]})}},{default:function(){return[(p=i.value)===null||p===void 0?void 0:p.cancelUploadText]}}),!e.autoUpload&&I.status==="waiting"&&l(ye,{theme:"primary",variant:"text",disabled:v.value,onClick:function(){var A;return(A=e.uploadFiles)===null||A===void 0?void 0:A.call(e)},class:"".concat(y,"__dragger-upload-btn")},{default:function(){return[i.value.triggerUploadText.normal]}})]),["fail","success"].includes(I==null?void 0:I.status)&&!v.value&&l("div",{class:"".concat(y,"__dragger-btns")},[l(ye,{theme:"primary",variant:"text",disabled:v.value,class:"".concat(y,"__dragger-progress-cancel"),onClick:e.triggerUpload},{default:function(){return[i.value.triggerUploadText.reupload]}}),l(ye,{theme:"danger",variant:"text",disabled:v.value,class:"".concat(y,"__dragger-delete-btn"),onClick:function(A){return e.onRemove({e:A,index:0,file:I})}},{default:function(){return[i.value.triggerUploadText.delete]}})])])])},P=function(){var p,I=l("div",null,[l("span",{class:"".concat(y,"--highlight")},[(p=i.value.triggerUploadText)===null||p===void 0?void 0:p.normal]),l("span",null,["\xA0\xA0/\xA0\xA0",i.value.dragger.draggingText])]),Z=l("div",null,[i.value.dragger.dragDropText]);return b.value?Z:I},j=function(){var p,I=o.value[0];return I&&(["progress","success","fail","waiting"].includes(I.status)||!I.status)?O():l("div",{class:"".concat(y,"__trigger"),onClick:e.triggerUpload},[((p=n.default)===null||p===void 0?void 0:p.call(n))||P()])};return function(){var C;return l("div",{ref:$,class:_.value,onDrop:g.handleDrop,onDragenter:g.handleDragenter,onDragover:g.handleDragover,onDragleave:g.handleDragleave},[((C=e.trigger)===null||C===void 0?void 0:C.call(e,rn,{files:o.value,dragActive:b.value}))||j()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function pa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ha(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){N(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 qr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!ut(t)}var Xr=W({name:"UploadImageCard",props:ha(ha({},qe),{},{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,v=a.max,c=f(function(){return e.locale}),i=He({AddIcon:xn,BrowseIcon:ka,DeleteIcon:za,ErrorCircleFilledIcon:at}),s=i.BrowseIcon,u=i.DeleteIcon,d=i.AddIcon,y=i.ErrorCircleFilledIcon,g=fe(),b=f(function(){var x;return o.value?!v.value||n.value.length<v.value:!((x=n.value)!==null&&x!==void 0&&x[0])}),$=function(F,L){return l("div",{class:"".concat(r.value,"-upload__card-content ").concat(r.value,"-upload__card-box")},[l(Ve,{class:"".concat(r.value,"-upload__card-image"),src:F.url||F.raw,error:""},null),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(dt,re({images:n.value.map(function(S){return S.url||S.raw}),defaultIndex:L,trigger:function(O,P){var j=P.open;return l(s,{onClick:function(p){var I,Z=p.e;(I=e.onPreview)===null||I===void 0||I.call(e,{file:F,index:L,e:Z}),j()}},null)}},e.imageViewerProps),null)]),!e.disabled&&l(he,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(O){return O.stopPropagation()}},[l(u,{onClick:function(O){var P,j=O.e;return e==null||(P=e.onRemove)===null||P===void 0?void 0:P.call(e,{e:j,file:F,index:L})}},null)])])])])},_=function(F,L){var S;return l("div",{class:[L,"".concat(r.value,"-upload__").concat(e.theme,"-").concat(F.status)]},[l(Ke,{loading:!0,size:"medium"},null),l("p",null,[(S=c.value)===null||S===void 0||(S=S.progress)===null||S===void 0?void 0:S.uploadingText,e.showUploadProgress?" ".concat(F.percent,"%"):""])])},M=function(F,L,S){var O,P;return l("div",{class:S},[l(y,null,null),l("p",null,[((O=F.response)===null||O===void 0?void 0:O.error)||((P=c.value)===null||P===void 0||(P=P.progress)===null||P===void 0?void 0:P.failText)]),l("div",{class:"".concat(r.value,"-upload__card-mask")},[l("span",{class:"".concat(r.value,"-upload__card-mask-item"),onClick:function(C){return C.stopPropagation()}},[l(u,{onClick:function(C){var p,I=C.e;return e==null||(p=e.onRemove)===null||p===void 0?void 0:p.call(e,{e:I,file:F,index:L})}},null)])])])};return function(){var x,F,L=g("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(L)return L;var S="".concat(r.value,"-upload__card-item ").concat(r.value,"-is-background");return l("div",null,[l("ul",{class:"".concat(r.value,"-upload__card")},[(x=n.value)===null||x===void 0?void 0:x.map(function(O,P){var j="".concat(r.value,"-upload__card-name"),C="".concat(r.value,"-upload__card-container ").concat(r.value,"-upload__card-box"),p=e.abridgeName?Me.apply(void 0,[O.name].concat(ie(e.abridgeName))):O.name;return l("li",{class:S,key:P},[O.status==="progress"&&_(O,C),O.status==="fail"&&M(O,P,C),!["progress","fail"].includes(O.status)&&$(O,P),Boolean(p&&e.showImageFileName)&&(O.url?l(tt,{href:O.url,class:j,target:"_blank",hover:"color",size:"small"},qr(p)?p:{default:function(){return[p]}}):l("span",{class:j},[p]))])}),b.value&&l("li",{class:S,onClick:e.triggerUpload},[l("div",{class:["".concat(r.value,"-upload__image-add"),"".concat(r.value,"-upload__card-container"),"".concat(r.value,"-upload__card-box"),N({},"".concat(r.value,"-is-disabled"),e.disabled)]},[l(d,null,null),l("p",{class:["".concat(r.value,"-size-s"),"".concat(r.value,"-upload__add-text")]},[(F=c.value)===null||F===void 0||(F=F.triggerUploadText)===null||F===void 0?void 0:F.image])])])])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ya(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ba(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ya(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ya(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Zr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!ut(t)}var Gr=W({name:"UploadMultipleFlowList",props:ba(ba({},qe),{},{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,v=r.disabled,c=r.displayFiles,i=r.classPrefix,s=r.accept,u=f(function(){return"".concat(i.value,"-upload")}),d=f(function(){return e.locale}),y=fe(),g=He({BrowseIcon:ka,DeleteIcon:za,CheckCircleFilledIcon:st,ErrorCircleFilledIcon:at,TimeFilledIcon:Ma}),b=g.BrowseIcon,$=g.DeleteIcon,_=g.CheckCircleFilledIcon,M=g.ErrorCircleFilledIcon,x=g.TimeFilledIcon,F=ft(e.dragEvents,s),L=G([]),S=G(0),O=f(function(){return o.value?"".concat(d.value.progress.uploadingText):d.value.triggerUploadText.normal}),P=f(function(){var V=e.draggable===void 0?!0:e.draggable;return V?{onDrop:F.handleDrop,onDragenter:F.handleDragenter,onDragover:F.handleDragover,onDragleave:F.handleDragleave}:{}}),j=function(){var h={success:l(_,null,null),fail:l(M,null,null),progress:l(Ke,null,null),waiting:l(x,null,null)},U=d.value.progress,R={success:U==null?void 0:U.successText,fail:U==null?void 0:U.failText,progress:U==null?void 0:U.uploadingText,waiting:U==null?void 0:U.waitingText};return{iconMap:h,textMap:R}},C=function(){return l("div",{class:"".concat(u.value,"__flow-empty")},[F.dragActive.value?d.value.dragger.dragDropText:d.value.dragger.clickAndDragText])},p=function(h,U){var R=j(),ee=R.iconMap,te=R.textMap,k=e.abridgeName&&h.name?Me.apply(void 0,[h.name].concat(ie(e.abridgeName))):h.name;return l("li",{class:"".concat(u.value,"__card-item"),key:h.name+U+h.percent+h.status||"0"},[l("div",{class:["".concat(u.value,"__card-content"),N({},"".concat(i.value,"-is-bordered"),h.status!=="waiting")]},[["fail","progress"].includes(h.status)&&l("div",{class:"".concat(u.value,"__card-status-wrap ").concat(u.value,"__").concat(e.theme,"-").concat(h.status)},[ee[h.status],l("p",null,[te[h.status],e.showUploadProgress&&h.status==="progress"?" ".concat(h.percent,"%"):""])]),(["waiting","success"].includes(h.status)||!h.status&&h.url)&&l(Ve,{class:"".concat(u.value,"__card-image"),src:h.url||h.raw,error:"",loading:""},null),l("div",{class:"".concat(u.value,"__card-mask")},[(h.url||h.raw)&&!["progress","fail"].includes(h.status)&&l("span",{class:"".concat(u.value,"__card-mask-item")},[l(b,{onClick:function(B){var w,m=B.e;S.value=U,L.value=c.value,(w=e.onPreview)===null||w===void 0||w.call(e,{file:h,index:U,e:m})}},null),l("span",{class:"".concat(u.value,"__card-mask-item-divider")},null)]),!v.value&&l("span",{class:"".concat(u.value,"__card-mask-item ").concat(u.value,"__delete"),onClick:function(B){return e.onRemove({e:B,index:U,file:h})}},[l($,null,null)])])]),e.showImageFileName&&l("p",{class:["".concat(u.value,"__card-name"),"".concat(u.value,"__flow-status")]},[["success","waiting"].includes(h.status)&&ee[h.status],k])])},I=function(h){var U,R,ee=j(),te=ee.iconMap,k=ee.textMap;return l("div",{class:"".concat(u.value,"__flow-status")},[te[h.status],l("span",{class:"".concat(u.value,"__").concat(e.theme,"-").concat(h.status)},[(U=h.response)!==null&&U!==void 0&&U.error&&((R=h.response)===null||R===void 0?void 0:R.error)||k[h.status],e.showUploadProgress&&h.status==="progress"?" ".concat(h.percent||0,"%"):""])])},Z=function(h,U){var R;return l("td",null,[l(ye,{theme:"primary",variant:"text",content:(R=d.value)===null||R===void 0||(R=R.triggerUploadText)===null||R===void 0?void 0:R.delete,class:"".concat(u.value,"__delete"),onClick:function(te){return e.onRemove({e:te,index:U,file:h})}},null)])},Q=function(h){var U;return h===0?l("td",{rowSpan:c.value.length,class:"".concat(u.value,"__flow-table__batch-row")},[l(ye,{theme:"primary",variant:"text",content:(U=d.value)===null||U===void 0||(U=U.triggerUploadText)===null||U===void 0?void 0:U.delete,class:"".concat(u.value,"__delete"),onClick:function(ee){return e.onRemove({e:ee,index:-1,file:void 0})}},null)]):null},X=function(h){return Xl.test(h)?l(rl,null,null):Zl.test(h)?l(al,null,null):Gl.test(h)?l(vl,null,null):Yl.test(h)?l(ul,null,null):$a.test(h)?l(Ll,null,null):l(gl,null,null)},A=function(h){if(!h||!h.raw&&h.url)return null;var U=h.raw.type,R="".concat(u.value,"__file-thumbnail");return Kl.test(U)?l(Ve,{class:R,src:h.url||h.raw,fit:"scale-down",error:"",loading:"",onClick:function(te){var k;te.preventDefault(),L.value=[h],S.value=0,(k=e.onPreview)===null||k===void 0||k.call(e,{file:h,index:0,e:te})}},null):l("div",{class:R},[X(U)])},E=function(){var h,U,R,ee,te=y("fileListDisplay",{params:{cancelUpload:e.cancelUpload,uploadFiles:e.uploadFiles,onPreview:e.onPreview,onRemove:e.onRemove,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles,dragEvents:P.value}});return te||e.fileListDisplay?te:l("table",re({class:"".concat(u.value,"__flow-table")},P.value),[l("thead",null,[l("tr",null,[l("th",null,[(h=d.value.file)===null||h===void 0?void 0:h.fileNameText]),l("th",{style:{minWidth:"120px"}},[(U=d.value.file)===null||U===void 0?void 0:U.fileSizeText]),l("th",{style:{minWidth:"120px"}},[(R=d.value.file)===null||R===void 0?void 0:R.fileStatusText]),v.value?null:l("th",null,[(ee=d.value.file)===null||ee===void 0?void 0:ee.fileOperationText])])]),l("tbody",null,[!c.value.length&&l("tr",null,[l("td",{colSpan:4},[C()])]),c.value.map(function(k,z){var B,w=e.isBatchUpload,m=w&&c.value.every(function(q){return q.status==="success"||!q.status})?Q(z):Z(k,z),D=(B=e.abridgeName)!==null&&B!==void 0&&B.length?Me.apply(void 0,[k.name].concat(ie(e.abridgeName))):k.name,H=e.showThumbnail?l("div",{class:"".concat(u.value,"__file-info")},[A(k),D]):D,K=k.url?l(tt,{href:k.url,target:"_blank",hover:"color"},Zr(H)?H:{default:function(){return[H]}}):H;return l("tr",{key:k.name+z+k.size},[l("td",{class:"".concat(u.value,"__file-name"),key:k.name+k.url},[K]),l("td",null,[Wl(k.size)]),l("td",null,[I(k)]),v.value?null:m])})])])},T=function(){var h=y("fileListDisplay",{params:{cancelUpload:e.cancelUpload,uploadFiles:e.uploadFiles,onRemove:e.onRemove,onPreview:e.onPreview,toUploadFiles:e.toUploadFiles,sizeOverLimitMessage:e.sizeOverLimitMessage,locale:e.locale,files:e.displayFiles,dragEvents:P.value}});return h||e.fileListDisplay?h:l("ul",{class:"".concat(u.value,"__card clearfix")},[e.displayFiles.map(function(U,R){return p(U,R)})])};return function(){var V,h,U,R="".concat(u.value,"__flow-card-area"),ee=v.value||!o.value,te=n.uploadButton||Se(e.uploadButton),k=Boolean(v.value||o.value||!c.value.length),z=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")},[(V=n.default)===null||V===void 0?void 0:V.call(n),e.placeholder&&l("small",{class:"".concat(u.value,"__flow-placeholder ").concat(u.value,"__placeholder")},[e.placeholder])]),e.theme==="image-flow"&&l("div",re({class:R},P.value),[c.value.length?T():C()]),e.theme==="file-flow"&&(c.value.length?E():l("div",re({class:R},P.value),[C()])),!e.autoUpload&&(e.uploadButton!==null||e.cancelUploadButton!==null)&&l("div",{class:"".concat(u.value,"__flow-bottom")},[e.cancelUploadButton!==null&&(te?y("cancelUploadButton",{params:{disabled:ee,cancelUploadText:(h=d.value)===null||h===void 0?void 0:h.cancelUploadText,cancelUpload:e.cancelUpload}}):l(ye,re({theme:"default",disabled:ee,content:(U=d.value)===null||U===void 0?void 0:U.cancelUploadText,class:"".concat(u.value,"__cancel"),onClick:function(w){var m;return(m=e.cancelUpload)===null||m===void 0?void 0:m.call(e,{e:w})}},gt(e.cancelUploadButton)?e.cancelUploadButton:{}),null)),e.uploadButton!==null&&(z?y("uploadButton",{params:{disabled:k,uploading:o.value,uploadText:O.value,uploadFiles:e.uploadFiles}}):l(ye,re({disabled:k,theme:"primary",loading:o.value,class:"".concat(u.value,"__continue"),content:O.value,onClick:function(){var w;return(w=e.uploadFiles)===null||w===void 0?void 0:w.call(e)}},gt(e.uploadButton)?e.uploadButton:{}),null))]),l(dt,re({images:L.value.map(function(B){return B.url||B.raw}),visible:!!L.value.length,onClose:function(){L.value=[]},index:S.value,onIndexChange:function(w){return S.value=w}},e.imageViewerProps),null)])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Oa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ye(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){N(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 Yr(t){var e,a=t.method,n=a===void 0?"POST":a,r=t.action,o=t.withCredentials,v=o===void 0?!1:o,c=t.headers,i=c===void 0?{}:c,s=t.data,u=s===void 0?{}:s,d=t.file,y=t.files,g=y===void 0?[]:y,b=t.name,$=b===void 0?"file":b,_=t.useMockProgress,M=_===void 0?!0:_,x=t.mockProgressDuration,F=x===void 0?300:x,L=t.formatRequest,S=t.onError,O=t.onProgress,P=t.onSuccess,j=g||[],C=0,p=new XMLHttpRequest;v&&(p.withCredentials=!0);var I,Z;if(M&&((e=g[0])===null||e===void 0?void 0:e.status)==="progress")var Q=setTimeout(function(){I=setInterval(function(){C+10<100?(C=Math.max(C+10,C),g[0]&&C!==g[0].percent&&(g[0].percent=C,O({percent:C,file:d||j[0],files:j.map(function(T){return Ye(Ye({},T),{},{percent:C})}),type:"mock",XMLHttpRequest:p}))):clearInterval(I)},F),clearTimeout(Q)},F);var X={};if(u){var A=Se(u)?u(j):u;Object.assign(X,A)}j.forEach(function(T,V){var h=j.length>1?"".concat($,"[").concat(V,"]"):$;X[h]=T.raw}),j.length===1?X[$]=j[0].raw:X[$]=j.map(function(T){return T.raw}),X.length=j.length,L&&(X=L(X));var E=new FormData;return Object.keys(X).forEach(function(T){E.append(T,X[T])}),p.open(n,r,!0),Object.keys(i).forEach(function(T){p.setRequestHeader(T,i[T])}),p.onerror=function(T){S({event:T,file:d,files:j,XMLHttpRequest:p}),clearInterval(I),clearTimeout(Z)},p.ontimeout=function(T){S({event:T,file:d,files:j,XMLHttpRequest:p})},p.upload&&(p.upload.onprogress=function(T){var V,h=0;if(T.total>0&&(h=Math.round(T.loaded/T.total*100)),C=Math.max(h,C),C!==h&&((V=j[0])===null||V===void 0?void 0:V.percent)!==C){var U=j.map(function(R){return Ye(Ye({},R),{},{percent:C})});O({event:T,percent:C,file:d||U[0],files:U,type:"real",XMLHttpRequest:p})}}),p.onload=function(T){var V={};V.XMLHttpRequest=p;var h=p.status<200||p.status>=300;if(h)return S({event:T,file:d,files:j,response:V,XMLHttpRequest:p});var U=p.responseText||p.response;try{V=JSON.parse(U)}catch{V=U,Pe.error("Upload","response does not a valid json")}clearInterval(I),clearTimeout(Z),j.forEach(function(R){var ee;R.percent=100,R.status="success",R.uploadTime=((ee=V)===null||ee===void 0?void 0:ee.uploadTime)||Ta()}),Re(V)==="object"&&(V.XMLHttpRequest=p),P({event:T,file:d||j[0],files:ie(j),XMLHttpRequest:p,response:V})},p.send(E),p.upload.requestParams=X,p.upload.requestHeaders=i,p}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function wa(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 ve(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?wa(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):wa(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Jr(t,e){var a=e.sizeLimit,n=e.beforeUpload,r=new Promise(function(i){var s=null;if(a){var u=lt(a)?{size:a,unit:"KB"}:a,d=er(t.size,u.size,u.unit);d&&(s=u)}i(s)}),o=[r,void 0];if(Se(n)){var v=n(t),c=v instanceof Promise?v:new Promise(function(i){return i(v)});o[1]=c}return new Promise(function(i){Promise.all(o).then(function(s){i(s)})})}function _a(t){var e=t.event,a=t.files,n=t.response,r=t.XMLHttpRequest,o=t.formatResponse,v=n;return Se(o)&&(v=o(n,{file:a[0],currentFiles:a})),a.forEach(function(c){c.status="fail",c.response=v}),{response:v,event:e,files:a,XMLHttpRequest:r}}function Wr(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(v){var c;v.percent=100,v.status="success",(c=v.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 Qr(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 Fa(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(!Qr(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 s=[];c.status==="success"&&i.files?s=i.files.map(function(g){var b=a.find(function($){return g.name&&$.name===g.name||g.raw&&$.raw===g.raw});return ve(ve(ve({},b),g),{},{status:c.status,response:i})}):(a.forEach(function(g){var b;g.status=c.status,g.response=i,g.url=i.url,g.percent=c.status==="success"?100:0,g.uploadTime=((b=i)===null||b===void 0?void 0:b.uploadTime)||Ta()}),s=a);var u={response:i,file:s[0],files:s};if(c.status==="success"){var d;(d=t.onResponseSuccess)===null||d===void 0||d.call(t,u)}else if(c.status==="fail"){var y;(y=t.onResponseError)===null||y===void 0||y.call(t,u)}r({status:c.status,data:u})});else{var o,v=Yr({action:t.action,files:t.toUploadFiles,useMockProgress:t.useMockProgress,mockProgressDuration:t.mockProgressDuration,onError:function(i){var s,u=_a(ve(ve({},i),{},{formatResponse:t.formatResponse}));(s=t.onResponseError)===null||s===void 0||s.call(t,u),r({status:"fail",data:u})},onProgress:t.onResponseProgress,onSuccess:function(i){var s=t.formatResponse,u=i.response;if(Se(s)&&(u=s(i.response,{file:i.file,currentFiles:i.files})),u.error){var d,y=_a(ve(ve({},i),{},{response:u}));(d=t.onResponseError)===null||d===void 0||d.call(t,y),r({status:"fail",data:y})}else{var g;i.file.response=u,i.files[0].response=u;var b=Wr(ve(ve({},i),{},{response:u}));(g=t.onResponseSuccess)===null||g===void 0||g.call(t,b),r({status:"success",data:b})}},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:v})}})}function eo(t,e){for(var a=t.filter(function(c){return c.url}),n=a,r=function(){var i=e[o],s=t.findIndex(function(d){return d.raw&&d.raw===i.raw||d.name&&d.name===i.name}),u=s>=0?ve(ve({},t[s]),i):i;n.push(u)},o=0,v=e.length;o<v;o++)r();return n}function to(t){var e=t.uploadAllFilesInOneRequest,a=t.toUploadFiles,n=t.uploadedFiles,r=t.isBatchUpload,o=a.filter(function(v){return!v.response||v.response&&!v.response.error});return new Promise(function(v){if(e||!t.multiple){Fa(t).then(function(i){i.status==="success"&&(i.data.files=r||!t.multiple?i.data.files:eo(n,i.data.files));var s=i.status==="fail"?i.data.files:[];v(ve(ve({},i),{},{failedFiles:s}))});return}var c=o.map(function(i){return Fa(ve(ve({},t),{},{toUploadFiles:[i]}))});Promise.all(c).then(function(i){var s=[],u=[];i.forEach(function(g){g.status==="success"?s.push(g.data.files[0]):g.status==="fail"&&u.push(g.data.files[0])});var d=t.autoUpload?n.concat(s):n,y=r||!t.multiple?s:d;v({status:s.length?"success":"fail",data:{files:y},failedFiles:u,list:i})})})}function rt(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 v=ve({raw:r,lastModified:r.lastModified,name:r.name,size:r.size,type:r.type,percent:n,status:a},o);return v})}function ao(t){var e=t.files,a=t.uploadValue,n=t.max,r=t.allowUploadDuplicateFile;return new Promise(function(o){var v=e.filter(function(_){var M=a.find(function(x){return x.name===_.name});return r||!M}),c=!1;if(v.length<e.length&&(c=!0),!v.length){var i=rt(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 s=!1;if(n&&v.length&&!t.isBatchUpload){var u=v.length;v=v.slice(0,n-a.length),u+a.length>n&&(s=!0)}var d=rt(v,t.format,t.autoUpload?"progress":"waiting"),y;if(t.beforeAllFilesUpload){var g,b=(g=t.beforeAllFilesUpload)===null||g===void 0?void 0:g.call(t,d);y=b instanceof Promise?b:new Promise(function(_){return _(b)})}var $=d.map(function(_){return new Promise(function(M){Jr(_,{beforeUpload:t.beforeUpload,sizeLimit:t.sizeLimit}).then(function(x){var F=Oe(x,2),L=F[0],S=F[1];L?M({file:_,validateResult:{type:"FILE_OVER_SIZE_LIMIT",extra:L}}):S===!1&&M({file:_,validateResult:{type:"CUSTOM_BEFORE_UPLOAD"}}),M({file:_})})})});Promise.all([y].concat($)).then(function(_){var M=Tn(_),x=M[0],F=M.slice(1);o(x===!1?{lengthOverLimit:s,hasSameNameFile:c,validateResult:{type:"BEFORE_ALL_FILES_UPLOAD"},files:d}:{lengthOverLimit:s,hasSameNameFile:c,fileValidateList:F,files:d})})})}function no(t,e){var a=[],n=[],r=[];return t.forEach(function(o){var v,c;if(((v=o.validateResult)===null||v===void 0?void 0:v.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 lo(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 ro(t){var e=t.multiple,a=t.uploadValue,n=t.toUploadFiles,r=t.autoUpload,o=r?n:n.filter(function(v){return v.status!=="success"});return e&&!t.isBatchUpload?r?(o.length?a.concat(o):a)||[]:a:(o.length?o:a)||[]}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function 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 Je(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){N(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 oo(t){var e=G(),a=we(t),n=a.disabled,r=a.autoUpload,o=a.isBatchUpload,v=a.multiple,c=a.files,i=a.modelValue,s=a.defaultFiles,u=$e("upload"),d=u.globalConfig,y=u.t,g=u.classPrefix,b=vt(c,i,s.value,t.onChange,"files"),$=Oe(b,2),_=$[0],M=$[1],x=G([]),F=G([]),L=G(""),S=f(function(){return xa({},d.value,t.locale)}),O="".concat(g.value,"-upload__tips ").concat(g.value,"-size-s"),P=[O].concat("".concat(g.value,"-upload__tips-error")),j="".concat(g.value,"-upload__placeholder"),C=f(function(){var w,m=lo({isBatchUpload:o.value,multiple:v.value,status:(w=_.value)===null||w===void 0||(w=w[0])===null||w===void 0?void 0:w.status,autoUpload:r.value});return S.value.triggerUploadText[m]}),p=G(!1),I=f(function(){return ro({multiple:t.multiple,toUploadFiles:F.value,uploadValue:_.value,autoUpload:r.value,isBatchUpload:o.value})}),Z=function(m){var D=m.file,H=m.percent,K=r.value?F:_,q=K.value.findIndex(function(ne){return D.raw===ne.raw});K.value[q]=Je(Je({},K.value[q]),{},{percent:H})},Q=function(){t.autoUpload&&(F.value=ie(F.value))},X=function(m){var D;if(!(!m||!m.files||!m.files[0])){var H=m.response,K=m.event,q=m.files;Q(),(D=t.onOneFileFail)===null||D===void 0||D.call(t,{e:K,file:q==null?void 0:q[0],currentFiles:q,failedFiles:q,response:H}),(!t.multiple||t.isBatchUpload)&&M([],{trigger:"progress-fail",e:m.event,file:m.files[0]})}},A=function(m){var D;Q(),(D=t.onProgress)===null||D===void 0||D.call(t,{e:m.event,file:m.file,currentFiles:m.files,percent:m.percent,type:m.type,XMLHttpRequest:m.XMLHttpRequest})},E=function(m){if(t.multiple&&!t.uploadAllFilesInOneRequest){var D;Q(),(D=t.onOneFileSuccess)===null||D===void 0||D.call(t,{e:m.event,file:m.files[0],response:m.response})}};function T(w){var m=w;return m.message?y(m.message,{sizeLimit:m.size}):"".concat(y(S.value.sizeLimitMessage,{sizeLimit:m.size})," ").concat(m.unit)}var V=function(m){var D=t.multiple&&!o.value?_.value.concat(m):m;!D.length||(M(D,{trigger:"add",index:_.value.length,file:m[0],files:m}),F.value=[])},h=function(m){var D;if(!n.value){var H={currentSelectedFiles:rt(ie(m),t.format)};(D=t.onSelectChange)===null||D===void 0||D.call(t,ie(m),H),ao({uploadValue:_.value,files:ie(m),allowUploadDuplicateFile:t.allowUploadDuplicateFile,max:t.multiple?t.max:0,sizeLimit:t.sizeLimit,isBatchUpload:o.value,autoUpload:r.value,format:t.format,beforeUpload:t.beforeUpload,beforeAllFilesUpload:t.beforeAllFilesUpload}).then(function(K){var q;if(((q=K.validateResult)===null||q===void 0?void 0:q.type)==="BEFORE_ALL_FILES_UPLOAD"){var ne,oe={type:"BEFORE_ALL_FILES_UPLOAD",files:K.files};(ne=t.onValidate)===null||ne===void 0||ne.call(t,oe);return}if(K.lengthOverLimit){var _e,xe={type:"FILES_OVER_LENGTH_LIMIT",files:K.files};if((_e=t.onValidate)===null||_e===void 0||_e.call(t,xe),!K.files.length)return}if(K.hasSameNameFile){var Fe,Ie={type:"FILTER_FILE_SAME_NAME",files:K.files};(Fe=t.onValidate)===null||Fe===void 0||Fe.call(t,Ie)}if(K.fileValidateList instanceof Array){var Te,Ee=no(K.fileValidateList,T),Ae=Ee.sizeLimitErrors,ae=Ee.beforeUploadErrorFiles,J=Ee.toFiles,le=r.value?J:F.value.concat(J);if(F.value=le,(Te=t.onWaitingUploadFilesChange)===null||Te===void 0||Te.call(t,{files:le,trigger:"validate"}),Ae[0]){var Ue;L.value=Ae[0].file.response.error,(Ue=t.onValidate)===null||Ue===void 0||Ue.call(t,{type:"FILE_OVER_SIZE_LIMIT",files:Ae.map(function(qa){return qa.file})})}else if(L.value="",ae.length){var Xe,Ka={type:"CUSTOM_BEFORE_UPLOAD",files:ae};(Xe=t.onValidate)===null||Xe===void 0||Xe.call(t,Ka)}r.value?te(le):V(le)}}),e.value.value=null}},U=function(m){var D=Aa(m.target.files);h==null||h(D)};function R(w){h==null||h(w)}function ee(w){h==null||h(ie(w.clipboardData.files))}function te(w){var m=_.value.filter(function(H){return H.status!=="success"}),D=r.value?w||F.value:m;!D||!D.length||(p.value=!0,x.value=[],to({action:t.action,headers:t.headers,method:t.method,name:t.name,withCredentials:t.withCredentials,uploadedFiles:_.value,toUploadFiles:D,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:A,onResponseSuccess:E,onResponseError:X,setXhrObject:function(K){var q;(q=K.files[0])!==null&&q!==void 0&&q.raw&&x.value.find(function(ne){var oe;return((oe=ne.files[0])===null||oe===void 0?void 0:oe.raw)===K.files[0].raw})||(x.value=x.value.concat(K))}}).then(function(H){var K=H.status,q=H.data,ne=H.list,oe=H.failedFiles;if(p.value=!1,K==="success"){var _e;M(ie(q.files),{trigger:"add",file:q.files[0]}),x.value=[],(_e=t.onSuccess)===null||_e===void 0||_e.call(t,{fileList:q.files,currentFiles:D,file:D[0],results:ne==null?void 0:ne.map(function(Ie){return Ie.data}),response:q.response||ne.map(function(Ie){return Ie.data.response}),XMLHttpRequest:q.XMLHttpRequest})}else if(oe!=null&&oe[0]){var xe;(xe=t.onFail)===null||xe===void 0||xe.call(t,{e:q.event,file:oe[0],failedFiles:oe,currentFiles:D,response:q.response,XMLHttpRequest:q.XMLHttpRequest})}if(r.value){var Fe;F.value=oe,(Fe=t.onWaitingUploadFilesChange)===null||Fe===void 0||Fe.call(t,{files:oe,trigger:"uploaded"})}}))}function k(w){var m,D,H;L.value="",(m=(D=w.e).stopPropagation)===null||m===void 0||m.call(D);var K={e:w.e,trigger:"remove",index:w.index,file:w.file};if(t.isBatchUpload||!t.multiple){var q;F.value=[],(q=t.onWaitingUploadFilesChange)===null||q===void 0||q.call(t,{files:[],trigger:"remove"}),M([],K)}else if(!t.autoUpload)_.value.splice(w.index,1),M(ie(_.value),K);else if(w.index<_.value.length)_.value.splice(w.index,1),M(ie(_.value),K);else{var ne;F.value.splice(w.index-_.value.length,1),F.value=ie(F.value),(ne=t.onWaitingUploadFilesChange)===null||ne===void 0||ne.call(t,{files:ie(F.value),trigger:"remove"})}(H=t.onRemove)===null||H===void 0||H.call(t,w)}var z=function(m){var D;n.value||!e.value||(m==null||(D=m.stopPropagation)===null||D===void 0||D.call(m),e.value.click())},B=function(m){var D,H;(D=x.value)===null||D===void 0||D.forEach(function(K){var q;(q=K.xhrReq)===null||q===void 0||q.abort()}),p.value=!1,r.value?F.value=[]:M(_.value.map(function(K){return K.status!=="success"?Je(Je({},K),{},{status:"waiting"}):K}),{trigger:"abort"}),m!=null&&m.file&&!r.value&&(k==null||k({file:m.file,e:m.e,index:0})),(H=t.onCancelUpload)===null||H===void 0||H.call(t)};return{t:y,locale:S,classPrefix:g,triggerUploadText:C,toUploadFiles:F,uploadValue:_,displayFiles:I,sizeOverLimitMessage:L,uploading:p,tipsClasses:O,errorClasses:P,placeholderClass:j,inputRef:e,disabled:n,xhrReq:x,uploadFilePercent:Z,uploadFiles:te,onFileChange:h,onNormalFileChange:U,onDragFileChange:R,onPasteFileChange:ee,onInnerRemove:k,triggerUpload:z,cancelUpload:B}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Pa(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Sa(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){N(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}var io=W({name:"UploadCustomFile",props:Sa(Sa({},qe),{},{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,v=r.displayFiles,c=r.accept,i=ft(e.dragEvents,c),s=i.dragActive,u=et(),d=function(){var g,b={dragActive:s.value||!1,files:v.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:b})||((g=e.childrenNode)===null||g===void 0?void 0:g.call(e,b))])])};return function(){var y,g;return l(he,null,[e.draggable?d():l("div",{class:"".concat(o.value,"-upload__trigger"),onClick:e.triggerUpload},[((y=e.childrenNode)===null||y===void 0?void 0:y.call(e,{files:v.value}))||((g=n.default)===null||g===void 0?void 0:g.call(n))])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ja(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 uo(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ja(Object(a),!0).forEach(function(n){N(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ja(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var co=W({name:"TUpload",props:Rr,setup:function(e,a){var n=a.slots,r=a.expose,o=et(),v=fe(),c=oo(e),i=c.locale,s=c.classPrefix,u=c.triggerUploadText,d=c.toUploadFiles,y=c.displayFiles,g=c.uploadValue,b=c.sizeOverLimitMessage,$=c.uploading,_=c.tipsClasses,M=c.errorClasses,x=c.placeholderClass,F=c.inputRef,L=c.onInnerRemove,S=c.uploadFiles,O=c.onNormalFileChange,P=c.onDragFileChange,j=c.onPasteFileChange,C=c.triggerUpload,p=c.cancelUpload,I=c.uploadFilePercent,Z=Ua();r({upload:F.value,uploading:$,triggerUpload:C,uploadFiles:S,cancelUpload:p,uploadFilePercent:I});var Q=function(){var te=function(){return e.theme==="file-input"?l(ye,re({disabled:Z.value,variant:"outline"},e.triggerButtonProps),{default:function(){return[u.value]}}):l(ye,re({disabled:Z.value,variant:"outline",icon:function(){return l(Ul,null,null)}},e.triggerButtonProps),{default:function(){return[u.value]}})};return o("default","trigger",{params:{dragActive:!1,files:g.value}})||te()},X=f(function(){return{accept:e.accept,files:g.value,toUploadFiles:d.value,displayFiles:y.value,theme:e.theme,placeholder:e.placeholder,disabled:Z.value,tips:e.tips,status:e.status,sizeOverLimitMessage:b.value,uploading:$.value,classPrefix:s.value,tipsClasses:_,errorClasses:M,placeholderClass:x,locale:i.value,autoUpload:e.autoUpload,abridgeName:e.abridgeName,showUploadProgress:e.showUploadProgress,fileListDisplay:e.fileListDisplay,onRemove:L,uploadPastedFiles:e.uploadPastedFiles,onPasteFileChange:j,imageViewerProps:e.imageViewerProps}}),A={onDragFileChange:P,onDragenter:e.onDragenter,onDragleave:e.onDragleave,onDrop:e.onDrop},E=f(function(){return["".concat(s.value,"-upload"),N({},"".concat(s.value,"-upload--theme-").concat(e.theme),e.theme==="file-input")]}),T=function(){return l(Hr,re(X.value,{multiple:e.multiple}),{default:function(){return[l("div",{class:"".concat(s.value,"-upload__trigger"),onClick:C},[Q()])]},fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},V=function(){return l(Kr,re(X.value,{dragEvents:A,trigger:e.trigger,cancelUpload:p,triggerUpload:C,uploadFiles:S,onCancelUpload:e.onCancelUpload}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},h=function(){return l(Xr,re(X.value,{multiple:e.multiple,max:e.max,showUploadProgress:e.showUploadProgress,triggerUpload:C,uploadFiles:S,cancelUpload:p,onPreview:e.onPreview,showImageFileName:e.showImageFileName}),{fileListDisplay:n.fileListDisplay,"file-list-display":n["file-list-display"]})},U=function(){return l(Gr,re(X.value,{isBatchUpload:e.isBatchUpload,draggable:e.draggable,dragEvents:A,uploadFiles:S,cancelUpload:p,onPreview:e.onPreview,showImageFileName:e.showImageFileName,showThumbnail:e.showThumbnail,uploadButton:e.uploadButton,cancelUploadButton:e.cancelUploadButton}),{default:function(){return[l("div",{class:"".concat(s.value,"-upload__trigger"),onClick:C},[!e.draggable&&Q()])]},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"]})},R=function(){return l(io,re(X.value,{draggable:e.draggable,dragContent:e.dragContent,dragEvents:A,triggerUpload:C,trigger:e.trigger,childrenNode:n.default}),{default:function(){return[Q()]},dragContent:n.dragContent,"drag-content":n["drag-content"],trigger:n.trigger})};return function(){return l("div",{class:E.value,onPaste:e.uploadPastedFiles?j:void 0},[l("input",re({ref:F,type:"file",disabled:Z.value,onChange:O,multiple:e.multiple,accept:e.accept,hidden:!0},e.inputAttributes?uo({},e.inputAttributes):{}),null),["file","file-input"].includes(e.theme)&&!e.draggable&&T(),["file","image"].includes(e.theme)&&e.draggable&&V(),e.theme==="image"&&!e.draggable&&h(),["image-flow","file-flow"].includes(e.theme)&&U(),e.theme==="custom"&&R(),Boolean(e.tips||n.tips)&&l("small",{class:[_,N({},"".concat(s.value,"-upload__tips-").concat(e.status),e.status)]},[v("tips")]),b.value&&l("small",{class:M},[b.value])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var so=je(co);const vo=t=>(mn("data-v-e9760a40"),t=t(),pn(),t),fo={class:"container"},go={style:{"margin-right":"20px"}},mo={style:{display:"flex","align-items":"center","justify-content":"space-between"}},po={style:{display:"flex",width:"100%"}},ho={style:{width:"90%"}},yo=vo(()=>Le("br",null,null,-1)),bo={style:{width:"10%",margin:"auto","text-align":"center"}},Oo={name:"Backup"},wo=W({...Oo,setup(t){Za();const e=Ga(),a=hn(),n=mt({binaryFile:void 0,loading:!1,showPanel:!1,showUpload:!1,refLoading:!1}),r=mt({title:"",desc:"",firmware:[]}),o=()=>{n.showPanel=!0},v=()=>{r.title="",r.desc="",r.firmware=[],n.showUpload=!0},c=()=>{console.log(r),n.showUpload=!1},i=()=>{n.refLoading=!0,setTimeout(()=>{n.refLoading=!1},1e3)},s=u=>{a.push({path:"/tool/flash",query:{url:u}})};return(u,d)=>{const y=Ya,g=sn,b=vn,$=dn,_=on,M=In,x=un,F=fn,L=gn,S=ye,O=Dn,P=tt,j=Lr,C=zr,p=Ar,I=Xn,Z=En,Q=cr,X=so,A=Un;return Ze(),Ge("div",fo,[l(y,{items:[u.$t("menu.workshop"),u.$t("menu.firmware")]},null,8,["items"]),l(L,{gutter:20,align:"stretch"},{default:Y(()=>[l(F,{span:24},{default:Y(()=>[l(x,{class:"general-card",title:u.$t("menu.firmware")},{extra:Y(()=>[Le("div",go,[ke(e).name?(Ze(),Ge(he,{key:0},[l(g,{onClick:o},{default:Y(()=>[de("\xA0\xA0"+ze(ke(e).name)+"\xA0\xA0",1)]),_:1}),l(g,{onClick:d[0]||(d[0]=E=>ke(e).logout())},{default:Y(()=>[de("\xA0\xA0\u9000\u51FA\xA0\xA0")]),_:1})],64)):(Ze(),Ge(he,{key:1},[l(g,{onClick:d[1]||(d[1]=E=>ke(e).setInfo({showLogin:!0}))},{default:Y(()=>[de("\xA0\xA0\u767B\u5F55\xA0\xA0")]),_:1}),l(g,{onClick:d[2]||(d[2]=E=>ke(e).setInfo({showRegister:!0}))},{default:Y(()=>[de("\xA0\xA0\u6CE8\u518C\xA0\xA0")]),_:1})],64))])]),default:Y(()=>[l(_,null,{default:Y(()=>[l($,{style:{width:"100%"}},{actions:Y(()=>[l(g,{onClick:d[3]||(d[3]=E=>s("/LOSEHU126.bin"))},{default:Y(()=>[de(ze(u.$t("global.use")),1)]),_:1})]),default:Y(()=>[l(b,{title:"LOSEHU126.bin",description:"https://github.com/losehu/uv-k5-firmware-custom"})]),_:1}),l($,{style:{width:"100%"}},{actions:Y(()=>[l(g,{onClick:d[4]||(d[4]=E=>s("/LOSEHU126K.bin"))},{default:Y(()=>[de(ze(u.$t("global.use")),1)]),_:1})]),default:Y(()=>[l(b,{title:"LOSEHU126K.bin",description:"https://github.com/losehu/uv-k5-firmware-custom"})]),_:1}),l($,{style:{width:"100%"}},{actions:Y(()=>[l(g,{onClick:d[5]||(d[5]=E=>s("/LOSEHU126H.bin"))},{default:Y(()=>[de(ze(u.$t("global.use")),1)]),_:1})]),default:Y(()=>[l(b,{title:"LOSEHU126H.bin",description:"https://github.com/losehu/uv-k5-firmware-custom"})]),_:1}),l($,{style:{width:"100%"}},{actions:Y(()=>[l(g,{onClick:d[6]||(d[6]=E=>s("/LOSEHU117P6.bin"))},{default:Y(()=>[de(ze(u.$t("global.use")),1)]),_:1})]),default:Y(()=>[l(b,{title:"LOSEHU117P6\uFF08\u6211\u57FA\u4E8E LOSEHU117 \u4FEE\u6539\u7684\u56FA\u4EF6\uFF09",description:"https://github.com/silenty4ng/uv-k5-firmware-chinese-lts"})]),_:1}),l($,{style:{width:"100%"}},{actions:Y(()=>[l(g,{onClick:d[7]||(d[7]=E=>s("/LOSEHU117P6K.bin"))},{default:Y(()=>[de(ze(u.$t("global.use")),1)]),_:1})]),default:Y(()=>[l(b,{title:"LOSEHU117P6K\uFF08\u6211\u57FA\u4E8E LOSEHU117K \u4FEE\u6539\u7684\u56FA\u4EF6\uFF09",description:"https://github.com/silenty4ng/uv-k5-firmware-chinese-lts"})]),_:1})]),_:1}),l(M,{style:{margin:"10px"},total:5,showPageNumber:"",showPageSize:!1})]),_:1},8,["title"])]),_:1})]),_:1}),l(p,{visible:n.showPanel,"onUpdate:visible":d[8]||(d[8]=E=>n.showPanel=E),size:"50%",header:"\u6211\u7684\u56FA\u4EF6",footer:!1},{default:Y(()=>[Le("div",mo,[l(S,{style:{margin:"10px"},onClick:v},{default:Y(()=>[de("\u4E0A\u4F20\u65B0\u56FA\u4EF6")]),_:1}),l(S,{loading:n.refLoading,shape:"circle",theme:"outline",onClick:i},{icon:Y(()=>[l(ke(Cl))]),_:1},8,["loading"])]),l(C,{split:!0},{default:Y(()=>[(Ze(),Ge(he,null,cn(20,E=>l(j,null,{default:Y(()=>[Le("div",po,[Le("div",ho,[l(O,{theme:"primary",variant:"outline"},{default:Y(()=>[de("\u5BA1\u6838\u4E2D")]),_:1}),de(" \u56FA\u4EF6\u540D\u79F0 "),yo,de(" \u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0\u56FA\u4EF6\u63CF\u8FF0 ")]),Le("div",bo,[l(P,{theme:"primary",hover:"color"},{default:Y(()=>[de("\u5220\u9664")]),_:1})])])]),_:1})),64))]),_:1})]),_:1},8,["visible"]),l(p,{visible:n.showUpload,"onUpdate:visible":d[12]||(d[12]=E=>n.showUpload=E),size:"25%",header:"\u4E0A\u4F20\u65B0\u56FA\u4EF6",footer:!1},{default:Y(()=>[l(A,{data:r,"reset-type":"initial",colon:"",onSubmit:c},{default:Y(()=>[l(Z,{label:"\u56FA\u4EF6\u540D\u79F0",name:"title","label-align":"top"},{default:Y(()=>[l(I,{modelValue:r.title,"onUpdate:modelValue":d[9]||(d[9]=E=>r.title=E)},null,8,["modelValue"])]),_:1}),l(Z,{label:"\u56FA\u4EF6\u63CF\u8FF0",name:"desc","label-align":"top"},{default:Y(()=>[l(Q,{autosize:{minRows:5,maxRows:10},modelValue:r.desc,"onUpdate:modelValue":d[10]||(d[10]=E=>r.desc=E),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1}),l(Z,{label:"\u56FA\u4EF6\u6587\u4EF6",name:"firmware","label-align":"top"},{default:Y(()=>[l(X,{modelValue:r.firmware,"onUpdate:modelValue":d[11]||(d[11]=E=>r.firmware=E),action:"https://service-bv448zsw-1257786608.gz.apigw.tencentcs.com/api/upload-demo","abridge-name":[8,6],theme:"file-input",placeholder:"\u672A\u9009\u62E9\u6587\u4EF6"},null,8,["modelValue"])]),_:1}),l(Z,{"label-align":"top"},{default:Y(()=>[l(S,{theme:"primary",type:"submit",block:""},{default:Y(()=>[de("\u63D0\u4EA4\u5BA1\u6838")]),_:1})]),_:1})]),_:1},8,["data"])]),_:1},8,["visible"])])}}});const Vo=Ja(wo,[["__scopeId","data-v-e9760a40"]]);export{Vo as default};
|