@hpcc-js/dgrid2 2.3.10 → 2.3.12
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 +648 -672
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2846 -2870
- 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 +8 -8
- package/src/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.es6.js
CHANGED
|
@@ -1,77 +1,82 @@
|
|
|
1
1
|
import { format, timeParse, timeFormat, publish, HTMLWidget } from '@hpcc-js/common';
|
|
2
2
|
|
|
3
3
|
var PKG_NAME = "@hpcc-js/dgrid2";
|
|
4
|
-
var PKG_VERSION = "2.3.
|
|
5
|
-
var BUILD_VERSION = "2.104.
|
|
6
|
-
|
|
7
|
-
/******************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
/* global Reflect, Promise */
|
|
22
|
-
|
|
23
|
-
var extendStatics = function(d, b) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function __extends(d, b) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
var __assign = function() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
function __decorate(decorators, target, key, desc) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function __metadata(metadataKey, metadataValue) {
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function __spreadArray(to, from, pack) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var n,l$1,u$1,t$1,o$2,r$2,f$1,e$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y$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 d$1(l,f,t,o,null)}function d$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 k$2(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$2(n,l){if(null==l)return n.__?g$2(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?g$2(n):null}function m$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 m$1(n)}}function w$2(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!x$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||r$2)(x$1);}function x$1(){var n,l,u,i,o,r,e,c;for(t$1.sort(f$1);n=t$1.shift();)n.__d&&(l=t$1.length,i=void 0,o=void 0,e=(r=(u=n).__v).__e,(c=u.__P)&&(i=[],(o=h$1({},r)).__v=r.__v+1,L$1(c,r,o,u.__n,void 0!==c.ownerSVGElement,null!=r.__h?[e]:null,i,null==e?g$2(r):e,r.__h),M(i,r),r.__e!=e&&m$1(r)),t$1.length>l&&t$1.sort(f$1));x$1.__r=0;}function P(n,l,u,i,t,o,r,f,e,a){var h,p,y,_,b,m,w,x=i&&i.__k||s$1,P=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _||"function"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?d$1(null,_,null,null,_):v$1(_)?d$1(k$2,{children:_},null,null,null):_.__b>0?d$1(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(y=x[h])||y&&_.key==y.key&&_.type===y.type)x[h]=void 0;else for(p=0;p<P;p++){if((y=x[p])&&_.key==y.key&&_.type===y.type){x[p]=void 0;break}y=null;}L$1(n,_,y=y||c$1,t,o,r,f,e,a),b=_.__e,(p=_.ref)&&y.ref!=p&&(w||(w=[]),y.ref&&w.push(y.ref,null,_),w.push(p,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===y.__k?_.__d=e=C$1(_,e,n):e=$$1(n,_,y,x,b,e),"function"==typeof u.type&&(u.__d=e)):e&&y.__e==e&&e.parentNode!=n&&(e=g$2(y));}for(u.__e=m,h=P;h--;)null!=x[h]&&("function"==typeof u.type&&null!=x[h].__e&&x[h].__e==u.__d&&(u.__d=A$1(i).nextSibling),q$2(x[h],x[h]));if(w)for(h=0;h<w.length;h++)O(w[h],w[++h],w[++h]);}function C$1(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?C$1(i,l,u):$$1(u,i,i,t,i.__e,l));return l}function S(n,l){return l=l||[],null==n||"boolean"==typeof n||(v$1(n)?n.some(function(n){S(n,l);}):l.push(n)),l}function $$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+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function A$1(n){var l,u,i;if(null==n.type||"string"==typeof n.type)return n.__e;if(n.__k)for(l=n.__k.length-1;l>=0;l--)if((u=n.__k[l])&&(i=A$1(u)))return i;return null}function H$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||T$2(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]||T$2(n,o,l[o],u[o],i);}function I$1(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function T$2(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||I$1(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||I$1(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?z$1:j$1,o):n.removeEventListener(l,o?z$1:j$1,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function j$1(n){return this.l[n.type+!1](l$1.event?l$1.event(n):n)}function z$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function L$1(n,u,i,t,o,r,f,e,c){var s,a,p,y,d,_,g,m,w,x,C,S,$,A,H,I=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 I){if(m=u.props,w=(s=I.contextType)&&t[s.__c],x=s?w?w.props.value:s.__:t,i.__c?g=(a=u.__c=i.__c).__=a.__E:("prototype"in I&&I.prototype.render?u.__c=a=new I(m,x):(u.__c=a=new b$1(m,x),a.constructor=I,a.render=B$2),w&&w.sub(a),a.props=m,a.state||(a.state={}),a.context=x,a.__n=t,p=a.__d=!0,a.__h=[],a._sb=[]),null==a.__s&&(a.__s=a.state),null!=I.getDerivedStateFromProps&&(a.__s==a.state&&(a.__s=h$1({},a.__s)),h$1(a.__s,I.getDerivedStateFromProps(m,a.__s))),y=a.props,d=a.state,a.__v=u,p)null==I.getDerivedStateFromProps&&null!=a.componentWillMount&&a.componentWillMount(),null!=a.componentDidMount&&a.__h.push(a.componentDidMount);else {if(null==I.getDerivedStateFromProps&&m!==y&&null!=a.componentWillReceiveProps&&a.componentWillReceiveProps(m,x),!a.__e&&null!=a.shouldComponentUpdate&&!1===a.shouldComponentUpdate(m,a.__s,x)||u.__v===i.__v){for(u.__v!==i.__v&&(a.props=m,a.state=a.__s,a.__d=!1),a.__e=!1,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<a._sb.length;C++)a.__h.push(a._sb[C]);a._sb=[],a.__h.length&&f.push(a);break n}null!=a.componentWillUpdate&&a.componentWillUpdate(m,a.__s,x),null!=a.componentDidUpdate&&a.__h.push(function(){a.componentDidUpdate(y,d,_);});}if(a.context=x,a.props=m,a.__P=n,S=l$1.__r,$=0,"prototype"in I&&I.prototype.render){for(a.state=a.__s,a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),A=0;A<a._sb.length;A++)a.__h.push(a._sb[A]);a._sb=[];}else do{a.__d=!1,S&&S(u),s=a.render(a.props,a.state,a.context),a.state=a.__s;}while(a.__d&&++$<25);a.state=a.__s,null!=a.getChildContext&&(t=h$1(h$1({},t),a.getChildContext())),p||null==a.getSnapshotBeforeUpdate||(_=a.getSnapshotBeforeUpdate(y,d)),P(n,v$1(H=null!=s&&s.type===k$2&&null==s.key?s.props.children:s)?H:[H],u,i,t,o,r,f,e,c),a.base=u.__e,u.__h=null,a.__h.length&&f.push(a),g&&(a.__E=a.__=null),a.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=N$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 M(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 N$1(l,u,i,t,o,r,f,e){var s,a,h,y=i.props,d=u.props,_=u.type,k=0;if("svg"===_&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!_&&(_?s.localName===_:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===_)return document.createTextNode(d);l=o?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,d.is&&d),r=null,e=!1;}if(null===_)y===d||e&&l.data===d||(l.data=d);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||c$1).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!e){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(h||a)&&(h&&(a&&h.__html==a.__html||h.__html===l.innerHTML)||(l.innerHTML=h&&h.__html||""));}if(H$1(l,d,y,o,e),h)u.__k=[];else if(P(l,v$1(k=u.props.children)?k:[k],u,i,t,o&&"foreignObject"!==_,r,f,r?r[0]:i.__k&&g$2(i,0),e),null!=r)for(k=r.length;k--;)null!=r[k]&&p$1(r[k]);e||("value"in d&&void 0!==(k=d.value)&&(k!==l.value||"progress"===_&&!k||"option"===_&&k!==y.value)&&T$2(l,"value",k,y.value,!1),"checked"in d&&void 0!==(k=d.checked)&&k!==l.checked&&T$2(l,"checked",k,y.checked,!1));}return l}function O(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function q$2(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||O(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,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&q$2(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function B$2(n,l,u){return this.constructor(n,u)}function D$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=[],L$1(i,u=(!o&&t||i).__k=y$1(k$2,null,[u]),r||c$1,c$1,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),M(f,u);}function G$1(n,l){var u={__c:l="__cC"+e$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(function(n){n.__e=!0,w$2(n);});},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=s$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,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$2(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$2(this));},b$1.prototype.render=k$2,t$1=[],r$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x$1.__r=0,e$1=0;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
4
|
+
var PKG_VERSION = "2.3.12";
|
|
5
|
+
var BUILD_VERSION = "2.104.30";
|
|
6
|
+
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */
|
|
21
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
22
|
+
|
|
23
|
+
var extendStatics = function(d, b) {
|
|
24
|
+
extendStatics = Object.setPrototypeOf ||
|
|
25
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
+
return extendStatics(d, b);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function __extends(d, b) {
|
|
31
|
+
if (typeof b !== "function" && b !== null)
|
|
32
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
33
|
+
extendStatics(d, b);
|
|
34
|
+
function __() { this.constructor = d; }
|
|
35
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var __assign = function() {
|
|
39
|
+
__assign = Object.assign || function __assign(t) {
|
|
40
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
41
|
+
s = arguments[i];
|
|
42
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
return __assign.apply(this, arguments);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function __decorate(decorators, target, key, desc) {
|
|
50
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
51
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
52
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
53
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function __metadata(metadataKey, metadataValue) {
|
|
57
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function __spreadArray(to, from, pack) {
|
|
61
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
62
|
+
if (ar || !(i in from)) {
|
|
63
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
64
|
+
ar[i] = from[i];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
71
|
+
var e = new Error(message);
|
|
72
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var n,l$1,u$1,i$1,o$2,r$2,f$1,e$1,c$1={},s$1=[],a$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v$1=Array.isArray;function h$1(n,l){for(var u in l)n[u]=l[u];return n}function p$1(n){var l=n.parentNode;l&&l.removeChild(n);}function y$1(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$1(l,f,i,o,null)}function d$1(n,t,i,o,r){var f={type:n,props:t,key:i,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 k$2(n){return n.children}function b$1(n,l){this.props=n,this.context=l;}function g$2(n,l){if(null==l)return n.__?g$2(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.__d||u.__e;return "function"==typeof n.type?g$2(n):null}function m$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 m$1(n)}}function w$2(n){(!n.__d&&(n.__d=!0)&&i$1.push(n)&&!x$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||r$2)(x$1);}function x$1(){var n,l,u,t,o,r,e,c,s;for(i$1.sort(f$1);n=i$1.shift();)n.__d&&(l=i$1.length,t=void 0,o=void 0,r=void 0,c=(e=(u=n).__v).__e,(s=u.__P)&&(t=[],o=[],(r=h$1({},e)).__v=e.__v+1,z$1(s,e,r,u.__n,void 0!==s.ownerSVGElement,null!=e.__h?[c]:null,t,null==c?g$2(e):c,e.__h,o),L$1(t,e,o),e.__e!=c&&m$1(e)),i$1.length>l&&i$1.sort(f$1));x$1.__r=0;}function P(n,l,u,t,i,o,r,f,e,a,h){var p,y,_,b,m,w,x,P,C,D=0,H=t&&t.__k||s$1,I=H.length,T=I,j=l.length;for(u.__k=[],p=0;p<j;p++)null!=(b=u.__k[p]=null==(b=l[p])||"boolean"==typeof b||"function"==typeof b?null:"string"==typeof b||"number"==typeof b||"bigint"==typeof b?d$1(null,b,null,null,b):v$1(b)?d$1(k$2,{children:b},null,null,null):b.__b>0?d$1(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)?(b.__=u,b.__b=u.__b+1,-1===(P=A$1(b,H,x=p+D,T))?_=c$1:(_=H[P]||c$1,H[P]=void 0,T--),z$1(n,b,_,i,o,r,f,e,a,h),m=b.__e,(y=b.ref)&&_.ref!=y&&(_.ref&&N$1(_.ref,null,b),h.push(y,b.__c||m,b)),null!=m&&(null==w&&(w=m),(C=_===c$1||null===_.__v)?-1==P&&D--:P!==x&&(P===x+1?D++:P>x?T>j-x?D+=P-x:D--:D=P<x&&P==x-1?P-x:0),x=p+D,"function"!=typeof b.type||P===x&&_.__k!==b.__k?"function"==typeof b.type||P===x&&!C?void 0!==b.__d?(e=b.__d,b.__d=void 0):e=m.nextSibling:e=S(n,m,e):e=$$1(b,e,n),"function"==typeof u.type&&(u.__d=e))):(_=H[p])&&null==_.key&&_.__e&&(_.__e==e&&(_.__=t,e=g$2(_)),O(_,_,!1),H[p]=null);for(u.__e=w,p=I;p--;)null!=H[p]&&("function"==typeof u.type&&null!=H[p].__e&&H[p].__e==u.__d&&(u.__d=H[p].__e.nextSibling),O(H[p],H[p]));}function $$1(n,l,u){for(var t,i=n.__k,o=0;i&&o<i.length;o++)(t=i[o])&&(t.__=n,l="function"==typeof t.type?$$1(t,l,u):S(u,t.__e,l));return l}function C$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(v$1(n)?n.some(function(n){C$1(n,l);}):l.push(n)),l}function S(n,l,u){return null==u||u.parentNode!==n?n.insertBefore(l,null):l==u&&null!=l.parentNode||n.insertBefore(l,u),l.nextSibling}function A$1(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&i==e.key&&o===e.type)return f;f++;}}return -1}function D$1(n,l,u,t,i){var o;for(o in u)"children"===o||"key"===o||o in l||I$1(n,o,null,u[o],t);for(o in l)i&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||I$1(n,o,l[o],u[o],t);}function H$1(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$1.test(l)?u:u+"px";}function I$1(n,l,u,t,i){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||H$1(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||H$1(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?j$1:T$2,o)):n.removeEventListener(l,o?j$1:T$2,o);else if("dangerouslySetInnerHTML"!==l){if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function T$2(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return}else n.t=Date.now();return u(l$1.event?l$1.event(n):n)}function j$1(n){return this.l[n.type+!0](l$1.event?l$1.event(n):n)}function z$1(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,g,m,w,x,$,C,S,A,D,H,I=u.type;if(void 0!==u.constructor)return null;null!=t.__h&&(c=t.__h,e=u.__e=t.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);n:if("function"==typeof I)try{if(w=u.props,x=(a=I.contextType)&&i[a.__c],$=a?x?x.props.value:a.__:i,t.__c?m=(p=u.__c=t.__c).__=p.__E:("prototype"in I&&I.prototype.render?u.__c=p=new I(w,$):(u.__c=p=new b$1(w,$),p.constructor=I,p.render=q$2),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=$,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=h$1({},p.__s)),h$1(p.__s,I.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else {if(null==I.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,$),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,$)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&f.push(p);break n}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,$),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,g);});}if(p.context=$,p.props=w,p.__P=n,p.__e=!1,S=l$1.__r,A=0,"prototype"in I&&I.prototype.render){for(p.state=p.__s,p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),D=0;D<p._sb.length;D++)p.__h.push(p._sb[D]);p._sb=[];}else do{p.__d=!1,S&&S(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(i=h$1(h$1({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(g=p.getSnapshotBeforeUpdate(d,_)),P(n,v$1(H=null!=a&&a.type===k$2&&null==a.key?a.props.children:a)?H:[H],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__h=null,p.__h.length&&f.push(p),m&&(p.__E=p.__=null);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=M(t.__e,u,t,i,o,r,f,c,s);(a=l$1.diffed)&&a(u);}function L$1(n,u,t){for(var i=0;i<t.length;i++)N$1(t[i],t[++i],t[++i]);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 M(l,u,t,i,o,r,f,e,s){var a,h,y,d=t.props,_=u.props,k=u.type,b=0;if("svg"===k&&(o=!0),null!=r)for(;b<r.length;b++)if((a=r[b])&&"setAttribute"in a==!!k&&(k?a.localName===k:3===a.nodeType)){l=a,r[b]=null;break}if(null==l){if(null===k)return document.createTextNode(_);l=o?document.createElementNS("http://www.w3.org/2000/svg",k):document.createElement(k,_.is&&_),r=null,e=!1;}if(null===k)d===_||e&&l.data===_||(l.data=_);else {if(r=r&&n.call(l.childNodes),h=(d=t.props||c$1).dangerouslySetInnerHTML,y=_.dangerouslySetInnerHTML,!e){if(null!=r)for(d={},b=0;b<l.attributes.length;b++)d[l.attributes[b].name]=l.attributes[b].value;(y||h)&&(y&&(h&&y.__html==h.__html||y.__html===l.innerHTML)||(l.innerHTML=y&&y.__html||""));}if(D$1(l,_,d,o,e),y)u.__k=[];else if(P(l,v$1(b=u.props.children)?b:[b],u,t,i,o&&"foreignObject"!==k,r,f,r?r[0]:t.__k&&g$2(t,0),e,s),null!=r)for(b=r.length;b--;)null!=r[b]&&p$1(r[b]);e||("value"in _&&void 0!==(b=_.value)&&(b!==l.value||"progress"===k&&!b||"option"===k&&b!==d.value)&&I$1(l,"value",b,d.value,!1),"checked"in _&&void 0!==(b=_.checked)&&b!==l.checked&&I$1(l,"checked",b,d.checked,!1));}return l}function N$1(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,t);}}function O(n,u,t){var i,o;if(l$1.unmount&&l$1.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||N$1(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$1.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&O(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$1(n.__e),n.__=n.__e=n.__d=void 0;}function q$2(n,l,u){return this.constructor(n,u)}function B$2(u,t,i){var o,r,f,e;l$1.__&&l$1.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],z$1(t,u=(!o&&i||t).__k=y$1(k$2,null,[u]),r||c$1,c$1,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),L$1(f,u,e);}function G$1(n,l){var u={__c:l="__cC"+e$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w$2(n);});},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=s$1.slice,l$1={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l;}throw n}},u$1=0,b$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h$1({},this.state),"function"==typeof n&&(n=n(h$1({},u),this.props)),n&&h$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$2(this));},b$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$2(this));},b$1.prototype.render=k$2,i$1=[],r$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(n,l){return n.__v.__b-l.__v.__b},x$1.__r=0,e$1=0;
|
|
76
|
+
|
|
77
|
+
var t,r$1,u,i,o$1=0,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function h(n){return o$1=1,s(B$1,n)}function s(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){var f=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r))};r$1.u=!0;var c=r$1.shouldComponentUpdate,e=r$1.componentWillUpdate;r$1.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$1.shouldComponentUpdate=f;}return o.__N||o.__}function p(u,i){var o=d(t++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function y(u,i){var o=d(t++,4);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r$1.__h.push(o));}function _$1(n){return o$1=5,F$1(function(){return {current:n}},[])}function A(n,t,r){o$1=6,y(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n));}function F$1(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T$1(n,t){return o$1=8,F$1(function(){return n},t)}function q$1(n){var u=r$1.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$1)),u.props.value):n.__}function V$1(){var n=d(t++,11);if(!n.__){for(var u=r$1.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++;}return n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k$1),t.__H.__h.forEach(w$1),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r$1=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var i=(r$1=n.__c).__H;i&&(u===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k$1),i.__h.forEach(w$1),i.__h=[],t=0)),u=r$1;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r$1=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k$1),t.__h=t.__h.filter(function(n){return !n.__||w$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k$1(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));}function k$1(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w$1(n){var t=r$1;n.__c=n.__(),r$1=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t}
|
|
78
|
+
|
|
79
|
+
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(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 w(n){this.props=n;}function x(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return !r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,y$1(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u}(w.prototype=new b$1).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var N="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=N,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var T=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);T(n,t,e,r);};var F=l$1.unmount;function I(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return I(n,t,e)})),n}function L(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function U(){this.__u=0,this.t=null,this.__b=null;}function D(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function V(){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),F&&F(n);},(U.prototype=new b$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=D(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.__a){var n=r.state.__a;r.__v.__k[0]=L(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},U.prototype.componentWillUnmount=function(){this.t=[];},U.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=I(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&y$1(k$2,null,n.fallback);return i&&(i.__h=null),[y$1(k$2,null,e.__a?null:n.children),i]};var W=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];}};(V.prototype=new b$1).__a=function(n){var t=this,e=D(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),W(t,n,r)):u();};e?e(o):o();}},V.prototype.render=function(n){this.u=null,this.o=new Map;var t=C$1(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},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){W(n,e,t);});};var B="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$="undefined"!=typeof document,q=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function G(n,t,e){return null==t.__k&&(t.textContent=""),B$2(n,t),"function"==typeof e&&e(),n?n.__c:null}b$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(b$1.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var K=l$1.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}l$1.event=function(n){return K&&(n=K(n)),n.persist=Q,n.isPropagationStopped=X,n.isDefaultPrevented=nn,n.nativeEvent=n};var en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=l$1.vnode;l$1.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||$&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||q(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":Z.test(o)?o=l:-1===e.indexOf("-")&&H.test(o)?o=o.replace(Y,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=C$1(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=C$1(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,"className",en)):(t.className&&!t.class||t.class&&t.className)&&(u.class=u.className=t.className),n.props=u;}(n),n.$$typeof=B,rn&&rn(n);};var un=l$1.__r;l$1.__r=function(n){un&&un(n),n.__c;};var on=l$1.diffed;l$1.diffed=function(n){on&&on(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value);};function vn(n){return !!n.__k&&(B$2(null,n),!0)}var mn=function(n,t){return n(t)};
|
|
75
80
|
|
|
76
81
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
77
82
|
|
|
@@ -85,6 +90,9 @@ function getColSpan(column, lastFrozenColumnIndex, args) {
|
|
|
85
90
|
return undefined;
|
|
86
91
|
}
|
|
87
92
|
|
|
93
|
+
function stopPropagation(event) {
|
|
94
|
+
event.stopPropagation();
|
|
95
|
+
}
|
|
88
96
|
function scrollIntoView(element) {
|
|
89
97
|
element?.scrollIntoView({
|
|
90
98
|
inline: 'nearest',
|
|
@@ -119,12 +127,12 @@ function onEditorNavigation({
|
|
|
119
127
|
target
|
|
120
128
|
}) {
|
|
121
129
|
if (key === 'Tab' && (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement)) {
|
|
122
|
-
return target.
|
|
130
|
+
return target.closest('.rdg-editor-container')?.querySelectorAll('input, textarea, select').length === 1;
|
|
123
131
|
}
|
|
124
132
|
return false;
|
|
125
133
|
}
|
|
126
134
|
|
|
127
|
-
const measuringCellClassname = "
|
|
135
|
+
const measuringCellClassname = "mlln6zg7-0-0-beta-40";
|
|
128
136
|
function renderMeasuringCells(viewportColumns) {
|
|
129
137
|
return viewportColumns.map(({
|
|
130
138
|
key,
|
|
@@ -145,33 +153,31 @@ function renderMeasuringCells(viewportColumns) {
|
|
|
145
153
|
function isSelectedCellEditable({
|
|
146
154
|
selectedPosition,
|
|
147
155
|
columns,
|
|
148
|
-
rows
|
|
149
|
-
isGroupRow
|
|
156
|
+
rows
|
|
150
157
|
}) {
|
|
151
158
|
const column = columns[selectedPosition.idx];
|
|
152
159
|
const row = rows[selectedPosition.rowIdx];
|
|
153
|
-
return
|
|
160
|
+
return isCellEditable(column, row);
|
|
154
161
|
}
|
|
155
162
|
function isCellEditable(column, row) {
|
|
156
|
-
return column.renderEditCell != null &&
|
|
163
|
+
return column.renderEditCell != null && (typeof column.editable === 'function' ? column.editable(row) : column.editable) !== false;
|
|
157
164
|
}
|
|
158
165
|
function getSelectedCellColSpan({
|
|
159
166
|
rows,
|
|
160
167
|
topSummaryRows,
|
|
161
168
|
bottomSummaryRows,
|
|
162
169
|
rowIdx,
|
|
170
|
+
mainHeaderRowIdx,
|
|
163
171
|
lastFrozenColumnIndex,
|
|
164
|
-
column
|
|
165
|
-
isGroupRow
|
|
172
|
+
column
|
|
166
173
|
}) {
|
|
167
174
|
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
168
|
-
|
|
169
|
-
if (rowIdx === minRowIdx) {
|
|
175
|
+
if (rowIdx === mainHeaderRowIdx) {
|
|
170
176
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
171
177
|
type: 'HEADER'
|
|
172
178
|
});
|
|
173
179
|
}
|
|
174
|
-
if (topSummaryRows && rowIdx >
|
|
180
|
+
if (topSummaryRows && rowIdx > mainHeaderRowIdx && rowIdx <= topSummaryRowsCount + mainHeaderRowIdx) {
|
|
175
181
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
176
182
|
type: 'SUMMARY',
|
|
177
183
|
row: topSummaryRows[rowIdx + topSummaryRowsCount]
|
|
@@ -179,13 +185,10 @@ function getSelectedCellColSpan({
|
|
|
179
185
|
}
|
|
180
186
|
if (rowIdx >= 0 && rowIdx < rows.length) {
|
|
181
187
|
const row = rows[rowIdx];
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
return;
|
|
188
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
189
|
+
type: 'ROW',
|
|
190
|
+
row
|
|
191
|
+
});
|
|
189
192
|
}
|
|
190
193
|
if (bottomSummaryRows) {
|
|
191
194
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
@@ -196,6 +199,8 @@ function getSelectedCellColSpan({
|
|
|
196
199
|
return undefined;
|
|
197
200
|
}
|
|
198
201
|
function getNextSelectedCellPosition({
|
|
202
|
+
moveUp,
|
|
203
|
+
moveNext,
|
|
199
204
|
cellNavigationMode,
|
|
200
205
|
columns,
|
|
201
206
|
colSpanColumns,
|
|
@@ -203,24 +208,22 @@ function getNextSelectedCellPosition({
|
|
|
203
208
|
topSummaryRows,
|
|
204
209
|
bottomSummaryRows,
|
|
205
210
|
minRowIdx,
|
|
211
|
+
mainHeaderRowIdx,
|
|
206
212
|
maxRowIdx,
|
|
207
213
|
currentPosition: {
|
|
208
|
-
idx: currentIdx
|
|
214
|
+
idx: currentIdx,
|
|
215
|
+
rowIdx: currentRowIdx
|
|
209
216
|
},
|
|
210
217
|
nextPosition,
|
|
211
218
|
lastFrozenColumnIndex,
|
|
212
|
-
isCellWithinBounds
|
|
213
|
-
isGroupRow
|
|
219
|
+
isCellWithinBounds
|
|
214
220
|
}) {
|
|
215
221
|
let {
|
|
216
222
|
idx: nextIdx,
|
|
217
223
|
rowIdx: nextRowIdx
|
|
218
224
|
} = nextPosition;
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
const row = rows[nextRowIdx];
|
|
222
|
-
if (isGroupRow(row)) return;
|
|
223
|
-
}
|
|
225
|
+
const columnsCount = columns.length;
|
|
226
|
+
const setColSpan = moveNext => {
|
|
224
227
|
for (const column of colSpanColumns) {
|
|
225
228
|
const colIdx = column.idx;
|
|
226
229
|
if (colIdx > nextIdx) break;
|
|
@@ -229,21 +232,58 @@ function getNextSelectedCellPosition({
|
|
|
229
232
|
topSummaryRows,
|
|
230
233
|
bottomSummaryRows,
|
|
231
234
|
rowIdx: nextRowIdx,
|
|
235
|
+
mainHeaderRowIdx,
|
|
232
236
|
lastFrozenColumnIndex,
|
|
233
|
-
column
|
|
234
|
-
isGroupRow
|
|
237
|
+
column
|
|
235
238
|
});
|
|
236
239
|
if (colSpan && nextIdx > colIdx && nextIdx < colSpan + colIdx) {
|
|
237
|
-
nextIdx = colIdx + (
|
|
240
|
+
nextIdx = colIdx + (moveNext ? colSpan : 0);
|
|
238
241
|
break;
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
};
|
|
245
|
+
const getParentRowIdx = parent => {
|
|
246
|
+
return parent.level + mainHeaderRowIdx;
|
|
247
|
+
};
|
|
248
|
+
const setHeaderGroupColAndRowSpan = () => {
|
|
249
|
+
if (moveNext) {
|
|
250
|
+
const nextColumn = columns[nextIdx];
|
|
251
|
+
let parent = nextColumn.parent;
|
|
252
|
+
while (parent !== undefined) {
|
|
253
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
254
|
+
if (nextRowIdx === parentRowIdx) {
|
|
255
|
+
nextIdx = parent.idx + parent.colSpan;
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
parent = parent.parent;
|
|
259
|
+
}
|
|
260
|
+
} else if (moveUp) {
|
|
261
|
+
const nextColumn = columns[nextIdx];
|
|
262
|
+
let parent = nextColumn.parent;
|
|
263
|
+
let found = false;
|
|
264
|
+
while (parent !== undefined) {
|
|
265
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
266
|
+
if (nextRowIdx >= parentRowIdx) {
|
|
267
|
+
nextIdx = parent.idx;
|
|
268
|
+
nextRowIdx = parentRowIdx;
|
|
269
|
+
found = true;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
parent = parent.parent;
|
|
273
|
+
}
|
|
274
|
+
if (!found) {
|
|
275
|
+
nextIdx = currentIdx;
|
|
276
|
+
nextRowIdx = currentRowIdx;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
242
280
|
if (isCellWithinBounds(nextPosition)) {
|
|
243
|
-
setColSpan(
|
|
281
|
+
setColSpan(moveNext);
|
|
282
|
+
if (nextRowIdx < mainHeaderRowIdx) {
|
|
283
|
+
setHeaderGroupColAndRowSpan();
|
|
284
|
+
}
|
|
244
285
|
}
|
|
245
286
|
if (cellNavigationMode === 'CHANGE_ROW') {
|
|
246
|
-
const columnsCount = columns.length;
|
|
247
287
|
const isAfterLastColumn = nextIdx === columnsCount;
|
|
248
288
|
const isBeforeFirstColumn = nextIdx === -1;
|
|
249
289
|
if (isAfterLastColumn) {
|
|
@@ -261,6 +301,20 @@ function getNextSelectedCellPosition({
|
|
|
261
301
|
setColSpan(false);
|
|
262
302
|
}
|
|
263
303
|
}
|
|
304
|
+
if (nextRowIdx < mainHeaderRowIdx) {
|
|
305
|
+
const nextColumn = columns[nextIdx];
|
|
306
|
+
let parent = nextColumn.parent;
|
|
307
|
+
const nextParentRowIdx = nextRowIdx;
|
|
308
|
+
nextRowIdx = mainHeaderRowIdx;
|
|
309
|
+
while (parent !== undefined) {
|
|
310
|
+
const parentRowIdx = getParentRowIdx(parent);
|
|
311
|
+
if (parentRowIdx >= nextParentRowIdx) {
|
|
312
|
+
nextRowIdx = parentRowIdx;
|
|
313
|
+
nextIdx = parent.idx;
|
|
314
|
+
}
|
|
315
|
+
parent = parent.parent;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
264
318
|
return {
|
|
265
319
|
idx: nextIdx,
|
|
266
320
|
rowIdx: nextRowIdx
|
|
@@ -283,11 +337,11 @@ function canExitGrid({
|
|
|
283
337
|
return shiftKey ? atFirstCellInRow && atFirstRow : atLastCellInRow && atLastRow;
|
|
284
338
|
}
|
|
285
339
|
|
|
286
|
-
const cell = "
|
|
340
|
+
const cell = "cj343x07-0-0-beta-40";
|
|
287
341
|
const cellClassname = `rdg-cell ${cell}`;
|
|
288
|
-
const cellFrozen = "
|
|
342
|
+
const cellFrozen = "csofj7r7-0-0-beta-40";
|
|
289
343
|
const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
290
|
-
const cellFrozenLast = "
|
|
344
|
+
const cellFrozenLast = "ch2wcw87-0-0-beta-40";
|
|
291
345
|
const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
|
|
292
346
|
|
|
293
347
|
function getRowStyle(rowIdx, height) {
|
|
@@ -301,10 +355,29 @@ function getRowStyle(rowIdx, height) {
|
|
|
301
355
|
'--rdg-grid-row-start': rowIdx
|
|
302
356
|
};
|
|
303
357
|
}
|
|
304
|
-
function
|
|
358
|
+
function getHeaderCellStyle(column, rowIdx, rowSpan) {
|
|
359
|
+
const gridRowEnd = rowIdx + 1;
|
|
360
|
+
const paddingBlockStart = `calc(${rowSpan - 1} * var(--rdg-header-row-height))`;
|
|
361
|
+
if (column.parent === undefined) {
|
|
362
|
+
return {
|
|
363
|
+
insetBlockStart: 0,
|
|
364
|
+
gridRowStart: 1,
|
|
365
|
+
gridRowEnd,
|
|
366
|
+
paddingBlockStart
|
|
367
|
+
};
|
|
368
|
+
}
|
|
305
369
|
return {
|
|
306
|
-
|
|
307
|
-
|
|
370
|
+
insetBlockStart: `calc(${rowIdx - rowSpan} * var(--rdg-header-row-height))`,
|
|
371
|
+
gridRowStart: gridRowEnd - rowSpan,
|
|
372
|
+
gridRowEnd,
|
|
373
|
+
paddingBlockStart
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
function getCellStyle(column, colSpan = 1) {
|
|
377
|
+
const index = column.idx + 1;
|
|
378
|
+
return {
|
|
379
|
+
gridColumnStart: index,
|
|
380
|
+
gridColumnEnd: index + colSpan,
|
|
308
381
|
insetInlineStart: column.frozen ? `var(--rdg-frozen-left-${column.idx})` : undefined
|
|
309
382
|
};
|
|
310
383
|
}
|
|
@@ -335,14 +408,17 @@ function clampColumnWidth(width, {
|
|
|
335
408
|
}
|
|
336
409
|
return width;
|
|
337
410
|
}
|
|
411
|
+
function getHeaderCellRowSpan(column, rowIdx) {
|
|
412
|
+
return column.parent === undefined ? rowIdx : column.level - column.parent.level;
|
|
413
|
+
}
|
|
338
414
|
|
|
339
|
-
const checkboxLabel = "
|
|
415
|
+
const checkboxLabel = "c1bn88vv7-0-0-beta-40";
|
|
340
416
|
const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
|
|
341
|
-
const checkboxInput = "
|
|
417
|
+
const checkboxInput = "c1qt073l7-0-0-beta-40";
|
|
342
418
|
const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
|
|
343
|
-
const checkbox = "
|
|
419
|
+
const checkbox = "cf71kmq7-0-0-beta-40";
|
|
344
420
|
const checkboxClassname = `rdg-checkbox ${checkbox}`;
|
|
345
|
-
const checkboxLabelDisabled = "
|
|
421
|
+
const checkboxLabelDisabled = "c1lwve4p7-0-0-beta-40";
|
|
346
422
|
const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
|
|
347
423
|
function renderCheckbox({
|
|
348
424
|
onChange,
|
|
@@ -364,46 +440,6 @@ function renderCheckbox({
|
|
|
364
440
|
});
|
|
365
441
|
}
|
|
366
442
|
|
|
367
|
-
const groupCellContent = "g1w3c5217-0-0-beta-33";
|
|
368
|
-
const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
|
|
369
|
-
const caret = "cm5tyhw7-0-0-beta-33";
|
|
370
|
-
const caretClassname = `rdg-caret ${caret}`;
|
|
371
|
-
function renderToggleGroup(props) {
|
|
372
|
-
return /*#__PURE__*/o(ToggleGroup, {
|
|
373
|
-
...props
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
function ToggleGroup({
|
|
377
|
-
groupKey,
|
|
378
|
-
isExpanded,
|
|
379
|
-
tabIndex,
|
|
380
|
-
toggleGroup
|
|
381
|
-
}) {
|
|
382
|
-
function handleKeyDown({
|
|
383
|
-
key
|
|
384
|
-
}) {
|
|
385
|
-
if (key === 'Enter') {
|
|
386
|
-
toggleGroup();
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';
|
|
390
|
-
return /*#__PURE__*/o("span", {
|
|
391
|
-
className: groupCellContentClassname,
|
|
392
|
-
tabIndex: tabIndex,
|
|
393
|
-
onKeyDown: handleKeyDown,
|
|
394
|
-
children: [groupKey, /*#__PURE__*/o("svg", {
|
|
395
|
-
viewBox: "0 0 14 8",
|
|
396
|
-
width: "14",
|
|
397
|
-
height: "8",
|
|
398
|
-
className: caretClassname,
|
|
399
|
-
"aria-hidden": true,
|
|
400
|
-
children: /*#__PURE__*/o("path", {
|
|
401
|
-
d: d
|
|
402
|
-
})
|
|
403
|
-
})]
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
|
|
407
443
|
function renderValue(props) {
|
|
408
444
|
try {
|
|
409
445
|
return props.row[props.column.key];
|
|
@@ -527,52 +563,68 @@ const DEFAULT_COLUMN_WIDTH = 'auto';
|
|
|
527
563
|
const DEFAULT_COLUMN_MIN_WIDTH = 50;
|
|
528
564
|
function useCalculatedColumns({
|
|
529
565
|
rawColumns,
|
|
530
|
-
|
|
531
|
-
|
|
566
|
+
defaultColumnOptions,
|
|
567
|
+
getColumnWidth,
|
|
532
568
|
viewportWidth,
|
|
533
569
|
scrollLeft,
|
|
534
|
-
defaultColumnOptions,
|
|
535
|
-
rawGroupBy,
|
|
536
570
|
enableVirtualization
|
|
537
571
|
}) {
|
|
538
572
|
const defaultWidth = defaultColumnOptions?.width ?? DEFAULT_COLUMN_WIDTH;
|
|
539
573
|
const defaultMinWidth = defaultColumnOptions?.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;
|
|
540
574
|
const defaultMaxWidth = defaultColumnOptions?.maxWidth ?? undefined;
|
|
541
|
-
const
|
|
575
|
+
const defaultCellRenderer = defaultColumnOptions?.renderCell ?? renderValue;
|
|
542
576
|
const defaultSortable = defaultColumnOptions?.sortable ?? false;
|
|
543
577
|
const defaultResizable = defaultColumnOptions?.resizable ?? false;
|
|
578
|
+
const defaultDraggable = defaultColumnOptions?.draggable ?? false;
|
|
544
579
|
const {
|
|
545
580
|
columns,
|
|
546
581
|
colSpanColumns,
|
|
547
582
|
lastFrozenColumnIndex,
|
|
548
|
-
|
|
583
|
+
headerRowsCount
|
|
549
584
|
} = F$1(() => {
|
|
550
|
-
const groupBy = [];
|
|
551
585
|
let lastFrozenColumnIndex = -1;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
586
|
+
let headerRowsCount = 1;
|
|
587
|
+
const columns = [];
|
|
588
|
+
collectColumns(rawColumns, 1);
|
|
589
|
+
function collectColumns(rawColumns, level, parent) {
|
|
590
|
+
for (const rawColumn of rawColumns) {
|
|
591
|
+
if ('children' in rawColumn) {
|
|
592
|
+
const calculatedColumnParent = {
|
|
593
|
+
name: rawColumn.name,
|
|
594
|
+
parent,
|
|
595
|
+
idx: -1,
|
|
596
|
+
colSpan: 0,
|
|
597
|
+
level: 0,
|
|
598
|
+
headerCellClass: rawColumn.headerCellClass
|
|
599
|
+
};
|
|
600
|
+
collectColumns(rawColumn.children, level + 1, calculatedColumnParent);
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
const frozen = rawColumn.frozen ?? false;
|
|
604
|
+
const column = {
|
|
605
|
+
...rawColumn,
|
|
606
|
+
parent,
|
|
607
|
+
idx: 0,
|
|
608
|
+
level: 0,
|
|
609
|
+
frozen,
|
|
610
|
+
isLastFrozenColumn: false,
|
|
611
|
+
width: rawColumn.width ?? defaultWidth,
|
|
612
|
+
minWidth: rawColumn.minWidth ?? defaultMinWidth,
|
|
613
|
+
maxWidth: rawColumn.maxWidth ?? defaultMaxWidth,
|
|
614
|
+
sortable: rawColumn.sortable ?? defaultSortable,
|
|
615
|
+
resizable: rawColumn.resizable ?? defaultResizable,
|
|
616
|
+
draggable: rawColumn.draggable ?? defaultDraggable,
|
|
617
|
+
renderCell: rawColumn.renderCell ?? defaultCellRenderer
|
|
618
|
+
};
|
|
619
|
+
columns.push(column);
|
|
620
|
+
if (frozen) {
|
|
621
|
+
lastFrozenColumnIndex++;
|
|
622
|
+
}
|
|
623
|
+
if (level > headerRowsCount) {
|
|
624
|
+
headerRowsCount = level;
|
|
625
|
+
}
|
|
573
626
|
}
|
|
574
|
-
|
|
575
|
-
});
|
|
627
|
+
}
|
|
576
628
|
columns.sort(({
|
|
577
629
|
key: aKey,
|
|
578
630
|
frozen: frozenA
|
|
@@ -582,13 +634,6 @@ function useCalculatedColumns({
|
|
|
582
634
|
}) => {
|
|
583
635
|
if (aKey === SELECT_COLUMN_KEY) return -1;
|
|
584
636
|
if (bKey === SELECT_COLUMN_KEY) return 1;
|
|
585
|
-
if (rawGroupBy?.includes(aKey)) {
|
|
586
|
-
if (rawGroupBy.includes(bKey)) {
|
|
587
|
-
return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);
|
|
588
|
-
}
|
|
589
|
-
return -1;
|
|
590
|
-
}
|
|
591
|
-
if (rawGroupBy?.includes(bKey)) return 1;
|
|
592
637
|
if (frozenA) {
|
|
593
638
|
if (frozenB) return 0;
|
|
594
639
|
return -1;
|
|
@@ -599,9 +644,7 @@ function useCalculatedColumns({
|
|
|
599
644
|
const colSpanColumns = [];
|
|
600
645
|
columns.forEach((column, idx) => {
|
|
601
646
|
column.idx = idx;
|
|
602
|
-
|
|
603
|
-
groupBy.push(column.key);
|
|
604
|
-
}
|
|
647
|
+
updateColumnParent(column, idx, 0);
|
|
605
648
|
if (column.colSpan != null) {
|
|
606
649
|
colSpanColumns.push(column);
|
|
607
650
|
}
|
|
@@ -613,9 +656,9 @@ function useCalculatedColumns({
|
|
|
613
656
|
columns,
|
|
614
657
|
colSpanColumns,
|
|
615
658
|
lastFrozenColumnIndex,
|
|
616
|
-
|
|
659
|
+
headerRowsCount
|
|
617
660
|
};
|
|
618
|
-
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth,
|
|
661
|
+
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultCellRenderer, defaultResizable, defaultSortable, defaultDraggable]);
|
|
619
662
|
const {
|
|
620
663
|
templateColumns,
|
|
621
664
|
layoutCssVars,
|
|
@@ -627,7 +670,7 @@ function useCalculatedColumns({
|
|
|
627
670
|
let totalFrozenColumnWidth = 0;
|
|
628
671
|
const templateColumns = [];
|
|
629
672
|
for (const column of columns) {
|
|
630
|
-
let width =
|
|
673
|
+
let width = getColumnWidth(column);
|
|
631
674
|
if (typeof width === 'number') {
|
|
632
675
|
width = clampColumnWidth(width, column);
|
|
633
676
|
} else {
|
|
@@ -655,7 +698,7 @@ function useCalculatedColumns({
|
|
|
655
698
|
totalFrozenColumnWidth,
|
|
656
699
|
columnMetrics
|
|
657
700
|
};
|
|
658
|
-
}, [
|
|
701
|
+
}, [getColumnWidth, columns, lastFrozenColumnIndex]);
|
|
659
702
|
const [colOverscanStartIdx, colOverscanEndIdx] = F$1(() => {
|
|
660
703
|
if (!enableVirtualization) {
|
|
661
704
|
return [0, columns.length - 1];
|
|
@@ -700,11 +743,26 @@ function useCalculatedColumns({
|
|
|
700
743
|
colOverscanEndIdx,
|
|
701
744
|
templateColumns,
|
|
702
745
|
layoutCssVars,
|
|
746
|
+
headerRowsCount,
|
|
703
747
|
lastFrozenColumnIndex,
|
|
704
|
-
totalFrozenColumnWidth
|
|
705
|
-
groupBy
|
|
748
|
+
totalFrozenColumnWidth
|
|
706
749
|
};
|
|
707
750
|
}
|
|
751
|
+
function updateColumnParent(column, index, level) {
|
|
752
|
+
if (level < column.level) {
|
|
753
|
+
column.level = level;
|
|
754
|
+
}
|
|
755
|
+
if (column.parent !== undefined) {
|
|
756
|
+
const {
|
|
757
|
+
parent
|
|
758
|
+
} = column;
|
|
759
|
+
if (parent.idx === -1) {
|
|
760
|
+
parent.idx = index;
|
|
761
|
+
}
|
|
762
|
+
parent.colSpan += 1;
|
|
763
|
+
updateColumnParent(parent, index, level - 1);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
708
766
|
|
|
709
767
|
const useLayoutEffect = typeof window === 'undefined' ? p : y;
|
|
710
768
|
|
|
@@ -767,7 +825,7 @@ function useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gri
|
|
|
767
825
|
}
|
|
768
826
|
gridRef.current.style.gridTemplateColumns = newTemplateColumns.join(' ');
|
|
769
827
|
const measuredWidth = typeof nextWidth === 'number' ? nextWidth : measureColumnWidth(gridRef, resizingKey);
|
|
770
|
-
|
|
828
|
+
mn(() => {
|
|
771
829
|
setResizedColumnWidths(resizedColumnWidths => {
|
|
772
830
|
const newResizedColumnWidths = new Map(resizedColumnWidths);
|
|
773
831
|
newResizedColumnWidths.set(resizingKey, measuredWidth);
|
|
@@ -813,7 +871,7 @@ function useGridDimensions() {
|
|
|
813
871
|
setBlockSize(initialHeight);
|
|
814
872
|
const resizeObserver = new ResizeObserver(entries => {
|
|
815
873
|
const size = entries[0].contentBoxSize[0];
|
|
816
|
-
|
|
874
|
+
mn(() => {
|
|
817
875
|
setInlineSize(size.inlineSize);
|
|
818
876
|
setBlockSize(size.blockSize);
|
|
819
877
|
});
|
|
@@ -865,8 +923,7 @@ function useViewportColumns({
|
|
|
865
923
|
colOverscanEndIdx,
|
|
866
924
|
lastFrozenColumnIndex,
|
|
867
925
|
rowOverscanStartIdx,
|
|
868
|
-
rowOverscanEndIdx
|
|
869
|
-
isGroupRow
|
|
926
|
+
rowOverscanEndIdx
|
|
870
927
|
}) {
|
|
871
928
|
const startIdx = F$1(() => {
|
|
872
929
|
if (colOverscanStartIdx === 0) return 0;
|
|
@@ -888,7 +945,6 @@ function useViewportColumns({
|
|
|
888
945
|
}
|
|
889
946
|
for (let rowIdx = rowOverscanStartIdx; rowIdx <= rowOverscanEndIdx; rowIdx++) {
|
|
890
947
|
const row = rows[rowIdx];
|
|
891
|
-
if (isGroupRow(row)) continue;
|
|
892
948
|
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
893
949
|
type: 'ROW',
|
|
894
950
|
row
|
|
@@ -918,7 +974,7 @@ function useViewportColumns({
|
|
|
918
974
|
}
|
|
919
975
|
}
|
|
920
976
|
return startIdx;
|
|
921
|
-
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns
|
|
977
|
+
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns]);
|
|
922
978
|
return F$1(() => {
|
|
923
979
|
const viewportColumns = [];
|
|
924
980
|
for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {
|
|
@@ -930,78 +986,13 @@ function useViewportColumns({
|
|
|
930
986
|
}, [startIdx, colOverscanEndIdx, columns]);
|
|
931
987
|
}
|
|
932
988
|
|
|
933
|
-
function isReadonlyArray(arr) {
|
|
934
|
-
return Array.isArray(arr);
|
|
935
|
-
}
|
|
936
989
|
function useViewportRows({
|
|
937
|
-
|
|
990
|
+
rows,
|
|
938
991
|
rowHeight,
|
|
939
992
|
clientHeight,
|
|
940
993
|
scrollTop,
|
|
941
|
-
groupBy,
|
|
942
|
-
rowGrouper,
|
|
943
|
-
expandedGroupIds,
|
|
944
994
|
enableVirtualization
|
|
945
995
|
}) {
|
|
946
|
-
const [groupedRows, rowsCount] = F$1(() => {
|
|
947
|
-
if (groupBy.length === 0 || rowGrouper == null) return [undefined, rawRows.length];
|
|
948
|
-
const groupRows = (rows, [groupByKey, ...remainingGroupByKeys], startRowIndex) => {
|
|
949
|
-
let groupRowsCount = 0;
|
|
950
|
-
const groups = {};
|
|
951
|
-
for (const [key, childRows] of Object.entries(rowGrouper(rows, groupByKey))) {
|
|
952
|
-
const [childGroups, childRowsCount] = remainingGroupByKeys.length === 0 ? [childRows, childRows.length] : groupRows(childRows, remainingGroupByKeys, startRowIndex + groupRowsCount + 1);
|
|
953
|
-
groups[key] = {
|
|
954
|
-
childRows,
|
|
955
|
-
childGroups,
|
|
956
|
-
startRowIndex: startRowIndex + groupRowsCount
|
|
957
|
-
};
|
|
958
|
-
groupRowsCount += childRowsCount + 1;
|
|
959
|
-
}
|
|
960
|
-
return [groups, groupRowsCount];
|
|
961
|
-
};
|
|
962
|
-
return groupRows(rawRows, groupBy, 0);
|
|
963
|
-
}, [groupBy, rowGrouper, rawRows]);
|
|
964
|
-
const [rows, isGroupRow] = F$1(() => {
|
|
965
|
-
const allGroupRows = new Set();
|
|
966
|
-
if (!groupedRows) return [rawRows, isGroupRow];
|
|
967
|
-
const flattenedRows = [];
|
|
968
|
-
const expandGroup = (rows, parentId, level) => {
|
|
969
|
-
if (isReadonlyArray(rows)) {
|
|
970
|
-
flattenedRows.push(...rows);
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
Object.keys(rows).forEach((groupKey, posInSet, keys) => {
|
|
974
|
-
const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;
|
|
975
|
-
const isExpanded = expandedGroupIds?.has(id) ?? false;
|
|
976
|
-
const {
|
|
977
|
-
childRows,
|
|
978
|
-
childGroups,
|
|
979
|
-
startRowIndex
|
|
980
|
-
} = rows[groupKey];
|
|
981
|
-
const groupRow = {
|
|
982
|
-
id,
|
|
983
|
-
parentId,
|
|
984
|
-
groupKey,
|
|
985
|
-
isExpanded,
|
|
986
|
-
childRows,
|
|
987
|
-
level,
|
|
988
|
-
posInSet,
|
|
989
|
-
startRowIndex,
|
|
990
|
-
setSize: keys.length
|
|
991
|
-
};
|
|
992
|
-
flattenedRows.push(groupRow);
|
|
993
|
-
allGroupRows.add(groupRow);
|
|
994
|
-
if (isExpanded) {
|
|
995
|
-
expandGroup(childGroups, id, level + 1);
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
|
-
};
|
|
999
|
-
expandGroup(groupedRows, undefined, 0);
|
|
1000
|
-
return [flattenedRows, isGroupRow];
|
|
1001
|
-
function isGroupRow(row) {
|
|
1002
|
-
return allGroupRows.has(row);
|
|
1003
|
-
}
|
|
1004
|
-
}, [expandedGroupIds, groupedRows, rawRows]);
|
|
1005
996
|
const {
|
|
1006
997
|
totalRowHeight,
|
|
1007
998
|
gridTemplateRows,
|
|
@@ -1021,13 +1012,7 @@ function useViewportRows({
|
|
|
1021
1012
|
let totalRowHeight = 0;
|
|
1022
1013
|
let gridTemplateRows = ' ';
|
|
1023
1014
|
const rowPositions = rows.map(row => {
|
|
1024
|
-
const currentRowHeight =
|
|
1025
|
-
type: 'GROUP',
|
|
1026
|
-
row
|
|
1027
|
-
}) : rowHeight({
|
|
1028
|
-
type: 'ROW',
|
|
1029
|
-
row
|
|
1030
|
-
});
|
|
1015
|
+
const currentRowHeight = rowHeight(row);
|
|
1031
1016
|
const position = {
|
|
1032
1017
|
top: totalRowHeight,
|
|
1033
1018
|
height: currentRowHeight
|
|
@@ -1061,7 +1046,7 @@ function useViewportRows({
|
|
|
1061
1046
|
return 0;
|
|
1062
1047
|
}
|
|
1063
1048
|
};
|
|
1064
|
-
}, [
|
|
1049
|
+
}, [rowHeight, rows]);
|
|
1065
1050
|
let rowOverscanStartIdx = 0;
|
|
1066
1051
|
let rowOverscanEndIdx = rows.length - 1;
|
|
1067
1052
|
if (enableVirtualization) {
|
|
@@ -1074,31 +1059,37 @@ function useViewportRows({
|
|
|
1074
1059
|
return {
|
|
1075
1060
|
rowOverscanStartIdx,
|
|
1076
1061
|
rowOverscanEndIdx,
|
|
1077
|
-
rows,
|
|
1078
|
-
rowsCount,
|
|
1079
1062
|
totalRowHeight,
|
|
1080
1063
|
gridTemplateRows,
|
|
1081
|
-
isGroupRow,
|
|
1082
1064
|
getRowTop,
|
|
1083
1065
|
getRowHeight,
|
|
1084
1066
|
findRowIdx
|
|
1085
1067
|
};
|
|
1086
1068
|
}
|
|
1087
1069
|
|
|
1088
|
-
const cellDragHandle = "
|
|
1070
|
+
const cellDragHandle = "c1w9bbhr7-0-0-beta-40";
|
|
1071
|
+
const cellDragHandleFrozenClassname = "c1creorc7-0-0-beta-40";
|
|
1089
1072
|
const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1090
1073
|
function DragHandle({
|
|
1074
|
+
gridRowStart,
|
|
1091
1075
|
rows,
|
|
1092
|
-
|
|
1076
|
+
column,
|
|
1077
|
+
columnWidth,
|
|
1093
1078
|
selectedPosition,
|
|
1094
1079
|
latestDraggedOverRowIdx,
|
|
1095
1080
|
isCellEditable,
|
|
1096
1081
|
onRowsChange,
|
|
1097
1082
|
onFill,
|
|
1083
|
+
onClick,
|
|
1098
1084
|
setDragging,
|
|
1099
1085
|
setDraggedOverRowIdx
|
|
1100
1086
|
}) {
|
|
1087
|
+
const {
|
|
1088
|
+
idx,
|
|
1089
|
+
rowIdx
|
|
1090
|
+
} = selectedPosition;
|
|
1101
1091
|
function handleMouseDown(event) {
|
|
1092
|
+
event.preventDefault();
|
|
1102
1093
|
if (event.buttons !== 1) return;
|
|
1103
1094
|
setDragging(true);
|
|
1104
1095
|
window.addEventListener('mouseover', onMouseOver);
|
|
@@ -1116,9 +1107,6 @@ function DragHandle({
|
|
|
1116
1107
|
function handleDragEnd() {
|
|
1117
1108
|
const overRowIdx = latestDraggedOverRowIdx.current;
|
|
1118
1109
|
if (overRowIdx === undefined) return;
|
|
1119
|
-
const {
|
|
1120
|
-
rowIdx
|
|
1121
|
-
} = selectedPosition;
|
|
1122
1110
|
const startRowIndex = rowIdx < overRowIdx ? rowIdx + 1 : overRowIdx;
|
|
1123
1111
|
const endRowIndex = rowIdx < overRowIdx ? overRowIdx + 1 : rowIdx;
|
|
1124
1112
|
updateRows(startRowIndex, endRowIndex);
|
|
@@ -1126,14 +1114,9 @@ function DragHandle({
|
|
|
1126
1114
|
}
|
|
1127
1115
|
function handleDoubleClick(event) {
|
|
1128
1116
|
event.stopPropagation();
|
|
1129
|
-
updateRows(
|
|
1117
|
+
updateRows(rowIdx + 1, rows.length);
|
|
1130
1118
|
}
|
|
1131
1119
|
function updateRows(startRowIdx, endRowIdx) {
|
|
1132
|
-
const {
|
|
1133
|
-
idx,
|
|
1134
|
-
rowIdx
|
|
1135
|
-
} = selectedPosition;
|
|
1136
|
-
const column = columns[idx];
|
|
1137
1120
|
const sourceRow = rows[rowIdx];
|
|
1138
1121
|
const updatedRows = [...rows];
|
|
1139
1122
|
const indexes = [];
|
|
@@ -1160,14 +1143,25 @@ function DragHandle({
|
|
|
1160
1143
|
});
|
|
1161
1144
|
}
|
|
1162
1145
|
}
|
|
1146
|
+
const colSpan = column.colSpan?.({
|
|
1147
|
+
type: 'ROW',
|
|
1148
|
+
row: rows[rowIdx]
|
|
1149
|
+
}) ?? 1;
|
|
1150
|
+
const style = getCellStyle(column, colSpan);
|
|
1163
1151
|
return /*#__PURE__*/o("div", {
|
|
1164
|
-
|
|
1152
|
+
style: {
|
|
1153
|
+
...style,
|
|
1154
|
+
gridRowStart,
|
|
1155
|
+
insetInlineStart: style.insetInlineStart && typeof columnWidth === 'number' ? `calc(${style.insetInlineStart} + ${columnWidth}px - var(--rdg-drag-handle-size))` : undefined
|
|
1156
|
+
},
|
|
1157
|
+
className: clsx(cellDragHandleClassname, column.frozen && cellDragHandleFrozenClassname),
|
|
1158
|
+
onClick: onClick,
|
|
1165
1159
|
onMouseDown: handleMouseDown,
|
|
1166
1160
|
onDoubleClick: handleDoubleClick
|
|
1167
1161
|
});
|
|
1168
1162
|
}
|
|
1169
1163
|
|
|
1170
|
-
const cellEditing = "
|
|
1164
|
+
const cellEditing = "cis5rrm7-0-0-beta-40";
|
|
1171
1165
|
function EditCell({
|
|
1172
1166
|
column,
|
|
1173
1167
|
colSpan,
|
|
@@ -1264,148 +1258,69 @@ function EditCell({
|
|
|
1264
1258
|
});
|
|
1265
1259
|
}
|
|
1266
1260
|
|
|
1267
|
-
function
|
|
1268
|
-
id,
|
|
1269
|
-
groupKey,
|
|
1270
|
-
childRows,
|
|
1271
|
-
isExpanded,
|
|
1272
|
-
isCellSelected,
|
|
1261
|
+
function GroupedColumnHeaderCell({
|
|
1273
1262
|
column,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1263
|
+
rowIdx,
|
|
1264
|
+
isCellSelected,
|
|
1265
|
+
selectCell
|
|
1277
1266
|
}) {
|
|
1278
1267
|
const {
|
|
1279
1268
|
tabIndex,
|
|
1280
|
-
childTabIndex,
|
|
1281
1269
|
onFocus
|
|
1282
1270
|
} = useRovingTabIndex(isCellSelected);
|
|
1283
|
-
|
|
1284
|
-
|
|
1271
|
+
const {
|
|
1272
|
+
colSpan
|
|
1273
|
+
} = column;
|
|
1274
|
+
const rowSpan = getHeaderCellRowSpan(column, rowIdx);
|
|
1275
|
+
const index = column.idx + 1;
|
|
1276
|
+
function onClick() {
|
|
1277
|
+
selectCell({
|
|
1278
|
+
idx: column.idx,
|
|
1279
|
+
rowIdx
|
|
1280
|
+
});
|
|
1285
1281
|
}
|
|
1286
|
-
const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;
|
|
1287
1282
|
return /*#__PURE__*/o("div", {
|
|
1288
|
-
role: "
|
|
1289
|
-
"aria-colindex":
|
|
1283
|
+
role: "columnheader",
|
|
1284
|
+
"aria-colindex": index,
|
|
1285
|
+
"aria-colspan": colSpan,
|
|
1286
|
+
"aria-rowspan": rowSpan,
|
|
1290
1287
|
"aria-selected": isCellSelected,
|
|
1291
1288
|
tabIndex: tabIndex,
|
|
1292
|
-
className:
|
|
1289
|
+
className: clsx(cellClassname, column.headerCellClass),
|
|
1293
1290
|
style: {
|
|
1294
|
-
...
|
|
1295
|
-
|
|
1291
|
+
...getHeaderCellStyle(column, rowIdx, rowSpan),
|
|
1292
|
+
gridColumnStart: index,
|
|
1293
|
+
gridColumnEnd: index + colSpan
|
|
1296
1294
|
},
|
|
1297
|
-
onClick: isLevelMatching ? toggleGroup : undefined,
|
|
1298
1295
|
onFocus: onFocus,
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
childRows,
|
|
1302
|
-
column,
|
|
1303
|
-
row,
|
|
1304
|
-
isExpanded,
|
|
1305
|
-
tabIndex: childTabIndex,
|
|
1306
|
-
toggleGroup
|
|
1307
|
-
})
|
|
1308
|
-
}, column.key);
|
|
1309
|
-
}
|
|
1310
|
-
const GroupCell$1 = /*#__PURE__*/x(GroupCell);
|
|
1311
|
-
|
|
1312
|
-
const row = "r1otpg647-0-0-beta-33";
|
|
1313
|
-
const rowClassname = `rdg-row ${row}`;
|
|
1314
|
-
const rowSelected = "rel5gk27-0-0-beta-33";
|
|
1315
|
-
const rowSelectedClassname = 'rdg-row-selected';
|
|
1316
|
-
const rowSelectedWithFrozenCell = "r1qymf1z7-0-0-beta-33";
|
|
1317
|
-
|
|
1318
|
-
const groupRow = "gyxx7e97-0-0-beta-33";
|
|
1319
|
-
const groupRowClassname = `rdg-group-row ${groupRow}`;
|
|
1320
|
-
function GroupedRow({
|
|
1321
|
-
id,
|
|
1322
|
-
groupKey,
|
|
1323
|
-
viewportColumns,
|
|
1324
|
-
childRows,
|
|
1325
|
-
rowIdx,
|
|
1326
|
-
row,
|
|
1327
|
-
gridRowStart,
|
|
1328
|
-
height,
|
|
1329
|
-
level,
|
|
1330
|
-
isExpanded,
|
|
1331
|
-
selectedCellIdx,
|
|
1332
|
-
isRowSelected,
|
|
1333
|
-
selectGroup,
|
|
1334
|
-
toggleGroup,
|
|
1335
|
-
...props
|
|
1336
|
-
}) {
|
|
1337
|
-
const idx = viewportColumns[0].key === SELECT_COLUMN_KEY ? level + 1 : level;
|
|
1338
|
-
function handleSelectGroup() {
|
|
1339
|
-
selectGroup(rowIdx);
|
|
1340
|
-
}
|
|
1341
|
-
return /*#__PURE__*/o(RowSelectionProvider, {
|
|
1342
|
-
value: isRowSelected,
|
|
1343
|
-
children: /*#__PURE__*/o("div", {
|
|
1344
|
-
role: "row",
|
|
1345
|
-
"aria-level": level,
|
|
1346
|
-
"aria-expanded": isExpanded,
|
|
1347
|
-
className: clsx(rowClassname, groupRowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, selectedCellIdx === -1 && rowSelectedClassname),
|
|
1348
|
-
onClick: handleSelectGroup,
|
|
1349
|
-
style: getRowStyle(gridRowStart, height),
|
|
1350
|
-
...props,
|
|
1351
|
-
children: viewportColumns.map(column => /*#__PURE__*/o(GroupCell$1, {
|
|
1352
|
-
id: id,
|
|
1353
|
-
groupKey: groupKey,
|
|
1354
|
-
childRows: childRows,
|
|
1355
|
-
isExpanded: isExpanded,
|
|
1356
|
-
isCellSelected: selectedCellIdx === column.idx,
|
|
1357
|
-
column: column,
|
|
1358
|
-
row: row,
|
|
1359
|
-
groupColumnIndex: idx,
|
|
1360
|
-
toggleGroup: toggleGroup
|
|
1361
|
-
}, column.key))
|
|
1362
|
-
})
|
|
1296
|
+
onClick: onClick,
|
|
1297
|
+
children: column.name
|
|
1363
1298
|
});
|
|
1364
1299
|
}
|
|
1365
|
-
const GroupRowRenderer = /*#__PURE__*/x(GroupedRow);
|
|
1366
1300
|
|
|
1367
|
-
const
|
|
1368
|
-
const
|
|
1369
|
-
const headerSortName = "h14cojrm7-0-0-beta-33";
|
|
1301
|
+
const headerSortCellClassname = "h44jtk67-0-0-beta-40";
|
|
1302
|
+
const headerSortName = "hcgkhxz7-0-0-beta-40";
|
|
1370
1303
|
const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1371
1304
|
function renderHeaderCell({
|
|
1372
1305
|
column,
|
|
1373
1306
|
sortDirection,
|
|
1374
|
-
priority
|
|
1375
|
-
onSort,
|
|
1376
|
-
tabIndex
|
|
1307
|
+
priority
|
|
1377
1308
|
}) {
|
|
1378
1309
|
if (!column.sortable) return column.name;
|
|
1379
1310
|
return /*#__PURE__*/o(SortableHeaderCell, {
|
|
1380
|
-
onSort: onSort,
|
|
1381
1311
|
sortDirection: sortDirection,
|
|
1382
1312
|
priority: priority,
|
|
1383
|
-
tabIndex: tabIndex,
|
|
1384
1313
|
children: column.name
|
|
1385
1314
|
});
|
|
1386
1315
|
}
|
|
1387
1316
|
function SortableHeaderCell({
|
|
1388
|
-
onSort,
|
|
1389
1317
|
sortDirection,
|
|
1390
1318
|
priority,
|
|
1391
|
-
children
|
|
1392
|
-
tabIndex
|
|
1319
|
+
children
|
|
1393
1320
|
}) {
|
|
1394
1321
|
const renderSortStatus = useDefaultRenderers().renderSortStatus;
|
|
1395
|
-
function handleKeyDown(event) {
|
|
1396
|
-
if (event.key === ' ' || event.key === 'Enter') {
|
|
1397
|
-
event.preventDefault();
|
|
1398
|
-
onSort(event.ctrlKey || event.metaKey);
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
function handleClick(event) {
|
|
1402
|
-
onSort(event.ctrlKey || event.metaKey);
|
|
1403
|
-
}
|
|
1404
1322
|
return /*#__PURE__*/o("span", {
|
|
1405
|
-
tabIndex: tabIndex,
|
|
1406
1323
|
className: headerSortCellClassname,
|
|
1407
|
-
onClick: handleClick,
|
|
1408
|
-
onKeyDown: handleKeyDown,
|
|
1409
1324
|
children: [/*#__PURE__*/o("span", {
|
|
1410
1325
|
className: headerSortNameClassname,
|
|
1411
1326
|
children: children
|
|
@@ -1418,20 +1333,33 @@ function SortableHeaderCell({
|
|
|
1418
1333
|
});
|
|
1419
1334
|
}
|
|
1420
1335
|
|
|
1421
|
-
const
|
|
1336
|
+
const cellSortableClassname = "c6l2wv17-0-0-beta-40";
|
|
1337
|
+
const cellResizable = "c1kqdw7y7-0-0-beta-40";
|
|
1422
1338
|
const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
|
|
1339
|
+
const resizeHandleClassname = "r1y6ywlx7-0-0-beta-40";
|
|
1340
|
+
const cellDraggableClassname = 'rdg-cell-draggable';
|
|
1341
|
+
const cellDragging = "c1bezg5o7-0-0-beta-40";
|
|
1342
|
+
const cellDraggingClassname = `rdg-cell-dragging ${cellDragging}`;
|
|
1343
|
+
const cellOver = "c1vc96037-0-0-beta-40";
|
|
1344
|
+
const cellOverClassname = `rdg-cell-drag-over ${cellOver}`;
|
|
1423
1345
|
function HeaderCell({
|
|
1424
1346
|
column,
|
|
1425
1347
|
colSpan,
|
|
1348
|
+
rowIdx,
|
|
1426
1349
|
isCellSelected,
|
|
1427
1350
|
onColumnResize,
|
|
1351
|
+
onColumnsReorder,
|
|
1428
1352
|
sortColumns,
|
|
1429
1353
|
onSortColumnsChange,
|
|
1430
1354
|
selectCell,
|
|
1431
1355
|
shouldFocusGrid,
|
|
1432
|
-
direction
|
|
1356
|
+
direction,
|
|
1357
|
+
dragDropKey
|
|
1433
1358
|
}) {
|
|
1359
|
+
const [isDragging, setIsDragging] = h(false);
|
|
1360
|
+
const [isOver, setIsOver] = h(false);
|
|
1434
1361
|
const isRtl = direction === 'rtl';
|
|
1362
|
+
const rowSpan = getHeaderCellRowSpan(column, rowIdx);
|
|
1435
1363
|
const {
|
|
1436
1364
|
tabIndex,
|
|
1437
1365
|
childTabIndex,
|
|
@@ -1442,7 +1370,12 @@ function HeaderCell({
|
|
|
1442
1370
|
const sortDirection = sortColumn?.direction;
|
|
1443
1371
|
const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;
|
|
1444
1372
|
const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;
|
|
1445
|
-
const
|
|
1373
|
+
const {
|
|
1374
|
+
sortable,
|
|
1375
|
+
resizable,
|
|
1376
|
+
draggable
|
|
1377
|
+
} = column;
|
|
1378
|
+
const className = getCellClassname(column, column.headerCellClass, sortable && cellSortableClassname, resizable && cellResizableClassname, draggable && cellDraggableClassname, isDragging && cellDraggingClassname, isOver && cellOverClassname);
|
|
1446
1379
|
const renderHeaderCell$1 = column.renderHeaderCell ?? renderHeaderCell;
|
|
1447
1380
|
function onPointerDown(event) {
|
|
1448
1381
|
if (event.pointerType === 'mouse' && event.buttons !== 1) {
|
|
@@ -1452,20 +1385,18 @@ function HeaderCell({
|
|
|
1452
1385
|
currentTarget,
|
|
1453
1386
|
pointerId
|
|
1454
1387
|
} = event;
|
|
1388
|
+
const headerCell = currentTarget.parentElement;
|
|
1455
1389
|
const {
|
|
1456
1390
|
right,
|
|
1457
1391
|
left
|
|
1458
|
-
} =
|
|
1392
|
+
} = headerCell.getBoundingClientRect();
|
|
1459
1393
|
const offset = isRtl ? event.clientX - left : right - event.clientX;
|
|
1460
|
-
if (offset > 11) {
|
|
1461
|
-
return;
|
|
1462
|
-
}
|
|
1463
1394
|
function onPointerMove(event) {
|
|
1464
1395
|
event.preventDefault();
|
|
1465
1396
|
const {
|
|
1466
1397
|
right,
|
|
1467
1398
|
left
|
|
1468
|
-
} =
|
|
1399
|
+
} = headerCell.getBoundingClientRect();
|
|
1469
1400
|
const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
|
|
1470
1401
|
if (width > 0) {
|
|
1471
1402
|
onColumnResize(column, clampColumnWidth(width, column));
|
|
@@ -1511,54 +1442,125 @@ function HeaderCell({
|
|
|
1511
1442
|
}
|
|
1512
1443
|
}
|
|
1513
1444
|
}
|
|
1514
|
-
function onClick() {
|
|
1515
|
-
selectCell(
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
} = event.currentTarget.getBoundingClientRect();
|
|
1522
|
-
const offset = isRtl ? event.clientX - left : right - event.clientX;
|
|
1523
|
-
if (offset > 11) {
|
|
1524
|
-
return;
|
|
1445
|
+
function onClick(event) {
|
|
1446
|
+
selectCell({
|
|
1447
|
+
idx: column.idx,
|
|
1448
|
+
rowIdx
|
|
1449
|
+
});
|
|
1450
|
+
if (sortable) {
|
|
1451
|
+
onSort(event.ctrlKey || event.metaKey);
|
|
1525
1452
|
}
|
|
1453
|
+
}
|
|
1454
|
+
function onDoubleClick() {
|
|
1526
1455
|
onColumnResize(column, 'max-content');
|
|
1527
1456
|
}
|
|
1528
1457
|
function handleFocus(event) {
|
|
1529
1458
|
onFocus?.(event);
|
|
1530
1459
|
if (shouldFocusGrid) {
|
|
1531
|
-
selectCell(
|
|
1460
|
+
selectCell({
|
|
1461
|
+
idx: 0,
|
|
1462
|
+
rowIdx
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
function onKeyDown(event) {
|
|
1467
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
1468
|
+
event.preventDefault();
|
|
1469
|
+
onSort(event.ctrlKey || event.metaKey);
|
|
1532
1470
|
}
|
|
1533
1471
|
}
|
|
1472
|
+
function onDragStart(event) {
|
|
1473
|
+
event.dataTransfer.setData(dragDropKey, column.key);
|
|
1474
|
+
event.dataTransfer.dropEffect = 'move';
|
|
1475
|
+
setIsDragging(true);
|
|
1476
|
+
}
|
|
1477
|
+
function onDragEnd() {
|
|
1478
|
+
setIsDragging(false);
|
|
1479
|
+
}
|
|
1480
|
+
function onDragOver(event) {
|
|
1481
|
+
event.preventDefault();
|
|
1482
|
+
event.dataTransfer.dropEffect = 'move';
|
|
1483
|
+
}
|
|
1484
|
+
function onDrop(event) {
|
|
1485
|
+
setIsOver(false);
|
|
1486
|
+
if (event.dataTransfer.types.includes(dragDropKey)) {
|
|
1487
|
+
const sourceKey = event.dataTransfer.getData(dragDropKey);
|
|
1488
|
+
if (sourceKey !== column.key) {
|
|
1489
|
+
event.preventDefault();
|
|
1490
|
+
onColumnsReorder?.(sourceKey, column.key);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
function onDragEnter(event) {
|
|
1495
|
+
if (isEventPertinent(event)) {
|
|
1496
|
+
setIsOver(true);
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
function onDragLeave(event) {
|
|
1500
|
+
if (isEventPertinent(event)) {
|
|
1501
|
+
setIsOver(false);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
let draggableProps;
|
|
1505
|
+
if (draggable) {
|
|
1506
|
+
draggableProps = {
|
|
1507
|
+
draggable: true,
|
|
1508
|
+
onDragStart,
|
|
1509
|
+
onDragEnd,
|
|
1510
|
+
onDragOver,
|
|
1511
|
+
onDragEnter,
|
|
1512
|
+
onDragLeave,
|
|
1513
|
+
onDrop
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1534
1516
|
return /*#__PURE__*/o("div", {
|
|
1535
1517
|
role: "columnheader",
|
|
1536
1518
|
"aria-colindex": column.idx + 1,
|
|
1519
|
+
"aria-colspan": colSpan,
|
|
1520
|
+
"aria-rowspan": rowSpan,
|
|
1537
1521
|
"aria-selected": isCellSelected,
|
|
1538
1522
|
"aria-sort": ariaSort,
|
|
1539
|
-
"aria-colspan": colSpan,
|
|
1540
1523
|
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1541
1524
|
className: className,
|
|
1542
|
-
style:
|
|
1525
|
+
style: {
|
|
1526
|
+
...getHeaderCellStyle(column, rowIdx, rowSpan),
|
|
1527
|
+
...getCellStyle(column, colSpan)
|
|
1528
|
+
},
|
|
1543
1529
|
onFocus: handleFocus,
|
|
1544
1530
|
onClick: onClick,
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
children: renderHeaderCell$1({
|
|
1531
|
+
onKeyDown: sortable ? onKeyDown : undefined,
|
|
1532
|
+
...draggableProps,
|
|
1533
|
+
children: [renderHeaderCell$1({
|
|
1548
1534
|
column,
|
|
1549
1535
|
sortDirection,
|
|
1550
1536
|
priority,
|
|
1551
|
-
onSort,
|
|
1552
1537
|
tabIndex: childTabIndex
|
|
1553
|
-
})
|
|
1538
|
+
}), resizable && /*#__PURE__*/o("div", {
|
|
1539
|
+
className: resizeHandleClassname,
|
|
1540
|
+
onClick: stopPropagation,
|
|
1541
|
+
onDoubleClick: onDoubleClick,
|
|
1542
|
+
onPointerDown: onPointerDown
|
|
1543
|
+
})]
|
|
1554
1544
|
});
|
|
1555
1545
|
}
|
|
1546
|
+
function isEventPertinent(event) {
|
|
1547
|
+
const relatedTarget = event.relatedTarget;
|
|
1548
|
+
return !event.currentTarget.contains(relatedTarget);
|
|
1549
|
+
}
|
|
1556
1550
|
|
|
1557
|
-
const
|
|
1551
|
+
const row = "r1upfr807-0-0-beta-40";
|
|
1552
|
+
const rowClassname = `rdg-row ${row}`;
|
|
1553
|
+
const rowSelected = "r190mhd37-0-0-beta-40";
|
|
1554
|
+
const rowSelectedClassname = 'rdg-row-selected';
|
|
1555
|
+
const rowSelectedWithFrozenCell = "r139qu9m7-0-0-beta-40";
|
|
1556
|
+
|
|
1557
|
+
const headerRow = "h10tskcx7-0-0-beta-40";
|
|
1558
1558
|
const headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1559
1559
|
function HeaderRow({
|
|
1560
|
+
rowIdx,
|
|
1560
1561
|
columns,
|
|
1561
1562
|
onColumnResize,
|
|
1563
|
+
onColumnsReorder,
|
|
1562
1564
|
sortColumns,
|
|
1563
1565
|
onSortColumnsChange,
|
|
1564
1566
|
lastFrozenColumnIndex,
|
|
@@ -1567,6 +1569,7 @@ function HeaderRow({
|
|
|
1567
1569
|
shouldFocusGrid,
|
|
1568
1570
|
direction
|
|
1569
1571
|
}) {
|
|
1572
|
+
const dragDropKey = V$1();
|
|
1570
1573
|
const cells = [];
|
|
1571
1574
|
for (let index = 0; index < columns.length; index++) {
|
|
1572
1575
|
const column = columns[index];
|
|
@@ -1579,28 +1582,70 @@ function HeaderRow({
|
|
|
1579
1582
|
cells.push( /*#__PURE__*/o(HeaderCell, {
|
|
1580
1583
|
column: column,
|
|
1581
1584
|
colSpan: colSpan,
|
|
1585
|
+
rowIdx: rowIdx,
|
|
1582
1586
|
isCellSelected: selectedCellIdx === column.idx,
|
|
1583
1587
|
onColumnResize: onColumnResize,
|
|
1588
|
+
onColumnsReorder: onColumnsReorder,
|
|
1584
1589
|
onSortColumnsChange: onSortColumnsChange,
|
|
1585
1590
|
sortColumns: sortColumns,
|
|
1586
1591
|
selectCell: selectCell,
|
|
1587
1592
|
shouldFocusGrid: shouldFocusGrid && index === 0,
|
|
1588
|
-
direction: direction
|
|
1593
|
+
direction: direction,
|
|
1594
|
+
dragDropKey: dragDropKey
|
|
1589
1595
|
}, column.key));
|
|
1590
1596
|
}
|
|
1591
1597
|
return /*#__PURE__*/o("div", {
|
|
1592
1598
|
role: "row",
|
|
1593
|
-
"aria-rowindex":
|
|
1599
|
+
"aria-rowindex": rowIdx,
|
|
1594
1600
|
className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
1595
|
-
style: getRowStyle(1),
|
|
1596
1601
|
children: cells
|
|
1597
1602
|
});
|
|
1598
1603
|
}
|
|
1599
1604
|
const HeaderRow$1 = /*#__PURE__*/x(HeaderRow);
|
|
1600
1605
|
|
|
1601
|
-
|
|
1606
|
+
function GroupedColumnHeaderRow({
|
|
1607
|
+
rowIdx,
|
|
1608
|
+
level,
|
|
1609
|
+
columns,
|
|
1610
|
+
selectedCellIdx,
|
|
1611
|
+
selectCell
|
|
1612
|
+
}) {
|
|
1613
|
+
const cells = [];
|
|
1614
|
+
const renderedParents = new Set();
|
|
1615
|
+
for (const column of columns) {
|
|
1616
|
+
let {
|
|
1617
|
+
parent
|
|
1618
|
+
} = column;
|
|
1619
|
+
if (parent === undefined) continue;
|
|
1620
|
+
while (parent.level > level) {
|
|
1621
|
+
if (parent.parent === undefined) break;
|
|
1622
|
+
parent = parent.parent;
|
|
1623
|
+
}
|
|
1624
|
+
if (parent.level === level && !renderedParents.has(parent)) {
|
|
1625
|
+
renderedParents.add(parent);
|
|
1626
|
+
const {
|
|
1627
|
+
idx
|
|
1628
|
+
} = parent;
|
|
1629
|
+
cells.push( /*#__PURE__*/o(GroupedColumnHeaderCell, {
|
|
1630
|
+
column: parent,
|
|
1631
|
+
rowIdx: rowIdx,
|
|
1632
|
+
isCellSelected: selectedCellIdx === idx,
|
|
1633
|
+
selectCell: selectCell
|
|
1634
|
+
}, idx));
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
return /*#__PURE__*/o("div", {
|
|
1638
|
+
role: "row",
|
|
1639
|
+
"aria-rowindex": rowIdx,
|
|
1640
|
+
className: headerRowClassname,
|
|
1641
|
+
children: cells
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
const GroupedColumnHeaderRow$1 = /*#__PURE__*/x(GroupedColumnHeaderRow);
|
|
1645
|
+
|
|
1646
|
+
const cellCopied = "c6ra8a37-0-0-beta-40";
|
|
1602
1647
|
const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
|
|
1603
|
-
const cellDraggedOver = "
|
|
1648
|
+
const cellDraggedOver = "cq910m07-0-0-beta-40";
|
|
1604
1649
|
const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1605
1650
|
function Cell({
|
|
1606
1651
|
column,
|
|
@@ -1610,7 +1655,6 @@ function Cell({
|
|
|
1610
1655
|
isDraggedOver,
|
|
1611
1656
|
row,
|
|
1612
1657
|
rowIdx,
|
|
1613
|
-
dragHandle,
|
|
1614
1658
|
onClick,
|
|
1615
1659
|
onDoubleClick,
|
|
1616
1660
|
onContextMenu,
|
|
@@ -1676,8 +1720,8 @@ function Cell({
|
|
|
1676
1720
|
return /*#__PURE__*/o("div", {
|
|
1677
1721
|
role: "gridcell",
|
|
1678
1722
|
"aria-colindex": column.idx + 1,
|
|
1679
|
-
"aria-selected": isCellSelected,
|
|
1680
1723
|
"aria-colspan": colSpan,
|
|
1724
|
+
"aria-selected": isCellSelected,
|
|
1681
1725
|
"aria-readonly": !isEditable || undefined,
|
|
1682
1726
|
tabIndex: tabIndex,
|
|
1683
1727
|
className: className,
|
|
@@ -1687,14 +1731,12 @@ function Cell({
|
|
|
1687
1731
|
onContextMenu: handleContextMenu,
|
|
1688
1732
|
onFocus: onFocus,
|
|
1689
1733
|
...props,
|
|
1690
|
-
children:
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
onRowChange: handleRowChange
|
|
1697
|
-
}), dragHandle]
|
|
1734
|
+
children: column.renderCell({
|
|
1735
|
+
column,
|
|
1736
|
+
row,
|
|
1737
|
+
isCellEditable: isEditable,
|
|
1738
|
+
tabIndex: childTabIndex,
|
|
1739
|
+
onRowChange: handleRowChange
|
|
1698
1740
|
})
|
|
1699
1741
|
});
|
|
1700
1742
|
}
|
|
@@ -1713,7 +1755,6 @@ function Row({
|
|
|
1713
1755
|
row,
|
|
1714
1756
|
viewportColumns,
|
|
1715
1757
|
selectedCellEditor,
|
|
1716
|
-
selectedCellDragHandle,
|
|
1717
1758
|
onCellClick,
|
|
1718
1759
|
onCellDoubleClick,
|
|
1719
1760
|
onCellContextMenu,
|
|
@@ -1757,7 +1798,6 @@ function Row({
|
|
|
1757
1798
|
isCopied: copiedCellIdx === idx,
|
|
1758
1799
|
isDraggedOver: draggedOverCellIdx === idx,
|
|
1759
1800
|
isCellSelected: isCellSelected,
|
|
1760
|
-
dragHandle: isCellSelected ? selectedCellDragHandle : undefined,
|
|
1761
1801
|
onClick: onCellClick,
|
|
1762
1802
|
onDoubleClick: onCellDoubleClick,
|
|
1763
1803
|
onContextMenu: onCellContextMenu,
|
|
@@ -1820,7 +1860,7 @@ function ScrollToCell({
|
|
|
1820
1860
|
});
|
|
1821
1861
|
}
|
|
1822
1862
|
|
|
1823
|
-
const arrow = "
|
|
1863
|
+
const arrow = "a3ejtar7-0-0-beta-40";
|
|
1824
1864
|
const arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
1825
1865
|
function renderSortStatus({
|
|
1826
1866
|
sortDirection,
|
|
@@ -1855,13 +1895,14 @@ function renderSortPriority({
|
|
|
1855
1895
|
return priority;
|
|
1856
1896
|
}
|
|
1857
1897
|
|
|
1858
|
-
const root = "
|
|
1898
|
+
const root = "rnvodz57-0-0-beta-40";
|
|
1859
1899
|
const rootClassname = `rdg ${root}`;
|
|
1860
|
-
const viewportDragging = "
|
|
1900
|
+
const viewportDragging = "vlqv91k7-0-0-beta-40";
|
|
1861
1901
|
const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
|
|
1862
|
-
const focusSinkClassname = "
|
|
1902
|
+
const focusSinkClassname = "f1lsfrzw7-0-0-beta-40";
|
|
1903
|
+
const focusSinkHeaderAndSummaryClassname = "f1cte0lg7-0-0-beta-40";
|
|
1863
1904
|
|
|
1864
|
-
const summaryCellClassname = "
|
|
1905
|
+
const summaryCellClassname = "s8wc6fl7-0-0-beta-40";
|
|
1865
1906
|
function SummaryCell({
|
|
1866
1907
|
column,
|
|
1867
1908
|
colSpan,
|
|
@@ -1904,10 +1945,10 @@ function SummaryCell({
|
|
|
1904
1945
|
}
|
|
1905
1946
|
const SummaryCell$1 = /*#__PURE__*/x(SummaryCell);
|
|
1906
1947
|
|
|
1907
|
-
const summaryRow = "
|
|
1908
|
-
const topSummaryRow = "
|
|
1909
|
-
const topSummaryRowBorderClassname = "
|
|
1910
|
-
const bottomSummaryRowBorderClassname = "
|
|
1948
|
+
const summaryRow = "skuhp557-0-0-beta-40";
|
|
1949
|
+
const topSummaryRow = "tf8l5ub7-0-0-beta-40";
|
|
1950
|
+
const topSummaryRowBorderClassname = "tb9ughf7-0-0-beta-40";
|
|
1951
|
+
const bottomSummaryRowBorderClassname = "b1yssfnt7-0-0-beta-40";
|
|
1911
1952
|
const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
1912
1953
|
const topSummaryRowClassname = `rdg-top-summary-row ${topSummaryRow}`;
|
|
1913
1954
|
function SummaryRow({
|
|
@@ -1961,7 +2002,7 @@ const SummaryRow$1 = /*#__PURE__*/x(SummaryRow);
|
|
|
1961
2002
|
function DataGrid(props, ref) {
|
|
1962
2003
|
const {
|
|
1963
2004
|
columns: rawColumns,
|
|
1964
|
-
rows
|
|
2005
|
+
rows,
|
|
1965
2006
|
topSummaryRows,
|
|
1966
2007
|
bottomSummaryRows,
|
|
1967
2008
|
rowKeyGetter,
|
|
@@ -1974,16 +2015,14 @@ function DataGrid(props, ref) {
|
|
|
1974
2015
|
sortColumns,
|
|
1975
2016
|
onSortColumnsChange,
|
|
1976
2017
|
defaultColumnOptions,
|
|
1977
|
-
groupBy: rawGroupBy,
|
|
1978
|
-
rowGrouper,
|
|
1979
|
-
expandedGroupIds,
|
|
1980
|
-
onExpandedGroupIdsChange,
|
|
1981
2018
|
onCellClick,
|
|
1982
2019
|
onCellDoubleClick,
|
|
1983
2020
|
onCellContextMenu,
|
|
1984
2021
|
onCellKeyDown,
|
|
2022
|
+
onSelectedCellChange,
|
|
1985
2023
|
onScroll,
|
|
1986
2024
|
onColumnResize,
|
|
2025
|
+
onColumnsReorder,
|
|
1987
2026
|
onFill,
|
|
1988
2027
|
onCopy,
|
|
1989
2028
|
onPaste,
|
|
@@ -1993,12 +2032,15 @@ function DataGrid(props, ref) {
|
|
|
1993
2032
|
style,
|
|
1994
2033
|
rowClass,
|
|
1995
2034
|
direction: rawDirection,
|
|
2035
|
+
role: rawRole,
|
|
1996
2036
|
'aria-label': ariaLabel,
|
|
1997
2037
|
'aria-labelledby': ariaLabelledBy,
|
|
1998
2038
|
'aria-describedby': ariaDescribedBy,
|
|
2039
|
+
'aria-rowcount': rawAriaRowCount,
|
|
1999
2040
|
'data-testid': testId
|
|
2000
2041
|
} = props;
|
|
2001
2042
|
const defaultRenderers = useDefaultRenderers();
|
|
2043
|
+
const role = rawRole ?? 'grid';
|
|
2002
2044
|
const rowHeight = rawRowHeight ?? 35;
|
|
2003
2045
|
const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
2004
2046
|
const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
@@ -2008,36 +2050,62 @@ function DataGrid(props, ref) {
|
|
|
2008
2050
|
const noRowsFallback = renderers?.noRowsFallback ?? defaultRenderers?.noRowsFallback;
|
|
2009
2051
|
const enableVirtualization = rawEnableVirtualization ?? true;
|
|
2010
2052
|
const direction = rawDirection ?? 'ltr';
|
|
2011
|
-
const
|
|
2053
|
+
const [scrollTop, setScrollTop] = h(0);
|
|
2054
|
+
const [scrollLeft, setScrollLeft] = h(0);
|
|
2055
|
+
const [resizedColumnWidths, setResizedColumnWidths] = h(() => new Map());
|
|
2056
|
+
const [measuredColumnWidths, setMeasuredColumnWidths] = h(() => new Map());
|
|
2057
|
+
const [copiedCell, setCopiedCell] = h(null);
|
|
2058
|
+
const [isDragging, setDragging] = h(false);
|
|
2059
|
+
const [draggedOverRowIdx, setOverRowIdx] = h(undefined);
|
|
2060
|
+
const [scrollToPosition, setScrollToPosition] = h(null);
|
|
2061
|
+
const getColumnWidth = T$1(column => {
|
|
2062
|
+
return resizedColumnWidths.get(column.key) ?? measuredColumnWidths.get(column.key) ?? column.width;
|
|
2063
|
+
}, [measuredColumnWidths, resizedColumnWidths]);
|
|
2064
|
+
const [gridRef, gridWidth, gridHeight] = useGridDimensions();
|
|
2065
|
+
const {
|
|
2066
|
+
columns,
|
|
2067
|
+
colSpanColumns,
|
|
2068
|
+
lastFrozenColumnIndex,
|
|
2069
|
+
headerRowsCount,
|
|
2070
|
+
colOverscanStartIdx,
|
|
2071
|
+
colOverscanEndIdx,
|
|
2072
|
+
templateColumns,
|
|
2073
|
+
layoutCssVars,
|
|
2074
|
+
totalFrozenColumnWidth
|
|
2075
|
+
} = useCalculatedColumns({
|
|
2076
|
+
rawColumns,
|
|
2077
|
+
defaultColumnOptions,
|
|
2078
|
+
getColumnWidth,
|
|
2079
|
+
scrollLeft,
|
|
2080
|
+
viewportWidth: gridWidth,
|
|
2081
|
+
enableVirtualization
|
|
2082
|
+
});
|
|
2012
2083
|
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
2013
2084
|
const bottomSummaryRowsCount = bottomSummaryRows?.length ?? 0;
|
|
2014
2085
|
const summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount;
|
|
2015
2086
|
const headerAndTopSummaryRowsCount = headerRowsCount + topSummaryRowsCount;
|
|
2087
|
+
const groupedColumnHeaderRowsCount = headerRowsCount - 1;
|
|
2016
2088
|
const minRowIdx = -headerAndTopSummaryRowsCount;
|
|
2017
|
-
const
|
|
2018
|
-
const
|
|
2019
|
-
const [resizedColumnWidths, setResizedColumnWidths] = h(() => new Map());
|
|
2020
|
-
const [measuredColumnWidths, setMeasuredColumnWidths] = h(() => new Map());
|
|
2089
|
+
const mainHeaderRowIdx = minRowIdx + groupedColumnHeaderRowsCount;
|
|
2090
|
+
const maxRowIdx = rows.length + bottomSummaryRowsCount - 1;
|
|
2021
2091
|
const [selectedPosition, setSelectedPosition] = h(() => ({
|
|
2022
2092
|
idx: -1,
|
|
2023
2093
|
rowIdx: minRowIdx - 1,
|
|
2024
2094
|
mode: 'SELECT'
|
|
2025
2095
|
}));
|
|
2026
|
-
const [copiedCell, setCopiedCell] = h(null);
|
|
2027
|
-
const [isDragging, setDragging] = h(false);
|
|
2028
|
-
const [draggedOverRowIdx, setOverRowIdx] = h(undefined);
|
|
2029
|
-
const [scrollToPosition, setScrollToPosition] = h(null);
|
|
2030
2096
|
const prevSelectedPosition = _$1(selectedPosition);
|
|
2031
2097
|
const latestDraggedOverRowIdx = _$1(draggedOverRowIdx);
|
|
2032
2098
|
const lastSelectedRowIdx = _$1(-1);
|
|
2033
|
-
const
|
|
2099
|
+
const focusSinkRef = _$1(null);
|
|
2034
2100
|
const shouldFocusCellRef = _$1(false);
|
|
2035
|
-
const
|
|
2036
|
-
const
|
|
2101
|
+
const isTreeGrid = role === 'treegrid';
|
|
2102
|
+
const headerRowsHeight = headerRowsCount * headerRowHeight;
|
|
2103
|
+
const clientHeight = gridHeight - headerRowsHeight - summaryRowsCount * summaryRowHeight;
|
|
2037
2104
|
const isSelectable = selectedRows != null && onSelectedRowsChange != null;
|
|
2038
2105
|
const isRtl = direction === 'rtl';
|
|
2039
2106
|
const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';
|
|
2040
2107
|
const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';
|
|
2108
|
+
const ariaRowCount = rawAriaRowCount ?? headerRowsCount + rows.length + summaryRowsCount;
|
|
2041
2109
|
const defaultGridComponents = F$1(() => ({
|
|
2042
2110
|
renderCheckbox: renderCheckbox$1,
|
|
2043
2111
|
renderSortStatus: renderSortStatus$1
|
|
@@ -2045,48 +2113,22 @@ function DataGrid(props, ref) {
|
|
|
2045
2113
|
const allRowsSelected = F$1(() => {
|
|
2046
2114
|
const {
|
|
2047
2115
|
length
|
|
2048
|
-
} =
|
|
2049
|
-
return length !== 0 && selectedRows != null && rowKeyGetter != null && selectedRows.size >= length &&
|
|
2050
|
-
}, [
|
|
2051
|
-
const {
|
|
2052
|
-
columns,
|
|
2053
|
-
colSpanColumns,
|
|
2054
|
-
colOverscanStartIdx,
|
|
2055
|
-
colOverscanEndIdx,
|
|
2056
|
-
templateColumns,
|
|
2057
|
-
layoutCssVars,
|
|
2058
|
-
lastFrozenColumnIndex,
|
|
2059
|
-
totalFrozenColumnWidth,
|
|
2060
|
-
groupBy
|
|
2061
|
-
} = useCalculatedColumns({
|
|
2062
|
-
rawColumns,
|
|
2063
|
-
measuredColumnWidths,
|
|
2064
|
-
resizedColumnWidths,
|
|
2065
|
-
scrollLeft,
|
|
2066
|
-
viewportWidth: gridWidth,
|
|
2067
|
-
defaultColumnOptions,
|
|
2068
|
-
rawGroupBy: rowGrouper ? rawGroupBy : undefined,
|
|
2069
|
-
enableVirtualization
|
|
2070
|
-
});
|
|
2116
|
+
} = rows;
|
|
2117
|
+
return length !== 0 && selectedRows != null && rowKeyGetter != null && selectedRows.size >= length && rows.every(row => selectedRows.has(rowKeyGetter(row)));
|
|
2118
|
+
}, [rows, selectedRows, rowKeyGetter]);
|
|
2071
2119
|
const {
|
|
2072
2120
|
rowOverscanStartIdx,
|
|
2073
2121
|
rowOverscanEndIdx,
|
|
2074
|
-
rows,
|
|
2075
|
-
rowsCount,
|
|
2076
2122
|
totalRowHeight,
|
|
2077
2123
|
gridTemplateRows,
|
|
2078
|
-
isGroupRow,
|
|
2079
2124
|
getRowTop,
|
|
2080
2125
|
getRowHeight,
|
|
2081
2126
|
findRowIdx
|
|
2082
2127
|
} = useViewportRows({
|
|
2083
|
-
|
|
2084
|
-
groupBy,
|
|
2085
|
-
rowGrouper,
|
|
2128
|
+
rows,
|
|
2086
2129
|
rowHeight,
|
|
2087
2130
|
clientHeight,
|
|
2088
2131
|
scrollTop,
|
|
2089
|
-
expandedGroupIds,
|
|
2090
2132
|
enableVirtualization
|
|
2091
2133
|
});
|
|
2092
2134
|
const viewportColumns = useViewportColumns({
|
|
@@ -2099,20 +2141,18 @@ function DataGrid(props, ref) {
|
|
|
2099
2141
|
rowOverscanEndIdx,
|
|
2100
2142
|
rows,
|
|
2101
2143
|
topSummaryRows,
|
|
2102
|
-
bottomSummaryRows
|
|
2103
|
-
isGroupRow
|
|
2144
|
+
bottomSummaryRows
|
|
2104
2145
|
});
|
|
2105
2146
|
const {
|
|
2106
2147
|
gridTemplateColumns,
|
|
2107
2148
|
handleColumnResize
|
|
2108
2149
|
} = useColumnWidths(columns, viewportColumns, templateColumns, gridRef, gridWidth, resizedColumnWidths, measuredColumnWidths, setResizedColumnWidths, setMeasuredColumnWidths, onColumnResize);
|
|
2109
|
-
const
|
|
2110
|
-
const minColIdx = hasGroups ? -1 : 0;
|
|
2150
|
+
const minColIdx = isTreeGrid ? -1 : 0;
|
|
2111
2151
|
const maxColIdx = columns.length - 1;
|
|
2112
|
-
const maxRowIdx = rows.length + bottomSummaryRowsCount - 1;
|
|
2113
2152
|
const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition);
|
|
2114
2153
|
const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition);
|
|
2115
2154
|
const handleColumnResizeLatest = useLatestFunc(handleColumnResize);
|
|
2155
|
+
const onColumnsReorderLastest = useLatestFunc(onColumnsReorder);
|
|
2116
2156
|
const onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange);
|
|
2117
2157
|
const onCellClickLatest = useLatestFunc(onCellClick);
|
|
2118
2158
|
const onCellDoubleClickLatest = useLatestFunc(onCellDoubleClick);
|
|
@@ -2120,19 +2160,15 @@ function DataGrid(props, ref) {
|
|
|
2120
2160
|
const selectRowLatest = useLatestFunc(selectRow);
|
|
2121
2161
|
const handleFormatterRowChangeLatest = useLatestFunc(updateRow);
|
|
2122
2162
|
const selectCellLatest = useLatestFunc(selectCell);
|
|
2123
|
-
const
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
});
|
|
2128
|
-
});
|
|
2129
|
-
const selectHeaderCellLatest = useLatestFunc(idx => {
|
|
2163
|
+
const selectHeaderCellLatest = useLatestFunc(({
|
|
2164
|
+
idx,
|
|
2165
|
+
rowIdx
|
|
2166
|
+
}) => {
|
|
2130
2167
|
selectCell({
|
|
2131
|
-
rowIdx: minRowIdx,
|
|
2168
|
+
rowIdx: minRowIdx + rowIdx - 1,
|
|
2132
2169
|
idx
|
|
2133
2170
|
});
|
|
2134
2171
|
});
|
|
2135
|
-
const toggleGroupLatest = useLatestFunc(toggleGroup);
|
|
2136
2172
|
useLayoutEffect(() => {
|
|
2137
2173
|
if (!selectedCellIsWithinSelectionBounds || isSamePosition(selectedPosition, prevSelectedPosition.current)) {
|
|
2138
2174
|
prevSelectedPosition.current = selectedPosition;
|
|
@@ -2140,22 +2176,16 @@ function DataGrid(props, ref) {
|
|
|
2140
2176
|
}
|
|
2141
2177
|
prevSelectedPosition.current = selectedPosition;
|
|
2142
2178
|
if (selectedPosition.idx === -1) {
|
|
2143
|
-
|
|
2179
|
+
focusSinkRef.current.focus({
|
|
2144
2180
|
preventScroll: true
|
|
2145
2181
|
});
|
|
2146
|
-
scrollIntoView(
|
|
2182
|
+
scrollIntoView(focusSinkRef.current);
|
|
2147
2183
|
}
|
|
2148
2184
|
});
|
|
2149
2185
|
useLayoutEffect(() => {
|
|
2150
2186
|
if (!shouldFocusCellRef.current) return;
|
|
2151
2187
|
shouldFocusCellRef.current = false;
|
|
2152
|
-
|
|
2153
|
-
if (cell === null) return;
|
|
2154
|
-
scrollIntoView(cell);
|
|
2155
|
-
const elementToFocus = cell.querySelector('[tabindex="0"]') ?? cell;
|
|
2156
|
-
elementToFocus.focus({
|
|
2157
|
-
preventScroll: true
|
|
2158
|
-
});
|
|
2188
|
+
focusCellOrCellContent();
|
|
2159
2189
|
});
|
|
2160
2190
|
A(ref, () => ({
|
|
2161
2191
|
element: gridRef.current,
|
|
@@ -2183,7 +2213,7 @@ function DataGrid(props, ref) {
|
|
|
2183
2213
|
assertIsValidKeyGetter(rowKeyGetter);
|
|
2184
2214
|
if (args.type === 'HEADER') {
|
|
2185
2215
|
const newSelectedRows = new Set(selectedRows);
|
|
2186
|
-
for (const row of
|
|
2216
|
+
for (const row of rows) {
|
|
2187
2217
|
const rowKey = rowKeyGetter(row);
|
|
2188
2218
|
if (args.checked) {
|
|
2189
2219
|
newSelectedRows.add(rowKey);
|
|
@@ -2200,18 +2230,6 @@ function DataGrid(props, ref) {
|
|
|
2200
2230
|
isShiftClick
|
|
2201
2231
|
} = args;
|
|
2202
2232
|
const newSelectedRows = new Set(selectedRows);
|
|
2203
|
-
if (isGroupRow(row)) {
|
|
2204
|
-
for (const childRow of row.childRows) {
|
|
2205
|
-
const rowKey = rowKeyGetter(childRow);
|
|
2206
|
-
if (checked) {
|
|
2207
|
-
newSelectedRows.add(rowKey);
|
|
2208
|
-
} else {
|
|
2209
|
-
newSelectedRows.delete(rowKey);
|
|
2210
|
-
}
|
|
2211
|
-
}
|
|
2212
|
-
onSelectedRowsChange(newSelectedRows);
|
|
2213
|
-
return;
|
|
2214
|
-
}
|
|
2215
2233
|
const rowKey = rowKeyGetter(row);
|
|
2216
2234
|
if (checked) {
|
|
2217
2235
|
newSelectedRows.add(rowKey);
|
|
@@ -2222,7 +2240,6 @@ function DataGrid(props, ref) {
|
|
|
2222
2240
|
const step = sign(rowIdx - previousRowIdx);
|
|
2223
2241
|
for (let i = previousRowIdx + step; i !== rowIdx; i += step) {
|
|
2224
2242
|
const row = rows[i];
|
|
2225
|
-
if (isGroupRow(row)) continue;
|
|
2226
2243
|
newSelectedRows.add(rowKeyGetter(row));
|
|
2227
2244
|
}
|
|
2228
2245
|
}
|
|
@@ -2232,16 +2249,6 @@ function DataGrid(props, ref) {
|
|
|
2232
2249
|
}
|
|
2233
2250
|
onSelectedRowsChange(newSelectedRows);
|
|
2234
2251
|
}
|
|
2235
|
-
function toggleGroup(expandedGroupId) {
|
|
2236
|
-
if (!onExpandedGroupIdsChange) return;
|
|
2237
|
-
const newExpandedGroupIds = new Set(expandedGroupIds);
|
|
2238
|
-
if (newExpandedGroupIds.has(expandedGroupId)) {
|
|
2239
|
-
newExpandedGroupIds.delete(expandedGroupId);
|
|
2240
|
-
} else {
|
|
2241
|
-
newExpandedGroupIds.add(expandedGroupId);
|
|
2242
|
-
}
|
|
2243
|
-
onExpandedGroupIdsChange(newExpandedGroupIds);
|
|
2244
|
-
}
|
|
2245
2252
|
function handleKeyDown(event) {
|
|
2246
2253
|
const {
|
|
2247
2254
|
idx,
|
|
@@ -2249,8 +2256,8 @@ function DataGrid(props, ref) {
|
|
|
2249
2256
|
mode
|
|
2250
2257
|
} = selectedPosition;
|
|
2251
2258
|
if (mode === 'EDIT') return;
|
|
2252
|
-
|
|
2253
|
-
|
|
2259
|
+
if (onCellKeyDown && isRowIdxWithinViewportBounds(rowIdx)) {
|
|
2260
|
+
const row = rows[rowIdx];
|
|
2254
2261
|
const cellEvent = createCellEvent(event);
|
|
2255
2262
|
onCellKeyDown({
|
|
2256
2263
|
mode: 'SELECT',
|
|
@@ -2263,13 +2270,12 @@ function DataGrid(props, ref) {
|
|
|
2263
2270
|
}
|
|
2264
2271
|
if (!(event.target instanceof Element)) return;
|
|
2265
2272
|
const isCellEvent = event.target.closest('.rdg-cell') !== null;
|
|
2266
|
-
const isRowEvent =
|
|
2273
|
+
const isRowEvent = isTreeGrid && event.target === focusSinkRef.current;
|
|
2267
2274
|
if (!isCellEvent && !isRowEvent) return;
|
|
2268
2275
|
const {
|
|
2269
|
-
key,
|
|
2270
2276
|
keyCode
|
|
2271
2277
|
} = event;
|
|
2272
|
-
if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event)
|
|
2278
|
+
if (selectedCellIsWithinViewportBounds && (onPaste != null || onCopy != null) && isCtrlKeyHeldDown(event)) {
|
|
2273
2279
|
const cKey = 67;
|
|
2274
2280
|
const vKey = 86;
|
|
2275
2281
|
if (keyCode === cKey) {
|
|
@@ -2281,11 +2287,6 @@ function DataGrid(props, ref) {
|
|
|
2281
2287
|
return;
|
|
2282
2288
|
}
|
|
2283
2289
|
}
|
|
2284
|
-
if (isRowIdxWithinViewportBounds(rowIdx) && isGroupRow(row) && selectedPosition.idx === -1 && (key === leftKey && row.isExpanded || key === rightKey && !row.isExpanded)) {
|
|
2285
|
-
event.preventDefault();
|
|
2286
|
-
toggleGroup(row.id);
|
|
2287
|
-
return;
|
|
2288
|
-
}
|
|
2289
2290
|
switch (event.key) {
|
|
2290
2291
|
case 'Escape':
|
|
2291
2292
|
setCopiedCell(null);
|
|
@@ -2311,23 +2312,19 @@ function DataGrid(props, ref) {
|
|
|
2311
2312
|
scrollTop,
|
|
2312
2313
|
scrollLeft
|
|
2313
2314
|
} = event.currentTarget;
|
|
2314
|
-
|
|
2315
|
+
mn(() => {
|
|
2315
2316
|
setScrollTop(scrollTop);
|
|
2316
2317
|
setScrollLeft(abs(scrollLeft));
|
|
2317
2318
|
});
|
|
2318
2319
|
onScroll?.(event);
|
|
2319
2320
|
}
|
|
2320
|
-
function getRawRowIdx(rowIdx) {
|
|
2321
|
-
return hasGroups ? rawRows.indexOf(rows[rowIdx]) : rowIdx;
|
|
2322
|
-
}
|
|
2323
2321
|
function updateRow(column, rowIdx, row) {
|
|
2324
2322
|
if (typeof onRowsChange !== 'function') return;
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
updatedRows[rawRowIdx] = row;
|
|
2323
|
+
if (row === rows[rowIdx]) return;
|
|
2324
|
+
const updatedRows = [...rows];
|
|
2325
|
+
updatedRows[rowIdx] = row;
|
|
2329
2326
|
onRowsChange(updatedRows, {
|
|
2330
|
-
indexes: [
|
|
2327
|
+
indexes: [rowIdx],
|
|
2331
2328
|
column
|
|
2332
2329
|
});
|
|
2333
2330
|
}
|
|
@@ -2340,7 +2337,7 @@ function DataGrid(props, ref) {
|
|
|
2340
2337
|
idx,
|
|
2341
2338
|
rowIdx
|
|
2342
2339
|
} = selectedPosition;
|
|
2343
|
-
const sourceRow =
|
|
2340
|
+
const sourceRow = rows[rowIdx];
|
|
2344
2341
|
const sourceColumnKey = columns[idx].key;
|
|
2345
2342
|
setCopiedCell({
|
|
2346
2343
|
row: sourceRow,
|
|
@@ -2360,7 +2357,7 @@ function DataGrid(props, ref) {
|
|
|
2360
2357
|
rowIdx
|
|
2361
2358
|
} = selectedPosition;
|
|
2362
2359
|
const targetColumn = columns[idx];
|
|
2363
|
-
const targetRow =
|
|
2360
|
+
const targetRow = rows[rowIdx];
|
|
2364
2361
|
const updatedTargetRow = onPaste({
|
|
2365
2362
|
sourceRow: copiedCell.row,
|
|
2366
2363
|
sourceColumnKey: copiedCell.columnKey,
|
|
@@ -2372,7 +2369,6 @@ function DataGrid(props, ref) {
|
|
|
2372
2369
|
function handleCellInput(event) {
|
|
2373
2370
|
if (!selectedCellIsWithinViewportBounds) return;
|
|
2374
2371
|
const row = rows[selectedPosition.rowIdx];
|
|
2375
|
-
if (isGroupRow(row)) return;
|
|
2376
2372
|
const {
|
|
2377
2373
|
key,
|
|
2378
2374
|
shiftKey
|
|
@@ -2424,22 +2420,22 @@ function DataGrid(props, ref) {
|
|
|
2424
2420
|
return isCellWithinViewportBounds(position) && isSelectedCellEditable({
|
|
2425
2421
|
columns,
|
|
2426
2422
|
rows,
|
|
2427
|
-
selectedPosition: position
|
|
2428
|
-
isGroupRow
|
|
2423
|
+
selectedPosition: position
|
|
2429
2424
|
});
|
|
2430
2425
|
}
|
|
2431
2426
|
function selectCell(position, enableEditor) {
|
|
2432
2427
|
if (!isCellWithinSelectionBounds(position)) return;
|
|
2433
2428
|
commitEditorChanges();
|
|
2429
|
+
const row = rows[position.rowIdx];
|
|
2430
|
+
const samePosition = isSamePosition(selectedPosition, position);
|
|
2434
2431
|
if (enableEditor && isCellEditable(position)) {
|
|
2435
|
-
const row = rows[position.rowIdx];
|
|
2436
2432
|
setSelectedPosition({
|
|
2437
2433
|
...position,
|
|
2438
2434
|
mode: 'EDIT',
|
|
2439
2435
|
row,
|
|
2440
2436
|
originalRow: row
|
|
2441
2437
|
});
|
|
2442
|
-
} else if (
|
|
2438
|
+
} else if (samePosition) {
|
|
2443
2439
|
scrollIntoView(getCellToScroll(gridRef.current));
|
|
2444
2440
|
} else {
|
|
2445
2441
|
shouldFocusCellRef.current = true;
|
|
@@ -2448,30 +2444,20 @@ function DataGrid(props, ref) {
|
|
|
2448
2444
|
mode: 'SELECT'
|
|
2449
2445
|
});
|
|
2450
2446
|
}
|
|
2447
|
+
if (onSelectedCellChange && !samePosition) {
|
|
2448
|
+
onSelectedCellChange({
|
|
2449
|
+
rowIdx: position.rowIdx,
|
|
2450
|
+
row,
|
|
2451
|
+
column: columns[position.idx]
|
|
2452
|
+
});
|
|
2453
|
+
}
|
|
2451
2454
|
}
|
|
2452
2455
|
function getNextPosition(key, ctrlKey, shiftKey) {
|
|
2453
2456
|
const {
|
|
2454
2457
|
idx,
|
|
2455
2458
|
rowIdx
|
|
2456
2459
|
} = selectedPosition;
|
|
2457
|
-
const row = rows[rowIdx];
|
|
2458
2460
|
const isRowSelected = selectedCellIsWithinSelectionBounds && idx === -1;
|
|
2459
|
-
if (key === leftKey && isRowSelected && isGroupRow(row) && !row.isExpanded && row.level !== 0) {
|
|
2460
|
-
let parentRowIdx = -1;
|
|
2461
|
-
for (let i = selectedPosition.rowIdx - 1; i >= 0; i--) {
|
|
2462
|
-
const parentRow = rows[i];
|
|
2463
|
-
if (isGroupRow(parentRow) && parentRow.id === row.parentId) {
|
|
2464
|
-
parentRowIdx = i;
|
|
2465
|
-
break;
|
|
2466
|
-
}
|
|
2467
|
-
}
|
|
2468
|
-
if (parentRowIdx !== -1) {
|
|
2469
|
-
return {
|
|
2470
|
-
idx,
|
|
2471
|
-
rowIdx: parentRowIdx
|
|
2472
|
-
};
|
|
2473
|
-
}
|
|
2474
|
-
}
|
|
2475
2461
|
switch (key) {
|
|
2476
2462
|
case 'ArrowUp':
|
|
2477
2463
|
return {
|
|
@@ -2501,7 +2487,7 @@ function DataGrid(props, ref) {
|
|
|
2501
2487
|
case 'Home':
|
|
2502
2488
|
if (isRowSelected) return {
|
|
2503
2489
|
idx,
|
|
2504
|
-
rowIdx:
|
|
2490
|
+
rowIdx: minRowIdx
|
|
2505
2491
|
};
|
|
2506
2492
|
return {
|
|
2507
2493
|
idx: 0,
|
|
@@ -2510,7 +2496,7 @@ function DataGrid(props, ref) {
|
|
|
2510
2496
|
case 'End':
|
|
2511
2497
|
if (isRowSelected) return {
|
|
2512
2498
|
idx,
|
|
2513
|
-
rowIdx:
|
|
2499
|
+
rowIdx: maxRowIdx
|
|
2514
2500
|
};
|
|
2515
2501
|
return {
|
|
2516
2502
|
idx: maxColIdx,
|
|
@@ -2562,19 +2548,21 @@ function DataGrid(props, ref) {
|
|
|
2562
2548
|
const nextPosition = getNextPosition(key, ctrlKey, shiftKey);
|
|
2563
2549
|
if (isSamePosition(selectedPosition, nextPosition)) return;
|
|
2564
2550
|
const nextSelectedCellPosition = getNextSelectedCellPosition({
|
|
2551
|
+
moveUp: key === 'ArrowUp',
|
|
2552
|
+
moveNext: key === rightKey || key === 'Tab' && !shiftKey,
|
|
2565
2553
|
columns,
|
|
2566
2554
|
colSpanColumns,
|
|
2567
2555
|
rows,
|
|
2568
2556
|
topSummaryRows,
|
|
2569
2557
|
bottomSummaryRows,
|
|
2570
2558
|
minRowIdx,
|
|
2559
|
+
mainHeaderRowIdx,
|
|
2571
2560
|
maxRowIdx,
|
|
2572
2561
|
lastFrozenColumnIndex,
|
|
2573
2562
|
cellNavigationMode,
|
|
2574
2563
|
currentPosition: selectedPosition,
|
|
2575
2564
|
nextPosition,
|
|
2576
|
-
isCellWithinBounds: isCellWithinSelectionBounds
|
|
2577
|
-
isGroupRow
|
|
2565
|
+
isCellWithinBounds: isCellWithinSelectionBounds
|
|
2578
2566
|
});
|
|
2579
2567
|
selectCell(nextSelectedCellPosition);
|
|
2580
2568
|
}
|
|
@@ -2586,17 +2574,34 @@ function DataGrid(props, ref) {
|
|
|
2586
2574
|
const isDraggedOver = rowIdx < draggedOverRowIdx ? rowIdx < currentRowIdx && currentRowIdx <= draggedOverRowIdx : rowIdx > currentRowIdx && currentRowIdx >= draggedOverRowIdx;
|
|
2587
2575
|
return isDraggedOver ? selectedPosition.idx : undefined;
|
|
2588
2576
|
}
|
|
2589
|
-
function
|
|
2590
|
-
|
|
2577
|
+
function focusCellOrCellContent() {
|
|
2578
|
+
const cell = getCellToScroll(gridRef.current);
|
|
2579
|
+
if (cell === null) return;
|
|
2580
|
+
scrollIntoView(cell);
|
|
2581
|
+
const elementToFocus = cell.querySelector('[tabindex="0"]') ?? cell;
|
|
2582
|
+
elementToFocus.focus({
|
|
2583
|
+
preventScroll: true
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
function renderDragHandle() {
|
|
2587
|
+
if (onFill == null || selectedPosition.mode === 'EDIT' || !isCellWithinViewportBounds(selectedPosition)) {
|
|
2588
|
+
return;
|
|
2589
|
+
}
|
|
2590
|
+
const column = columns[selectedPosition.idx];
|
|
2591
|
+
if (column.renderEditCell == null || column.editable === false) {
|
|
2591
2592
|
return;
|
|
2592
2593
|
}
|
|
2594
|
+
const columnWidth = getColumnWidth(column);
|
|
2593
2595
|
return /*#__PURE__*/o(DragHandle, {
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
+
gridRowStart: headerAndTopSummaryRowsCount + selectedPosition.rowIdx + 1,
|
|
2597
|
+
rows: rows,
|
|
2598
|
+
column: column,
|
|
2599
|
+
columnWidth: columnWidth,
|
|
2596
2600
|
selectedPosition: selectedPosition,
|
|
2597
2601
|
isCellEditable: isCellEditable,
|
|
2598
2602
|
latestDraggedOverRowIdx: latestDraggedOverRowIdx,
|
|
2599
2603
|
onRowsChange: onRowsChange,
|
|
2604
|
+
onClick: focusCellOrCellContent,
|
|
2600
2605
|
onFill: onFill,
|
|
2601
2606
|
setDragging: setDragging,
|
|
2602
2607
|
setDraggedOverRowIdx: setDraggedOverRowIdx
|
|
@@ -2626,7 +2631,7 @@ function DataGrid(props, ref) {
|
|
|
2626
2631
|
};
|
|
2627
2632
|
const onRowChange = (row, commitChanges, shouldFocusCell) => {
|
|
2628
2633
|
if (commitChanges) {
|
|
2629
|
-
|
|
2634
|
+
mn(() => {
|
|
2630
2635
|
updateRow(column, selectedPosition.rowIdx, row);
|
|
2631
2636
|
closeEditor(shouldFocusCell);
|
|
2632
2637
|
});
|
|
@@ -2652,7 +2657,7 @@ function DataGrid(props, ref) {
|
|
|
2652
2657
|
}, column.key);
|
|
2653
2658
|
}
|
|
2654
2659
|
function getRowViewportColumns(rowIdx) {
|
|
2655
|
-
const selectedColumn = columns[selectedPosition.idx];
|
|
2660
|
+
const selectedColumn = selectedPosition.idx === -1 ? undefined : columns[selectedPosition.idx];
|
|
2656
2661
|
if (selectedColumn !== undefined && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) {
|
|
2657
2662
|
return selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)];
|
|
2658
2663
|
}
|
|
@@ -2660,7 +2665,6 @@ function DataGrid(props, ref) {
|
|
|
2660
2665
|
}
|
|
2661
2666
|
function getViewportRows() {
|
|
2662
2667
|
const rowElements = [];
|
|
2663
|
-
let startRowIndex = 0;
|
|
2664
2668
|
const {
|
|
2665
2669
|
idx: selectedIdx,
|
|
2666
2670
|
rowIdx: selectedRowIdx
|
|
@@ -2671,7 +2675,7 @@ function DataGrid(props, ref) {
|
|
|
2671
2675
|
const isRowOutsideViewport = viewportRowIdx === rowOverscanStartIdx - 1 || viewportRowIdx === rowOverscanEndIdx + 1;
|
|
2672
2676
|
const rowIdx = isRowOutsideViewport ? selectedRowIdx : viewportRowIdx;
|
|
2673
2677
|
let rowColumns = viewportColumns;
|
|
2674
|
-
const selectedColumn = columns[selectedIdx];
|
|
2678
|
+
const selectedColumn = selectedIdx === -1 ? undefined : columns[selectedIdx];
|
|
2675
2679
|
if (selectedColumn !== undefined) {
|
|
2676
2680
|
if (isRowOutsideViewport) {
|
|
2677
2681
|
rowColumns = [selectedColumn];
|
|
@@ -2681,49 +2685,14 @@ function DataGrid(props, ref) {
|
|
|
2681
2685
|
}
|
|
2682
2686
|
const row = rows[rowIdx];
|
|
2683
2687
|
const gridRowStart = headerAndTopSummaryRowsCount + rowIdx + 1;
|
|
2684
|
-
|
|
2685
|
-
({
|
|
2686
|
-
startRowIndex
|
|
2687
|
-
} = row);
|
|
2688
|
-
let isGroupRowSelected = false;
|
|
2689
|
-
if (isSelectable) {
|
|
2690
|
-
assertIsValidKeyGetter(rowKeyGetter);
|
|
2691
|
-
isGroupRowSelected = row.childRows.every(cr => selectedRows.has(rowKeyGetter(cr)));
|
|
2692
|
-
}
|
|
2693
|
-
rowElements.push( /*#__PURE__*/o(GroupRowRenderer, {
|
|
2694
|
-
"aria-level": row.level + 1,
|
|
2695
|
-
"aria-setsize": row.setSize,
|
|
2696
|
-
"aria-posinset": row.posInSet + 1,
|
|
2697
|
-
"aria-rowindex": headerAndTopSummaryRowsCount + startRowIndex + 1,
|
|
2698
|
-
"aria-selected": isSelectable ? isGroupRowSelected : undefined,
|
|
2699
|
-
id: row.id,
|
|
2700
|
-
groupKey: row.groupKey,
|
|
2701
|
-
viewportColumns: rowColumns,
|
|
2702
|
-
childRows: row.childRows,
|
|
2703
|
-
rowIdx: rowIdx,
|
|
2704
|
-
row: row,
|
|
2705
|
-
gridRowStart: gridRowStart,
|
|
2706
|
-
height: getRowHeight(rowIdx),
|
|
2707
|
-
level: row.level,
|
|
2708
|
-
isExpanded: row.isExpanded,
|
|
2709
|
-
selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,
|
|
2710
|
-
isRowSelected: isGroupRowSelected,
|
|
2711
|
-
selectGroup: selectGroupLatest,
|
|
2712
|
-
toggleGroup: toggleGroupLatest
|
|
2713
|
-
}, row.id));
|
|
2714
|
-
continue;
|
|
2715
|
-
}
|
|
2716
|
-
startRowIndex++;
|
|
2717
|
-
let key;
|
|
2688
|
+
let key = rowIdx;
|
|
2718
2689
|
let isRowSelected = false;
|
|
2719
2690
|
if (typeof rowKeyGetter === 'function') {
|
|
2720
2691
|
key = rowKeyGetter(row);
|
|
2721
2692
|
isRowSelected = selectedRows?.has(key) ?? false;
|
|
2722
|
-
} else {
|
|
2723
|
-
key = hasGroups ? startRowIndex : rowIdx;
|
|
2724
2693
|
}
|
|
2725
2694
|
rowElements.push(renderRow(key, {
|
|
2726
|
-
'aria-rowindex': headerAndTopSummaryRowsCount +
|
|
2695
|
+
'aria-rowindex': headerAndTopSummaryRowsCount + rowIdx + 1,
|
|
2727
2696
|
'aria-selected': isSelectable ? isRowSelected : undefined,
|
|
2728
2697
|
rowIdx,
|
|
2729
2698
|
row,
|
|
@@ -2742,7 +2711,6 @@ function DataGrid(props, ref) {
|
|
|
2742
2711
|
lastFrozenColumnIndex,
|
|
2743
2712
|
onRowChange: handleFormatterRowChangeLatest,
|
|
2744
2713
|
selectCell: selectCellLatest,
|
|
2745
|
-
selectedCellDragHandle: getDragHandle(rowIdx),
|
|
2746
2714
|
selectedCellEditor: getCellEditor(rowIdx)
|
|
2747
2715
|
}));
|
|
2748
2716
|
}
|
|
@@ -2756,7 +2724,7 @@ function DataGrid(props, ref) {
|
|
|
2756
2724
|
});
|
|
2757
2725
|
setDraggedOverRowIdx(undefined);
|
|
2758
2726
|
}
|
|
2759
|
-
let templateRows =
|
|
2727
|
+
let templateRows = `repeat(${headerRowsCount}, ${headerRowHeight}px)`;
|
|
2760
2728
|
if (topSummaryRowsCount > 0) {
|
|
2761
2729
|
templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`;
|
|
2762
2730
|
}
|
|
@@ -2768,18 +2736,18 @@ function DataGrid(props, ref) {
|
|
|
2768
2736
|
}
|
|
2769
2737
|
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== minRowIdx - 1;
|
|
2770
2738
|
return /*#__PURE__*/o("div", {
|
|
2771
|
-
role:
|
|
2739
|
+
role: role,
|
|
2772
2740
|
"aria-label": ariaLabel,
|
|
2773
2741
|
"aria-labelledby": ariaLabelledBy,
|
|
2774
2742
|
"aria-describedby": ariaDescribedBy,
|
|
2775
2743
|
"aria-multiselectable": isSelectable ? true : undefined,
|
|
2776
2744
|
"aria-colcount": columns.length,
|
|
2777
|
-
"aria-rowcount":
|
|
2745
|
+
"aria-rowcount": ariaRowCount,
|
|
2778
2746
|
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),
|
|
2779
2747
|
style: {
|
|
2780
2748
|
...style,
|
|
2781
2749
|
scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex || scrollToPosition?.idx !== undefined ? `${totalFrozenColumnWidth}px` : undefined,
|
|
2782
|
-
scrollPaddingBlock: isRowIdxWithinViewportBounds(selectedPosition.rowIdx) || scrollToPosition?.rowIdx !== undefined ? `${
|
|
2750
|
+
scrollPaddingBlock: isRowIdxWithinViewportBounds(selectedPosition.rowIdx) || scrollToPosition?.rowIdx !== undefined ? `${headerRowsHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : undefined,
|
|
2783
2751
|
gridTemplateColumns,
|
|
2784
2752
|
gridTemplateRows: templateRows,
|
|
2785
2753
|
'--rdg-header-row-height': `${headerRowHeight}px`,
|
|
@@ -2792,40 +2760,39 @@ function DataGrid(props, ref) {
|
|
|
2792
2760
|
onScroll: handleScroll,
|
|
2793
2761
|
onKeyDown: handleKeyDown,
|
|
2794
2762
|
"data-testid": testId,
|
|
2795
|
-
children: [
|
|
2796
|
-
ref: rowRef,
|
|
2797
|
-
tabIndex: isGroupRowFocused ? 0 : -1,
|
|
2798
|
-
className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell]),
|
|
2799
|
-
style: {
|
|
2800
|
-
gridRowStart: selectedPosition.rowIdx + headerAndTopSummaryRowsCount + 1
|
|
2801
|
-
}
|
|
2802
|
-
}), scrollToPosition !== null && /*#__PURE__*/o(ScrollToCell, {
|
|
2803
|
-
scrollToPosition: scrollToPosition,
|
|
2804
|
-
setScrollToCellPosition: setScrollToPosition,
|
|
2805
|
-
gridElement: gridRef.current
|
|
2806
|
-
}), /*#__PURE__*/o(DataGridDefaultRenderersProvider, {
|
|
2763
|
+
children: [/*#__PURE__*/o(DataGridDefaultRenderersProvider, {
|
|
2807
2764
|
value: defaultGridComponents,
|
|
2808
|
-
children:
|
|
2765
|
+
children: /*#__PURE__*/o(RowSelectionChangeProvider, {
|
|
2809
2766
|
value: selectRowLatest,
|
|
2810
2767
|
children: [/*#__PURE__*/o(RowSelectionProvider, {
|
|
2811
2768
|
value: allRowsSelected,
|
|
2812
|
-
children:
|
|
2813
|
-
|
|
2769
|
+
children: [Array.from({
|
|
2770
|
+
length: groupedColumnHeaderRowsCount
|
|
2771
|
+
}, (_, index) => /*#__PURE__*/o(GroupedColumnHeaderRow$1, {
|
|
2772
|
+
rowIdx: index + 1,
|
|
2773
|
+
level: -groupedColumnHeaderRowsCount + index,
|
|
2774
|
+
columns: getRowViewportColumns(minRowIdx + index),
|
|
2775
|
+
selectedCellIdx: selectedPosition.rowIdx === minRowIdx + index ? selectedPosition.idx : undefined,
|
|
2776
|
+
selectCell: selectHeaderCellLatest
|
|
2777
|
+
}, index)), /*#__PURE__*/o(HeaderRow$1, {
|
|
2778
|
+
rowIdx: headerRowsCount,
|
|
2779
|
+
columns: getRowViewportColumns(mainHeaderRowIdx),
|
|
2814
2780
|
onColumnResize: handleColumnResizeLatest,
|
|
2781
|
+
onColumnsReorder: onColumnsReorderLastest,
|
|
2815
2782
|
sortColumns: sortColumns,
|
|
2816
2783
|
onSortColumnsChange: onSortColumnsChangeLatest,
|
|
2817
2784
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
2818
|
-
selectedCellIdx: selectedPosition.rowIdx ===
|
|
2785
|
+
selectedCellIdx: selectedPosition.rowIdx === mainHeaderRowIdx ? selectedPosition.idx : undefined,
|
|
2819
2786
|
selectCell: selectHeaderCellLatest,
|
|
2820
2787
|
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
2821
2788
|
direction: direction
|
|
2822
|
-
})
|
|
2789
|
+
})]
|
|
2823
2790
|
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/o(k$2, {
|
|
2824
2791
|
children: [topSummaryRows?.map((row, rowIdx) => {
|
|
2825
|
-
const gridRowStart = headerRowsCount +
|
|
2826
|
-
const summaryRowIdx =
|
|
2792
|
+
const gridRowStart = headerRowsCount + 1 + rowIdx;
|
|
2793
|
+
const summaryRowIdx = mainHeaderRowIdx + 1 + rowIdx;
|
|
2827
2794
|
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
2828
|
-
const top =
|
|
2795
|
+
const top = headerRowsHeight + summaryRowHeight * rowIdx;
|
|
2829
2796
|
return /*#__PURE__*/o(SummaryRow$1, {
|
|
2830
2797
|
"aria-rowindex": gridRowStart,
|
|
2831
2798
|
rowIdx: summaryRowIdx,
|
|
@@ -2847,7 +2814,7 @@ function DataGrid(props, ref) {
|
|
|
2847
2814
|
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : undefined;
|
|
2848
2815
|
const bottom = top === undefined ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : undefined;
|
|
2849
2816
|
return /*#__PURE__*/o(SummaryRow$1, {
|
|
2850
|
-
"aria-rowindex":
|
|
2817
|
+
"aria-rowindex": ariaRowCount - bottomSummaryRowsCount + rowIdx + 1,
|
|
2851
2818
|
rowIdx: summaryRowIdx,
|
|
2852
2819
|
gridRowStart: gridRowStart,
|
|
2853
2820
|
row: row,
|
|
@@ -2862,14 +2829,23 @@ function DataGrid(props, ref) {
|
|
|
2862
2829
|
}, rowIdx);
|
|
2863
2830
|
})]
|
|
2864
2831
|
})]
|
|
2865
|
-
})
|
|
2832
|
+
})
|
|
2833
|
+
}), renderDragHandle(), renderMeasuringCells(viewportColumns), isTreeGrid && /*#__PURE__*/o("div", {
|
|
2834
|
+
ref: focusSinkRef,
|
|
2835
|
+
tabIndex: isGroupRowFocused ? 0 : -1,
|
|
2836
|
+
className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell], !isRowIdxWithinViewportBounds(selectedPosition.rowIdx) && focusSinkHeaderAndSummaryClassname),
|
|
2837
|
+
style: {
|
|
2838
|
+
gridRowStart: selectedPosition.rowIdx + headerAndTopSummaryRowsCount + 1
|
|
2839
|
+
}
|
|
2840
|
+
}), scrollToPosition !== null && /*#__PURE__*/o(ScrollToCell, {
|
|
2841
|
+
scrollToPosition: scrollToPosition,
|
|
2842
|
+
setScrollToCellPosition: setScrollToPosition,
|
|
2843
|
+
gridElement: gridRef.current
|
|
2866
2844
|
})]
|
|
2867
2845
|
});
|
|
2868
2846
|
}
|
|
2869
|
-
let getCellToScrollExpression;
|
|
2870
2847
|
function getCellToScroll(gridEl) {
|
|
2871
|
-
|
|
2872
|
-
return getCellToScrollExpression.evaluate(gridEl, 8).singleNodeValue;
|
|
2848
|
+
return gridEl.querySelector(':scope > [role="row"] > [tabindex="0"]');
|
|
2873
2849
|
}
|
|
2874
2850
|
function isSamePosition(p1, p2) {
|
|
2875
2851
|
return p1.idx === p2.idx && p1.rowIdx === p2.rowIdx;
|
|
@@ -3070,7 +3046,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
3070
3046
|
G(y$1(ReactTable, { table: this }), this._div.node());
|
|
3071
3047
|
};
|
|
3072
3048
|
Table.prototype.exit = function (domNode, element) {
|
|
3073
|
-
|
|
3049
|
+
vn(this._div.node());
|
|
3074
3050
|
this._div.remove();
|
|
3075
3051
|
_super.prototype.exit.call(this, domNode, element);
|
|
3076
3052
|
};
|