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