mirror of
https://github.com/silenty4ng/k5web
synced 2024-11-14 22:35:31 +00:00
239 lines
214 KiB
JavaScript
239 lines
214 KiB
JavaScript
|
import{u as un,r as sn,_ as cn,b as zl,o as Io,g as Hl,l as Wl,e as $l,a as En,f as Vl,h as Ul}from"./dialog.46314d29.js";import{d as Ne,c as N,f as H,w as ve,o as ht,bN as Xl,bO as Gl,b as Da,aI as L,n as It,t as Ie,i as wr,bB as Ke,bu as ql,u as Yl,x as Jl,y as Zl,bs as Lo,p as ko,r as Xn,h as Ge,aU as dn,b4 as Ql,bC as ei,g as No,s as ti}from"./arco.949c921a.js";import{c as qt,O as Re,w as Yt,W as ni,an as ai,N as Lt,b as Mo,ap as Gn,ae as ri,e as dt,aq as oi,am as li,ar as ii,ao as ui,d as gt,F as Ga,as as yr,at as si,M as Fa,J as ci,K as ir}from"./index.d4000d74.js";import{_ as Pe,i as Bo,b as qa}from"./helper.f1ff4a0e.js";import{u as kt,b as de,a as zo,_ as z}from"./useConfig.e95fe182.js";import{_ as Ho,b as Wo,o as $o,c as Cr,t as di,d as ur,T as Vo,p as Cn,P as vi,e as Uo,u as fi,f as Nt,A as Xo,g as Go,h as Ya,i as xr,E as qo,j as Yo,k as Jo,l as hi,m as ba,C as Ja,a as Zo,n as gi,q as pi,r as bi}from"./dep-6deb4e3a.d58e9bf6.js";import{f as xe,l as mi,o as Te,j as Qo,k as el,d as wi,m as Sr,n as tl,g as W,i as yi,L as nl,p as Ci}from"./index.2a3a3f52.js";import{d as xn,_ as Za,r as wn,b as al,e as xi,g as rl,c as Si,i as Oi,l as ze,I as Ri,s as Vn,v as ol}from"./form-model.b3eee910.js";import{i as Ei}from"./useDisabled.2989597b.js";import{B as ma}from"./index.d1156dd9.js";function Or(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Rr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(n),!0).forEach(function(a){cn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Or(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Di={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"}}]},_i=Ne({name:"AddRectangleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=N(()=>t.size),{className:r,style:o}=un(a),l=N(()=>["t-icon","t-icon-add-rectangle",r.value]),i=N(()=>Rr(Rr({},o.value),n.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(Di,u.value)}});const Ti=_i;function Er(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Dr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(n),!0).forEach(function(a){cn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Pi={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"}}]},Ai=Ne({name:"ChevronRightCircleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:n}=e,a=N(()=>t.size),{className:r,style:o}=un(a),l=N(()=>["t-icon","t-icon-chevron-right-circle",r.value]),i=N(()=>Dr(Dr({},o.value),n.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(Pi,u.value)}});const ji=Ai;function _r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Tr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(n),!0).forEach(functi
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var Xi={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 Gi=Ne({name:"TAffix",props:Xi,emits:["fixedChange"],setup:function(e,n){var a,r=kt("affix"),o=qt(),l=H(null),i=H(null),u=H((a=document)===null||a===void 0?void 0:a.createElement("div")),s=H(!1),v=H(!1),d=H(),p=H(),b=0,m=function(){s.value||(b=window.requestAnimationFrame(function(){var O,R;b=0;var _=(O=(R=l.value)===null||R===void 0?void 0:R.getBoundingClientRect())!==null&&O!==void 0?O:{top:0,width:0,height:0},A=_.top,j=_.width,T=_.height,F=0;d.value instanceof HTMLElement&&(F=d.value.getBoundingClientRect().top);var P,I=A-F,D=d.value[d.value instanceof Window?"innerHeight":"clientHeight"]-T,w=F+D-e.offsetBottom;if(!xn(e.offsetTop)&&I<=e.offsetTop?P=F+e.offsetTop:!xn(e.offsetBottom)&&A>=w?P=w:P=!1,i.value){var h=P!==!1,g=l.value.contains(u.value);h?(i.value.className=r.value,p.value={top:"".concat(P,"px"),width:"".concat(j,"px"),height:"".concat(T,"px"),zIndex:e.zIndex},g||(u.value.style.width="".concat(j,"px"),u.value.style.height="".concat(T,"px"),l.value.appendChild(u.value))):(i.value.removeAttribute("class"),p.value=void 0,g&&u.value.remove()),n.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=Za(wn.mark(function O(){return wn.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,It();case 2:if(!v.value){_.next=4;break}return _.abrupt("return");case 4:d.value=mi(e.container),Te(d.value,"scroll",m),Te(window,"resize",m),v.value=!0;case 8:case"end":return _.stop()}},O)}));return function(){return x.apply(this,arguments)}}(),S=function(){!d.value||!v.value||(xe(d.value,"scroll",m),xe(window,"resize",m),b&&window.cancelAnimationFrame(b),v.value=!1)};return ve(function(){return e.offsetTop},function(){m()}),ve(function(){return e.offsetBottom},function(){m()}),ve(function(){return e.zIndex},function(){m()}),ht(y),Xl(y),Gl(S),Da(S),{affixWrapRef:l,affixRef:i,bindScroll:y,unbindScroll:S,handleScroll:m,scrollContainer:d,renderTNodeJSX:o,affixStyle:p}},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 Qn=Yt(Gi);/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var qi=Qo,Yi=Ho,Ji=Wo,Zi=ni,Qi=ai,eu=el,tu=200;function nu(t,e,n,a){var r=-1,o=Yi,l=!0,i=t.length,u=[],s=e.length;if(!i)return u;n&&(e=Zi(e,Qi(n))),a?(o=Ji,l=!1):e.length>=tu&&(o=eu,l=!1,e=new qi(e));e:for(;++r<i;){var v=t[r],d=n==null?v:n(v);if(v=a||v!==0?v:0,l&&d===d){for(var p=s;p--;)if(e[p]===d)continue e;u.push(v)}else o(e,d,a)||u.push(v)}return u}var au=nu;/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var ll={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 il=Symbol("RadioGroupProvide"),ul=Symbol("RadioButtonProvide");/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Nr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function ru(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ou(t){var e={};return Object.keys(t).forEach(function(n){xn(t[n])||(e[n]=t[n])}),e}var sr=Ne({name:"TRadio",inheritAttrs:!1,props:ru({},ll),setup:function(e,n){var a=n.attrs,r=H(),o=Ie(e),l=o.checked,i=o.modelValue,u=al(l,i,e.defaultChecked,e.onChange,"checked"),s=Pe(u,2),v=s[0],d=s[1],p=N(function(){return b?e.value===b.value:v.value}),b=wr(il,void 0),m=N(function(){return Boolean(e.allowUncheck||(b==null?void 0:b.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}),!(p.value&&!m.value)))if(b){var C=p.value&&m.value?void 0:e.value;b.setValue(C,{e:c})}else{var E=m.value?!p.value:!0;d(E,{e:c})}},x=N(function(){return ou({focus:a.onFocus,blur:a.onBlur,keydown:a.onKeydown,keyup:a.onKeyup,keypresss:a.onKeypresss})}),O=N(function(){var g=[].concat(de(Object.keys(x.value)),["input","change"]).map(function(c){return"on".concat(c[0].toUpperCase()).concat(c.slice(1))});return $o(a,g)}),R=N(function(){return b==null?void 0:b.disabled}),_=xi(R),A=N(function(){return{name:b?b.name:e.name,checked:p.value,disabled:_.value,readonly:e.readonly,value:e.value}}),j=zo(),T=j.STATUS,F=wr(ul,void 0),P=kt("radio-button"),I=kt("radio"),D=N(function(){return F?P.value:I.value}),w=N(function(){return["".concat(D.value),z(z({},T.value.checked,A.value.checked),T.value.disabled,A.value.disabled)]}),h=Mo();return function(){return L("label",Ke({ref:r,class:w.value},O.value,{tabindex:_.value?void 0:"0",onClick:S}),[L("input",Ke({type:"radio",class:"".concat(D.value,"__former")},x.value,A.value,{onClick:y,tabindex:"-1","data-value":Lt(e.value)?"'".concat(e.value,"'"):e.value,"data-allow-uncheck":m.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 lu={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 iu(t,e){var n=function(r){var o=Cr.test(r.key)||Cr.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})}}};ht(function(){Te(t.value,"keydown",n)}),ql(function(){xe(t.value,"keydown",n)})}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var uu=["window"],su=typeof window<"u"?window:void 0;function cu(t){var e,n=Yl(t);return(e=n==null?void 0:n.$el)!==null&&e!==void 0?e:n}function du(t){return Jl()?(Zl(t),!0):!1}function vu(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n.window,r=a===void 0?su:a,o=rl(n,uu),l,i=r&&"MutationObserver"in r,u=function(){l&&(l.disconnect(),l=void 0)},s=ve(function(){return cu(t)},function(d){u(),i&&r&&d&&(l=new MutationObserver(e),l.observe(d,o))},{immediate:!0}),v=function(){u(),s()};return du(v),{isSupported:i,stop:v}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ka(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var fu=Ne({name:"TRadioGroup",props:Ka({},lu),setup:function(e){var n=Ie(e),a=n.value,r=n.modelValue,o=al(a,r,e.defaultValue,e.onChange),l=Pe(o,2),i=l[0],u=l[1],s=H(),v=kt("radio-button"),d=zo(),p=d.STATUS,b=d.SIZE;iu(s,u);var m=N(function(){return".".concat(v.value,".").concat(p.value.checked)}),y=H({width:"0px",height:"0px",left:"0px",top:"0px","transition-property":"none"}),S=function(){var w=document.createElement("div");w.setAttribute("style","position: absolute; visibility: hidden;"),w.appendChild(s.value.cloneNode(!0)),document.body.appendChild(w);var h=w.querySelector(m.value),g=h.offsetWidth,c=h.offsetHeight,f=h.offsetLeft,C=h.offsetTop;y.value=Ka(Ka({},y.value),{},{width:"".concat(g,"px"),height:"".concat(c,"px"),left:"".concat(f,"px"),top:"".concat(C,"px")}),document.body.removeChild(w)},x=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(e.variant!=="outline"){var h=s.value.querySelector(m.value),g=w?"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()}},O;ve(i,Za(wn.mark(function D(){return wn.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,It();case 2:x();case 3:case"end":return h.stop()}},D)}))),ht(function(){x(!0),Si(s,di(Za(wn.mark(function w(){return wn.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,It();case 2:x();case 3:case"end":return g.stop()}},w)})),300));var D=s.value.querySelector("".concat(m.value," .").concat(v.value,"__label"));D&&(O=vu(D,function(w){w.forEach(function(h){h.type==="characterData"&&x()})},{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}),Lo(function(){var D;(D=O)===null||D===void 0||D.stop()});var R=Ie(e),_=R.name,A=R.disabled;ko(il,Xn({name:_,disabled:A,value:i,allowUncheck:e.allowUncheck,setValue:u}));var j=kt("radio-group"),T=Gn(),F=function(){if(e.variant.includes("filled")&&!Oi(i.value))return L("div",{style:y.value,class:"".concat(j.value,"__bg-block")},null)},P=function(){var w;return(w=e.options)===null||w===void 0?void 0:w.map(function(h){var g=h;return(Bo(h)||Lt(h))&&(g={value:h,label:h.toString()}),L(sr,{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(Ge):g.label]}})})},I=N(function(){return["".concat(j.value),b.value[e.size],z(z(z({},"".concat(j.value,"__outline"),e.variant==="outline"),"".concat(j.value,"--filled"),e.variant.includes("filled")),"".concat(j.value,"--primary-filled"),e.variant==="primary-filled")]});return function(){return L("div",{ref:s,class:I.value},[T("default")||P(),F()])}}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Br(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ia(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Br(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function hu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var gu=Ne({name:"TRadioButton",inheritAttrs:!1,props:Ia({},ll),setup:function(e,n){var a=n.attrs;ko(ul,Xn({}));var r=N(function(){var l=Ia(Ia({},e),$o(a,Object.keys(a).filter(function(i){return i.startsWith("on")})));return l}),o=Mo();return function(){var l;return L(sr,r.value,hu(l=o("default","label"))?l:{default:function(){return[l]}})}}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var pu=Yt(sr),bu=Yt(fu);Yt(gu);/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function zr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Kn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var _a=function(e){var n=Kn({},e),a=document.createElement("div"),r=H(!1),o=n.className,l=n.style,i=o,u=function(y,S){if(y){if(i&&i!==y){var x;(x=a.firstElementChild.classList).remove.apply(x,de(i.split(" ").map(function(O){return O.trim()})))}y.split(" ").forEach(function(O){a.firstElementChild.classList.add(O.trim())})}S&&(a.firstElementChild.style.cssText+=S),i=y},s=Ne({setup:function(y,S){var x=S.expose,O=H(n);ht(function(){r.value=!0,document.activeElement.blur(),It(function(){u(o,l)})});var R=function(A){O.value=Kn(Kn({},n),A)};return x({update:R}),function(){var _=n.onClose||function(){r.value=!1};return delete n.className,delete n.style,Ge(zl,Kn({onClose:_,visible:r.value},O.value))}}}),v=Ql(s),d=v.mount(a),p=wi(n.attach);p?p.appendChild(a):console.error("attach is not exist");var b={show:function(){r.value=!0},hide:function(){r.value=!1},update:function(y){d.update(Io(y,["className","style"])),u(y.className,y.style)},destroy:function(){r.value=!1,setTimeout(function(){v.unmount(),a.remove()},300)},setConfirmLoading:function(y){d.update({confirmLoading:y})}};return b},mu=function(e){return _a(e)},wu=function(e){var n=Kn({},e);return n.cancelBtn=null,_a(n)},wa={confirm:mu,alert:wu},cr=_a;cr.install=function(t){t.config.globalProperties.$dialog=_a,Object.keys(wa).forEach(function(e){t.config.globalProperties.$dialog[e]=wa[e]})};Object.keys(wa).forEach(function(t){cr[t]=wa[t]});/**
|
||
|
* 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 sl(t,e){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=n,r=0,o=t.length;r<o;r++){var l,i=t[r];if(e.set(i,n),i!=null&&(l=i.children)!==null&&l!==void 0&&l.length){var u=sl(i.children,e,n+1);u>a&&(a=u)}}return a}function cl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e,a=(t==null?void 0:t.children)||[],r=0,o=a.length;r<o;r++){var l=a[r];l.children?n=cl(l,n):n+=1}return n}function yu(t){var e=new Map,n=sl(t,e),a=new Map,r=function l(i,u){for(var s=0,v=i.length;s<v;s++){var d,p=i[s],b=p.children?1:n-e.get(p)+1,m=p.children?cl(p):1,y={};b>1&&(y.rowspan=b),m>1&&(y.colspan=m),a.set(p,y),p!=null&&(d=p.children)!==null&&d!==void 0&&d.length?l(p.children,u):u.push(p)}},o=[];return r(t,o),{rowspanAndColspanMap:a,leafColumns:o}}function Cu(t){var e=function a(r,o){for(var l,i=[],u=[],s=0,v=r.length;s<v;s++){var d,p=r[s],b=[p];i=i.concat(b),p!=null&&(d=p.children)!==null&&d!==void 0&&d.length&&(u=u.concat(p.children))}return(l=u)!==null&&l!==void 0&&l.length&&a(u,o),o.push(i),i},n=[];return e(t,n),n=n.reverse(),n}/**
|
||
|
* 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
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Hr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function xu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Su(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var dr=Ne({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 n=H(),a=H(!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(){!n.value||(a.value=Sr(n.value))},i=function(){!n.value||(a.value=Sr(n.value))},u=ur(function(s){s.type==="mouseleave"?i():l()},80);return{root:n,isOverflow:a,ellipsisClasses:r,innerEllipsisClassName:o,onMouseAround:u}},render:function(){var e=ri(this,"default","content"),n=L("div",{ref:"root",class:this.ellipsisClasses,onMouseenter:this.onMouseAround,onMouseleave:this.onMouseAround},[e]),a=null,r=this.tooltipProps;if(this.isOverflow){var o=xu({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);a=L(Vo,o,Su(n)?n:{default:function(){return[n]}})}else a=n;return a}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Wr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function $r(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Ou(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}function Ta(t,e,n){var a={col:e,colIndex:n};return Re(e.title)?e.title(Ge,a):Lt(e.title)&&t[e.title]?t[e.title](a):Re(e.render)&&e.render(Ge,$r($r({},a),{},{type:"title",row:{},rowIndex:-1}))||e.title}function dl(t){var e=ot(),n=e.tableSortClasses,a=e.tableFilterClasses,r=N(function(){return yu(t.columns)}),o=N(function(){return Cu(t.columns)}),l=N(function(){return o.value.length>1}),i=function(s,v,d,p,b,m){var y=Pe(s,3),S=y[0],x=y[1],O=y[2],R=z(z({},n.sortable,x),a.filterable,O),_=Re(p)?p(Ge,{col:v,colIndex:d}):void 0,A=Boolean(p!==void 0?p:v.ellipsis);return L("div",{class:R},[L("div",{class:n.title},[A?L(dr,{placement:"bottom",attach:t.attach||(b?function(){return b}:void 0),tooltipContent:_&&function(){return _},tooltipProps:dt(p)==="object"?p:void 0,classPrefix:m==null?void 0:m.classPrefix,overlayClassName:m==null?void 0:m.ellipsisOverlayClassName},Ou(S)?S:{default:function(){return[S]}}):L("div",null,[S]),Boolean(x||O)&&L("div",{class:a.iconWrap},[x,O])])])};return{thList:o,isMultipleHeader:l,spansAndLeafNodes:r,renderTitleWidthIcon:i}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Vr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ru(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Eu=80,Du=600,Ur=8;function _u(t){var e=t.isWidthOverflow,n=t.tableContentRef,a=t.showColumnShadow,r=t.getThWidthList,o=t.updateThWidthList,l=t.setTableElmWidth,i=t.updateTableAfterColumnResize,u=t.onColumnResizeChange,s=H(),v=H({}),d=H([]),p,b;ht(function(){var w=typeof document<"u";p=w?document.onselectstart:null,b=w?document.ondragstart:null});var m=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 w(h,g){!h||(d.value=h,h.forEach(function(c,f){var C=m(h,f-1,"prev"),E=m(h,f+1,"next"),k=g?v.value[g.colKey].prev:E,K=g?v.value[g.colKey].next:C,M=f===0?k:C,$=f===h.length-1?K:E;v.value[c.colKey]={prev:M,next:$,current:{prevSibling:m(h,f-1,"prev"),nextSibling:m(h,f+1,"next")}},w(c.children,c)}))},S={isDragging:!1,draggingCol:null,draggingStart:0,effectCol:"next"},x=Xn({display:"none",height:"10px",left:"10px",bottom:"0"}),O=function(h){return h.fixed==="right"&&a.right},R=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<=Ur,k=h.pageX-C.left<=Ur,K=O(g);if(E||K){var M,$=(M=g.resizable)!==null&&M!==void 0?M:!0;if($){c.style.cursor=E||K&&k?"col-resize":"";var q=E&&!K||K&&k;S.draggingCol=q?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=Bo(h.minWidth)?h.minWidth:parseInt(h.minWidth||"0",10);return{minColWidth:Math.max(((g=h.resize)===null||g===void 0?void 0:g.minWidth)||Eu,f),maxColWidth:((c=h.resize)===null||c===void 0?void 0:c.maxWidth)||Du}},A=function(h,g,c,f){var C=c.right-f.left,E=c.left-f.left,k=S.effectCol==="next"?h:g,K=_(k),M=K.minColWidth,$=K.maxColWidth;return{resizeLinePos:C,minResizeLineLeft:E+M,maxResizeLineLeft:E+$}},j=function(h,g,c,f,C){var E=f.left-C.left,k=h.dataset.colkey===g.colKey?g:c,K=f.left-C.left,M=_(k),$=M.minColWidth,q=M.maxColWidth;return{resizeLinePos:E,minResizeLineLeft:K+(f.width-q),maxResizeLineLeft:K+(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,K=E.maxColWidth,M=h[g.colKey]+c;C=M<k||M>K}return!(C||e.value||f===d.value.length-1)},I=function(h,g,c,f){return g?A(h,g,c,f):T(c,f)},D=function(h,g,c){var f,C,E;if(!!S.draggingCol){var k=S.draggingCol,K=k.getBoundingClientRect(),M=(f=n.value)===null||f===void 0?void 0:f.getBoundingClientRect(),$=(C=v.value[g.colKey])===null||C===void 0?void 0:C.next,q=(E=v.value[g.colKey])===null||E===void 0?void 0:E.prev,ee=O(g)?j(k,g,$,K,M):I(g,$,K,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-K.top,"px"),x.left="".concat(ne,"px");var B=n.value.parentElement.getBoundingClientRect();x.bottom="".concat(B.bottom-M.bottom,"px")}var X=function Y(){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 Ye=S.effect
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Tu(){}var Pu=Tu,La=oi,Au=Pu,ju=tl,Fu=1/0,Ku=La&&1/ju(new La([,-0]))[1]==Fu?function(t){return new La(t)}:Au,Iu=Ku,Lu=Qo,ku=Ho,Nu=Wo,Mu=el,Bu=Iu,zu=tl,Hu=200;function Wu(t,e,n){var a=-1,r=ku,o=t.length,l=!0,i=[],u=i;if(n)l=!1,r=Nu;else if(o>=Hu){var s=e?null:Bu(t);if(s)return zu(s);l=!1,r=Mu,u=new Lu}else u=e?[]:i;e:for(;++a<o;){var v=t[a],d=e?e(v):v;if(v=n||v!==0?v:0,l&&d===d){for(var p=u.length;p--;)if(u[p]===d)continue e;e&&u.push(d),i.push(v)}else r(u,d,n)||(u!==i&&u.push(d),i.push(v))}return i}var $u=Wu,Vu=au,Uu=$l,Xr=$u;function Xu(t,e,n){var a=t.length;if(a<2)return a?Xr(t[0]):[];for(var r=-1,o=Array(a);++r<a;)for(var l=t[r],i=-1;++i<a;)i!=r&&(o[r]=Vu(o[r]||l,t[i],e,n));return Xr(Uu(o,1),e,n)}var Gu=Xu,qu=ii,Yu=li,Ju=Gu,Zu=ui,Qu=Wl,es=Yu(function(t){var e=Qu(t);return e=typeof e=="function"?e:void 0,Ju(qu(t,Zu),void 0,e)}),ts=es;function Gr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function hn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function vr(t,e,n,a){var r=n==null?void 0:n.get(t.colKey||e);if(!r)return{};var o=z(z(z(z({},a.left,t.fixed==="left"),a.right,t.fixed==="right"),a.lastLeft,t.fixed==="left"&&r.lastLeftFixedCol),a.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 ns(t,e,n,a,r,o){if(!a||!a.length)return{style:void 0,classes:void 0};var l=e<a[0],i=e>n-1-a[1],u=n-a[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 as(t,e,n,a){var r=Ie(t),o=r.columns,l=r.tableLayout,i=r.tableContentWidth,u=r.fixedRows,s=r.firstFullRow,v=r.lastFullRow,d=r.maxHeight,p=r.headerAffixedTop,b=r.footerAffixedBottom,m=r.bordered,y=r.resizable,S=r.allowResizeColumnWidth,x=H([]),O=H(),R=H(),_=H(!1),A=H(!1),j=H(),T=H(6),F=H(new Map),P=Xn({left:!1,right:!1}),I=H({left:0,top:0}),D=H(0),w=H(0),h=H({}),g=H(!1),c=H(!1),f=H(!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){j.value=re}function K(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&&K(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=
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function qr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function rs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function os(t,e){var n=Ie(t),a=n.pagination,r=n.data,o=n.disableDataPage,l=gt(),i=l.classPrefix,u=H(t.pagination),s=H([]),v=H(!1),d=function(){var m=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 O=(m-1)*y,R=m*y;s.value=S.slice(O,R)}else s.value=S};ve(function(){var b,m;return[(b=a.value)===null||b===void 0?void 0:b.current,(m=a.value)===null||m===void 0?void 0:m.pageSize,r.value.length,o]},function(){if(!(!a.value||!a.value.current)){var b=a.value,m=b.current,y=b.pageSize;u.value={current:m,pageSize:y},d(a.value.current,a.value.pageSize)}},{immediate:!0}),ve([r],function(){var b,m;if(!(!a.value||!a.value.defaultCurrent)){var y=Boolean(a.value.current);y||d((b=u.value.current)!==null&&b!==void 0?b:a.value.defaultCurrent,(m=u.value.pageSize)!==null&&m!==void 0?m:a.value.defaultPageSize)}},{immediate:!0});var p=function(){if(!t.pagination)return null;var m=rs({},t.pagination);return delete m.onChange,L("div",{class:"".concat(i.value,"-table__pagination")},[L(vi,Ke(m,{onChange:function(S){var x,O,R;(x=t.pagination)===null||x===void 0||(O=x.onChange)===null||O===void 0||O.call(x,S),u.value=S,d(S.current,S.pageSize),(R=t.onPageChange)===null||R===void 0||R.call(t,S,s.value)}}),{totalContent:e.slots.totalContent})])};return{isPaginateData:v,dataSource:s,innerPagination:u,renderPagination:p}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function ls(t){var e=H(),n=H(),a=H(),r=H(),o=H(),l=H(!0),i=H(!0),u=H(!0),s=!1,v=!1,d=N(function(){return t.scroll&&t.scroll.type==="virtual"&&(t.scroll.threshold||100)<t.data.length}),p=N(function(){return!!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom)}),b=0,m=function(B){if(!(!p.value&&!d.value)){var X=B;if(!X&&e.value&&(b=0,X=e.value),!!X){var Q=X.scrollLeft;if(b!==Q){b=Q;for(var Y=[e.value,n.value,a.value,r.value],se=0,he=Y.length;se<he;se++)Y[se]&&B!==Y[se]&&(Y[se].scrollLeft=Q)}}}},y=function(B,X,Q){return X.top+Q<B.top&&B.top>B.height},S=function(B){return Ei(B)?0:B.offsetTop||0},x=function(){var B,X,Q;if(!(!p.value&&!d.value)){var Y=(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=a.value)===null||Q===void 0?void 0:Q.getBoundingClientRect();if((t.headerAffixedTop||d.value)&&n.value){var Ve=S(t.headerAffixProps||t.headerAffixedTop),Ye=(Le==null?void 0:Le.height)||0,Me=Math.abs(Y.top)<Y.height-he-Ve-Ye;d.value&&(Me=Y.top>-1*se.height),l.value=Me}if(t.footerAffixedBottom&&a!==null&&a!==void 0&&a.value)i.value=y(Le,Y,he);else if(t.horizontalScrollAffixedBottom&&r!==null&&r!==void 0&&r.value){var lt=r.value.getBoundingClientRect();i.value=y(lt,Y,he)}if(t.paginationAffixedBottom&&o.value){var pt=o.value.getBoundingClientRect();u.value=y(pt,Y,he)}}},O=function(){x()},R=function(){m(a.value)},_=function(){m(n.value)},A=function(){m(r.value)},j=function(){m(e.value)},T=function(){Te(a.value,"scroll",R)},F=function(){xe(a.value,"scroll",R)},P=function(){Te(n.value,"scroll",_),C()},I=function(){s||xe(n.value,"scroll",_),E()},D=function(){Te(r.value,"scroll",A)},w=function(){xe(r.value,"scroll",A)},h=function(){Te(e.value,"scroll",j),C()},g=function(){s||xe(e.value,"scroll",j),E()},c=function(){s=!0},f=function(){s=!1,v||(xe(n.value,"scroll",_),xe(e.value,"scroll",j))},C=function(){v=!0},E=function(){v=!1},k=[],K=function(B){var X=ur(function(he){xe(B,"scroll",he)},200);function Q(){m(B),X(Q)}function Y(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",Y);function se(){xe(B,"touchstart",Y)}return{removeElementTouchScrollListener:se}},M=[],$=function(){M.forEach(function(B){return B()}),M.length=0},q=function(){xe(window,"mousedown",c),xe(window,"mouseup",f),$(),n.value&&(xe(n.value,"mouseenter",P),xe(n.value,"mouseleave",I)),a.value&&(xe(a.value,"mouseenter",T),xe(a.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",w))},ee=function(){if(Te(window,"mousedown",c),Te(window,"mouseup",f),q(),n.value){Te(n.value,"mouseenter",P),Te(n.value,"mouseleave",I);var B=K(n.value),X=B.removeElementTouchScrollListener;M.push(X)}if(t.footerAffixedBottom&&a.value){Te(a.value,"mouseenter",T),Te(a.value,"mouseleave",F);var Q=K(a.value),Y=Q.removeElementTouchScrollListener;M.push(Y)}if(t.horizontalScrollAffixedBottom&&r.value){Te(r.value,"mouseenter",D),Te(r.value,"mouseleave",w);var se=K(r.value),he=se.removeElementTouchScrollListener;M.push(he)}if((p.value||d.value)&&e.value){Te(e.value,"mouseenter",h),Te(e.value,"mouseleave",g);var Le=K(e.value),Ve=Le.removeElementTouchScrollListener;M.push(Ve)}},ne=function(){if(!(!p.value&&!t.paginationAffixedBottom))var B=setTimeout(function(){p.value||t.paginationAffixedBottom?Te(document,"scroll",O):xe(document,"scroll",O),clearTimeout(B)})};ve([n,a,r,e],function(){ee(),m(),x()}),ve(p,ne),ve(function(){return[t.data,t.columns,t.headerAffixedTop,t.footerAffixedBottom,t.horizontalScrollAffixedBottom]},function(){m()}),Da(function(){xe(document,"scroll",O),q(),n.value=null,a.value=null,r.value=null,e.value=null});var ae=function(B){e.value=B,ne()};return{showAffixHeader:l,showAffixFooter:i,showAffixPagination:u,affixHeaderRef:n,affixFooterRef:a,horizontalScrollbarRef:r,paginationRef:o,onHorizontalSc
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function fr(t,e){if(!!t){for(var n=t instanceof Array?t:[t],a={},r=0;r<n.length;r++){var o=n[r];if(!!o){var l=Re(o)?o(e):o;a=l instanceof Array?fr(l,e):Object.assign(a,l)}}return a}}function hr(t,e,n){for(var a=t instanceof Array?t:[t],r=e.row,o=e.rowIndex,l=[],i=0,u=a.length;i<u;i++){var s=a[i],v=Re(s)?s(e):s;if(Ga(v)&&!(v instanceof Array)){v[o]&&(v=v[o]);var d=W(r,n||"id");v[d]&&(v=v[d])}else v instanceof Array&&(v=hr(v,e,n));l=l.concat(v)}return l}function vl(t,e){for(var n=t instanceof Array?t:[t],a=[],r=0,o=n.length;r<o;r++){var l=n[r];Re(l)?a.push(l(e)):a.push(l)}return a}function fl(t,e){if(!(!t||!e)){var n=t==null?void 0:t.find(function(i){return i.colKey===e});if(n)return n;for(var a=0,r=t.length;a<r;a++){var o;if((o=t[a])!==null&&o!==void 0&&(o=o.children)!==null&&o!==void 0&&o.length){var l;return fl((l=t[a])===null||l===void 0?void 0:l.children,e)}}}}function ea(t,e){return dt(t)==="object"?t:dt(e)==="object"?e:{}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function is(t,e,n){var a=N(function(){return Math.max(n.rowHeight||48,48)}),r=H(!1),o=N(function(){return(n==null?void 0:n.type)==="lazy"&&!r.value}),l=!yi&&window.requestAnimationFrame||function(u){return setTimeout(u,16.6)},i=function(){r.value||l(function(){r.value=!0})};return ht(function(){(n==null?void 0:n.type)==="lazy"&&It(function(){var u=Math.max(10,n.bufferSize||10),s=a.value*u;!(e!=null&&e.value)||!(t!=null&&t.value)||Uo(e.value,t.value,i,s)})}),{hasLazyLoadHolder:o,tRowHeight:a}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Un(t,e,n,a){var r=W(t,e);return r===void 0&&ze.error("Table","rowKey is wrong, can not get unique identifier of row."),[r,n||a].join("_")}function hl(t,e,n,a){var r=H(new Map),o=function(u,s){var v=u.rowIndex,d=u.colIndex;if(!(!s.rowspan&&!s.colspan)){for(var p=v+(s.rowspan||1),b=d+(s.colspan||1),m=v;m<p;m++)for(var y=d;y<b;y++)if(m!==v||y!==d){if(!t.value[m]||!e.value[y])return;var S=Un(t.value[m],n.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 p=0,b=u.length;p<b;p++)for(var m=u[p],y=0,S=s.length;y<S;y++){var x=s[y],O={row:m,col:x,rowIndex:p,colIndex:y},R=Un(m,n.value,x.colKey,y),_=r.value.get(R)||{},A=v(O)||{};(A.rowspan||A.colspan||_.rowspan||_.colspan)&&(A.rowspan&&(_.rowspan=A.rowspan),A.colspan&&(_.colspan=A.colspan),r.value.set(R,_)),o==null||o(O,_)}};return ve(function(){return[t.value,e.value,a]},function(){l(t.value,e.value,a==null?void 0:a.value)},{immediate:!0}),{skipSpansMap:r}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Yr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function rt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function us(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var gl=["rowKey","rowClassName","columns","fixedRows","footData","rowAttributes","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup"],pl=["click","dblclick","mouseover","mousedown","mouseenter","mouseleave","mouseup"];function ya(t,e,n){var a=t.col,r=t.row,o=t.rowIndex;if(a.colKey==="serial-number"){var l=(n==null?void 0:n.pagination)||{},i=l.current,u=l.pageSize,s=l.defaultCurrent,v=l.defaultPageSize,d=i||s,p=u||v;return p&&d?p*(d-1)+o+1:o+1}if(Re(a.cell))return a.cell(Ge,t);if(e[a.colKey])return e[a.colKey](t);if(Lt(a.cell)&&e[a.cell])return e[a.cell](t);if(Re(a.render))return a.render(Ge,rt(rt({},t),{},{type:"cell"}));var b=W(r,a.colKey);return[void 0,"",null].includes(b)?n!=null&&n.cellEmptyContent?Re(n.cellEmptyContent)?n.cellEmptyContent(Ge,t):n.cellEmptyContent:e.cellEmptyContent?e.cellEmptyContent(t):e["cell-empty-content"]?e["cell-empty-content"](t):b:b}var ss=Ne({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,gl)),{},{tableElm:{},tableContentElm:{}}),emits:["row-mounted"],setup:function(e,n){var a=Ie(e),r=a.tableContentElm,o=a.active,l=a.isHover,i=H(null),u=ot(),s=u.tdEllipsisClass,v=u.tableBaseClass,d=u.tableColFixedClasses,p=u.tableRowFixedClasses,b=u.tdAlignClasses,m=u.tableDraggableClasses,y=N(function(){return ns(W(e.row,e.rowKey||"id"),e.rowIndex,e.dataLength,e.fixedRows,e.rowAndColFixedPosition,p)}),S=N(function(){return fr(e.rowAttributes,{row:e.row,rowIndex:e.rowIndex,type:"body"})||{}}),x=N(function(){var P,I=hr(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,I,z(z({},"".concat(e.classPrefix,"-table__row--active"),o.value),"".concat(e.classPrefix,"-table__row--hover"),l.value)].filter(function(D){return D})}),O=is(r,i,Xn(rt(rt({},e.scroll),{},{rowIndex:e.rowIndex}))),R=O.hasLazyLoadHolder,_=O.tRowHeight,A=function(I,D){var w={};return pl.forEach(function(h){w["on".concat(yr(h))]=function(g){var c,f={e:g,row:I,index:D};(c=e["onRow".concat(yr(h))])===null||c===void 0||c.call(e,f)}}),w},j=function(){var I;(I=e.virtualConfig)!==null&&I!==void 0&&I.isVirtualScroll.value&&n.emit("row-mounted",{ref:i,data:e.row})};ht(function(){It(function(){j()})}),ei(function(){It(function(){j()})});function T(P,I){var D=I.cellNode,w=P.col,h=P.colIndex,g;Re(w.ellipsis)?g=w.ellipsis(Ge,P):dt(w.ellipsis)==="object"&&Re(w.ellipsis.content)?g=w.ellipsis.content(Ge,P):n.slots["ellipsis-".concat(w.colKey)]?g=n.slots["ellipsis-".concat(w.colKey)](P):n.slots.ellipsis&&(g=n.slots.ellipsis(P));var c={};dt(w.ellipsis)==="object"&&(c="props"in w.ellipsis?w.ellipsis.props:w.ellipsis||void 0);var f=e.tableElm,C=h===0?"top-left":"top";return C=h===e.columns.length-1?"top-right":C,L(dr,{placement:C,attach:f?function(){return f}:void 0,tooltipContent:g&&function(){return g},tooltipProps:c,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},us(D)?D:{default:function(){return[D]}})}function F(P,I){var D=P.col,w=P.colIndex,h=P.rowIndex,g=I.cellSpans,c=I.dataLength,f=I.rowAndColFixedPosition,C=ya(P,n.slots,{cellEmptyContent:I.cellEmptyContent,pagination:e.pagi
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Jr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function ta(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var bl=["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"],cs=Ne({name:"TBody",props:ta({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,bl)),setup:function(e){var n=qt(),a=Ie(e),r=a.data,o=a.columns,l=a.rowKey,i=a.rowspanAndColspan,u=gt("table",e.locale),s=u.t,v=u.globalConfig,d=ot(),p=d.tableFullRowClasses,b=d.tableBaseClass,m=hl(r,o,l,i),y=m.skipSpansMap,S=N(function(){return[b.body]});return{t:s,globalConfig:v,renderTNode:n,tableFullRowClasses:p,tbodyClasses:S,tableBaseClass:b,skipSpansMap:y}},render:function(){var e=this,n,a,r,o,l=function(x){var O=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(O,"px")}:{}},[e.renderTNode("empty")||e.t(e.globalConfig.empty)])])])},i=function(x,O){var R=si(O),_=e.renderTNode(R);if(["",null,void 0,!1].includes(_))return null;var A=e.isWidthOverflow&&e.columns.find(function(F){return F.fixed==="left"}),j=[e.tableFullRowClasses.base,e.tableFullRowClasses[R]],T=e.bordered?e.tableWidth-2:e.tableWidth;return L("tr",{class:j,key:"key-full-row-".concat(O)},[L("td",{colspan:x},[L("div",{class:z({},e.tableFullRowClasses.innerFullRow,A),style:A?{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"];(n=this.data)===null||n===void 0||n.forEach(function(S,x){var O,R=e.rowKey||"id",_=W(S,R),A=ta(ta({},Cn(e.$props,gl)),{},{rowKey:R,row:S,columns:e.columns,rowIndex:S.VIRTUAL_SCROLL_INDEX||x,dataLength:s,skipSpansMap:e.skipSpansMap,virtualConfig:e.virtualConfig,active:(O=e.activeRow)===null||O===void 0?void 0:O.includes(_),isHover:e.hoverRow===_},Cn(e.$props,d));e.onCellClick&&(A.onCellClick=e.onCellClick);var j=L(ss,Ke({key:W(S,e.rowKey||"id")||x},A,{onRowMounted:e.handleRowMounted}),e.$slots);if(v.push(j),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 p=[i(u,"first-full-row")].concat(v,[i(u,"last-full-row")]),b=!((a=this.data)!==null&&a!==void 0&&a.length)&&!this.loading&&!this.firstFullRow&&!this.lastFullRow,m="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:m,"-ms-transform":m,"-moz-transform":m,"-webkit-transform":m}:void 0;return L("tbody",{class:this.tbodyClasses,style:ta({},y)},[b?l(this.columns):p])}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Mn(t){return t&&(isNaN(Number(t))?t:"".concat(t,"px"))}function ml(t){var e=Ie(t),n=e.size,a=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,p=v.tableAlignClasses,b=fi(),m=b.sizeClassNames,y=gt("table",t.locale),S=y.globalConfig,x=N(function(){var A;return(A=n.value)!==null&&A!==void 0?A:S.value.size}),O=N(function(){return[d.table,z(z(z(z(z(z(z(z({},m[x.value],x.value!=="medium"),d.bordered,a.value),d.striped,r.value),d.hover,o.value),d.loading,t.loading),d.affixedHeader,t.headerAffixedTop),d.rowspanAndColspan,t.rowspanAndColspan),p[l.value],l.value!=="middle")]}),R=N(function(){return{height:Mn(i.value),maxHeight:Mn(u.value)}}),_=N(function(){return{width:Mn(s.value)}});return{tableClasses:O,sizeClassNames:m,tableElementStyles:_,tableContentStyles:R}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Zr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Vt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zr(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ds(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var Qr=Ne({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,n){var a=n.slots,r=H(),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={},p=e.thList[0],b=0,m=p.length;b<m;b++){var y=p[b];if(y.colspan>1)for(var S=b+1;S<b+y.colspan;S++)p[S]&&(d[p[S].colKey]=!0)}return d}),v=function(p){for(var b=p;b;){var m;if(b=b.parentNode,(m=b)!==null&&m!==void 0&&(m=m.classList)!==null&&m!==void 0&&m.contains("".concat(e.classPrefix,"-table")))break}return b};return Vt(Vt({},o),{},{colspanSkipMap:s,theadClasses:u,theadRef:r,slots:a,getTableNode:v})},render:function(){var e=this,n=function(r,o){var l=new Map,i=e.spansAndLeafNodes.rowspanAndColspanMap;return e.thList.map(function(u,s){var v=u.map(function(d,p){var b;if(e.colspanSkipMap[d.colKey])return null;var m=i.get(d);if(p===0&&m.rowspan>1)for(var y=s+1;y<s+m.rowspan;y++)l.set(e.thList[y][0],!0);var S=vr(d,p,r,e.tableColFixedClasses),x={col:d,colIndex:p,row:{},rowIndex:-1},O=vl(d.className,Vt(Vt({},x),{},{type:"th"})),R=e.showColumnShadow.left&&d.fixed==="left",_=e.showColumnShadow.right&&d.fixed==="right",A=e.thDraggable&&!(R||_),j=[S.classes,O,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,A)],T=!((b=d.children)!==null&&b!==void 0&&b.length),F=T&&o!==null&&o!==void 0&&o[d.colKey]?"".concat(o==null?void 0:o[d.colKey],"px"):void 0,P=Vt(Vt({},S.style||{}),{},{width:F}),I=Ta(e.slots,d,p),D=e.resizable||!A?{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,p)}if(!A)var k=setTimeout(function(){var K,M=e.theadRef.querySelectorAll("th");(K=M[p])===null||K===void 0||K.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))}}:{},w=Re(d.ellipsisTitle)?d.ellipsisTitle(Ge,{col:d,colIndex:p}):void 0,h=d.ellipsisTitle!==void 0?Boolean(d.ellipsisTitle):Boolean(d.ellipsis),g=(Re(d.attrs)?d.attrs(Vt(Vt({},x),{},{type:"th"})):d.attrs)||{};return d.colspan>1&&(g.colspan=d.colspan),L("th",Ke({key:d.colKey,"data-colkey":d.colKey,class:j,style:P},g,m,D),[L("div",{class:e.tableBaseClass.thCellInner},[h?L(dr,{placement:"bottom",attach:e.attach||(e.theadRef?function(){return e.getTableNode(e.theadRef)}:void 0),tooltipContent:w&&function(){return w},tooltipProps:dt(d.ellipsisTitle)==="object"?d.ellipsisTitle:void 0,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},ds(I)?I:{default:function(){return[I]}}):I])])});return L("tr",{key:s},[v])})};return L("thead",{ref:"theadRef",class:this.theadClasses},[n(this.rowAndColFixedPosition,this.thWidthList)])}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function eo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function na(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?eo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var to=Ne({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,n){var a=qt(),r=ot(),o=Ie(e),l=o.footData,i=o.columns,u=o.rowKey,s=o.rowspanAndColspanInFooter,v=hl(l,i,u,s),d=v.skipSpansMap,p=function(m){var y=m.col,S=m.row;return Re(y.foot)?y.foot(Ge,m):Lt(y.foot)&&n.slots[y.foot]?n.slots[y.foot](m)||y.foot:y.foot||W(S,y.colKey)};return na(na({skipSpansMap:d},r),{},{renderTFootCell:p,renderTNode:a})},render:function(){var e,n=this;if(!this.columns)return null;var a=[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=fr(n.rowAttributes,{row:l,rowIndex:i,type:"foot"}),s=hr(n.rowClassName,{row:l,rowIndex:i,type:"foot"},n.rowKey||"id");return L("tr",Ke(u,{key:i,class:s}),[n.columns.map(function(v,d){var p,b={},m=null;if(n.skipSpansMap.size){var y,S,x=Un(l,n.rowKey,v.colKey,d);if(m=n.skipSpansMap.get(x)||{},((y=m)===null||y===void 0?void 0:y.rowspan)>1&&(b.rowspan=m.rowspan),((S=m)===null||S===void 0?void 0:S.colspan)>1&&(b.colspan=m.colspan),m.skipped)return null}var O=vr(v,d,n.rowAndColFixedPosition,n.tableColFixedClasses),R=na({},O.style);return(p=n.thWidthList)!==null&&p!==void 0&&p[v.colKey]&&(R.width="".concat(n.thWidthList[v.colKey],"px")),L("td",Ke(na({key:v.colKey},b),{class:O.classes,style:R}),[n.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:a,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 vs(t,e){var n=Ie(t),a=n.data,r=n.activeRowType,o=n.activeRowKeys,l=n.defaultActiveRowKeys,i=n.disableSpaceInactiveRow,u=H(-1),s=H(!1),v=H(!1),d=H(-1),p=Nt(o,l.value,t.onActiveChange,"activeRowKeys"),b=Pe(p,2),m=b[0],y=b[1],S=function(h){var g=h.row,c=h.index,f=W(g,t.rowKey);if(r.value==="single"){var C=m.value.length>1?[f]:[];y(C,{type:"inactive",activeRowList:[{row:g,rowIndex:c}],currentRowData:g})}else if(r.value==="multiple"){for(var E=m.value.filter(function(q){return q!==f}),k=[],K=0,M=a.value.length;K<M;K++){var $=a.value[K];E.includes(W($,t.rowKey))&&k.push({row:$,rowIndex:K})}y(E,{type:"inactive",activeRowList:k,currentRowData:g})}},x=function(h){var g=h.row,c=W(g,t.rowKey);if(r.value==="single")y([c],{activeRowList:[{row:g,rowIndex:h.index}],currentRowData:g,type:"active"});else{for(var f=m.value.concat(c),C=[],E=0,k=a.value.length;E<k;E++){var K=a.value[E];f.includes(W(K,t.rowKey))&&C.push({row:K,rowIndex:E})}y(f,{activeRowList:C,currentRowData:g,type:"active"})}},O=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:a.value[k],rowIndex:k});var K=E.map(function(M){return W(M.row,t.rowKey)});y(K,{activeRowList:E,type:"active",currentRowData:g})},R=function(){for(var h=[],g=0,c=a.value.length;g<c;g++){var f=a.value[g],C=W(f,t.rowKey);m.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=W(c,t.rowKey);s.value?(u.value=f,O(h),v.value=!0):m.value.includes(C)&&(g==null?void 0:g.action)!=="active"?i.value||(S(h),u.value=f):(x(h),u.value=f)}},A=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},j=function(){var h,g=a.value.map(function(f){return W(f,t.rowKey)}),c=a.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(Xo.test(c)){h.preventDefault();var f=Math.min(a.value.length-1,u.value+1);r.value==="single"?_({row:a.value[f],index:f,e:h},{action:"active"}):u.value=f}else if(Go.test(c)){h.preventDefault();var C=Math.max(0,u.value-1);r.value==="single"?_({row:a.value[C],index:C,e:h},{action:"active"}):u.value=C}else if(Ya.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:R()})}else if(!i.value)_({row:a.value[E],index:E,e:h});else{var K;(K=t.onActiveRowAction)===null||K===void 0||K.call(t,{action:"space-one-selection",activeRowList:R()})}}else xr.test(c)?(s.value=!0,d.value=u.value):qo.test(c)||Yo.test(c)?(A(),T()):Jo.test(c)&&j();Ya.test(c)||T()},P=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());xr.test(c)&&(s.value=!1)},I=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:m,onHighlightRow:_,addHighlightKeyboardListener:I,removeHighlightKeyboardListener:D}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function fs(t,e){var n=Ie(t),a=n.hover,r=n.data,o=n.activeRowType,l=n.keyboardRowHover,i=n.disableSpaceInactiveRow,u=H(),s=H(-1),v=N(function(){return o.value==="single"?!1:o.value==="multiple"?!0:a.value||l.value}),d=function(x,O){var R=W(x.row,t.rowKey);u.value===R&&(O==null?void 0:O.action)!=="hover"?i.value||(u.value=void 0):u.value=R,s.value=x.index},p=function(){u.value=void 0,s.value=-1},b=function(x){var O;if(!!v.value){var R=x.code||((O=x.key)===null||O===void 0?void 0:O.trim());if(Xo.test(R)){x.preventDefault();var _=Math.min(r.value.length-1,s.value+1);d({row:r.value[_],index:_,e:x},{action:"hover"})}else if(Go.test(R)){x.preventDefault();var A=Math.max(0,s.value-1);d({row:r.value[A],index:A,e:x},{action:"hover"})}else if(Ya.test(R)&&t.activeRowType!=="multiple"){var j=s.value;if(d({row:r.value[j],index:j,e:x}),!t.activeRowType){var T;(T=t.onActiveRowAction)===null||T===void 0||T.call(t,{action:"space-one-selection",activeRowList:[{row:r.value[j],rowIndex:j}]})}}else if(qo.test(R)&&!t.activeRowType){var F;u.value=void 0,(F=t.onActiveRowAction)===null||F===void 0||F.call(t,{action:"clear",activeRowList:[]})}else if(Jo.test(R)&&!t.activeRowType){var P;(P=t.onActiveRowAction)===null||P===void 0||P.call(t,{action:"select-all",activeRowList:[]})}else if(Yo.test(R)&&!t.activeRowType){var I;(I=t.onActiveRowAction)===null||I===void 0||I.call(t,{action:"clear",activeRowList:[]})}}},m=function(){Te(e.value,"keydown",b)},y=function(){xe(e.value,"keydown",b)};return{hoverRow:u,needKeyboardRowHover:v,clearHoverRow:p,addRowHoverKeyboardListener:m,removeRowHoverKeyboardListener:y}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function hs(t,e){var n=H(),a=H(!0),r=function(){if(!(!e.value||!t.value||n.value)){a.value=!1;var l=Uo(t.value,null,function(){a.value=!0},10);n.value=l}};return ht(r),e.value&&ve([e,t],r),Da(function(){var o,l;!e.value||(o=n.value)===null||o===void 0||(l=o.unobserve)===null||l===void 0||l.call(o,t.value)}),{showElement:a}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function no(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?no(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ao(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var gs=["page-change","cell-click","scroll","scrollX","scrollY"];pl.map(function(t){return"row-".concat(t)}).concat(gs);var wl=Ne({name:"TBaseTable",props:nt(nt({},On),{},{renderExpandedRow:Function,onLeafColumnsChange:Function,thDraggable:Boolean}),emits:["show-element-change"],setup:function(e,n){var a=Ie(e),r=a.lazyLoad,o=qt(),l=H(),i=H(),u=H(),s=H(),v=H(0),d=ot(),p=d.classPrefix,b=d.virtualScrollClasses,m=d.tableLayoutClasses,y=d.tableBaseClass,S=d.tableColFixedClasses,x=ml(e),O=x.tableClasses,R=x.sizeClassNames,_=x.tableContentStyles,A=x.tableElementStyles,j=gt("table",e.locale),T=j.globalConfig,F=dl(e),P=F.isMultipleHeader,I=F.spansAndLeafNodes,D=F.thList,w=N(function(){var ye;return((ye=I.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=hs(l,r),c=g.showElement,f=H(),C=H(),E=H(),k=H(),K=as(e,n,w,{paginationAffixRef:f,horizontalScrollAffixRef:C,headerTopAffixRef:E,footerBottomAffixRef:k}),M=K.scrollbarWidth,$=K.virtualScrollHeaderPos,q=K.tableWidth,ee=K.tableElmWidth,ne=K.tableContentRef,ae=K.isFixedHeader,J=K.isWidthOverflow,B=K.isFixedColumn,X=K.thWidthList,Q=K.showColumnShadow,Y=K.rowAndColFixedPosition,se=K.setData,he=K.refreshTable,Le=K.setTableElmWidth,Ve=K.emitScrollEvent,Ye=K.setUseFixedTableElmRef,Me=K.updateColumnFixedShadow,lt=K.getThWidthList,pt=K.updateThWidthList,it=K.addTableResizeObserver,Pt=K.updateTableAfterColumnResize,je=ls(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=os(e,n),ue=pe.dataSource,me=pe.innerPagination,Ee=pe.isPaginateData,Ae=pe.renderPagination,He=_u({isWidthOverflow:J,tableContentRef:ne,showColumnShadow:Q,getThWidthList:lt,updateThWidthList:pt,setTableElmWidth:Le,updateTableAfterColumnResize:Pt,onColumnResizeChange:e.onColumnResizeChange}),At=He.resizeLineRef,zt=He.resizeLineStyle,tt=He.setEffectColMap,Ht=N(function(){return[O.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(p,"-table__row--active-").concat(e.activeRowType),e.activeRowType)]}),Ct=N(function(){return[[m[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=vs(e,l),be=St.tActiveRow,fe=St.onHighlightRow,Fe=St.addHighlightKeyboardListener,Je=St.removeHighlightKeyboardListener,qe=fs(e,l),bt=qe.hoverRow,Jt=qe.needKeyboardRowHover,Jn=qe.clearHoverRow,Zt=qe.addRowHoverKeyboardListener,Qt=qe.removeRowHoverKeyboardListener;ve(i,function(){Ye(i.value)}),ve(function(){return[e.data,ue]},function(){se(Ee.value?ue.value:e.data)}),ve(I,function(){var ye;(ye=e.onLeafColumnsChange)===null||ye===void 0||ye.call(e,I.value.leafColumns),tt(I.value.leafColumns,null)},{immediate:!0});var en=function(){It(function(){te(),ge()})},tn=N(function(){return{data:e.data,scroll:e.scroll}}),mt=hi(ne,tn),we=-1,fn=function(
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var yl={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 ro(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function oo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ro(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var ps=Ne({name:"ColumnCheckboxGroup",props:{checkboxProps:Object,options:{type:Array,default:function(){return[]}},label:String,uniqueKey:String,value:Array,onChange:Function},setup:function(e){var n=Ie(e),a=n.checkboxProps,r=n.value,o=n.options,l=kt(),i=N(function(){var m=[];return o.value.forEach(function(y){if(dt(y)==="object"){if(y.disabled)return;y.value?m.push(y.value):typeof y.label=="string"&&m.push(y.label)}else m.push(y)}),m}),u=N(function(){return ba(i.value,r.value)}),s=N(function(){var m=u.value.length;return Boolean(m&&i.value.length===m)}),v=N(function(){var m=u.value.length;return Boolean(m<i.value.length&&m)}),d=function(y,S){var x={e:S.e,type:"check",current:void 0,option:void 0};if(y){var O,R=de(new Set(r.value.concat(i.value)));(O=e.onChange)===null||O===void 0||O.call(e,R,x)}else{var _,A=r.value.filter(function(j){return!i.value.includes(j)});(_=e.onChange)===null||_===void 0||_.call(e,A,oo(oo({},x),{},{type:"uncheck"}))}},p=function(y,S){var x;(x=e.onChange)===null||x===void 0||x.call(e,y,S)},b=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:b.value},[L("div",{class:"".concat(l.value,"-table__column-controller-block")},[L(Ja,{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(Zo,Ke({options:o.value},a.value,{modelValue:r.value,onChange:p}),null)])])}}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function ka(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Qa(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set,n=0,a=t.length;n<a;n++){var r,o=t[n];(r=o.children)!==null&&r!==void 0&&r.length?Qa(o.children,e):o.colKey&&e.add(o.colKey)}return e}function bs(t,e){var n=gt("table",t.locale),a=n.classPrefix,r=n.globalConfig,o=En({SettingIcon:Ui}),l=o.SettingIcon,i=Ie(t),u=i.columns,s=i.columnController,v=i.displayColumns,d=i.columnControllerVisible,p=H(null),b=qt(),m=N(function(){var w,h=(((w=s.value)===null||w===void 0?void 0:w.fields)||de(Qa(u.value))).filter(function(g){return g});return new Set(h)}),y=de(Qa(u.value)),S=Nt(v,t.defaultDisplayColumns||y,t.onDisplayColumnsChange,"displayColumns"),x=Pe(S,2),O=x[0],R=x[1],_=H(v.value||t.defaultDisplayColumns||y),A=N(function(){var w;if((w=s.value)!==null&&w!==void 0&&(w=w.groupColumns)!==null&&w!==void 0&&w.length)return T(u.value);var h={label:r.value.selectAllText,options:F(u.value)};return[h]});ve([v],function(w){var h=Pe(w,1),g=h[0];_.value=g||t.defaultDisplayColumns||y});function j(w,h){return{label:function(){return Ta(e.slots,w,h)},value:w.colKey,disabled:!m.value.has(w.colKey)}}function T(w){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,K=E.length;k<K;k++){for(var M,$=E[k],q=j($,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(q):c[ee]=ka(ka({},g[ee]),{},{options:[q]}))}(M=$.children)!==null&&M!==void 0&&M.length&&C($.children)}};return f(w),c}function F(w){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=w.length;c<f;c++){var C,E=w[c];(C=E.children)!==null&&C!==void 0&&C.length?F(E.children,g):E.colKey&&g.push(j(E,c))}return g}var P=function(h,g){var c;_.value=h;var f={columns:h,type:g.type,currentColumn:fl(u.value,String(g.current)),e:g.e};(c=t.onColumnChange)===null||c===void 0||c.call(t,f)},I=function(){var h;if(p.value){p.value.show();return}p.value=cr.confirm(ka({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,K=L("div",{class:["".concat(a.value,"-table__column-controller"),"".concat(a.value,"-table__column-controller--").concat(f)]},[L("div",{class:"".concat(a.value,"-table__column-controller-body")},[Re(E)?E(Ge):b("columnControllerTopContent"),r.value.columnConfigDescriptionText&&L("p",{class:"".concat(a.value,"-table__column-controller-desc")},[r.value.columnConfigDescriptionText]),A.value.map(function(M,$){var q,ee,ne=(q=s.value)!==null&&q!==void 0&&(q=q.groupColumns)!==null&&q!==void 0&&q.length?String(M.value||$):void 0;return L(ps,{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(Ge):b("columnControllerBottomContent")])]);return K},confirmBtn:r.value.confirmText,cancelBtn:r.value.cancelText,width:612,onConfirm:function(){if(R(de(_.value)),d.value===void 0)p.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)p.value.hide();else{var c;(c=t.onCol
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function ms(t,e){var n=Ie(t),a=n.expandedRowKeys,r=qt(),o=gt("table",t.locale),l=o.t,i=o.globalConfig,u=En({ChevronRightCircleIcon:ji}),s=u.ChevronRightCircleIcon,v=ot(),d=v.tableExpandClasses,p=v.positiveRotate90,b=v.tableFullRowClasses,m=Nt(a,t.defaultExpandedRowKeys||[],t.onExpandChange,"expandedRowKeys"),y=Pe(m,2),S=y[0],x=y[1],O=N(function(){return Boolean(t.expandedRow||e.slots.expandedRow||e.slots["expanded-row"])}),R=N(function(){return t.expandIcon!==!1&&O.value}),_=N(function(){var I;return((I=t.columns)===null||I===void 0||(I=I[0])===null||I===void 0?void 0:I.fixed)==="left"}),A=function(D,w){t.expandOnRowClick&&D.stopPropagation();var h=W(w,t.rowKey||"id"),g=S.value.indexOf(h),c=de(S.value);g!==-1?c.splice(g,1):c.push(h),x(c,{expandedRowData:t.data.filter(function(f){return c.includes(W(f,t.rowKey||"id"))}),currentRowData:w})},j=function(D,w){var h=w.row,g=w.rowIndex,c=W(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({},p,f)];return L("span",{class:E,onClick:function(K){return A(K,h)}},[C])},T=function(){var D={colKey:"__EXPAND_ROW_ICON_COLUMN__",width:46,className:d.iconCell,fixed:_.value?"left":void 0,cell:j,stopPropagation:!0};return D},F=function(D){var w=W(D.row,t.rowKey||"id");if(!S.value||!S.value.includes(w))return null;var h=D.isWidthOverflow&&t.columns.find(function(g){return g.fixed==="left"});return L("tr",{key:"expand_".concat(w),class:[d.row,z({},b.base,h)]},[L("td",{colspan:D.columns.length},[L("div",{class:[d.rowInner,z({},b.innerFullRow,h)],style:h?{width:"".concat(D.tableWidth,"px")}:{}},[L("div",{class:b.innerFullElement},[r("expandedRow",{params:D})])])])])},P=function(D){A(D.e,D.row)};return{showExpandedRow:O,showExpandIconColumn:R,getExpandColumn:T,renderExpandedRow:F,onInnerExpandRowClick:P}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function er(t,e,n){if(!t)return!1;var a=Re(t.disabled)?t.disabled({row:e,rowIndex:n}):t.disabled;return t.checkProps&&(Re(t.checkProps)?a=a||t.checkProps({row:e,rowIndex:n}).disabled:t.checkProps==="object"&&(a=a||t.checkProps.disabled)),!!a}function ws(t,e,n){for(var a={},r=0,o=e.length;r<o;r++){var l=W(e[r],n);t.includes(l)&&(a[l]=!0)}return a}function Ca(t,e){for(var n=0,a=t.length;n<a;n++){var r;if(t[n].colKey===e)return t[n];if((r=t[n].children)!==null&&r!==void 0&&r.length){var o=Ca(t[n].children,e);if(o)return o}}return null}function io(t,e){for(var n=0,a=t.length;n<a;n++){var r;if(t[n].colKey===e)return n;if((r=t[n].children)!==null&&r!==void 0&&r.length){var o=Ca(t[n].children,e);if(o)return n}}return-1}function Cl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,a=t.length;n<a;n++){var r,o=t[n];o.filter&&"resetValue"in o.filter&&(e[o.colKey]=o.filter.resetValue),(r=o.children)!==null&&r!==void 0&&r.length&&Cl(o.children,e)}return e}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function uo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function aa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?uo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):uo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ys(t,e){var n=Ie(t),a=n.selectedRowKeys,r=n.columns,o=n.rowKey,l=n.data,i=n.reserveSelectedRowOnPaginate,u=H(l.value),s=H(),v=Nt(a,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),d=Pe(v,2),p=d[0],b=d[1],m=H(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)})}),O=N(function(){return ba(p.value,x.value.map(function(c){return W(c,t.rowKey||"id")}))}),R=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});ve([l,r,p,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(p.value),k=function($){var q=$.row,ee=W(q,t.rowKey||"id");return E.has(ee)?e.selected:""},K=E.size?k:void 0;s.value=[C,K]},{immediate:!0});function _(c,f){return er(y.value,c,f)}function A(){return function(){var c=O.value.length>0&&O.value.length<x.value.length,f=O.value.length!==0&&x.value.length!==0&&O.value.length===x.value.length;return L(Ja,{checked:f,indeterminate:c,disabled:!x.value.length,onChange:P},null)}}function j(c){var f=c.col,C=c.row,E=c.rowIndex,k=Re(f.disabled)?f.disabled({row:C,rowIndex:E}):f.disabled,K=Re(f.checkProps)?f.checkProps({row:C,rowIndex:E}):f.checkProps;return{disabled:k||(K==null?void 0:K.disabled),checkProps:K}}function T(c){var f=c.col,C=c.row,E=C===void 0?{}:C,k=p.value.includes(W(E,t.rowKey||"id")),K=j(c),M=K.disabled,$=K.checkProps,q=aa(aa({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(pu,q,null);if(f.type==="multiple"){var ee,ne=(ee=t.indeterminateSelectedRowKeys)!==null&&ee!==void 0&&ee.length?t.indeterminateSelectedRowKeys.includes(W(E,t.rowKey)):!1;return L(Ja,Ke({indeterminate:ne},q),null)}return null}function F(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=de(p.value),C=t.rowKey||"id",E=W(c,C),k=f.indexOf(E),K=k!==-1;if(S.value==="multiple")K?f.splice(k,1):f.push(E);else if(S.value==="single")f=K&&R.value?[]:[E];else{ze.warn("Table","`column.type` must be one of `multiple` and `single`");return}b(f,{selectedRowData:f.map(function(M){return m.value.get(M)}),currentRowKey:E,currentRowData:c,type:K?"uncheck":"check"})}function P(c){var f,C=t.rowKey||"id",E=x.value.map(function(M){return W(M,C)}),k=((f=a.value)===null||f===void 0?void 0:f.filter(function(M){return!E.includes(M)}))||[],K=c?[].concat(de(k),de(E)):de(k);b(K,{selectedRowData:c?K.map(function(M){return m.value.get(M)}):[],type:c?"check":"uncheck",currentRowKey:"CHECK_ALL_BOX"})}function I(c){var f=["multiple","single"].includes(c.type);return f?aa(aa({},c),{},{width:c.width||64,className:[e.checkCell,c.className],cell:function(E,k){return T(k)},title:c.type==="multiple"?A():c.title}):c}var D=function(f){var C=f.row,E=f.index,k=t.columns.findIndex(function($){return $.colKey==="row-select"}),K=!1;if(k!==-1){var M;K=(M=j({row:C,rowIndex:E,col:t.columns[k],colIndex:k}))===null||M===void 0?void 0:M.disabled}K||F(C)};ve([l,o],function(){for(var c=0,f=l.value.length;c<f;c+
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Cs(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var xs=Ne({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,n){var a=ot(),r=a.tableSortClasses,o=a.negativeRotate180,l=Gn(),i=gt("table",e.locale),u=i.t,s=i.globalConfig,v=En({ChevronDownIcon:gi}),d=v.ChevronDownIcon,p=N(function(){return e.sortType==="all"?["asc","desc"]:[e.sortType]}),b=function(S,x){n.emit("sort-icon-click",S,{descending:x==="desc"})},m=function(S,x){var O=u(s.value.sortIcon)||L(d,null,null),R=l("sortIcon",O),_=[x,r.sortIcon,r.iconDirection[S],z({},o,S==="asc")];return L("span",{class:_,onClick:function(j){return b(j,S)}},[R])};return{t:u,globalConfig:s,tableSortClasses:r,negativeRotate180:o,allowSortTypes:p,getSortIcon:m}},render:function(){var e=this,n=this.tableSortClasses,a=[n.trigger,z({},n.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?n.iconActive:n.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(Vo,Ke({content:d,placement:"right",showArrow:!1,class:e.tableSortClasses.iconDirection[l]},e.tooltipProps),Cs(i=e.getSortIcon(l,s))?i:{default:function(){return[i]}})});return L("div",{class:a},[o])}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function so(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Ss(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?so(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):so(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Os(t,e){var n=e.slots,a=Ie(t),r=a.sort,o=a.data,l=H(),i=Nt(r,t.defaultSort,t.onSortChange,"sort"),u=Pe(i,2),s=u[0],v=u[1],d=Nt(o,[],t.onDataChange,"data"),p=Pe(d,2),b=p[0],m=p[1],y=N(function(){return R(t.columns)}),S=H(),x=N(function(){var D=s.value;return D?Fa(D)?D:[D]:[]}),O=N(function(){var D={};return x.value.forEach(function(w,h){var g=w.sortBy;D[g]=Ss({index:h},w)}),D});function R(D){for(var w=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)&&(w[f.colKey]=f.sorter),(c=f.children)!==null&&c!==void 0&&c.length&&R(f.children,w)}return w}function _(D){var w=D;if(!!Object.keys(y.value).length){l.value||(l.value=b.value);var h=!w||w instanceof Array&&!w.length,g=!(w instanceof Array)&&!(w!=null&&w.sortBy);if(h||g)return m(l.value,{trigger:"sort"}),l.value;var c=w instanceof Array?w:[w],f=b.value.slice().sort(function(C,E){for(var k=0,K=0,M=c.length;K<M;K++){var $=c[K],q=y.value[$.sortBy];if(k===0&&q)k=$.descending?q(E,C):q(C,E);else break}return k});if(JSON.stringify(f)!==JSON.stringify(b.value))return m(f,{trigger:"sort"}),f}}function A(D,w){var h,g;if(t.multipleSort)g=F(D,w);else{var c=s.value instanceof Array?s.value[0]:s.value;g=T(D,c,w)}var f=_(g),C=f||b.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 j(D){if(D!==void 0)return D?"desc":"asc"}function T(D,w,h){if(!(w&&w.sortBy===D.colKey&&w.descending===h.descending))return{sortBy:D.colKey,descending:h.descending}}function F(D,w){Array.isArray(s.value)||(s.value=s.value?[s.value]:[]);for(var h=s.value,g=D.colKey,c=de(h),f=0,C=h.length;f<C;f++)if(h[f].sortBy===g){var E=T(D,h[f],w);return E?c[f]=E:c.splice(f,1),c}return c.push({sortBy:g,descending:w.descending}),c}function P(D){var w,h=D.col;if(!h.sorter)return null;var g={sortType:h.sortType,sortOrder:j((w=O.value[h.colKey])===null||w===void 0?void 0:w.descending),sortIcon:t.sortIcon,hideSortTips:t.hideSortTips,locale:t.locale};return L(xs,Ke(g,{onSortIconClick:function(f,C){return A(h,C)}}),{sortIcon:n.sortIcon})}var I=function(w,h){var g=Fa(w)?w:[w],c=Fa(h)?h:[h];if(g.length&&!h)return!1;for(var f=function(){var M=g[E],$=c.find(function(q){return q.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 ve(function(){return[s,t.data]},function(){!s.value||!Object.keys(s.value).length||!b.value.length||I(s.value,S.value)||_(s.value)},{immediate:!0}),{renderSortIcon:P}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function co(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function ra(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?co(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Rs=Ne({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,n){var a=H(null),r=Gn(),o=gt("table",e.locale),l=o.t,i=o.globalConfig,u=En({FilterIcon:Ni}),s=u.FilterIcon,v=H(!1),d=function(x){var O;v.value=x,(O=e.onVisibleChange)===null||O===void 0||O.call(e,x)},p=function(x,O,R){if(!R)return null;var _=!!R.setup;if(Re(x.filter.component)&&!_)return x.filter.component(function(j,T){var F=dt(T)==="object"&&"attrs"in T?T.attrs:{};return Ge(j,{props:ra(ra({},O),F)})});var A=x.filter||{};return L(R,Ke({class:A.classNames,style:A.style},A.attrs,O),null)},b=function(x){var O,R,_=["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 A=e.innerFilterValue,j=A===void 0?{}:A,T={single:bu,multiple:Zo,input:Ri}[x.filter.type]||x.filter.component;if(!(!T&&!x.filter.component)){var F=ra(ra({options:["single","multiple"].includes(x.filter.type)?(O=x.filter)===null||O===void 0?void 0:O.list:void 0},((R=x.filter)===null||R===void 0?void 0:R.props)||{}),{},{onChange:function(I,D){var w,h;if(n.emit("inner-filter-change",I,x),(w=x.filter.props)!==null&&w!==void 0&&w.onChange){var g,c;(g=(c=x.filter.props).onChange)===null||g===void 0||g.call(c,I,D)}(h=x.filter)!==null&&h!==void 0&&(h=h.confirmEvents)!==null&&h!==void 0&&h.includes("onChange")&&(v.value=!1)}});return x.colKey&&j&&x.colKey in j&&(F.value=j==null?void 0:j[x.colKey]),x.filter.confirmEvents&&x.filter.confirmEvents.forEach(function(P){P!=="onChange"&&(F[P]=function(){n.emit("confirm",x),v.value=!1})}),L("div",{class:e.tableFilterClasses.contentInner},[p(x,F,T)])}},m=function(x){if(!!x.filter.showConfirmAndReset)return L("div",{class:e.tableFilterClasses.bottomButtons},[L(ma,{theme:"default",size:"small",onClick:function(){n.emit("reset",x),v.value=!1}},{default:function(){return[i.value.resetText]}}),L(ma,{theme:"primary",size:"small",onClick:function(){n.emit("confirm",x),v.value=!1}},{default:function(){return[i.value.confirmText]}})])},y=function(){return L("div",{class:e.tableFilterClasses.popupContent},[b(e.column),m(e.column)])};return{t:l,globalConfig:i,FilterIcon:s,filterPopupVisible:v,triggerElementRef:a,renderTNode:r,getContent:y,onFilterPopupVisibleChange:d}},render:function(){var e,n=this,a=this.column,r=this.popupProps,o=this.FilterIcon;if(!a.filter||a.filter&&!Object.keys(a.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[a.colKey],u=dt(i)==="object"&&!ci(i),s=![null,void 0,""].includes(i)&&dt(i)!=="object";return L(pi,Ke({attach:this.attach||(this.primaryTableElement?function(){return n.primaryTableElement}:void 0),visible:this.filterPopupVisible,destroyOnClose:!0,trigger:"click",placement:"bottom-right",showArrow:!0,overlayClassName:this.tableFilterClasses.popup,onVisibleChange:function(d){return n.onFilterPopupVisibleChange(d)},class:[this.tableFilterClasses.icon,z({},this.isFocusClass,u||s)],content:this.getContent},r),{default:function(){return[L("div",{ref:"triggerElementRef"},[n.renderTNode("filterIcon",{defaultNode:l,params:{col:a,colIndex:n.colIndex}})])]}})}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function vo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function oa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function xl(t){var e=t instanceof Array&&t.length,n=dt(t)==="object"&&!(t instanceof Array),a=n&&Object.keys(t).length;return e||a||!["null","","undefined"].includes(String(t))}function Es(t){var e={};return Object.keys(t).forEach(function(n){var a=t[n];xl(a)&&(e[n]=a)}),e}function Ds(t,e){var n=H(null),a=gt("table",t.locale),r=a.t,o=a.globalConfig,l=Gn(),i=Ie(t),u=i.filterValue,s=i.columns,v=ot(),d=v.tableFilterClasses,p=v.isFocusClass,b=H(),m=Nt(u,t.defaultFilterValue,t.onFilterChange,"filterValue"),y=Pe(m,2),S=y[0],x=y[1],O=H(S.value),R=N(function(){var c=Es(S.value||{});return!S.value||!Object.keys(c).length});ve([S],function(c){var f=Pe(c,1),C=f[0];O.value=C});function _(){var c,f;if(R.value)return null;var C=L("div",{class:d.result},[L("span",null,[r(o.value.searchResultText,{result:A(),count:((c=t.pagination)===null||c===void 0?void 0:c.total)||((f=t.data)===null||f===void 0?void 0:f.length)})]),L(ma,{theme:"primary",variant:"text",onClick:I},{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 A(){var c=[],f=[];return j(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 K=k instanceof Array?k:[k],M=[];C.filter.list.forEach(function(ae){K.includes(ae.value)&&M.push(ae.label)}),k=M.join()}if(xl(k)){var $,q,ee=Re(($=C.filter)===null||$===void 0?void 0:$.label)?C.filter.label(Ge):(q=C.filter)===null||q===void 0?void 0:q.label,ne=Ta(e.slots,C,E);c.push("".concat(ee||ne,"\uFF1A").concat(k))}}),c.join("\uFF1B")}function j(c,f){c.forEach(function(C){C.children&&j(C.children,f),f.push(C)})}function T(c,f){var C=oa(oa({},O.value),{},z({},f.colKey,c));O.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=oa(oa({},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 I(){var c=Cl(s.value);F(c,"clear",void 0)}function D(c){F(O.value,"confirm",c)}function w(c){var f,C=c.col,E=c.colIndex;return L(Rs,{column:C,colIndex:E,filterIcon:t.filterIcon,tFilterValue:S.value,innerFilterValue:O.value,tableFilterClasses:d,isFocusClass:p,popupProps:C.filter.popupProps,attach:t.attach,locale:t.locale,onReset:P,onConfirm:D,onInnerFilterChange:T,primaryTableElement:(f=n.value)===null||f===void 0?void 0:f.$el,onVisibleChange:g},{filterIcon:e.slots.filterIcon})}function h(c){n.value=c}function g(c){c&&!b.value&&(b.value=!c)}return{hasEmptyCondition:R,isTableOverflowHidden:b,renderFilterIcon:w,renderFirstFilterRow:_,setFilterPrimaryTableRef:h}}/**!
|
||
|
* Sortable 1.15.2
|
||
|
* @author RubaXa <trash@rubaxa.org>
|
||
|
* @author owenm <owen23355@gmail.com>
|
||
|
* @license MIT
|
||
|
*/function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Tt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fo(Object(n),!0).forEach(function(a){_s(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function va(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?va=function(e){return typeof e}:va=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},va(t)}function _s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mt(){return Mt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Mt.apply(this,arguments)}function Ts(t,e){if(t==null)return{};var n={},a=Object.keys(t),r,o;for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}function Ps(t,e){if(t==null)return{};var n=Ts(t,e),a,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)a=o[r],!(e.indexOf(a)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,a)||(n[a]=t[a]))}return n}var As="1.15.2";function Kt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Bt=Kt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),qn=Kt(/Edge/i),ho=Kt(/firefox/i),Bn=Kt(/safari/i)&&!Kt(/chrome/i)&&!Kt(/android/i),Sl=Kt(/iP(ad|od|hone)/i),Ol=Kt(/chrome/i)&&Kt(/android/i),Rl={capture:!1,passive:!1};function Oe(t,e,n){t.addEventListener(e,n,!Bt&&Rl)}function Ce(t,e,n){t.removeEventListener(e,n,!Bt&&Rl)}function xa(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 js(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function yt(t,e,n,a){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&xa(t,e):xa(t,e))||a&&t===n)return t;if(t===n)break}while(t=js(t))}return null}var go=/\s+/g;function ut(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var a=(" "+t.className+" ").replace(go," ").replace(" "+e+" "," ");t.className=(a+(n?" "+e:"")).replace(go," ")}}function ie(t,e,n){var a=t&&t.style;if(a){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in a)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),a[e]=n+(typeof n=="string"?"":"px")}}function Sn(t,e){var n="";if(typeof t=="string")n=t;else do{var a=ie(t,"transform");a&&a!=="none"&&(n=a+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function El(t,e,n){if(t){var a=t.getElementsByTagName(e),r=0,o=a.length;if(n)for(;r<o;r++)n(a[r],r);return a}return[]}function _t(){var t=document.scrollingElement;return t||document.documentElement}function Xe(t,e,n,a,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||n)&&t!==window&&(r=r||t.parentNode,!Bt))do if(r&&r.getBoundingClientRect&&(ie(r,"transform")!=="none"||n&&ie(r,"position")!=="static")){var p=r.getBoundingClientRect();l-=p.top+parseInt(ie(r,"border-top-width")),i-=p.left+parseInt(ie(r,"border-left-width")),u=l+o.height,s=i+o.width;break}while(r=r.parentNode);if(a&&t!==window){var b=Sn(r||t),m=b&&b.a,y=b&&b.d;b&&
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function xo(t,e,n){var a=de(t);return n-e>0?(a.splice(n+1,0,a[e]),a.splice(e,1)):(a.splice(n,0,a[e]),a.splice(e+1,1)),a}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function So(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function jn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?So(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):So(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function Oo(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Ro(t,e,n){var a=n===0?t.children[0]:t.children[n-1].nextSibling;t.insertBefore(e,a)}function ec(t,e,n){var a=Ie(t),r=a.sortOnRowDraggable,o=a.dragSort,l=a.data,i=H(t.pagination),u=ot(),s=u.tableDraggableClasses,v=u.tableBaseClass,d=u.tableFullRowClasses,p=u.tableExpandClasses,b=H(t.columns||[]),m=H(null),y=N(function(){return b.value.find(function(I){return I.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}),O=N(function(){return["col","row-handler-col"].includes(o.value)});t.sortOnRowDraggable&&ze.error("Table","`sortOnRowDraggable` is going to be deprecated, use dragSort='row' instead.");function R(I,D){var w,h,g=(w=D.current)!==null&&w!==void 0?w:D.defaultCurrent,c=(h=D.pageSize)!==null&&h!==void 0?h:D.defaultPageSize;return!t.disableDataPage&&D&&l.value.length>c?c*(g-1)+I:I}var _=function(D){if(!(!x.value&&!S.value)){var w=D==null?void 0:D.querySelector("tbody");if(!w)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(p.row),onMove:function(c){return!Ci(c.related,d.base)},onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){Oo(c.item),Ro(c.from,c.item,c.oldIndex);var C=c.oldIndex,E=c.newIndex;(Re(t.firstFullRow)&&t.firstFullRow(Ge)||e.slots.firstFullRow||e.slots["first-full-row"])&&(C-=1,E-=1),i.value&&(C=R(C,i.value),E=R(E,i.value));var k={data:l.value,currentIndex:C,current:l.value[C],targetIndex:E,target:l.value[E],newData:xo(de(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);!w||(S.value?new oe(w,jn({},h)):new oe(w,jn(jn({},h),{},{handle:".".concat(s.handle)})))}},A=function(D,w){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){w&&(Oo(c.item),Ro(c.from,c.item,c.oldIndex));var C=c.oldIndex,E=c.newIndex,k=c.target,K=w?C:E,M=w?E:C,$=k.children[K],q=k.children[M],ee=Ca(b.value,$.dataset.colkey),ne=Ca(b.value,q.dataset.colkey);(!ee||!ee.colKey)&&ze.error("Table","colKey is missing in ".concat(JSON.stringify(ee))),(!ne||!ne.colKey)&&ze.error("Table","colKey is missing in ".concat(JSON.stringify(ne))),K=io(t.columns,ee.colKey),M=io(t.columns,ne.colKey);var ae={data:b.value,currentIndex:K,current:ee,targetIndex:M,target:ne,newData:xo(de(t.columns),K,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)},j=function(D){if(!(!O.value||!D)){var w=D.querySelectorAll("thead > tr");if(w.length<=1){var h=Pe(w,1),g=h[0];A(g,!0)}else w==null||w.forEach(function(c){A(c,!1)})}};function T(I){m.value=I}function F(I){b.value=I}ve([m,b,o,n],function(I){var D=Pe(I,4),w=D[0];D[1],D[2];var h=D[3];P(w,h)});function P(I,D){var w=I;if(!(!I||!w.$el||!D.showElement))var h=setTimeout(function(){_(w.$el),j(w.$el);var g=setTimeout(function(){w.$refs.affixHeaderRef&&j(w.$refs.affixHeaderRef),clearTimeout(g)});clearTimeout(h)},60)}return{innerPagination:i,isRowDraggable:S,isRowHandlerDraggable:x,isColDraggable:O,setDragSortPrimaryTableRef:T,setDragSortColumns:F}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function tc(t){var e=qt(),n=gt("table",t.locale),a=n.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 p=t.asyncLoading,b={"load-more":a.value.loadingMoreText,loading:a.value.loadingText}[String(p)];return L("div",{class:u.value,onClick:s},[L(nl,{indicator:p==="loading",loading:!!p,size:"small",text:b},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 Eo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function _e(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Eo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var nc=Ne({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,n){var a,r=Ie(e),o=r.row,l=r.col;H(null);var i=N(function(){var c;return(c=l.value.edit)===null||c===void 0?void 0:c.keepEditMode}),u=H(i.value||((a=e.col.edit)===null||a===void 0?void 0:a.defaultEditable)||!1),s=H(),v=H(),d=kt(),p=En({Edit1Icon:Ii}),b=p.Edit1Icon,m=function(f){if(dt(f)==="object"&&("rowValue"in f||f.isUpdateCurrentRow)){var C=f.isUpdateCurrentRow?W(o.value,e.rowKey):f.rowValue;delete f.rowValue,delete f.isUpdateCurrentRow,n.emit("update-edited-cell",C,o.value,f)}else s.value=f};ve([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:m})))||{}}),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=bi(f),E=C[0],k=C.slice(1),K=_e({},o.value);return k.length?(K[E]=ir(o.value[E]),Vn(K[E],k.join("."),s.value)):Vn(K,c,s.value),K}),O=N(function(){var c=ya({row:x.value,col:_e(_e({},l.value),{},{cell:e.oldCell}),rowIndex:e.rowIndex,colIndex:e.colIndex},n.slots,{cellEmptyContent:e.cellEmptyContent});return c}),R=N(function(){var c=l.value.edit;return Re(c.props)?c.props(_e(_e({},S.value),{},{editedRow:x.value,updateEditedCellValue:m})):_e({},c.props)}),_=N(function(){var c,f=l.value.edit;if(!f)return{};var C=_e({},R.value);return delete C.onChange,delete C.value,(c=f.abortEditOnEvent)===null||c===void 0||c.forEach(function(E){delete C[E]}),C}),A=N(function(){var c,f=l.value.edit;return f?Boolean((c=f.abortEditOnEvent)===null||c===void 0?void 0:c.includes("onChange")):!1}),j=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 K;(K=e.onValidate)===null||K===void 0||K.call(e,E),C(!0);return}ol(s.value,k).then(function(M){var $,q=M==null?void 0:M.filter(function(ee){return!ee.result});E.result[0].errorList=q,($=e.onValidate)===null||$===void 0||$.call(e,E),!q||!q.length?(v.value=[],C(!0)):(v.value=q,C(q))})})},T=function(f,C){return Ga(f)&&Ga(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),K=2;K<E;K++)k[K-2]=arguments[K];j("self").then(function(M){var $,q;if(M===!0){var ee=W(o.value,l.value.colKey);T(s.value,ee)||(s.value=ee,f==null||f.apply(void 0,k)),($=(q=y.value)[C])===null||$===void 0||$.call(q,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:j,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(K){K!=="onChange"&&(E[K]=function(){for(var M=arguments
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Do(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Fn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Do(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function ac(t){var e=Ie(t),n=e.editableRowKeys,a=new Map,r=H({}),o=N(function(){return ws(t.editableRowKeys,t.data,t.rowKey||"id")}),l=H({}),i=H({}),u=function(R){var _={};return R.forEach(function(A){var j=A.row,T=A.col,F=A.errorList,P=W(j,t.rowKey||"id"),I=[P,T.colKey].join("__");F!=null&&F.length?_[I]=F:delete _[I]}),_},s=function(R){var _=a.get(R);if(!!_){var A=_.map(function(j){return new Promise(function(T){var F=j.editedRow,P=j.col,I=Re(P.edit.rules)?P.edit.rules(j):P.edit.rules;if(!P.edit||!I||!I.length){T(Fn(Fn({},j),{},{errorList:[]}));return}ol(W(F,P.colKey),I).then(function(D){T(Fn(Fn({},j),{},{errorList:D.filter(function(w){return!w.result})}))})})});return new Promise(function(j,T){Promise.all(A).then(function(F){j({errors:F.filter(function(P){var I;return(I=P.errorList)===null||I===void 0?void 0:I.length}),errorMap:u(F)})},T)})}},v=function(R){return new Promise(function(_,A){s(R).then(function(j){var T,F=j.errors,P=j.errorMap;r.value=P;var I="parent";(T=t.onRowValidate)===null||T===void 0||T.call(t,{trigger:I,result:F}),_({trigger:I,result:F})},A)})},d=function(){var R=Object.keys(l.value),_=R.map(function(A){return l.value[A].validateEdit("parent")});return new Promise(function(A,j){Promise.all(_).then(function(T){var F,P={};T.forEach(function(I,D){I!==!0&&(P[R[D]]=I)}),(F=t.onValidate)===null||F===void 0||F.call(t,{result:P}),A({result:P})},j)})},p=function(){if(Object.keys(l.value).length)return d();for(var R=[],_=t.data||[],A=0,j=_.length;A<j;A++){var T=W(_[A],t.rowKey||"id");R.push(s(T))}return new Promise(function(F,P){Promise.all(R).then(function(I){var D,w={};I.forEach(function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{errors:[],errorMap:{}},g=h.errorMap;g&&Object.assign(w,g)}),r.value=w,(D=t.onValidate)===null||D===void 0||D.call(t,{result:w}),F({result:w})},P)})},b=function(R,_,A){i.value[R]||(i.value[R]=ir(_)),Object.entries(A).forEach(function(j){var T=Pe(j,2),F=T[0],P=T[1];Vn(i.value[R],F,P)})},m=function(R){if(t.editableRowKeys){var _=W(R.row,t.rowKey||"id"),A=a.get(_);if(A){var j=A.findIndex(function(T){return T.col.colKey===R.col.colKey});j===-1?A.push(R):A[j]=R,a.set(_,A)}else a.set(_,[R])}},y=function(){r.value={}},S=function(R){var _=Un(R.row,t.rowKey,R.col.colKey,R.colIndex);R.isEdit?l.value[_]=R:delete l.value[_]},x=function(R){var _,A=R.row,j=R.col,T=W(A,t.rowKey||"id"),F=i.value[T];if(F&&(_=t.editableRowKeys)!==null&&_!==void 0&&_.includes(T)){var P=Fn({},F);return Vn(P,j.colKey,W(F,j.colKey)),P}return A};return ve(function(){var O;return(O=n.value)===null||O===void 0?void 0:O.join(",")},function(O){var R=O.split(","),_=Object.keys(i.value);_.forEach(function(A){R.includes(A)||delete i.value[A]})}),{editedFormData:i,errorListMap:r,editableKeysMap:o,validateTableData:p,validateRowData:v,onRuleChange:m,clearValidateData:y,onUpdateEditedCell:b,getEditRowData:x,onPrimaryTableCellEditChange:S}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function _o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function jt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_o(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var rc=["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"],mr=Ne({name:"TPrimaryTable",props:jt(jt({},On),yl),setup:function(e,n){var a=qt(),r=Ie(e),o=r.columns,l=r.columnController,i=H(null),u=H(!1),s=ot(),v=s.classPrefix,d=s.tableDraggableClasses,p=s.tableBaseClass,b=s.tableSelectedClasses,m=s.tableSortClasses,y=gt("table",e.locale),S=y.globalConfig,x=ml(e),O=x.sizeClassNames,R=N(function(){var be;return(be=e.size)!==null&&be!==void 0?be:S.value.size}),_=bs(e,n),A=_.tDisplayColumns,j=_.renderColumnController,T=ms(e,n),F=T.showExpandedRow,P=T.showExpandIconColumn,I=T.getExpandColumn,D=T.renderExpandedRow,w=T.onInnerExpandRowClick,h=Os(e,n),g=h.renderSortIcon,c=ys(e,b),f=c.selectColumn,C=c.showRowSelect,E=c.selectedRowClassNames,k=c.currentPaginateData,K=c.formatToRowSelectColumn,M=c.setTSelectedRowKeys,$=c.onInnerSelectRowClick,q=c.handleRowSelectWithAreaSelection,ee=Ds(e,n),ne=ee.hasEmptyCondition,ae=ee.isTableOverflowHidden,J=ee.renderFilterIcon,B=ee.renderFirstFilterRow,X=ee.setFilterPrimaryTableRef,Q=N(function(){return{showElement:u.value}}),Y=ec(e,n,Q),se=Y.isRowHandlerDraggable,he=Y.isRowDraggable,Le=Y.isColDraggable,Ve=Y.innerPagination,Ye=Y.setDragSortPrimaryTableRef,Me=Y.setDragSortColumns,lt=dl(e),pt=lt.renderTitleWidthIcon,it=tc(e),Pt=it.renderAsyncLoading,je=ac(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),p.overflowVisible,ae.value===!1),p.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(fe){return fe})}),Ee=N(function(){var be=[e.rowAttributes];return(se.value||he.value)&&be.push(function(fe){var Fe=fe.row;return{"data-id":W(Fe,e.rowKey||"id")}}),be.filter(function(fe){return fe})});ht(function(){X(i.value),Ye(i.value)}),n.expose({validateRowData:Tn,validateTableData:re,clearValidateData:G,refreshTable:function(){i.value.refreshTable()},scrollToElement:function(fe){i.value.scrollToElement(fe)},scrollColumnIntoView:function(fe){i.value.scrollColumnIntoView(fe)},baseTableRef:i});var Ae=function(fe){var Fe;(Fe=e.onRowEdit)===null||Fe===void 0||Fe.call(e,fe);var Je=W(fe.editedRow,e.rowKey||"id");Z(Je,fe.row,z({},fe.col.colKey,fe.valu
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var oc={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 To(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function ca(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?To(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):To(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var Po={code:1001,reason:"The same level of rows can not be swapped."};function Ft(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=W(t,e);return n||a?"".concat(r,"_").concat(n||0,"_").concat(a||0,"}"):r}var lc=function(){function t(){Ul(this,t),z(this,"treeDataMap",new Map),z(this,"expandAllRowIndex",void 0),this.treeDataMap=new Map}return Vl(t,[{key:"initialTreeStore",value:function(n,a,r){var o;(o=this.treeDataMap)===null||o===void 0||o.clear(),this.initialTreeDataMap(this.treeDataMap,n,a.find(function(l){return l.colKey==="row-select"}),r)}},{key:"getAllUniqueKeys",value:function(n,a){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=n.length;o<l;o++){var i=n[o];r.push(Ft(i,a.rowKey));var u=W(i,a.childrenKey);u!=null&&u.length&&this.getAllUniqueKeys(u,a,r)}return r}},{key:"getExpandedChildrenKeys",value:function(n,a){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=n.length;o<l;o++){var i=n[o],u=Ft(i,a.rowKey),s=this.treeDataMap.get(u);s.expanded&&r.push(u);var v=W(i,a.childrenKey);v!=null&&v.length&&this.getExpandedChildrenKeys(v,a,r)}return r}},{key:"expandTreeNode",value:function(n,a,r){var o=this;return n.length&&n.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},a,r,"expand")}),a}},{key:"foldTreeNode",value:function(n,a,r){var o=this;return n.length&&n.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},a,r,"fold")}),a}},{key:"toggleExpandData",value:function(n,a,r,o){var l;if(!n)return ze.error("EnhancedTable","the node toggleExpanded doest not exist in `data`"),a;var i=W(n.row,r.rowKey);if(xn(i))return ze.error("EnhancedTable","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`."),[];var u=W(n.row,r.childrenKey);if(u===!0)return a;var s=this.treeDataMap.get(i);return o==="expand"&&s.expanded||o==="fold"&&!s.expanded?a:(s.rowIndex=(l=s.rowIndex)!==null&&l!==void 0?l:n.rowIndex,s.expanded=!s.expanded,this.treeDataMap.set(i,s),this.updateExpandRow(s,a,r))}},{key:"updateExpandRow",value:function(n,a,r){var o=n.row,l=n.rowIndex,i=n.expanded,u=this.treeDataMap,s=W(o,r.childrenKey);if(!o||!s)return a;if(i)or(u,n,i,r),bn(u,o,s.length,"expand",r),a.splice.apply(a,[l+1,0].concat(s));else{or(u,n,i,r);var v=n.expandChildrenLength||s.length;bn(u,o,-1*v,"fold",r),a.splice(l+1,v)}return on(u,a,{rowKey:r.rowKey,minRowIndex:l+1}),a}},{key:"getData",value:function(n){return this.treeDataMap.get(n)}},{key:"updateData",value:function(n,a,r,o){var l=Ft(a,o.rowKey),i=this.treeDataMap.get(n);if(!i||i.rowIndex===-1)return Nl(r,n,a,{rowKey:o.rowKey,childrenKey:o.childrenKey}),-1;if(W(a,o.childrenKey)===!0){var u=W(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),p=this.treeDataMap.get(d);p&&this.treeDataMap.delete(d)}}var b=i.rowIndex;if(i.row=a,i.id=l,i.parent){var m=W(i.parent.row,o.childrenKey),y=m.findIndex(function(S){return Ft(S,o.rowKey)===n});m[y]=a}return this.treeDataMap.set(l,i),n!==l&&this.treeDataMap.delete(n),b}},{key:"remove",value:function(n,a,r){var o=this.treeDataMap.get(n);if(o&&o.rowIndex>=0){var l=(o.expandChildrenLength||0)+1;if(a.splice(o.rowIndex,l),o.parent){var i=W(o.parent.row,r.childrenKey),u=i.findIndex(function(s){return W(s,r.rowKey)===n});i.splice(u,1),bn(this.treeDataMap,o.parent.row,-1*l,"delete",r)}this.treeDataMap.delete(n),on(this.treeDat
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Ao(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Xa(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ao(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ao(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function uc(t,e){var n=e.store,a=e.dataSource,r=e.rowDataKeys,o=Ie(t),l=o.data,i=o.expandedTreeNodes,u=o.tree,s=H(!1),v=H(!1),d=Nt(i,t.defaultExpandedTreeNodes,t.onExpandedTreeNodesChange,"expandedTreeNodes"),p=Pe(d,2),b=p[0],m=p[1],y=H({type:"props-change"});function S(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"expand-all",j=arguments.length>1?arguments[1]:void 0,T=j||l.value;a.value=n.value.expandAll(T,r.value);var F=a.value.map(function(P){return Ft(P,r.value.rowKey)});m(F,{row:void 0,rowState:void 0,rowIndex:void 0,type:"expand",trigger:A}),y.value.type="expand-all"}function x(){a.value=de(n.value.foldAll(a.value,r.value)),m([],{row:void 0,rowState:void 0,rowIndex:void 0,type:"fold",trigger:"fold-all"})}function O(A,j){var T,F=A.row,P=A.rowIndex;y.value=Xa({type:"user-reaction-change"},A);var I=Ft(F,r.value.rowKey),D=n.value.treeDataMap.get(I),w=de(b.value);if(D.expanded){for(var h=n.value.getExpandedChildrenKeys([F],r.value),g=0,c=w.length;g<c;g++){var f=w[g];h.includes(f)&&(w[g]=void 0)}w=w.filter(Boolean)}else w.push(I);var C={row:F,rowIndex:P,rowState:D,trigger:j};m(w,Xa(Xa({},C),{},{type:D.expanded?"fold":"expand"})),(T=t.onTreeExpandChange)===null||T===void 0||T.call(t,C)}function R(A,j){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],F=ic(j,T),P=F.addedList,I=F.removedList;return n.value.expandTreeNode(P,A,r.value),n.value.foldTreeNode(I,A,r.value),de(A)}ve([b,l],function(A,j){var T=Pe(A,1),F=T[0],P=Pe(j,1),I=P[0];if(!(!n.value.treeDataMap.size||!l.value.length)){if(y.value.type==="user-reaction-change"){var D=y.value||{},w=D.row,h=D.rowIndex;a.value=de(n.value.toggleExpandData({row:w,rowIndex:h},de(a.value),r.value))}else y.value.type==="props-change"&&R(a.value,F,I);y.value.type="props-change"}});var _=function(j){var T,F;(T=u.value)!==null&&T!==void 0&&T.defaultExpandAll&&!s.value?(S("default-expand-all",de(j)),s.value=!0):(F=b.value)!==null&&F!==void 0&&F.length&&It(function(){a.value=R(de(j),b.value,[])})};return{tExpandedTreeNode:b,isDefaultExpandAllExecute:s,isDefaultExpandedTreeNodesExecute:v,expandAll:S,foldAll:x,onExpandFoldIconClick:O,updateExpandOnDataChange:_}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function jo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function vt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function sc(t,e){var n=Ie(t),a=n.data,r=n.columns,o=gt("table",t.locale),l=o.t,i=o.globalConfig,u=En({AddRectangleIcon:Ti,MinusRectangleIcon:zi}),s=u.AddRectangleIcon,v=u.MinusRectangleIcon,d=H(new lc),p=ti(),b=H([]),m=ot(),y=m.tableTreeClasses,S=Gn(),x=N(function(){var B;return{rowKey:t.rowKey||"id",childrenKey:((B=t.tree)===null||B===void 0?void 0:B.childrenKey)||"children"}}),O=uc(t,{store:d,dataSource:b,rowDataKeys:x}),R=O.tExpandedTreeNode,_=O.isDefaultExpandAllExecute,A=O.isDefaultExpandedTreeNodesExecute,j=O.expandAll,T=O.foldAll,F=O.updateExpandOnDataChange,P=O.onExpandFoldIconClick,I=N(function(){return r.value.find(function(B){return B.colKey==="row-select"})});ve(I,function(B){!d.value||d.value.updateDisabledState(b.value,B,x.value)});var D=function(X){var Q=vt(vt({},X),{},{type:"fold"}),Y=l(i.value.treeExpandAndFoldIcon,Ge,Q)||L(v,null,null);return S("treeExpandAndFoldIcon",{defaultNode:Y,params:Q})},w=function(X){var Q=vt(vt({},X),{},{type:"expand"}),Y=l(i.value.treeExpandAndFoldIcon,Ge,Q)||L(s,null,null);return S("treeExpandAndFoldIcon",{defaultNode:Y,params:Q})};ve([a],function(){t.tree?h(a.value):b.value=a.value},{immediate:!0}),Lo(function(){var B;!t.tree||((B=d.value.treeDataMap)===null||B===void 0||B.clear(),d.value=null)}),ve(function(){var B;return[r,(B=t.tree)===null||B===void 0?void 0:B.treeNodeColumnIndex]},function(){p.value=f()},{immediate:!0});function h(B){var X,Q=t.columns,Y=t.expandedTreeNodes,se=t.defaultExpandedTreeNodes,he=t.tree;d.value.initialTreeStore(B,Q,x.value);var Le=Boolean(!A.value&&(se==null?void 0:se.length)),Ve=Boolean((he==null?void 0:he.defaultExpandAll)&&!_.value);(X=R.value)!==null&&X!==void 0&&X.length&&!!(Y||Le)||Ve?(F(B),A.value=!0):b.value=de(B)}function g(B){var X,Q;if(B!==void 0){var Y=((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 Y?{paddingLeft:"".concat(B*Y||1,"px")}:{}}}function c(B,X){var Q,Y,se=vt({},B);B.row.VIRTUAL_SCROLL_INDEX!==void 0&&(se.rowIndex=B.row.VIRTUAL_SCROLL_INDEX),b.value=de(d.value.toggleExpandData(se,b.value,x.value));var he=W(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);(Y=t.onTreeExpandChange)===null||Y===void 0||Y.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;(Y=X[Q])!==null&&Y!==void 0&&Y.type||((se=X[Q])===null||se===void 0?void 0:se.colKey)==="__EXPAND_ROW_ICON_COLUMN__";){var Y,se;Q+=1}return X[Q]}function C(B){if(!t.tree||B.colKey!==p.value.colKey)return B;var X=vt({},p.value);return X.cell=function(Q,Y){var se=ya(vt(vt({},Y),{},{col:vt({},p.value)}),e.slots,{cellEmptyContent:t.cellEmptyContent}),he=d.value.treeDataMap.get(W(Y.row,x.value.rowKey)),Le=g(he==null?void 0:he.level),Ve=z({},y.inlineCol,!!B.ellipsis),Ye=W(Y.row,x.value.childrenKey);if(Ye&&Ye instanceof Array||Ye===!0){var Me,lt=(Me=d.value.treeDataMap.get(W(Y.row,x.value.rowKey)))!==null&&Me!==void 0&&Me.expanded?D(Y):w(Y);return L("div",{class:[y.col,Ve],style:Le},[!!(Ye.length||Ye===!0)&&L("span",{class:y.icon,onClick:function(it){P(Y,"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,Y){return ya(vt(vt({},Y),{},{col:vt({},p.value)}),e.slots)}),X}function E(B,X){var Q=d.value.updateData(B,X,b.value,x.value),Y=de(b.value);Y[Q]=X,b.value=Y
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/function Fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function da(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fo(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fo(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var lr=new Map;function Nn(t,e,n,a){if(lr.get(e))return lr.get(e);var r=a||{allChildren:[],allChildrenKeys:[],leafNodeKeys:[]},o=W(e,n.childrenKey);if(!o||!o.length)return r;var l=o.filter(function(x){var O;return!((O=t.get(W(x,n.rowKey)))!==null&&O!==void 0&&O.disabled)});r.allChildren=de(new Set(r.allChildren.concat(l)));for(var i=0,u=o.length;i<u;i++){var s=o[i],v=W(s,n.childrenKey);if(v!=null&&v.length){var d=Nn(t,s,n,r);r.allChildren=de(new Set(r.allChildren.concat(d.allChildren)))}}for(var p=0,b=r.allChildren.length;p<b;p++){var m=r.allChildren[p],y=W(m,n.childrenKey),S=W(m,n.rowKey);r.allChildrenKeys.push(S),(!y||!y.length)&&r.leafNodeKeys.push(S)}return r.allChildrenKeys=de(new Set(r.allChildrenKeys)),r.leafNodeKeys=de(new Set(r.leafNodeKeys)),r}function cc(t,e){for(var n=t.selectedRowKeys,a=t.removeKeys,r=e||{data:[],keys:[]},o=0,l=n.length;o<l;o++){var i=n[o];a.includes(i)||r.keys.push(i)}return r}function dc(t){for(var e=t.treeDataMap,n=t.selectedRowKeys,a=[],r=0,o=n.length;r<o;r++){var l=n[r];a.push(e.get(l))}return a}function vc(t,e){var n=Ie(t),a=n.selectedRowKeys,r=n.tree,o=n.data,l=n.indeterminateSelectedRowKeys,i=H([]),u=Nt(a,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),s=Pe(u,2),v=s[0],d=s[1],p=N(function(){var O;return{rowKey:t.rowKey||"id",childrenKey:((O=t.tree)===null||O===void 0?void 0:O.childrenKey)||"children"}});ve([r,e,o,v],function(O){var R=Pe(O,2),_=R[0],A=R[1];!_||!A.size||_.checkStrictly||b()});function b(){if(!(!r.value||r.value.checkStrictly)){if(!v.value.length){i.value=[];return}for(var O=[],R={},_=0,A=v.value.length;_<A;_++){var j=v.value[_],T=e.value.get(j);if(!!T){var F=W(T.row,p.value.childrenKey);if(!F||!F.length)for(var P=T.parent;P;){R[P.id]||(R[P.id]=[]),R[P.id].push(T.row);var I=R[P.id].length,D=Nn(e.value,P.row,p.value),w=D.allChildrenKeys,h=O.indexOf(P.id),g=v.value.indexOf(P.id);I>0&&I<w.length&&g===-1?h===-1&&O.push(P.id):h!==-1&&O.splice(h,1),P=P.parent}}}i.value=O}}function m(O,R,_){if(!(!r.value||r.value.checkStrictly)){for(var A=de(O),j=e.value.get(R),T=j.parent;T;){var F=Nn(e.value,T.row,p.value),P=F.leafNodeKeys,I=ba(P,O),D=A.indexOf(T.id);_==="uncheck"?D!==-1&&A.splice(D,1):I.length===P.length&&D===-1&&A.push(T.id),T=T.parent}return A}}function y(O,R){if(!r.value||r.value.checkStrictly){d(O,R);return}R.currentRowKey==="CHECK_ALL_BOX"?S(R):x(O,R)}function S(O){var R=[],_=[];if(O.type==="check")for(var A=de(e.value.values()),j=0,T=A.length;j<T;j++){var F=A[j];F.disabled||(_.push(F.row),R.push(W(F.row,p.value.rowKey)))}var P=da(da({},O),{},{selectedRowData:_||[]});d(R,P)}function x(O,R){var _,A=de(O);if(((_=t.tree)===null||_===void 0?void 0:_.checkStrictly)===!1){if((R==null?void 0:R.type)==="check"){var j=Nn(e.value,R.currentRowData,p.value),T=j.allChildrenKeys;lr.set(R.currentRowData,j),A=de(new Set(A.concat(T)))}else if((R==null?void 0:R.type)==="uncheck"){var F=Nn(e.value,R.currentRowData,p.value),P=cc({selectedRowKeys:O,removeKeys:F.allChildrenKeys});A=P.keys}}A=m(A,R.currentRowKey,R.type);var I=dc({treeDataMap:e.value,selectedRowKeys:A}),D=da(da({},R),{},{selectedRowData:I});d(A,D)}return{tIndeterminateSelectedRowKeys:l.value?l:i,onInnerSelectChange:y}}/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/var fc=["store","dataSource","formatTreeColumn","swapData","onExpandFoldIconClick"];function Ko(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function Dt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ko(Object(n),!0).forEach(function(a){z(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ko(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}var hc=Ne({name:"TEnhancedTable",props:Dt(Dt(Dt({},On),yl),oc),setup:function(e,n){var a=H(null),r=sc(e,n),o=r.store,l=r.dataSource,i=r.formatTreeColumn,u=r.swapData,s=r.onExpandFoldIconClick,v=rl(r,fc),d=kt(),p=H(o.value.treeDataMap),b=vc(e,p),m=b.tIndeterminateSelectedRowKeys,y=b.onInnerSelectChange,S=function j(T){for(var F=[],P=0,I=T.length;P<I;P++){var D,w,h=Dt({},T[P]);h=i(h),(D=h.children)!==null&&D!==void 0&&D.length&&(h.children=j(h.children)),(!h.children||(w=h.children)!==null&&w!==void 0&&w.length)&&F.push(h)}return F},x=N(function(){var j=!e.tree||!Object.keys(e.tree).length;return j?e.columns:S(e.columns)}),O=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))},R=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 j(T,F){if(!T)return-1;if(T.rowIndex>=0)return T.rowIndex;if(T.rowIndex<0)return j(T.parent)},A=function(T){var F=T.index;if(!F&&F!==0){if(!T.key){ze.error("Table","scrollToElement: one of `index` or `key` must exist.");return}var P=p.value.get(T.key);F=_(P,T.key),(F<0||F===void 0)&&ze.error("Table","".concat(T.key," does not exist in data, check `rowKey` or `data` please."))}a.value.scrollToElement(Dt(Dt({},T),{},{index:F}))};return n.expose(Dt(Dt({store:o.value,dataSource:l.value},v),{},{primaryTableRef:a,validateRowData:function(T){return a.value.validateRowData(T)},validateTableData:function(){return a.value.validateTableData()},clearValidateData:function(){a.value.clearValidateData()},refreshTable:function(){a.value.refreshTable()},scrollToElement:A})),function(){var j,T=No(),F=T.vnode,P=Dt(Dt({},F.props),{},{rowKey:e.rowKey||"id",data:l.value,columns:x.value,indeterminateSelectedRowKeys:m.value,disableDataPage:Boolean(e.tree&&Object.keys(e.tree).length),onSelectChange:y,onDragSort:O,rowClassName:function(D){var w=D.row,h=W(w,e.rowKey||"id"),g=p.value.get(h);return g?["".concat(d.value,"-table-tr--level-").concat(g.level),e.rowClassName]:[e.rowClassName]}});return(j=e.tree)!==null&&j!==void 0&&j.expandTreeNodeOnClick&&(P.onRowClick=R),L(mr,Ke(P,{ref:a}),n.slots)}}});/**
|
||
|
* tdesign v1.9.4
|
||
|
* (c) 2024 tdesign
|
||
|
* @license MIT
|
||
|
*/Yt(wl);Yt(mr);Yt(hc);var gc=ir(mr),Dc=Yt(gc,"TTable");export{Ec as M,Dc as T};
|