@hpcc-js/dgrid2 3.1.1 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2967 -378
- package/dist/index.js.map +1 -7
- package/dist/index.umd.cjs +32 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +22 -14
- package/src/hooks.ts +1 -3
- package/src/reactTable.tsx +13 -13
- package/src/table.ts +7 -4
- package/types/reactTable.d.ts +2 -2
- package/types/table.d.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1,459 +1,3048 @@
|
|
|
1
|
-
var $r=Object.defineProperty;var l=(e,t)=>$r(e,"name",{value:t,configurable:!0});var as="@hpcc-js/dgrid2",cs="3.1.1",ds="3.2.1";var wt,F,Bn,Wr,ve,Vn,qn,qt,Jt,Yt,Xt,Yn,Je={},Xn=[],Ur=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vt=Array.isArray;function ge(e,t){for(var n in t)e[n]=t[n];return e}l(ge,"d");function Zn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}l(Zn,"w");function ee(e,t,n){var o,r,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?wt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return bt(e,a,o,r,null)}l(ee,"_");function bt(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++Bn,__i:-1,__u:0};return r==null&&F.vnode!=null&&F.vnode(i),i}l(bt,"g");function Z(e){return e.children}l(Z,"b");function se(e,t){this.props=e,this.context=t}l(se,"k");function Me(e,t){if(t==null)return e.__?Me(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Me(e):null}l(Me,"x");function Jn(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Jn(e)}}l(Jn,"C");function Zt(e){(!e.__d&&(e.__d=!0)&&ve.push(e)&&!Ct.__r++||Vn!==F.debounceRendering)&&((Vn=F.debounceRendering)||qn)(Ct)}l(Zt,"S");function Ct(){var e,t,n,o,r,i,a,c;for(ve.sort(qt);e=ve.shift();)e.__d&&(t=ve.length,o=void 0,i=(r=(n=e).__v).__e,a=[],c=[],n.__P&&((o=ge({},r)).__v=r.__v+1,F.vnode&&F.vnode(o),Qt(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[i]:null,a,i??Me(r),!!(32&r.__u),c),o.__v=r.__v,o.__.__k[o.__i]=o,to(a,o,c),o.__e!=i&&Jn(o)),ve.length>t&&ve.sort(qt));Ct.__r=0}l(Ct,"M");function Qn(e,t,n,o,r,i,a,c,u,d,C){var s,g,f,x,R,m=o&&o.__k||Xn,h=t.length;for(n.__d=u,Gr(n,t,m),u=n.__d,s=0;s<h;s++)(f=n.__k[s])!=null&&(g=f.__i===-1?Je:m[f.__i]||Je,f.__i=s,Qt(e,f,g,r,i,a,c,u,d,C),x=f.__e,f.ref&&g.ref!=f.ref&&(g.ref&&en(g.ref,null,f),C.push(f.ref,f.__c||x,f)),R==null&&x!=null&&(R=x),65536&f.__u||g.__k===f.__k?u=eo(f,u,e):typeof f.type=="function"&&f.__d!==void 0?u=f.__d:x&&(u=x.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=u,n.__e=R}l(Qn,"P");function Gr(e,t,n){var o,r,i,a,c,u=t.length,d=n.length,C=d,s=0;for(e.__k=[],o=0;o<u;o++)(r=t[o])!=null&&typeof r!="boolean"&&typeof r!="function"?(a=o+s,(r=e.__k[o]=typeof r=="string"||typeof r=="number"||typeof r=="bigint"||r.constructor==String?bt(null,r,null,null,null):vt(r)?bt(Z,{children:r},null,null,null):r.constructor===void 0&&r.__b>0?bt(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=e,r.__b=e.__b+1,i=null,(c=r.__i=Vr(r,n,a,C))!==-1&&(C--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&s--,typeof r.type!="function"&&(r.__u|=65536)):c!==a&&(c==a-1?s--:c==a+1?s++:(c>a?s--:s++,r.__u|=65536))):r=e.__k[o]=null;if(C)for(o=0;o<d;o++)(i=n[o])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=Me(i)),no(i,i))}l(Gr,"$");function eo(e,t,n){var o,r;if(typeof e.type=="function"){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,t=eo(o[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=Me(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}l(eo,"I");function Qe(e,t){return t=t||[],e==null||typeof e=="boolean"||(vt(e)?e.some(function(n){Qe(n,t)}):t.push(e)),t}l(Qe,"H");function Vr(e,t,n,o){var r=e.key,i=e.type,a=n-1,c=n+1,u=t[n];if(u===null||u&&r==u.key&&i===u.type&&!(131072&u.__u))return n;if(o>(u!=null&&!(131072&u.__u)?1:0))for(;a>=0||c<t.length;){if(a>=0){if((u=t[a])&&!(131072&u.__u)&&r==u.key&&i===u.type)return a;a--}if(c<t.length){if((u=t[c])&&!(131072&u.__u)&&r==u.key&&i===u.type)return c;c++}}return-1}l(Vr,"L");function jn(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ur.test(t)?n:n+"px"}l(jn,"T");function yt(e,t,n,o,r){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||jn(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||jn(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=Jt,e.addEventListener(t,i?Xt:Yt,i)):e.removeEventListener(t,i?Xt:Yt,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}l(yt,"A");function Kn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Jt++;else if(t.t<n.u)return;return n(F.event?F.event(t):t)}}}l(Kn,"F");function Qt(e,t,n,o,r,i,a,c,u,d){var C,s,g,f,x,R,m,h,w,z,v,S,P,b,y,E,I=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[c=t.__e=n.__e]),(C=F.__b)&&C(t);e:if(typeof I=="function")try{if(h=t.props,w="prototype"in I&&I.prototype.render,z=(C=I.contextType)&&o[C.__c],v=C?z?z.props.value:C.__:o,n.__c?m=(s=t.__c=n.__c).__=s.__E:(w?t.__c=s=new I(h,v):(t.__c=s=new se(h,v),s.constructor=I,s.render=Kr),z&&z.sub(s),s.props=h,s.state||(s.state={}),s.context=v,s.__n=o,g=s.__d=!0,s.__h=[],s._sb=[]),w&&s.__s==null&&(s.__s=s.state),w&&I.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ge({},s.__s)),ge(s.__s,I.getDerivedStateFromProps(h,s.__s))),f=s.props,x=s.state,s.__v=t,g)w&&I.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),w&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(w&&I.getDerivedStateFromProps==null&&h!==f&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(h,v),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(h,s.__s,v)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(s.props=h,s.state=s.__s,s.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(N){N&&(N.__=t)}),S=0;S<s._sb.length;S++)s.__h.push(s._sb[S]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(h,s.__s,v),w&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(f,x,R)})}if(s.context=v,s.props=h,s.__P=e,s.__e=!1,P=F.__r,b=0,w){for(s.state=s.__s,s.__d=!1,P&&P(t),C=s.render(s.props,s.state,s.context),y=0;y<s._sb.length;y++)s.__h.push(s._sb[y]);s._sb=[]}else do s.__d=!1,P&&P(t),C=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++b<25);s.state=s.__s,s.getChildContext!=null&&(o=ge(ge({},o),s.getChildContext())),w&&!g&&s.getSnapshotBeforeUpdate!=null&&(R=s.getSnapshotBeforeUpdate(f,x)),Qn(e,vt(E=C!=null&&C.type===Z&&C.key==null?C.props.children:C)?E:[E],t,n,o,r,i,a,c,u,d),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),m&&(s.__E=s.__=null)}catch(N){if(t.__v=null,u||i!=null){for(t.__u|=u?160:128;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;i[i.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;F.__e(N,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=jr(n.__e,t,n,o,r,i,a,u,d);(C=F.diffed)&&C(t)}l(Qt,"O");function to(e,t,n){t.__d=void 0;for(var o=0;o<n.length;o++)en(n[o],n[++o],n[++o]);F.__c&&F.__c(t,e),e.some(function(r){try{e=r.__h,r.__h=[],e.some(function(i){i.call(r)})}catch(i){F.__e(i,r.__v)}})}l(to,"j");function jr(e,t,n,o,r,i,a,c,u){var d,C,s,g,f,x,R,m=n.props,h=t.props,w=t.type;if(w==="svg"?r="http://www.w3.org/2000/svg":w==="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(d=0;d<i.length;d++)if((f=i[d])&&"setAttribute"in f==!!w&&(w?f.localName===w:f.nodeType===3)){e=f,i[d]=null;break}}if(e==null){if(w===null)return document.createTextNode(h);e=document.createElementNS(r,w,h.is&&h),c&&(F.__m&&F.__m(t,i),c=!1),i=null}if(w===null)m===h||c&&e.data===h||(e.data=h);else{if(i=i&&wt.call(e.childNodes),m=n.props||Je,!c&&i!=null)for(m={},d=0;d<e.attributes.length;d++)m[(f=e.attributes[d]).name]=f.value;for(d in m)if(f=m[d],d!="children"){if(d=="dangerouslySetInnerHTML")s=f;else if(!(d in h)){if(d=="value"&&"defaultValue"in h||d=="checked"&&"defaultChecked"in h)continue;yt(e,d,null,f,r)}}for(d in h)f=h[d],d=="children"?g=f:d=="dangerouslySetInnerHTML"?C=f:d=="value"?x=f:d=="checked"?R=f:c&&typeof f!="function"||m[d]===f||yt(e,d,f,m[d],r);if(C)c||s&&(C.__html===s.__html||C.__html===e.innerHTML)||(e.innerHTML=C.__html),t.__k=[];else if(s&&(e.innerHTML=""),Qn(e,vt(g)?g:[g],t,n,o,w==="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&Me(n,0),c,u),i!=null)for(d=i.length;d--;)Zn(i[d]);c||(d="value",w==="progress"&&x==null?e.removeAttribute("value"):x!==void 0&&(x!==e[d]||w==="progress"&&!x||w==="option"&&x!==m[d])&&yt(e,d,x,m[d],r),d="checked",R!==void 0&&R!==e[d]&&yt(e,d,R,m[d],r))}return e}l(jr,"z");function en(e,t,n){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(r){F.__e(r,n)}}l(en,"N");function no(e,t,n){var o,r;if(F.unmount&&F.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||en(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){F.__e(i,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&no(o[r],t,n||typeof e.type!="function");n||Zn(e.__e),e.__c=e.__=e.__e=e.__d=void 0}l(no,"V");function Kr(e,t,n){return this.constructor(e,n)}l(Kr,"q");function tn(e,t,n){var o,r,i,a;F.__&&F.__(e,t),r=(o=typeof n=="function")?null:n&&n.__k||t.__k,i=[],a=[],Qt(t,e=(!o&&n||t).__k=ee(Z,null,[e]),r||Je,Je,t.namespaceURI,!o&&n?[n]:r?null:t.firstChild?wt.call(t.childNodes):null,i,!o&&n?n:r?r.__e:t.firstChild,o,a),to(i,e,a)}l(tn,"B");function me(e,t){var n={__c:t="__cC"+Yn++,__:e,Consumer:l(function(o,r){return o.children(r)},"Consumer"),Provider:l(function(o){var r,i;return this.getChildContext||(r=new Set,(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(a){this.props.value!==a.value&&r.forEach(function(c){c.__e=!0,Zt(c)})},this.sub=function(a){r.add(a);var c=a.componentWillUnmount;a.componentWillUnmount=function(){r&&r.delete(a),c&&c.call(a)}}),o.children},"Provider")};return n.Provider.__=n.Consumer.contextType=n}l(me,"G");wt=Xn.slice,F={__e:l(function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(c){e=c}throw e},"__e")},Bn=0,Wr=l(function(e){return e!=null&&e.constructor==null},"t"),se.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ge({},this.state),typeof e=="function"&&(e=e(ge({},n),this.props)),e&&ge(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Zt(this))},se.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Zt(this))},se.prototype.render=Z,ve=[],qn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qt=l(function(e,t){return e.__v.__b-t.__v.__b},"f"),Ct.__r=0,Jt=0,Yt=Kn(!1),Xt=Kn(!0),Yn=0;var ye,W,nn,oo,Ae=0,fo=[],B=F,ro=B.__b,lo=B.__r,io=B.diffed,so=B.__c,ao=B.unmount,co=B.__;function Oe(e,t){B.__h&&B.__h(W,e,Ae||t),Ae=0;var n=W.__H||(W.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}l(Oe,"d");function K(e){return Ae=1,_o(po,e)}l(K,"h");function _o(e,t,n){var o=Oe(ye++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):po(void 0,t),function(c){var u=o.__N?o.__N[0]:o.__[0],d=o.t(u,c);u!==d&&(o.__N=[d,o.__[1]],o.__c.setState({}))}],o.__c=W,!W.u)){var r=l(function(c,u,d){if(!o.__c.__H)return!0;var C=o.__c.__H.__.filter(function(g){return!!g.__c});if(C.every(function(g){return!g.__N}))return!i||i.call(this,c,u,d);var s=!1;return C.forEach(function(g){if(g.__N){var f=g.__[0];g.__=g.__N,g.__N=void 0,f!==g.__[0]&&(s=!0)}}),!(!s&&o.__c.props===c)&&(!i||i.call(this,c,u,d))},"f");W.u=!0;var i=W.shouldComponentUpdate,a=W.componentWillUpdate;W.componentWillUpdate=function(c,u,d){if(this.__e){var C=i;i=void 0,r(c,u,d),i=C}a&&a.call(this,c,u,d)},W.shouldComponentUpdate=r}return o.__N||o.__}l(_o,"p");function be(e,t){var n=Oe(ye++,3);!B.__s&&sn(n.__H,t)&&(n.__=e,n.i=t,W.__H.__h.push(n))}l(be,"y");function Rt(e,t){var n=Oe(ye++,4);!B.__s&&sn(n.__H,t)&&(n.__=e,n.i=t,W.__h.push(n))}l(Rt,"_");function re(e){return Ae=5,Y(function(){return{current:e}},[])}l(re,"A");function rn(e,t,n){Ae=6,Rt(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}l(rn,"F");function Y(e,t){var n=Oe(ye++,7);return sn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}l(Y,"T");function de(e,t){return Ae=8,Y(function(){return e},t)}l(de,"q");function xe(e){var t=W.context[e.__c],n=Oe(ye++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(W)),t.props.value):e.__}l(xe,"x");function ln(){var e=Oe(ye++,11);if(!e.__){for(var t=W.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}l(ln,"g");function Br(){for(var e;e=fo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xt),e.__H.__h.forEach(on),e.__H.__h=[]}catch(t){e.__H.__h=[],B.__e(t,e.__v)}}l(Br,"j");B.__b=function(e){W=null,ro&&ro(e)},B.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),co&&co(e,t)},B.__r=function(e){lo&&lo(e),ye=0;var t=(W=e.__c).__H;t&&(nn===W?(t.__h=[],W.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(xt),t.__h.forEach(on),t.__h=[],ye=0)),nn=W},B.diffed=function(e){io&&io(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fo.push(t)!==1&&oo===B.requestAnimationFrame||((oo=B.requestAnimationFrame)||qr)(Br)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),nn=W=null},B.__c=function(e,t){t.some(function(n){try{n.__h.forEach(xt),n.__h=n.__h.filter(function(o){return!o.__||on(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],B.__e(o,n.__v)}}),so&&so(e,t)},B.unmount=function(e){ao&&ao(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{xt(o)}catch(r){t=r}}),n.__H=void 0,t&&B.__e(t,n.__v))};var uo=typeof requestAnimationFrame=="function";function qr(e){var t,n=l(function(){clearTimeout(o),uo&&cancelAnimationFrame(t),setTimeout(e)},"r"),o=setTimeout(n,100);uo&&(t=requestAnimationFrame(n))}l(qr,"w");function xt(e){var t=W,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),W=t}l(xt,"z");function on(e){var t=W;e.__c=e.__(),W=t}l(on,"B");function sn(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}l(sn,"C");function po(e,t){return typeof t=="function"?t(e):t}l(po,"D");function cn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}l(cn,"g");function ho(e,t){this.props=e,this.context=t}l(ho,"E");function Re(e,t){function n(r){var i=this.props.ref,a=i==r.ref;return!a&&i&&(i.call?i(null):i.current=null),t?!t(this.props,r)||!a:cn(this.props,r)}l(n,"r");function o(r){return this.shouldComponentUpdate=n,ee(e,r)}return l(o,"u"),o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}l(Re,"C");(ho.prototype=new se).isPureReactComponent=!0,ho.prototype.shouldComponentUpdate=function(e,t){return cn(this.props,e)||cn(this.state,t)};var go=F.__b;F.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),go&&go(e)};var Xr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function dn(e){function t(n){if(!("ref"in n))return e(n,null);var o=n.ref;delete n.ref;var r=e(n,o);return n.ref=o,r}return l(t,"t"),t.$$typeof=Xr,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}l(dn,"w");var Zr=F.__e;F.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}Zr(e,t,n,o)};var mo=F.unmount;function xo(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=function(o,r){for(var i in r)o[i]=r[i];return o}({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return xo(o,t,n)})),e}l(xo,"T");function Ro(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Ro(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}l(Ro,"A");function an(){this.__u=0,this.t=null,this.__b=null}l(an,"D");function ko(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}l(ko,"L");function kt(){this.u=null,this.o=null}l(kt,"F");F.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),mo&&mo(e)},(an.prototype=new se).__c=function(e,t){var n=t.__c,o=this;o.t==null&&(o.t=[]),o.t.push(n);var r=ko(o.__v),i=!1,a=l(function(){i||(i=!0,n.__R=null,r?r(c):c())},"i");n.__R=a;var c=l(function(){if(!--o.__u){if(o.state.__a){var u=o.state.__a;o.__v.__k[0]=Ro(u,u.__c.__P,u.__c.__O)}var d;for(o.setState({__a:o.__b=null});d=o.t.pop();)d.forceUpdate()}},"c");o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},an.prototype.componentWillUnmount=function(){this.t=[]},an.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=xo(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&ee(Z,null,e.fallback);return r&&(r.__u&=-33),[ee(Z,null,t.__a?null:e.children),r]};var yo=l(function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}},"U");(kt.prototype=new se).__a=function(e){var t=this,n=ko(t.__v),o=t.o.get(e);return o[0]++,function(r){var i=l(function(){t.props.revealOrder?(o.push(r),yo(t,e,o)):r()},"o");n?n(i):i()}},kt.prototype.render=function(e){this.u=null,this.o=new Map;var t=Qe(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},kt.prototype.componentDidUpdate=kt.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,n){yo(e,n,t)})};var Jr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Qr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,el=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tl=/[A-Z0-9]/g,nl=typeof document<"u",ol=l(function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)},"Y");function So(e,t,n){return t.__k==null&&(t.textContent=""),tn(e,t),typeof n=="function"&&n(),e?e.__c:null}l(So,"$");se.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(se.prototype,e,{configurable:!0,get:l(function(){return this["UNSAFE_"+e]},"get"),set:l(function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})},"set")})});var bo=F.event;function rl(){}l(rl,"J");function ll(){return this.cancelBubble}l(ll,"K");function il(){return this.defaultPrevented}l(il,"Q");F.event=function(e){return bo&&(e=bo(e)),e.persist=rl,e.isPropagationStopped=ll,e.isDefaultPrevented=il,e.nativeEvent=e};var Eo,sl={enumerable:!1,configurable:!0,get:l(function(){return this.class},"get")},Co=F.vnode;F.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,o=t.type,r={},i=o.indexOf("-")===-1;for(var a in n){var c=n[a];if(!(a==="value"&&"defaultValue"in n&&c==null||nl&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in n&&n.value==null?a="value":a==="download"&&c===!0?c="":u==="translate"&&c==="no"?c=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||o!=="input"&&o!=="textarea"||ol(n.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":el.test(a)&&(a=u):u=a="oninput":i&&Qr.test(a)?a=a.replace(tl,"-$&").toLowerCase():c===null&&(c=void 0),u==="oninput"&&r[a=u]&&(a="oninputCapture"),r[a]=c}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=Qe(n.children).forEach(function(d){d.props.selected=r.value.indexOf(d.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=Qe(n.children).forEach(function(d){d.props.selected=r.multiple?r.defaultValue.indexOf(d.props.value)!=-1:r.defaultValue==d.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",sl)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),t.props=r}(e),e.$$typeof=Jr,Co&&Co(e)};var wo=F.__r;F.__r=function(e){wo&&wo(e),Eo=e.__c};var vo=F.diffed;F.diffed=function(e){vo&&vo(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value),Eo=null};function Io(e){return!!e.__k&&(tn(null,e),!0)}l(Io,"hn");var et=l(function(e,t){return e(t)},"pn");import{HTMLWidget as is}from"@hpcc-js/common";function Do(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Do(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}l(Do,"r");function al(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Do(e))&&(o&&(o+=" "),o+=t);return o}l(al,"clsx");var fe=al;var cl=0,Is=Array.isArray;function H(e,t,n,o,r,i){t||(t={});var a,c,u=t;"ref"in t&&(a=t.ref,delete t.ref);var d={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--cl,__i:-1,__u:0,__source:r,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(c in a)u[c]===void 0&&(u[c]=a[c]);return F.vnode&&F.vnode(d),d}l(H,"u");function le(e,t,n){let o=typeof e.colSpan=="function"?e.colSpan(n):1;if(Number.isInteger(o)&&o>1&&(!e.frozen||e.idx+o-1<=t))return o}l(le,"getColSpan");function dl(e){e.stopPropagation()}l(dl,"stopPropagation");function St(e){e?.scrollIntoView({inline:"nearest",block:"nearest"})}l(St,"scrollIntoView");function tt(e){let t=!1,n={...e,preventGridDefault(){t=!0},isGridDefaultPrevented(){return t}};return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),n}l(tt,"createCellEvent");var ul=new Set(["Unidentified","Alt","AltGraph","CapsLock","Control","Fn","FnLock","Meta","NumLock","ScrollLock","Shift","Tab","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp","Insert","ContextMenu","Escape","Pause","Play","PrintScreen","F1","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]);function pn(e){return(e.ctrlKey||e.metaKey)&&e.key!=="Control"}l(pn,"isCtrlKeyHeldDown");function fl(e){return pn(e)&&e.keyCode!==86?!1:!ul.has(e.key)}l(fl,"isDefaultCellInput");function _l({key:e,target:t}){return e==="Tab"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)?t.closest(".rdg-editor-container")?.querySelectorAll("input, textarea, select").length===1:!1}l(_l,"onEditorNavigation");var pl="mlln6zg7-0-0-beta-47";function hl(e){return e.map(({key:t,idx:n,minWidth:o,maxWidth:r})=>H("div",{className:pl,style:{gridColumnStart:n+1,minWidth:o,maxWidth:r},"data-measuring-cell-key":t},t))}l(hl,"renderMeasuringCells");function gl({selectedPosition:e,columns:t,rows:n}){let o=t[e.idx],r=n[e.rowIdx];return Lo(o,r)}l(gl,"isSelectedCellEditable");function Lo(e,t){return e.renderEditCell!=null&&(typeof e.editable=="function"?e.editable(t):e.editable)!==!1}l(Lo,"isCellEditableUtil");function ml({rows:e,topSummaryRows:t,bottomSummaryRows:n,rowIdx:o,mainHeaderRowIdx:r,lastFrozenColumnIndex:i,column:a}){let c=t?.length??0;if(o===r)return le(a,i,{type:"HEADER"});if(t&&o>r&&o<=c+r)return le(a,i,{type:"SUMMARY",row:t[o+c]});if(o>=0&&o<e.length){let u=e[o];return le(a,i,{type:"ROW",row:u})}if(n)return le(a,i,{type:"SUMMARY",row:n[o-e.length]})}l(ml,"getSelectedCellColSpan");function yl({moveUp:e,moveNext:t,cellNavigationMode:n,columns:o,colSpanColumns:r,rows:i,topSummaryRows:a,bottomSummaryRows:c,minRowIdx:u,mainHeaderRowIdx:d,maxRowIdx:C,currentPosition:{idx:s,rowIdx:g},nextPosition:f,lastFrozenColumnIndex:x,isCellWithinBounds:R}){let{idx:m,rowIdx:h}=f,w=o.length,z=l(P=>{for(let b of r){let y=b.idx;if(y>m)break;let E=ml({rows:i,topSummaryRows:a,bottomSummaryRows:c,rowIdx:h,mainHeaderRowIdx:d,lastFrozenColumnIndex:x,column:b});if(E&&m>y&&m<E+y){m=y+(P?E:0);break}}},"setColSpan"),v=l(P=>P.level+d,"getParentRowIdx"),S=l(()=>{if(t){let b=o[m].parent;for(;b!==void 0;){let y=v(b);if(h===y){m=b.idx+b.colSpan;break}b=b.parent}}else if(e){let b=o[m].parent,y=!1;for(;b!==void 0;){let E=v(b);if(h>=E){m=b.idx,h=E,y=!0;break}b=b.parent}y||(m=s,h=g)}},"setHeaderGroupColAndRowSpan");if(R(f)&&(z(t),h<d&&S()),n==="CHANGE_ROW"&&(m===w?h===C||(m=0,h+=1):m===-1&&(h===u||(h-=1,m=w-1),z(!1))),h<d){let b=o[m].parent,y=h;for(h=d;b!==void 0;){let E=v(b);E>=y&&(h=E,m=b.idx),b=b.parent}}return{idx:m,rowIdx:h}}l(yl,"getNextSelectedCellPosition");function bl({maxColIdx:e,minRowIdx:t,maxRowIdx:n,selectedPosition:{rowIdx:o,idx:r},shiftKey:i}){return i?r===0&&o===t:r===e&&o===n}l(bl,"canExitGrid");var Cl="cj343x07-0-0-beta-47",No=`rdg-cell ${Cl}`,wl="csofj7r7-0-0-beta-47",vl=`rdg-cell-frozen ${wl}`;function Mo(e){return{"--rdg-grid-row-start":e}}l(Mo,"getRowStyle");function Ao(e,t,n){let o=t+1,r=`calc(${n-1} * var(--rdg-header-row-height))`;return e.parent===void 0?{insetBlockStart:0,gridRowStart:1,gridRowEnd:o,paddingBlockStart:r}:{insetBlockStart:`calc(${t-n} * var(--rdg-header-row-height))`,gridRowStart:o-n,gridRowEnd:o,paddingBlockStart:r}}l(Ao,"getHeaderCellStyle");function ot(e,t=1){let n=e.idx+1;return{gridColumnStart:n,gridColumnEnd:n+t,insetInlineStart:e.frozen?`var(--rdg-frozen-left-${e.idx})`:void 0}}l(ot,"getCellStyle");function It(e,...t){return fe(No,...t,e.frozen&&vl)}l(It,"getCellClassname");var{min:nt,max:Et,floor:To,sign:xl,abs:Rl}=Math;function fn(e){if(typeof e!="function")throw new Error("Please specify the rowKeyGetter prop to use selection")}l(fn,"assertIsValidKeyGetter");function Oo(e,{minWidth:t,maxWidth:n}){return e=Et(e,t),typeof n=="number"&&n>=t?nt(e,n):e}l(Oo,"clampColumnWidth");function $o(e,t){return e.parent===void 0?t:e.level-e.parent.level}l($o,"getHeaderCellRowSpan");var kl="c1bn88vv7-0-0-beta-47",Sl=`rdg-checkbox-input ${kl}`;function El({onChange:e,indeterminate:t,...n}){function o(r){e(r.target.checked,r.nativeEvent.shiftKey)}return l(o,"handleChange"),H("input",{ref:l(r=>{r&&(r.indeterminate=t===!0)},"ref"),type:"checkbox",className:Sl,onChange:o,...n})}l(El,"renderCheckbox");var Il="g1s9ylgp7-0-0-beta-47",Ns=`rdg-group-cell-content ${Il}`,Dl="cz54e4y7-0-0-beta-47",Ms=`rdg-caret ${Dl}`;function Tl(e){try{return e.row[e.column.key]}catch{return null}}l(Tl,"renderValue");var Wo=me(void 0),Pl=Wo.Provider;function gn(){return xe(Wo)}l(gn,"useDefaultRenderers");function mn({value:e,tabIndex:t,indeterminate:n,disabled:o,onChange:r,"aria-label":i,"aria-labelledby":a}){let c=gn().renderCheckbox;return c({"aria-label":i,"aria-labelledby":a,tabIndex:t,indeterminate:n,disabled:o,checked:e,onChange:r})}l(mn,"SelectCellFormatter");var Uo=me(void 0),zl=Uo.Provider,Go=me(void 0),Hl=Go.Provider;function Vo(){let e=xe(Uo),t=xe(Go);if(e===void 0||t===void 0)throw new Error("useRowSelection must be used within DataGrid cells");return{isRowSelectionDisabled:e.isRowSelectionDisabled,isRowSelected:e.isRowSelected,onRowSelectionChange:t}}l(Vo,"useRowSelection");var jo=me(void 0),Fl=jo.Provider,Ko=me(void 0),Ll=Ko.Provider;function Nl(){let e=xe(jo),t=xe(Ko);if(e===void 0||t===void 0)throw new Error("useHeaderRowSelection must be used within DataGrid cells");return{isIndeterminate:e.isIndeterminate,isRowSelected:e.isRowSelected,onRowSelectionChange:t}}l(Nl,"useHeaderRowSelection");var hn="rdg-select-column";function Ml(e){let{isIndeterminate:t,isRowSelected:n,onRowSelectionChange:o}=Nl();return H(mn,{"aria-label":"Select All",tabIndex:e.tabIndex,indeterminate:t,value:n,onChange:l(r=>{o({checked:t?!1:r})},"onChange")})}l(Ml,"HeaderRenderer");function Al(e){let{isRowSelectionDisabled:t,isRowSelected:n,onRowSelectionChange:o}=Vo();return H(mn,{"aria-label":"Select",tabIndex:e.tabIndex,disabled:t,value:n,onChange:l((r,i)=>{o({row:e.row,checked:r,isShiftClick:i})},"onChange")})}l(Al,"SelectFormatter");function Ol(e){let{isRowSelected:t,onRowSelectionChange:n}=Vo();return H(mn,{"aria-label":"Select Group",tabIndex:e.tabIndex,value:t,onChange:l(o=>{n({row:e.row,checked:o,isShiftClick:!1})},"onChange")})}l(Ol,"SelectGroupFormatter");var Bo={key:hn,name:"",width:35,minWidth:35,maxWidth:35,resizable:!1,sortable:!1,frozen:!0,renderHeaderCell(e){return H(Ml,{...e})},renderCell(e){return H(Al,{...e})},renderGroupCell(e){return H(Ol,{...e})}},$l="auto",Wl=50;function Ul({rawColumns:e,defaultColumnOptions:t,getColumnWidth:n,viewportWidth:o,scrollLeft:r,enableVirtualization:i}){let a=t?.width??$l,c=t?.minWidth??Wl,u=t?.maxWidth??void 0,d=t?.renderCell??Tl,C=t?.sortable??!1,s=t?.resizable??!1,g=t?.draggable??!1,{columns:f,colSpanColumns:x,lastFrozenColumnIndex:R,headerRowsCount:m}=Y(()=>{let b=-1,y=1,E=[];I(e,1);function I(M,O,J){for(let U of M){if("children"in U){let Ue={name:U.name,parent:J,idx:-1,colSpan:0,level:0,headerCellClass:U.headerCellClass};I(U.children,O+1,Ue);continue}let ie=U.frozen??!1,We={...U,parent:J,idx:0,level:0,frozen:ie,width:U.width??a,minWidth:U.minWidth??c,maxWidth:U.maxWidth??u,sortable:U.sortable??C,resizable:U.resizable??s,draggable:U.draggable??g,renderCell:U.renderCell??d};E.push(We),ie&&b++,O>y&&(y=O)}}l(I,"collectColumns"),E.sort(({key:M,frozen:O},{key:J,frozen:U})=>M===hn?-1:J===hn?1:O?U?0:-1:U?1:0);let N=[];return E.forEach((M,O)=>{M.idx=O,qo(M,O,0),M.colSpan!=null&&N.push(M)}),{columns:E,colSpanColumns:N,lastFrozenColumnIndex:b,headerRowsCount:y}},[e,a,c,u,d,s,C,g]),{templateColumns:h,layoutCssVars:w,totalFrozenColumnWidth:z,columnMetrics:v}=Y(()=>{let b=new Map,y=0,E=0,I=[];for(let M of f){let O=n(M);typeof O=="number"?O=Oo(O,M):O=M.minWidth,I.push(`${O}px`),b.set(M,{width:O,left:y}),y+=O}if(R!==-1){let M=b.get(f[R]);E=M.left+M.width}let N={};for(let M=0;M<=R;M++){let O=f[M];N[`--rdg-frozen-left-${O.idx}`]=`${b.get(O).left}px`}return{templateColumns:I,layoutCssVars:N,totalFrozenColumnWidth:E,columnMetrics:b}},[n,f,R]),[S,P]=Y(()=>{if(!i)return[0,f.length-1];let b=r+z,y=r+o,E=f.length-1,I=nt(R+1,E);if(b>=y)return[I,I];let N=I;for(;N<E;){let{left:U,width:ie}=v.get(f[N]);if(U+ie>b)break;N++}let M=N;for(;M<E;){let{left:U,width:ie}=v.get(f[M]);if(U+ie>=y)break;M++}let O=Et(I,N-1),J=nt(E,M+1);return[O,J]},[v,f,R,r,z,o,i]);return{columns:f,colSpanColumns:x,colOverscanStartIdx:S,colOverscanEndIdx:P,templateColumns:h,layoutCssVars:w,headerRowsCount:m,lastFrozenColumnIndex:R,totalFrozenColumnWidth:z}}l(Ul,"useCalculatedColumns");function qo(e,t,n){if(n<e.level&&(e.level=n),e.parent!==void 0){let{parent:o}=e;o.idx===-1&&(o.idx=t),o.colSpan+=1,qo(o,t,n-1)}}l(qo,"updateColumnParent");var $e=typeof window>"u"?be:Rt;function Gl(e,t,n,o,r,i,a,c,u,d){let C=re(r),s=e.length===t.length,g=s&&r!==C.current,f=[...n],x=[];for(let{key:w,idx:z,width:v}of t)typeof v=="string"&&(g||!a.has(w))&&!i.has(w)&&(f[z]=v,x.push(w));let R=f.join(" ");$e(()=>{C.current=r,m(x)});function m(w){w.length!==0&&u(z=>{let v=new Map(z),S=!1;for(let P of w){let b=Po(o,P);S||=b!==z.get(P),b===void 0?v.delete(P):v.set(P,b)}return S?v:z})}l(m,"updateMeasuredWidths");function h(w,z){let{key:v}=w,S=[...n],P=[];for(let{key:y,idx:E,width:I}of t)if(v===y){let N=typeof z=="number"?`${z}px`:z;S[E]=N}else s&&typeof I=="string"&&!i.has(y)&&(S[E]=I,P.push(y));o.current.style.gridTemplateColumns=S.join(" ");let b=typeof z=="number"?z:Po(o,v);et(()=>{c(y=>{let E=new Map(y);return E.set(v,b),E}),m(P)}),d?.(w.idx,b)}return l(h,"handleColumnResize"),{gridTemplateColumns:R,handleColumnResize:h}}l(Gl,"useColumnWidths");function Po(e,t){let n=`[data-measuring-cell-key="${CSS.escape(t)}"]`;return e.current?.querySelector(n)?.getBoundingClientRect().width}l(Po,"measureColumnWidth");function Vl(){let e=re(null),[t,n]=K(1),[o,r]=K(1),[i,a]=K(0);return $e(()=>{let{ResizeObserver:c}=window;if(c==null)return;let{clientWidth:u,clientHeight:d,offsetWidth:C,offsetHeight:s}=e.current,{width:g,height:f}=e.current.getBoundingClientRect(),x=s-d,R=g-C+u,m=f-x;n(R),r(m),a(x);let h=new c(w=>{let z=w[0].contentBoxSize[0],{clientHeight:v,offsetHeight:S}=e.current;et(()=>{n(z.inlineSize),r(z.blockSize),a(S-v)})});return h.observe(e.current),()=>{h.disconnect()}},[]),[e,t,o,i]}l(Vl,"useGridDimensions");function te(e){let t=re(e);be(()=>{t.current=e});let n=de((...o)=>{t.current(...o)},[]);return e&&n}l(te,"useLatestFunc");function Dt(e){let[t,n]=K(!1);t&&!e&&n(!1);function o(i){i.target!==i.currentTarget&&n(!0)}return l(o,"onFocus"),{tabIndex:e&&!t?0:-1,childTabIndex:e?0:-1,onFocus:e?o:void 0}}l(Dt,"useRovingTabIndex");function jl({columns:e,colSpanColumns:t,rows:n,topSummaryRows:o,bottomSummaryRows:r,colOverscanStartIdx:i,colOverscanEndIdx:a,lastFrozenColumnIndex:c,rowOverscanStartIdx:u,rowOverscanEndIdx:d}){let C=Y(()=>{if(i===0)return 0;let s=i,g=l((f,x)=>x!==void 0&&f+x>i?(s=f,!0):!1,"updateStartIdx");for(let f of t){let x=f.idx;if(x>=s||g(x,le(f,c,{type:"HEADER"})))break;for(let R=u;R<=d;R++){let m=n[R];if(g(x,le(f,c,{type:"ROW",row:m})))break}if(o!=null){for(let R of o)if(g(x,le(f,c,{type:"SUMMARY",row:R})))break}if(r!=null){for(let R of r)if(g(x,le(f,c,{type:"SUMMARY",row:R})))break}}return s},[u,d,n,o,r,i,c,t]);return Y(()=>{let s=[];for(let g=0;g<=a;g++){let f=e[g];g<C&&!f.frozen||s.push(f)}return s},[C,a,e])}l(jl,"useViewportColumns");function Kl({rows:e,rowHeight:t,clientHeight:n,scrollTop:o,enableVirtualization:r}){let{totalRowHeight:i,gridTemplateRows:a,getRowTop:c,getRowHeight:u,findRowIdx:d}=Y(()=>{if(typeof t=="number")return{totalRowHeight:t*e.length,gridTemplateRows:` repeat(${e.length}, ${t}px)`,getRowTop:l(m=>m*t,"getRowTop"),getRowHeight:l(()=>t,"getRowHeight"),findRowIdx:l(m=>To(m/t),"findRowIdx")};let g=0,f=" ",x=e.map(m=>{let h=t(m),w={top:g,height:h};return f+=`${h}px `,g+=h,w}),R=l(m=>Et(0,nt(e.length-1,m)),"validateRowIdx");return{totalRowHeight:g,gridTemplateRows:f,getRowTop:l(m=>x[R(m)].top,"getRowTop"),getRowHeight:l(m=>x[R(m)].height,"getRowHeight"),findRowIdx(m){let h=0,w=x.length-1;for(;h<=w;){let z=h+To((w-h)/2),v=x[z].top;if(v===m)return z;if(v<m?h=z+1:v>m&&(w=z-1),h>w)return w}return 0}}},[t,e]),C=0,s=e.length-1;if(r){let f=d(o),x=d(o+n);C=Et(0,f-4),s=nt(e.length-1,x+4)}return{rowOverscanStartIdx:C,rowOverscanEndIdx:s,totalRowHeight:i,gridTemplateRows:a,getRowTop:c,getRowHeight:u,findRowIdx:d}}l(Kl,"useViewportRows");var Bl="c1w9bbhr7-0-0-beta-47",ql="c1creorc7-0-0-beta-47",Yl=`rdg-cell-drag-handle ${Bl}`;function Xl({gridRowStart:e,rows:t,column:n,columnWidth:o,maxColIdx:r,isLastRow:i,selectedPosition:a,latestDraggedOverRowIdx:c,isCellEditable:u,onRowsChange:d,onFill:C,onClick:s,setDragging:g,setDraggedOverRowIdx:f}){let{idx:x,rowIdx:R}=a;function m(S){if(S.preventDefault(),S.buttons!==1)return;g(!0),window.addEventListener("mouseover",P),window.addEventListener("mouseup",b);function P(y){y.buttons!==1&&b()}l(P,"onMouseOver");function b(){window.removeEventListener("mouseover",P),window.removeEventListener("mouseup",b),g(!1),h()}l(b,"onMouseUp")}l(m,"handleMouseDown");function h(){let S=c.current;if(S===void 0)return;let P=R<S?R+1:S,b=R<S?S+1:R;z(P,b),f(void 0)}l(h,"handleDragEnd");function w(S){S.stopPropagation(),z(R+1,t.length)}l(w,"handleDoubleClick");function z(S,P){let b=t[R],y=[...t],E=[];for(let I=S;I<P;I++)if(u({rowIdx:I,idx:x})){let N=C({columnKey:n.key,sourceRow:b,targetRow:t[I]});N!==t[I]&&(y[I]=N,E.push(I))}E.length>0&&d?.(y,{indexes:E,column:n})}l(z,"updateRows");function v(){let S=n.colSpan?.({type:"ROW",row:t[R]})??1,{insetInlineStart:P,...b}=ot(n,S),y="calc(var(--rdg-drag-handle-size) * -0.5 + 1px)",E=n.idx+S-1===r;return{...b,gridRowStart:e,marginInlineEnd:E?void 0:y,marginBlockEnd:i?void 0:y,insetInlineStart:P?`calc(${P} + ${o}px + var(--rdg-drag-handle-size) * -0.5 - 1px)`:void 0}}return l(v,"getStyle"),H("div",{style:v(),className:fe(Yl,n.frozen&&ql),onClick:s,onMouseDown:m,onDoubleClick:w})}l(Xl,"DragHandle");var Zl="cis5rrm7-0-0-beta-47";function Jl({column:e,colSpan:t,row:n,rowIdx:o,onRowChange:r,closeEditor:i,onKeyDown:a,navigate:c}){let u=re(void 0),d=e.editorOptions?.commitOnOutsideClick!==!1,C=te(()=>{f(!0,!1)});be(()=>{if(!d)return;function h(){u.current=requestAnimationFrame(C)}return l(h,"onWindowCaptureMouseDown"),addEventListener("mousedown",h,{capture:!0}),()=>{removeEventListener("mousedown",h,{capture:!0}),s()}},[d,C]);function s(){cancelAnimationFrame(u.current)}l(s,"cancelFrameRequest");function g(h){if(a){let w=tt(h);if(a({mode:"EDIT",row:n,column:e,rowIdx:o,navigate(){c(h)},onClose:f},w),w.isGridDefaultPrevented())return}h.key==="Escape"?f():h.key==="Enter"?f(!0):_l(h)&&c(h)}l(g,"handleKeyDown");function f(h=!1,w=!0){h?r(n,!0,w):i(w)}l(f,"onClose");function x(h,w=!1){r(h,w,w)}l(x,"onEditorRowChange");let{cellClass:R}=e,m=It(e,"rdg-editor-container",typeof R=="function"?R(n):R,!e.editorOptions?.displayCellContent&&Zl);return H("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":!0,className:m,style:ot(e,t),onKeyDown:g,onMouseDownCapture:s,children:e.renderEditCell!=null&&H(Z,{children:[e.renderEditCell({column:e,row:n,rowIdx:o,onRowChange:x,onClose:f}),e.editorOptions?.displayCellContent&&e.renderCell({column:e,row:n,rowIdx:o,isCellEditable:!0,tabIndex:-1,onRowChange:x})]})})}l(Jl,"EditCell");function Ql({column:e,rowIdx:t,isCellSelected:n,selectCell:o}){let{tabIndex:r,onFocus:i}=Dt(n),{colSpan:a}=e,c=$o(e,t),u=e.idx+1;function d(){o({idx:e.idx,rowIdx:t})}return l(d,"onClick"),H("div",{role:"columnheader","aria-colindex":u,"aria-colspan":a,"aria-rowspan":c,"aria-selected":n,tabIndex:r,className:fe(No,e.headerCellClass),style:{...Ao(e,t,c),gridColumnStart:u,gridColumnEnd:u+a},onFocus:i,onClick:d,children:e.name})}l(Ql,"GroupedColumnHeaderCell");var ei="h44jtk67-0-0-beta-47",ti="hcgkhxz7-0-0-beta-47",ni=`rdg-header-sort-name ${ti}`;function oi({column:e,sortDirection:t,priority:n}){return e.sortable?H(ri,{sortDirection:t,priority:n,children:e.name}):e.name}l(oi,"renderHeaderCell");function ri({sortDirection:e,priority:t,children:n}){let o=gn().renderSortStatus;return H("span",{className:ei,children:[H("span",{className:ni,children:n}),H("span",{children:o({sortDirection:e,priority:t})})]})}l(ri,"SortableHeaderCell");var li="c6l2wv17-0-0-beta-47",ii="c1kqdw7y7-0-0-beta-47",si=`rdg-cell-resizable ${ii}`,ai="r1y6ywlx7-0-0-beta-47",ci="rdg-cell-draggable",di="c1bezg5o7-0-0-beta-47",ui=`rdg-cell-dragging ${di}`,fi="c1vc96037-0-0-beta-47",_i=`rdg-cell-drag-over ${fi}`;function pi({column:e,colSpan:t,rowIdx:n,isCellSelected:o,onColumnResize:r,onColumnsReorder:i,sortColumns:a,onSortColumnsChange:c,selectCell:u,shouldFocusGrid:d,direction:C,dragDropKey:s}){let[g,f]=K(!1),[x,R]=K(!1),m=C==="rtl",h=$o(e,n),{tabIndex:w,childTabIndex:z,onFocus:v}=Dt(o),S=a?.findIndex(L=>L.columnKey===e.key),P=S!==void 0&&S>-1?a[S]:void 0,b=P?.direction,y=P!==void 0&&a.length>1?S+1:void 0,E=b&&!y?b==="ASC"?"ascending":"descending":void 0,{sortable:I,resizable:N,draggable:M}=e,O=It(e,e.headerCellClass,I&&li,N&&si,M&&ci,g&&ui,x&&_i),J=e.renderHeaderCell??oi;function U(L){if(L.pointerType==="mouse"&&L.buttons!==1)return;L.preventDefault();let{currentTarget:G,pointerId:ne}=L,ue=G.parentElement,{right:lt,left:it}=ue.getBoundingClientRect(),Ge=m?L.clientX-it:lt-L.clientX,Se=!1;function Ve(Ee){let{width:Ie,right:Lt,left:je}=ue.getBoundingClientRect(),De=m?Lt+Ge-Ee.clientX:Ee.clientX+Ge-je;De=Oo(De,e),Ie>0&&De!==Ie&&r(e,De)}l(Ve,"onPointerMove");function st(){Se=!0,r(e,"max-content")}l(st,"onDoubleClick");function at(Ee){Se||Ve(Ee),G.removeEventListener("pointermove",Ve),G.removeEventListener("dblclick",st),G.removeEventListener("lostpointercapture",at)}l(at,"onLostPointerCapture"),G.setPointerCapture(ne),G.addEventListener("pointermove",Ve),G.addEventListener("dblclick",st),G.addEventListener("lostpointercapture",at)}l(U,"onPointerDown");function ie(L){if(c==null)return;let{sortDescendingFirst:G}=e;if(P===void 0){let ne={columnKey:e.key,direction:G?"DESC":"ASC"};c(a&&L?[...a,ne]:[ne])}else{let ne;if((G===!0&&b==="DESC"||G!==!0&&b==="ASC")&&(ne={columnKey:e.key,direction:b==="ASC"?"DESC":"ASC"}),L){let ue=[...a];ne?ue[S]=ne:ue.splice(S,1),c(ue)}else c(ne?[ne]:[])}}l(ie,"onSort");function We(L){u({idx:e.idx,rowIdx:n}),I&&ie(L.ctrlKey||L.metaKey)}l(We,"onClick");function Ue(L){v?.(L),d&&u({idx:0,rowIdx:n})}l(Ue,"handleFocus");function Tt(L){(L.key===" "||L.key==="Enter")&&(L.preventDefault(),ie(L.ctrlKey||L.metaKey))}l(Tt,"onKeyDown");function Pt(L){L.dataTransfer.setData(s,e.key),L.dataTransfer.dropEffect="move",f(!0)}l(Pt,"onDragStart");function zt(){f(!1)}l(zt,"onDragEnd");function Ht(L){L.preventDefault(),L.dataTransfer.dropEffect="move"}l(Ht,"onDragOver");function Ft(L){if(R(!1),L.dataTransfer.types.includes(s.toLowerCase())){let G=L.dataTransfer.getData(s.toLowerCase());G!==e.key&&(L.preventDefault(),i?.(G,e.key))}}l(Ft,"onDrop");function ke(L){zo(L)&&R(!0)}l(ke,"onDragEnter");function rt(L){zo(L)&&R(!1)}l(rt,"onDragLeave");let pe;return M&&(pe={draggable:!0,onDragStart:Pt,onDragEnd:zt,onDragOver:Ht,onDragEnter:ke,onDragLeave:rt,onDrop:Ft}),H("div",{role:"columnheader","aria-colindex":e.idx+1,"aria-colspan":t,"aria-rowspan":h,"aria-selected":o,"aria-sort":E,tabIndex:d?0:w,className:O,style:{...Ao(e,n,h),...ot(e,t)},onFocus:Ue,onClick:We,onKeyDown:I?Tt:void 0,...pe,children:[J({column:e,sortDirection:b,priority:y,tabIndex:z}),N&&H("div",{className:ai,onClick:dl,onPointerDown:U})]})}l(pi,"HeaderCell");function zo(e){let t=e.relatedTarget;return!e.currentTarget.contains(t)}l(zo,"isEventPertinent");var hi="r1upfr807-0-0-beta-47",Yo=`rdg-row ${hi}`,gi="r190mhd37-0-0-beta-47",yn="rdg-row-selected",mi="r139qu9m7-0-0-beta-47",yi="rdg-top-summary-row",bi="rdg-bottom-summary-row",Ci="h10tskcx7-0-0-beta-47",Xo=`rdg-header-row ${Ci}`;function wi({rowIdx:e,columns:t,onColumnResize:n,onColumnsReorder:o,sortColumns:r,onSortColumnsChange:i,lastFrozenColumnIndex:a,selectedCellIdx:c,selectCell:u,shouldFocusGrid:d,direction:C}){let s=ln(),g=[];for(let f=0;f<t.length;f++){let x=t[f],R=le(x,a,{type:"HEADER"});R!==void 0&&(f+=R-1),g.push(H(pi,{column:x,colSpan:R,rowIdx:e,isCellSelected:c===x.idx,onColumnResize:n,onColumnsReorder:o,onSortColumnsChange:i,sortColumns:r,selectCell:u,shouldFocusGrid:d&&f===0,direction:C,dragDropKey:s},x.key))}return H("div",{role:"row","aria-rowindex":e,className:fe(Xo,c===-1&&yn),children:g})}l(wi,"HeaderRow");var vi=Re(wi);function xi({rowIdx:e,level:t,columns:n,selectedCellIdx:o,selectCell:r}){let i=[],a=new Set;for(let c of n){let{parent:u}=c;if(u!==void 0){for(;u.level>t&&u.parent!==void 0;)u=u.parent;if(u.level===t&&!a.has(u)){a.add(u);let{idx:d}=u;i.push(H(Ql,{column:u,rowIdx:e,isCellSelected:o===d,selectCell:r},d))}}}return H("div",{role:"row","aria-rowindex":e,className:Xo,children:i})}l(xi,"GroupedColumnHeaderRow");var Ri=Re(xi),ki="c6ra8a37-0-0-beta-47",Si=`rdg-cell-copied ${ki}`,Ei="cq910m07-0-0-beta-47",Ii=`rdg-cell-dragged-over ${Ei}`;function Di({column:e,colSpan:t,isCellSelected:n,isCopied:o,isDraggedOver:r,row:i,rowIdx:a,onClick:c,onDoubleClick:u,onContextMenu:d,onRowChange:C,selectCell:s,...g}){let{tabIndex:f,childTabIndex:x,onFocus:R}=Dt(n),{cellClass:m}=e,h=It(e,typeof m=="function"?m(i):m,o&&Si,r&&Ii),w=Lo(e,i);function z(y){s({rowIdx:a,idx:e.idx},y)}l(z,"selectCellWrapper");function v(y){if(c){let E=tt(y);if(c({row:i,column:e,selectCell:z},E),E.isGridDefaultPrevented())return}z()}l(v,"handleClick");function S(y){if(d){let E=tt(y);if(d({row:i,column:e,selectCell:z},E),E.isGridDefaultPrevented())return}z()}l(S,"handleContextMenu");function P(y){if(u){let E=tt(y);if(u({row:i,column:e,selectCell:z},E),E.isGridDefaultPrevented())return}z(!0)}l(P,"handleDoubleClick");function b(y){C(e,y)}return l(b,"handleRowChange"),H("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":n,"aria-readonly":!w||void 0,tabIndex:f,className:h,style:ot(e,t),onClick:v,onDoubleClick:P,onContextMenu:S,onFocus:R,...g,children:e.renderCell({column:e,row:i,rowIdx:a,isCellEditable:w,tabIndex:x,onRowChange:b})})}l(Di,"Cell");var Ti=Re(Di);function Pi({className:e,rowIdx:t,gridRowStart:n,selectedCellIdx:o,isRowSelectionDisabled:r,isRowSelected:i,copiedCellIdx:a,draggedOverCellIdx:c,lastFrozenColumnIndex:u,row:d,viewportColumns:C,selectedCellEditor:s,onCellClick:g,onCellDoubleClick:f,onCellContextMenu:x,rowClass:R,setDraggedOverRowIdx:m,onMouseEnter:h,onRowChange:w,selectCell:z,...v},S){let P=te((I,N)=>{w(I,t,N)});function b(I){m?.(t),h?.(I)}l(b,"handleDragEnter"),e=fe(Yo,`rdg-row-${t%2===0?"even":"odd"}`,R?.(d,t),e,o===-1&&yn);let y=[];for(let I=0;I<C.length;I++){let N=C[I],{idx:M}=N,O=le(N,u,{type:"ROW",row:d});O!==void 0&&(I+=O-1);let J=o===M;J&&s?y.push(s):y.push(H(Ti,{column:N,colSpan:O,row:d,rowIdx:t,isCopied:a===M,isDraggedOver:c===M,isCellSelected:J,onClick:g,onDoubleClick:f,onContextMenu:x,onRowChange:P,selectCell:z},N.key))}let E=Y(()=>({isRowSelected:i,isRowSelectionDisabled:r}),[r,i]);return H(zl,{value:E,children:H("div",{role:"row",ref:S,className:e,onMouseEnter:b,style:Mo(n),...v,children:y})})}l(Pi,"Row");var zi=Re(dn(Pi));function Hi(e,t){return H(zi,{...t},e)}l(Hi,"defaultRenderRow");function Fi({scrollToPosition:{idx:e,rowIdx:t},gridElement:n,setScrollToCellPosition:o}){let r=re(null);return $e(()=>{St(r.current)}),$e(()=>{function i(){o(null)}l(i,"removeScrollToCell");let a=new IntersectionObserver(i,{root:n,threshold:1});return a.observe(r.current),()=>{a.disconnect()}},[n,o]),H("div",{ref:r,style:{gridColumn:e===void 0?"1/-1":e+1,gridRow:t===void 0?"1/-1":t+2}})}l(Fi,"ScrollToCell");var Li="a3ejtar7-0-0-beta-47",Ni=`rdg-sort-arrow ${Li}`;function Mi({sortDirection:e,priority:t}){return H(Z,{children:[Ai({sortDirection:e}),Oi({priority:t})]})}l(Mi,"renderSortStatus");function Ai({sortDirection:e}){return e===void 0?null:H("svg",{viewBox:"0 0 12 8",width:"12",height:"8",className:Ni,"aria-hidden":!0,children:H("path",{d:e==="ASC"?"M0 8 6 0 12 8":"M0 0 6 8 12 0"})})}l(Ai,"renderSortIcon");function Oi({priority:e}){return e}l(Oi,"renderSortPriority");var $i="rnvodz57-0-0-beta-47",Wi=`rdg ${$i}`,Ui="vlqv91k7-0-0-beta-47",Gi=`rdg-viewport-dragging ${Ui}`,Vi="f1lsfrzw7-0-0-beta-47",ji="f1cte0lg7-0-0-beta-47",Ki="s8wc6fl7-0-0-beta-47";function Bi({column:e,colSpan:t,row:n,rowIdx:o,isCellSelected:r,selectCell:i}){let{tabIndex:a,childTabIndex:c,onFocus:u}=Dt(r),{summaryCellClass:d}=e,C=It(e,Ki,typeof d=="function"?d(n):d);function s(){i({rowIdx:o,idx:e.idx})}return l(s,"onClick"),H("div",{role:"gridcell","aria-colindex":e.idx+1,"aria-colspan":t,"aria-selected":r,tabIndex:a,className:C,style:ot(e,t),onClick:s,onFocus:u,children:e.renderSummaryCell?.({column:e,row:n,tabIndex:c})})}l(Bi,"SummaryCell");var qi=Re(Bi),Yi="skuhp557-0-0-beta-47",Xi="tf8l5ub7-0-0-beta-47",Zi=`rdg-summary-row ${Yi}`;function Ji({rowIdx:e,gridRowStart:t,row:n,viewportColumns:o,top:r,bottom:i,lastFrozenColumnIndex:a,selectedCellIdx:c,isTop:u,selectCell:d,"aria-rowindex":C}){let s=[];for(let g=0;g<o.length;g++){let f=o[g],x=le(f,a,{type:"SUMMARY",row:n});x!==void 0&&(g+=x-1);let R=c===f.idx;s.push(H(qi,{column:f,colSpan:x,row:n,rowIdx:e,isCellSelected:R,selectCell:d},f.key))}return H("div",{role:"row","aria-rowindex":C,className:fe(Yo,`rdg-row-${e%2===0?"even":"odd"}`,Zi,u?`${yi} ${Xi}`:bi,c===-1&&yn),style:{...Mo(t),"--rdg-summary-row-top":r!==void 0?`${r}px`:void 0,"--rdg-summary-row-bottom":i!==void 0?`${i}px`:void 0},children:s})}l(Ji,"SummaryRow");var Ho=Re(Ji);function Qi(e,t){let{columns:n,rows:o,topSummaryRows:r,bottomSummaryRows:i,rowKeyGetter:a,onRowsChange:c,rowHeight:u,headerRowHeight:d,summaryRowHeight:C,selectedRows:s,isRowSelectionDisabled:g,onSelectedRowsChange:f,sortColumns:x,onSortColumnsChange:R,defaultColumnOptions:m,onCellClick:h,onCellDoubleClick:w,onCellContextMenu:z,onCellKeyDown:v,onSelectedCellChange:S,onScroll:P,onColumnResize:b,onColumnsReorder:y,onFill:E,onCopy:I,onPaste:N,enableVirtualization:M,renderers:O,className:J,style:U,rowClass:ie,direction:We,role:Ue,"aria-label":Tt,"aria-labelledby":Pt,"aria-describedby":zt,"aria-rowcount":Ht,"data-testid":Ft}=e,ke=gn(),rt=Ue??"grid",pe=u??35,L=d??(typeof pe=="number"?pe:35),G=C??(typeof pe=="number"?pe:35),ne=O?.renderRow??ke?.renderRow??Hi,ue=O?.renderSortStatus??ke?.renderSortStatus??Mi,lt=O?.renderCheckbox??ke?.renderCheckbox??El,it=O?.noRowsFallback??ke?.noRowsFallback,Ge=M??!0,Se=We??"ltr",[Ve,st]=K(0),[at,Ee]=K(0),[Ie,Lt]=K(()=>new Map),[je,De]=K(()=>new Map),[Te,bn]=K(null),[Cn,tr]=K(!1),[Ke,nr]=K(void 0),[ct,wn]=K(null),vn=de(_=>Ie.get(_.key)??je.get(_.key)??_.width,[je,Ie]),[Pe,xn,Rn,or]=Vl(),{columns:q,colSpanColumns:kn,lastFrozenColumnIndex:oe,headerRowsCount:Ce,colOverscanStartIdx:rr,colOverscanEndIdx:Sn,templateColumns:lr,layoutCssVars:ir,totalFrozenColumnWidth:sr}=Ul({rawColumns:n,defaultColumnOptions:m,getColumnWidth:vn,scrollLeft:at,viewportWidth:xn,enableVirtualization:Ge}),Be=r?.length??0,ze=i?.length??0,En=Be+ze,He=Ce+Be,Nt=Ce-1,Q=-He,dt=Q+Nt,we=o.length+ze-1,[k,Fe]=K(()=>({idx:-1,rowIdx:Q-1,mode:"SELECT"})),Mt=re(k),In=re(Ke),Dn=re(-1),ut=re(null),ft=re(!1),At=rt==="treegrid",Ot=Ce*L,Tn=En*G,_t=Rn-Ot-Tn,$t=s!=null&&f!=null,Pn=Se==="rtl",ar=Pn?"ArrowRight":"ArrowLeft",zn=Pn?"ArrowLeft":"ArrowRight",Hn=Ht??Ce+o.length+En,cr=Y(()=>({renderCheckbox:lt,renderSortStatus:ue}),[lt,ue]),dr=Y(()=>{let _=!1,p=!1;if(a!=null&&s!=null&&s.size>0){for(let D of o)if(s.has(a(D))?_=!0:p=!0,_&&p)break}return{isRowSelected:_&&!p,isIndeterminate:_&&p}},[o,s,a]),{rowOverscanStartIdx:qe,rowOverscanEndIdx:Ye,totalRowHeight:Wt,gridTemplateRows:ur,getRowTop:Fn,getRowHeight:fr,findRowIdx:Ln}=Kl({rows:o,rowHeight:pe,clientHeight:_t,scrollTop:Ve,enableVirtualization:Ge}),he=jl({columns:q,colSpanColumns:kn,colOverscanStartIdx:rr,colOverscanEndIdx:Sn,lastFrozenColumnIndex:oe,rowOverscanStartIdx:qe,rowOverscanEndIdx:Ye,rows:o,topSummaryRows:r,bottomSummaryRows:i}),{gridTemplateColumns:_r,handleColumnResize:pr}=Gl(q,he,lr,Pe,xn,Ie,je,Lt,De,b),hr=At?-1:0,Le=q.length-1,Ut=jt(k),pt=$n(k),gr=L+Wt+Tn+or,mr=te(pr),yr=te(y),br=te(R),Cr=te(h),wr=te(w),vr=te(z),xr=te(Sr),Rr=te(Mn),kr=te(ht),Gt=te(Xe),Nn=te(({idx:_,rowIdx:p})=>{Xe({rowIdx:Q+p-1,idx:_})});$e(()=>{if(!Ut||_n(k,Mt.current)){Mt.current=k;return}Mt.current=k,k.idx===-1&&(ut.current.focus({preventScroll:!0}),St(ut.current))}),$e(()=>{ft.current&&(ft.current=!1,Un())}),rn(t,()=>({element:Pe.current,scrollToCell({idx:_,rowIdx:p}){let D=_!==void 0&&_>oe&&_<q.length?_:void 0,T=p!==void 0&&Ne(p)?p:void 0;(D!==void 0||T!==void 0)&&wn({idx:D,rowIdx:T})},selectCell:Xe}));let Vt=de(_=>{nr(_),In.current=_},[]);function Sr(_){if(!f)return;fn(a);let p=new Set(s);for(let D of o){if(g?.(D)===!0)continue;let T=a(D);_.checked?p.add(T):p.delete(T)}f(p)}l(Sr,"selectHeaderRow");function Mn(_){if(!f)return;fn(a);let{row:p,checked:D,isShiftClick:T}=_;if(g?.(p)===!0)return;let A=new Set(s),$=a(p),V=Dn.current,j=o.indexOf(p);if(Dn.current=j,D?A.add($):A.delete($),T&&V!==-1&&V!==j&&V<o.length){let X=xl(j-V);for(let ae=V+X;ae!==j;ae+=X){let ce=o[ae];g?.(ce)!==!0&&(D?A.add(a(ce)):A.delete(a(ce)))}}f(A)}l(Mn,"selectRow");function Er(_){let{idx:p,rowIdx:D,mode:T}=k;if(T==="EDIT")return;if(v&&Ne(D)){let j=o[D],X=tt(_);if(v({mode:"SELECT",row:j,column:q[p],rowIdx:D,selectCell:Xe},X),X.isGridDefaultPrevented())return}if(!(_.target instanceof Element))return;let A=_.target.closest(".rdg-cell")!==null,$=At&&_.target===ut.current;if(!A&&!$)return;let{keyCode:V}=_;if(pt&&(N!=null||I!=null)&&pn(_)){if(V===67){if(window.getSelection()?.isCollapsed===!1)return;Dr();return}if(V===86){Tr();return}}switch(_.key){case"Escape":bn(null);return;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Tab":case"Home":case"End":case"PageUp":case"PageDown":Wn(_);break;default:Pr(_);break}}l(Er,"handleKeyDown");function Ir(_){let{scrollTop:p,scrollLeft:D}=_.currentTarget;et(()=>{st(p),Ee(Rl(D))}),P?.(_)}l(Ir,"handleScroll");function ht(_,p,D){if(typeof c!="function"||D===o[p])return;let T=[...o];T[p]=D,c(T,{indexes:[p],column:_})}l(ht,"updateRow");function An(){k.mode==="EDIT"&&ht(q[k.idx],k.rowIdx,k.row)}l(An,"commitEditorChanges");function Dr(){let{idx:_,rowIdx:p}=k,D=o[p],T=q[_].key;bn({row:D,columnKey:T}),I?.({sourceRow:D,sourceColumnKey:T})}l(Dr,"handleCopy");function Tr(){if(!N||!c||Te===null||!gt(k))return;let{idx:_,rowIdx:p}=k,D=q[_],T=o[p],A=N({sourceRow:Te.row,sourceColumnKey:Te.columnKey,targetRow:T,targetColumnKey:D.key});ht(D,p,A)}l(Tr,"handlePaste");function Pr(_){if(!pt)return;let p=o[k.rowIdx],{key:D,shiftKey:T}=_;if($t&&T&&D===" "){fn(a);let A=a(p);Mn({row:p,checked:!s.has(A),isShiftClick:!1}),_.preventDefault();return}gt(k)&&fl(_)&&Fe(({idx:A,rowIdx:$})=>({idx:A,rowIdx:$,mode:"EDIT",row:p,originalRow:p}))}l(Pr,"handleCellInput");function On(_){return _>=hr&&_<=Le}l(On,"isColIdxWithinSelectionBounds");function Ne(_){return _>=0&&_<o.length}l(Ne,"isRowIdxWithinViewportBounds");function jt({idx:_,rowIdx:p}){return p>=Q&&p<=we&&On(_)}l(jt,"isCellWithinSelectionBounds");function zr({idx:_,rowIdx:p}){return Ne(p)&&_>=0&&_<=Le}l(zr,"isCellWithinEditBounds");function $n({idx:_,rowIdx:p}){return Ne(p)&&On(_)}l($n,"isCellWithinViewportBounds");function gt(_){return zr(_)&&gl({columns:q,rows:o,selectedPosition:_})}l(gt,"isCellEditable");function Xe(_,p){if(!jt(_))return;An();let D=o[_.rowIdx],T=_n(k,_);p&>(_)?Fe({..._,mode:"EDIT",row:D,originalRow:D}):T?St(Fo(Pe.current)):(ft.current=!0,Fe({..._,mode:"SELECT"})),S&&!T&&S({rowIdx:_.rowIdx,row:D,column:q[_.idx]})}l(Xe,"selectCell");function Hr(_,p,D){let{idx:T,rowIdx:A}=k,$=Ut&&T===-1;switch(_){case"ArrowUp":return{idx:T,rowIdx:A-1};case"ArrowDown":return{idx:T,rowIdx:A+1};case ar:return{idx:T-1,rowIdx:A};case zn:return{idx:T+1,rowIdx:A};case"Tab":return{idx:T+(D?-1:1),rowIdx:A};case"Home":return $?{idx:T,rowIdx:Q}:{idx:0,rowIdx:p?Q:A};case"End":return $?{idx:T,rowIdx:we}:{idx:Le,rowIdx:p?we:A};case"PageUp":{if(k.rowIdx===Q)return k;let V=Fn(A)+fr(A)-_t;return{idx:T,rowIdx:V>0?Ln(V):0}}case"PageDown":{if(k.rowIdx>=o.length)return k;let V=Fn(A)+_t;return{idx:T,rowIdx:V<Wt?Ln(V):o.length-1}}default:return k}}l(Hr,"getNextPosition");function Wn(_){let{key:p,shiftKey:D}=_,T="NONE";if(p==="Tab"){if(bl({shiftKey:D,maxColIdx:Le,minRowIdx:Q,maxRowIdx:we,selectedPosition:k})){An();return}T="CHANGE_ROW"}_.preventDefault();let A=pn(_),$=Hr(p,A,D);if(_n(k,$))return;let V=yl({moveUp:p==="ArrowUp",moveNext:p===zn||p==="Tab"&&!D,columns:q,colSpanColumns:kn,rows:o,topSummaryRows:r,bottomSummaryRows:i,minRowIdx:Q,mainHeaderRowIdx:dt,maxRowIdx:we,lastFrozenColumnIndex:oe,cellNavigationMode:T,currentPosition:k,nextPosition:$,isCellWithinBounds:jt});Xe(V)}l(Wn,"navigate");function Fr(_){if(Ke===void 0)return;let{rowIdx:p}=k;return(p<Ke?p<_&&_<=Ke:p>_&&_>=Ke)?k.idx:void 0}l(Fr,"getDraggedOverCellIdx");function Un(){let _=Fo(Pe.current);if(_===null)return;St(_),(_.querySelector('[tabindex="0"]')??_).focus({preventScroll:!0})}l(Un,"focusCellOrCellContent");function Lr(){if(E==null||k.mode==="EDIT"||!$n(k))return;let{idx:_,rowIdx:p}=k,D=q[_];if(D.renderEditCell==null||D.editable===!1)return;let T=vn(D);return H(Xl,{gridRowStart:He+p+1,rows:o,column:D,columnWidth:T,maxColIdx:Le,isLastRow:p===we,selectedPosition:k,isCellEditable:gt,latestDraggedOverRowIdx:In,onRowsChange:c,onClick:Un,onFill:E,setDragging:tr,setDraggedOverRowIdx:Vt})}l(Lr,"renderDragHandle");function Nr(_){if(k.rowIdx!==_||k.mode==="SELECT")return;let{idx:p,row:D}=k,T=q[p],A=le(T,oe,{type:"ROW",row:D}),$=l(j=>{ft.current=j,Fe(({idx:X,rowIdx:ae})=>({idx:X,rowIdx:ae,mode:"SELECT"}))},"closeEditor"),V=l((j,X,ae)=>{X?et(()=>{ht(T,k.rowIdx,j),$(ae)}):Fe(ce=>({...ce,row:j}))},"onRowChange");return o[k.rowIdx]!==k.originalRow&&$(!1),H(Jl,{column:T,colSpan:A,row:D,rowIdx:_,onRowChange:V,closeEditor:$,onKeyDown:v,navigate:Wn},T.key)}l(Nr,"getCellEditor");function Ze(_){let p=k.idx===-1?void 0:q[k.idx];return p!==void 0&&k.rowIdx===_&&!he.includes(p)?k.idx>Sn?[...he,p]:[...he.slice(0,oe+1),p,...he.slice(oe+1)]:he}l(Ze,"getRowViewportColumns");function Mr(){let _=[],{idx:p,rowIdx:D}=k,T=pt&&D<qe?qe-1:qe,A=pt&&D>Ye?Ye+1:Ye;for(let $=T;$<=A;$++){let V=$===qe-1||$===Ye+1,j=V?D:$,X=he,ae=p===-1?void 0:q[p];ae!==void 0&&(V?X=[ae]:X=Ze(j));let ce=o[j],Ar=He+j+1,Kt=j,Bt=!1;typeof a=="function"&&(Kt=a(ce),Bt=s?.has(Kt)??!1),_.push(ne(Kt,{"aria-rowindex":He+j+1,"aria-selected":$t?Bt:void 0,rowIdx:j,row:ce,viewportColumns:X,isRowSelectionDisabled:g?.(ce)??!1,isRowSelected:Bt,onCellClick:Cr,onCellDoubleClick:wr,onCellContextMenu:vr,rowClass:ie,gridRowStart:Ar,copiedCellIdx:Te!==null&&Te.row===ce?q.findIndex(Or=>Or.key===Te.columnKey):void 0,selectedCellIdx:D===j?p:void 0,draggedOverCellIdx:Fr(j),setDraggedOverRowIdx:Cn?Vt:void 0,lastFrozenColumnIndex:oe,onRowChange:kr,selectCell:Gt,selectedCellEditor:Nr(j)}))}return _}l(Mr,"getViewportRows"),(k.idx>Le||k.rowIdx>we)&&(Fe({idx:-1,rowIdx:Q-1,mode:"SELECT"}),Vt(void 0));let mt=`repeat(${Ce}, ${L}px)`;Be>0&&(mt+=` repeat(${Be}, ${G}px)`),o.length>0&&(mt+=ur),ze>0&&(mt+=` repeat(${ze}, ${G}px)`);let Gn=k.idx===-1&&k.rowIdx!==Q-1;return H("div",{role:rt,"aria-label":Tt,"aria-labelledby":Pt,"aria-describedby":zt,"aria-multiselectable":$t?!0:void 0,"aria-colcount":q.length,"aria-rowcount":Hn,className:fe(Wi,J,Cn&&Gi),style:{...U,scrollPaddingInlineStart:k.idx>oe||ct?.idx!==void 0?`${sr}px`:void 0,scrollPaddingBlock:Ne(k.rowIdx)||ct?.rowIdx!==void 0?`${Ot+Be*G}px ${ze*G}px`:void 0,gridTemplateColumns:_r,gridTemplateRows:mt,"--rdg-header-row-height":`${L}px`,"--rdg-scroll-height":`${gr}px`,...ir},dir:Se,ref:Pe,onScroll:Ir,onKeyDown:Er,"data-testid":Ft,children:[H(Pl,{value:cr,children:[H(Ll,{value:xr,children:H(Fl,{value:dr,children:[Array.from({length:Nt},(_,p)=>H(Ri,{rowIdx:p+1,level:-Nt+p,columns:Ze(Q+p),selectedCellIdx:k.rowIdx===Q+p?k.idx:void 0,selectCell:Nn},p)),H(vi,{rowIdx:Ce,columns:Ze(dt),onColumnResize:mr,onColumnsReorder:yr,sortColumns:x,onSortColumnsChange:br,lastFrozenColumnIndex:oe,selectedCellIdx:k.rowIdx===dt?k.idx:void 0,selectCell:Nn,shouldFocusGrid:!Ut,direction:Se})]})}),o.length===0&&it?it:H(Z,{children:[r?.map((_,p)=>{let D=Ce+1+p,T=dt+1+p,A=k.rowIdx===T,$=Ot+G*p;return H(Ho,{"aria-rowindex":D,rowIdx:T,gridRowStart:D,row:_,top:$,bottom:void 0,viewportColumns:Ze(T),lastFrozenColumnIndex:oe,selectedCellIdx:A?k.idx:void 0,isTop:!0,selectCell:Gt},p)}),H(Hl,{value:Rr,children:Mr()}),i?.map((_,p)=>{let D=He+o.length+p+1,T=o.length+p,A=k.rowIdx===T,$=_t>Wt?Rn-G*(i.length-p):void 0,V=$===void 0?G*(i.length-1-p):void 0;return H(Ho,{"aria-rowindex":Hn-ze+p+1,rowIdx:T,gridRowStart:D,row:_,top:$,bottom:V,viewportColumns:Ze(T),lastFrozenColumnIndex:oe,selectedCellIdx:A?k.idx:void 0,isTop:!1,selectCell:Gt},p)})]})]}),Lr(),hl(he),At&&H("div",{ref:ut,tabIndex:Gn?0:-1,className:fe(Vi,Gn&&[gi,oe!==-1&&mi],!Ne(k.rowIdx)&&ji),style:{gridRowStart:k.rowIdx+He+1}}),ct!==null&&H(Fi,{scrollToPosition:ct,setScrollToCellPosition:wn,gridElement:Pe.current})]})}l(Qi,"DataGrid");function Fo(e){return e.querySelector(':scope > [role="row"] > [tabindex="0"]')}l(Fo,"getCellToScroll");function _n(e,t){return e.idx===t.idx&&e.rowIdx===t.rowIdx}l(_n,"isSamePosition");var Zo=dn(Qi);var es="g1yxluv37-0-0-beta-47",As=`rdg-group-row ${es}`;var ts="t7vyx3i7-0-0-beta-47",Os=`rdg-text-editor ${ts}`;import{format as ns,timeFormat as os,timeParse as rs}from"@hpcc-js/common";function Jo(e){let t=Y(()=>e.columns(),[e,e.dataChecksum()]),n=Y(()=>e.data(),[e,e.dataChecksum()]);return[t,n]}l(Jo,"useData");(function(){if(!document.getElementById("acd94ec7")){var e=document.createElement("style");e.id="acd94ec7",e.textContent=`@layer rdg {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('@layer rdg{@layer Defaults,FocusSink,CheckboxInput,CheckboxIcon,CheckboxLabel,Cell,HeaderCell,SummaryCell,EditCell,Row,HeaderRow,SummaryRow,GroupedRow,Root;}@layer rdg.MeasuringCell{.mlln6zg7-0-0-beta-47{contain:strict;grid-row:1;visibility:hidden}}@layer rdg.Cell{.cj343x07-0-0-beta-47{position:relative;padding-block:0;padding-inline:8px;border-inline-end:1px solid var(--rdg-border-color);border-block-end:1px solid var(--rdg-border-color);grid-row-start:var(--rdg-grid-row-start);align-content:center;background-color:inherit;white-space:nowrap;overflow:clip;text-overflow:ellipsis;outline:none}.cj343x07-0-0-beta-47[aria-selected=true]{outline:2px solid var(--rdg-selection-color);outline-offset:-2px}}@layer rdg.Cell{.csofj7r7-0-0-beta-47{position:sticky;z-index:1}.csofj7r7-0-0-beta-47:nth-last-child(1 of.csofj7r7-0-0-beta-47){box-shadow:var(--rdg-cell-frozen-box-shadow)}}@layer rdg.CheckboxInput{.c1bn88vv7-0-0-beta-47{display:block;margin:auto;inline-size:20px;block-size:20px}.c1bn88vv7-0-0-beta-47:focus-visible{outline:2px solid var(--rdg-checkbox-focus-color);outline-offset:-3px}.c1bn88vv7-0-0-beta-47:enabled{cursor:pointer}}@layer rdg.GroupCellContent{.g1s9ylgp7-0-0-beta-47{outline:none}}@layer rdg.GroupCellCaret{.cz54e4y7-0-0-beta-47{margin-inline-start:4px;stroke:currentColor;stroke-width:1.5px;fill:transparent;vertical-align:middle}.cz54e4y7-0-0-beta-47>path{transition:d .1s}}@layer rdg.DragHandle{.c1w9bbhr7-0-0-beta-47{--rdg-drag-handle-size: 8px;z-index:0;cursor:move;inline-size:var(--rdg-drag-handle-size);block-size:var(--rdg-drag-handle-size);background-color:var(--rdg-selection-color);place-self:end}.c1w9bbhr7-0-0-beta-47:hover{--rdg-drag-handle-size: 16px;border:2px solid var(--rdg-selection-color);background-color:var(--rdg-background-color)}}@layer rdg.DragHandle{.c1creorc7-0-0-beta-47{z-index:1;position:sticky}}@layer rdg.EditCell{.cis5rrm7-0-0-beta-47{padding:0}}@layer rdg.SortableHeaderCell{.h44jtk67-0-0-beta-47{display:flex}}@layer rdg.SortableHeaderCellName{.hcgkhxz7-0-0-beta-47{flex-grow:1;overflow:clip;text-overflow:ellipsis}}@layer rdg.HeaderCell{.c6l2wv17-0-0-beta-47{cursor:pointer}}@layer rdg.HeaderCell{.c1kqdw7y7-0-0-beta-47{touch-action:none}}@layer rdg.HeaderCell{.r1y6ywlx7-0-0-beta-47{cursor:col-resize;position:absolute;inset-block-start:0;inset-inline-end:0;inset-block-end:0;inline-size:10px}}.c1bezg5o7-0-0-beta-47{opacity:.5}.c1vc96037-0-0-beta-47{background-color:var(--rdg-header-draggable-background-color)}@layer rdg.Row{.r1upfr807-0-0-beta-47{display:contents;background-color:var(--rdg-background-color)}.r1upfr807-0-0-beta-47:hover{background-color:var(--rdg-row-hover-background-color)}.r1upfr807-0-0-beta-47[aria-selected=true]{background-color:var(--rdg-row-selected-background-color)}.r1upfr807-0-0-beta-47[aria-selected=true]:hover{background-color:var(--rdg-row-selected-hover-background-color)}}@layer rdg.FocusSink{.r190mhd37-0-0-beta-47{outline:2px solid var(--rdg-selection-color);outline-offset:-2px}}@layer rdg.FocusSink{.r139qu9m7-0-0-beta-47:before{content:"";display:inline-block;block-size:100%;position:sticky;inset-inline-start:0;border-inline-start:2px solid var(--rdg-selection-color)}}@layer rdg.HeaderRow{.h10tskcx7-0-0-beta-47{display:contents;background-color:var(--rdg-header-background-color);font-weight:700}.h10tskcx7-0-0-beta-47>.cj343x07-0-0-beta-47{z-index:2;position:sticky}.h10tskcx7-0-0-beta-47>.csofj7r7-0-0-beta-47{z-index:3}}@layer rdg.Cell{.c6ra8a37-0-0-beta-47{background-color:#ccf}}@layer rdg.Cell{.cq910m07-0-0-beta-47{background-color:#ccf}.cq910m07-0-0-beta-47.c6ra8a37-0-0-beta-47{background-color:#99f}}@layer rdg.SortIcon{.a3ejtar7-0-0-beta-47{fill:currentColor}.a3ejtar7-0-0-beta-47>path{transition:d .1s}}@layer rdg.Defaults{.rnvodz57-0-0-beta-47 *,.rnvodz57-0-0-beta-47 *:before,.rnvodz57-0-0-beta-47 *:after{box-sizing:inherit}}@layer rdg.Root{.rnvodz57-0-0-beta-47{--rdg-color: #000;--rdg-border-color: #ddd;--rdg-summary-border-color: #aaa;--rdg-background-color: hsl(0deg 0% 100%);--rdg-header-background-color: hsl(0deg 0% 97.5%);--rdg-header-draggable-background-color: hsl(0deg 0% 90.5%);--rdg-row-hover-background-color: hsl(0deg 0% 96%);--rdg-row-selected-background-color: hsl(207deg 76% 92%);--rdg-row-selected-hover-background-color: hsl(207deg 76% 88%);--rdg-checkbox-focus-color: hsl(207deg 100% 69%);--rdg-selection-color: #66afe9;--rdg-font-size: 14px;--rdg-cell-frozen-box-shadow: 2px 0 5px -2px rgba(136, 136, 136, .3);display:grid;color-scheme:var(--rdg-color-scheme, light dark);accent-color:light-dark(hsl(207deg 100% 29%),hsl(207deg 100% 79%));contain:content;content-visibility:auto;block-size:350px;border:1px solid var(--rdg-border-color);box-sizing:border-box;overflow:auto;background-color:var(--rdg-background-color);color:var(--rdg-color);font-size:var(--rdg-font-size)}.rnvodz57-0-0-beta-47:dir(rtl){--rdg-cell-frozen-box-shadow: -2px 0 5px -2px rgba(136, 136, 136, .3)}.rnvodz57-0-0-beta-47:before{content:"";grid-column:1/-1;grid-row:1/-1}.rnvodz57-0-0-beta-47.rdg-dark{--rdg-color-scheme: dark;--rdg-color: #ddd;--rdg-border-color: #444;--rdg-summary-border-color: #555;--rdg-background-color: hsl(0deg 0% 13%);--rdg-header-background-color: hsl(0deg 0% 10.5%);--rdg-header-draggable-background-color: hsl(0deg 0% 17.5%);--rdg-row-hover-background-color: hsl(0deg 0% 9%);--rdg-row-selected-background-color: hsl(207deg 76% 42%);--rdg-row-selected-hover-background-color: hsl(207deg 76% 38%);--rdg-checkbox-focus-color: hsl(207deg 100% 89%)}.rnvodz57-0-0-beta-47.rdg-light{--rdg-color-scheme: light}@media (prefers-color-scheme: dark){.rnvodz57-0-0-beta-47:not(.rdg-light){--rdg-color: #ddd;--rdg-border-color: #444;--rdg-summary-border-color: #555;--rdg-background-color: hsl(0deg 0% 13%);--rdg-header-background-color: hsl(0deg 0% 10.5%);--rdg-header-draggable-background-color: hsl(0deg 0% 17.5%);--rdg-row-hover-background-color: hsl(0deg 0% 9%);--rdg-row-selected-background-color: hsl(207deg 76% 42%);--rdg-row-selected-hover-background-color: hsl(207deg 76% 38%);--rdg-checkbox-focus-color: hsl(207deg 100% 89%)}}.rnvodz57-0-0-beta-47>:nth-last-child(1 of.rdg-top-summary-row)>.cj343x07-0-0-beta-47{border-block-end:2px solid var(--rdg-summary-border-color)}.rnvodz57-0-0-beta-47>:nth-child(1 of.rdg-bottom-summary-row)>.cj343x07-0-0-beta-47{border-block-start:2px solid var(--rdg-summary-border-color)}}@layer rdg.Root{.vlqv91k7-0-0-beta-47{-webkit-user-select:none;user-select:none}.vlqv91k7-0-0-beta-47 .r1upfr807-0-0-beta-47{cursor:move}}@layer rdg.FocusSink{.f1lsfrzw7-0-0-beta-47{grid-column:1/-1;pointer-events:none;z-index:1}}@layer rdg.FocusSink{.f1cte0lg7-0-0-beta-47{z-index:3}}@layer rdg.SummaryCell{.s8wc6fl7-0-0-beta-47{inset-block-start:var(--rdg-summary-row-top);inset-block-end:var(--rdg-summary-row-bottom)}}@layer rdg.SummaryRow{.skuhp557-0-0-beta-47>.cj343x07-0-0-beta-47{position:sticky}}@layer rdg.SummaryRow{.tf8l5ub7-0-0-beta-47>.cj343x07-0-0-beta-47{z-index:2}.tf8l5ub7-0-0-beta-47>.csofj7r7-0-0-beta-47{z-index:3}}@layer rdg.GroupedRow{.g1yxluv37-0-0-beta-47:not([aria-selected=true]){background-color:var(--rdg-header-background-color)}.g1yxluv37-0-0-beta-47>.cj343x07-0-0-beta-47:not(:last-child,.csofj7r7-0-0-beta-47),.g1yxluv37-0-0-beta-47>:nth-last-child(n+2 of.csofj7r7-0-0-beta-47){border-inline-end:none}}@layer rdg.TextEditor{.t7vyx3i7-0-0-beta-47{-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;inline-size:100%;block-size:100%;padding-block:0;padding-inline:6px;border:2px solid #ccc;vertical-align:top;color:var(--rdg-color);background-color:var(--rdg-background-color);font-family:inherit;font-size:var(--rdg-font-size)}.t7vyx3i7-0-0-beta-47:focus{border-color:var(--rdg-selection-color);outline:none}.t7vyx3i7-0-0-beta-47::placeholder{color:#999;opacity:1}}.dgrid2_Table .rdg{font-family:monospace,Courier New,Courier}.dgrid2_Table .rdg-checkbox-label .rdg-checkbox{block-size:16px;inline-size:16px;border-width:2px;box-shadow:inset 0 0 0 3px var(--rdg-background-color)}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
+
import require$$0$1, { forwardRef, createContext, useState, useCallback, useRef, useMemo, useImperativeHandle, useContext, useEffect, useLayoutEffect as useLayoutEffect$1, memo, useId, createElement } from "react";
|
|
6
|
+
import require$$0, { flushSync } from "react-dom";
|
|
7
|
+
import { format, timeParse, timeFormat, HTMLWidget } from "@hpcc-js/common";
|
|
8
|
+
const PKG_NAME = "@hpcc-js/dgrid2", PKG_VERSION = "3.1.1", BUILD_VERSION = "3.2.1";
|
|
9
|
+
var client = {}, hasRequiredClient;
|
|
10
|
+
function requireClient() {
|
|
11
|
+
if (hasRequiredClient) return client;
|
|
12
|
+
hasRequiredClient = 1;
|
|
13
|
+
var m = require$$0;
|
|
14
|
+
if (process.env.NODE_ENV === "production")
|
|
15
|
+
client.createRoot = m.createRoot, client.hydrateRoot = m.hydrateRoot;
|
|
16
|
+
else {
|
|
17
|
+
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
18
|
+
client.createRoot = function(c, o) {
|
|
19
|
+
i.usingClientEntryPoint = !0;
|
|
20
|
+
try {
|
|
21
|
+
return m.createRoot(c, o);
|
|
22
|
+
} finally {
|
|
23
|
+
i.usingClientEntryPoint = !1;
|
|
24
|
+
}
|
|
25
|
+
}, client.hydrateRoot = function(c, h, o) {
|
|
26
|
+
i.usingClientEntryPoint = !0;
|
|
27
|
+
try {
|
|
28
|
+
return m.hydrateRoot(c, h, o);
|
|
29
|
+
} finally {
|
|
30
|
+
i.usingClientEntryPoint = !1;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return client;
|
|
16
35
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
var clientExports = requireClient(), jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
37
|
+
/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-jsx-runtime.production.min.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/
|
|
46
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
47
|
+
function requireReactJsxRuntime_production_min() {
|
|
48
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
49
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
50
|
+
var f = require$$0$1, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
51
|
+
function q(c, a, g) {
|
|
52
|
+
var b, d = {}, e = null, h = null;
|
|
53
|
+
g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
54
|
+
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
55
|
+
if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
|
|
56
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
23
57
|
}
|
|
58
|
+
return reactJsxRuntime_production_min.Fragment = l, reactJsxRuntime_production_min.jsx = q, reactJsxRuntime_production_min.jsxs = q, reactJsxRuntime_production_min;
|
|
24
59
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
white-space: nowrap;
|
|
45
|
-
overflow: clip;
|
|
46
|
-
text-overflow: ellipsis;
|
|
47
|
-
outline: none;
|
|
48
|
-
|
|
49
|
-
&[aria-selected='true'] {
|
|
50
|
-
outline: 2px solid var(--rdg-selection-color);
|
|
51
|
-
outline-offset: -2px;
|
|
60
|
+
var reactJsxRuntime_development = {};
|
|
61
|
+
/**
|
|
62
|
+
* @license React
|
|
63
|
+
* react-jsx-runtime.development.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/
|
|
70
|
+
var hasRequiredReactJsxRuntime_development;
|
|
71
|
+
function requireReactJsxRuntime_development() {
|
|
72
|
+
return hasRequiredReactJsxRuntime_development || (hasRequiredReactJsxRuntime_development = 1, process.env.NODE_ENV !== "production" && function() {
|
|
73
|
+
var React = require$$0$1, REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
74
|
+
function getIteratorFn(maybeIterable) {
|
|
75
|
+
if (maybeIterable === null || typeof maybeIterable != "object")
|
|
76
|
+
return null;
|
|
77
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
78
|
+
return typeof maybeIterator == "function" ? maybeIterator : null;
|
|
52
79
|
}
|
|
53
|
-
|
|
80
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
81
|
+
function error(format2) {
|
|
82
|
+
{
|
|
83
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)
|
|
84
|
+
args[_key2 - 1] = arguments[_key2];
|
|
85
|
+
printWarning("error", format2, args);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function printWarning(level, format2, args) {
|
|
89
|
+
{
|
|
90
|
+
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame, stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
91
|
+
stack !== "" && (format2 += "%s", args = args.concat([stack]));
|
|
92
|
+
var argsWithFormat = args.map(function(item) {
|
|
93
|
+
return String(item);
|
|
94
|
+
});
|
|
95
|
+
argsWithFormat.unshift("Warning: " + format2), Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
var enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_MODULE_REFERENCE;
|
|
99
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
100
|
+
function isValidElementType(type) {
|
|
101
|
+
return !!(typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
102
|
+
// types supported by any Flight configuration anywhere since
|
|
103
|
+
// we don't know which Flight build this will end up being used
|
|
104
|
+
// with.
|
|
105
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0));
|
|
106
|
+
}
|
|
107
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
108
|
+
var displayName = outerType.displayName;
|
|
109
|
+
if (displayName)
|
|
110
|
+
return displayName;
|
|
111
|
+
var functionName = innerType.displayName || innerType.name || "";
|
|
112
|
+
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
113
|
+
}
|
|
114
|
+
function getContextName(type) {
|
|
115
|
+
return type.displayName || "Context";
|
|
116
|
+
}
|
|
117
|
+
function getComponentNameFromType(type) {
|
|
118
|
+
if (type == null)
|
|
119
|
+
return null;
|
|
120
|
+
if (typeof type.tag == "number" && error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof type == "function")
|
|
121
|
+
return type.displayName || type.name || null;
|
|
122
|
+
if (typeof type == "string")
|
|
123
|
+
return type;
|
|
124
|
+
switch (type) {
|
|
125
|
+
case REACT_FRAGMENT_TYPE:
|
|
126
|
+
return "Fragment";
|
|
127
|
+
case REACT_PORTAL_TYPE:
|
|
128
|
+
return "Portal";
|
|
129
|
+
case REACT_PROFILER_TYPE:
|
|
130
|
+
return "Profiler";
|
|
131
|
+
case REACT_STRICT_MODE_TYPE:
|
|
132
|
+
return "StrictMode";
|
|
133
|
+
case REACT_SUSPENSE_TYPE:
|
|
134
|
+
return "Suspense";
|
|
135
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
136
|
+
return "SuspenseList";
|
|
137
|
+
}
|
|
138
|
+
if (typeof type == "object")
|
|
139
|
+
switch (type.$$typeof) {
|
|
140
|
+
case REACT_CONTEXT_TYPE:
|
|
141
|
+
var context = type;
|
|
142
|
+
return getContextName(context) + ".Consumer";
|
|
143
|
+
case REACT_PROVIDER_TYPE:
|
|
144
|
+
var provider = type;
|
|
145
|
+
return getContextName(provider._context) + ".Provider";
|
|
146
|
+
case REACT_FORWARD_REF_TYPE:
|
|
147
|
+
return getWrappedName(type, type.render, "ForwardRef");
|
|
148
|
+
case REACT_MEMO_TYPE:
|
|
149
|
+
var outerName = type.displayName || null;
|
|
150
|
+
return outerName !== null ? outerName : getComponentNameFromType(type.type) || "Memo";
|
|
151
|
+
case REACT_LAZY_TYPE: {
|
|
152
|
+
var lazyComponent = type, payload = lazyComponent._payload, init = lazyComponent._init;
|
|
153
|
+
try {
|
|
154
|
+
return getComponentNameFromType(init(payload));
|
|
155
|
+
} catch {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
var assign = Object.assign, disabledDepth = 0, prevLog, prevInfo, prevWarn, prevError, prevGroup, prevGroupCollapsed, prevGroupEnd;
|
|
163
|
+
function disabledLog() {
|
|
164
|
+
}
|
|
165
|
+
disabledLog.__reactDisabledLog = !0;
|
|
166
|
+
function disableLogs() {
|
|
167
|
+
{
|
|
168
|
+
if (disabledDepth === 0) {
|
|
169
|
+
prevLog = console.log, prevInfo = console.info, prevWarn = console.warn, prevError = console.error, prevGroup = console.group, prevGroupCollapsed = console.groupCollapsed, prevGroupEnd = console.groupEnd;
|
|
170
|
+
var props = {
|
|
171
|
+
configurable: !0,
|
|
172
|
+
enumerable: !0,
|
|
173
|
+
value: disabledLog,
|
|
174
|
+
writable: !0
|
|
175
|
+
};
|
|
176
|
+
Object.defineProperties(console, {
|
|
177
|
+
info: props,
|
|
178
|
+
log: props,
|
|
179
|
+
warn: props,
|
|
180
|
+
error: props,
|
|
181
|
+
group: props,
|
|
182
|
+
groupCollapsed: props,
|
|
183
|
+
groupEnd: props
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
disabledDepth++;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function reenableLogs() {
|
|
190
|
+
{
|
|
191
|
+
if (disabledDepth--, disabledDepth === 0) {
|
|
192
|
+
var props = {
|
|
193
|
+
configurable: !0,
|
|
194
|
+
enumerable: !0,
|
|
195
|
+
writable: !0
|
|
196
|
+
};
|
|
197
|
+
Object.defineProperties(console, {
|
|
198
|
+
log: assign({}, props, {
|
|
199
|
+
value: prevLog
|
|
200
|
+
}),
|
|
201
|
+
info: assign({}, props, {
|
|
202
|
+
value: prevInfo
|
|
203
|
+
}),
|
|
204
|
+
warn: assign({}, props, {
|
|
205
|
+
value: prevWarn
|
|
206
|
+
}),
|
|
207
|
+
error: assign({}, props, {
|
|
208
|
+
value: prevError
|
|
209
|
+
}),
|
|
210
|
+
group: assign({}, props, {
|
|
211
|
+
value: prevGroup
|
|
212
|
+
}),
|
|
213
|
+
groupCollapsed: assign({}, props, {
|
|
214
|
+
value: prevGroupCollapsed
|
|
215
|
+
}),
|
|
216
|
+
groupEnd: assign({}, props, {
|
|
217
|
+
value: prevGroupEnd
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
disabledDepth < 0 && error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, prefix;
|
|
225
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
226
|
+
{
|
|
227
|
+
if (prefix === void 0)
|
|
228
|
+
try {
|
|
229
|
+
throw Error();
|
|
230
|
+
} catch (x) {
|
|
231
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
232
|
+
prefix = match && match[1] || "";
|
|
233
|
+
}
|
|
234
|
+
return `
|
|
235
|
+
` + prefix + name;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
var reentry = !1, componentFrameCache;
|
|
239
|
+
{
|
|
240
|
+
var PossiblyWeakMap = typeof WeakMap == "function" ? WeakMap : Map;
|
|
241
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
242
|
+
}
|
|
243
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
244
|
+
if (!fn || reentry)
|
|
245
|
+
return "";
|
|
246
|
+
{
|
|
247
|
+
var frame = componentFrameCache.get(fn);
|
|
248
|
+
if (frame !== void 0)
|
|
249
|
+
return frame;
|
|
250
|
+
}
|
|
251
|
+
var control;
|
|
252
|
+
reentry = !0;
|
|
253
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
254
|
+
Error.prepareStackTrace = void 0;
|
|
255
|
+
var previousDispatcher;
|
|
256
|
+
previousDispatcher = ReactCurrentDispatcher.current, ReactCurrentDispatcher.current = null, disableLogs();
|
|
257
|
+
try {
|
|
258
|
+
if (construct) {
|
|
259
|
+
var Fake = function() {
|
|
260
|
+
throw Error();
|
|
261
|
+
};
|
|
262
|
+
if (Object.defineProperty(Fake.prototype, "props", {
|
|
263
|
+
set: function() {
|
|
264
|
+
throw Error();
|
|
265
|
+
}
|
|
266
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
267
|
+
try {
|
|
268
|
+
Reflect.construct(Fake, []);
|
|
269
|
+
} catch (x) {
|
|
270
|
+
control = x;
|
|
271
|
+
}
|
|
272
|
+
Reflect.construct(fn, [], Fake);
|
|
273
|
+
} else {
|
|
274
|
+
try {
|
|
275
|
+
Fake.call();
|
|
276
|
+
} catch (x) {
|
|
277
|
+
control = x;
|
|
278
|
+
}
|
|
279
|
+
fn.call(Fake.prototype);
|
|
280
|
+
}
|
|
281
|
+
} else {
|
|
282
|
+
try {
|
|
283
|
+
throw Error();
|
|
284
|
+
} catch (x) {
|
|
285
|
+
control = x;
|
|
286
|
+
}
|
|
287
|
+
fn();
|
|
288
|
+
}
|
|
289
|
+
} catch (sample) {
|
|
290
|
+
if (sample && control && typeof sample.stack == "string") {
|
|
291
|
+
for (var sampleLines = sample.stack.split(`
|
|
292
|
+
`), controlLines = control.stack.split(`
|
|
293
|
+
`), s = sampleLines.length - 1, c = controlLines.length - 1; s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]; )
|
|
294
|
+
c--;
|
|
295
|
+
for (; s >= 1 && c >= 0; s--, c--)
|
|
296
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
297
|
+
if (s !== 1 || c !== 1)
|
|
298
|
+
do
|
|
299
|
+
if (s--, c--, c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
300
|
+
var _frame = `
|
|
301
|
+
` + sampleLines[s].replace(" at new ", " at ");
|
|
302
|
+
return fn.displayName && _frame.includes("<anonymous>") && (_frame = _frame.replace("<anonymous>", fn.displayName)), typeof fn == "function" && componentFrameCache.set(fn, _frame), _frame;
|
|
303
|
+
}
|
|
304
|
+
while (s >= 1 && c >= 0);
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
} finally {
|
|
309
|
+
reentry = !1, ReactCurrentDispatcher.current = previousDispatcher, reenableLogs(), Error.prepareStackTrace = previousPrepareStackTrace;
|
|
310
|
+
}
|
|
311
|
+
var name = fn ? fn.displayName || fn.name : "", syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
312
|
+
return typeof fn == "function" && componentFrameCache.set(fn, syntheticFrame), syntheticFrame;
|
|
313
|
+
}
|
|
314
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
315
|
+
return describeNativeComponentFrame(fn, !1);
|
|
316
|
+
}
|
|
317
|
+
function shouldConstruct(Component) {
|
|
318
|
+
var prototype = Component.prototype;
|
|
319
|
+
return !!(prototype && prototype.isReactComponent);
|
|
320
|
+
}
|
|
321
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
322
|
+
if (type == null)
|
|
323
|
+
return "";
|
|
324
|
+
if (typeof type == "function")
|
|
325
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
326
|
+
if (typeof type == "string")
|
|
327
|
+
return describeBuiltInComponentFrame(type);
|
|
328
|
+
switch (type) {
|
|
329
|
+
case REACT_SUSPENSE_TYPE:
|
|
330
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
331
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
332
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
333
|
+
}
|
|
334
|
+
if (typeof type == "object")
|
|
335
|
+
switch (type.$$typeof) {
|
|
336
|
+
case REACT_FORWARD_REF_TYPE:
|
|
337
|
+
return describeFunctionComponentFrame(type.render);
|
|
338
|
+
case REACT_MEMO_TYPE:
|
|
339
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
340
|
+
case REACT_LAZY_TYPE: {
|
|
341
|
+
var lazyComponent = type, payload = lazyComponent._payload, init = lazyComponent._init;
|
|
342
|
+
try {
|
|
343
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
344
|
+
} catch {
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
return "";
|
|
349
|
+
}
|
|
350
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty, loggedTypeFailures = {}, ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
351
|
+
function setCurrentlyValidatingElement(element) {
|
|
352
|
+
if (element) {
|
|
353
|
+
var owner = element._owner, stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
354
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
355
|
+
} else
|
|
356
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
357
|
+
}
|
|
358
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
359
|
+
{
|
|
360
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
361
|
+
for (var typeSpecName in typeSpecs)
|
|
362
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
363
|
+
var error$1 = void 0;
|
|
364
|
+
try {
|
|
365
|
+
if (typeof typeSpecs[typeSpecName] != "function") {
|
|
366
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
367
|
+
throw err.name = "Invariant Violation", err;
|
|
368
|
+
}
|
|
369
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
370
|
+
} catch (ex) {
|
|
371
|
+
error$1 = ex;
|
|
372
|
+
}
|
|
373
|
+
error$1 && !(error$1 instanceof Error) && (setCurrentlyValidatingElement(element), error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1), setCurrentlyValidatingElement(null)), error$1 instanceof Error && !(error$1.message in loggedTypeFailures) && (loggedTypeFailures[error$1.message] = !0, setCurrentlyValidatingElement(element), error("Failed %s type: %s", location, error$1.message), setCurrentlyValidatingElement(null));
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
var isArrayImpl = Array.isArray;
|
|
378
|
+
function isArray(a) {
|
|
379
|
+
return isArrayImpl(a);
|
|
380
|
+
}
|
|
381
|
+
function typeName(value) {
|
|
382
|
+
{
|
|
383
|
+
var hasToStringTag = typeof Symbol == "function" && Symbol.toStringTag, type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
384
|
+
return type;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function willCoercionThrow(value) {
|
|
388
|
+
try {
|
|
389
|
+
return testStringCoercion(value), !1;
|
|
390
|
+
} catch {
|
|
391
|
+
return !0;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function testStringCoercion(value) {
|
|
395
|
+
return "" + value;
|
|
396
|
+
}
|
|
397
|
+
function checkKeyStringCoercion(value) {
|
|
398
|
+
if (willCoercionThrow(value))
|
|
399
|
+
return error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value)), testStringCoercion(value);
|
|
400
|
+
}
|
|
401
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner, RESERVED_PROPS = {
|
|
402
|
+
key: !0,
|
|
403
|
+
ref: !0,
|
|
404
|
+
__self: !0,
|
|
405
|
+
__source: !0
|
|
406
|
+
}, specialPropKeyWarningShown, specialPropRefWarningShown;
|
|
407
|
+
function hasValidRef(config) {
|
|
408
|
+
if (hasOwnProperty.call(config, "ref")) {
|
|
409
|
+
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
410
|
+
if (getter && getter.isReactWarning)
|
|
411
|
+
return !1;
|
|
412
|
+
}
|
|
413
|
+
return config.ref !== void 0;
|
|
414
|
+
}
|
|
415
|
+
function hasValidKey(config) {
|
|
416
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
417
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
418
|
+
if (getter && getter.isReactWarning)
|
|
419
|
+
return !1;
|
|
420
|
+
}
|
|
421
|
+
return config.key !== void 0;
|
|
422
|
+
}
|
|
423
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
424
|
+
typeof config.ref == "string" && ReactCurrentOwner.current;
|
|
425
|
+
}
|
|
426
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
427
|
+
{
|
|
428
|
+
var warnAboutAccessingKey = function() {
|
|
429
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName));
|
|
430
|
+
};
|
|
431
|
+
warnAboutAccessingKey.isReactWarning = !0, Object.defineProperty(props, "key", {
|
|
432
|
+
get: warnAboutAccessingKey,
|
|
433
|
+
configurable: !0
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
438
|
+
{
|
|
439
|
+
var warnAboutAccessingRef = function() {
|
|
440
|
+
specialPropRefWarningShown || (specialPropRefWarningShown = !0, error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName));
|
|
441
|
+
};
|
|
442
|
+
warnAboutAccessingRef.isReactWarning = !0, Object.defineProperty(props, "ref", {
|
|
443
|
+
get: warnAboutAccessingRef,
|
|
444
|
+
configurable: !0
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
449
|
+
var element = {
|
|
450
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
451
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
452
|
+
// Built-in properties that belong on the element
|
|
453
|
+
type,
|
|
454
|
+
key,
|
|
455
|
+
ref,
|
|
456
|
+
props,
|
|
457
|
+
// Record the component responsible for creating this element.
|
|
458
|
+
_owner: owner
|
|
459
|
+
};
|
|
460
|
+
return element._store = {}, Object.defineProperty(element._store, "validated", {
|
|
461
|
+
configurable: !1,
|
|
462
|
+
enumerable: !1,
|
|
463
|
+
writable: !0,
|
|
464
|
+
value: !1
|
|
465
|
+
}), Object.defineProperty(element, "_self", {
|
|
466
|
+
configurable: !1,
|
|
467
|
+
enumerable: !1,
|
|
468
|
+
writable: !1,
|
|
469
|
+
value: self
|
|
470
|
+
}), Object.defineProperty(element, "_source", {
|
|
471
|
+
configurable: !1,
|
|
472
|
+
enumerable: !1,
|
|
473
|
+
writable: !1,
|
|
474
|
+
value: source
|
|
475
|
+
}), Object.freeze && (Object.freeze(element.props), Object.freeze(element)), element;
|
|
476
|
+
};
|
|
477
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
478
|
+
{
|
|
479
|
+
var propName, props = {}, key = null, ref = null;
|
|
480
|
+
maybeKey !== void 0 && (checkKeyStringCoercion(maybeKey), key = "" + maybeKey), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), hasValidRef(config) && (ref = config.ref, warnIfStringRefCannotBeAutoConverted(config, self));
|
|
481
|
+
for (propName in config)
|
|
482
|
+
hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName) && (props[propName] = config[propName]);
|
|
483
|
+
if (type && type.defaultProps) {
|
|
484
|
+
var defaultProps = type.defaultProps;
|
|
485
|
+
for (propName in defaultProps)
|
|
486
|
+
props[propName] === void 0 && (props[propName] = defaultProps[propName]);
|
|
487
|
+
}
|
|
488
|
+
if (key || ref) {
|
|
489
|
+
var displayName = typeof type == "function" ? type.displayName || type.name || "Unknown" : type;
|
|
490
|
+
key && defineKeyPropWarningGetter(props, displayName), ref && defineRefPropWarningGetter(props, displayName);
|
|
491
|
+
}
|
|
492
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner, ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
496
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
497
|
+
if (element) {
|
|
498
|
+
var owner = element._owner, stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
499
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
500
|
+
} else
|
|
501
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
502
|
+
}
|
|
503
|
+
var propTypesMisspellWarningShown;
|
|
504
|
+
propTypesMisspellWarningShown = !1;
|
|
505
|
+
function isValidElement(object) {
|
|
506
|
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
507
|
+
}
|
|
508
|
+
function getDeclarationErrorAddendum() {
|
|
509
|
+
{
|
|
510
|
+
if (ReactCurrentOwner$1.current) {
|
|
511
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
512
|
+
if (name)
|
|
513
|
+
return `
|
|
514
|
+
|
|
515
|
+
Check the render method of \`` + name + "`.";
|
|
516
|
+
}
|
|
517
|
+
return "";
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
function getSourceInfoErrorAddendum(source) {
|
|
521
|
+
return "";
|
|
522
|
+
}
|
|
523
|
+
var ownerHasKeyUseWarning = {};
|
|
524
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
525
|
+
{
|
|
526
|
+
var info = getDeclarationErrorAddendum();
|
|
527
|
+
if (!info) {
|
|
528
|
+
var parentName = typeof parentType == "string" ? parentType : parentType.displayName || parentType.name;
|
|
529
|
+
parentName && (info = `
|
|
530
|
+
|
|
531
|
+
Check the top-level render call using <` + parentName + ">.");
|
|
532
|
+
}
|
|
533
|
+
return info;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function validateExplicitKey(element, parentType) {
|
|
537
|
+
{
|
|
538
|
+
if (!element._store || element._store.validated || element.key != null)
|
|
539
|
+
return;
|
|
540
|
+
element._store.validated = !0;
|
|
541
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
542
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo])
|
|
543
|
+
return;
|
|
544
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = !0;
|
|
545
|
+
var childOwner = "";
|
|
546
|
+
element && element._owner && element._owner !== ReactCurrentOwner$1.current && (childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."), setCurrentlyValidatingElement$1(element), error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner), setCurrentlyValidatingElement$1(null);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
function validateChildKeys(node, parentType) {
|
|
550
|
+
{
|
|
551
|
+
if (typeof node != "object")
|
|
552
|
+
return;
|
|
553
|
+
if (isArray(node))
|
|
554
|
+
for (var i = 0; i < node.length; i++) {
|
|
555
|
+
var child = node[i];
|
|
556
|
+
isValidElement(child) && validateExplicitKey(child, parentType);
|
|
557
|
+
}
|
|
558
|
+
else if (isValidElement(node))
|
|
559
|
+
node._store && (node._store.validated = !0);
|
|
560
|
+
else if (node) {
|
|
561
|
+
var iteratorFn = getIteratorFn(node);
|
|
562
|
+
if (typeof iteratorFn == "function" && iteratorFn !== node.entries)
|
|
563
|
+
for (var iterator = iteratorFn.call(node), step; !(step = iterator.next()).done; )
|
|
564
|
+
isValidElement(step.value) && validateExplicitKey(step.value, parentType);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function validatePropTypes(element) {
|
|
569
|
+
{
|
|
570
|
+
var type = element.type;
|
|
571
|
+
if (type == null || typeof type == "string")
|
|
572
|
+
return;
|
|
573
|
+
var propTypes;
|
|
574
|
+
if (typeof type == "function")
|
|
575
|
+
propTypes = type.propTypes;
|
|
576
|
+
else if (typeof type == "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
577
|
+
// Inner props are checked in the reconciler.
|
|
578
|
+
type.$$typeof === REACT_MEMO_TYPE))
|
|
579
|
+
propTypes = type.propTypes;
|
|
580
|
+
else
|
|
581
|
+
return;
|
|
582
|
+
if (propTypes) {
|
|
583
|
+
var name = getComponentNameFromType(type);
|
|
584
|
+
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
585
|
+
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
586
|
+
propTypesMisspellWarningShown = !0;
|
|
587
|
+
var _name = getComponentNameFromType(type);
|
|
588
|
+
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
589
|
+
}
|
|
590
|
+
typeof type.getDefaultProps == "function" && !type.getDefaultProps.isReactClassApproved && error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function validateFragmentProps(fragment) {
|
|
594
|
+
{
|
|
595
|
+
for (var keys = Object.keys(fragment.props), i = 0; i < keys.length; i++) {
|
|
596
|
+
var key = keys[i];
|
|
597
|
+
if (key !== "children" && key !== "key") {
|
|
598
|
+
setCurrentlyValidatingElement$1(fragment), error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key), setCurrentlyValidatingElement$1(null);
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
fragment.ref !== null && (setCurrentlyValidatingElement$1(fragment), error("Invalid attribute `ref` supplied to `React.Fragment`."), setCurrentlyValidatingElement$1(null));
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
var didWarnAboutKeySpread = {};
|
|
606
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
607
|
+
{
|
|
608
|
+
var validType = isValidElementType(type);
|
|
609
|
+
if (!validType) {
|
|
610
|
+
var info = "";
|
|
611
|
+
(type === void 0 || typeof type == "object" && type !== null && Object.keys(type).length === 0) && (info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
612
|
+
var sourceInfo = getSourceInfoErrorAddendum();
|
|
613
|
+
sourceInfo ? info += sourceInfo : info += getDeclarationErrorAddendum();
|
|
614
|
+
var typeString;
|
|
615
|
+
type === null ? typeString = "null" : isArray(type) ? typeString = "array" : type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE ? (typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />", info = " Did you accidentally export a JSX literal instead of a component?") : typeString = typeof type, error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
616
|
+
}
|
|
617
|
+
var element = jsxDEV(type, props, key, source, self);
|
|
618
|
+
if (element == null)
|
|
619
|
+
return element;
|
|
620
|
+
if (validType) {
|
|
621
|
+
var children = props.children;
|
|
622
|
+
if (children !== void 0)
|
|
623
|
+
if (isStaticChildren)
|
|
624
|
+
if (isArray(children)) {
|
|
625
|
+
for (var i = 0; i < children.length; i++)
|
|
626
|
+
validateChildKeys(children[i], type);
|
|
627
|
+
Object.freeze && Object.freeze(children);
|
|
628
|
+
} else
|
|
629
|
+
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
630
|
+
else
|
|
631
|
+
validateChildKeys(children, type);
|
|
632
|
+
}
|
|
633
|
+
if (hasOwnProperty.call(props, "key")) {
|
|
634
|
+
var componentName = getComponentNameFromType(type), keys = Object.keys(props).filter(function(k) {
|
|
635
|
+
return k !== "key";
|
|
636
|
+
}), beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
637
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
638
|
+
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
639
|
+
error(`A props object containing a "key" prop is being spread into JSX:
|
|
640
|
+
let props = %s;
|
|
641
|
+
<%s {...props} />
|
|
642
|
+
React keys must be passed directly to JSX without using spread:
|
|
643
|
+
let props = %s;
|
|
644
|
+
<%s key={someKey} {...props} />`, beforeExample, componentName, afterExample, componentName), didWarnAboutKeySpread[componentName + beforeExample] = !0;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return type === REACT_FRAGMENT_TYPE ? validateFragmentProps(element) : validatePropTypes(element), element;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
651
|
+
return jsxWithValidation(type, props, key, !0);
|
|
652
|
+
}
|
|
653
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
654
|
+
return jsxWithValidation(type, props, key, !1);
|
|
655
|
+
}
|
|
656
|
+
var jsx = jsxWithValidationDynamic, jsxs = jsxWithValidationStatic;
|
|
657
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE, reactJsxRuntime_development.jsx = jsx, reactJsxRuntime_development.jsxs = jsxs;
|
|
658
|
+
}()), reactJsxRuntime_development;
|
|
54
659
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
660
|
+
var hasRequiredJsxRuntime;
|
|
661
|
+
function requireJsxRuntime() {
|
|
662
|
+
return hasRequiredJsxRuntime || (hasRequiredJsxRuntime = 1, process.env.NODE_ENV === "production" ? jsxRuntime.exports = requireReactJsxRuntime_production_min() : jsxRuntime.exports = requireReactJsxRuntime_development()), jsxRuntime.exports;
|
|
663
|
+
}
|
|
664
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
665
|
+
function r(e) {
|
|
666
|
+
var t, f, n = "";
|
|
667
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
668
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
669
|
+
var o = e.length;
|
|
670
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
671
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
672
|
+
return n;
|
|
673
|
+
}
|
|
674
|
+
function clsx() {
|
|
675
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
676
|
+
return n;
|
|
677
|
+
}
|
|
678
|
+
function getColSpan(column, lastFrozenColumnIndex, args) {
|
|
679
|
+
const colSpan = typeof column.colSpan == "function" ? column.colSpan(args) : 1;
|
|
680
|
+
if (Number.isInteger(colSpan) && colSpan > 1 && (!column.frozen || column.idx + colSpan - 1 <= lastFrozenColumnIndex))
|
|
681
|
+
return colSpan;
|
|
682
|
+
}
|
|
683
|
+
function stopPropagation(event) {
|
|
684
|
+
event.stopPropagation();
|
|
685
|
+
}
|
|
686
|
+
function scrollIntoView(element) {
|
|
687
|
+
element == null || element.scrollIntoView({
|
|
688
|
+
inline: "nearest",
|
|
689
|
+
block: "nearest"
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
function createCellEvent(event) {
|
|
693
|
+
let defaultPrevented = !1;
|
|
694
|
+
const cellEvent = {
|
|
695
|
+
...event,
|
|
696
|
+
preventGridDefault() {
|
|
697
|
+
defaultPrevented = !0;
|
|
698
|
+
},
|
|
699
|
+
isGridDefaultPrevented() {
|
|
700
|
+
return defaultPrevented;
|
|
65
701
|
}
|
|
702
|
+
};
|
|
703
|
+
return Object.setPrototypeOf(cellEvent, Object.getPrototypeOf(event)), cellEvent;
|
|
704
|
+
}
|
|
705
|
+
const nonInputKeys = /* @__PURE__ */ new Set(["Unidentified", "Alt", "AltGraph", "CapsLock", "Control", "Fn", "FnLock", "Meta", "NumLock", "ScrollLock", "Shift", "Tab", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "End", "Home", "PageDown", "PageUp", "Insert", "ContextMenu", "Escape", "Pause", "Play", "PrintScreen", "F1", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12"]);
|
|
706
|
+
function isCtrlKeyHeldDown(e) {
|
|
707
|
+
return (e.ctrlKey || e.metaKey) && e.key !== "Control";
|
|
708
|
+
}
|
|
709
|
+
function isDefaultCellInput(event) {
|
|
710
|
+
return isCtrlKeyHeldDown(event) && event.keyCode !== 86 ? !1 : !nonInputKeys.has(event.key);
|
|
711
|
+
}
|
|
712
|
+
function onEditorNavigation({
|
|
713
|
+
key,
|
|
714
|
+
target
|
|
715
|
+
}) {
|
|
716
|
+
var _a;
|
|
717
|
+
return key === "Tab" && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) ? ((_a = target.closest(".rdg-editor-container")) == null ? void 0 : _a.querySelectorAll("input, textarea, select").length) === 1 : !1;
|
|
718
|
+
}
|
|
719
|
+
const measuringCellClassname = "mlln6zg7-0-0-beta-47";
|
|
720
|
+
function renderMeasuringCells(viewportColumns) {
|
|
721
|
+
return viewportColumns.map(({
|
|
722
|
+
key,
|
|
723
|
+
idx,
|
|
724
|
+
minWidth,
|
|
725
|
+
maxWidth
|
|
726
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
727
|
+
className: measuringCellClassname,
|
|
728
|
+
style: {
|
|
729
|
+
gridColumnStart: idx + 1,
|
|
730
|
+
minWidth,
|
|
731
|
+
maxWidth
|
|
732
|
+
},
|
|
733
|
+
"data-measuring-cell-key": key
|
|
734
|
+
}, key));
|
|
735
|
+
}
|
|
736
|
+
function isSelectedCellEditable({
|
|
737
|
+
selectedPosition,
|
|
738
|
+
columns,
|
|
739
|
+
rows
|
|
740
|
+
}) {
|
|
741
|
+
const column = columns[selectedPosition.idx], row2 = rows[selectedPosition.rowIdx];
|
|
742
|
+
return isCellEditableUtil(column, row2);
|
|
743
|
+
}
|
|
744
|
+
function isCellEditableUtil(column, row2) {
|
|
745
|
+
return column.renderEditCell != null && (typeof column.editable == "function" ? column.editable(row2) : column.editable) !== !1;
|
|
746
|
+
}
|
|
747
|
+
function getSelectedCellColSpan({
|
|
748
|
+
rows,
|
|
749
|
+
topSummaryRows,
|
|
750
|
+
bottomSummaryRows,
|
|
751
|
+
rowIdx,
|
|
752
|
+
mainHeaderRowIdx,
|
|
753
|
+
lastFrozenColumnIndex,
|
|
754
|
+
column
|
|
755
|
+
}) {
|
|
756
|
+
const topSummaryRowsCount = (topSummaryRows == null ? void 0 : topSummaryRows.length) ?? 0;
|
|
757
|
+
if (rowIdx === mainHeaderRowIdx)
|
|
758
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
759
|
+
type: "HEADER"
|
|
760
|
+
});
|
|
761
|
+
if (topSummaryRows && rowIdx > mainHeaderRowIdx && rowIdx <= topSummaryRowsCount + mainHeaderRowIdx)
|
|
762
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
763
|
+
type: "SUMMARY",
|
|
764
|
+
row: topSummaryRows[rowIdx + topSummaryRowsCount]
|
|
765
|
+
});
|
|
766
|
+
if (rowIdx >= 0 && rowIdx < rows.length) {
|
|
767
|
+
const row2 = rows[rowIdx];
|
|
768
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
769
|
+
type: "ROW",
|
|
770
|
+
row: row2
|
|
771
|
+
});
|
|
66
772
|
}
|
|
773
|
+
if (bottomSummaryRows)
|
|
774
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
775
|
+
type: "SUMMARY",
|
|
776
|
+
row: bottomSummaryRows[rowIdx - rows.length]
|
|
777
|
+
});
|
|
67
778
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
779
|
+
function getNextSelectedCellPosition({
|
|
780
|
+
moveUp,
|
|
781
|
+
moveNext,
|
|
782
|
+
cellNavigationMode,
|
|
783
|
+
columns,
|
|
784
|
+
colSpanColumns,
|
|
785
|
+
rows,
|
|
786
|
+
topSummaryRows,
|
|
787
|
+
bottomSummaryRows,
|
|
788
|
+
minRowIdx,
|
|
789
|
+
mainHeaderRowIdx,
|
|
790
|
+
maxRowIdx,
|
|
791
|
+
currentPosition: {
|
|
792
|
+
idx: currentIdx,
|
|
793
|
+
rowIdx: currentRowIdx
|
|
794
|
+
},
|
|
795
|
+
nextPosition,
|
|
796
|
+
lastFrozenColumnIndex,
|
|
797
|
+
isCellWithinBounds
|
|
798
|
+
}) {
|
|
799
|
+
let {
|
|
800
|
+
idx: nextIdx,
|
|
801
|
+
rowIdx: nextRowIdx
|
|
802
|
+
} = nextPosition;
|
|
803
|
+
const columnsCount = columns.length, setColSpan = (moveNext2) => {
|
|
804
|
+
for (const column of colSpanColumns) {
|
|
805
|
+
const colIdx = column.idx;
|
|
806
|
+
if (colIdx > nextIdx) break;
|
|
807
|
+
const colSpan = getSelectedCellColSpan({
|
|
808
|
+
rows,
|
|
809
|
+
topSummaryRows,
|
|
810
|
+
bottomSummaryRows,
|
|
811
|
+
rowIdx: nextRowIdx,
|
|
812
|
+
mainHeaderRowIdx,
|
|
813
|
+
lastFrozenColumnIndex,
|
|
814
|
+
column
|
|
815
|
+
});
|
|
816
|
+
if (colSpan && nextIdx > colIdx && nextIdx < colSpan + colIdx) {
|
|
817
|
+
nextIdx = colIdx + (moveNext2 ? colSpan : 0);
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
80
820
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
821
|
+
}, getParentRowIdx = (parent) => parent.level + mainHeaderRowIdx, setHeaderGroupColAndRowSpan = () => {
|
|
822
|
+
if (moveNext) {
|
|
823
|
+
let parent = columns[nextIdx].parent;
|
|
824
|
+
for (; parent !== void 0; ) {
|
|
825
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
826
|
+
if (nextRowIdx === parentRowIdx) {
|
|
827
|
+
nextIdx = parent.idx + parent.colSpan;
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
parent = parent.parent;
|
|
831
|
+
}
|
|
832
|
+
} else if (moveUp) {
|
|
833
|
+
let parent = columns[nextIdx].parent, found = !1;
|
|
834
|
+
for (; parent !== void 0; ) {
|
|
835
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
836
|
+
if (nextRowIdx >= parentRowIdx) {
|
|
837
|
+
nextIdx = parent.idx, nextRowIdx = parentRowIdx, found = !0;
|
|
838
|
+
break;
|
|
839
|
+
}
|
|
840
|
+
parent = parent.parent;
|
|
841
|
+
}
|
|
842
|
+
found || (nextIdx = currentIdx, nextRowIdx = currentRowIdx);
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
if (isCellWithinBounds(nextPosition) && (setColSpan(moveNext), nextRowIdx < mainHeaderRowIdx && setHeaderGroupColAndRowSpan()), cellNavigationMode === "CHANGE_ROW" && (nextIdx === columnsCount ? nextRowIdx === maxRowIdx || (nextIdx = 0, nextRowIdx += 1) : nextIdx === -1 && (nextRowIdx === minRowIdx || (nextRowIdx -= 1, nextIdx = columnsCount - 1), setColSpan(!1))), nextRowIdx < mainHeaderRowIdx) {
|
|
846
|
+
let parent = columns[nextIdx].parent;
|
|
847
|
+
const nextParentRowIdx = nextRowIdx;
|
|
848
|
+
for (nextRowIdx = mainHeaderRowIdx; parent !== void 0; ) {
|
|
849
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
850
|
+
parentRowIdx >= nextParentRowIdx && (nextRowIdx = parentRowIdx, nextIdx = parent.idx), parent = parent.parent;
|
|
84
851
|
}
|
|
85
852
|
}
|
|
853
|
+
return {
|
|
854
|
+
idx: nextIdx,
|
|
855
|
+
rowIdx: nextRowIdx
|
|
856
|
+
};
|
|
86
857
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
858
|
+
function canExitGrid({
|
|
859
|
+
maxColIdx,
|
|
860
|
+
minRowIdx,
|
|
861
|
+
maxRowIdx,
|
|
862
|
+
selectedPosition: {
|
|
863
|
+
rowIdx,
|
|
864
|
+
idx
|
|
865
|
+
},
|
|
866
|
+
shiftKey
|
|
867
|
+
}) {
|
|
868
|
+
return shiftKey ? idx === 0 && rowIdx === minRowIdx : idx === maxColIdx && rowIdx === maxRowIdx;
|
|
869
|
+
}
|
|
870
|
+
const cell = "cj343x07-0-0-beta-47", cellClassname = `rdg-cell ${cell}`, cellFrozen = "csofj7r7-0-0-beta-47", cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
871
|
+
function getRowStyle(rowIdx) {
|
|
872
|
+
return {
|
|
873
|
+
"--rdg-grid-row-start": rowIdx
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
function getHeaderCellStyle(column, rowIdx, rowSpan) {
|
|
877
|
+
const gridRowEnd = rowIdx + 1, paddingBlockStart = `calc(${rowSpan - 1} * var(--rdg-header-row-height))`;
|
|
878
|
+
return column.parent === void 0 ? {
|
|
879
|
+
insetBlockStart: 0,
|
|
880
|
+
gridRowStart: 1,
|
|
881
|
+
gridRowEnd,
|
|
882
|
+
paddingBlockStart
|
|
883
|
+
} : {
|
|
884
|
+
insetBlockStart: `calc(${rowIdx - rowSpan} * var(--rdg-header-row-height))`,
|
|
885
|
+
gridRowStart: gridRowEnd - rowSpan,
|
|
886
|
+
gridRowEnd,
|
|
887
|
+
paddingBlockStart
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function getCellStyle(column, colSpan = 1) {
|
|
891
|
+
const index = column.idx + 1;
|
|
892
|
+
return {
|
|
893
|
+
gridColumnStart: index,
|
|
894
|
+
gridColumnEnd: index + colSpan,
|
|
895
|
+
insetInlineStart: column.frozen ? `var(--rdg-frozen-left-${column.idx})` : void 0
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function getCellClassname(column, ...extraClasses) {
|
|
899
|
+
return clsx(cellClassname, ...extraClasses, column.frozen && cellFrozenClassname);
|
|
900
|
+
}
|
|
901
|
+
const {
|
|
902
|
+
min,
|
|
903
|
+
max,
|
|
904
|
+
floor,
|
|
905
|
+
sign,
|
|
906
|
+
abs
|
|
907
|
+
} = Math;
|
|
908
|
+
function assertIsValidKeyGetter(keyGetter) {
|
|
909
|
+
if (typeof keyGetter != "function")
|
|
910
|
+
throw new Error("Please specify the rowKeyGetter prop to use selection");
|
|
911
|
+
}
|
|
912
|
+
function clampColumnWidth(width, {
|
|
913
|
+
minWidth,
|
|
914
|
+
maxWidth
|
|
915
|
+
}) {
|
|
916
|
+
return width = max(width, minWidth), typeof maxWidth == "number" && maxWidth >= minWidth ? min(width, maxWidth) : width;
|
|
917
|
+
}
|
|
918
|
+
function getHeaderCellRowSpan(column, rowIdx) {
|
|
919
|
+
return column.parent === void 0 ? rowIdx : column.level - column.parent.level;
|
|
920
|
+
}
|
|
921
|
+
const checkbox = "c1bn88vv7-0-0-beta-47", checkboxClassname = `rdg-checkbox-input ${checkbox}`;
|
|
922
|
+
function renderCheckbox({
|
|
923
|
+
onChange,
|
|
924
|
+
indeterminate,
|
|
925
|
+
...props
|
|
926
|
+
}) {
|
|
927
|
+
function handleChange(e) {
|
|
928
|
+
onChange(e.target.checked, e.nativeEvent.shiftKey);
|
|
92
929
|
}
|
|
930
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("input", {
|
|
931
|
+
ref: (el) => {
|
|
932
|
+
el && (el.indeterminate = indeterminate === !0);
|
|
933
|
+
},
|
|
934
|
+
type: "checkbox",
|
|
935
|
+
className: checkboxClassname,
|
|
936
|
+
onChange: handleChange,
|
|
937
|
+
...props
|
|
938
|
+
});
|
|
93
939
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
stroke-width: 1.5px;
|
|
100
|
-
fill: transparent;
|
|
101
|
-
vertical-align: middle;
|
|
102
|
-
|
|
103
|
-
> path {
|
|
104
|
-
transition: d 0.1s;
|
|
105
|
-
}
|
|
940
|
+
function renderValue(props) {
|
|
941
|
+
try {
|
|
942
|
+
return props.row[props.column.key];
|
|
943
|
+
} catch {
|
|
944
|
+
return null;
|
|
106
945
|
}
|
|
107
946
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
947
|
+
const DataGridDefaultRenderersContext = /* @__PURE__ */ createContext(void 0), DataGridDefaultRenderersProvider = DataGridDefaultRenderersContext.Provider;
|
|
948
|
+
function useDefaultRenderers() {
|
|
949
|
+
return useContext(DataGridDefaultRenderersContext);
|
|
950
|
+
}
|
|
951
|
+
function SelectCellFormatter({
|
|
952
|
+
value,
|
|
953
|
+
tabIndex,
|
|
954
|
+
indeterminate,
|
|
955
|
+
disabled,
|
|
956
|
+
onChange,
|
|
957
|
+
"aria-label": ariaLabel,
|
|
958
|
+
"aria-labelledby": ariaLabelledBy
|
|
959
|
+
}) {
|
|
960
|
+
const renderCheckbox2 = useDefaultRenderers().renderCheckbox;
|
|
961
|
+
return renderCheckbox2({
|
|
962
|
+
"aria-label": ariaLabel,
|
|
963
|
+
"aria-labelledby": ariaLabelledBy,
|
|
964
|
+
tabIndex,
|
|
965
|
+
indeterminate,
|
|
966
|
+
disabled,
|
|
967
|
+
checked: value,
|
|
968
|
+
onChange
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
const RowSelectionContext = /* @__PURE__ */ createContext(void 0), RowSelectionProvider = RowSelectionContext.Provider, RowSelectionChangeContext = /* @__PURE__ */ createContext(void 0), RowSelectionChangeProvider = RowSelectionChangeContext.Provider;
|
|
972
|
+
function useRowSelection() {
|
|
973
|
+
const rowSelectionContext = useContext(RowSelectionContext), rowSelectionChangeContext = useContext(RowSelectionChangeContext);
|
|
974
|
+
if (rowSelectionContext === void 0 || rowSelectionChangeContext === void 0)
|
|
975
|
+
throw new Error("useRowSelection must be used within DataGrid cells");
|
|
976
|
+
return {
|
|
977
|
+
isRowSelectionDisabled: rowSelectionContext.isRowSelectionDisabled,
|
|
978
|
+
isRowSelected: rowSelectionContext.isRowSelected,
|
|
979
|
+
onRowSelectionChange: rowSelectionChangeContext
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
const HeaderRowSelectionContext = /* @__PURE__ */ createContext(void 0), HeaderRowSelectionProvider = HeaderRowSelectionContext.Provider, HeaderRowSelectionChangeContext = /* @__PURE__ */ createContext(void 0), HeaderRowSelectionChangeProvider = HeaderRowSelectionChangeContext.Provider;
|
|
983
|
+
function useHeaderRowSelection() {
|
|
984
|
+
const headerRowSelectionContext = useContext(HeaderRowSelectionContext), headerRowSelectionChangeContext = useContext(HeaderRowSelectionChangeContext);
|
|
985
|
+
if (headerRowSelectionContext === void 0 || headerRowSelectionChangeContext === void 0)
|
|
986
|
+
throw new Error("useHeaderRowSelection must be used within DataGrid cells");
|
|
987
|
+
return {
|
|
988
|
+
isIndeterminate: headerRowSelectionContext.isIndeterminate,
|
|
989
|
+
isRowSelected: headerRowSelectionContext.isRowSelected,
|
|
990
|
+
onRowSelectionChange: headerRowSelectionChangeContext
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
const SELECT_COLUMN_KEY = "rdg-select-column";
|
|
994
|
+
function HeaderRenderer(props) {
|
|
995
|
+
const {
|
|
996
|
+
isIndeterminate,
|
|
997
|
+
isRowSelected,
|
|
998
|
+
onRowSelectionChange
|
|
999
|
+
} = useHeaderRowSelection();
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectCellFormatter, {
|
|
1001
|
+
"aria-label": "Select All",
|
|
1002
|
+
tabIndex: props.tabIndex,
|
|
1003
|
+
indeterminate: isIndeterminate,
|
|
1004
|
+
value: isRowSelected,
|
|
1005
|
+
onChange: (checked) => {
|
|
1006
|
+
onRowSelectionChange({
|
|
1007
|
+
checked: isIndeterminate ? !1 : checked
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
function SelectFormatter(props) {
|
|
1013
|
+
const {
|
|
1014
|
+
isRowSelectionDisabled,
|
|
1015
|
+
isRowSelected,
|
|
1016
|
+
onRowSelectionChange
|
|
1017
|
+
} = useRowSelection();
|
|
1018
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectCellFormatter, {
|
|
1019
|
+
"aria-label": "Select",
|
|
1020
|
+
tabIndex: props.tabIndex,
|
|
1021
|
+
disabled: isRowSelectionDisabled,
|
|
1022
|
+
value: isRowSelected,
|
|
1023
|
+
onChange: (checked, isShiftClick) => {
|
|
1024
|
+
onRowSelectionChange({
|
|
1025
|
+
row: props.row,
|
|
1026
|
+
checked,
|
|
1027
|
+
isShiftClick
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
function SelectGroupFormatter(props) {
|
|
1033
|
+
const {
|
|
1034
|
+
isRowSelected,
|
|
1035
|
+
onRowSelectionChange
|
|
1036
|
+
} = useRowSelection();
|
|
1037
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectCellFormatter, {
|
|
1038
|
+
"aria-label": "Select Group",
|
|
1039
|
+
tabIndex: props.tabIndex,
|
|
1040
|
+
value: isRowSelected,
|
|
1041
|
+
onChange: (checked) => {
|
|
1042
|
+
onRowSelectionChange({
|
|
1043
|
+
row: props.row,
|
|
1044
|
+
checked,
|
|
1045
|
+
isShiftClick: !1
|
|
1046
|
+
});
|
|
124
1047
|
}
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
1050
|
+
const SelectColumn = {
|
|
1051
|
+
key: SELECT_COLUMN_KEY,
|
|
1052
|
+
name: "",
|
|
1053
|
+
width: 35,
|
|
1054
|
+
minWidth: 35,
|
|
1055
|
+
maxWidth: 35,
|
|
1056
|
+
resizable: !1,
|
|
1057
|
+
sortable: !1,
|
|
1058
|
+
frozen: !0,
|
|
1059
|
+
renderHeaderCell(props) {
|
|
1060
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderRenderer, {
|
|
1061
|
+
...props
|
|
1062
|
+
});
|
|
1063
|
+
},
|
|
1064
|
+
renderCell(props) {
|
|
1065
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectFormatter, {
|
|
1066
|
+
...props
|
|
1067
|
+
});
|
|
1068
|
+
},
|
|
1069
|
+
renderGroupCell(props) {
|
|
1070
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectGroupFormatter, {
|
|
1071
|
+
...props
|
|
1072
|
+
});
|
|
125
1073
|
}
|
|
1074
|
+
}, DEFAULT_COLUMN_WIDTH = "auto", DEFAULT_COLUMN_MIN_WIDTH = 50;
|
|
1075
|
+
function useCalculatedColumns({
|
|
1076
|
+
rawColumns,
|
|
1077
|
+
defaultColumnOptions,
|
|
1078
|
+
getColumnWidth,
|
|
1079
|
+
viewportWidth,
|
|
1080
|
+
scrollLeft,
|
|
1081
|
+
enableVirtualization
|
|
1082
|
+
}) {
|
|
1083
|
+
const defaultWidth = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.width) ?? DEFAULT_COLUMN_WIDTH, defaultMinWidth = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.minWidth) ?? DEFAULT_COLUMN_MIN_WIDTH, defaultMaxWidth = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.maxWidth) ?? void 0, defaultCellRenderer = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.renderCell) ?? renderValue, defaultSortable = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.sortable) ?? !1, defaultResizable = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.resizable) ?? !1, defaultDraggable = (defaultColumnOptions == null ? void 0 : defaultColumnOptions.draggable) ?? !1, {
|
|
1084
|
+
columns,
|
|
1085
|
+
colSpanColumns,
|
|
1086
|
+
lastFrozenColumnIndex,
|
|
1087
|
+
headerRowsCount
|
|
1088
|
+
} = useMemo(() => {
|
|
1089
|
+
let lastFrozenColumnIndex2 = -1, headerRowsCount2 = 1;
|
|
1090
|
+
const columns2 = [];
|
|
1091
|
+
collectColumns(rawColumns, 1);
|
|
1092
|
+
function collectColumns(rawColumns2, level, parent) {
|
|
1093
|
+
for (const rawColumn of rawColumns2) {
|
|
1094
|
+
if ("children" in rawColumn) {
|
|
1095
|
+
const calculatedColumnParent = {
|
|
1096
|
+
name: rawColumn.name,
|
|
1097
|
+
parent,
|
|
1098
|
+
idx: -1,
|
|
1099
|
+
colSpan: 0,
|
|
1100
|
+
level: 0,
|
|
1101
|
+
headerCellClass: rawColumn.headerCellClass
|
|
1102
|
+
};
|
|
1103
|
+
collectColumns(rawColumn.children, level + 1, calculatedColumnParent);
|
|
1104
|
+
continue;
|
|
1105
|
+
}
|
|
1106
|
+
const frozen = rawColumn.frozen ?? !1, column = {
|
|
1107
|
+
...rawColumn,
|
|
1108
|
+
parent,
|
|
1109
|
+
idx: 0,
|
|
1110
|
+
level: 0,
|
|
1111
|
+
frozen,
|
|
1112
|
+
width: rawColumn.width ?? defaultWidth,
|
|
1113
|
+
minWidth: rawColumn.minWidth ?? defaultMinWidth,
|
|
1114
|
+
maxWidth: rawColumn.maxWidth ?? defaultMaxWidth,
|
|
1115
|
+
sortable: rawColumn.sortable ?? defaultSortable,
|
|
1116
|
+
resizable: rawColumn.resizable ?? defaultResizable,
|
|
1117
|
+
draggable: rawColumn.draggable ?? defaultDraggable,
|
|
1118
|
+
renderCell: rawColumn.renderCell ?? defaultCellRenderer
|
|
1119
|
+
};
|
|
1120
|
+
columns2.push(column), frozen && lastFrozenColumnIndex2++, level > headerRowsCount2 && (headerRowsCount2 = level);
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
columns2.sort(({
|
|
1124
|
+
key: aKey,
|
|
1125
|
+
frozen: frozenA
|
|
1126
|
+
}, {
|
|
1127
|
+
key: bKey,
|
|
1128
|
+
frozen: frozenB
|
|
1129
|
+
}) => aKey === SELECT_COLUMN_KEY ? -1 : bKey === SELECT_COLUMN_KEY ? 1 : frozenA ? frozenB ? 0 : -1 : frozenB ? 1 : 0);
|
|
1130
|
+
const colSpanColumns2 = [];
|
|
1131
|
+
return columns2.forEach((column, idx) => {
|
|
1132
|
+
column.idx = idx, updateColumnParent(column, idx, 0), column.colSpan != null && colSpanColumns2.push(column);
|
|
1133
|
+
}), {
|
|
1134
|
+
columns: columns2,
|
|
1135
|
+
colSpanColumns: colSpanColumns2,
|
|
1136
|
+
lastFrozenColumnIndex: lastFrozenColumnIndex2,
|
|
1137
|
+
headerRowsCount: headerRowsCount2
|
|
1138
|
+
};
|
|
1139
|
+
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultCellRenderer, defaultResizable, defaultSortable, defaultDraggable]), {
|
|
1140
|
+
templateColumns,
|
|
1141
|
+
layoutCssVars,
|
|
1142
|
+
totalFrozenColumnWidth,
|
|
1143
|
+
columnMetrics
|
|
1144
|
+
} = useMemo(() => {
|
|
1145
|
+
const columnMetrics2 = /* @__PURE__ */ new Map();
|
|
1146
|
+
let left = 0, totalFrozenColumnWidth2 = 0;
|
|
1147
|
+
const templateColumns2 = [];
|
|
1148
|
+
for (const column of columns) {
|
|
1149
|
+
let width = getColumnWidth(column);
|
|
1150
|
+
typeof width == "number" ? width = clampColumnWidth(width, column) : width = column.minWidth, templateColumns2.push(`${width}px`), columnMetrics2.set(column, {
|
|
1151
|
+
width,
|
|
1152
|
+
left
|
|
1153
|
+
}), left += width;
|
|
1154
|
+
}
|
|
1155
|
+
if (lastFrozenColumnIndex !== -1) {
|
|
1156
|
+
const columnMetric = columnMetrics2.get(columns[lastFrozenColumnIndex]);
|
|
1157
|
+
totalFrozenColumnWidth2 = columnMetric.left + columnMetric.width;
|
|
1158
|
+
}
|
|
1159
|
+
const layoutCssVars2 = {};
|
|
1160
|
+
for (let i = 0; i <= lastFrozenColumnIndex; i++) {
|
|
1161
|
+
const column = columns[i];
|
|
1162
|
+
layoutCssVars2[`--rdg-frozen-left-${column.idx}`] = `${columnMetrics2.get(column).left}px`;
|
|
1163
|
+
}
|
|
1164
|
+
return {
|
|
1165
|
+
templateColumns: templateColumns2,
|
|
1166
|
+
layoutCssVars: layoutCssVars2,
|
|
1167
|
+
totalFrozenColumnWidth: totalFrozenColumnWidth2,
|
|
1168
|
+
columnMetrics: columnMetrics2
|
|
1169
|
+
};
|
|
1170
|
+
}, [getColumnWidth, columns, lastFrozenColumnIndex]), [colOverscanStartIdx, colOverscanEndIdx] = useMemo(() => {
|
|
1171
|
+
if (!enableVirtualization)
|
|
1172
|
+
return [0, columns.length - 1];
|
|
1173
|
+
const viewportLeft = scrollLeft + totalFrozenColumnWidth, viewportRight = scrollLeft + viewportWidth, lastColIdx = columns.length - 1, firstUnfrozenColumnIdx = min(lastFrozenColumnIndex + 1, lastColIdx);
|
|
1174
|
+
if (viewportLeft >= viewportRight)
|
|
1175
|
+
return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx];
|
|
1176
|
+
let colVisibleStartIdx = firstUnfrozenColumnIdx;
|
|
1177
|
+
for (; colVisibleStartIdx < lastColIdx; ) {
|
|
1178
|
+
const {
|
|
1179
|
+
left,
|
|
1180
|
+
width
|
|
1181
|
+
} = columnMetrics.get(columns[colVisibleStartIdx]);
|
|
1182
|
+
if (left + width > viewportLeft)
|
|
1183
|
+
break;
|
|
1184
|
+
colVisibleStartIdx++;
|
|
1185
|
+
}
|
|
1186
|
+
let colVisibleEndIdx = colVisibleStartIdx;
|
|
1187
|
+
for (; colVisibleEndIdx < lastColIdx; ) {
|
|
1188
|
+
const {
|
|
1189
|
+
left,
|
|
1190
|
+
width
|
|
1191
|
+
} = columnMetrics.get(columns[colVisibleEndIdx]);
|
|
1192
|
+
if (left + width >= viewportRight)
|
|
1193
|
+
break;
|
|
1194
|
+
colVisibleEndIdx++;
|
|
1195
|
+
}
|
|
1196
|
+
const colOverscanStartIdx2 = max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1), colOverscanEndIdx2 = min(lastColIdx, colVisibleEndIdx + 1);
|
|
1197
|
+
return [colOverscanStartIdx2, colOverscanEndIdx2];
|
|
1198
|
+
}, [columnMetrics, columns, lastFrozenColumnIndex, scrollLeft, totalFrozenColumnWidth, viewportWidth, enableVirtualization]);
|
|
1199
|
+
return {
|
|
1200
|
+
columns,
|
|
1201
|
+
colSpanColumns,
|
|
1202
|
+
colOverscanStartIdx,
|
|
1203
|
+
colOverscanEndIdx,
|
|
1204
|
+
templateColumns,
|
|
1205
|
+
layoutCssVars,
|
|
1206
|
+
headerRowsCount,
|
|
1207
|
+
lastFrozenColumnIndex,
|
|
1208
|
+
totalFrozenColumnWidth
|
|
1209
|
+
};
|
|
126
1210
|
}
|
|
127
|
-
|
|
128
|
-
.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
1211
|
+
function updateColumnParent(column, index, level) {
|
|
1212
|
+
if (level < column.level && (column.level = level), column.parent !== void 0) {
|
|
1213
|
+
const {
|
|
1214
|
+
parent
|
|
1215
|
+
} = column;
|
|
1216
|
+
parent.idx === -1 && (parent.idx = index), parent.colSpan += 1, updateColumnParent(parent, index, level - 1);
|
|
132
1217
|
}
|
|
133
1218
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.
|
|
137
|
-
|
|
138
|
-
|
|
1219
|
+
const useLayoutEffect = typeof window > "u" ? useEffect : useLayoutEffect$1;
|
|
1220
|
+
function useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize) {
|
|
1221
|
+
const prevGridWidthRef = useRef(gridWidth), columnsCanFlex = columns.length === viewportColumns.length, ignorePreviouslyMeasuredColumns = columnsCanFlex && gridWidth !== prevGridWidthRef.current, newTemplateColumns = [...templateColumns], columnsToMeasure = [];
|
|
1222
|
+
for (const {
|
|
1223
|
+
key,
|
|
1224
|
+
idx,
|
|
1225
|
+
width
|
|
1226
|
+
} of viewportColumns)
|
|
1227
|
+
typeof width == "string" && (ignorePreviouslyMeasuredColumns || !measuredColumnWidths.has(key)) && !resizedColumnWidths.has(key) && (newTemplateColumns[idx] = width, columnsToMeasure.push(key));
|
|
1228
|
+
const gridTemplateColumns = newTemplateColumns.join(" ");
|
|
1229
|
+
useLayoutEffect(() => {
|
|
1230
|
+
prevGridWidthRef.current = gridWidth, updateMeasuredWidths(columnsToMeasure);
|
|
1231
|
+
});
|
|
1232
|
+
function updateMeasuredWidths(columnsToMeasure2) {
|
|
1233
|
+
columnsToMeasure2.length !== 0 && setMeasuredColumnWidths((measuredColumnWidths2) => {
|
|
1234
|
+
const newMeasuredColumnWidths = new Map(measuredColumnWidths2);
|
|
1235
|
+
let hasChanges = !1;
|
|
1236
|
+
for (const key of columnsToMeasure2) {
|
|
1237
|
+
const measuredWidth = measureColumnWidth(gridRef, key);
|
|
1238
|
+
hasChanges || (hasChanges = measuredWidth !== measuredColumnWidths2.get(key)), measuredWidth === void 0 ? newMeasuredColumnWidths.delete(key) : newMeasuredColumnWidths.set(key, measuredWidth);
|
|
1239
|
+
}
|
|
1240
|
+
return hasChanges ? newMeasuredColumnWidths : measuredColumnWidths2;
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
function handleColumnResize(column, nextWidth) {
|
|
1244
|
+
const {
|
|
1245
|
+
key: resizingKey
|
|
1246
|
+
} = column, newTemplateColumns2 = [...templateColumns], columnsToMeasure2 = [];
|
|
1247
|
+
for (const {
|
|
1248
|
+
key,
|
|
1249
|
+
idx,
|
|
1250
|
+
width
|
|
1251
|
+
} of viewportColumns)
|
|
1252
|
+
if (resizingKey === key) {
|
|
1253
|
+
const width2 = typeof nextWidth == "number" ? `${nextWidth}px` : nextWidth;
|
|
1254
|
+
newTemplateColumns2[idx] = width2;
|
|
1255
|
+
} else columnsCanFlex && typeof width == "string" && !resizedColumnWidths.has(key) && (newTemplateColumns2[idx] = width, columnsToMeasure2.push(key));
|
|
1256
|
+
gridRef.current.style.gridTemplateColumns = newTemplateColumns2.join(" ");
|
|
1257
|
+
const measuredWidth = typeof nextWidth == "number" ? nextWidth : measureColumnWidth(gridRef, resizingKey);
|
|
1258
|
+
flushSync(() => {
|
|
1259
|
+
setResizedColumnWidths((resizedColumnWidths2) => {
|
|
1260
|
+
const newResizedColumnWidths = new Map(resizedColumnWidths2);
|
|
1261
|
+
return newResizedColumnWidths.set(resizingKey, measuredWidth), newResizedColumnWidths;
|
|
1262
|
+
}), updateMeasuredWidths(columnsToMeasure2);
|
|
1263
|
+
}), onColumnResize == null || onColumnResize(column.idx, measuredWidth);
|
|
139
1264
|
}
|
|
1265
|
+
return {
|
|
1266
|
+
gridTemplateColumns,
|
|
1267
|
+
handleColumnResize
|
|
1268
|
+
};
|
|
140
1269
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1270
|
+
function measureColumnWidth(gridRef, key) {
|
|
1271
|
+
var _a;
|
|
1272
|
+
const selector = `[data-measuring-cell-key="${CSS.escape(key)}"]`, measuringCell = (_a = gridRef.current) == null ? void 0 : _a.querySelector(selector);
|
|
1273
|
+
return measuringCell == null ? void 0 : measuringCell.getBoundingClientRect().width;
|
|
1274
|
+
}
|
|
1275
|
+
function useGridDimensions() {
|
|
1276
|
+
const gridRef = useRef(null), [inlineSize, setInlineSize] = useState(1), [blockSize, setBlockSize] = useState(1), [horizontalScrollbarHeight, setHorizontalScrollbarHeight] = useState(0);
|
|
1277
|
+
return useLayoutEffect(() => {
|
|
1278
|
+
const {
|
|
1279
|
+
ResizeObserver
|
|
1280
|
+
} = window;
|
|
1281
|
+
if (ResizeObserver == null) return;
|
|
1282
|
+
const {
|
|
1283
|
+
clientWidth,
|
|
1284
|
+
clientHeight,
|
|
1285
|
+
offsetWidth,
|
|
1286
|
+
offsetHeight
|
|
1287
|
+
} = gridRef.current, {
|
|
1288
|
+
width,
|
|
1289
|
+
height
|
|
1290
|
+
} = gridRef.current.getBoundingClientRect(), initialHorizontalScrollbarHeight = offsetHeight - clientHeight, initialWidth = width - offsetWidth + clientWidth, initialHeight = height - initialHorizontalScrollbarHeight;
|
|
1291
|
+
setInlineSize(initialWidth), setBlockSize(initialHeight), setHorizontalScrollbarHeight(initialHorizontalScrollbarHeight);
|
|
1292
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
1293
|
+
const size = entries[0].contentBoxSize[0], {
|
|
1294
|
+
clientHeight: clientHeight2,
|
|
1295
|
+
offsetHeight: offsetHeight2
|
|
1296
|
+
} = gridRef.current;
|
|
1297
|
+
flushSync(() => {
|
|
1298
|
+
setInlineSize(size.inlineSize), setBlockSize(size.blockSize), setHorizontalScrollbarHeight(offsetHeight2 - clientHeight2);
|
|
1299
|
+
});
|
|
1300
|
+
});
|
|
1301
|
+
return resizeObserver.observe(gridRef.current), () => {
|
|
1302
|
+
resizeObserver.disconnect();
|
|
1303
|
+
};
|
|
1304
|
+
}, []), [gridRef, inlineSize, blockSize, horizontalScrollbarHeight];
|
|
1305
|
+
}
|
|
1306
|
+
function useLatestFunc(fn) {
|
|
1307
|
+
const ref = useRef(fn);
|
|
1308
|
+
useEffect(() => {
|
|
1309
|
+
ref.current = fn;
|
|
1310
|
+
});
|
|
1311
|
+
const callbackFn = useCallback((...args) => {
|
|
1312
|
+
ref.current(...args);
|
|
1313
|
+
}, []);
|
|
1314
|
+
return fn && callbackFn;
|
|
1315
|
+
}
|
|
1316
|
+
function useRovingTabIndex(isSelected) {
|
|
1317
|
+
const [isChildFocused, setIsChildFocused] = useState(!1);
|
|
1318
|
+
isChildFocused && !isSelected && setIsChildFocused(!1);
|
|
1319
|
+
function onFocus(event) {
|
|
1320
|
+
event.target !== event.currentTarget && setIsChildFocused(!0);
|
|
146
1321
|
}
|
|
1322
|
+
return {
|
|
1323
|
+
tabIndex: isSelected && !isChildFocused ? 0 : -1,
|
|
1324
|
+
childTabIndex: isSelected ? 0 : -1,
|
|
1325
|
+
onFocus: isSelected ? onFocus : void 0
|
|
1326
|
+
};
|
|
147
1327
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
1328
|
+
function useViewportColumns({
|
|
1329
|
+
columns,
|
|
1330
|
+
colSpanColumns,
|
|
1331
|
+
rows,
|
|
1332
|
+
topSummaryRows,
|
|
1333
|
+
bottomSummaryRows,
|
|
1334
|
+
colOverscanStartIdx,
|
|
1335
|
+
colOverscanEndIdx,
|
|
1336
|
+
lastFrozenColumnIndex,
|
|
1337
|
+
rowOverscanStartIdx,
|
|
1338
|
+
rowOverscanEndIdx
|
|
1339
|
+
}) {
|
|
1340
|
+
const startIdx = useMemo(() => {
|
|
1341
|
+
if (colOverscanStartIdx === 0) return 0;
|
|
1342
|
+
let startIdx2 = colOverscanStartIdx;
|
|
1343
|
+
const updateStartIdx = (colIdx, colSpan) => colSpan !== void 0 && colIdx + colSpan > colOverscanStartIdx ? (startIdx2 = colIdx, !0) : !1;
|
|
1344
|
+
for (const column of colSpanColumns) {
|
|
1345
|
+
const colIdx = column.idx;
|
|
1346
|
+
if (colIdx >= startIdx2 || updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
1347
|
+
type: "HEADER"
|
|
1348
|
+
})))
|
|
1349
|
+
break;
|
|
1350
|
+
for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {
|
|
1351
|
+
const row2 = rows[rowIdx];
|
|
1352
|
+
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
1353
|
+
type: "ROW",
|
|
1354
|
+
row: row2
|
|
1355
|
+
})))
|
|
1356
|
+
break;
|
|
1357
|
+
}
|
|
1358
|
+
if (topSummaryRows != null) {
|
|
1359
|
+
for (const row2 of topSummaryRows)
|
|
1360
|
+
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
1361
|
+
type: "SUMMARY",
|
|
1362
|
+
row: row2
|
|
1363
|
+
})))
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1366
|
+
if (bottomSummaryRows != null) {
|
|
1367
|
+
for (const row2 of bottomSummaryRows)
|
|
1368
|
+
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
1369
|
+
type: "SUMMARY",
|
|
1370
|
+
row: row2
|
|
1371
|
+
})))
|
|
1372
|
+
break;
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
return startIdx2;
|
|
1376
|
+
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns]);
|
|
1377
|
+
return useMemo(() => {
|
|
1378
|
+
const viewportColumns = [];
|
|
1379
|
+
for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {
|
|
1380
|
+
const column = columns[colIdx];
|
|
1381
|
+
colIdx < startIdx && !column.frozen || viewportColumns.push(column);
|
|
1382
|
+
}
|
|
1383
|
+
return viewportColumns;
|
|
1384
|
+
}, [startIdx, colOverscanEndIdx, columns]);
|
|
1385
|
+
}
|
|
1386
|
+
function useViewportRows({
|
|
1387
|
+
rows,
|
|
1388
|
+
rowHeight,
|
|
1389
|
+
clientHeight,
|
|
1390
|
+
scrollTop,
|
|
1391
|
+
enableVirtualization
|
|
1392
|
+
}) {
|
|
1393
|
+
const {
|
|
1394
|
+
totalRowHeight,
|
|
1395
|
+
gridTemplateRows,
|
|
1396
|
+
getRowTop,
|
|
1397
|
+
getRowHeight,
|
|
1398
|
+
findRowIdx
|
|
1399
|
+
} = useMemo(() => {
|
|
1400
|
+
if (typeof rowHeight == "number")
|
|
1401
|
+
return {
|
|
1402
|
+
totalRowHeight: rowHeight * rows.length,
|
|
1403
|
+
gridTemplateRows: ` repeat(${rows.length}, ${rowHeight}px)`,
|
|
1404
|
+
getRowTop: (rowIdx) => rowIdx * rowHeight,
|
|
1405
|
+
getRowHeight: () => rowHeight,
|
|
1406
|
+
findRowIdx: (offset) => floor(offset / rowHeight)
|
|
1407
|
+
};
|
|
1408
|
+
let totalRowHeight2 = 0, gridTemplateRows2 = " ";
|
|
1409
|
+
const rowPositions = rows.map((row2) => {
|
|
1410
|
+
const currentRowHeight = rowHeight(row2), position = {
|
|
1411
|
+
top: totalRowHeight2,
|
|
1412
|
+
height: currentRowHeight
|
|
1413
|
+
};
|
|
1414
|
+
return gridTemplateRows2 += `${currentRowHeight}px `, totalRowHeight2 += currentRowHeight, position;
|
|
1415
|
+
}), validateRowIdx = (rowIdx) => max(0, min(rows.length - 1, rowIdx));
|
|
1416
|
+
return {
|
|
1417
|
+
totalRowHeight: totalRowHeight2,
|
|
1418
|
+
gridTemplateRows: gridTemplateRows2,
|
|
1419
|
+
getRowTop: (rowIdx) => rowPositions[validateRowIdx(rowIdx)].top,
|
|
1420
|
+
getRowHeight: (rowIdx) => rowPositions[validateRowIdx(rowIdx)].height,
|
|
1421
|
+
findRowIdx(offset) {
|
|
1422
|
+
let start = 0, end = rowPositions.length - 1;
|
|
1423
|
+
for (; start <= end; ) {
|
|
1424
|
+
const middle = start + floor((end - start) / 2), currentOffset = rowPositions[middle].top;
|
|
1425
|
+
if (currentOffset === offset) return middle;
|
|
1426
|
+
if (currentOffset < offset ? start = middle + 1 : currentOffset > offset && (end = middle - 1), start > end) return end;
|
|
1427
|
+
}
|
|
1428
|
+
return 0;
|
|
1429
|
+
}
|
|
1430
|
+
};
|
|
1431
|
+
}, [rowHeight, rows]);
|
|
1432
|
+
let rowOverscanStartIdx = 0, rowOverscanEndIdx = rows.length - 1;
|
|
1433
|
+
if (enableVirtualization) {
|
|
1434
|
+
const rowVisibleStartIdx = findRowIdx(scrollTop), rowVisibleEndIdx = findRowIdx(scrollTop + clientHeight);
|
|
1435
|
+
rowOverscanStartIdx = max(0, rowVisibleStartIdx - 4), rowOverscanEndIdx = min(rows.length - 1, rowVisibleEndIdx + 4);
|
|
154
1436
|
}
|
|
1437
|
+
return {
|
|
1438
|
+
rowOverscanStartIdx,
|
|
1439
|
+
rowOverscanEndIdx,
|
|
1440
|
+
totalRowHeight,
|
|
1441
|
+
gridTemplateRows,
|
|
1442
|
+
getRowTop,
|
|
1443
|
+
getRowHeight,
|
|
1444
|
+
findRowIdx
|
|
1445
|
+
};
|
|
155
1446
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
1447
|
+
const cellDragHandle = "c1w9bbhr7-0-0-beta-47", cellDragHandleFrozenClassname = "c1creorc7-0-0-beta-47", cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1448
|
+
function DragHandle({
|
|
1449
|
+
gridRowStart,
|
|
1450
|
+
rows,
|
|
1451
|
+
column,
|
|
1452
|
+
columnWidth,
|
|
1453
|
+
maxColIdx,
|
|
1454
|
+
isLastRow,
|
|
1455
|
+
selectedPosition,
|
|
1456
|
+
latestDraggedOverRowIdx,
|
|
1457
|
+
isCellEditable,
|
|
1458
|
+
onRowsChange,
|
|
1459
|
+
onFill,
|
|
1460
|
+
onClick,
|
|
1461
|
+
setDragging,
|
|
1462
|
+
setDraggedOverRowIdx
|
|
1463
|
+
}) {
|
|
1464
|
+
const {
|
|
1465
|
+
idx,
|
|
1466
|
+
rowIdx
|
|
1467
|
+
} = selectedPosition;
|
|
1468
|
+
function handleMouseDown(event) {
|
|
1469
|
+
if (event.preventDefault(), event.buttons !== 1) return;
|
|
1470
|
+
setDragging(!0), window.addEventListener("mouseover", onMouseOver), window.addEventListener("mouseup", onMouseUp);
|
|
1471
|
+
function onMouseOver(event2) {
|
|
1472
|
+
event2.buttons !== 1 && onMouseUp();
|
|
1473
|
+
}
|
|
1474
|
+
function onMouseUp() {
|
|
1475
|
+
window.removeEventListener("mouseover", onMouseOver), window.removeEventListener("mouseup", onMouseUp), setDragging(!1), handleDragEnd();
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
function handleDragEnd() {
|
|
1479
|
+
const overRowIdx = latestDraggedOverRowIdx.current;
|
|
1480
|
+
if (overRowIdx === void 0) return;
|
|
1481
|
+
const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx, endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;
|
|
1482
|
+
updateRows(startRowIndex, endRowIndex), setDraggedOverRowIdx(void 0);
|
|
161
1483
|
}
|
|
1484
|
+
function handleDoubleClick(event) {
|
|
1485
|
+
event.stopPropagation(), updateRows(rowIdx + 1, rows.length);
|
|
1486
|
+
}
|
|
1487
|
+
function updateRows(startRowIdx, endRowIdx) {
|
|
1488
|
+
const sourceRow = rows[rowIdx], updatedRows = [...rows], indexes = [];
|
|
1489
|
+
for (let i = startRowIdx; i < endRowIdx; i++)
|
|
1490
|
+
if (isCellEditable({
|
|
1491
|
+
rowIdx: i,
|
|
1492
|
+
idx
|
|
1493
|
+
})) {
|
|
1494
|
+
const updatedRow = onFill({
|
|
1495
|
+
columnKey: column.key,
|
|
1496
|
+
sourceRow,
|
|
1497
|
+
targetRow: rows[i]
|
|
1498
|
+
});
|
|
1499
|
+
updatedRow !== rows[i] && (updatedRows[i] = updatedRow, indexes.push(i));
|
|
1500
|
+
}
|
|
1501
|
+
indexes.length > 0 && (onRowsChange == null || onRowsChange(updatedRows, {
|
|
1502
|
+
indexes,
|
|
1503
|
+
column
|
|
1504
|
+
}));
|
|
1505
|
+
}
|
|
1506
|
+
function getStyle() {
|
|
1507
|
+
var _a;
|
|
1508
|
+
const colSpan = ((_a = column.colSpan) == null ? void 0 : _a.call(column, {
|
|
1509
|
+
type: "ROW",
|
|
1510
|
+
row: rows[rowIdx]
|
|
1511
|
+
})) ?? 1, {
|
|
1512
|
+
insetInlineStart,
|
|
1513
|
+
...style
|
|
1514
|
+
} = getCellStyle(column, colSpan), marginEnd = "calc(var(--rdg-drag-handle-size) * -0.5 + 1px)", isLastColumn = column.idx + colSpan - 1 === maxColIdx;
|
|
1515
|
+
return {
|
|
1516
|
+
...style,
|
|
1517
|
+
gridRowStart,
|
|
1518
|
+
marginInlineEnd: isLastColumn ? void 0 : marginEnd,
|
|
1519
|
+
marginBlockEnd: isLastRow ? void 0 : marginEnd,
|
|
1520
|
+
insetInlineStart: insetInlineStart ? `calc(${insetInlineStart} + ${columnWidth}px + var(--rdg-drag-handle-size) * -0.5 - 1px)` : void 0
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1524
|
+
style: getStyle(),
|
|
1525
|
+
className: clsx(cellDragHandleClassname, column.frozen && cellDragHandleFrozenClassname),
|
|
1526
|
+
onClick,
|
|
1527
|
+
onMouseDown: handleMouseDown,
|
|
1528
|
+
onDoubleClick: handleDoubleClick
|
|
1529
|
+
});
|
|
162
1530
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
1531
|
+
const cellEditing = "cis5rrm7-0-0-beta-47";
|
|
1532
|
+
function EditCell({
|
|
1533
|
+
column,
|
|
1534
|
+
colSpan,
|
|
1535
|
+
row: row2,
|
|
1536
|
+
rowIdx,
|
|
1537
|
+
onRowChange,
|
|
1538
|
+
closeEditor,
|
|
1539
|
+
onKeyDown,
|
|
1540
|
+
navigate
|
|
1541
|
+
}) {
|
|
1542
|
+
var _a, _b, _c;
|
|
1543
|
+
const frameRequestRef = useRef(void 0), commitOnOutsideClick = ((_a = column.editorOptions) == null ? void 0 : _a.commitOnOutsideClick) !== !1, commitOnOutsideMouseDown = useLatestFunc(() => {
|
|
1544
|
+
onClose(!0, !1);
|
|
1545
|
+
});
|
|
1546
|
+
useEffect(() => {
|
|
1547
|
+
if (!commitOnOutsideClick) return;
|
|
1548
|
+
function onWindowCaptureMouseDown() {
|
|
1549
|
+
frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);
|
|
1550
|
+
}
|
|
1551
|
+
return addEventListener("mousedown", onWindowCaptureMouseDown, {
|
|
1552
|
+
capture: !0
|
|
1553
|
+
}), () => {
|
|
1554
|
+
removeEventListener("mousedown", onWindowCaptureMouseDown, {
|
|
1555
|
+
capture: !0
|
|
1556
|
+
}), cancelFrameRequest();
|
|
1557
|
+
};
|
|
1558
|
+
}, [commitOnOutsideClick, commitOnOutsideMouseDown]);
|
|
1559
|
+
function cancelFrameRequest() {
|
|
1560
|
+
cancelAnimationFrame(frameRequestRef.current);
|
|
1561
|
+
}
|
|
1562
|
+
function handleKeyDown(event) {
|
|
1563
|
+
if (onKeyDown) {
|
|
1564
|
+
const cellEvent = createCellEvent(event);
|
|
1565
|
+
if (onKeyDown({
|
|
1566
|
+
mode: "EDIT",
|
|
1567
|
+
row: row2,
|
|
1568
|
+
column,
|
|
1569
|
+
rowIdx,
|
|
1570
|
+
navigate() {
|
|
1571
|
+
navigate(event);
|
|
1572
|
+
},
|
|
1573
|
+
onClose
|
|
1574
|
+
}, cellEvent), cellEvent.isGridDefaultPrevented()) return;
|
|
1575
|
+
}
|
|
1576
|
+
event.key === "Escape" ? onClose() : event.key === "Enter" ? onClose(!0) : onEditorNavigation(event) && navigate(event);
|
|
1577
|
+
}
|
|
1578
|
+
function onClose(commitChanges = !1, shouldFocusCell = !0) {
|
|
1579
|
+
commitChanges ? onRowChange(row2, !0, shouldFocusCell) : closeEditor(shouldFocusCell);
|
|
1580
|
+
}
|
|
1581
|
+
function onEditorRowChange(row3, commitChangesAndFocus = !1) {
|
|
1582
|
+
onRowChange(row3, commitChangesAndFocus, commitChangesAndFocus);
|
|
167
1583
|
}
|
|
1584
|
+
const {
|
|
1585
|
+
cellClass
|
|
1586
|
+
} = column, className = getCellClassname(column, "rdg-editor-container", typeof cellClass == "function" ? cellClass(row2) : cellClass, !((_b = column.editorOptions) != null && _b.displayCellContent) && cellEditing);
|
|
1587
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1588
|
+
role: "gridcell",
|
|
1589
|
+
"aria-colindex": column.idx + 1,
|
|
1590
|
+
"aria-colspan": colSpan,
|
|
1591
|
+
"aria-selected": !0,
|
|
1592
|
+
className,
|
|
1593
|
+
style: getCellStyle(column, colSpan),
|
|
1594
|
+
onKeyDown: handleKeyDown,
|
|
1595
|
+
onMouseDownCapture: cancelFrameRequest,
|
|
1596
|
+
children: column.renderEditCell != null && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
1597
|
+
children: [column.renderEditCell({
|
|
1598
|
+
column,
|
|
1599
|
+
row: row2,
|
|
1600
|
+
rowIdx,
|
|
1601
|
+
onRowChange: onEditorRowChange,
|
|
1602
|
+
onClose
|
|
1603
|
+
}), ((_c = column.editorOptions) == null ? void 0 : _c.displayCellContent) && column.renderCell({
|
|
1604
|
+
column,
|
|
1605
|
+
row: row2,
|
|
1606
|
+
rowIdx,
|
|
1607
|
+
isCellEditable: !0,
|
|
1608
|
+
tabIndex: -1,
|
|
1609
|
+
onRowChange: onEditorRowChange
|
|
1610
|
+
})]
|
|
1611
|
+
})
|
|
1612
|
+
});
|
|
168
1613
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
1614
|
+
function GroupedColumnHeaderCell({
|
|
1615
|
+
column,
|
|
1616
|
+
rowIdx,
|
|
1617
|
+
isCellSelected,
|
|
1618
|
+
selectCell
|
|
1619
|
+
}) {
|
|
1620
|
+
const {
|
|
1621
|
+
tabIndex,
|
|
1622
|
+
onFocus
|
|
1623
|
+
} = useRovingTabIndex(isCellSelected), {
|
|
1624
|
+
colSpan
|
|
1625
|
+
} = column, rowSpan = getHeaderCellRowSpan(column, rowIdx), index = column.idx + 1;
|
|
1626
|
+
function onClick() {
|
|
1627
|
+
selectCell({
|
|
1628
|
+
idx: column.idx,
|
|
1629
|
+
rowIdx
|
|
1630
|
+
});
|
|
178
1631
|
}
|
|
1632
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1633
|
+
role: "columnheader",
|
|
1634
|
+
"aria-colindex": index,
|
|
1635
|
+
"aria-colspan": colSpan,
|
|
1636
|
+
"aria-rowspan": rowSpan,
|
|
1637
|
+
"aria-selected": isCellSelected,
|
|
1638
|
+
tabIndex,
|
|
1639
|
+
className: clsx(cellClassname, column.headerCellClass),
|
|
1640
|
+
style: {
|
|
1641
|
+
...getHeaderCellStyle(column, rowIdx, rowSpan),
|
|
1642
|
+
gridColumnStart: index,
|
|
1643
|
+
gridColumnEnd: index + colSpan
|
|
1644
|
+
},
|
|
1645
|
+
onFocus,
|
|
1646
|
+
onClick,
|
|
1647
|
+
children: column.name
|
|
1648
|
+
});
|
|
179
1649
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
1650
|
+
const headerSortCellClassname = "h44jtk67-0-0-beta-47", headerSortName = "hcgkhxz7-0-0-beta-47", headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1651
|
+
function renderHeaderCell({
|
|
1652
|
+
column,
|
|
1653
|
+
sortDirection,
|
|
1654
|
+
priority
|
|
1655
|
+
}) {
|
|
1656
|
+
return column.sortable ? /* @__PURE__ */ jsxRuntimeExports.jsx(SortableHeaderCell, {
|
|
1657
|
+
sortDirection,
|
|
1658
|
+
priority,
|
|
1659
|
+
children: column.name
|
|
1660
|
+
}) : column.name;
|
|
183
1661
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
1662
|
+
function SortableHeaderCell({
|
|
1663
|
+
sortDirection,
|
|
1664
|
+
priority,
|
|
1665
|
+
children
|
|
1666
|
+
}) {
|
|
1667
|
+
const renderSortStatus2 = useDefaultRenderers().renderSortStatus;
|
|
1668
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
1669
|
+
className: headerSortCellClassname,
|
|
1670
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
1671
|
+
className: headerSortNameClassname,
|
|
1672
|
+
children
|
|
1673
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
1674
|
+
children: renderSortStatus2({
|
|
1675
|
+
sortDirection,
|
|
1676
|
+
priority
|
|
1677
|
+
})
|
|
1678
|
+
})]
|
|
1679
|
+
});
|
|
187
1680
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
1681
|
+
const cellSortableClassname = "c6l2wv17-0-0-beta-47", cellResizable = "c1kqdw7y7-0-0-beta-47", cellResizableClassname = `rdg-cell-resizable ${cellResizable}`, resizeHandleClassname = "r1y6ywlx7-0-0-beta-47", cellDraggableClassname = "rdg-cell-draggable", cellDragging = "c1bezg5o7-0-0-beta-47", cellDraggingClassname = `rdg-cell-dragging ${cellDragging}`, cellOver = "c1vc96037-0-0-beta-47", cellOverClassname = `rdg-cell-drag-over ${cellOver}`;
|
|
1682
|
+
function HeaderCell({
|
|
1683
|
+
column,
|
|
1684
|
+
colSpan,
|
|
1685
|
+
rowIdx,
|
|
1686
|
+
isCellSelected,
|
|
1687
|
+
onColumnResize,
|
|
1688
|
+
onColumnsReorder,
|
|
1689
|
+
sortColumns,
|
|
1690
|
+
onSortColumnsChange,
|
|
1691
|
+
selectCell,
|
|
1692
|
+
shouldFocusGrid,
|
|
1693
|
+
direction,
|
|
1694
|
+
dragDropKey
|
|
1695
|
+
}) {
|
|
1696
|
+
const [isDragging, setIsDragging] = useState(!1), [isOver, setIsOver] = useState(!1), isRtl = direction === "rtl", rowSpan = getHeaderCellRowSpan(column, rowIdx), {
|
|
1697
|
+
tabIndex,
|
|
1698
|
+
childTabIndex,
|
|
1699
|
+
onFocus
|
|
1700
|
+
} = useRovingTabIndex(isCellSelected), sortIndex = sortColumns == null ? void 0 : sortColumns.findIndex((sort) => sort.columnKey === column.key), sortColumn = sortIndex !== void 0 && sortIndex > -1 ? sortColumns[sortIndex] : void 0, sortDirection = sortColumn == null ? void 0 : sortColumn.direction, priority = sortColumn !== void 0 && sortColumns.length > 1 ? sortIndex + 1 : void 0, ariaSort = sortDirection && !priority ? sortDirection === "ASC" ? "ascending" : "descending" : void 0, {
|
|
1701
|
+
sortable,
|
|
1702
|
+
resizable,
|
|
1703
|
+
draggable
|
|
1704
|
+
} = column, className = getCellClassname(column, column.headerCellClass, sortable && cellSortableClassname, resizable && cellResizableClassname, draggable && cellDraggableClassname, isDragging && cellDraggingClassname, isOver && cellOverClassname), renderHeaderCell$1 = column.renderHeaderCell ?? renderHeaderCell;
|
|
1705
|
+
function onPointerDown(event) {
|
|
1706
|
+
if (event.pointerType === "mouse" && event.buttons !== 1)
|
|
1707
|
+
return;
|
|
1708
|
+
event.preventDefault();
|
|
1709
|
+
const {
|
|
1710
|
+
currentTarget,
|
|
1711
|
+
pointerId
|
|
1712
|
+
} = event, headerCell = currentTarget.parentElement, {
|
|
1713
|
+
right,
|
|
1714
|
+
left
|
|
1715
|
+
} = headerCell.getBoundingClientRect(), offset = isRtl ? event.clientX - left : right - event.clientX;
|
|
1716
|
+
let hasDoubleClicked = !1;
|
|
1717
|
+
function onPointerMove(event2) {
|
|
1718
|
+
const {
|
|
1719
|
+
width,
|
|
1720
|
+
right: right2,
|
|
1721
|
+
left: left2
|
|
1722
|
+
} = headerCell.getBoundingClientRect();
|
|
1723
|
+
let newWidth = isRtl ? right2 + offset - event2.clientX : event2.clientX + offset - left2;
|
|
1724
|
+
newWidth = clampColumnWidth(newWidth, column), width > 0 && newWidth !== width && onColumnResize(column, newWidth);
|
|
197
1725
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1726
|
+
function onDoubleClick() {
|
|
1727
|
+
hasDoubleClicked = !0, onColumnResize(column, "max-content");
|
|
1728
|
+
}
|
|
1729
|
+
function onLostPointerCapture(event2) {
|
|
1730
|
+
hasDoubleClicked || onPointerMove(event2), currentTarget.removeEventListener("pointermove", onPointerMove), currentTarget.removeEventListener("dblclick", onDoubleClick), currentTarget.removeEventListener("lostpointercapture", onLostPointerCapture);
|
|
1731
|
+
}
|
|
1732
|
+
currentTarget.setPointerCapture(pointerId), currentTarget.addEventListener("pointermove", onPointerMove), currentTarget.addEventListener("dblclick", onDoubleClick), currentTarget.addEventListener("lostpointercapture", onLostPointerCapture);
|
|
1733
|
+
}
|
|
1734
|
+
function onSort(ctrlClick) {
|
|
1735
|
+
if (onSortColumnsChange == null) return;
|
|
1736
|
+
const {
|
|
1737
|
+
sortDescendingFirst
|
|
1738
|
+
} = column;
|
|
1739
|
+
if (sortColumn === void 0) {
|
|
1740
|
+
const nextSort = {
|
|
1741
|
+
columnKey: column.key,
|
|
1742
|
+
direction: sortDescendingFirst ? "DESC" : "ASC"
|
|
1743
|
+
};
|
|
1744
|
+
onSortColumnsChange(sortColumns && ctrlClick ? [...sortColumns, nextSort] : [nextSort]);
|
|
1745
|
+
} else {
|
|
1746
|
+
let nextSortColumn;
|
|
1747
|
+
if ((sortDescendingFirst === !0 && sortDirection === "DESC" || sortDescendingFirst !== !0 && sortDirection === "ASC") && (nextSortColumn = {
|
|
1748
|
+
columnKey: column.key,
|
|
1749
|
+
direction: sortDirection === "ASC" ? "DESC" : "ASC"
|
|
1750
|
+
}), ctrlClick) {
|
|
1751
|
+
const nextSortColumns = [...sortColumns];
|
|
1752
|
+
nextSortColumn ? nextSortColumns[sortIndex] = nextSortColumn : nextSortColumns.splice(sortIndex, 1), onSortColumnsChange(nextSortColumns);
|
|
1753
|
+
} else
|
|
1754
|
+
onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []);
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
function onClick(event) {
|
|
1758
|
+
selectCell({
|
|
1759
|
+
idx: column.idx,
|
|
1760
|
+
rowIdx
|
|
1761
|
+
}), sortable && onSort(event.ctrlKey || event.metaKey);
|
|
1762
|
+
}
|
|
1763
|
+
function handleFocus(event) {
|
|
1764
|
+
onFocus == null || onFocus(event), shouldFocusGrid && selectCell({
|
|
1765
|
+
idx: 0,
|
|
1766
|
+
rowIdx
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
function onKeyDown(event) {
|
|
1770
|
+
(event.key === " " || event.key === "Enter") && (event.preventDefault(), onSort(event.ctrlKey || event.metaKey));
|
|
1771
|
+
}
|
|
1772
|
+
function onDragStart(event) {
|
|
1773
|
+
event.dataTransfer.setData(dragDropKey, column.key), event.dataTransfer.dropEffect = "move", setIsDragging(!0);
|
|
1774
|
+
}
|
|
1775
|
+
function onDragEnd() {
|
|
1776
|
+
setIsDragging(!1);
|
|
1777
|
+
}
|
|
1778
|
+
function onDragOver(event) {
|
|
1779
|
+
event.preventDefault(), event.dataTransfer.dropEffect = "move";
|
|
1780
|
+
}
|
|
1781
|
+
function onDrop(event) {
|
|
1782
|
+
if (setIsOver(!1), event.dataTransfer.types.includes(dragDropKey.toLowerCase())) {
|
|
1783
|
+
const sourceKey = event.dataTransfer.getData(dragDropKey.toLowerCase());
|
|
1784
|
+
sourceKey !== column.key && (event.preventDefault(), onColumnsReorder == null || onColumnsReorder(sourceKey, column.key));
|
|
205
1785
|
}
|
|
206
1786
|
}
|
|
1787
|
+
function onDragEnter(event) {
|
|
1788
|
+
isEventPertinent(event) && setIsOver(!0);
|
|
1789
|
+
}
|
|
1790
|
+
function onDragLeave(event) {
|
|
1791
|
+
isEventPertinent(event) && setIsOver(!1);
|
|
1792
|
+
}
|
|
1793
|
+
let draggableProps;
|
|
1794
|
+
return draggable && (draggableProps = {
|
|
1795
|
+
draggable: !0,
|
|
1796
|
+
onDragStart,
|
|
1797
|
+
onDragEnd,
|
|
1798
|
+
onDragOver,
|
|
1799
|
+
onDragEnter,
|
|
1800
|
+
onDragLeave,
|
|
1801
|
+
onDrop
|
|
1802
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
1803
|
+
role: "columnheader",
|
|
1804
|
+
"aria-colindex": column.idx + 1,
|
|
1805
|
+
"aria-colspan": colSpan,
|
|
1806
|
+
"aria-rowspan": rowSpan,
|
|
1807
|
+
"aria-selected": isCellSelected,
|
|
1808
|
+
"aria-sort": ariaSort,
|
|
1809
|
+
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1810
|
+
className,
|
|
1811
|
+
style: {
|
|
1812
|
+
...getHeaderCellStyle(column, rowIdx, rowSpan),
|
|
1813
|
+
...getCellStyle(column, colSpan)
|
|
1814
|
+
},
|
|
1815
|
+
onFocus: handleFocus,
|
|
1816
|
+
onClick,
|
|
1817
|
+
onKeyDown: sortable ? onKeyDown : void 0,
|
|
1818
|
+
...draggableProps,
|
|
1819
|
+
children: [renderHeaderCell$1({
|
|
1820
|
+
column,
|
|
1821
|
+
sortDirection,
|
|
1822
|
+
priority,
|
|
1823
|
+
tabIndex: childTabIndex
|
|
1824
|
+
}), resizable && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1825
|
+
className: resizeHandleClassname,
|
|
1826
|
+
onClick: stopPropagation,
|
|
1827
|
+
onPointerDown
|
|
1828
|
+
})]
|
|
1829
|
+
});
|
|
207
1830
|
}
|
|
208
|
-
|
|
209
|
-
.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
1831
|
+
function isEventPertinent(event) {
|
|
1832
|
+
const relatedTarget = event.relatedTarget;
|
|
1833
|
+
return !event.currentTarget.contains(relatedTarget);
|
|
1834
|
+
}
|
|
1835
|
+
const row = "r1upfr807-0-0-beta-47", rowClassname = `rdg-row ${row}`, rowSelected = "r190mhd37-0-0-beta-47", rowSelectedClassname = "rdg-row-selected", rowSelectedWithFrozenCell = "r139qu9m7-0-0-beta-47", topSummaryRowClassname = "rdg-top-summary-row", bottomSummaryRowClassname = "rdg-bottom-summary-row", headerRow = "h10tskcx7-0-0-beta-47", headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1836
|
+
function HeaderRow({
|
|
1837
|
+
rowIdx,
|
|
1838
|
+
columns,
|
|
1839
|
+
onColumnResize,
|
|
1840
|
+
onColumnsReorder,
|
|
1841
|
+
sortColumns,
|
|
1842
|
+
onSortColumnsChange,
|
|
1843
|
+
lastFrozenColumnIndex,
|
|
1844
|
+
selectedCellIdx,
|
|
1845
|
+
selectCell,
|
|
1846
|
+
shouldFocusGrid,
|
|
1847
|
+
direction
|
|
1848
|
+
}) {
|
|
1849
|
+
const dragDropKey = useId(), cells = [];
|
|
1850
|
+
for (let index = 0; index < columns.length; index++) {
|
|
1851
|
+
const column = columns[index], colSpan = getColSpan(column, lastFrozenColumnIndex, {
|
|
1852
|
+
type: "HEADER"
|
|
1853
|
+
});
|
|
1854
|
+
colSpan !== void 0 && (index += colSpan - 1), cells.push(/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderCell, {
|
|
1855
|
+
column,
|
|
1856
|
+
colSpan,
|
|
1857
|
+
rowIdx,
|
|
1858
|
+
isCellSelected: selectedCellIdx === column.idx,
|
|
1859
|
+
onColumnResize,
|
|
1860
|
+
onColumnsReorder,
|
|
1861
|
+
onSortColumnsChange,
|
|
1862
|
+
sortColumns,
|
|
1863
|
+
selectCell,
|
|
1864
|
+
shouldFocusGrid: shouldFocusGrid && index === 0,
|
|
1865
|
+
direction,
|
|
1866
|
+
dragDropKey
|
|
1867
|
+
}, column.key));
|
|
213
1868
|
}
|
|
1869
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1870
|
+
role: "row",
|
|
1871
|
+
"aria-rowindex": rowIdx,
|
|
1872
|
+
className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
1873
|
+
children: cells
|
|
1874
|
+
});
|
|
214
1875
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
1876
|
+
const HeaderRow$1 = /* @__PURE__ */ memo(HeaderRow);
|
|
1877
|
+
function GroupedColumnHeaderRow({
|
|
1878
|
+
rowIdx,
|
|
1879
|
+
level,
|
|
1880
|
+
columns,
|
|
1881
|
+
selectedCellIdx,
|
|
1882
|
+
selectCell
|
|
1883
|
+
}) {
|
|
1884
|
+
const cells = [], renderedParents = /* @__PURE__ */ new Set();
|
|
1885
|
+
for (const column of columns) {
|
|
1886
|
+
let {
|
|
1887
|
+
parent
|
|
1888
|
+
} = column;
|
|
1889
|
+
if (parent !== void 0) {
|
|
1890
|
+
for (; parent.level > level && parent.parent !== void 0; )
|
|
1891
|
+
parent = parent.parent;
|
|
1892
|
+
if (parent.level === level && !renderedParents.has(parent)) {
|
|
1893
|
+
renderedParents.add(parent);
|
|
1894
|
+
const {
|
|
1895
|
+
idx
|
|
1896
|
+
} = parent;
|
|
1897
|
+
cells.push(/* @__PURE__ */ jsxRuntimeExports.jsx(GroupedColumnHeaderCell, {
|
|
1898
|
+
column: parent,
|
|
1899
|
+
rowIdx,
|
|
1900
|
+
isCellSelected: selectedCellIdx === idx,
|
|
1901
|
+
selectCell
|
|
1902
|
+
}, idx));
|
|
1903
|
+
}
|
|
225
1904
|
}
|
|
226
1905
|
}
|
|
1906
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1907
|
+
role: "row",
|
|
1908
|
+
"aria-rowindex": rowIdx,
|
|
1909
|
+
className: headerRowClassname,
|
|
1910
|
+
children: cells
|
|
1911
|
+
});
|
|
227
1912
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
1913
|
+
const GroupedColumnHeaderRow$1 = /* @__PURE__ */ memo(GroupedColumnHeaderRow), cellCopied = "c6ra8a37-0-0-beta-47", cellCopiedClassname = `rdg-cell-copied ${cellCopied}`, cellDraggedOver = "cq910m07-0-0-beta-47", cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1914
|
+
function Cell({
|
|
1915
|
+
column,
|
|
1916
|
+
colSpan,
|
|
1917
|
+
isCellSelected,
|
|
1918
|
+
isCopied,
|
|
1919
|
+
isDraggedOver,
|
|
1920
|
+
row: row2,
|
|
1921
|
+
rowIdx,
|
|
1922
|
+
onClick,
|
|
1923
|
+
onDoubleClick,
|
|
1924
|
+
onContextMenu,
|
|
1925
|
+
onRowChange,
|
|
1926
|
+
selectCell,
|
|
1927
|
+
...props
|
|
1928
|
+
}) {
|
|
1929
|
+
const {
|
|
1930
|
+
tabIndex,
|
|
1931
|
+
childTabIndex,
|
|
1932
|
+
onFocus
|
|
1933
|
+
} = useRovingTabIndex(isCellSelected), {
|
|
1934
|
+
cellClass
|
|
1935
|
+
} = column, className = getCellClassname(column, typeof cellClass == "function" ? cellClass(row2) : cellClass, isCopied && cellCopiedClassname, isDraggedOver && cellDraggedOverClassname), isEditable = isCellEditableUtil(column, row2);
|
|
1936
|
+
function selectCellWrapper(openEditor) {
|
|
1937
|
+
selectCell({
|
|
1938
|
+
rowIdx,
|
|
1939
|
+
idx: column.idx
|
|
1940
|
+
}, openEditor);
|
|
1941
|
+
}
|
|
1942
|
+
function handleClick(event) {
|
|
1943
|
+
if (onClick) {
|
|
1944
|
+
const cellEvent = createCellEvent(event);
|
|
1945
|
+
if (onClick({
|
|
1946
|
+
row: row2,
|
|
1947
|
+
column,
|
|
1948
|
+
selectCell: selectCellWrapper
|
|
1949
|
+
}, cellEvent), cellEvent.isGridDefaultPrevented()) return;
|
|
240
1950
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
1951
|
+
selectCellWrapper();
|
|
1952
|
+
}
|
|
1953
|
+
function handleContextMenu(event) {
|
|
1954
|
+
if (onContextMenu) {
|
|
1955
|
+
const cellEvent = createCellEvent(event);
|
|
1956
|
+
if (onContextMenu({
|
|
1957
|
+
row: row2,
|
|
1958
|
+
column,
|
|
1959
|
+
selectCell: selectCellWrapper
|
|
1960
|
+
}, cellEvent), cellEvent.isGridDefaultPrevented()) return;
|
|
1961
|
+
}
|
|
1962
|
+
selectCellWrapper();
|
|
1963
|
+
}
|
|
1964
|
+
function handleDoubleClick(event) {
|
|
1965
|
+
if (onDoubleClick) {
|
|
1966
|
+
const cellEvent = createCellEvent(event);
|
|
1967
|
+
if (onDoubleClick({
|
|
1968
|
+
row: row2,
|
|
1969
|
+
column,
|
|
1970
|
+
selectCell: selectCellWrapper
|
|
1971
|
+
}, cellEvent), cellEvent.isGridDefaultPrevented()) return;
|
|
244
1972
|
}
|
|
1973
|
+
selectCellWrapper(!0);
|
|
245
1974
|
}
|
|
1975
|
+
function handleRowChange(newRow) {
|
|
1976
|
+
onRowChange(column, newRow);
|
|
1977
|
+
}
|
|
1978
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
1979
|
+
role: "gridcell",
|
|
1980
|
+
"aria-colindex": column.idx + 1,
|
|
1981
|
+
"aria-colspan": colSpan,
|
|
1982
|
+
"aria-selected": isCellSelected,
|
|
1983
|
+
"aria-readonly": !isEditable || void 0,
|
|
1984
|
+
tabIndex,
|
|
1985
|
+
className,
|
|
1986
|
+
style: getCellStyle(column, colSpan),
|
|
1987
|
+
onClick: handleClick,
|
|
1988
|
+
onDoubleClick: handleDoubleClick,
|
|
1989
|
+
onContextMenu: handleContextMenu,
|
|
1990
|
+
onFocus,
|
|
1991
|
+
...props,
|
|
1992
|
+
children: column.renderCell({
|
|
1993
|
+
column,
|
|
1994
|
+
row: row2,
|
|
1995
|
+
rowIdx,
|
|
1996
|
+
isCellEditable: isEditable,
|
|
1997
|
+
tabIndex: childTabIndex,
|
|
1998
|
+
onRowChange: handleRowChange
|
|
1999
|
+
})
|
|
2000
|
+
});
|
|
246
2001
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
2002
|
+
const Cell$1 = /* @__PURE__ */ memo(Cell);
|
|
2003
|
+
function Row({
|
|
2004
|
+
className,
|
|
2005
|
+
rowIdx,
|
|
2006
|
+
gridRowStart,
|
|
2007
|
+
selectedCellIdx,
|
|
2008
|
+
isRowSelectionDisabled,
|
|
2009
|
+
isRowSelected,
|
|
2010
|
+
copiedCellIdx,
|
|
2011
|
+
draggedOverCellIdx,
|
|
2012
|
+
lastFrozenColumnIndex,
|
|
2013
|
+
row: row2,
|
|
2014
|
+
viewportColumns,
|
|
2015
|
+
selectedCellEditor,
|
|
2016
|
+
onCellClick,
|
|
2017
|
+
onCellDoubleClick,
|
|
2018
|
+
onCellContextMenu,
|
|
2019
|
+
rowClass,
|
|
2020
|
+
setDraggedOverRowIdx,
|
|
2021
|
+
onMouseEnter,
|
|
2022
|
+
onRowChange,
|
|
2023
|
+
selectCell,
|
|
2024
|
+
...props
|
|
2025
|
+
}, ref) {
|
|
2026
|
+
const handleRowChange = useLatestFunc((column, newRow) => {
|
|
2027
|
+
onRowChange(column, rowIdx, newRow);
|
|
2028
|
+
});
|
|
2029
|
+
function handleDragEnter(event) {
|
|
2030
|
+
setDraggedOverRowIdx == null || setDraggedOverRowIdx(rowIdx), onMouseEnter == null || onMouseEnter(event);
|
|
2031
|
+
}
|
|
2032
|
+
className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? "even" : "odd"}`, rowClass == null ? void 0 : rowClass(row2, rowIdx), className, selectedCellIdx === -1 && rowSelectedClassname);
|
|
2033
|
+
const cells = [];
|
|
2034
|
+
for (let index = 0; index < viewportColumns.length; index++) {
|
|
2035
|
+
const column = viewportColumns[index], {
|
|
2036
|
+
idx
|
|
2037
|
+
} = column, colSpan = getColSpan(column, lastFrozenColumnIndex, {
|
|
2038
|
+
type: "ROW",
|
|
2039
|
+
row: row2
|
|
2040
|
+
});
|
|
2041
|
+
colSpan !== void 0 && (index += colSpan - 1);
|
|
2042
|
+
const isCellSelected = selectedCellIdx === idx;
|
|
2043
|
+
isCellSelected && selectedCellEditor ? cells.push(selectedCellEditor) : cells.push(/* @__PURE__ */ jsxRuntimeExports.jsx(Cell$1, {
|
|
2044
|
+
column,
|
|
2045
|
+
colSpan,
|
|
2046
|
+
row: row2,
|
|
2047
|
+
rowIdx,
|
|
2048
|
+
isCopied: copiedCellIdx === idx,
|
|
2049
|
+
isDraggedOver: draggedOverCellIdx === idx,
|
|
2050
|
+
isCellSelected,
|
|
2051
|
+
onClick: onCellClick,
|
|
2052
|
+
onDoubleClick: onCellDoubleClick,
|
|
2053
|
+
onContextMenu: onCellContextMenu,
|
|
2054
|
+
onRowChange: handleRowChange,
|
|
2055
|
+
selectCell
|
|
2056
|
+
}, column.key));
|
|
252
2057
|
}
|
|
2058
|
+
const selectionValue = useMemo(() => ({
|
|
2059
|
+
isRowSelected,
|
|
2060
|
+
isRowSelectionDisabled
|
|
2061
|
+
}), [isRowSelectionDisabled, isRowSelected]);
|
|
2062
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowSelectionProvider, {
|
|
2063
|
+
value: selectionValue,
|
|
2064
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
2065
|
+
role: "row",
|
|
2066
|
+
ref,
|
|
2067
|
+
className,
|
|
2068
|
+
onMouseEnter: handleDragEnter,
|
|
2069
|
+
style: getRowStyle(gridRowStart),
|
|
2070
|
+
...props,
|
|
2071
|
+
children: cells
|
|
2072
|
+
})
|
|
2073
|
+
});
|
|
253
2074
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
@
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
2075
|
+
const RowComponent = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(Row));
|
|
2076
|
+
function defaultRenderRow(key, props) {
|
|
2077
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RowComponent, {
|
|
2078
|
+
...props
|
|
2079
|
+
}, key);
|
|
2080
|
+
}
|
|
2081
|
+
function ScrollToCell({
|
|
2082
|
+
scrollToPosition: {
|
|
2083
|
+
idx,
|
|
2084
|
+
rowIdx
|
|
2085
|
+
},
|
|
2086
|
+
gridElement,
|
|
2087
|
+
setScrollToCellPosition
|
|
2088
|
+
}) {
|
|
2089
|
+
const ref = useRef(null);
|
|
2090
|
+
return useLayoutEffect(() => {
|
|
2091
|
+
scrollIntoView(ref.current);
|
|
2092
|
+
}), useLayoutEffect(() => {
|
|
2093
|
+
function removeScrollToCell() {
|
|
2094
|
+
setScrollToCellPosition(null);
|
|
2095
|
+
}
|
|
2096
|
+
const observer = new IntersectionObserver(removeScrollToCell, {
|
|
2097
|
+
root: gridElement,
|
|
2098
|
+
threshold: 1
|
|
2099
|
+
});
|
|
2100
|
+
return observer.observe(ref.current), () => {
|
|
2101
|
+
observer.disconnect();
|
|
2102
|
+
};
|
|
2103
|
+
}, [gridElement, setScrollToCellPosition]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
2104
|
+
ref,
|
|
2105
|
+
style: {
|
|
2106
|
+
gridColumn: idx === void 0 ? "1/-1" : idx + 1,
|
|
2107
|
+
gridRow: rowIdx === void 0 ? "1/-1" : rowIdx + 2
|
|
261
2108
|
}
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
const arrow = "a3ejtar7-0-0-beta-47", arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
2112
|
+
function renderSortStatus({
|
|
2113
|
+
sortDirection,
|
|
2114
|
+
priority
|
|
2115
|
+
}) {
|
|
2116
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
2117
|
+
children: [renderSortIcon({
|
|
2118
|
+
sortDirection
|
|
2119
|
+
}), renderSortPriority({
|
|
2120
|
+
priority
|
|
2121
|
+
})]
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
function renderSortIcon({
|
|
2125
|
+
sortDirection
|
|
2126
|
+
}) {
|
|
2127
|
+
return sortDirection === void 0 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("svg", {
|
|
2128
|
+
viewBox: "0 0 12 8",
|
|
2129
|
+
width: "12",
|
|
2130
|
+
height: "8",
|
|
2131
|
+
className: arrowClassname,
|
|
2132
|
+
"aria-hidden": !0,
|
|
2133
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", {
|
|
2134
|
+
d: sortDirection === "ASC" ? "M0 8 6 0 12 8" : "M0 0 6 8 12 0"
|
|
2135
|
+
})
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
function renderSortPriority({
|
|
2139
|
+
priority
|
|
2140
|
+
}) {
|
|
2141
|
+
return priority;
|
|
2142
|
+
}
|
|
2143
|
+
const root = "rnvodz57-0-0-beta-47", rootClassname = `rdg ${root}`, viewportDragging = "vlqv91k7-0-0-beta-47", viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`, focusSinkClassname = "f1lsfrzw7-0-0-beta-47", focusSinkHeaderAndSummaryClassname = "f1cte0lg7-0-0-beta-47", summaryCellClassname = "s8wc6fl7-0-0-beta-47";
|
|
2144
|
+
function SummaryCell({
|
|
2145
|
+
column,
|
|
2146
|
+
colSpan,
|
|
2147
|
+
row: row2,
|
|
2148
|
+
rowIdx,
|
|
2149
|
+
isCellSelected,
|
|
2150
|
+
selectCell
|
|
2151
|
+
}) {
|
|
2152
|
+
var _a;
|
|
2153
|
+
const {
|
|
2154
|
+
tabIndex,
|
|
2155
|
+
childTabIndex,
|
|
2156
|
+
onFocus
|
|
2157
|
+
} = useRovingTabIndex(isCellSelected), {
|
|
2158
|
+
summaryCellClass
|
|
2159
|
+
} = column, className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass == "function" ? summaryCellClass(row2) : summaryCellClass);
|
|
2160
|
+
function onClick() {
|
|
2161
|
+
selectCell({
|
|
2162
|
+
rowIdx,
|
|
2163
|
+
idx: column.idx
|
|
2164
|
+
});
|
|
262
2165
|
}
|
|
2166
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
2167
|
+
role: "gridcell",
|
|
2168
|
+
"aria-colindex": column.idx + 1,
|
|
2169
|
+
"aria-colspan": colSpan,
|
|
2170
|
+
"aria-selected": isCellSelected,
|
|
2171
|
+
tabIndex,
|
|
2172
|
+
className,
|
|
2173
|
+
style: getCellStyle(column, colSpan),
|
|
2174
|
+
onClick,
|
|
2175
|
+
onFocus,
|
|
2176
|
+
children: (_a = column.renderSummaryCell) == null ? void 0 : _a.call(column, {
|
|
2177
|
+
column,
|
|
2178
|
+
row: row2,
|
|
2179
|
+
tabIndex: childTabIndex
|
|
2180
|
+
})
|
|
2181
|
+
});
|
|
263
2182
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
2183
|
+
const SummaryCell$1 = /* @__PURE__ */ memo(SummaryCell), summaryRow = "skuhp557-0-0-beta-47", topSummaryRow = "tf8l5ub7-0-0-beta-47", summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
2184
|
+
function SummaryRow({
|
|
2185
|
+
rowIdx,
|
|
2186
|
+
gridRowStart,
|
|
2187
|
+
row: row2,
|
|
2188
|
+
viewportColumns,
|
|
2189
|
+
top,
|
|
2190
|
+
bottom,
|
|
2191
|
+
lastFrozenColumnIndex,
|
|
2192
|
+
selectedCellIdx,
|
|
2193
|
+
isTop,
|
|
2194
|
+
selectCell,
|
|
2195
|
+
"aria-rowindex": ariaRowIndex
|
|
2196
|
+
}) {
|
|
2197
|
+
const cells = [];
|
|
2198
|
+
for (let index = 0; index < viewportColumns.length; index++) {
|
|
2199
|
+
const column = viewportColumns[index], colSpan = getColSpan(column, lastFrozenColumnIndex, {
|
|
2200
|
+
type: "SUMMARY",
|
|
2201
|
+
row: row2
|
|
2202
|
+
});
|
|
2203
|
+
colSpan !== void 0 && (index += colSpan - 1);
|
|
2204
|
+
const isCellSelected = selectedCellIdx === column.idx;
|
|
2205
|
+
cells.push(/* @__PURE__ */ jsxRuntimeExports.jsx(SummaryCell$1, {
|
|
2206
|
+
column,
|
|
2207
|
+
colSpan,
|
|
2208
|
+
row: row2,
|
|
2209
|
+
rowIdx,
|
|
2210
|
+
isCellSelected,
|
|
2211
|
+
selectCell
|
|
2212
|
+
}, column.key));
|
|
273
2213
|
}
|
|
2214
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
2215
|
+
role: "row",
|
|
2216
|
+
"aria-rowindex": ariaRowIndex,
|
|
2217
|
+
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? "even" : "odd"}`, summaryRowClassname, isTop ? `${topSummaryRowClassname} ${topSummaryRow}` : bottomSummaryRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
2218
|
+
style: {
|
|
2219
|
+
...getRowStyle(gridRowStart),
|
|
2220
|
+
"--rdg-summary-row-top": top !== void 0 ? `${top}px` : void 0,
|
|
2221
|
+
"--rdg-summary-row-bottom": bottom !== void 0 ? `${bottom}px` : void 0
|
|
2222
|
+
},
|
|
2223
|
+
children: cells
|
|
2224
|
+
});
|
|
274
2225
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
2226
|
+
const SummaryRow$1 = /* @__PURE__ */ memo(SummaryRow);
|
|
2227
|
+
function DataGrid(props, ref) {
|
|
2228
|
+
const {
|
|
2229
|
+
columns: rawColumns,
|
|
2230
|
+
rows,
|
|
2231
|
+
topSummaryRows,
|
|
2232
|
+
bottomSummaryRows,
|
|
2233
|
+
rowKeyGetter,
|
|
2234
|
+
onRowsChange,
|
|
2235
|
+
rowHeight: rawRowHeight,
|
|
2236
|
+
headerRowHeight: rawHeaderRowHeight,
|
|
2237
|
+
summaryRowHeight: rawSummaryRowHeight,
|
|
2238
|
+
selectedRows,
|
|
2239
|
+
isRowSelectionDisabled,
|
|
2240
|
+
onSelectedRowsChange,
|
|
2241
|
+
sortColumns,
|
|
2242
|
+
onSortColumnsChange,
|
|
2243
|
+
defaultColumnOptions,
|
|
2244
|
+
onCellClick,
|
|
2245
|
+
onCellDoubleClick,
|
|
2246
|
+
onCellContextMenu,
|
|
2247
|
+
onCellKeyDown,
|
|
2248
|
+
onSelectedCellChange,
|
|
2249
|
+
onScroll,
|
|
2250
|
+
onColumnResize,
|
|
2251
|
+
onColumnsReorder,
|
|
2252
|
+
onFill,
|
|
2253
|
+
onCopy,
|
|
2254
|
+
onPaste,
|
|
2255
|
+
enableVirtualization: rawEnableVirtualization,
|
|
2256
|
+
renderers,
|
|
2257
|
+
className,
|
|
2258
|
+
style,
|
|
2259
|
+
rowClass,
|
|
2260
|
+
direction: rawDirection,
|
|
2261
|
+
role: rawRole,
|
|
2262
|
+
"aria-label": ariaLabel,
|
|
2263
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2264
|
+
"aria-describedby": ariaDescribedBy,
|
|
2265
|
+
"aria-rowcount": rawAriaRowCount,
|
|
2266
|
+
"data-testid": testId
|
|
2267
|
+
} = props, defaultRenderers = useDefaultRenderers(), role = rawRole ?? "grid", rowHeight = rawRowHeight ?? 35, headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight == "number" ? rowHeight : 35), summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight == "number" ? rowHeight : 35), renderRow = (renderers == null ? void 0 : renderers.renderRow) ?? (defaultRenderers == null ? void 0 : defaultRenderers.renderRow) ?? defaultRenderRow, renderSortStatus$1 = (renderers == null ? void 0 : renderers.renderSortStatus) ?? (defaultRenderers == null ? void 0 : defaultRenderers.renderSortStatus) ?? renderSortStatus, renderCheckbox$1 = (renderers == null ? void 0 : renderers.renderCheckbox) ?? (defaultRenderers == null ? void 0 : defaultRenderers.renderCheckbox) ?? renderCheckbox, noRowsFallback = (renderers == null ? void 0 : renderers.noRowsFallback) ?? (defaultRenderers == null ? void 0 : defaultRenderers.noRowsFallback), enableVirtualization = rawEnableVirtualization ?? !0, direction = rawDirection ?? "ltr", [scrollTop, setScrollTop] = useState(0), [scrollLeft, setScrollLeft] = useState(0), [resizedColumnWidths, setResizedColumnWidths] = useState(() => /* @__PURE__ */ new Map()), [measuredColumnWidths, setMeasuredColumnWidths] = useState(() => /* @__PURE__ */ new Map()), [copiedCell, setCopiedCell] = useState(null), [isDragging, setDragging] = useState(!1), [draggedOverRowIdx, setOverRowIdx] = useState(void 0), [scrollToPosition, setScrollToPosition] = useState(null), getColumnWidth = useCallback((column) => resizedColumnWidths.get(column.key) ?? measuredColumnWidths.get(column.key) ?? column.width, [measuredColumnWidths, resizedColumnWidths]), [gridRef, gridWidth, gridHeight, horizontalScrollbarHeight] = useGridDimensions(), {
|
|
2268
|
+
columns,
|
|
2269
|
+
colSpanColumns,
|
|
2270
|
+
lastFrozenColumnIndex,
|
|
2271
|
+
headerRowsCount,
|
|
2272
|
+
colOverscanStartIdx,
|
|
2273
|
+
colOverscanEndIdx,
|
|
2274
|
+
templateColumns,
|
|
2275
|
+
layoutCssVars,
|
|
2276
|
+
totalFrozenColumnWidth
|
|
2277
|
+
} = useCalculatedColumns({
|
|
2278
|
+
rawColumns,
|
|
2279
|
+
defaultColumnOptions,
|
|
2280
|
+
getColumnWidth,
|
|
2281
|
+
scrollLeft,
|
|
2282
|
+
viewportWidth: gridWidth,
|
|
2283
|
+
enableVirtualization
|
|
2284
|
+
}), topSummaryRowsCount = (topSummaryRows == null ? void 0 : topSummaryRows.length) ?? 0, bottomSummaryRowsCount = (bottomSummaryRows == null ? void 0 : bottomSummaryRows.length) ?? 0, summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount, headerAndTopSummaryRowsCount = headerRowsCount + topSummaryRowsCount, groupedColumnHeaderRowsCount = headerRowsCount - 1, minRowIdx = -headerAndTopSummaryRowsCount, mainHeaderRowIdx = minRowIdx + groupedColumnHeaderRowsCount, maxRowIdx = rows.length + bottomSummaryRowsCount - 1, [selectedPosition, setSelectedPosition] = useState(() => ({
|
|
2285
|
+
idx: -1,
|
|
2286
|
+
rowIdx: minRowIdx - 1,
|
|
2287
|
+
mode: "SELECT"
|
|
2288
|
+
})), prevSelectedPosition = useRef(selectedPosition), latestDraggedOverRowIdx = useRef(draggedOverRowIdx), lastSelectedRowIdx = useRef(-1), focusSinkRef = useRef(null), shouldFocusCellRef = useRef(!1), isTreeGrid = role === "treegrid", headerRowsHeight = headerRowsCount * headerRowHeight, summaryRowsHeight = summaryRowsCount * summaryRowHeight, clientHeight = gridHeight - headerRowsHeight - summaryRowsHeight, isSelectable = selectedRows != null && onSelectedRowsChange != null, isRtl = direction === "rtl", leftKey = isRtl ? "ArrowRight" : "ArrowLeft", rightKey = isRtl ? "ArrowLeft" : "ArrowRight", ariaRowCount = rawAriaRowCount ?? headerRowsCount + rows.length + summaryRowsCount, defaultGridComponents = useMemo(() => ({
|
|
2289
|
+
renderCheckbox: renderCheckbox$1,
|
|
2290
|
+
renderSortStatus: renderSortStatus$1
|
|
2291
|
+
}), [renderCheckbox$1, renderSortStatus$1]), headerSelectionValue = useMemo(() => {
|
|
2292
|
+
let hasSelectedRow = !1, hasUnselectedRow = !1;
|
|
2293
|
+
if (rowKeyGetter != null && selectedRows != null && selectedRows.size > 0) {
|
|
2294
|
+
for (const row2 of rows)
|
|
2295
|
+
if (selectedRows.has(rowKeyGetter(row2)) ? hasSelectedRow = !0 : hasUnselectedRow = !0, hasSelectedRow && hasUnselectedRow) break;
|
|
283
2296
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
2297
|
+
return {
|
|
2298
|
+
isRowSelected: hasSelectedRow && !hasUnselectedRow,
|
|
2299
|
+
isIndeterminate: hasSelectedRow && hasUnselectedRow
|
|
2300
|
+
};
|
|
2301
|
+
}, [rows, selectedRows, rowKeyGetter]), {
|
|
2302
|
+
rowOverscanStartIdx,
|
|
2303
|
+
rowOverscanEndIdx,
|
|
2304
|
+
totalRowHeight,
|
|
2305
|
+
gridTemplateRows,
|
|
2306
|
+
getRowTop,
|
|
2307
|
+
getRowHeight,
|
|
2308
|
+
findRowIdx
|
|
2309
|
+
} = useViewportRows({
|
|
2310
|
+
rows,
|
|
2311
|
+
rowHeight,
|
|
2312
|
+
clientHeight,
|
|
2313
|
+
scrollTop,
|
|
2314
|
+
enableVirtualization
|
|
2315
|
+
}), viewportColumns = useViewportColumns({
|
|
2316
|
+
columns,
|
|
2317
|
+
colSpanColumns,
|
|
2318
|
+
colOverscanStartIdx,
|
|
2319
|
+
colOverscanEndIdx,
|
|
2320
|
+
lastFrozenColumnIndex,
|
|
2321
|
+
rowOverscanStartIdx,
|
|
2322
|
+
rowOverscanEndIdx,
|
|
2323
|
+
rows,
|
|
2324
|
+
topSummaryRows,
|
|
2325
|
+
bottomSummaryRows
|
|
2326
|
+
}), {
|
|
2327
|
+
gridTemplateColumns,
|
|
2328
|
+
handleColumnResize
|
|
2329
|
+
} = useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize), minColIdx = isTreeGrid ? -1 : 0, maxColIdx = columns.length - 1, selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition), selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition), scrollHeight = headerRowHeight + totalRowHeight + summaryRowsHeight + horizontalScrollbarHeight, handleColumnResizeLatest = useLatestFunc(handleColumnResize), onColumnsReorderLastest = useLatestFunc(onColumnsReorder), onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange), onCellClickLatest = useLatestFunc(onCellClick), onCellDoubleClickLatest = useLatestFunc(onCellDoubleClick), onCellContextMenuLatest = useLatestFunc(onCellContextMenu), selectHeaderRowLatest = useLatestFunc(selectHeaderRow), selectRowLatest = useLatestFunc(selectRow), handleFormatterRowChangeLatest = useLatestFunc(updateRow), selectCellLatest = useLatestFunc(selectCell), selectHeaderCellLatest = useLatestFunc(({
|
|
2330
|
+
idx,
|
|
2331
|
+
rowIdx
|
|
2332
|
+
}) => {
|
|
2333
|
+
selectCell({
|
|
2334
|
+
rowIdx: minRowIdx + rowIdx - 1,
|
|
2335
|
+
idx
|
|
2336
|
+
});
|
|
2337
|
+
});
|
|
2338
|
+
useLayoutEffect(() => {
|
|
2339
|
+
if (!selectedCellIsWithinSelectionBounds || isSamePosition(selectedPosition, prevSelectedPosition.current)) {
|
|
2340
|
+
prevSelectedPosition.current = selectedPosition;
|
|
2341
|
+
return;
|
|
294
2342
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
2343
|
+
prevSelectedPosition.current = selectedPosition, selectedPosition.idx === -1 && (focusSinkRef.current.focus({
|
|
2344
|
+
preventScroll: !0
|
|
2345
|
+
}), scrollIntoView(focusSinkRef.current));
|
|
2346
|
+
}), useLayoutEffect(() => {
|
|
2347
|
+
shouldFocusCellRef.current && (shouldFocusCellRef.current = !1, focusCellOrCellContent());
|
|
2348
|
+
}), useImperativeHandle(ref, () => ({
|
|
2349
|
+
element: gridRef.current,
|
|
2350
|
+
scrollToCell({
|
|
2351
|
+
idx,
|
|
2352
|
+
rowIdx
|
|
2353
|
+
}) {
|
|
2354
|
+
const scrollToIdx = idx !== void 0 && idx > lastFrozenColumnIndex && idx < columns.length ? idx : void 0, scrollToRowIdx = rowIdx !== void 0 && isRowIdxWithinViewportBounds(rowIdx) ? rowIdx : void 0;
|
|
2355
|
+
(scrollToIdx !== void 0 || scrollToRowIdx !== void 0) && setScrollToPosition({
|
|
2356
|
+
idx: scrollToIdx,
|
|
2357
|
+
rowIdx: scrollToRowIdx
|
|
2358
|
+
});
|
|
2359
|
+
},
|
|
2360
|
+
selectCell
|
|
2361
|
+
}));
|
|
2362
|
+
const setDraggedOverRowIdx = useCallback((rowIdx) => {
|
|
2363
|
+
setOverRowIdx(rowIdx), latestDraggedOverRowIdx.current = rowIdx;
|
|
2364
|
+
}, []);
|
|
2365
|
+
function selectHeaderRow(args) {
|
|
2366
|
+
if (!onSelectedRowsChange) return;
|
|
2367
|
+
assertIsValidKeyGetter(rowKeyGetter);
|
|
2368
|
+
const newSelectedRows = new Set(selectedRows);
|
|
2369
|
+
for (const row2 of rows) {
|
|
2370
|
+
if ((isRowSelectionDisabled == null ? void 0 : isRowSelectionDisabled(row2)) === !0) continue;
|
|
2371
|
+
const rowKey = rowKeyGetter(row2);
|
|
2372
|
+
args.checked ? newSelectedRows.add(rowKey) : newSelectedRows.delete(rowKey);
|
|
319
2373
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
2374
|
+
onSelectedRowsChange(newSelectedRows);
|
|
2375
|
+
}
|
|
2376
|
+
function selectRow(args) {
|
|
2377
|
+
if (!onSelectedRowsChange) return;
|
|
2378
|
+
assertIsValidKeyGetter(rowKeyGetter);
|
|
2379
|
+
const {
|
|
2380
|
+
row: row2,
|
|
2381
|
+
checked,
|
|
2382
|
+
isShiftClick
|
|
2383
|
+
} = args;
|
|
2384
|
+
if ((isRowSelectionDisabled == null ? void 0 : isRowSelectionDisabled(row2)) === !0) return;
|
|
2385
|
+
const newSelectedRows = new Set(selectedRows), rowKey = rowKeyGetter(row2), previousRowIdx = lastSelectedRowIdx.current, rowIdx = rows.indexOf(row2);
|
|
2386
|
+
if (lastSelectedRowIdx.current = rowIdx, checked ? newSelectedRows.add(rowKey) : newSelectedRows.delete(rowKey), isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx && previousRowIdx < rows.length) {
|
|
2387
|
+
const step = sign(rowIdx - previousRowIdx);
|
|
2388
|
+
for (let i = previousRowIdx + step; i !== rowIdx; i += step) {
|
|
2389
|
+
const row3 = rows[i];
|
|
2390
|
+
(isRowSelectionDisabled == null ? void 0 : isRowSelectionDisabled(row3)) !== !0 && (checked ? newSelectedRows.add(rowKeyGetter(row3)) : newSelectedRows.delete(rowKeyGetter(row3)));
|
|
2391
|
+
}
|
|
324
2392
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
2393
|
+
onSelectedRowsChange(newSelectedRows);
|
|
2394
|
+
}
|
|
2395
|
+
function handleKeyDown(event) {
|
|
2396
|
+
var _a;
|
|
2397
|
+
const {
|
|
2398
|
+
idx,
|
|
2399
|
+
rowIdx,
|
|
2400
|
+
mode
|
|
2401
|
+
} = selectedPosition;
|
|
2402
|
+
if (mode === "EDIT") return;
|
|
2403
|
+
if (onCellKeyDown && isRowIdxWithinViewportBounds(rowIdx)) {
|
|
2404
|
+
const row2 = rows[rowIdx], cellEvent = createCellEvent(event);
|
|
2405
|
+
if (onCellKeyDown({
|
|
2406
|
+
mode: "SELECT",
|
|
2407
|
+
row: row2,
|
|
2408
|
+
column: columns[idx],
|
|
2409
|
+
rowIdx,
|
|
2410
|
+
selectCell
|
|
2411
|
+
}, cellEvent), cellEvent.isGridDefaultPrevented()) return;
|
|
328
2412
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
2413
|
+
if (!(event.target instanceof Element)) return;
|
|
2414
|
+
const isCellEvent = event.target.closest(".rdg-cell") !== null, isRowEvent = isTreeGrid && event.target === focusSinkRef.current;
|
|
2415
|
+
if (!isCellEvent && !isRowEvent) return;
|
|
2416
|
+
const {
|
|
2417
|
+
keyCode
|
|
2418
|
+
} = event;
|
|
2419
|
+
if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event)) {
|
|
2420
|
+
if (keyCode === 67) {
|
|
2421
|
+
if (((_a = window.getSelection()) == null ? void 0 : _a.isCollapsed) === !1) return;
|
|
2422
|
+
handleCopy();
|
|
2423
|
+
return;
|
|
333
2424
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
> .cj343x07-0-0-beta-47 {
|
|
338
|
-
border-block-end: 2px solid var(--rdg-summary-border-color);
|
|
2425
|
+
if (keyCode === 86) {
|
|
2426
|
+
handlePaste();
|
|
2427
|
+
return;
|
|
339
2428
|
}
|
|
340
2429
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
2430
|
+
switch (event.key) {
|
|
2431
|
+
case "Escape":
|
|
2432
|
+
setCopiedCell(null);
|
|
2433
|
+
return;
|
|
2434
|
+
case "ArrowUp":
|
|
2435
|
+
case "ArrowDown":
|
|
2436
|
+
case "ArrowLeft":
|
|
2437
|
+
case "ArrowRight":
|
|
2438
|
+
case "Tab":
|
|
2439
|
+
case "Home":
|
|
2440
|
+
case "End":
|
|
2441
|
+
case "PageUp":
|
|
2442
|
+
case "PageDown":
|
|
2443
|
+
navigate(event);
|
|
2444
|
+
break;
|
|
2445
|
+
default:
|
|
2446
|
+
handleCellInput(event);
|
|
2447
|
+
break;
|
|
346
2448
|
}
|
|
347
2449
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
2450
|
+
function handleScroll(event) {
|
|
2451
|
+
const {
|
|
2452
|
+
scrollTop: scrollTop2,
|
|
2453
|
+
scrollLeft: scrollLeft2
|
|
2454
|
+
} = event.currentTarget;
|
|
2455
|
+
flushSync(() => {
|
|
2456
|
+
setScrollTop(scrollTop2), setScrollLeft(abs(scrollLeft2));
|
|
2457
|
+
}), onScroll == null || onScroll(event);
|
|
357
2458
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
z-index: 1;
|
|
2459
|
+
function updateRow(column, rowIdx, row2) {
|
|
2460
|
+
if (typeof onRowsChange != "function" || row2 === rows[rowIdx]) return;
|
|
2461
|
+
const updatedRows = [...rows];
|
|
2462
|
+
updatedRows[rowIdx] = row2, onRowsChange(updatedRows, {
|
|
2463
|
+
indexes: [rowIdx],
|
|
2464
|
+
column
|
|
2465
|
+
});
|
|
366
2466
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
.f1cte0lg7-0-0-beta-47 {
|
|
370
|
-
@layer rdg.FocusSink {
|
|
371
|
-
/* Should have a higher value than 3 to show up above header and summary rows */
|
|
372
|
-
z-index: 3;
|
|
2467
|
+
function commitEditorChanges() {
|
|
2468
|
+
selectedPosition.mode === "EDIT" && updateRow(columns[selectedPosition.idx], selectedPosition.rowIdx, selectedPosition.row);
|
|
373
2469
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
2470
|
+
function handleCopy() {
|
|
2471
|
+
const {
|
|
2472
|
+
idx,
|
|
2473
|
+
rowIdx
|
|
2474
|
+
} = selectedPosition, sourceRow = rows[rowIdx], sourceColumnKey = columns[idx].key;
|
|
2475
|
+
setCopiedCell({
|
|
2476
|
+
row: sourceRow,
|
|
2477
|
+
columnKey: sourceColumnKey
|
|
2478
|
+
}), onCopy == null || onCopy({
|
|
2479
|
+
sourceRow,
|
|
2480
|
+
sourceColumnKey
|
|
2481
|
+
});
|
|
381
2482
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
2483
|
+
function handlePaste() {
|
|
2484
|
+
if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition))
|
|
2485
|
+
return;
|
|
2486
|
+
const {
|
|
2487
|
+
idx,
|
|
2488
|
+
rowIdx
|
|
2489
|
+
} = selectedPosition, targetColumn = columns[idx], targetRow = rows[rowIdx], updatedTargetRow = onPaste({
|
|
2490
|
+
sourceRow: copiedCell.row,
|
|
2491
|
+
sourceColumnKey: copiedCell.columnKey,
|
|
2492
|
+
targetRow,
|
|
2493
|
+
targetColumnKey: targetColumn.key
|
|
2494
|
+
});
|
|
2495
|
+
updateRow(targetColumn, rowIdx, updatedTargetRow);
|
|
390
2496
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
2497
|
+
function handleCellInput(event) {
|
|
2498
|
+
if (!selectedCellIsWithinViewportBounds) return;
|
|
2499
|
+
const row2 = rows[selectedPosition.rowIdx], {
|
|
2500
|
+
key,
|
|
2501
|
+
shiftKey
|
|
2502
|
+
} = event;
|
|
2503
|
+
if (isSelectable && shiftKey && key === " ") {
|
|
2504
|
+
assertIsValidKeyGetter(rowKeyGetter);
|
|
2505
|
+
const rowKey = rowKeyGetter(row2);
|
|
2506
|
+
selectRow({
|
|
2507
|
+
row: row2,
|
|
2508
|
+
checked: !selectedRows.has(rowKey),
|
|
2509
|
+
isShiftClick: !1
|
|
2510
|
+
}), event.preventDefault();
|
|
2511
|
+
return;
|
|
397
2512
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
2513
|
+
isCellEditable(selectedPosition) && isDefaultCellInput(event) && setSelectedPosition(({
|
|
2514
|
+
idx,
|
|
2515
|
+
rowIdx
|
|
2516
|
+
}) => ({
|
|
2517
|
+
idx,
|
|
2518
|
+
rowIdx,
|
|
2519
|
+
mode: "EDIT",
|
|
2520
|
+
row: row2,
|
|
2521
|
+
originalRow: row2
|
|
2522
|
+
}));
|
|
2523
|
+
}
|
|
2524
|
+
function isColIdxWithinSelectionBounds(idx) {
|
|
2525
|
+
return idx >= minColIdx && idx <= maxColIdx;
|
|
2526
|
+
}
|
|
2527
|
+
function isRowIdxWithinViewportBounds(rowIdx) {
|
|
2528
|
+
return rowIdx >= 0 && rowIdx < rows.length;
|
|
2529
|
+
}
|
|
2530
|
+
function isCellWithinSelectionBounds({
|
|
2531
|
+
idx,
|
|
2532
|
+
rowIdx
|
|
2533
|
+
}) {
|
|
2534
|
+
return rowIdx >= minRowIdx && rowIdx <= maxRowIdx && isColIdxWithinSelectionBounds(idx);
|
|
2535
|
+
}
|
|
2536
|
+
function isCellWithinEditBounds({
|
|
2537
|
+
idx,
|
|
2538
|
+
rowIdx
|
|
2539
|
+
}) {
|
|
2540
|
+
return isRowIdxWithinViewportBounds(rowIdx) && idx >= 0 && idx <= maxColIdx;
|
|
2541
|
+
}
|
|
2542
|
+
function isCellWithinViewportBounds({
|
|
2543
|
+
idx,
|
|
2544
|
+
rowIdx
|
|
2545
|
+
}) {
|
|
2546
|
+
return isRowIdxWithinViewportBounds(rowIdx) && isColIdxWithinSelectionBounds(idx);
|
|
2547
|
+
}
|
|
2548
|
+
function isCellEditable(position) {
|
|
2549
|
+
return isCellWithinEditBounds(position) && isSelectedCellEditable({
|
|
2550
|
+
columns,
|
|
2551
|
+
rows,
|
|
2552
|
+
selectedPosition: position
|
|
2553
|
+
});
|
|
2554
|
+
}
|
|
2555
|
+
function selectCell(position, enableEditor) {
|
|
2556
|
+
if (!isCellWithinSelectionBounds(position)) return;
|
|
2557
|
+
commitEditorChanges();
|
|
2558
|
+
const row2 = rows[position.rowIdx], samePosition = isSamePosition(selectedPosition, position);
|
|
2559
|
+
enableEditor && isCellEditable(position) ? setSelectedPosition({
|
|
2560
|
+
...position,
|
|
2561
|
+
mode: "EDIT",
|
|
2562
|
+
row: row2,
|
|
2563
|
+
originalRow: row2
|
|
2564
|
+
}) : samePosition ? scrollIntoView(getCellToScroll(gridRef.current)) : (shouldFocusCellRef.current = !0, setSelectedPosition({
|
|
2565
|
+
...position,
|
|
2566
|
+
mode: "SELECT"
|
|
2567
|
+
})), onSelectedCellChange && !samePosition && onSelectedCellChange({
|
|
2568
|
+
rowIdx: position.rowIdx,
|
|
2569
|
+
row: row2,
|
|
2570
|
+
column: columns[position.idx]
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
function getNextPosition(key, ctrlKey, shiftKey) {
|
|
2574
|
+
const {
|
|
2575
|
+
idx,
|
|
2576
|
+
rowIdx
|
|
2577
|
+
} = selectedPosition, isRowSelected = selectedCellIsWithinSelectionBounds && idx === -1;
|
|
2578
|
+
switch (key) {
|
|
2579
|
+
case "ArrowUp":
|
|
2580
|
+
return {
|
|
2581
|
+
idx,
|
|
2582
|
+
rowIdx: rowIdx - 1
|
|
2583
|
+
};
|
|
2584
|
+
case "ArrowDown":
|
|
2585
|
+
return {
|
|
2586
|
+
idx,
|
|
2587
|
+
rowIdx: rowIdx + 1
|
|
2588
|
+
};
|
|
2589
|
+
case leftKey:
|
|
2590
|
+
return {
|
|
2591
|
+
idx: idx - 1,
|
|
2592
|
+
rowIdx
|
|
2593
|
+
};
|
|
2594
|
+
case rightKey:
|
|
2595
|
+
return {
|
|
2596
|
+
idx: idx + 1,
|
|
2597
|
+
rowIdx
|
|
2598
|
+
};
|
|
2599
|
+
case "Tab":
|
|
2600
|
+
return {
|
|
2601
|
+
idx: idx + (shiftKey ? -1 : 1),
|
|
2602
|
+
rowIdx
|
|
2603
|
+
};
|
|
2604
|
+
case "Home":
|
|
2605
|
+
return isRowSelected ? {
|
|
2606
|
+
idx,
|
|
2607
|
+
rowIdx: minRowIdx
|
|
2608
|
+
} : {
|
|
2609
|
+
idx: 0,
|
|
2610
|
+
rowIdx: ctrlKey ? minRowIdx : rowIdx
|
|
2611
|
+
};
|
|
2612
|
+
case "End":
|
|
2613
|
+
return isRowSelected ? {
|
|
2614
|
+
idx,
|
|
2615
|
+
rowIdx: maxRowIdx
|
|
2616
|
+
} : {
|
|
2617
|
+
idx: maxColIdx,
|
|
2618
|
+
rowIdx: ctrlKey ? maxRowIdx : rowIdx
|
|
2619
|
+
};
|
|
2620
|
+
case "PageUp": {
|
|
2621
|
+
if (selectedPosition.rowIdx === minRowIdx) return selectedPosition;
|
|
2622
|
+
const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight;
|
|
2623
|
+
return {
|
|
2624
|
+
idx,
|
|
2625
|
+
rowIdx: nextRowY > 0 ? findRowIdx(nextRowY) : 0
|
|
2626
|
+
};
|
|
2627
|
+
}
|
|
2628
|
+
case "PageDown": {
|
|
2629
|
+
if (selectedPosition.rowIdx >= rows.length) return selectedPosition;
|
|
2630
|
+
const nextRowY = getRowTop(rowIdx) + clientHeight;
|
|
2631
|
+
return {
|
|
2632
|
+
idx,
|
|
2633
|
+
rowIdx: nextRowY < totalRowHeight ? findRowIdx(nextRowY) : rows.length - 1
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
default:
|
|
2637
|
+
return selectedPosition;
|
|
401
2638
|
}
|
|
402
2639
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
2640
|
+
function navigate(event) {
|
|
2641
|
+
const {
|
|
2642
|
+
key,
|
|
2643
|
+
shiftKey
|
|
2644
|
+
} = event;
|
|
2645
|
+
let cellNavigationMode = "NONE";
|
|
2646
|
+
if (key === "Tab") {
|
|
2647
|
+
if (canExitGrid({
|
|
2648
|
+
shiftKey,
|
|
2649
|
+
maxColIdx,
|
|
2650
|
+
minRowIdx,
|
|
2651
|
+
maxRowIdx,
|
|
2652
|
+
selectedPosition
|
|
2653
|
+
})) {
|
|
2654
|
+
commitEditorChanges();
|
|
2655
|
+
return;
|
|
2656
|
+
}
|
|
2657
|
+
cellNavigationMode = "CHANGE_ROW";
|
|
410
2658
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
2659
|
+
event.preventDefault();
|
|
2660
|
+
const ctrlKey = isCtrlKeyHeldDown(event), nextPosition = getNextPosition(key, ctrlKey, shiftKey);
|
|
2661
|
+
if (isSamePosition(selectedPosition, nextPosition)) return;
|
|
2662
|
+
const nextSelectedCellPosition = getNextSelectedCellPosition({
|
|
2663
|
+
moveUp: key === "ArrowUp",
|
|
2664
|
+
moveNext: key === rightKey || key === "Tab" && !shiftKey,
|
|
2665
|
+
columns,
|
|
2666
|
+
colSpanColumns,
|
|
2667
|
+
rows,
|
|
2668
|
+
topSummaryRows,
|
|
2669
|
+
bottomSummaryRows,
|
|
2670
|
+
minRowIdx,
|
|
2671
|
+
mainHeaderRowIdx,
|
|
2672
|
+
maxRowIdx,
|
|
2673
|
+
lastFrozenColumnIndex,
|
|
2674
|
+
cellNavigationMode,
|
|
2675
|
+
currentPosition: selectedPosition,
|
|
2676
|
+
nextPosition,
|
|
2677
|
+
isCellWithinBounds: isCellWithinSelectionBounds
|
|
2678
|
+
});
|
|
2679
|
+
selectCell(nextSelectedCellPosition);
|
|
2680
|
+
}
|
|
2681
|
+
function getDraggedOverCellIdx(currentRowIdx) {
|
|
2682
|
+
if (draggedOverRowIdx === void 0) return;
|
|
2683
|
+
const {
|
|
2684
|
+
rowIdx
|
|
2685
|
+
} = selectedPosition;
|
|
2686
|
+
return (rowIdx < draggedOverRowIdx ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx) ? selectedPosition.idx : void 0;
|
|
2687
|
+
}
|
|
2688
|
+
function focusCellOrCellContent() {
|
|
2689
|
+
const cell2 = getCellToScroll(gridRef.current);
|
|
2690
|
+
if (cell2 === null) return;
|
|
2691
|
+
scrollIntoView(cell2), (cell2.querySelector('[tabindex="0"]') ?? cell2).focus({
|
|
2692
|
+
preventScroll: !0
|
|
2693
|
+
});
|
|
2694
|
+
}
|
|
2695
|
+
function renderDragHandle() {
|
|
2696
|
+
if (onFill == null || selectedPosition.mode === "EDIT" || !isCellWithinViewportBounds(selectedPosition))
|
|
2697
|
+
return;
|
|
2698
|
+
const {
|
|
2699
|
+
idx,
|
|
2700
|
+
rowIdx
|
|
2701
|
+
} = selectedPosition, column = columns[idx];
|
|
2702
|
+
if (column.renderEditCell == null || column.editable === !1)
|
|
2703
|
+
return;
|
|
2704
|
+
const columnWidth = getColumnWidth(column);
|
|
2705
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DragHandle, {
|
|
2706
|
+
gridRowStart: headerAndTopSummaryRowsCount + rowIdx + 1,
|
|
2707
|
+
rows,
|
|
2708
|
+
column,
|
|
2709
|
+
columnWidth,
|
|
2710
|
+
maxColIdx,
|
|
2711
|
+
isLastRow: rowIdx === maxRowIdx,
|
|
2712
|
+
selectedPosition,
|
|
2713
|
+
isCellEditable,
|
|
2714
|
+
latestDraggedOverRowIdx,
|
|
2715
|
+
onRowsChange,
|
|
2716
|
+
onClick: focusCellOrCellContent,
|
|
2717
|
+
onFill,
|
|
2718
|
+
setDragging,
|
|
2719
|
+
setDraggedOverRowIdx
|
|
2720
|
+
});
|
|
2721
|
+
}
|
|
2722
|
+
function getCellEditor(rowIdx) {
|
|
2723
|
+
if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === "SELECT") return;
|
|
2724
|
+
const {
|
|
2725
|
+
idx,
|
|
2726
|
+
row: row2
|
|
2727
|
+
} = selectedPosition, column = columns[idx], colSpan = getColSpan(column, lastFrozenColumnIndex, {
|
|
2728
|
+
type: "ROW",
|
|
2729
|
+
row: row2
|
|
2730
|
+
}), closeEditor = (shouldFocusCell) => {
|
|
2731
|
+
shouldFocusCellRef.current = shouldFocusCell, setSelectedPosition(({
|
|
2732
|
+
idx: idx2,
|
|
2733
|
+
rowIdx: rowIdx2
|
|
2734
|
+
}) => ({
|
|
2735
|
+
idx: idx2,
|
|
2736
|
+
rowIdx: rowIdx2,
|
|
2737
|
+
mode: "SELECT"
|
|
2738
|
+
}));
|
|
2739
|
+
}, onRowChange = (row3, commitChanges, shouldFocusCell) => {
|
|
2740
|
+
commitChanges ? flushSync(() => {
|
|
2741
|
+
updateRow(column, selectedPosition.rowIdx, row3), closeEditor(shouldFocusCell);
|
|
2742
|
+
}) : setSelectedPosition((position) => ({
|
|
2743
|
+
...position,
|
|
2744
|
+
row: row3
|
|
2745
|
+
}));
|
|
2746
|
+
};
|
|
2747
|
+
return rows[selectedPosition.rowIdx] !== selectedPosition.originalRow && closeEditor(!1), /* @__PURE__ */ jsxRuntimeExports.jsx(EditCell, {
|
|
2748
|
+
column,
|
|
2749
|
+
colSpan,
|
|
2750
|
+
row: row2,
|
|
2751
|
+
rowIdx,
|
|
2752
|
+
onRowChange,
|
|
2753
|
+
closeEditor,
|
|
2754
|
+
onKeyDown: onCellKeyDown,
|
|
2755
|
+
navigate
|
|
2756
|
+
}, column.key);
|
|
2757
|
+
}
|
|
2758
|
+
function getRowViewportColumns(rowIdx) {
|
|
2759
|
+
const selectedColumn = selectedPosition.idx === -1 ? void 0 : columns[selectedPosition.idx];
|
|
2760
|
+
return selectedColumn !== void 0 && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn) ? selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)] : viewportColumns;
|
|
2761
|
+
}
|
|
2762
|
+
function getViewportRows() {
|
|
2763
|
+
const rowElements = [], {
|
|
2764
|
+
idx: selectedIdx,
|
|
2765
|
+
rowIdx: selectedRowIdx
|
|
2766
|
+
} = selectedPosition, startRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx < rowOverscanStartIdx ? rowOverscanStartIdx - 1 : rowOverscanStartIdx, endRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx > rowOverscanEndIdx ? rowOverscanEndIdx + 1 : rowOverscanEndIdx;
|
|
2767
|
+
for (let viewportRowIdx = startRowIdx; viewportRowIdx <= endRowIdx; viewportRowIdx++) {
|
|
2768
|
+
const isRowOutsideViewport = viewportRowIdx === rowOverscanStartIdx - 1 || viewportRowIdx === rowOverscanEndIdx + 1, rowIdx = isRowOutsideViewport ? selectedRowIdx : viewportRowIdx;
|
|
2769
|
+
let rowColumns = viewportColumns;
|
|
2770
|
+
const selectedColumn = selectedIdx === -1 ? void 0 : columns[selectedIdx];
|
|
2771
|
+
selectedColumn !== void 0 && (isRowOutsideViewport ? rowColumns = [selectedColumn] : rowColumns = getRowViewportColumns(rowIdx));
|
|
2772
|
+
const row2 = rows[rowIdx], gridRowStart = headerAndTopSummaryRowsCount + rowIdx + 1;
|
|
2773
|
+
let key = rowIdx, isRowSelected = !1;
|
|
2774
|
+
typeof rowKeyGetter == "function" && (key = rowKeyGetter(row2), isRowSelected = (selectedRows == null ? void 0 : selectedRows.has(key)) ?? !1), rowElements.push(renderRow(key, {
|
|
2775
|
+
"aria-rowindex": headerAndTopSummaryRowsCount + rowIdx + 1,
|
|
2776
|
+
"aria-selected": isSelectable ? isRowSelected : void 0,
|
|
2777
|
+
rowIdx,
|
|
2778
|
+
row: row2,
|
|
2779
|
+
viewportColumns: rowColumns,
|
|
2780
|
+
isRowSelectionDisabled: (isRowSelectionDisabled == null ? void 0 : isRowSelectionDisabled(row2)) ?? !1,
|
|
2781
|
+
isRowSelected,
|
|
2782
|
+
onCellClick: onCellClickLatest,
|
|
2783
|
+
onCellDoubleClick: onCellDoubleClickLatest,
|
|
2784
|
+
onCellContextMenu: onCellContextMenuLatest,
|
|
2785
|
+
rowClass,
|
|
2786
|
+
gridRowStart,
|
|
2787
|
+
copiedCellIdx: copiedCell !== null && copiedCell.row === row2 ? columns.findIndex((c) => c.key === copiedCell.columnKey) : void 0,
|
|
2788
|
+
selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : void 0,
|
|
2789
|
+
draggedOverCellIdx: getDraggedOverCellIdx(rowIdx),
|
|
2790
|
+
setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : void 0,
|
|
2791
|
+
lastFrozenColumnIndex,
|
|
2792
|
+
onRowChange: handleFormatterRowChangeLatest,
|
|
2793
|
+
selectCell: selectCellLatest,
|
|
2794
|
+
selectedCellEditor: getCellEditor(rowIdx)
|
|
2795
|
+
}));
|
|
415
2796
|
}
|
|
2797
|
+
return rowElements;
|
|
416
2798
|
}
|
|
2799
|
+
(selectedPosition.idx > maxColIdx || selectedPosition.rowIdx > maxRowIdx) && (setSelectedPosition({
|
|
2800
|
+
idx: -1,
|
|
2801
|
+
rowIdx: minRowIdx - 1,
|
|
2802
|
+
mode: "SELECT"
|
|
2803
|
+
}), setDraggedOverRowIdx(void 0));
|
|
2804
|
+
let templateRows = `repeat(${headerRowsCount}, ${headerRowHeight}px)`;
|
|
2805
|
+
topSummaryRowsCount > 0 && (templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`), rows.length > 0 && (templateRows += gridTemplateRows), bottomSummaryRowsCount > 0 && (templateRows += ` repeat(${bottomSummaryRowsCount}, ${summaryRowHeight}px)`);
|
|
2806
|
+
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== minRowIdx - 1;
|
|
2807
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
2808
|
+
role,
|
|
2809
|
+
"aria-label": ariaLabel,
|
|
2810
|
+
"aria-labelledby": ariaLabelledBy,
|
|
2811
|
+
"aria-describedby": ariaDescribedBy,
|
|
2812
|
+
"aria-multiselectable": isSelectable ? !0 : void 0,
|
|
2813
|
+
"aria-colcount": columns.length,
|
|
2814
|
+
"aria-rowcount": ariaRowCount,
|
|
2815
|
+
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),
|
|
2816
|
+
style: {
|
|
2817
|
+
...style,
|
|
2818
|
+
scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex || (scrollToPosition == null ? void 0 : scrollToPosition.idx) !== void 0 ? `${totalFrozenColumnWidth}px` : void 0,
|
|
2819
|
+
scrollPaddingBlock: isRowIdxWithinViewportBounds(selectedPosition.rowIdx) || (scrollToPosition == null ? void 0 : scrollToPosition.rowIdx) !== void 0 ? `${headerRowsHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : void 0,
|
|
2820
|
+
gridTemplateColumns,
|
|
2821
|
+
gridTemplateRows: templateRows,
|
|
2822
|
+
"--rdg-header-row-height": `${headerRowHeight}px`,
|
|
2823
|
+
"--rdg-scroll-height": `${scrollHeight}px`,
|
|
2824
|
+
...layoutCssVars
|
|
2825
|
+
},
|
|
2826
|
+
dir: direction,
|
|
2827
|
+
ref: gridRef,
|
|
2828
|
+
onScroll: handleScroll,
|
|
2829
|
+
onKeyDown: handleKeyDown,
|
|
2830
|
+
"data-testid": testId,
|
|
2831
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsxs(DataGridDefaultRenderersProvider, {
|
|
2832
|
+
value: defaultGridComponents,
|
|
2833
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(HeaderRowSelectionChangeProvider, {
|
|
2834
|
+
value: selectHeaderRowLatest,
|
|
2835
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(HeaderRowSelectionProvider, {
|
|
2836
|
+
value: headerSelectionValue,
|
|
2837
|
+
children: [Array.from({
|
|
2838
|
+
length: groupedColumnHeaderRowsCount
|
|
2839
|
+
}, (_, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(GroupedColumnHeaderRow$1, {
|
|
2840
|
+
rowIdx: index + 1,
|
|
2841
|
+
level: -groupedColumnHeaderRowsCount + index,
|
|
2842
|
+
columns: getRowViewportColumns(minRowIdx + index),
|
|
2843
|
+
selectedCellIdx: selectedPosition.rowIdx === minRowIdx + index ? selectedPosition.idx : void 0,
|
|
2844
|
+
selectCell: selectHeaderCellLatest
|
|
2845
|
+
}, index)), /* @__PURE__ */ jsxRuntimeExports.jsx(HeaderRow$1, {
|
|
2846
|
+
rowIdx: headerRowsCount,
|
|
2847
|
+
columns: getRowViewportColumns(mainHeaderRowIdx),
|
|
2848
|
+
onColumnResize: handleColumnResizeLatest,
|
|
2849
|
+
onColumnsReorder: onColumnsReorderLastest,
|
|
2850
|
+
sortColumns,
|
|
2851
|
+
onSortColumnsChange: onSortColumnsChangeLatest,
|
|
2852
|
+
lastFrozenColumnIndex,
|
|
2853
|
+
selectedCellIdx: selectedPosition.rowIdx === mainHeaderRowIdx ? selectedPosition.idx : void 0,
|
|
2854
|
+
selectCell: selectHeaderCellLatest,
|
|
2855
|
+
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
2856
|
+
direction
|
|
2857
|
+
})]
|
|
2858
|
+
})
|
|
2859
|
+
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
|
|
2860
|
+
children: [topSummaryRows == null ? void 0 : topSummaryRows.map((row2, rowIdx) => {
|
|
2861
|
+
const gridRowStart = headerRowsCount + 1 + rowIdx, summaryRowIdx = mainHeaderRowIdx + 1 + rowIdx, isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx, top = headerRowsHeight + summaryRowHeight * rowIdx;
|
|
2862
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryRow$1, {
|
|
2863
|
+
"aria-rowindex": gridRowStart,
|
|
2864
|
+
rowIdx: summaryRowIdx,
|
|
2865
|
+
gridRowStart,
|
|
2866
|
+
row: row2,
|
|
2867
|
+
top,
|
|
2868
|
+
bottom: void 0,
|
|
2869
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
2870
|
+
lastFrozenColumnIndex,
|
|
2871
|
+
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : void 0,
|
|
2872
|
+
isTop: !0,
|
|
2873
|
+
selectCell: selectCellLatest
|
|
2874
|
+
}, rowIdx);
|
|
2875
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(RowSelectionChangeProvider, {
|
|
2876
|
+
value: selectRowLatest,
|
|
2877
|
+
children: getViewportRows()
|
|
2878
|
+
}), bottomSummaryRows == null ? void 0 : bottomSummaryRows.map((row2, rowIdx) => {
|
|
2879
|
+
const gridRowStart = headerAndTopSummaryRowsCount + rows.length + rowIdx + 1, summaryRowIdx = rows.length + rowIdx, isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx, top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : void 0, bottom = top === void 0 ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : void 0;
|
|
2880
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SummaryRow$1, {
|
|
2881
|
+
"aria-rowindex": ariaRowCount - bottomSummaryRowsCount + rowIdx + 1,
|
|
2882
|
+
rowIdx: summaryRowIdx,
|
|
2883
|
+
gridRowStart,
|
|
2884
|
+
row: row2,
|
|
2885
|
+
top,
|
|
2886
|
+
bottom,
|
|
2887
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
2888
|
+
lastFrozenColumnIndex,
|
|
2889
|
+
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : void 0,
|
|
2890
|
+
isTop: !1,
|
|
2891
|
+
selectCell: selectCellLatest
|
|
2892
|
+
}, rowIdx);
|
|
2893
|
+
})]
|
|
2894
|
+
})]
|
|
2895
|
+
}), renderDragHandle(), renderMeasuringCells(viewportColumns), isTreeGrid && /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
2896
|
+
ref: focusSinkRef,
|
|
2897
|
+
tabIndex: isGroupRowFocused ? 0 : -1,
|
|
2898
|
+
className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell], !isRowIdxWithinViewportBounds(selectedPosition.rowIdx) && focusSinkHeaderAndSummaryClassname),
|
|
2899
|
+
style: {
|
|
2900
|
+
gridRowStart: selectedPosition.rowIdx + headerAndTopSummaryRowsCount + 1
|
|
2901
|
+
}
|
|
2902
|
+
}), scrollToPosition !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollToCell, {
|
|
2903
|
+
scrollToPosition,
|
|
2904
|
+
setScrollToCellPosition: setScrollToPosition,
|
|
2905
|
+
gridElement: gridRef.current
|
|
2906
|
+
})]
|
|
2907
|
+
});
|
|
417
2908
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
2909
|
+
function getCellToScroll(gridEl) {
|
|
2910
|
+
return gridEl.querySelector(':scope > [role="row"] > [tabindex="0"]');
|
|
2911
|
+
}
|
|
2912
|
+
function isSamePosition(p1, p2) {
|
|
2913
|
+
return p1.idx === p2.idx && p1.rowIdx === p2.rowIdx;
|
|
2914
|
+
}
|
|
2915
|
+
const DataGrid$1 = /* @__PURE__ */ forwardRef(DataGrid);
|
|
2916
|
+
function useData(widget) {
|
|
2917
|
+
const columns = require$$0$1.useMemo(() => widget.columns(), [widget, widget.dataChecksum()]), data = require$$0$1.useMemo(() => widget.data(), [widget, widget.dataChecksum()]);
|
|
2918
|
+
return [columns, data];
|
|
2919
|
+
}
|
|
2920
|
+
function copyAndSort(items, attribute, descending) {
|
|
2921
|
+
const key = attribute;
|
|
2922
|
+
return [...items].sort((a, b) => a[key] < b[key] ? descending ? 1 : -1 : a[key] > b[key] ? descending ? -1 : 1 : 0);
|
|
2923
|
+
}
|
|
2924
|
+
const EmptyRowsRenderer = ({
|
|
2925
|
+
message
|
|
2926
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { textAlign: "center", gridColumn: "1/-1" }, children: message }), ReactTable = ({
|
|
2927
|
+
table,
|
|
2928
|
+
sort
|
|
2929
|
+
}) => {
|
|
2930
|
+
const [columns, data] = useData(table), multiSelect = table.multiSelect(), columnTypes = table.columnTypes(), columnPatterns = table.columnPatterns(), columnFormats = table.columnFormats(), [listColumns, setListColumns] = useState([]), [sortColumn, setSortColumn] = useState(), [rows, setRows] = useState([]), [selectedRows, setSelectedRows] = useState(/* @__PURE__ */ new Set());
|
|
2931
|
+
useEffect(() => {
|
|
2932
|
+
setListColumns([
|
|
2933
|
+
...multiSelect ? [SelectColumn] : [],
|
|
2934
|
+
...columns.map((column) => {
|
|
2935
|
+
const type = columnTypes[column] ?? "string";
|
|
2936
|
+
let formatter, __hpcc_pattern, __hpcc_format;
|
|
2937
|
+
switch (type) {
|
|
2938
|
+
case "time":
|
|
2939
|
+
__hpcc_pattern = columnPatterns[column] !== void 0 ? timeParse(columnPatterns[column]) : void 0, __hpcc_format = columnFormats[column] !== void 0 ? timeFormat(columnFormats[column]) : void 0;
|
|
2940
|
+
break;
|
|
2941
|
+
case "number":
|
|
2942
|
+
formatter = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { textAlign: "right" }, children: props.row[props.column.key] });
|
|
2943
|
+
// eslint-disable-next-line no-fallthrough
|
|
2944
|
+
default:
|
|
2945
|
+
__hpcc_format = columnFormats[column] !== void 0 ? format(columnFormats[column]) : void 0;
|
|
2946
|
+
}
|
|
2947
|
+
return {
|
|
2948
|
+
key: column,
|
|
2949
|
+
name: column,
|
|
2950
|
+
resizable: !0,
|
|
2951
|
+
sortable: !0,
|
|
2952
|
+
minWidth: 80,
|
|
2953
|
+
renderCell: formatter,
|
|
2954
|
+
__hpcc_pattern,
|
|
2955
|
+
__hpcc_format
|
|
2956
|
+
};
|
|
2957
|
+
})
|
|
2958
|
+
]);
|
|
2959
|
+
}, [columnFormats, columnPatterns, columnTypes, columns, multiSelect]);
|
|
2960
|
+
const onSortColumnsChange = useCallback((sortColumns) => {
|
|
2961
|
+
const futureSortColumn = sortColumns.slice(-1)[0], sorted = futureSortColumn !== void 0, isSortedDescending = (futureSortColumn == null ? void 0 : futureSortColumn.direction) === "DESC";
|
|
2962
|
+
setSortColumn(futureSortColumn), setRows(copyAndSort(rows, sorted ? futureSortColumn.columnKey : "key", sorted ? isSortedDescending : !1));
|
|
2963
|
+
}, [rows]), rowKeyGetter = useCallback((row2) => row2.key, []), onSelectedRowsChange = useCallback((selectedRows2) => {
|
|
2964
|
+
setSelectedRows(selectedRows2);
|
|
2965
|
+
}, []), onCellClick = useCallback((row2, column) => {
|
|
2966
|
+
table.onRowClickCallback(row2, column.key);
|
|
2967
|
+
}, [table]);
|
|
2968
|
+
return useEffect(() => {
|
|
2969
|
+
let items = data.map((row2, index) => {
|
|
2970
|
+
const retVal = {
|
|
2971
|
+
key: index
|
|
2972
|
+
};
|
|
2973
|
+
return listColumns.forEach((column, index2) => {
|
|
2974
|
+
let val = row2[index2];
|
|
2975
|
+
column.__hpcc_pattern && column.__hpcc_format ? val = column.__hpcc_format(column.__hpcc_pattern(val)) : column.__hpcc_pattern ? val = column.__hpcc_pattern(val).toString() : column.__hpcc_format && (val = column.__hpcc_format(val)), retVal[column.key] = val;
|
|
2976
|
+
}), retVal;
|
|
2977
|
+
});
|
|
2978
|
+
sort != null && sort.attribute && (items = copyAndSort(items, sort.attribute, sort.descending)), setRows(items);
|
|
2979
|
+
}, [listColumns, data, sort]), /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2980
|
+
DataGrid$1,
|
|
2981
|
+
{
|
|
2982
|
+
columns: listColumns,
|
|
2983
|
+
headerRowHeight: 24,
|
|
2984
|
+
rows,
|
|
2985
|
+
rowKeyGetter,
|
|
2986
|
+
rowHeight: 20,
|
|
2987
|
+
renderers: { noRowsFallback: /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyRowsRenderer, { message: table.noDataMessage() }) },
|
|
2988
|
+
className: table.darkMode() ? "rdg-dark" : "rdg-light",
|
|
2989
|
+
sortColumns: sortColumn ? [sortColumn] : [],
|
|
2990
|
+
onSortColumnsChange,
|
|
2991
|
+
selectedRows,
|
|
2992
|
+
onSelectedRowsChange: multiSelect ? onSelectedRowsChange : void 0,
|
|
2993
|
+
onCellClick: multiSelect ? void 0 : (args, event) => onCellClick(args.row, args.column),
|
|
2994
|
+
"aria-describedby": "",
|
|
2995
|
+
"aria-label": "",
|
|
2996
|
+
"aria-labelledby": "",
|
|
2997
|
+
style: { height: "100%" }
|
|
445
2998
|
}
|
|
2999
|
+
);
|
|
3000
|
+
};
|
|
3001
|
+
class Table extends HTMLWidget {
|
|
3002
|
+
constructor() {
|
|
3003
|
+
super();
|
|
3004
|
+
__publicField(this, "_div");
|
|
3005
|
+
__publicField(this, "_root");
|
|
3006
|
+
__publicField(this, "_component");
|
|
3007
|
+
__publicField(this, "_prevRow");
|
|
3008
|
+
__publicField(this, "_prevColumn");
|
|
3009
|
+
}
|
|
3010
|
+
columnType(column, type) {
|
|
3011
|
+
return arguments.length === 1 ? this.columnTypes()[column] : (this.columnTypes({ ...this.columnTypes(), [column]: type }), this);
|
|
3012
|
+
}
|
|
3013
|
+
columnPattern(column, pattern) {
|
|
3014
|
+
return arguments.length === 1 ? this.columnPatterns()[column] : (this.columnPatterns({ ...this.columnPatterns(), [column]: pattern }), this);
|
|
3015
|
+
}
|
|
3016
|
+
columnFormat(column, format2) {
|
|
3017
|
+
return arguments.length === 1 ? this.columnFormats()[column] : (this.columnFormats({ ...this.columnFormats(), [column]: format2 }), this);
|
|
3018
|
+
}
|
|
3019
|
+
onRowClickCallback(row2, column) {
|
|
3020
|
+
this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row2) && this.click(this._prevRow, this._prevColumn ?? "", !1), row2 && this.click(row2, column, !0), this._prevRow = row2, this._prevColumn = column;
|
|
3021
|
+
}
|
|
3022
|
+
enter(domNode, element) {
|
|
3023
|
+
super.enter(domNode, element), this._div = element.append("div").style("display", "grid"), this._root = clientExports.createRoot(this._div.node(), { identifierPrefix: this.id() }), this._component = createElement(ReactTable, { table: this });
|
|
3024
|
+
}
|
|
3025
|
+
update(domNode, element) {
|
|
3026
|
+
super.update(domNode, element), this._div.style("width", this.width() + "px"), this._div.style("height", this.height() + "px"), this._root.render(this._component);
|
|
3027
|
+
}
|
|
3028
|
+
exit(domNode, element) {
|
|
3029
|
+
this._div.remove(), super.exit(domNode, element);
|
|
3030
|
+
}
|
|
3031
|
+
// Events ---
|
|
3032
|
+
click(row2, col, sel) {
|
|
446
3033
|
}
|
|
447
3034
|
}
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
3035
|
+
Table.prototype._class += " dgrid2_Table";
|
|
3036
|
+
Table.prototype.publish("noDataMessage", "...empty...", "string", "No Data Message");
|
|
3037
|
+
Table.prototype.publish("darkMode", !1, "boolean", "Dark Mode");
|
|
3038
|
+
Table.prototype.publish("multiSelect", !1, "boolean", "Multiple Selection");
|
|
3039
|
+
Table.prototype.publish("columnTypes", {}, "object", 'Column Types ("boolean" | "number" | "string" | "time"');
|
|
3040
|
+
Table.prototype.publish("columnPatterns", {}, "object", "Column Patterns");
|
|
3041
|
+
Table.prototype.publish("columnFormats", {}, "object", "Column Formats");
|
|
3042
|
+
export {
|
|
3043
|
+
BUILD_VERSION,
|
|
3044
|
+
PKG_NAME,
|
|
3045
|
+
PKG_VERSION,
|
|
3046
|
+
Table
|
|
3047
|
+
};
|
|
459
3048
|
//# sourceMappingURL=index.js.map
|