2024-10-11 09:19:39 +00:00
|
|
|
import{P as sn,Q as cn,S as dn,b as It,i as Yt,a3 as Re,az as Se,aA as Nl,aB as Te,w as qt,aj as Ao,ai as Ml,ak as Bl,al as jo,n as Pe,g as ve,e as zl,c as Fo,f as z,m as Lt,h as Ko,aq as Un,l as Io,aC as Pa,aD as Hl,p as vt,aE as Wl,as as Ua,aF as $l,aG as Lo,ah as Vl,a1 as H,aH as Ul,aI as Xl,aJ as Gl,am as Yl,d as gt,U as ql,Y as Xa,aK as Jl,aL as br,aM as Zl,ac as ko,Z as _n,aN as Ql,O as pa,k as Aa,a5 as ei,aO as ti,a2 as lr,ar as ni,aP as ai,aQ as ri}from"./index.9d6da31d.js";import{d as He,c as N,j as W,w as ce,o as pt,bP as oi,bQ as li,b as Ra,aI as k,n as Gt,t as Ie,i as mr,aV as Ke,bA as ii,u as ui,x as si,y as ci,aY as No,p as Mo,r as Xn,h as Ye,aU as vn,aZ as di,g as Bo,s as vi}from"./arco.9755215d.js";import{_ as zo,b as Ho,o as Wo,c as wr,t as $o,p as xn,P as fi,d as Vo,u as kt,A as Uo,e as Xo,f as Ga,g as yr,E as Go,h as Yo,i as qo,j as hi,k as ba,C as Ya,a as Jo,l as gi}from"./dep-71c4f289.efb2c598.js";import{d as ir,T as Zo,u as pi,a as bi,P as mi}from"./index.f3cc6098.js";import{i as Sn,b as Qo,_ as el,d as wi,l as ze,I as yi}from"./index.3871c524.js";import{_ as qa,r as yn,i as Ci,s as $n,v as tl}from"./form-model.539cba92.js";function Cr(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 xr(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Cr(Object(a),!0).forEach(function(n){dn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Cr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var xi={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"}}]},Si=He({name:"AddRectangleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=sn(n),l=N(()=>["t-icon","t-icon-add-rectangle",r.value]),i=N(()=>xr(xr({},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()=>cn(xi,u.value)}});const Oi=Si;function Sr(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 Or(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Sr(Object(a),!0).forEach(function(n){dn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Sr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var Ri={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"}}]},Ei=He({name:"ChevronRightCircleIcon",props:{size:{type:String},onClick:{type:Function}},setup(t,e){var{attrs:a}=e,n=N(()=>t.size),{className:r,style:o}=sn(n),l=N(()=>["t-icon","t-icon-chevron-right-circle",r.value]),i=N(()=>Or(Or({},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()=>cn(Ri,u.value)}});const _i=Ei;function Rr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Er(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Rr(Object(a),!0).forEach(function(n){dn(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Rr(Object(a)).forEach
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Hi={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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Wi=He({name:"TAffix",props:Hi,emits:["fixedChange"],setup:function(e,a){var n,r=It("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(),p=W(),b=0,w=function(){s.value||(b=window.requestAnimationFrame(function(){var O,S;b=0;var D=(O=(S=l.value)===null||S===void 0?void 0:S.getBoundingClientRect())!==null&&O!==void 0?O:{top:0,width:0,height:0},j=D.top,A=D.width,P=D.height,F=0;d.value instanceof HTMLElement&&(F=d.value.getBoundingClientRect().top);var T,I=j-F,_=d.value[d.value instanceof Window?"innerHeight":"clientHeight"]-P,m=F+_-e.offsetBottom;if(!Sn(e.offsetTop)&&I<=e.offsetTop?T=F+e.offsetTop:!Sn(e.offsetBottom)&&j>=m?T=m:T=!1,i.value){var h=T!==!1,g=l.value.contains(u.value);h?(i.value.className=r.value,p.value={top:"".concat(T,"px"),width:"".concat(A,"px"),height:"".concat(P,"px"),zIndex:e.zIndex},g||(u.value.style.width="".concat(A,"px"),u.value.style.height="".concat(P,"px"),l.value.appendChild(u.value))):(i.value.removeAttribute("class"),p.value=void 0,g&&u.value.remove()),a.emit("fixedChange",h,{top:Number(T)}),Re(e.onFixedChange)&&e.onFixedChange(h,{top:Number(T)})}s.value=!1}),s.value=!0)},y=function(){var C=qa(yn.mark(function O(){return yn.wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Gt();case 2:if(!v.value){D.next=4;break}return D.abrupt("return");case 4:d.value=Nl(e.container),Te(d.value,"scroll",w),Te(window,"resize",w),v.value=!0;case 8:case"end":return D.stop()}},O)}));return function(){return C.apply(this,arguments)}}(),R=function(){!d.value||!v.value||(Se(d.value,"scroll",w),Se(window,"resize",w),b&&window.cancelAnimationFrame(b),v.value=!1)};return ce(function(){return e.offsetTop},function(){w()}),ce(function(){return e.offsetBottom},function(){w()}),ce(function(){return e.zIndex},function(){w()}),pt(y),oi(y),li(R),Ra(R),{affixWrapRef:l,affixRef:i,bindScroll:y,unbindScroll:R,handleScroll:w,scrollContainer:d,renderTNodeJSX:o,affixStyle:p}},render:function(){return k("div",{ref:"affixWrapRef"},[k("div",{ref:"affixRef",style:this.affixStyle},[this.renderTNodeJSX("default")])])}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Zn=qt(Wi);/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var $i=Ao,Vi=zo,Ui=Ho,Xi=Ml,Gi=Bl,Yi=jo,qi=200;function Ji(t,e,a,n){var r=-1,o=Vi,l=!0,i=t.length,u=[],s=e.length;if(!i)return u;a&&(e=Xi(e,Gi(a))),n?(o=Ui,l=!1):e.length>=qi&&(o=Yi,l=!1,e=new $i(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 p=s;p--;)if(e[p]===d)continue e;u.push(v)}else o(e,d,n)||u.push(v)}return u}var Zi=Ji;/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var nl={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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var al=Symbol("RadioGroupProvide"),rl=Symbol("RadioButtonProvide");/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 Qi(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 eu(t){var e={};return Object.keys(t).forEach(function(a){Sn(t[a])||(e[a]=t[a])}),e}var ur=He({name:"TRadio",inheritAttrs:!1,props:Qi({},nl),setup:function(e,a){var n=a.attrs,r=W(),o=Ie(e),l=o.checked,i=o.modelValue,u=Qo(l,i,e.defaultChecked,e.onChange,"checked"),s=Pe(u,2),v=s[0],d=s[1],p=N(function(){return b?e.value===b.value:v.value}),b=mr(al,void 0),w=N(function(){return Boolean(e.allowUncheck||(b==null?void 0:b.allowUncheck))}),y=function(c){c.stopPropagation()},R=function(c){var f;if(!(D.value||e.readonly)&&((f=e.onClick)===null||f===void 0||f.call(e,{e:c}),!(p.value&&!w.value)))if(b){var x=p.value&&w.value?void 0:e.value;b.setValue(x,{e:c})}else{var E=w.value?!p.value:!0;d(E,{e:c})}},C=N(function(){return eu({focus:n.onFocus,blur:n.onBlur,keydown:n.onKeydown,keyup:n.onKeyup,keypresss:n.onKeypresss})}),O=N(function(){var g=[].concat(ve(Object.keys(C.value)),["input","change"]).map(function(c){return"on".concat(c[0].toUpperCase()).concat(c.slice(1))});return Wo(n,g)}),S=N(function(){return b==null?void 0:b.disabled}),D=zl({afterDisabled:S}),j=N(function(){return{name:b?b.name:e.name,checked:p.value,disabled:D.value,readonly:e.readonly,value:e.value}}),A=Fo(),P=A.STATUS,F=mr(rl,void 0),T=It("radio-button"),I=It("radio"),_=N(function(){return F?T.value:I.value}),m=N(function(){return["".concat(_.value),z(z({},P.value.checked,j.value.checked),P.value.disabled,j.value.disabled)]}),h=Ko();return function(){return k("label",Ke({ref:r,class:m.value},O.value,{tabindex:D.value?void 0:"0",onClick:R}),[k("input",Ke({type:"radio",class:"".concat(_.value,"__former")},C.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),k("span",{class:"".concat(_.value,"__input")},null),k("span",{class:"".concat(_.value,"__label")},[h("default","label")])])}}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var tu={allowUncheck:Boolean,disabled:{type:Boolean,default:void 0},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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function nu(t,e){var a=function(r){var o=wr.test(r.key)||wr.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})}}};pt(function(){Te(t.value,"keydown",a)}),ii(function(){Se(t.value,"keydown",a)})}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var au=["window"],ru=typeof window<"u"?window:void 0;function ou(t){var e,a=ui(t);return(e=a==null?void 0:a.$el)!==null&&e!==void 0?e:a}function lu(t){return si()?(ci(t),!0):!1}function iu(t,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=a.window,r=n===void 0?ru:n,o=el(a,au),l,i=r&&"MutationObserver"in r,u=function(){l&&(l.disconnect(),l=void 0)},s=ce(function(){return ou(t)},function(d){u(),i&&r&&d&&(l=new MutationObserver(e),l.observe(d,o))},{immediate:!0}),v=function(){u(),s()};return lu(v),{isSupported:i,stop:v}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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}var uu=He({name:"TRadioGroup",props:ja({},tu),setup:function(e){var a=Ie(e),n=a.value,r=a.modelValue,o=Qo(n,r,e.defaultValue,e.onChange),l=Pe(o,2),i=l[0],u=l[1],s=W(),v=It("radio-button"),d=Fo(),p=d.STATUS,b=d.SIZE;nu(s,u);var w=N(function(){return".".concat(v.value,".").concat(p.value.checked)}),y=W({width:"0px",height:"0px",left:"0px",top:"0px","transition-property":"none"}),R=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,x=h.offsetTop;y.value=ja(ja({},y.value),{},{width:"".concat(g,"px"),height:"".concat(c,"px"),left:"".concat(f,"px"),top:"".concat(x,"px")}),document.body.removeChild(m)},C=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,x=h.offsetLeft,E=h.offsetTop;c?y.value={"transition-property":g,width:"".concat(c,"px"),height:"".concat(f,"px"),left:"".concat(x,"px"),top:"".concat(E,"px")}:R()}},O;ce(i,qa(yn.mark(function _(){return yn.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,Gt();case 2:C();case 3:case"end":return h.stop()}},_)}))),pt(function(){C(!0),wi(s,$o(qa(yn.mark(function m(){return yn.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,Gt();case 2:C();case 3:case"end":return g.stop()}},m)})),300));var _=s.value.querySelector("".concat(w.value," .").concat(v.value,"__label"));_&&(O=iu(_,function(m){m.forEach(function(h){h.type==="characterData"&&C()})},{attributes:!0,childList:!0,characterData:!0,subtree:!0}))}),No(function(){var _;(_=O)===null||_===void 0||_.stop()});var S=Ie(e),D=S.name,j=S.disabled;Mo(al,Xn({name:D,disabled:j,value:i,allowUncheck:e.allowUncheck,setValue:u}));var A=It("radio-group"),P=Un(),F=function(){if(e.variant.includes("filled")&&!Ci(i.value))return k("div",{style:y.value,class:"".concat(A.value,"__bg-block")},null)},T=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()}),k(ur,{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]}})})},I=N(function(){return["".concat(A.value),b.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 k("div",{ref:s,class:I.value},[P("default")||T(),F()])}}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 Fa(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 su(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var cu=He({name:"TRadioButton",inheritAttrs:!1,props:Fa({},nl),setup:function(e,a){var n=a.attrs;Mo(rl,Xn({}));var r=N(function(){var l=Fa(Fa({},e),Wo(n,Object.keys(n).filter(function(i){return i.startsWith("on")})));return l}),o=Ko();return function(){var l;return k(ur,r.value,su(l=o("default","label"))?l:{default:function(){return[l]}})}}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var du=qt(ur),vu=qt(uu);qt(cu);/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Rn={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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ol(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=ol(i.children,e,a+1);u>n&&(n=u)}}return n}function ll(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=ll(l,a):a+=1}return a}function fu(t){var e=new Map,a=ol(t,e),n=new Map,r=function(i,u){for(var s=0,v=i.length;s<v;s++){var d,p=i[s],b=p.children?1:a-e.get(p)+1,w=p.children?ll(p):1,y={};b>1&&(y.rowspan=b),w>1&&(y.colspan=w),n.set(p,y),p!=null&&(d=p.children)!==null&&d!==void 0&&d.length?r(p.children,u):u.push(p)}},o=[];return r(t,o),{rowspanAndColspanMap:n,leafColumns:o}}function hu(t){var e=function(r,o){for(var l,i=[],u=[],s=0,v=r.length;s<v;s++){var d,p=r[s],b=[p];i=i.concat(b),p!=null&&(d=p.children)!==null&&d!==void 0&&d.length&&(u=u.concat(p.children))}return(l=u)!==null&&l!==void 0&&l.length&&e(u,o),o.push(i),i},a=[];return e(t,a),a=a.reverse(),a}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function it(){var t=It(),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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/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 gu(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 pu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var sr=He({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=W(!1),o=N(function(){return["".concat(e.classPrefix,"-table__ellipsis"),"".concat(e.classPrefix,"-text-ellipsis")]}),l=N(function(){return["".concat(e.classPrefix,"-table__ellipsis-content"),e.overlayClassName]});pt(function(){r.value=Pa(a.value)});var i=function(){!a.value||(r.value=Pa(a.value),n.value=!0)},u=function(){!a.value||(r.value=Pa(a.value))},s=ir(function(v){v.type==="mouseleave"?u():i()},80);return{flag:n,root:a,isOverflow:r,ellipsisClasses:o,innerEllipsisClassName:l,onMouseAround:s}},render:function(){var e=Hl(this,"default","content"),a=k("div",{ref:"root",class:this.ellipsisClasses,onMouseenter:this.onMouseAround,onMouseleave:this.onMouseAround,style:{textOverflow:this.isOverflow?"ellipsis":"clip"}},[e]),n=null,r=this.tooltipProps;if(this.isOverflow&&this.flag){var o=gu({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=k(Zo,o,pu(a)?a:{default:function(){return[a]}})}else n=a;return n}});/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Mr(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 Br(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Mr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Mr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function bu(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(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,Br(Br({},n),{},{type:"title",row:{},rowIndex:-1}))||e.title}function il(t){var e=it(),a=e.tableSortClasses,n=e.tableFilterClasses,r=N(function(){return fu(t.columns)}),o=N(function(){return hu(t.columns)}),l=N(function(){return o.value.length>1}),i=function(s,v,d,p,b,w){var y=Pe(s,3),R=y[0],C=y[1],O=y[2],S=z(z({},a.sortable,C),n.filterable,O),D=Re(p)?p(Ye,{col:v,colIndex:d}):void 0,j=Boolean(p!==void 0?p:v.ellipsis);return k("div",{class:S},[k("div",{class:a.title},[j?k(sr,{placement:"bottom",attach:t.attach||(b?function(){return b}:void 0),tooltipContent:D&&function(){return D},tooltipProps:vt(p)==="object"?p:void 0,classPrefix:w==null?void 0:w.classPrefix,overlayClassName:w==null?void 0:w.ellipsisOverlayClassName},bu(R)?R:{default:function(){return[R]}}):k("div",null,[R]),Boolean(C||O)&&k("div",{class:n.iconWrap},[C,O])])])};return{thList:o,isMultipleHeader:l,spansAndLeafNodes:r,renderTitleWidthIcon:i}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function zr(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 mu(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?zr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):zr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var wu=80,yu=600,Hr=8;function Cu(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([]),p,b;pt(function(){var m=typeof document<"u";p=m?document.onselectstart:null,b=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(h,g){!h||(d.value=h,h.forEach(function(c,f){var x=w(h,f-1,"prev"),E=w(h,f+1,"next"),L=g?v.value[g.colKey].prev:E,K=g?v.value[g.colKey].next:x,B=f===0?L:x,$=f===h.length-1?K:E;v.value[c.colKey]={prev:B,next:$,current:{prevSibling:w(h,f-1,"prev"),nextSibling:w(h,f+1,"next")}},y(c.children,c)}))},R={isDragging:!1,draggingCol:null,draggingStart:0,effectCol:"next"},C=Xn({display:"none",height:"10px",left:"10px",bottom:"0"}),O=function(h){return h.fixed==="right"&&n.right},S=function(h,g){if(!(!s.value||R.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 x=c.getBoundingClientRect(),E=x.right-h.pageX<=Hr,L=h.pageX-x.left<=Hr,K=O(g);if(E||K){var B,$=(B=g.resizable)!==null&&B!==void 0?B:!0;if($){c.style.cursor=E||K&&L?"col-resize":"";var Y=E&&!K||K&&L;R.draggingCol=Y?c:c.nextElementSibling,R.effectCol="next";return}}else if(L){var ee=c.previousElementSibling;if(ee){var ae,ne,Q=(ae=v.value[g.colKey])===null||ae===void 0?void 0:ae.prev,M=(ne=Q==null?void 0:Q.resizable)!==null&&ne!==void 0?ne:!0;if(M){c.style.cursor="col-resize",R.draggingCol=ee,R.effectCol="prev";return}}}c.style.cursor="",R.draggingCol=null,R.effectCol=null}}},D=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)||wu,f),maxColWidth:((c=h.resize)===null||c===void 0?void 0:c.maxWidth)||yu}},j=function(h,g,c,f){var x=c.right-f.left,E=c.left-f.left,L=R.effectCol==="next"?h:g,K=D(L),B=K.minColWidth,$=K.maxColWidth;return{resizeLinePos:x,minResizeLineLeft:E+B,maxResizeLineLeft:E+$}},A=function(h,g,c,f,x){var E=f.left-x.left,L=h.dataset.colkey===g.colKey?g:c,K=f.left-x.left,B=D(L),$=B.minColWidth,Y=B.maxColWidth;return{resizeLinePos:E,minResizeLineLeft:K+(f.width-Y),maxResizeLineLeft:K+(f.width-$)}},P=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},T=function(h,g,c,f){var x=!0;if(g){var E=D(g),L=E.minColWidth,K=E.maxColWidth,B=h[g.colKey]+c;x=B<L||B>K}return!(x||e.value||f===d.value.length-1)},I=function(h,g,c,f){return g?j(h,g,c,f):P(c,f)},_=function(h,g,c){var f,x,E;if(!!R.draggingCol){var L=R.draggingCol,K=L.getBoundingClientRect(),B=(f=a.value)===null||f===void 0?void 0:f.getBoundingClientRect(),$=(x=v.value[g.colKey])===null||x===void 0?void 0:x.next,Y=(E=v.value[g.colKey])===null||E===void 0?void 0:E.prev,ee=O(g)?A(L,g,$,K,B):I(g,$,K,B),ae=ee.resizeLinePos,ne=ee.minResizeLineLeft,Q=ee.maxResizeLineLeft;if(R.isDragging=!0,R.draggingStart=h.x,s!=null&&s.value){C.display="block",C.height="".concat(B.bottom-K.top,"px"),C.left="".concat(ae,"px");var M=a.value.parentElement.getBoundingClientRect();C.bottom="".concat(M.bottom-B.bottom,"px")}var X=function(){var fe;if(!!R.isDragging){var he=ae-parseFloat(C.left)||0,Le=r("calculate"),We=(fe=v.value[g.colKey])===null||fe===void 0?void 0:fe.current;if(!!We){var qe=R.effectCol=
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function xu(){}var Su=xu,Ka=$l,Ou=Su,Ru=Lo,Eu=1/0,_u=Ka&&1/Ru(new Ka([,-0]))[1]==Eu?function(t){return new Ka(t)}:Ou,Du=_u,Tu=Ao,Pu=zo,Au=Ho,ju=jo,Fu=Du,Ku=Lo,Iu=200;function Lu(t,e,a){var n=-1,r=Pu,o=t.length,l=!0,i=[],u=i;if(a)l=!1,r=Au;else if(o>=Iu){var s=e?null:Fu(t);if(s)return Ku(s);l=!1,r=ju,u=new Tu}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 p=u.length;p--;)if(u[p]===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=Lu,Nu=Zi,Mu=Gl,Wr=ku;function Bu(t,e,a){var n=t.length;if(n<2)return n?Wr(t[0]):[];for(var r=-1,o=Array(n);++r<n;)for(var l=t[r],i=-1;++i<n;)i!=r&&(o[r]=Nu(o[r]||l,t[i],e,a));return Wr(Mu(o,1),e,a)}var zu=Bu,Hu=Ul,Wu=Vl,$u=zu,Vu=Yl,Uu=Xl,Xu=Wu(function(t){var e=Uu(t);return e=typeof e=="function"?e:void 0,$u(Hu(t,Vu),void 0,e)}),Gu=Xu;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 gn(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 cr(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 Yu(t,e,a,n,r,o){var l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0;if(!n||!n.length)return{style:void 0,classes:void 0};var i=e<n[0],u=e>a-1-n[1],s=a-n[1],v=(r==null?void 0:r.get(t))||{},d=z(z(z(z({},o.top,i),o.bottom,u),o.firstBottom,e===s),o.withoutBorderBottom,e===s-1),p={top:i?"".concat(v.top-l,"px"):void 0,bottom:u?"".concat(v.bottom+l,"px"):void 0};return{style:p,classes:d}}function qu(t,e,a,n){var r=Ie(t),o=r.columns,l=r.tableLayout,i=r.tableContentWidth,u=r.fixedRows,s=r.firstFullRow,v=r.lastFullRow,d=r.maxHeight,p=r.headerAffixedTop,b=r.footerAffixedBottom,w=r.bordered,y=r.resizable,R=r.allowResizeColumnWidth,C=W([]),O=W(),S=W(),D=W(!1),j=W(!1),A=W(),P=W(6),F=W(new Map),T=Xn({left:!1,right:!1}),I=W({left:0,top:0}),_=W(0),m=W(0),h=W({}),g=W(!1),c=W(!1),f=W(!1),x=N(function(){var re,V;return(re=(V=R.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 L(re){A.value=re}function K(re){for(var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Map,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],J=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 we=ue.colKey||le,Ee={col:ue,parent:te,index:le};V.set(we,Ee),(pe=ue.children)!==null&&pe!==void 0&&pe.length&&K(ue.children,V,G,J+1,Ee),G[J]?G[J].push(Ee):G[J]=[Ee]}return{newColumnsMap:V,levelNodes:G}}var B=function(V,G){for(var J=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),we=te-1;we>=0&&V[we].fixed!=="left";)we-=1;var Ee=V[we],Ae=te===0&&(J==null?void 0:J.left)||0,Me=G.get((Ee==null?void 0:Ee.colKey)||te-1);ue&&(ue.left=((Me==null?void 0:Me.left)||Ae)+((Me==null?void 0:Me.width)||0)),(ge=pe.children)!==null&&ge!==void 0&&ge.length&&B(pe.children,G,ue)}},$=function(V,G){for(var J=arguments.length>2&&arguments[2]!==void 0?arguments[
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 Ju(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 Zu(t,e){var a=Ie(t),n=a.pagination,r=a.data,o=a.disableDataPage,l=gt(),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,R=t.data,C=Boolean(!o.value&&R.length>y);if(v.value=C,C){var O=(w-1)*y,S=w*y;s.value=R.slice(O,S)}else s.value=R};ce(function(){var b,w;return[(b=n.value)===null||b===void 0?void 0:b.current,(w=n.value)===null||w===void 0?void 0:w.pageSize,r.value.length,o]},function(){if(!(!n.value||!n.value.current)){var b=n.value,w=b.current,y=b.pageSize;u.value={current:w,pageSize:y},d(n.value.current,n.value.pageSize)}},{immediate:!0}),ce([r],function(){var b,w;if(!(!n.value||!n.value.defaultCurrent)){var y=Boolean(n.value.current);y||d((b=u.value.current)!==null&&b!==void 0?b:n.value.defaultCurrent,(w=u.value.pageSize)!==null&&w!==void 0?w:n.value.defaultPageSize)}},{immediate:!0});var p=function(){if(!t.pagination)return null;var w=Ju({},t.pagination);return delete w.onChange,k("div",{class:"".concat(i.value,"-table__pagination")},[k(fi,Ke(w,{onChange:function(R){var C,O,S;(C=t.pagination)===null||C===void 0||(O=C.onChange)===null||O===void 0||O.call(C,R),u.value=R,d(R.current,R.pageSize),(S=t.onPageChange)===null||S===void 0||S.call(t,R,s.value)}}),{totalContent:e.slots.totalContent})])};return{isPaginateData:v,dataSource:s,innerPagination:u,renderPagination:p}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Qu(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}),p=N(function(){return!!(t.headerAffixedTop||t.footerAffixedBottom||t.horizontalScrollAffixedBottom)}),b=0,w=function(M){if(!(!p.value&&!d.value)){var X=M;if(!X&&e.value&&(b=0,X=e.value),!!X){var q=X.scrollLeft;if(b!==q){b=q;for(var Z=[e.value,a.value,n.value,r.value],fe=0,he=Z.length;fe<he;fe++)Z[fe]&&M!==Z[fe]&&(Z[fe].scrollLeft=q)}}}},y=function(M,X,q){return X.top+q<M.top&&M.top>M.height},R=function(M){return ql(M)?0:M.offsetTop||0},C=function(){var M,X,q;if(!(!p.value&&!d.value)){var Z=(M=e.value)===null||M===void 0?void 0:M.getBoundingClientRect(),fe=(X=e.value)===null||X===void 0||(X=X.querySelector("thead"))===null||X===void 0?void 0:X.getBoundingClientRect(),he=(fe==null?void 0:fe.height)||0,Le=(q=n.value)===null||q===void 0?void 0:q.getBoundingClientRect();if((t.headerAffixedTop||d.value)&&a.value){var We=R(t.headerAffixProps||t.headerAffixedTop),qe=(Le==null?void 0:Le.height)||0,Ne=Math.abs(Z.top)<Z.height-he-We-qe;d.value&&(Ne=Z.top>-1*fe.height),l.value=Ne}if(t.footerAffixedBottom&&n!==null&&n!==void 0&&n.value)i.value=y(Le,Z,he);else if(t.horizontalScrollAffixedBottom&&r!==null&&r!==void 0&&r.value){var nt=r.value.getBoundingClientRect();i.value=y(nt,Z,he)}if(t.paginationAffixedBottom&&o.value){var ut=o.value.getBoundingClientRect();u.value=y(ut,Z,he)}}},O=function(){C()},S=function(){w(n.value)},D=function(){w(a.value)},j=function(){w(r.value)},A=function(){w(e.value)},P=function(){Te(n.value,"scroll",S)},F=function(){Se(n.value,"scroll",S)},T=function(){Te(a.value,"scroll",D),x()},I=function(){s||Se(a.value,"scroll",D),E()},_=function(){Te(r.value,"scroll",j)},m=function(){Se(r.value,"scroll",j)},h=function(){Te(e.value,"scroll",A),x()},g=function(){s||Se(e.value,"scroll",A),E()},c=function(){s=!0},f=function(){s=!1,v||(Se(a.value,"scroll",D),Se(e.value,"scroll",A))},x=function(){v=!0},E=function(){v=!1},L=[],K=function(M){var X=ir(function(he){Se(M,"scroll",he)},200);function q(){w(M),X(q)}function Z(he){he.composedPath().includes(M)&&(L.forEach(function(Le){return Le()}),L.length=0,Te(M,"scroll",q),X(q),L.push(function(){Se(M,"scroll",q)}))}Te(M,"touchstart",Z);function fe(){Se(M,"touchstart",Z)}return{removeElementTouchScrollListener:fe}},B=[],$=function(){B.forEach(function(M){return M()}),B.length=0},Y=function(){Se(window,"mousedown",c),Se(window,"mouseup",f),$(),a.value&&(Se(a.value,"mouseenter",T),Se(a.value,"mouseleave",I)),n.value&&(Se(n.value,"mouseenter",P),Se(n.value,"mouseleave",F)),e.value&&(Se(e.value,"mouseenter",h),Se(e.value,"mouseleave",g)),r.value&&(Se(r.value,"mouseenter",_),Se(r.value,"mouseleave",m))},ee=function(){if(Te(window,"mousedown",c),Te(window,"mouseup",f),Y(),a.value){Te(a.value,"mouseenter",T),Te(a.value,"mouseleave",I);var M=K(a.value),X=M.removeElementTouchScrollListener;B.push(X)}if(t.footerAffixedBottom&&n.value){Te(n.value,"mouseenter",P),Te(n.value,"mouseleave",F);var q=K(n.value),Z=q.removeElementTouchScrollListener;B.push(Z)}if(t.horizontalScrollAffixedBottom&&r.value){Te(r.value,"mouseenter",_),Te(r.value,"mouseleave",m);var fe=K(r.value),he=fe.removeElementTouchScrollListener;B.push(he)}if((p.value||d.value)&&e.value){Te(e.value,"mouseenter",h),Te(e.value,"mouseleave",g);var Le=K(e.value),We=Le.removeElementTouchScrollListener;B.push(We)}},ae=function(){if(!(!p.value&&!t.paginationAffixedBottom))var M=setTimeout(function(){p.value||t.paginationAffixedBottom?Te(document,"scroll",O):Se(document,"scroll",O),clearTimeout(M)})};ce([a,n,r,e],function(){ee(),w(),C()}),ce(p,ae),ce(function(){return[t.data,t.columns,t.headerAffixedTop,t.footerAffixedBottom,t.horizontalScrollAffixedBottom]},function(){w()}),Ra(function(){Se(document,"scroll",O),Y(),a.value=null,n.value=null,r.value=null,e.value=null});var ne=function(M){e.value=M,ae()};return{showAffixHeader:l,showAffixFooter:i,showAffixPagination:u,affixHeaderRef:a,affixFooterRef:n,horizontalScrollbarRef:r,paginationRef:o,onHorizontalSc
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function dr(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?dr(l,e):Object.assign(n,l)}}return n}}function vr(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(Xa(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=vr(v,e,a));l=l.concat(v)}return l}function Ja(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 ul(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 ul((l=t[n])===null||l===void 0?void 0:l.children,e)}}}}function Qn(t,e){return vt(t)==="object"?t:vt(e)==="object"?e:{}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function es(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=!Jl&&window.requestAnimationFrame||function(u){return setTimeout(u,16.6)},i=function(){r.value||l(function(){r.value=!0})};return pt(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)||Vo(e.value,t.value,i,s)})}),{hasLazyLoadHolder:o,tRowHeight:n}}/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Vn(t,e,a,n){var r=H(t,e);return r===void 0&&ze.error("Table","rowKey is wrong, can not get unique identifier of row."),[r,a||n].join("_")}function sl(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 p=v+(s.rowspan||1),b=d+(s.colspan||1),w=v;w<p;w++)for(var y=d;y<b;y++)if(w!==v||y!==d){if(!t.value[w]||!e.value[y])return;var R=Vn(t.value[w],a.value,e.value[y].colKey,y),C=r.value.get(R)||{};C.skipped=!0,r.value.set(R,C)}}},l=function(u,s,v){var d;if((d=r.value)===null||d===void 0||d.clear(),!(!u||!v))for(var p=0,b=u.length;p<b;p++)for(var w=u[p],y=0,R=s.length;y<R;y++){var C=s[y],O={row:w,col:C,rowIndex:p,colIndex:y},S=Vn(w,a.value,C.colKey,y),D=r.value.get(S)||{},j=v(O)||{};(j.rowspan||j.colspan||D.rowspan||D.colspan)&&(j.rowspan&&(D.rowspan=j.rowspan),j.colspan&&(D.colspan=j.colspan),r.value.set(S,D)),o==null||o(O,D)}};return ce(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.9
|
|
|
|
* (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 ot(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}function ts(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var cl=["rowKey","rowClassName","columns","fixedRows","footData","rowAttributes","rowspanAndColspan","scroll","cellEmptyContent","pagination","attach","onCellClick","onRowClick","onRowDblclick","onRowMouseover","onRowMousedown","onRowMouseenter","onRowMouseleave","onRowMouseup"],dl=["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,p=u||v;return p&&d?p*(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,ot(ot({},t),{},{type:"cell"}));var b=H(r,n.colKey);return[void 0,"",null].includes(b)?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):b:b}var ns=He({name:"TR",props:ot(ot({row:Object,rowIndex:Number,dataLength:Number,ellipsisOverlayClassName:String,classPrefix:String,rowAndColFixedPosition:Map,skipSpansMap:Map,virtualConfig:Object,active:Boolean,isHover:Boolean},xn(Rn,cl)),{},{tableElm:{},tableContentElm:{}}),emits:["row-mounted"],setup:function(e,a){var n=Ie(e),r=n.tableContentElm,o=n.active,l=n.isHover,i=W(null),u=it(),s=u.tdEllipsisClass,v=u.tableBaseClass,d=u.tableColFixedClasses,p=u.tableRowFixedClasses,b=u.tdAlignClasses,w=u.tableDraggableClasses,y=N(function(){return Yu(H(e.row,e.rowKey||"id"),e.rowIndex,e.dataLength,e.fixedRows,e.rowAndColFixedPosition,p,e.virtualConfig.isVirtualScroll.value?e.virtualConfig.translateY.value:0)}),R=N(function(){return dr(e.rowAttributes,{row:e.row,rowIndex:e.rowIndex,type:"body"})||{}}),C=N(function(){var T,I=vr(e.rowClassName,{row:e.row,rowIndex:e.rowIndex,type:"body"},e.rowKey||"id");return[(T=y.value)===null||T===void 0?void 0:T.classes,I,z(z({},"".concat(e.classPrefix,"-table__row--active"),o.value),"".concat(e.classPrefix,"-table__row--hover"),l.value)].filter(function(_){return _})}),O=es(r,i,Xn(ot(ot({},e.scroll),{},{rowIndex:e.rowIndex}))),S=O.hasLazyLoadHolder,D=O.tRowHeight,j=function(I,_){var m={};return dl.forEach(function(h){m["on".concat(br(h))]=function(g){var c,f={e:g,row:I,index:_};(c=e["onRow".concat(br(h))])===null||c===void 0||c.call(e,f)}}),m},A=function(){var I;(I=e.virtualConfig)!==null&&I!==void 0&&I.isVirtualScroll.value&&a.emit("row-mounted",{ref:i,data:e.row})};pt(function(){Gt(function(){A()})}),di(function(){Gt(function(){A()})});function P(T,I){var _=I.cellNode,m=T.col,h=T.colIndex,g;Re(m.ellipsis)?g=m.ellipsis(Ye,T):vt(m.ellipsis)==="object"&&Re(m.ellipsis.content)?g=m.ellipsis.content(Ye,T):a.slots["ellipsis-".concat(m.colKey)]?g=a.slots["ellipsis-".concat(m.colKey)](T):a.slots.ellipsis&&(g=a.slots.ellipsis(T));var c={};vt(m.ellipsis)==="object"&&(c="props"in m.ellipsis?m.ellipsis.props:m.ellipsis||void 0);var f=e.tableElm,x=h===0?"top-left":"top";return x=h===e.columns.length-1?"top-right":x,k(sr,{placement:x,attach:f?function(){return f}:void 0,tooltipContent:g&&function(){return g},tooltipProps:c,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},ts(_)?_:{default:function(){return[_]}})}function F(T,I){var _=T.col,m=T.colIndex,h=T.rowIndex,g=I.cellSpans,c=I.dataLength,f=I.rowAndColFixedPosit
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 ea(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}var vl=["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"],as=He({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]},xn(Rn,vl)),setup:function(e){var a=Yt(),n=Ie(e),r=n.data,o=n.columns,l=n.rowKey,i=n.rowspanAndColspan,u=gt("table",e.locale),s=u.t,v=u.globalConfig,d=it(),p=d.tableFullRowClasses,b=d.tableBaseClass,w=sl(r,o,l,i),y=w.skipSpansMap,R=N(function(){return[b.body]});return{t:s,globalConfig:v,renderTNode:a,tableFullRowClasses:p,tbodyClasses:R,tableBaseClass:b,skipSpansMap:y}},render:function(){var e=this,a,n,r,o,l=function(O){var S=e.bordered?e.tableWidth-2:e.tableWidth;return k("tr",{class:[e.tableBaseClass.emptyRow,z({},e.tableFullRowClasses.base,e.isWidthOverflow)]},[k("td",{colspan:O.length},[k("div",{class:[e.tableBaseClass.empty,z({},e.tableFullRowClasses.innerFullRow,e.isWidthOverflow)],style:e.isWidthOverflow?{width:"".concat(S,"px")}:{}},[e.renderTNode("empty")||e.t(e.globalConfig.empty)])])])},i=function(O,S){var D=Zl(S),j=e.renderTNode(D);if(["",null,void 0,!1].includes(j))return null;var A=e.isWidthOverflow&&e.columns.find(function(T){return T.fixed==="left"}),P=[e.tableFullRowClasses.base,e.tableFullRowClasses[D]],F=e.bordered?e.tableWidth-2:e.tableWidth;return k("tr",{class:P,key:"key-full-row-".concat(S)},[k("td",{colspan:O},[k("div",{class:z({},e.tableFullRowClasses.innerFullRow,A),style:A?{width:"".concat(F,"px")}:{}},[k("div",{class:e.tableFullRowClasses.innerFullElement},[j])])])])},u=this.columns.length,s=(a=this.data)===null||a===void 0?void 0:a.length,v=[],d=["classPrefix","ellipsisOverlayClassName","rowAndColFixedPosition","scroll","tableElm","tableContentElm","pagination","attach"],p=this.virtualConfig.isVirtualScroll.value?this.virtualConfig.visibleData.value:this.data;p==null||p.forEach(function(C,O){var S,D=e.rowKey||"id",j=H(C,D),A=ea(ea({},xn(e.$props,cl)),{},{rowKey:D,row:C,columns:e.columns,rowIndex:C.VIRTUAL_SCROLL_INDEX||O,dataLength:s,skipSpansMap:e.skipSpansMap,virtualConfig:e.virtualConfig,active:(S=e.activeRow)===null||S===void 0?void 0:S.includes(j),isHover:e.hoverRow===j},xn(e.$props,d));e.onCellClick&&(A.onCellClick=e.onCellClick);var P=k(ns,Ke({key:H(C,e.rowKey||"id")||O},A,{onRowMounted:e.handleRowMounted}),e.$slots);if(v.push(P),e.renderExpandedRow){var F={row:C,index:O,columns:e.columns,tableWidth:e.tableWidth,isWidthOverflow:e.isWidthOverflow},T=e.renderExpandedRow(F);T&&v.push(T)}});var b=[i(u,"first-full-row")].concat(v,[i(u,"last-full-row")]),w=!((n=this.data)!==null&&n!==void 0&&n.length)&&!this.loading&&!this.firstFullRow&&!this.lastFullRow,y="translateY(".concat((r=this.virtualConfig)===null||r===void 0?void 0:r.translateY.value,"px)"),R=(o=this.virtualConfig)!==null&&o!==void 0&&o.isVirtualScroll.value?{transform:y,"-ms-transform":y,"-moz-transform":y,"-webkit-transform":y}:void 0;return k("tbody",{class:this.tbodyClasses,style:ea({},R)},[w?l(this.co
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function Nn(t){return t&&(isNaN(Number(t))?t:"".concat(t,"px"))}function fl(t){var e=Ie(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=it(),d=v.tableBaseClass,p=v.tableAlignClasses,b=pi(),w=b.sizeClassNames,y=gt("table",t.locale),R=y.globalConfig,C=N(function(){var j;return(j=a.value)!==null&&j!==void 0?j:R.value.size}),O=N(function(){return[d.table,z(z(z(z(z(z(z(z({},w[C.value],C.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),p[l.value],l.value!=="middle")]}),S=N(function(){return{height:Nn(i.value),maxHeight:Nn(u.value)}}),D=N(function(){return{width:Nn(s.value)}});return{tableClasses:O,sizeClassNames:w,tableElementStyles:D,tableContentStyles:S}}/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Gr(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?Gr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Gr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function rs(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var Yr=He({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=it(),l=o.tableHeaderClasses,i=o.tableBaseClass,u=N(function(){return[l.header,z(z(z({},l.fixed,Boolean(e.maxHeight||e.height)),i.bordered,e.bordered&&e.isMultipleHeader),l.multipleHeader,e.isMultipleHeader)]}),s=N(function(){for(var d={},p=e.thList[0],b=0,w=p.length;b<w;b++){var y=p[b];if(y.colspan>1)for(var R=b+1;R<b+y.colspan;R++)p[R]&&(d[p[R].colKey]=!0)}return d}),v=function(p){for(var b=p;b;){var w;if(b=b.parentNode,(w=b)!==null&&w!==void 0&&(w=w.classList)!==null&&w!==void 0&&w.contains("".concat(e.classPrefix,"-table")))break}return b};return Rt(Rt({},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,p){var b;if(e.colspanSkipMap[d.colKey])return null;var w=i.get(d);if(p===0&&w.rowspan>1)for(var y=s+1;y<s+w.rowspan;y++)l.set(e.thList[y][0],!0);var R=cr(d,p,r,e.tableColFixedClasses),C={col:d,colIndex:p,row:{},rowIndex:-1},O=Ja(d.className,Rt(Rt({},C),{},{type:"th"})),S=Ja(d.thClassName,Rt(Rt({},C),{},{type:"th"})),D=e.showColumnShadow.left&&d.fixed==="left",j=e.showColumnShadow.right&&d.fixed==="right",A=e.thDraggable&&!(D||j),P=[R.classes,O,S,z(z(z(z({},e.tableHeaderClasses.thBordered,l.get(d)),"".concat(e.classPrefix,"-table__th-").concat(d.colKey),d.colKey),e.tdAlignClasses[d.align],d.align&&d.align!=="left"),e.tableDraggableClasses.dragSortTh,A)],F=!((b=d.children)!==null&&b!==void 0&&b.length),T=F&&o!==null&&o!==void 0&&o[d.colKey]?"".concat(o==null?void 0:o[d.colKey],"px"):void 0,I=Rt(Rt({},R.style||{}),{},{width:T}),_=Ea(e.slots,d,p),m=e.resizable||!A?{onMousedown:function(x){if(e.resizable){var E,L;(E=e.columnResizeParams)===null||E===void 0||(L=E.onColumnMousedown)===null||L===void 0||L.call(E,x,d,p)}if(!A)var K=setTimeout(function(){var B,$=e.theadRef.querySelectorAll("th");(B=$[p])===null||B===void 0||B.removeAttribute("draggable"),clearTimeout(K)},10)},onMousemove:function(x){var E,L;e.resizable&&((E=e.columnResizeParams)===null||E===void 0||(L=E.onColumnMouseover)===null||L===void 0||L.call(E,x,d))}}:{},h=Re(d.ellipsisTitle)?d.ellipsisTitle(Ye,{col:d,colIndex:p}):void 0,g=d.ellipsisTitle!==void 0?Boolean(d.ellipsisTitle):Boolean(d.ellipsis),c=(Re(d.attrs)?d.attrs(Rt(Rt({},C),{},{type:"th"})):d.attrs)||{};return d.colspan>1&&(c.colspan=d.colspan),k("th",Ke({key:d.colKey,"data-colkey":d.colKey,class:P,style:I},c,w,m),[k("div",{class:e.tableBaseClass.thCellInner},[g?k(sr,{placement:"bottom",attach:e.attach||(e.theadRef?function(){return e.getTableNode(e.theadRef)}:void 0),tooltipContent:h&&function(){return h},tooltipProps:vt(d.ellipsisTitle)==="object"?d.ellipsisTitle:void 0,overlayClassName:e.ellipsisOverlayClassName,classPrefix:e.classPrefix},rs(_)?_:{default:function(){return[_]}}):_])])});return k("tr",{key:s},[v])})};return k("thead",{ref:"theadRef",class:this.theadClasses},[a(this.rowAndColFixedPosition,this.thWidthList)]
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 ta(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 Jr=He({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=it(),o=Ie(e),l=o.footData,i=o.columns,u=o.rowKey,s=o.rowspanAndColspanInFooter,v=sl(l,i,u,s),d=v.skipSpansMap,p=function(w){var y=w.col,R=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(R,y.colKey)};return ta(ta({skipSpansMap:d},r),{},{renderTFootCell:p,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=dr(a.rowAttributes,{row:l,rowIndex:i,type:"foot"}),s=vr(a.rowClassName,{row:l,rowIndex:i,type:"foot"},a.rowKey||"id");return k("tr",Ke(u,{key:i,class:s}),[a.columns.map(function(v,d){var p,b={},w=null;if(a.skipSpansMap.size){var y,R,C=Vn(l,a.rowKey,v.colKey,d);if(w=a.skipSpansMap.get(C)||{},((y=w)===null||y===void 0?void 0:y.rowspan)>1&&(b.rowspan=w.rowspan),((R=w)===null||R===void 0?void 0:R.colspan)>1&&(b.colspan=w.colspan),w.skipped)return null}var O=cr(v,d,a.rowAndColFixedPosition,a.tableColFixedClasses),S=ta({},O.style);return(p=a.thWidthList)!==null&&p!==void 0&&p[v.colKey]&&(S.width="".concat(a.thWidthList[v.colKey],"px")),k("td",Ke(ta({key:v.colKey},b),{class:O.classes,style:S}),[a.renderTFootCell({row:l,rowIndex:i,col:v,colIndex:d})])})])}),o=this.renderTNode("footerSummary");return!o&&(!this.footData||!this.footData.length)?null:k("tfoot",{ref:"tFooterRef",class:n,style:{visibility:this.virtualScroll?"hidden":"visible"}},[o&&k("tr",{class:this.tableFullRowClasses.base},[k("td",{colspan:this.columns.length},[k("div",{class:this.tableFullRowClasses.innerFullElement},[o])])]),r])}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function os(t,e){var a=Ie(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),p=kt(o,l.value,t.onActiveChange,"activeRowKeys"),b=Pe(p,2),w=b[0],y=b[1],R=function(h){var g=h.row,c=h.index,f=H(g,t.rowKey);if(r.value==="single"){var x=w.value.length>1?[f]:[];y(x,{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}),L=[],K=0,B=n.value.length;K<B;K++){var $=n.value[K];E.includes(H($,t.rowKey))&&L.push({row:$,rowIndex:K})}y(E,{type:"inactive",activeRowList:L,currentRowData:g})}},C=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),x=[],E=0,L=n.value.length;E<L;E++){var K=n.value[E];f.includes(H(K,t.rowKey))&&x.push({row:K,rowIndex:E})}y(f,{activeRowList:x,currentRowData:g,type:"active"})}},O=function(h){document.getSelection().removeAllRanges();for(var g=h.row,c=u.value,f=Math.min(d.value,c),x=Math.max(d.value,c),E=[],L=f;L<=x;L++)E.push({row:n.value[L],rowIndex:L});var K=E.map(function(B){return H(B.row,t.rowKey)});y(K,{activeRowList:E,type:"active",currentRowData:g})},S=function(){for(var h=[],g=0,c=n.value.length;g<c;g++){var f=n.value[g],x=H(f,t.rowKey);w.value.includes(x)&&h.push({row:f,rowIndex:g})}return h},D=function(h,g){if(!!r.value){var c=h.row,f=h.index,x=H(c,t.rowKey);s.value?(u.value=f,O(h),v.value=!0):w.value.includes(x)&&(g==null?void 0:g.action)!=="active"?i.value||(R(h),u.value=f):(C(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,x){return{row:f,rowIndex:x}});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},P=function(){v.value=!1},F=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());if(Uo.test(c)){h.preventDefault();var f=Math.min(n.value.length-1,u.value+1);r.value==="single"?D({row:n.value[f],index:f,e:h},{action:"active"}):u.value=f}else if(Xo.test(c)){h.preventDefault();var x=Math.max(0,u.value-1);r.value==="single"?D({row:n.value[x],index:x,e:h},{action:"active"}):u.value=x}else if(Ga.test(c)){h.preventDefault();var E=u.value;if(v.value){var L;(L=t.onActiveRowAction)===null||L===void 0||L.call(t,{action:"shift-area-selection",activeRowList:S()})}else if(!i.value)D({row:n.value[E],index:E,e:h});else{var K;(K=t.onActiveRowAction)===null||K===void 0||K.call(t,{action:"space-one-selection",activeRowList:S()})}}else yr.test(c)?(s.value=!0,d.value=u.value):Go.test(c)||Yo.test(c)?(j(),P()):qo.test(c)&&A();Ga.test(c)||P()},T=function(h){var g,c=h.code||((g=h.key)===null||g===void 0?void 0:g.trim());yr.test(c)&&(s.value=!1)},I=function(){Te(e.value,"keydown",F),Te(e.value,"keyup",T)},_=function(){Se(e.value,"keydown",F),Se(e.value,"keyup",T)};return{tActiveRow:w,onHighlightRow:D,addHighlightKeyboardListener:I,removeHighlightKeyboardListener:_}}/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function ls(t,e){var a=Ie(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(C,O){var S=H(C.row,t.rowKey);u.value===S&&(O==null?void 0:O.action)!=="hover"?i.value||(u.value=void 0):u.value=S,s.value=C.index},p=function(){u.value=void 0,s.value=-1},b=function(C){var O;if(!!v.value){var S=C.code||((O=C.key)===null||O===void 0?void 0:O.trim());if(Uo.test(S)){C.preventDefault();var D=Math.min(r.value.length-1,s.value+1);d({row:r.value[D],index:D,e:C},{action:"hover"})}else if(Xo.test(S)){C.preventDefault();var j=Math.max(0,s.value-1);d({row:r.value[j],index:j,e:C},{action:"hover"})}else if(Ga.test(S)&&t.activeRowType!=="multiple"){var A=s.value;if(d({row:r.value[A],index:A,e:C}),!t.activeRowType){var P;(P=t.onActiveRowAction)===null||P===void 0||P.call(t,{action:"space-one-selection",activeRowList:[{row:r.value[A],rowIndex:A}]})}}else if(Go.test(S)&&!t.activeRowType){var F;u.value=void 0,(F=t.onActiveRowAction)===null||F===void 0||F.call(t,{action:"clear",activeRowList:[]})}else if(qo.test(S)&&!t.activeRowType){var T;(T=t.onActiveRowAction)===null||T===void 0||T.call(t,{action:"select-all",activeRowList:[]})}else if(Yo.test(S)&&!t.activeRowType){var I;(I=t.onActiveRowAction)===null||I===void 0||I.call(t,{action:"clear",activeRowList:[]})}}},w=function(){Te(e.value,"keydown",b)},y=function(){Se(e.value,"keydown",b)};return{hoverRow:u,needKeyboardRowHover:v,clearHoverRow:p,addRowHoverKeyboardListener:w,removeRowHoverKeyboardListener:y}}/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function is(t,e){var a=W(),n=W(!0),r=function(){if(!(!e.value||!t.value||a.value)){n.value=!1;var l=Vo(t.value,null,function(){n.value=!0},10);a.value=l}};return pt(r),e.value&&ce([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}}/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function Zr(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Qe(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Zr(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Qr(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var us=["page-change","cell-click","scroll","scrollX","scrollY"];dl.map(function(t){return"row-".concat(t)}).concat(us);var hl=He({name:"TBaseTable",props:Qe(Qe({},Rn),{},{renderExpandedRow:Function,onLeafColumnsChange:Function,thDraggable:Boolean}),emits:["show-element-change"],setup:function(e,a){var n=Ie(e),r=n.lazyLoad,o=Yt(),l=W(),i=W(),u=W(),s=W(),v=W(0),d=it(),p=d.classPrefix,b=d.virtualScrollClasses,w=d.tableLayoutClasses,y=d.tableBaseClass,R=d.tableColFixedClasses,C=fl(e),O=C.tableClasses,S=C.sizeClassNames,D=C.tableContentStyles,j=C.tableElementStyles,A=gt("table",e.locale),P=A.globalConfig,F=il(e),T=F.isMultipleHeader,I=F.spansAndLeafNodes,_=F.thList,m=N(function(){var be;return((be=I.value)===null||be===void 0?void 0:be.leafColumns)||e.columns}),h=N(function(){var be;return(be=e.size)!==null&&be!==void 0?be:P.value.size}),g=is(l,r),c=g.showElement,f=W(),x=W(),E=W(),L=W(),K=qu(e,a,m,{paginationAffixRef:f,horizontalScrollAffixRef:x,headerTopAffixRef:E,footerBottomAffixRef:L}),B=K.scrollbarWidth,$=K.virtualScrollHeaderPos,Y=K.tableWidth,ee=K.tableElmWidth,ae=K.tableContentRef,ne=K.isFixedHeader,Q=K.isWidthOverflow,M=K.isFixedColumn,X=K.thWidthList,q=K.showColumnShadow,Z=K.rowAndColFixedPosition,fe=K.setData,he=K.refreshTable,Le=K.setTableElmWidth,We=K.emitScrollEvent,qe=K.setUseFixedTableElmRef,Ne=K.updateColumnFixedShadow,nt=K.getThWidthList,ut=K.updateThWidthList,st=K.addTableResizeObserver,Tt=K.updateTableAfterColumnResize,je=Qu(e),Dn=je.affixHeaderRef,Tn=je.affixFooterRef,Pn=je.horizontalScrollbarRef,re=je.paginationRef,V=je.showAffixHeader,G=je.showAffixFooter,J=je.showAffixPagination,te=je.onHorizontalScroll,le=je.setTableContentRef,ge=je.updateAffixHeaderOrFooter,pe=Zu(e,a),ue=pe.dataSource,we=pe.innerPagination,Ee=pe.isPaginateData,Ae=pe.renderPagination,Me=Cu({isWidthOverflow:Q,tableContentRef:ae,showColumnShadow:q,getThWidthList:nt,updateThWidthList:ut,setTableElmWidth:Le,updateTableAfterColumnResize:Tt,onColumnResizeChange:e.onColumnResizeChange}),Pt=Me.resizeLineRef,Bt=Me.resizeLineStyle,at=Me.setEffectColMap,zt=N(function(){return[O.value,z(z(z(z(z(z(z(z({},y.headerFixed,ne.value),y.columnFixed,M.value),y.widthOverflow,Q.value),y.multipleHeader,T.value),R.leftShadow,q.left),R.rightShadow,q.right),y.columnResizableTable,e.resizable),"".concat(p,"-table__row--active-").concat(e.activeRowType),e.activeRowType)]}),yt=N(function(){return[[w[e.tableLayout]]]}),fn=N(function(){return e.bordered&&ne.value&&(T.value&&Q.value||!T.value)}),Ct=N(function(){var be,me;if(!e.bordered)return 0;var De=(be=s.value)===null||be===void 0?void 0:be.getBoundingClientRect(),Ge=(me=re.value)===null||me===void 0?void 0:me.getBoundingClientRect();return((De==null?void 0:De.height)||0)+((Ge==null?void 0:Ge.height)||0)}),xt=os(e,l),ye=xt.tActiveRow,de=xt.onHighlightRow,Fe=xt.addHighlightKeyboardListener,Je=xt.removeHighlightKeyboardListener,Xe=ls(e,l),bt=Xe.hoverRow,Jt=Xe.needKeyboardRowHover,qn=Xe.clearHoverRow,Zt=Xe.addRowHoverKeyboardListener,Qt=Xe.removeRowHoverKeyboardListener;ce(i,function(){qe(i.value)}),ce(function(){return[e.data,ue]},function(){fe(Ee.value?ue.value:e.data)}),ce(I,function(){var be;(be=e.onLeafColumnsChange)===null||be===void 0||be.call(e,I.value.leafColumns),at(I.value.leafColumns,null)},{immediate:!0});var en=function(){Gt(function(){te(),ge()})},Ht=$o(function(){ut(nt("calculate"))}),Wt=N(function(){return{data:e.data,scroll:Qe(Q
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var gl={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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/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 to(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}var ss=He({name:"ColumnCheckboxGroup",props:{checkboxProps:Object,options:{type:Array,default:function(){return[]}},label:String,uniqueKey:String,value:Array,onChange:Function},setup:function(e){var a=Ie(e),n=a.checkboxProps,r=a.value,o=a.options,l=It(),i=N(function(){var w=[];return o.value.forEach(function(y){if(vt(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,R){var C={e:R.e,type:"check",current:void 0,option:void 0};if(y){var O,S=ve(new Set(r.value.concat(i.value)));(O=e.onChange)===null||O===void 0||O.call(e,S,C)}else{var D,j=r.value.filter(function(A){return!i.value.includes(A)});(D=e.onChange)===null||D===void 0||D.call(e,j,to(to({},C),{},{type:"uncheck"}))}},p=function(y,R){var C;(C=e.onChange)===null||C===void 0||C.call(e,y,R)},b=N(function(){return["".concat(l.value,"-table__column-controller-item"),z({},"".concat(l.value,"-table__").concat(e.uniqueKey),e.uniqueKey)]});return function(){return k("div",{class:b.value},[k("div",{class:"".concat(l.value,"-table__column-controller-block")},[k(Ya,{indeterminate:v.value,checked:s.value,onChange:d,disabled:!i.value.length},{default:function(){return[e.label]}})]),k("div",{class:"".concat(l.value,"-table__column-controller-block")},[k(Jo,Ke({options:o.value},n.value,{modelValue:r.value,onChange:p}),null)])])}}});/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function no(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?no(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):no(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function Za(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?Za(o.children,e):o.colKey&&e.add(o.colKey)}return e}function cs(t,e){var a=gt("table",t.locale),n=a.classPrefix,r=a.globalConfig,o=_n({SettingIcon:zi}),l=o.SettingIcon,i=Ie(t),u=i.columns,s=i.columnController,v=i.displayColumns,d=i.columnControllerVisible,p=W(null),b=Yt(),w=N(function(){var m,h=(((m=s.value)===null||m===void 0?void 0:m.fields)||ve(Za(u.value))).filter(function(g){return g});return new Set(h)}),y=ve(Za(u.value)),R=kt(v,t.defaultDisplayColumns||y,t.onDisplayColumnsChange,"displayColumns"),C=Pe(R,2),O=C[0],S=C[1],D=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 P(u.value);var h={label:r.value.selectAllText,options:F(u.value)};return[h]});ce([v],function(m){var h=Pe(m,1),g=h[0];D.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 P(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(E){for(var L=0,K=E.length;L<K;L++){for(var B,$=E[L],Y=A($,L),ee=0,ae=g.length;ee<ae;ee++){var ne,Q=g[ee];!Q.columns.includes($.colKey)||((ne=c[ee])!==null&&ne!==void 0&&(ne=ne.options)!==null&&ne!==void 0&&ne.length?c[ee].options.push(Y):c[ee]=Ia(Ia({},g[ee]),{},{options:[Y]}))}(B=$.children)!==null&&B!==void 0&&B.length&&f($.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 x,E=m[c];(x=E.children)!==null&&x!==void 0&&x.length?F(E.children,g):E.colKey&&g.push(A(E,c))}return g}var T=function(h,g){var c;D.value=h;var f={columns:h,type:g.type,currentColumn:ul(u.value,String(g.current)),e:g.e};(c=t.onColumnChange)===null||c===void 0||c.call(t,f)},I=function(){var h;if(p.value){p.value.show();return}p.value=Ql.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",x=s.value||{},E=x.columnControllerTopContent,L=x.columnControllerBottomContent,K=k("div",{class:["".concat(n.value,"-table__column-controller"),"".concat(n.value,"-table__column-controller--").concat(f)]},[k("div",{class:"".concat(n.value,"-table__column-controller-body")},[Re(E)?E(Ye):b("columnControllerTopContent"),r.value.columnConfigDescriptionText&&k("p",{class:"".concat(n.value,"-table__column-controller-desc")},[r.value.columnConfigDescriptionText]),j.value.map(function(B,$){var Y,ee,ae=(Y=s.value)!==null&&Y!==void 0&&(Y=Y.groupColumns)!==null&&Y!==void 0&&Y.length?String(B.value||$):void 0;return k(ss,{key:B.value||$,uniqueKey:ae,value:D.value,label:B.label,options:B.options,onChange:T,checkboxProps:(ee=s.value)===null||ee===void 0?void 0:ee.checkboxProps},null)}),Re(L)?L(Ye):b("columnControllerBottomContent")])]);return K},confirmBtn:r.value.confirmText,cancelBtn:r.value.cancelText,width:612,onConfirm:function(){if(S(ve(D.value)),d.value===void 0)p.value.hide();else{var c;(c=t.onColumnControllerVisibleChange)===null||c===void 0||c.call(t,!1,{trigger:"confirm"}),e.emit("update:columnControllerVisible",!1)}},onClose:function(){if(d.value===void 0)p.value.hide();else{var c;(c=t.onColum
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function ds(t,e){var a=Ie(t),n=a.expandedRowKeys,r=Yt(),o=gt("table",t.locale),l=o.t,i=o.globalConfig,u=_n({ChevronRightCircleIcon:_i}),s=u.ChevronRightCircleIcon,v=it(),d=v.tableExpandClasses,p=v.positiveRotate90,b=v.tableFullRowClasses,w=kt(n,t.defaultExpandedRowKeys||[],t.onExpandChange,"expandedRowKeys"),y=Pe(w,2),R=y[0],C=y[1],O=N(function(){return Boolean(t.expandedRow||e.slots.expandedRow||e.slots["expanded-row"])}),S=N(function(){return t.expandIcon!==!1&&O.value}),D=N(function(){var I;return((I=t.columns)===null||I===void 0||(I=I[0])===null||I===void 0?void 0:I.fixed)==="left"}),j=function(_,m){t.expandOnRowClick&&_.stopPropagation();var h=H(m,t.rowKey||"id"),g=R.value.indexOf(h),c=ve(R.value);g!==-1?c.splice(g,1):c.push(h),C(c,{expandedRowData:t.data.filter(function(f){return c.includes(H(f,t.rowKey||"id"))}),currentRowData:m})},A=function(_,m){var h=m.row,g=m.rowIndex,c=H(h,t.rowKey||"id"),f=R.value.includes(c),x=r("expandIcon",{defaultNode:l(i.value.expandIcon)||k(s,null,null),params:{row:h,index:g}});if(!x)return null;var E=[d.iconBox,d[f?"expanded":"collapsed"],z({},p,f)];return k("span",{class:E,onClick:function(K){return j(K,h)}},[x])},P=function(){var _={colKey:"__EXPAND_ROW_ICON_COLUMN__",width:46,className:d.iconCell,fixed:D.value?"left":void 0,cell:A,stopPropagation:!0};return _},F=function(_){var m=H(_.row,t.rowKey||"id");if(!R.value||!R.value.includes(m))return null;var h=_.isWidthOverflow&&t.columns.find(function(g){return g.fixed==="left"});return k("tr",{key:"expand_".concat(m),class:[d.row,z({},b.base,h)]},[k("td",{colspan:_.columns.length},[k("div",{class:[d.rowInner,z({},b.innerFullRow,h)],style:h?{width:"".concat(_.tableWidth,"px")}:{}},[k("div",{class:b.innerFullElement},[r("expandedRow",{params:_})])])])])},T=function(_){j(_.e,_.row)};return{showExpandedRow:O,showExpandIconColumn:S,getExpandColumn:P,renderExpandedRow:F,onInnerExpandRowClick:T}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Qa(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 vs(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 ao(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 pl(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&&pl(o.children,e)}return e}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 na(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 fs(t,e){var a=Ie(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),p=d[0],b=d[1],w=W(new Map),y=N(function(){return t.columns.find(function(c){var f=c.type;return["multiple","single"].includes(f)})}),R=N(function(){var c;return t.rowSelectionType||((c=y.value)===null||c===void 0?void 0:c.type)||"single"}),C=N(function(){var c=i.value?l.value:u.value;return c.filter(function(f,x){return!D(f,x)})}),O=N(function(){return ba(p.value,C.value.map(function(c){return H(c,t.rowKey||"id")}))}),S=N(function(){var c;if(t.rowSelectionAllowUncheck)return!0;var f=R.value==="single";return!f||!y.value||!("allowUncheck"in((c=y.value)===null||c===void 0?void 0:c.checkProps))?!1:y.value.checkProps.allowUncheck});ce([l,r,p,y,o],function(){var c,f=function($){return y.value.disabled($)?e.disabled:""},x=(c=y.value)!==null&&c!==void 0&&c.disabled?f:void 0,E=new Set(p.value),L=function($){var Y=$.row,ee=H(Y,t.rowKey||"id");return E.has(ee)?e.selected:""},K=E.size?L:void 0;s.value=[x,K]},{immediate:!0});function D(c,f){return Qa(y.value,c,f)}function j(){return function(){var c=O.value.length>0&&O.value.length<C.value.length,f=O.value.length!==0&&C.value.length!==0&&O.value.length===C.value.length;return k(Ya,{checked:f,indeterminate:c,disabled:!C.value.length,onChange:T},null)}}function A(c){var f=c.col,x=c.row,E=c.rowIndex,L=Re(f.disabled)?f.disabled({row:x,rowIndex:E}):f.disabled,K=Re(f.checkProps)?f.checkProps({row:x,rowIndex:E}):f.checkProps;return{disabled:L||(K==null?void 0:K.disabled),checkProps:K}}function P(c){var f=c.col,x=c.row,E=x===void 0?{}:x,L=p.value.includes(H(E,t.rowKey||"id")),K=A(c),B=K.disabled,$=K.checkProps,Y=na(na({checked:L,disabled:B},$),{},{onClick:function(Q){if(vt(Q)==="object"&&"e"in Q){var M;(M=Q.e)===null||M===void 0||M.stopPropagation()}else Q==null||Q.stopPropagation()},onChange:function(){return F(E)}});if(f.type==="single")return k(du,Y,null);if(f.type==="multiple"){var ee,ae=(ee=t.indeterminateSelectedRowKeys)!==null&&ee!==void 0&&ee.length?t.indeterminateSelectedRowKeys.includes(H(E,t.rowKey)):!1;return k(Ya,Ke({indeterminate:ae},Y),null)}return null}function F(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=ve(p.value),x=t.rowKey||"id",E=H(c,x),L=f.indexOf(E),K=L!==-1;if(R.value==="multiple")K?f.splice(L,1):f.push(E);else if(R.value==="single")f=K&&S.value?[]:[E];else{ze.warn("Table","`column.type` must be one of `multiple` and `single`");return}b(f,{selectedRowData:f.map(function(B){return w.value.get(B)}),currentRowKey:E,currentRowData:c,type:K?"uncheck":"check"})}function T(c){var f,x=t.rowKey||"id",E=C.value.map(function(B){return H(B,x)}),L=((f=n.value)===null||f===void 0?void 0:f.filter(function(B){return!E.includes(B)}))||[],K=c?[].concat(ve(L),ve(E)):ve(L);b(K,{selectedRowData:c?K.map(function(B){return w.value.get(B)}):[],type:c?"check":"uncheck",currentRowKey:"CHECK_ALL_BOX"})}function I(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,L){return P(L)},title:c.type==="multiple"?j():c.title}):c}var _=function(f){var x=f.row,E=f.index,L=t.columns.findIndex(function($){return $.colKey==="row-select"}),K=!1;if(L!==-1){var B;K=(B=A({row:x,rowIndex:E,col:t.columns[L],colIndex:L}))===null||B===void 0?void 0:B.disabled}K||F(x)};ce([l,o],function(){for(var c=0,f=l.value.length;c<f;c+
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/function hs(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vn(t)}var gs=He({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=it(),r=n.tableSortClasses,o=n.negativeRotate180,l=Un(),i=gt("table",e.locale),u=i.t,s=i.globalConfig,v=_n({ChevronDownIcon:bi}),d=v.ChevronDownIcon,p=N(function(){return e.sortType==="all"?["asc","desc"]:[e.sortType]}),b=function(R,C){a.emit("sort-icon-click",R,{descending:C==="desc"})},w=function(R,C){var O=u(s.value.sortIcon)||k(d,null,null),S=l("sortIcon",O),D=[C,r.sortIcon,r.iconDirection[R],z({},o,R==="asc")];return k("span",{class:D,onClick:function(A){return b(A,R)}},[S])};return{t:u,globalConfig:s,tableSortClasses:r,negativeRotate180:o,allowSortTypes:p,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):k(Zo,Ke({content:d,placement:"right",showArrow:!1,class:e.tableSortClasses.iconDirection[l]},e.tooltipProps),hs(i=e.getSortIcon(l,s))?i:{default:function(){return[i]}})});return k("div",{class:n},[o])}});/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 ps(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}function bs(t,e){var a=e.slots,n=Ie(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"),p=Pe(d,2),b=p[0],w=p[1],y=N(function(){return S(t.columns)}),R=W(),C=N(function(){var _=s.value;return _?Aa(_)?_:[_]:[]}),O=N(function(){var _={};return C.value.forEach(function(m,h){var g=m.sortBy;_[g]=ps({index:h},m)}),_});function S(_){for(var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=0,g=_.length;h<g;h++){var c,f=_[h];Re(f.sorter)&&(m[f.colKey]=f.sorter),(c=f.children)!==null&&c!==void 0&&c.length&&S(f.children,m)}return m}function D(_){var m=_;if(!!Object.keys(y.value).length){l.value||(l.value=b.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=b.value.slice().sort(function(x,E){for(var L=0,K=0,B=c.length;K<B;K++){var $=c[K],Y=y.value[$.sortBy];if(L===0&&Y)L=$.descending?Y(E,x):Y(x,E);else break}return L});if(JSON.stringify(f)!==JSON.stringify(b.value))return w(f,{trigger:"sort"}),f}}function j(_,m){var h,g;if(t.multipleSort)g=F(_,m);else{var c=s.value instanceof Array?s.value[0]:s.value;g=P(_,c,m)}var f=D(g),x=f||b.value,E=x;v(g,{currentDataSource:E,col:_}),(h=t.onChange)===null||h===void 0||h.call(t,{sorter:g},{currentData:x,trigger:"sorter"}),R.value=g}function A(_){if(_!==void 0)return _?"desc":"asc"}function P(_,m,h){if(!(m&&m.sortBy===_.colKey&&m.descending===h.descending))return{sortBy:_.colKey,descending:h.descending}}function F(_,m){Array.isArray(s.value)||(s.value=s.value?[s.value]:[]);for(var h=s.value,g=_.colKey,c=ve(h),f=0,x=h.length;f<x;f++)if(h[f].sortBy===g){var E=P(_,h[f],m);return E?c[f]=E:c.splice(f,1),c}return c.push({sortBy:g,descending:m.descending}),c}function T(_){var m,h=_.col;if(!h.sorter)return null;var g={sortType:h.sortType,sortOrder:A((m=O.value[h.colKey])===null||m===void 0?void 0:m.descending),sortIcon:t.sortIcon,hideSortTips:t.hideSortTips,locale:t.locale};return k(gs,Ke(g,{onSortIconClick:function(f,x){return j(h,x)}}),{sortIcon:a.sortIcon})}var I=function(m,h){var g=Aa(m)?m:[m],c=Aa(h)?h:[h];if(g.length&&!h)return!1;for(var f=function(){var B=g[E],$=c.find(function(Y){return Y.sortBy===B.sortBy});return $?{v:B.descending===$.descending}:{v:!1}},x,E=0,L=g.length;E<L;E++)if(x=f(),x)return x.v};return ce(function(){return[s,t.data]},function(){!s.value||!Object.keys(s.value).length||!b.value.length||I(s.value,R.value)||D(s.value)},{immediate:!0}),{renderSortIcon:T}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/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 aa(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}var ms=He({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=gt("table",e.locale),l=o.t,i=o.globalConfig,u=_n({FilterIcon:Fi}),s=u.FilterIcon,v=W(!1),d=function(C){var O;v.value=C,(O=e.onVisibleChange)===null||O===void 0||O.call(e,C)},p=function(C,O,S){if(!S)return null;var D=!!S.setup;if(Re(C.filter.component)&&!D)return C.filter.component(function(A,P){var F=vt(P)==="object"&&"attrs"in P?P.attrs:{};return Ye(A,{props:aa(aa({},O),F)})});var j=C.filter||{};return k(S,Ke({class:j.classNames,style:j.style},j.attrs,O),null)},b=function(C){var O,S,D,j=["single","multiple","input"];if((O=C.filter)!==null&&O!==void 0&&O.type&&!j.includes(C.filter.type)){console.error("TDesign Table Error: column.filter.type must be the following: ".concat(JSON.stringify(j)));return}var A=e.innerFilterValue,P=A===void 0?{}:A,F={single:vu,multiple:Jo,input:yi}[C.filter.type]||C.filter.component;if(!(!F&&!C.filter.component)){var T=aa(aa({options:["single","multiple"].includes(C.filter.type)?(S=C.filter)===null||S===void 0?void 0:S.list:void 0},((D=C.filter)===null||D===void 0?void 0:D.props)||{}),{},{onChange:function(_,m){var h,g;if(a.emit("inner-filter-change",_,C),(h=C.filter.props)!==null&&h!==void 0&&h.onChange){var c,f;(c=(f=C.filter.props).onChange)===null||c===void 0||c.call(f,_,m)}(g=C.filter)!==null&&g!==void 0&&(g=g.confirmEvents)!==null&&g!==void 0&&g.includes("onChange")&&(v.value=!1)}});return C.colKey&&P&&C.colKey in P&&(T.value=P==null?void 0:P[C.colKey]),C.filter.confirmEvents&&C.filter.confirmEvents.forEach(function(I){I!=="onChange"&&(T[I]=function(){a.emit("confirm",C),v.value=!1})}),k("div",{class:e.tableFilterClasses.contentInner},[p(C,T,F)])}},w=function(C){if(!!C.filter.showConfirmAndReset)return k("div",{class:e.tableFilterClasses.bottomButtons},[k(pa,{theme:"default",size:"small",onClick:function(){a.emit("reset",C),v.value=!1}},{default:function(){return[i.value.resetText]}}),k(pa,{theme:"primary",size:"small",onClick:function(){a.emit("confirm",C),v.value=!1}},{default:function(){return[i.value.confirmText]}})])},y=function(){return k("div",{class:e.tableFilterClasses.popupContent},[b(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)||k(o,null,null),i=(e=this.tFilterValue)===null||e===void 0?void 0:e[n.colKey],u=vt(i)==="object"&&!ei(i),s=![null,void 0,""].includes(i)&&vt(i)!=="object";return k(mi,Ke({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[k("div",{ref:"triggerElementRef"},[a.renderTNode("filterIcon",{defaultNode:l,params:{col:n,colIndex:a.colIndex}})])]}})}});/**
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @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 ra(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){z(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 bl(t){var e=t instanceof Array&&t.length,a=vt(t)==="object"&&!(t instanceof Array),n=a&&Object.keys(t).length;return e||n||!["null","","undefined"].includes(String(t))}function ws(t){var e={};return Object.keys(t).forEach(function(a){var n=t[a];bl(n)&&(e[a]=n)}),e}function ys(t,e){var a=W(null),n=gt("table",t.locale),r=n.t,o=n.globalConfig,l=Un(),i=Ie(t),u=i.filterValue,s=i.columns,v=it(),d=v.tableFilterClasses,p=v.isFocusClass,b=W(),w=kt(u,t.defaultFilterValue,t.onFilterChange,"filterValue"),y=Pe(w,2),R=y[0],C=y[1],O=W(R.value),S=N(function(){var c=ws(R.value||{});return!R.value||!Object.keys(c).length});ce([R],function(c){var f=Pe(c,1),x=f[0];O.value=x});function D(){var c,f;if(S.value)return null;var x=k("div",{class:d.result},[k("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)})]),k(pa,{theme:"primary",variant:"text",onClick:I},{default:function(){return[o.value.clearFilterResultButtonText]}})]),E=l("filterRow");return t.filterRow&&!E||t.filterRow===null?null:k("div",{class:d.inner},[E||x])}function j(){var c=[],f=[];return A(t.columns,f),f.filter(function(x){return x.filter}).forEach(function(x,E){var L=R.value[x.colKey];if(x.filter.list&&!["null"].includes(String(L))){var K=L instanceof Array?L:[L],B=[];x.filter.list.forEach(function(ne){K.includes(ne.value)&&B.push(ne.label)}),L=B.join()}if(bl(L)){var $,Y,ee=Re(($=x.filter)===null||$===void 0?void 0:$.label)?x.filter.label(Ye):(Y=x.filter)===null||Y===void 0?void 0:Y.label,ae=Ea(e.slots,x,E);c.push("".concat(ee||ae,"\uFF1A").concat(L))}}),c.join("\uFF1B")}function A(c,f){c.forEach(function(x){x.children&&A(x.children,f),f.push(x)})}function P(c,f){var x=ra(ra({},O.value),{},z({},f.colKey,c));O.value=x,f.filter.showConfirmAndReset||F(x,"filter-change",f)}function F(c,f,x){var E;C(c,{col:x,trigger:f}),(E=t.onChange)===null||E===void 0||E.call(t,{filter:c},{trigger:"filter"})}function T(c){var f,x,E=ra(ra({},R.value),{},z({},c.colKey,(f=(x=c.filter.resetValue)!==null&&x!==void 0?x:{single:"",multiple:[],input:""}[c.filter.type])!==null&&f!==void 0?f:""));F(E,"reset",c)}function I(){var c=pl(s.value);F(c,"clear",void 0)}function _(c){F(O.value,"confirm",c)}function m(c){var f,x=c.col,E=c.colIndex;return k(ms,{column:x,colIndex:E,filterIcon:t.filterIcon,tFilterValue:R.value,innerFilterValue:O.value,tableFilterClasses:d,isFocusClass:p,popupProps:x.filter.popupProps,attach:t.attach,locale:t.locale,onReset:T,onConfirm:_,onInnerFilterChange:P,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&&!b.value&&(b.value=!c)}return{hasEmptyCondition:S,isTableOverflowHidden:b,renderFilterIcon:m,renderFirstFilterRow:D,setFilterPrimaryTableRef:h}}/**!
|
|
|
|
* Sortable 1.15.3
|
|
|
|
* @author RubaXa <trash@rubaxa.org>
|
|
|
|
* @author owenm <owen23355@gmail.com>
|
|
|
|
* @license MIT
|
|
|
|
*/function uo(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?uo(Object(a),!0).forEach(function(n){Cs(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):uo(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 Cs(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 xs(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 Ss(t,e){if(t==null)return{};var a=xs(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 Os="1.15.3";function Kt(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Mt=Kt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Gn=Kt(/Edge/i),so=Kt(/firefox/i),Mn=Kt(/safari/i)&&!Kt(/chrome/i)&&!Kt(/android/i),ml=Kt(/iP(ad|od|hone)/i),wl=Kt(/chrome/i)&&Kt(/android/i),yl={capture:!1,passive:!1};function Oe(t,e,a){t.addEventListener(e,a,!Mt&&yl)}function xe(t,e,a){t.removeEventListener(e,a,!Mt&&yl)}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 Cl(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=Cl(t))}return null}var co=/\s+/g;function ct(t,e,a){if(t&&e)if(t.classList)t.classList[a?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(co," ").replace(" "+e+" "," ");t.className=(n+(a?" "+e:"")).replace(co," ")}}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 On(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 xl(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 Ue(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 p=r.getBoundingClientRect();l-=p.top+parseInt(ie(r,"border-top-width")),i-=p.left+parseInt(ie(r,"border-left-width")),u=l+o.height,s=i+o.width;break}while(r=r.parentNode);if(n&&t!==window){var b=On(r||t),w=b&&b.a,y=b&&b.d;b&&
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function mo(t,e,a){var n=ve(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.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function wo(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?wo(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):wo(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}function yo(t){t.parentElement!==null&&t.parentElement.removeChild(t)}function Co(t,e,a){var n=a===0?t.children[0]:t.children[a-1].nextSibling;t.insertBefore(e,n)}function Us(t,e,a){var n=Ie(t),r=n.sortOnRowDraggable,o=n.dragSort,l=n.data,i=W(t.pagination),u=it(),s=u.tableDraggableClasses,v=u.tableBaseClass,d=u.tableFullRowClasses,p=u.tableExpandClasses,b=W(t.columns||[]),w=W(null),y=N(function(){return b.value.find(function(I){return I.colKey==="drag"})}),R=N(function(){return r.value||["row","row-handler-col"].includes(o.value)}),C=N(function(){return["row-handler","row-handler-col"].includes(o.value)&&!!y.value}),O=N(function(){return["col","row-handler-col"].includes(o.value)});t.sortOnRowDraggable&&ze.error("Table","`sortOnRowDraggable` is going to be deprecated, use dragSort='row' instead.");function S(I,_){var m,h,g=(m=_.current)!==null&&m!==void 0?m:_.defaultCurrent,c=(h=_.pageSize)!==null&&h!==void 0?h:_.defaultPageSize;return!t.disableDataPage&&_&&l.value.length>c?c*(g-1)+I:I}var D=function(_){if(!(!C.value&&!R.value)){var m=_==null?void 0:_.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(p.row),onMove:function(c){return!ti(c.related,d.base)},onEnd:function(c){var f;if(c.newIndex!==c.oldIndex){yo(c.item),Co(c.from,c.item,c.oldIndex);var x=c.oldIndex,E=c.newIndex;(Re(t.firstFullRow)&&t.firstFullRow(Ye)||e.slots.firstFullRow||e.slots["first-full-row"])&&(x-=1,E-=1),i.value&&(x=S(x,i.value),E=S(E,i.value));var L={data:l.value,currentIndex:x,current:l.value[x],targetIndex:E,target:l.value[E],newData:mo(ve(t.data),x,E),e:c,sort:"row"};L.currentData=L.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,L)}}},t.dragSortOptions);!m||(R.value?new oe(m,jn({},h)):new oe(m,jn(jn({},h),{},{handle:".".concat(s.handle)})))}},j=function(_,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&&(yo(c.item),Co(c.from,c.item,c.oldIndex));var x=c.oldIndex,E=c.newIndex,L=c.target,K=m?x:E,B=m?E:x,$=L.children[K],Y=L.children[B],ee=wa(b.value,$.dataset.colkey),ae=wa(b.value,Y.dataset.colkey);(!ee||!ee.colKey)&&ze.error("Table","colKey is missing in ".concat(JSON.stringify(ee))),(!ae||!ae.colKey)&&ze.error("Table","colKey is missing in ".concat(JSON.stringify(ae))),K=ao(t.columns,ee.colKey),B=ao(t.columns,ae.colKey);var ne={data:b.value,currentIndex:K,current:ee,targetIndex:B,target:ae,newData:mo(ve(t.columns),K,B),e:c,sort:"col"};ne.currentData=ne.newData,(f=t.onDragSort)===null||f===void 0||f.call(t,ne)}}},t.dragSortOptions);!_||new oe(_,h)},A=function(_){if(!(!O.value||!_)){var m=_.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 P(I){w.value=I}function F(I){b.value=I}ce([w,b,o,a],function(I){var _=Pe(I,4),m=_[0];_[1],_[2];var h=_[3];T(m,h)});function T(I,_){var m=I;if(!(!I||!m.$el||!_.showElement))var h=setTimeout(function(){D(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:R,isRowHandlerDraggable:C,isColDraggable:O,setDragSortPrimaryTableRef:P,setDragSortColumns:F}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/function Xs(t){var e=Yt(),a=gt("table",t.locale),n=a.globalConfig,r=it(),o=r.isLoadingClass,l=r.isLoadMoreClass,i=r.asyncLoadingClass,u=N(function(){return[i,z(z({},o,t.asyncLoading==="loading"),l,t.asyncLoading==="load-more")]});function s(){var d;!Lt(t.asyncLoading)||(d=t.onAsyncLoadingClick)===null||d===void 0||d.call(t,{status:t.asyncLoading})}function v(){var d=e("asyncLoading");if(Lt(d)){var p=t.asyncLoading,b={"load-more":n.value.loadingMoreText,loading:n.value.loadingText}[String(p)];return k("div",{class:u.value,onClick:s},[k(ko,{indicator:p==="loading",loading:!!p,size:"small",text:b},null)])}return[null,!1,void 0].includes(d)?null:k("div",{class:u.value,onClick:s},[d])}return{renderAsyncLoading:v}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/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 _e(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}var Gs=He({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=Ie(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=It(),p=_n({Edit1Icon:Pi}),b=p.Edit1Icon,w=function(f){if(vt(f)==="object"&&("rowValue"in f||f.isUpdateCurrentRow)){var x=f.isUpdateCurrentRow?H(o.value,e.rowKey):f.rowValue;delete f.rowValue,delete f.isUpdateCurrentRow,a.emit("update-edited-cell",x,o.value,f)}else s.value=f};ce([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({},R.value),{},{editedRow:C.value,updateEditedCellValue:w})))||{}}),R=N(function(){return{rowIndex:e.rowIndex,colIndex:e.colIndex,col:e.col,row:e.row}}),C=N(function(){var c=l.value.colKey,f=c.split(".")||[],x=gi(f),E=x[0],L=x.slice(1),K=_e({},o.value);return L.length?(K[E]=lr(o.value[E]),$n(K[E],L.join("."),s.value)):$n(K,c,s.value),K}),O=N(function(){var c=ma({row:C.value,col:_e(_e({},l.value),{},{cell:e.oldCell}),rowIndex:e.rowIndex,colIndex:e.colIndex},a.slots,{cellEmptyContent:e.cellEmptyContent});return c}),S=N(function(){var c=l.value.edit;return Re(c.props)?c.props(_e(_e({},R.value),{},{editedRow:C.value,updateEditedCellValue:w})):_e({},c.props)}),D=N(function(){var c,f=l.value.edit;if(!f)return{};var x=_e({},S.value);return delete x.onChange,delete x.value,(c=f.abortEditOnEvent)===null||c===void 0||c.forEach(function(E){delete x[E]}),x}),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(x){var E={result:[_e(_e({},R.value),{},{errorList:[],value:s.value})],trigger:f},L=Re(l.value.edit.rules)?l.value.edit.rules(R.value):l.value.edit.rules;if(!l.value.edit||!L||!L.length){var K;(K=e.onValidate)===null||K===void 0||K.call(e,E),x(!0);return}tl(s.value,L).then(function(B){var $,Y=B==null?void 0:B.filter(function(ee){return!ee.result});E.result[0].errorList=Y,($=e.onValidate)===null||$===void 0||$.call(e,E),!Y||!Y.length?(v.value=[],x(!0)):(v.value=Y,x(Y))})})},P=function(f,x){return Xa(f)&&Xa(x)?JSON.stringify(f)===JSON.stringify(x):f===x},F=function(f,x){for(var E=arguments.length,L=new Array(E>2?E-2:0),K=2;K<E;K++)L[K-2]=arguments[K];A("self").then(function(B){var $,Y;if(B===!0){var ee=H(o.value,l.value.colKey);P(s.value,ee)||(s.value=ee,f==null||f.apply(void 0,L)),($=(Y=y.value)[x])===null||$===void 0||$.call(Y,L[2]);var ae=setTimeout(function(){var ne;i.value||(u.value=!1),v.value=[],(ne=e.onEditableChange)===null||ne===void 0||ne.call(e,_e(_e({},R.value),{},{value:s.value,editedRow:_e(_e({},e.row),{},z({},e.col.colKey,s.value)),validateEdit:A,isEdit:!1})),clearTimeout(ae)},0)}})},T=N(function(){var c,f=l.value.edit,x=e.editable===void 0;if(!(!u.value||!x)){if(!(f!=null&&(c=f.abortEditOnEvent)!==null&&c!==void 0&&c.length))return{};var E={},L=f==null?void 0:f.onEdited;return f.abortEditOnEvent.forEach(function(K){K!=="onChange"&&(E[K]=function(){for(var B=arguments
|
2024-09-02 02:23:47 +00:00
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 Fn(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}function Ys(t){var e=Ie(t),a=e.editableRowKeys,n=new Map,r=W({}),o=N(function(){return vs(t.editableRowKeys,t.data,t.rowKey||"id")}),l=W({}),i=W({}),u=function(S){var D={};return S.forEach(function(j){var A=j.row,P=j.col,F=j.errorList,T=H(A,t.rowKey||"id"),I=[T,P.colKey].join("__");F!=null&&F.length?D[I]=F:delete D[I]}),D},s=function(S){var D=n.get(S);if(!!D){var j=D.map(function(A){return new Promise(function(P){var F=A.editedRow,T=A.col,I=Re(T.edit.rules)?T.edit.rules(A):T.edit.rules;if(!T.edit||!I||!I.length){P(Fn(Fn({},A),{},{errorList:[]}));return}tl(H(F,T.colKey),I).then(function(_){P(Fn(Fn({},A),{},{errorList:_.filter(function(m){return!m.result})}))})})});return new Promise(function(A,P){Promise.all(j).then(function(F){A({errors:F.filter(function(T){var I;return(I=T.errorList)===null||I===void 0?void 0:I.length}),errorMap:u(F)})},P)})}},v=function(S){return new Promise(function(D,j){s(S).then(function(A){var P,F=A.errors,T=A.errorMap;r.value=T;var I="parent";(P=t.onRowValidate)===null||P===void 0||P.call(t,{trigger:I,result:F}),D({trigger:I,result:F})},j)})},d=function(){var S=Object.keys(l.value),D=S.map(function(j){return l.value[j].validateEdit("parent")});return new Promise(function(j,A){Promise.all(D).then(function(P){var F,T={};P.forEach(function(I,_){I!==!0&&(T[S[_]]=I)}),(F=t.onValidate)===null||F===void 0||F.call(t,{result:T}),j({result:T})},A)})},p=function(){if(Object.keys(l.value).length)return d();for(var S=[],D=t.data||[],j=0,A=D.length;j<A;j++){var P=H(D[j],t.rowKey||"id");S.push(s(P))}return new Promise(function(F,T){Promise.all(S).then(function(I){var _,m={};I.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,(_=t.onValidate)===null||_===void 0||_.call(t,{result:m}),F({result:m})},T)})},b=function(S,D,j){i.value[S]||(i.value[S]=lr(D)),Object.entries(j).forEach(function(A){var P=Pe(A,2),F=P[0],T=P[1];$n(i.value[S],F,T)})},w=function(S){if(t.editableRowKeys){var D=H(S.row,t.rowKey||"id"),j=n.get(D);if(j){var A=j.findIndex(function(P){return P.col.colKey===S.col.colKey});A===-1?j.push(S):j[A]=S,n.set(D,j)}else n.set(D,[S])}},y=function(){r.value={}},R=function(S){var D=Vn(S.row,t.rowKey,S.col.colKey,S.colIndex);S.isEdit?l.value[D]=S:delete l.value[D]},C=function(S){var D,j=S.row,A=S.col,P=H(j,t.rowKey||"id"),F=i.value[P];if(F&&(D=t.editableRowKeys)!==null&&D!==void 0&&D.includes(P)){var T=Fn({},F);return $n(T,A.colKey,H(F,A.colKey)),T}return j};return ce(function(){var O;return(O=a.value)===null||O===void 0?void 0:O.join(",")},function(O){var S=O.split(","),D=Object.keys(i.value);D.forEach(function(j){S.includes(j)||delete i.value[j]})}),{editedFormData:i,errorListMap:r,editableKeysMap:o,validateTableData:p,validateRowData:v,onRuleChange:w,clearValidateData:y,onUpdateEditedCell:b,getEditRowData:C,onPrimaryTableCellEditChange:R}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 jt(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 qs=["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"],pr=He({name:"TPrimaryTable",props:jt(jt({},Rn),gl),setup:function(e,a){var n=Yt(),r=Ie(e),o=r.columns,l=r.columnController,i=W(null),u=W(!1),s=it(),v=s.classPrefix,d=s.tableDraggableClasses,p=s.tableBaseClass,b=s.tableSelectedClasses,w=s.tableSortClasses,y=gt("table",e.locale),R=y.globalConfig,C=fl(e),O=C.sizeClassNames,S=N(function(){var ye;return(ye=e.size)!==null&&ye!==void 0?ye:R.value.size}),D=cs(e,a),j=D.tDisplayColumns,A=D.renderColumnController,P=ds(e,a),F=P.showExpandedRow,T=P.showExpandIconColumn,I=P.getExpandColumn,_=P.renderExpandedRow,m=P.onInnerExpandRowClick,h=bs(e,a),g=h.renderSortIcon,c=fs(e,b),f=c.selectColumn,x=c.showRowSelect,E=c.selectedRowClassNames,L=c.currentPaginateData,K=c.formatToRowSelectColumn,B=c.setTSelectedRowKeys,$=c.onInnerSelectRowClick,Y=c.handleRowSelectWithAreaSelection,ee=ys(e,a),ae=ee.hasEmptyCondition,ne=ee.isTableOverflowHidden,Q=ee.renderFilterIcon,M=ee.renderFirstFilterRow,X=ee.setFilterPrimaryTableRef,q=N(function(){return{showElement:u.value}}),Z=Us(e,a,q),fe=Z.isRowHandlerDraggable,he=Z.isRowDraggable,Le=Z.isColDraggable,We=Z.innerPagination,qe=Z.setDragSortPrimaryTableRef,Ne=Z.setDragSortColumns,nt=il(e),ut=nt.renderTitleWidthIcon,st=Xs(e),Tt=st.renderAsyncLoading,je=Ys(e),Dn=je.errorListMap,Tn=je.editableKeysMap,Pn=je.validateRowData,re=je.validateTableData,V=je.onRuleChange,G=je.clearValidateData,J=je.onUpdateEditedCell,te=je.getEditRowData,le=je.onPrimaryTableCellEditChange,ge=N(function(){return Boolean(F.value||x.value)}),pe=N(function(){return Boolean(F.value||x.value)}),ue=N(function(){var ye;return z(z(z(z(z(z(z(z({},d.colDraggable,Le.value),d.rowHandlerDraggable,fe.value),d.rowDraggable,he.value),p.overflowVisible,ne.value===!1),p.tableRowEdit,e.editableRowKeys),"".concat(v,"-table--select-").concat((ye=f.value)===null||ye===void 0?void 0:ye.type),f.value),"".concat(v,"-table--row-select"),x.value),"".concat(v,"-table--row-expandable"),F.value)}),we=N(function(){var ye=[e.rowClassName,E.value];return ye.filter(function(de){return de})}),Ee=N(function(){var ye=[e.rowAttributes];return(fe.value||he.value)&&ye.push(function(de){var Fe=de.row;return{"data-id":H(Fe,e.rowKey||"id")}}),ye.filter(function(de){return de})});pt(function(){X(i.value),qe(i.value)}),a.expose({validateRowData:Pn,validateTableData:re,clearValidateData:G,refreshTable:function(){i.value.refreshTable()},scrollToElement:function(de){i.value.scrollToElement(de)},scrollColumnIntoView:function(de){i.value.scrollColumnIntoView(de)},baseTableRef:i});var Ae=function(de){var Fe;(Fe=e.onRowEdit)===null||Fe===void 0||Fe.call(e,de);var Je=H(de.editedRow,e.rowKey||"id");J(Je,de.row,z({},de.col.colKey,de.valu
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var Js={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.9
|
|
|
|
* (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 sa(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}var Eo={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 Zs=function(){function t(){ri(this,t),z(this,"treeDataMap",new Map),z(this,"expandAllRowIndex",void 0),this.treeDataMap=new Map}return ai(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 ze.error("EnhancedTable","the node toggleExpanded doest not exist in `data`"),n;var i=H(a.row,r.rowKey);if(Sn(i))return ze.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)rr(u,a,i,r),mn(u,o,s.length,"expand",r),n.splice.apply(n,[l+1,0].concat(s));else{rr(u,a,i,r);var v=a.expandChildrenLength||s.length;mn(u,o,-1*v,"fold",r),n.splice(l+1,v)}return ln(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 Kl(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),p=this.treeDataMap.get(d);p&&this.treeDataMap.delete(d)}}var b=i.rowIndex;if(i.row=n,i.id=l,i.parent){var w=H(i.parent.row,o.childrenKey),y=w.findIndex(function(R){return Ft(R,o.rowKey)===a});w[y]=n}return this.treeDataMap.set(l,i),a!==l&&this.treeDataMap.delete(a),b}},{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),mn(this.treeDataMap,o.parent.row,-1*l,"delete",r)}this.treeDataMap.delete(a),ln(this.treeDat
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 Va(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}function ec(t,e){var a=e.store,n=e.dataSource,r=e.rowDataKeys,o=Ie(t),l=o.data,i=o.expandedTreeNodes,u=o.tree,s=W(!1),v=W(!1),d=kt(i,t.defaultExpandedTreeNodes,t.onExpandedTreeNodesChange,"expandedTreeNodes"),p=Pe(d,2),b=p[0],w=p[1],y=W({type:"props-change"});function R(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"expand-all",A=arguments.length>1?arguments[1]:void 0,P=A||l.value;n.value=a.value.expandAll(P,r.value);var F=n.value.map(function(T){return Ft(T,r.value.rowKey)});w(F,{row:void 0,rowState:void 0,rowIndex:void 0,type:"expand",trigger:j}),y.value.type="expand-all"}function C(){n.value=ve(a.value.foldAll(n.value,r.value)),w([],{row:void 0,rowState:void 0,rowIndex:void 0,type:"fold",trigger:"fold-all"})}function O(j,A){var P,F=j.row,T=j.rowIndex;y.value=Va({type:"user-reaction-change"},j);var I=Ft(F,r.value.rowKey),_=a.value.treeDataMap.get(I),m=ve(b.value);if(_.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(I);var x={row:F,rowIndex:T,rowState:_,trigger:A};w(m,Va(Va({},x),{},{type:_.expanded?"fold":"expand"})),(P=t.onTreeExpandChange)===null||P===void 0||P.call(t,x)}function S(j,A){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],F=Qs(A,P),T=F.addedList,I=F.removedList;return a.value.expandTreeNode(T,j,r.value),a.value.foldTreeNode(I,j,r.value),ve(j)}ce([b,l],function(j,A){var P=Pe(j,1),F=P[0],T=Pe(A,1),I=T[0];if(!(!a.value.treeDataMap.size||!l.value.length)){if(y.value.type==="user-reaction-change"){var _=y.value||{},m=_.row,h=_.rowIndex;n.value=ve(a.value.toggleExpandData({row:m,rowIndex:h},ve(n.value),r.value))}else y.value.type==="props-change"&&S(n.value,F,I);y.value.type="props-change"}});var D=function(A){var P,F;(P=u.value)!==null&&P!==void 0&&P.defaultExpandAll&&!s.value?(R("default-expand-all",ve(A)),s.value=!0):(F=b.value)!==null&&F!==void 0&&F.length&&Gt(function(){n.value=S(ve(A),b.value,[])})};return{tExpandedTreeNode:b,isDefaultExpandAllExecute:s,isDefaultExpandedTreeNodesExecute:v,expandAll:R,foldAll:C,onExpandFoldIconClick:O,updateExpandOnDataChange:D}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 ft(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 tc(t,e){var a=Ie(t),n=a.data,r=a.columns,o=gt("table",t.locale),l=o.t,i=o.globalConfig,u=_n({AddRectangleIcon:Oi,MinusRectangleIcon:Li}),s=u.AddRectangleIcon,v=u.MinusRectangleIcon,d=W(new Zs),p=vi(),b=W([]),w=it(),y=w.tableTreeClasses,R=Un(),C=N(function(){var M;return{rowKey:t.rowKey||"id",childrenKey:((M=t.tree)===null||M===void 0?void 0:M.childrenKey)||"children"}}),O=ec(t,{store:d,dataSource:b,rowDataKeys:C}),S=O.tExpandedTreeNode,D=O.isDefaultExpandAllExecute,j=O.isDefaultExpandedTreeNodesExecute,A=O.expandAll,P=O.foldAll,F=O.updateExpandOnDataChange,T=O.onExpandFoldIconClick,I=N(function(){return r.value.find(function(M){return M.colKey==="row-select"})});ce(I,function(M){!d.value||d.value.updateDisabledState(b.value,M,C.value)});var _=function(X){var q=ft(ft({},X),{},{type:"fold"}),Z=l(i.value.treeExpandAndFoldIcon,Ye,q)||k(v,null,null);return R("treeExpandAndFoldIcon",{defaultNode:Z,params:q})},m=function(X){var q=ft(ft({},X),{},{type:"expand"}),Z=l(i.value.treeExpandAndFoldIcon,Ye,q)||k(s,null,null);return R("treeExpandAndFoldIcon",{defaultNode:Z,params:q})};ce([n],function(){t.tree?h(n.value):b.value=n.value},{immediate:!0}),No(function(){var M;!t.tree||((M=d.value.treeDataMap)===null||M===void 0||M.clear(),d.value=null)}),ce(function(){var M;return[r,(M=t.tree)===null||M===void 0?void 0:M.treeNodeColumnIndex]},function(){p.value=f()},{immediate:!0});function h(M){var X,q=t.columns,Z=t.expandedTreeNodes,fe=t.defaultExpandedTreeNodes,he=t.tree;d.value.initialTreeStore(M,q,C.value);var Le=Boolean(!j.value&&(fe==null?void 0:fe.length)),We=Boolean((he==null?void 0:he.defaultExpandAll)&&!D.value);(X=S.value)!==null&&X!==void 0&&X.length&&!!(Z||Le)||We?(F(M),j.value=!0):b.value=ve(M)}function g(M){var X,q;if(M!==void 0){var Z=((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 Z?{paddingLeft:"".concat(M*Z||1,"px")}:{}}}function c(M,X){var q,Z,fe=ft({},M);M.row.VIRTUAL_SCROLL_INDEX!==void 0&&(fe.rowIndex=M.row.VIRTUAL_SCROLL_INDEX),b.value=ve(d.value.toggleExpandData(fe,b.value,C.value));var he=H(M.row,C.value.rowKey),Le=(q=d.value)===null||q===void 0||(q=q.treeDataMap)===null||q===void 0?void 0:q.get(he);(Z=t.onTreeExpandChange)===null||Z===void 0||Z.call(t,{row:M.row,rowIndex:M.rowIndex,rowState:Le,trigger:X})}function f(){for(var M,X=t.columns,q=((M=t.tree)===null||M===void 0?void 0:M.treeNodeColumnIndex)||0;(Z=X[q])!==null&&Z!==void 0&&Z.type||((fe=X[q])===null||fe===void 0?void 0:fe.colKey)==="__EXPAND_ROW_ICON_COLUMN__";){var Z,fe;q+=1}return X[q]}function x(M){if(!t.tree||M.colKey!==p.value.colKey)return M;var X=ft({},p.value);return X.cell=function(q,Z){var fe=ma(ft(ft({},Z),{},{col:ft({},p.value)}),e.slots,{cellEmptyContent:t.cellEmptyContent}),he=d.value.treeDataMap.get(H(Z.row,C.value.rowKey)),Le=g(he==null?void 0:he.level),We=z({},y.inlineCol,!!M.ellipsis),qe=H(Z.row,C.value.childrenKey);if(qe&&qe instanceof Array||qe===!0){var Ne,nt=(Ne=d.value.treeDataMap.get(H(Z.row,C.value.rowKey)))!==null&&Ne!==void 0&&Ne.expanded?_(Z):m(Z);return k("div",{class:[y.col,We],style:Le},[!!(qe.length||qe===!0)&&k("span",{class:y.icon,onClick:function(st){T(Z,"expand-fold-icon"),st.stopPropagation()}},[nt]),fe])}return k("div",{style:Le,class:[We,y.leafNode]},[k("span",{class:y.icon},null),fe])},X.ellipsis===!0&&(X.ellipsis=function(q,Z){return ma(ft(ft({},Z),{},{col:ft({},p.value)}),e.slots)}),X}function E(M,X){var q=d.value.updateData(M,X,b.value,C.value),Z=ve(b.value);Z[q]=X,b.value=Z
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (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 ca(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 or=new Map;function kn(t,e,a,n){if(or.get(e))return or.get(e);var r=n||{allChildren:[],allChildrenKeys:[],leafNodeKeys:[]},o=H(e,a.childrenKey);if(!o||!o.length)return r;var l=o.filter(function(C){var O;return!((O=t.get(H(C,a.rowKey)))!==null&&O!==void 0&&O.disabled)});r.allChildren=ve(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=ve(new Set(r.allChildren.concat(d.allChildren)))}}for(var p=0,b=r.allChildren.length;p<b;p++){var w=r.allChildren[p],y=H(w,a.childrenKey),R=H(w,a.rowKey);r.allChildrenKeys.push(R),(!y||!y.length)&&r.leafNodeKeys.push(R)}return r.allChildrenKeys=ve(new Set(r.allChildrenKeys)),r.leafNodeKeys=ve(new Set(r.leafNodeKeys)),r}function nc(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 ac(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 rc(t,e){var a=Ie(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],p=N(function(){var O;return{rowKey:t.rowKey||"id",childrenKey:((O=t.tree)===null||O===void 0?void 0:O.childrenKey)||"children"}});ce([r,e,o,v],function(O){var S=Pe(O,2),D=S[0],j=S[1];!D||!j.size||D.checkStrictly||b()});function b(){if(!(!r.value||r.value.checkStrictly)){if(!v.value.length){i.value=[];return}for(var O=[],S={},D=0,j=v.value.length;D<j;D++){var A=v.value[D],P=e.value.get(A);if(!!P){var F=H(P.row,p.value.childrenKey);if(!F||!F.length)for(var T=P.parent;T;){S[T.id]||(S[T.id]=[]),S[T.id].push(P.row);var I=S[T.id].length,_=kn(e.value,T.row,p.value),m=_.allChildrenKeys,h=O.indexOf(T.id),g=v.value.indexOf(T.id);I>0&&I<m.length&&g===-1?h===-1&&O.push(T.id):h!==-1&&O.splice(h,1),T=T.parent}}}i.value=O}}function w(O,S,D){if(!(!r.value||r.value.checkStrictly)){for(var j=ve(O),A=e.value.get(S),P=A.parent;P;){var F=kn(e.value,P.row,p.value),T=F.leafNodeKeys,I=ba(T,O),_=j.indexOf(P.id);D==="uncheck"?_!==-1&&j.splice(_,1):I.length===T.length&&_===-1&&j.push(P.id),P=P.parent}return j}}function y(O,S){if(!r.value||r.value.checkStrictly){d(O,S);return}S.currentRowKey==="CHECK_ALL_BOX"?R(S):C(O,S)}function R(O){var S=[],D=[];if(O.type==="check")for(var j=ve(e.value.values()),A=0,P=j.length;A<P;A++){var F=j[A];F.disabled||(D.push(F.row),S.push(H(F.row,p.value.rowKey)))}var T=ca(ca({},O),{},{selectedRowData:D||[]});d(S,T)}function C(O,S){var D,j=ve(O);if(((D=t.tree)===null||D===void 0?void 0:D.checkStrictly)===!1){if((S==null?void 0:S.type)==="check"){var A=kn(e.value,S.currentRowData,p.value),P=A.allChildrenKeys;or.set(S.currentRowData,A),j=ve(new Set(j.concat(P)))}else if((S==null?void 0:S.type)==="uncheck"){var F=kn(e.value,S.currentRowData,p.value),T=nc({selectedRowKeys:O,removeKeys:F.allChildrenKeys});j=T.keys}}j=w(j,S.currentRowKey,S.type);var I=ac({treeDataMap:e.value,selectedRowKeys:j}),_=ca(ca({},S),{},{selectedRowData:I});d(j,_)}return{tIndeterminateSelectedRowKeys:l.value?l:i,onInnerSelectChange:y}}/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
|
|
|
*/var oc=["store","dataSource","formatTreeColumn","swapData","onExpandFoldIconClick"];function Po(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,n)}return a}function Et(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Po(Object(a),!0).forEach(function(n){z(t,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Po(Object(a)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(a,n))})}return t}var lc=He({name:"TEnhancedTable",props:Et(Et(Et({},Rn),gl),Js),setup:function(e,a){var n=W(null),r=tc(e,a),o=r.store,l=r.dataSource,i=r.formatTreeColumn,u=r.swapData,s=r.onExpandFoldIconClick,v=el(r,oc),d=It(),p=W(o.value.treeDataMap),b=rc(e,p),w=b.tIndeterminateSelectedRowKeys,y=b.onInnerSelectChange,R=function(P){for(var F=[],T=0,I=P.length;T<I;T++){var _,m,h=Et({},P[T]);h=i(h),(_=h.children)!==null&&_!==void 0&&_.length&&(h.children=R(h.children)),(!h.children||(m=h.children)!==null&&m!==void 0&&m.length)&&F.push(h)}return F},C=N(function(){var A=!e.tree||!Object.keys(e.tree).length;return A?e.columns:R(e.columns)}),O=function(P){var F;e.beforeDragSort&&!e.beforeDragSort(P)||(u({current:P.current,target:P.target,currentIndex:P.currentIndex,targetIndex:P.targetIndex}),(F=e.onDragSort)===null||F===void 0||F.call(e,P))},S=function(P){var F,T;(F=e.tree)!==null&&F!==void 0&&F.expandTreeNodeOnClick&&s({row:P.row,rowIndex:P.index},"row-click"),(T=e.onRowClick)===null||T===void 0||T.call(e,P)},D=function(P,F){if(!P)return-1;if(P.rowIndex>=0)return P.rowIndex;if(P.rowIndex<0)return D(P.parent)},j=function(P){var F=P.index;if(!F&&F!==0){if(!P.key){ze.error("Table","scrollToElement: one of `index` or `key` must exist.");return}var T=p.value.get(P.key);F=D(T,P.key),(F<0||F===void 0)&&ze.error("Table","".concat(P.key," does not exist in data, check `rowKey` or `data` please."))}n.value.scrollToElement(Et(Et({},P),{},{index:F}))};return a.expose(Et(Et({store:o.value,dataSource:l.value},v),{},{primaryTableRef:n,validateRowData:function(P){return n.value.validateRowData(P)},validateTableData:function(){return n.value.validateTableData()},clearValidateData:function(){n.value.clearValidateData()},refreshTable:function(){n.value.refreshTable()},scrollToElement:j})),function(){var A,P=Bo(),F=P.vnode,T=Et(Et({},F.props),{},{rowKey:e.rowKey||"id",data:l.value,columns:C.value,indeterminateSelectedRowKeys:w.value,disableDataPage:Boolean(e.tree&&Object.keys(e.tree).length),onSelectChange:y,onDragSort:O,rowClassName:function(_){var m=_.row,h=H(m,e.rowKey||"id"),g=p.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&&(T.onRowClick=S),k(pr,Ke(T,{ref:n}),a.slots)}}});/**
|
|
|
|
* tdesign v1.9.9
|
|
|
|
* (c) 2024 tdesign
|
|
|
|
* @license MIT
|
2024-10-09 15:16:10 +00:00
|
|
|
*/qt(hl);qt(pr);qt(lc);var ic=lr(pr),gc=qt(ic,"TTable");export{hc as M,gc as T};
|