2024-07-22 04:42:06 +00:00
|
|
|
import{O as un,P as sn,Q as cn,b as Kt,i as Yt,a2 as Re,aj as xe,aG as Kl,ah as Te,w as qt,as as Po,ar as Ll,at as kl,au as Ao,n as Pe,g as fe,c as jo,f as z,m as Lt,h as Fo,az as Un,l as Io,aH as Nl,aI as gr,o as dt,aJ as Ml,aA as Va,aK as Bl,aL as Ko,aq as zl,$ as H,aM as Hl,aN as Wl,aO as $l,av as Vl,d as ht,a1 as Ul,W as Ua,al as Xl,aP as pr,aQ as Gl,ab as Lo,X as En,aR as Yl,N as pa,k as Pa,a4 as ql,aS as Jl,a0 as rr,am as Zl,aT as Ql,aU as ei}from"./index.3e53dd4f.js";import{d as ze,c as N,f as W,w as de,o as yt,bN as ti,bO as ni,b as Ra,aI as L,n as Gt,t as Ke,i as br,aV as Ie,bA as ai,u as ri,x as oi,y as li,aY as ko,p as No,r as Xn,h as Ye,aU as dn,aZ as ii,g as Mo,s as ui}from"./arco.c29bba08.js";import{_ as Bo,b as zo,o as Ho,c as mr,t as si,d as or,T as Wo,p as Cn,P as ci,e as $o,u as di,f as kt,A as Vo,g as Uo,h as Xa,i as wr,E as Xo,j as Go,k as Yo,l as vi,m as ba,C as Ga,a as qo,n as fi,q as hi,r as gi}from"./dep-6deb4e3a.300404c4.js";import{i as xn,b as Jo,d as pi,_ as Zo,c as bi,l as Be,I as mi}from"./index.c4d5074a.js";import{_ as Ya,r as wn,i as wi,s as $n,v as Qo}from"./form-model.d4a8bc76.js";function yr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Cr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?yr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):yr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var yi={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2 2h20v20H2V2zm2 2v16h16V4H4zm9 2.5V11h4.5v2H13v4.5h-2V13H6.5v-2H11V6.5h2z"}}]},Ci=ze({name:"AddRectangleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-add-rectangle",r.value]),i=N(()=>Cr(Cr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(yi,u.value)}});const xi=Ci;function xr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Sr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):xr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Si={tag:"svg",attrs:{fill:"none",viewBox:"0 0 24 24",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12 3a9 9 0 100 18 9 9 0 000-18zM1 12a11 11 0 1122 0 11 11 0 01-22 0zm9.5-5.41L15.91 12l-5.41 5.41L9.09 16l4-4-4-4 1.41-1.41z"}}]},Oi=ze({name:"ChevronRightCircleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=un(n),l=N(()=>["t-icon","t-icon-chevron-right-circle",r.value]),i=N(()=>Sr(Sr({},o.value),a.style)),u=N(()=>({class:l.value,style:i.value,onClick:s=>{var v;return(v=t.onClick)===null||v===void 0?void 0:v.call(t,{e:s})}}));return()=>sn(Si,u.value)}});const Ri=Oi;function Or(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Rr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(a),!0).forEach(function(n){cn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Or(Object(a)).forEach(function(n){Object.definePropert
|
2024-07-20 03:44:29 +00:00
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Bi={container:{type:[String,Function],default:function(){return function(){return window}}},content:{type:[String,Function]},default:{type:[String,Function]},offsetBottom:{type:Number,default:0},offsetTop:{type:Number,default:0},zIndex:{type:Number},onFixedChange:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var zi=ze({name:"TAffix",props:Bi,emits:["fixedChange"],setup:function(e,a){var n,r=Kt("affix"),o=Yt(),l=W(null),i=W(null),u=W((n=document)===null||n===void 0?void 0:n.createElement("div")),s=W(!1),v=W(!1),d=W(),b=W(),p=0,w=function(){s.value||(p=window.requestAnimationFrame(function(){var R,O;p=0;var _=(R=(O=l.value)===null||O===void 0?void 0:O.getBoundingClientRect())!==null&&R!==void 0?R:{top:0,width:0,height:0},j=_.top,A=_.width,T=_.height,F=0;d.value instanceof HTMLElement&&(F=d.value.getBoundingClientRect().top);var P,K=j-F,D=d.value[d.value instanceof Window?"innerHeight":"clientHeight"]-T,m=F+D-e.offsetBottom;if(!xn(e.offsetTop)&&K<=e.offsetTop?P=F+e.offsetTop:!xn(e.offsetBottom)&&j>=m?P=m:P=!1,i.value){var h=P!==!1,g=l.value.contains(u.value);h?(i.value.className=r.value,b.value={top:"".concat(P,"px"),width:"".concat(A,"px"),height:"".concat(T,"px"),zIndex:e.zIndex},g||(u.value.style.width="".concat(A,"px"),u.value.style.height="".concat(T,"px"),l.value.appendChild(u.value))):(i.value.removeAttribute("class"),b.value=void 0,g&&u.value.remove()),a.emit("fixedChange",h,{top:Number(P)}),Re(e.onFixedChange)&&e.onFixedChange(h,{top:Number(P)})}s.value=!1}),s.value=!0)},y=function(){var x=Ya(wn.mark(function R(){return wn.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,Gt();case 2:if(!v.value){_.next=4;break}return _.abrupt("return");case 4:d.value=Kl(e.container),Te(d.value,"scroll",w),Te(window,"resize",w),v.value=!0;case 8:case"end":return _.stop()}},R)}));return function(){return x.apply(this,arguments)}}(),S=function(){!d.value||!v.value||(xe(d.value,"scroll",w),xe(window,"resize",w),p&&window.cancelAnimationFrame(p),v.value=!1)};return de(function(){return e.offsetTop},function(){w()}),de(function(){return e.offsetBottom},function(){w()}),de(function(){return e.zIndex},function(){w()}),yt(y),ti(y),ni(S),Ra(S),{affixWrapRef:l,affixRef:i,bindScroll:y,unbindScroll:S,handleScroll:w,scrollContainer:d,renderTNodeJSX:o,affixStyle:b}},render:function(){return L("div",{ref:"affixWrapRef"},[L("div",{ref:"affixRef",style:this.affixStyle},[this.renderTNodeJSX("default")])])}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Zn=qt(zi);/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Hi=Po,Wi=Bo,$i=zo,Vi=Ll,Ui=kl,Xi=Ao,Gi=200;function Yi(t,e,a,n){var r=-1,o=Wi,l=!0,i=t.length,u=[],s=e.length;if(!i)return u;a&&(e=Vi(e,Ui(a))),n?(o=$i,l=!1):e.length>=Gi&&(o=Xi,l=!1,e=new Hi(e));e:for(;++r<i;){var v=t[r],d=a==null?v:a(v);if(v=n||v!==0?v:0,l&&d===d){for(var b=s;b--;)if(e[b]===d)continue e;u.push(v)}else o(e,d,n)||u.push(v)}return u}var qi=Yi;/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var el={allowUncheck:Boolean,checked:{type:Boolean,default:void 0},modelValue:{type:Boolean,default:void 0},defaultChecked:Boolean,default:{type:[String,Function]},disabled:{type:Boolean,default:void 0},label:{type:[String,Function]},name:{type:String,default:""},readonly:Boolean,value:{type:[String,Number,Boolean],default:void 0},onChange:Function,onClick:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var tl=Symbol("RadioGroupProvide"),nl=Symbol("RadioButtonProvide");/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Ir(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ji(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ir(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ir(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Zi(t){var e={};return Object.keys(t).forEach(function(a){xn(t[a])||(e[a]=t[a])}),e}var lr=ze({name:"TRadio",inheritAttrs:!1,props:Ji({},el),setup:function(e,a){var n=a.attrs,r=W(),o=Ke(e),l=o.checked,i=o.modelValue,u=Jo(l,i,e.defaultChecked,e.onChange,"checked"),s=Pe(u,2),v=s[0],d=s[1],b=N(function(){return p?e.value===p.value:v.value}),p=br(tl,void 0),w=N(function(){return Boolean(e.allowUncheck||(p==null?void 0:p.allowUncheck))}),y=function(c){c.stopPropagation()},S=function(c){var f;if(!(_.value||e.readonly)&&((f=e.onClick)===null||f===void 0||f.call(e,{e:c}),!(b.value&&!w.value)))if(p){var C=b.value&&w.value?void 0:e.value;p.setValue(C,{e:c})}else{var E=w.value?!b.value:!0;d(E,{e:c})}},x=N(function(){return Zi({focus:n.onFocus,blur:n.onBlur,keydown:n.onKeydown,keyup:n.onKeyup,keypresss:n.onKeypresss})}),R=N(function(){var g=[].concat(fe(Object.keys(x.value)),["input","change"]).map(function(c){return"on".concat(c[0].toUpperCase()).concat(c.slice(1))});return Ho(n,g)}),O=N(function(){return p==null?void 0:p.disabled}),_=pi(O),j=N(function(){return{name:p?p.name:e.name,checked:b.value,disabled:_.value,readonly:e.readonly,value:e.value}}),A=jo(),T=A.STATUS,F=br(nl,void 0),P=Kt("radio-button"),K=Kt("radio"),D=N(function(){return F?P.value:K.value}),m=N(function(){return["".concat(D.value),z(z({},T.value.checked,j.value.checked),T.value.disabled,j.value.disabled)]}),h=Fo();return function(){return L("label",Ie({ref:r,class:m.value},R.value,{tabindex:_.value?void 0:"0",onClick:S}),[L("input",Ie({type:"radio",class:"".concat(D.value,"__former")},x.value,j.value,{onClick:y,tabindex:"-1","data-value":Lt(e.value)?"'".concat(e.value,"'"):e.value,"data-allow-uncheck":w.value||void 0}),null),L("span",{class:"".concat(D.value,"__input")},null),L("span",{class:"".concat(D.value,"__label")},[h("default","label")])])}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Qi={allowUncheck:Boolean,disabled:Boolean,name:{type:String,default:""},options:{type:Array},size:{type:String,default:"medium",validator:function(e){return e?["small","medium","large"].includes(e):!0}},value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean]},variant:{type:String,default:"outline",validator:function(e){return e?["outline","primary-filled","default-filled"].includes(e):!0}},onChange:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function eu(t,e){var a=function(r){var o=mr.test(r.key)||mr.test(r.code);if(o){r.preventDefault();var l=r.target.querySelector("input");if(!l)return;var i=l.dataset;if(l.checked&&i.allowUncheck)e(void 0,{e:r});else{var u=isNaN(Number(i.value))?i.value:Number(i.value);u=Lt(u)&&{true:!0,false:!1}[u]||u,u=Lt(u)&&u[0]==="'"?u.replace(/'/g,""):u,e(u,{e:r})}}};yt(function(){Te(t.value,"keydown",a)}),ai(function(){xe(t.value,"keydown",a)})}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var tu=["window"],nu=typeof window<"u"?window:void 0;function au(t){var e,a=ri(t);return(e=a==null?void 0:a.$el)!==null&&e!==void 0?e:a}function ru(t){return oi()?(li(t),!0):!1}function ou(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=a.window,r=n===void 0?nu:n,o=Zo(a,tu),l,i=r&&"MutationObserver"in r,u=function(){l&&(l.disconnect(),l=void 0)},s=de(function(){return au(t)},function(d){u(),i&&r&&d&&(l=new MutationObserver(e),l.observe(d,o))},{immediate:!0}),v=function(){u(),s()};return ru(v),{isSupported:i,stop:v}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Kr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Aa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Kr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var lu=ze({name:"TRadioGroup",props:Aa({},Qi),setup:function(e){var a=Ke(e),n=a.value,r=a.modelValue,o=Jo(n,r,e.defaultValue,e.onChange),l=Pe(o,2),i=l[0],u=l[1],s=W(),v=Kt("radio-button"),d=jo(),b=d.STATUS,p=d.SIZE;eu(s,u);var w=N(function(){return".".concat(v.value,".").concat(b.value.checked)}),y=W({width:"0px",height:"0px",left:"0px",top:"0px","transition-property":"none"}),S=function(){var m=document.createElement("div");m.setAttribute("style","position: absolute; visibility: hidden;"),m.appendChild(s.value.cloneNode(!0)),document.body.appendChild(m);var h=m.querySelector(w.value),g=h.offsetWidth,c=h.offsetHeight,f=h.offsetLeft,C=h.offsetTop;y.value=Aa(Aa({},y.value),{},{width:"".concat(g,"px"),height:"".concat(c,"px"),left:"".concat(f,"px"),top:"".concat(C,"px")}),document.body.removeChild(m)},x=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(e.variant!=="outline"){var h=s.value.querySelector(w.value),g=m?"none":"all";if(!h){y.value={"transition-property":g,width:"0px",height:"9px",left:"0px",top:"0px"};return}var c=h.offsetWidth,f=h.offsetHeight,C=h.offsetLeft,E=h.offsetTop;c?y.value={"transition-property":g,width:"".concat(c,"px"),height:"".concat(f,"px"),left:"".concat(C,"px"),top:"".concat(E,"px")}:S()}},R;de(i,Ya(wn.mark(function D(){return wn.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Gt();case 2:x();case 3:case"end":return h.stop()}},D)}))),yt(function(){x(!0),bi(s,si(Ya(wn.mark(function m(){return wn.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gt();case 2:x();case 3:case"end":return g.stop()}},m)})),300));var D=s.value.querySelector("".concat(w.value," .").concat(v.value,"__label"));D&&(R=ou(D,function(m){m.forEach(function(h){h.type==="characterData"&&x()})},{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}),ko(function(){var D;(D=R)===null||D===void 0||D.stop()});var O=Ke(e),_=O.name,j=O.disabled;No(tl,Xn({name:_,disabled:j,value:i,allowUncheck:e.allowUncheck,setValue:u}));var A=Kt("radio-group"),T=Un(),F=function(){if(e.variant.includes("filled")&&!wi(i.value))return L("div",{style:y.value,class:"".concat(A.value,"__bg-block")},null)},P=function(){var m;return(m=e.options)===null||m===void 0?void 0:m.map(function(h){var g=h;return(Io(h)||Lt(h))&&(g={value:h,label:h.toString()}),L(lr,{key:"radio-group-options-".concat(g.value,"-").concat(Math.random()),name:e.name,checked:i.value===g.value,disabled:"disabled"in g?g.disabled:e.disabled,value:g.value},{default:function(){return[Re(g.label)?g.label(Ye):g.label]}})})},K=N(function(){return["".concat(A.value),p.value[e.size],z(z(z({},"".concat(A.value,"__outline"),e.variant==="outline"),"".concat(A.value,"--filled"),e.variant.includes("filled")),"".concat(A.value,"--primary-filled"),e.variant==="primary-filled")]});return function(){return L("div",{ref:s,class:K.value},[T("default")||P(),F()])}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Lr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ja(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Lr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function iu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var uu=ze({name:"TRadioButton",inheritAttrs:!1,props:ja({},el),setup:function(e,a){var n=a.attrs;No(nl,Xn({}));var r=N(function(){var l=ja(ja({},e),Ho(n,Object.keys(n).filter(function(i){return i.startsWith("on")})));return l}),o=Fo();return function(){var l;return L(lr,r.value,iu(l=o("default","label"))?l:{default:function(){return[l]}})}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var su=qt(lr),cu=qt(lu);qt(uu);/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var On={activeRowKeys:{type:Array,default:void 0},defaultActiveRowKeys:{type:Array,default:function(){return[]}},activeRowType:{type:String,default:""},allowResizeColumnWidth:{type:Boolean,default:void 0},attach:{type:[String,Function]},bordered:Boolean,bottomContent:{type:[String,Function]},cellEmptyContent:{type:[String,Function]},columns:{type:Array,default:function(){return[]}},data:{type:Array,default:function(){return[]}},disableDataPage:Boolean,disableSpaceInactiveRow:{type:Boolean,default:void 0},empty:{type:[String,Function],default:""},firstFullRow:{type:[String,Function]},fixedRows:{type:Array},footData:{type:Array,default:function(){return[]}},footerAffixProps:{type:Object},footerAffixedBottom:{type:[Boolean,Object],default:!1},footerSummary:{type:[String,Function]},headerAffixProps:{type:Object},headerAffixedTop:{type:[Boolean,Object],default:!1},height:{type:[String,Number]},horizontalScrollAffixedBottom:{type:[Boolean,Object]},hover:Boolean,keyboardRowHover:{type:Boolean,default:!0},lastFullRow:{type:[String,Function]},lazyLoad:Boolean,loading:{type:[Boolean,Function],default:void 0},loadingProps:{type:Object},locale:{type:Object},maxHeight:{type:[String,Number]},pagination:{type:Object},paginationAffixedBottom:{type:[Boolean,Object]},resizable:Boolean,rowAttributes:{type:[Object,Array,Function]},rowClassName:{type:[String,Object,Array,Function]},rowKey:{type:String,default:"id",required:!0},rowspanAndColspan:{type:Function},rowspanAndColspanInFooter:{type:Function},scroll:{type:Object},showHeader:{type:Boolean,default:!0},size:{type:String,validator:function(e){return e?["small","medium","large"].includes(e):!0}},stripe:Boolean,tableContentWidth:{type:String,default:""},tableLayout:{type:String,default:"fixed",validator:function(e){return e?["auto","fixed"].includes(e):!0}},topContent:{type:[String,Function]},verticalAlign:{type:String,default:"middle",validator:function(e){return e?["top","middle","bottom"].includes(e):!0}},onActiveChange:Function,onActiveRowAction:Function,onCellClick:Function,onColumnResizeChange:Function,onPageChange:Function,onRowClick:Function,onRowDblclick:Function,onRowMousedown:Function,onRowMouseenter:Function,onRowMouseleave:Function,onRowMouseover:Function,onRowMouseup:Function,onScroll:Function,onScrollX:Function,onScrollY:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function al(t,e){for(var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=a,r=0,o=t.length;r<o;r++){var l,i=t[r];if(e.set(i,a),i!=null&&(l=i.children)!==null&&l!==void 0&&l.length){var u=al(i.children,e,a+1);u>n&&(n=u)}}return n}function rl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=e,n=(t==null?void 0:t.children)||[],r=0,o=n.length;r<o;r++){var l=n[r];l.children?a=rl(l,a):a+=1}return a}function du(t){var e=new Map,a=al(t,e),n=new Map,r=function l(i,u){for(var s=0,v=i.length;s<v;s++){var d,b=i[s],p=b.children?1:a-e.get(b)+1,w=b.children?rl(b):1,y={};p>1&&(y.rowspan=p),w>1&&(y.colspan=w),n.set(b,y),b!=null&&(d=b.children)!==null&&d!==void 0&&d.length?l(b.children,u):u.push(b)}},o=[];return r(t,o),{rowspanAndColspanMap:n,leafColumns:o}}function vu(t){var e=function n(r,o){for(var l,i=[],u=[],s=0,v=r.length;s<v;s++){var d,b=r[s],p=[b];i=i.concat(p),b!=null&&(d=b.children)!==null&&d!==void 0&&d.length&&(u=u.concat(b.children))}return(l=u)!==null&&l!==void 0&&l.length&&n(u,o),o.push(i),i},a=[];return e(t,a),a=a.reverse(),a}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ot(){var t=Kt(),e={classPrefix:t.value,tableBaseClass:{table:"".concat(t.value,"-table"),columnResizableTable:"".concat(t.value,"-table--column-resizable"),overflowVisible:"".concat(t.value,"-table--overflow-visible"),body:"".concat(t.value,"-table__body"),content:"".concat(t.value,"-table__content"),topContent:"".concat(t.value,"-table__top-content"),bottomContent:"".concat(t.value,"-table__bottom-content"),paginationWrap:"".concat(t.value,"-table__pagination-wrap"),tdLastRow:"".concat(t.value,"-table__td-last-row"),tdFirstCol:"".concat(t.value,"-table__td-first-col"),thCellInner:"".concat(t.value,"-table__th-cell-inner"),tableRowEdit:"".concat(t.value,"-table--row-edit"),cellEditable:"".concat(t.value,"-table__cell--editable"),cellEditWrap:"".concat(t.value,"-table__cell-wrap"),bordered:"".concat(t.value,"-table--bordered"),striped:"".concat(t.value,"-table--striped"),hover:"".concat(t.value,"-table--hoverable"),loading:"".concat(t.value,"-table--loading"),rowspanAndColspan:"".concat(t.value,"-table--rowspan-colspan"),empty:"".concat(t.value,"-table__empty"),emptyRow:"".concat(t.value,"-table__empty-row"),headerFixed:"".concat(t.value,"-table--header-fixed"),columnFixed:"".concat(t.value,"-table--column-fixed"),widthOverflow:"".concat(t.value,"-table--width-overflow"),multipleHeader:"".concat(t.value,"-table--multiple-header"),footerAffixed:"".concat(t.value,"-table--footer-affixed"),horizontalBarAffixed:"".concat(t.value,"-table--horizontal-bar-affixed"),affixedHeader:"".concat(t.value,"-table--affixed-header"),affixedHeaderElm:"".concat(t.value,"-table__affixed-header-elm"),affixedFooterElm:"".concat(t.value,"-table__affixed-footer-elm"),affixedFooterWrap:"".concat(t.value,"-table__affixed-footer-wrap"),scrollbarDivider:"".concat(t.value,"-table__scroll-bar-divider"),fullHeight:"".concat(t.value,"-table--full-height"),resizeLine:"".concat(t.value,"-table__resize-line"),obviousScrollbar:"".concat(t.value,"-table__scrollbar--obvious"),affixedHeaderWrap:"".concat(t.value,"-table__affixed-header-elm-wrap")},tdAlignClasses:{left:"".concat(t.value,"-align-left"),right:"".concat(t.value,"-align-right"),center:"".concat(t.value,"-align-center")},tableHeaderClasses:{header:"".concat(t.value,"-table__header"),thBordered:"".concat(t.value,"-table__header-th--bordered"),fixed:"".concat(t.value,"-table__header--fixed"),multipleHeader:"".concat(t.value,"-table__header--multiple")},tableFooterClasses:{footer:"".concat(t.value,"-table__footer"),fixed:"".concat(t.value,"-table__footer--fixed")},tableAlignClasses:{top:"".concat(t.value,"-vertical-align-top"),middle:"".concat(t.value,"-vertical-align-middle"),bottom:"".concat(t.value,"-vertical-align-bottom")},tableRowFixedClasses:{top:"".concat(t.value,"-table__row--fixed-top"),bottom:"".concat(t.value,"-table__row--fixed-bottom"),firstBottom:"".concat(t.value,"-table__row--fixed-bottom-first"),withoutBorderBottom:"".concat(t.value,"-table__row--without-border-bottom")},tableColFixedClasses:{left:"".concat(t.value,"-table__cell--fixed-left"),right:"".concat(t.value,"-table__cell--fixed-right"),lastLeft:"".concat(t.value,"-table__cell--fixed-left-last"),firstRight:"".concat(t.value,"-table__cell--fixed-right-first"),leftShadow:"".concat(t.value,"-table__content--scrollable-to-left"),rightShadow:"".concat(t.value,"-table__content--scrollable-to-right")},tableLayoutClasses:{auto:"".concat(t.value,"-table--layout-auto"),fixed:"".concat(t.value,"-table--layout-fixed")},tdEllipsisClass:"".concat(t.value,"-table-td--ellipsis"),tableFullRowClasses:{base:"".concat(t.value,"-table__row--full"),innerFullRow:"".concat(t.value,"-table__row-full-inner"),innerFullElement:"".concat(t.value,"-table__row-full-element"),firstFullRow:"".concat(t.value,"-table__first-full-row"),lastFullRow:"".concat(t.value,"-table__last-full-row")},tableExpandClasses:{iconBox:"".concat(t.value,"-table__expand-box"),iconCell:"".concat(t.value,"-table__expandable-icon-cell"),row:"".concat(t.value,"-table__expanded-row"),rowInner:"".concat(t.value,"-table__expanded-row-inner"),expanded:"".concat(t.value,"-table
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function kr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function fu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):kr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function hu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var ir=ze({name:"TEllipsis",props:{content:{type:[String,Function]},default:{type:[String,Function]},tooltipContent:{type:[String,Number,Function]},placement:String,attach:[String,Function],tooltipProps:Object,zIndex:Number,overlayClassName:String,classPrefix:{type:String,default:"t"}},setup:function(e){var a=W(),n=W(!1),r=N(function(){return["".concat(e.classPrefix,"-table__ellipsis"),"".concat(e.classPrefix,"-text-ellipsis")]}),o=N(function(){return["".concat(e.classPrefix,"-table__ellipsis-content"),e.overlayClassName]}),l=function(){!a.value||(n.value=gr(a.value))},i=function(){!a.value||(n.value=gr(a.value))},u=or(function(s){s.type==="mouseleave"?i():l()},80);return{root:a,isOverflow:n,ellipsisClasses:r,innerEllipsisClassName:o,onMouseAround:u}},render:function(){var e=Nl(this,"default","content"),a=L("div",{ref:"root",class:this.ellipsisClasses,onMouseenter:this.onMouseAround,onMouseleave:this.onMouseAround},[e]),n=null,r=this.tooltipProps;if(this.isOverflow){var o=fu({content:this.tooltipContent||function(){return e},destroyOnClose:!0,zIndex:this.zIndex,attach:this.attach,placement:this.placement,overlayClassName:r!=null&&r.overlayClassName?this.innerEllipsisClassName.concat(r.overlayClassName):this.innerEllipsisClassName},r);n=L(Wo,o,hu(a)?a:{default:function(){return[a]}})}else n=a;return n}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Nr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Mr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Nr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Nr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function gu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}function Ea(t,e,a){var n={col:e,colIndex:a};return Re(e.title)?e.title(Ye,n):Lt(e.title)&&t[e.title]?t[e.title](n):Re(e.render)&&e.render(Ye,Mr(Mr({},n),{},{type:"title",row:{},rowIndex:-1}))||e.title}function ol(t){var e=ot(),a=e.tableSortClasses,n=e.tableFilterClasses,r=N(function(){return du(t.columns)}),o=N(function(){return vu(t.columns)}),l=N(function(){return o.value.length>1}),i=function(s,v,d,b,p,w){var y=Pe(s,3),S=y[0],x=y[1],R=y[2],O=z(z({},a.sortable,x),n.filterable,R),_=Re(b)?b(Ye,{col:v,colIndex:d}):void 0,j=Boolean(b!==void 0?b:v.ellipsis);return L("div",{class:O},[L("div",{class:a.title},[j?L(ir,{placement:"bottom",attach:t.attach||(p?function(){return p}:void 0),tooltipContent:_&&function(){return _},tooltipProps:dt(b)==="object"?b:void 0,classPrefix:w==null?void 0:w.classPrefix,overlayClassName:w==null?void 0:w.ellipsisOverlayClassName},gu(S)?S:{default:function(){return[S]}}):L("div",null,[S]),Boolean(x||R)&&L("div",{class:n.iconWrap},[x,R])])])};return{thList:o,isMultipleHeader:l,spansAndLeafNodes:r,renderTitleWidthIcon:i}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Br(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function pu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Br(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var bu=80,mu=600,zr=8;function wu(t){var e=t.isWidthOverflow,a=t.tableContentRef,n=t.showColumnShadow,r=t.getThWidthList,o=t.updateThWidthList,l=t.setTableElmWidth,i=t.updateTableAfterColumnResize,u=t.onColumnResizeChange,s=W(),v=W({}),d=W([]),b,p;yt(function(){var m=typeof document<"u";b=m?document.onselectstart:null,p=m?document.ondragstart:null});var w=function(h,g,c){for(var f=g;h[f]&&h[f].resizable===!1;)c==="next"?f+=1:f-=1;return h[f]},y=function m(h,g){!h||(d.value=h,h.forEach(function(c,f){var C=w(h,f-1,"prev"),E=w(h,f+1,"next"),k=g?v.value[g.colKey].prev:E,I=g?v.value[g.colKey].next:C,M=f===0?k:C,$=f===h.length-1?I:E;v.value[c.colKey]={prev:M,next:$,current:{prevSibling:w(h,f-1,"prev"),nextSibling:w(h,f+1,"next")}},m(c.children,c)}))},S={isDragging:!1,draggingCol:null,draggingStart:0,effectCol:"next"},x=Xn({display:"none",height:"10px",left:"10px",bottom:"0"}),R=function(h){return h.fixed==="right"&&n.right},O=function(h,g){if(!(!s.value||S.isDragging||!h.target)){var c=h.target.closest("th"),f=c.getAttribute("data-colkey");if(!!d.value.find(function(X){return X.colKey===f})){var C=c.getBoundingClientRect(),E=C.right-h.pageX<=zr,k=h.pageX-C.left<=zr,I=R(g);if(E||I){var M,$=(M=g.resizable)!==null&&M!==void 0?M:!0;if($){c.style.cursor=E||I&&k?"col-resize":"";var Y=E&&!I||I&&k;S.draggingCol=Y?c:c.nextElementSibling,S.effectCol="next";return}}else if(k){var ee=c.previousElementSibling;if(ee){var ne,ae,J=(ne=v.value[g.colKey])===null||ne===void 0?void 0:ne.prev,B=(ae=J==null?void 0:J.resizable)!==null&&ae!==void 0?ae:!0;if(B){c.style.cursor="col-resize",S.draggingCol=ee,S.effectCol="prev";return}}}c.style.cursor="",S.draggingCol=null,S.effectCol=null}}},_=function(h){var g,c,f=Io(h.minWidth)?h.minWidth:parseInt(h.minWidth||"0",10);return{minColWidth:Math.max(((g=h.resize)===null||g===void 0?void 0:g.minWidth)||bu,f),maxColWidth:((c=h.resize)===null||c===void 0?void 0:c.maxWidth)||mu}},j=function(h,g,c,f){var C=c.right-f.left,E=c.left-f.left,k=S.effectCol==="next"?h:g,I=_(k),M=I.minColWidth,$=I.maxColWidth;return{resizeLinePos:C,minResizeLineLeft:E+M,maxResizeLineLeft:E+$}},A=function(h,g,c,f,C){var E=f.left-C.left,k=h.dataset.colkey===g.colKey?g:c,I=f.left-C.left,M=_(k),$=M.minColWidth,Y=M.maxColWidth;return{resizeLinePos:E,minResizeLineLeft:I+(f.width-Y),maxResizeLineLeft:I+(f.width-$)}},T=function(h,g){var c=h.left-g.left,f=h.left-g.left;return{resizeLinePos:c,minResizeLineLeft:f,maxResizeLineLeft:f}},F=function(h){var g=0;return d.value.forEach(function(c){g+=h[c.colKey]}),g},P=function(h,g,c,f){var C=!0;if(g){var E=_(g),k=E.minColWidth,I=E.maxColWidth,M=h[g.colKey]+c;C=M<k||M>I}return!(C||e.value||f===d.value.length-1)},K=function(h,g,c,f){return g?j(h,g,c,f):T(c,f)},D=function(h,g,c){var f,C,E;if(!!S.draggingCol){var k=S.draggingCol,I=k.getBoundingClientRect(),M=(f=a.value)===null||f===void 0?void 0:f.getBoundingClientRect(),$=(C=v.value[g.colKey])===null||C===void 0?void 0:C.next,Y=(E=v.value[g.colKey])===null||E===void 0?void 0:E.prev,ee=R(g)?A(k,g,$,I,M):K(g,$,I,M),ne=ee.resizeLinePos,ae=ee.minResizeLineLeft,J=ee.maxResizeLineLeft;if(S.isDragging=!0,S.draggingStart=h.x,s!=null&&s.value){x.display="block",x.height="".concat(M.bottom-I.top,"px"),x.left="".concat(ne,"px");var B=a.value.parentElement.getBoundingClientRect();x.bottom="".concat(B.bottom-M.bottom,"px")}var X=function q(){var se;if(!!S.isDragging){var he=ne-parseFloat(x.left)||0,Le=r("calculate"),Ve=(se=v.value[g.colKey])===null||se===void 0?void 0:se.current;if(!!Ve){var qe=S.effect
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function yu(){}var Cu=yu,Fa=Bl,xu=Cu,Su=Ko,Ou=1/0,Ru=Fa&&1/Su(new Fa([,-0]))[1]==Ou?function(t){return new Fa(t)}:xu,Eu=Ru,Du=Po,_u=Bo,Tu=zo,Pu=Ao,Au=Eu,ju=Ko,Fu=200;function Iu(t,e,a){var n=-1,r=_u,o=t.length,l=!0,i=[],u=i;if(a)l=!1,r=Tu;else if(o>=Fu){var s=e?null:Au(t);if(s)return ju(s);l=!1,r=Pu,u=new Du}else u=e?[]:i;e:for(;++n<o;){var v=t[n],d=e?e(v):v;if(v=a||v!==0?v:0,l&&d===d){for(var b=u.length;b--;)if(u[b]===d)continue e;e&&u.push(d),i.push(v)}else r(u,d,a)||(u!==i&&u.push(d),i.push(v))}return i}var Ku=Iu,Lu=qi,ku=$l,Hr=Ku;function Nu(t,e,a){var n=t.length;if(n<2)return n?Hr(t[0]):[];for(var r=-1,o=Array(n);++r<n;)for(var l=t[r],i=-1;++i<n;)i!=r&&(o[r]=Lu(o[r]||l,t[i],e,a));return Hr(ku(o,1),e,a)}var Mu=Nu,Bu=Hl,zu=zl,Hu=Mu,Wu=Vl,$u=Wl,Vu=zu(function(t){var e=$u(t);return e=typeof e=="function"?e:void 0,Hu(Bu(t,Wu),void 0,e)}),Uu=Vu;function Wr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function hn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Wr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ur(t,e,a,n){var r=a==null?void 0:a.get(t.colKey||e);if(!r)return{};var o=z(z(z(z({},n.left,t.fixed==="left"),n.right,t.fixed==="right"),n.lastLeft,t.fixed==="left"&&r.lastLeftFixedCol),n.firstRight,t.fixed==="right"&&r.firstRightFixedCol),l={left:t.fixed==="left"?"".concat(r.left,"px"):void 0,right:t.fixed==="right"?"".concat(r.right,"px"):void 0};return{style:l,classes:o}}function Xu(t,e,a,n,r,o){if(!n||!n.length)return{style:void 0,classes:void 0};var l=e<n[0],i=e>a-1-n[1],u=a-n[1],s=(r==null?void 0:r.get(t))||{},v=z(z(z(z({},o.top,l),o.bottom,i),o.firstBottom,e===u),o.withoutBorderBottom,e===u-1),d={top:l?"".concat(s.top,"px"):void 0,bottom:i?"".concat(s.bottom,"px"):void 0};return{style:d,classes:v}}function Gu(t,e,a,n){var r=Ke(t),o=r.columns,l=r.tableLayout,i=r.tableContentWidth,u=r.fixedRows,s=r.firstFullRow,v=r.lastFullRow,d=r.maxHeight,b=r.headerAffixedTop,p=r.footerAffixedBottom,w=r.bordered,y=r.resizable,S=r.allowResizeColumnWidth,x=W([]),R=W(),O=W(),_=W(!1),j=W(!1),A=W(),T=W(6),F=W(new Map),P=Xn({left:!1,right:!1}),K=W({left:0,top:0}),D=W(0),m=W(0),h=W({}),g=W(!1),c=W(!1),f=W(!1),C=N(function(){var re,V;return(re=(V=S.value)!==null&&V!==void 0?V:y.value)!==null&&re!==void 0?re:!1}),E=N(function(){var re;return!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom||((re=t.scroll)===null||re===void 0?void 0:re.type)==="virtual")});function k(re){A.value=re}function I(re){for(var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Map,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,te=arguments.length>4?arguments[4]:void 0,le=0,ge=re.length;le<ge;le++){var pe,ue=re[le];["left","right"].includes(ue.fixed)&&(g.value=!0),ue.fixed==="right"&&(c.value=!0),ue.fixed==="left"&&(f.value=!0);var me=ue.colKey||le,Ee={col:ue,parent:te,index:le};V.set(me,Ee),(pe=ue.children)!==null&&pe!==void 0&&pe.length&&I(ue.children,V,G,Z+1,Ee),G[Z]?G[Z].push(Ee):G[Z]=[Ee]}return{newColumnsMap:V,levelNodes:G}}var M=function re(V,G){for(var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=0,le=V.length;te<le;te++){var ge,pe=V[te];if(pe.fixed==="right")return;for(var ue=G.get(pe.colKey||te),me=te-1;me>=0&&V[me].fixed!=="left";)me-=1;var Ee=V[me],Ae=te===0&&(Z==null?void 0:Z.left)||0,He=G.get((Ee==null?void 0:Ee.colKey)||te-1);ue&&(ue.left=((He==null?void 0:He.left)||Ae)+((He==null?void 0:He.width)||0)),(ge=pe.children)!==null&&ge!==void 0&&ge.length&&re(pe.children,G,ue)}},$=function re(V,G){for(var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},te=V.length-1;te>=0;te--){var le,ge=V[te];if(ge.fixed=
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function $r(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Yu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):$r(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function qu(t,e){var a=Ke(t),n=a.pagination,r=a.data,o=a.disableDataPage,l=ht(),i=l.classPrefix,u=W(t.pagination),s=W([]),v=W(!1),d=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:10,S=t.data,x=Boolean(!o.value&&S.length>y);if(v.value=x,x){var R=(w-1)*y,O=w*y;s.value=S.slice(R,O)}else s.value=S};de(function(){var p,w;return[(p=n.value)===null||p===void 0?void 0:p.current,(w=n.value)===null||w===void 0?void 0:w.pageSize,r.value.length,o]},function(){if(!(!n.value||!n.value.current)){var p=n.value,w=p.current,y=p.pageSize;u.value={current:w,pageSize:y},d(n.value.current,n.value.pageSize)}},{immediate:!0}),de([r],function(){var p,w;if(!(!n.value||!n.value.defaultCurrent)){var y=Boolean(n.value.current);y||d((p=u.value.current)!==null&&p!==void 0?p:n.value.defaultCurrent,(w=u.value.pageSize)!==null&&w!==void 0?w:n.value.defaultPageSize)}},{immediate:!0});var b=function(){if(!t.pagination)return null;var w=Yu({},t.pagination);return delete w.onChange,L("div",{class:"".concat(i.value,"-table__pagination")},[L(ci,Ie(w,{onChange:function(S){var x,R,O;(x=t.pagination)===null||x===void 0||(R=x.onChange)===null||R===void 0||R.call(x,S),u.value=S,d(S.current,S.pageSize),(O=t.onPageChange)===null||O===void 0||O.call(t,S,s.value)}}),{totalContent:e.slots.totalContent})])};return{isPaginateData:v,dataSource:s,innerPagination:u,renderPagination:b}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Ju(t){var e=W(),a=W(),n=W(),r=W(),o=W(),l=W(!0),i=W(!0),u=W(!0),s=!1,v=!1,d=N(function(){return t.scroll&&t.scroll.type==="virtual"&&(t.scroll.threshold||100)<t.data.length}),b=N(function(){return!!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom)}),p=0,w=function(B){if(!(!b.value&&!d.value)){var X=B;if(!X&&e.value&&(p=0,X=e.value),!!X){var Q=X.scrollLeft;if(p!==Q){p=Q;for(var q=[e.value,a.value,n.value,r.value],se=0,he=q.length;se<he;se++)q[se]&&B!==q[se]&&(q[se].scrollLeft=Q)}}}},y=function(B,X,Q){return X.top+Q<B.top&&B.top>B.height},S=function(B){return Ul(B)?0:B.offsetTop||0},x=function(){var B,X,Q;if(!(!b.value&&!d.value)){var q=(B=e.value)===null||B===void 0?void 0:B.getBoundingClientRect(),se=(X=e.value)===null||X===void 0||(X=X.querySelector("thead"))===null||X===void 0?void 0:X.getBoundingClientRect(),he=(se==null?void 0:se.height)||0,Le=(Q=n.value)===null||Q===void 0?void 0:Q.getBoundingClientRect();if((t.headerAffixedTop||d.value)&&a.value){var Ve=S(t.headerAffixProps||t.headerAffixedTop),qe=(Le==null?void 0:Le.height)||0,Ne=Math.abs(q.top)<q.height-he-Ve-qe;d.value&&(Ne=q.top>-1*se.height),l.value=Ne}if(t.footerAffixedBottom&&n!==null&&n!==void 0&&n.value)i.value=y(Le,q,he);else if(t.horizontalScrollAffixedBottom&&r!==null&&r!==void 0&&r.value){var lt=r.value.getBoundingClientRect();i.value=y(lt,q,he)}if(t.paginationAffixedBottom&&o.value){var gt=o.value.getBoundingClientRect();u.value=y(gt,q,he)}}},R=function(){x()},O=function(){w(n.value)},_=function(){w(a.value)},j=function(){w(r.value)},A=function(){w(e.value)},T=function(){Te(n.value,"scroll",O)},F=function(){xe(n.value,"scroll",O)},P=function(){Te(a.value,"scroll",_),C()},K=function(){s||xe(a.value,"scroll",_),E()},D=function(){Te(r.value,"scroll",j)},m=function(){xe(r.value,"scroll",j)},h=function(){Te(e.value,"scroll",A),C()},g=function(){s||xe(e.value,"scroll",A),E()},c=function(){s=!0},f=function(){s=!1,v||(xe(a.value,"scroll",_),xe(e.value,"scroll",A))},C=function(){v=!0},E=function(){v=!1},k=[],I=function(B){var X=or(function(he){xe(B,"scroll",he)},200);function Q(){w(B),X(Q)}function q(he){he.composedPath().includes(B)&&(k.forEach(function(Le){return Le()}),k.length=0,Te(B,"scroll",Q),X(Q),k.push(function(){xe(B,"scroll",Q)}))}Te(B,"touchstart",q);function se(){xe(B,"touchstart",q)}return{removeElementTouchScrollListener:se}},M=[],$=function(){M.forEach(function(B){return B()}),M.length=0},Y=function(){xe(window,"mousedown",c),xe(window,"mouseup",f),$(),a.value&&(xe(a.value,"mouseenter",P),xe(a.value,"mouseleave",K)),n.value&&(xe(n.value,"mouseenter",T),xe(n.value,"mouseleave",F)),e.value&&(xe(e.value,"mouseenter",h),xe(e.value,"mouseleave",g)),r.value&&(xe(r.value,"mouseenter",D),xe(r.value,"mouseleave",m))},ee=function(){if(Te(window,"mousedown",c),Te(window,"mouseup",f),Y(),a.value){Te(a.value,"mouseenter",P),Te(a.value,"mouseleave",K);var B=I(a.value),X=B.removeElementTouchScrollListener;M.push(X)}if(t.footerAffixedBottom&&n.value){Te(n.value,"mouseenter",T),Te(n.value,"mouseleave",F);var Q=I(n.value),q=Q.removeElementTouchScrollListener;M.push(q)}if(t.horizontalScrollAffixedBottom&&r.value){Te(r.value,"mouseenter",D),Te(r.value,"mouseleave",m);var se=I(r.value),he=se.removeElementTouchScrollListener;M.push(he)}if((b.value||d.value)&&e.value){Te(e.value,"mouseenter",h),Te(e.value,"mouseleave",g);var Le=I(e.value),Ve=Le.removeElementTouchScrollListener;M.push(Ve)}},ne=function(){if(!(!b.value&&!t.paginationAffixedBottom))var B=setTimeout(function(){b.value||t.paginationAffixedBottom?Te(document,"scroll",R):xe(document,"scroll",R),clearTimeout(B)})};de([a,n,r,e],function(){ee(),w(),x()}),de(b,ne),de(function(){return[t.data,t.columns,t.headerAffixedTop,t.footerAffixedBottom,t.horizontalScrollAffixedBottom]},function(){w()}),Ra(function(){xe(document,"scroll",R),Y(),a.value=null,n.value=null,r.value=null,e.value=null});var ae=function(B){e.value=B,ne()};return{showAffixHeader:l,showAffixFooter:i,showAffixPagination:u,affixHeaderRef:a,affixFooterRef:n,horizontalScrollbarRef:r,paginationRef:o,onHorizontalSc
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function sr(t,e){if(!!t){for(var a=t instanceof Array?t:[t],n={},r=0;r<a.length;r++){var o=a[r];if(!!o){var l=Re(o)?o(e):o;n=l instanceof Array?sr(l,e):Object.assign(n,l)}}return n}}function cr(t,e,a){for(var n=t instanceof Array?t:[t],r=e.row,o=e.rowIndex,l=[],i=0,u=n.length;i<u;i++){var s=n[i],v=Re(s)?s(e):s;if(Ua(v)&&!(v instanceof Array)){v[o]&&(v=v[o]);var d=H(r,a||"id");v[d]&&(v=v[d])}else v instanceof Array&&(v=cr(v,e,a));l=l.concat(v)}return l}function ll(t,e){for(var a=t instanceof Array?t:[t],n=[],r=0,o=a.length;r<o;r++){var l=a[r];Re(l)?n.push(l(e)):n.push(l)}return n}function il(t,e){if(!(!t||!e)){var a=t==null?void 0:t.find(function(i){return i.colKey===e});if(a)return a;for(var n=0,r=t.length;n<r;n++){var o;if((o=t[n])!==null&&o!==void 0&&(o=o.children)!==null&&o!==void 0&&o.length){var l;return il((l=t[n])===null||l===void 0?void 0:l.children,e)}}}}function Qn(t,e){return dt(t)==="object"?t:dt(e)==="object"?e:{}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Zu(t,e,a){var n=N(function(){return Math.max(a.rowHeight||48,48)}),r=W(!1),o=N(function(){return(a==null?void 0:a.type)==="lazy"&&!r.value}),l=!Xl&&window.requestAnimationFrame||function(u){return setTimeout(u,16.6)},i=function(){r.value||l(function(){r.value=!0})};return yt(function(){(a==null?void 0:a.type)==="lazy"&&Gt(function(){var u=Math.max(10,a.bufferSize||10),s=n.value*u;!(e!=null&&e.value)||!(t!=null&&t.value)||$o(e.value,t.value,i,s)})}),{hasLazyLoadHolder:o,tRowHeight:n}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Vn(t,e,a,n){var r=H(t,e);return r===void 0&&Be.error("Table","rowKey is wrong, can not get unique identifier of row."),[r,a||n].join("_")}function ul(t,e,a,n){var r=W(new Map),o=function(u,s){var v=u.rowIndex,d=u.colIndex;if(!(!s.rowspan&&!s.colspan)){for(var b=v+(s.rowspan||1),p=d+(s.colspan||1),w=v;w<b;w++)for(var y=d;y<p;y++)if(w!==v||y!==d){if(!t.value[w]||!e.value[y])return;var S=Vn(t.value[w],a.value,e.value[y].colKey,y),x=r.value.get(S)||{};x.skipped=!0,r.value.set(S,x)}}},l=function(u,s,v){var d;if((d=r.value)===null||d===void 0||d.clear(),!(!u||!v))for(var b=0,p=u.length;b<p;b++)for(var w=u[b],y=0,S=s.length;y<S;y++){var x=s[y],R={row:w,col:x,rowIndex:b,colIndex:y},O=Vn(w,a.value,x.colKey,y),_=r.value.get(O)||{},j=v(R)||{};(j.rowspan||j.colspan||_.rowspan||_.colspan)&&(j.rowspan&&(_.rowspan=j.rowspan),j.colspan&&(_.colspan=j.colspan),r.value.set(O,_)),o==null||o(R,_)}};return de(function(){return[t.value,e.value,n]},function(){l(t.value,e.value,n==null?void 0:n.value)},{immediate:!0}),{skipSpansMap:r}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Vr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function rt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Vr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Qu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var sl=["rowKey","rowClassName","columns","fixedRows","footData","rowAttributes","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup"],cl=["click","dblclick","mouseover","mousedown","mouseenter","mouseleave","mouseup"];function ma(t,e,a){var n=t.col,r=t.row,o=t.rowIndex;if(n.colKey==="serial-number"){var l=(a==null?void 0:a.pagination)||{},i=l.current,u=l.pageSize,s=l.defaultCurrent,v=l.defaultPageSize,d=i||s,b=u||v;return b&&d?b*(d-1)+o+1:o+1}if(Re(n.cell))return n.cell(Ye,t);if(e[n.colKey])return e[n.colKey](t);if(Lt(n.cell)&&e[n.cell])return e[n.cell](t);if(Re(n.render))return n.render(Ye,rt(rt({},t),{},{type:"cell"}));var p=H(r,n.colKey);return[void 0,"",null].includes(p)?a!=null&&a.cellEmptyContent?Re(a.cellEmptyContent)?a.cellEmptyContent(Ye,t):a.cellEmptyContent:e.cellEmptyContent?e.cellEmptyContent(t):e["cell-empty-content"]?e["cell-empty-content"](t):p:p}var es=ze({name:"TR",props:rt(rt({row:Object,rowIndex:Number,dataLength:Number,ellipsisOverlayClassName:String,classPrefix:String,rowAndColFixedPosition:Map,skipSpansMap:Map,virtualConfig:Object,active:Boolean,isHover:Boolean},Cn(On,sl)),{},{tableElm:{},tableContentElm:{}}),emits:["row-mounted"],setup:function(e,a){var n=Ke(e),r=n.tableContentElm,o=n.active,l=n.isHover,i=W(null),u=ot(),s=u.tdEllipsisClass,v=u.tableBaseClass,d=u.tableColFixedClasses,b=u.tableRowFixedClasses,p=u.tdAlignClasses,w=u.tableDraggableClasses,y=N(function(){return Xu(H(e.row,e.rowKey||"id"),e.rowIndex,e.dataLength,e.fixedRows,e.rowAndColFixedPosition,b)}),S=N(function(){return sr(e.rowAttributes,{row:e.row,rowIndex:e.rowIndex,type:"body"})||{}}),x=N(function(){var P,K=cr(e.rowClassName,{row:e.row,rowIndex:e.rowIndex,type:"body"},e.rowKey||"id");return[(P=y.value)===null||P===void 0?void 0:P.classes,K,z(z({},"".concat(e.classPrefix,"-table__row--active"),o.value),"".concat(e.classPrefix,"-table__row--hover"),l.value)].filter(function(D){return D})}),R=Zu(r,i,Xn(rt(rt({},e.scroll),{},{rowIndex:e.rowIndex}))),O=R.hasLazyLoadHolder,_=R.tRowHeight,j=function(K,D){var m={};return cl.forEach(function(h){m["on".concat(pr(h))]=function(g){var c,f={e:g,row:K,index:D};(c=e["onRow".concat(pr(h))])===null||c===void 0||c.call(e,f)}}),m},A=function(){var K;(K=e.virtualConfig)!==null&&K!==void 0&&K.isVirtualScroll.value&&a.emit("row-mounted",{ref:i,data:e.row})};yt(function(){Gt(function(){A()})}),ii(function(){Gt(function(){A()})});function T(P,K){var D=K.cellNode,m=P.col,h=P.colIndex,g;Re(m.ellipsis)?g=m.ellipsis(Ye,P):dt(m.ellipsis)==="object"&&Re(m.ellipsis.content)?g=m.ellipsis.content(Ye,P):a.slots["ellipsis-".concat(m.colKey)]?g=a.slots["ellipsis-".concat(m.colKey)](P):a.slots.ellipsis&&(g=a.slots.ellipsis(P));var c={};dt(m.ellipsis)==="object"&&(c="props"in m.ellipsis?m.ellipsis.props:m.ellipsis||void 0);var f=e.tableElm,C=h===0?"top-left":"top";return C=h===e.columns.length-1?"top-right":C,L(ir,{placement:C,attach:f?function(){return f}:void 0,tooltipContent:g&&function(){return g},tooltipProps:c,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},Qu(D)?D:{default:function(){return[D]}})}function F(P,K){var D=P.col,m=P.colIndex,h=P.rowIndex,g=K.cellSpans,c=K.dataLength,f=K.rowAndColFixedPosition,C=ma(P,a.slots,{cellEmptyContent:K.cellEmptyContent,pagination:e.pagi
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Ur(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ea(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ur(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var dl=["bordered","rowKey","rowClassName","rowAttributes","loading","empty","fixedRows","firstFullRow","lastFullRow","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onPageChange","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup","onScroll","onScrollX","onScrollY"],ts=ze({name:"TBody",props:ea({classPrefix:String,data:Array,columns:Array,ellipsisOverlayClassName:String,rowAndColFixedPosition:Map,showColumnShadow:Object,tableElm:{},tableWidth:Number,isWidthOverflow:Boolean,virtualConfig:Object,tableContentElm:{},handleRowMounted:Function,renderExpandedRow:Function,firstFullRow:[String,Function],lastFullRow:[String,Function],activeRow:[Array],hoverRow:[String,Number]},Cn(On,dl)),setup:function(e){var a=Yt(),n=Ke(e),r=n.data,o=n.columns,l=n.rowKey,i=n.rowspanAndColspan,u=ht("table",e.locale),s=u.t,v=u.globalConfig,d=ot(),b=d.tableFullRowClasses,p=d.tableBaseClass,w=ul(r,o,l,i),y=w.skipSpansMap,S=N(function(){return[p.body]});return{t:s,globalConfig:v,renderTNode:a,tableFullRowClasses:b,tbodyClasses:S,tableBaseClass:p,skipSpansMap:y}},render:function(){var e=this,a,n,r,o,l=function(x){var R=e.bordered?e.tableWidth-2:e.tableWidth;return L("tr",{class:[e.tableBaseClass.emptyRow,z({},e.tableFullRowClasses.base,e.isWidthOverflow)]},[L("td",{colspan:x.length},[L("div",{class:[e.tableBaseClass.empty,z({},e.tableFullRowClasses.innerFullRow,e.isWidthOverflow)],style:e.isWidthOverflow?{width:"".concat(R,"px")}:{}},[e.renderTNode("empty")||e.t(e.globalConfig.empty)])])])},i=function(x,R){var O=Gl(R),_=e.renderTNode(O);if(["",null,void 0,!1].includes(_))return null;var j=e.isWidthOverflow&&e.columns.find(function(F){return F.fixed==="left"}),A=[e.tableFullRowClasses.base,e.tableFullRowClasses[O]],T=e.bordered?e.tableWidth-2:e.tableWidth;return L("tr",{class:A,key:"key-full-row-".concat(R)},[L("td",{colspan:x},[L("div",{class:z({},e.tableFullRowClasses.innerFullRow,j),style:j?{width:"".concat(T,"px")}:{}},[L("div",{class:e.tableFullRowClasses.innerFullElement},[_])])])])},u=this.columns.length,s=this.data.length,v=[],d=["classPrefix","ellipsisOverlayClassName","rowAndColFixedPosition","scroll","tableElm","tableContentElm","pagination","attach"];(a=this.data)===null||a===void 0||a.forEach(function(S,x){var R,O=e.rowKey||"id",_=H(S,O),j=ea(ea({},Cn(e.$props,sl)),{},{rowKey:O,row:S,columns:e.columns,rowIndex:S.VIRTUAL_SCROLL_INDEX||x,dataLength:s,skipSpansMap:e.skipSpansMap,virtualConfig:e.virtualConfig,active:(R=e.activeRow)===null||R===void 0?void 0:R.includes(_),isHover:e.hoverRow===_},Cn(e.$props,d));e.onCellClick&&(j.onCellClick=e.onCellClick);var A=L(es,Ie({key:H(S,e.rowKey||"id")||x},j,{onRowMounted:e.handleRowMounted}),e.$slots);if(v.push(A),e.renderExpandedRow){var T={row:S,index:x,columns:e.columns,tableWidth:e.tableWidth,isWidthOverflow:e.isWidthOverflow},F=e.renderExpandedRow(T);F&&v.push(F)}});var b=[i(u,"first-full-row")].concat(v,[i(u,"last-full-row")]),p=!((n=this.data)!==null&&n!==void 0&&n.length)&&!this.loading&&!this.firstFullRow&&!this.lastFullRow,w="translateY(".concat((r=this.virtualConfig)===null||r===void 0?void 0:r.translateY.value,"px)"),y=(o=this.virtualConfig)!==null&&o!==void 0&&o.isVirtualScroll.value?{transform:w,"-ms-transform":w,"-moz-transform":w,"-webkit-transform":w}:void 0;return L("tbody",{class:this.tbodyClasses,style:ea({},y)},[p?l(this.columns):b])}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Nn(t){return t&&(isNaN(Number(t))?t:"".concat(t,"px"))}function vl(t){var e=Ke(t),a=e.size,n=e.bordered,r=e.stripe,o=e.hover,l=e.verticalAlign,i=e.height,u=e.maxHeight,s=e.tableContentWidth,v=ot(),d=v.tableBaseClass,b=v.tableAlignClasses,p=di(),w=p.sizeClassNames,y=ht("table",t.locale),S=y.globalConfig,x=N(function(){var j;return(j=a.value)!==null&&j!==void 0?j:S.value.size}),R=N(function(){return[d.table,z(z(z(z(z(z(z(z({},w[x.value],x.value!=="medium"),d.bordered,n.value),d.striped,r.value),d.hover,o.value),d.loading,t.loading),d.affixedHeader,t.headerAffixedTop),d.rowspanAndColspan,t.rowspanAndColspan),b[l.value],l.value!=="middle")]}),O=N(function(){return{height:Nn(i.value),maxHeight:Nn(u.value)}}),_=N(function(){return{width:Nn(s.value)}});return{tableClasses:R,sizeClassNames:w,tableElementStyles:_,tableContentStyles:O}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Xr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function $t(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Xr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ns(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var Gr=ze({name:"THead",props:{classPrefix:String,ellipsisOverlayClassName:String,isFixedHeader:Boolean,thDraggable:Boolean,maxHeight:[String,Number],height:[String,Number],rowAndColFixedPosition:Map,thWidthList:Object,bordered:Boolean,isMultipleHeader:Boolean,resizable:Boolean,attach:[String,Function],spansAndLeafNodes:Object,thList:Array,columnResizeParams:Object,showColumnShadow:Object},setup:function(e,a){var n=a.slots,r=W(),o=ot(),l=o.tableHeaderClasses,i=o.tableBaseClass,u=N(function(){return[l.header,z(z(z({},l.fixed,Boolean(e.maxHeight||e.height)),i.bordered,e.bordered&&e.isMultipleHeader),l.multipleHeader,e.isMultipleHeader)]}),s=N(function(){for(var d={},b=e.thList[0],p=0,w=b.length;p<w;p++){var y=b[p];if(y.colspan>1)for(var S=p+1;S<p+y.colspan;S++)b[S]&&(d[b[S].colKey]=!0)}return d}),v=function(b){for(var p=b;p;){var w;if(p=p.parentNode,(w=p)!==null&&w!==void 0&&(w=w.classList)!==null&&w!==void 0&&w.contains("".concat(e.classPrefix,"-table")))break}return p};return $t($t({},o),{},{colspanSkipMap:s,theadClasses:u,theadRef:r,slots:n,getTableNode:v})},render:function(){var e=this,a=function(r,o){var l=new Map,i=e.spansAndLeafNodes.rowspanAndColspanMap;return e.thList.map(function(u,s){var v=u.map(function(d,b){var p;if(e.colspanSkipMap[d.colKey])return null;var w=i.get(d);if(b===0&&w.rowspan>1)for(var y=s+1;y<s+w.rowspan;y++)l.set(e.thList[y][0],!0);var S=ur(d,b,r,e.tableColFixedClasses),x={col:d,colIndex:b,row:{},rowIndex:-1},R=ll(d.className,$t($t({},x),{},{type:"th"})),O=e.showColumnShadow.left&&d.fixed==="left",_=e.showColumnShadow.right&&d.fixed==="right",j=e.thDraggable&&!(O||_),A=[S.classes,R,d.thClassName,z(z(z(z({},e.tableHeaderClasses.thBordered,l.get(d)),"".concat(e.classPrefix,"-table__th-").concat(d.colKey),d.colKey),e.tdAlignClasses[d.align],d.align&&d.align!=="left"),e.tableDraggableClasses.dragSortTh,j)],T=!((p=d.children)!==null&&p!==void 0&&p.length),F=T&&o!==null&&o!==void 0&&o[d.colKey]?"".concat(o==null?void 0:o[d.colKey],"px"):void 0,P=$t($t({},S.style||{}),{},{width:F}),K=Ea(e.slots,d,b),D=e.resizable||!j?{onMousedown:function(f){if(e.resizable){var C,E;(C=e.columnResizeParams)===null||C===void 0||(E=C.onColumnMousedown)===null||E===void 0||E.call(C,f,d,b)}if(!j)var k=setTimeout(function(){var I,M=e.theadRef.querySelectorAll("th");(I=M[b])===null||I===void 0||I.removeAttribute("draggable"),clearTimeout(k)},10)},onMousemove:function(f){var C,E;e.resizable&&((C=e.columnResizeParams)===null||C===void 0||(E=C.onColumnMouseover)===null||E===void 0||E.call(C,f,d))}}:{},m=Re(d.ellipsisTitle)?d.ellipsisTitle(Ye,{col:d,colIndex:b}):void 0,h=d.ellipsisTitle!==void 0?Boolean(d.ellipsisTitle):Boolean(d.ellipsis),g=(Re(d.attrs)?d.attrs($t($t({},x),{},{type:"th"})):d.attrs)||{};return d.colspan>1&&(g.colspan=d.colspan),L("th",Ie({key:d.colKey,"data-colkey":d.colKey,class:A,style:P},g,w,D),[L("div",{class:e.tableBaseClass.thCellInner},[h?L(ir,{placement:"bottom",attach:e.attach||(e.theadRef?function(){return e.getTableNode(e.theadRef)}:void 0),tooltipContent:m&&function(){return m},tooltipProps:dt(d.ellipsisTitle)==="object"?d.ellipsisTitle:void 0,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},ns(K)?K:{default:function(){return[K]}}):K])])});return L("tr",{key:s},[v])})};return L("thead",{ref:"theadRef",class:this.theadClasses},[a(this.rowAndColFixedPosition,this.thWidthList)])}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Yr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ta(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Yr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var qr=ze({name:"TFoot",props:{rowKey:String,isFixedHeader:Boolean,rowAndColFixedPosition:Map,footData:Array,columns:Array,rowAttributes:[Array,Object,Function],rowClassName:[Array,String,Object,Function],thWidthList:[Object],footerSummary:[String,Function],rowspanAndColspanInFooter:Function,virtualScroll:Boolean},setup:function(e,a){var n=Yt(),r=ot(),o=Ke(e),l=o.footData,i=o.columns,u=o.rowKey,s=o.rowspanAndColspanInFooter,v=ul(l,i,u,s),d=v.skipSpansMap,b=function(w){var y=w.col,S=w.row;return Re(y.foot)?y.foot(Ye,w):Lt(y.foot)&&a.slots[y.foot]?a.slots[y.foot](w)||y.foot:y.foot||H(S,y.colKey)};return ta(ta({skipSpansMap:d},r),{},{renderTFootCell:b,renderTNode:n})},render:function(){var e,a=this;if(!this.columns)return null;var n=[this.tableFooterClasses.footer,z({},this.tableFooterClasses.fixed,this.isFixedHeader)],r=(e=this.footData)===null||e===void 0?void 0:e.map(function(l,i){var u=sr(a.rowAttributes,{row:l,rowIndex:i,type:"foot"}),s=cr(a.rowClassName,{row:l,rowIndex:i,type:"foot"},a.rowKey||"id");return L("tr",Ie(u,{key:i,class:s}),[a.columns.map(function(v,d){var b,p={},w=null;if(a.skipSpansMap.size){var y,S,x=Vn(l,a.rowKey,v.colKey,d);if(w=a.skipSpansMap.get(x)||{},((y=w)===null||y===void 0?void 0:y.rowspan)>1&&(p.rowspan=w.rowspan),((S=w)===null||S===void 0?void 0:S.colspan)>1&&(p.colspan=w.colspan),w.skipped)return null}var R=ur(v,d,a.rowAndColFixedPosition,a.tableColFixedClasses),O=ta({},R.style);return(b=a.thWidthList)!==null&&b!==void 0&&b[v.colKey]&&(O.width="".concat(a.thWidthList[v.colKey],"px")),L("td",Ie(ta({key:v.colKey},p),{class:R.classes,style:O}),[a.renderTFootCell({row:l,rowIndex:i,col:v,colIndex:d})])})])}),o=this.renderTNode("footerSummary");return!o&&(!this.footData||!this.footData.length)?null:L("tfoot",{ref:"tFooterRef",class:n,style:{visibility:this.virtualScroll?"hidden":"visible"}},[o&&L("tr",{class:this.tableFullRowClasses.base},[L("td",{colspan:this.columns.length},[L("div",{class:this.tableFullRowClasses.innerFullElement},[o])])]),r])}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function as(t,e){var a=Ke(t),n=a.data,r=a.activeRowType,o=a.activeRowKeys,l=a.defaultActiveRowKeys,i=a.disableSpaceInactiveRow,u=W(-1),s=W(!1),v=W(!1),d=W(-1),b=kt(o,l.value,t.onActiveChange,"activeRowKeys"),p=Pe(b,2),w=p[0],y=p[1],S=function(h){var g=h.row,c=h.index,f=H(g,t.rowKey);if(r.value==="single"){var C=w.value.length>1?[f]:[];y(C,{type:"inactive",activeRowList:[{row:g,rowIndex:c}],currentRowData:g})}else if(r.value==="multiple"){for(var E=w.value.filter(function(Y){return Y!==f}),k=[],I=0,M=n.value.length;I<M;I++){var $=n.value[I];E.includes(H($,t.rowKey))&&k.push({row:$,rowIndex:I})}y(E,{type:"inactive",activeRowList:k,currentRowData:g})}},x=function(h){var g=h.row,c=H(g,t.rowKey);if(r.value==="single")y([c],{activeRowList:[{row:g,rowIndex:h.index}],currentRowData:g,type:"active"});else{for(var f=w.value.concat(c),C=[],E=0,k=n.value.length;E<k;E++){var I=n.value[E];f.includes(H(I,t.rowKey))&&C.push({row:I,rowIndex:E})}y(f,{activeRowList:C,currentRowData:g,type:"active"})}},R=function(h){document.getSelection().removeAllRanges();for(var g=h.row,c=u.value,f=Math.min(d.value,c),C=Math.max(d.value,c),E=[],k=f;k<=C;k++)E.push({row:n.value[k],rowIndex:k});var I=E.map(function(M){return H(M.row,t.rowKey)});y(I,{activeRowList:E,type:"active",currentRowData:g})},O=function(){for(var h=[],g=0,c=n.value.length;g<c;g++){var f=n.value[g],C=H(f,t.rowKey);w.value.includes(C)&&h.push({row:f,rowIndex:g})}return h},_=function(h,g){if(!!r.value){var c=h.row,f=h.index,C=H(c,t.rowKey);s.value?(u.value=f,R(h),v.value=!0):w.value.includes(C)&&(g==null?void 0:g.action)!=="active"?i.value||(S(h),u.value=f):(x(h),u.value=f)}},j=function(){var h;y([],{activeRowList:[],currentRowData:void 0,type:"inactive"}),(h=t.onActiveRowAction)===null||h===void 0||h.call(t,{action:"clear",activeRowList:[]}),u.value=-1},A=function(){var h,g=n.value.map(function(f){return H(f,t.rowKey)}),c=n.value.map(function(f,C){return{row:f,rowIndex:C}});y(g,{activeRowList:c,currentRowData:void 0,type:"active"}),(h=t.onActiveRowAction)===null||h===void 0||h.call(t,{action:"select-all",activeRowList:c}),u.value=-1},T=function(){v.value=!1},F=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());if(Vo.test(c)){h.preventDefault();var f=Math.min(n.value.length-1,u.value+1);r.value==="single"?_({row:n.value[f],index:f,e:h},{action:"active"}):u.value=f}else if(Uo.test(c)){h.preventDefault();var C=Math.max(0,u.value-1);r.value==="single"?_({row:n.value[C],index:C,e:h},{action:"active"}):u.value=C}else if(Xa.test(c)){h.preventDefault();var E=u.value;if(v.value){var k;(k=t.onActiveRowAction)===null||k===void 0||k.call(t,{action:"shift-area-selection",activeRowList:O()})}else if(!i.value)_({row:n.value[E],index:E,e:h});else{var I;(I=t.onActiveRowAction)===null||I===void 0||I.call(t,{action:"space-one-selection",activeRowList:O()})}}else wr.test(c)?(s.value=!0,d.value=u.value):Xo.test(c)||Go.test(c)?(j(),T()):Yo.test(c)&&A();Xa.test(c)||T()},P=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());wr.test(c)&&(s.value=!1)},K=function(){Te(e.value,"keydown",F),Te(e.value,"keyup",P)},D=function(){xe(e.value,"keydown",F),xe(e.value,"keyup",P)};return{tActiveRow:w,onHighlightRow:_,addHighlightKeyboardListener:K,removeHighlightKeyboardListener:D}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function rs(t,e){var a=Ke(t),n=a.hover,r=a.data,o=a.activeRowType,l=a.keyboardRowHover,i=a.disableSpaceInactiveRow,u=W(),s=W(-1),v=N(function(){return o.value==="single"?!1:o.value==="multiple"?!0:n.value||l.value}),d=function(x,R){var O=H(x.row,t.rowKey);u.value===O&&(R==null?void 0:R.action)!=="hover"?i.value||(u.value=void 0):u.value=O,s.value=x.index},b=function(){u.value=void 0,s.value=-1},p=function(x){var R;if(!!v.value){var O=x.code||((R=x.key)===null||R===void 0?void 0:R.trim());if(Vo.test(O)){x.preventDefault();var _=Math.min(r.value.length-1,s.value+1);d({row:r.value[_],index:_,e:x},{action:"hover"})}else if(Uo.test(O)){x.preventDefault();var j=Math.max(0,s.value-1);d({row:r.value[j],index:j,e:x},{action:"hover"})}else if(Xa.test(O)&&t.activeRowType!=="multiple"){var A=s.value;if(d({row:r.value[A],index:A,e:x}),!t.activeRowType){var T;(T=t.onActiveRowAction)===null||T===void 0||T.call(t,{action:"space-one-selection",activeRowList:[{row:r.value[A],rowIndex:A}]})}}else if(Xo.test(O)&&!t.activeRowType){var F;u.value=void 0,(F=t.onActiveRowAction)===null||F===void 0||F.call(t,{action:"clear",activeRowList:[]})}else if(Yo.test(O)&&!t.activeRowType){var P;(P=t.onActiveRowAction)===null||P===void 0||P.call(t,{action:"select-all",activeRowList:[]})}else if(Go.test(O)&&!t.activeRowType){var K;(K=t.onActiveRowAction)===null||K===void 0||K.call(t,{action:"clear",activeRowList:[]})}}},w=function(){Te(e.value,"keydown",p)},y=function(){xe(e.value,"keydown",p)};return{hoverRow:u,needKeyboardRowHover:v,clearHoverRow:b,addRowHoverKeyboardListener:w,removeRowHoverKeyboardListener:y}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function os(t,e){var a=W(),n=W(!0),r=function(){if(!(!e.value||!t.value||a.value)){n.value=!1;var l=$o(t.value,null,function(){n.value=!0},10);a.value=l}};return yt(r),e.value&&de([e,t],r),Ra(function(){var o,l;!e.value||(o=a.value)===null||o===void 0||(l=o.unobserve)===null||l===void 0||l.call(o,t.value)}),{showElement:n}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Jr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function nt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Jr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Zr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var ls=["page-change","cell-click","scroll","scrollX","scrollY"];cl.map(function(t){return"row-".concat(t)}).concat(ls);var fl=ze({name:"TBaseTable",props:nt(nt({},On),{},{renderExpandedRow:Function,onLeafColumnsChange:Function,thDraggable:Boolean}),emits:["show-element-change"],setup:function(e,a){var n=Ke(e),r=n.lazyLoad,o=Yt(),l=W(),i=W(),u=W(),s=W(),v=W(0),d=ot(),b=d.classPrefix,p=d.virtualScrollClasses,w=d.tableLayoutClasses,y=d.tableBaseClass,S=d.tableColFixedClasses,x=vl(e),R=x.tableClasses,O=x.sizeClassNames,_=x.tableContentStyles,j=x.tableElementStyles,A=ht("table",e.locale),T=A.globalConfig,F=ol(e),P=F.isMultipleHeader,K=F.spansAndLeafNodes,D=F.thList,m=N(function(){var ye;return((ye=K.value)===null||ye===void 0?void 0:ye.leafColumns)||e.columns}),h=N(function(){var ye;return(ye=e.size)!==null&&ye!==void 0?ye:T.value.size}),g=os(l,r),c=g.showElement,f=W(),C=W(),E=W(),k=W(),I=Gu(e,a,m,{paginationAffixRef:f,horizontalScrollAffixRef:C,headerTopAffixRef:E,footerBottomAffixRef:k}),M=I.scrollbarWidth,$=I.virtualScrollHeaderPos,Y=I.tableWidth,ee=I.tableElmWidth,ne=I.tableContentRef,ae=I.isFixedHeader,J=I.isWidthOverflow,B=I.isFixedColumn,X=I.thWidthList,Q=I.showColumnShadow,q=I.rowAndColFixedPosition,se=I.setData,he=I.refreshTable,Le=I.setTableElmWidth,Ve=I.emitScrollEvent,qe=I.setUseFixedTableElmRef,Ne=I.updateColumnFixedShadow,lt=I.getThWidthList,gt=I.updateThWidthList,it=I.addTableResizeObserver,Pt=I.updateTableAfterColumnResize,je=Ju(e),Dn=je.affixHeaderRef,_n=je.affixFooterRef,Tn=je.horizontalScrollbarRef,re=je.paginationRef,V=je.showAffixHeader,G=je.showAffixFooter,Z=je.showAffixPagination,te=je.onHorizontalScroll,le=je.setTableContentRef,ge=je.updateAffixHeaderOrFooter,pe=qu(e,a),ue=pe.dataSource,me=pe.innerPagination,Ee=pe.isPaginateData,Ae=pe.renderPagination,He=wu({isWidthOverflow:J,tableContentRef:ne,showColumnShadow:Q,getThWidthList:lt,updateThWidthList:gt,setTableElmWidth:Le,updateTableAfterColumnResize:Pt,onColumnResizeChange:e.onColumnResizeChange}),At=He.resizeLineRef,Bt=He.resizeLineStyle,tt=He.setEffectColMap,zt=N(function(){return[R.value,z(z(z(z(z(z(z(z({},y.headerFixed,ae.value),y.columnFixed,B.value),y.widthOverflow,J.value),y.multipleHeader,P.value),S.leftShadow,Q.left),S.rightShadow,Q.right),y.columnResizableTable,e.resizable),"".concat(b,"-table__row--active-").concat(e.activeRowType),e.activeRowType)]}),Ct=N(function(){return[[w[e.tableLayout]]]}),vn=N(function(){return e.bordered&&ae.value&&(P.value&&J.value||!P.value)}),xt=N(function(){var ye,De;if(!e.bordered)return 0;var Se=(ye=s.value)===null||ye===void 0?void 0:ye.getBoundingClientRect(),We=(De=re.value)===null||De===void 0?void 0:De.getBoundingClientRect();return((Se==null?void 0:Se.height)||0)+((We==null?void 0:We.height)||0)}),St=as(e,l),be=St.tActiveRow,ve=St.onHighlightRow,Fe=St.addHighlightKeyboardListener,Je=St.removeHighlightKeyboardListener,Ge=rs(e,l),pt=Ge.hoverRow,Jt=Ge.needKeyboardRowHover,qn=Ge.clearHoverRow,Zt=Ge.addRowHoverKeyboardListener,Qt=Ge.removeRowHoverKeyboardListener;de(i,function(){qe(i.value)}),de(function(){return[e.data,ue]},function(){se(Ee.value?ue.value:e.data)}),de(K,function(){var ye;(ye=e.onLeafColumnsChange)===null||ye===void 0||ye.call(e,K.value.leafColumns),tt(K.value.leafColumns,null)},{immediate:!0});var en=function(){Gt(function(){te(),ge()})},tn=N(function(){return{data:e.data,scroll:e.scroll}}),bt=vi(ne,tn),we=-1,fn=function(
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var hl={asyncLoading:{type:[String,Function]},columnController:{type:Object},columnControllerVisible:{type:Boolean,default:void 0},defaultColumnControllerVisible:{type:Boolean,default:void 0},columns:{type:Array,default:function(){return[]}},displayColumns:{type:Array,default:void 0},defaultDisplayColumns:{type:Array},dragSort:{type:String,validator:function(e){return e?["row","row-handler","col","row-handler-col","drag-col"].includes(e):!0}},dragSortOptions:{type:Object},editableCellState:{type:Function},editableRowKeys:{type:Array},expandIcon:{type:[Boolean,Function],default:!0},expandOnRowClick:Boolean,expandedRow:{type:[String,Function]},expandedRowKeys:{type:Array,default:void 0},defaultExpandedRowKeys:{type:Array,default:function(){return[]}},filterIcon:{type:Function},filterRow:{type:[String,Function]},filterValue:{type:Object,default:void 0},defaultFilterValue:{type:Object},hideSortTips:Boolean,indeterminateSelectedRowKeys:{type:Array},multipleSort:Boolean,reserveSelectedRowOnPaginate:{type:Boolean,default:!0},rowSelectionAllowUncheck:Boolean,rowSelectionType:{type:String,validator:function(e){return e?["single","multiple"].includes(e):!0}},selectOnRowClick:Boolean,selectedRowKeys:{type:Array,default:void 0},defaultSelectedRowKeys:{type:Array,default:function(){return[]}},showSortColumnBgColor:Boolean,sort:{type:[Object,Array],default:void 0},defaultSort:{type:[Object,Array]},sortIcon:{type:Function},sortOnRowDraggable:Boolean,onAsyncLoadingClick:Function,onCellClick:Function,onChange:Function,onColumnChange:Function,onColumnControllerVisibleChange:Function,onDataChange:Function,onDisplayColumnsChange:Function,onDragSort:Function,onExpandChange:Function,onFilterChange:Function,onRowEdit:Function,onRowValidate:Function,onSelectChange:Function,onSortChange:Function,onValidate:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Qr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function eo(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Qr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var is=ze({name:"ColumnCheckboxGroup",props:{checkboxProps:Object,options:{type:Array,default:function(){return[]}},label:String,uniqueKey:String,value:Array,onChange:Function},setup:function(e){var a=Ke(e),n=a.checkboxProps,r=a.value,o=a.options,l=Kt(),i=N(function(){var w=[];return o.value.forEach(function(y){if(dt(y)==="object"){if(y.disabled)return;y.value?w.push(y.value):typeof y.label=="string"&&w.push(y.label)}else w.push(y)}),w}),u=N(function(){return ba(i.value,r.value)}),s=N(function(){var w=u.value.length;return Boolean(w&&i.value.length===w)}),v=N(function(){var w=u.value.length;return Boolean(w<i.value.length&&w)}),d=function(y,S){var x={e:S.e,type:"check",current:void 0,option:void 0};if(y){var R,O=fe(new Set(r.value.concat(i.value)));(R=e.onChange)===null||R===void 0||R.call(e,O,x)}else{var _,j=r.value.filter(function(A){return!i.value.includes(A)});(_=e.onChange)===null||_===void 0||_.call(e,j,eo(eo({},x),{},{type:"uncheck"}))}},b=function(y,S){var x;(x=e.onChange)===null||x===void 0||x.call(e,y,S)},p=N(function(){return["".concat(l.value,"-table__column-controller-item"),z({},"".concat(l.value,"-table__").concat(e.uniqueKey),e.uniqueKey)]});return function(){return L("div",{class:p.value},[L("div",{class:"".concat(l.value,"-table__column-controller-block")},[L(Ga,{indeterminate:v.value,checked:s.value,onChange:d,disabled:!i.value.length},{default:function(){return[e.label]}})]),L("div",{class:"".concat(l.value,"-table__column-controller-block")},[L(qo,Ie({options:o.value},n.value,{modelValue:r.value,onChange:b}),null)])])}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function to(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Ia(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?to(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):to(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function qa(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set,a=0,n=t.length;a<n;a++){var r,o=t[a];(r=o.children)!==null&&r!==void 0&&r.length?qa(o.children,e):o.colKey&&e.add(o.colKey)}return e}function us(t,e){var a=ht("table",t.locale),n=a.classPrefix,r=a.globalConfig,o=En({SettingIcon:Mi}),l=o.SettingIcon,i=Ke(t),u=i.columns,s=i.columnController,v=i.displayColumns,d=i.columnControllerVisible,b=W(null),p=Yt(),w=N(function(){var m,h=(((m=s.value)===null||m===void 0?void 0:m.fields)||fe(qa(u.value))).filter(function(g){return g});return new Set(h)}),y=fe(qa(u.value)),S=kt(v,t.defaultDisplayColumns||y,t.onDisplayColumnsChange,"displayColumns"),x=Pe(S,2),R=x[0],O=x[1],_=W(v.value||t.defaultDisplayColumns||y),j=N(function(){var m;if((m=s.value)!==null&&m!==void 0&&(m=m.groupColumns)!==null&&m!==void 0&&m.length)return T(u.value);var h={label:r.value.selectAllText,options:F(u.value)};return[h]});de([v],function(m){var h=Pe(m,1),g=h[0];_.value=g||t.defaultDisplayColumns||y});function A(m,h){return{label:function(){return Ea(e.slots,m,h)},value:m.colKey,disabled:!w.value.has(m.colKey)}}function T(m){var h,g=(h=s.value)===null||h===void 0?void 0:h.groupColumns;if(!(g!=null&&g.length))return[];var c=[],f=function C(E){for(var k=0,I=E.length;k<I;k++){for(var M,$=E[k],Y=A($,k),ee=0,ne=g.length;ee<ne;ee++){var ae,J=g[ee];!J.columns.includes($.colKey)||((ae=c[ee])!==null&&ae!==void 0&&(ae=ae.options)!==null&&ae!==void 0&&ae.length?c[ee].options.push(Y):c[ee]=Ia(Ia({},g[ee]),{},{options:[Y]}))}(M=$.children)!==null&&M!==void 0&&M.length&&C($.children)}};return f(m),c}function F(m){var h,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if((h=s.value)!==null&&h!==void 0&&(h=h.groupColumns)!==null&&h!==void 0&&h.length)return[];for(var c=0,f=m.length;c<f;c++){var C,E=m[c];(C=E.children)!==null&&C!==void 0&&C.length?F(E.children,g):E.colKey&&g.push(A(E,c))}return g}var P=function(h,g){var c;_.value=h;var f={columns:h,type:g.type,currentColumn:il(u.value,String(g.current)),e:g.e};(c=t.onColumnChange)===null||c===void 0||c.call(t,f)},K=function(){var h;if(b.value){b.value.show();return}b.value=Yl.confirm(Ia({header:r.value.columnConfigTitleText,body:function(){var c,f=((c=s.value)===null||c===void 0?void 0:c.displayType)==="fixed-width"?"fixed":"auto",C=s.value||{},E=C.columnControllerTopContent,k=C.columnControllerBottomContent,I=L("div",{class:["".concat(n.value,"-table__column-controller"),"".concat(n.value,"-table__column-controller--").concat(f)]},[L("div",{class:"".concat(n.value,"-table__column-controller-body")},[Re(E)?E(Ye):p("columnControllerTopContent"),r.value.columnConfigDescriptionText&&L("p",{class:"".concat(n.value,"-table__column-controller-desc")},[r.value.columnConfigDescriptionText]),j.value.map(function(M,$){var Y,ee,ne=(Y=s.value)!==null&&Y!==void 0&&(Y=Y.groupColumns)!==null&&Y!==void 0&&Y.length?String(M.value||$):void 0;return L(is,{key:M.value||$,uniqueKey:ne,value:_.value,label:M.label,options:M.options,onChange:P,checkboxProps:(ee=s.value)===null||ee===void 0?void 0:ee.checkboxProps},null)}),Re(k)?k(Ye):p("columnControllerBottomContent")])]);return I},confirmBtn:r.value.confirmText,cancelBtn:r.value.cancelText,width:612,onConfirm:function(){if(O(fe(_.value)),d.value===void 0)b.value.hide();else{var c;(c=t.onColumnControllerVisibleChange)===null||c===void 0||c.call(t,!1,{trigger:"confirm"}),e.emit("update:columnControllerVisible",!1)}},onClose:function(){if(d.value===void 0)b.value.hide();else{var c;(c=t.onCol
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ss(t,e){var a=Ke(t),n=a.expandedRowKeys,r=Yt(),o=ht("table",t.locale),l=o.t,i=o.globalConfig,u=En({ChevronRightCircleIcon:Ri}),s=u.ChevronRightCircleIcon,v=ot(),d=v.tableExpandClasses,b=v.positiveRotate90,p=v.tableFullRowClasses,w=kt(n,t.defaultExpandedRowKeys||[],t.onExpandChange,"expandedRowKeys"),y=Pe(w,2),S=y[0],x=y[1],R=N(function(){return Boolean(t.expandedRow||e.slots.expandedRow||e.slots["expanded-row"])}),O=N(function(){return t.expandIcon!==!1&&R.value}),_=N(function(){var K;return((K=t.columns)===null||K===void 0||(K=K[0])===null||K===void 0?void 0:K.fixed)==="left"}),j=function(D,m){t.expandOnRowClick&&D.stopPropagation();var h=H(m,t.rowKey||"id"),g=S.value.indexOf(h),c=fe(S.value);g!==-1?c.splice(g,1):c.push(h),x(c,{expandedRowData:t.data.filter(function(f){return c.includes(H(f,t.rowKey||"id"))}),currentRowData:m})},A=function(D,m){var h=m.row,g=m.rowIndex,c=H(h,t.rowKey||"id"),f=S.value.includes(c),C=r("expandIcon",{defaultNode:l(i.value.expandIcon)||L(s,null,null),params:{row:h,index:g}});if(!C)return null;var E=[d.iconBox,d[f?"expanded":"collapsed"],z({},b,f)];return L("span",{class:E,onClick:function(I){return j(I,h)}},[C])},T=function(){var D={colKey:"__EXPAND_ROW_ICON_COLUMN__",width:46,className:d.iconCell,fixed:_.value?"left":void 0,cell:A,stopPropagation:!0};return D},F=function(D){var m=H(D.row,t.rowKey||"id");if(!S.value||!S.value.includes(m))return null;var h=D.isWidthOverflow&&t.columns.find(function(g){return g.fixed==="left"});return L("tr",{key:"expand_".concat(m),class:[d.row,z({},p.base,h)]},[L("td",{colspan:D.columns.length},[L("div",{class:[d.rowInner,z({},p.innerFullRow,h)],style:h?{width:"".concat(D.tableWidth,"px")}:{}},[L("div",{class:p.innerFullElement},[r("expandedRow",{params:D})])])])])},P=function(D){j(D.e,D.row)};return{showExpandedRow:R,showExpandIconColumn:O,getExpandColumn:T,renderExpandedRow:F,onInnerExpandRowClick:P}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Ja(t,e,a){if(!t)return!1;var n=Re(t.disabled)?t.disabled({row:e,rowIndex:a}):t.disabled;return t.checkProps&&(Re(t.checkProps)?n=n||t.checkProps({row:e,rowIndex:a}).disabled:t.checkProps==="object"&&(n=n||t.checkProps.disabled)),!!n}function cs(t,e,a){for(var n={},r=0,o=e.length;r<o;r++){var l=H(e[r],a);t.includes(l)&&(n[l]=!0)}return n}function wa(t,e){for(var a=0,n=t.length;a<n;a++){var r;if(t[a].colKey===e)return t[a];if((r=t[a].children)!==null&&r!==void 0&&r.length){var o=wa(t[a].children,e);if(o)return o}}return null}function no(t,e){for(var a=0,n=t.length;a<n;a++){var r;if(t[a].colKey===e)return a;if((r=t[a].children)!==null&&r!==void 0&&r.length){var o=wa(t[a].children,e);if(o)return a}}return-1}function gl(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=0,n=t.length;a<n;a++){var r,o=t[a];o.filter&&"resetValue"in o.filter&&(e[o.colKey]=o.filter.resetValue),(r=o.children)!==null&&r!==void 0&&r.length&&gl(o.children,e)}return e}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ao(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function na(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ao(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ao(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ds(t,e){var a=Ke(t),n=a.selectedRowKeys,r=a.columns,o=a.rowKey,l=a.data,i=a.reserveSelectedRowOnPaginate,u=W(l.value),s=W(),v=kt(n,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),d=Pe(v,2),b=d[0],p=d[1],w=W(new Map),y=N(function(){return t.columns.find(function(c){var f=c.type;return["multiple","single"].includes(f)})}),S=N(function(){var c;return t.rowSelectionType||((c=y.value)===null||c===void 0?void 0:c.type)||"single"}),x=N(function(){var c=i.value?l.value:u.value;return c.filter(function(f,C){return!_(f,C)})}),R=N(function(){return ba(b.value,x.value.map(function(c){return H(c,t.rowKey||"id")}))}),O=N(function(){var c;if(t.rowSelectionAllowUncheck)return!0;var f=S.value==="single";return!f||!y.value||!("allowUncheck"in((c=y.value)===null||c===void 0?void 0:c.checkProps))?!1:y.value.checkProps.allowUncheck});de([l,r,b,y,o],function(){var c,f=function($){return y.value.disabled($)?e.disabled:""},C=(c=y.value)!==null&&c!==void 0&&c.disabled?f:void 0,E=new Set(b.value),k=function($){var Y=$.row,ee=H(Y,t.rowKey||"id");return E.has(ee)?e.selected:""},I=E.size?k:void 0;s.value=[C,I]},{immediate:!0});function _(c,f){return Ja(y.value,c,f)}function j(){return function(){var c=R.value.length>0&&R.value.length<x.value.length,f=R.value.length!==0&&x.value.length!==0&&R.value.length===x.value.length;return L(Ga,{checked:f,indeterminate:c,disabled:!x.value.length,onChange:P},null)}}function A(c){var f=c.col,C=c.row,E=c.rowIndex,k=Re(f.disabled)?f.disabled({row:C,rowIndex:E}):f.disabled,I=Re(f.checkProps)?f.checkProps({row:C,rowIndex:E}):f.checkProps;return{disabled:k||(I==null?void 0:I.disabled),checkProps:I}}function T(c){var f=c.col,C=c.row,E=C===void 0?{}:C,k=b.value.includes(H(E,t.rowKey||"id")),I=A(c),M=I.disabled,$=I.checkProps,Y=na(na({checked:k,disabled:M},$),{},{onClick:function(J){if(dt(J)==="object"&&"e"in J){var B;(B=J.e)===null||B===void 0||B.stopPropagation()}else J==null||J.stopPropagation()},onChange:function(){return F(E)}});if(f.type==="single")return L(su,Y,null);if(f.type==="multiple"){var ee,ne=(ee=t.indeterminateSelectedRowKeys)!==null&&ee!==void 0&&ee.length?t.indeterminateSelectedRowKeys.includes(H(E,t.rowKey)):!1;return L(Ga,Ie({indeterminate:ne},Y),null)}return null}function F(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=fe(b.value),C=t.rowKey||"id",E=H(c,C),k=f.indexOf(E),I=k!==-1;if(S.value==="multiple")I?f.splice(k,1):f.push(E);else if(S.value==="single")f=I&&O.value?[]:[E];else{Be.warn("Table","`column.type` must be one of `multiple` and `single`");return}p(f,{selectedRowData:f.map(function(M){return w.value.get(M)}),currentRowKey:E,currentRowData:c,type:I?"uncheck":"check"})}function P(c){var f,C=t.rowKey||"id",E=x.value.map(function(M){return H(M,C)}),k=((f=n.value)===null||f===void 0?void 0:f.filter(function(M){return!E.includes(M)}))||[],I=c?[].concat(fe(k),fe(E)):fe(k);p(I,{selectedRowData:c?I.map(function(M){return w.value.get(M)}):[],type:c?"check":"uncheck",currentRowKey:"CHECK_ALL_BOX"})}function K(c){var f=["multiple","single"].includes(c.type);return f?na(na({},c),{},{width:c.width||64,className:[e.checkCell,c.className],cell:function(E,k){return T(k)},title:c.type==="multiple"?j():c.title}):c}var D=function(f){var C=f.row,E=f.index,k=t.columns.findIndex(function($){return $.colKey==="row-select"}),I=!1;if(k!==-1){var M;I=(M=A({row:C,rowIndex:E,col:t.columns[k],colIndex:k}))===null||M===void 0?void 0:M.disabled}I||F(C)};de([l,o],function(){for(var c=0,f=l.value.length;c<f;c+
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function vs(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!dn(t)}var fs=ze({name:"TSorterButton",props:{sortType:{type:String,default:"all"},sortOrder:{type:String,default:function(){return""}},locale:Object,sortIcon:Function,tooltipProps:Object,hideSortTips:Boolean},emits:["sort-icon-click"],setup:function(e,a){var n=ot(),r=n.tableSortClasses,o=n.negativeRotate180,l=Un(),i=ht("table",e.locale),u=i.t,s=i.globalConfig,v=En({ChevronDownIcon:fi}),d=v.ChevronDownIcon,b=N(function(){return e.sortType==="all"?["asc","desc"]:[e.sortType]}),p=function(S,x){a.emit("sort-icon-click",S,{descending:x==="desc"})},w=function(S,x){var R=u(s.value.sortIcon)||L(d,null,null),O=l("sortIcon",R),_=[x,r.sortIcon,r.iconDirection[S],z({},o,S==="asc")];return L("span",{class:_,onClick:function(A){return p(A,S)}},[O])};return{t:u,globalConfig:s,tableSortClasses:r,negativeRotate180:o,allowSortTypes:b,getSortIcon:w}},render:function(){var e=this,a=this.tableSortClasses,n=[a.trigger,z({},a.doubleIcon,this.allowSortTypes.length>1)],r={asc:this.globalConfig.sortAscendingOperationText,desc:this.globalConfig.sortDescendingOperationText},o=this.allowSortTypes.map(function(l){var i,u,s=l===e.sortOrder?a.iconActive:a.iconDefault,v=e.globalConfig.sortCancelOperationText,d=l===e.sortOrder?v:r[l];return((u=e.hideSortTips)!==null&&u!==void 0?u:e.globalConfig.hideSortTips)?e.getSortIcon(l,s):L(Wo,Ie({content:d,placement:"right",showArrow:!1,class:e.tableSortClasses.iconDirection[l]},e.tooltipProps),vs(i=e.getSortIcon(l,s))?i:{default:function(){return[i]}})});return L("div",{class:n},[o])}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ro(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function hs(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?ro(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ro(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function gs(t,e){var a=e.slots,n=Ke(t),r=n.sort,o=n.data,l=W(),i=kt(r,t.defaultSort,t.onSortChange,"sort"),u=Pe(i,2),s=u[0],v=u[1],d=kt(o,[],t.onDataChange,"data"),b=Pe(d,2),p=b[0],w=b[1],y=N(function(){return O(t.columns)}),S=W(),x=N(function(){var D=s.value;return D?Pa(D)?D:[D]:[]}),R=N(function(){var D={};return x.value.forEach(function(m,h){var g=m.sortBy;D[g]=hs({index:h},m)}),D});function O(D){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=0,g=D.length;h<g;h++){var c,f=D[h];Re(f.sorter)&&(m[f.colKey]=f.sorter),(c=f.children)!==null&&c!==void 0&&c.length&&O(f.children,m)}return m}function _(D){var m=D;if(!!Object.keys(y.value).length){l.value||(l.value=p.value);var h=!m||m instanceof Array&&!m.length,g=!(m instanceof Array)&&!(m!=null&&m.sortBy);if(h||g)return w(l.value,{trigger:"sort"}),l.value;var c=m instanceof Array?m:[m],f=p.value.slice().sort(function(C,E){for(var k=0,I=0,M=c.length;I<M;I++){var $=c[I],Y=y.value[$.sortBy];if(k===0&&Y)k=$.descending?Y(E,C):Y(C,E);else break}return k});if(JSON.stringify(f)!==JSON.stringify(p.value))return w(f,{trigger:"sort"}),f}}function j(D,m){var h,g;if(t.multipleSort)g=F(D,m);else{var c=s.value instanceof Array?s.value[0]:s.value;g=T(D,c,m)}var f=_(g),C=f||p.value,E=C;v(g,{currentDataSource:E,col:D}),(h=t.onChange)===null||h===void 0||h.call(t,{sorter:g},{currentData:C,trigger:"sorter"}),S.value=g}function A(D){if(D!==void 0)return D?"desc":"asc"}function T(D,m,h){if(!(m&&m.sortBy===D.colKey&&m.descending===h.descending))return{sortBy:D.colKey,descending:h.descending}}function F(D,m){Array.isArray(s.value)||(s.value=s.value?[s.value]:[]);for(var h=s.value,g=D.colKey,c=fe(h),f=0,C=h.length;f<C;f++)if(h[f].sortBy===g){var E=T(D,h[f],m);return E?c[f]=E:c.splice(f,1),c}return c.push({sortBy:g,descending:m.descending}),c}function P(D){var m,h=D.col;if(!h.sorter)return null;var g={sortType:h.sortType,sortOrder:A((m=R.value[h.colKey])===null||m===void 0?void 0:m.descending),sortIcon:t.sortIcon,hideSortTips:t.hideSortTips,locale:t.locale};return L(fs,Ie(g,{onSortIconClick:function(f,C){return j(h,C)}}),{sortIcon:a.sortIcon})}var K=function(m,h){var g=Pa(m)?m:[m],c=Pa(h)?h:[h];if(g.length&&!h)return!1;for(var f=function(){var M=g[E],$=c.find(function(Y){return Y.sortBy===M.sortBy});return $?{v:M.descending===$.descending}:{v:!1}},C,E=0,k=g.length;E<k;E++)if(C=f(),C)return C.v};return de(function(){return[s,t.data]},function(){!s.value||!Object.keys(s.value).length||!p.value.length||K(s.value,S.value)||_(s.value)},{immediate:!0}),{renderSortIcon:P}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function oo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function aa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?oo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):oo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ps=ze({name:"TableFilterController",props:{locale:Object,column:Object,colIndex:Number,tFilterValue:Object,innerFilterValue:Object,tableFilterClasses:Object,isFocusClass:String,primaryTableElement:{},popupProps:Object,attach:[String,Function],onVisibleChange:Function},emits:["inner-filter-change","reset","confirm"],setup:function(e,a){var n=W(null),r=Un(),o=ht("table",e.locale),l=o.t,i=o.globalConfig,u=En({FilterIcon:Ai}),s=u.FilterIcon,v=W(!1),d=function(x){var R;v.value=x,(R=e.onVisibleChange)===null||R===void 0||R.call(e,x)},b=function(x,R,O){if(!O)return null;var _=!!O.setup;if(Re(x.filter.component)&&!_)return x.filter.component(function(A,T){var F=dt(T)==="object"&&"attrs"in T?T.attrs:{};return Ye(A,{props:aa(aa({},R),F)})});var j=x.filter||{};return L(O,Ie({class:j.classNames,style:j.style},j.attrs,R),null)},p=function(x){var R,O,_=["single","multiple","input"];if(x.type&&!_.includes(x.filter.type)){console.error("TDesign Table Error: column.filter.type must be the following: ".concat(JSON.stringify(_)));return}var j=e.innerFilterValue,A=j===void 0?{}:j,T={single:cu,multiple:qo,input:mi}[x.filter.type]||x.filter.component;if(!(!T&&!x.filter.component)){var F=aa(aa({options:["single","multiple"].includes(x.filter.type)?(R=x.filter)===null||R===void 0?void 0:R.list:void 0},((O=x.filter)===null||O===void 0?void 0:O.props)||{}),{},{onChange:function(K,D){var m,h;if(a.emit("inner-filter-change",K,x),(m=x.filter.props)!==null&&m!==void 0&&m.onChange){var g,c;(g=(c=x.filter.props).onChange)===null||g===void 0||g.call(c,K,D)}(h=x.filter)!==null&&h!==void 0&&(h=h.confirmEvents)!==null&&h!==void 0&&h.includes("onChange")&&(v.value=!1)}});return x.colKey&&A&&x.colKey in A&&(F.value=A==null?void 0:A[x.colKey]),x.filter.confirmEvents&&x.filter.confirmEvents.forEach(function(P){P!=="onChange"&&(F[P]=function(){a.emit("confirm",x),v.value=!1})}),L("div",{class:e.tableFilterClasses.contentInner},[b(x,F,T)])}},w=function(x){if(!!x.filter.showConfirmAndReset)return L("div",{class:e.tableFilterClasses.bottomButtons},[L(pa,{theme:"default",size:"small",onClick:function(){a.emit("reset",x),v.value=!1}},{default:function(){return[i.value.resetText]}}),L(pa,{theme:"primary",size:"small",onClick:function(){a.emit("confirm",x),v.value=!1}},{default:function(){return[i.value.confirmText]}})])},y=function(){return L("div",{class:e.tableFilterClasses.popupContent},[p(e.column),w(e.column)])};return{t:l,globalConfig:i,FilterIcon:s,filterPopupVisible:v,triggerElementRef:n,renderTNode:r,getContent:y,onFilterPopupVisibleChange:d}},render:function(){var e,a=this,n=this.column,r=this.popupProps,o=this.FilterIcon;if(!n.filter||n.filter&&!Object.keys(n.filter).length)return null;var l=this.t(this.globalConfig.filterIcon)||L(o,null,null),i=(e=this.tFilterValue)===null||e===void 0?void 0:e[n.colKey],u=dt(i)==="object"&&!ql(i),s=![null,void 0,""].includes(i)&&dt(i)!=="object";return L(hi,Ie({attach:this.attach||(this.primaryTableElement?function(){return a.primaryTableElement}:void 0),visible:this.filterPopupVisible,destroyOnClose:!0,trigger:"click",placement:"bottom-right",showArrow:!0,overlayClassName:this.tableFilterClasses.popup,onVisibleChange:function(d){return a.onFilterPopupVisibleChange(d)},class:[this.tableFilterClasses.icon,z({},this.isFocusClass,u||s)],content:this.getContent},r),{default:function(){return[L("div",{ref:"triggerElementRef"},[a.renderTNode("filterIcon",{defaultNode:l,params:{col:n,colIndex:a.colIndex}})])]}})}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function lo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ra(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):lo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function pl(t){var e=t instanceof Array&&t.length,a=dt(t)==="object"&&!(t instanceof Array),n=a&&Object.keys(t).length;return e||n||!["null","","undefined"].includes(String(t))}function bs(t){var e={};return Object.keys(t).forEach(function(a){var n=t[a];pl(n)&&(e[a]=n)}),e}function ms(t,e){var a=W(null),n=ht("table",t.locale),r=n.t,o=n.globalConfig,l=Un(),i=Ke(t),u=i.filterValue,s=i.columns,v=ot(),d=v.tableFilterClasses,b=v.isFocusClass,p=W(),w=kt(u,t.defaultFilterValue,t.onFilterChange,"filterValue"),y=Pe(w,2),S=y[0],x=y[1],R=W(S.value),O=N(function(){var c=bs(S.value||{});return!S.value||!Object.keys(c).length});de([S],function(c){var f=Pe(c,1),C=f[0];R.value=C});function _(){var c,f;if(O.value)return null;var C=L("div",{class:d.result},[L("span",null,[r(o.value.searchResultText,{result:j(),count:((c=t.pagination)===null||c===void 0?void 0:c.total)||((f=t.data)===null||f===void 0?void 0:f.length)})]),L(pa,{theme:"primary",variant:"text",onClick:K},{default:function(){return[o.value.clearFilterResultButtonText]}})]),E=l("filterRow");return t.filterRow&&!E||t.filterRow===null?null:L("div",{class:d.inner},[E||C])}function j(){var c=[],f=[];return A(t.columns,f),f.filter(function(C){return C.filter}).forEach(function(C,E){var k=S.value[C.colKey];if(C.filter.list&&!["null"].includes(String(k))){var I=k instanceof Array?k:[k],M=[];C.filter.list.forEach(function(ae){I.includes(ae.value)&&M.push(ae.label)}),k=M.join()}if(pl(k)){var $,Y,ee=Re(($=C.filter)===null||$===void 0?void 0:$.label)?C.filter.label(Ye):(Y=C.filter)===null||Y===void 0?void 0:Y.label,ne=Ea(e.slots,C,E);c.push("".concat(ee||ne,"\uFF1A").concat(k))}}),c.join("\uFF1B")}function A(c,f){c.forEach(function(C){C.children&&A(C.children,f),f.push(C)})}function T(c,f){var C=ra(ra({},R.value),{},z({},f.colKey,c));R.value=C,f.filter.showConfirmAndReset||F(C,"filter-change",f)}function F(c,f,C){var E;x(c,{col:C,trigger:f}),(E=t.onChange)===null||E===void 0||E.call(t,{filter:c},{trigger:"filter"})}function P(c){var f,C,E=ra(ra({},S.value),{},z({},c.colKey,(f=(C=c.filter.resetValue)!==null&&C!==void 0?C:{single:"",multiple:[],input:""}[c.filter.type])!==null&&f!==void 0?f:""));F(E,"reset",c)}function K(){var c=gl(s.value);F(c,"clear",void 0)}function D(c){F(R.value,"confirm",c)}function m(c){var f,C=c.col,E=c.colIndex;return L(ps,{column:C,colIndex:E,filterIcon:t.filterIcon,tFilterValue:S.value,innerFilterValue:R.value,tableFilterClasses:d,isFocusClass:b,popupProps:C.filter.popupProps,attach:t.attach,locale:t.locale,onReset:P,onConfirm:D,onInnerFilterChange:T,primaryTableElement:(f=a.value)===null||f===void 0?void 0:f.$el,onVisibleChange:g},{filterIcon:e.slots.filterIcon})}function h(c){a.value=c}function g(c){c&&!p.value&&(p.value=!c)}return{hasEmptyCondition:O,isTableOverflowHidden:p,renderFilterIcon:m,renderFirstFilterRow:_,setFilterPrimaryTableRef:h}}/**!
|
|
|
|
* Sortable 1.15.2
|
|
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
|
|
* @author owenm <owen23355@gmail.com>
|
|
|
|
* @license MIT
|
|
|
|
*/function io(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Tt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?io(Object(a),!0).forEach(function(n){ws(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):io(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function da(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?da=function(e){return typeof e}:da=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(t)}function ws(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Nt(){return Nt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},Nt.apply(this,arguments)}function ys(t,e){if(t==null)return{};var a={},n=Object.keys(t),r,o;for(o=0;o<n.length;o++)r=n[o],!(e.indexOf(r)>=0)&&(a[r]=t[r]);return a}function Cs(t,e){if(t==null)return{};var a=ys(t,e),n,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,n)||(a[n]=t[n]))}return a}var xs="1.15.2";function It(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Mt=It(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Gn=It(/Edge/i),uo=It(/firefox/i),Mn=It(/safari/i)&&!It(/chrome/i)&&!It(/android/i),bl=It(/iP(ad|od|hone)/i),ml=It(/chrome/i)&&It(/android/i),wl={capture:!1,passive:!1};function Oe(t,e,a){t.addEventListener(e,a,!Mt&&wl)}function Ce(t,e,a){t.removeEventListener(e,a,!Mt&&wl)}function ya(t,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Ss(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function wt(t,e,a,n){if(t){a=a||document;do{if(e!=null&&(e[0]===">"?t.parentNode===a&&ya(t,e):ya(t,e))||n&&t===a)return t;if(t===a)break}while(t=Ss(t))}return null}var so=/\s+/g;function ut(t,e,a){if(t&&e)if(t.classList)t.classList[a?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(so," ").replace(" "+e+" "," ");t.className=(n+(a?" "+e:"")).replace(so," ")}}function ie(t,e,a){var n=t&&t.style;if(n){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(a=t.currentStyle),e===void 0?a:a[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=a+(typeof a=="string"?"":"px")}}function Sn(t,e){var a="";if(typeof t=="string")a=t;else do{var n=ie(t,"transform");n&&n!=="none"&&(a=n+" "+a)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(a)}function yl(t,e,a){if(t){var n=t.getElementsByTagName(e),r=0,o=n.length;if(a)for(;r<o;r++)a(n[r],r);return n}return[]}function _t(){var t=document.scrollingElement;return t||document.documentElement}function Xe(t,e,a,n,r){if(!(!t.getBoundingClientRect&&t!==window)){var o,l,i,u,s,v,d;if(t!==window&&t.parentNode&&t!==_t()?(o=t.getBoundingClientRect(),l=o.top,i=o.left,u=o.bottom,s=o.right,v=o.height,d=o.width):(l=0,i=0,u=window.innerHeight,s=window.innerWidth,v=window.innerHeight,d=window.innerWidth),(e||a)&&t!==window&&(r=r||t.parentNode,!Mt))do if(r&&r.getBoundingClientRect&&(ie(r,"transform")!=="none"||a&&ie(r,"position")!=="static")){var b=r.getBoundingClientRect();l-=b.top+parseInt(ie(r,"border-top-width")),i-=b.left+parseInt(ie(r,"border-left-width")),u=l+o.height,s=i+o.width;break}while(r=r.parentNode);if(n&&t!==window){var p=Sn(r||t),w=p&&p.a,y=p&&p.d;p&&
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function bo(t,e,a){var n=fe(t);return a-e>0?(n.splice(a+1,0,n[e]),n.splice(e,1)):(n.splice(a,0,n[e]),n.splice(e+1,1)),n}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function mo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function jn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):mo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function wo(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function yo(t,e,a){var n=a===0?t.children[0]:t.children[a-1].nextSibling;t.insertBefore(e,n)}function Vs(t,e,a){var n=Ke(t),r=n.sortOnRowDraggable,o=n.dragSort,l=n.data,i=W(t.pagination),u=ot(),s=u.tableDraggableClasses,v=u.tableBaseClass,d=u.tableFullRowClasses,b=u.tableExpandClasses,p=W(t.columns||[]),w=W(null),y=N(function(){return p.value.find(function(K){return K.colKey==="drag"})}),S=N(function(){return r.value||["row","row-handler-col"].includes(o.value)}),x=N(function(){return["row-handler","row-handler-col"].includes(o.value)&&!!y.value}),R=N(function(){return["col","row-handler-col"].includes(o.value)});t.sortOnRowDraggable&&Be.error("Table","`sortOnRowDraggable` is going to be deprecated, use dragSort='row' instead.");function O(K,D){var m,h,g=(m=D.current)!==null&&m!==void 0?m:D.defaultCurrent,c=(h=D.pageSize)!==null&&h!==void 0?h:D.defaultPageSize;return!t.disableDataPage&&D&&l.value.length>c?c*(g-1)+K:K}var _=function(D){if(!(!x.value&&!S.value)){var m=D==null?void 0:D.querySelector("tbody");if(!m)return console.error("tbody does not exist."),null;var h=jn({animation:150,ghostClass:s.ghost,chosenClass:s.chosen,dragClass:s.dragging,filter:".".concat(d.base,",.").concat(b.row),onMove:function(c){return!Jl(c.related,d.base)},onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){wo(c.item),yo(c.from,c.item,c.oldIndex);var C=c.oldIndex,E=c.newIndex;(Re(t.firstFullRow)&&t.firstFullRow(Ye)||e.slots.firstFullRow||e.slots["first-full-row"])&&(C-=1,E-=1),i.value&&(C=O(C,i.value),E=O(E,i.value));var k={data:l.value,currentIndex:C,current:l.value[C],targetIndex:E,target:l.value[E],newData:bo(fe(t.data),C,E),e:c,sort:"row"};k.currentData=k.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,k)}}},t.dragSortOptions);!m||(S.value?new oe(m,jn({},h)):new oe(m,jn(jn({},h),{},{handle:".".concat(s.handle)})))}},j=function(D,m){var h=jn({animation:150,dataIdAttr:"data-colkey",direction:"vertical",ghostClass:s.ghost,chosenClass:s.chosen,dragClass:s.dragging,handle:".".concat(v.thCellInner),onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){m&&(wo(c.item),yo(c.from,c.item,c.oldIndex));var C=c.oldIndex,E=c.newIndex,k=c.target,I=m?C:E,M=m?E:C,$=k.children[I],Y=k.children[M],ee=wa(p.value,$.dataset.colkey),ne=wa(p.value,Y.dataset.colkey);(!ee||!ee.colKey)&&Be.error("Table","colKey is missing in ".concat(JSON.stringify(ee))),(!ne||!ne.colKey)&&Be.error("Table","colKey is missing in ".concat(JSON.stringify(ne))),I=no(t.columns,ee.colKey),M=no(t.columns,ne.colKey);var ae={data:p.value,currentIndex:I,current:ee,targetIndex:M,target:ne,newData:bo(fe(t.columns),I,M),e:c,sort:"col"};ae.currentData=ae.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,ae)}}},t.dragSortOptions);!D||new oe(D,h)},A=function(D){if(!(!R.value||!D)){var m=D.querySelectorAll("thead > tr");if(m.length<=1){var h=Pe(m,1),g=h[0];j(g,!0)}else m==null||m.forEach(function(c){j(c,!1)})}};function T(K){w.value=K}function F(K){p.value=K}de([w,p,o,a],function(K){var D=Pe(K,4),m=D[0];D[1],D[2];var h=D[3];P(m,h)});function P(K,D){var m=K;if(!(!K||!m.$el||!D.showElement))var h=setTimeout(function(){_(m.$el),A(m.$el);var g=setTimeout(function(){m.$refs.affixHeaderRef&&A(m.$refs.affixHeaderRef),clearTimeout(g)});clearTimeout(h)},60)}return{innerPagination:i,isRowDraggable:S,isRowHandlerDraggable:x,isColDraggable:R,setDragSortPrimaryTableRef:T,setDragSortColumns:F}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Us(t){var e=Yt(),a=ht("table",t.locale),n=a.globalConfig,r=ot(),o=r.isLoadingClass,l=r.isLoadMoreClass,i=r.asyncLoadingClass,u=N(function(){return[i,z(z({},o,t.asyncLoading==="loading"),l,t.asyncLoading==="load-more")]});function s(){var d;!Lt(t.asyncLoading)||(d=t.onAsyncLoadingClick)===null||d===void 0||d.call(t,{status:t.asyncLoading})}function v(){var d=e("asyncLoading");if(Lt(d)){var b=t.asyncLoading,p={"load-more":n.value.loadingMoreText,loading:n.value.loadingText}[String(b)];return L("div",{class:u.value,onClick:s},[L(Lo,{indicator:b==="loading",loading:!!b,size:"small",text:p},null)])}return[null,!1,void 0].includes(d)?null:L("div",{class:u.value,onClick:s},[d])}return{renderAsyncLoading:v}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Co(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function _e(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Co(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Co(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Xs=ze({name:"TableEditableCell",props:{row:Object,rowKey:String,rowIndex:Number,col:Object,colIndex:Number,oldCell:[Function,String],tableBaseClass:Object,cellEmptyContent:[Function,String],editable:{type:Boolean,default:void 0},readonly:{type:Boolean},errors:{type:Array,default:void 0},onChange:Function,onValidate:Function,onRuleChange:Function,onEditableChange:Function},emits:["update-edited-cell"],setup:function(e,a){var n,r=Ke(e),o=r.row,l=r.col;W(null);var i=N(function(){var c;return(c=l.value.edit)===null||c===void 0?void 0:c.keepEditMode}),u=W(i.value||((n=e.col.edit)===null||n===void 0?void 0:n.defaultEditable)||!1),s=W(),v=W(),d=Kt(),b=En({Edit1Icon:_i}),p=b.Edit1Icon,w=function(f){if(dt(f)==="object"&&("rowValue"in f||f.isUpdateCurrentRow)){var C=f.isUpdateCurrentRow?H(o.value,e.rowKey):f.rowValue;delete f.rowValue,delete f.isUpdateCurrentRow,a.emit("update-edited-cell",C,o.value,f)}else s.value=f};de([i],function(c){c&&(u.value=!0)});var y=N(function(){var c,f;return((c=l.value.edit)===null||c===void 0||(f=c.on)===null||f===void 0?void 0:f.call(c,_e(_e({},S.value),{},{editedRow:x.value,updateEditedCellValue:w})))||{}}),S=N(function(){return{rowIndex:e.rowIndex,colIndex:e.colIndex,col:e.col,row:e.row}}),x=N(function(){var c=l.value.colKey,f=c.split(".")||[],C=gi(f),E=C[0],k=C.slice(1),I=_e({},o.value);return k.length?(I[E]=rr(o.value[E]),$n(I[E],k.join("."),s.value)):$n(I,c,s.value),I}),R=N(function(){var c=ma({row:x.value,col:_e(_e({},l.value),{},{cell:e.oldCell}),rowIndex:e.rowIndex,colIndex:e.colIndex},a.slots,{cellEmptyContent:e.cellEmptyContent});return c}),O=N(function(){var c=l.value.edit;return Re(c.props)?c.props(_e(_e({},S.value),{},{editedRow:x.value,updateEditedCellValue:w})):_e({},c.props)}),_=N(function(){var c,f=l.value.edit;if(!f)return{};var C=_e({},O.value);return delete C.onChange,delete C.value,(c=f.abortEditOnEvent)===null||c===void 0||c.forEach(function(E){delete C[E]}),C}),j=N(function(){var c,f=l.value.edit;return f?Boolean((c=f.abortEditOnEvent)===null||c===void 0?void 0:c.includes("onChange")):!1}),A=function(f){return new Promise(function(C){var E={result:[_e(_e({},S.value),{},{errorList:[],value:s.value})],trigger:f},k=Re(l.value.edit.rules)?l.value.edit.rules(S.value):l.value.edit.rules;if(!l.value.edit||!k||!k.length){var I;(I=e.onValidate)===null||I===void 0||I.call(e,E),C(!0);return}Qo(s.value,k).then(function(M){var $,Y=M==null?void 0:M.filter(function(ee){return!ee.result});E.result[0].errorList=Y,($=e.onValidate)===null||$===void 0||$.call(e,E),!Y||!Y.length?(v.value=[],C(!0)):(v.value=Y,C(Y))})})},T=function(f,C){return Ua(f)&&Ua(C)?JSON.stringify(f)===JSON.stringify(C):f===C},F=function(f,C){for(var E=arguments.length,k=new Array(E>2?E-2:0),I=2;I<E;I++)k[I-2]=arguments[I];A("self").then(function(M){var $,Y;if(M===!0){var ee=H(o.value,l.value.colKey);T(s.value,ee)||(s.value=ee,f==null||f.apply(void 0,k)),($=(Y=y.value)[C])===null||$===void 0||$.call(Y,k[2]);var ne=setTimeout(function(){var ae;i.value||(u.value=!1),v.value=[],(ae=e.onEditableChange)===null||ae===void 0||ae.call(e,_e(_e({},S.value),{},{value:s.value,editedRow:_e(_e({},e.row),{},z({},e.col.colKey,s.value)),validateEdit:A,isEdit:!1})),clearTimeout(ne)},0)}})},P=N(function(){var c,f=l.value.edit,C=e.editable===void 0;if(!(!u.value||!C)){if(!(f!=null&&(c=f.abortEditOnEvent)!==null&&c!==void 0&&c.length))return{};var E={},k=f==null?void 0:f.onEdited;return f.abortEditOnEvent.forEach(function(I){I!=="onChange"&&(E[I]=function(){for(var M=arguments
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function xo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Fn(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?xo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):xo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Gs(t){var e=Ke(t),a=e.editableRowKeys,n=new Map,r=W({}),o=N(function(){return cs(t.editableRowKeys,t.data,t.rowKey||"id")}),l=W({}),i=W({}),u=function(O){var _={};return O.forEach(function(j){var A=j.row,T=j.col,F=j.errorList,P=H(A,t.rowKey||"id"),K=[P,T.colKey].join("__");F!=null&&F.length?_[K]=F:delete _[K]}),_},s=function(O){var _=n.get(O);if(!!_){var j=_.map(function(A){return new Promise(function(T){var F=A.editedRow,P=A.col,K=Re(P.edit.rules)?P.edit.rules(A):P.edit.rules;if(!P.edit||!K||!K.length){T(Fn(Fn({},A),{},{errorList:[]}));return}Qo(H(F,P.colKey),K).then(function(D){T(Fn(Fn({},A),{},{errorList:D.filter(function(m){return!m.result})}))})})});return new Promise(function(A,T){Promise.all(j).then(function(F){A({errors:F.filter(function(P){var K;return(K=P.errorList)===null||K===void 0?void 0:K.length}),errorMap:u(F)})},T)})}},v=function(O){return new Promise(function(_,j){s(O).then(function(A){var T,F=A.errors,P=A.errorMap;r.value=P;var K="parent";(T=t.onRowValidate)===null||T===void 0||T.call(t,{trigger:K,result:F}),_({trigger:K,result:F})},j)})},d=function(){var O=Object.keys(l.value),_=O.map(function(j){return l.value[j].validateEdit("parent")});return new Promise(function(j,A){Promise.all(_).then(function(T){var F,P={};T.forEach(function(K,D){K!==!0&&(P[O[D]]=K)}),(F=t.onValidate)===null||F===void 0||F.call(t,{result:P}),j({result:P})},A)})},b=function(){if(Object.keys(l.value).length)return d();for(var O=[],_=t.data||[],j=0,A=_.length;j<A;j++){var T=H(_[j],t.rowKey||"id");O.push(s(T))}return new Promise(function(F,P){Promise.all(O).then(function(K){var D,m={};K.forEach(function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{errors:[],errorMap:{}},g=h.errorMap;g&&Object.assign(m,g)}),r.value=m,(D=t.onValidate)===null||D===void 0||D.call(t,{result:m}),F({result:m})},P)})},p=function(O,_,j){i.value[O]||(i.value[O]=rr(_)),Object.entries(j).forEach(function(A){var T=Pe(A,2),F=T[0],P=T[1];$n(i.value[O],F,P)})},w=function(O){if(t.editableRowKeys){var _=H(O.row,t.rowKey||"id"),j=n.get(_);if(j){var A=j.findIndex(function(T){return T.col.colKey===O.col.colKey});A===-1?j.push(O):j[A]=O,n.set(_,j)}else n.set(_,[O])}},y=function(){r.value={}},S=function(O){var _=Vn(O.row,t.rowKey,O.col.colKey,O.colIndex);O.isEdit?l.value[_]=O:delete l.value[_]},x=function(O){var _,j=O.row,A=O.col,T=H(j,t.rowKey||"id"),F=i.value[T];if(F&&(_=t.editableRowKeys)!==null&&_!==void 0&&_.includes(T)){var P=Fn({},F);return $n(P,A.colKey,H(F,A.colKey)),P}return j};return de(function(){var R;return(R=a.value)===null||R===void 0?void 0:R.join(",")},function(R){var O=R.split(","),_=Object.keys(i.value);_.forEach(function(j){O.includes(j)||delete i.value[j]})}),{editedFormData:i,errorListMap:r,editableKeysMap:o,validateTableData:b,validateRowData:v,onRuleChange:w,clearValidateData:y,onUpdateEditedCell:p,getEditRowData:x,onPrimaryTableCellEditChange:S}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function So(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function jt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?So(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):So(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ys=["hideSortTips","dragSort","defaultExpandedRowKeys","defaultSelectedRowKeys","columnController","filterRow","sortOnRowDraggable","expandOnRowClick","expand-on-row-click","expanded-row","editable-row-keys","editable-cell-state","filter-value","multipleSort","expandIcon","expand-icon","reserveSelectedRowOnPaginate","expandedRowKeys","expandedRow","reserve-selected-row-on-paginate","reserveSelectedRowOnPaginate","selected-row-keys","selectedRowKeys","selectOnRowClick","column-controller","columnController","dragSort","drag-sort","hideSortTips","showSortColumnBgColor","filter-row","filterRow","multiple-sort","multipleSort","async-loading","onChange","onAsyncLoadingClick","onColumnChange","onColumnControllerVisibleChange","onDataChange","onDisplayColumnsChange","onDragSort","onExpandChange","onFilterChange","onSelectChange","onSortChange"],hr=ze({name:"TPrimaryTable",props:jt(jt({},On),hl),setup:function(e,a){var n=Yt(),r=Ke(e),o=r.columns,l=r.columnController,i=W(null),u=W(!1),s=ot(),v=s.classPrefix,d=s.tableDraggableClasses,b=s.tableBaseClass,p=s.tableSelectedClasses,w=s.tableSortClasses,y=ht("table",e.locale),S=y.globalConfig,x=vl(e),R=x.sizeClassNames,O=N(function(){var be;return(be=e.size)!==null&&be!==void 0?be:S.value.size}),_=us(e,a),j=_.tDisplayColumns,A=_.renderColumnController,T=ss(e,a),F=T.showExpandedRow,P=T.showExpandIconColumn,K=T.getExpandColumn,D=T.renderExpandedRow,m=T.onInnerExpandRowClick,h=gs(e,a),g=h.renderSortIcon,c=ds(e,p),f=c.selectColumn,C=c.showRowSelect,E=c.selectedRowClassNames,k=c.currentPaginateData,I=c.formatToRowSelectColumn,M=c.setTSelectedRowKeys,$=c.onInnerSelectRowClick,Y=c.handleRowSelectWithAreaSelection,ee=ms(e,a),ne=ee.hasEmptyCondition,ae=ee.isTableOverflowHidden,J=ee.renderFilterIcon,B=ee.renderFirstFilterRow,X=ee.setFilterPrimaryTableRef,Q=N(function(){return{showElement:u.value}}),q=Vs(e,a,Q),se=q.isRowHandlerDraggable,he=q.isRowDraggable,Le=q.isColDraggable,Ve=q.innerPagination,qe=q.setDragSortPrimaryTableRef,Ne=q.setDragSortColumns,lt=ol(e),gt=lt.renderTitleWidthIcon,it=Us(e),Pt=it.renderAsyncLoading,je=Gs(e),Dn=je.errorListMap,_n=je.editableKeysMap,Tn=je.validateRowData,re=je.validateTableData,V=je.onRuleChange,G=je.clearValidateData,Z=je.onUpdateEditedCell,te=je.getEditRowData,le=je.onPrimaryTableCellEditChange,ge=N(function(){return Boolean(F.value||C.value)}),pe=N(function(){return Boolean(F.value||C.value)}),ue=N(function(){var be;return z(z(z(z(z(z(z(z({},d.colDraggable,Le.value),d.rowHandlerDraggable,se.value),d.rowDraggable,he.value),b.overflowVisible,ae.value===!1),b.tableRowEdit,e.editableRowKeys),"".concat(v,"-table--select-").concat((be=f.value)===null||be===void 0?void 0:be.type),f.value),"".concat(v,"-table--row-select"),C.value),"".concat(v,"-table--row-expandable"),F.value)}),me=N(function(){var be=[e.rowClassName,E.value];return be.filter(function(ve){return ve})}),Ee=N(function(){var be=[e.rowAttributes];return(se.value||he.value)&&be.push(function(ve){var Fe=ve.row;return{"data-id":H(Fe,e.rowKey||"id")}}),be.filter(function(ve){return ve})});yt(function(){X(i.value),qe(i.value)}),a.expose({validateRowData:Tn,validateTableData:re,clearValidateData:G,refreshTable:function(){i.value.refreshTable()},scrollToElement:function(ve){i.value.scrollToElement(ve)},scrollColumnIntoView:function(ve){i.value.scrollColumnIntoView(ve)},baseTableRef:i});var Ae=function(ve){var Fe;(Fe=e.onRowEdit)===null||Fe===void 0||Fe.call(e,ve);var Je=H(ve.editedRow,e.rowKey||"id");Z(Je,ve.row,z({},ve.col.colKey,ve.valu
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var qs={beforeDragSort:{type:Function},expandedTreeNodes:{type:Array,default:void 0},defaultExpandedTreeNodes:{type:Array,default:function(){return[]}},tree:{type:Object},treeExpandAndFoldIcon:{type:Function},onAbnormalDragSort:Function,onExpandedTreeNodesChange:Function,onTreeExpandChange:Function};/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Oo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function sa(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Oo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Oo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ro={code:1001,reason:"The same level of rows can not be swapped."};function Ft(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=H(t,e);return a||n?"".concat(r,"_").concat(a||0,"_").concat(n||0,"}"):r}var Js=function(){function t(){ei(this,t),z(this,"treeDataMap",new Map),z(this,"expandAllRowIndex",void 0),this.treeDataMap=new Map}return Ql(t,[{key:"initialTreeStore",value:function(a,n,r){var o;(o=this.treeDataMap)===null||o===void 0||o.clear(),this.initialTreeDataMap(this.treeDataMap,a,n.find(function(l){return l.colKey==="row-select"}),r)}},{key:"getAllUniqueKeys",value:function(a,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=a.length;o<l;o++){var i=a[o];r.push(Ft(i,n.rowKey));var u=H(i,n.childrenKey);u!=null&&u.length&&this.getAllUniqueKeys(u,n,r)}return r}},{key:"getExpandedChildrenKeys",value:function(a,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o=0,l=a.length;o<l;o++){var i=a[o],u=Ft(i,n.rowKey),s=this.treeDataMap.get(u);s.expanded&&r.push(u);var v=H(i,n.childrenKey);v!=null&&v.length&&this.getExpandedChildrenKeys(v,n,r)}return r}},{key:"expandTreeNode",value:function(a,n,r){var o=this;return a.length&&a.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},n,r,"expand")}),n}},{key:"foldTreeNode",value:function(a,n,r){var o=this;return a.length&&a.forEach(function(l){var i=o.treeDataMap.get(l);!i||o.toggleExpandData({row:i.row,rowIndex:i.rowIndex},n,r,"fold")}),n}},{key:"toggleExpandData",value:function(a,n,r,o){var l;if(!a)return Be.error("EnhancedTable","the node toggleExpanded doest not exist in `data`"),n;var i=H(a.row,r.rowKey);if(xn(i))return Be.error("EnhancedTable","`rowKey` could be wrong, can not get rowValue from `data` by `rowKey`."),[];var u=H(a.row,r.childrenKey);if(u===!0)return n;var s=this.treeDataMap.get(i);return o==="expand"&&s.expanded||o==="fold"&&!s.expanded?n:(s.rowIndex=(l=s.rowIndex)!==null&&l!==void 0?l:a.rowIndex,s.expanded=!s.expanded,this.treeDataMap.set(i,s),this.updateExpandRow(s,n,r))}},{key:"updateExpandRow",value:function(a,n,r){var o=a.row,l=a.rowIndex,i=a.expanded,u=this.treeDataMap,s=H(o,r.childrenKey);if(!o||!s)return n;if(i)nr(u,a,i,r),bn(u,o,s.length,"expand",r),n.splice.apply(n,[l+1,0].concat(s));else{nr(u,a,i,r);var v=a.expandChildrenLength||s.length;bn(u,o,-1*v,"fold",r),n.splice(l+1,v)}return on(u,n,{rowKey:r.rowKey,minRowIndex:l+1}),n}},{key:"getData",value:function(a){return this.treeDataMap.get(a)}},{key:"updateData",value:function(a,n,r,o){var l=Ft(n,o.rowKey),i=this.treeDataMap.get(a);if(!i||i.rowIndex===-1)return jl(r,a,n,{rowKey:o.rowKey,childrenKey:o.childrenKey}),-1;if(H(n,o.childrenKey)===!0){var u=H(i.row,o.childrenKey);if(u!=null&&u.length)for(var s=0,v=u.length;s<v;s++){var d=Ft(u[s],o.rowKey),b=this.treeDataMap.get(d);b&&this.treeDataMap.delete(d)}}var p=i.rowIndex;if(i.row=n,i.id=l,i.parent){var w=H(i.parent.row,o.childrenKey),y=w.findIndex(function(S){return Ft(S,o.rowKey)===a});w[y]=n}return this.treeDataMap.set(l,i),a!==l&&this.treeDataMap.delete(a),p}},{key:"remove",value:function(a,n,r){var o=this.treeDataMap.get(a);if(o&&o.rowIndex>=0){var l=(o.expandChildrenLength||0)+1;if(n.splice(o.rowIndex,l),o.parent){var i=H(o.parent.row,r.childrenKey),u=i.findIndex(function(s){return H(s,r.rowKey)===a});i.splice(u,1),bn(this.treeDataMap,o.parent.row,-1*l,"delete",r)}this.treeDataMap.delete(a),on(this.treeDat
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Eo(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function $a(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Eo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Eo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Qs(t,e){var a=e.store,n=e.dataSource,r=e.rowDataKeys,o=Ke(t),l=o.data,i=o.expandedTreeNodes,u=o.tree,s=W(!1),v=W(!1),d=kt(i,t.defaultExpandedTreeNodes,t.onExpandedTreeNodesChange,"expandedTreeNodes"),b=Pe(d,2),p=b[0],w=b[1],y=W({type:"props-change"});function S(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"expand-all",A=arguments.length>1?arguments[1]:void 0,T=A||l.value;n.value=a.value.expandAll(T,r.value);var F=n.value.map(function(P){return Ft(P,r.value.rowKey)});w(F,{row:void 0,rowState:void 0,rowIndex:void 0,type:"expand",trigger:j}),y.value.type="expand-all"}function x(){n.value=fe(a.value.foldAll(n.value,r.value)),w([],{row:void 0,rowState:void 0,rowIndex:void 0,type:"fold",trigger:"fold-all"})}function R(j,A){var T,F=j.row,P=j.rowIndex;y.value=$a({type:"user-reaction-change"},j);var K=Ft(F,r.value.rowKey),D=a.value.treeDataMap.get(K),m=fe(p.value);if(D.expanded){for(var h=a.value.getExpandedChildrenKeys([F],r.value),g=0,c=m.length;g<c;g++){var f=m[g];h.includes(f)&&(m[g]=void 0)}m=m.filter(Boolean)}else m.push(K);var C={row:F,rowIndex:P,rowState:D,trigger:A};w(m,$a($a({},C),{},{type:D.expanded?"fold":"expand"})),(T=t.onTreeExpandChange)===null||T===void 0||T.call(t,C)}function O(j,A){var T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],F=Zs(A,T),P=F.addedList,K=F.removedList;return a.value.expandTreeNode(P,j,r.value),a.value.foldTreeNode(K,j,r.value),fe(j)}de([p,l],function(j,A){var T=Pe(j,1),F=T[0],P=Pe(A,1),K=P[0];if(!(!a.value.treeDataMap.size||!l.value.length)){if(y.value.type==="user-reaction-change"){var D=y.value||{},m=D.row,h=D.rowIndex;n.value=fe(a.value.toggleExpandData({row:m,rowIndex:h},fe(n.value),r.value))}else y.value.type==="props-change"&&O(n.value,F,K);y.value.type="props-change"}});var _=function(A){var T,F;(T=u.value)!==null&&T!==void 0&&T.defaultExpandAll&&!s.value?(S("default-expand-all",fe(A)),s.value=!0):(F=p.value)!==null&&F!==void 0&&F.length&&Gt(function(){n.value=O(fe(A),p.value,[])})};return{tExpandedTreeNode:p,isDefaultExpandAllExecute:s,isDefaultExpandedTreeNodesExecute:v,expandAll:S,foldAll:x,onExpandFoldIconClick:R,updateExpandOnDataChange:_}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Do(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function vt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Do(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Do(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function ec(t,e){var a=Ke(t),n=a.data,r=a.columns,o=ht("table",t.locale),l=o.t,i=o.globalConfig,u=En({AddRectangleIcon:xi,MinusRectangleIcon:Ii}),s=u.AddRectangleIcon,v=u.MinusRectangleIcon,d=W(new Js),b=ui(),p=W([]),w=ot(),y=w.tableTreeClasses,S=Un(),x=N(function(){var B;return{rowKey:t.rowKey||"id",childrenKey:((B=t.tree)===null||B===void 0?void 0:B.childrenKey)||"children"}}),R=Qs(t,{store:d,dataSource:p,rowDataKeys:x}),O=R.tExpandedTreeNode,_=R.isDefaultExpandAllExecute,j=R.isDefaultExpandedTreeNodesExecute,A=R.expandAll,T=R.foldAll,F=R.updateExpandOnDataChange,P=R.onExpandFoldIconClick,K=N(function(){return r.value.find(function(B){return B.colKey==="row-select"})});de(K,function(B){!d.value||d.value.updateDisabledState(p.value,B,x.value)});var D=function(X){var Q=vt(vt({},X),{},{type:"fold"}),q=l(i.value.treeExpandAndFoldIcon,Ye,Q)||L(v,null,null);return S("treeExpandAndFoldIcon",{defaultNode:q,params:Q})},m=function(X){var Q=vt(vt({},X),{},{type:"expand"}),q=l(i.value.treeExpandAndFoldIcon,Ye,Q)||L(s,null,null);return S("treeExpandAndFoldIcon",{defaultNode:q,params:Q})};de([n],function(){t.tree?h(n.value):p.value=n.value},{immediate:!0}),ko(function(){var B;!t.tree||((B=d.value.treeDataMap)===null||B===void 0||B.clear(),d.value=null)}),de(function(){var B;return[r,(B=t.tree)===null||B===void 0?void 0:B.treeNodeColumnIndex]},function(){b.value=f()},{immediate:!0});function h(B){var X,Q=t.columns,q=t.expandedTreeNodes,se=t.defaultExpandedTreeNodes,he=t.tree;d.value.initialTreeStore(B,Q,x.value);var Le=Boolean(!j.value&&(se==null?void 0:se.length)),Ve=Boolean((he==null?void 0:he.defaultExpandAll)&&!_.value);(X=O.value)!==null&&X!==void 0&&X.length&&!!(q||Le)||Ve?(F(B),j.value=!0):p.value=fe(B)}function g(B){var X,Q;if(B!==void 0){var q=((X=t.tree)===null||X===void 0?void 0:X.indent)===void 0?24:(Q=t.tree)===null||Q===void 0?void 0:Q.indent;return q?{paddingLeft:"".concat(B*q||1,"px")}:{}}}function c(B,X){var Q,q,se=vt({},B);B.row.VIRTUAL_SCROLL_INDEX!==void 0&&(se.rowIndex=B.row.VIRTUAL_SCROLL_INDEX),p.value=fe(d.value.toggleExpandData(se,p.value,x.value));var he=H(B.row,x.value.rowKey),Le=(Q=d.value)===null||Q===void 0||(Q=Q.treeDataMap)===null||Q===void 0?void 0:Q.get(he);(q=t.onTreeExpandChange)===null||q===void 0||q.call(t,{row:B.row,rowIndex:B.rowIndex,rowState:Le,trigger:X})}function f(){for(var B,X=t.columns,Q=((B=t.tree)===null||B===void 0?void 0:B.treeNodeColumnIndex)||0;(q=X[Q])!==null&&q!==void 0&&q.type||((se=X[Q])===null||se===void 0?void 0:se.colKey)==="__EXPAND_ROW_ICON_COLUMN__";){var q,se;Q+=1}return X[Q]}function C(B){if(!t.tree||B.colKey!==b.value.colKey)return B;var X=vt({},b.value);return X.cell=function(Q,q){var se=ma(vt(vt({},q),{},{col:vt({},b.value)}),e.slots,{cellEmptyContent:t.cellEmptyContent}),he=d.value.treeDataMap.get(H(q.row,x.value.rowKey)),Le=g(he==null?void 0:he.level),Ve=z({},y.inlineCol,!!B.ellipsis),qe=H(q.row,x.value.childrenKey);if(qe&&qe instanceof Array||qe===!0){var Ne,lt=(Ne=d.value.treeDataMap.get(H(q.row,x.value.rowKey)))!==null&&Ne!==void 0&&Ne.expanded?D(q):m(q);return L("div",{class:[y.col,Ve],style:Le},[!!(qe.length||qe===!0)&&L("span",{class:y.icon,onClick:function(it){P(q,"expand-fold-icon"),it.stopPropagation()}},[lt]),se])}return L("div",{style:Le,class:[Ve,y.leafNode]},[L("span",{class:y.icon},null),se])},X.ellipsis===!0&&(X.ellipsis=function(Q,q){return ma(vt(vt({},q),{},{col:vt({},b.value)}),e.slots)}),X}function E(B,X){var Q=d.value.updateData(B,X,p.value,x.value),q=fe(p.value);q[Q]=X,p.value=q
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function _o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function ca(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_o(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_o(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var ar=new Map;function kn(t,e,a,n){if(ar.get(e))return ar.get(e);var r=n||{allChildren:[],allChildrenKeys:[],leafNodeKeys:[]},o=H(e,a.childrenKey);if(!o||!o.length)return r;var l=o.filter(function(x){var R;return!((R=t.get(H(x,a.rowKey)))!==null&&R!==void 0&&R.disabled)});r.allChildren=fe(new Set(r.allChildren.concat(l)));for(var i=0,u=o.length;i<u;i++){var s=o[i],v=H(s,a.childrenKey);if(v!=null&&v.length){var d=kn(t,s,a,r);r.allChildren=fe(new Set(r.allChildren.concat(d.allChildren)))}}for(var b=0,p=r.allChildren.length;b<p;b++){var w=r.allChildren[b],y=H(w,a.childrenKey),S=H(w,a.rowKey);r.allChildrenKeys.push(S),(!y||!y.length)&&r.leafNodeKeys.push(S)}return r.allChildrenKeys=fe(new Set(r.allChildrenKeys)),r.leafNodeKeys=fe(new Set(r.leafNodeKeys)),r}function tc(t,e){for(var a=t.selectedRowKeys,n=t.removeKeys,r=e||{data:[],keys:[]},o=0,l=a.length;o<l;o++){var i=a[o];n.includes(i)||r.keys.push(i)}return r}function nc(t){for(var e=t.treeDataMap,a=t.selectedRowKeys,n=[],r=0,o=a.length;r<o;r++){var l=a[r];n.push(e.get(l))}return n}function ac(t,e){var a=Ke(t),n=a.selectedRowKeys,r=a.tree,o=a.data,l=a.indeterminateSelectedRowKeys,i=W([]),u=kt(n,t.defaultSelectedRowKeys||[],t.onSelectChange,"selectedRowKeys"),s=Pe(u,2),v=s[0],d=s[1],b=N(function(){var R;return{rowKey:t.rowKey||"id",childrenKey:((R=t.tree)===null||R===void 0?void 0:R.childrenKey)||"children"}});de([r,e,o,v],function(R){var O=Pe(R,2),_=O[0],j=O[1];!_||!j.size||_.checkStrictly||p()});function p(){if(!(!r.value||r.value.checkStrictly)){if(!v.value.length){i.value=[];return}for(var R=[],O={},_=0,j=v.value.length;_<j;_++){var A=v.value[_],T=e.value.get(A);if(!!T){var F=H(T.row,b.value.childrenKey);if(!F||!F.length)for(var P=T.parent;P;){O[P.id]||(O[P.id]=[]),O[P.id].push(T.row);var K=O[P.id].length,D=kn(e.value,P.row,b.value),m=D.allChildrenKeys,h=R.indexOf(P.id),g=v.value.indexOf(P.id);K>0&&K<m.length&&g===-1?h===-1&&R.push(P.id):h!==-1&&R.splice(h,1),P=P.parent}}}i.value=R}}function w(R,O,_){if(!(!r.value||r.value.checkStrictly)){for(var j=fe(R),A=e.value.get(O),T=A.parent;T;){var F=kn(e.value,T.row,b.value),P=F.leafNodeKeys,K=ba(P,R),D=j.indexOf(T.id);_==="uncheck"?D!==-1&&j.splice(D,1):K.length===P.length&&D===-1&&j.push(T.id),T=T.parent}return j}}function y(R,O){if(!r.value||r.value.checkStrictly){d(R,O);return}O.currentRowKey==="CHECK_ALL_BOX"?S(O):x(R,O)}function S(R){var O=[],_=[];if(R.type==="check")for(var j=fe(e.value.values()),A=0,T=j.length;A<T;A++){var F=j[A];F.disabled||(_.push(F.row),O.push(H(F.row,b.value.rowKey)))}var P=ca(ca({},R),{},{selectedRowData:_||[]});d(O,P)}function x(R,O){var _,j=fe(R);if(((_=t.tree)===null||_===void 0?void 0:_.checkStrictly)===!1){if((O==null?void 0:O.type)==="check"){var A=kn(e.value,O.currentRowData,b.value),T=A.allChildrenKeys;ar.set(O.currentRowData,A),j=fe(new Set(j.concat(T)))}else if((O==null?void 0:O.type)==="uncheck"){var F=kn(e.value,O.currentRowData,b.value),P=tc({selectedRowKeys:R,removeKeys:F.allChildrenKeys});j=P.keys}}j=w(j,O.currentRowKey,O.type);var K=nc({treeDataMap:e.value,selectedRowKeys:j}),D=ca(ca({},O),{},{selectedRowData:K});d(j,D)}return{tIndeterminateSelectedRowKeys:l.value?l:i,onInnerSelectChange:y}}/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var rc=["store","dataSource","formatTreeColumn","swapData","onExpandFoldIconClick"];function To(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Dt(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?To(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):To(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var oc=ze({name:"TEnhancedTable",props:Dt(Dt(Dt({},On),hl),qs),setup:function(e,a){var n=W(null),r=ec(e,a),o=r.store,l=r.dataSource,i=r.formatTreeColumn,u=r.swapData,s=r.onExpandFoldIconClick,v=Zo(r,rc),d=Kt(),b=W(o.value.treeDataMap),p=ac(e,b),w=p.tIndeterminateSelectedRowKeys,y=p.onInnerSelectChange,S=function A(T){for(var F=[],P=0,K=T.length;P<K;P++){var D,m,h=Dt({},T[P]);h=i(h),(D=h.children)!==null&&D!==void 0&&D.length&&(h.children=A(h.children)),(!h.children||(m=h.children)!==null&&m!==void 0&&m.length)&&F.push(h)}return F},x=N(function(){var A=!e.tree||!Object.keys(e.tree).length;return A?e.columns:S(e.columns)}),R=function(T){var F;e.beforeDragSort&&!e.beforeDragSort(T)||(u({current:T.current,target:T.target,currentIndex:T.currentIndex,targetIndex:T.targetIndex}),(F=e.onDragSort)===null||F===void 0||F.call(e,T))},O=function(T){var F,P;(F=e.tree)!==null&&F!==void 0&&F.expandTreeNodeOnClick&&s({row:T.row,rowIndex:T.index},"row-click"),(P=e.onRowClick)===null||P===void 0||P.call(e,T)},_=function A(T,F){if(!T)return-1;if(T.rowIndex>=0)return T.rowIndex;if(T.rowIndex<0)return A(T.parent)},j=function(T){var F=T.index;if(!F&&F!==0){if(!T.key){Be.error("Table","scrollToElement: one of `index` or `key` must exist.");return}var P=b.value.get(T.key);F=_(P,T.key),(F<0||F===void 0)&&Be.error("Table","".concat(T.key," does not exist in data, check `rowKey` or `data` please."))}n.value.scrollToElement(Dt(Dt({},T),{},{index:F}))};return a.expose(Dt(Dt({store:o.value,dataSource:l.value},v),{},{primaryTableRef:n,validateRowData:function(T){return n.value.validateRowData(T)},validateTableData:function(){return n.value.validateTableData()},clearValidateData:function(){n.value.clearValidateData()},refreshTable:function(){n.value.refreshTable()},scrollToElement:j})),function(){var A,T=Mo(),F=T.vnode,P=Dt(Dt({},F.props),{},{rowKey:e.rowKey||"id",data:l.value,columns:x.value,indeterminateSelectedRowKeys:w.value,disableDataPage:Boolean(e.tree&&Object.keys(e.tree).length),onSelectChange:y,onDragSort:R,rowClassName:function(D){var m=D.row,h=H(m,e.rowKey||"id"),g=b.value.get(h);return g?["".concat(d.value,"-table-tr--level-").concat(g.level),e.rowClassName]:[e.rowClassName]}});return(A=e.tree)!==null&&A!==void 0&&A.expandTreeNodeOnClick&&(P.onRowClick=O),L(hr,Ie(P,{ref:n}),a.slots)}}});/**
|
|
|
|
* tdesign v1.9.4
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/qt(fl);qt(hr);qt(oc);var lc=rr(hr),fc=qt(lc,"TTable");export{vc as M,fc as T};
|