mirror of
https://github.com/silenty4ng/k5web
synced 2024-11-14 14:33:23 +00:00
235 lines
212 KiB
JavaScript
235 lines
212 KiB
JavaScript
import{O as un,P as sn,Q as cn,b as Kt,i as Yt,a2 as Re,aj as xe,aG as Kl,ah as Te,w as qt,as as Po,ar as Ll,at as kl,au as Ao,n as Pe,g as fe,c as jo,f as z,m as Lt,h as Fo,az as Un,l as Io,aH as Nl,aI as gr,o as dt,aJ as Ml,aA as Va,aK as Bl,aL as Ko,aq as zl,$ as H,aM as Hl,aN as Wl,aO as $l,av as Vl,d as ht,a1 as Ul,W as Ua,al as Xl,aP as pr,aQ as Gl,ab as Lo,X as En,aR as Yl,N as pa,k as Pa,a4 as ql,aS as Jl,a0 as rr,am as Zl,aT as Ql,aU as ei}from"./index.3e53dd4f.js";import{d as ze,c as N,f as W,w as de,o as yt,bN as ti,bO as ni,b as Ra,aI as L,n as Gt,t as Ke,i as br,aV as Ie,bA as ai,u as ri,x as oi,y as li,aY as ko,p as No,r as Xn,h as Ye,aU as dn,aZ as ii,g as Mo,s as ui}from"./arco.c29bba08.js";import{_ as Bo,b as zo,o as Ho,c as mr,t as si,d as or,T as Wo,p as Cn,P as ci,e as $o,u as di,f as kt,A as Vo,g as Uo,h as Xa,i as wr,E as Xo,j as Go,k as Yo,l as vi,m as ba,C as Ga,a as qo,n as fi,q as hi,r as gi}from"./dep-6deb4e3a.300404c4.js";import{i as xn,b as Jo,d as pi,_ as Zo,c as bi,l as Be,I as mi}from"./index.c4d5074a.js";import{_ as Ya,r as wn,i as wi,s as $n,v as Qo}from"./form-model.d4a8bc76.js";function yr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Cr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?yr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):yr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var yi={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 2v16h16V4H4zm9 2.5V11h4.5v2H13v4.5h-2V13H6.5v-2H11V6.5h2z"}}]},Ci=ze({name:"AddRectangleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-add-rectangle",r.value]),i=N(()=>Cr(Cr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(yi,u.value)}});const xi=Ci;function xr(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 Sr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):xr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Si={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 3a9 9 0 100 18 9 9 0 000-18zM1 12a11 11 0 1122 0 11 11 0 01-22 0zm9.5-5.41L15.91 12l-5.41 5.41L9.09 16l4-4-4-4 1.41-1.41z"}}]},Oi=ze({name:"ChevronRightCircleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-chevron-right-circle",r.value]),i=N(()=>Sr(Sr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(Si,u.value)}});const Ri=Oi;function Or(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Rr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Or(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ei={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M16.83 1.42l5.75 5.75L7.75 22H2v-5.75L16.83 1.42zm0 8.68l2.92-2.93-2.92-2.93-2.93 2.93 2.93 2.93zm-4.34-1.51L4 17.07V20h2.93l8.48-8.49L12.5 8.6z"}}]},Di=ze({name:"Edit1Icon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-edit-1",r.value]),i=N(()=>Rr(Rr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(Ei,u.value)}});const _i=Di;function Er(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?Er(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Er(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ti={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.57 3h18.86l-6.93 9.82V21h-5v-8.18L2.57 3zm3.86 2l5.07 7.18V19h1v-6.82L17.57 5H6.43z"}}]},Pi=ze({name:"FilterIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-filter",r.value]),i=N(()=>Dr(Dr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(Ti,u.value)}});const Ai=Pi;function _r(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Tr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_r(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ji={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 2v16h16V4H4zm2.5 7h11v2h-11v-2z"}}]},Fi=ze({name:"MinusRectangleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-minus-rectangle",r.value]),i=N(()=>Tr(Tr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(ji,u.value)}});const Ii=Fi;function Pr(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 Ar(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Pr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Pr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ki={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M6.75 2.25h3v3h-3v-3zm7.5 0h3v3h-3v-3zm-7.5 5.5h3v3h-3v-3zm7.5 0h3v3h-3v-3zm-7.5 5.5h3v3h-3v-3zm7.5 0h3v3h-3v-3zm-7.5 5.5h3v3h-3v-3zm7.5 0h3v3h-3v-3z"}}]},Li=ze({name:"MoveIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-move",r.value]),i=N(()=>Ar(Ar({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(Ki,u.value)}});const vc=Li;function jr(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?jr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):jr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ki={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 .85l9.66 5.57v11.16L12 23.15l-9.66-5.57V6.42L12 .85zm0 2.3L4.34 7.58v8.84L12 20.85l7.66-4.43V7.58L12 3.15zM12 9a3 3 0 100 6 3 3 0 000-6zm-5 3a5 5 0 1110 0 5 5 0 01-10 0z"}}]},Ni=ze({name:"SettingIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-setting",r.value]),i=N(()=>Fr(Fr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(ki,u.value)}});const Mi=Ni;/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Bi={container:{type:[String,Function],default:function(){return function(){return window}}},content:{type:[String,Function]},default:{type:[String,Function]},offsetBottom:{type:Number,default:0},offsetTop:{type:Number,default:0},zIndex:{type:Number},onFixedChange:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var zi=ze({name:"TAffix",props:Bi,emits:["fixedChange"],setup:function(e,a){var n,r=Kt("affix"),o=Yt(),l=W(null),i=W(null),u=W((n=document)===null||n===void 0?void 0:n.createElement("div")),s=W(!1),v=W(!1),d=W(),b=W(),p=0,w=function(){s.value||(p=window.requestAnimationFrame(function(){var R,O;p=0;var _=(R=(O=l.value)===null||O===void 0?void 0:O.getBoundingClientRect())!==null&&R!==void 0?R:{top:0,width:0,height:0},j=_.top,A=_.width,T=_.height,F=0;d.value instanceof HTMLElement&&(F=d.value.getBoundingClientRect().top);var P,K=j-F,D=d.value[d.value instanceof Window?"innerHeight":"clientHeight"]-T,m=F+D-e.offsetBottom;if(!xn(e.offsetTop)&&K<=e.offsetTop?P=F+e.offsetTop:!xn(e.offsetBottom)&&j>=m?P=m:P=!1,i.value){var h=P!==!1,g=l.value.contains(u.value);h?(i.value.className=r.value,b.value={top:"".concat(P,"px"),width:"".concat(A,"px"),height:"".concat(T,"px"),zIndex:e.zIndex},g||(u.value.style.width="".concat(A,"px"),u.value.style.height="".concat(T,"px"),l.value.appendChild(u.value))):(i.value.removeAttribute("class"),b.value=void 0,g&&u.value.remove()),a.emit("fixedChange",h,{top:Number(P)}),Re(e.onFixedChange)&&e.onFixedChange(h,{top:Number(P)})}s.value=!1}),s.value=!0)},y=function(){var x=Ya(wn.mark(function R(){return wn.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,Gt();case 2:if(!v.value){_.next=4;break}return _.abrupt("return");case 4:d.value=Kl(e.container),Te(d.value,"scroll",w),Te(window,"resize",w),v.value=!0;case 8:case"end":return _.stop()}},R)}));return function(){return x.apply(this,arguments)}}(),S=function(){!d.value||!v.value||(xe(d.value,"scroll",w),xe(window,"resize",w),p&&window.cancelAnimationFrame(p),v.value=!1)};return de(function(){return e.offsetTop},function(){w()}),de(function(){return e.offsetBottom},function(){w()}),de(function(){return e.zIndex},function(){w()}),yt(y),ti(y),ni(S),Ra(S),{affixWrapRef:l,affixRef:i,bindScroll:y,unbindScroll:S,handleScroll:w,scrollContainer:d,renderTNodeJSX:o,affixStyle:b}},render:function(){return L("div",{ref:"affixWrapRef"},[L("div",{ref:"affixRef",style:this.affixStyle},[this.renderTNodeJSX("default")])])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Zn=qt(zi);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Hi=Po,Wi=Bo,$i=zo,Vi=Ll,Ui=kl,Xi=Ao,Gi=200;function Yi(t,e,a,n){var r=-1,o=Wi,l=!0,i=t.length,u=[],s=e.length;if(!i)return u;a&&(e=Vi(e,Ui(a))),n?(o=$i,l=!1):e.length>=Gi&&(o=Xi,l=!1,e=new Hi(e));e:for(;++r<i;){var v=t[r],d=a==null?v:a(v);if(v=n||v!==0?v:0,l&&d===d){for(var b=s;b--;)if(e[b]===d)continue e;u.push(v)}else o(e,d,n)||u.push(v)}return u}var qi=Yi;/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var el={allowUncheck:Boolean,checked:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultChecked:Boolean,default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},label:{type:[String,Function]},name:{type:String,default:""},readonly:Boolean,value:{type:[String,Number,Boolean],default:void 0},onChange:Function,onClick:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var tl=Symbol("RadioGroupProvide"),nl=Symbol("RadioButtonProvide");/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Ir(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 Ji(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ir(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Zi(t){var e={};return Object.keys(t).forEach(function(a){xn(t[a])||(e[a]=t[a])}),e}var lr=ze({name:"TRadio",inheritAttrs:!1,props:Ji({},el),setup:function(e,a){var n=a.attrs,r=W(),o=Ke(e),l=o.checked,i=o.modelValue,u=Jo(l,i,e.defaultChecked,e.onChange,"checked"),s=Pe(u,2),v=s[0],d=s[1],b=N(function(){return p?e.value===p.value:v.value}),p=br(tl,void 0),w=N(function(){return Boolean(e.allowUncheck||(p==null?void 0:p.allowUncheck))}),y=function(c){c.stopPropagation()},S=function(c){var f;if(!(_.value||e.readonly)&&((f=e.onClick)===null||f===void 0||f.call(e,{e:c}),!(b.value&&!w.value)))if(p){var C=b.value&&w.value?void 0:e.value;p.setValue(C,{e:c})}else{var E=w.value?!b.value:!0;d(E,{e:c})}},x=N(function(){return Zi({focus:n.onFocus,blur:n.onBlur,keydown:n.onKeydown,keyup:n.onKeyup,keypresss:n.onKeypresss})}),R=N(function(){var g=[].concat(fe(Object.keys(x.value)),["input","change"]).map(function(c){return"on".concat(c[0].toUpperCase()).concat(c.slice(1))});return Ho(n,g)}),O=N(function(){return p==null?void 0:p.disabled}),_=pi(O),j=N(function(){return{name:p?p.name:e.name,checked:b.value,disabled:_.value,readonly:e.readonly,value:e.value}}),A=jo(),T=A.STATUS,F=br(nl,void 0),P=Kt("radio-button"),K=Kt("radio"),D=N(function(){return F?P.value:K.value}),m=N(function(){return["".concat(D.value),z(z({},T.value.checked,j.value.checked),T.value.disabled,j.value.disabled)]}),h=Fo();return function(){return L("label",Ie({ref:r,class:m.value},R.value,{tabindex:_.value?void 0:"0",onClick:S}),[L("input",Ie({type:"radio",class:"".concat(D.value,"__former")},x.value,j.value,{onClick:y,tabindex:"-1","data-value":Lt(e.value)?"'".concat(e.value,"'"):e.value,"data-allow-uncheck":w.value||void 0}),null),L("span",{class:"".concat(D.value,"__input")},null),L("span",{class:"".concat(D.value,"__label")},[h("default","label")])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Qi={allowUncheck:Boolean,disabled:Boolean,name:{type:String,default:""},options:{type:Array},size:{type:String,default:"medium",validator:function(e){return e?["small","medium","large"].includes(e):!0}},value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean]},variant:{type:String,default:"outline",validator:function(e){return e?["outline","primary-filled","default-filled"].includes(e):!0}},onChange:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function eu(t,e){var a=function(r){var o=mr.test(r.key)||mr.test(r.code);if(o){r.preventDefault();var l=r.target.querySelector("input");if(!l)return;var i=l.dataset;if(l.checked&&i.allowUncheck)e(void 0,{e:r});else{var u=isNaN(Number(i.value))?i.value:Number(i.value);u=Lt(u)&&{true:!0,false:!1}[u]||u,u=Lt(u)&&u[0]==="'"?u.replace(/'/g,""):u,e(u,{e:r})}}};yt(function(){Te(t.value,"keydown",a)}),ai(function(){xe(t.value,"keydown",a)})}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var tu=["window"],nu=typeof window<"u"?window:void 0;function au(t){var e,a=ri(t);return(e=a==null?void 0:a.$el)!==null&&e!==void 0?e:a}function ru(t){return oi()?(li(t),!0):!1}function ou(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=a.window,r=n===void 0?nu:n,o=Zo(a,tu),l,i=r&&"MutationObserver"in r,u=function(){l&&(l.disconnect(),l=void 0)},s=de(function(){return au(t)},function(d){u(),i&&r&&d&&(l=new MutationObserver(e),l.observe(d,o))},{immediate:!0}),v=function(){u(),s()};return ru(v),{isSupported:i,stop:v}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Kr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Aa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Kr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var lu=ze({name:"TRadioGroup",props:Aa({},Qi),setup:function(e){var a=Ke(e),n=a.value,r=a.modelValue,o=Jo(n,r,e.defaultValue,e.onChange),l=Pe(o,2),i=l[0],u=l[1],s=W(),v=Kt("radio-button"),d=jo(),b=d.STATUS,p=d.SIZE;eu(s,u);var w=N(function(){return".".concat(v.value,".").concat(b.value.checked)}),y=W({width:"0px",height:"0px",left:"0px",top:"0px","transition-property":"none"}),S=function(){var m=document.createElement("div");m.setAttribute("style","position: absolute; visibility: hidden;"),m.appendChild(s.value.cloneNode(!0)),document.body.appendChild(m);var h=m.querySelector(w.value),g=h.offsetWidth,c=h.offsetHeight,f=h.offsetLeft,C=h.offsetTop;y.value=Aa(Aa({},y.value),{},{width:"".concat(g,"px"),height:"".concat(c,"px"),left:"".concat(f,"px"),top:"".concat(C,"px")}),document.body.removeChild(m)},x=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(e.variant!=="outline"){var h=s.value.querySelector(w.value),g=m?"none":"all";if(!h){y.value={"transition-property":g,width:"0px",height:"9px",left:"0px",top:"0px"};return}var c=h.offsetWidth,f=h.offsetHeight,C=h.offsetLeft,E=h.offsetTop;c?y.value={"transition-property":g,width:"".concat(c,"px"),height:"".concat(f,"px"),left:"".concat(C,"px"),top:"".concat(E,"px")}:S()}},R;de(i,Ya(wn.mark(function D(){return wn.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Gt();case 2:x();case 3:case"end":return h.stop()}},D)}))),yt(function(){x(!0),bi(s,si(Ya(wn.mark(function m(){return wn.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gt();case 2:x();case 3:case"end":return g.stop()}},m)})),300));var D=s.value.querySelector("".concat(w.value," .").concat(v.value,"__label"));D&&(R=ou(D,function(m){m.forEach(function(h){h.type==="characterData"&&x()})},{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}),ko(function(){var D;(D=R)===null||D===void 0||D.stop()});var O=Ke(e),_=O.name,j=O.disabled;No(tl,Xn({name:_,disabled:j,value:i,allowUncheck:e.allowUncheck,setValue:u}));var A=Kt("radio-group"),T=Un(),F=function(){if(e.variant.includes("filled")&&!wi(i.value))return L("div",{style:y.value,class:"".concat(A.value,"__bg-block")},null)},P=function(){var m;return(m=e.options)===null||m===void 0?void 0:m.map(function(h){var g=h;return(Io(h)||Lt(h))&&(g={value:h,label:h.toString()}),L(lr,{key:"radio-group-options-".concat(g.value,"-").concat(Math.random()),name:e.name,checked:i.value===g.value,disabled:"disabled"in g?g.disabled:e.disabled,value:g.value},{default:function(){return[Re(g.label)?g.label(Ye):g.label]}})})},K=N(function(){return["".concat(A.value),p.value[e.size],z(z(z({},"".concat(A.value,"__outline"),e.variant==="outline"),"".concat(A.value,"--filled"),e.variant.includes("filled")),"".concat(A.value,"--primary-filled"),e.variant==="primary-filled")]});return function(){return L("div",{ref:s,class:K.value},[T("default")||P(),F()])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Lr(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 ja(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Lr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function iu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var uu=ze({name:"TRadioButton",inheritAttrs:!1,props:ja({},el),setup:function(e,a){var n=a.attrs;No(nl,Xn({}));var r=N(function(){var l=ja(ja({},e),Ho(n,Object.keys(n).filter(function(i){return i.startsWith("on")})));return l}),o=Fo();return function(){var l;return L(lr,r.value,iu(l=o("default","label"))?l:{default:function(){return[l]}})}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var su=qt(lr),cu=qt(lu);qt(uu);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var On={activeRowKeys:{type:Array,default:void 0},defaultActiveRowKeys:{type:Array,default:function(){return[]}},activeRowType:{type:String,default:""},allowResizeColumnWidth:{type:Boolean,default:void 0},attach:{type:[String,Function]},bordered:Boolean,bottomContent:{type:[String,Function]},cellEmptyContent:{type:[String,Function]},columns:{type:Array,default:function(){return[]}},data:{type:Array,default:function(){return[]}},disableDataPage:Boolean,disableSpaceInactiveRow:{type:Boolean,default:void 0},empty:{type:[String,Function],default:""},firstFullRow:{type:[String,Function]},fixedRows:{type:Array},footData:{type:Array,default:function(){return[]}},footerAffixProps:{type:Object},footerAffixedBottom:{type:[Boolean,Object],default:!1},footerSummary:{type:[String,Function]},headerAffixProps:{type:Object},headerAffixedTop:{type:[Boolean,Object],default:!1},height:{type:[String,Number]},horizontalScrollAffixedBottom:{type:[Boolean,Object]},hover:Boolean,keyboardRowHover:{type:Boolean,default:!0},lastFullRow:{type:[String,Function]},lazyLoad:Boolean,loading:{type:[Boolean,Function],default:void 0},loadingProps:{type:Object},locale:{type:Object},maxHeight:{type:[String,Number]},pagination:{type:Object},paginationAffixedBottom:{type:[Boolean,Object]},resizable:Boolean,rowAttributes:{type:[Object,Array,Function]},rowClassName:{type:[String,Object,Array,Function]},rowKey:{type:String,default:"id",required:!0},rowspanAndColspan:{type:Function},rowspanAndColspanInFooter:{type:Function},scroll:{type:Object},showHeader:{type:Boolean,default:!0},size:{type:String,validator:function(e){return e?["small","medium","large"].includes(e):!0}},stripe:Boolean,tableContentWidth:{type:String,default:""},tableLayout:{type:String,default:"fixed",validator:function(e){return e?["auto","fixed"].includes(e):!0}},topContent:{type:[String,Function]},verticalAlign:{type:String,default:"middle",validator:function(e){return e?["top","middle","bottom"].includes(e):!0}},onActiveChange:Function,onActiveRowAction:Function,onCellClick:Function,onColumnResizeChange:Function,onPageChange:Function,onRowClick:Function,onRowDblclick:Function,onRowMousedown:Function,onRowMouseenter:Function,onRowMouseleave:Function,onRowMouseover:Function,onRowMouseup:Function,onScroll:Function,onScrollX:Function,onScrollY:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function al(t,e){for(var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=a,r=0,o=t.length;r<o;r++){var l,i=t[r];if(e.set(i,a),i!=null&&(l=i.children)!==null&&l!==void 0&&l.length){var u=al(i.children,e,a+1);u>n&&(n=u)}}return n}function rl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=e,n=(t==null?void 0:t.children)||[],r=0,o=n.length;r<o;r++){var l=n[r];l.children?a=rl(l,a):a+=1}return a}function du(t){var e=new Map,a=al(t,e),n=new Map,r=function l(i,u){for(var s=0,v=i.length;s<v;s++){var d,b=i[s],p=b.children?1:a-e.get(b)+1,w=b.children?rl(b):1,y={};p>1&&(y.rowspan=p),w>1&&(y.colspan=w),n.set(b,y),b!=null&&(d=b.children)!==null&&d!==void 0&&d.length?l(b.children,u):u.push(b)}},o=[];return r(t,o),{rowspanAndColspanMap:n,leafColumns:o}}function vu(t){var e=function n(r,o){for(var l,i=[],u=[],s=0,v=r.length;s<v;s++){var d,b=r[s],p=[b];i=i.concat(p),b!=null&&(d=b.children)!==null&&d!==void 0&&d.length&&(u=u.concat(b.children))}return(l=u)!==null&&l!==void 0&&l.length&&n(u,o),o.push(i),i},a=[];return e(t,a),a=a.reverse(),a}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ot(){var t=Kt(),e={classPrefix:t.value,tableBaseClass:{table:"".concat(t.value,"-table"),columnResizableTable:"".concat(t.value,"-table--column-resizable"),overflowVisible:"".concat(t.value,"-table--overflow-visible"),body:"".concat(t.value,"-table__body"),content:"".concat(t.value,"-table__content"),topContent:"".concat(t.value,"-table__top-content"),bottomContent:"".concat(t.value,"-table__bottom-content"),paginationWrap:"".concat(t.value,"-table__pagination-wrap"),tdLastRow:"".concat(t.value,"-table__td-last-row"),tdFirstCol:"".concat(t.value,"-table__td-first-col"),thCellInner:"".concat(t.value,"-table__th-cell-inner"),tableRowEdit:"".concat(t.value,"-table--row-edit"),cellEditable:"".concat(t.value,"-table__cell--editable"),cellEditWrap:"".concat(t.value,"-table__cell-wrap"),bordered:"".concat(t.value,"-table--bordered"),striped:"".concat(t.value,"-table--striped"),hover:"".concat(t.value,"-table--hoverable"),loading:"".concat(t.value,"-table--loading"),rowspanAndColspan:"".concat(t.value,"-table--rowspan-colspan"),empty:"".concat(t.value,"-table__empty"),emptyRow:"".concat(t.value,"-table__empty-row"),headerFixed:"".concat(t.value,"-table--header-fixed"),columnFixed:"".concat(t.value,"-table--column-fixed"),widthOverflow:"".concat(t.value,"-table--width-overflow"),multipleHeader:"".concat(t.value,"-table--multiple-header"),footerAffixed:"".concat(t.value,"-table--footer-affixed"),horizontalBarAffixed:"".concat(t.value,"-table--horizontal-bar-affixed"),affixedHeader:"".concat(t.value,"-table--affixed-header"),affixedHeaderElm:"".concat(t.value,"-table__affixed-header-elm"),affixedFooterElm:"".concat(t.value,"-table__affixed-footer-elm"),affixedFooterWrap:"".concat(t.value,"-table__affixed-footer-wrap"),scrollbarDivider:"".concat(t.value,"-table__scroll-bar-divider"),fullHeight:"".concat(t.value,"-table--full-height"),resizeLine:"".concat(t.value,"-table__resize-line"),obviousScrollbar:"".concat(t.value,"-table__scrollbar--obvious"),affixedHeaderWrap:"".concat(t.value,"-table__affixed-header-elm-wrap")},tdAlignClasses:{left:"".concat(t.value,"-align-left"),right:"".concat(t.value,"-align-right"),center:"".concat(t.value,"-align-center")},tableHeaderClasses:{header:"".concat(t.value,"-table__header"),thBordered:"".concat(t.value,"-table__header-th--bordered"),fixed:"".concat(t.value,"-table__header--fixed"),multipleHeader:"".concat(t.value,"-table__header--multiple")},tableFooterClasses:{footer:"".concat(t.value,"-table__footer"),fixed:"".concat(t.value,"-table__footer--fixed")},tableAlignClasses:{top:"".concat(t.value,"-vertical-align-top"),middle:"".concat(t.value,"-vertical-align-middle"),bottom:"".concat(t.value,"-vertical-align-bottom")},tableRowFixedClasses:{top:"".concat(t.value,"-table__row--fixed-top"),bottom:"".concat(t.value,"-table__row--fixed-bottom"),firstBottom:"".concat(t.value,"-table__row--fixed-bottom-first"),withoutBorderBottom:"".concat(t.value,"-table__row--without-border-bottom")},tableColFixedClasses:{left:"".concat(t.value,"-table__cell--fixed-left"),right:"".concat(t.value,"-table__cell--fixed-right"),lastLeft:"".concat(t.value,"-table__cell--fixed-left-last"),firstRight:"".concat(t.value,"-table__cell--fixed-right-first"),leftShadow:"".concat(t.value,"-table__content--scrollable-to-left"),rightShadow:"".concat(t.value,"-table__content--scrollable-to-right")},tableLayoutClasses:{auto:"".concat(t.value,"-table--layout-auto"),fixed:"".concat(t.value,"-table--layout-fixed")},tdEllipsisClass:"".concat(t.value,"-table-td--ellipsis"),tableFullRowClasses:{base:"".concat(t.value,"-table__row--full"),innerFullRow:"".concat(t.value,"-table__row-full-inner"),innerFullElement:"".concat(t.value,"-table__row-full-element"),firstFullRow:"".concat(t.value,"-table__first-full-row"),lastFullRow:"".concat(t.value,"-table__last-full-row")},tableExpandClasses:{iconBox:"".concat(t.value,"-table__expand-box"),iconCell:"".concat(t.value,"-table__expandable-icon-cell"),row:"".concat(t.value,"-table__expanded-row"),rowInner:"".concat(t.value,"-table__expanded-row-inner"),expanded:"".concat(t.value,"-table__row--expanded"),collapsed:"".concat(t.value,"-table__row--collapsed")},tableSortClasses:{sortable:"".concat(t.value,"-table__cell--sortable"),sortColumn:"".concat(t.value,"-table__sort-column"),title:"".concat(t.value,"-table__cell--title"),trigger:"".concat(t.value,"-table__cell--sort-trigger"),doubleIcon:"".concat(t.value,"-table__double-icons"),sortIcon:"".concat(t.value,"-table__sort-icon"),iconDirection:{asc:"".concat(t.value,"-table-sort-asc"),desc:"".concat(t.value,"-table-sort-desc")},iconActive:"".concat(t.value,"-table__sort-icon--active"),iconDefault:"".concat(t.value,"-icon-sort--default")},tableSelectedClasses:{selected:"".concat(t.value,"-table__row--selected"),disabled:"".concat(t.value,"-table__row--disabled"),checkCell:"".concat(t.value,"-table__cell-check")},tableFilterClasses:{filterable:"".concat(t.value,"-table__cell--filterable"),popup:"".concat(t.value,"-table__filter-pop"),icon:"".concat(t.value,"-table__filter-icon"),popupContent:"".concat(t.value,"-table__filter-pop-content"),result:"".concat(t.value,"-table__filter-result"),inner:"".concat(t.value,"-table__row-filter-inner"),bottomButtons:"".concat(t.value,"-table__filter--bottom-buttons"),contentInner:"".concat(t.value,"-table__filter-pop-content-inner"),iconWrap:"".concat(t.value,"-table__filter-icon-wrap")},asyncLoadingClass:"".concat(t.value,"-table__async-loading"),isFocusClass:"".concat(t.value,"-is-focus"),isLoadingClass:"".concat(t.value,"-is-loading"),isLoadMoreClass:"".concat(t.value,"-is-load-more"),tableTreeClasses:{col:"".concat(t.value,"-table__tree-col"),inlineCol:"".concat(t.value,"-table__tree-col--inline"),icon:"".concat(t.value,"-table__tree-op-icon"),leafNode:"".concat(t.value,"-table__tree-leaf-node")},tableDraggableClasses:{rowDraggable:"".concat(t.value,"-table--row-draggable"),rowHandlerDraggable:"".concat(t.value,"-table--row-handler-draggable"),colDraggable:"".concat(t.value,"-table--col-draggable"),handle:"".concat(t.value,"-table__handle-draggable"),ghost:"".concat(t.value,"-table__ele--draggable-ghost"),chosen:"".concat(t.value,"-table__ele--draggable-chosen"),dragging:"".concat(t.value,"-table__ele--draggable-dragging"),dragSortTh:"".concat(t.value,"-table__th--drag-sort")},virtualScrollClasses:{cursor:"".concat(t.value,"-table__virtual-scroll-cursor"),header:"".concat(t.value,"-table__virtual-scroll-header")},positiveRotate90:"".concat(t.value,"-positive-rotate-90"),negativeRotate180:"".concat(t.value,"-negative-rotate-180")};return e}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function kr(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 fu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):kr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function hu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var ir=ze({name:"TEllipsis",props:{content:{type:[String,Function]},default:{type:[String,Function]},tooltipContent:{type:[String,Number,Function]},placement:String,attach:[String,Function],tooltipProps:Object,zIndex:Number,overlayClassName:String,classPrefix:{type:String,default:"t"}},setup:function(e){var a=W(),n=W(!1),r=N(function(){return["".concat(e.classPrefix,"-table__ellipsis"),"".concat(e.classPrefix,"-text-ellipsis")]}),o=N(function(){return["".concat(e.classPrefix,"-table__ellipsis-content"),e.overlayClassName]}),l=function(){!a.value||(n.value=gr(a.value))},i=function(){!a.value||(n.value=gr(a.value))},u=or(function(s){s.type==="mouseleave"?i():l()},80);return{root:a,isOverflow:n,ellipsisClasses:r,innerEllipsisClassName:o,onMouseAround:u}},render:function(){var e=Nl(this,"default","content"),a=L("div",{ref:"root",class:this.ellipsisClasses,onMouseenter:this.onMouseAround,onMouseleave:this.onMouseAround},[e]),n=null,r=this.tooltipProps;if(this.isOverflow){var o=fu({content:this.tooltipContent||function(){return e},destroyOnClose:!0,zIndex:this.zIndex,attach:this.attach,placement:this.placement,overlayClassName:r!=null&&r.overlayClassName?this.innerEllipsisClassName.concat(r.overlayClassName):this.innerEllipsisClassName},r);n=L(Wo,o,hu(a)?a:{default:function(){return[a]}})}else n=a;return n}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Nr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Mr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Nr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function gu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}function Ea(t,e,a){var n={col:e,colIndex:a};return Re(e.title)?e.title(Ye,n):Lt(e.title)&&t[e.title]?t[e.title](n):Re(e.render)&&e.render(Ye,Mr(Mr({},n),{},{type:"title",row:{},rowIndex:-1}))||e.title}function ol(t){var e=ot(),a=e.tableSortClasses,n=e.tableFilterClasses,r=N(function(){return du(t.columns)}),o=N(function(){return vu(t.columns)}),l=N(function(){return o.value.length>1}),i=function(s,v,d,b,p,w){var y=Pe(s,3),S=y[0],x=y[1],R=y[2],O=z(z({},a.sortable,x),n.filterable,R),_=Re(b)?b(Ye,{col:v,colIndex:d}):void 0,j=Boolean(b!==void 0?b:v.ellipsis);return L("div",{class:O},[L("div",{class:a.title},[j?L(ir,{placement:"bottom",attach:t.attach||(p?function(){return p}:void 0),tooltipContent:_&&function(){return _},tooltipProps:dt(b)==="object"?b:void 0,classPrefix:w==null?void 0:w.classPrefix,overlayClassName:w==null?void 0:w.ellipsisOverlayClassName},gu(S)?S:{default:function(){return[S]}}):L("div",null,[S]),Boolean(x||R)&&L("div",{class:n.iconWrap},[x,R])])])};return{thList:o,isMultipleHeader:l,spansAndLeafNodes:r,renderTitleWidthIcon:i}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Br(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 pu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Br(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var bu=80,mu=600,zr=8;function wu(t){var e=t.isWidthOverflow,a=t.tableContentRef,n=t.showColumnShadow,r=t.getThWidthList,o=t.updateThWidthList,l=t.setTableElmWidth,i=t.updateTableAfterColumnResize,u=t.onColumnResizeChange,s=W(),v=W({}),d=W([]),b,p;yt(function(){var m=typeof document<"u";b=m?document.onselectstart:null,p=m?document.ondragstart:null});var w=function(h,g,c){for(var f=g;h[f]&&h[f].resizable===!1;)c==="next"?f+=1:f-=1;return h[f]},y=function m(h,g){!h||(d.value=h,h.forEach(function(c,f){var C=w(h,f-1,"prev"),E=w(h,f+1,"next"),k=g?v.value[g.colKey].prev:E,I=g?v.value[g.colKey].next:C,M=f===0?k:C,$=f===h.length-1?I:E;v.value[c.colKey]={prev:M,next:$,current:{prevSibling:w(h,f-1,"prev"),nextSibling:w(h,f+1,"next")}},m(c.children,c)}))},S={isDragging:!1,draggingCol:null,draggingStart:0,effectCol:"next"},x=Xn({display:"none",height:"10px",left:"10px",bottom:"0"}),R=function(h){return h.fixed==="right"&&n.right},O=function(h,g){if(!(!s.value||S.isDragging||!h.target)){var c=h.target.closest("th"),f=c.getAttribute("data-colkey");if(!!d.value.find(function(X){return X.colKey===f})){var C=c.getBoundingClientRect(),E=C.right-h.pageX<=zr,k=h.pageX-C.left<=zr,I=R(g);if(E||I){var M,$=(M=g.resizable)!==null&&M!==void 0?M:!0;if($){c.style.cursor=E||I&&k?"col-resize":"";var Y=E&&!I||I&&k;S.draggingCol=Y?c:c.nextElementSibling,S.effectCol="next";return}}else if(k){var ee=c.previousElementSibling;if(ee){var ne,ae,J=(ne=v.value[g.colKey])===null||ne===void 0?void 0:ne.prev,B=(ae=J==null?void 0:J.resizable)!==null&&ae!==void 0?ae:!0;if(B){c.style.cursor="col-resize",S.draggingCol=ee,S.effectCol="prev";return}}}c.style.cursor="",S.draggingCol=null,S.effectCol=null}}},_=function(h){var g,c,f=Io(h.minWidth)?h.minWidth:parseInt(h.minWidth||"0",10);return{minColWidth:Math.max(((g=h.resize)===null||g===void 0?void 0:g.minWidth)||bu,f),maxColWidth:((c=h.resize)===null||c===void 0?void 0:c.maxWidth)||mu}},j=function(h,g,c,f){var C=c.right-f.left,E=c.left-f.left,k=S.effectCol==="next"?h:g,I=_(k),M=I.minColWidth,$=I.maxColWidth;return{resizeLinePos:C,minResizeLineLeft:E+M,maxResizeLineLeft:E+$}},A=function(h,g,c,f,C){var E=f.left-C.left,k=h.dataset.colkey===g.colKey?g:c,I=f.left-C.left,M=_(k),$=M.minColWidth,Y=M.maxColWidth;return{resizeLinePos:E,minResizeLineLeft:I+(f.width-Y),maxResizeLineLeft:I+(f.width-$)}},T=function(h,g){var c=h.left-g.left,f=h.left-g.left;return{resizeLinePos:c,minResizeLineLeft:f,maxResizeLineLeft:f}},F=function(h){var g=0;return d.value.forEach(function(c){g+=h[c.colKey]}),g},P=function(h,g,c,f){var C=!0;if(g){var E=_(g),k=E.minColWidth,I=E.maxColWidth,M=h[g.colKey]+c;C=M<k||M>I}return!(C||e.value||f===d.value.length-1)},K=function(h,g,c,f){return g?j(h,g,c,f):T(c,f)},D=function(h,g,c){var f,C,E;if(!!S.draggingCol){var k=S.draggingCol,I=k.getBoundingClientRect(),M=(f=a.value)===null||f===void 0?void 0:f.getBoundingClientRect(),$=(C=v.value[g.colKey])===null||C===void 0?void 0:C.next,Y=(E=v.value[g.colKey])===null||E===void 0?void 0:E.prev,ee=R(g)?A(k,g,$,I,M):K(g,$,I,M),ne=ee.resizeLinePos,ae=ee.minResizeLineLeft,J=ee.maxResizeLineLeft;if(S.isDragging=!0,S.draggingStart=h.x,s!=null&&s.value){x.display="block",x.height="".concat(M.bottom-I.top,"px"),x.left="".concat(ne,"px");var B=a.value.parentElement.getBoundingClientRect();x.bottom="".concat(B.bottom-M.bottom,"px")}var X=function q(){var se;if(!!S.isDragging){var he=ne-parseFloat(x.left)||0,Le=r("calculate"),Ve=(se=v.value[g.colKey])===null||se===void 0?void 0:se.current;if(!!Ve){var qe=S.effectCol==="next"?Ve.nextSibling:Ve.prevSibling,Ne=pu({},Le),lt=g.resizable!==!1?g:qe,gt=S.effectCol==="next"?Ve.nextSibling:g,it=P(Ne,gt,he,c);S.effectCol==="next"?R(g)?k.dataset.colkey!==g.colKey?Ne[$.colKey]+=he:Ne[lt.colKey]+=he:(Ne[lt.colKey]-=he,it&&(Ne[$.colKey]+=he)):S.effectCol==="prev"&&(it&&(Ne[lt.colKey]+=he),Y&&(Ne[Y.colKey]-=he)),o(Ne);var Pt=F(Ne);l(Math.round(Pt)),i(),S.isDragging=!1,S.draggingCol=null,S.effectCol=null,k.style.cursor="",x.display="none",x.left="0",xe(document,"mouseup",q),xe(document,"mousemove",Q),document.onselectstart=b,document.ondragstart=p,u==null||u({columnsWidth:Ne})}}},Q=function(se){if(S.isDragging){var he=ne+se.x-S.draggingStart;x.left="".concat(Math.min(Math.max(he,ae),J),"px")}};Te(document,"mouseup",X),Te(document,"mousemove",Q),document.onselectstart=function(){return!1},document.ondragstart=function(){return!1}}};return{resizeLineRef:s,resizeLineStyle:x,onColumnMouseover:O,onColumnMousedown:D,setEffectColMap:y}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function yu(){}var Cu=yu,Fa=Bl,xu=Cu,Su=Ko,Ou=1/0,Ru=Fa&&1/Su(new Fa([,-0]))[1]==Ou?function(t){return new Fa(t)}:xu,Eu=Ru,Du=Po,_u=Bo,Tu=zo,Pu=Ao,Au=Eu,ju=Ko,Fu=200;function Iu(t,e,a){var n=-1,r=_u,o=t.length,l=!0,i=[],u=i;if(a)l=!1,r=Tu;else if(o>=Fu){var s=e?null:Au(t);if(s)return ju(s);l=!1,r=Pu,u=new Du}else u=e?[]:i;e:for(;++n<o;){var v=t[n],d=e?e(v):v;if(v=a||v!==0?v:0,l&&d===d){for(var b=u.length;b--;)if(u[b]===d)continue e;e&&u.push(d),i.push(v)}else r(u,d,a)||(u!==i&&u.push(d),i.push(v))}return i}var Ku=Iu,Lu=qi,ku=$l,Hr=Ku;function Nu(t,e,a){var n=t.length;if(n<2)return n?Hr(t[0]):[];for(var r=-1,o=Array(n);++r<n;)for(var l=t[r],i=-1;++i<n;)i!=r&&(o[r]=Lu(o[r]||l,t[i],e,a));return Hr(ku(o,1),e,a)}var Mu=Nu,Bu=Hl,zu=zl,Hu=Mu,Wu=Vl,$u=Wl,Vu=zu(function(t){var e=$u(t);return e=typeof e=="function"?e:void 0,Hu(Bu(t,Wu),void 0,e)}),Uu=Vu;function Wr(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 hn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Wr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ur(t,e,a,n){var r=a==null?void 0:a.get(t.colKey||e);if(!r)return{};var o=z(z(z(z({},n.left,t.fixed==="left"),n.right,t.fixed==="right"),n.lastLeft,t.fixed==="left"&&r.lastLeftFixedCol),n.firstRight,t.fixed==="right"&&r.firstRightFixedCol),l={left:t.fixed==="left"?"".concat(r.left,"px"):void 0,right:t.fixed==="right"?"".concat(r.right,"px"):void 0};return{style:l,classes:o}}function Xu(t,e,a,n,r,o){if(!n||!n.length)return{style:void 0,classes:void 0};var l=e<n[0],i=e>a-1-n[1],u=a-n[1],s=(r==null?void 0:r.get(t))||{},v=z(z(z(z({},o.top,l),o.bottom,i),o.firstBottom,e===u),o.withoutBorderBottom,e===u-1),d={top:l?"".concat(s.top,"px"):void 0,bottom:i?"".concat(s.bottom,"px"):void 0};return{style:d,classes:v}}function Gu(t,e,a,n){var r=Ke(t),o=r.columns,l=r.tableLayout,i=r.tableContentWidth,u=r.fixedRows,s=r.firstFullRow,v=r.lastFullRow,d=r.maxHeight,b=r.headerAffixedTop,p=r.footerAffixedBottom,w=r.bordered,y=r.resizable,S=r.allowResizeColumnWidth,x=W([]),R=W(),O=W(),_=W(!1),j=W(!1),A=W(),T=W(6),F=W(new Map),P=Xn({left:!1,right:!1}),K=W({left:0,top:0}),D=W(0),m=W(0),h=W({}),g=W(!1),c=W(!1),f=W(!1),C=N(function(){var re,V;return(re=(V=S.value)!==null&&V!==void 0?V:y.value)!==null&&re!==void 0?re:!1}),E=N(function(){var re;return!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom||((re=t.scroll)===null||re===void 0?void 0:re.type)==="virtual")});function k(re){A.value=re}function I(re){for(var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Map,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,te=arguments.length>4?arguments[4]:void 0,le=0,ge=re.length;le<ge;le++){var pe,ue=re[le];["left","right"].includes(ue.fixed)&&(g.value=!0),ue.fixed==="right"&&(c.value=!0),ue.fixed==="left"&&(f.value=!0);var me=ue.colKey||le,Ee={col:ue,parent:te,index:le};V.set(me,Ee),(pe=ue.children)!==null&&pe!==void 0&&pe.length&&I(ue.children,V,G,Z+1,Ee),G[Z]?G[Z].push(Ee):G[Z]=[Ee]}return{newColumnsMap:V,levelNodes:G}}var M=function re(V,G){for(var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=0,le=V.length;te<le;te++){var ge,pe=V[te];if(pe.fixed==="right")return;for(var ue=G.get(pe.colKey||te),me=te-1;me>=0&&V[me].fixed!=="left";)me-=1;var Ee=V[me],Ae=te===0&&(Z==null?void 0:Z.left)||0,He=G.get((Ee==null?void 0:Ee.colKey)||te-1);ue&&(ue.left=((He==null?void 0:He.left)||Ae)+((He==null?void 0:He.width)||0)),(ge=pe.children)!==null&&ge!==void 0&&ge.length&&re(pe.children,G,ue)}},$=function re(V,G){for(var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=V.length-1;te>=0;te--){var le,ge=V[te];if(ge.fixed==="left")return;for(var pe=G.get(ge.colKey||te),ue=te+1;ue<V.length&&V[ue].fixed!=="right";)ue+=1;var me=V[ue],Ee=te===V.length-1&&(Z==null?void 0:Z.right)||0,Ae=G.get((me==null?void 0:me.colKey)||te+1);pe&&(pe.right=((Ae==null?void 0:Ae.right)||Ee)+((Ae==null?void 0:Ae.width)||0)),(le=ge.children)!==null&&le!==void 0&&le.length&&re(ge.children,G,pe)}},Y=function(V,G){if(!!V){for(var Z=0,te=V.length;Z<te;Z++)for(var le=V[Z].children,ge=0,pe=le.length;ge<pe;ge++){var ue,me=le[ge],Ee=me.dataset.colkey;Ee||Be.warn("TDesign Table","".concat(me.innerText," missing colKey. colKey is required for fixed column feature."));var Ae=G.get(Ee||ge);Ae!=null&&(ue=Ae.col)!==null&&ue!==void 0&&ue.fixed&&G.set(Ee,hn(hn({},Ae),{},{width:me.getBoundingClientRect().width}))}M(o.value,G),$(o.value,G)}},ee=function(V,G,Z,te){for(var le=u.value||[],ge=Pe(le,2),pe=ge[0],ue=ge[1],me=t.data,Ee=t.rowKey,Ae=Ee===void 0?"id":Ee,He=0;He<pe;He++){var At=V[He],Bt=H(me[He],Ae),tt=G.get(Bt)||{},zt=H(me[He-1],Ae),Ct=G.get(zt)||{},vn=0;He===0&&(vn=(Z==null?void 0:Z.getBoundingClientRect().height)||0),tt.top=(Ct.top||vn)+(Ct.height||0),G.set(Bt,hn(hn({},tt),{},{height:(At==null?void 0:At.getBoundingClientRect().height)||0}))}for(var xt=me.length-1;xt>=me.length-ue;xt--){var St=V[xt],be=H(me[xt],Ae),ve=G.get(be)||{},Fe=H(me[xt+1],Ae),Je=G.get(Fe)||{},Ge=0;xt===me.length-1&&(Ge=(te==null?void 0:te.getBoundingClientRect().height)||0),ve.bottom=(Je.bottom||Ge)+(Je.height||0),G.set(be,hn(hn({},ve),{},{height:(St==null?void 0:St.getBoundingClientRect().height)||0}))}},ne=function(V,G){if(F.value.clear(),!!V){var Z=V.querySelector("thead");Z&&Y(Z.children,G);var te=V.querySelector("tbody"),le=V.querySelector("tfoot");te&&ee(te.children,G,Z,le),F.value=G}},ae,J=function(V,G){if(!(!g.value||!V)){var Z=V.scrollLeft;if(!(ae===Z&&(!G||!G.skipScrollLimit))){ae=Z;var te=V.clientWidth+Z<V.scrollWidth,le=Z>0;P.left===le&&P.right===te||(P.left=le&&f.value,P.right=te&&c.value)}}},B=function(V){for(var G=0;G<V.length;G++)for(var Z=V[G],te=0,le=Z.length;te<le;te++){var ge=Z[te],pe=Z[te+1],ue=ge.parent,me=!ue||(ue==null?void 0:ue.lastLeftFixedCol);me&&ge.col.fixed==="left"&&(pe==null?void 0:pe.col.fixed)!=="left"&&(ge.lastLeftFixedCol=!0);var Ee=Z[te-1],Ae=!ue||(ue==null?void 0:ue.firstRightFixedCol);Ae&&ge.col.fixed==="right"&&(Ee==null?void 0:Ee.col.fixed)!=="right"&&(ge.firstRightFixedCol=!0)}},X=function(){var V=I(o.value),G=V.newColumnsMap,Z=V.levelNodes;B(Z);var te=setTimeout(function(){var le;(g.value||(le=u.value)!==null&&le!==void 0&&le.length)&&ne(O.value,G),clearTimeout(te)},0);return function(){clearTimeout(te)}},Q=function(){var V=setTimeout(function(){if(!!O.value){_.value=O.value.scrollHeight>O.value.clientHeight,j.value=O.value.scrollWidth>O.value.clientWidth;var G=O.value.getBoundingClientRect();K.value={top:G.top,left:G.left},clearTimeout(V)}},0)},q=function(V){m.value!==V&&(m.value=V)},se=function(){var V,G,Z=(V=O.value)===null||V===void 0?void 0:V.getBoundingClientRect();if(!!Z){var te=_.value?T.value:0;D.value=Z.width-te-(t.bordered?1:0);var le=A==null||(G=A.value)===null||G===void 0?void 0:G.getBoundingClientRect();le!=null&&le.width&&q(le.width)}},he=function(){var V,G,Z,te,le,ge,pe,ue;(V=n.paginationAffixRef.value)===null||V===void 0||(G=V.handleScroll)===null||G===void 0||G.call(V),(Z=n.horizontalScrollAffixRef.value)===null||Z===void 0||(te=Z.handleScroll)===null||te===void 0||te.call(Z),(le=n.headerTopAffixRef.value)===null||le===void 0||(ge=le.handleScroll)===null||ge===void 0||ge.call(le),(pe=n.footerBottomAffixRef.value)===null||pe===void 0||(ue=pe.handleScroll)===null||ue===void 0||ue.call(pe)},Le=function(V){for(var G={},Z=0,te=V.length;Z<te;Z++)for(var le=V[Z].children,ge=0,pe=le.length;ge<pe;ge++){var ue=le[ge],me=ue.dataset.colkey;G[me]=ue.getBoundingClientRect().width}return G},Ve=function(V){if(V instanceof HTMLCollection){if(C.value)return;h.value=Le(V)}else h.value=h.value||{},Object.entries(V).forEach(function(G){var Z=Pe(G,2),te=Z[0],le=Z[1];h.value[te]=le});return h.value},qe=function(){var V=setTimeout(function(){var G;if(se(),!E.value){var Z=(G=O.value)===null||G===void 0?void 0:G.querySelector("thead");!Z||(Ve(Z.children),clearTimeout(V))}},0)},Ne=function(){h.value={}},lt=function(V){var G,Z,te;(G=t.onScrollX)===null||G===void 0||G.call(t,{e:V}),(Z=t.onScrollY)===null||Z===void 0||Z.call(t,{e:V}),(te=t.onScroll)===null||te===void 0||te.call(t,{e:V})},gt=function(V){if(V==="calculate"){var G,Z=(G=O.value)===null||G===void 0||(G=G.querySelector("thead"))===null||G===void 0?void 0:G.children;return Le(Z)}return h.value||{}};de([x,o,w,l,i,_,j,g,u,s,v],X,{immediate:!0}),de([g,o],function(){var re=setTimeout(function(){g.value&&J(O.value),clearTimeout(re)},0)},{immediate:!0}),de([d,x,o,w,O],function(){O.value&&Q()},{immediate:!0}),de(a,function(){Ne()}),de([x,w,l,u,_,b,p,i],function(){var re=setTimeout(function(){qe(),he(),clearTimeout(re)},60)},{immediate:!0}),de([a],function(re,V){var G=Pe(re,1),Z=G[0],te=Pe(V,1),le=te[0],ge=Z.map(function(tt){return tt.colKey}),pe=le.map(function(tt){return tt.colKey});if(ge.length<pe.length){var ue=Uu(pe,ge),me=gt("calculate"),Ee=0;ue.forEach(function(tt){Ee+=me[tt]});var Ae=Cn(me,pe),He=Object.values(Ae).reduce(function(){var tt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,zt=arguments.length>1?arguments[1]:void 0;return tt+zt}),At=O.value.clientWidth,Bt=He-Ee;q(Math.max(At,Bt))}});var it=function(){qe(),Q(),he(),(g.value||_.value)&&(X(),J(O.value,{skipScrollLimit:!0}))},Pt=or(function(){it()},30),je=null;function Dn(re){typeof window>"u"||Va()<11||typeof window.ResizeObserver>"u"||(xe(window,"resize",Pt),je=new window.ResizeObserver(function(){var V=setTimeout(function(){it(),clearTimeout(V)},200)}),je.observe(re),R.value=re)}yt(function(){var re=Ml();T.value=re,qe();var V=g.value||_.value||!E.value||!x.value.length,G=typeof window<"u",Z=G&&typeof window.ResizeObserver<"u";(V&&Va()<11||!Z)&&Te(window,"resize",Pt)}),Ra(function(){var re,V;typeof window<"u"&&xe(window,"resize",Pt),(re=je)===null||re===void 0||re.unobserve(R.value),(V=je)===null||V===void 0||V.disconnect()});var _n=function(V){x.value=V},Tn=function(){X(),Q()};return{tableWidth:D,tableElmWidth:m,thWidthList:h,isFixedHeader:_,isWidthOverflow:j,tableContentRef:O,isFixedColumn:g,showColumnShadow:P,rowAndColFixedPosition:F,virtualScrollHeaderPos:K,scrollbarWidth:T,setData:_n,refreshTable:it,setTableElmWidth:q,emitScrollEvent:lt,updateThWidthListHandler:qe,updateColumnFixedShadow:J,setUseFixedTableElmRef:k,getThWidthList:gt,updateThWidthList:Ve,addTableResizeObserver:Dn,updateTableAfterColumnResize:Tn}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function $r(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 Yu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):$r(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function qu(t,e){var a=Ke(t),n=a.pagination,r=a.data,o=a.disableDataPage,l=ht(),i=l.classPrefix,u=W(t.pagination),s=W([]),v=W(!1),d=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,S=t.data,x=Boolean(!o.value&&S.length>y);if(v.value=x,x){var R=(w-1)*y,O=w*y;s.value=S.slice(R,O)}else s.value=S};de(function(){var p,w;return[(p=n.value)===null||p===void 0?void 0:p.current,(w=n.value)===null||w===void 0?void 0:w.pageSize,r.value.length,o]},function(){if(!(!n.value||!n.value.current)){var p=n.value,w=p.current,y=p.pageSize;u.value={current:w,pageSize:y},d(n.value.current,n.value.pageSize)}},{immediate:!0}),de([r],function(){var p,w;if(!(!n.value||!n.value.defaultCurrent)){var y=Boolean(n.value.current);y||d((p=u.value.current)!==null&&p!==void 0?p:n.value.defaultCurrent,(w=u.value.pageSize)!==null&&w!==void 0?w:n.value.defaultPageSize)}},{immediate:!0});var b=function(){if(!t.pagination)return null;var w=Yu({},t.pagination);return delete w.onChange,L("div",{class:"".concat(i.value,"-table__pagination")},[L(ci,Ie(w,{onChange:function(S){var x,R,O;(x=t.pagination)===null||x===void 0||(R=x.onChange)===null||R===void 0||R.call(x,S),u.value=S,d(S.current,S.pageSize),(O=t.onPageChange)===null||O===void 0||O.call(t,S,s.value)}}),{totalContent:e.slots.totalContent})])};return{isPaginateData:v,dataSource:s,innerPagination:u,renderPagination:b}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Ju(t){var e=W(),a=W(),n=W(),r=W(),o=W(),l=W(!0),i=W(!0),u=W(!0),s=!1,v=!1,d=N(function(){return t.scroll&&t.scroll.type==="virtual"&&(t.scroll.threshold||100)<t.data.length}),b=N(function(){return!!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom)}),p=0,w=function(B){if(!(!b.value&&!d.value)){var X=B;if(!X&&e.value&&(p=0,X=e.value),!!X){var Q=X.scrollLeft;if(p!==Q){p=Q;for(var q=[e.value,a.value,n.value,r.value],se=0,he=q.length;se<he;se++)q[se]&&B!==q[se]&&(q[se].scrollLeft=Q)}}}},y=function(B,X,Q){return X.top+Q<B.top&&B.top>B.height},S=function(B){return Ul(B)?0:B.offsetTop||0},x=function(){var B,X,Q;if(!(!b.value&&!d.value)){var q=(B=e.value)===null||B===void 0?void 0:B.getBoundingClientRect(),se=(X=e.value)===null||X===void 0||(X=X.querySelector("thead"))===null||X===void 0?void 0:X.getBoundingClientRect(),he=(se==null?void 0:se.height)||0,Le=(Q=n.value)===null||Q===void 0?void 0:Q.getBoundingClientRect();if((t.headerAffixedTop||d.value)&&a.value){var Ve=S(t.headerAffixProps||t.headerAffixedTop),qe=(Le==null?void 0:Le.height)||0,Ne=Math.abs(q.top)<q.height-he-Ve-qe;d.value&&(Ne=q.top>-1*se.height),l.value=Ne}if(t.footerAffixedBottom&&n!==null&&n!==void 0&&n.value)i.value=y(Le,q,he);else if(t.horizontalScrollAffixedBottom&&r!==null&&r!==void 0&&r.value){var lt=r.value.getBoundingClientRect();i.value=y(lt,q,he)}if(t.paginationAffixedBottom&&o.value){var gt=o.value.getBoundingClientRect();u.value=y(gt,q,he)}}},R=function(){x()},O=function(){w(n.value)},_=function(){w(a.value)},j=function(){w(r.value)},A=function(){w(e.value)},T=function(){Te(n.value,"scroll",O)},F=function(){xe(n.value,"scroll",O)},P=function(){Te(a.value,"scroll",_),C()},K=function(){s||xe(a.value,"scroll",_),E()},D=function(){Te(r.value,"scroll",j)},m=function(){xe(r.value,"scroll",j)},h=function(){Te(e.value,"scroll",A),C()},g=function(){s||xe(e.value,"scroll",A),E()},c=function(){s=!0},f=function(){s=!1,v||(xe(a.value,"scroll",_),xe(e.value,"scroll",A))},C=function(){v=!0},E=function(){v=!1},k=[],I=function(B){var X=or(function(he){xe(B,"scroll",he)},200);function Q(){w(B),X(Q)}function q(he){he.composedPath().includes(B)&&(k.forEach(function(Le){return Le()}),k.length=0,Te(B,"scroll",Q),X(Q),k.push(function(){xe(B,"scroll",Q)}))}Te(B,"touchstart",q);function se(){xe(B,"touchstart",q)}return{removeElementTouchScrollListener:se}},M=[],$=function(){M.forEach(function(B){return B()}),M.length=0},Y=function(){xe(window,"mousedown",c),xe(window,"mouseup",f),$(),a.value&&(xe(a.value,"mouseenter",P),xe(a.value,"mouseleave",K)),n.value&&(xe(n.value,"mouseenter",T),xe(n.value,"mouseleave",F)),e.value&&(xe(e.value,"mouseenter",h),xe(e.value,"mouseleave",g)),r.value&&(xe(r.value,"mouseenter",D),xe(r.value,"mouseleave",m))},ee=function(){if(Te(window,"mousedown",c),Te(window,"mouseup",f),Y(),a.value){Te(a.value,"mouseenter",P),Te(a.value,"mouseleave",K);var B=I(a.value),X=B.removeElementTouchScrollListener;M.push(X)}if(t.footerAffixedBottom&&n.value){Te(n.value,"mouseenter",T),Te(n.value,"mouseleave",F);var Q=I(n.value),q=Q.removeElementTouchScrollListener;M.push(q)}if(t.horizontalScrollAffixedBottom&&r.value){Te(r.value,"mouseenter",D),Te(r.value,"mouseleave",m);var se=I(r.value),he=se.removeElementTouchScrollListener;M.push(he)}if((b.value||d.value)&&e.value){Te(e.value,"mouseenter",h),Te(e.value,"mouseleave",g);var Le=I(e.value),Ve=Le.removeElementTouchScrollListener;M.push(Ve)}},ne=function(){if(!(!b.value&&!t.paginationAffixedBottom))var B=setTimeout(function(){b.value||t.paginationAffixedBottom?Te(document,"scroll",R):xe(document,"scroll",R),clearTimeout(B)})};de([a,n,r,e],function(){ee(),w(),x()}),de(b,ne),de(function(){return[t.data,t.columns,t.headerAffixedTop,t.footerAffixedBottom,t.horizontalScrollAffixedBottom]},function(){w()}),Ra(function(){xe(document,"scroll",R),Y(),a.value=null,n.value=null,r.value=null,e.value=null});var ae=function(B){e.value=B,ne()};return{showAffixHeader:l,showAffixFooter:i,showAffixPagination:u,affixHeaderRef:a,affixFooterRef:n,horizontalScrollbarRef:r,paginationRef:o,onHorizontalScroll:w,setTableContentRef:ae,updateAffixHeaderOrFooter:x}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function sr(t,e){if(!!t){for(var a=t instanceof Array?t:[t],n={},r=0;r<a.length;r++){var o=a[r];if(!!o){var l=Re(o)?o(e):o;n=l instanceof Array?sr(l,e):Object.assign(n,l)}}return n}}function cr(t,e,a){for(var n=t instanceof Array?t:[t],r=e.row,o=e.rowIndex,l=[],i=0,u=n.length;i<u;i++){var s=n[i],v=Re(s)?s(e):s;if(Ua(v)&&!(v instanceof Array)){v[o]&&(v=v[o]);var d=H(r,a||"id");v[d]&&(v=v[d])}else v instanceof Array&&(v=cr(v,e,a));l=l.concat(v)}return l}function ll(t,e){for(var a=t instanceof Array?t:[t],n=[],r=0,o=a.length;r<o;r++){var l=a[r];Re(l)?n.push(l(e)):n.push(l)}return n}function il(t,e){if(!(!t||!e)){var a=t==null?void 0:t.find(function(i){return i.colKey===e});if(a)return a;for(var n=0,r=t.length;n<r;n++){var o;if((o=t[n])!==null&&o!==void 0&&(o=o.children)!==null&&o!==void 0&&o.length){var l;return il((l=t[n])===null||l===void 0?void 0:l.children,e)}}}}function Qn(t,e){return dt(t)==="object"?t:dt(e)==="object"?e:{}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Zu(t,e,a){var n=N(function(){return Math.max(a.rowHeight||48,48)}),r=W(!1),o=N(function(){return(a==null?void 0:a.type)==="lazy"&&!r.value}),l=!Xl&&window.requestAnimationFrame||function(u){return setTimeout(u,16.6)},i=function(){r.value||l(function(){r.value=!0})};return yt(function(){(a==null?void 0:a.type)==="lazy"&&Gt(function(){var u=Math.max(10,a.bufferSize||10),s=n.value*u;!(e!=null&&e.value)||!(t!=null&&t.value)||$o(e.value,t.value,i,s)})}),{hasLazyLoadHolder:o,tRowHeight:n}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Vn(t,e,a,n){var r=H(t,e);return r===void 0&&Be.error("Table","rowKey is wrong, can not get unique identifier of row."),[r,a||n].join("_")}function ul(t,e,a,n){var r=W(new Map),o=function(u,s){var v=u.rowIndex,d=u.colIndex;if(!(!s.rowspan&&!s.colspan)){for(var b=v+(s.rowspan||1),p=d+(s.colspan||1),w=v;w<b;w++)for(var y=d;y<p;y++)if(w!==v||y!==d){if(!t.value[w]||!e.value[y])return;var S=Vn(t.value[w],a.value,e.value[y].colKey,y),x=r.value.get(S)||{};x.skipped=!0,r.value.set(S,x)}}},l=function(u,s,v){var d;if((d=r.value)===null||d===void 0||d.clear(),!(!u||!v))for(var b=0,p=u.length;b<p;b++)for(var w=u[b],y=0,S=s.length;y<S;y++){var x=s[y],R={row:w,col:x,rowIndex:b,colIndex:y},O=Vn(w,a.value,x.colKey,y),_=r.value.get(O)||{},j=v(R)||{};(j.rowspan||j.colspan||_.rowspan||_.colspan)&&(j.rowspan&&(_.rowspan=j.rowspan),j.colspan&&(_.colspan=j.colspan),r.value.set(O,_)),o==null||o(R,_)}};return de(function(){return[t.value,e.value,n]},function(){l(t.value,e.value,n==null?void 0:n.value)},{immediate:!0}),{skipSpansMap:r}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Vr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function rt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Vr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Qu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var sl=["rowKey","rowClassName","columns","fixedRows","footData","rowAttributes","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup"],cl=["click","dblclick","mouseover","mousedown","mouseenter","mouseleave","mouseup"];function ma(t,e,a){var n=t.col,r=t.row,o=t.rowIndex;if(n.colKey==="serial-number"){var l=(a==null?void 0:a.pagination)||{},i=l.current,u=l.pageSize,s=l.defaultCurrent,v=l.defaultPageSize,d=i||s,b=u||v;return b&&d?b*(d-1)+o+1:o+1}if(Re(n.cell))return n.cell(Ye,t);if(e[n.colKey])return e[n.colKey](t);if(Lt(n.cell)&&e[n.cell])return e[n.cell](t);if(Re(n.render))return n.render(Ye,rt(rt({},t),{},{type:"cell"}));var p=H(r,n.colKey);return[void 0,"",null].includes(p)?a!=null&&a.cellEmptyContent?Re(a.cellEmptyContent)?a.cellEmptyContent(Ye,t):a.cellEmptyContent:e.cellEmptyContent?e.cellEmptyContent(t):e["cell-empty-content"]?e["cell-empty-content"](t):p:p}var es=ze({name:"TR",props:rt(rt({row:Object,rowIndex:Number,dataLength:Number,ellipsisOverlayClassName:String,classPrefix:String,rowAndColFixedPosition:Map,skipSpansMap:Map,virtualConfig:Object,active:Boolean,isHover:Boolean},Cn(On,sl)),{},{tableElm:{},tableContentElm:{}}),emits:["row-mounted"],setup:function(e,a){var n=Ke(e),r=n.tableContentElm,o=n.active,l=n.isHover,i=W(null),u=ot(),s=u.tdEllipsisClass,v=u.tableBaseClass,d=u.tableColFixedClasses,b=u.tableRowFixedClasses,p=u.tdAlignClasses,w=u.tableDraggableClasses,y=N(function(){return Xu(H(e.row,e.rowKey||"id"),e.rowIndex,e.dataLength,e.fixedRows,e.rowAndColFixedPosition,b)}),S=N(function(){return sr(e.rowAttributes,{row:e.row,rowIndex:e.rowIndex,type:"body"})||{}}),x=N(function(){var P,K=cr(e.rowClassName,{row:e.row,rowIndex:e.rowIndex,type:"body"},e.rowKey||"id");return[(P=y.value)===null||P===void 0?void 0:P.classes,K,z(z({},"".concat(e.classPrefix,"-table__row--active"),o.value),"".concat(e.classPrefix,"-table__row--hover"),l.value)].filter(function(D){return D})}),R=Zu(r,i,Xn(rt(rt({},e.scroll),{},{rowIndex:e.rowIndex}))),O=R.hasLazyLoadHolder,_=R.tRowHeight,j=function(K,D){var m={};return cl.forEach(function(h){m["on".concat(pr(h))]=function(g){var c,f={e:g,row:K,index:D};(c=e["onRow".concat(pr(h))])===null||c===void 0||c.call(e,f)}}),m},A=function(){var K;(K=e.virtualConfig)!==null&&K!==void 0&&K.isVirtualScroll.value&&a.emit("row-mounted",{ref:i,data:e.row})};yt(function(){Gt(function(){A()})}),ii(function(){Gt(function(){A()})});function T(P,K){var D=K.cellNode,m=P.col,h=P.colIndex,g;Re(m.ellipsis)?g=m.ellipsis(Ye,P):dt(m.ellipsis)==="object"&&Re(m.ellipsis.content)?g=m.ellipsis.content(Ye,P):a.slots["ellipsis-".concat(m.colKey)]?g=a.slots["ellipsis-".concat(m.colKey)](P):a.slots.ellipsis&&(g=a.slots.ellipsis(P));var c={};dt(m.ellipsis)==="object"&&(c="props"in m.ellipsis?m.ellipsis.props:m.ellipsis||void 0);var f=e.tableElm,C=h===0?"top-left":"top";return C=h===e.columns.length-1?"top-right":C,L(ir,{placement:C,attach:f?function(){return f}:void 0,tooltipContent:g&&function(){return g},tooltipProps:c,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},Qu(D)?D:{default:function(){return[D]}})}function F(P,K){var D=P.col,m=P.colIndex,h=P.rowIndex,g=K.cellSpans,c=K.dataLength,f=K.rowAndColFixedPosition,C=ma(P,a.slots,{cellEmptyContent:K.cellEmptyContent,pagination:e.pagination}),E=ur(D,m,f,d),k=ll(D.className,rt(rt({},P),{},{type:"td"})),I=[E.classes,k,z(z(z(z(z({},s,D.ellipsis),v.tdLastRow,h+g.rowspan===c),v.tdFirstCol,m===0&&e.rowspanAndColspan),p[D.align],D.align&&D.align!=="left"),w.handle,D.colKey==="drag")],M=function(ne){var ae,J=rt(rt({},P),{},{e:ne});D.stopPropagation&&ne.stopPropagation(),(ae=e.onCellClick)===null||ae===void 0||ae.call(e,J)},$=Re(D.attrs)?D.attrs(rt(rt({},P),{},{type:"td"})):D.attrs,Y=rt(rt({},$),g);return L("td",Ie({key:D.colKey||m,class:I,style:E.style},Y,{onClick:M}),[D.ellipsis?T(P,{cellNode:C}):C])}return function(){var P,K=e.columns,D=e.skipSpansMap,m=e.row,h=e.dataLength,g=e.rowAndColFixedPosition,c=K==null?void 0:K.map(function(f,C){var E={},k={row:m,col:f,rowIndex:e.rowIndex,colIndex:C},I=null;if(e.skipSpansMap.size){var M,$,Y=Vn(m,e.rowKey,f.colKey,C);if(I=D.get(Y)||{},((M=I)===null||M===void 0?void 0:M.rowspan)>1&&(E.rowspan=I.rowspan),(($=I)===null||$===void 0?void 0:$.colspan)>1&&(E.colspan=I.colspan),I.skipped)return null}return F(k,{dataLength:h,rowAndColFixedPosition:g,columnLength:K.length,cellSpans:E,cellEmptyContent:e.cellEmptyContent})});return L("tr",Ie({ref:i},S.value,{style:(P=y.value)===null||P===void 0?void 0:P.style,class:x.value},j(m,e.rowIndex)),[O.value?[L("td",{style:{height:"".concat(_.value,"px"),border:"none"}},null)]:c])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Ur(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 ea(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ur(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var dl=["bordered","rowKey","rowClassName","rowAttributes","loading","empty","fixedRows","firstFullRow","lastFullRow","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onPageChange","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup","onScroll","onScrollX","onScrollY"],ts=ze({name:"TBody",props:ea({classPrefix:String,data:Array,columns:Array,ellipsisOverlayClassName:String,rowAndColFixedPosition:Map,showColumnShadow:Object,tableElm:{},tableWidth:Number,isWidthOverflow:Boolean,virtualConfig:Object,tableContentElm:{},handleRowMounted:Function,renderExpandedRow:Function,firstFullRow:[String,Function],lastFullRow:[String,Function],activeRow:[Array],hoverRow:[String,Number]},Cn(On,dl)),setup:function(e){var a=Yt(),n=Ke(e),r=n.data,o=n.columns,l=n.rowKey,i=n.rowspanAndColspan,u=ht("table",e.locale),s=u.t,v=u.globalConfig,d=ot(),b=d.tableFullRowClasses,p=d.tableBaseClass,w=ul(r,o,l,i),y=w.skipSpansMap,S=N(function(){return[p.body]});return{t:s,globalConfig:v,renderTNode:a,tableFullRowClasses:b,tbodyClasses:S,tableBaseClass:p,skipSpansMap:y}},render:function(){var e=this,a,n,r,o,l=function(x){var R=e.bordered?e.tableWidth-2:e.tableWidth;return L("tr",{class:[e.tableBaseClass.emptyRow,z({},e.tableFullRowClasses.base,e.isWidthOverflow)]},[L("td",{colspan:x.length},[L("div",{class:[e.tableBaseClass.empty,z({},e.tableFullRowClasses.innerFullRow,e.isWidthOverflow)],style:e.isWidthOverflow?{width:"".concat(R,"px")}:{}},[e.renderTNode("empty")||e.t(e.globalConfig.empty)])])])},i=function(x,R){var O=Gl(R),_=e.renderTNode(O);if(["",null,void 0,!1].includes(_))return null;var j=e.isWidthOverflow&&e.columns.find(function(F){return F.fixed==="left"}),A=[e.tableFullRowClasses.base,e.tableFullRowClasses[O]],T=e.bordered?e.tableWidth-2:e.tableWidth;return L("tr",{class:A,key:"key-full-row-".concat(R)},[L("td",{colspan:x},[L("div",{class:z({},e.tableFullRowClasses.innerFullRow,j),style:j?{width:"".concat(T,"px")}:{}},[L("div",{class:e.tableFullRowClasses.innerFullElement},[_])])])])},u=this.columns.length,s=this.data.length,v=[],d=["classPrefix","ellipsisOverlayClassName","rowAndColFixedPosition","scroll","tableElm","tableContentElm","pagination","attach"];(a=this.data)===null||a===void 0||a.forEach(function(S,x){var R,O=e.rowKey||"id",_=H(S,O),j=ea(ea({},Cn(e.$props,sl)),{},{rowKey:O,row:S,columns:e.columns,rowIndex:S.VIRTUAL_SCROLL_INDEX||x,dataLength:s,skipSpansMap:e.skipSpansMap,virtualConfig:e.virtualConfig,active:(R=e.activeRow)===null||R===void 0?void 0:R.includes(_),isHover:e.hoverRow===_},Cn(e.$props,d));e.onCellClick&&(j.onCellClick=e.onCellClick);var A=L(es,Ie({key:H(S,e.rowKey||"id")||x},j,{onRowMounted:e.handleRowMounted}),e.$slots);if(v.push(A),e.renderExpandedRow){var T={row:S,index:x,columns:e.columns,tableWidth:e.tableWidth,isWidthOverflow:e.isWidthOverflow},F=e.renderExpandedRow(T);F&&v.push(F)}});var b=[i(u,"first-full-row")].concat(v,[i(u,"last-full-row")]),p=!((n=this.data)!==null&&n!==void 0&&n.length)&&!this.loading&&!this.firstFullRow&&!this.lastFullRow,w="translateY(".concat((r=this.virtualConfig)===null||r===void 0?void 0:r.translateY.value,"px)"),y=(o=this.virtualConfig)!==null&&o!==void 0&&o.isVirtualScroll.value?{transform:w,"-ms-transform":w,"-moz-transform":w,"-webkit-transform":w}:void 0;return L("tbody",{class:this.tbodyClasses,style:ea({},y)},[p?l(this.columns):b])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Nn(t){return t&&(isNaN(Number(t))?t:"".concat(t,"px"))}function vl(t){var e=Ke(t),a=e.size,n=e.bordered,r=e.stripe,o=e.hover,l=e.verticalAlign,i=e.height,u=e.maxHeight,s=e.tableContentWidth,v=ot(),d=v.tableBaseClass,b=v.tableAlignClasses,p=di(),w=p.sizeClassNames,y=ht("table",t.locale),S=y.globalConfig,x=N(function(){var j;return(j=a.value)!==null&&j!==void 0?j:S.value.size}),R=N(function(){return[d.table,z(z(z(z(z(z(z(z({},w[x.value],x.value!=="medium"),d.bordered,n.value),d.striped,r.value),d.hover,o.value),d.loading,t.loading),d.affixedHeader,t.headerAffixedTop),d.rowspanAndColspan,t.rowspanAndColspan),b[l.value],l.value!=="middle")]}),O=N(function(){return{height:Nn(i.value),maxHeight:Nn(u.value)}}),_=N(function(){return{width:Nn(s.value)}});return{tableClasses:R,sizeClassNames:w,tableElementStyles:_,tableContentStyles:O}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Xr(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?Xr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Xr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ns(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var Gr=ze({name:"THead",props:{classPrefix:String,ellipsisOverlayClassName:String,isFixedHeader:Boolean,thDraggable:Boolean,maxHeight:[String,Number],height:[String,Number],rowAndColFixedPosition:Map,thWidthList:Object,bordered:Boolean,isMultipleHeader:Boolean,resizable:Boolean,attach:[String,Function],spansAndLeafNodes:Object,thList:Array,columnResizeParams:Object,showColumnShadow:Object},setup:function(e,a){var n=a.slots,r=W(),o=ot(),l=o.tableHeaderClasses,i=o.tableBaseClass,u=N(function(){return[l.header,z(z(z({},l.fixed,Boolean(e.maxHeight||e.height)),i.bordered,e.bordered&&e.isMultipleHeader),l.multipleHeader,e.isMultipleHeader)]}),s=N(function(){for(var d={},b=e.thList[0],p=0,w=b.length;p<w;p++){var y=b[p];if(y.colspan>1)for(var S=p+1;S<p+y.colspan;S++)b[S]&&(d[b[S].colKey]=!0)}return d}),v=function(b){for(var p=b;p;){var w;if(p=p.parentNode,(w=p)!==null&&w!==void 0&&(w=w.classList)!==null&&w!==void 0&&w.contains("".concat(e.classPrefix,"-table")))break}return p};return $t($t({},o),{},{colspanSkipMap:s,theadClasses:u,theadRef:r,slots:n,getTableNode:v})},render:function(){var e=this,a=function(r,o){var l=new Map,i=e.spansAndLeafNodes.rowspanAndColspanMap;return e.thList.map(function(u,s){var v=u.map(function(d,b){var p;if(e.colspanSkipMap[d.colKey])return null;var w=i.get(d);if(b===0&&w.rowspan>1)for(var y=s+1;y<s+w.rowspan;y++)l.set(e.thList[y][0],!0);var S=ur(d,b,r,e.tableColFixedClasses),x={col:d,colIndex:b,row:{},rowIndex:-1},R=ll(d.className,$t($t({},x),{},{type:"th"})),O=e.showColumnShadow.left&&d.fixed==="left",_=e.showColumnShadow.right&&d.fixed==="right",j=e.thDraggable&&!(O||_),A=[S.classes,R,d.thClassName,z(z(z(z({},e.tableHeaderClasses.thBordered,l.get(d)),"".concat(e.classPrefix,"-table__th-").concat(d.colKey),d.colKey),e.tdAlignClasses[d.align],d.align&&d.align!=="left"),e.tableDraggableClasses.dragSortTh,j)],T=!((p=d.children)!==null&&p!==void 0&&p.length),F=T&&o!==null&&o!==void 0&&o[d.colKey]?"".concat(o==null?void 0:o[d.colKey],"px"):void 0,P=$t($t({},S.style||{}),{},{width:F}),K=Ea(e.slots,d,b),D=e.resizable||!j?{onMousedown:function(f){if(e.resizable){var C,E;(C=e.columnResizeParams)===null||C===void 0||(E=C.onColumnMousedown)===null||E===void 0||E.call(C,f,d,b)}if(!j)var k=setTimeout(function(){var I,M=e.theadRef.querySelectorAll("th");(I=M[b])===null||I===void 0||I.removeAttribute("draggable"),clearTimeout(k)},10)},onMousemove:function(f){var C,E;e.resizable&&((C=e.columnResizeParams)===null||C===void 0||(E=C.onColumnMouseover)===null||E===void 0||E.call(C,f,d))}}:{},m=Re(d.ellipsisTitle)?d.ellipsisTitle(Ye,{col:d,colIndex:b}):void 0,h=d.ellipsisTitle!==void 0?Boolean(d.ellipsisTitle):Boolean(d.ellipsis),g=(Re(d.attrs)?d.attrs($t($t({},x),{},{type:"th"})):d.attrs)||{};return d.colspan>1&&(g.colspan=d.colspan),L("th",Ie({key:d.colKey,"data-colkey":d.colKey,class:A,style:P},g,w,D),[L("div",{class:e.tableBaseClass.thCellInner},[h?L(ir,{placement:"bottom",attach:e.attach||(e.theadRef?function(){return e.getTableNode(e.theadRef)}:void 0),tooltipContent:m&&function(){return m},tooltipProps:dt(d.ellipsisTitle)==="object"?d.ellipsisTitle:void 0,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},ns(K)?K:{default:function(){return[K]}}):K])])});return L("tr",{key:s},[v])})};return L("thead",{ref:"theadRef",class:this.theadClasses},[a(this.rowAndColFixedPosition,this.thWidthList)])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Yr(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 ta(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Yr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var qr=ze({name:"TFoot",props:{rowKey:String,isFixedHeader:Boolean,rowAndColFixedPosition:Map,footData:Array,columns:Array,rowAttributes:[Array,Object,Function],rowClassName:[Array,String,Object,Function],thWidthList:[Object],footerSummary:[String,Function],rowspanAndColspanInFooter:Function,virtualScroll:Boolean},setup:function(e,a){var n=Yt(),r=ot(),o=Ke(e),l=o.footData,i=o.columns,u=o.rowKey,s=o.rowspanAndColspanInFooter,v=ul(l,i,u,s),d=v.skipSpansMap,b=function(w){var y=w.col,S=w.row;return Re(y.foot)?y.foot(Ye,w):Lt(y.foot)&&a.slots[y.foot]?a.slots[y.foot](w)||y.foot:y.foot||H(S,y.colKey)};return ta(ta({skipSpansMap:d},r),{},{renderTFootCell:b,renderTNode:n})},render:function(){var e,a=this;if(!this.columns)return null;var n=[this.tableFooterClasses.footer,z({},this.tableFooterClasses.fixed,this.isFixedHeader)],r=(e=this.footData)===null||e===void 0?void 0:e.map(function(l,i){var u=sr(a.rowAttributes,{row:l,rowIndex:i,type:"foot"}),s=cr(a.rowClassName,{row:l,rowIndex:i,type:"foot"},a.rowKey||"id");return L("tr",Ie(u,{key:i,class:s}),[a.columns.map(function(v,d){var b,p={},w=null;if(a.skipSpansMap.size){var y,S,x=Vn(l,a.rowKey,v.colKey,d);if(w=a.skipSpansMap.get(x)||{},((y=w)===null||y===void 0?void 0:y.rowspan)>1&&(p.rowspan=w.rowspan),((S=w)===null||S===void 0?void 0:S.colspan)>1&&(p.colspan=w.colspan),w.skipped)return null}var R=ur(v,d,a.rowAndColFixedPosition,a.tableColFixedClasses),O=ta({},R.style);return(b=a.thWidthList)!==null&&b!==void 0&&b[v.colKey]&&(O.width="".concat(a.thWidthList[v.colKey],"px")),L("td",Ie(ta({key:v.colKey},p),{class:R.classes,style:O}),[a.renderTFootCell({row:l,rowIndex:i,col:v,colIndex:d})])})])}),o=this.renderTNode("footerSummary");return!o&&(!this.footData||!this.footData.length)?null:L("tfoot",{ref:"tFooterRef",class:n,style:{visibility:this.virtualScroll?"hidden":"visible"}},[o&&L("tr",{class:this.tableFullRowClasses.base},[L("td",{colspan:this.columns.length},[L("div",{class:this.tableFullRowClasses.innerFullElement},[o])])]),r])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function as(t,e){var a=Ke(t),n=a.data,r=a.activeRowType,o=a.activeRowKeys,l=a.defaultActiveRowKeys,i=a.disableSpaceInactiveRow,u=W(-1),s=W(!1),v=W(!1),d=W(-1),b=kt(o,l.value,t.onActiveChange,"activeRowKeys"),p=Pe(b,2),w=p[0],y=p[1],S=function(h){var g=h.row,c=h.index,f=H(g,t.rowKey);if(r.value==="single"){var C=w.value.length>1?[f]:[];y(C,{type:"inactive",activeRowList:[{row:g,rowIndex:c}],currentRowData:g})}else if(r.value==="multiple"){for(var E=w.value.filter(function(Y){return Y!==f}),k=[],I=0,M=n.value.length;I<M;I++){var $=n.value[I];E.includes(H($,t.rowKey))&&k.push({row:$,rowIndex:I})}y(E,{type:"inactive",activeRowList:k,currentRowData:g})}},x=function(h){var g=h.row,c=H(g,t.rowKey);if(r.value==="single")y([c],{activeRowList:[{row:g,rowIndex:h.index}],currentRowData:g,type:"active"});else{for(var f=w.value.concat(c),C=[],E=0,k=n.value.length;E<k;E++){var I=n.value[E];f.includes(H(I,t.rowKey))&&C.push({row:I,rowIndex:E})}y(f,{activeRowList:C,currentRowData:g,type:"active"})}},R=function(h){document.getSelection().removeAllRanges();for(var g=h.row,c=u.value,f=Math.min(d.value,c),C=Math.max(d.value,c),E=[],k=f;k<=C;k++)E.push({row:n.value[k],rowIndex:k});var I=E.map(function(M){return H(M.row,t.rowKey)});y(I,{activeRowList:E,type:"active",currentRowData:g})},O=function(){for(var h=[],g=0,c=n.value.length;g<c;g++){var f=n.value[g],C=H(f,t.rowKey);w.value.includes(C)&&h.push({row:f,rowIndex:g})}return h},_=function(h,g){if(!!r.value){var c=h.row,f=h.index,C=H(c,t.rowKey);s.value?(u.value=f,R(h),v.value=!0):w.value.includes(C)&&(g==null?void 0:g.action)!=="active"?i.value||(S(h),u.value=f):(x(h),u.value=f)}},j=function(){var h;y([],{activeRowList:[],currentRowData:void 0,type:"inactive"}),(h=t.onActiveRowAction)===null||h===void 0||h.call(t,{action:"clear",activeRowList:[]}),u.value=-1},A=function(){var h,g=n.value.map(function(f){return H(f,t.rowKey)}),c=n.value.map(function(f,C){return{row:f,rowIndex:C}});y(g,{activeRowList:c,currentRowData:void 0,type:"active"}),(h=t.onActiveRowAction)===null||h===void 0||h.call(t,{action:"select-all",activeRowList:c}),u.value=-1},T=function(){v.value=!1},F=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());if(Vo.test(c)){h.preventDefault();var f=Math.min(n.value.length-1,u.value+1);r.value==="single"?_({row:n.value[f],index:f,e:h},{action:"active"}):u.value=f}else if(Uo.test(c)){h.preventDefault();var C=Math.max(0,u.value-1);r.value==="single"?_({row:n.value[C],index:C,e:h},{action:"active"}):u.value=C}else if(Xa.test(c)){h.preventDefault();var E=u.value;if(v.value){var k;(k=t.onActiveRowAction)===null||k===void 0||k.call(t,{action:"shift-area-selection",activeRowList:O()})}else if(!i.value)_({row:n.value[E],index:E,e:h});else{var I;(I=t.onActiveRowAction)===null||I===void 0||I.call(t,{action:"space-one-selection",activeRowList:O()})}}else wr.test(c)?(s.value=!0,d.value=u.value):Xo.test(c)||Go.test(c)?(j(),T()):Yo.test(c)&&A();Xa.test(c)||T()},P=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());wr.test(c)&&(s.value=!1)},K=function(){Te(e.value,"keydown",F),Te(e.value,"keyup",P)},D=function(){xe(e.value,"keydown",F),xe(e.value,"keyup",P)};return{tActiveRow:w,onHighlightRow:_,addHighlightKeyboardListener:K,removeHighlightKeyboardListener:D}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function rs(t,e){var a=Ke(t),n=a.hover,r=a.data,o=a.activeRowType,l=a.keyboardRowHover,i=a.disableSpaceInactiveRow,u=W(),s=W(-1),v=N(function(){return o.value==="single"?!1:o.value==="multiple"?!0:n.value||l.value}),d=function(x,R){var O=H(x.row,t.rowKey);u.value===O&&(R==null?void 0:R.action)!=="hover"?i.value||(u.value=void 0):u.value=O,s.value=x.index},b=function(){u.value=void 0,s.value=-1},p=function(x){var R;if(!!v.value){var O=x.code||((R=x.key)===null||R===void 0?void 0:R.trim());if(Vo.test(O)){x.preventDefault();var _=Math.min(r.value.length-1,s.value+1);d({row:r.value[_],index:_,e:x},{action:"hover"})}else if(Uo.test(O)){x.preventDefault();var j=Math.max(0,s.value-1);d({row:r.value[j],index:j,e:x},{action:"hover"})}else if(Xa.test(O)&&t.activeRowType!=="multiple"){var A=s.value;if(d({row:r.value[A],index:A,e:x}),!t.activeRowType){var T;(T=t.onActiveRowAction)===null||T===void 0||T.call(t,{action:"space-one-selection",activeRowList:[{row:r.value[A],rowIndex:A}]})}}else if(Xo.test(O)&&!t.activeRowType){var F;u.value=void 0,(F=t.onActiveRowAction)===null||F===void 0||F.call(t,{action:"clear",activeRowList:[]})}else if(Yo.test(O)&&!t.activeRowType){var P;(P=t.onActiveRowAction)===null||P===void 0||P.call(t,{action:"select-all",activeRowList:[]})}else if(Go.test(O)&&!t.activeRowType){var K;(K=t.onActiveRowAction)===null||K===void 0||K.call(t,{action:"clear",activeRowList:[]})}}},w=function(){Te(e.value,"keydown",p)},y=function(){xe(e.value,"keydown",p)};return{hoverRow:u,needKeyboardRowHover:v,clearHoverRow:b,addRowHoverKeyboardListener:w,removeRowHoverKeyboardListener:y}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function os(t,e){var a=W(),n=W(!0),r=function(){if(!(!e.value||!t.value||a.value)){n.value=!1;var l=$o(t.value,null,function(){n.value=!0},10);a.value=l}};return yt(r),e.value&&de([e,t],r),Ra(function(){var o,l;!e.value||(o=a.value)===null||o===void 0||(l=o.unobserve)===null||l===void 0||l.call(o,t.value)}),{showElement:n}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Jr(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?Jr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Jr(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]"&&!dn(t)}var ls=["page-change","cell-click","scroll","scrollX","scrollY"];cl.map(function(t){return"row-".concat(t)}).concat(ls);var fl=ze({name:"TBaseTable",props:nt(nt({},On),{},{renderExpandedRow:Function,onLeafColumnsChange:Function,thDraggable:Boolean}),emits:["show-element-change"],setup:function(e,a){var n=Ke(e),r=n.lazyLoad,o=Yt(),l=W(),i=W(),u=W(),s=W(),v=W(0),d=ot(),b=d.classPrefix,p=d.virtualScrollClasses,w=d.tableLayoutClasses,y=d.tableBaseClass,S=d.tableColFixedClasses,x=vl(e),R=x.tableClasses,O=x.sizeClassNames,_=x.tableContentStyles,j=x.tableElementStyles,A=ht("table",e.locale),T=A.globalConfig,F=ol(e),P=F.isMultipleHeader,K=F.spansAndLeafNodes,D=F.thList,m=N(function(){var ye;return((ye=K.value)===null||ye===void 0?void 0:ye.leafColumns)||e.columns}),h=N(function(){var ye;return(ye=e.size)!==null&&ye!==void 0?ye:T.value.size}),g=os(l,r),c=g.showElement,f=W(),C=W(),E=W(),k=W(),I=Gu(e,a,m,{paginationAffixRef:f,horizontalScrollAffixRef:C,headerTopAffixRef:E,footerBottomAffixRef:k}),M=I.scrollbarWidth,$=I.virtualScrollHeaderPos,Y=I.tableWidth,ee=I.tableElmWidth,ne=I.tableContentRef,ae=I.isFixedHeader,J=I.isWidthOverflow,B=I.isFixedColumn,X=I.thWidthList,Q=I.showColumnShadow,q=I.rowAndColFixedPosition,se=I.setData,he=I.refreshTable,Le=I.setTableElmWidth,Ve=I.emitScrollEvent,qe=I.setUseFixedTableElmRef,Ne=I.updateColumnFixedShadow,lt=I.getThWidthList,gt=I.updateThWidthList,it=I.addTableResizeObserver,Pt=I.updateTableAfterColumnResize,je=Ju(e),Dn=je.affixHeaderRef,_n=je.affixFooterRef,Tn=je.horizontalScrollbarRef,re=je.paginationRef,V=je.showAffixHeader,G=je.showAffixFooter,Z=je.showAffixPagination,te=je.onHorizontalScroll,le=je.setTableContentRef,ge=je.updateAffixHeaderOrFooter,pe=qu(e,a),ue=pe.dataSource,me=pe.innerPagination,Ee=pe.isPaginateData,Ae=pe.renderPagination,He=wu({isWidthOverflow:J,tableContentRef:ne,showColumnShadow:Q,getThWidthList:lt,updateThWidthList:gt,setTableElmWidth:Le,updateTableAfterColumnResize:Pt,onColumnResizeChange:e.onColumnResizeChange}),At=He.resizeLineRef,Bt=He.resizeLineStyle,tt=He.setEffectColMap,zt=N(function(){return[R.value,z(z(z(z(z(z(z(z({},y.headerFixed,ae.value),y.columnFixed,B.value),y.widthOverflow,J.value),y.multipleHeader,P.value),S.leftShadow,Q.left),S.rightShadow,Q.right),y.columnResizableTable,e.resizable),"".concat(b,"-table__row--active-").concat(e.activeRowType),e.activeRowType)]}),Ct=N(function(){return[[w[e.tableLayout]]]}),vn=N(function(){return e.bordered&&ae.value&&(P.value&&J.value||!P.value)}),xt=N(function(){var ye,De;if(!e.bordered)return 0;var Se=(ye=s.value)===null||ye===void 0?void 0:ye.getBoundingClientRect(),We=(De=re.value)===null||De===void 0?void 0:De.getBoundingClientRect();return((Se==null?void 0:Se.height)||0)+((We==null?void 0:We.height)||0)}),St=as(e,l),be=St.tActiveRow,ve=St.onHighlightRow,Fe=St.addHighlightKeyboardListener,Je=St.removeHighlightKeyboardListener,Ge=rs(e,l),pt=Ge.hoverRow,Jt=Ge.needKeyboardRowHover,qn=Ge.clearHoverRow,Zt=Ge.addRowHoverKeyboardListener,Qt=Ge.removeRowHoverKeyboardListener;de(i,function(){qe(i.value)}),de(function(){return[e.data,ue]},function(){se(Ee.value?ue.value:e.data)}),de(K,function(){var ye;(ye=e.onLeafColumnsChange)===null||ye===void 0||ye.call(e,K.value.leafColumns),tt(K.value.leafColumns,null)},{immediate:!0});var en=function(){Gt(function(){te(),ge()})},tn=N(function(){return{data:e.data,scroll:e.scroll}}),bt=vi(ne,tn),we=-1,fn=function(De){var Se=De.target||De.srcElement,We=Se.scrollTop;we!==We?bt.isVirtualScroll.value&&bt.handleScroll():(we=-1,Ne(Se)),we=We,Ve(De)},Ht=function(){var De;!i.value||(v.value=(De=i.value.querySelector("tfoot"))===null||De===void 0?void 0:De.getBoundingClientRect().height)},Pn=function(De){if(!!ne.value){for(var Se=ne.value.querySelector('th[data-colkey="'.concat(De,'"]')),We=ne.value.querySelectorAll("th.t-table__cell--fixed-left"),Et=0,Wt=0,An=We.length;Wt<An;Wt++)Et+=We[Wt].getBoundingClientRect().width;var Jn=Se.getBoundingClientRect(),Fl=ne.value.getBoundingClientRect(),Il=Jn.left-Fl.left-Et;ne.value.scrollTo({left:Il,behavior:"smooth"})}};de(ne,function(){le(ne.value)}),de(function(){return[i.value,e.footData,e.footerSummary,e.columns]},function(){var ye=setTimeout(function(){Ht(),clearTimeout(ye)},0)}),de(l,function(ye){it(ye)}),yt(function(){Ht(),le(ne.value),it(l.value)});var nn=function(){e.activeRowType&&Fe(),Jt.value&&Zt()},Ot=function(){e.activeRowType&&Je(),Jt.value&&Qt()},Rt=function(De){var Se;(Se=e.onRowClick)===null||Se===void 0||Se.call(e,De),e.activeRowType&&ve(De),Jt.value&&qn()};de([c],function(ye){var De=Pe(ye,1),Se=De[0];a.emit("show-element-change",Se)},{immediate:!0});var _a=N(function(){return Ee.value?ue.value:e.data}),Ta=function(De){var Se=De.index;if(!Se&&Se!==0){var We;if(!De.key){Be.error("Table","scrollToElement: one of `index` or `key` must exist.");return}Se=(We=_a.value)===null||We===void 0?void 0:We.findIndex(function(Et){return H(Et,e.rowKey)===De.key}),Se<0&&Be.error("Table","".concat(De.key," does not exist in data, check `rowKey` or `data` please."))}bt.scrollToElement(nt(nt({},De),{},{index:Se-1}))};return{thList:D,classPrefix:b,innerPagination:me,globalConfig:T,tableFootHeight:v,virtualScrollHeaderPos:$,tableSize:h,tableWidth:Y,tableElmWidth:ee,tableRef:l,tableElmRef:i,sizeClassNames:O,tableBaseClass:y,spansAndLeafNodes:K,dynamicBaseTableClasses:zt,tableContentStyles:_,tableElementStyles:j,dividerBottom:xt,virtualScrollClasses:p,tableLayoutClasses:w,tableElmClasses:Ct,tableContentRef:ne,isFixedHeader:ae,isWidthOverflow:J,isFixedColumn:B,rowAndColFixedPosition:q,showColumnShadow:Q,thWidthList:X,isPaginateData:Ee,dataSource:ue,affixHeaderRef:Dn,affixFooterRef:_n,bottomContentRef:s,paginationRef:re,showAffixHeader:V,showAffixFooter:G,scrollbarWidth:M,isMultipleHeader:P,showRightDivider:vn,resizeLineRef:At,resizeLineStyle:Bt,columnResizeParams:He,horizontalScrollbarRef:Tn,tableBodyRef:u,virtualConfig:bt,showAffixPagination:Z,tActiveRow:be,hoverRow:pt,showElement:c,scrollToElement:Ta,renderPagination:Ae,renderTNode:o,onFixedChange:en,onHorizontalScroll:te,updateAffixHeaderOrFooter:ge,onInnerVirtualScroll:fn,refreshTable:he,scrollColumnIntoView:Pn,onTableFocus:nn,onTableBlur:Ot,onInnerRowClick:Rt,paginationAffixRef:f,horizontalScrollAffixRef:C,headerTopAffixRef:E,footerBottomAffixRef:k}},render:function(){var e,a,n=this,r,o,l,i,u,s;if(!this.showElement)return L("div",{ref:"tableRef"},null);var v=this.rowAndColFixedPosition,d=this.tableLayout,b=this.isPaginateData?this.dataSource:this.data,p=((e=this.spansAndLeafNodes)===null||e===void 0?void 0:e.leafColumns)||this.columns,w=(a=this.allowResizeColumnWidth)!==null&&a!==void 0?a:this.resizable;w&&d==="auto"&&Be.warn("Table","table-layout can not be `auto`, cause you are using column resizable, set `table-layout: fixed` please.");var y=d==="fixed"&&this.isWidthOverflow?"100px":void 0,S=function(){var Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return L("colgroup",null,[p.map(function(q){var se={width:Nn((Q||w?n.thWidthList[q.colKey]:void 0)||q.width)||y};return q.minWidth&&(se.minWidth=Nn(q.minWidth)),!se.width&&!q.minWidth&&n.tableLayout==="fixed"&&(se.minWidth="80px"),L("col",{key:q.colKey,style:se},null)})])},x=function(){return n.showHeader===!1?null:!!(n.virtualConfig.isVirtualScroll.value||n.headerAffixedTop)&&(n.headerAffixedTop?L(Zn,Ie({offsetTop:0},Qn(n.headerAffixedTop),{onFixedChange:n.onFixedChange,ref:"headerTopAffixRef"}),Zr(h)?h:{default:function(){return[h]}}):n.isFixedHeader&&h)},R=function(){return L(Zn,Ie({offsetBottom:0},Qn(n.horizontalScrollAffixedBottom),{style:{marginTop:"-".concat(n.scrollbarWidth*2,"px")},horizontalScrollAffixedBottom:!0,ref:"horizontalScrollAffixRef"}),{default:function(){return[L("div",{ref:"horizontalScrollbarRef",class:["scrollbar",n.tableBaseClass.obviousScrollbar],style:{width:"".concat(n.tableWidth,"px"),overflow:"auto",opacity:Number(n.showAffixFooter)}},[L("div",{style:{width:"".concat(n.tableElmWidth,"px"),height:"5px"}},null)])]}})},O={isFixedHeader:this.isFixedHeader,rowAndColFixedPosition:this.rowAndColFixedPosition,isMultipleHeader:this.isMultipleHeader,bordered:this.bordered,maxHeight:this.maxHeight,height:this.height,spansAndLeafNodes:this.spansAndLeafNodes,thList:this.thList,thWidthList:this.thWidthList,resizable:this.resizable,columnResizeParams:this.columnResizeParams,classPrefix:this.classPrefix,ellipsisOverlayClassName:this.tableSize!=="medium"?this.sizeClassNames[this.tableSize]:"",attach:this.attach,showColumnShadow:this.showColumnShadow,thDraggable:this.thDraggable},_=Va()<=11?4:0,j=this.isWidthOverflow?this.scrollbarWidth:0,A=W((((r=this.affixHeaderRef)===null||r===void 0?void 0:r.getBoundingClientRect().height)||0)-_),T=setTimeout(function(){var X;A.value=(((X=n.affixHeaderRef)===null||X===void 0?void 0:X.getBoundingClientRect().height)||0)-_,clearTimeout(T)},0),F=N(function(){return A.value-j}),P=On.headerAffixedTop?Number(this.showAffixHeader):1,K=N(function(){return{width:"".concat(n.tableWidth,"px"),height:"".concat(F.value,"px"),opacity:P}}),D=this.bordered?1:0,m=Boolean((this.headerAffixedTop||this.virtualConfig.isVirtualScroll.value)&&this.tableWidth)&&L("div",{ref:"affixHeaderRef",style:{width:"".concat(this.tableWidth-D,"px"),opacity:Number(this.showAffixHeader)},class:["scrollbar",z({},this.tableBaseClass.affixedHeaderElm,this.headerAffixedTop||this.virtualConfig.isVirtualScroll.value)]},[L("table",{class:this.tableElmClasses,style:nt(nt({},this.tableElementStyles),{},{width:"".concat(this.tableElmWidth,"px")})},[S(!0),L(Gr,O,this.$slots)])]),h=L("div",{class:this.tableBaseClass.affixedHeaderWrap,style:K.value},[m]),g=this.isWidthOverflow?this.scrollbarWidth:0;this.bordered&&(g+=1);var c=Boolean(this.virtualConfig.isVirtualScroll.value||this.footerAffixedBottom),f=((o=this.footData)===null||o===void 0?void 0:o.length)||this.footerSummary||this.$slots.footerSummary,C=Boolean(c&&f&&this.tableWidth)&&L(Zn,Ie({class:this.tableBaseClass.affixedFooterWrap,onFixedChange:this.onFixedChange,offsetBottom:g||0},Qn(this.footerAffixedBottom),{style:{marginTop:"".concat(-1*(((l=this.tableFootHeight)!==null&&l!==void 0?l:0)+g),"px")},ref:"footerBottomAffixRef"}),{default:function(){return[L("div",{ref:"affixFooterRef",style:{width:"".concat(n.tableWidth-D,"px"),opacity:Number(n.showAffixFooter)},class:["scrollbar",z({},n.tableBaseClass.affixedFooterElm,n.footerAffixedBottom||n.virtualConfig.isVirtualScroll.value)]},[L("table",{class:n.tableElmClasses,style:nt(nt({},n.tableElementStyles),{},{width:"".concat(n.tableElmWidth,"px")})},[S(!0),L(qr,{rowKey:n.rowKey,isFixedHeader:n.isFixedHeader,rowAndColFixedPosition:v,footData:n.footData,columns:p,rowAttributes:n.rowAttributes,rowClassName:n.rowClassName,thWidthList:n.thWidthList,footerSummary:n.footerSummary,rowspanAndColspanInFooter:n.rowspanAndColspanInFooter},n.$slots)])])]}}),E="translate(0, ".concat(this.virtualConfig.scrollHeight.value+((i=this.tableFootHeight)!==null&&i!==void 0?i:0)+((u=A.value)!==null&&u!==void 0?u:0),"px)"),k={transform:E,"-ms-transform":E,"-moz-transform":E,"-webkit-transform":E},I=this.virtualConfig,M=nt(nt({classPrefix:this.classPrefix,ellipsisOverlayClassName:this.tableSize!=="medium"?this.sizeClassNames[this.tableSize]:"",rowAndColFixedPosition:v,showColumnShadow:this.showColumnShadow,data:I.isVirtualScroll.value?I.visibleData.value:b,virtualConfig:this.virtualConfig,columns:this.spansAndLeafNodes.leafColumns,tableElm:this.tableRef,tableWidth:this.tableWidth,isWidthOverflow:this.isWidthOverflow,scroll:this.scroll,cellEmptyContent:this.cellEmptyContent,tableContentElm:this.tableContentRef,handleRowMounted:this.virtualConfig.handleRowMounted,renderExpandedRow:this.renderExpandedRow},Cn(this.$props,dl)),{},{pagination:this.innerPagination,attach:this.attach,hoverRow:this.hoverRow,activeRow:this.tActiveRow,onRowClick:this.onInnerRowClick}),$=L("div",{ref:"tableContentRef",class:this.tableBaseClass.content,style:this.tableContentStyles,onScroll:this.onInnerVirtualScroll},[this.virtualConfig.isVirtualScroll.value&&L("div",{class:this.virtualScrollClasses.cursor,style:k},null),L("table",{ref:"tableElmRef",class:this.tableElmClasses,style:nt(nt({},this.tableElementStyles),{},{width:this.resizable&&this.isWidthOverflow&&this.tableElmWidth?"".concat(this.tableElmWidth,"px"):this.tableElementStyles.width})},[S(!1),this.showHeader&&L(Gr,nt(nt({},O),{},{thWidthList:w?this.thWidthList:{}}),this.$slots),L(ts,M,this.$slots),L(qr,{rowKey:this.rowKey,isFixedHeader:this.isFixedHeader,rowAndColFixedPosition:v,footData:this.footData,columns:p,rowAttributes:this.rowAttributes,rowClassName:this.rowClassName,footerSummary:this.footerSummary,rowspanAndColspanInFooter:this.rowspanAndColspanInFooter,virtualScroll:this.virtualConfig.isVirtualScroll.value},this.$slots)])]),Y=Re(this.loading)?this.loading:this.$slots.loading,ee=this.loading!==void 0&&L(Lo,Ie({loading:!!this.loading,text:Y,attach:this.tableRef?function(){return n.tableRef}:void 0,showOverlay:!0,size:"small"},this.loadingProps),null),ne=this.renderTNode("topContent"),ae=this.renderTNode("bottomContent"),J=L("div",{ref:"paginationRef",class:this.tableBaseClass.paginationWrap,style:{opacity:Number(this.showAffixPagination)}},[this.renderPagination()]),B=!!ae&&L("div",{ref:"bottomContentRef",class:this.tableBaseClass.bottomContent},[ae]);return L("div",{ref:"tableRef",tabindex:"0",class:this.dynamicBaseTableClasses,onFocus:this.onTableFocus,onBlur:this.onTableBlur},[!!ne&&L("div",{class:this.tableBaseClass.topContent},[ne]),x(),$,C,ee,B,this.showRightDivider&&L("div",{class:this.tableBaseClass.scrollbarDivider,style:{right:"".concat(this.scrollbarWidth,"px"),bottom:this.dividerBottom?"".concat(this.dividerBottom,"px"):void 0,height:"".concat((s=this.tableContentRef)===null||s===void 0?void 0:s.getBoundingClientRect().height,"px")}},null),this.horizontalScrollAffixedBottom&&R(),this.paginationAffixedBottom?L(Zn,Ie({offsetBottom:0},Qn(this.paginationAffixedBottom),{ref:"paginationAffixRef"}),Zr(J)?J:{default:function(){return[J]}}):J,L("div",{ref:"resizeLineRef",class:this.tableBaseClass.resizeLine,style:this.resizeLineStyle},null)])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var hl={asyncLoading:{type:[String,Function]},columnController:{type:Object},columnControllerVisible:{type:Boolean,default:void 0},defaultColumnControllerVisible:{type:Boolean,default:void 0},columns:{type:Array,default:function(){return[]}},displayColumns:{type:Array,default:void 0},defaultDisplayColumns:{type:Array},dragSort:{type:String,validator:function(e){return e?["row","row-handler","col","row-handler-col","drag-col"].includes(e):!0}},dragSortOptions:{type:Object},editableCellState:{type:Function},editableRowKeys:{type:Array},expandIcon:{type:[Boolean,Function],default:!0},expandOnRowClick:Boolean,expandedRow:{type:[String,Function]},expandedRowKeys:{type:Array,default:void 0},defaultExpandedRowKeys:{type:Array,default:function(){return[]}},filterIcon:{type:Function},filterRow:{type:[String,Function]},filterValue:{type:Object,default:void 0},defaultFilterValue:{type:Object},hideSortTips:Boolean,indeterminateSelectedRowKeys:{type:Array},multipleSort:Boolean,reserveSelectedRowOnPaginate:{type:Boolean,default:!0},rowSelectionAllowUncheck:Boolean,rowSelectionType:{type:String,validator:function(e){return e?["single","multiple"].includes(e):!0}},selectOnRowClick:Boolean,selectedRowKeys:{type:Array,default:void 0},defaultSelectedRowKeys:{type:Array,default:function(){return[]}},showSortColumnBgColor:Boolean,sort:{type:[Object,Array],default:void 0},defaultSort:{type:[Object,Array]},sortIcon:{type:Function},sortOnRowDraggable:Boolean,onAsyncLoadingClick:Function,onCellClick:Function,onChange:Function,onColumnChange:Function,onColumnControllerVisibleChange:Function,onDataChange:Function,onDisplayColumnsChange:Function,onDragSort:Function,onExpandChange:Function,onFilterChange:Function,onRowEdit:Function,onRowValidate:Function,onSelectChange:Function,onSortChange:Function,onValidate:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Qr(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 eo(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Qr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var is=ze({name:"ColumnCheckboxGroup",props:{checkboxProps:Object,options:{type:Array,default:function(){return[]}},label:String,uniqueKey:String,value:Array,onChange:Function},setup:function(e){var a=Ke(e),n=a.checkboxProps,r=a.value,o=a.options,l=Kt(),i=N(function(){var w=[];return o.value.forEach(function(y){if(dt(y)==="object"){if(y.disabled)return;y.value?w.push(y.value):typeof y.label=="string"&&w.push(y.label)}else w.push(y)}),w}),u=N(function(){return ba(i.value,r.value)}),s=N(function(){var w=u.value.length;return Boolean(w&&i.value.length===w)}),v=N(function(){var w=u.value.length;return Boolean(w<i.value.length&&w)}),d=function(y,S){var x={e:S.e,type:"check",current:void 0,option:void 0};if(y){var R,O=fe(new Set(r.value.concat(i.value)));(R=e.onChange)===null||R===void 0||R.call(e,O,x)}else{var _,j=r.value.filter(function(A){return!i.value.includes(A)});(_=e.onChange)===null||_===void 0||_.call(e,j,eo(eo({},x),{},{type:"uncheck"}))}},b=function(y,S){var x;(x=e.onChange)===null||x===void 0||x.call(e,y,S)},p=N(function(){return["".concat(l.value,"-table__column-controller-item"),z({},"".concat(l.value,"-table__").concat(e.uniqueKey),e.uniqueKey)]});return function(){return L("div",{class:p.value},[L("div",{class:"".concat(l.value,"-table__column-controller-block")},[L(Ga,{indeterminate:v.value,checked:s.value,onChange:d,disabled:!i.value.length},{default:function(){return[e.label]}})]),L("div",{class:"".concat(l.value,"-table__column-controller-block")},[L(qo,Ie({options:o.value},n.value,{modelValue:r.value,onChange:b}),null)])])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function to(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ia(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?to(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):to(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function qa(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set,a=0,n=t.length;a<n;a++){var r,o=t[a];(r=o.children)!==null&&r!==void 0&&r.length?qa(o.children,e):o.colKey&&e.add(o.colKey)}return e}function us(t,e){var a=ht("table",t.locale),n=a.classPrefix,r=a.globalConfig,o=En({SettingIcon:Mi}),l=o.SettingIcon,i=Ke(t),u=i.columns,s=i.columnController,v=i.displayColumns,d=i.columnControllerVisible,b=W(null),p=Yt(),w=N(function(){var m,h=(((m=s.value)===null||m===void 0?void 0:m.fields)||fe(qa(u.value))).filter(function(g){return g});return new Set(h)}),y=fe(qa(u.value)),S=kt(v,t.defaultDisplayColumns||y,t.onDisplayColumnsChange,"displayColumns"),x=Pe(S,2),R=x[0],O=x[1],_=W(v.value||t.defaultDisplayColumns||y),j=N(function(){var m;if((m=s.value)!==null&&m!==void 0&&(m=m.groupColumns)!==null&&m!==void 0&&m.length)return T(u.value);var h={label:r.value.selectAllText,options:F(u.value)};return[h]});de([v],function(m){var h=Pe(m,1),g=h[0];_.value=g||t.defaultDisplayColumns||y});function A(m,h){return{label:function(){return Ea(e.slots,m,h)},value:m.colKey,disabled:!w.value.has(m.colKey)}}function T(m){var h,g=(h=s.value)===null||h===void 0?void 0:h.groupColumns;if(!(g!=null&&g.length))return[];var c=[],f=function C(E){for(var k=0,I=E.length;k<I;k++){for(var M,$=E[k],Y=A($,k),ee=0,ne=g.length;ee<ne;ee++){var ae,J=g[ee];!J.columns.includes($.colKey)||((ae=c[ee])!==null&&ae!==void 0&&(ae=ae.options)!==null&&ae!==void 0&&ae.length?c[ee].options.push(Y):c[ee]=Ia(Ia({},g[ee]),{},{options:[Y]}))}(M=$.children)!==null&&M!==void 0&&M.length&&C($.children)}};return f(m),c}function F(m){var h,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if((h=s.value)!==null&&h!==void 0&&(h=h.groupColumns)!==null&&h!==void 0&&h.length)return[];for(var c=0,f=m.length;c<f;c++){var C,E=m[c];(C=E.children)!==null&&C!==void 0&&C.length?F(E.children,g):E.colKey&&g.push(A(E,c))}return g}var P=function(h,g){var c;_.value=h;var f={columns:h,type:g.type,currentColumn:il(u.value,String(g.current)),e:g.e};(c=t.onColumnChange)===null||c===void 0||c.call(t,f)},K=function(){var h;if(b.value){b.value.show();return}b.value=Yl.confirm(Ia({header:r.value.columnConfigTitleText,body:function(){var c,f=((c=s.value)===null||c===void 0?void 0:c.displayType)==="fixed-width"?"fixed":"auto",C=s.value||{},E=C.columnControllerTopContent,k=C.columnControllerBottomContent,I=L("div",{class:["".concat(n.value,"-table__column-controller"),"".concat(n.value,"-table__column-controller--").concat(f)]},[L("div",{class:"".concat(n.value,"-table__column-controller-body")},[Re(E)?E(Ye):p("columnControllerTopContent"),r.value.columnConfigDescriptionText&&L("p",{class:"".concat(n.value,"-table__column-controller-desc")},[r.value.columnConfigDescriptionText]),j.value.map(function(M,$){var Y,ee,ne=(Y=s.value)!==null&&Y!==void 0&&(Y=Y.groupColumns)!==null&&Y!==void 0&&Y.length?String(M.value||$):void 0;return L(is,{key:M.value||$,uniqueKey:ne,value:_.value,label:M.label,options:M.options,onChange:P,checkboxProps:(ee=s.value)===null||ee===void 0?void 0:ee.checkboxProps},null)}),Re(k)?k(Ye):p("columnControllerBottomContent")])]);return I},confirmBtn:r.value.confirmText,cancelBtn:r.value.cancelText,width:612,onConfirm:function(){if(O(fe(_.value)),d.value===void 0)b.value.hide();else{var c;(c=t.onColumnControllerVisibleChange)===null||c===void 0||c.call(t,!1,{trigger:"confirm"}),e.emit("update:columnControllerVisible",!1)}},onClose:function(){if(d.value===void 0)b.value.hide();else{var c;(c=t.onColumnControllerVisibleChange)===null||c===void 0||c.call(t,!1,{trigger:"cancel"}),e.emit("update:columnControllerVisible",!1)}}},((h=s.value)===null||h===void 0?void 0:h.dialogProps)||{}))};de([d],function(m){var h=Pe(m,1),g=h[0];g!==void 0&&(b.value?g?b.value.show():b.value.hide():g&&K())},{immediate:!0});var D=function(){var h,g=!!(s.value&&Object.keys(s.value).length),c=g?s.value.placement||"top-right":"";if(g&&s.value.hideTriggerButton)return null;var f=["".concat(n.value,"-table__column-controller-trigger"),z({},"".concat(n.value,"-align-").concat(c),!!c)];return L("div",{class:f},[L(pa,Ie({theme:"default",variant:"outline",onClick:K,content:r.value.columnConfigButtonText},(h=t.columnController)===null||h===void 0?void 0:h.buttonProps),{icon:function(){return L(l,null,null)}})])};return{tDisplayColumns:R,columnCheckboxKeys:_,renderColumnController:D}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ss(t,e){var a=Ke(t),n=a.expandedRowKeys,r=Yt(),o=ht("table",t.locale),l=o.t,i=o.globalConfig,u=En({ChevronRightCircleIcon:Ri}),s=u.ChevronRightCircleIcon,v=ot(),d=v.tableExpandClasses,b=v.positiveRotate90,p=v.tableFullRowClasses,w=kt(n,t.defaultExpandedRowKeys||[],t.onExpandChange,"expandedRowKeys"),y=Pe(w,2),S=y[0],x=y[1],R=N(function(){return Boolean(t.expandedRow||e.slots.expandedRow||e.slots["expanded-row"])}),O=N(function(){return t.expandIcon!==!1&&R.value}),_=N(function(){var K;return((K=t.columns)===null||K===void 0||(K=K[0])===null||K===void 0?void 0:K.fixed)==="left"}),j=function(D,m){t.expandOnRowClick&&D.stopPropagation();var h=H(m,t.rowKey||"id"),g=S.value.indexOf(h),c=fe(S.value);g!==-1?c.splice(g,1):c.push(h),x(c,{expandedRowData:t.data.filter(function(f){return c.includes(H(f,t.rowKey||"id"))}),currentRowData:m})},A=function(D,m){var h=m.row,g=m.rowIndex,c=H(h,t.rowKey||"id"),f=S.value.includes(c),C=r("expandIcon",{defaultNode:l(i.value.expandIcon)||L(s,null,null),params:{row:h,index:g}});if(!C)return null;var E=[d.iconBox,d[f?"expanded":"collapsed"],z({},b,f)];return L("span",{class:E,onClick:function(I){return j(I,h)}},[C])},T=function(){var D={colKey:"__EXPAND_ROW_ICON_COLUMN__",width:46,className:d.iconCell,fixed:_.value?"left":void 0,cell:A,stopPropagation:!0};return D},F=function(D){var m=H(D.row,t.rowKey||"id");if(!S.value||!S.value.includes(m))return null;var h=D.isWidthOverflow&&t.columns.find(function(g){return g.fixed==="left"});return L("tr",{key:"expand_".concat(m),class:[d.row,z({},p.base,h)]},[L("td",{colspan:D.columns.length},[L("div",{class:[d.rowInner,z({},p.innerFullRow,h)],style:h?{width:"".concat(D.tableWidth,"px")}:{}},[L("div",{class:p.innerFullElement},[r("expandedRow",{params:D})])])])])},P=function(D){j(D.e,D.row)};return{showExpandedRow:R,showExpandIconColumn:O,getExpandColumn:T,renderExpandedRow:F,onInnerExpandRowClick:P}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Ja(t,e,a){if(!t)return!1;var n=Re(t.disabled)?t.disabled({row:e,rowIndex:a}):t.disabled;return t.checkProps&&(Re(t.checkProps)?n=n||t.checkProps({row:e,rowIndex:a}).disabled:t.checkProps==="object"&&(n=n||t.checkProps.disabled)),!!n}function cs(t,e,a){for(var n={},r=0,o=e.length;r<o;r++){var l=H(e[r],a);t.includes(l)&&(n[l]=!0)}return n}function wa(t,e){for(var a=0,n=t.length;a<n;a++){var r;if(t[a].colKey===e)return t[a];if((r=t[a].children)!==null&&r!==void 0&&r.length){var o=wa(t[a].children,e);if(o)return o}}return null}function no(t,e){for(var a=0,n=t.length;a<n;a++){var r;if(t[a].colKey===e)return a;if((r=t[a].children)!==null&&r!==void 0&&r.length){var o=wa(t[a].children,e);if(o)return a}}return-1}function gl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=0,n=t.length;a<n;a++){var r,o=t[a];o.filter&&"resetValue"in o.filter&&(e[o.colKey]=o.filter.resetValue),(r=o.children)!==null&&r!==void 0&&r.length&&gl(o.children,e)}return e}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ao(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function na(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ao(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ds(t,e){var a=Ke(t),n=a.selectedRowKeys,r=a.columns,o=a.rowKey,l=a.data,i=a.reserveSelectedRowOnPaginate,u=W(l.value),s=W(),v=kt(n,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),d=Pe(v,2),b=d[0],p=d[1],w=W(new Map),y=N(function(){return t.columns.find(function(c){var f=c.type;return["multiple","single"].includes(f)})}),S=N(function(){var c;return t.rowSelectionType||((c=y.value)===null||c===void 0?void 0:c.type)||"single"}),x=N(function(){var c=i.value?l.value:u.value;return c.filter(function(f,C){return!_(f,C)})}),R=N(function(){return ba(b.value,x.value.map(function(c){return H(c,t.rowKey||"id")}))}),O=N(function(){var c;if(t.rowSelectionAllowUncheck)return!0;var f=S.value==="single";return!f||!y.value||!("allowUncheck"in((c=y.value)===null||c===void 0?void 0:c.checkProps))?!1:y.value.checkProps.allowUncheck});de([l,r,b,y,o],function(){var c,f=function($){return y.value.disabled($)?e.disabled:""},C=(c=y.value)!==null&&c!==void 0&&c.disabled?f:void 0,E=new Set(b.value),k=function($){var Y=$.row,ee=H(Y,t.rowKey||"id");return E.has(ee)?e.selected:""},I=E.size?k:void 0;s.value=[C,I]},{immediate:!0});function _(c,f){return Ja(y.value,c,f)}function j(){return function(){var c=R.value.length>0&&R.value.length<x.value.length,f=R.value.length!==0&&x.value.length!==0&&R.value.length===x.value.length;return L(Ga,{checked:f,indeterminate:c,disabled:!x.value.length,onChange:P},null)}}function A(c){var f=c.col,C=c.row,E=c.rowIndex,k=Re(f.disabled)?f.disabled({row:C,rowIndex:E}):f.disabled,I=Re(f.checkProps)?f.checkProps({row:C,rowIndex:E}):f.checkProps;return{disabled:k||(I==null?void 0:I.disabled),checkProps:I}}function T(c){var f=c.col,C=c.row,E=C===void 0?{}:C,k=b.value.includes(H(E,t.rowKey||"id")),I=A(c),M=I.disabled,$=I.checkProps,Y=na(na({checked:k,disabled:M},$),{},{onClick:function(J){if(dt(J)==="object"&&"e"in J){var B;(B=J.e)===null||B===void 0||B.stopPropagation()}else J==null||J.stopPropagation()},onChange:function(){return F(E)}});if(f.type==="single")return L(su,Y,null);if(f.type==="multiple"){var ee,ne=(ee=t.indeterminateSelectedRowKeys)!==null&&ee!==void 0&&ee.length?t.indeterminateSelectedRowKeys.includes(H(E,t.rowKey)):!1;return L(Ga,Ie({indeterminate:ne},Y),null)}return null}function F(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=fe(b.value),C=t.rowKey||"id",E=H(c,C),k=f.indexOf(E),I=k!==-1;if(S.value==="multiple")I?f.splice(k,1):f.push(E);else if(S.value==="single")f=I&&O.value?[]:[E];else{Be.warn("Table","`column.type` must be one of `multiple` and `single`");return}p(f,{selectedRowData:f.map(function(M){return w.value.get(M)}),currentRowKey:E,currentRowData:c,type:I?"uncheck":"check"})}function P(c){var f,C=t.rowKey||"id",E=x.value.map(function(M){return H(M,C)}),k=((f=n.value)===null||f===void 0?void 0:f.filter(function(M){return!E.includes(M)}))||[],I=c?[].concat(fe(k),fe(E)):fe(k);p(I,{selectedRowData:c?I.map(function(M){return w.value.get(M)}):[],type:c?"check":"uncheck",currentRowKey:"CHECK_ALL_BOX"})}function K(c){var f=["multiple","single"].includes(c.type);return f?na(na({},c),{},{width:c.width||64,className:[e.checkCell,c.className],cell:function(E,k){return T(k)},title:c.type==="multiple"?j():c.title}):c}var D=function(f){var C=f.row,E=f.index,k=t.columns.findIndex(function($){return $.colKey==="row-select"}),I=!1;if(k!==-1){var M;I=(M=A({row:C,rowIndex:E,col:t.columns[k],colIndex:k}))===null||M===void 0?void 0:M.disabled}I||F(C)};de([l,o],function(){for(var c=0,f=l.value.length;c<f;c++)w.value.set(H(l.value[c],o.value||"id"),l.value[c])},{immediate:!0});var m=N(function(){return Boolean(y.value||t.selectOnRowClick||t.selectedRowKeys)}),h=function(){p([],{selectedRowData:[],currentRowKey:void 0,currentRowData:void 0,type:"uncheck"})},g=function(f){var C=f.activeRowList,E=f.action;if(!!m.value){if(E==="clear"){h();return}if(E==="select-all"){P(!0);return}if(S.value==="single"){E==="space-one-selection"&&F(C[0].row);return}var k=C.filter(function(ae){var J=ae.row,B=ae.rowIndex;return!A({row:J,rowIndex:B,col:y.value,colIndex:void 0}).disabled});if(!!k.length){var I=k.map(function(ae){var J=ae.row;return H(J,t.rowKey)}),M=ba(b.value,I),$=M.length!==I.length,Y=b.value.filter(function(ae){return!I.includes(ae)}),ee=$?fe(new Set(b.value.concat(I))):Y,ne=E==="space-one-selection"?C[0].row:void 0;p(ee,{selectedRowData:C,currentRowKey:H(ne,t.rowKey),currentRowData:ne,type:$?"check":"uncheck"})}}};return{selectColumn:y,showRowSelect:m,selectedRowClassNames:s,currentPaginateData:u,setTSelectedRowKeys:p,formatToRowSelectColumn:K,onInnerSelectRowClick:D,handleRowSelectWithAreaSelection:g}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function vs(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var fs=ze({name:"TSorterButton",props:{sortType:{type:String,default:"all"},sortOrder:{type:String,default:function(){return""}},locale:Object,sortIcon:Function,tooltipProps:Object,hideSortTips:Boolean},emits:["sort-icon-click"],setup:function(e,a){var n=ot(),r=n.tableSortClasses,o=n.negativeRotate180,l=Un(),i=ht("table",e.locale),u=i.t,s=i.globalConfig,v=En({ChevronDownIcon:fi}),d=v.ChevronDownIcon,b=N(function(){return e.sortType==="all"?["asc","desc"]:[e.sortType]}),p=function(S,x){a.emit("sort-icon-click",S,{descending:x==="desc"})},w=function(S,x){var R=u(s.value.sortIcon)||L(d,null,null),O=l("sortIcon",R),_=[x,r.sortIcon,r.iconDirection[S],z({},o,S==="asc")];return L("span",{class:_,onClick:function(A){return p(A,S)}},[O])};return{t:u,globalConfig:s,tableSortClasses:r,negativeRotate180:o,allowSortTypes:b,getSortIcon:w}},render:function(){var e=this,a=this.tableSortClasses,n=[a.trigger,z({},a.doubleIcon,this.allowSortTypes.length>1)],r={asc:this.globalConfig.sortAscendingOperationText,desc:this.globalConfig.sortDescendingOperationText},o=this.allowSortTypes.map(function(l){var i,u,s=l===e.sortOrder?a.iconActive:a.iconDefault,v=e.globalConfig.sortCancelOperationText,d=l===e.sortOrder?v:r[l];return((u=e.hideSortTips)!==null&&u!==void 0?u:e.globalConfig.hideSortTips)?e.getSortIcon(l,s):L(Wo,Ie({content:d,placement:"right",showArrow:!1,class:e.tableSortClasses.iconDirection[l]},e.tooltipProps),vs(i=e.getSortIcon(l,s))?i:{default:function(){return[i]}})});return L("div",{class:n},[o])}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function ro(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 hs(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ro(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ro(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function gs(t,e){var a=e.slots,n=Ke(t),r=n.sort,o=n.data,l=W(),i=kt(r,t.defaultSort,t.onSortChange,"sort"),u=Pe(i,2),s=u[0],v=u[1],d=kt(o,[],t.onDataChange,"data"),b=Pe(d,2),p=b[0],w=b[1],y=N(function(){return O(t.columns)}),S=W(),x=N(function(){var D=s.value;return D?Pa(D)?D:[D]:[]}),R=N(function(){var D={};return x.value.forEach(function(m,h){var g=m.sortBy;D[g]=hs({index:h},m)}),D});function O(D){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=0,g=D.length;h<g;h++){var c,f=D[h];Re(f.sorter)&&(m[f.colKey]=f.sorter),(c=f.children)!==null&&c!==void 0&&c.length&&O(f.children,m)}return m}function _(D){var m=D;if(!!Object.keys(y.value).length){l.value||(l.value=p.value);var h=!m||m instanceof Array&&!m.length,g=!(m instanceof Array)&&!(m!=null&&m.sortBy);if(h||g)return w(l.value,{trigger:"sort"}),l.value;var c=m instanceof Array?m:[m],f=p.value.slice().sort(function(C,E){for(var k=0,I=0,M=c.length;I<M;I++){var $=c[I],Y=y.value[$.sortBy];if(k===0&&Y)k=$.descending?Y(E,C):Y(C,E);else break}return k});if(JSON.stringify(f)!==JSON.stringify(p.value))return w(f,{trigger:"sort"}),f}}function j(D,m){var h,g;if(t.multipleSort)g=F(D,m);else{var c=s.value instanceof Array?s.value[0]:s.value;g=T(D,c,m)}var f=_(g),C=f||p.value,E=C;v(g,{currentDataSource:E,col:D}),(h=t.onChange)===null||h===void 0||h.call(t,{sorter:g},{currentData:C,trigger:"sorter"}),S.value=g}function A(D){if(D!==void 0)return D?"desc":"asc"}function T(D,m,h){if(!(m&&m.sortBy===D.colKey&&m.descending===h.descending))return{sortBy:D.colKey,descending:h.descending}}function F(D,m){Array.isArray(s.value)||(s.value=s.value?[s.value]:[]);for(var h=s.value,g=D.colKey,c=fe(h),f=0,C=h.length;f<C;f++)if(h[f].sortBy===g){var E=T(D,h[f],m);return E?c[f]=E:c.splice(f,1),c}return c.push({sortBy:g,descending:m.descending}),c}function P(D){var m,h=D.col;if(!h.sorter)return null;var g={sortType:h.sortType,sortOrder:A((m=R.value[h.colKey])===null||m===void 0?void 0:m.descending),sortIcon:t.sortIcon,hideSortTips:t.hideSortTips,locale:t.locale};return L(fs,Ie(g,{onSortIconClick:function(f,C){return j(h,C)}}),{sortIcon:a.sortIcon})}var K=function(m,h){var g=Pa(m)?m:[m],c=Pa(h)?h:[h];if(g.length&&!h)return!1;for(var f=function(){var M=g[E],$=c.find(function(Y){return Y.sortBy===M.sortBy});return $?{v:M.descending===$.descending}:{v:!1}},C,E=0,k=g.length;E<k;E++)if(C=f(),C)return C.v};return de(function(){return[s,t.data]},function(){!s.value||!Object.keys(s.value).length||!p.value.length||K(s.value,S.value)||_(s.value)},{immediate:!0}),{renderSortIcon:P}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function oo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function aa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):oo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ps=ze({name:"TableFilterController",props:{locale:Object,column:Object,colIndex:Number,tFilterValue:Object,innerFilterValue:Object,tableFilterClasses:Object,isFocusClass:String,primaryTableElement:{},popupProps:Object,attach:[String,Function],onVisibleChange:Function},emits:["inner-filter-change","reset","confirm"],setup:function(e,a){var n=W(null),r=Un(),o=ht("table",e.locale),l=o.t,i=o.globalConfig,u=En({FilterIcon:Ai}),s=u.FilterIcon,v=W(!1),d=function(x){var R;v.value=x,(R=e.onVisibleChange)===null||R===void 0||R.call(e,x)},b=function(x,R,O){if(!O)return null;var _=!!O.setup;if(Re(x.filter.component)&&!_)return x.filter.component(function(A,T){var F=dt(T)==="object"&&"attrs"in T?T.attrs:{};return Ye(A,{props:aa(aa({},R),F)})});var j=x.filter||{};return L(O,Ie({class:j.classNames,style:j.style},j.attrs,R),null)},p=function(x){var R,O,_=["single","multiple","input"];if(x.type&&!_.includes(x.filter.type)){console.error("TDesign Table Error: column.filter.type must be the following: ".concat(JSON.stringify(_)));return}var j=e.innerFilterValue,A=j===void 0?{}:j,T={single:cu,multiple:qo,input:mi}[x.filter.type]||x.filter.component;if(!(!T&&!x.filter.component)){var F=aa(aa({options:["single","multiple"].includes(x.filter.type)?(R=x.filter)===null||R===void 0?void 0:R.list:void 0},((O=x.filter)===null||O===void 0?void 0:O.props)||{}),{},{onChange:function(K,D){var m,h;if(a.emit("inner-filter-change",K,x),(m=x.filter.props)!==null&&m!==void 0&&m.onChange){var g,c;(g=(c=x.filter.props).onChange)===null||g===void 0||g.call(c,K,D)}(h=x.filter)!==null&&h!==void 0&&(h=h.confirmEvents)!==null&&h!==void 0&&h.includes("onChange")&&(v.value=!1)}});return x.colKey&&A&&x.colKey in A&&(F.value=A==null?void 0:A[x.colKey]),x.filter.confirmEvents&&x.filter.confirmEvents.forEach(function(P){P!=="onChange"&&(F[P]=function(){a.emit("confirm",x),v.value=!1})}),L("div",{class:e.tableFilterClasses.contentInner},[b(x,F,T)])}},w=function(x){if(!!x.filter.showConfirmAndReset)return L("div",{class:e.tableFilterClasses.bottomButtons},[L(pa,{theme:"default",size:"small",onClick:function(){a.emit("reset",x),v.value=!1}},{default:function(){return[i.value.resetText]}}),L(pa,{theme:"primary",size:"small",onClick:function(){a.emit("confirm",x),v.value=!1}},{default:function(){return[i.value.confirmText]}})])},y=function(){return L("div",{class:e.tableFilterClasses.popupContent},[p(e.column),w(e.column)])};return{t:l,globalConfig:i,FilterIcon:s,filterPopupVisible:v,triggerElementRef:n,renderTNode:r,getContent:y,onFilterPopupVisibleChange:d}},render:function(){var e,a=this,n=this.column,r=this.popupProps,o=this.FilterIcon;if(!n.filter||n.filter&&!Object.keys(n.filter).length)return null;var l=this.t(this.globalConfig.filterIcon)||L(o,null,null),i=(e=this.tFilterValue)===null||e===void 0?void 0:e[n.colKey],u=dt(i)==="object"&&!ql(i),s=![null,void 0,""].includes(i)&&dt(i)!=="object";return L(hi,Ie({attach:this.attach||(this.primaryTableElement?function(){return a.primaryTableElement}:void 0),visible:this.filterPopupVisible,destroyOnClose:!0,trigger:"click",placement:"bottom-right",showArrow:!0,overlayClassName:this.tableFilterClasses.popup,onVisibleChange:function(d){return a.onFilterPopupVisibleChange(d)},class:[this.tableFilterClasses.icon,z({},this.isFocusClass,u||s)],content:this.getContent},r),{default:function(){return[L("div",{ref:"triggerElementRef"},[a.renderTNode("filterIcon",{defaultNode:l,params:{col:n,colIndex:a.colIndex}})])]}})}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function lo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ra(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):lo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function pl(t){var e=t instanceof Array&&t.length,a=dt(t)==="object"&&!(t instanceof Array),n=a&&Object.keys(t).length;return e||n||!["null","","undefined"].includes(String(t))}function bs(t){var e={};return Object.keys(t).forEach(function(a){var n=t[a];pl(n)&&(e[a]=n)}),e}function ms(t,e){var a=W(null),n=ht("table",t.locale),r=n.t,o=n.globalConfig,l=Un(),i=Ke(t),u=i.filterValue,s=i.columns,v=ot(),d=v.tableFilterClasses,b=v.isFocusClass,p=W(),w=kt(u,t.defaultFilterValue,t.onFilterChange,"filterValue"),y=Pe(w,2),S=y[0],x=y[1],R=W(S.value),O=N(function(){var c=bs(S.value||{});return!S.value||!Object.keys(c).length});de([S],function(c){var f=Pe(c,1),C=f[0];R.value=C});function _(){var c,f;if(O.value)return null;var C=L("div",{class:d.result},[L("span",null,[r(o.value.searchResultText,{result:j(),count:((c=t.pagination)===null||c===void 0?void 0:c.total)||((f=t.data)===null||f===void 0?void 0:f.length)})]),L(pa,{theme:"primary",variant:"text",onClick:K},{default:function(){return[o.value.clearFilterResultButtonText]}})]),E=l("filterRow");return t.filterRow&&!E||t.filterRow===null?null:L("div",{class:d.inner},[E||C])}function j(){var c=[],f=[];return A(t.columns,f),f.filter(function(C){return C.filter}).forEach(function(C,E){var k=S.value[C.colKey];if(C.filter.list&&!["null"].includes(String(k))){var I=k instanceof Array?k:[k],M=[];C.filter.list.forEach(function(ae){I.includes(ae.value)&&M.push(ae.label)}),k=M.join()}if(pl(k)){var $,Y,ee=Re(($=C.filter)===null||$===void 0?void 0:$.label)?C.filter.label(Ye):(Y=C.filter)===null||Y===void 0?void 0:Y.label,ne=Ea(e.slots,C,E);c.push("".concat(ee||ne,"\uFF1A").concat(k))}}),c.join("\uFF1B")}function A(c,f){c.forEach(function(C){C.children&&A(C.children,f),f.push(C)})}function T(c,f){var C=ra(ra({},R.value),{},z({},f.colKey,c));R.value=C,f.filter.showConfirmAndReset||F(C,"filter-change",f)}function F(c,f,C){var E;x(c,{col:C,trigger:f}),(E=t.onChange)===null||E===void 0||E.call(t,{filter:c},{trigger:"filter"})}function P(c){var f,C,E=ra(ra({},S.value),{},z({},c.colKey,(f=(C=c.filter.resetValue)!==null&&C!==void 0?C:{single:"",multiple:[],input:""}[c.filter.type])!==null&&f!==void 0?f:""));F(E,"reset",c)}function K(){var c=gl(s.value);F(c,"clear",void 0)}function D(c){F(R.value,"confirm",c)}function m(c){var f,C=c.col,E=c.colIndex;return L(ps,{column:C,colIndex:E,filterIcon:t.filterIcon,tFilterValue:S.value,innerFilterValue:R.value,tableFilterClasses:d,isFocusClass:b,popupProps:C.filter.popupProps,attach:t.attach,locale:t.locale,onReset:P,onConfirm:D,onInnerFilterChange:T,primaryTableElement:(f=a.value)===null||f===void 0?void 0:f.$el,onVisibleChange:g},{filterIcon:e.slots.filterIcon})}function h(c){a.value=c}function g(c){c&&!p.value&&(p.value=!c)}return{hasEmptyCondition:O,isTableOverflowHidden:p,renderFilterIcon:m,renderFirstFilterRow:_,setFilterPrimaryTableRef:h}}/**!
|
|
* Sortable 1.15.2
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
* @author owenm <owen23355@gmail.com>
|
|
* @license MIT
|
|
*/function io(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Tt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?io(Object(a),!0).forEach(function(n){ws(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):io(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function da(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?da=function(e){return typeof e}:da=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(t)}function ws(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Nt(){return Nt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},Nt.apply(this,arguments)}function ys(t,e){if(t==null)return{};var a={},n=Object.keys(t),r,o;for(o=0;o<n.length;o++)r=n[o],!(e.indexOf(r)>=0)&&(a[r]=t[r]);return a}function Cs(t,e){if(t==null)return{};var a=ys(t,e),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(a[n]=t[n]))}return a}var xs="1.15.2";function It(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Mt=It(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Gn=It(/Edge/i),uo=It(/firefox/i),Mn=It(/safari/i)&&!It(/chrome/i)&&!It(/android/i),bl=It(/iP(ad|od|hone)/i),ml=It(/chrome/i)&&It(/android/i),wl={capture:!1,passive:!1};function Oe(t,e,a){t.addEventListener(e,a,!Mt&&wl)}function Ce(t,e,a){t.removeEventListener(e,a,!Mt&&wl)}function ya(t,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ss(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function wt(t,e,a,n){if(t){a=a||document;do{if(e!=null&&(e[0]===">"?t.parentNode===a&&ya(t,e):ya(t,e))||n&&t===a)return t;if(t===a)break}while(t=Ss(t))}return null}var so=/\s+/g;function ut(t,e,a){if(t&&e)if(t.classList)t.classList[a?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(so," ").replace(" "+e+" "," ");t.className=(n+(a?" "+e:"")).replace(so," ")}}function ie(t,e,a){var n=t&&t.style;if(n){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(a=t.currentStyle),e===void 0?a:a[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=a+(typeof a=="string"?"":"px")}}function Sn(t,e){var a="";if(typeof t=="string")a=t;else do{var n=ie(t,"transform");n&&n!=="none"&&(a=n+" "+a)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(a)}function yl(t,e,a){if(t){var n=t.getElementsByTagName(e),r=0,o=n.length;if(a)for(;r<o;r++)a(n[r],r);return n}return[]}function _t(){var t=document.scrollingElement;return t||document.documentElement}function Xe(t,e,a,n,r){if(!(!t.getBoundingClientRect&&t!==window)){var o,l,i,u,s,v,d;if(t!==window&&t.parentNode&&t!==_t()?(o=t.getBoundingClientRect(),l=o.top,i=o.left,u=o.bottom,s=o.right,v=o.height,d=o.width):(l=0,i=0,u=window.innerHeight,s=window.innerWidth,v=window.innerHeight,d=window.innerWidth),(e||a)&&t!==window&&(r=r||t.parentNode,!Mt))do if(r&&r.getBoundingClientRect&&(ie(r,"transform")!=="none"||a&&ie(r,"position")!=="static")){var b=r.getBoundingClientRect();l-=b.top+parseInt(ie(r,"border-top-width")),i-=b.left+parseInt(ie(r,"border-left-width")),u=l+o.height,s=i+o.width;break}while(r=r.parentNode);if(n&&t!==window){var p=Sn(r||t),w=p&&p.a,y=p&&p.d;p&&(l/=y,i/=w,d/=w,v/=y,u=l+v,s=i+d)}return{top:l,left:i,bottom:u,right:s,width:d,height:v}}}function co(t,e,a){for(var n=Xt(t,!0),r=Xe(t)[e];n;){var o=Xe(n)[a],l=void 0;if(a==="top"||a==="left"?l=r>=o:l=r<=o,!l)return n;if(n===_t())break;n=Xt(n,!1)}return!1}function Rn(t,e,a,n){for(var r=0,o=0,l=t.children;o<l.length;){if(l[o].style.display!=="none"&&l[o]!==oe.ghost&&(n||l[o]!==oe.dragged)&&wt(l[o],a.draggable,t,!1)){if(r===e)return l[o];r++}o++}return null}function dr(t,e){for(var a=t.lastElementChild;a&&(a===oe.ghost||ie(a,"display")==="none"||e&&!ya(a,e));)a=a.previousElementSibling;return a||null}function ft(t,e){var a=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==oe.clone&&(!e||ya(t,e))&&a++;return a}function vo(t){var e=0,a=0,n=_t();if(t)do{var r=Sn(t),o=r.a,l=r.d;e+=t.scrollLeft*o,a+=t.scrollTop*l}while(t!==n&&(t=t.parentNode));return[e,a]}function Os(t,e){for(var a in t)if(!!t.hasOwnProperty(a)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===t[a][n])return Number(a)}return-1}function Xt(t,e){if(!t||!t.getBoundingClientRect)return _t();var a=t,n=!1;do if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var r=ie(a);if(a.clientWidth<a.scrollWidth&&(r.overflowX=="auto"||r.overflowX=="scroll")||a.clientHeight<a.scrollHeight&&(r.overflowY=="auto"||r.overflowY=="scroll")){if(!a.getBoundingClientRect||a===document.body)return _t();if(n||e)return a;n=!0}}while(a=a.parentNode);return _t()}function Rs(t,e){if(t&&e)for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return t}function Ka(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var Bn;function Cl(t,e){return function(){if(!Bn){var a=arguments,n=this;a.length===1?t.call(n,a[0]):t.apply(n,a),Bn=setTimeout(function(){Bn=void 0},e)}}}function Es(){clearTimeout(Bn),Bn=void 0}function xl(t,e,a){t.scrollLeft+=e,t.scrollTop+=a}function Sl(t){var e=window.Polymer,a=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):a?a(t).clone(!0)[0]:t.cloneNode(!0)}function Ol(t,e,a){var n={};return Array.from(t.children).forEach(function(r){var o,l,i,u;if(!(!wt(r,e.draggable,t,!1)||r.animated||r===a)){var s=Xe(r);n.left=Math.min((o=n.left)!==null&&o!==void 0?o:1/0,s.left),n.top=Math.min((l=n.top)!==null&&l!==void 0?l:1/0,s.top),n.right=Math.max((i=n.right)!==null&&i!==void 0?i:-1/0,s.right),n.bottom=Math.max((u=n.bottom)!==null&&u!==void 0?u:-1/0,s.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var ct="Sortable"+new Date().getTime();function Ds(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(r){if(!(ie(r,"display")==="none"||r===oe.ghost)){t.push({target:r,rect:Xe(r)});var o=Tt({},t[t.length-1].rect);if(r.thisAnimationDuration){var l=Sn(r,!0);l&&(o.top-=l.f,o.left-=l.e)}r.fromRect=o}})}},addAnimationState:function(n){t.push(n)},removeAnimationState:function(n){t.splice(Os(t,{target:n}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var o=!1,l=0;t.forEach(function(i){var u=0,s=i.target,v=s.fromRect,d=Xe(s),b=s.prevFromRect,p=s.prevToRect,w=i.rect,y=Sn(s,!0);y&&(d.top-=y.f,d.left-=y.e),s.toRect=d,s.thisAnimationDuration&&Ka(b,d)&&!Ka(v,d)&&(w.top-d.top)/(w.left-d.left)===(v.top-d.top)/(v.left-d.left)&&(u=Ts(w,b,p,r.options)),Ka(d,v)||(s.prevFromRect=v,s.prevToRect=d,u||(u=r.options.animation),r.animate(s,w,d,u)),u&&(o=!0,l=Math.max(l,u),clearTimeout(s.animationResetTimer),s.animationResetTimer=setTimeout(function(){s.animationTime=0,s.prevFromRect=null,s.fromRect=null,s.prevToRect=null,s.thisAnimationDuration=null},u),s.thisAnimationDuration=u)}),clearTimeout(e),o?e=setTimeout(function(){typeof n=="function"&&n()},l):typeof n=="function"&&n(),t=[]},animate:function(n,r,o,l){if(l){ie(n,"transition",""),ie(n,"transform","");var i=Sn(this.el),u=i&&i.a,s=i&&i.d,v=(r.left-o.left)/(u||1),d=(r.top-o.top)/(s||1);n.animatingX=!!v,n.animatingY=!!d,ie(n,"transform","translate3d("+v+"px,"+d+"px,0)"),this.forRepaintDummy=_s(n),ie(n,"transition","transform "+l+"ms"+(this.options.easing?" "+this.options.easing:"")),ie(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ie(n,"transition",""),ie(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},l)}}}}function _s(t){return t.offsetWidth}function Ts(t,e,a,n){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-a.top,2)+Math.pow(e.left-a.left,2))*n.animation}var gn=[],La={initializeByDefault:!0},Yn={mount:function(e){for(var a in La)La.hasOwnProperty(a)&&!(a in e)&&(e[a]=La[a]);gn.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),gn.push(e)},pluginEvent:function(e,a,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=e+"Global";gn.forEach(function(l){!a[l.pluginName]||(a[l.pluginName][o]&&a[l.pluginName][o](Tt({sortable:a},n)),a.options[l.pluginName]&&a[l.pluginName][e]&&a[l.pluginName][e](Tt({sortable:a},n)))})},initializePlugins:function(e,a,n,r){gn.forEach(function(i){var u=i.pluginName;if(!(!e.options[u]&&!i.initializeByDefault)){var s=new i(e,a,e.options);s.sortable=e,s.options=e.options,e[u]=s,Nt(n,s.defaults)}});for(var o in e.options)if(!!e.options.hasOwnProperty(o)){var l=this.modifyOption(e,o,e.options[o]);typeof l<"u"&&(e.options[o]=l)}},getEventProperties:function(e,a){var n={};return gn.forEach(function(r){typeof r.eventProperties=="function"&&Nt(n,r.eventProperties.call(a[r.pluginName],e))}),n},modifyOption:function(e,a,n){var r;return gn.forEach(function(o){!e[o.pluginName]||o.optionListeners&&typeof o.optionListeners[a]=="function"&&(r=o.optionListeners[a].call(e[o.pluginName],n))}),r}};function Ps(t){var e=t.sortable,a=t.rootEl,n=t.name,r=t.targetEl,o=t.cloneEl,l=t.toEl,i=t.fromEl,u=t.oldIndex,s=t.newIndex,v=t.oldDraggableIndex,d=t.newDraggableIndex,b=t.originalEvent,p=t.putSortable,w=t.extraEventProperties;if(e=e||a&&a[ct],!!e){var y,S=e.options,x="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!Mt&&!Gn?y=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(n,!0,!0)),y.to=l||a,y.from=i||a,y.item=r||a,y.clone=o,y.oldIndex=u,y.newIndex=s,y.oldDraggableIndex=v,y.newDraggableIndex=d,y.originalEvent=b,y.pullMode=p?p.lastPutMode:void 0;var R=Tt(Tt({},w),Yn.getEventProperties(n,e));for(var O in R)y[O]=R[O];a&&a.dispatchEvent(y),S[x]&&S[x].call(e,y)}}var As=["evt"],at=function(e,a){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,o=Cs(n,As);Yn.pluginEvent.bind(oe)(e,a,Tt({dragEl:U,parentEl:$e,ghostEl:ce,rootEl:ke,nextEl:ln,lastDownEl:va,cloneEl:Me,cloneHidden:Ut,dragStarted:In,putSortable:Ze,activeSortable:oe.active,originalEvent:r,oldIndex:yn,oldDraggableIndex:zn,newIndex:st,newDraggableIndex:Vt,hideGhostForTarget:_l,unhideGhostForTarget:Tl,cloneNowHidden:function(){Ut=!0},cloneNowShown:function(){Ut=!1},dispatchSortableEvent:function(i){et({sortable:a,name:i,originalEvent:r})}},o))};function et(t){Ps(Tt({putSortable:Ze,cloneEl:Me,targetEl:U,rootEl:ke,oldIndex:yn,oldDraggableIndex:zn,newIndex:st,newDraggableIndex:Vt},t))}var U,$e,ce,ke,ln,va,Me,Ut,yn,st,zn,Vt,oa,Ze,mn=!1,Ca=!1,xa=[],an,mt,ka,Na,fo,ho,In,pn,Hn,Wn=!1,la=!1,fa,Qe,Ma=[],Za=!1,Sa=[],Da=typeof document<"u",ia=bl,go=Gn||Mt?"cssFloat":"float",js=Da&&!ml&&!bl&&"draggable"in document.createElement("div"),Rl=function(){if(!!Da){if(Mt)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),El=function(e,a){var n=ie(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Rn(e,0,a),l=Rn(e,1,a),i=o&&ie(o),u=l&&ie(l),s=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+Xe(o).width,v=u&&parseInt(u.marginLeft)+parseInt(u.marginRight)+Xe(l).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&i.float&&i.float!=="none"){var d=i.float==="left"?"left":"right";return l&&(u.clear==="both"||u.clear===d)?"vertical":"horizontal"}return o&&(i.display==="block"||i.display==="flex"||i.display==="table"||i.display==="grid"||s>=r&&n[go]==="none"||l&&n[go]==="none"&&s+v>r)?"vertical":"horizontal"},Fs=function(e,a,n){var r=n?e.left:e.top,o=n?e.right:e.bottom,l=n?e.width:e.height,i=n?a.left:a.top,u=n?a.right:a.bottom,s=n?a.width:a.height;return r===i||o===u||r+l/2===i+s/2},Is=function(e,a){var n;return xa.some(function(r){var o=r[ct].options.emptyInsertThreshold;if(!(!o||dr(r))){var l=Xe(r),i=e>=l.left-o&&e<=l.right+o,u=a>=l.top-o&&a<=l.bottom+o;if(i&&u)return n=r}}),n},Dl=function(e){function a(o,l){return function(i,u,s,v){var d=i.options.group.name&&u.options.group.name&&i.options.group.name===u.options.group.name;if(o==null&&(l||d))return!0;if(o==null||o===!1)return!1;if(l&&o==="clone")return o;if(typeof o=="function")return a(o(i,u,s,v),l)(i,u,s,v);var b=(l?i:u).options.group.name;return o===!0||typeof o=="string"&&o===b||o.join&&o.indexOf(b)>-1}}var n={},r=e.group;(!r||da(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=a(r.pull,!0),n.checkPut=a(r.put),n.revertClone=r.revertClone,e.group=n},_l=function(){!Rl&&ce&&ie(ce,"display","none")},Tl=function(){!Rl&&ce&&ie(ce,"display","")};Da&&!ml&&document.addEventListener("click",function(t){if(Ca)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ca=!1,!1},!0);var rn=function(e){if(U){e=e.touches?e.touches[0]:e;var a=Is(e.clientX,e.clientY);if(a){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=a,n.preventDefault=void 0,n.stopPropagation=void 0,a[ct]._onDragOver(n)}}},Ks=function(e){U&&U.parentNode[ct]._isOutsideThisEl(e.target)};function oe(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Nt({},e),t[ct]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return El(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(l,i){l.setData("Text",i.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:oe.supportPointer!==!1&&"PointerEvent"in window&&!Mn,emptyInsertThreshold:5};Yn.initializePlugins(this,t,a);for(var n in a)!(n in e)&&(e[n]=a[n]);Dl(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:js,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Oe(t,"pointerdown",this._onTapStart):(Oe(t,"mousedown",this._onTapStart),Oe(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(t,"dragover",this),Oe(t,"dragenter",this)),xa.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Nt(this,Ds())}oe.prototype={constructor:oe,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(pn=null)},_getDirection:function(e,a){return typeof this.options.direction=="function"?this.options.direction.call(this,e,a,U):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var a=this,n=this.el,r=this.options,o=r.preventOnFilter,l=e.type,i=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,u=(i||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||u,v=r.filter;if(Ws(n),!U&&!(/mousedown|pointerdown/.test(l)&&e.button!==0||r.disabled)&&!s.isContentEditable&&!(!this.nativeDraggable&&Mn&&u&&u.tagName.toUpperCase()==="SELECT")&&(u=wt(u,r.draggable,n,!1),!(u&&u.animated)&&va!==u)){if(yn=ft(u),zn=ft(u,r.draggable),typeof v=="function"){if(v.call(this,e,u,this)){et({sortable:a,rootEl:s,name:"filter",targetEl:u,toEl:n,fromEl:n}),at("filter",a,{evt:e}),o&&e.cancelable&&e.preventDefault();return}}else if(v&&(v=v.split(",").some(function(d){if(d=wt(s,d.trim(),n,!1),d)return et({sortable:a,rootEl:d,name:"filter",targetEl:u,fromEl:n,toEl:n}),at("filter",a,{evt:e}),!0}),v)){o&&e.cancelable&&e.preventDefault();return}r.handle&&!wt(s,r.handle,n,!1)||this._prepareDragStart(e,i,u)}}},_prepareDragStart:function(e,a,n){var r=this,o=r.el,l=r.options,i=o.ownerDocument,u;if(n&&!U&&n.parentNode===o){var s=Xe(n);if(ke=o,U=n,$e=U.parentNode,ln=U.nextSibling,va=n,oa=l.group,oe.dragged=U,an={target:U,clientX:(a||e).clientX,clientY:(a||e).clientY},fo=an.clientX-s.left,ho=an.clientY-s.top,this._lastX=(a||e).clientX,this._lastY=(a||e).clientY,U.style["will-change"]="all",u=function(){if(at("delayEnded",r,{evt:e}),oe.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!uo&&r.nativeDraggable&&(U.draggable=!0),r._triggerDragStart(e,a),et({sortable:r,name:"choose",originalEvent:e}),ut(U,l.chosenClass,!0)},l.ignore.split(",").forEach(function(v){yl(U,v.trim(),Ba)}),Oe(i,"dragover",rn),Oe(i,"mousemove",rn),Oe(i,"touchmove",rn),Oe(i,"mouseup",r._onDrop),Oe(i,"touchend",r._onDrop),Oe(i,"touchcancel",r._onDrop),uo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),at("delayStart",this,{evt:e}),l.delay&&(!l.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(Gn||Mt))){if(oe.eventCanceled){this._onDrop();return}Oe(i,"mouseup",r._disableDelayedDrag),Oe(i,"touchend",r._disableDelayedDrag),Oe(i,"touchcancel",r._disableDelayedDrag),Oe(i,"mousemove",r._delayedDragTouchMoveHandler),Oe(i,"touchmove",r._delayedDragTouchMoveHandler),l.supportPointer&&Oe(i,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(u,l.delay)}else u()}},_delayedDragTouchMoveHandler:function(e){var a=e.touches?e.touches[0]:e;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&Ba(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._disableDelayedDrag),Ce(e,"touchend",this._disableDelayedDrag),Ce(e,"touchcancel",this._disableDelayedDrag),Ce(e,"mousemove",this._delayedDragTouchMoveHandler),Ce(e,"touchmove",this._delayedDragTouchMoveHandler),Ce(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,a){a=a||e.pointerType=="touch"&&e,!this.nativeDraggable||a?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):a?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(U,"dragend",this),Oe(ke,"dragstart",this._onDragStart));try{document.selection?ha(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,a){if(mn=!1,ke&&U){at("dragStarted",this,{evt:a}),this.nativeDraggable&&Oe(document,"dragover",Ks);var n=this.options;!e&&ut(U,n.dragClass,!1),ut(U,n.ghostClass,!0),oe.active=this,e&&this._appendGhost(),et({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(mt){this._lastX=mt.clientX,this._lastY=mt.clientY,_l();for(var e=document.elementFromPoint(mt.clientX,mt.clientY),a=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(mt.clientX,mt.clientY),e!==a);)a=e;if(U.parentNode[ct]._isOutsideThisEl(e),a)do{if(a[ct]){var n=void 0;if(n=a[ct]._onDragOver({clientX:mt.clientX,clientY:mt.clientY,target:e,rootEl:a}),n&&!this.options.dragoverBubble)break}e=a}while(a=a.parentNode);Tl()}},_onTouchMove:function(e){if(an){var a=this.options,n=a.fallbackTolerance,r=a.fallbackOffset,o=e.touches?e.touches[0]:e,l=ce&&Sn(ce,!0),i=ce&&l&&l.a,u=ce&&l&&l.d,s=ia&&Qe&&vo(Qe),v=(o.clientX-an.clientX+r.x)/(i||1)+(s?s[0]-Ma[0]:0)/(i||1),d=(o.clientY-an.clientY+r.y)/(u||1)+(s?s[1]-Ma[1]:0)/(u||1);if(!oe.active&&!mn){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ce){l?(l.e+=v-(ka||0),l.f+=d-(Na||0)):l={a:1,b:0,c:0,d:1,e:v,f:d};var b="matrix(".concat(l.a,",").concat(l.b,",").concat(l.c,",").concat(l.d,",").concat(l.e,",").concat(l.f,")");ie(ce,"webkitTransform",b),ie(ce,"mozTransform",b),ie(ce,"msTransform",b),ie(ce,"transform",b),ka=v,Na=d,mt=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ce){var e=this.options.fallbackOnBody?document.body:ke,a=Xe(U,!0,ia,!0,e),n=this.options;if(ia){for(Qe=e;ie(Qe,"position")==="static"&&ie(Qe,"transform")==="none"&&Qe!==document;)Qe=Qe.parentNode;Qe!==document.body&&Qe!==document.documentElement?(Qe===document&&(Qe=_t()),a.top+=Qe.scrollTop,a.left+=Qe.scrollLeft):Qe=_t(),Ma=vo(Qe)}ce=U.cloneNode(!0),ut(ce,n.ghostClass,!1),ut(ce,n.fallbackClass,!0),ut(ce,n.dragClass,!0),ie(ce,"transition",""),ie(ce,"transform",""),ie(ce,"box-sizing","border-box"),ie(ce,"margin",0),ie(ce,"top",a.top),ie(ce,"left",a.left),ie(ce,"width",a.width),ie(ce,"height",a.height),ie(ce,"opacity","0.8"),ie(ce,"position",ia?"absolute":"fixed"),ie(ce,"zIndex","100000"),ie(ce,"pointerEvents","none"),oe.ghost=ce,e.appendChild(ce),ie(ce,"transform-origin",fo/parseInt(ce.style.width)*100+"% "+ho/parseInt(ce.style.height)*100+"%")}},_onDragStart:function(e,a){var n=this,r=e.dataTransfer,o=n.options;if(at("dragStart",this,{evt:e}),oe.eventCanceled){this._onDrop();return}at("setupClone",this),oe.eventCanceled||(Me=Sl(U),Me.removeAttribute("id"),Me.draggable=!1,Me.style["will-change"]="",this._hideClone(),ut(Me,this.options.chosenClass,!1),oe.clone=Me),n.cloneId=ha(function(){at("clone",n),!oe.eventCanceled&&(n.options.removeCloneOnHide||ke.insertBefore(Me,U),n._hideClone(),et({sortable:n,name:"clone"}))}),!a&&ut(U,o.dragClass,!0),a?(Ca=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Ce(document,"mouseup",n._onDrop),Ce(document,"touchend",n._onDrop),Ce(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,U)),Oe(document,"drop",n),ie(U,"transform","translateZ(0)")),mn=!0,n._dragStartId=ha(n._dragStarted.bind(n,a,e)),Oe(document,"selectstart",n),In=!0,Mn&&ie(document.body,"user-select","none")},_onDragOver:function(e){var a=this.el,n=e.target,r,o,l,i=this.options,u=i.group,s=oe.active,v=oa===u,d=i.sort,b=Ze||s,p,w=this,y=!1;if(Za)return;function S(E,k){at(E,w,Tt({evt:e,isOwner:v,axis:p?"vertical":"horizontal",revert:l,dragRect:r,targetRect:o,canSort:d,fromSortable:b,target:n,completed:R,onMove:function(M,$){return ua(ke,a,U,r,M,Xe(M),e,$)},changed:O},k))}function x(){S("dragOverAnimationCapture"),w.captureAnimationState(),w!==b&&b.captureAnimationState()}function R(E){return S("dragOverCompleted",{insertion:E}),E&&(v?s._hideClone():s._showClone(w),w!==b&&(ut(U,Ze?Ze.options.ghostClass:s.options.ghostClass,!1),ut(U,i.ghostClass,!0)),Ze!==w&&w!==oe.active?Ze=w:w===oe.active&&Ze&&(Ze=null),b===w&&(w._ignoreWhileAnimating=n),w.animateAll(function(){S("dragOverAnimationComplete"),w._ignoreWhileAnimating=null}),w!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(n===U&&!U.animated||n===a&&!n.animated)&&(pn=null),!i.dragoverBubble&&!e.rootEl&&n!==document&&(U.parentNode[ct]._isOutsideThisEl(e.target),!E&&rn(e)),!i.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),y=!0}function O(){st=ft(U),Vt=ft(U,i.draggable),et({sortable:w,name:"change",toEl:a,newIndex:st,newDraggableIndex:Vt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=wt(n,i.draggable,a,!0),S("dragOver"),oe.eventCanceled)return y;if(U.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||w._ignoreWhileAnimating===n)return R(!1);if(Ca=!1,s&&!i.disabled&&(v?d||(l=$e!==ke):Ze===this||(this.lastPutMode=oa.checkPull(this,s,U,e))&&u.checkPut(this,s,U,e))){if(p=this._getDirection(e,n)==="vertical",r=Xe(U),S("dragOverValid"),oe.eventCanceled)return y;if(l)return $e=ke,x(),this._hideClone(),S("revert"),oe.eventCanceled||(ln?ke.insertBefore(U,ln):ke.appendChild(U)),R(!0);var _=dr(a,i.draggable);if(!_||Ms(e,p,this)&&!_.animated){if(_===U)return R(!1);if(_&&a===e.target&&(n=_),n&&(o=Xe(n)),ua(ke,a,U,r,n,o,e,!!n)!==!1)return x(),_&&_.nextSibling?a.insertBefore(U,_.nextSibling):a.appendChild(U),$e=a,O(),R(!0)}else if(_&&Ns(e,p,this)){var j=Rn(a,0,i,!0);if(j===U)return R(!1);if(n=j,o=Xe(n),ua(ke,a,U,r,n,o,e,!1)!==!1)return x(),a.insertBefore(U,j),$e=a,O(),R(!0)}else if(n.parentNode===a){o=Xe(n);var A=0,T,F=U.parentNode!==a,P=!Fs(U.animated&&U.toRect||r,n.animated&&n.toRect||o,p),K=p?"top":"left",D=co(n,"top","top")||co(U,"top","top"),m=D?D.scrollTop:void 0;pn!==n&&(T=o[K],Wn=!1,la=!P&&i.invertSwap||F),A=Bs(e,n,o,p,P?1:i.swapThreshold,i.invertedSwapThreshold==null?i.swapThreshold:i.invertedSwapThreshold,la,pn===n);var h;if(A!==0){var g=ft(U);do g-=A,h=$e.children[g];while(h&&(ie(h,"display")==="none"||h===ce))}if(A===0||h===n)return R(!1);pn=n,Hn=A;var c=n.nextElementSibling,f=!1;f=A===1;var C=ua(ke,a,U,r,n,o,e,f);if(C!==!1)return(C===1||C===-1)&&(f=C===1),Za=!0,setTimeout(ks,30),x(),f&&!c?a.appendChild(U):n.parentNode.insertBefore(U,f?c:n),D&&xl(D,0,m-D.scrollTop),$e=U.parentNode,T!==void 0&&!la&&(fa=Math.abs(T-Xe(n)[K])),O(),R(!0)}if(a.contains(U))return R(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ce(document,"mousemove",this._onTouchMove),Ce(document,"touchmove",this._onTouchMove),Ce(document,"pointermove",this._onTouchMove),Ce(document,"dragover",rn),Ce(document,"mousemove",rn),Ce(document,"touchmove",rn)},_offUpEvents:function(){var e=this.el.ownerDocument;Ce(e,"mouseup",this._onDrop),Ce(e,"touchend",this._onDrop),Ce(e,"pointerup",this._onDrop),Ce(e,"touchcancel",this._onDrop),Ce(document,"selectstart",this)},_onDrop:function(e){var a=this.el,n=this.options;if(st=ft(U),Vt=ft(U,n.draggable),at("drop",this,{evt:e}),$e=U&&U.parentNode,st=ft(U),Vt=ft(U,n.draggable),oe.eventCanceled){this._nulling();return}mn=!1,la=!1,Wn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Qa(this.cloneId),Qa(this._dragStartId),this.nativeDraggable&&(Ce(document,"drop",this),Ce(a,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Mn&&ie(document.body,"user-select",""),ie(U,"transform",""),e&&(In&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ce&&ce.parentNode&&ce.parentNode.removeChild(ce),(ke===$e||Ze&&Ze.lastPutMode!=="clone")&&Me&&Me.parentNode&&Me.parentNode.removeChild(Me),U&&(this.nativeDraggable&&Ce(U,"dragend",this),Ba(U),U.style["will-change"]="",In&&!mn&&ut(U,Ze?Ze.options.ghostClass:this.options.ghostClass,!1),ut(U,this.options.chosenClass,!1),et({sortable:this,name:"unchoose",toEl:$e,newIndex:null,newDraggableIndex:null,originalEvent:e}),ke!==$e?(st>=0&&(et({rootEl:$e,name:"add",toEl:$e,fromEl:ke,originalEvent:e}),et({sortable:this,name:"remove",toEl:$e,originalEvent:e}),et({rootEl:$e,name:"sort",toEl:$e,fromEl:ke,originalEvent:e}),et({sortable:this,name:"sort",toEl:$e,originalEvent:e})),Ze&&Ze.save()):st!==yn&&st>=0&&(et({sortable:this,name:"update",toEl:$e,originalEvent:e}),et({sortable:this,name:"sort",toEl:$e,originalEvent:e})),oe.active&&((st==null||st===-1)&&(st=yn,Vt=zn),et({sortable:this,name:"end",toEl:$e,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),ke=U=$e=ce=ln=Me=va=Ut=an=mt=In=st=Vt=yn=zn=pn=Hn=Ze=oa=oe.dragged=oe.ghost=oe.clone=oe.active=null,Sa.forEach(function(e){e.checked=!0}),Sa.length=ka=Na=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":U&&(this._onDragOver(e),Ls(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],a,n=this.el.children,r=0,o=n.length,l=this.options;r<o;r++)a=n[r],wt(a,l.draggable,this.el,!1)&&e.push(a.getAttribute(l.dataIdAttr)||Hs(a));return e},sort:function(e,a){var n={},r=this.el;this.toArray().forEach(function(o,l){var i=r.children[l];wt(i,this.options.draggable,r,!1)&&(n[o]=i)},this),a&&this.captureAnimationState(),e.forEach(function(o){n[o]&&(r.removeChild(n[o]),r.appendChild(n[o]))}),a&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,a){return wt(e,a||this.options.draggable,this.el,!1)},option:function(e,a){var n=this.options;if(a===void 0)return n[e];var r=Yn.modifyOption(this,e,a);typeof r<"u"?n[e]=r:n[e]=a,e==="group"&&Dl(n)},destroy:function(){at("destroy",this);var e=this.el;e[ct]=null,Ce(e,"mousedown",this._onTapStart),Ce(e,"touchstart",this._onTapStart),Ce(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ce(e,"dragover",this),Ce(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),xa.splice(xa.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ut){if(at("hideClone",this),oe.eventCanceled)return;ie(Me,"display","none"),this.options.removeCloneOnHide&&Me.parentNode&&Me.parentNode.removeChild(Me),Ut=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Ut){if(at("showClone",this),oe.eventCanceled)return;U.parentNode==ke&&!this.options.group.revertClone?ke.insertBefore(Me,U):ln?ke.insertBefore(Me,ln):ke.appendChild(Me),this.options.group.revertClone&&this.animate(U,Me),ie(Me,"display",""),Ut=!1}}};function Ls(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function ua(t,e,a,n,r,o,l,i){var u,s=t[ct],v=s.options.onMove,d;return window.CustomEvent&&!Mt&&!Gn?u=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent("move",!0,!0)),u.to=e,u.from=t,u.dragged=a,u.draggedRect=n,u.related=r||e,u.relatedRect=o||Xe(e),u.willInsertAfter=i,u.originalEvent=l,t.dispatchEvent(u),v&&(d=v.call(s,u,l)),d}function Ba(t){t.draggable=!1}function ks(){Za=!1}function Ns(t,e,a){var n=Xe(Rn(a.el,0,a.options,!0)),r=Ol(a.el,a.options,ce),o=10;return e?t.clientX<r.left-o||t.clientY<n.top&&t.clientX<n.right:t.clientY<r.top-o||t.clientY<n.bottom&&t.clientX<n.left}function Ms(t,e,a){var n=Xe(dr(a.el,a.options.draggable)),r=Ol(a.el,a.options,ce),o=10;return e?t.clientX>r.right+o||t.clientY>n.bottom&&t.clientX>n.left:t.clientY>r.bottom+o||t.clientX>n.right&&t.clientY>n.top}function Bs(t,e,a,n,r,o,l,i){var u=n?t.clientY:t.clientX,s=n?a.height:a.width,v=n?a.top:a.left,d=n?a.bottom:a.right,b=!1;if(!l){if(i&&fa<s*r){if(!Wn&&(Hn===1?u>v+s*o/2:u<d-s*o/2)&&(Wn=!0),Wn)b=!0;else if(Hn===1?u<v+fa:u>d-fa)return-Hn}else if(u>v+s*(1-r)/2&&u<d-s*(1-r)/2)return zs(e)}return b=b||l,b&&(u<v+s*o/2||u>d-s*o/2)?u>v+s/2?1:-1:0}function zs(t){return ft(U)<ft(t)?1:-1}function Hs(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,a=e.length,n=0;a--;)n+=e.charCodeAt(a);return n.toString(36)}function Ws(t){Sa.length=0;for(var e=t.getElementsByTagName("input"),a=e.length;a--;){var n=e[a];n.checked&&Sa.push(n)}}function ha(t){return setTimeout(t,0)}function Qa(t){return clearTimeout(t)}Da&&Oe(document,"touchmove",function(t){(oe.active||mn)&&t.cancelable&&t.preventDefault()});oe.utils={on:Oe,off:Ce,css:ie,find:yl,is:function(e,a){return!!wt(e,a,e,!1)},extend:Rs,throttle:Cl,closest:wt,toggleClass:ut,clone:Sl,index:ft,nextTick:ha,cancelNextTick:Qa,detectDirection:El,getChild:Rn};oe.get=function(t){return t[ct]};oe.mount=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(oe.utils=Tt(Tt({},oe.utils),n.utils)),Yn.mount(n)})};oe.create=function(t,e){return new oe(t,e)};oe.version=xs;var Ue=[],Kn,er,tr=!1,za,Ha,Oa,Ln;function $s(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(a){var n=a.originalEvent;this.sortable.nativeDraggable?Oe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Oe(document,"pointermove",this._handleFallbackAutoScroll):n.touches?Oe(document,"touchmove",this._handleFallbackAutoScroll):Oe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(a){var n=a.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?Ce(document,"dragover",this._handleAutoScroll):(Ce(document,"pointermove",this._handleFallbackAutoScroll),Ce(document,"touchmove",this._handleFallbackAutoScroll),Ce(document,"mousemove",this._handleFallbackAutoScroll)),po(),ga(),Es()},nulling:function(){Oa=er=Kn=tr=Ln=za=Ha=null,Ue.length=0},_handleFallbackAutoScroll:function(a){this._handleAutoScroll(a,!0)},_handleAutoScroll:function(a,n){var r=this,o=(a.touches?a.touches[0]:a).clientX,l=(a.touches?a.touches[0]:a).clientY,i=document.elementFromPoint(o,l);if(Oa=a,n||this.options.forceAutoScrollFallback||Gn||Mt||Mn){Wa(a,this.options,i,n);var u=Xt(i,!0);tr&&(!Ln||o!==za||l!==Ha)&&(Ln&&po(),Ln=setInterval(function(){var s=Xt(document.elementFromPoint(o,l),!0);s!==u&&(u=s,ga()),Wa(a,r.options,s,n)},10),za=o,Ha=l)}else{if(!this.options.bubbleScroll||Xt(i,!0)===_t()){ga();return}Wa(a,this.options,Xt(i,!1),!1)}}},Nt(t,{pluginName:"scroll",initializeByDefault:!0})}function ga(){Ue.forEach(function(t){clearInterval(t.pid)}),Ue=[]}function po(){clearInterval(Ln)}var Wa=Cl(function(t,e,a,n){if(!!e.scroll){var r=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,i=e.scrollSpeed,u=_t(),s=!1,v;er!==a&&(er=a,ga(),Kn=e.scroll,v=e.scrollFn,Kn===!0&&(Kn=Xt(a,!0)));var d=0,b=Kn;do{var p=b,w=Xe(p),y=w.top,S=w.bottom,x=w.left,R=w.right,O=w.width,_=w.height,j=void 0,A=void 0,T=p.scrollWidth,F=p.scrollHeight,P=ie(p),K=p.scrollLeft,D=p.scrollTop;p===u?(j=O<T&&(P.overflowX==="auto"||P.overflowX==="scroll"||P.overflowX==="visible"),A=_<F&&(P.overflowY==="auto"||P.overflowY==="scroll"||P.overflowY==="visible")):(j=O<T&&(P.overflowX==="auto"||P.overflowX==="scroll"),A=_<F&&(P.overflowY==="auto"||P.overflowY==="scroll"));var m=j&&(Math.abs(R-r)<=l&&K+O<T)-(Math.abs(x-r)<=l&&!!K),h=A&&(Math.abs(S-o)<=l&&D+_<F)-(Math.abs(y-o)<=l&&!!D);if(!Ue[d])for(var g=0;g<=d;g++)Ue[g]||(Ue[g]={});(Ue[d].vx!=m||Ue[d].vy!=h||Ue[d].el!==p)&&(Ue[d].el=p,Ue[d].vx=m,Ue[d].vy=h,clearInterval(Ue[d].pid),(m!=0||h!=0)&&(s=!0,Ue[d].pid=setInterval(function(){n&&this.layer===0&&oe.active._onTouchMove(Oa);var c=Ue[this.layer].vy?Ue[this.layer].vy*i:0,f=Ue[this.layer].vx?Ue[this.layer].vx*i:0;typeof v=="function"&&v.call(oe.dragged.parentNode[ct],f,c,t,Oa,Ue[this.layer].el)!=="continue"||xl(Ue[this.layer].el,f,c)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&b!==u&&(b=Xt(b,!1)));tr=s}},30),Pl=function(e){var a=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.activeSortable,l=e.dispatchSortableEvent,i=e.hideGhostForTarget,u=e.unhideGhostForTarget;if(!!a){var s=n||o;i();var v=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,d=document.elementFromPoint(v.clientX,v.clientY);u(),s&&!s.el.contains(d)&&(l("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function vr(){}vr.prototype={startIndex:null,dragStart:function(e){var a=e.oldDraggableIndex;this.startIndex=a},onSpill:function(e){var a=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Rn(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(a,r):this.sortable.el.appendChild(a),this.sortable.animateAll(),n&&n.animateAll()},drop:Pl};Nt(vr,{pluginName:"revertOnSpill"});function fr(){}fr.prototype={onSpill:function(e){var a=e.dragEl,n=e.putSortable,r=n||this.sortable;r.captureAnimationState(),a.parentNode&&a.parentNode.removeChild(a),r.animateAll()},drop:Pl};Nt(fr,{pluginName:"removeOnSpill"});oe.mount(new $s);oe.mount(fr,vr);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function bo(t,e,a){var n=fe(t);return a-e>0?(n.splice(a+1,0,n[e]),n.splice(e,1)):(n.splice(a,0,n[e]),n.splice(e+1,1)),n}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function mo(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 jn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):mo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function wo(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function yo(t,e,a){var n=a===0?t.children[0]:t.children[a-1].nextSibling;t.insertBefore(e,n)}function Vs(t,e,a){var n=Ke(t),r=n.sortOnRowDraggable,o=n.dragSort,l=n.data,i=W(t.pagination),u=ot(),s=u.tableDraggableClasses,v=u.tableBaseClass,d=u.tableFullRowClasses,b=u.tableExpandClasses,p=W(t.columns||[]),w=W(null),y=N(function(){return p.value.find(function(K){return K.colKey==="drag"})}),S=N(function(){return r.value||["row","row-handler-col"].includes(o.value)}),x=N(function(){return["row-handler","row-handler-col"].includes(o.value)&&!!y.value}),R=N(function(){return["col","row-handler-col"].includes(o.value)});t.sortOnRowDraggable&&Be.error("Table","`sortOnRowDraggable` is going to be deprecated, use dragSort='row' instead.");function O(K,D){var m,h,g=(m=D.current)!==null&&m!==void 0?m:D.defaultCurrent,c=(h=D.pageSize)!==null&&h!==void 0?h:D.defaultPageSize;return!t.disableDataPage&&D&&l.value.length>c?c*(g-1)+K:K}var _=function(D){if(!(!x.value&&!S.value)){var m=D==null?void 0:D.querySelector("tbody");if(!m)return console.error("tbody does not exist."),null;var h=jn({animation:150,ghostClass:s.ghost,chosenClass:s.chosen,dragClass:s.dragging,filter:".".concat(d.base,",.").concat(b.row),onMove:function(c){return!Jl(c.related,d.base)},onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){wo(c.item),yo(c.from,c.item,c.oldIndex);var C=c.oldIndex,E=c.newIndex;(Re(t.firstFullRow)&&t.firstFullRow(Ye)||e.slots.firstFullRow||e.slots["first-full-row"])&&(C-=1,E-=1),i.value&&(C=O(C,i.value),E=O(E,i.value));var k={data:l.value,currentIndex:C,current:l.value[C],targetIndex:E,target:l.value[E],newData:bo(fe(t.data),C,E),e:c,sort:"row"};k.currentData=k.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,k)}}},t.dragSortOptions);!m||(S.value?new oe(m,jn({},h)):new oe(m,jn(jn({},h),{},{handle:".".concat(s.handle)})))}},j=function(D,m){var h=jn({animation:150,dataIdAttr:"data-colkey",direction:"vertical",ghostClass:s.ghost,chosenClass:s.chosen,dragClass:s.dragging,handle:".".concat(v.thCellInner),onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){m&&(wo(c.item),yo(c.from,c.item,c.oldIndex));var C=c.oldIndex,E=c.newIndex,k=c.target,I=m?C:E,M=m?E:C,$=k.children[I],Y=k.children[M],ee=wa(p.value,$.dataset.colkey),ne=wa(p.value,Y.dataset.colkey);(!ee||!ee.colKey)&&Be.error("Table","colKey is missing in ".concat(JSON.stringify(ee))),(!ne||!ne.colKey)&&Be.error("Table","colKey is missing in ".concat(JSON.stringify(ne))),I=no(t.columns,ee.colKey),M=no(t.columns,ne.colKey);var ae={data:p.value,currentIndex:I,current:ee,targetIndex:M,target:ne,newData:bo(fe(t.columns),I,M),e:c,sort:"col"};ae.currentData=ae.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,ae)}}},t.dragSortOptions);!D||new oe(D,h)},A=function(D){if(!(!R.value||!D)){var m=D.querySelectorAll("thead > tr");if(m.length<=1){var h=Pe(m,1),g=h[0];j(g,!0)}else m==null||m.forEach(function(c){j(c,!1)})}};function T(K){w.value=K}function F(K){p.value=K}de([w,p,o,a],function(K){var D=Pe(K,4),m=D[0];D[1],D[2];var h=D[3];P(m,h)});function P(K,D){var m=K;if(!(!K||!m.$el||!D.showElement))var h=setTimeout(function(){_(m.$el),A(m.$el);var g=setTimeout(function(){m.$refs.affixHeaderRef&&A(m.$refs.affixHeaderRef),clearTimeout(g)});clearTimeout(h)},60)}return{innerPagination:i,isRowDraggable:S,isRowHandlerDraggable:x,isColDraggable:R,setDragSortPrimaryTableRef:T,setDragSortColumns:F}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Us(t){var e=Yt(),a=ht("table",t.locale),n=a.globalConfig,r=ot(),o=r.isLoadingClass,l=r.isLoadMoreClass,i=r.asyncLoadingClass,u=N(function(){return[i,z(z({},o,t.asyncLoading==="loading"),l,t.asyncLoading==="load-more")]});function s(){var d;!Lt(t.asyncLoading)||(d=t.onAsyncLoadingClick)===null||d===void 0||d.call(t,{status:t.asyncLoading})}function v(){var d=e("asyncLoading");if(Lt(d)){var b=t.asyncLoading,p={"load-more":n.value.loadingMoreText,loading:n.value.loadingText}[String(b)];return L("div",{class:u.value,onClick:s},[L(Lo,{indicator:b==="loading",loading:!!b,size:"small",text:p},null)])}return[null,!1,void 0].includes(d)?null:L("div",{class:u.value,onClick:s},[d])}return{renderAsyncLoading:v}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Co(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 _e(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Co(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Xs=ze({name:"TableEditableCell",props:{row:Object,rowKey:String,rowIndex:Number,col:Object,colIndex:Number,oldCell:[Function,String],tableBaseClass:Object,cellEmptyContent:[Function,String],editable:{type:Boolean,default:void 0},readonly:{type:Boolean},errors:{type:Array,default:void 0},onChange:Function,onValidate:Function,onRuleChange:Function,onEditableChange:Function},emits:["update-edited-cell"],setup:function(e,a){var n,r=Ke(e),o=r.row,l=r.col;W(null);var i=N(function(){var c;return(c=l.value.edit)===null||c===void 0?void 0:c.keepEditMode}),u=W(i.value||((n=e.col.edit)===null||n===void 0?void 0:n.defaultEditable)||!1),s=W(),v=W(),d=Kt(),b=En({Edit1Icon:_i}),p=b.Edit1Icon,w=function(f){if(dt(f)==="object"&&("rowValue"in f||f.isUpdateCurrentRow)){var C=f.isUpdateCurrentRow?H(o.value,e.rowKey):f.rowValue;delete f.rowValue,delete f.isUpdateCurrentRow,a.emit("update-edited-cell",C,o.value,f)}else s.value=f};de([i],function(c){c&&(u.value=!0)});var y=N(function(){var c,f;return((c=l.value.edit)===null||c===void 0||(f=c.on)===null||f===void 0?void 0:f.call(c,_e(_e({},S.value),{},{editedRow:x.value,updateEditedCellValue:w})))||{}}),S=N(function(){return{rowIndex:e.rowIndex,colIndex:e.colIndex,col:e.col,row:e.row}}),x=N(function(){var c=l.value.colKey,f=c.split(".")||[],C=gi(f),E=C[0],k=C.slice(1),I=_e({},o.value);return k.length?(I[E]=rr(o.value[E]),$n(I[E],k.join("."),s.value)):$n(I,c,s.value),I}),R=N(function(){var c=ma({row:x.value,col:_e(_e({},l.value),{},{cell:e.oldCell}),rowIndex:e.rowIndex,colIndex:e.colIndex},a.slots,{cellEmptyContent:e.cellEmptyContent});return c}),O=N(function(){var c=l.value.edit;return Re(c.props)?c.props(_e(_e({},S.value),{},{editedRow:x.value,updateEditedCellValue:w})):_e({},c.props)}),_=N(function(){var c,f=l.value.edit;if(!f)return{};var C=_e({},O.value);return delete C.onChange,delete C.value,(c=f.abortEditOnEvent)===null||c===void 0||c.forEach(function(E){delete C[E]}),C}),j=N(function(){var c,f=l.value.edit;return f?Boolean((c=f.abortEditOnEvent)===null||c===void 0?void 0:c.includes("onChange")):!1}),A=function(f){return new Promise(function(C){var E={result:[_e(_e({},S.value),{},{errorList:[],value:s.value})],trigger:f},k=Re(l.value.edit.rules)?l.value.edit.rules(S.value):l.value.edit.rules;if(!l.value.edit||!k||!k.length){var I;(I=e.onValidate)===null||I===void 0||I.call(e,E),C(!0);return}Qo(s.value,k).then(function(M){var $,Y=M==null?void 0:M.filter(function(ee){return!ee.result});E.result[0].errorList=Y,($=e.onValidate)===null||$===void 0||$.call(e,E),!Y||!Y.length?(v.value=[],C(!0)):(v.value=Y,C(Y))})})},T=function(f,C){return Ua(f)&&Ua(C)?JSON.stringify(f)===JSON.stringify(C):f===C},F=function(f,C){for(var E=arguments.length,k=new Array(E>2?E-2:0),I=2;I<E;I++)k[I-2]=arguments[I];A("self").then(function(M){var $,Y;if(M===!0){var ee=H(o.value,l.value.colKey);T(s.value,ee)||(s.value=ee,f==null||f.apply(void 0,k)),($=(Y=y.value)[C])===null||$===void 0||$.call(Y,k[2]);var ne=setTimeout(function(){var ae;i.value||(u.value=!1),v.value=[],(ae=e.onEditableChange)===null||ae===void 0||ae.call(e,_e(_e({},S.value),{},{value:s.value,editedRow:_e(_e({},e.row),{},z({},e.col.colKey,s.value)),validateEdit:A,isEdit:!1})),clearTimeout(ne)},0)}})},P=N(function(){var c,f=l.value.edit,C=e.editable===void 0;if(!(!u.value||!C)){if(!(f!=null&&(c=f.abortEditOnEvent)!==null&&c!==void 0&&c.length))return{};var E={},k=f==null?void 0:f.onEdited;return f.abortEditOnEvent.forEach(function(I){I!=="onChange"&&(E[I]=function(){for(var M=arguments.length,$=new Array(M),Y=0;Y<M;Y++)$[Y]=arguments[Y];F.apply(void 0,[k,I,_e(_e({},S.value),{},{trigger:I,newRowData:x.value})].concat($))})}),E}}),K=function(f){var C,E,k,I,M,$,Y;s.value=f;for(var ee=_e(_e({},S.value),{},{value:f,editedRow:_e(_e({},e.row),{},z({},e.col.colKey,f))}),ne=arguments.length,ae=new Array(ne>1?ne-1:0),J=1;J<ne;J++)ae[J-1]=arguments[J];(C=O.value)===null||C===void 0||(E=C.onChange)===null||E===void 0||E.call.apply(E,[C,f].concat(ae)),(k=e.onChange)===null||k===void 0||k.call(e,ee),(I=e.onRuleChange)===null||I===void 0||I.call(e,ee),(M=y.value)===null||M===void 0||($=M.onChange)===null||$===void 0||$.call(M,ee);var B=e.editable===void 0;if(B&&j.value){var X,Q=(X=l.value.edit)===null||X===void 0?void 0:X.onEdited;F.apply(void 0,[Q,"change",_e(_e({},S.value),{},{trigger:"onChange",newRowData:x.value})].concat(ae))}((Y=l.value.edit)===null||Y===void 0?void 0:Y.validateTrigger)==="change"&&A("self")},D=function(f){var C;if(!(!l.value.edit||!l.value.edit.component)&&!!u.value){var E=((C=f.composedPath)===null||C===void 0?void 0:C.call(f))||f.path||[],k=E.find(function(M){var $;return($=M.classList)===null||$===void 0?void 0:$.contains("".concat(d.value,"-popup__content"))});if(!k){var I=l.value.edit.onEdited;F(I,"",_e(_e({},S.value),{},{trigger:"document",newRowData:x.value}))}}},m=function(){var f;(f=e.onEditableChange)===null||f===void 0||f.call(e,_e(_e({},S.value),{},{value:s.value,editedRow:e.row,isEdit:!0,validateEdit:A}))},h=function(f){u.value=!0,m(),f.stopPropagation()};yt(function(){var c;(c=e.col.edit)!==null&&c!==void 0&&c.defaultEditable&&m()});var g=N(function(){return H(o.value,l.value.colKey)});return de(g,function(c){s.value=c},{immediate:!0}),de(u,function(c){var f=e.editable===void 0;!l.value.edit||!l.value.edit.component||!f||(c?Te(document,"click",D):xe(document,"click",D))},{immediate:!0}),de(function(){return[e.editable,e.row,e.col,e.rowIndex,e.colIndex]},function(c){var f=Pe(c,1),C=f[0];if(C===!1)s.value=g.value;else if(C===!0){var E;(E=e.onRuleChange)===null||E===void 0||E.call(e,_e(_e({},S.value),{},{value:g.value,editedRow:o.value}))}},{immediate:!0}),de(function(){return e.errors},function(c){v.value=c}),function(){var c,f,C,E;if(e.readonly)return R.value;if(e.editable===void 0&&!u.value||e.editable===!1){var k;return L("div",{class:e.tableBaseClass.cellEditable,onClick:h},[R.value,((k=l.value.edit)===null||k===void 0?void 0:k.showEditIcon)!==!1&&L(p,null,null)])}var I=(c=l.value.edit)===null||c===void 0?void 0:c.component;if(!I)return Be.error("Table","edit.component is required."),null;var M=(f=v.value)===null||f===void 0||(f=f[0])===null||f===void 0?void 0:f.message,$=_e({},y.value);return delete $.onChange,(C=l.value.edit)!==null&&C!==void 0&&(C=C.abortEditOnEvent)!==null&&C!==void 0&&C.length&&l.value.edit.abortEditOnEvent.forEach(function(Y){$[Y]&&delete $[Y]}),L("div",{class:e.tableBaseClass.cellEditWrap,onClick:function(ee){ee.stopPropagation()},ref:"tableEditableCellRef"},[L(I,Ie({status:M?((E=v.value)===null||E===void 0||(E=E[0])===null||E===void 0?void 0:E.type)||"error":void 0,tips:M},_.value,P.value,$,{value:s.value,onChange:K}),null)])}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function xo(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 Fn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?xo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):xo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Gs(t){var e=Ke(t),a=e.editableRowKeys,n=new Map,r=W({}),o=N(function(){return cs(t.editableRowKeys,t.data,t.rowKey||"id")}),l=W({}),i=W({}),u=function(O){var _={};return O.forEach(function(j){var A=j.row,T=j.col,F=j.errorList,P=H(A,t.rowKey||"id"),K=[P,T.colKey].join("__");F!=null&&F.length?_[K]=F:delete _[K]}),_},s=function(O){var _=n.get(O);if(!!_){var j=_.map(function(A){return new Promise(function(T){var F=A.editedRow,P=A.col,K=Re(P.edit.rules)?P.edit.rules(A):P.edit.rules;if(!P.edit||!K||!K.length){T(Fn(Fn({},A),{},{errorList:[]}));return}Qo(H(F,P.colKey),K).then(function(D){T(Fn(Fn({},A),{},{errorList:D.filter(function(m){return!m.result})}))})})});return new Promise(function(A,T){Promise.all(j).then(function(F){A({errors:F.filter(function(P){var K;return(K=P.errorList)===null||K===void 0?void 0:K.length}),errorMap:u(F)})},T)})}},v=function(O){return new Promise(function(_,j){s(O).then(function(A){var T,F=A.errors,P=A.errorMap;r.value=P;var K="parent";(T=t.onRowValidate)===null||T===void 0||T.call(t,{trigger:K,result:F}),_({trigger:K,result:F})},j)})},d=function(){var O=Object.keys(l.value),_=O.map(function(j){return l.value[j].validateEdit("parent")});return new Promise(function(j,A){Promise.all(_).then(function(T){var F,P={};T.forEach(function(K,D){K!==!0&&(P[O[D]]=K)}),(F=t.onValidate)===null||F===void 0||F.call(t,{result:P}),j({result:P})},A)})},b=function(){if(Object.keys(l.value).length)return d();for(var O=[],_=t.data||[],j=0,A=_.length;j<A;j++){var T=H(_[j],t.rowKey||"id");O.push(s(T))}return new Promise(function(F,P){Promise.all(O).then(function(K){var D,m={};K.forEach(function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{errors:[],errorMap:{}},g=h.errorMap;g&&Object.assign(m,g)}),r.value=m,(D=t.onValidate)===null||D===void 0||D.call(t,{result:m}),F({result:m})},P)})},p=function(O,_,j){i.value[O]||(i.value[O]=rr(_)),Object.entries(j).forEach(function(A){var T=Pe(A,2),F=T[0],P=T[1];$n(i.value[O],F,P)})},w=function(O){if(t.editableRowKeys){var _=H(O.row,t.rowKey||"id"),j=n.get(_);if(j){var A=j.findIndex(function(T){return T.col.colKey===O.col.colKey});A===-1?j.push(O):j[A]=O,n.set(_,j)}else n.set(_,[O])}},y=function(){r.value={}},S=function(O){var _=Vn(O.row,t.rowKey,O.col.colKey,O.colIndex);O.isEdit?l.value[_]=O:delete l.value[_]},x=function(O){var _,j=O.row,A=O.col,T=H(j,t.rowKey||"id"),F=i.value[T];if(F&&(_=t.editableRowKeys)!==null&&_!==void 0&&_.includes(T)){var P=Fn({},F);return $n(P,A.colKey,H(F,A.colKey)),P}return j};return de(function(){var R;return(R=a.value)===null||R===void 0?void 0:R.join(",")},function(R){var O=R.split(","),_=Object.keys(i.value);_.forEach(function(j){O.includes(j)||delete i.value[j]})}),{editedFormData:i,errorListMap:r,editableKeysMap:o,validateTableData:b,validateRowData:v,onRuleChange:w,clearValidateData:y,onUpdateEditedCell:p,getEditRowData:x,onPrimaryTableCellEditChange:S}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function So(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function jt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?So(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):So(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ys=["hideSortTips","dragSort","defaultExpandedRowKeys","defaultSelectedRowKeys","columnController","filterRow","sortOnRowDraggable","expandOnRowClick","expand-on-row-click","expanded-row","editable-row-keys","editable-cell-state","filter-value","multipleSort","expandIcon","expand-icon","reserveSelectedRowOnPaginate","expandedRowKeys","expandedRow","reserve-selected-row-on-paginate","reserveSelectedRowOnPaginate","selected-row-keys","selectedRowKeys","selectOnRowClick","column-controller","columnController","dragSort","drag-sort","hideSortTips","showSortColumnBgColor","filter-row","filterRow","multiple-sort","multipleSort","async-loading","onChange","onAsyncLoadingClick","onColumnChange","onColumnControllerVisibleChange","onDataChange","onDisplayColumnsChange","onDragSort","onExpandChange","onFilterChange","onSelectChange","onSortChange"],hr=ze({name:"TPrimaryTable",props:jt(jt({},On),hl),setup:function(e,a){var n=Yt(),r=Ke(e),o=r.columns,l=r.columnController,i=W(null),u=W(!1),s=ot(),v=s.classPrefix,d=s.tableDraggableClasses,b=s.tableBaseClass,p=s.tableSelectedClasses,w=s.tableSortClasses,y=ht("table",e.locale),S=y.globalConfig,x=vl(e),R=x.sizeClassNames,O=N(function(){var be;return(be=e.size)!==null&&be!==void 0?be:S.value.size}),_=us(e,a),j=_.tDisplayColumns,A=_.renderColumnController,T=ss(e,a),F=T.showExpandedRow,P=T.showExpandIconColumn,K=T.getExpandColumn,D=T.renderExpandedRow,m=T.onInnerExpandRowClick,h=gs(e,a),g=h.renderSortIcon,c=ds(e,p),f=c.selectColumn,C=c.showRowSelect,E=c.selectedRowClassNames,k=c.currentPaginateData,I=c.formatToRowSelectColumn,M=c.setTSelectedRowKeys,$=c.onInnerSelectRowClick,Y=c.handleRowSelectWithAreaSelection,ee=ms(e,a),ne=ee.hasEmptyCondition,ae=ee.isTableOverflowHidden,J=ee.renderFilterIcon,B=ee.renderFirstFilterRow,X=ee.setFilterPrimaryTableRef,Q=N(function(){return{showElement:u.value}}),q=Vs(e,a,Q),se=q.isRowHandlerDraggable,he=q.isRowDraggable,Le=q.isColDraggable,Ve=q.innerPagination,qe=q.setDragSortPrimaryTableRef,Ne=q.setDragSortColumns,lt=ol(e),gt=lt.renderTitleWidthIcon,it=Us(e),Pt=it.renderAsyncLoading,je=Gs(e),Dn=je.errorListMap,_n=je.editableKeysMap,Tn=je.validateRowData,re=je.validateTableData,V=je.onRuleChange,G=je.clearValidateData,Z=je.onUpdateEditedCell,te=je.getEditRowData,le=je.onPrimaryTableCellEditChange,ge=N(function(){return Boolean(F.value||C.value)}),pe=N(function(){return Boolean(F.value||C.value)}),ue=N(function(){var be;return z(z(z(z(z(z(z(z({},d.colDraggable,Le.value),d.rowHandlerDraggable,se.value),d.rowDraggable,he.value),b.overflowVisible,ae.value===!1),b.tableRowEdit,e.editableRowKeys),"".concat(v,"-table--select-").concat((be=f.value)===null||be===void 0?void 0:be.type),f.value),"".concat(v,"-table--row-select"),C.value),"".concat(v,"-table--row-expandable"),F.value)}),me=N(function(){var be=[e.rowClassName,E.value];return be.filter(function(ve){return ve})}),Ee=N(function(){var be=[e.rowAttributes];return(se.value||he.value)&&be.push(function(ve){var Fe=ve.row;return{"data-id":H(Fe,e.rowKey||"id")}}),be.filter(function(ve){return ve})});yt(function(){X(i.value),qe(i.value)}),a.expose({validateRowData:Tn,validateTableData:re,clearValidateData:G,refreshTable:function(){i.value.refreshTable()},scrollToElement:function(ve){i.value.scrollToElement(ve)},scrollColumnIntoView:function(ve){i.value.scrollColumnIntoView(ve)},baseTableRef:i});var Ae=function(ve){var Fe;(Fe=e.onRowEdit)===null||Fe===void 0||Fe.call(e,ve);var Je=H(ve.editedRow,e.rowKey||"id");Z(Je,ve.row,z({},ve.col.colKey,ve.value))},He=function be(ve){for(var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=[],Ge=function(){var Zt,Qt,en,tn,bt,we=jt({},ve[pt]),fn=((Zt=we.children)===null||Zt===void 0?void 0:Zt.length)||((Qt=j.value)===null||Qt===void 0?void 0:Qt.includes(we.colKey));if(!fn&&(e.columnController||e.displayColumns||e.defaultDisplayColumns)&&!Fe)return 1;we=I(we);var Ht=e.sort;if(we.sorter&&e.showSortColumnBgColor){var Pn=Ht instanceof Array?Ht:[Ht],nn=Pn.find(function(De){return De&&De.sortBy===we.colKey&&De.descending!==void 0});nn&&(we.className=we.className instanceof Array?we.className.concat(w.sortColumn):[we.className,w.sortColumn])}if(we.sorter||we.filter){var Ot=Ea(a.slots,we,pt),Rt=we,_a=Rt.ellipsisTitle;we.title=function(De,Se){var We,Et=we.sorter?g(Se):null,Wt=we.filter?J(Se):null,An=(We=i.value)===null||We===void 0?void 0:We.tableContentRef;return gt([Ot,Et,Wt],Se.col,Se.colIndex,_a,An,{classPrefix:v,ellipsisOverlayClassName:O.value!=="medium"?R[O.value]:""})},we.ellipsisTitle=!1}if((en=we.edit)!==null&&en!==void 0&&en.component){var Ta=we.cell;we.cell=function(De,Se){var We=jt(jt({},Se),{},{row:te(Se),oldCell:Ta,rowKey:e.rowKey||"id",tableBaseClass:b,cellEmptyContent:e.cellEmptyContent,onChange:Ae,onValidate:e.onRowValidate,onRuleChange:V,onEditableChange:le});if(e.editableRowKeys){var Et,Wt=H(Se.row,e.rowKey||"id");We.editable=_n.value[Wt]||!1;var An=[Wt,Se.col.colKey].join("__"),Jn=(Et=Dn.value)===null||Et===void 0?void 0:Et[An];Jn&&(We.errors=Jn)}return e.editableCellState&&(We.readonly=!e.editableCellState(Se)),L(Xs,Ie(We,{onUpdateEditedCell:Z}),a.slots)}}if((tn=we.children)!==null&&tn!==void 0&&tn.length){var ye;we.children=be(we.children,Fe||((ye=j.value)===null||ye===void 0?void 0:ye.includes(we.colKey)))}(!we.children||(bt=we.children)!==null&&bt!==void 0&&bt.length)&&Je.push(we)},pt=0,Jt=ve.length;pt<Jt;pt++)Ge();return Je},At=N(function(){var be=He(o.value);return P.value&&be.unshift(K()),be}),Bt=function(ve,Fe){var Je,Ge;Ve.value=jt(jt({},Ve.value),ve),k.value=Fe,(Je=e.onPageChange)===null||Je===void 0||Je.call(e,ve,Fe);var pt=[{pagination:ve},{trigger:"pagination",currentData:Fe}];(Ge=e.onChange)===null||Ge===void 0||Ge.call.apply(Ge,[e].concat(pt)),e.reserveSelectedRowOnPaginate||M([],{selectedRowData:[],type:"uncheck",currentRowKey:"CLEAR_ON_PAGINATE"})},tt=function(ve){var Fe;(Fe=e.onActiveRowAction)===null||Fe===void 0||Fe.call(e,ve),Y(ve)},zt=function(ve){e.expandOnRowClick&&m(ve),e.selectOnRowClick&&$(ve)},Ct,vn=250,xt=function(ve){if(!e.onRowDblclick){zt(ve);return}Ct?(clearTimeout(Ct),Ct=void 0):Ct=setTimeout(function(){zt(ve),Ct=void 0},vn)},St=function(ve){u.value=ve};return function(){var be,ve,Fe=function(fn,Ht,Pn,nn){if(!Pn)return e[fn];var Ot=Ht(Ye),Rt=n(fn);return Ot&&!Rt?function(){return Ot}:Rt&&!Ot?function(){return Rt}:Ot&&Rt?function(){return nn!=null&&nn.reverse?L("div",null,[Ot,Rt]):L("div",null,[Rt,Ot])}:null},Je=!!(l.value&&Object.keys(l.value).length),Ge=Je?l.value.placement||"top-right":"",pt=Je&&(Ge==null?void 0:Ge.indexOf("bottom"))!==-1,Jt=Fe("topContent",A,Je&&!pt),qn=Fe("bottomContent",A,pt,{reverse:!0}),Zt=Fe("firstFullRow",B,!ne.value),Qt=Fe("lastFullRow",Pt,!!e.asyncLoading),en=Mo(),tn=en.vnode,bt=jt(jt({},Zl(tn.props,Ys)),{},{rowKey:e.rowKey,rowClassName:me.value,rowAttributes:Ee.value,columns:At.value,keyboardRowHover:(be=e.keyboardRowHover)!==null&&be!==void 0?be:ge.value,disableSpaceInactiveRow:(ve=e.disableSpaceInactiveRow)!==null&&ve!==void 0?ve:pe.value,topContent:Jt,bottomContent:qn,firstFullRow:Zt,lastFullRow:Qt,thDraggable:["col","row-handler-col"].includes(e.dragSort),onShowElementChange:St,onPageChange:Bt,renderExpandedRow:F.value?D:void 0,onActiveRowAction:tt});return(e.expandOnRowClick||e.selectOnRowClick)&&(bt.onRowClick=xt),L(fl,Ie(bt,{ref:i,class:ue.value,onLeafColumnsChange:Ne}),a.slots)}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var qs={beforeDragSort:{type:Function},expandedTreeNodes:{type:Array,default:void 0},defaultExpandedTreeNodes:{type:Array,default:function(){return[]}},tree:{type:Object},treeExpandAndFoldIcon:{type:Function},onAbnormalDragSort:Function,onExpandedTreeNodesChange:Function,onTreeExpandChange:Function};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Oo(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?Oo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Oo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ro={code:1001,reason:"The same level of rows can not be swapped."};function Ft(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=H(t,e);return a||n?"".concat(r,"_").concat(a||0,"_").concat(n||0,"}"):r}var Js=function(){function t(){ei(this,t),z(this,"treeDataMap",new Map),z(this,"expandAllRowIndex",void 0),this.treeDataMap=new Map}return Ql(t,[{key:"initialTreeStore",value:function(a,n,r){var o;(o=this.treeDataMap)===null||o===void 0||o.clear(),this.initialTreeDataMap(this.treeDataMap,a,n.find(function(l){return l.colKey==="row-select"}),r)}},{key:"getAllUniqueKeys",value:function(a,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=a.length;o<l;o++){var i=a[o];r.push(Ft(i,n.rowKey));var u=H(i,n.childrenKey);u!=null&&u.length&&this.getAllUniqueKeys(u,n,r)}return r}},{key:"getExpandedChildrenKeys",value:function(a,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=a.length;o<l;o++){var i=a[o],u=Ft(i,n.rowKey),s=this.treeDataMap.get(u);s.expanded&&r.push(u);var v=H(i,n.childrenKey);v!=null&&v.length&&this.getExpandedChildrenKeys(v,n,r)}return r}},{key:"expandTreeNode",value:function(a,n,r){var o=this;return a.length&&a.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},n,r,"expand")}),n}},{key:"foldTreeNode",value:function(a,n,r){var o=this;return a.length&&a.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},n,r,"fold")}),n}},{key:"toggleExpandData",value:function(a,n,r,o){var l;if(!a)return Be.error("EnhancedTable","the node toggleExpanded doest not exist in `data`"),n;var i=H(a.row,r.rowKey);if(xn(i))return Be.error("EnhancedTable","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`."),[];var u=H(a.row,r.childrenKey);if(u===!0)return n;var s=this.treeDataMap.get(i);return o==="expand"&&s.expanded||o==="fold"&&!s.expanded?n:(s.rowIndex=(l=s.rowIndex)!==null&&l!==void 0?l:a.rowIndex,s.expanded=!s.expanded,this.treeDataMap.set(i,s),this.updateExpandRow(s,n,r))}},{key:"updateExpandRow",value:function(a,n,r){var o=a.row,l=a.rowIndex,i=a.expanded,u=this.treeDataMap,s=H(o,r.childrenKey);if(!o||!s)return n;if(i)nr(u,a,i,r),bn(u,o,s.length,"expand",r),n.splice.apply(n,[l+1,0].concat(s));else{nr(u,a,i,r);var v=a.expandChildrenLength||s.length;bn(u,o,-1*v,"fold",r),n.splice(l+1,v)}return on(u,n,{rowKey:r.rowKey,minRowIndex:l+1}),n}},{key:"getData",value:function(a){return this.treeDataMap.get(a)}},{key:"updateData",value:function(a,n,r,o){var l=Ft(n,o.rowKey),i=this.treeDataMap.get(a);if(!i||i.rowIndex===-1)return jl(r,a,n,{rowKey:o.rowKey,childrenKey:o.childrenKey}),-1;if(H(n,o.childrenKey)===!0){var u=H(i.row,o.childrenKey);if(u!=null&&u.length)for(var s=0,v=u.length;s<v;s++){var d=Ft(u[s],o.rowKey),b=this.treeDataMap.get(d);b&&this.treeDataMap.delete(d)}}var p=i.rowIndex;if(i.row=n,i.id=l,i.parent){var w=H(i.parent.row,o.childrenKey),y=w.findIndex(function(S){return Ft(S,o.rowKey)===a});w[y]=n}return this.treeDataMap.set(l,i),a!==l&&this.treeDataMap.delete(a),p}},{key:"remove",value:function(a,n,r){var o=this.treeDataMap.get(a);if(o&&o.rowIndex>=0){var l=(o.expandChildrenLength||0)+1;if(n.splice(o.rowIndex,l),o.parent){var i=H(o.parent.row,r.childrenKey),u=i.findIndex(function(s){return H(s,r.rowKey)===a});i.splice(u,1),bn(this.treeDataMap,o.parent.row,-1*l,"delete",r)}this.treeDataMap.delete(a),on(this.treeDataMap,n,{minRowIndex:o.rowIndex,rowKey:r.rowKey,type:"remove"})}else Be.warn("EnhancedTable","Can not remove this node, which is not appeared.");return n}},{key:"removeChildren",value:function(a,n,r){var o=this.treeDataMap.get(a);if(o&&o.rowIndex>=0){var l=o.expandChildrenLength||0;l&&n.splice(o.rowIndex+1,l),o.parent&&bn(this.treeDataMap,o.parent.row,-1*l,"delete",r),o.expandChildrenLength=0,o.expanded=!1,$n(o.row,r.childrenKey,void 0),this.treeDataMap.set(a,o),l&&on(this.treeDataMap,n,{minRowIndex:o.rowIndex+1,rowKey:r.rowKey,type:"remove"})}else Be.warn("EnhancedTable","Can not remove this node's children, which is not appeared.");return n}},{key:"appendTo",value:function(a,n,r,o){var l=this.treeDataMap.get(a);if(!this.validateDataExist(l,a))return r;for(var i=H(l.row,o.childrenKey),u=l.expanded||!(i!=null&&i.length),s=n instanceof Array?n:[n],v=[],d=-1,b=0,p=s.length;b<p;b++){var w=s[b],y=Ft(w,o.rowKey),S=this.treeDataMap.get(y);if(!this.validateDataDoubleExist(S,y))Be.warn("Table","Duplicated Data `".concat(y,"` has been removed."));else{var x=u?l.rowIndex+(l.expandChildrenLength||0)+(b+1):-1;b===0&&(d=x);var R={id:y,row:w,rowIndex:x,level:l.level+1,expanded:!1,expandChildrenLength:0,disabled:!1,path:fe(l.path),parent:l};R.path=R.path.concat(R),v.push(w),this.treeDataMap.set(y,R)}}if(!v.length)return r;if(i!=null&&i.length?l.row[o.childrenKey]=l.row[o.childrenKey].concat(v):(l.row[o.childrenKey]=v,l.expanded=!0),u){r.splice.apply(r,[d,0].concat(v));var O=v.length||1;bn(this.treeDataMap,l.row,O,"insert",{rowKey:o.rowKey,childrenKey:o.childrenKey}),on(this.treeDataMap,r,{minRowIndex:d+v.length-1,rowKey:o.rowKey,type:"add",count:1})}return r}},{key:"appendToRoot",value:function(a,n,r){for(var o=n.concat(a),l=a instanceof Array?a:[a],i=n.length,u=0,s=l.length;u<s;u++){var v=H(l[u],r.rowKey);if(!v){Be.error("Table","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`.");continue}var d={id:v,row:l[u],rowIndex:i+u,level:0,expanded:!1,expandChildrenLength:0,disabled:!1};d.path=[d],this.treeDataMap.set(v,d)}return o}},{key:"insertAfter",value:function(a,n,r,o){return this.insert(a,n,r,o,"after")}},{key:"insertBefore",value:function(a,n,r,o){return this.insert(a,n,r,o,"before")}},{key:"insert",value:function(a,n,r,o,l){var i=this.treeDataMap.get(a);if(!this.validateDataExist(i,a))return r;var u=H(n,o.rowKey),s=this.treeDataMap.get(u);if(!this.validateDataDoubleExist(s,u))return r;var v=l==="after"?i.rowIndex+1:i.rowIndex,d={id:u,row:n,rowIndex:v,level:i.level,expanded:!1,expandChildrenLength:0,disabled:!1,path:i.path.slice(0,-1),parent:i.parent};d.path=d.path.concat(d);var b=l==="after"?i.rowIndex+(i.expandChildrenLength+1):i.rowIndex;r.splice(b,0,n);var p=l==="after"?1:0;if(i.parent){var w=i.parent.row[o.childrenKey].findIndex(function(y){return a===H(y,o.rowKey)});i.parent.row[o.childrenKey].splice(w+p,0,n),bn(this.treeDataMap,i.parent.row,1,"insert",o)}return this.treeDataMap.set(u,d),on(this.treeDataMap,r,{rowKey:o.rowKey,minRowIndex:i.rowIndex+1,type:"add"}),r}},{key:"swapData",value:function(a,n,r){var o=n.currentIndex,l=n.targetIndex;if(o===l)return{dataSource:a,result:!0};var i=H(n.current,r.rowKey),u=H(n.target,r.rowKey),s=this.treeDataMap.get(i),v=this.treeDataMap.get(u);if(s.level!==v.level)return{dataSource:a,result:!1,code:Ro.code,reason:Ro.reason};var d=o+s.expandChildrenLength+1,b=l+v.expandChildrenLength+1,p=a.slice(o,d),w=a.slice(l,b);if(o>l){var y=a.slice(b,o),S=p.concat(w,y);a.splice(l,S.length),a.splice.apply(a,[l,0].concat(fe(S))),on(this.treeDataMap,a,{rowKey:r.rowKey,minRowIndex:l,maxRowIndex:d})}else{var x=a.slice(d,l),R=x.concat(w,p);a.splice(o,R.length),a.splice.apply(a,[o,0].concat(fe(R))),on(this.treeDataMap,a,{rowKey:r.rowKey,minRowIndex:o,maxRowIndex:b})}if(s.parent){for(var O=s.parent.row[r.childrenKey],_=0,j=-1,A=-1,T=0,F=O.length;T<F&&(H(O[T],r.rowKey)===i&&(j=T,_+=1),H(O[T],r.rowKey)===u&&(A=T,_+=1),!(_>=2));T++);O[j]=n.target,O[A]=n.current}return{dataSource:a,result:!0}}},{key:"expandAll",value:function(a,n){var r=this;this.expandAllRowIndex=0;var o=[],l=function i(u,s){for(var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=0,b=u.length;d<b;d++){var p=u[d],w=H(p,s.rowKey),y=r.treeDataMap.get(w),S=H(p,s.childrenKey);if(y.rowIndex=r.expandAllRowIndex,S!==!0&&S!==null&&S!==void 0&&S.length&&(y.expanded=!0),y.expandChildrenLength=(S==null?void 0:S.length)||0,r.expandAllRowIndex+=1,o.push(p),r.treeDataMap.set(w,y),S!=null&&S.length){for(var x=v;(R=x)!==null&&R!==void 0&&R.row;){var R;x.expandChildrenLength+=S.length,r.treeDataMap.set(x.id,x),x=x.parent}i(S,s,y)}}};return l(a,n),o}},{key:"foldAll",value:function(a,n){for(var r=[],o=0,l=0,i=a.length;l<i;l++){var u=a[l],s=H(u,n.rowKey),v=this.treeDataMap.get(s);v.rowIndex=v.level===0?o:-1,v.expanded=!1,v.expandChildrenLength=0,v.level===0&&(r.push(u),o+=1);var d=H(u,n.childrenKey);d!=null&&d.length&&this.foldAll(d,n)}return r}},{key:"getTreeNode",value:function(a,n){for(var r=[],o=0,l=a.length;o<l;o++){var i=a[o],u=H(i,n.rowKey),s=this.treeDataMap.get(u);s.level===0&&r.push(i)}return r}},{key:"getTreeExpandedRow",value:function(a,n){var r=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"data",l=[];return a.forEach(function(i){var u=H(i,n.rowKey),s=r.treeDataMap.get(u);!s.expanded||(o==="unique"?l.push(u):o==="data"?l.push(i):l.push(s))}),l}},{key:"initialTreeDataMap",value:function(a,n,r,o){for(var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,u=0,s=n.length;u<s;u++){var v=n[u],d=Ft(v,o.rowKey);if(xn(d)){Be.error("EnhancedTable","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`.");return}var b=H(v,o.childrenKey),p={id:d,row:v,rowIndex:l===0?u:-1,level:l,expanded:!1,expandChildrenLength:0,disabled:Ja(r,v,u),parent:i};p.path=i?i.path.concat(p):[p],a.set(d,p),b!=null&&b.length&&this.initialTreeDataMap(a,b,r,o,l+1,p)}}},{key:"updateDisabledState",value:function(a,n,r){for(var o=0,l=a.length;o<l;o++){var i=a[o],u=H(i,r.rowKey);if(xn(u)){Be.error("EnhancedTable","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`.");return}var s=this.treeDataMap.get(u);s.disabled=Ja(n,i,o),this.treeDataMap.set(u,s);var v=H(i,r.childrenKey);v!=null&&v.length&&this.updateDisabledState(v,n,r)}}},{key:"validateDataExist",value:function(a,n){return a?!0:(Be.warn("EnhancedTable","".concat(n," does not exist.")),!1)}},{key:"validateDataDoubleExist",value:function(a,n){return a?(Be.warn("EnhancedTable","Duplicated Key. ".concat(n," already exists.")),!1):!0}}])}();function bn(t,e,a,n,r){for(var o=e;o;){var l,i=t.get(H(o,r.rowKey)),u=(i.expandChildrenLength||0)+a;i.expandChildrenLength=Math.max(0,u),o=i==null||(l=i.parent)===null||l===void 0?void 0:l.row}n==="fold"&&Al(t,e,r)}function Al(t,e,a){var n=H(e,a.childrenKey);n!=null&&n.length&&n.forEach(function(r){var o=t.get(H(r,a.rowKey));!o||(o.expandChildrenLength=0,Al(t,o.row,a))})}function nr(t,e,a,n){var r=e.row,o=e.rowIndex,l=H(r,n.childrenKey);l.forEach(function(i,u){var s=H(i,n.rowKey),v=a?o+1+u:-1,d=t.get(s),b=sa(sa({},d),{},{row:i,rowIndex:v,expanded:!1,parent:e});if(t.set(s,b),!a){var p=H(i,n.childrenKey);p!=null&&p.length&&nr(t,sa(sa({},b),{},{rowIndex:-1,expanded:!1}),a,n)}})}function jl(t,e,a,n){for(var r=0,o=t.length;r<o;r++){var l=t[r];if(H(l,n.rowKey)===e){t[r]=a;return}var i=H(l,n.childrenKey)||[];i!=null&&i.length&&jl(i,e,a,n)}}function on(t,e,a){for(var n=a.minRowIndex||0,r=a.maxRowIndex||e.length,o=n;o<r;o++){var l=e[o],i=t.get(H(l,a.rowKey));i||Be.warn("Table","tree map went wrong"),i.rowIndex=o+((a==null?void 0:a.count)||1)-1}}function Zs(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=[],n=[],r=new Map,o=new Map,l=0,i=t.length;l<i;l++)r.set(t[l],!0);for(var u=0,s=e.length;u<s;u++)o.set(e[u],!0);for(var v=0,d=t.length;v<d;v++)o.get(t[v])||n.push(t[v]);for(var b=0,p=e.length;b<p;b++)r.get(e[b])||a.push(e[b]);return{removedList:a,addedList:n}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Eo(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 $a(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Eo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Qs(t,e){var a=e.store,n=e.dataSource,r=e.rowDataKeys,o=Ke(t),l=o.data,i=o.expandedTreeNodes,u=o.tree,s=W(!1),v=W(!1),d=kt(i,t.defaultExpandedTreeNodes,t.onExpandedTreeNodesChange,"expandedTreeNodes"),b=Pe(d,2),p=b[0],w=b[1],y=W({type:"props-change"});function S(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"expand-all",A=arguments.length>1?arguments[1]:void 0,T=A||l.value;n.value=a.value.expandAll(T,r.value);var F=n.value.map(function(P){return Ft(P,r.value.rowKey)});w(F,{row:void 0,rowState:void 0,rowIndex:void 0,type:"expand",trigger:j}),y.value.type="expand-all"}function x(){n.value=fe(a.value.foldAll(n.value,r.value)),w([],{row:void 0,rowState:void 0,rowIndex:void 0,type:"fold",trigger:"fold-all"})}function R(j,A){var T,F=j.row,P=j.rowIndex;y.value=$a({type:"user-reaction-change"},j);var K=Ft(F,r.value.rowKey),D=a.value.treeDataMap.get(K),m=fe(p.value);if(D.expanded){for(var h=a.value.getExpandedChildrenKeys([F],r.value),g=0,c=m.length;g<c;g++){var f=m[g];h.includes(f)&&(m[g]=void 0)}m=m.filter(Boolean)}else m.push(K);var C={row:F,rowIndex:P,rowState:D,trigger:A};w(m,$a($a({},C),{},{type:D.expanded?"fold":"expand"})),(T=t.onTreeExpandChange)===null||T===void 0||T.call(t,C)}function O(j,A){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],F=Zs(A,T),P=F.addedList,K=F.removedList;return a.value.expandTreeNode(P,j,r.value),a.value.foldTreeNode(K,j,r.value),fe(j)}de([p,l],function(j,A){var T=Pe(j,1),F=T[0],P=Pe(A,1),K=P[0];if(!(!a.value.treeDataMap.size||!l.value.length)){if(y.value.type==="user-reaction-change"){var D=y.value||{},m=D.row,h=D.rowIndex;n.value=fe(a.value.toggleExpandData({row:m,rowIndex:h},fe(n.value),r.value))}else y.value.type==="props-change"&&O(n.value,F,K);y.value.type="props-change"}});var _=function(A){var T,F;(T=u.value)!==null&&T!==void 0&&T.defaultExpandAll&&!s.value?(S("default-expand-all",fe(A)),s.value=!0):(F=p.value)!==null&&F!==void 0&&F.length&&Gt(function(){n.value=O(fe(A),p.value,[])})};return{tExpandedTreeNode:p,isDefaultExpandAllExecute:s,isDefaultExpandedTreeNodesExecute:v,expandAll:S,foldAll:x,onExpandFoldIconClick:R,updateExpandOnDataChange:_}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function Do(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function vt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Do(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Do(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ec(t,e){var a=Ke(t),n=a.data,r=a.columns,o=ht("table",t.locale),l=o.t,i=o.globalConfig,u=En({AddRectangleIcon:xi,MinusRectangleIcon:Ii}),s=u.AddRectangleIcon,v=u.MinusRectangleIcon,d=W(new Js),b=ui(),p=W([]),w=ot(),y=w.tableTreeClasses,S=Un(),x=N(function(){var B;return{rowKey:t.rowKey||"id",childrenKey:((B=t.tree)===null||B===void 0?void 0:B.childrenKey)||"children"}}),R=Qs(t,{store:d,dataSource:p,rowDataKeys:x}),O=R.tExpandedTreeNode,_=R.isDefaultExpandAllExecute,j=R.isDefaultExpandedTreeNodesExecute,A=R.expandAll,T=R.foldAll,F=R.updateExpandOnDataChange,P=R.onExpandFoldIconClick,K=N(function(){return r.value.find(function(B){return B.colKey==="row-select"})});de(K,function(B){!d.value||d.value.updateDisabledState(p.value,B,x.value)});var D=function(X){var Q=vt(vt({},X),{},{type:"fold"}),q=l(i.value.treeExpandAndFoldIcon,Ye,Q)||L(v,null,null);return S("treeExpandAndFoldIcon",{defaultNode:q,params:Q})},m=function(X){var Q=vt(vt({},X),{},{type:"expand"}),q=l(i.value.treeExpandAndFoldIcon,Ye,Q)||L(s,null,null);return S("treeExpandAndFoldIcon",{defaultNode:q,params:Q})};de([n],function(){t.tree?h(n.value):p.value=n.value},{immediate:!0}),ko(function(){var B;!t.tree||((B=d.value.treeDataMap)===null||B===void 0||B.clear(),d.value=null)}),de(function(){var B;return[r,(B=t.tree)===null||B===void 0?void 0:B.treeNodeColumnIndex]},function(){b.value=f()},{immediate:!0});function h(B){var X,Q=t.columns,q=t.expandedTreeNodes,se=t.defaultExpandedTreeNodes,he=t.tree;d.value.initialTreeStore(B,Q,x.value);var Le=Boolean(!j.value&&(se==null?void 0:se.length)),Ve=Boolean((he==null?void 0:he.defaultExpandAll)&&!_.value);(X=O.value)!==null&&X!==void 0&&X.length&&!!(q||Le)||Ve?(F(B),j.value=!0):p.value=fe(B)}function g(B){var X,Q;if(B!==void 0){var q=((X=t.tree)===null||X===void 0?void 0:X.indent)===void 0?24:(Q=t.tree)===null||Q===void 0?void 0:Q.indent;return q?{paddingLeft:"".concat(B*q||1,"px")}:{}}}function c(B,X){var Q,q,se=vt({},B);B.row.VIRTUAL_SCROLL_INDEX!==void 0&&(se.rowIndex=B.row.VIRTUAL_SCROLL_INDEX),p.value=fe(d.value.toggleExpandData(se,p.value,x.value));var he=H(B.row,x.value.rowKey),Le=(Q=d.value)===null||Q===void 0||(Q=Q.treeDataMap)===null||Q===void 0?void 0:Q.get(he);(q=t.onTreeExpandChange)===null||q===void 0||q.call(t,{row:B.row,rowIndex:B.rowIndex,rowState:Le,trigger:X})}function f(){for(var B,X=t.columns,Q=((B=t.tree)===null||B===void 0?void 0:B.treeNodeColumnIndex)||0;(q=X[Q])!==null&&q!==void 0&&q.type||((se=X[Q])===null||se===void 0?void 0:se.colKey)==="__EXPAND_ROW_ICON_COLUMN__";){var q,se;Q+=1}return X[Q]}function C(B){if(!t.tree||B.colKey!==b.value.colKey)return B;var X=vt({},b.value);return X.cell=function(Q,q){var se=ma(vt(vt({},q),{},{col:vt({},b.value)}),e.slots,{cellEmptyContent:t.cellEmptyContent}),he=d.value.treeDataMap.get(H(q.row,x.value.rowKey)),Le=g(he==null?void 0:he.level),Ve=z({},y.inlineCol,!!B.ellipsis),qe=H(q.row,x.value.childrenKey);if(qe&&qe instanceof Array||qe===!0){var Ne,lt=(Ne=d.value.treeDataMap.get(H(q.row,x.value.rowKey)))!==null&&Ne!==void 0&&Ne.expanded?D(q):m(q);return L("div",{class:[y.col,Ve],style:Le},[!!(qe.length||qe===!0)&&L("span",{class:y.icon,onClick:function(it){P(q,"expand-fold-icon"),it.stopPropagation()}},[lt]),se])}return L("div",{style:Le,class:[Ve,y.leafNode]},[L("span",{class:y.icon},null),se])},X.ellipsis===!0&&(X.ellipsis=function(Q,q){return ma(vt(vt({},q),{},{col:vt({},b.value)}),e.slots)}),X}function E(B,X){var Q=d.value.updateData(B,X,p.value,x.value),q=fe(p.value);q[Q]=X,p.value=q}function k(B){return d.value.getData(B)}function I(B){p.value=fe(d.value.remove(B,p.value,x.value))}function M(B){p.value=fe(d.value.removeChildren(B,p.value,x.value))}function $(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",X=arguments.length>1?arguments[1]:void 0;if(!B){p.value=d.value.appendToRoot(X,p.value,x.value);return}p.value=fe(d.value.appendTo(B,X,p.value,x.value))}function Y(B,X){p.value=fe(d.value.insertAfter(B,X,p.value,x.value))}function ee(B,X){p.value=fe(d.value.insertBefore(B,X,p.value,x.value))}function ne(B){var X=d.value.swapData(p.value,B,x.value);if(X.result)p.value=fe(X.dataSource);else{var Q,q={code:X.code,reason:X.reason};(Q=t.onAbnormalDragSort)===null||Q===void 0||Q.call(t,q)}}function ae(){return d.value.getTreeNode(p.value,x.value)}function J(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data";return d.value.getTreeExpandedRow(p.value,x.value,B)}return{store:d,rowDataKeys:x,dataSource:p,swapData:ne,setData:E,getData:k,remove:I,removeChildren:M,appendTo:$,insertAfter:Y,insertBefore:ee,formatTreeColumn:C,toggleExpandData:c,expandAll:A,foldAll:T,getTreeNode:ae,resetData:h,getTreeExpandedRow:J,onExpandFoldIconClick:P}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function _o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ca(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_o(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ar=new Map;function kn(t,e,a,n){if(ar.get(e))return ar.get(e);var r=n||{allChildren:[],allChildrenKeys:[],leafNodeKeys:[]},o=H(e,a.childrenKey);if(!o||!o.length)return r;var l=o.filter(function(x){var R;return!((R=t.get(H(x,a.rowKey)))!==null&&R!==void 0&&R.disabled)});r.allChildren=fe(new Set(r.allChildren.concat(l)));for(var i=0,u=o.length;i<u;i++){var s=o[i],v=H(s,a.childrenKey);if(v!=null&&v.length){var d=kn(t,s,a,r);r.allChildren=fe(new Set(r.allChildren.concat(d.allChildren)))}}for(var b=0,p=r.allChildren.length;b<p;b++){var w=r.allChildren[b],y=H(w,a.childrenKey),S=H(w,a.rowKey);r.allChildrenKeys.push(S),(!y||!y.length)&&r.leafNodeKeys.push(S)}return r.allChildrenKeys=fe(new Set(r.allChildrenKeys)),r.leafNodeKeys=fe(new Set(r.leafNodeKeys)),r}function tc(t,e){for(var a=t.selectedRowKeys,n=t.removeKeys,r=e||{data:[],keys:[]},o=0,l=a.length;o<l;o++){var i=a[o];n.includes(i)||r.keys.push(i)}return r}function nc(t){for(var e=t.treeDataMap,a=t.selectedRowKeys,n=[],r=0,o=a.length;r<o;r++){var l=a[r];n.push(e.get(l))}return n}function ac(t,e){var a=Ke(t),n=a.selectedRowKeys,r=a.tree,o=a.data,l=a.indeterminateSelectedRowKeys,i=W([]),u=kt(n,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),s=Pe(u,2),v=s[0],d=s[1],b=N(function(){var R;return{rowKey:t.rowKey||"id",childrenKey:((R=t.tree)===null||R===void 0?void 0:R.childrenKey)||"children"}});de([r,e,o,v],function(R){var O=Pe(R,2),_=O[0],j=O[1];!_||!j.size||_.checkStrictly||p()});function p(){if(!(!r.value||r.value.checkStrictly)){if(!v.value.length){i.value=[];return}for(var R=[],O={},_=0,j=v.value.length;_<j;_++){var A=v.value[_],T=e.value.get(A);if(!!T){var F=H(T.row,b.value.childrenKey);if(!F||!F.length)for(var P=T.parent;P;){O[P.id]||(O[P.id]=[]),O[P.id].push(T.row);var K=O[P.id].length,D=kn(e.value,P.row,b.value),m=D.allChildrenKeys,h=R.indexOf(P.id),g=v.value.indexOf(P.id);K>0&&K<m.length&&g===-1?h===-1&&R.push(P.id):h!==-1&&R.splice(h,1),P=P.parent}}}i.value=R}}function w(R,O,_){if(!(!r.value||r.value.checkStrictly)){for(var j=fe(R),A=e.value.get(O),T=A.parent;T;){var F=kn(e.value,T.row,b.value),P=F.leafNodeKeys,K=ba(P,R),D=j.indexOf(T.id);_==="uncheck"?D!==-1&&j.splice(D,1):K.length===P.length&&D===-1&&j.push(T.id),T=T.parent}return j}}function y(R,O){if(!r.value||r.value.checkStrictly){d(R,O);return}O.currentRowKey==="CHECK_ALL_BOX"?S(O):x(R,O)}function S(R){var O=[],_=[];if(R.type==="check")for(var j=fe(e.value.values()),A=0,T=j.length;A<T;A++){var F=j[A];F.disabled||(_.push(F.row),O.push(H(F.row,b.value.rowKey)))}var P=ca(ca({},R),{},{selectedRowData:_||[]});d(O,P)}function x(R,O){var _,j=fe(R);if(((_=t.tree)===null||_===void 0?void 0:_.checkStrictly)===!1){if((O==null?void 0:O.type)==="check"){var A=kn(e.value,O.currentRowData,b.value),T=A.allChildrenKeys;ar.set(O.currentRowData,A),j=fe(new Set(j.concat(T)))}else if((O==null?void 0:O.type)==="uncheck"){var F=kn(e.value,O.currentRowData,b.value),P=tc({selectedRowKeys:R,removeKeys:F.allChildrenKeys});j=P.keys}}j=w(j,O.currentRowKey,O.type);var K=nc({treeDataMap:e.value,selectedRowKeys:j}),D=ca(ca({},O),{},{selectedRowData:K});d(j,D)}return{tIndeterminateSelectedRowKeys:l.value?l:i,onInnerSelectChange:y}}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var rc=["store","dataSource","formatTreeColumn","swapData","onExpandFoldIconClick"];function To(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?To(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):To(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var oc=ze({name:"TEnhancedTable",props:Dt(Dt(Dt({},On),hl),qs),setup:function(e,a){var n=W(null),r=ec(e,a),o=r.store,l=r.dataSource,i=r.formatTreeColumn,u=r.swapData,s=r.onExpandFoldIconClick,v=Zo(r,rc),d=Kt(),b=W(o.value.treeDataMap),p=ac(e,b),w=p.tIndeterminateSelectedRowKeys,y=p.onInnerSelectChange,S=function A(T){for(var F=[],P=0,K=T.length;P<K;P++){var D,m,h=Dt({},T[P]);h=i(h),(D=h.children)!==null&&D!==void 0&&D.length&&(h.children=A(h.children)),(!h.children||(m=h.children)!==null&&m!==void 0&&m.length)&&F.push(h)}return F},x=N(function(){var A=!e.tree||!Object.keys(e.tree).length;return A?e.columns:S(e.columns)}),R=function(T){var F;e.beforeDragSort&&!e.beforeDragSort(T)||(u({current:T.current,target:T.target,currentIndex:T.currentIndex,targetIndex:T.targetIndex}),(F=e.onDragSort)===null||F===void 0||F.call(e,T))},O=function(T){var F,P;(F=e.tree)!==null&&F!==void 0&&F.expandTreeNodeOnClick&&s({row:T.row,rowIndex:T.index},"row-click"),(P=e.onRowClick)===null||P===void 0||P.call(e,T)},_=function A(T,F){if(!T)return-1;if(T.rowIndex>=0)return T.rowIndex;if(T.rowIndex<0)return A(T.parent)},j=function(T){var F=T.index;if(!F&&F!==0){if(!T.key){Be.error("Table","scrollToElement: one of `index` or `key` must exist.");return}var P=b.value.get(T.key);F=_(P,T.key),(F<0||F===void 0)&&Be.error("Table","".concat(T.key," does not exist in data, check `rowKey` or `data` please."))}n.value.scrollToElement(Dt(Dt({},T),{},{index:F}))};return a.expose(Dt(Dt({store:o.value,dataSource:l.value},v),{},{primaryTableRef:n,validateRowData:function(T){return n.value.validateRowData(T)},validateTableData:function(){return n.value.validateTableData()},clearValidateData:function(){n.value.clearValidateData()},refreshTable:function(){n.value.refreshTable()},scrollToElement:j})),function(){var A,T=Mo(),F=T.vnode,P=Dt(Dt({},F.props),{},{rowKey:e.rowKey||"id",data:l.value,columns:x.value,indeterminateSelectedRowKeys:w.value,disableDataPage:Boolean(e.tree&&Object.keys(e.tree).length),onSelectChange:y,onDragSort:R,rowClassName:function(D){var m=D.row,h=H(m,e.rowKey||"id"),g=b.value.get(h);return g?["".concat(d.value,"-table-tr--level-").concat(g.level),e.rowClassName]:[e.rowClassName]}});return(A=e.tree)!==null&&A!==void 0&&A.expandTreeNodeOnClick&&(P.onRowClick=O),L(hr,Ie(P,{ref:n}),a.slots)}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/qt(fl);qt(hr);qt(oc);var lc=rr(hr),fc=qt(lc,"TTable");export{vc as M,fc as T};
|