@hpcc-js/dgrid2 2.1.0 → 2.1.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.es6.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { publish, HTMLWidget } from '@hpcc-js/common';
2
2
 
3
3
  var PKG_NAME = "@hpcc-js/dgrid2";
4
- var PKG_VERSION = "2.1.0";
5
- var BUILD_VERSION = "2.103.0";
4
+ var PKG_VERSION = "2.1.1";
5
+ var BUILD_VERSION = "2.103.1";
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -56,13 +56,11 @@ function __spreadArray(to, from, pack) {
56
56
  return to.concat(ar || Array.prototype.slice.call(from));
57
57
  }
58
58
 
59
- var n,l$1,u$1,t$1,o$2,r$1,f$1,e$2={},c$1=[],s$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a$1(n,l){for(var u in l)n[u]=l[u];return n}function h$1(n){var l=n.parentNode;l&&l.removeChild(n);}function v$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y$1(l,f,t,o,null)}function y$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function d$1(n){return n.children}function _$1(n,l){this.props=n,this.context=l;}function k$1(n,l){if(null==l)return n.__?k$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k$1(n):null}function b$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b$1(n)}}function m$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$2.__r++||r$1!==l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$2)(g$2);}function g$2(){for(var n;g$2.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a$1({},t)).__v=t.__v+1,j$2(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k$1(t):o,t.__h),z$1(u,t),t.__e!=o&&b$1(t)));});}function w$2(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c$1,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y$1(null,_,null,null,_):Array.isArray(_)?y$1(d$1,{children:_},null,null,null):_.__b>0?y$1(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j$2(n,_,p=p||e$2,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x$2(_,s,n):s=P$1(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k$1(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k$1(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M$1(g[h],g[++h],g[++h]);}function x$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x$2(i,l,u):P$1(u,i,i,t,i.__e,l));return l}function A$2(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A$2(n,l);}):l.push(n)),l}function P$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H$1(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s$1.test(l)?u:u+"px";}function H$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$2(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l$1.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _$1(m,x),h.constructor=P,h.render=O$1),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a$1({},h.__s)),a$1(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l$1.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a$1(a$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d$1&&null==s.key?s.props.children:s,w$2(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L$1(i.__e,u,i,t,o,r,f,c);(s=l$1.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L$1(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||e$2).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w$2(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k$1(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h$1(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H$1(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H$1(l,"checked",_,y.checked,!1));}return l}function M$1(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M$1(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h$1(n.__e),n.__e=n.__d=void 0;}function O$1(n,l,u){return this.constructor(n,u)}function S$1(u,i,t){var o,r,f;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j$2(i,u=(!o&&t||i).__k=v$1(d$1,null,[u]),r||e$2,e$2,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z$1(f,u);}function D(n,l){var u={__c:l="__cC"+f$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,_$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a$1({},this.state),"function"==typeof n&&(n=n(a$1({},u),this.props)),n&&a$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m$1(this));},_$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m$1(this));},_$1.prototype.render=d$1,t$1=[],o$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g$2.__r=0,f$1=0;
59
+ var n,l$1,u$1,t$1,o$2,r$1,f$1,e$2={},c$1=[],s$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a$1(n,l){for(var u in l)n[u]=l[u];return n}function h$1(n){var l=n.parentNode;l&&l.removeChild(n);}function v$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y$1(l,f,t,o,null)}function y$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function d$1(n){return n.children}function _$1(n,l){this.props=n,this.context=l;}function k$1(n,l){if(null==l)return n.__?k$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k$1(n):null}function b$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b$1(n)}}function m$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$2.__r++||r$1!==l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$2)(g$2);}function g$2(){for(var n;g$2.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a$1({},t)).__v=t.__v+1,j$2(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k$1(t):o,t.__h),z$1(u,t),t.__e!=o&&b$1(t)));});}function w$2(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c$1,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y$1(null,_,null,null,_):Array.isArray(_)?y$1(d$1,{children:_},null,null,null):_.__b>0?y$1(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j$2(n,_,p=p||e$2,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x$2(_,s,n):s=P$1(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k$1(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k$1(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M$1(g[h],g[++h],g[++h]);}function x$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x$2(i,l,u):P$1(u,i,i,t,i.__e,l));return l}function A$2(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A$2(n,l);}):l.push(n)),l}function P$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H$1(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s$1.test(l)?u:u+"px";}function H$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I$1,o):n.removeEventListener(l,o?T$1:I$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I$1(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$2(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l$1.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _$1(m,x),h.constructor=P,h.render=O$1),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a$1({},h.__s)),a$1(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l$1.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a$1(a$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d$1&&null==s.key?s.props.children:s,w$2(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L$1(i.__e,u,i,t,o,r,f,c);(s=l$1.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L$1(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||e$2).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w$2(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k$1(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h$1(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H$1(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H$1(l,"checked",_,y.checked,!1));}return l}function M$1(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M$1(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h$1(n.__e),n.__e=n.__d=void 0;}function O$1(n,l,u){return this.constructor(n,u)}function S$1(u,i,t){var o,r,f;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j$2(i,u=(!o&&t||i).__k=v$1(d$1,null,[u]),r||e$2,e$2,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z$1(f,u);}function D$1(n,l){var u={__c:l="__cC"+f$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,_$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a$1({},this.state),"function"==typeof n&&(n=n(a$1({},u),this.props)),n&&a$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m$1(this));},_$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m$1(this));},_$1.prototype.render=d$1,t$1=[],o$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g$2.__r=0,f$1=0;
60
60
 
61
- var o$1=0;function e$1(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o$1,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
61
+ var t,u,r,o$1=0,i=[],c=l$1.__b,f=l$1.__r,e$1=l$1.diffed,a=l$1.__c,v=l$1.unmount;function l(t,r){l$1.__h&&l$1.__h(u,t,o$1||r),o$1=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function m(n){return o$1=1,p(w$1,n)}function p(n,r,o){var i=l(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=l(t++,3);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function d(r,o){var i=l(t++,4);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function h(n){return o$1=5,_(function(){return {current:n}},[])}function s(n,t,u){o$1=6,d(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n));}function _(n,u){var r=l(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o$1=8,_(function(){return n},t)}function F(n){var r=u.context[n.__c],o=l(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x$1(){for(var t;t=i.shift();)if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,c&&c(n);},l$1.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},l$1.diffed=function(t){e$1&&e$1(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===l$1.requestAnimationFrame||((r=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),a&&a(t,u);},l$1.unmount=function(t){v&&v(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{g$1(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
62
62
 
63
- var t,u,r,o=0,i=[],c=l$1.__b,f=l$1.__r,e=l$1.diffed,a=l$1.__c,v=l$1.unmount;function l(t,r){l$1.__h&&l$1.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function m(n){return o=1,p(w$1,n)}function p(n,r,o){var i=l(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=l(t++,3);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function d(r,o){var i=l(t++,4);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function h(n){return o=5,_(function(){return {current:n}},[])}function s(n,t,u){o=6,d(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n));}function _(n,u){var r=l(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o=8,_(function(){return n},t)}function F(n){var r=u.context[n.__c],o=l(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x$1(){for(var t;t=i.shift();)if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,c&&c(n);},l$1.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},l$1.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===l$1.requestAnimationFrame||((r=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),a&&a(t,u);},l$1.unmount=function(t){v&&v(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{g$1(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
64
-
65
- function C(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,v$1(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new _$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t){var e=C({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A=l$1.__e;l$1.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);A(n,t,e,r);};var O=l$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function M(){this.u=null,this.o=null;}l$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new _$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&v$1(d$1,null,n.fallback);return u&&(u.__h=null),[v$1(d$1,null,t.__e?null:n.children),u]};var T=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(M.prototype=new _$1).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),T(t,n,r)):u();};e?e(o):o();}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=A$2(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){T(n,e,t);});};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,j="undefined"!=typeof document,z=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function B(n,t,e){return null==t.__k&&(t.textContent=""),S$1(n,t),"function"==typeof e&&e(),n?n.__c:null}_$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(_$1.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=l$1.event;function Z(){}function Y(){return this.cancelBubble}function q(){return this.defaultPrevented}l$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=q,n.nativeEvent=n};var J={configurable:!0,get:function(){return this.class}},K=l$1.vnode;l$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){var u=-1===t.indexOf("-");for(var o in r={},e){var i=e[o];j&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in e&&null==i||("defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!z(e.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():u&&V.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),r[o]=i);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r,e.class!=e.className&&(J.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",J));}n.$$typeof=P,K&&K(n);};var Q=l$1.__r;l$1.__r=function(n){Q&&Q(n);};function un(n){return !!n.__k&&(S$1(null,n),!0)}
63
+ function C(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,v$1(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new _$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t){var e=C({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A=l$1.__e;l$1.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);A(n,t,e,r);};var O=l$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function M(){this.u=null,this.o=null;}l$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new _$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&v$1(d$1,null,n.fallback);return u&&(u.__h=null),[v$1(d$1,null,t.__e?null:n.children),u]};var T=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function D(n){return this.getChildContext=function(){return n.context},n.children}function I(n){var t=this,e=n.i;t.componentWillUnmount=function(){S$1(null,t.l),t.l=null,t.i=null;},t.i&&t.i!==e&&t.componentWillUnmount(),n.__v?(t.l||(t.i=e,t.l={nodeType:1,parentNode:e,childNodes:[],appendChild:function(n){this.childNodes.push(n),t.i.appendChild(n);},insertBefore:function(n,e){this.childNodes.push(n),t.i.appendChild(n);},removeChild:function(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t.i.removeChild(n);}}),S$1(v$1(D,{context:t.context},n.__v),t.l)):t.l&&t.componentWillUnmount();}function W(n,t){return v$1(I,{__v:n,i:t})}(M.prototype=new _$1).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),T(t,n,r)):u();};e?e(o):o();}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=A$2(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){T(n,e,t);});};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,j="undefined"!=typeof document,z=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function B(n,t,e){return null==t.__k&&(t.textContent=""),S$1(n,t),"function"==typeof e&&e(),n?n.__c:null}_$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(_$1.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=l$1.event;function Z(){}function Y(){return this.cancelBubble}function q(){return this.defaultPrevented}l$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=q,n.nativeEvent=n};var J={configurable:!0,get:function(){return this.class}},K=l$1.vnode;l$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){var u=-1===t.indexOf("-");for(var o in r={},e){var i=e[o];j&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in e&&null==i||("defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!z(e.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():u&&V.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),r[o]=i);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r,e.class!=e.className&&(J.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",J));}n.$$typeof=P,K&&K(n);};var Q=l$1.__r;l$1.__r=function(n){Q&&Q(n);};function un(n){return !!n.__k&&(S$1(null,n),!0)}
66
64
 
67
65
  function toVal(mix) {
68
66
  var k, y, str='';
@@ -105,6 +103,8 @@ function clsx () {
105
103
  return str;
106
104
  }
107
105
 
106
+ var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
107
+
108
108
  function styleInject$1(css, ref) {
109
109
  if ( ref === void 0 ) ref = {};
110
110
  var insertAt = ref.insertAt;
@@ -132,118 +132,110 @@ function styleInject$1(css, ref) {
132
132
  }
133
133
  }
134
134
 
135
- var css_248z$f = ".c1wupbe700-beta11{background-color:inherit;border-block-end:1px solid var(--rdg-border-color);border-inline-end:1px solid var(--rdg-border-color);contain:strict;contain:size layout style paint;grid-row-start:var(--rdg-grid-row-start);outline:none;overflow:hidden;overflow:clip;padding-block:0;padding-inline:8px;text-overflow:ellipsis;white-space:nowrap}.c1wupbe700-beta11[aria-selected=true]{box-shadow:inset 0 0 0 2px var(--rdg-selection-color)}.cd0kgiy700-beta11 .c1wupbe700-beta11{contain:content}.c1730fa4700-beta11{position:sticky;z-index:1}.c9dpaye700-beta11{box-shadow:var(--rdg-frozen-cell-box-shadow)}";
136
- styleInject$1(css_248z$f,{"insertAt":"top"});
135
+ var css_248z$b = ".c1wupbe700-canary49{contain:strict;contain:size layout style paint;padding:0 8px;border-right:1px solid var(--border-color);border-bottom:1px solid var(--border-color);background-color:inherit;white-space:nowrap;overflow:hidden;overflow:clip;text-overflow:ellipsis}.c1wupbe700-canary49[aria-selected=true]{box-shadow:inset 0 0 0 2px var(--selection-color)}.cd0kgiy700-canary49{position:sticky;z-index:1}.c1730fa4700-canary49{box-shadow:2px 0 5px -2px hsla(0,0%,53.3%,.3)}";
136
+ styleInject$1(css_248z$b);
137
137
 
138
- const cell = "c1wupbe700-beta11";
138
+ const cell = "c1wupbe700-canary49";
139
139
  const cellClassname = `rdg-cell ${cell}`;
140
- const cellAutoResizeClassname = "cd0kgiy700-beta11";
141
- const cellFrozen = "c1730fa4700-beta11";
140
+ const cellFrozen = "cd0kgiy700-canary49";
142
141
  const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
143
- const cellFrozenLast = "c9dpaye700-beta11";
142
+ const cellFrozenLast = "c1730fa4700-canary49";
144
143
  const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
145
144
 
146
- var css_248z$e = ".r104f42s700-beta11{--rdg-color:#000;--rdg-border-color:#ddd;--rdg-summary-border-color:#aaa;--rdg-background-color:#fff;--rdg-header-background-color:#f9f9f9;--rdg-row-hover-background-color:#f5f5f5;--rdg-row-selected-background-color:#dbecfa;--row-selected-hover-background-color:#c9e3f8;--rdg-checkbox-color:#005194;--rdg-checkbox-focus-color:#61b8ff;--rdg-checkbox-disabled-border-color:#ccc;--rdg-checkbox-disabled-background-color:#ddd;--rdg-selection-color:#66afe9;--rdg-frozen-cell-box-shadow:calc(2px*var(--rdg-sign)) 0 5px -2px hsla(0,0%,53%,.3);--rdg-font-size:14px;content-visibility:auto;background-color:var(--rdg-background-color);block-size:350px;border:1px solid var(--rdg-border-color);box-sizing:border-box;color:var(--rdg-color);color-scheme:var(--rdg-color-scheme,light dark);contain:strict;contain:size layout style paint;display:grid;font-size:var(--rdg-font-size);overflow:auto;user-select:none}@supports not (contain:strict){.r104f42s700-beta11{position:relative;z-index:0}}.r104f42s700-beta11 *,.r104f42s700-beta11 :after,.r104f42s700-beta11 :before{box-sizing:inherit}.r104f42s700-beta11:before{block-size:var(--rdg-grid-block-size);content:\"\";inline-size:var(--rdg-grid-inline-size);inset-block-start:0;inset-inline-start:0;position:absolute}.r104f42s700-beta11.rdg-dark{--rdg-color-scheme:dark;--rdg-color:#ddd;--rdg-border-color:#444;--rdg-summary-border-color:#555;--rdg-background-color:#212121;--rdg-header-background-color:#1b1b1b;--rdg-row-hover-background-color:#171717;--rdg-row-selected-background-color:#1a73bc;--row-selected-hover-background-color:#1768ab;--rdg-checkbox-color:#94cfff;--rdg-checkbox-focus-color:#c7e6ff;--rdg-checkbox-disabled-border-color:#000;--rdg-checkbox-disabled-background-color:#333}.r104f42s700-beta11.rdg-light{--rdg-color-scheme:light}@media (prefers-color-scheme:dark){.r104f42s700-beta11:not(.rdg-light){--rdg-color:#ddd;--rdg-border-color:#444;--rdg-summary-border-color:#555;--rdg-background-color:#212121;--rdg-header-background-color:#1b1b1b;--rdg-row-hover-background-color:#171717;--rdg-row-selected-background-color:#1a73bc;--row-selected-hover-background-color:#1768ab;--rdg-checkbox-color:#94cfff;--rdg-checkbox-focus-color:#c7e6ff;--rdg-checkbox-disabled-border-color:#000;--rdg-checkbox-disabled-background-color:#333}}.v7ly7s700-beta11.r1otpg64700-beta11{cursor:move}.fc4f4zb700-beta11{grid-column-start:1;inset-inline-start:0;position:sticky}";
147
- styleInject$1(css_248z$e,{"insertAt":"top"});
145
+ var css_248z$a = ".r104f42s700-canary49{--color:#000;--border-color:#ddd;--summary-border-color:#aaa;--background-color:hsl(0deg 0% 100%);--header-background-color:hsl(0deg 0% 97.5%);--row-hover-background-color:hsl(0deg 0% 96%);--row-selected-background-color:hsl(207deg 76% 92%);--row-selected-hover-background-color:hsl(207deg 76% 88%);--checkbox-color:hsl(207deg 100% 29%);--checkbox-focus-color:hsl(207deg 100% 69%);--checkbox-disabled-border-color:#ccc;--checkbox-disabled-background-color:#ddd;--selection-color:#66afe9;--font-size:14px;contain:strict;contain:size layout style paint;content-visibility:auto;height:350px;border:1px solid var(--border-color);box-sizing:border-box;overflow:auto;user-select:none;background-color:var(--background-color);color:var(--color);font-size:var(--font-size)}@supports not (contain:strict){.r104f42s700-canary49{position:relative;z-index:0}}.r104f42s700-canary49 *,.r104f42s700-canary49 :after,.r104f42s700-canary49 :before{box-sizing:inherit}.r104f42s700-canary49.rdg-dark{--color:#ddd;--border-color:#444;--summary-border-color:#555;--background-color:hsl(0deg 0% 13%);--header-background-color:hsl(0deg 0% 10.5%);--row-hover-background-color:hsl(0deg 0% 9%);--row-selected-background-color:hsl(207deg 76% 42%);--row-selected-hover-background-color:hsl(207deg 76% 38%);--checkbox-color:hsl(207deg 100% 79%);--checkbox-focus-color:hsl(207deg 100% 89%);--checkbox-disabled-border-color:#000;--checkbox-disabled-background-color:#333}@media (prefers-color-scheme:dark){.r104f42s700-canary49:not(.rdg-light){--color:#ddd;--border-color:#444;--summary-border-color:#555;--background-color:hsl(0deg 0% 13%);--header-background-color:hsl(0deg 0% 10.5%);--row-hover-background-color:hsl(0deg 0% 9%);--row-selected-background-color:hsl(207deg 76% 42%);--row-selected-hover-background-color:hsl(207deg 76% 38%);--checkbox-color:hsl(207deg 100% 79%);--checkbox-focus-color:hsl(207deg 100% 89%);--checkbox-disabled-border-color:#000;--checkbox-disabled-background-color:#333}}.f7ly7s700-canary49{position:sticky;top:0;left:0;height:0;width:0;outline:0}.vc4f4zb700-canary49.r1otpg64700-canary49{cursor:move}";
146
+ styleInject$1(css_248z$a);
148
147
 
149
- const root = "r104f42s700-beta11";
148
+ const root = "r104f42s700-canary49";
150
149
  const rootClassname = `rdg ${root}`;
151
- const viewportDragging = "v7ly7s700-beta11";
150
+ const focusSink = "f7ly7s700-canary49";
151
+ const focusSinkClassname = `rdg-focus-sink ${focusSink}`;
152
+ const viewportDragging = "vc4f4zb700-canary49";
152
153
  const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
153
- const focusSinkClassname = "fc4f4zb700-beta11";
154
154
 
155
- var css_248z$d = ".r1otpg64700-beta11{background-color:var(--rdg-background-color);display:contents;line-height:var(--rdg-row-height)}.r1otpg64700-beta11:hover{background-color:var(--rdg-row-hover-background-color)}.r1otpg64700-beta11[aria-selected=true]{background-color:var(--rdg-row-selected-background-color)}.r1otpg64700-beta11[aria-selected=true]:hover{background-color:var(--row-selected-hover-background-color)}.rel5gk2700-beta11{outline:none}.rel5gk2700-beta11>.c1wupbe700-beta11{box-shadow:inset 0 2px 0 0 var(--rdg-selection-color),inset 0 -2px 0 0 var(--rdg-selection-color)}.rel5gk2700-beta11>.c1wupbe700-beta11:first-child{box-shadow:inset 0 2px 0 0 var(--rdg-selection-color),inset 0 -2px 0 0 var(--rdg-selection-color),inset calc(2px*var(--rdg-sign)) 0 0 0 var(--rdg-selection-color)}.rel5gk2700-beta11>.c1wupbe700-beta11:last-child{box-shadow:inset 0 2px 0 0 var(--rdg-selection-color),inset 0 -2px 0 0 var(--rdg-selection-color),inset calc(-2px*var(--rdg-sign)) 0 0 0 var(--rdg-selection-color)}.rel5gk2700-beta11>.c9dpaye700-beta11{box-shadow:inset 0 2px 0 0 var(--rdg-selection-color),inset 0 -2px 0 0 var(--rdg-selection-color),var(--rdg-frozen-cell-box-shadow)}";
156
- styleInject$1(css_248z$d,{"insertAt":"top"});
155
+ var css_248z$9 = ".g1cvx5us700-canary49:not([aria-selected=true]){background-color:var(--header-background-color)}.g1cvx5us700-canary49>.c1wupbe700-canary49:not(:last-child):not(.c1730fa4700-canary49){border-right:none}.g1j2w62i700-canary49:after{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;box-shadow:inset 0 0 0 2px var(--selection-color);pointer-events:none;z-index:2}.g1j2w62i700-canary49>.c1wupbe700-canary49:first-child{box-shadow:inset 2px 0 0 0 var(--selection-color)}";
156
+ styleInject$1(css_248z$9);
157
157
 
158
- const row = "r1otpg64700-beta11";
159
- const rowClassname = `rdg-row ${row}`;
160
- const rowSelected = "rel5gk2700-beta11";
161
- const rowSelectedClassname = `rdg-row-selected ${rowSelected}`;
158
+ const groupRow = "g1cvx5us700-canary49";
159
+ const groupRowClassname = `rdg-group-row ${groupRow}`;
160
+ const groupRowSelected = "g1j2w62i700-canary49";
161
+ const groupRowSelectedClassname = `rdg-group-row-selected ${groupRowSelected}`;
162
162
 
163
- var css_248z$c = ".cd9l4jz700-beta11{align-items:center;cursor:pointer;display:flex;inset:0;justify-content:center;margin-inline-end:1px;position:absolute}.c1noyk41700-beta11{all:unset}.cdwjxv8700-beta11{background-color:var(--rdg-background-color);block-size:20px;border:2px solid var(--rdg-border-color);content:\"\";inline-size:20px}.c1noyk41700-beta11:checked+.cdwjxv8700-beta11{background-color:var(--rdg-checkbox-color);box-shadow:inset 0 0 0 4px var(--rdg-background-color)}.c1noyk41700-beta11:focus+.cdwjxv8700-beta11{border-color:var(--rdg-checkbox-focus-color)}.cca4mwn700-beta11{cursor:default}.cca4mwn700-beta11 .cdwjxv8700-beta11{background-color:var(--rdg-checkbox-disabled-background-color);border-color:var(--rdg-checkbox-disabled-border-color)}";
164
- styleInject$1(css_248z$c,{"insertAt":"top"});
163
+ var css_248z$8 = ".h1fquj5h700-canary49{contain:strict;contain:size layout style paint;display:grid;grid-template-columns:var(--template-columns);grid-template-rows:var(--header-row-height);height:var(--header-row-height);line-height:var(--header-row-height);width:var(--row-width);position:sticky;top:0;background-color:var(--header-background-color);font-weight:700;z-index:3;touch-action:none}";
164
+ styleInject$1(css_248z$8);
165
165
 
166
- const checkboxLabel = "cd9l4jz700-beta11";
167
- const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
168
- const checkboxInput = "c1noyk41700-beta11";
169
- const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
170
- const checkbox = "cdwjxv8700-beta11";
171
- const checkboxClassname = `rdg-checkbox ${checkbox}`;
172
- const checkboxLabelDisabled = "cca4mwn700-beta11";
173
- const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
174
- const CheckboxFormatter = /*#__PURE__*/x(function CheckboxFormatter({
175
- onChange,
176
- ...props
177
- }, ref) {
178
- function handleChange(e) {
179
- onChange(e.target.checked, e.nativeEvent.shiftKey);
180
- }
166
+ const headerRow = "h1fquj5h700-canary49";
167
+ const headerRowClassname = `rdg-header-row ${headerRow}`;
181
168
 
182
- return /*#__PURE__*/e$1("label", {
183
- className: clsx(checkboxLabelClassname, props.disabled && checkboxLabelDisabledClassname),
184
- children: [/*#__PURE__*/e$1("input", {
185
- type: "checkbox",
186
- ref: ref,
187
- ...props,
188
- className: checkboxInputClassname,
189
- onChange: handleChange
190
- }), /*#__PURE__*/e$1("div", {
191
- className: checkboxClassname
192
- })]
193
- });
194
- });
169
+ var css_248z$7 = ".r1otpg64700-canary49{contain:strict;contain:size layout style paint;display:grid;grid-template-rows:var(--row-height);grid-template-columns:var(--template-columns);position:absolute;left:0;width:var(--row-width);height:var(--row-height);line-height:var(--row-height);background-color:var(--background-color)}.r1otpg64700-canary49:hover{background-color:var(--row-hover-background-color)}.r1otpg64700-canary49[aria-selected=true]{background-color:var(--row-selected-background-color)}.r1otpg64700-canary49[aria-selected=true]:hover{background-color:var(--row-selected-hover-background-color)}.sel5gk2700-canary49{position:sticky;z-index:3;grid-template-rows:var(--summary-row-height);height:var(--summary-row-height);line-height:var(--summary-row-height)}.sel5gk2700-canary49>.c1wupbe700-canary49{border-top:2px solid var(--summary-border-color)}";
170
+ styleInject$1(css_248z$7);
195
171
 
196
- const useLayoutEffect = typeof window === 'undefined' ? y : d;
172
+ const row = "r1otpg64700-canary49";
173
+ const rowClassname = `rdg-row ${row}`;
174
+ const summaryRow = "sel5gk2700-canary49";
175
+ const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
197
176
 
198
- function useFocusRef(isSelected) {
177
+ function useFocusRef(isCellSelected) {
199
178
  const ref = h(null);
200
- useLayoutEffect(() => {
179
+ d(() => {
201
180
  var _ref$current;
202
181
 
203
- if (!isSelected) return;
182
+ if (!isCellSelected) return;
204
183
  (_ref$current = ref.current) == null ? void 0 : _ref$current.focus({
205
184
  preventScroll: true
206
185
  });
207
- }, [isSelected]);
208
- return {
209
- ref,
210
- tabIndex: isSelected ? 0 : -1
211
- };
186
+ }, [isCellSelected]);
187
+ return ref;
212
188
  }
213
189
 
214
- const DataGridDefaultComponentsContext = /*#__PURE__*/D(undefined);
215
- const DataGridDefaultComponentsProvider = DataGridDefaultComponentsContext.Provider;
216
- function useDefaultComponents() {
217
- return F(DataGridDefaultComponentsContext);
218
- }
190
+ var css_248z$6 = ".c1w6d5eo700-canary49{cursor:pointer;display:flex;align-items:center;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;margin-right:1px}.c1h7iz8d700-canary49{all:unset;width:0;margin:0}.cc79ydj700-canary49{content:\"\";width:20px;height:20px;border:2px solid var(--border-color);background-color:var(--background-color)}.c1h7iz8d700-canary49:checked+.cc79ydj700-canary49{background-color:var(--checkbox-color);box-shadow:inset 0 0 0 4px var(--background-color)}.c1h7iz8d700-canary49:focus+.cc79ydj700-canary49{border-color:var(--checkbox-focus-color)}.c1e5jt0b700-canary49{cursor:default}.c1e5jt0b700-canary49 .cc79ydj700-canary49{border-color:var(--checkbox-disabled-border-color);background-color:var(--checkbox-disabled-background-color)}";
191
+ styleInject$1(css_248z$6);
219
192
 
193
+ const checkboxLabel = "c1w6d5eo700-canary49";
194
+ const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
195
+ const checkboxInput = "c1h7iz8d700-canary49";
196
+ const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
197
+ const checkbox = "cc79ydj700-canary49";
198
+ const checkboxClassname = `rdg-checkbox ${checkbox}`;
199
+ const checkboxLabelDisabled = "c1e5jt0b700-canary49";
200
+ const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
220
201
  function SelectCellFormatter({
221
202
  value,
203
+ tabIndex,
222
204
  isCellSelected,
223
205
  disabled,
206
+ onClick,
224
207
  onChange,
225
208
  'aria-label': ariaLabel,
226
209
  'aria-labelledby': ariaLabelledBy
227
210
  }) {
228
- const {
229
- ref,
230
- tabIndex
231
- } = useFocusRef(isCellSelected);
232
- const Formatter = useDefaultComponents().checkboxFormatter;
233
- return /*#__PURE__*/e$1(Formatter, {
234
- "aria-label": ariaLabel,
235
- "aria-labelledby": ariaLabelledBy,
236
- ref: ref,
237
- tabIndex: tabIndex,
238
- disabled: disabled,
239
- checked: value,
240
- onChange: onChange
211
+ const inputRef = useFocusRef(isCellSelected);
212
+
213
+ function handleChange(e) {
214
+ onChange(e.target.checked, e.nativeEvent.shiftKey);
215
+ }
216
+
217
+ return /*#__PURE__*/e("label", {
218
+ className: clsx(checkboxLabelClassname, disabled && checkboxLabelDisabledClassname),
219
+ children: [/*#__PURE__*/e("input", {
220
+ "aria-label": ariaLabel,
221
+ "aria-labelledby": ariaLabelledBy,
222
+ tabIndex: tabIndex,
223
+ ref: inputRef,
224
+ type: "checkbox",
225
+ className: checkboxInputClassname,
226
+ disabled: disabled,
227
+ checked: value,
228
+ onChange: handleChange,
229
+ onClick: onClick
230
+ }), /*#__PURE__*/e("div", {
231
+ className: checkboxClassname
232
+ })]
241
233
  });
242
234
  }
243
235
 
244
236
  function ValueFormatter(props) {
245
237
  try {
246
- return /*#__PURE__*/e$1(d$1, {
238
+ return /*#__PURE__*/e(d$1, {
247
239
  children: props.row[props.column.key]
248
240
  });
249
241
  } catch {
@@ -251,12 +243,12 @@ function ValueFormatter(props) {
251
243
  }
252
244
  }
253
245
 
254
- var css_248z$b = ".gch972y700-beta11{outline:none}.cz2qf0d700-beta11{stroke:currentColor;stroke-width:1.5px;fill:transparent;margin-inline-start:4px;vertical-align:middle}.cz2qf0d700-beta11>path{transition:d .1s}";
255
- styleInject$1(css_248z$b,{"insertAt":"top"});
246
+ var css_248z$5 = ".gch972y700-canary49{outline:none}.cz2qf0d700-canary49{margin-left:4px;stroke:currentColor;stroke-width:1.5px;fill:transparent;vertical-align:middle}.cz2qf0d700-canary49>path{transition:d .1s}";
247
+ styleInject$1(css_248z$5);
256
248
 
257
- const groupCellContent = "gch972y700-beta11";
249
+ const groupCellContent = "gch972y700-canary49";
258
250
  const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
259
- const caret = "cz2qf0d700-beta11";
251
+ const caret = "cz2qf0d700-canary49";
260
252
  const caretClassname = `rdg-caret ${caret}`;
261
253
  function ToggleGroupFormatter({
262
254
  groupKey,
@@ -264,10 +256,7 @@ function ToggleGroupFormatter({
264
256
  isCellSelected,
265
257
  toggleGroup
266
258
  }) {
267
- const {
268
- ref,
269
- tabIndex
270
- } = useFocusRef(isCellSelected);
259
+ const cellRef = useFocusRef(isCellSelected);
271
260
 
272
261
  function handleKeyDown({
273
262
  key
@@ -278,95 +267,23 @@ function ToggleGroupFormatter({
278
267
  }
279
268
 
280
269
  const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';
281
- return /*#__PURE__*/e$1("span", {
282
- ref: ref,
270
+ return /*#__PURE__*/e("span", {
271
+ ref: cellRef,
283
272
  className: groupCellContentClassname,
284
- tabIndex: tabIndex,
273
+ tabIndex: -1,
285
274
  onKeyDown: handleKeyDown,
286
- children: [groupKey, /*#__PURE__*/e$1("svg", {
275
+ children: [groupKey, /*#__PURE__*/e("svg", {
287
276
  viewBox: "0 0 14 8",
288
277
  width: "14",
289
278
  height: "8",
290
279
  className: caretClassname,
291
- "aria-hidden": true,
292
- children: /*#__PURE__*/e$1("path", {
280
+ children: /*#__PURE__*/e("path", {
293
281
  d: d
294
282
  })
295
283
  })]
296
284
  });
297
285
  }
298
286
 
299
- const RowSelectionContext = /*#__PURE__*/D(undefined);
300
- const RowSelectionProvider = RowSelectionContext.Provider;
301
- const RowSelectionChangeContext = /*#__PURE__*/D(undefined);
302
- const RowSelectionChangeProvider = RowSelectionChangeContext.Provider;
303
- function useRowSelection() {
304
- const rowSelectionContext = F(RowSelectionContext);
305
- const rowSelectionChangeContext = F(RowSelectionChangeContext);
306
-
307
- if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {
308
- throw new Error('useRowSelection must be used within DataGrid cells');
309
- }
310
-
311
- return [rowSelectionContext, rowSelectionChangeContext];
312
- }
313
-
314
- const SELECT_COLUMN_KEY = 'select-row';
315
-
316
- function SelectFormatter(props) {
317
- const [isRowSelected, onRowSelectionChange] = useRowSelection();
318
- return /*#__PURE__*/e$1(SelectCellFormatter, {
319
- "aria-label": "Select",
320
- isCellSelected: props.isCellSelected,
321
- value: isRowSelected,
322
- onChange: (checked, isShiftClick) => {
323
- onRowSelectionChange({
324
- row: props.row,
325
- checked,
326
- isShiftClick
327
- });
328
- }
329
- });
330
- }
331
-
332
- function SelectGroupFormatter(props) {
333
- const [isRowSelected, onRowSelectionChange] = useRowSelection();
334
- return /*#__PURE__*/e$1(SelectCellFormatter, {
335
- "aria-label": "Select Group",
336
- isCellSelected: props.isCellSelected,
337
- value: isRowSelected,
338
- onChange: checked => {
339
- onRowSelectionChange({
340
- row: props.row,
341
- checked,
342
- isShiftClick: false
343
- });
344
- }
345
- });
346
- }
347
-
348
- const SelectColumn = {
349
- key: SELECT_COLUMN_KEY,
350
- name: '',
351
- width: 35,
352
- maxWidth: 35,
353
- resizable: false,
354
- sortable: false,
355
- frozen: true,
356
-
357
- headerRenderer(props) {
358
- return /*#__PURE__*/e$1(SelectCellFormatter, {
359
- "aria-label": "Select All",
360
- isCellSelected: props.isCellSelected,
361
- value: props.allRowsSelected,
362
- onChange: props.onAllRowsSelectionChange
363
- });
364
- },
365
-
366
- formatter: SelectFormatter,
367
- groupFormatter: SelectGroupFormatter
368
- };
369
-
370
287
  function getColSpan(column, lastFrozenColumnIndex, args) {
371
288
  const colSpan = typeof column.colSpan === 'function' ? column.colSpan(args) : 1;
372
289
 
@@ -377,6 +294,10 @@ function getColSpan(column, lastFrozenColumnIndex, args) {
377
294
  return undefined;
378
295
  }
379
296
 
297
+ function stopPropagation(event) {
298
+ event.stopPropagation();
299
+ }
300
+
380
301
  const nonInputKeys = 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']);
381
302
  function isCtrlKeyHeldDown(e) {
382
303
  return (e.ctrlKey || e.metaKey) && e.key !== 'Control';
@@ -408,134 +329,100 @@ function isSelectedCellEditable({
408
329
  function isCellEditable(column, row) {
409
330
  return column.editor != null && !column.rowGroup && (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false;
410
331
  }
411
- function getSelectedCellColSpan({
412
- rows,
413
- summaryRows,
414
- rowIdx,
415
- lastFrozenColumnIndex,
416
- column,
417
- isGroupRow
418
- }) {
419
- if (rowIdx === -1) {
420
- return getColSpan(column, lastFrozenColumnIndex, {
421
- type: 'HEADER'
422
- });
423
- }
424
-
425
- if (rowIdx >= 0 && rowIdx < rows.length) {
426
- const row = rows[rowIdx];
427
-
428
- if (!isGroupRow(row)) {
429
- return getColSpan(column, lastFrozenColumnIndex, {
430
- type: 'ROW',
431
- row
432
- });
433
- }
434
-
435
- return undefined;
436
- }
437
-
438
- if (summaryRows) {
439
- return getColSpan(column, lastFrozenColumnIndex, {
440
- type: 'SUMMARY',
441
- row: summaryRows[rowIdx - rows.length]
442
- });
443
- }
444
-
445
- return undefined;
446
- }
447
332
  function getNextSelectedCellPosition({
448
333
  cellNavigationMode,
449
334
  columns,
450
335
  colSpanColumns,
451
336
  rows,
452
- summaryRows,
453
- minRowIdx,
454
- maxRowIdx,
455
- currentPosition: {
456
- idx: currentIdx
457
- },
337
+ currentPosition,
458
338
  nextPosition,
459
339
  lastFrozenColumnIndex,
460
340
  isCellWithinBounds,
461
341
  isGroupRow
462
342
  }) {
463
- let {
464
- idx: nextIdx,
465
- rowIdx: nextRowIdx
466
- } = nextPosition;
343
+ const rowsCount = rows.length;
344
+ let position = nextPosition;
467
345
 
468
346
  const setColSpan = moveRight => {
469
- if (nextRowIdx >= 0 && nextRowIdx < rows.length) {
470
- const row = rows[nextRowIdx];
471
- if (isGroupRow(row)) return;
472
- }
347
+ const row = rows[position.rowIdx];
473
348
 
474
- for (const column of colSpanColumns) {
475
- const colIdx = column.idx;
476
- if (colIdx > nextIdx) break;
477
- const colSpan = getSelectedCellColSpan({
478
- rows,
479
- summaryRows,
480
- rowIdx: nextRowIdx,
481
- lastFrozenColumnIndex,
482
- column,
483
- isGroupRow
484
- });
349
+ if (!isGroupRow(row)) {
350
+ const posIdx = position.idx;
485
351
 
486
- if (colSpan && nextIdx > colIdx && nextIdx < colSpan + colIdx) {
487
- nextIdx = colIdx + (moveRight ? colSpan : 0);
488
- break;
352
+ for (const column of colSpanColumns) {
353
+ const colIdx = column.idx;
354
+ if (colIdx > posIdx) break;
355
+ const colSpan = getColSpan(column, lastFrozenColumnIndex, {
356
+ type: 'ROW',
357
+ row
358
+ });
359
+
360
+ if (colSpan && posIdx > colIdx && posIdx < colSpan + colIdx) {
361
+ position.idx = colIdx + (moveRight ? colSpan : 0);
362
+ break;
363
+ }
489
364
  }
490
365
  }
491
366
  };
492
367
 
493
- if (isCellWithinBounds(nextPosition)) {
494
- setColSpan(nextIdx - currentIdx > 0);
368
+ if (isCellWithinBounds(position)) {
369
+ setColSpan(position.idx - currentPosition.idx > 0);
495
370
  }
496
371
 
497
372
  if (cellNavigationMode !== 'NONE') {
373
+ const {
374
+ idx,
375
+ rowIdx
376
+ } = nextPosition;
498
377
  const columnsCount = columns.length;
499
- const isAfterLastColumn = nextIdx === columnsCount;
500
- const isBeforeFirstColumn = nextIdx === -1;
378
+ const isAfterLastColumn = idx === columnsCount;
379
+ const isBeforeFirstColumn = idx === -1;
501
380
 
502
381
  if (isAfterLastColumn) {
503
382
  if (cellNavigationMode === 'CHANGE_ROW') {
504
- const isLastRow = nextRowIdx === maxRowIdx;
383
+ const isLastRow = rowIdx === rowsCount - 1;
505
384
 
506
385
  if (!isLastRow) {
507
- nextIdx = 0;
508
- nextRowIdx += 1;
386
+ position = {
387
+ idx: 0,
388
+ rowIdx: rowIdx + 1
389
+ };
509
390
  }
510
391
  } else {
511
- nextIdx = 0;
392
+ position = {
393
+ rowIdx,
394
+ idx: 0
395
+ };
512
396
  }
397
+
398
+ setColSpan(true);
513
399
  } else if (isBeforeFirstColumn) {
514
400
  if (cellNavigationMode === 'CHANGE_ROW') {
515
- const isFirstRow = nextRowIdx === minRowIdx;
401
+ const isFirstRow = rowIdx === 0;
516
402
 
517
403
  if (!isFirstRow) {
518
- nextRowIdx -= 1;
519
- nextIdx = columnsCount - 1;
404
+ position = {
405
+ rowIdx: rowIdx - 1,
406
+ idx: columnsCount - 1
407
+ };
520
408
  }
521
409
  } else {
522
- nextIdx = columnsCount - 1;
410
+ position = {
411
+ rowIdx,
412
+ idx: columnsCount - 1
413
+ };
523
414
  }
524
-
525
- setColSpan(false);
526
415
  }
416
+
417
+ setColSpan(false);
527
418
  }
528
419
 
529
- return {
530
- idx: nextIdx,
531
- rowIdx: nextRowIdx
532
- };
420
+ return position;
533
421
  }
534
422
  function canExitGrid({
535
423
  cellNavigationMode,
536
- maxColIdx,
537
- minRowIdx,
538
- maxRowIdx,
424
+ columns,
425
+ rowsCount,
539
426
  selectedPosition: {
540
427
  rowIdx,
541
428
  idx
@@ -543,10 +430,10 @@ function canExitGrid({
543
430
  shiftKey
544
431
  }) {
545
432
  if (cellNavigationMode === 'NONE' || cellNavigationMode === 'CHANGE_ROW') {
546
- const atLastCellInRow = idx === maxColIdx;
433
+ const atLastCellInRow = idx === columns.length - 1;
547
434
  const atFirstCellInRow = idx === 0;
548
- const atLastRow = rowIdx === maxRowIdx;
549
- const atFirstRow = rowIdx === minRowIdx;
435
+ const atLastRow = rowIdx === rowsCount - 1;
436
+ const atFirstRow = rowIdx === 0;
550
437
  return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow;
551
438
  }
552
439
 
@@ -556,39 +443,86 @@ function canExitGrid({
556
443
  const {
557
444
  min,
558
445
  max,
559
- round,
560
446
  floor,
561
- sign,
562
- abs
447
+ ceil,
448
+ sign
563
449
  } = Math;
564
450
  function assertIsValidKeyGetter(keyGetter) {
565
451
  if (typeof keyGetter !== 'function') {
566
452
  throw new Error('Please specify the rowKeyGetter prop to use selection');
567
453
  }
568
454
  }
569
- function getRowStyle(rowIdx, height) {
570
- if (height !== undefined) {
571
- return {
572
- '--rdg-grid-row-start': rowIdx,
573
- '--rdg-row-height': `${height}px`
574
- };
575
- }
576
-
577
- return {
578
- '--rdg-grid-row-start': rowIdx
579
- };
580
- }
581
455
  function getCellStyle(column, colSpan) {
582
456
  return {
583
457
  gridColumnStart: column.idx + 1,
584
458
  gridColumnEnd: colSpan !== undefined ? `span ${colSpan}` : undefined,
585
- insetInlineStart: column.frozen ? `var(--rdg-frozen-left-${column.idx})` : undefined
459
+ left: column.frozen ? `var(--frozen-left-${column.key})` : undefined
586
460
  };
587
461
  }
588
462
  function getCellClassname(column, ...extraClasses) {
589
463
  return clsx(cellClassname, ...extraClasses, column.frozen && cellFrozenClassname, column.isLastFrozenColumn && cellFrozenLastClassname);
590
464
  }
591
465
 
466
+ const SELECT_COLUMN_KEY = 'select-row';
467
+
468
+ function SelectFormatter(props) {
469
+ const [isRowSelected, onRowSelectionChange] = useRowSelection();
470
+ return /*#__PURE__*/e(SelectCellFormatter, {
471
+ "aria-label": "Select",
472
+ tabIndex: -1,
473
+ isCellSelected: props.isCellSelected,
474
+ value: isRowSelected,
475
+ onClick: stopPropagation,
476
+ onChange: (checked, isShiftClick) => {
477
+ onRowSelectionChange({
478
+ rowIdx: props.rowIdx,
479
+ checked,
480
+ isShiftClick
481
+ });
482
+ }
483
+ });
484
+ }
485
+
486
+ function SelectGroupFormatter(props) {
487
+ const [isRowSelected, onRowSelectionChange] = useRowSelection();
488
+ return /*#__PURE__*/e(SelectCellFormatter, {
489
+ "aria-label": "Select Group",
490
+ tabIndex: -1,
491
+ isCellSelected: props.isCellSelected,
492
+ value: isRowSelected,
493
+ onChange: checked => {
494
+ onRowSelectionChange({
495
+ checked,
496
+ isShiftClick: false,
497
+ rowIdx: props.rowIdx
498
+ });
499
+ },
500
+ onClick: stopPropagation
501
+ });
502
+ }
503
+
504
+ const SelectColumn = {
505
+ key: SELECT_COLUMN_KEY,
506
+ name: '',
507
+ width: 35,
508
+ maxWidth: 35,
509
+ resizable: false,
510
+ sortable: false,
511
+ frozen: true,
512
+
513
+ headerRenderer(props) {
514
+ return /*#__PURE__*/e(SelectCellFormatter, {
515
+ "aria-label": "Select All",
516
+ isCellSelected: false,
517
+ value: props.allRowsSelected,
518
+ onChange: props.onAllRowsSelectionChange
519
+ });
520
+ },
521
+
522
+ formatter: SelectFormatter,
523
+ groupFormatter: SelectGroupFormatter
524
+ };
525
+
592
526
  function useCalculatedColumns({
593
527
  rawColumns,
594
528
  columnWidths,
@@ -720,6 +654,9 @@ function useCalculatedColumns({
720
654
  }
721
655
  }
722
656
 
657
+ const unallocatedWidth = viewportWidth - allocatedWidth;
658
+ const unallocatedColumnWidth = unallocatedWidth / unassignedColumnsCount;
659
+
723
660
  for (const column of columns) {
724
661
  let width;
725
662
 
@@ -730,11 +667,7 @@ function useCalculatedColumns({
730
667
  width
731
668
  } = columnMetric);
732
669
  } else {
733
- const unallocatedWidth = viewportWidth - allocatedWidth;
734
- const unallocatedColumnWidth = round(unallocatedWidth / unassignedColumnsCount);
735
670
  width = clampColumnWidth(unallocatedColumnWidth, column, minColumnWidth);
736
- allocatedWidth += width;
737
- unassignedColumnsCount--;
738
671
  columnMetrics.set(column, {
739
672
  width,
740
673
  left
@@ -752,12 +685,12 @@ function useCalculatedColumns({
752
685
  }
753
686
 
754
687
  const layoutCssVars = {
755
- gridTemplateColumns: templateColumns
688
+ '--template-columns': templateColumns
756
689
  };
757
690
 
758
691
  for (let i = 0; i <= lastFrozenColumnIndex; i++) {
759
692
  const column = columns[i];
760
- layoutCssVars[`--rdg-frozen-left-${column.idx}`] = `${columnMetrics.get(column).left}px`;
693
+ layoutCssVars[`--frozen-left-${column.key}`] = `${columnMetrics.get(column).left}px`;
761
694
  }
762
695
 
763
696
  return {
@@ -865,7 +798,7 @@ function useGridDimensions() {
865
798
  const gridRef = h(null);
866
799
  const [gridWidth, setGridWidth] = m(1);
867
800
  const [gridHeight, setGridHeight] = m(1);
868
- useLayoutEffect(() => {
801
+ d(() => {
869
802
  const {
870
803
  ResizeObserver
871
804
  } = window;
@@ -875,7 +808,7 @@ function useGridDimensions() {
875
808
  clientWidth,
876
809
  clientHeight
877
810
  } = gridRef.current;
878
- setGridWidth(clientWidth - (devicePixelRatio % 1 === 0 ? 0 : 1));
811
+ setGridWidth(clientWidth - (devicePixelRatio % 0.5 === 0 ? 0 : 1));
879
812
  setGridHeight(clientHeight);
880
813
  });
881
814
  resizeObserver.observe(gridRef.current);
@@ -896,40 +829,19 @@ function useLatestFunc(fn) {
896
829
  }, []);
897
830
  }
898
831
 
899
- function useRovingCellRef(isSelected) {
900
- const ref = h(null);
901
- const isChildFocused = h(false);
902
- const [, forceRender] = m({});
903
- useLayoutEffect(() => {
904
- var _ref$current;
905
-
906
- if (!isSelected) {
907
- isChildFocused.current = false;
908
- return;
909
- }
910
-
911
- if (isChildFocused.current) {
912
- forceRender({});
913
- return;
914
- }
915
-
916
- (_ref$current = ref.current) == null ? void 0 : _ref$current.focus({
917
- preventScroll: true
918
- });
919
- }, [isSelected]);
832
+ const RowSelectionContext = /*#__PURE__*/D$1(undefined);
833
+ const RowSelectionProvider = RowSelectionContext.Provider;
834
+ const RowSelectionChangeContext = /*#__PURE__*/D$1(undefined);
835
+ const RowSelectionChangeProvider = RowSelectionChangeContext.Provider;
836
+ function useRowSelection() {
837
+ const rowSelectionContext = F(RowSelectionContext);
838
+ const rowSelectionChangeContext = F(RowSelectionChangeContext);
920
839
 
921
- function onFocus(event) {
922
- if (event.target !== ref.current) {
923
- isChildFocused.current = true;
924
- }
840
+ if (rowSelectionContext === undefined || rowSelectionChangeContext === undefined) {
841
+ throw new Error('useRowSelection must be used within DataGrid cells');
925
842
  }
926
843
 
927
- const isFocused = isSelected && !isChildFocused.current;
928
- return {
929
- ref,
930
- tabIndex: isFocused ? 0 : -1,
931
- onFocus
932
- };
844
+ return [rowSelectionContext, rowSelectionChangeContext];
933
845
  }
934
846
 
935
847
  function useViewportColumns({
@@ -1006,6 +918,8 @@ function useViewportColumns({
1006
918
  }, [startIdx, colOverscanEndIdx, columns]);
1007
919
  }
1008
920
 
921
+ const RENDER_BATCH_SIZE = 8;
922
+
1009
923
  function isReadonlyArray(arr) {
1010
924
  return Array.isArray(arr);
1011
925
  }
@@ -1092,7 +1006,6 @@ function useViewportRows({
1092
1006
  }, [expandedGroupIds, groupedRows, rawRows]);
1093
1007
  const {
1094
1008
  totalRowHeight,
1095
- gridTemplateRows,
1096
1009
  getRowTop,
1097
1010
  getRowHeight,
1098
1011
  findRowIdx
@@ -1100,7 +1013,6 @@ function useViewportRows({
1100
1013
  if (typeof rowHeight === 'number') {
1101
1014
  return {
1102
1015
  totalRowHeight: rowHeight * rows.length,
1103
- gridTemplateRows: ` repeat(${rows.length}, ${rowHeight}px)`,
1104
1016
  getRowTop: rowIdx => rowIdx * rowHeight,
1105
1017
  getRowHeight: () => rowHeight,
1106
1018
  findRowIdx: offset => floor(offset / rowHeight)
@@ -1108,7 +1020,6 @@ function useViewportRows({
1108
1020
  }
1109
1021
 
1110
1022
  let totalRowHeight = 0;
1111
- let gridTemplateRows = ' ';
1112
1023
  const rowPositions = rows.map(row => {
1113
1024
  const currentRowHeight = isGroupRow(row) ? rowHeight({
1114
1025
  type: 'GROUP',
@@ -1121,7 +1032,6 @@ function useViewportRows({
1121
1032
  top: totalRowHeight,
1122
1033
  height: currentRowHeight
1123
1034
  };
1124
- gridTemplateRows += `${currentRowHeight}px `;
1125
1035
  totalRowHeight += currentRowHeight;
1126
1036
  return position;
1127
1037
  });
@@ -1132,7 +1042,6 @@ function useViewportRows({
1132
1042
 
1133
1043
  return {
1134
1044
  totalRowHeight,
1135
- gridTemplateRows,
1136
1045
  getRowTop: rowIdx => rowPositions[validateRowIdx(rowIdx)].top,
1137
1046
  getRowHeight: rowIdx => rowPositions[validateRowIdx(rowIdx)].height,
1138
1047
 
@@ -1159,24 +1068,32 @@ function useViewportRows({
1159
1068
 
1160
1069
  };
1161
1070
  }, [isGroupRow, rowHeight, rows]);
1162
- let rowOverscanStartIdx = 0;
1163
- let rowOverscanEndIdx = rows.length - 1;
1164
1071
 
1165
- if (enableVirtualization) {
1166
- const overscanThreshold = 4;
1167
- const rowVisibleStartIdx = findRowIdx(scrollTop);
1168
- const rowVisibleEndIdx = findRowIdx(scrollTop + clientHeight);
1169
- rowOverscanStartIdx = max(0, rowVisibleStartIdx - overscanThreshold);
1170
- rowOverscanEndIdx = min(rows.length - 1, rowVisibleEndIdx + overscanThreshold);
1072
+ if (!enableVirtualization) {
1073
+ return {
1074
+ rowOverscanStartIdx: 0,
1075
+ rowOverscanEndIdx: rows.length - 1,
1076
+ rows,
1077
+ rowsCount,
1078
+ totalRowHeight,
1079
+ isGroupRow,
1080
+ getRowTop,
1081
+ getRowHeight,
1082
+ findRowIdx
1083
+ };
1171
1084
  }
1172
1085
 
1086
+ const overscanThreshold = 4;
1087
+ const rowVisibleStartIdx = findRowIdx(scrollTop);
1088
+ const rowVisibleEndIdx = min(rows.length - 1, findRowIdx(scrollTop + clientHeight));
1089
+ const rowOverscanStartIdx = max(0, floor((rowVisibleStartIdx - overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE);
1090
+ const rowOverscanEndIdx = min(rows.length - 1, ceil((rowVisibleEndIdx + overscanThreshold) / RENDER_BATCH_SIZE) * RENDER_BATCH_SIZE);
1173
1091
  return {
1174
1092
  rowOverscanStartIdx,
1175
1093
  rowOverscanEndIdx,
1176
1094
  rows,
1177
1095
  rowsCount,
1178
1096
  totalRowHeight,
1179
- gridTemplateRows,
1180
1097
  isGroupRow,
1181
1098
  getRowTop,
1182
1099
  getRowHeight,
@@ -1184,107 +1101,53 @@ function useViewportRows({
1184
1101
  };
1185
1102
  }
1186
1103
 
1187
- var css_248z$a = ".h1tr5c9i700-beta11{cursor:pointer;display:flex}.h1tr5c9i700-beta11:focus{outline:none}.h19r0msv700-beta11{flex-grow:1;overflow:hidden;overflow:clip;text-overflow:ellipsis}";
1188
- styleInject$1(css_248z$a,{"insertAt":"top"});
1104
+ var css_248z$4 = ".h13yq3r8700-canary49{cursor:pointer;display:flex}.ht6rdyl700-canary49{flex-grow:1;overflow:hidden;overflow:clip;text-overflow:ellipsis}";
1105
+ styleInject$1(css_248z$4);
1189
1106
 
1190
- const headerSortCell = "h1tr5c9i700-beta11";
1107
+ const headerSortCell = "h13yq3r8700-canary49";
1191
1108
  const headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;
1192
- const headerSortName = "h19r0msv700-beta11";
1109
+ const headerSortName = "ht6rdyl700-canary49";
1193
1110
  const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
1194
- function HeaderRenderer({
1195
- column,
1111
+ function SortableHeaderCell({
1112
+ onSort,
1196
1113
  sortDirection,
1197
1114
  priority,
1198
- onSort,
1199
- isCellSelected
1115
+ children
1200
1116
  }) {
1201
- if (!column.sortable) return /*#__PURE__*/e$1(d$1, {
1202
- children: column.name
1203
- });
1204
- return /*#__PURE__*/e$1(SortableHeaderCell, {
1205
- onSort: onSort,
1206
- sortDirection: sortDirection,
1207
- priority: priority,
1208
- isCellSelected: isCellSelected,
1209
- children: column.name
1210
- });
1211
- }
1212
-
1213
- function SortableHeaderCell({
1214
- onSort,
1215
- sortDirection,
1216
- priority,
1217
- children,
1218
- isCellSelected
1219
- }) {
1220
- const SortIcon = useDefaultComponents().sortIcon;
1221
- const {
1222
- ref,
1223
- tabIndex
1224
- } = useFocusRef(isCellSelected);
1225
-
1226
- function handleKeyDown(event) {
1227
- if (event.key === ' ' || event.key === 'Enter') {
1228
- event.preventDefault();
1229
- onSort(event.ctrlKey || event.metaKey);
1230
- }
1231
- }
1117
+ let sortText = '';
1232
1118
 
1233
- function handleClick(event) {
1234
- onSort(event.ctrlKey || event.metaKey);
1119
+ if (sortDirection === 'ASC') {
1120
+ sortText = '\u25B2';
1121
+ } else if (sortDirection === 'DESC') {
1122
+ sortText = '\u25BC';
1235
1123
  }
1236
1124
 
1237
- return /*#__PURE__*/e$1("span", {
1238
- ref: ref,
1239
- tabIndex: tabIndex,
1125
+ return /*#__PURE__*/e("span", {
1240
1126
  className: headerSortCellClassname,
1241
- onClick: handleClick,
1242
- onKeyDown: handleKeyDown,
1243
- children: [/*#__PURE__*/e$1("span", {
1127
+ onClick: e => onSort(e.ctrlKey),
1128
+ children: [/*#__PURE__*/e("span", {
1244
1129
  className: headerSortNameClassname,
1245
1130
  children: children
1246
- }), /*#__PURE__*/e$1("span", {
1247
- children: [/*#__PURE__*/e$1(SortIcon, {
1248
- sortDirection: sortDirection
1249
- }), priority]
1131
+ }), /*#__PURE__*/e("span", {
1132
+ children: [sortText, priority]
1250
1133
  })]
1251
1134
  });
1252
1135
  }
1253
1136
 
1254
- var css_248z$9 = ".celq7o9700-beta11{touch-action:none}.celq7o9700-beta11:after{content:\"\";cursor:col-resize;inline-size:10px;inset-block-end:0;inset-block-start:0;inset-inline-end:0;position:absolute}";
1255
- styleInject$1(css_248z$9,{"insertAt":"top"});
1137
+ var css_248z$3 = ".celq7o9700-canary49:after{content:\"\";cursor:col-resize;position:absolute;top:0;right:0;bottom:0;width:10px}";
1138
+ styleInject$1(css_248z$3);
1256
1139
 
1257
- const cellResizable = "celq7o9700-beta11";
1140
+ const cellResizable = "celq7o9700-canary49";
1258
1141
  const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
1259
1142
  function HeaderCell({
1260
1143
  column,
1261
1144
  colSpan,
1262
- isCellSelected,
1263
- onColumnResize,
1145
+ onResize,
1264
1146
  allRowsSelected,
1265
1147
  onAllRowsSelectionChange,
1266
1148
  sortColumns,
1267
- onSortColumnsChange,
1268
- selectCell,
1269
- shouldFocusGrid,
1270
- direction
1149
+ onSortColumnsChange
1271
1150
  }) {
1272
- var _column$headerRendere, _column$minWidth, _column$maxWidth;
1273
-
1274
- const isRtl = direction === 'rtl';
1275
- const {
1276
- ref,
1277
- tabIndex,
1278
- onFocus
1279
- } = useRovingCellRef(isCellSelected);
1280
- const sortIndex = sortColumns == null ? void 0 : sortColumns.findIndex(sort => sort.columnKey === column.key);
1281
- const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined;
1282
- const sortDirection = sortColumn == null ? void 0 : sortColumn.direction;
1283
- const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;
1284
- const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;
1285
- const className = getCellClassname(column, column.headerCellClass, column.resizable && cellResizableClassname);
1286
- const HeaderRenderer$1 = (_column$headerRendere = column.headerRenderer) != null ? _column$headerRendere : HeaderRenderer;
1287
-
1288
1151
  function onPointerDown(event) {
1289
1152
  if (event.pointerType === 'mouse' && event.buttons !== 1) {
1290
1153
  return;
@@ -1295,38 +1158,47 @@ function HeaderCell({
1295
1158
  pointerId
1296
1159
  } = event;
1297
1160
  const {
1298
- right,
1299
- left
1161
+ right
1300
1162
  } = currentTarget.getBoundingClientRect();
1301
- const offset = isRtl ? event.clientX - left : right - event.clientX;
1163
+ const offset = right - event.clientX;
1302
1164
 
1303
1165
  if (offset > 11) {
1304
1166
  return;
1305
1167
  }
1306
1168
 
1307
1169
  function onPointerMove(event) {
1308
- const {
1309
- right,
1310
- left
1311
- } = currentTarget.getBoundingClientRect();
1312
- const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
1170
+ if (event.pointerId !== pointerId) return;
1171
+
1172
+ if (event.pointerType === 'mouse' && event.buttons !== 1) {
1173
+ onPointerUp(event);
1174
+ return;
1175
+ }
1176
+
1177
+ const width = event.clientX + offset - currentTarget.getBoundingClientRect().left;
1313
1178
 
1314
1179
  if (width > 0) {
1315
- onColumnResize(column, width);
1180
+ onResize(column, width);
1316
1181
  }
1317
1182
  }
1318
1183
 
1319
- function onLostPointerCapture() {
1320
- currentTarget.removeEventListener('pointermove', onPointerMove);
1321
- currentTarget.removeEventListener('lostpointercapture', onLostPointerCapture);
1184
+ function onPointerUp(event) {
1185
+ if (event.pointerId !== pointerId) return;
1186
+ window.removeEventListener('pointermove', onPointerMove);
1187
+ window.removeEventListener('pointerup', onPointerUp);
1322
1188
  }
1323
1189
 
1324
- currentTarget.setPointerCapture(pointerId);
1325
- currentTarget.addEventListener('pointermove', onPointerMove);
1326
- currentTarget.addEventListener('lostpointercapture', onLostPointerCapture);
1190
+ event.preventDefault();
1191
+ window.addEventListener('pointermove', onPointerMove);
1192
+ window.addEventListener('pointerup', onPointerUp);
1327
1193
  }
1328
1194
 
1329
- function onSort(ctrlClick) {
1195
+ const sortIndex = sortColumns == null ? void 0 : sortColumns.findIndex(sort => sort.columnKey === column.key);
1196
+ const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined;
1197
+ const sortDirection = sortColumn == null ? void 0 : sortColumn.direction;
1198
+ const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;
1199
+ const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;
1200
+
1201
+ const onSort = ctrlClick => {
1330
1202
  if (onSortColumnsChange == null) return;
1331
1203
  const {
1332
1204
  sortDescendingFirst
@@ -1362,82 +1234,62 @@ function HeaderCell({
1362
1234
  onSortColumnsChange(nextSortColumn ? [nextSortColumn] : []);
1363
1235
  }
1364
1236
  }
1365
- }
1366
-
1367
- function onClick() {
1368
- selectCell(column.idx);
1369
- }
1370
-
1371
- function onDoubleClick(event) {
1372
- const {
1373
- right,
1374
- left
1375
- } = event.currentTarget.getBoundingClientRect();
1376
- const offset = isRtl ? event.clientX - left : right - event.clientX;
1237
+ };
1377
1238
 
1378
- if (offset > 11) {
1379
- return;
1239
+ function getCell() {
1240
+ if (column.headerRenderer) {
1241
+ return /*#__PURE__*/e(column.headerRenderer, {
1242
+ column: column,
1243
+ sortDirection: sortDirection,
1244
+ priority: priority,
1245
+ onSort: onSort,
1246
+ allRowsSelected: allRowsSelected,
1247
+ onAllRowsSelectionChange: onAllRowsSelectionChange
1248
+ });
1380
1249
  }
1381
1250
 
1382
- onColumnResize(column, 'auto');
1383
- }
1384
-
1385
- function handleFocus(event) {
1386
- onFocus(event);
1387
-
1388
- if (shouldFocusGrid) {
1389
- selectCell(0);
1251
+ if (column.sortable) {
1252
+ return /*#__PURE__*/e(SortableHeaderCell, {
1253
+ onSort: onSort,
1254
+ sortDirection: sortDirection,
1255
+ priority: priority,
1256
+ children: column.name
1257
+ });
1390
1258
  }
1259
+
1260
+ return column.name;
1391
1261
  }
1392
1262
 
1393
- return /*#__PURE__*/e$1("div", {
1263
+ const className = getCellClassname(column, column.headerCellClass, column.resizable && cellResizableClassname);
1264
+ return /*#__PURE__*/e("div", {
1394
1265
  role: "columnheader",
1395
1266
  "aria-colindex": column.idx + 1,
1396
- "aria-selected": isCellSelected,
1397
1267
  "aria-sort": ariaSort,
1398
1268
  "aria-colspan": colSpan,
1399
- ref: ref,
1400
- tabIndex: shouldFocusGrid ? 0 : tabIndex,
1401
1269
  className: className,
1402
- style: { ...getCellStyle(column, colSpan),
1403
- minWidth: (_column$minWidth = column.minWidth) != null ? _column$minWidth : undefined,
1404
- maxWidth: (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : undefined
1405
- },
1406
- onFocus: handleFocus,
1407
- onClick: onClick,
1408
- onDoubleClick: column.resizable ? onDoubleClick : undefined,
1270
+ style: getCellStyle(column, colSpan),
1409
1271
  onPointerDown: column.resizable ? onPointerDown : undefined,
1410
- children: /*#__PURE__*/e$1(HeaderRenderer$1, {
1411
- column: column,
1412
- sortDirection: sortDirection,
1413
- priority: priority,
1414
- onSort: onSort,
1415
- allRowsSelected: allRowsSelected,
1416
- onAllRowsSelectionChange: onAllRowsSelectionChange,
1417
- isCellSelected: isCellSelected
1418
- })
1272
+ children: getCell()
1419
1273
  });
1420
1274
  }
1421
1275
 
1422
- var css_248z$8 = ".h197vzie700-beta11{background-color:var(--rdg-header-background-color);display:contents;font-weight:700;line-height:var(--rdg-header-row-height)}.h197vzie700-beta11>.c1wupbe700-beta11{inset-block-start:0;position:sticky;z-index:2}.h197vzie700-beta11>.c1730fa4700-beta11{z-index:3}";
1423
- styleInject$1(css_248z$8,{"insertAt":"top"});
1424
-
1425
- const headerRow = "h197vzie700-beta11";
1426
- const headerRowClassname = `rdg-header-row ${headerRow}`;
1427
-
1428
1276
  function HeaderRow({
1429
1277
  columns,
1278
+ rows,
1279
+ rowKeyGetter,
1280
+ onSelectedRowsChange,
1430
1281
  allRowsSelected,
1431
- onAllRowsSelectionChange,
1432
1282
  onColumnResize,
1433
1283
  sortColumns,
1434
1284
  onSortColumnsChange,
1435
- lastFrozenColumnIndex,
1436
- selectedCellIdx,
1437
- selectCell,
1438
- shouldFocusGrid,
1439
- direction
1285
+ lastFrozenColumnIndex
1440
1286
  }) {
1287
+ const handleAllRowsSelectionChange = A$1(checked => {
1288
+ if (!onSelectedRowsChange) return;
1289
+ assertIsValidKeyGetter(rowKeyGetter);
1290
+ const newSelectedRows = new Set(checked ? rows.map(rowKeyGetter) : undefined);
1291
+ onSelectedRowsChange(newSelectedRows);
1292
+ }, [onSelectedRowsChange, rows, rowKeyGetter]);
1441
1293
  const cells = [];
1442
1294
 
1443
1295
  for (let index = 0; index < columns.length; index++) {
@@ -1450,152 +1302,225 @@ function HeaderRow({
1450
1302
  index += colSpan - 1;
1451
1303
  }
1452
1304
 
1453
- cells.push( /*#__PURE__*/e$1(HeaderCell, {
1305
+ cells.push( /*#__PURE__*/e(HeaderCell, {
1454
1306
  column: column,
1455
1307
  colSpan: colSpan,
1456
- isCellSelected: selectedCellIdx === column.idx,
1457
- onColumnResize: onColumnResize,
1308
+ onResize: onColumnResize,
1458
1309
  allRowsSelected: allRowsSelected,
1459
- onAllRowsSelectionChange: onAllRowsSelectionChange,
1310
+ onAllRowsSelectionChange: handleAllRowsSelectionChange,
1460
1311
  onSortColumnsChange: onSortColumnsChange,
1461
- sortColumns: sortColumns,
1462
- selectCell: selectCell,
1463
- shouldFocusGrid: shouldFocusGrid && index === 0,
1464
- direction: direction
1312
+ sortColumns: sortColumns
1465
1313
  }, column.key));
1466
1314
  }
1467
1315
 
1468
- return /*#__PURE__*/e$1("div", {
1316
+ return /*#__PURE__*/e("div", {
1469
1317
  role: "row",
1470
1318
  "aria-rowindex": 1,
1471
- className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
1472
- style: getRowStyle(1),
1319
+ className: headerRowClassname,
1473
1320
  children: cells
1474
1321
  });
1475
1322
  }
1476
1323
 
1477
1324
  const HeaderRow$1 = /*#__PURE__*/g(HeaderRow);
1478
1325
 
1479
- var css_248z$7 = ".c1bmg16t700-beta11,.ccpfvsn700-beta11{background-color:#ccf}.c1bmg16t700-beta11.ccpfvsn700-beta11{background-color:#99f}";
1480
- styleInject$1(css_248z$7,{"insertAt":"top"});
1326
+ var css_248z$2 = ".c1bmg16t700-canary49,.ccpfvsn700-canary49{background-color:#ccf}.c1bmg16t700-canary49.ccpfvsn700-canary49{background-color:#99f}.c12t67zz700-canary49{cursor:move;position:absolute;right:0;bottom:0;width:8px;height:8px;background-color:var(--selection-color)}.c12t67zz700-canary49:hover{width:16px;height:16px;border:2px solid var(--selection-color);background-color:var(--background-color)}";
1327
+ styleInject$1(css_248z$2);
1481
1328
 
1482
- const cellCopied = "ccpfvsn700-beta11";
1329
+ const cellCopied = "ccpfvsn700-canary49";
1483
1330
  const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
1484
- const cellDraggedOver = "c1bmg16t700-beta11";
1331
+ const cellDraggedOver = "c1bmg16t700-canary49";
1485
1332
  const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
1333
+ const cellDragHandle = "c12t67zz700-canary49";
1334
+ const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
1486
1335
 
1487
1336
  function Cell({
1337
+ className,
1488
1338
  column,
1489
1339
  colSpan,
1490
1340
  isCellSelected,
1491
1341
  isCopied,
1492
1342
  isDraggedOver,
1493
1343
  row,
1494
- dragHandle,
1344
+ rowIdx,
1345
+ dragHandleProps,
1495
1346
  onRowClick,
1496
- onRowDoubleClick,
1347
+ onClick,
1348
+ onDoubleClick,
1349
+ onContextMenu,
1497
1350
  onRowChange,
1498
1351
  selectCell,
1499
1352
  ...props
1500
- }) {
1501
- const {
1502
- ref,
1503
- tabIndex,
1504
- onFocus
1505
- } = useRovingCellRef(isCellSelected);
1353
+ }, ref) {
1506
1354
  const {
1507
1355
  cellClass
1508
1356
  } = column;
1509
- const className = getCellClassname(column, typeof cellClass === 'function' ? cellClass(row) : cellClass, isCopied && cellCopiedClassname, isDraggedOver && cellDraggedOverClassname);
1357
+ className = getCellClassname(column, typeof cellClass === 'function' ? cellClass(row) : cellClass, className, isCopied && cellCopiedClassname, isDraggedOver && cellDraggedOverClassname);
1510
1358
 
1511
1359
  function selectCellWrapper(openEditor) {
1512
- selectCell(row, column, openEditor);
1360
+ selectCell({
1361
+ idx: column.idx,
1362
+ rowIdx
1363
+ }, openEditor);
1513
1364
  }
1514
1365
 
1515
- function handleClick() {
1366
+ function handleClick(event) {
1516
1367
  var _column$editorOptions;
1517
1368
 
1518
1369
  selectCellWrapper((_column$editorOptions = column.editorOptions) == null ? void 0 : _column$editorOptions.editOnClick);
1519
- onRowClick == null ? void 0 : onRowClick(row, column);
1370
+ onRowClick == null ? void 0 : onRowClick(rowIdx, row, column);
1371
+ onClick == null ? void 0 : onClick(event);
1520
1372
  }
1521
1373
 
1522
- function handleContextMenu() {
1374
+ function handleContextMenu(event) {
1523
1375
  selectCellWrapper();
1376
+ onContextMenu == null ? void 0 : onContextMenu(event);
1524
1377
  }
1525
1378
 
1526
- function handleDoubleClick() {
1379
+ function handleDoubleClick(event) {
1527
1380
  selectCellWrapper(true);
1528
- onRowDoubleClick == null ? void 0 : onRowDoubleClick(row, column);
1381
+ onDoubleClick == null ? void 0 : onDoubleClick(event);
1382
+ }
1383
+
1384
+ function handleRowChange(newRow) {
1385
+ onRowChange(rowIdx, newRow);
1529
1386
  }
1530
1387
 
1531
- return /*#__PURE__*/e$1("div", {
1388
+ return /*#__PURE__*/e("div", {
1532
1389
  role: "gridcell",
1533
1390
  "aria-colindex": column.idx + 1,
1534
1391
  "aria-selected": isCellSelected,
1535
1392
  "aria-colspan": colSpan,
1536
1393
  "aria-readonly": !isCellEditable(column, row) || undefined,
1537
1394
  ref: ref,
1538
- tabIndex: tabIndex,
1539
1395
  className: className,
1540
1396
  style: getCellStyle(column, colSpan),
1541
1397
  onClick: handleClick,
1542
1398
  onDoubleClick: handleDoubleClick,
1543
1399
  onContextMenu: handleContextMenu,
1544
- onFocus: onFocus,
1545
1400
  ...props,
1546
- children: !column.rowGroup && /*#__PURE__*/e$1(d$1, {
1547
- children: [/*#__PURE__*/e$1(column.formatter, {
1401
+ children: !column.rowGroup && /*#__PURE__*/e(d$1, {
1402
+ children: [/*#__PURE__*/e(column.formatter, {
1548
1403
  column: column,
1404
+ rowIdx: rowIdx,
1549
1405
  row: row,
1550
1406
  isCellSelected: isCellSelected,
1551
- onRowChange: onRowChange
1552
- }), dragHandle]
1407
+ onRowChange: handleRowChange
1408
+ }), dragHandleProps && /*#__PURE__*/e("div", {
1409
+ className: cellDragHandleClassname,
1410
+ ...dragHandleProps
1411
+ })]
1553
1412
  })
1554
1413
  });
1555
1414
  }
1556
1415
 
1557
- const Cell$1 = /*#__PURE__*/g(Cell);
1416
+ const Cell$1 = /*#__PURE__*/g( /*#__PURE__*/x(Cell));
1417
+
1418
+ var css_248z$1 = ".c1tngyp1700-canary49{padding:0}";
1419
+ styleInject$1(css_248z$1);
1420
+
1421
+ const cellEditing = "c1tngyp1700-canary49";
1422
+ const cellEditingClassname = `rdg-editor-container ${cellEditing}`;
1423
+ function EditCell({
1424
+ column,
1425
+ colSpan,
1426
+ row,
1427
+ rowIdx,
1428
+ onRowChange,
1429
+ onClose,
1430
+ onKeyDown,
1431
+ editorPortalTarget
1432
+ }) {
1433
+ const frameRequestRef = h();
1434
+ const commitOnOutsideMouseDown = useLatestFunc(() => {
1435
+ onRowChange(row, true);
1436
+ });
1437
+
1438
+ function cancelFrameRequest() {
1439
+ cancelAnimationFrame(frameRequestRef.current);
1440
+ }
1441
+
1442
+ y(() => {
1443
+ function onWindowCaptureMouseDown() {
1444
+ frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);
1445
+ }
1446
+
1447
+ addEventListener('mousedown', onWindowCaptureMouseDown, {
1448
+ capture: true
1449
+ });
1450
+ return () => {
1451
+ removeEventListener('mousedown', onWindowCaptureMouseDown, {
1452
+ capture: true
1453
+ });
1454
+ cancelFrameRequest();
1455
+ };
1456
+ }, [commitOnOutsideMouseDown]);
1457
+ const {
1458
+ cellClass
1459
+ } = column;
1460
+ const className = getCellClassname(column, cellEditingClassname, typeof cellClass === 'function' ? cellClass(row) : cellClass);
1461
+ let content;
1462
+
1463
+ if (column.editor != null) {
1464
+ var _column$editorOptions;
1465
+
1466
+ content = /*#__PURE__*/e(column.editor, {
1467
+ column: column,
1468
+ row: row,
1469
+ rowIdx: rowIdx,
1470
+ onRowChange: onRowChange,
1471
+ onClose: onClose,
1472
+ editorPortalTarget: editorPortalTarget
1473
+ });
1474
+
1475
+ if ((_column$editorOptions = column.editorOptions) != null && _column$editorOptions.createPortal) {
1476
+ content = /*#__PURE__*/W(content, editorPortalTarget);
1477
+ }
1478
+ }
1479
+
1480
+ return /*#__PURE__*/e("div", {
1481
+ role: "gridcell",
1482
+ "aria-colindex": column.idx + 1,
1483
+ "aria-selected": true,
1484
+ className: className,
1485
+ style: getCellStyle(column, colSpan),
1486
+ onKeyDown: onKeyDown,
1487
+ onMouseDownCapture: cancelFrameRequest,
1488
+ children: content
1489
+ });
1490
+ }
1558
1491
 
1559
1492
  function Row({
1493
+ cellRenderer,
1560
1494
  className,
1561
1495
  rowIdx,
1562
- gridRowStart,
1563
- height,
1564
- selectedCellIdx,
1565
1496
  isRowSelected,
1566
1497
  copiedCellIdx,
1567
1498
  draggedOverCellIdx,
1568
1499
  lastFrozenColumnIndex,
1569
1500
  row,
1570
1501
  viewportColumns,
1571
- selectedCellEditor,
1572
- selectedCellDragHandle,
1502
+ selectedCellProps,
1573
1503
  onRowClick,
1574
- onRowDoubleClick,
1575
1504
  rowClass,
1576
1505
  setDraggedOverRowIdx,
1577
1506
  onMouseEnter,
1507
+ top,
1508
+ height,
1578
1509
  onRowChange,
1579
1510
  selectCell,
1580
1511
  ...props
1581
1512
  }, ref) {
1582
- const handleRowChange = useLatestFunc(newRow => {
1583
- onRowChange(rowIdx, newRow);
1584
- });
1585
-
1586
1513
  function handleDragEnter(event) {
1587
1514
  setDraggedOverRowIdx == null ? void 0 : setDraggedOverRowIdx(rowIdx);
1588
1515
  onMouseEnter == null ? void 0 : onMouseEnter(event);
1589
1516
  }
1590
1517
 
1591
- className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass == null ? void 0 : rowClass(row), className, selectedCellIdx === -1 && rowSelectedClassname);
1518
+ className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass == null ? void 0 : rowClass(row), className, (selectedCellProps == null ? void 0 : selectedCellProps.idx) === -1 && groupRowSelectedClassname);
1519
+ const CellRenderer = cellRenderer != null ? cellRenderer : Cell$1;
1592
1520
  const cells = [];
1593
1521
 
1594
1522
  for (let index = 0; index < viewportColumns.length; index++) {
1595
1523
  const column = viewportColumns[index];
1596
- const {
1597
- idx
1598
- } = column;
1599
1524
  const colSpan = getColSpan(column, lastFrozenColumnIndex, {
1600
1525
  type: 'ROW',
1601
1526
  row
@@ -1605,35 +1530,47 @@ function Row({
1605
1530
  index += colSpan - 1;
1606
1531
  }
1607
1532
 
1608
- const isCellSelected = selectedCellIdx === idx;
1533
+ const isCellSelected = (selectedCellProps == null ? void 0 : selectedCellProps.idx) === column.idx;
1609
1534
 
1610
- if (isCellSelected && selectedCellEditor) {
1611
- cells.push(selectedCellEditor);
1612
- } else {
1613
- cells.push( /*#__PURE__*/e$1(Cell$1, {
1535
+ if ((selectedCellProps == null ? void 0 : selectedCellProps.mode) === 'EDIT' && isCellSelected) {
1536
+ cells.push( /*#__PURE__*/e(EditCell, {
1537
+ rowIdx: rowIdx,
1614
1538
  column: column,
1615
1539
  colSpan: colSpan,
1616
- row: row,
1617
- isCopied: copiedCellIdx === idx,
1618
- isDraggedOver: draggedOverCellIdx === idx,
1619
- isCellSelected: isCellSelected,
1620
- dragHandle: isCellSelected ? selectedCellDragHandle : undefined,
1621
- onRowClick: onRowClick,
1622
- onRowDoubleClick: onRowDoubleClick,
1623
- onRowChange: handleRowChange,
1624
- selectCell: selectCell
1540
+ onKeyDown: selectedCellProps.onKeyDown,
1541
+ ...selectedCellProps.editorProps
1625
1542
  }, column.key));
1543
+ continue;
1626
1544
  }
1545
+
1546
+ cells.push( /*#__PURE__*/e(CellRenderer, {
1547
+ rowIdx: rowIdx,
1548
+ column: column,
1549
+ colSpan: colSpan,
1550
+ row: row,
1551
+ isCopied: copiedCellIdx === column.idx,
1552
+ isDraggedOver: draggedOverCellIdx === column.idx,
1553
+ isCellSelected: isCellSelected,
1554
+ dragHandleProps: isCellSelected ? selectedCellProps.dragHandleProps : undefined,
1555
+ onFocus: isCellSelected ? selectedCellProps.onFocus : undefined,
1556
+ onKeyDown: isCellSelected ? selectedCellProps.onKeyDown : undefined,
1557
+ onRowClick: onRowClick,
1558
+ onRowChange: onRowChange,
1559
+ selectCell: selectCell
1560
+ }, column.key));
1627
1561
  }
1628
1562
 
1629
- return /*#__PURE__*/e$1(RowSelectionProvider, {
1563
+ return /*#__PURE__*/e(RowSelectionProvider, {
1630
1564
  value: isRowSelected,
1631
- children: /*#__PURE__*/e$1("div", {
1565
+ children: /*#__PURE__*/e("div", {
1632
1566
  role: "row",
1633
1567
  ref: ref,
1634
1568
  className: className,
1635
1569
  onMouseEnter: handleDragEnter,
1636
- style: getRowStyle(gridRowStart, height),
1570
+ style: {
1571
+ top,
1572
+ '--row-height': `${height}px`
1573
+ },
1637
1574
  ...props,
1638
1575
  children: cells
1639
1576
  })
@@ -1644,43 +1581,33 @@ const Row$1 = /*#__PURE__*/g( /*#__PURE__*/x(Row));
1644
1581
 
1645
1582
  function GroupCell({
1646
1583
  id,
1584
+ rowIdx,
1647
1585
  groupKey,
1648
1586
  childRows,
1649
1587
  isExpanded,
1650
1588
  isCellSelected,
1651
1589
  column,
1652
- row,
1653
1590
  groupColumnIndex,
1654
1591
  toggleGroup: toggleGroupWrapper
1655
1592
  }) {
1656
- const {
1657
- ref,
1658
- tabIndex,
1659
- onFocus
1660
- } = useRovingCellRef(isCellSelected);
1661
-
1662
1593
  function toggleGroup() {
1663
1594
  toggleGroupWrapper(id);
1664
1595
  }
1665
1596
 
1666
1597
  const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;
1667
- return /*#__PURE__*/e$1("div", {
1598
+ return /*#__PURE__*/e("div", {
1668
1599
  role: "gridcell",
1669
1600
  "aria-colindex": column.idx + 1,
1670
- "aria-selected": isCellSelected,
1671
- ref: ref,
1672
- tabIndex: tabIndex,
1673
1601
  className: getCellClassname(column),
1674
1602
  style: { ...getCellStyle(column),
1675
1603
  cursor: isLevelMatching ? 'pointer' : 'default'
1676
1604
  },
1677
1605
  onClick: isLevelMatching ? toggleGroup : undefined,
1678
- onFocus: onFocus,
1679
- children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e$1(column.groupFormatter, {
1606
+ children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e(column.groupFormatter, {
1607
+ rowIdx: rowIdx,
1680
1608
  groupKey: groupKey,
1681
1609
  childRows: childRows,
1682
1610
  column: column,
1683
- row: row,
1684
1611
  isExpanded: isExpanded,
1685
1612
  isCellSelected: isCellSelected,
1686
1613
  toggleGroup: toggleGroup
@@ -1690,53 +1617,52 @@ function GroupCell({
1690
1617
 
1691
1618
  const GroupCell$1 = /*#__PURE__*/g(GroupCell);
1692
1619
 
1693
- var css_248z$6 = ".gyxx7e9700-beta11:not([aria-selected=true]){background-color:var(--rdg-header-background-color)}.gyxx7e9700-beta11>.c1wupbe700-beta11:not(:last-child):not(.c9dpaye700-beta11){border-inline-end:none}";
1694
- styleInject$1(css_248z$6,{"insertAt":"top"});
1695
-
1696
- const groupRow = "gyxx7e9700-beta11";
1697
- const groupRowClassname = `rdg-group-row ${groupRow}`;
1698
-
1699
1620
  function GroupedRow({
1700
1621
  id,
1701
1622
  groupKey,
1702
1623
  viewportColumns,
1703
1624
  childRows,
1704
1625
  rowIdx,
1705
- row,
1706
- gridRowStart,
1626
+ top,
1707
1627
  height,
1708
1628
  level,
1709
1629
  isExpanded,
1710
1630
  selectedCellIdx,
1711
1631
  isRowSelected,
1712
- selectGroup,
1632
+ selectCell,
1713
1633
  toggleGroup,
1714
1634
  ...props
1715
1635
  }) {
1716
1636
  const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? level + 1 : level;
1717
1637
 
1718
- function handleSelectGroup() {
1719
- selectGroup(rowIdx);
1638
+ function selectGroup() {
1639
+ selectCell({
1640
+ rowIdx,
1641
+ idx: -1
1642
+ });
1720
1643
  }
1721
1644
 
1722
- return /*#__PURE__*/e$1(RowSelectionProvider, {
1645
+ return /*#__PURE__*/e(RowSelectionProvider, {
1723
1646
  value: isRowSelected,
1724
- children: /*#__PURE__*/e$1("div", {
1647
+ children: /*#__PURE__*/e("div", {
1725
1648
  role: "row",
1726
1649
  "aria-level": level,
1727
1650
  "aria-expanded": isExpanded,
1728
- className: clsx(rowClassname, groupRowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, selectedCellIdx === -1 && rowSelectedClassname),
1729
- onClick: handleSelectGroup,
1730
- style: getRowStyle(gridRowStart, height),
1651
+ className: clsx(rowClassname, groupRowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, selectedCellIdx === -1 && groupRowSelectedClassname),
1652
+ onClick: selectGroup,
1653
+ style: {
1654
+ top,
1655
+ '--row-height': `${height}px`
1656
+ },
1731
1657
  ...props,
1732
- children: viewportColumns.map(column => /*#__PURE__*/e$1(GroupCell$1, {
1658
+ children: viewportColumns.map(column => /*#__PURE__*/e(GroupCell$1, {
1733
1659
  id: id,
1660
+ rowIdx: rowIdx,
1734
1661
  groupKey: groupKey,
1735
1662
  childRows: childRows,
1736
1663
  isExpanded: isExpanded,
1737
1664
  isCellSelected: selectedCellIdx === column.idx,
1738
1665
  column: column,
1739
- row: row,
1740
1666
  groupColumnIndex: idx,
1741
1667
  toggleGroup: toggleGroup
1742
1668
  }, column.key))
@@ -1746,71 +1672,37 @@ function GroupedRow({
1746
1672
 
1747
1673
  const GroupRowRenderer = /*#__PURE__*/g(GroupedRow);
1748
1674
 
1749
- var css_248z$5 = ".s1n3hxke700-beta11{inset-block-end:var(--rdg-summary-row-bottom);inset-block-start:var(--rdg-summary-row-top)}";
1750
- styleInject$1(css_248z$5,{"insertAt":"top"});
1751
-
1752
- const summaryCellClassname = "s1n3hxke700-beta11";
1753
-
1754
1675
  function SummaryCell({
1755
1676
  column,
1756
1677
  colSpan,
1757
- row,
1758
- isCellSelected,
1759
- selectCell
1678
+ row
1760
1679
  }) {
1761
- const {
1762
- ref,
1763
- tabIndex,
1764
- onFocus
1765
- } = useRovingCellRef(isCellSelected);
1766
1680
  const {
1767
1681
  summaryFormatter: SummaryFormatter,
1768
1682
  summaryCellClass
1769
1683
  } = column;
1770
- const className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass);
1771
-
1772
- function onClick() {
1773
- selectCell(row, column);
1774
- }
1775
-
1776
- return /*#__PURE__*/e$1("div", {
1684
+ const className = getCellClassname(column, typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass);
1685
+ return /*#__PURE__*/e("div", {
1777
1686
  role: "gridcell",
1778
1687
  "aria-colindex": column.idx + 1,
1779
1688
  "aria-colspan": colSpan,
1780
- "aria-selected": isCellSelected,
1781
- ref: ref,
1782
- tabIndex: tabIndex,
1783
1689
  className: className,
1784
1690
  style: getCellStyle(column, colSpan),
1785
- onClick: onClick,
1786
- onFocus: onFocus,
1787
- children: SummaryFormatter && /*#__PURE__*/e$1(SummaryFormatter, {
1691
+ children: SummaryFormatter && /*#__PURE__*/e(SummaryFormatter, {
1788
1692
  column: column,
1789
- row: row,
1790
- isCellSelected: isCellSelected
1693
+ row: row
1791
1694
  })
1792
1695
  });
1793
1696
  }
1794
1697
 
1795
1698
  const SummaryCell$1 = /*#__PURE__*/g(SummaryCell);
1796
1699
 
1797
- var css_248z$4 = ".snfqesz700-beta11.r1otpg64700-beta11{line-height:var(--rdg-summary-row-height)}.snfqesz700-beta11.r1otpg64700-beta11>.c1wupbe700-beta11{position:sticky}.s1jijrjz700-beta11>.c1wupbe700-beta11{border-block-start:2px solid var(--rdg-summary-border-color)}";
1798
- styleInject$1(css_248z$4,{"insertAt":"top"});
1799
-
1800
- const summaryRow = "snfqesz700-beta11";
1801
- const summaryRowBorderClassname = "s1jijrjz700-beta11";
1802
- const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
1803
-
1804
1700
  function SummaryRow({
1805
1701
  rowIdx,
1806
- gridRowStart,
1807
1702
  row,
1808
1703
  viewportColumns,
1809
- top,
1810
1704
  bottom,
1811
1705
  lastFrozenColumnIndex,
1812
- selectedCellIdx,
1813
- selectCell,
1814
1706
  'aria-rowindex': ariaRowIndex
1815
1707
  }) {
1816
1708
  const cells = [];
@@ -1826,23 +1718,19 @@ function SummaryRow({
1826
1718
  index += colSpan - 1;
1827
1719
  }
1828
1720
 
1829
- const isCellSelected = selectedCellIdx === column.idx;
1830
- cells.push( /*#__PURE__*/e$1(SummaryCell$1, {
1721
+ cells.push( /*#__PURE__*/e(SummaryCell$1, {
1831
1722
  column: column,
1832
1723
  colSpan: colSpan,
1833
- row: row,
1834
- isCellSelected: isCellSelected,
1835
- selectCell: selectCell
1724
+ row: row
1836
1725
  }, column.key));
1837
1726
  }
1838
1727
 
1839
- return /*#__PURE__*/e$1("div", {
1728
+ return /*#__PURE__*/e("div", {
1840
1729
  role: "row",
1841
1730
  "aria-rowindex": ariaRowIndex,
1842
- className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, rowIdx === 0 && summaryRowBorderClassname, selectedCellIdx === -1 && rowSelectedClassname),
1843
- style: { ...getRowStyle(gridRowStart),
1844
- '--rdg-summary-row-top': top !== undefined ? `${top}px` : undefined,
1845
- '--rdg-summary-row-bottom': bottom !== undefined ? `${bottom}px` : undefined
1731
+ className: `${rowClassname} rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'} ${summaryRowClassname}`,
1732
+ style: {
1733
+ bottom
1846
1734
  },
1847
1735
  children: cells
1848
1736
  });
@@ -1850,220 +1738,11 @@ function SummaryRow({
1850
1738
 
1851
1739
  const SummaryRow$1 = /*#__PURE__*/g(SummaryRow);
1852
1740
 
1853
- var css_248z$3 = ".c1tngyp1700-beta11.rdg-cell{padding:0}";
1854
- styleInject$1(css_248z$3,{"insertAt":"top"});
1855
-
1856
- const cellEditing = "c1tngyp1700-beta11";
1857
- function EditCell({
1858
- column,
1859
- colSpan,
1860
- row,
1861
- onRowChange,
1862
- closeEditor,
1863
- scrollToCell
1864
- }) {
1865
- var _column$editorOptions, _column$editorOptions4, _column$editorOptions5;
1866
-
1867
- const frameRequestRef = h();
1868
- const commitOnOutsideClick = ((_column$editorOptions = column.editorOptions) == null ? void 0 : _column$editorOptions.commitOnOutsideClick) !== false;
1869
- const commitOnOutsideMouseDown = useLatestFunc(() => {
1870
- onClose(true);
1871
- });
1872
- y(() => {
1873
- if (!commitOnOutsideClick) return;
1874
-
1875
- function onWindowCaptureMouseDown() {
1876
- frameRequestRef.current = requestAnimationFrame(commitOnOutsideMouseDown);
1877
- }
1878
-
1879
- addEventListener('mousedown', onWindowCaptureMouseDown, {
1880
- capture: true
1881
- });
1882
- return () => {
1883
- removeEventListener('mousedown', onWindowCaptureMouseDown, {
1884
- capture: true
1885
- });
1886
- cancelFrameRequest();
1887
- };
1888
- }, [commitOnOutsideClick, commitOnOutsideMouseDown]);
1889
-
1890
- function cancelFrameRequest() {
1891
- cancelAnimationFrame(frameRequestRef.current);
1892
- }
1893
-
1894
- function onKeyDown(event) {
1895
- if (event.key === 'Escape') {
1896
- event.stopPropagation();
1897
- onClose();
1898
- } else if (event.key === 'Enter') {
1899
- event.stopPropagation();
1900
- onClose(true);
1901
- scrollToCell();
1902
- } else {
1903
- var _column$editorOptions2, _column$editorOptions3;
1904
-
1905
- const onNavigation = (_column$editorOptions2 = (_column$editorOptions3 = column.editorOptions) == null ? void 0 : _column$editorOptions3.onNavigation) != null ? _column$editorOptions2 : onEditorNavigation;
1906
-
1907
- if (!onNavigation(event)) {
1908
- event.stopPropagation();
1909
- }
1910
- }
1911
- }
1912
-
1913
- function onClose(commitChanges) {
1914
- if (commitChanges) {
1915
- onRowChange(row, true);
1916
- } else {
1917
- closeEditor();
1918
- }
1919
- }
1920
-
1921
- const {
1922
- cellClass
1923
- } = column;
1924
- const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !((_column$editorOptions4 = column.editorOptions) != null && _column$editorOptions4.renderFormatter) && cellEditing);
1925
- return /*#__PURE__*/e$1("div", {
1926
- role: "gridcell",
1927
- "aria-colindex": column.idx + 1,
1928
- "aria-colspan": colSpan,
1929
- "aria-selected": true,
1930
- className: className,
1931
- style: getCellStyle(column, colSpan),
1932
- onKeyDown: onKeyDown,
1933
- onMouseDownCapture: commitOnOutsideClick ? cancelFrameRequest : undefined,
1934
- children: column.editor != null && /*#__PURE__*/e$1(d$1, {
1935
- children: [/*#__PURE__*/e$1(column.editor, {
1936
- column: column,
1937
- row: row,
1938
- onRowChange: onRowChange,
1939
- onClose: onClose
1940
- }), ((_column$editorOptions5 = column.editorOptions) == null ? void 0 : _column$editorOptions5.renderFormatter) && /*#__PURE__*/e$1(column.formatter, {
1941
- column: column,
1942
- row: row,
1943
- isCellSelected: true,
1944
- onRowChange: onRowChange
1945
- })]
1946
- })
1947
- });
1948
- }
1949
-
1950
- var css_248z$2 = ".cadd3bp700-beta11{background-color:var(--rdg-selection-color);block-size:8px;cursor:move;inline-size:8px;inset-block-end:0;inset-inline-end:0;position:absolute}.cadd3bp700-beta11:hover{background-color:var(--rdg-background-color);block-size:16px;border:2px solid var(--rdg-selection-color);inline-size:16px}";
1951
- styleInject$1(css_248z$2,{"insertAt":"top"});
1952
-
1953
- const cellDragHandle = "cadd3bp700-beta11";
1954
- const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
1955
- function DragHandle({
1956
- rows,
1957
- columns,
1958
- selectedPosition,
1959
- latestDraggedOverRowIdx,
1960
- isCellEditable,
1961
- onRowsChange,
1962
- onFill,
1963
- setDragging,
1964
- setDraggedOverRowIdx
1965
- }) {
1966
- function handleMouseDown(event) {
1967
- if (event.buttons !== 1) return;
1968
- setDragging(true);
1969
- window.addEventListener('mouseover', onMouseOver);
1970
- window.addEventListener('mouseup', onMouseUp);
1971
-
1972
- function onMouseOver(event) {
1973
- if (event.buttons !== 1) onMouseUp();
1974
- }
1975
-
1976
- function onMouseUp() {
1977
- window.removeEventListener('mouseover', onMouseOver);
1978
- window.removeEventListener('mouseup', onMouseUp);
1979
- setDragging(false);
1980
- handleDragEnd();
1981
- }
1982
- }
1983
-
1984
- function handleDragEnd() {
1985
- const overRowIdx = latestDraggedOverRowIdx.current;
1986
- if (overRowIdx === undefined) return;
1987
- const {
1988
- rowIdx
1989
- } = selectedPosition;
1990
- const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;
1991
- const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;
1992
- updateRows(startRowIndex, endRowIndex);
1993
- setDraggedOverRowIdx(undefined);
1994
- }
1995
-
1996
- function handleDoubleClick(event) {
1997
- event.stopPropagation();
1998
- updateRows(selectedPosition.rowIdx + 1, rows.length);
1999
- }
2000
-
2001
- function updateRows(startRowIdx, endRowIdx) {
2002
- const {
2003
- idx,
2004
- rowIdx
2005
- } = selectedPosition;
2006
- const column = columns[idx];
2007
- const sourceRow = rows[rowIdx];
2008
- const updatedRows = [...rows];
2009
- const indexes = [];
2010
-
2011
- for (let i = startRowIdx; i < endRowIdx; i++) {
2012
- if (isCellEditable({
2013
- rowIdx: i,
2014
- idx
2015
- })) {
2016
- const updatedRow = onFill({
2017
- columnKey: column.key,
2018
- sourceRow,
2019
- targetRow: rows[i]
2020
- });
2021
-
2022
- if (updatedRow !== rows[i]) {
2023
- updatedRows[i] = updatedRow;
2024
- indexes.push(i);
2025
- }
2026
- }
2027
- }
2028
-
2029
- if (indexes.length > 0) {
2030
- onRowsChange == null ? void 0 : onRowsChange(updatedRows, {
2031
- indexes,
2032
- column
2033
- });
2034
- }
2035
- }
2036
-
2037
- return /*#__PURE__*/e$1("div", {
2038
- className: cellDragHandleClassname,
2039
- onMouseDown: handleMouseDown,
2040
- onDoubleClick: handleDoubleClick
2041
- });
2042
- }
2043
-
2044
- var css_248z$1 = ".a888944700-beta11{fill:currentColor}.a888944700-beta11>path{transition:d .1s}";
2045
- styleInject$1(css_248z$1,{"insertAt":"top"});
2046
-
2047
- const arrow = "a888944700-beta11";
2048
- const arrowClassname = `rdg-sort-arrow ${arrow}`;
2049
- function SortIcon({
2050
- sortDirection
2051
- }) {
2052
- return sortDirection !== undefined ? /*#__PURE__*/e$1("svg", {
2053
- viewBox: "0 0 12 8",
2054
- width: "12",
2055
- height: "8",
2056
- className: arrowClassname,
2057
- "aria-hidden": true,
2058
- children: /*#__PURE__*/e$1("path", {
2059
- d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'
2060
- })
2061
- }) : null;
2062
- }
2063
-
1741
+ var _globalThis$document;
1742
+ const body = (_globalThis$document = globalThis.document) == null ? void 0 : _globalThis$document.body;
2064
1743
  const initialPosition = {
2065
1744
  idx: -1,
2066
- rowIdx: -2,
1745
+ rowIdx: -1,
2067
1746
  mode: 'SELECT'
2068
1747
  };
2069
1748
 
@@ -2085,38 +1764,33 @@ function DataGrid({
2085
1764
  rowGrouper,
2086
1765
  expandedGroupIds,
2087
1766
  onExpandedGroupIdsChange,
1767
+ rowRenderer,
1768
+ emptyRowsRenderer: EmptyRowsRenderer,
2088
1769
  onRowClick,
2089
- onRowDoubleClick,
2090
1770
  onScroll,
2091
1771
  onColumnResize,
1772
+ onSelectedCellChange,
2092
1773
  onFill,
2093
- onCopy,
2094
1774
  onPaste,
2095
1775
  cellNavigationMode: rawCellNavigationMode,
2096
1776
  enableVirtualization,
2097
- components,
1777
+ editorPortalTarget: rawEditorPortalTarget,
2098
1778
  className,
2099
1779
  style,
2100
1780
  rowClass,
2101
- direction,
2102
1781
  'aria-label': ariaLabel,
2103
1782
  'aria-labelledby': ariaLabelledBy,
2104
- 'aria-describedby': ariaDescribedBy,
2105
- 'data-testid': testId
1783
+ 'aria-describedby': ariaDescribedBy
2106
1784
  }, ref) {
2107
- var _rowHeight, _ref, _components$rowRender, _ref2, _components$sortIcon, _ref3, _components$checkboxF, _components$noRowsFal, _enableVirtualization, _direction, _summaryRows$length;
1785
+ var _rowHeight, _enableVirtualization, _summaryRows$length;
2108
1786
 
2109
- const defaultComponents = useDefaultComponents();
2110
1787
  (_rowHeight = rowHeight) != null ? _rowHeight : rowHeight = 35;
2111
1788
  const headerRowHeight = rawHeaderRowHeight != null ? rawHeaderRowHeight : typeof rowHeight === 'number' ? rowHeight : 35;
2112
1789
  const summaryRowHeight = rawSummaryRowHeight != null ? rawSummaryRowHeight : typeof rowHeight === 'number' ? rowHeight : 35;
2113
- const RowRenderer = (_ref = (_components$rowRender = components == null ? void 0 : components.rowRenderer) != null ? _components$rowRender : defaultComponents == null ? void 0 : defaultComponents.rowRenderer) != null ? _ref : Row$1;
2114
- const sortIcon = (_ref2 = (_components$sortIcon = components == null ? void 0 : components.sortIcon) != null ? _components$sortIcon : defaultComponents == null ? void 0 : defaultComponents.sortIcon) != null ? _ref2 : SortIcon;
2115
- const checkboxFormatter = (_ref3 = (_components$checkboxF = components == null ? void 0 : components.checkboxFormatter) != null ? _components$checkboxF : defaultComponents == null ? void 0 : defaultComponents.checkboxFormatter) != null ? _ref3 : CheckboxFormatter;
2116
- const noRowsFallback = (_components$noRowsFal = components == null ? void 0 : components.noRowsFallback) != null ? _components$noRowsFal : defaultComponents == null ? void 0 : defaultComponents.noRowsFallback;
1790
+ const RowRenderer = rowRenderer != null ? rowRenderer : Row$1;
2117
1791
  const cellNavigationMode = rawCellNavigationMode != null ? rawCellNavigationMode : 'NONE';
2118
1792
  (_enableVirtualization = enableVirtualization) != null ? _enableVirtualization : enableVirtualization = true;
2119
- (_direction = direction) != null ? _direction : direction = 'ltr';
1793
+ const editorPortalTarget = rawEditorPortalTarget != null ? rawEditorPortalTarget : body;
2120
1794
  const [scrollTop, setScrollTop] = m(0);
2121
1795
  const [scrollLeft, setScrollLeft] = m(0);
2122
1796
  const [columnWidths, setColumnWidths] = m(() => new Map());
@@ -2124,24 +1798,20 @@ function DataGrid({
2124
1798
  const [copiedCell, setCopiedCell] = m(null);
2125
1799
  const [isDragging, setDragging] = m(false);
2126
1800
  const [draggedOverRowIdx, setOverRowIdx] = m(undefined);
2127
- const [autoResizeColumn, setAutoResizeColumn] = m(null);
1801
+ const focusSinkRef = h(null);
2128
1802
  const prevSelectedPosition = h(selectedPosition);
2129
1803
  const latestDraggedOverRowIdx = h(draggedOverRowIdx);
2130
1804
  const lastSelectedRowIdx = h(-1);
2131
- const rowRef = h(null);
1805
+ const isCellFocusable = h(false);
1806
+ const selectRowWrapper = useLatestFunc(selectRow);
1807
+ const selectCellWrapper = useLatestFunc(selectCell);
1808
+ const toggleGroupWrapper = useLatestFunc(toggleGroup);
1809
+ const handleFormatterRowChangeWrapper = useLatestFunc(updateRow);
2132
1810
  const [gridRef, gridWidth, gridHeight] = useGridDimensions();
2133
1811
  const headerRowsCount = 1;
2134
1812
  const summaryRowsCount = (_summaryRows$length = summaryRows == null ? void 0 : summaryRows.length) != null ? _summaryRows$length : 0;
2135
1813
  const clientHeight = gridHeight - headerRowHeight - summaryRowsCount * summaryRowHeight;
2136
1814
  const isSelectable = selectedRows != null && onSelectedRowsChange != null;
2137
- const isHeaderRowSelected = selectedPosition.rowIdx === -1;
2138
- const isRtl = direction === 'rtl';
2139
- const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';
2140
- const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';
2141
- const defaultGridComponents = _(() => ({
2142
- sortIcon,
2143
- checkboxFormatter
2144
- }), [sortIcon, checkboxFormatter]);
2145
1815
  const allRowsSelected = _(() => {
2146
1816
  const {
2147
1817
  length
@@ -2174,7 +1844,6 @@ function DataGrid({
2174
1844
  rows,
2175
1845
  rowsCount,
2176
1846
  totalRowHeight,
2177
- gridTemplateRows,
2178
1847
  isGroupRow,
2179
1848
  getRowTop,
2180
1849
  getRowHeight,
@@ -2203,68 +1872,24 @@ function DataGrid({
2203
1872
  });
2204
1873
  const hasGroups = groupBy.length > 0 && typeof rowGrouper === 'function';
2205
1874
  const minColIdx = hasGroups ? -1 : 0;
2206
- const maxColIdx = columns.length - 1;
2207
- const minRowIdx = -1;
2208
- const maxRowIdx = headerRowsCount + rows.length + summaryRowsCount - 2;
2209
- const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition);
2210
- const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition);
2211
- const selectRowLatest = useLatestFunc(selectRow);
2212
- const selectAllRowsLatest = useLatestFunc(selectAllRows);
2213
- const handleFormatterRowChangeLatest = useLatestFunc(updateRow);
2214
- const selectViewportCellLatest = useLatestFunc((row, column, enableEditor) => {
2215
- const rowIdx = rows.indexOf(row);
2216
- selectCell({
2217
- rowIdx,
2218
- idx: column.idx
2219
- }, enableEditor);
2220
- });
2221
- const selectGroupLatest = useLatestFunc(rowIdx => {
2222
- selectCell({
2223
- rowIdx,
2224
- idx: -1
2225
- });
2226
- });
2227
- const selectHeaderCellLatest = useLatestFunc(idx => {
2228
- selectCell({
2229
- rowIdx: -1,
2230
- idx
2231
- });
2232
- });
2233
- const selectSummaryCellLatest = useLatestFunc((summaryRow, column) => {
2234
- const rowIdx = summaryRows.indexOf(summaryRow) + headerRowsCount + rows.length - 1;
2235
- selectCell({
2236
- rowIdx,
2237
- idx: column.idx
2238
- });
2239
- });
2240
- const toggleGroupLatest = useLatestFunc(toggleGroup);
2241
- useLayoutEffect(() => {
2242
- if (!selectedCellIsWithinSelectionBounds || isSamePosition(selectedPosition, prevSelectedPosition.current)) {
2243
- prevSelectedPosition.current = selectedPosition;
1875
+ const enableCellDragAndDrop = hasGroups ? false : onFill != null;
1876
+ d(() => {
1877
+ if (selectedPosition === prevSelectedPosition.current || selectedPosition.mode === 'EDIT' || !isCellWithinBounds(selectedPosition)) {
2244
1878
  return;
2245
1879
  }
2246
1880
 
2247
1881
  prevSelectedPosition.current = selectedPosition;
2248
1882
  scrollToCell(selectedPosition);
2249
1883
 
2250
- if (selectedPosition.idx === -1) {
2251
- rowRef.current.focus({
2252
- preventScroll: true
2253
- });
1884
+ if (isCellFocusable.current) {
1885
+ isCellFocusable.current = false;
1886
+ return;
2254
1887
  }
2255
- });
2256
- useLayoutEffect(() => {
2257
- if (autoResizeColumn === null) return;
2258
- const columnElement = gridRef.current.querySelector(`[aria-colindex="${autoResizeColumn.idx + 1}"]`);
2259
- const width = columnElement.clientWidth + 2;
2260
- setColumnWidths(columnWidths => {
2261
- const newColumnWidths = new Map(columnWidths);
2262
- newColumnWidths.set(autoResizeColumn.key, width);
2263
- return newColumnWidths;
1888
+
1889
+ focusSinkRef.current.focus({
1890
+ preventScroll: true
2264
1891
  });
2265
- setAutoResizeColumn(null);
2266
- onColumnResize == null ? void 0 : onColumnResize(autoResizeColumn.idx, width);
2267
- }, [autoResizeColumn, gridRef, onColumnResize]);
1892
+ });
2268
1893
  s(ref, () => ({
2269
1894
  element: gridRef.current,
2270
1895
 
@@ -2288,11 +1913,6 @@ function DataGrid({
2288
1913
  selectCell
2289
1914
  }));
2290
1915
  const handleColumnResize = A$1((column, width) => {
2291
- if (width === 'auto') {
2292
- setAutoResizeColumn(column);
2293
- return;
2294
- }
2295
-
2296
1916
  setColumnWidths(columnWidths => {
2297
1917
  const newColumnWidths = new Map(columnWidths);
2298
1918
  newColumnWidths.set(column.key, width);
@@ -2306,13 +1926,14 @@ function DataGrid({
2306
1926
  }, []);
2307
1927
 
2308
1928
  function selectRow({
2309
- row,
1929
+ rowIdx,
2310
1930
  checked,
2311
1931
  isShiftClick
2312
1932
  }) {
2313
1933
  if (!onSelectedRowsChange) return;
2314
1934
  assertIsValidKeyGetter(rowKeyGetter);
2315
1935
  const newSelectedRows = new Set(selectedRows);
1936
+ const row = rows[rowIdx];
2316
1937
 
2317
1938
  if (isGroupRow(row)) {
2318
1939
  for (const childRow of row.childRows) {
@@ -2334,7 +1955,6 @@ function DataGrid({
2334
1955
  if (checked) {
2335
1956
  newSelectedRows.add(rowKey);
2336
1957
  const previousRowIdx = lastSelectedRowIdx.current;
2337
- const rowIdx = rows.indexOf(row);
2338
1958
  lastSelectedRowIdx.current = rowIdx;
2339
1959
 
2340
1960
  if (isShiftClick && previousRowIdx !== -1 && previousRowIdx !== rowIdx) {
@@ -2354,24 +1974,6 @@ function DataGrid({
2354
1974
  onSelectedRowsChange(newSelectedRows);
2355
1975
  }
2356
1976
 
2357
- function selectAllRows(checked) {
2358
- if (!onSelectedRowsChange) return;
2359
- assertIsValidKeyGetter(rowKeyGetter);
2360
- const newSelectedRows = new Set(selectedRows);
2361
-
2362
- for (const row of rawRows) {
2363
- const rowKey = rowKeyGetter(row);
2364
-
2365
- if (checked) {
2366
- newSelectedRows.add(rowKey);
2367
- } else {
2368
- newSelectedRows.delete(rowKey);
2369
- }
2370
- }
2371
-
2372
- onSelectedRowsChange(newSelectedRows);
2373
- }
2374
-
2375
1977
  function toggleGroup(expandedGroupId) {
2376
1978
  if (!onExpandedGroupIdsChange) return;
2377
1979
  const newExpandedGroupIds = new Set(expandedGroupIds);
@@ -2385,20 +1987,30 @@ function DataGrid({
2385
1987
  onExpandedGroupIdsChange(newExpandedGroupIds);
2386
1988
  }
2387
1989
 
1990
+ function onGridFocus() {
1991
+ if (!isCellWithinBounds(selectedPosition)) {
1992
+ const initialPosition = {
1993
+ idx: 0,
1994
+ rowIdx: 0,
1995
+ mode: 'SELECT'
1996
+ };
1997
+
1998
+ if (isCellWithinBounds(initialPosition)) {
1999
+ setSelectedPosition(initialPosition);
2000
+ }
2001
+ } else {
2002
+ scrollToCell(selectedPosition);
2003
+ }
2004
+ }
2005
+
2388
2006
  function handleKeyDown(event) {
2389
- if (!(event.target instanceof Element)) return;
2390
- const isCellEvent = event.target.closest('.rdg-cell') !== null;
2391
- const isRowEvent = hasGroups && event.target === rowRef.current;
2392
- if (!isCellEvent && !isRowEvent) return;
2393
2007
  const {
2394
2008
  key,
2395
2009
  keyCode
2396
2010
  } = event;
2397
- const {
2398
- rowIdx
2399
- } = selectedPosition;
2011
+ const row = rows[selectedPosition.rowIdx];
2400
2012
 
2401
- if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event) && !isGroupRow(rows[rowIdx]) && selectedPosition.mode === 'SELECT') {
2013
+ if (onPaste && isCtrlKeyHeldDown(event) && isCellWithinBounds(selectedPosition) && !isGroupRow(row) && selectedPosition.idx !== -1 && selectedPosition.mode === 'SELECT') {
2402
2014
  const cKey = 67;
2403
2015
  const vKey = 86;
2404
2016
 
@@ -2413,19 +2025,16 @@ function DataGrid({
2413
2025
  }
2414
2026
  }
2415
2027
 
2416
- if (isRowIdxWithinViewportBounds(rowIdx)) {
2417
- const row = rows[rowIdx];
2418
-
2419
- if (isGroupRow(row) && selectedPosition.idx === -1 && (key === leftKey && row.isExpanded || key === rightKey && !row.isExpanded)) {
2420
- event.preventDefault();
2421
- toggleGroup(row.id);
2422
- return;
2423
- }
2028
+ if (isCellWithinBounds(selectedPosition) && isGroupRow(row) && selectedPosition.idx === -1 && (key === 'ArrowLeft' && row.isExpanded || key === 'ArrowRight' && !row.isExpanded)) {
2029
+ event.preventDefault();
2030
+ toggleGroup(row.id);
2031
+ return;
2424
2032
  }
2425
2033
 
2426
2034
  switch (event.key) {
2427
2035
  case 'Escape':
2428
2036
  setCopiedCell(null);
2037
+ closeEditor();
2429
2038
  return;
2430
2039
 
2431
2040
  case 'ArrowUp':
@@ -2446,13 +2055,17 @@ function DataGrid({
2446
2055
  }
2447
2056
  }
2448
2057
 
2058
+ function handleFocus() {
2059
+ isCellFocusable.current = true;
2060
+ }
2061
+
2449
2062
  function handleScroll(event) {
2450
2063
  const {
2451
2064
  scrollTop,
2452
2065
  scrollLeft
2453
2066
  } = event.currentTarget;
2454
2067
  setScrollTop(scrollTop);
2455
- setScrollLeft(abs(scrollLeft));
2068
+ setScrollLeft(scrollLeft);
2456
2069
  onScroll == null ? void 0 : onScroll(event);
2457
2070
  }
2458
2071
 
@@ -2462,19 +2075,24 @@ function DataGrid({
2462
2075
 
2463
2076
  function updateRow(rowIdx, row) {
2464
2077
  if (typeof onRowsChange !== 'function') return;
2465
- const rawRowIdx = getRawRowIdx(rowIdx);
2466
- if (row === rawRows[rawRowIdx]) return;
2078
+ if (row === rawRows[rowIdx]) return;
2467
2079
  const updatedRows = [...rawRows];
2468
- updatedRows[rawRowIdx] = row;
2080
+ updatedRows[rowIdx] = row;
2469
2081
  onRowsChange(updatedRows, {
2470
- indexes: [rawRowIdx],
2082
+ indexes: [rowIdx],
2471
2083
  column: columns[selectedPosition.idx]
2472
2084
  });
2473
2085
  }
2474
2086
 
2475
2087
  function commitEditorChanges() {
2476
- if (selectedPosition.mode !== 'EDIT') return;
2477
- updateRow(selectedPosition.rowIdx, selectedPosition.row);
2088
+ var _columns$selectedPosi;
2089
+
2090
+ if (((_columns$selectedPosi = columns[selectedPosition.idx]) == null ? void 0 : _columns$selectedPosi.editor) == null || selectedPosition.mode === 'SELECT' || selectedPosition.row === selectedPosition.originalRow) {
2091
+ return;
2092
+ }
2093
+
2094
+ const rowIdx = getRawRowIdx(selectedPosition.rowIdx);
2095
+ updateRow(rowIdx, selectedPosition.row);
2478
2096
  }
2479
2097
 
2480
2098
  function handleCopy() {
@@ -2482,28 +2100,23 @@ function DataGrid({
2482
2100
  idx,
2483
2101
  rowIdx
2484
2102
  } = selectedPosition;
2485
- const sourceRow = rawRows[getRawRowIdx(rowIdx)];
2486
- const sourceColumnKey = columns[idx].key;
2487
2103
  setCopiedCell({
2488
- row: sourceRow,
2489
- columnKey: sourceColumnKey
2490
- });
2491
- onCopy == null ? void 0 : onCopy({
2492
- sourceRow,
2493
- sourceColumnKey
2104
+ row: rawRows[getRawRowIdx(rowIdx)],
2105
+ columnKey: columns[idx].key
2494
2106
  });
2495
2107
  }
2496
2108
 
2497
2109
  function handlePaste() {
2498
- if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) {
2499
- return;
2500
- }
2501
-
2502
2110
  const {
2503
2111
  idx,
2504
2112
  rowIdx
2505
2113
  } = selectedPosition;
2506
2114
  const targetRow = rawRows[getRawRowIdx(rowIdx)];
2115
+
2116
+ if (!onPaste || !onRowsChange || copiedCell === null || !isCellEditable(selectedPosition)) {
2117
+ return;
2118
+ }
2119
+
2507
2120
  const updatedTargetRow = onPaste({
2508
2121
  sourceRow: copiedCell.row,
2509
2122
  sourceColumnKey: copiedCell.columnKey,
@@ -2516,27 +2129,23 @@ function DataGrid({
2516
2129
  function handleCellInput(event) {
2517
2130
  var _column$editorOptions;
2518
2131
 
2519
- if (!selectedCellIsWithinViewportBounds) return;
2132
+ if (!isCellWithinBounds(selectedPosition)) return;
2520
2133
  const row = rows[selectedPosition.rowIdx];
2521
2134
  if (isGroupRow(row)) return;
2522
2135
  const {
2523
- key,
2524
- shiftKey
2136
+ key
2525
2137
  } = event;
2138
+ const column = columns[selectedPosition.idx];
2139
+
2140
+ if (selectedPosition.mode === 'EDIT') {
2141
+ if (key === 'Enter') {
2142
+ commitEditorChanges();
2143
+ closeEditor();
2144
+ }
2526
2145
 
2527
- if (isSelectable && shiftKey && key === ' ') {
2528
- assertIsValidKeyGetter(rowKeyGetter);
2529
- const rowKey = rowKeyGetter(row);
2530
- selectRow({
2531
- row,
2532
- checked: !selectedRows.has(rowKey),
2533
- isShiftClick: false
2534
- });
2535
- event.preventDefault();
2536
2146
  return;
2537
2147
  }
2538
2148
 
2539
- const column = columns[selectedPosition.idx];
2540
2149
  (_column$editorOptions = column.editorOptions) == null ? void 0 : _column$editorOptions.onCellKeyDown == null ? void 0 : _column$editorOptions.onCellKeyDown(event);
2541
2150
  if (event.isDefaultPrevented()) return;
2542
2151
 
@@ -2547,6 +2156,7 @@ function DataGrid({
2547
2156
  }) => ({
2548
2157
  idx,
2549
2158
  rowIdx,
2159
+ key,
2550
2160
  mode: 'EDIT',
2551
2161
  row,
2552
2162
  originalRow: row
@@ -2554,30 +2164,128 @@ function DataGrid({
2554
2164
  }
2555
2165
  }
2556
2166
 
2557
- function isColIdxWithinSelectionBounds(idx) {
2558
- return idx >= minColIdx && idx <= maxColIdx;
2167
+ function handleDragEnd() {
2168
+ const overRowIdx = latestDraggedOverRowIdx.current;
2169
+ if (overRowIdx === undefined || !onFill || !onRowsChange) return;
2170
+ const {
2171
+ idx,
2172
+ rowIdx
2173
+ } = selectedPosition;
2174
+ const sourceRow = rawRows[rowIdx];
2175
+ const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;
2176
+ const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;
2177
+ const targetRows = rawRows.slice(startRowIndex, endRowIndex);
2178
+ const column = columns[idx];
2179
+ const updatedTargetRows = onFill({
2180
+ columnKey: column.key,
2181
+ sourceRow,
2182
+ targetRows
2183
+ });
2184
+ const updatedRows = [...rawRows];
2185
+ const indexes = [];
2186
+
2187
+ for (let i = startRowIndex; i < endRowIndex; i++) {
2188
+ const targetRowIdx = i - startRowIndex;
2189
+
2190
+ if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {
2191
+ updatedRows[i] = updatedTargetRows[targetRowIdx];
2192
+ indexes.push(i);
2193
+ }
2194
+ }
2195
+
2196
+ if (indexes.length > 0) {
2197
+ onRowsChange(updatedRows, {
2198
+ indexes,
2199
+ column
2200
+ });
2201
+ }
2202
+
2203
+ setDraggedOverRowIdx(undefined);
2559
2204
  }
2560
2205
 
2561
- function isRowIdxWithinViewportBounds(rowIdx) {
2562
- return rowIdx >= 0 && rowIdx < rows.length;
2206
+ function handleMouseDown(event) {
2207
+ if (event.buttons !== 1) return;
2208
+ setDragging(true);
2209
+ window.addEventListener('mouseover', onMouseOver);
2210
+ window.addEventListener('mouseup', onMouseUp);
2211
+
2212
+ function onMouseOver(event) {
2213
+ if (event.buttons !== 1) onMouseUp();
2214
+ }
2215
+
2216
+ function onMouseUp() {
2217
+ window.removeEventListener('mouseover', onMouseOver);
2218
+ window.removeEventListener('mouseup', onMouseUp);
2219
+ setDragging(false);
2220
+ handleDragEnd();
2221
+ }
2563
2222
  }
2564
2223
 
2565
- function isCellWithinSelectionBounds({
2566
- idx,
2567
- rowIdx
2568
- }) {
2569
- return rowIdx >= minRowIdx && rowIdx <= maxRowIdx && isColIdxWithinSelectionBounds(idx);
2224
+ function handleDoubleClick(event) {
2225
+ event.stopPropagation();
2226
+ if (!onFill || !onRowsChange) return;
2227
+ const {
2228
+ idx,
2229
+ rowIdx
2230
+ } = selectedPosition;
2231
+ const sourceRow = rawRows[rowIdx];
2232
+ const targetRows = rawRows.slice(rowIdx + 1);
2233
+ const column = columns[idx];
2234
+ const updatedTargetRows = onFill({
2235
+ columnKey: column.key,
2236
+ sourceRow,
2237
+ targetRows
2238
+ });
2239
+ const updatedRows = [...rawRows];
2240
+ const indexes = [];
2241
+
2242
+ for (let i = rowIdx + 1; i < updatedRows.length; i++) {
2243
+ const targetRowIdx = i - rowIdx - 1;
2244
+
2245
+ if (updatedRows[i] !== updatedTargetRows[targetRowIdx]) {
2246
+ updatedRows[i] = updatedTargetRows[targetRowIdx];
2247
+ indexes.push(i);
2248
+ }
2249
+ }
2250
+
2251
+ if (indexes.length > 0) {
2252
+ onRowsChange(updatedRows, {
2253
+ indexes,
2254
+ column
2255
+ });
2256
+ }
2257
+ }
2258
+
2259
+ function handleEditorRowChange(row, commitChanges) {
2260
+ if (selectedPosition.mode === 'SELECT') return;
2261
+
2262
+ if (commitChanges) {
2263
+ updateRow(getRawRowIdx(selectedPosition.rowIdx), row);
2264
+ closeEditor();
2265
+ } else {
2266
+ setSelectedPosition(position => ({ ...position,
2267
+ row
2268
+ }));
2269
+ }
2270
+ }
2271
+
2272
+ function handleOnClose(commitChanges) {
2273
+ if (commitChanges) {
2274
+ commitEditorChanges();
2275
+ }
2276
+
2277
+ closeEditor();
2570
2278
  }
2571
2279
 
2572
- function isCellWithinViewportBounds({
2280
+ function isCellWithinBounds({
2573
2281
  idx,
2574
2282
  rowIdx
2575
2283
  }) {
2576
- return isRowIdxWithinViewportBounds(rowIdx) && isColIdxWithinSelectionBounds(idx);
2284
+ return rowIdx >= 0 && rowIdx < rows.length && idx >= minColIdx && idx < columns.length;
2577
2285
  }
2578
2286
 
2579
2287
  function isCellEditable(position) {
2580
- return isCellWithinViewportBounds(position) && isSelectedCellEditable({
2288
+ return isCellWithinBounds(position) && isSelectedCellEditable({
2581
2289
  columns,
2582
2290
  rows,
2583
2291
  selectedPosition: position,
@@ -2586,23 +2294,37 @@ function DataGrid({
2586
2294
  }
2587
2295
 
2588
2296
  function selectCell(position, enableEditor) {
2589
- if (!isCellWithinSelectionBounds(position)) return;
2297
+ if (!isCellWithinBounds(position)) return;
2590
2298
  commitEditorChanges();
2591
2299
 
2592
2300
  if (enableEditor && isCellEditable(position)) {
2593
2301
  const row = rows[position.rowIdx];
2594
2302
  setSelectedPosition({ ...position,
2595
2303
  mode: 'EDIT',
2304
+ key: null,
2596
2305
  row,
2597
2306
  originalRow: row
2598
2307
  });
2599
- } else if (isSamePosition(selectedPosition, position)) {
2600
- scrollToCell(position);
2601
2308
  } else {
2602
2309
  setSelectedPosition({ ...position,
2603
2310
  mode: 'SELECT'
2604
2311
  });
2605
2312
  }
2313
+
2314
+ onSelectedCellChange == null ? void 0 : onSelectedCellChange({ ...position
2315
+ });
2316
+ }
2317
+
2318
+ function closeEditor() {
2319
+ if (selectedPosition.mode === 'SELECT') return;
2320
+ setSelectedPosition(({
2321
+ idx,
2322
+ rowIdx
2323
+ }) => ({
2324
+ idx,
2325
+ rowIdx,
2326
+ mode: 'SELECT'
2327
+ }));
2606
2328
  }
2607
2329
 
2608
2330
  function scrollToCell({
@@ -2618,7 +2340,7 @@ function DataGrid({
2618
2340
  var _rowIdx;
2619
2341
 
2620
2342
  (_rowIdx = rowIdx) != null ? _rowIdx : rowIdx = selectedPosition.rowIdx;
2621
- if (!isCellWithinSelectionBounds({
2343
+ if (!isCellWithinBounds({
2622
2344
  rowIdx,
2623
2345
  idx
2624
2346
  })) return;
@@ -2631,35 +2353,34 @@ function DataGrid({
2631
2353
  width
2632
2354
  } = columnMetrics.get(column);
2633
2355
  let right = left + width;
2634
- const colSpan = getSelectedCellColSpan({
2635
- rows,
2636
- summaryRows,
2637
- rowIdx,
2638
- lastFrozenColumnIndex,
2639
- column,
2640
- isGroupRow
2641
- });
2356
+ const row = rows[rowIdx];
2642
2357
 
2643
- if (colSpan !== undefined) {
2644
- const {
2645
- left,
2646
- width
2647
- } = columnMetrics.get(columns[column.idx + colSpan - 1]);
2648
- right = left + width;
2358
+ if (!isGroupRow(row)) {
2359
+ const colSpan = getColSpan(column, lastFrozenColumnIndex, {
2360
+ type: 'ROW',
2361
+ row
2362
+ });
2363
+
2364
+ if (colSpan !== undefined) {
2365
+ const {
2366
+ left,
2367
+ width
2368
+ } = columnMetrics.get(columns[column.idx + colSpan - 1]);
2369
+ right = left + width;
2370
+ }
2649
2371
  }
2650
2372
 
2651
2373
  const isCellAtLeftBoundary = left < scrollLeft + totalFrozenColumnWidth;
2652
2374
  const isCellAtRightBoundary = right > clientWidth + scrollLeft;
2653
- const sign = isRtl ? -1 : 1;
2654
2375
 
2655
2376
  if (isCellAtLeftBoundary) {
2656
- current.scrollLeft = (left - totalFrozenColumnWidth) * sign;
2377
+ current.scrollLeft = left - totalFrozenColumnWidth;
2657
2378
  } else if (isCellAtRightBoundary) {
2658
- current.scrollLeft = (right - clientWidth) * sign;
2379
+ current.scrollLeft = right - clientWidth;
2659
2380
  }
2660
2381
  }
2661
2382
 
2662
- if (typeof rowIdx === 'number' && isRowIdxWithinViewportBounds(rowIdx)) {
2383
+ if (typeof rowIdx === 'number') {
2663
2384
  const rowTop = getRowTop(rowIdx);
2664
2385
  const rowHeight = getRowHeight(rowIdx);
2665
2386
 
@@ -2677,9 +2398,9 @@ function DataGrid({
2677
2398
  rowIdx
2678
2399
  } = selectedPosition;
2679
2400
  const row = rows[rowIdx];
2680
- const isRowSelected = selectedCellIsWithinSelectionBounds && idx === -1;
2401
+ const isRowSelected = isCellWithinBounds(selectedPosition) && idx === -1;
2681
2402
 
2682
- if (key === leftKey && isRowSelected && isGroupRow(row) && !row.isExpanded && row.level !== 0) {
2403
+ if (key === 'ArrowLeft' && isRowSelected && isGroupRow(row) && !row.isExpanded && row.level !== 0) {
2683
2404
  let parentRowIdx = -1;
2684
2405
 
2685
2406
  for (let i = selectedPosition.rowIdx - 1; i >= 0; i--) {
@@ -2713,24 +2434,28 @@ function DataGrid({
2713
2434
  };
2714
2435
 
2715
2436
  case 'ArrowLeft':
2716
- return isRtl ? {
2717
- idx: idx + 1,
2718
- rowIdx
2719
- } : {
2437
+ return {
2720
2438
  idx: idx - 1,
2721
2439
  rowIdx
2722
2440
  };
2723
2441
 
2724
2442
  case 'ArrowRight':
2725
- return isRtl ? {
2726
- idx: idx - 1,
2727
- rowIdx
2728
- } : {
2443
+ return {
2729
2444
  idx: idx + 1,
2730
2445
  rowIdx
2731
2446
  };
2732
2447
 
2733
2448
  case 'Tab':
2449
+ if (selectedPosition.idx === -1 && selectedPosition.rowIdx === -1) {
2450
+ return shiftKey ? {
2451
+ idx: columns.length - 1,
2452
+ rowIdx: rows.length - 1
2453
+ } : {
2454
+ idx: 0,
2455
+ rowIdx: 0
2456
+ };
2457
+ }
2458
+
2734
2459
  return {
2735
2460
  idx: idx + (shiftKey ? -1 : 1),
2736
2461
  rowIdx
@@ -2741,9 +2466,12 @@ function DataGrid({
2741
2466
  idx,
2742
2467
  rowIdx: 0
2743
2468
  };
2744
- return {
2469
+ return ctrlKey ? {
2745
2470
  idx: 0,
2746
- rowIdx: ctrlKey ? minRowIdx : rowIdx
2471
+ rowIdx: 0
2472
+ } : {
2473
+ idx: 0,
2474
+ rowIdx
2747
2475
  };
2748
2476
 
2749
2477
  case 'End':
@@ -2751,14 +2479,16 @@ function DataGrid({
2751
2479
  idx,
2752
2480
  rowIdx: rows.length - 1
2753
2481
  };
2754
- return {
2755
- idx: maxColIdx,
2756
- rowIdx: ctrlKey ? maxRowIdx : rowIdx
2482
+ return ctrlKey ? {
2483
+ idx: columns.length - 1,
2484
+ rowIdx: rows.length - 1
2485
+ } : {
2486
+ idx: columns.length - 1,
2487
+ rowIdx
2757
2488
  };
2758
2489
 
2759
2490
  case 'PageUp':
2760
2491
  {
2761
- if (selectedPosition.rowIdx === minRowIdx) return selectedPosition;
2762
2492
  const nextRowY = getRowTop(rowIdx) + getRowHeight(rowIdx) - clientHeight;
2763
2493
  return {
2764
2494
  idx,
@@ -2768,7 +2498,6 @@ function DataGrid({
2768
2498
 
2769
2499
  case 'PageDown':
2770
2500
  {
2771
- if (selectedPosition.rowIdx >= rows.length) return selectedPosition;
2772
2501
  const nextRowY = getRowTop(rowIdx) + clientHeight;
2773
2502
  return {
2774
2503
  idx,
@@ -2782,6 +2511,13 @@ function DataGrid({
2782
2511
  }
2783
2512
 
2784
2513
  function navigate(event) {
2514
+ if (selectedPosition.mode === 'EDIT') {
2515
+ var _columns$selectedPosi2, _columns$selectedPosi3;
2516
+
2517
+ const onNavigation = (_columns$selectedPosi2 = (_columns$selectedPosi3 = columns[selectedPosition.idx].editorOptions) == null ? void 0 : _columns$selectedPosi3.onNavigation) != null ? _columns$selectedPosi2 : onEditorNavigation;
2518
+ if (!onNavigation(event)) return;
2519
+ }
2520
+
2785
2521
  const {
2786
2522
  key,
2787
2523
  shiftKey
@@ -2792,9 +2528,8 @@ function DataGrid({
2792
2528
  if (canExitGrid({
2793
2529
  shiftKey,
2794
2530
  cellNavigationMode,
2795
- maxColIdx,
2796
- minRowIdx,
2797
- maxRowIdx,
2531
+ columns,
2532
+ rowsCount: rows.length,
2798
2533
  selectedPosition
2799
2534
  })) {
2800
2535
  commitEditorChanges();
@@ -2806,23 +2541,18 @@ function DataGrid({
2806
2541
 
2807
2542
  event.preventDefault();
2808
2543
  const ctrlKey = isCtrlKeyHeldDown(event);
2809
- const nextPosition = getNextPosition(key, ctrlKey, shiftKey);
2810
- if (isSamePosition(selectedPosition, nextPosition)) return;
2811
- const nextSelectedCellPosition = getNextSelectedCellPosition({
2544
+ const nextPosition = getNextSelectedCellPosition({
2812
2545
  columns,
2813
2546
  colSpanColumns,
2814
2547
  rows,
2815
- summaryRows,
2816
- minRowIdx,
2817
- maxRowIdx,
2818
2548
  lastFrozenColumnIndex,
2819
2549
  cellNavigationMode: mode,
2820
2550
  currentPosition: selectedPosition,
2821
- nextPosition,
2822
- isCellWithinBounds: isCellWithinSelectionBounds,
2551
+ nextPosition: getNextPosition(key, ctrlKey, shiftKey),
2552
+ isCellWithinBounds,
2823
2553
  isGroupRow
2824
2554
  });
2825
- selectCell(nextSelectedCellPosition);
2555
+ selectCell(nextPosition);
2826
2556
  }
2827
2557
 
2828
2558
  function getDraggedOverCellIdx(currentRowIdx) {
@@ -2834,119 +2564,49 @@ function DataGrid({
2834
2564
  return isDraggedOver ? selectedPosition.idx : undefined;
2835
2565
  }
2836
2566
 
2837
- function getLayoutCssVars() {
2838
- if (autoResizeColumn === null) return layoutCssVars;
2839
- const {
2840
- gridTemplateColumns
2841
- } = layoutCssVars;
2842
- const newSizes = gridTemplateColumns.split(' ');
2843
- newSizes[autoResizeColumn.idx] = 'max-content';
2844
- return { ...layoutCssVars,
2845
- gridTemplateColumns: newSizes.join(' ')
2846
- };
2847
- }
2567
+ function getSelectedCellProps(rowIdx) {
2568
+ if (selectedPosition.rowIdx !== rowIdx) return;
2848
2569
 
2849
- function getDragHandle(rowIdx) {
2850
- if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === 'EDIT' || hasGroups || onFill == null) {
2851
- return;
2570
+ if (selectedPosition.mode === 'EDIT') {
2571
+ return {
2572
+ mode: 'EDIT',
2573
+ idx: selectedPosition.idx,
2574
+ onKeyDown: handleKeyDown,
2575
+ editorProps: {
2576
+ editorPortalTarget,
2577
+ row: selectedPosition.row,
2578
+ onRowChange: handleEditorRowChange,
2579
+ onClose: handleOnClose
2580
+ }
2581
+ };
2852
2582
  }
2853
2583
 
2854
- return /*#__PURE__*/e$1(DragHandle, {
2855
- rows: rawRows,
2856
- columns: columns,
2857
- selectedPosition: selectedPosition,
2858
- isCellEditable: isCellEditable,
2859
- latestDraggedOverRowIdx: latestDraggedOverRowIdx,
2860
- onRowsChange: onRowsChange,
2861
- onFill: onFill,
2862
- setDragging: setDragging,
2863
- setDraggedOverRowIdx: setDraggedOverRowIdx
2864
- });
2865
- }
2866
-
2867
- function getCellEditor(rowIdx) {
2868
- if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === 'SELECT') return;
2869
- const {
2870
- idx,
2871
- row
2872
- } = selectedPosition;
2873
- const column = columns[idx];
2874
- const colSpan = getColSpan(column, lastFrozenColumnIndex, {
2875
- type: 'ROW',
2876
- row
2877
- });
2878
-
2879
- const closeEditor = () => {
2880
- setSelectedPosition(({
2881
- idx,
2882
- rowIdx
2883
- }) => ({
2884
- idx,
2885
- rowIdx,
2886
- mode: 'SELECT'
2887
- }));
2888
- };
2889
-
2890
- const onRowChange = (row, commitChanges) => {
2891
- if (commitChanges) {
2892
- updateRow(selectedPosition.rowIdx, row);
2893
- closeEditor();
2894
- } else {
2895
- setSelectedPosition(position => ({ ...position,
2896
- row
2897
- }));
2898
- }
2584
+ return {
2585
+ mode: 'SELECT',
2586
+ idx: selectedPosition.idx,
2587
+ onFocus: handleFocus,
2588
+ onKeyDown: handleKeyDown,
2589
+ dragHandleProps: enableCellDragAndDrop && isCellEditable(selectedPosition) ? {
2590
+ onMouseDown: handleMouseDown,
2591
+ onDoubleClick: handleDoubleClick
2592
+ } : undefined
2899
2593
  };
2900
-
2901
- if (rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) {
2902
- closeEditor();
2903
- }
2904
-
2905
- return /*#__PURE__*/e$1(EditCell, {
2906
- column: column,
2907
- colSpan: colSpan,
2908
- row: row,
2909
- onRowChange: onRowChange,
2910
- closeEditor: closeEditor,
2911
- scrollToCell: () => {
2912
- scrollToCell(selectedPosition);
2913
- }
2914
- }, column.key);
2915
2594
  }
2916
2595
 
2917
2596
  function getViewportRows() {
2918
2597
  const rowElements = [];
2919
2598
  let startRowIndex = 0;
2920
- const {
2921
- idx: selectedIdx,
2922
- rowIdx: selectedRowIdx
2923
- } = selectedPosition;
2924
- const startRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx < rowOverscanStartIdx ? rowOverscanStartIdx - 1 : rowOverscanStartIdx;
2925
- const endRowIdx = selectedCellIsWithinViewportBounds && selectedRowIdx > rowOverscanEndIdx ? rowOverscanEndIdx + 1 : rowOverscanEndIdx;
2926
-
2927
- for (let viewportRowIdx = startRowIdx; viewportRowIdx <= endRowIdx; viewportRowIdx++) {
2928
- const isRowOutsideViewport = viewportRowIdx === rowOverscanStartIdx - 1 || viewportRowIdx === rowOverscanEndIdx + 1;
2929
- const rowIdx = isRowOutsideViewport ? selectedRowIdx : viewportRowIdx;
2930
- let rowColumns = viewportColumns;
2931
- const selectedColumn = columns[selectedIdx];
2932
-
2933
- if (selectedColumn !== undefined) {
2934
- if (isRowOutsideViewport) {
2935
- rowColumns = [selectedColumn];
2936
- } else if (selectedRowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) {
2937
- rowColumns = selectedIdx > viewportColumns[viewportColumns.length - 1].idx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)];
2938
- }
2939
- }
2940
2599
 
2600
+ for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {
2941
2601
  const row = rows[rowIdx];
2942
- const gridRowStart = headerRowsCount + rowIdx + 1;
2602
+ const top = getRowTop(rowIdx) + headerRowHeight;
2943
2603
 
2944
2604
  if (isGroupRow(row)) {
2945
2605
  ({
2946
2606
  startRowIndex
2947
2607
  } = row);
2948
- const isGroupRowSelected = isSelectable && row.childRows.every(cr => selectedRows.has(rowKeyGetter(cr)));
2949
- rowElements.push( /*#__PURE__*/e$1(GroupRowRenderer, {
2608
+ const isGroupRowSelected = isSelectable && row.childRows.every(cr => selectedRows == null ? void 0 : selectedRows.has(rowKeyGetter(cr)));
2609
+ rowElements.push( /*#__PURE__*/e(GroupRowRenderer, {
2950
2610
  "aria-level": row.level + 1,
2951
2611
  "aria-setsize": row.setSize,
2952
2612
  "aria-posinset": row.posInSet + 1,
@@ -2954,18 +2614,19 @@ function DataGrid({
2954
2614
  "aria-selected": isSelectable ? isGroupRowSelected : undefined,
2955
2615
  id: row.id,
2956
2616
  groupKey: row.groupKey,
2957
- viewportColumns: rowColumns,
2617
+ viewportColumns: viewportColumns,
2958
2618
  childRows: row.childRows,
2959
2619
  rowIdx: rowIdx,
2960
- row: row,
2961
- gridRowStart: gridRowStart,
2620
+ top: top,
2962
2621
  height: getRowHeight(rowIdx),
2963
2622
  level: row.level,
2964
2623
  isExpanded: row.isExpanded,
2965
- selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,
2624
+ selectedCellIdx: selectedPosition.rowIdx === rowIdx ? selectedPosition.idx : undefined,
2966
2625
  isRowSelected: isGroupRowSelected,
2967
- selectGroup: selectGroupLatest,
2968
- toggleGroup: toggleGroupLatest
2626
+ onFocus: selectedPosition.rowIdx === rowIdx ? handleFocus : undefined,
2627
+ onKeyDown: selectedPosition.rowIdx === rowIdx ? handleKeyDown : undefined,
2628
+ selectCell: selectCellWrapper,
2629
+ toggleGroup: toggleGroupWrapper
2969
2630
  }, row.id));
2970
2631
  continue;
2971
2632
  }
@@ -2983,49 +2644,40 @@ function DataGrid({
2983
2644
  key = hasGroups ? startRowIndex : rowIdx;
2984
2645
  }
2985
2646
 
2986
- rowElements.push( /*#__PURE__*/e$1(RowRenderer, {
2647
+ rowElements.push( /*#__PURE__*/e(RowRenderer, {
2987
2648
  "aria-rowindex": headerRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1,
2988
2649
  "aria-selected": isSelectable ? isRowSelected : undefined,
2989
2650
  rowIdx: rowIdx,
2990
2651
  row: row,
2991
- viewportColumns: rowColumns,
2652
+ viewportColumns: viewportColumns,
2992
2653
  isRowSelected: isRowSelected,
2993
2654
  onRowClick: onRowClick,
2994
- onRowDoubleClick: onRowDoubleClick,
2995
2655
  rowClass: rowClass,
2996
- gridRowStart: gridRowStart,
2656
+ top: top,
2997
2657
  height: getRowHeight(rowIdx),
2998
2658
  copiedCellIdx: copiedCell !== null && copiedCell.row === row ? columns.findIndex(c => c.key === copiedCell.columnKey) : undefined,
2999
- selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,
3000
2659
  draggedOverCellIdx: getDraggedOverCellIdx(rowIdx),
3001
2660
  setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : undefined,
3002
2661
  lastFrozenColumnIndex: lastFrozenColumnIndex,
3003
- onRowChange: handleFormatterRowChangeLatest,
3004
- selectCell: selectViewportCellLatest,
3005
- selectedCellDragHandle: getDragHandle(rowIdx),
3006
- selectedCellEditor: getCellEditor(rowIdx)
2662
+ selectedCellProps: getSelectedCellProps(rowIdx),
2663
+ onRowChange: handleFormatterRowChangeWrapper,
2664
+ selectCell: selectCellWrapper
3007
2665
  }, key));
3008
2666
  }
3009
2667
 
3010
2668
  return rowElements;
3011
2669
  }
3012
2670
 
3013
- if (selectedPosition.idx > maxColIdx || selectedPosition.rowIdx > maxRowIdx) {
2671
+ if (selectedPosition.idx >= columns.length || selectedPosition.rowIdx >= rows.length) {
3014
2672
  setSelectedPosition(initialPosition);
3015
2673
  setDraggedOverRowIdx(undefined);
3016
2674
  }
3017
2675
 
3018
- let templateRows = `${headerRowHeight}px`;
3019
-
3020
- if (rows.length > 0) {
3021
- templateRows += gridTemplateRows;
3022
- }
3023
-
3024
- if (summaryRowsCount > 0) {
3025
- templateRows += ` repeat(${summaryRowsCount}, ${summaryRowHeight}px)`;
2676
+ if (selectedPosition.mode === 'EDIT' && rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) {
2677
+ closeEditor();
3026
2678
  }
3027
2679
 
3028
- return /*#__PURE__*/e$1("div", {
2680
+ return /*#__PURE__*/e("div", {
3029
2681
  role: hasGroups ? 'treegrid' : 'grid',
3030
2682
  "aria-label": ariaLabel,
3031
2683
  "aria-labelledby": ariaLabelledBy,
@@ -3033,78 +2685,57 @@ function DataGrid({
3033
2685
  "aria-multiselectable": isSelectable ? true : undefined,
3034
2686
  "aria-colcount": columns.length,
3035
2687
  "aria-rowcount": headerRowsCount + rowsCount + summaryRowsCount,
3036
- className: clsx(rootClassname, className, isDragging && viewportDraggingClassname, autoResizeColumn !== null && cellAutoResizeClassname),
2688
+ className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),
3037
2689
  style: { ...style,
3038
- gridTemplateRows: templateRows,
3039
- '--rdg-header-row-height': `${headerRowHeight}px`,
3040
- '--rdg-grid-inline-size': `${totalColumnWidth}px`,
3041
- '--rdg-summary-row-height': `${summaryRowHeight}px`,
3042
- '--rdg-grid-block-size': `${max(totalRowHeight, clientHeight) + headerRowHeight + summaryRowsCount * summaryRowHeight}px`,
3043
- '--rdg-sign': isRtl ? -1 : 1,
3044
- ...getLayoutCssVars()
2690
+ '--header-row-height': `${headerRowHeight}px`,
2691
+ '--row-width': `${totalColumnWidth}px`,
2692
+ '--summary-row-height': `${summaryRowHeight}px`,
2693
+ ...layoutCssVars
3045
2694
  },
3046
- dir: direction,
3047
2695
  ref: gridRef,
3048
2696
  onScroll: handleScroll,
3049
- onKeyDown: handleKeyDown,
3050
- "data-testid": testId,
3051
- children: [hasGroups && /*#__PURE__*/e$1("div", {
3052
- ref: rowRef,
3053
- tabIndex: selectedPosition.idx === -1 && selectedPosition.rowIdx !== -2 ? 0 : -1,
3054
- className: focusSinkClassname,
3055
- style: {
3056
- gridRowStart: selectedPosition.rowIdx + 2
3057
- },
3058
- onKeyDown: handleKeyDown
3059
- }), /*#__PURE__*/e$1(DataGridDefaultComponentsProvider, {
3060
- value: defaultGridComponents,
3061
- children: [/*#__PURE__*/e$1(HeaderRow$1, {
3062
- columns: viewportColumns,
3063
- onColumnResize: handleColumnResize,
3064
- allRowsSelected: allRowsSelected,
3065
- onAllRowsSelectionChange: selectAllRowsLatest,
3066
- sortColumns: sortColumns,
3067
- onSortColumnsChange: onSortColumnsChange,
3068
- lastFrozenColumnIndex: lastFrozenColumnIndex,
3069
- selectedCellIdx: isHeaderRowSelected ? selectedPosition.idx : undefined,
3070
- selectCell: selectHeaderCellLatest,
3071
- shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
3072
- direction: direction
3073
- }), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/e$1(d$1, {
3074
- children: [/*#__PURE__*/e$1(RowSelectionChangeProvider, {
3075
- value: selectRowLatest,
3076
- children: getViewportRows()
3077
- }), summaryRows == null ? void 0 : summaryRows.map((row, rowIdx) => {
3078
- const gridRowStart = headerRowsCount + rows.length + rowIdx + 1;
3079
- const isSummaryRowSelected = selectedPosition.rowIdx === headerRowsCount + rows.length + rowIdx - 1;
3080
- const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (summaryRows.length - rowIdx) : undefined;
3081
- const bottom = top === undefined ? summaryRowHeight * (summaryRows.length - 1 - rowIdx) : undefined;
3082
- return /*#__PURE__*/e$1(SummaryRow$1, {
3083
- "aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
3084
- rowIdx: rowIdx,
3085
- gridRowStart: gridRowStart,
3086
- row: row,
3087
- top: top,
3088
- bottom: bottom,
3089
- viewportColumns: viewportColumns,
3090
- lastFrozenColumnIndex: lastFrozenColumnIndex,
3091
- selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
3092
- selectCell: selectSummaryCellLatest
3093
- }, rowIdx);
3094
- })]
3095
- })]
2697
+ children: [/*#__PURE__*/e(HeaderRow$1, {
2698
+ rowKeyGetter: rowKeyGetter,
2699
+ rows: rawRows,
2700
+ columns: viewportColumns,
2701
+ onColumnResize: handleColumnResize,
2702
+ allRowsSelected: allRowsSelected,
2703
+ onSelectedRowsChange: onSelectedRowsChange,
2704
+ sortColumns: sortColumns,
2705
+ onSortColumnsChange: onSortColumnsChange,
2706
+ lastFrozenColumnIndex: lastFrozenColumnIndex
2707
+ }), rows.length === 0 && EmptyRowsRenderer ? /*#__PURE__*/e(EmptyRowsRenderer, {}) : /*#__PURE__*/e(d$1, {
2708
+ children: [/*#__PURE__*/e("div", {
2709
+ ref: focusSinkRef,
2710
+ tabIndex: 0,
2711
+ className: focusSinkClassname,
2712
+ onKeyDown: handleKeyDown,
2713
+ onFocus: onGridFocus
2714
+ }), /*#__PURE__*/e("div", {
2715
+ style: {
2716
+ height: max(totalRowHeight, clientHeight)
2717
+ }
2718
+ }), /*#__PURE__*/e(RowSelectionChangeProvider, {
2719
+ value: selectRowWrapper,
2720
+ children: getViewportRows()
2721
+ }), summaryRows == null ? void 0 : summaryRows.map((row, rowIdx) => /*#__PURE__*/e(SummaryRow$1, {
2722
+ "aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
2723
+ rowIdx: rowIdx,
2724
+ row: row,
2725
+ bottom: summaryRowHeight * (summaryRows.length - 1 - rowIdx),
2726
+ viewportColumns: viewportColumns,
2727
+ lastFrozenColumnIndex: lastFrozenColumnIndex
2728
+ }, rowIdx))]
3096
2729
  })]
3097
2730
  });
3098
2731
  }
3099
2732
 
3100
- function isSamePosition(p1, p2) {
3101
- return p1.idx === p2.idx && p1.rowIdx === p2.rowIdx;
3102
- }
3103
-
3104
2733
  const DataGrid$1 = /*#__PURE__*/x(DataGrid);
3105
2734
 
3106
- var css_248z$g = ".t16y9g8l700-beta11{appearance:none;background-color:var(--rdg-background-color);block-size:100%;border:2px solid #ccc;box-sizing:border-box;color:var(--rdg-color);font-family:inherit;font-size:var(--rdg-font-size);inline-size:100%;padding-block:0;padding-inline:6px;vertical-align:top}.t16y9g8l700-beta11:focus{border-color:var(--rdg-selection-color);outline:none}.t16y9g8l700-beta11::placeholder{color:#999;opacity:1}";
3107
- styleInject$1(css_248z$g,{"insertAt":"top"});
2735
+ var css_248z$c = ".t16y9g8l700-canary49{appearance:none;box-sizing:border-box;width:100%;height:100%;padding:0 6px;border:2px solid #ccc;vertical-align:top;color:var(--color);background-color:var(--background-color);font-family:inherit;font-size:var(--font-size)}.t16y9g8l700-canary49:focus{border-color:var(--selection-color);outline:none}.t16y9g8l700-canary49::placeholder{color:#999;opacity:1}";
2736
+ styleInject$1(css_248z$c);
2737
+
2738
+ var DataGrid$2 = DataGrid$1;
3108
2739
 
3109
2740
  function styleInject(css, ref) {
3110
2741
  if ( ref === void 0 ) ref = {};
@@ -3197,7 +2828,7 @@ var ReactTable = function (_a) {
3197
2828
  }
3198
2829
  setItems(items);
3199
2830
  }, [columns, data, sort]);
3200
- return e$1(DataGrid$1, { columns: listColumns, headerRowHeight: 24, rows: items, rowKeyGetter: rowKeyGetter, rowHeight: 20, className: darkMode ? "rdg-dark" : "rdg-light", sortColumns: sortColumn ? [sortColumn] : [], onSortColumnsChange: onSortColumnsChange, selectedRows: selectedRows, onSelectedRowsChange: multiSelect ? onSelectedRowsChange : undefined, onRowClick: multiSelect ? undefined : onRowClick, "aria-describedby": "", "aria-label": "", "aria-labelledby": "", style: { height: "100%" } });
2831
+ return v$1(DataGrid$2, { columns: listColumns, headerRowHeight: 24, rows: items, rowKeyGetter: rowKeyGetter, rowHeight: 20, className: darkMode ? "rdg-dark" : "rdg-light", sortColumns: sortColumn ? [sortColumn] : [], onSortColumnsChange: onSortColumnsChange, selectedRows: selectedRows, onSelectedRowsChange: multiSelect ? onSelectedRowsChange : undefined, onRowClick: multiSelect ? undefined : onRowClick, "aria-describedby": "", "aria-label": "", "aria-labelledby": "", style: { height: "100%" } });
3201
2832
  };
3202
2833
  var Table = /** @class */ (function (_super) {
3203
2834
  __extends(Table, _super);
@@ -3206,7 +2837,7 @@ var Table = /** @class */ (function (_super) {
3206
2837
  }
3207
2838
  Table.prototype.renderTable = function () {
3208
2839
  var _this = this;
3209
- return e$1(ReactTable, { columns: this.columns(), data: this.data(), darkMode: this.darkMode(), onRowClickCallback: function (row, column) {
2840
+ return v$1(ReactTable, { columns: this.columns(), data: this.data(), darkMode: this.darkMode(), onRowClickCallback: function (row, column) {
3210
2841
  var _a;
3211
2842
  if (column === void 0) { column = ""; }
3212
2843
  if (_this._prevRow && JSON.stringify(_this._prevRow) !== JSON.stringify(row)) {