@hpcc-js/dgrid2 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es6.js +376 -265
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +375 -264
- 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 +6 -6
- package/src/__package__.ts +2 -2
- package/src/hooks.ts +12 -0
- package/src/reactTable.tsx +161 -0
- package/src/table.md +1 -1
- package/src/table.ts +92 -0
- package/types/__package__.d.ts +2 -2
- package/types/hooks.d.ts +3 -0
- package/types/hooks.d.ts.map +1 -0
- package/types/reactTable.d.ts +12 -0
- package/types/reactTable.d.ts.map +1 -0
- package/types/table.d.ts +20 -7
- package/types/table.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/hooks.d.ts +6 -0
- package/types-3.4/reactTable.d.ts +12 -0
- package/types-3.4/table.d.ts +20 -7
- package/src/table.tsx +0 -165
- package/src/test.ts +0 -41
- package/types/test.d.ts +0 -6
- package/types/test.d.ts.map +0 -1
- package/types-3.4/test.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
})(this, (function (exports, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/dgrid2";
|
|
8
|
-
var PKG_VERSION = "2.1
|
|
9
|
-
var BUILD_VERSION = "2.103.
|
|
8
|
+
var PKG_VERSION = "2.2.1";
|
|
9
|
+
var BUILD_VERSION = "2.103.5";
|
|
10
10
|
|
|
11
11
|
/*! *****************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -39,6 +39,17 @@
|
|
|
39
39
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
var __assign = function() {
|
|
43
|
+
__assign = Object.assign || function __assign(t) {
|
|
44
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
45
|
+
s = arguments[i];
|
|
46
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
47
|
+
}
|
|
48
|
+
return t;
|
|
49
|
+
};
|
|
50
|
+
return __assign.apply(this, arguments);
|
|
51
|
+
};
|
|
52
|
+
|
|
42
53
|
function __decorate(decorators, target, key, desc) {
|
|
43
54
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
44
55
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -62,9 +73,7 @@
|
|
|
62
73
|
|
|
63
74
|
var n,l$1,u$1,t$1,o$2,r$1,f$1,e$2={},c$1=[],s$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function a$1(n,l){for(var u in l)n[u]=l[u];return n}function h$1(n){var l=n.parentNode;l&&l.removeChild(n);}function v$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return y$1(l,f,t,o,null)}function y$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function d$1(n){return n.children}function _$1(n,l){this.props=n,this.context=l;}function k$1(n,l){if(null==l)return n.__?k$1(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?k$1(n):null}function b$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return b$1(n)}}function m$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$2.__r++||r$1!==l$1.debounceRendering)&&((r$1=l$1.debounceRendering)||o$2)(g$2);}function g$2(){for(var n;g$2.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=a$1({},t)).__v=t.__v+1,j$2(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?k$1(t):o,t.__h),z$1(u,t),t.__e!=o&&b$1(t)));});}function w$2(n,l,u,i,t,o,r,f,s,a){var h,v,p,_,b,m,g,w=i&&i.__k||c$1,A=w.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(_=u.__k[h]=null==(_=l[h])||"boolean"==typeof _?null:"string"==typeof _||"number"==typeof _||"bigint"==typeof _?y$1(null,_,null,null,_):Array.isArray(_)?y$1(d$1,{children:_},null,null,null):_.__b>0?y$1(_.type,_.props,_.key,null,_.__v):_)){if(_.__=u,_.__b=u.__b+1,null===(p=w[h])||p&&_.key==p.key&&_.type===p.type)w[h]=void 0;else for(v=0;v<A;v++){if((p=w[v])&&_.key==p.key&&_.type===p.type){w[v]=void 0;break}p=null;}j$2(n,_,p=p||e$2,t,o,r,f,s,a),b=_.__e,(v=_.ref)&&p.ref!=v&&(g||(g=[]),p.ref&&g.push(p.ref,null,_),g.push(v,_.__c||b,_)),null!=b?(null==m&&(m=b),"function"==typeof _.type&&_.__k===p.__k?_.__d=s=x$2(_,s,n):s=P$1(n,_,p,w,b,s),"function"==typeof u.type&&(u.__d=s)):s&&p.__e==s&&s.parentNode!=n&&(s=k$1(p));}for(u.__e=m,h=A;h--;)null!=w[h]&&("function"==typeof u.type&&null!=w[h].__e&&w[h].__e==u.__d&&(u.__d=k$1(i,h+1)),N(w[h],w[h]));if(g)for(h=0;h<g.length;h++)M$1(g[h],g[++h],g[++h]);}function x$2(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?x$2(i,l,u):P$1(u,i,i,t,i.__e,l));return l}function A$2(n,l){return l=l||[],null==n||"boolean"==typeof n||(Array.isArray(n)?n.some(function(n){A$2(n,l);}):l.push(n)),l}function P$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=2)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H$1(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H$1(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||s$1.test(l)?u:u+"px";}function H$1(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null!=u&&(!1!==u||"a"===l[0]&&"r"===l[1])?n.setAttribute(l,u):n.removeAttribute(l));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$2(n,u,i,t,o,r,f,e,c){var s,h,v,y,p,k,b,m,g,x,A,P=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(s=l$1.__b)&&s(u);try{n:if("function"==typeof P){if(m=u.props,g=(s=P.contextType)&&t[s.__c],x=s?g?g.props.value:s.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in P&&P.prototype.render?u.__c=h=new P(m,x):(u.__c=h=new _$1(m,x),h.constructor=P,h.render=O$1),g&&g.sub(h),h.props=m,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=P.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=a$1({},h.__s)),a$1(h.__s,P.getDerivedStateFromProps(m,h.__s))),y=h.props,p=h.state,v)null==P.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==P.getDerivedStateFromProps&&m!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(m,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(m,h.__s,x)||u.__v===i.__v){h.props=m,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(m,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,p,k);});}h.context=x,h.props=m,h.state=h.__s,(s=l$1.__r)&&s(u),h.__d=!1,h.__v=u,h.__P=n,s=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(t=a$1(a$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,p)),A=null!=s&&s.type===d$1&&null==s.key?s.props.children:s,w$2(n,Array.isArray(A)?A:[A],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L$1(i.__e,u,i,t,o,r,f,c);(s=l$1.diffed)&&s(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L$1(l,u,i,t,o,r,f,c){var s,a,v,y=i.props,p=u.props,d=u.type,_=0;if("svg"===d&&(o=!0),null!=r)for(;_<r.length;_++)if((s=r[_])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[_]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),a=(y=i.props||e$2).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},_=0;_<l.attributes.length;_++)y[l.attributes[_].name]=l.attributes[_].value;(v||a)&&(v&&(a&&v.__html==a.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(_=u.props.children,w$2(l,Array.isArray(_)?_:[_],u,i,t,o&&"foreignObject"!==d,r,f,r?r[0]:i.__k&&k$1(i,0),c),null!=r)for(_=r.length;_--;)null!=r[_]&&h$1(r[_]);c||("value"in p&&void 0!==(_=p.value)&&(_!==l.value||"progress"===d&&!_||"option"===d&&_!==y.value)&&H$1(l,"value",_,y.value,!1),"checked"in p&&void 0!==(_=p.checked)&&_!==l.checked&&H$1(l,"checked",_,y.checked,!1));}return l}function M$1(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M$1(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,"function"!=typeof n.type);i||null==n.__e||h$1(n.__e),n.__e=n.__d=void 0;}function O$1(n,l,u){return this.constructor(n,u)}function S$1(u,i,t){var o,r,f;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,f=[],j$2(i,u=(!o&&t||i).__k=v$1(d$1,null,[u]),r||e$2,e$2,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,f,!o&&t?t:r?r.__e:i.firstChild,o),z$1(f,u);}function D(n,l){var u={__c:l="__cC"+f$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(m$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=c$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,_$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=a$1({},this.state),"function"==typeof n&&(n=n(a$1({},u),this.props)),n&&a$1(u,n),null!=n&&this.__v&&(l&&this.__h.push(l),m$1(this));},_$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),m$1(this));},_$1.prototype.render=d$1,t$1=[],o$2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,g$2.__r=0,f$1=0;
|
|
64
75
|
|
|
65
|
-
var o$1=0
|
|
66
|
-
|
|
67
|
-
var t,u,r,o=0,i=[],c=l$1.__b,f=l$1.__r,e=l$1.diffed,a=l$1.__c,v=l$1.unmount;function l(t,r){l$1.__h&&l$1.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function m(n){return o=1,p(w$1,n)}function p(n,r,o){var i=l(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=l(t++,3);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function d(r,o){var i=l(t++,4);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function h(n){return o=5,_(function(){return {current:n}},[])}function s(n,t,u){o=6,d(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n));}function _(n,u){var r=l(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o=8,_(function(){return n},t)}function F(n){var r=u.context[n.__c],o=l(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x$1(){for(var t;t=i.shift();)if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,c&&c(n);},l$1.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},l$1.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===l$1.requestAnimationFrame||((r=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),a&&a(t,u);},l$1.unmount=function(t){v&&v(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{g$1(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
|
|
76
|
+
var t,u,r,o$1=0,i=[],c=l$1.__b,f=l$1.__r,e$1=l$1.diffed,a=l$1.__c,v=l$1.unmount;function l(t,r){l$1.__h&&l$1.__h(u,t,o$1||r),o$1=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function m(n){return o$1=1,p(w$1,n)}function p(n,r,o){var i=l(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=l(t++,3);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function d(r,o){var i=l(t++,4);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function h(n){return o$1=5,_(function(){return {current:n}},[])}function s(n,t,u){o$1=6,d(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n));}function _(n,u){var r=l(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o$1=8,_(function(){return n},t)}function F(n){var r=u.context[n.__c],o=l(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x$1(){for(var t;t=i.shift();)if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,c&&c(n);},l$1.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},l$1.diffed=function(t){e$1&&e$1(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===l$1.requestAnimationFrame||((r=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),a&&a(t,u);},l$1.unmount=function(t){v&&v(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{g$1(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
|
|
68
77
|
|
|
69
78
|
function C(n,t){for(var e in t)n[e]=t[e];return n}function S(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function g(n,t){function e(n){var e=this.props.ref,r=e==n.ref;return !r&&e&&(e.call?e(null):e.current=null),t?!t(this.props,n)||!r:S(this.props,n)}function r(t){return this.shouldComponentUpdate=e,v$1(n,t)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(E.prototype=new _$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return S(this.props,n)||S(this.state,t)};var w=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),w&&w(n);};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function x(n){function t(t){var e=C({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=R,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var A=l$1.__e;l$1.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);A(n,t,e,r);};var O=l$1.unmount;function L(){this.__u=0,this.t=null,this.__b=null;}function U(n){var t=n.__.__c;return t&&t.__e&&t.__e(n)}function M(){this.u=null,this.o=null;}l$1.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&!0===n.__h&&(n.type=null),O&&O(n);},(L.prototype=new _$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__e){var n=r.state.__e;r.__v.__k[0]=function n(t,e,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)}),t.__c&&t.__c.__P===e&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate();}},f=!0===t.__h;r.__u++||f||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(i,i);},L.prototype.componentWillUnmount=function(){this.t=[];},L.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function n(t,e,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),t.__c.__H=null),null!=(t=C({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return n(t,e,r)})),t}(this.__b,e,r.__O=r.__P);}this.__b=null;}var u=t.__e&&v$1(d$1,null,n.fallback);return u&&(u.__h=null),[v$1(d$1,null,t.__e?null:n.children),u]};var T=function(n,t,e){if(++e[1]===e[0]&&n.o.delete(t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};(M.prototype=new _$1).__e=function(n){var t=this,e=U(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),T(t,n,r)):u();};e?e(o):o();}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=A$2(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){T(n,e,t);});};var P="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,V=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,j="undefined"!=typeof document,z=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function B(n,t,e){return null==t.__k&&(t.textContent=""),S$1(n,t),"function"==typeof e&&e(),n?n.__c:null}_$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(_$1.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t});}});});var H=l$1.event;function Z(){}function Y(){return this.cancelBubble}function q(){return this.defaultPrevented}l$1.event=function(n){return H&&(n=H(n)),n.persist=Z,n.isPropagationStopped=Y,n.isDefaultPrevented=q,n.nativeEvent=n};var J={configurable:!0,get:function(){return this.class}},K=l$1.vnode;l$1.vnode=function(n){var t=n.type,e=n.props,r=e;if("string"==typeof t){var u=-1===t.indexOf("-");for(var o in r={},e){var i=e[o];j&&"children"===o&&"noscript"===t||"value"===o&&"defaultValue"in e&&null==i||("defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+t)&&!z(e.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():u&&V.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===i&&(i=void 0),r[o]=i);}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=-1!=r.value.indexOf(n.props.value);})),"select"==t&&null!=r.defaultValue&&(r.value=A$2(e.children).forEach(function(n){n.props.selected=r.multiple?-1!=r.defaultValue.indexOf(n.props.value):r.defaultValue==n.props.value;})),n.props=r,e.class!=e.className&&(J.enumerable="className"in e,null!=e.className&&(r.class=e.className),Object.defineProperty(r,"className",J));}n.$$typeof=P,K&&K(n);};var Q=l$1.__r;l$1.__r=function(n){Q&&Q(n);};function un(n){return !!n.__k&&(S$1(null,n),!0)}
|
|
70
79
|
|
|
@@ -109,6 +118,8 @@
|
|
|
109
118
|
return str;
|
|
110
119
|
}
|
|
111
120
|
|
|
121
|
+
var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
|
|
122
|
+
|
|
112
123
|
function styleInject$1(css, ref) {
|
|
113
124
|
if ( ref === void 0 ) ref = {};
|
|
114
125
|
var insertAt = ref.insertAt;
|
|
@@ -136,44 +147,45 @@
|
|
|
136
147
|
}
|
|
137
148
|
}
|
|
138
149
|
|
|
139
|
-
var css_248z$f = ".c1wupbe700-
|
|
150
|
+
var css_248z$f = ".c1wupbe700-beta12{background-color:inherit;border-block-end:1px solid var(--rdg-border-color);border-inline-end:1px solid var(--rdg-border-color);contain:strict;contain:size layout style paint;grid-row-start:var(--rdg-grid-row-start);outline:none;overflow:hidden;overflow:clip;padding-block:0;padding-inline:8px;text-overflow:ellipsis;white-space:nowrap}.c1wupbe700-beta12[aria-selected=true]{outline:2px solid var(--rdg-selection-color);outline-offset:-2px}.cd0kgiy700-beta12 .c1wupbe700-beta12{contain:content}.c1730fa4700-beta12{position:sticky;z-index:1}.c9dpaye700-beta12{box-shadow:calc(2px*var(--rdg-sign)) 0 5px -2px hsla(0,0%,53%,.3)}";
|
|
140
151
|
styleInject$1(css_248z$f,{"insertAt":"top"});
|
|
141
152
|
|
|
142
|
-
const cell = "c1wupbe700-
|
|
153
|
+
const cell = "c1wupbe700-beta12";
|
|
143
154
|
const cellClassname = `rdg-cell ${cell}`;
|
|
144
|
-
const cellAutoResizeClassname = "cd0kgiy700-
|
|
145
|
-
const cellFrozen = "c1730fa4700-
|
|
155
|
+
const cellAutoResizeClassname = "cd0kgiy700-beta12";
|
|
156
|
+
const cellFrozen = "c1730fa4700-beta12";
|
|
146
157
|
const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
147
|
-
const cellFrozenLast = "c9dpaye700-
|
|
158
|
+
const cellFrozenLast = "c9dpaye700-beta12";
|
|
148
159
|
const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
|
|
149
160
|
|
|
150
|
-
var css_248z$e = ".r104f42s700-
|
|
161
|
+
var css_248z$e = ".r104f42s700-beta12{--rdg-color:#000;--rdg-border-color:#ddd;--rdg-summary-border-color:#aaa;--rdg-background-color:#fff;--rdg-header-background-color:#f9f9f9;--rdg-row-hover-background-color:#f5f5f5;--rdg-row-selected-background-color:#dbecfa;--row-selected-hover-background-color:#c9e3f8;--rdg-checkbox-color:#005194;--rdg-checkbox-focus-color:#61b8ff;--rdg-checkbox-disabled-border-color:#ccc;--rdg-checkbox-disabled-background-color:#ddd;--rdg-selection-color:#66afe9;--rdg-font-size:14px;content-visibility:auto;background-color:var(--rdg-background-color);block-size:350px;border:1px solid var(--rdg-border-color);box-sizing:border-box;color:var(--rdg-color);color-scheme:var(--rdg-color-scheme,light dark);contain:strict;contain:size layout style paint;display:grid;font-size:var(--rdg-font-size);overflow:auto;user-select:none}@supports not (contain:strict){.r104f42s700-beta12{position:relative;z-index:0}}.r104f42s700-beta12 *,.r104f42s700-beta12 :after,.r104f42s700-beta12 :before{box-sizing:inherit}.r104f42s700-beta12:before{content:\"\";grid-column:1/-1;grid-row:1/-1}.r104f42s700-beta12.rdg-dark{--rdg-color-scheme:dark;--rdg-color:#ddd;--rdg-border-color:#444;--rdg-summary-border-color:#555;--rdg-background-color:#212121;--rdg-header-background-color:#1b1b1b;--rdg-row-hover-background-color:#171717;--rdg-row-selected-background-color:#1a73bc;--row-selected-hover-background-color:#1768ab;--rdg-checkbox-color:#94cfff;--rdg-checkbox-focus-color:#c7e6ff;--rdg-checkbox-disabled-border-color:#000;--rdg-checkbox-disabled-background-color:#333}.r104f42s700-beta12.rdg-light{--rdg-color-scheme:light}@media (prefers-color-scheme:dark){.r104f42s700-beta12:not(.rdg-light){--rdg-color:#ddd;--rdg-border-color:#444;--rdg-summary-border-color:#555;--rdg-background-color:#212121;--rdg-header-background-color:#1b1b1b;--rdg-row-hover-background-color:#171717;--rdg-row-selected-background-color:#1a73bc;--row-selected-hover-background-color:#1768ab;--rdg-checkbox-color:#94cfff;--rdg-checkbox-focus-color:#c7e6ff;--rdg-checkbox-disabled-border-color:#000;--rdg-checkbox-disabled-background-color:#333}}.v7ly7s700-beta12.r1otpg64700-beta12{cursor:move}.fc4f4zb700-beta12{grid-column:1/-1;pointer-events:none;z-index:4}";
|
|
151
162
|
styleInject$1(css_248z$e,{"insertAt":"top"});
|
|
152
163
|
|
|
153
|
-
const root = "r104f42s700-
|
|
164
|
+
const root = "r104f42s700-beta12";
|
|
154
165
|
const rootClassname = `rdg ${root}`;
|
|
155
|
-
const viewportDragging = "v7ly7s700-
|
|
166
|
+
const viewportDragging = "v7ly7s700-beta12";
|
|
156
167
|
const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
|
|
157
|
-
const focusSinkClassname = "fc4f4zb700-
|
|
168
|
+
const focusSinkClassname = "fc4f4zb700-beta12";
|
|
158
169
|
|
|
159
|
-
var css_248z$d = ".r1otpg64700-
|
|
170
|
+
var css_248z$d = ".r1otpg64700-beta12{background-color:var(--rdg-background-color);display:contents;line-height:var(--rdg-row-height)}.r1otpg64700-beta12:hover{background-color:var(--rdg-row-hover-background-color)}.r1otpg64700-beta12[aria-selected=true]{background-color:var(--rdg-row-selected-background-color)}.r1otpg64700-beta12[aria-selected=true]:hover{background-color:var(--row-selected-hover-background-color)}.rel5gk2700-beta12{outline:2px solid var(--rdg-selection-color);outline-offset:-2px}.r1qymf1z700-beta12:before{border-inline-start:2px solid var(--rdg-selection-color);content:\"\";display:inline-block;height:100%;inset-inline-start:0;position:sticky}";
|
|
160
171
|
styleInject$1(css_248z$d,{"insertAt":"top"});
|
|
161
172
|
|
|
162
|
-
const row = "r1otpg64700-
|
|
173
|
+
const row = "r1otpg64700-beta12";
|
|
163
174
|
const rowClassname = `rdg-row ${row}`;
|
|
164
|
-
const rowSelected = "rel5gk2700-
|
|
165
|
-
const rowSelectedClassname = `rdg-row-selected
|
|
175
|
+
const rowSelected = "rel5gk2700-beta12";
|
|
176
|
+
const rowSelectedClassname = `rdg-row-selected`;
|
|
177
|
+
const rowSelectedWithFrozenCell = "r1qymf1z700-beta12";
|
|
166
178
|
|
|
167
|
-
var css_248z$c = ".cd9l4jz700-
|
|
179
|
+
var css_248z$c = ".cd9l4jz700-beta12{align-items:center;cursor:pointer;display:flex;inset:0;justify-content:center;margin-inline-end:1px;position:absolute}.c1noyk41700-beta12{all:unset}.cdwjxv8700-beta12{background-color:var(--rdg-background-color);block-size:20px;border:2px solid var(--rdg-border-color);content:\"\";inline-size:20px}.c1noyk41700-beta12:checked+.cdwjxv8700-beta12{background-color:var(--rdg-checkbox-color);outline:4px solid var(--rdg-background-color);outline-offset:-6px}.c1noyk41700-beta12:focus+.cdwjxv8700-beta12{border-color:var(--rdg-checkbox-focus-color)}.cca4mwn700-beta12{cursor:default}.cca4mwn700-beta12 .cdwjxv8700-beta12{background-color:var(--rdg-checkbox-disabled-background-color);border-color:var(--rdg-checkbox-disabled-border-color)}";
|
|
168
180
|
styleInject$1(css_248z$c,{"insertAt":"top"});
|
|
169
181
|
|
|
170
|
-
const checkboxLabel = "cd9l4jz700-
|
|
182
|
+
const checkboxLabel = "cd9l4jz700-beta12";
|
|
171
183
|
const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
|
|
172
|
-
const checkboxInput = "c1noyk41700-
|
|
184
|
+
const checkboxInput = "c1noyk41700-beta12";
|
|
173
185
|
const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
|
|
174
|
-
const checkbox = "cdwjxv8700-
|
|
186
|
+
const checkbox = "cdwjxv8700-beta12";
|
|
175
187
|
const checkboxClassname = `rdg-checkbox ${checkbox}`;
|
|
176
|
-
const checkboxLabelDisabled = "cca4mwn700-
|
|
188
|
+
const checkboxLabelDisabled = "cca4mwn700-beta12";
|
|
177
189
|
const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
|
|
178
190
|
const CheckboxFormatter = /*#__PURE__*/x(function CheckboxFormatter({
|
|
179
191
|
onChange,
|
|
@@ -183,15 +195,15 @@
|
|
|
183
195
|
onChange(e.target.checked, e.nativeEvent.shiftKey);
|
|
184
196
|
}
|
|
185
197
|
|
|
186
|
-
return /*#__PURE__*/e
|
|
198
|
+
return /*#__PURE__*/e("label", {
|
|
187
199
|
className: clsx(checkboxLabelClassname, props.disabled && checkboxLabelDisabledClassname),
|
|
188
|
-
children: [/*#__PURE__*/e
|
|
200
|
+
children: [/*#__PURE__*/e("input", {
|
|
189
201
|
type: "checkbox",
|
|
190
202
|
ref: ref,
|
|
191
203
|
...props,
|
|
192
204
|
className: checkboxInputClassname,
|
|
193
205
|
onChange: handleChange
|
|
194
|
-
}), /*#__PURE__*/e
|
|
206
|
+
}), /*#__PURE__*/e("div", {
|
|
195
207
|
className: checkboxClassname
|
|
196
208
|
})]
|
|
197
209
|
});
|
|
@@ -234,7 +246,7 @@
|
|
|
234
246
|
tabIndex
|
|
235
247
|
} = useFocusRef(isCellSelected);
|
|
236
248
|
const Formatter = useDefaultComponents().checkboxFormatter;
|
|
237
|
-
return /*#__PURE__*/e
|
|
249
|
+
return /*#__PURE__*/e(Formatter, {
|
|
238
250
|
"aria-label": ariaLabel,
|
|
239
251
|
"aria-labelledby": ariaLabelledBy,
|
|
240
252
|
ref: ref,
|
|
@@ -247,7 +259,7 @@
|
|
|
247
259
|
|
|
248
260
|
function ValueFormatter(props) {
|
|
249
261
|
try {
|
|
250
|
-
return /*#__PURE__*/e
|
|
262
|
+
return /*#__PURE__*/e(d$1, {
|
|
251
263
|
children: props.row[props.column.key]
|
|
252
264
|
});
|
|
253
265
|
} catch {
|
|
@@ -255,12 +267,12 @@
|
|
|
255
267
|
}
|
|
256
268
|
}
|
|
257
269
|
|
|
258
|
-
var css_248z$b = ".gch972y700-
|
|
270
|
+
var css_248z$b = ".gch972y700-beta12{outline:none}.cz2qf0d700-beta12{stroke:currentColor;stroke-width:1.5px;fill:transparent;margin-inline-start:4px;vertical-align:middle}.cz2qf0d700-beta12>path{transition:d .1s}";
|
|
259
271
|
styleInject$1(css_248z$b,{"insertAt":"top"});
|
|
260
272
|
|
|
261
|
-
const groupCellContent = "gch972y700-
|
|
273
|
+
const groupCellContent = "gch972y700-beta12";
|
|
262
274
|
const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
|
|
263
|
-
const caret = "cz2qf0d700-
|
|
275
|
+
const caret = "cz2qf0d700-beta12";
|
|
264
276
|
const caretClassname = `rdg-caret ${caret}`;
|
|
265
277
|
function ToggleGroupFormatter({
|
|
266
278
|
groupKey,
|
|
@@ -282,18 +294,18 @@
|
|
|
282
294
|
}
|
|
283
295
|
|
|
284
296
|
const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';
|
|
285
|
-
return /*#__PURE__*/e
|
|
297
|
+
return /*#__PURE__*/e("span", {
|
|
286
298
|
ref: ref,
|
|
287
299
|
className: groupCellContentClassname,
|
|
288
300
|
tabIndex: tabIndex,
|
|
289
301
|
onKeyDown: handleKeyDown,
|
|
290
|
-
children: [groupKey, /*#__PURE__*/e
|
|
302
|
+
children: [groupKey, /*#__PURE__*/e("svg", {
|
|
291
303
|
viewBox: "0 0 14 8",
|
|
292
304
|
width: "14",
|
|
293
305
|
height: "8",
|
|
294
306
|
className: caretClassname,
|
|
295
307
|
"aria-hidden": true,
|
|
296
|
-
children: /*#__PURE__*/e
|
|
308
|
+
children: /*#__PURE__*/e("path", {
|
|
297
309
|
d: d
|
|
298
310
|
})
|
|
299
311
|
})]
|
|
@@ -319,7 +331,7 @@
|
|
|
319
331
|
|
|
320
332
|
function SelectFormatter(props) {
|
|
321
333
|
const [isRowSelected, onRowSelectionChange] = useRowSelection();
|
|
322
|
-
return /*#__PURE__*/e
|
|
334
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
323
335
|
"aria-label": "Select",
|
|
324
336
|
isCellSelected: props.isCellSelected,
|
|
325
337
|
value: isRowSelected,
|
|
@@ -335,7 +347,7 @@
|
|
|
335
347
|
|
|
336
348
|
function SelectGroupFormatter(props) {
|
|
337
349
|
const [isRowSelected, onRowSelectionChange] = useRowSelection();
|
|
338
|
-
return /*#__PURE__*/e
|
|
350
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
339
351
|
"aria-label": "Select Group",
|
|
340
352
|
isCellSelected: props.isCellSelected,
|
|
341
353
|
value: isRowSelected,
|
|
@@ -353,13 +365,14 @@
|
|
|
353
365
|
key: SELECT_COLUMN_KEY,
|
|
354
366
|
name: '',
|
|
355
367
|
width: 35,
|
|
368
|
+
minWidth: 35,
|
|
356
369
|
maxWidth: 35,
|
|
357
370
|
resizable: false,
|
|
358
371
|
sortable: false,
|
|
359
372
|
frozen: true,
|
|
360
373
|
|
|
361
374
|
headerRenderer(props) {
|
|
362
|
-
return /*#__PURE__*/e
|
|
375
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
363
376
|
"aria-label": "Select All",
|
|
364
377
|
isCellSelected: props.isCellSelected,
|
|
365
378
|
value: props.allRowsSelected,
|
|
@@ -557,19 +570,6 @@
|
|
|
557
570
|
return false;
|
|
558
571
|
}
|
|
559
572
|
|
|
560
|
-
const {
|
|
561
|
-
min,
|
|
562
|
-
max,
|
|
563
|
-
round,
|
|
564
|
-
floor,
|
|
565
|
-
sign,
|
|
566
|
-
abs
|
|
567
|
-
} = Math;
|
|
568
|
-
function assertIsValidKeyGetter(keyGetter) {
|
|
569
|
-
if (typeof keyGetter !== 'function') {
|
|
570
|
-
throw new Error('Please specify the rowKeyGetter prop to use selection');
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
573
|
function getRowStyle(rowIdx, height) {
|
|
574
574
|
if (height !== undefined) {
|
|
575
575
|
return {
|
|
@@ -593,6 +593,33 @@
|
|
|
593
593
|
return clsx(cellClassname, ...extraClasses, column.frozen && cellFrozenClassname, column.isLastFrozenColumn && cellFrozenLastClassname);
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
+
const {
|
|
597
|
+
min,
|
|
598
|
+
max,
|
|
599
|
+
round,
|
|
600
|
+
floor,
|
|
601
|
+
sign,
|
|
602
|
+
abs,
|
|
603
|
+
ceil
|
|
604
|
+
} = Math;
|
|
605
|
+
function assertIsValidKeyGetter(keyGetter) {
|
|
606
|
+
if (typeof keyGetter !== 'function') {
|
|
607
|
+
throw new Error('Please specify the rowKeyGetter prop to use selection');
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
function clampColumnWidth(width, {
|
|
611
|
+
minWidth,
|
|
612
|
+
maxWidth
|
|
613
|
+
}) {
|
|
614
|
+
width = max(width, minWidth);
|
|
615
|
+
|
|
616
|
+
if (typeof maxWidth === 'number' && maxWidth > minWidth) {
|
|
617
|
+
return min(width, maxWidth);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
return width;
|
|
621
|
+
}
|
|
622
|
+
|
|
596
623
|
function useCalculatedColumns({
|
|
597
624
|
rawColumns,
|
|
598
625
|
columnWidths,
|
|
@@ -604,7 +631,9 @@
|
|
|
604
631
|
}) {
|
|
605
632
|
var _defaultColumnOptions, _defaultColumnOptions2, _defaultColumnOptions3, _defaultColumnOptions4;
|
|
606
633
|
|
|
607
|
-
const
|
|
634
|
+
const defaultWidth = defaultColumnOptions == null ? void 0 : defaultColumnOptions.width;
|
|
635
|
+
const defaultMinWidth = (_defaultColumnOptions = defaultColumnOptions == null ? void 0 : defaultColumnOptions.minWidth) != null ? _defaultColumnOptions : 80;
|
|
636
|
+
const defaultMaxWidth = defaultColumnOptions == null ? void 0 : defaultColumnOptions.maxWidth;
|
|
608
637
|
const defaultFormatter = (_defaultColumnOptions2 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.formatter) != null ? _defaultColumnOptions2 : ValueFormatter;
|
|
609
638
|
const defaultSortable = (_defaultColumnOptions3 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.sortable) != null ? _defaultColumnOptions3 : false;
|
|
610
639
|
const defaultResizable = (_defaultColumnOptions4 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.resizable) != null ? _defaultColumnOptions4 : false;
|
|
@@ -617,7 +646,7 @@
|
|
|
617
646
|
const groupBy = [];
|
|
618
647
|
let lastFrozenColumnIndex = -1;
|
|
619
648
|
const columns = rawColumns.map(rawColumn => {
|
|
620
|
-
var _rawGroupBy$includes, _rawColumn$sortable, _rawColumn$resizable, _rawColumn$formatter;
|
|
649
|
+
var _rawGroupBy$includes, _rawColumn$width, _rawColumn$minWidth, _rawColumn$maxWidth, _rawColumn$sortable, _rawColumn$resizable, _rawColumn$formatter;
|
|
621
650
|
|
|
622
651
|
const rowGroup = (_rawGroupBy$includes = rawGroupBy == null ? void 0 : rawGroupBy.includes(rawColumn.key)) != null ? _rawGroupBy$includes : false;
|
|
623
652
|
const frozen = rowGroup || rawColumn.frozen || false;
|
|
@@ -626,6 +655,9 @@
|
|
|
626
655
|
frozen,
|
|
627
656
|
isLastFrozenColumn: false,
|
|
628
657
|
rowGroup,
|
|
658
|
+
width: (_rawColumn$width = rawColumn.width) != null ? _rawColumn$width : defaultWidth,
|
|
659
|
+
minWidth: (_rawColumn$minWidth = rawColumn.minWidth) != null ? _rawColumn$minWidth : defaultMinWidth,
|
|
660
|
+
maxWidth: (_rawColumn$maxWidth = rawColumn.maxWidth) != null ? _rawColumn$maxWidth : defaultMaxWidth,
|
|
629
661
|
sortable: (_rawColumn$sortable = rawColumn.sortable) != null ? _rawColumn$sortable : defaultSortable,
|
|
630
662
|
resizable: (_rawColumn$resizable = rawColumn.resizable) != null ? _rawColumn$resizable : defaultResizable,
|
|
631
663
|
formatter: (_rawColumn$formatter = rawColumn.formatter) != null ? _rawColumn$formatter : defaultFormatter
|
|
@@ -694,16 +726,14 @@
|
|
|
694
726
|
lastFrozenColumnIndex,
|
|
695
727
|
groupBy
|
|
696
728
|
};
|
|
697
|
-
}, [rawColumns, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
729
|
+
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
698
730
|
const {
|
|
699
731
|
layoutCssVars,
|
|
700
|
-
totalColumnWidth,
|
|
701
732
|
totalFrozenColumnWidth,
|
|
702
733
|
columnMetrics
|
|
703
734
|
} = _(() => {
|
|
704
735
|
const columnMetrics = new Map();
|
|
705
736
|
let left = 0;
|
|
706
|
-
let totalColumnWidth = 0;
|
|
707
737
|
let totalFrozenColumnWidth = 0;
|
|
708
738
|
let templateColumns = '';
|
|
709
739
|
let allocatedWidth = 0;
|
|
@@ -715,7 +745,7 @@
|
|
|
715
745
|
if (width === undefined) {
|
|
716
746
|
unassignedColumnsCount++;
|
|
717
747
|
} else {
|
|
718
|
-
width = clampColumnWidth(width, column
|
|
748
|
+
width = clampColumnWidth(width, column);
|
|
719
749
|
allocatedWidth += width;
|
|
720
750
|
columnMetrics.set(column, {
|
|
721
751
|
width,
|
|
@@ -736,7 +766,7 @@
|
|
|
736
766
|
} else {
|
|
737
767
|
const unallocatedWidth = viewportWidth - allocatedWidth;
|
|
738
768
|
const unallocatedColumnWidth = round(unallocatedWidth / unassignedColumnsCount);
|
|
739
|
-
width = clampColumnWidth(unallocatedColumnWidth, column
|
|
769
|
+
width = clampColumnWidth(unallocatedColumnWidth, column);
|
|
740
770
|
allocatedWidth += width;
|
|
741
771
|
unassignedColumnsCount--;
|
|
742
772
|
columnMetrics.set(column, {
|
|
@@ -745,7 +775,6 @@
|
|
|
745
775
|
});
|
|
746
776
|
}
|
|
747
777
|
|
|
748
|
-
totalColumnWidth += width;
|
|
749
778
|
left += width;
|
|
750
779
|
templateColumns += `${width}px `;
|
|
751
780
|
}
|
|
@@ -766,11 +795,10 @@
|
|
|
766
795
|
|
|
767
796
|
return {
|
|
768
797
|
layoutCssVars,
|
|
769
|
-
totalColumnWidth,
|
|
770
798
|
totalFrozenColumnWidth,
|
|
771
799
|
columnMetrics
|
|
772
800
|
};
|
|
773
|
-
}, [columnWidths, columns, viewportWidth,
|
|
801
|
+
}, [columnWidths, columns, viewportWidth, lastFrozenColumnIndex]);
|
|
774
802
|
const [colOverscanStartIdx, colOverscanEndIdx] = _(() => {
|
|
775
803
|
if (!enableVirtualization) {
|
|
776
804
|
return [0, columns.length - 1];
|
|
@@ -826,7 +854,6 @@
|
|
|
826
854
|
colOverscanEndIdx,
|
|
827
855
|
layoutCssVars,
|
|
828
856
|
columnMetrics,
|
|
829
|
-
totalColumnWidth,
|
|
830
857
|
lastFrozenColumnIndex,
|
|
831
858
|
totalFrozenColumnWidth,
|
|
832
859
|
groupBy
|
|
@@ -852,42 +879,44 @@
|
|
|
852
879
|
return undefined;
|
|
853
880
|
}
|
|
854
881
|
|
|
855
|
-
function clampColumnWidth(width, {
|
|
856
|
-
minWidth,
|
|
857
|
-
maxWidth
|
|
858
|
-
}, minColumnWidth) {
|
|
859
|
-
width = max(width, minWidth != null ? minWidth : minColumnWidth);
|
|
860
|
-
|
|
861
|
-
if (typeof maxWidth === 'number') {
|
|
862
|
-
return min(width, maxWidth);
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
return width;
|
|
866
|
-
}
|
|
867
|
-
|
|
868
882
|
function useGridDimensions() {
|
|
869
883
|
const gridRef = h(null);
|
|
870
|
-
const [
|
|
871
|
-
const [
|
|
884
|
+
const [inlineSize, setInlineSize] = m(1);
|
|
885
|
+
const [blockSize, setBlockSize] = m(1);
|
|
872
886
|
useLayoutEffect(() => {
|
|
873
887
|
const {
|
|
874
888
|
ResizeObserver
|
|
875
889
|
} = window;
|
|
876
890
|
if (ResizeObserver == null) return;
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
891
|
+
const {
|
|
892
|
+
clientWidth,
|
|
893
|
+
clientHeight,
|
|
894
|
+
offsetWidth,
|
|
895
|
+
offsetHeight
|
|
896
|
+
} = gridRef.current;
|
|
897
|
+
const {
|
|
898
|
+
width,
|
|
899
|
+
height
|
|
900
|
+
} = gridRef.current.getBoundingClientRect();
|
|
901
|
+
const initialWidth = width - offsetWidth + clientWidth;
|
|
902
|
+
const initialHeight = height - offsetHeight + clientHeight;
|
|
903
|
+
setInlineSize(handleDevicePixelRatio(initialWidth));
|
|
904
|
+
setBlockSize(initialHeight);
|
|
905
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
906
|
+
const size = entries[0].contentBoxSize[0];
|
|
907
|
+
setInlineSize(handleDevicePixelRatio(size.inlineSize));
|
|
908
|
+
setBlockSize(size.blockSize);
|
|
884
909
|
});
|
|
885
910
|
resizeObserver.observe(gridRef.current);
|
|
886
911
|
return () => {
|
|
887
912
|
resizeObserver.disconnect();
|
|
888
913
|
};
|
|
889
914
|
}, []);
|
|
890
|
-
return [gridRef,
|
|
915
|
+
return [gridRef, inlineSize, blockSize];
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
function handleDevicePixelRatio(size) {
|
|
919
|
+
return size - (devicePixelRatio === 1 ? 0 : ceil(devicePixelRatio));
|
|
891
920
|
}
|
|
892
921
|
|
|
893
922
|
function useLatestFunc(fn) {
|
|
@@ -901,38 +930,30 @@
|
|
|
901
930
|
}
|
|
902
931
|
|
|
903
932
|
function useRovingCellRef(isSelected) {
|
|
904
|
-
const
|
|
905
|
-
const isChildFocused = h(false);
|
|
906
|
-
const [, forceRender] = m({});
|
|
907
|
-
useLayoutEffect(() => {
|
|
908
|
-
var _ref$current;
|
|
933
|
+
const [isChildFocused, setIsChildFocused] = m(false);
|
|
909
934
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
if (isChildFocused.current) {
|
|
916
|
-
forceRender({});
|
|
917
|
-
return;
|
|
918
|
-
}
|
|
935
|
+
if (isChildFocused && !isSelected) {
|
|
936
|
+
setIsChildFocused(false);
|
|
937
|
+
}
|
|
919
938
|
|
|
920
|
-
|
|
939
|
+
const ref = A$1(cell => {
|
|
940
|
+
if (cell === null || cell.contains(document.activeElement)) return;
|
|
941
|
+
cell.focus({
|
|
921
942
|
preventScroll: true
|
|
922
943
|
});
|
|
923
|
-
}, [
|
|
944
|
+
}, []);
|
|
924
945
|
|
|
925
946
|
function onFocus(event) {
|
|
926
|
-
if (event.target !==
|
|
927
|
-
|
|
947
|
+
if (event.target !== event.currentTarget) {
|
|
948
|
+
setIsChildFocused(true);
|
|
928
949
|
}
|
|
929
950
|
}
|
|
930
951
|
|
|
931
|
-
const isFocused = isSelected && !isChildFocused
|
|
952
|
+
const isFocused = isSelected && !isChildFocused;
|
|
932
953
|
return {
|
|
933
|
-
ref,
|
|
954
|
+
ref: isSelected ? ref : undefined,
|
|
934
955
|
tabIndex: isFocused ? 0 : -1,
|
|
935
|
-
onFocus
|
|
956
|
+
onFocus: isSelected ? onFocus : undefined
|
|
936
957
|
};
|
|
937
958
|
}
|
|
938
959
|
|
|
@@ -1188,12 +1209,12 @@
|
|
|
1188
1209
|
};
|
|
1189
1210
|
}
|
|
1190
1211
|
|
|
1191
|
-
var css_248z$a = ".h1tr5c9i700-
|
|
1212
|
+
var css_248z$a = ".h1tr5c9i700-beta12{cursor:pointer;display:flex}.h1tr5c9i700-beta12:focus{outline:none}.h19r0msv700-beta12{flex-grow:1;overflow:hidden;overflow:clip;text-overflow:ellipsis}";
|
|
1192
1213
|
styleInject$1(css_248z$a,{"insertAt":"top"});
|
|
1193
1214
|
|
|
1194
|
-
const headerSortCell = "h1tr5c9i700-
|
|
1215
|
+
const headerSortCell = "h1tr5c9i700-beta12";
|
|
1195
1216
|
const headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;
|
|
1196
|
-
const headerSortName = "h19r0msv700-
|
|
1217
|
+
const headerSortName = "h19r0msv700-beta12";
|
|
1197
1218
|
const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1198
1219
|
function HeaderRenderer({
|
|
1199
1220
|
column,
|
|
@@ -1202,10 +1223,10 @@
|
|
|
1202
1223
|
onSort,
|
|
1203
1224
|
isCellSelected
|
|
1204
1225
|
}) {
|
|
1205
|
-
if (!column.sortable) return /*#__PURE__*/e
|
|
1226
|
+
if (!column.sortable) return /*#__PURE__*/e(d$1, {
|
|
1206
1227
|
children: column.name
|
|
1207
1228
|
});
|
|
1208
|
-
return /*#__PURE__*/e
|
|
1229
|
+
return /*#__PURE__*/e(SortableHeaderCell, {
|
|
1209
1230
|
onSort: onSort,
|
|
1210
1231
|
sortDirection: sortDirection,
|
|
1211
1232
|
priority: priority,
|
|
@@ -1238,27 +1259,27 @@
|
|
|
1238
1259
|
onSort(event.ctrlKey || event.metaKey);
|
|
1239
1260
|
}
|
|
1240
1261
|
|
|
1241
|
-
return /*#__PURE__*/e
|
|
1262
|
+
return /*#__PURE__*/e("span", {
|
|
1242
1263
|
ref: ref,
|
|
1243
1264
|
tabIndex: tabIndex,
|
|
1244
1265
|
className: headerSortCellClassname,
|
|
1245
1266
|
onClick: handleClick,
|
|
1246
1267
|
onKeyDown: handleKeyDown,
|
|
1247
|
-
children: [/*#__PURE__*/e
|
|
1268
|
+
children: [/*#__PURE__*/e("span", {
|
|
1248
1269
|
className: headerSortNameClassname,
|
|
1249
1270
|
children: children
|
|
1250
|
-
}), /*#__PURE__*/e
|
|
1251
|
-
children: [/*#__PURE__*/e
|
|
1271
|
+
}), /*#__PURE__*/e("span", {
|
|
1272
|
+
children: [/*#__PURE__*/e(SortIcon, {
|
|
1252
1273
|
sortDirection: sortDirection
|
|
1253
1274
|
}), priority]
|
|
1254
1275
|
})]
|
|
1255
1276
|
});
|
|
1256
1277
|
}
|
|
1257
1278
|
|
|
1258
|
-
var css_248z$9 = ".celq7o9700-
|
|
1279
|
+
var css_248z$9 = ".celq7o9700-beta12{touch-action:none}.celq7o9700-beta12:after{content:\"\";cursor:col-resize;inline-size:10px;inset-block-end:0;inset-block-start:0;inset-inline-end:0;position:absolute}";
|
|
1259
1280
|
styleInject$1(css_248z$9,{"insertAt":"top"});
|
|
1260
1281
|
|
|
1261
|
-
const cellResizable = "celq7o9700-
|
|
1282
|
+
const cellResizable = "celq7o9700-beta12";
|
|
1262
1283
|
const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
|
|
1263
1284
|
function HeaderCell({
|
|
1264
1285
|
column,
|
|
@@ -1273,7 +1294,7 @@
|
|
|
1273
1294
|
shouldFocusGrid,
|
|
1274
1295
|
direction
|
|
1275
1296
|
}) {
|
|
1276
|
-
var _column$headerRendere, _column$
|
|
1297
|
+
var _column$headerRendere, _column$maxWidth;
|
|
1277
1298
|
|
|
1278
1299
|
const isRtl = direction === 'rtl';
|
|
1279
1300
|
const {
|
|
@@ -1316,7 +1337,7 @@
|
|
|
1316
1337
|
const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
|
|
1317
1338
|
|
|
1318
1339
|
if (width > 0) {
|
|
1319
|
-
onColumnResize(column, width);
|
|
1340
|
+
onColumnResize(column, clampColumnWidth(width, column));
|
|
1320
1341
|
}
|
|
1321
1342
|
}
|
|
1322
1343
|
|
|
@@ -1387,14 +1408,14 @@
|
|
|
1387
1408
|
}
|
|
1388
1409
|
|
|
1389
1410
|
function handleFocus(event) {
|
|
1390
|
-
onFocus(event);
|
|
1411
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
1391
1412
|
|
|
1392
1413
|
if (shouldFocusGrid) {
|
|
1393
1414
|
selectCell(0);
|
|
1394
1415
|
}
|
|
1395
1416
|
}
|
|
1396
1417
|
|
|
1397
|
-
return /*#__PURE__*/e
|
|
1418
|
+
return /*#__PURE__*/e("div", {
|
|
1398
1419
|
role: "columnheader",
|
|
1399
1420
|
"aria-colindex": column.idx + 1,
|
|
1400
1421
|
"aria-selected": isCellSelected,
|
|
@@ -1404,14 +1425,14 @@
|
|
|
1404
1425
|
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1405
1426
|
className: className,
|
|
1406
1427
|
style: { ...getCellStyle(column, colSpan),
|
|
1407
|
-
minWidth:
|
|
1428
|
+
minWidth: column.minWidth,
|
|
1408
1429
|
maxWidth: (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : undefined
|
|
1409
1430
|
},
|
|
1410
1431
|
onFocus: handleFocus,
|
|
1411
1432
|
onClick: onClick,
|
|
1412
1433
|
onDoubleClick: column.resizable ? onDoubleClick : undefined,
|
|
1413
1434
|
onPointerDown: column.resizable ? onPointerDown : undefined,
|
|
1414
|
-
children: /*#__PURE__*/e
|
|
1435
|
+
children: /*#__PURE__*/e(HeaderRenderer$1, {
|
|
1415
1436
|
column: column,
|
|
1416
1437
|
sortDirection: sortDirection,
|
|
1417
1438
|
priority: priority,
|
|
@@ -1423,10 +1444,10 @@
|
|
|
1423
1444
|
});
|
|
1424
1445
|
}
|
|
1425
1446
|
|
|
1426
|
-
var css_248z$8 = ".h197vzie700-
|
|
1447
|
+
var css_248z$8 = ".h197vzie700-beta12{background-color:var(--rdg-header-background-color);display:contents;font-weight:700;line-height:var(--rdg-header-row-height)}.h197vzie700-beta12>.c1wupbe700-beta12{inset-block-start:0;position:sticky;z-index:2}.h197vzie700-beta12>.c1730fa4700-beta12{z-index:3}";
|
|
1427
1448
|
styleInject$1(css_248z$8,{"insertAt":"top"});
|
|
1428
1449
|
|
|
1429
|
-
const headerRow = "h197vzie700-
|
|
1450
|
+
const headerRow = "h197vzie700-beta12";
|
|
1430
1451
|
const headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1431
1452
|
|
|
1432
1453
|
function HeaderRow({
|
|
@@ -1454,7 +1475,7 @@
|
|
|
1454
1475
|
index += colSpan - 1;
|
|
1455
1476
|
}
|
|
1456
1477
|
|
|
1457
|
-
cells.push( /*#__PURE__*/e
|
|
1478
|
+
cells.push( /*#__PURE__*/e(HeaderCell, {
|
|
1458
1479
|
column: column,
|
|
1459
1480
|
colSpan: colSpan,
|
|
1460
1481
|
isCellSelected: selectedCellIdx === column.idx,
|
|
@@ -1469,7 +1490,7 @@
|
|
|
1469
1490
|
}, column.key));
|
|
1470
1491
|
}
|
|
1471
1492
|
|
|
1472
|
-
return /*#__PURE__*/e
|
|
1493
|
+
return /*#__PURE__*/e("div", {
|
|
1473
1494
|
role: "row",
|
|
1474
1495
|
"aria-rowindex": 1,
|
|
1475
1496
|
className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
@@ -1480,12 +1501,12 @@
|
|
|
1480
1501
|
|
|
1481
1502
|
const HeaderRow$1 = /*#__PURE__*/g(HeaderRow);
|
|
1482
1503
|
|
|
1483
|
-
var css_248z$7 = ".c1bmg16t700-
|
|
1504
|
+
var css_248z$7 = ".c1bmg16t700-beta12,.ccpfvsn700-beta12{background-color:#ccf}.c1bmg16t700-beta12.ccpfvsn700-beta12{background-color:#99f}";
|
|
1484
1505
|
styleInject$1(css_248z$7,{"insertAt":"top"});
|
|
1485
1506
|
|
|
1486
|
-
const cellCopied = "ccpfvsn700-
|
|
1507
|
+
const cellCopied = "ccpfvsn700-beta12";
|
|
1487
1508
|
const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
|
|
1488
|
-
const cellDraggedOver = "c1bmg16t700-
|
|
1509
|
+
const cellDraggedOver = "c1bmg16t700-beta12";
|
|
1489
1510
|
const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1490
1511
|
|
|
1491
1512
|
function Cell({
|
|
@@ -1532,7 +1553,7 @@
|
|
|
1532
1553
|
onRowDoubleClick == null ? void 0 : onRowDoubleClick(row, column);
|
|
1533
1554
|
}
|
|
1534
1555
|
|
|
1535
|
-
return /*#__PURE__*/e
|
|
1556
|
+
return /*#__PURE__*/e("div", {
|
|
1536
1557
|
role: "gridcell",
|
|
1537
1558
|
"aria-colindex": column.idx + 1,
|
|
1538
1559
|
"aria-selected": isCellSelected,
|
|
@@ -1547,8 +1568,8 @@
|
|
|
1547
1568
|
onContextMenu: handleContextMenu,
|
|
1548
1569
|
onFocus: onFocus,
|
|
1549
1570
|
...props,
|
|
1550
|
-
children: !column.rowGroup && /*#__PURE__*/e
|
|
1551
|
-
children: [/*#__PURE__*/e
|
|
1571
|
+
children: !column.rowGroup && /*#__PURE__*/e(d$1, {
|
|
1572
|
+
children: [/*#__PURE__*/e(column.formatter, {
|
|
1552
1573
|
column: column,
|
|
1553
1574
|
row: row,
|
|
1554
1575
|
isCellSelected: isCellSelected,
|
|
@@ -1614,7 +1635,7 @@
|
|
|
1614
1635
|
if (isCellSelected && selectedCellEditor) {
|
|
1615
1636
|
cells.push(selectedCellEditor);
|
|
1616
1637
|
} else {
|
|
1617
|
-
cells.push( /*#__PURE__*/e
|
|
1638
|
+
cells.push( /*#__PURE__*/e(Cell$1, {
|
|
1618
1639
|
column: column,
|
|
1619
1640
|
colSpan: colSpan,
|
|
1620
1641
|
row: row,
|
|
@@ -1630,9 +1651,9 @@
|
|
|
1630
1651
|
}
|
|
1631
1652
|
}
|
|
1632
1653
|
|
|
1633
|
-
return /*#__PURE__*/e
|
|
1654
|
+
return /*#__PURE__*/e(RowSelectionProvider, {
|
|
1634
1655
|
value: isRowSelected,
|
|
1635
|
-
children: /*#__PURE__*/e
|
|
1656
|
+
children: /*#__PURE__*/e("div", {
|
|
1636
1657
|
role: "row",
|
|
1637
1658
|
ref: ref,
|
|
1638
1659
|
className: className,
|
|
@@ -1668,7 +1689,7 @@
|
|
|
1668
1689
|
}
|
|
1669
1690
|
|
|
1670
1691
|
const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;
|
|
1671
|
-
return /*#__PURE__*/e
|
|
1692
|
+
return /*#__PURE__*/e("div", {
|
|
1672
1693
|
role: "gridcell",
|
|
1673
1694
|
"aria-colindex": column.idx + 1,
|
|
1674
1695
|
"aria-selected": isCellSelected,
|
|
@@ -1680,7 +1701,7 @@
|
|
|
1680
1701
|
},
|
|
1681
1702
|
onClick: isLevelMatching ? toggleGroup : undefined,
|
|
1682
1703
|
onFocus: onFocus,
|
|
1683
|
-
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e
|
|
1704
|
+
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e(column.groupFormatter, {
|
|
1684
1705
|
groupKey: groupKey,
|
|
1685
1706
|
childRows: childRows,
|
|
1686
1707
|
column: column,
|
|
@@ -1694,10 +1715,10 @@
|
|
|
1694
1715
|
|
|
1695
1716
|
const GroupCell$1 = /*#__PURE__*/g(GroupCell);
|
|
1696
1717
|
|
|
1697
|
-
var css_248z$6 = ".gyxx7e9700-
|
|
1718
|
+
var css_248z$6 = ".gyxx7e9700-beta12:not([aria-selected=true]){background-color:var(--rdg-header-background-color)}.gyxx7e9700-beta12>.c1wupbe700-beta12:not(:last-child):not(.c9dpaye700-beta12){border-inline-end:none}";
|
|
1698
1719
|
styleInject$1(css_248z$6,{"insertAt":"top"});
|
|
1699
1720
|
|
|
1700
|
-
const groupRow = "gyxx7e9700-
|
|
1721
|
+
const groupRow = "gyxx7e9700-beta12";
|
|
1701
1722
|
const groupRowClassname = `rdg-group-row ${groupRow}`;
|
|
1702
1723
|
|
|
1703
1724
|
function GroupedRow({
|
|
@@ -1723,9 +1744,9 @@
|
|
|
1723
1744
|
selectGroup(rowIdx);
|
|
1724
1745
|
}
|
|
1725
1746
|
|
|
1726
|
-
return /*#__PURE__*/e
|
|
1747
|
+
return /*#__PURE__*/e(RowSelectionProvider, {
|
|
1727
1748
|
value: isRowSelected,
|
|
1728
|
-
children: /*#__PURE__*/e
|
|
1749
|
+
children: /*#__PURE__*/e("div", {
|
|
1729
1750
|
role: "row",
|
|
1730
1751
|
"aria-level": level,
|
|
1731
1752
|
"aria-expanded": isExpanded,
|
|
@@ -1733,7 +1754,7 @@
|
|
|
1733
1754
|
onClick: handleSelectGroup,
|
|
1734
1755
|
style: getRowStyle(gridRowStart, height),
|
|
1735
1756
|
...props,
|
|
1736
|
-
children: viewportColumns.map(column => /*#__PURE__*/e
|
|
1757
|
+
children: viewportColumns.map(column => /*#__PURE__*/e(GroupCell$1, {
|
|
1737
1758
|
id: id,
|
|
1738
1759
|
groupKey: groupKey,
|
|
1739
1760
|
childRows: childRows,
|
|
@@ -1750,10 +1771,10 @@
|
|
|
1750
1771
|
|
|
1751
1772
|
const GroupRowRenderer = /*#__PURE__*/g(GroupedRow);
|
|
1752
1773
|
|
|
1753
|
-
var css_248z$5 = ".s1n3hxke700-
|
|
1774
|
+
var css_248z$5 = ".s1n3hxke700-beta12{inset-block-end:var(--rdg-summary-row-bottom);inset-block-start:var(--rdg-summary-row-top)}";
|
|
1754
1775
|
styleInject$1(css_248z$5,{"insertAt":"top"});
|
|
1755
1776
|
|
|
1756
|
-
const summaryCellClassname = "s1n3hxke700-
|
|
1777
|
+
const summaryCellClassname = "s1n3hxke700-beta12";
|
|
1757
1778
|
|
|
1758
1779
|
function SummaryCell({
|
|
1759
1780
|
column,
|
|
@@ -1777,7 +1798,7 @@
|
|
|
1777
1798
|
selectCell(row, column);
|
|
1778
1799
|
}
|
|
1779
1800
|
|
|
1780
|
-
return /*#__PURE__*/e
|
|
1801
|
+
return /*#__PURE__*/e("div", {
|
|
1781
1802
|
role: "gridcell",
|
|
1782
1803
|
"aria-colindex": column.idx + 1,
|
|
1783
1804
|
"aria-colspan": colSpan,
|
|
@@ -1788,7 +1809,7 @@
|
|
|
1788
1809
|
style: getCellStyle(column, colSpan),
|
|
1789
1810
|
onClick: onClick,
|
|
1790
1811
|
onFocus: onFocus,
|
|
1791
|
-
children: SummaryFormatter && /*#__PURE__*/e
|
|
1812
|
+
children: SummaryFormatter && /*#__PURE__*/e(SummaryFormatter, {
|
|
1792
1813
|
column: column,
|
|
1793
1814
|
row: row,
|
|
1794
1815
|
isCellSelected: isCellSelected
|
|
@@ -1798,11 +1819,11 @@
|
|
|
1798
1819
|
|
|
1799
1820
|
const SummaryCell$1 = /*#__PURE__*/g(SummaryCell);
|
|
1800
1821
|
|
|
1801
|
-
var css_248z$4 = ".snfqesz700-
|
|
1822
|
+
var css_248z$4 = ".snfqesz700-beta12.r1otpg64700-beta12{line-height:var(--rdg-summary-row-height)}.snfqesz700-beta12.r1otpg64700-beta12>.c1wupbe700-beta12{position:sticky}.s1jijrjz700-beta12>.c1wupbe700-beta12{border-block-start:2px solid var(--rdg-summary-border-color)}";
|
|
1802
1823
|
styleInject$1(css_248z$4,{"insertAt":"top"});
|
|
1803
1824
|
|
|
1804
|
-
const summaryRow = "snfqesz700-
|
|
1805
|
-
const summaryRowBorderClassname = "s1jijrjz700-
|
|
1825
|
+
const summaryRow = "snfqesz700-beta12";
|
|
1826
|
+
const summaryRowBorderClassname = "s1jijrjz700-beta12";
|
|
1806
1827
|
const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
1807
1828
|
|
|
1808
1829
|
function SummaryRow({
|
|
@@ -1831,7 +1852,7 @@
|
|
|
1831
1852
|
}
|
|
1832
1853
|
|
|
1833
1854
|
const isCellSelected = selectedCellIdx === column.idx;
|
|
1834
|
-
cells.push( /*#__PURE__*/e
|
|
1855
|
+
cells.push( /*#__PURE__*/e(SummaryCell$1, {
|
|
1835
1856
|
column: column,
|
|
1836
1857
|
colSpan: colSpan,
|
|
1837
1858
|
row: row,
|
|
@@ -1840,7 +1861,7 @@
|
|
|
1840
1861
|
}, column.key));
|
|
1841
1862
|
}
|
|
1842
1863
|
|
|
1843
|
-
return /*#__PURE__*/e
|
|
1864
|
+
return /*#__PURE__*/e("div", {
|
|
1844
1865
|
role: "row",
|
|
1845
1866
|
"aria-rowindex": ariaRowIndex,
|
|
1846
1867
|
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, rowIdx === 0 && summaryRowBorderClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
@@ -1854,10 +1875,10 @@
|
|
|
1854
1875
|
|
|
1855
1876
|
const SummaryRow$1 = /*#__PURE__*/g(SummaryRow);
|
|
1856
1877
|
|
|
1857
|
-
var css_248z$3 = ".c1tngyp1700-
|
|
1878
|
+
var css_248z$3 = ".c1tngyp1700-beta12.rdg-cell{padding:0}";
|
|
1858
1879
|
styleInject$1(css_248z$3,{"insertAt":"top"});
|
|
1859
1880
|
|
|
1860
|
-
const cellEditing = "c1tngyp1700-
|
|
1881
|
+
const cellEditing = "c1tngyp1700-beta12";
|
|
1861
1882
|
function EditCell({
|
|
1862
1883
|
column,
|
|
1863
1884
|
colSpan,
|
|
@@ -1926,7 +1947,7 @@
|
|
|
1926
1947
|
cellClass
|
|
1927
1948
|
} = column;
|
|
1928
1949
|
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !((_column$editorOptions4 = column.editorOptions) != null && _column$editorOptions4.renderFormatter) && cellEditing);
|
|
1929
|
-
return /*#__PURE__*/e
|
|
1950
|
+
return /*#__PURE__*/e("div", {
|
|
1930
1951
|
role: "gridcell",
|
|
1931
1952
|
"aria-colindex": column.idx + 1,
|
|
1932
1953
|
"aria-colspan": colSpan,
|
|
@@ -1935,13 +1956,13 @@
|
|
|
1935
1956
|
style: getCellStyle(column, colSpan),
|
|
1936
1957
|
onKeyDown: onKeyDown,
|
|
1937
1958
|
onMouseDownCapture: commitOnOutsideClick ? cancelFrameRequest : undefined,
|
|
1938
|
-
children: column.editor != null && /*#__PURE__*/e
|
|
1939
|
-
children: [/*#__PURE__*/e
|
|
1959
|
+
children: column.editor != null && /*#__PURE__*/e(d$1, {
|
|
1960
|
+
children: [/*#__PURE__*/e(column.editor, {
|
|
1940
1961
|
column: column,
|
|
1941
1962
|
row: row,
|
|
1942
1963
|
onRowChange: onRowChange,
|
|
1943
1964
|
onClose: onClose
|
|
1944
|
-
}), ((_column$editorOptions5 = column.editorOptions) == null ? void 0 : _column$editorOptions5.renderFormatter) && /*#__PURE__*/e
|
|
1965
|
+
}), ((_column$editorOptions5 = column.editorOptions) == null ? void 0 : _column$editorOptions5.renderFormatter) && /*#__PURE__*/e(column.formatter, {
|
|
1945
1966
|
column: column,
|
|
1946
1967
|
row: row,
|
|
1947
1968
|
isCellSelected: true,
|
|
@@ -1951,10 +1972,10 @@
|
|
|
1951
1972
|
});
|
|
1952
1973
|
}
|
|
1953
1974
|
|
|
1954
|
-
var css_248z$2 = ".cadd3bp700-
|
|
1975
|
+
var css_248z$2 = ".cadd3bp700-beta12{background-color:var(--rdg-selection-color);block-size:8px;cursor:move;inline-size:8px;inset-block-end:0;inset-inline-end:0;position:absolute}.cadd3bp700-beta12:hover{background-color:var(--rdg-background-color);block-size:16px;border:2px solid var(--rdg-selection-color);inline-size:16px}";
|
|
1955
1976
|
styleInject$1(css_248z$2,{"insertAt":"top"});
|
|
1956
1977
|
|
|
1957
|
-
const cellDragHandle = "cadd3bp700-
|
|
1978
|
+
const cellDragHandle = "cadd3bp700-beta12";
|
|
1958
1979
|
const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1959
1980
|
function DragHandle({
|
|
1960
1981
|
rows,
|
|
@@ -2038,28 +2059,28 @@
|
|
|
2038
2059
|
}
|
|
2039
2060
|
}
|
|
2040
2061
|
|
|
2041
|
-
return /*#__PURE__*/e
|
|
2062
|
+
return /*#__PURE__*/e("div", {
|
|
2042
2063
|
className: cellDragHandleClassname,
|
|
2043
2064
|
onMouseDown: handleMouseDown,
|
|
2044
2065
|
onDoubleClick: handleDoubleClick
|
|
2045
2066
|
});
|
|
2046
2067
|
}
|
|
2047
2068
|
|
|
2048
|
-
var css_248z$1 = ".a888944700-
|
|
2069
|
+
var css_248z$1 = ".a888944700-beta12{fill:currentColor}.a888944700-beta12>path{transition:d .1s}";
|
|
2049
2070
|
styleInject$1(css_248z$1,{"insertAt":"top"});
|
|
2050
2071
|
|
|
2051
|
-
const arrow = "a888944700-
|
|
2072
|
+
const arrow = "a888944700-beta12";
|
|
2052
2073
|
const arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
2053
2074
|
function SortIcon({
|
|
2054
2075
|
sortDirection
|
|
2055
2076
|
}) {
|
|
2056
|
-
return sortDirection !== undefined ? /*#__PURE__*/e
|
|
2077
|
+
return sortDirection !== undefined ? /*#__PURE__*/e("svg", {
|
|
2057
2078
|
viewBox: "0 0 12 8",
|
|
2058
2079
|
width: "12",
|
|
2059
2080
|
height: "8",
|
|
2060
2081
|
className: arrowClassname,
|
|
2061
2082
|
"aria-hidden": true,
|
|
2062
|
-
children: /*#__PURE__*/e
|
|
2083
|
+
children: /*#__PURE__*/e("path", {
|
|
2063
2084
|
d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'
|
|
2064
2085
|
})
|
|
2065
2086
|
}) : null;
|
|
@@ -2159,7 +2180,6 @@
|
|
|
2159
2180
|
colOverscanEndIdx,
|
|
2160
2181
|
layoutCssVars,
|
|
2161
2182
|
columnMetrics,
|
|
2162
|
-
totalColumnWidth,
|
|
2163
2183
|
lastFrozenColumnIndex,
|
|
2164
2184
|
totalFrozenColumnWidth,
|
|
2165
2185
|
groupBy
|
|
@@ -2260,7 +2280,9 @@
|
|
|
2260
2280
|
useLayoutEffect(() => {
|
|
2261
2281
|
if (autoResizeColumn === null) return;
|
|
2262
2282
|
const columnElement = gridRef.current.querySelector(`[aria-colindex="${autoResizeColumn.idx + 1}"]`);
|
|
2263
|
-
const
|
|
2283
|
+
const {
|
|
2284
|
+
width
|
|
2285
|
+
} = columnElement.getBoundingClientRect();
|
|
2264
2286
|
setColumnWidths(columnWidths => {
|
|
2265
2287
|
const newColumnWidths = new Map(columnWidths);
|
|
2266
2288
|
newColumnWidths.set(autoResizeColumn.key, width);
|
|
@@ -2716,20 +2738,14 @@
|
|
|
2716
2738
|
rowIdx: rowIdx + 1
|
|
2717
2739
|
};
|
|
2718
2740
|
|
|
2719
|
-
case
|
|
2720
|
-
return
|
|
2721
|
-
idx: idx + 1,
|
|
2722
|
-
rowIdx
|
|
2723
|
-
} : {
|
|
2741
|
+
case leftKey:
|
|
2742
|
+
return {
|
|
2724
2743
|
idx: idx - 1,
|
|
2725
2744
|
rowIdx
|
|
2726
2745
|
};
|
|
2727
2746
|
|
|
2728
|
-
case
|
|
2729
|
-
return
|
|
2730
|
-
idx: idx - 1,
|
|
2731
|
-
rowIdx
|
|
2732
|
-
} : {
|
|
2747
|
+
case rightKey:
|
|
2748
|
+
return {
|
|
2733
2749
|
idx: idx + 1,
|
|
2734
2750
|
rowIdx
|
|
2735
2751
|
};
|
|
@@ -2855,7 +2871,7 @@
|
|
|
2855
2871
|
return;
|
|
2856
2872
|
}
|
|
2857
2873
|
|
|
2858
|
-
return /*#__PURE__*/e
|
|
2874
|
+
return /*#__PURE__*/e(DragHandle, {
|
|
2859
2875
|
rows: rawRows,
|
|
2860
2876
|
columns: columns,
|
|
2861
2877
|
selectedPosition: selectedPosition,
|
|
@@ -2906,7 +2922,7 @@
|
|
|
2906
2922
|
closeEditor();
|
|
2907
2923
|
}
|
|
2908
2924
|
|
|
2909
|
-
return /*#__PURE__*/e
|
|
2925
|
+
return /*#__PURE__*/e(EditCell, {
|
|
2910
2926
|
column: column,
|
|
2911
2927
|
colSpan: colSpan,
|
|
2912
2928
|
row: row,
|
|
@@ -2918,6 +2934,16 @@
|
|
|
2918
2934
|
}, column.key);
|
|
2919
2935
|
}
|
|
2920
2936
|
|
|
2937
|
+
function getRowViewportColumns(rowIdx) {
|
|
2938
|
+
const selectedColumn = columns[selectedPosition.idx];
|
|
2939
|
+
|
|
2940
|
+
if (selectedColumn !== undefined && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) {
|
|
2941
|
+
return selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)];
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
return viewportColumns;
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2921
2947
|
function getViewportRows() {
|
|
2922
2948
|
const rowElements = [];
|
|
2923
2949
|
let startRowIndex = 0;
|
|
@@ -2937,8 +2963,8 @@
|
|
|
2937
2963
|
if (selectedColumn !== undefined) {
|
|
2938
2964
|
if (isRowOutsideViewport) {
|
|
2939
2965
|
rowColumns = [selectedColumn];
|
|
2940
|
-
} else
|
|
2941
|
-
rowColumns =
|
|
2966
|
+
} else {
|
|
2967
|
+
rowColumns = getRowViewportColumns(rowIdx);
|
|
2942
2968
|
}
|
|
2943
2969
|
}
|
|
2944
2970
|
|
|
@@ -2950,7 +2976,7 @@
|
|
|
2950
2976
|
startRowIndex
|
|
2951
2977
|
} = row);
|
|
2952
2978
|
const isGroupRowSelected = isSelectable && row.childRows.every(cr => selectedRows.has(rowKeyGetter(cr)));
|
|
2953
|
-
rowElements.push( /*#__PURE__*/e
|
|
2979
|
+
rowElements.push( /*#__PURE__*/e(GroupRowRenderer, {
|
|
2954
2980
|
"aria-level": row.level + 1,
|
|
2955
2981
|
"aria-setsize": row.setSize,
|
|
2956
2982
|
"aria-posinset": row.posInSet + 1,
|
|
@@ -2987,7 +3013,7 @@
|
|
|
2987
3013
|
key = hasGroups ? startRowIndex : rowIdx;
|
|
2988
3014
|
}
|
|
2989
3015
|
|
|
2990
|
-
rowElements.push( /*#__PURE__*/e
|
|
3016
|
+
rowElements.push( /*#__PURE__*/e(RowRenderer, {
|
|
2991
3017
|
"aria-rowindex": headerRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1,
|
|
2992
3018
|
"aria-selected": isSelectable ? isRowSelected : undefined,
|
|
2993
3019
|
rowIdx: rowIdx,
|
|
@@ -3029,7 +3055,8 @@
|
|
|
3029
3055
|
templateRows += ` repeat(${summaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3030
3056
|
}
|
|
3031
3057
|
|
|
3032
|
-
|
|
3058
|
+
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== -2;
|
|
3059
|
+
return /*#__PURE__*/e("div", {
|
|
3033
3060
|
role: hasGroups ? 'treegrid' : 'grid',
|
|
3034
3061
|
"aria-label": ariaLabel,
|
|
3035
3062
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -3041,9 +3068,7 @@
|
|
|
3041
3068
|
style: { ...style,
|
|
3042
3069
|
gridTemplateRows: templateRows,
|
|
3043
3070
|
'--rdg-header-row-height': `${headerRowHeight}px`,
|
|
3044
|
-
'--rdg-grid-inline-size': `${totalColumnWidth}px`,
|
|
3045
3071
|
'--rdg-summary-row-height': `${summaryRowHeight}px`,
|
|
3046
|
-
'--rdg-grid-block-size': `${max(totalRowHeight, clientHeight) + headerRowHeight + summaryRowsCount * summaryRowHeight}px`,
|
|
3047
3072
|
'--rdg-sign': isRtl ? -1 : 1,
|
|
3048
3073
|
...getLayoutCssVars()
|
|
3049
3074
|
},
|
|
@@ -3052,18 +3077,18 @@
|
|
|
3052
3077
|
onScroll: handleScroll,
|
|
3053
3078
|
onKeyDown: handleKeyDown,
|
|
3054
3079
|
"data-testid": testId,
|
|
3055
|
-
children: [hasGroups && /*#__PURE__*/e
|
|
3080
|
+
children: [hasGroups && /*#__PURE__*/e("div", {
|
|
3056
3081
|
ref: rowRef,
|
|
3057
|
-
tabIndex:
|
|
3058
|
-
className: focusSinkClassname,
|
|
3082
|
+
tabIndex: isGroupRowFocused ? 0 : -1,
|
|
3083
|
+
className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell]),
|
|
3059
3084
|
style: {
|
|
3060
3085
|
gridRowStart: selectedPosition.rowIdx + 2
|
|
3061
3086
|
},
|
|
3062
3087
|
onKeyDown: handleKeyDown
|
|
3063
|
-
}), /*#__PURE__*/e
|
|
3088
|
+
}), /*#__PURE__*/e(DataGridDefaultComponentsProvider, {
|
|
3064
3089
|
value: defaultGridComponents,
|
|
3065
|
-
children: [/*#__PURE__*/e
|
|
3066
|
-
columns:
|
|
3090
|
+
children: [/*#__PURE__*/e(HeaderRow$1, {
|
|
3091
|
+
columns: getRowViewportColumns(-1),
|
|
3067
3092
|
onColumnResize: handleColumnResize,
|
|
3068
3093
|
allRowsSelected: allRowsSelected,
|
|
3069
3094
|
onAllRowsSelectionChange: selectAllRowsLatest,
|
|
@@ -3074,23 +3099,24 @@
|
|
|
3074
3099
|
selectCell: selectHeaderCellLatest,
|
|
3075
3100
|
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
3076
3101
|
direction: direction
|
|
3077
|
-
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/e
|
|
3078
|
-
children: [/*#__PURE__*/e
|
|
3102
|
+
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/e(d$1, {
|
|
3103
|
+
children: [/*#__PURE__*/e(RowSelectionChangeProvider, {
|
|
3079
3104
|
value: selectRowLatest,
|
|
3080
3105
|
children: getViewportRows()
|
|
3081
3106
|
}), summaryRows == null ? void 0 : summaryRows.map((row, rowIdx) => {
|
|
3082
3107
|
const gridRowStart = headerRowsCount + rows.length + rowIdx + 1;
|
|
3083
|
-
const
|
|
3108
|
+
const summaryRowIdx = headerRowsCount + rows.length + rowIdx - 1;
|
|
3109
|
+
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3084
3110
|
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (summaryRows.length - rowIdx) : undefined;
|
|
3085
3111
|
const bottom = top === undefined ? summaryRowHeight * (summaryRows.length - 1 - rowIdx) : undefined;
|
|
3086
|
-
return /*#__PURE__*/e
|
|
3112
|
+
return /*#__PURE__*/e(SummaryRow$1, {
|
|
3087
3113
|
"aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
|
|
3088
3114
|
rowIdx: rowIdx,
|
|
3089
3115
|
gridRowStart: gridRowStart,
|
|
3090
3116
|
row: row,
|
|
3091
3117
|
top: top,
|
|
3092
3118
|
bottom: bottom,
|
|
3093
|
-
viewportColumns:
|
|
3119
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3094
3120
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3095
3121
|
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3096
3122
|
selectCell: selectSummaryCellLatest
|
|
@@ -3107,39 +3133,17 @@
|
|
|
3107
3133
|
|
|
3108
3134
|
const DataGrid$1 = /*#__PURE__*/x(DataGrid);
|
|
3109
3135
|
|
|
3110
|
-
var css_248z$g = ".t16y9g8l700-
|
|
3136
|
+
var css_248z$g = ".t16y9g8l700-beta12{appearance:none;background-color:var(--rdg-background-color);block-size:100%;border:2px solid #ccc;box-sizing:border-box;color:var(--rdg-color);font-family:inherit;font-size:var(--rdg-font-size);inline-size:100%;padding-block:0;padding-inline:6px;vertical-align:top}.t16y9g8l700-beta12:focus{border-color:var(--rdg-selection-color);outline:none}.t16y9g8l700-beta12::placeholder{color:#999;opacity:1}";
|
|
3111
3137
|
styleInject$1(css_248z$g,{"insertAt":"top"});
|
|
3112
3138
|
|
|
3113
|
-
function
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3120
|
-
var style = document.createElement('style');
|
|
3121
|
-
style.type = 'text/css';
|
|
3122
|
-
|
|
3123
|
-
if (insertAt === 'top') {
|
|
3124
|
-
if (head.firstChild) {
|
|
3125
|
-
head.insertBefore(style, head.firstChild);
|
|
3126
|
-
} else {
|
|
3127
|
-
head.appendChild(style);
|
|
3128
|
-
}
|
|
3129
|
-
} else {
|
|
3130
|
-
head.appendChild(style);
|
|
3131
|
-
}
|
|
3132
|
-
|
|
3133
|
-
if (style.styleSheet) {
|
|
3134
|
-
style.styleSheet.cssText = css;
|
|
3135
|
-
} else {
|
|
3136
|
-
style.appendChild(document.createTextNode(css));
|
|
3137
|
-
}
|
|
3139
|
+
function useData(widget) {
|
|
3140
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3141
|
+
var columns = _(function () { return widget.columns(); }, [widget, widget.dataChecksum()]);
|
|
3142
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3143
|
+
var data = _(function () { return widget.data(); }, [widget, widget.dataChecksum()]);
|
|
3144
|
+
return [columns, data];
|
|
3138
3145
|
}
|
|
3139
3146
|
|
|
3140
|
-
var css_248z = ".dgrid2_Table .rdg{font-family:monospace,Courier New,Courier}.dgrid2_Table .rdg-checkbox-label .rdg-checkbox{block-size:16px;border-width:2px;box-shadow:inset 0 0 0 3px var(--rdg-background-color);inline-size:16px}";
|
|
3141
|
-
styleInject(css_248z);
|
|
3142
|
-
|
|
3143
3147
|
function copyAndSort(items, attribute, descending) {
|
|
3144
3148
|
var key = attribute;
|
|
3145
3149
|
return __spreadArray([], items, true).sort(function (a, b) {
|
|
@@ -3152,76 +3156,167 @@
|
|
|
3152
3156
|
return 0;
|
|
3153
3157
|
});
|
|
3154
3158
|
}
|
|
3159
|
+
var EmptyRowsRenderer = function (_a) {
|
|
3160
|
+
var message = _a.message;
|
|
3161
|
+
return v$1("div", { style: { textAlign: "center", gridColumn: "1/-1" } },
|
|
3162
|
+
message,
|
|
3163
|
+
v$1("span", null, "--- * --- * ---"));
|
|
3164
|
+
};
|
|
3155
3165
|
var ReactTable = function (_a) {
|
|
3156
|
-
var
|
|
3157
|
-
var
|
|
3158
|
-
var
|
|
3159
|
-
var
|
|
3160
|
-
var
|
|
3166
|
+
var table = _a.table, sort = _a.sort;
|
|
3167
|
+
var _b = useData(table), columns = _b[0], data = _b[1];
|
|
3168
|
+
var multiSelect = table.multiSelect();
|
|
3169
|
+
var columnTypes = table.columnTypes();
|
|
3170
|
+
var columnPatterns = table.columnPatterns();
|
|
3171
|
+
var columnFormats = table.columnFormats();
|
|
3172
|
+
var _c = m([]), listColumns = _c[0], setListColumns = _c[1];
|
|
3173
|
+
var _d = m(), sortColumn = _d[0], setSortColumn = _d[1];
|
|
3174
|
+
var _e = m([]), rows = _e[0], setRows = _e[1];
|
|
3175
|
+
var _f = m(new Set()), selectedRows = _f[0], setSelectedRows = _f[1];
|
|
3161
3176
|
// Columns ---
|
|
3162
3177
|
y(function () {
|
|
3163
|
-
setListColumns(__spreadArray(__spreadArray([], multiSelect ? [SelectColumn] : [], true), columns.map(function (column) {
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3178
|
+
setListColumns(__spreadArray(__spreadArray([], multiSelect ? [SelectColumn] : [], true), columns.map(function (column) {
|
|
3179
|
+
var _a;
|
|
3180
|
+
var type = (_a = columnTypes[column]) !== null && _a !== void 0 ? _a : "string";
|
|
3181
|
+
var formatter;
|
|
3182
|
+
var __hpcc_pattern;
|
|
3183
|
+
var __hpcc_format;
|
|
3184
|
+
switch (type) {
|
|
3185
|
+
case "time":
|
|
3186
|
+
__hpcc_pattern = columnPatterns[column] !== undefined ? common.timeParse(columnPatterns[column]) : undefined;
|
|
3187
|
+
__hpcc_format = columnFormats[column] !== undefined ? common.timeFormat(columnFormats[column]) : undefined;
|
|
3188
|
+
break;
|
|
3189
|
+
case "number":
|
|
3190
|
+
formatter = function (props) {
|
|
3191
|
+
return v$1("div", { style: { textAlign: "right" } }, props.row[props.column.key]);
|
|
3192
|
+
};
|
|
3193
|
+
// eslint-disable-next-line no-fallthrough
|
|
3194
|
+
default:
|
|
3195
|
+
__hpcc_format = columnFormats[column] !== undefined ? common.format(columnFormats[column]) : undefined;
|
|
3196
|
+
}
|
|
3197
|
+
return {
|
|
3198
|
+
key: column,
|
|
3199
|
+
name: column,
|
|
3200
|
+
resizable: true,
|
|
3201
|
+
sortable: true,
|
|
3202
|
+
minWidth: 80,
|
|
3203
|
+
formatter: formatter,
|
|
3204
|
+
__hpcc_pattern: __hpcc_pattern,
|
|
3205
|
+
__hpcc_format: __hpcc_format
|
|
3206
|
+
};
|
|
3207
|
+
}), true));
|
|
3208
|
+
}, [columnFormats, columnPatterns, columnTypes, columns, multiSelect]);
|
|
3171
3209
|
var onSortColumnsChange = A$1(function (sortColumns) {
|
|
3172
3210
|
var futureSortColumn = sortColumns.slice(-1)[0];
|
|
3173
3211
|
var sorted = futureSortColumn !== undefined;
|
|
3174
3212
|
var isSortedDescending = (futureSortColumn === null || futureSortColumn === void 0 ? void 0 : futureSortColumn.direction) === "DESC";
|
|
3175
3213
|
setSortColumn(futureSortColumn);
|
|
3176
|
-
|
|
3177
|
-
}, [
|
|
3214
|
+
setRows(copyAndSort(rows, sorted ? futureSortColumn.columnKey : "key", sorted ? isSortedDescending : false));
|
|
3215
|
+
}, [rows]);
|
|
3178
3216
|
var rowKeyGetter = A$1(function (row) {
|
|
3179
3217
|
return row.key;
|
|
3180
3218
|
}, []);
|
|
3181
3219
|
var onSelectedRowsChange = A$1(function (selectedRows) {
|
|
3182
3220
|
setSelectedRows(selectedRows);
|
|
3183
|
-
|
|
3184
|
-
}, [items, onRowClickCallback, rowKeyGetter]);
|
|
3221
|
+
}, []);
|
|
3185
3222
|
var onRowClick = A$1(function (row, column) {
|
|
3186
|
-
onRowClickCallback(
|
|
3187
|
-
}, [
|
|
3223
|
+
table.onRowClickCallback(row, column.key);
|
|
3224
|
+
}, [table]);
|
|
3188
3225
|
// Rows ---
|
|
3189
3226
|
y(function () {
|
|
3190
3227
|
var items = data.map(function (row, index) {
|
|
3191
3228
|
var retVal = {
|
|
3192
3229
|
key: index
|
|
3193
3230
|
};
|
|
3194
|
-
|
|
3195
|
-
|
|
3231
|
+
listColumns.forEach(function (column, index) {
|
|
3232
|
+
var val = row[index];
|
|
3233
|
+
if (column.__hpcc_pattern && column.__hpcc_format) {
|
|
3234
|
+
val = column.__hpcc_format(column.__hpcc_pattern(val));
|
|
3235
|
+
}
|
|
3236
|
+
else if (column.__hpcc_pattern) {
|
|
3237
|
+
val = column.__hpcc_pattern(val).toString();
|
|
3238
|
+
}
|
|
3239
|
+
else if (column.__hpcc_format) {
|
|
3240
|
+
val = column.__hpcc_format(val);
|
|
3241
|
+
}
|
|
3242
|
+
retVal[column.key] = val;
|
|
3196
3243
|
});
|
|
3197
3244
|
return retVal;
|
|
3198
3245
|
});
|
|
3199
3246
|
if (sort === null || sort === void 0 ? void 0 : sort.attribute) {
|
|
3200
3247
|
items = copyAndSort(items, sort.attribute, sort.descending);
|
|
3201
3248
|
}
|
|
3202
|
-
|
|
3203
|
-
}, [
|
|
3204
|
-
return
|
|
3249
|
+
setRows(items);
|
|
3250
|
+
}, [listColumns, data, sort]);
|
|
3251
|
+
return v$1(DataGrid$1, { columns: listColumns, headerRowHeight: 24, rows: rows, rowKeyGetter: rowKeyGetter, rowHeight: 20, components: { noRowsFallback: v$1(EmptyRowsRenderer, { message: table.noDataMessage() }) }, className: table.darkMode() ? "rdg-dark" : "rdg-light", sortColumns: sortColumn ? [sortColumn] : [], onSortColumnsChange: onSortColumnsChange, selectedRows: selectedRows, onSelectedRowsChange: multiSelect ? onSelectedRowsChange : undefined, onRowClick: multiSelect ? undefined : onRowClick, "aria-describedby": "", "aria-label": "", "aria-labelledby": "", style: { height: "100%" } });
|
|
3205
3252
|
};
|
|
3253
|
+
|
|
3254
|
+
function styleInject(css, ref) {
|
|
3255
|
+
if ( ref === void 0 ) ref = {};
|
|
3256
|
+
var insertAt = ref.insertAt;
|
|
3257
|
+
|
|
3258
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
3259
|
+
|
|
3260
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3261
|
+
var style = document.createElement('style');
|
|
3262
|
+
style.type = 'text/css';
|
|
3263
|
+
|
|
3264
|
+
if (insertAt === 'top') {
|
|
3265
|
+
if (head.firstChild) {
|
|
3266
|
+
head.insertBefore(style, head.firstChild);
|
|
3267
|
+
} else {
|
|
3268
|
+
head.appendChild(style);
|
|
3269
|
+
}
|
|
3270
|
+
} else {
|
|
3271
|
+
head.appendChild(style);
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
if (style.styleSheet) {
|
|
3275
|
+
style.styleSheet.cssText = css;
|
|
3276
|
+
} else {
|
|
3277
|
+
style.appendChild(document.createTextNode(css));
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3281
|
+
var css_248z = ".dgrid2_Table .rdg{font-family:monospace,Courier New,Courier}.dgrid2_Table .rdg-checkbox-label .rdg-checkbox{block-size:16px;border-width:2px;box-shadow:inset 0 0 0 3px var(--rdg-background-color);inline-size:16px}";
|
|
3282
|
+
styleInject(css_248z);
|
|
3283
|
+
|
|
3206
3284
|
var Table = /** @class */ (function (_super) {
|
|
3207
3285
|
__extends(Table, _super);
|
|
3208
3286
|
function Table() {
|
|
3209
3287
|
return _super.call(this) || this;
|
|
3210
3288
|
}
|
|
3211
|
-
Table.prototype.
|
|
3212
|
-
var
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3289
|
+
Table.prototype.columnType = function (column, type) {
|
|
3290
|
+
var _a;
|
|
3291
|
+
if (arguments.length === 1)
|
|
3292
|
+
return this.columnTypes()[column];
|
|
3293
|
+
this.columnTypes(__assign(__assign({}, this.columnTypes()), (_a = {}, _a[column] = type, _a)));
|
|
3294
|
+
return this;
|
|
3295
|
+
};
|
|
3296
|
+
Table.prototype.columnPattern = function (column, pattern) {
|
|
3297
|
+
var _a;
|
|
3298
|
+
if (arguments.length === 1)
|
|
3299
|
+
return this.columnPatterns()[column];
|
|
3300
|
+
this.columnPatterns(__assign(__assign({}, this.columnPatterns()), (_a = {}, _a[column] = pattern, _a)));
|
|
3301
|
+
return this;
|
|
3302
|
+
};
|
|
3303
|
+
Table.prototype.columnFormat = function (column, format) {
|
|
3304
|
+
var _a;
|
|
3305
|
+
if (arguments.length === 1)
|
|
3306
|
+
return this.columnFormats()[column];
|
|
3307
|
+
this.columnFormats(__assign(__assign({}, this.columnFormats()), (_a = {}, _a[column] = format, _a)));
|
|
3308
|
+
return this;
|
|
3309
|
+
};
|
|
3310
|
+
Table.prototype.onRowClickCallback = function (row, column) {
|
|
3311
|
+
var _a;
|
|
3312
|
+
if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {
|
|
3313
|
+
this.click(this._prevRow, (_a = this._prevColumn) !== null && _a !== void 0 ? _a : "", false);
|
|
3314
|
+
}
|
|
3315
|
+
if (row) {
|
|
3316
|
+
this.click(row, column, true);
|
|
3317
|
+
}
|
|
3318
|
+
this._prevRow = row;
|
|
3319
|
+
this._prevColumn = column;
|
|
3225
3320
|
};
|
|
3226
3321
|
Table.prototype.enter = function (domNode, element) {
|
|
3227
3322
|
_super.prototype.enter.call(this, domNode, element);
|
|
@@ -3232,7 +3327,7 @@
|
|
|
3232
3327
|
_super.prototype.update.call(this, domNode, element);
|
|
3233
3328
|
this._div.style("width", this.width() + "px");
|
|
3234
3329
|
this._div.style("height", this.height() + "px");
|
|
3235
|
-
B(this
|
|
3330
|
+
B(v$1(ReactTable, { table: this }), this._div.node());
|
|
3236
3331
|
};
|
|
3237
3332
|
Table.prototype.exit = function (domNode, element) {
|
|
3238
3333
|
un(this._div.node());
|
|
@@ -3242,6 +3337,10 @@
|
|
|
3242
3337
|
// Events ---
|
|
3243
3338
|
Table.prototype.click = function (row, col, sel) {
|
|
3244
3339
|
};
|
|
3340
|
+
__decorate([
|
|
3341
|
+
common.publish("...empty...", "string", "No Data Message"),
|
|
3342
|
+
__metadata("design:type", Function)
|
|
3343
|
+
], Table.prototype, "noDataMessage", void 0);
|
|
3245
3344
|
__decorate([
|
|
3246
3345
|
common.publish(false, "boolean", "Dark Mode"),
|
|
3247
3346
|
__metadata("design:type", Function)
|
|
@@ -3250,6 +3349,18 @@
|
|
|
3250
3349
|
common.publish(false, "boolean", "Multiple Selection"),
|
|
3251
3350
|
__metadata("design:type", Function)
|
|
3252
3351
|
], Table.prototype, "multiSelect", void 0);
|
|
3352
|
+
__decorate([
|
|
3353
|
+
common.publish({}, "object", "Column Types (\"boolean\" | \"number\" | \"string\" | \"time\""),
|
|
3354
|
+
__metadata("design:type", Function)
|
|
3355
|
+
], Table.prototype, "columnTypes", void 0);
|
|
3356
|
+
__decorate([
|
|
3357
|
+
common.publish({}, "object", "Column Patterns"),
|
|
3358
|
+
__metadata("design:type", Function)
|
|
3359
|
+
], Table.prototype, "columnPatterns", void 0);
|
|
3360
|
+
__decorate([
|
|
3361
|
+
common.publish({}, "object", "Column Formats"),
|
|
3362
|
+
__metadata("design:type", Function)
|
|
3363
|
+
], Table.prototype, "columnFormats", void 0);
|
|
3253
3364
|
return Table;
|
|
3254
3365
|
}(common.HTMLWidget));
|
|
3255
3366
|
Table.prototype._class += " dgrid2_Table";
|