@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.es6.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { publish, HTMLWidget } from '@hpcc-js/common';
|
|
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.1
|
|
5
|
-
var BUILD_VERSION = "2.103.
|
|
4
|
+
var PKG_VERSION = "2.2.1";
|
|
5
|
+
var BUILD_VERSION = "2.103.5";
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -35,6 +35,17 @@ function __extends(d, b) {
|
|
|
35
35
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36
36
|
}
|
|
37
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
|
+
|
|
38
49
|
function __decorate(decorators, target, key, desc) {
|
|
39
50
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
40
51
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -58,9 +69,7 @@ function __spreadArray(to, from, pack) {
|
|
|
58
69
|
|
|
59
70
|
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;
|
|
60
71
|
|
|
61
|
-
var o$1=0
|
|
62
|
-
|
|
63
|
-
var t,u,r,o=0,i=[],c=l$1.__b,f=l$1.__r,e=l$1.diffed,a=l$1.__c,v=l$1.unmount;function l(t,r){l$1.__h&&l$1.__h(u,t,o||r),o=0;var i=u.__H||(u.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function m(n){return o=1,p(w$1,n)}function p(n,r,o){var i=l(t++,2);return i.t=n,i.__c||(i.__=[o?o(r):w$1(void 0,r),function(n){var t=i.t(i.__[0],n);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}));}],i.__c=u),i.__}function y(r,o){var i=l(t++,3);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__H.__h.push(i));}function d(r,o){var i=l(t++,4);!l$1.__s&&k(i.__H,o)&&(i.__=r,i.__H=o,u.__h.push(i));}function h(n){return o=5,_(function(){return {current:n}},[])}function s(n,t,u){o=6,d(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==u?u:u.concat(n));}function _(n,u){var r=l(t++,7);return k(r.__H,u)&&(r.__=n(),r.__H=u,r.__h=n),r.__}function A$1(n,t){return o=8,_(function(){return n},t)}function F(n){var r=u.context[n.__c],o=l(t++,9);return o.c=n,r?(null==o.__&&(o.__=!0,r.sub(u)),r.props.value):n.__}function x$1(){for(var t;t=i.shift();)if(t.__P)try{t.__H.__h.forEach(g$1),t.__H.__h.forEach(j$1),t.__H.__h=[];}catch(u){t.__H.__h=[],l$1.__e(u,t.__v);}}l$1.__b=function(n){u=null,c&&c(n);},l$1.__r=function(n){f&&f(n),t=0;var r=(u=n.__c).__H;r&&(r.__h.forEach(g$1),r.__h.forEach(j$1),r.__h=[]);},l$1.diffed=function(t){e&&e(t);var o=t.__c;o&&o.__H&&o.__H.__h.length&&(1!==i.push(o)&&r===l$1.requestAnimationFrame||((r=l$1.requestAnimationFrame)||function(n){var t,u=function(){clearTimeout(r),b&&cancelAnimationFrame(t),setTimeout(n);},r=setTimeout(u,100);b&&(t=requestAnimationFrame(u));})(x$1)),u=null;},l$1.__c=function(t,u){u.some(function(t){try{t.__h.forEach(g$1),t.__h=t.__h.filter(function(n){return !n.__||j$1(n)});}catch(r){u.some(function(n){n.__h&&(n.__h=[]);}),u=[],l$1.__e(r,t.__v);}}),a&&a(t,u);},l$1.unmount=function(t){v&&v(t);var u,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{g$1(n);}catch(n){u=n;}}),u&&l$1.__e(u,r.__v));};var b="function"==typeof requestAnimationFrame;function g$1(n){var t=u,r=n.__c;"function"==typeof r&&(n.__c=void 0,r()),u=t;}function j$1(n){var t=u;n.__c=n.__(),u=t;}function k(n,t){return !n||n.length!==t.length||t.some(function(t,u){return t!==n[u]})}function w$1(n,t){return "function"==typeof t?t(n):t}
|
|
72
|
+
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}
|
|
64
73
|
|
|
65
74
|
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)}
|
|
66
75
|
|
|
@@ -105,6 +114,8 @@ function clsx () {
|
|
|
105
114
|
return str;
|
|
106
115
|
}
|
|
107
116
|
|
|
117
|
+
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}
|
|
118
|
+
|
|
108
119
|
function styleInject$1(css, ref) {
|
|
109
120
|
if ( ref === void 0 ) ref = {};
|
|
110
121
|
var insertAt = ref.insertAt;
|
|
@@ -132,44 +143,45 @@ function styleInject$1(css, ref) {
|
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
|
|
135
|
-
var css_248z$f = ".c1wupbe700-
|
|
146
|
+
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)}";
|
|
136
147
|
styleInject$1(css_248z$f,{"insertAt":"top"});
|
|
137
148
|
|
|
138
|
-
const cell = "c1wupbe700-
|
|
149
|
+
const cell = "c1wupbe700-beta12";
|
|
139
150
|
const cellClassname = `rdg-cell ${cell}`;
|
|
140
|
-
const cellAutoResizeClassname = "cd0kgiy700-
|
|
141
|
-
const cellFrozen = "c1730fa4700-
|
|
151
|
+
const cellAutoResizeClassname = "cd0kgiy700-beta12";
|
|
152
|
+
const cellFrozen = "c1730fa4700-beta12";
|
|
142
153
|
const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
143
|
-
const cellFrozenLast = "c9dpaye700-
|
|
154
|
+
const cellFrozenLast = "c9dpaye700-beta12";
|
|
144
155
|
const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
|
|
145
156
|
|
|
146
|
-
var css_248z$e = ".r104f42s700-
|
|
157
|
+
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}";
|
|
147
158
|
styleInject$1(css_248z$e,{"insertAt":"top"});
|
|
148
159
|
|
|
149
|
-
const root = "r104f42s700-
|
|
160
|
+
const root = "r104f42s700-beta12";
|
|
150
161
|
const rootClassname = `rdg ${root}`;
|
|
151
|
-
const viewportDragging = "v7ly7s700-
|
|
162
|
+
const viewportDragging = "v7ly7s700-beta12";
|
|
152
163
|
const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
|
|
153
|
-
const focusSinkClassname = "fc4f4zb700-
|
|
164
|
+
const focusSinkClassname = "fc4f4zb700-beta12";
|
|
154
165
|
|
|
155
|
-
var css_248z$d = ".r1otpg64700-
|
|
166
|
+
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}";
|
|
156
167
|
styleInject$1(css_248z$d,{"insertAt":"top"});
|
|
157
168
|
|
|
158
|
-
const row = "r1otpg64700-
|
|
169
|
+
const row = "r1otpg64700-beta12";
|
|
159
170
|
const rowClassname = `rdg-row ${row}`;
|
|
160
|
-
const rowSelected = "rel5gk2700-
|
|
161
|
-
const rowSelectedClassname = `rdg-row-selected
|
|
171
|
+
const rowSelected = "rel5gk2700-beta12";
|
|
172
|
+
const rowSelectedClassname = `rdg-row-selected`;
|
|
173
|
+
const rowSelectedWithFrozenCell = "r1qymf1z700-beta12";
|
|
162
174
|
|
|
163
|
-
var css_248z$c = ".cd9l4jz700-
|
|
175
|
+
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)}";
|
|
164
176
|
styleInject$1(css_248z$c,{"insertAt":"top"});
|
|
165
177
|
|
|
166
|
-
const checkboxLabel = "cd9l4jz700-
|
|
178
|
+
const checkboxLabel = "cd9l4jz700-beta12";
|
|
167
179
|
const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
|
|
168
|
-
const checkboxInput = "c1noyk41700-
|
|
180
|
+
const checkboxInput = "c1noyk41700-beta12";
|
|
169
181
|
const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
|
|
170
|
-
const checkbox = "cdwjxv8700-
|
|
182
|
+
const checkbox = "cdwjxv8700-beta12";
|
|
171
183
|
const checkboxClassname = `rdg-checkbox ${checkbox}`;
|
|
172
|
-
const checkboxLabelDisabled = "cca4mwn700-
|
|
184
|
+
const checkboxLabelDisabled = "cca4mwn700-beta12";
|
|
173
185
|
const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
|
|
174
186
|
const CheckboxFormatter = /*#__PURE__*/x(function CheckboxFormatter({
|
|
175
187
|
onChange,
|
|
@@ -179,15 +191,15 @@ const CheckboxFormatter = /*#__PURE__*/x(function CheckboxFormatter({
|
|
|
179
191
|
onChange(e.target.checked, e.nativeEvent.shiftKey);
|
|
180
192
|
}
|
|
181
193
|
|
|
182
|
-
return /*#__PURE__*/e
|
|
194
|
+
return /*#__PURE__*/e("label", {
|
|
183
195
|
className: clsx(checkboxLabelClassname, props.disabled && checkboxLabelDisabledClassname),
|
|
184
|
-
children: [/*#__PURE__*/e
|
|
196
|
+
children: [/*#__PURE__*/e("input", {
|
|
185
197
|
type: "checkbox",
|
|
186
198
|
ref: ref,
|
|
187
199
|
...props,
|
|
188
200
|
className: checkboxInputClassname,
|
|
189
201
|
onChange: handleChange
|
|
190
|
-
}), /*#__PURE__*/e
|
|
202
|
+
}), /*#__PURE__*/e("div", {
|
|
191
203
|
className: checkboxClassname
|
|
192
204
|
})]
|
|
193
205
|
});
|
|
@@ -230,7 +242,7 @@ function SelectCellFormatter({
|
|
|
230
242
|
tabIndex
|
|
231
243
|
} = useFocusRef(isCellSelected);
|
|
232
244
|
const Formatter = useDefaultComponents().checkboxFormatter;
|
|
233
|
-
return /*#__PURE__*/e
|
|
245
|
+
return /*#__PURE__*/e(Formatter, {
|
|
234
246
|
"aria-label": ariaLabel,
|
|
235
247
|
"aria-labelledby": ariaLabelledBy,
|
|
236
248
|
ref: ref,
|
|
@@ -243,7 +255,7 @@ function SelectCellFormatter({
|
|
|
243
255
|
|
|
244
256
|
function ValueFormatter(props) {
|
|
245
257
|
try {
|
|
246
|
-
return /*#__PURE__*/e
|
|
258
|
+
return /*#__PURE__*/e(d$1, {
|
|
247
259
|
children: props.row[props.column.key]
|
|
248
260
|
});
|
|
249
261
|
} catch {
|
|
@@ -251,12 +263,12 @@ function ValueFormatter(props) {
|
|
|
251
263
|
}
|
|
252
264
|
}
|
|
253
265
|
|
|
254
|
-
var css_248z$b = ".gch972y700-
|
|
266
|
+
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}";
|
|
255
267
|
styleInject$1(css_248z$b,{"insertAt":"top"});
|
|
256
268
|
|
|
257
|
-
const groupCellContent = "gch972y700-
|
|
269
|
+
const groupCellContent = "gch972y700-beta12";
|
|
258
270
|
const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
|
|
259
|
-
const caret = "cz2qf0d700-
|
|
271
|
+
const caret = "cz2qf0d700-beta12";
|
|
260
272
|
const caretClassname = `rdg-caret ${caret}`;
|
|
261
273
|
function ToggleGroupFormatter({
|
|
262
274
|
groupKey,
|
|
@@ -278,18 +290,18 @@ function ToggleGroupFormatter({
|
|
|
278
290
|
}
|
|
279
291
|
|
|
280
292
|
const d = isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7';
|
|
281
|
-
return /*#__PURE__*/e
|
|
293
|
+
return /*#__PURE__*/e("span", {
|
|
282
294
|
ref: ref,
|
|
283
295
|
className: groupCellContentClassname,
|
|
284
296
|
tabIndex: tabIndex,
|
|
285
297
|
onKeyDown: handleKeyDown,
|
|
286
|
-
children: [groupKey, /*#__PURE__*/e
|
|
298
|
+
children: [groupKey, /*#__PURE__*/e("svg", {
|
|
287
299
|
viewBox: "0 0 14 8",
|
|
288
300
|
width: "14",
|
|
289
301
|
height: "8",
|
|
290
302
|
className: caretClassname,
|
|
291
303
|
"aria-hidden": true,
|
|
292
|
-
children: /*#__PURE__*/e
|
|
304
|
+
children: /*#__PURE__*/e("path", {
|
|
293
305
|
d: d
|
|
294
306
|
})
|
|
295
307
|
})]
|
|
@@ -315,7 +327,7 @@ const SELECT_COLUMN_KEY = 'select-row';
|
|
|
315
327
|
|
|
316
328
|
function SelectFormatter(props) {
|
|
317
329
|
const [isRowSelected, onRowSelectionChange] = useRowSelection();
|
|
318
|
-
return /*#__PURE__*/e
|
|
330
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
319
331
|
"aria-label": "Select",
|
|
320
332
|
isCellSelected: props.isCellSelected,
|
|
321
333
|
value: isRowSelected,
|
|
@@ -331,7 +343,7 @@ function SelectFormatter(props) {
|
|
|
331
343
|
|
|
332
344
|
function SelectGroupFormatter(props) {
|
|
333
345
|
const [isRowSelected, onRowSelectionChange] = useRowSelection();
|
|
334
|
-
return /*#__PURE__*/e
|
|
346
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
335
347
|
"aria-label": "Select Group",
|
|
336
348
|
isCellSelected: props.isCellSelected,
|
|
337
349
|
value: isRowSelected,
|
|
@@ -349,13 +361,14 @@ const SelectColumn = {
|
|
|
349
361
|
key: SELECT_COLUMN_KEY,
|
|
350
362
|
name: '',
|
|
351
363
|
width: 35,
|
|
364
|
+
minWidth: 35,
|
|
352
365
|
maxWidth: 35,
|
|
353
366
|
resizable: false,
|
|
354
367
|
sortable: false,
|
|
355
368
|
frozen: true,
|
|
356
369
|
|
|
357
370
|
headerRenderer(props) {
|
|
358
|
-
return /*#__PURE__*/e
|
|
371
|
+
return /*#__PURE__*/e(SelectCellFormatter, {
|
|
359
372
|
"aria-label": "Select All",
|
|
360
373
|
isCellSelected: props.isCellSelected,
|
|
361
374
|
value: props.allRowsSelected,
|
|
@@ -553,19 +566,6 @@ function canExitGrid({
|
|
|
553
566
|
return false;
|
|
554
567
|
}
|
|
555
568
|
|
|
556
|
-
const {
|
|
557
|
-
min,
|
|
558
|
-
max,
|
|
559
|
-
round,
|
|
560
|
-
floor,
|
|
561
|
-
sign,
|
|
562
|
-
abs
|
|
563
|
-
} = Math;
|
|
564
|
-
function assertIsValidKeyGetter(keyGetter) {
|
|
565
|
-
if (typeof keyGetter !== 'function') {
|
|
566
|
-
throw new Error('Please specify the rowKeyGetter prop to use selection');
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
569
|
function getRowStyle(rowIdx, height) {
|
|
570
570
|
if (height !== undefined) {
|
|
571
571
|
return {
|
|
@@ -589,6 +589,33 @@ function getCellClassname(column, ...extraClasses) {
|
|
|
589
589
|
return clsx(cellClassname, ...extraClasses, column.frozen && cellFrozenClassname, column.isLastFrozenColumn && cellFrozenLastClassname);
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
+
const {
|
|
593
|
+
min,
|
|
594
|
+
max,
|
|
595
|
+
round,
|
|
596
|
+
floor,
|
|
597
|
+
sign,
|
|
598
|
+
abs,
|
|
599
|
+
ceil
|
|
600
|
+
} = Math;
|
|
601
|
+
function assertIsValidKeyGetter(keyGetter) {
|
|
602
|
+
if (typeof keyGetter !== 'function') {
|
|
603
|
+
throw new Error('Please specify the rowKeyGetter prop to use selection');
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
function clampColumnWidth(width, {
|
|
607
|
+
minWidth,
|
|
608
|
+
maxWidth
|
|
609
|
+
}) {
|
|
610
|
+
width = max(width, minWidth);
|
|
611
|
+
|
|
612
|
+
if (typeof maxWidth === 'number' && maxWidth > minWidth) {
|
|
613
|
+
return min(width, maxWidth);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return width;
|
|
617
|
+
}
|
|
618
|
+
|
|
592
619
|
function useCalculatedColumns({
|
|
593
620
|
rawColumns,
|
|
594
621
|
columnWidths,
|
|
@@ -600,7 +627,9 @@ function useCalculatedColumns({
|
|
|
600
627
|
}) {
|
|
601
628
|
var _defaultColumnOptions, _defaultColumnOptions2, _defaultColumnOptions3, _defaultColumnOptions4;
|
|
602
629
|
|
|
603
|
-
const
|
|
630
|
+
const defaultWidth = defaultColumnOptions == null ? void 0 : defaultColumnOptions.width;
|
|
631
|
+
const defaultMinWidth = (_defaultColumnOptions = defaultColumnOptions == null ? void 0 : defaultColumnOptions.minWidth) != null ? _defaultColumnOptions : 80;
|
|
632
|
+
const defaultMaxWidth = defaultColumnOptions == null ? void 0 : defaultColumnOptions.maxWidth;
|
|
604
633
|
const defaultFormatter = (_defaultColumnOptions2 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.formatter) != null ? _defaultColumnOptions2 : ValueFormatter;
|
|
605
634
|
const defaultSortable = (_defaultColumnOptions3 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.sortable) != null ? _defaultColumnOptions3 : false;
|
|
606
635
|
const defaultResizable = (_defaultColumnOptions4 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.resizable) != null ? _defaultColumnOptions4 : false;
|
|
@@ -613,7 +642,7 @@ function useCalculatedColumns({
|
|
|
613
642
|
const groupBy = [];
|
|
614
643
|
let lastFrozenColumnIndex = -1;
|
|
615
644
|
const columns = rawColumns.map(rawColumn => {
|
|
616
|
-
var _rawGroupBy$includes, _rawColumn$sortable, _rawColumn$resizable, _rawColumn$formatter;
|
|
645
|
+
var _rawGroupBy$includes, _rawColumn$width, _rawColumn$minWidth, _rawColumn$maxWidth, _rawColumn$sortable, _rawColumn$resizable, _rawColumn$formatter;
|
|
617
646
|
|
|
618
647
|
const rowGroup = (_rawGroupBy$includes = rawGroupBy == null ? void 0 : rawGroupBy.includes(rawColumn.key)) != null ? _rawGroupBy$includes : false;
|
|
619
648
|
const frozen = rowGroup || rawColumn.frozen || false;
|
|
@@ -622,6 +651,9 @@ function useCalculatedColumns({
|
|
|
622
651
|
frozen,
|
|
623
652
|
isLastFrozenColumn: false,
|
|
624
653
|
rowGroup,
|
|
654
|
+
width: (_rawColumn$width = rawColumn.width) != null ? _rawColumn$width : defaultWidth,
|
|
655
|
+
minWidth: (_rawColumn$minWidth = rawColumn.minWidth) != null ? _rawColumn$minWidth : defaultMinWidth,
|
|
656
|
+
maxWidth: (_rawColumn$maxWidth = rawColumn.maxWidth) != null ? _rawColumn$maxWidth : defaultMaxWidth,
|
|
625
657
|
sortable: (_rawColumn$sortable = rawColumn.sortable) != null ? _rawColumn$sortable : defaultSortable,
|
|
626
658
|
resizable: (_rawColumn$resizable = rawColumn.resizable) != null ? _rawColumn$resizable : defaultResizable,
|
|
627
659
|
formatter: (_rawColumn$formatter = rawColumn.formatter) != null ? _rawColumn$formatter : defaultFormatter
|
|
@@ -690,16 +722,14 @@ function useCalculatedColumns({
|
|
|
690
722
|
lastFrozenColumnIndex,
|
|
691
723
|
groupBy
|
|
692
724
|
};
|
|
693
|
-
}, [rawColumns, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
725
|
+
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
694
726
|
const {
|
|
695
727
|
layoutCssVars,
|
|
696
|
-
totalColumnWidth,
|
|
697
728
|
totalFrozenColumnWidth,
|
|
698
729
|
columnMetrics
|
|
699
730
|
} = _(() => {
|
|
700
731
|
const columnMetrics = new Map();
|
|
701
732
|
let left = 0;
|
|
702
|
-
let totalColumnWidth = 0;
|
|
703
733
|
let totalFrozenColumnWidth = 0;
|
|
704
734
|
let templateColumns = '';
|
|
705
735
|
let allocatedWidth = 0;
|
|
@@ -711,7 +741,7 @@ function useCalculatedColumns({
|
|
|
711
741
|
if (width === undefined) {
|
|
712
742
|
unassignedColumnsCount++;
|
|
713
743
|
} else {
|
|
714
|
-
width = clampColumnWidth(width, column
|
|
744
|
+
width = clampColumnWidth(width, column);
|
|
715
745
|
allocatedWidth += width;
|
|
716
746
|
columnMetrics.set(column, {
|
|
717
747
|
width,
|
|
@@ -732,7 +762,7 @@ function useCalculatedColumns({
|
|
|
732
762
|
} else {
|
|
733
763
|
const unallocatedWidth = viewportWidth - allocatedWidth;
|
|
734
764
|
const unallocatedColumnWidth = round(unallocatedWidth / unassignedColumnsCount);
|
|
735
|
-
width = clampColumnWidth(unallocatedColumnWidth, column
|
|
765
|
+
width = clampColumnWidth(unallocatedColumnWidth, column);
|
|
736
766
|
allocatedWidth += width;
|
|
737
767
|
unassignedColumnsCount--;
|
|
738
768
|
columnMetrics.set(column, {
|
|
@@ -741,7 +771,6 @@ function useCalculatedColumns({
|
|
|
741
771
|
});
|
|
742
772
|
}
|
|
743
773
|
|
|
744
|
-
totalColumnWidth += width;
|
|
745
774
|
left += width;
|
|
746
775
|
templateColumns += `${width}px `;
|
|
747
776
|
}
|
|
@@ -762,11 +791,10 @@ function useCalculatedColumns({
|
|
|
762
791
|
|
|
763
792
|
return {
|
|
764
793
|
layoutCssVars,
|
|
765
|
-
totalColumnWidth,
|
|
766
794
|
totalFrozenColumnWidth,
|
|
767
795
|
columnMetrics
|
|
768
796
|
};
|
|
769
|
-
}, [columnWidths, columns, viewportWidth,
|
|
797
|
+
}, [columnWidths, columns, viewportWidth, lastFrozenColumnIndex]);
|
|
770
798
|
const [colOverscanStartIdx, colOverscanEndIdx] = _(() => {
|
|
771
799
|
if (!enableVirtualization) {
|
|
772
800
|
return [0, columns.length - 1];
|
|
@@ -822,7 +850,6 @@ function useCalculatedColumns({
|
|
|
822
850
|
colOverscanEndIdx,
|
|
823
851
|
layoutCssVars,
|
|
824
852
|
columnMetrics,
|
|
825
|
-
totalColumnWidth,
|
|
826
853
|
lastFrozenColumnIndex,
|
|
827
854
|
totalFrozenColumnWidth,
|
|
828
855
|
groupBy
|
|
@@ -848,42 +875,44 @@ function getSpecifiedWidth({
|
|
|
848
875
|
return undefined;
|
|
849
876
|
}
|
|
850
877
|
|
|
851
|
-
function clampColumnWidth(width, {
|
|
852
|
-
minWidth,
|
|
853
|
-
maxWidth
|
|
854
|
-
}, minColumnWidth) {
|
|
855
|
-
width = max(width, minWidth != null ? minWidth : minColumnWidth);
|
|
856
|
-
|
|
857
|
-
if (typeof maxWidth === 'number') {
|
|
858
|
-
return min(width, maxWidth);
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
return width;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
878
|
function useGridDimensions() {
|
|
865
879
|
const gridRef = h(null);
|
|
866
|
-
const [
|
|
867
|
-
const [
|
|
880
|
+
const [inlineSize, setInlineSize] = m(1);
|
|
881
|
+
const [blockSize, setBlockSize] = m(1);
|
|
868
882
|
useLayoutEffect(() => {
|
|
869
883
|
const {
|
|
870
884
|
ResizeObserver
|
|
871
885
|
} = window;
|
|
872
886
|
if (ResizeObserver == null) return;
|
|
873
|
-
const
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
887
|
+
const {
|
|
888
|
+
clientWidth,
|
|
889
|
+
clientHeight,
|
|
890
|
+
offsetWidth,
|
|
891
|
+
offsetHeight
|
|
892
|
+
} = gridRef.current;
|
|
893
|
+
const {
|
|
894
|
+
width,
|
|
895
|
+
height
|
|
896
|
+
} = gridRef.current.getBoundingClientRect();
|
|
897
|
+
const initialWidth = width - offsetWidth + clientWidth;
|
|
898
|
+
const initialHeight = height - offsetHeight + clientHeight;
|
|
899
|
+
setInlineSize(handleDevicePixelRatio(initialWidth));
|
|
900
|
+
setBlockSize(initialHeight);
|
|
901
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
902
|
+
const size = entries[0].contentBoxSize[0];
|
|
903
|
+
setInlineSize(handleDevicePixelRatio(size.inlineSize));
|
|
904
|
+
setBlockSize(size.blockSize);
|
|
880
905
|
});
|
|
881
906
|
resizeObserver.observe(gridRef.current);
|
|
882
907
|
return () => {
|
|
883
908
|
resizeObserver.disconnect();
|
|
884
909
|
};
|
|
885
910
|
}, []);
|
|
886
|
-
return [gridRef,
|
|
911
|
+
return [gridRef, inlineSize, blockSize];
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function handleDevicePixelRatio(size) {
|
|
915
|
+
return size - (devicePixelRatio === 1 ? 0 : ceil(devicePixelRatio));
|
|
887
916
|
}
|
|
888
917
|
|
|
889
918
|
function useLatestFunc(fn) {
|
|
@@ -897,38 +926,30 @@ function useLatestFunc(fn) {
|
|
|
897
926
|
}
|
|
898
927
|
|
|
899
928
|
function useRovingCellRef(isSelected) {
|
|
900
|
-
const
|
|
901
|
-
const isChildFocused = h(false);
|
|
902
|
-
const [, forceRender] = m({});
|
|
903
|
-
useLayoutEffect(() => {
|
|
904
|
-
var _ref$current;
|
|
929
|
+
const [isChildFocused, setIsChildFocused] = m(false);
|
|
905
930
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
if (isChildFocused.current) {
|
|
912
|
-
forceRender({});
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
931
|
+
if (isChildFocused && !isSelected) {
|
|
932
|
+
setIsChildFocused(false);
|
|
933
|
+
}
|
|
915
934
|
|
|
916
|
-
|
|
935
|
+
const ref = A$1(cell => {
|
|
936
|
+
if (cell === null || cell.contains(document.activeElement)) return;
|
|
937
|
+
cell.focus({
|
|
917
938
|
preventScroll: true
|
|
918
939
|
});
|
|
919
|
-
}, [
|
|
940
|
+
}, []);
|
|
920
941
|
|
|
921
942
|
function onFocus(event) {
|
|
922
|
-
if (event.target !==
|
|
923
|
-
|
|
943
|
+
if (event.target !== event.currentTarget) {
|
|
944
|
+
setIsChildFocused(true);
|
|
924
945
|
}
|
|
925
946
|
}
|
|
926
947
|
|
|
927
|
-
const isFocused = isSelected && !isChildFocused
|
|
948
|
+
const isFocused = isSelected && !isChildFocused;
|
|
928
949
|
return {
|
|
929
|
-
ref,
|
|
950
|
+
ref: isSelected ? ref : undefined,
|
|
930
951
|
tabIndex: isFocused ? 0 : -1,
|
|
931
|
-
onFocus
|
|
952
|
+
onFocus: isSelected ? onFocus : undefined
|
|
932
953
|
};
|
|
933
954
|
}
|
|
934
955
|
|
|
@@ -1184,12 +1205,12 @@ function useViewportRows({
|
|
|
1184
1205
|
};
|
|
1185
1206
|
}
|
|
1186
1207
|
|
|
1187
|
-
var css_248z$a = ".h1tr5c9i700-
|
|
1208
|
+
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}";
|
|
1188
1209
|
styleInject$1(css_248z$a,{"insertAt":"top"});
|
|
1189
1210
|
|
|
1190
|
-
const headerSortCell = "h1tr5c9i700-
|
|
1211
|
+
const headerSortCell = "h1tr5c9i700-beta12";
|
|
1191
1212
|
const headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;
|
|
1192
|
-
const headerSortName = "h19r0msv700-
|
|
1213
|
+
const headerSortName = "h19r0msv700-beta12";
|
|
1193
1214
|
const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1194
1215
|
function HeaderRenderer({
|
|
1195
1216
|
column,
|
|
@@ -1198,10 +1219,10 @@ function HeaderRenderer({
|
|
|
1198
1219
|
onSort,
|
|
1199
1220
|
isCellSelected
|
|
1200
1221
|
}) {
|
|
1201
|
-
if (!column.sortable) return /*#__PURE__*/e
|
|
1222
|
+
if (!column.sortable) return /*#__PURE__*/e(d$1, {
|
|
1202
1223
|
children: column.name
|
|
1203
1224
|
});
|
|
1204
|
-
return /*#__PURE__*/e
|
|
1225
|
+
return /*#__PURE__*/e(SortableHeaderCell, {
|
|
1205
1226
|
onSort: onSort,
|
|
1206
1227
|
sortDirection: sortDirection,
|
|
1207
1228
|
priority: priority,
|
|
@@ -1234,27 +1255,27 @@ function SortableHeaderCell({
|
|
|
1234
1255
|
onSort(event.ctrlKey || event.metaKey);
|
|
1235
1256
|
}
|
|
1236
1257
|
|
|
1237
|
-
return /*#__PURE__*/e
|
|
1258
|
+
return /*#__PURE__*/e("span", {
|
|
1238
1259
|
ref: ref,
|
|
1239
1260
|
tabIndex: tabIndex,
|
|
1240
1261
|
className: headerSortCellClassname,
|
|
1241
1262
|
onClick: handleClick,
|
|
1242
1263
|
onKeyDown: handleKeyDown,
|
|
1243
|
-
children: [/*#__PURE__*/e
|
|
1264
|
+
children: [/*#__PURE__*/e("span", {
|
|
1244
1265
|
className: headerSortNameClassname,
|
|
1245
1266
|
children: children
|
|
1246
|
-
}), /*#__PURE__*/e
|
|
1247
|
-
children: [/*#__PURE__*/e
|
|
1267
|
+
}), /*#__PURE__*/e("span", {
|
|
1268
|
+
children: [/*#__PURE__*/e(SortIcon, {
|
|
1248
1269
|
sortDirection: sortDirection
|
|
1249
1270
|
}), priority]
|
|
1250
1271
|
})]
|
|
1251
1272
|
});
|
|
1252
1273
|
}
|
|
1253
1274
|
|
|
1254
|
-
var css_248z$9 = ".celq7o9700-
|
|
1275
|
+
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}";
|
|
1255
1276
|
styleInject$1(css_248z$9,{"insertAt":"top"});
|
|
1256
1277
|
|
|
1257
|
-
const cellResizable = "celq7o9700-
|
|
1278
|
+
const cellResizable = "celq7o9700-beta12";
|
|
1258
1279
|
const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
|
|
1259
1280
|
function HeaderCell({
|
|
1260
1281
|
column,
|
|
@@ -1269,7 +1290,7 @@ function HeaderCell({
|
|
|
1269
1290
|
shouldFocusGrid,
|
|
1270
1291
|
direction
|
|
1271
1292
|
}) {
|
|
1272
|
-
var _column$headerRendere, _column$
|
|
1293
|
+
var _column$headerRendere, _column$maxWidth;
|
|
1273
1294
|
|
|
1274
1295
|
const isRtl = direction === 'rtl';
|
|
1275
1296
|
const {
|
|
@@ -1312,7 +1333,7 @@ function HeaderCell({
|
|
|
1312
1333
|
const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
|
|
1313
1334
|
|
|
1314
1335
|
if (width > 0) {
|
|
1315
|
-
onColumnResize(column, width);
|
|
1336
|
+
onColumnResize(column, clampColumnWidth(width, column));
|
|
1316
1337
|
}
|
|
1317
1338
|
}
|
|
1318
1339
|
|
|
@@ -1383,14 +1404,14 @@ function HeaderCell({
|
|
|
1383
1404
|
}
|
|
1384
1405
|
|
|
1385
1406
|
function handleFocus(event) {
|
|
1386
|
-
onFocus(event);
|
|
1407
|
+
onFocus == null ? void 0 : onFocus(event);
|
|
1387
1408
|
|
|
1388
1409
|
if (shouldFocusGrid) {
|
|
1389
1410
|
selectCell(0);
|
|
1390
1411
|
}
|
|
1391
1412
|
}
|
|
1392
1413
|
|
|
1393
|
-
return /*#__PURE__*/e
|
|
1414
|
+
return /*#__PURE__*/e("div", {
|
|
1394
1415
|
role: "columnheader",
|
|
1395
1416
|
"aria-colindex": column.idx + 1,
|
|
1396
1417
|
"aria-selected": isCellSelected,
|
|
@@ -1400,14 +1421,14 @@ function HeaderCell({
|
|
|
1400
1421
|
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1401
1422
|
className: className,
|
|
1402
1423
|
style: { ...getCellStyle(column, colSpan),
|
|
1403
|
-
minWidth:
|
|
1424
|
+
minWidth: column.minWidth,
|
|
1404
1425
|
maxWidth: (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : undefined
|
|
1405
1426
|
},
|
|
1406
1427
|
onFocus: handleFocus,
|
|
1407
1428
|
onClick: onClick,
|
|
1408
1429
|
onDoubleClick: column.resizable ? onDoubleClick : undefined,
|
|
1409
1430
|
onPointerDown: column.resizable ? onPointerDown : undefined,
|
|
1410
|
-
children: /*#__PURE__*/e
|
|
1431
|
+
children: /*#__PURE__*/e(HeaderRenderer$1, {
|
|
1411
1432
|
column: column,
|
|
1412
1433
|
sortDirection: sortDirection,
|
|
1413
1434
|
priority: priority,
|
|
@@ -1419,10 +1440,10 @@ function HeaderCell({
|
|
|
1419
1440
|
});
|
|
1420
1441
|
}
|
|
1421
1442
|
|
|
1422
|
-
var css_248z$8 = ".h197vzie700-
|
|
1443
|
+
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}";
|
|
1423
1444
|
styleInject$1(css_248z$8,{"insertAt":"top"});
|
|
1424
1445
|
|
|
1425
|
-
const headerRow = "h197vzie700-
|
|
1446
|
+
const headerRow = "h197vzie700-beta12";
|
|
1426
1447
|
const headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1427
1448
|
|
|
1428
1449
|
function HeaderRow({
|
|
@@ -1450,7 +1471,7 @@ function HeaderRow({
|
|
|
1450
1471
|
index += colSpan - 1;
|
|
1451
1472
|
}
|
|
1452
1473
|
|
|
1453
|
-
cells.push( /*#__PURE__*/e
|
|
1474
|
+
cells.push( /*#__PURE__*/e(HeaderCell, {
|
|
1454
1475
|
column: column,
|
|
1455
1476
|
colSpan: colSpan,
|
|
1456
1477
|
isCellSelected: selectedCellIdx === column.idx,
|
|
@@ -1465,7 +1486,7 @@ function HeaderRow({
|
|
|
1465
1486
|
}, column.key));
|
|
1466
1487
|
}
|
|
1467
1488
|
|
|
1468
|
-
return /*#__PURE__*/e
|
|
1489
|
+
return /*#__PURE__*/e("div", {
|
|
1469
1490
|
role: "row",
|
|
1470
1491
|
"aria-rowindex": 1,
|
|
1471
1492
|
className: clsx(headerRowClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
@@ -1476,12 +1497,12 @@ function HeaderRow({
|
|
|
1476
1497
|
|
|
1477
1498
|
const HeaderRow$1 = /*#__PURE__*/g(HeaderRow);
|
|
1478
1499
|
|
|
1479
|
-
var css_248z$7 = ".c1bmg16t700-
|
|
1500
|
+
var css_248z$7 = ".c1bmg16t700-beta12,.ccpfvsn700-beta12{background-color:#ccf}.c1bmg16t700-beta12.ccpfvsn700-beta12{background-color:#99f}";
|
|
1480
1501
|
styleInject$1(css_248z$7,{"insertAt":"top"});
|
|
1481
1502
|
|
|
1482
|
-
const cellCopied = "ccpfvsn700-
|
|
1503
|
+
const cellCopied = "ccpfvsn700-beta12";
|
|
1483
1504
|
const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
|
|
1484
|
-
const cellDraggedOver = "c1bmg16t700-
|
|
1505
|
+
const cellDraggedOver = "c1bmg16t700-beta12";
|
|
1485
1506
|
const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1486
1507
|
|
|
1487
1508
|
function Cell({
|
|
@@ -1528,7 +1549,7 @@ function Cell({
|
|
|
1528
1549
|
onRowDoubleClick == null ? void 0 : onRowDoubleClick(row, column);
|
|
1529
1550
|
}
|
|
1530
1551
|
|
|
1531
|
-
return /*#__PURE__*/e
|
|
1552
|
+
return /*#__PURE__*/e("div", {
|
|
1532
1553
|
role: "gridcell",
|
|
1533
1554
|
"aria-colindex": column.idx + 1,
|
|
1534
1555
|
"aria-selected": isCellSelected,
|
|
@@ -1543,8 +1564,8 @@ function Cell({
|
|
|
1543
1564
|
onContextMenu: handleContextMenu,
|
|
1544
1565
|
onFocus: onFocus,
|
|
1545
1566
|
...props,
|
|
1546
|
-
children: !column.rowGroup && /*#__PURE__*/e
|
|
1547
|
-
children: [/*#__PURE__*/e
|
|
1567
|
+
children: !column.rowGroup && /*#__PURE__*/e(d$1, {
|
|
1568
|
+
children: [/*#__PURE__*/e(column.formatter, {
|
|
1548
1569
|
column: column,
|
|
1549
1570
|
row: row,
|
|
1550
1571
|
isCellSelected: isCellSelected,
|
|
@@ -1610,7 +1631,7 @@ function Row({
|
|
|
1610
1631
|
if (isCellSelected && selectedCellEditor) {
|
|
1611
1632
|
cells.push(selectedCellEditor);
|
|
1612
1633
|
} else {
|
|
1613
|
-
cells.push( /*#__PURE__*/e
|
|
1634
|
+
cells.push( /*#__PURE__*/e(Cell$1, {
|
|
1614
1635
|
column: column,
|
|
1615
1636
|
colSpan: colSpan,
|
|
1616
1637
|
row: row,
|
|
@@ -1626,9 +1647,9 @@ function Row({
|
|
|
1626
1647
|
}
|
|
1627
1648
|
}
|
|
1628
1649
|
|
|
1629
|
-
return /*#__PURE__*/e
|
|
1650
|
+
return /*#__PURE__*/e(RowSelectionProvider, {
|
|
1630
1651
|
value: isRowSelected,
|
|
1631
|
-
children: /*#__PURE__*/e
|
|
1652
|
+
children: /*#__PURE__*/e("div", {
|
|
1632
1653
|
role: "row",
|
|
1633
1654
|
ref: ref,
|
|
1634
1655
|
className: className,
|
|
@@ -1664,7 +1685,7 @@ function GroupCell({
|
|
|
1664
1685
|
}
|
|
1665
1686
|
|
|
1666
1687
|
const isLevelMatching = column.rowGroup && groupColumnIndex === column.idx;
|
|
1667
|
-
return /*#__PURE__*/e
|
|
1688
|
+
return /*#__PURE__*/e("div", {
|
|
1668
1689
|
role: "gridcell",
|
|
1669
1690
|
"aria-colindex": column.idx + 1,
|
|
1670
1691
|
"aria-selected": isCellSelected,
|
|
@@ -1676,7 +1697,7 @@ function GroupCell({
|
|
|
1676
1697
|
},
|
|
1677
1698
|
onClick: isLevelMatching ? toggleGroup : undefined,
|
|
1678
1699
|
onFocus: onFocus,
|
|
1679
|
-
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e
|
|
1700
|
+
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter && /*#__PURE__*/e(column.groupFormatter, {
|
|
1680
1701
|
groupKey: groupKey,
|
|
1681
1702
|
childRows: childRows,
|
|
1682
1703
|
column: column,
|
|
@@ -1690,10 +1711,10 @@ function GroupCell({
|
|
|
1690
1711
|
|
|
1691
1712
|
const GroupCell$1 = /*#__PURE__*/g(GroupCell);
|
|
1692
1713
|
|
|
1693
|
-
var css_248z$6 = ".gyxx7e9700-
|
|
1714
|
+
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}";
|
|
1694
1715
|
styleInject$1(css_248z$6,{"insertAt":"top"});
|
|
1695
1716
|
|
|
1696
|
-
const groupRow = "gyxx7e9700-
|
|
1717
|
+
const groupRow = "gyxx7e9700-beta12";
|
|
1697
1718
|
const groupRowClassname = `rdg-group-row ${groupRow}`;
|
|
1698
1719
|
|
|
1699
1720
|
function GroupedRow({
|
|
@@ -1719,9 +1740,9 @@ function GroupedRow({
|
|
|
1719
1740
|
selectGroup(rowIdx);
|
|
1720
1741
|
}
|
|
1721
1742
|
|
|
1722
|
-
return /*#__PURE__*/e
|
|
1743
|
+
return /*#__PURE__*/e(RowSelectionProvider, {
|
|
1723
1744
|
value: isRowSelected,
|
|
1724
|
-
children: /*#__PURE__*/e
|
|
1745
|
+
children: /*#__PURE__*/e("div", {
|
|
1725
1746
|
role: "row",
|
|
1726
1747
|
"aria-level": level,
|
|
1727
1748
|
"aria-expanded": isExpanded,
|
|
@@ -1729,7 +1750,7 @@ function GroupedRow({
|
|
|
1729
1750
|
onClick: handleSelectGroup,
|
|
1730
1751
|
style: getRowStyle(gridRowStart, height),
|
|
1731
1752
|
...props,
|
|
1732
|
-
children: viewportColumns.map(column => /*#__PURE__*/e
|
|
1753
|
+
children: viewportColumns.map(column => /*#__PURE__*/e(GroupCell$1, {
|
|
1733
1754
|
id: id,
|
|
1734
1755
|
groupKey: groupKey,
|
|
1735
1756
|
childRows: childRows,
|
|
@@ -1746,10 +1767,10 @@ function GroupedRow({
|
|
|
1746
1767
|
|
|
1747
1768
|
const GroupRowRenderer = /*#__PURE__*/g(GroupedRow);
|
|
1748
1769
|
|
|
1749
|
-
var css_248z$5 = ".s1n3hxke700-
|
|
1770
|
+
var css_248z$5 = ".s1n3hxke700-beta12{inset-block-end:var(--rdg-summary-row-bottom);inset-block-start:var(--rdg-summary-row-top)}";
|
|
1750
1771
|
styleInject$1(css_248z$5,{"insertAt":"top"});
|
|
1751
1772
|
|
|
1752
|
-
const summaryCellClassname = "s1n3hxke700-
|
|
1773
|
+
const summaryCellClassname = "s1n3hxke700-beta12";
|
|
1753
1774
|
|
|
1754
1775
|
function SummaryCell({
|
|
1755
1776
|
column,
|
|
@@ -1773,7 +1794,7 @@ function SummaryCell({
|
|
|
1773
1794
|
selectCell(row, column);
|
|
1774
1795
|
}
|
|
1775
1796
|
|
|
1776
|
-
return /*#__PURE__*/e
|
|
1797
|
+
return /*#__PURE__*/e("div", {
|
|
1777
1798
|
role: "gridcell",
|
|
1778
1799
|
"aria-colindex": column.idx + 1,
|
|
1779
1800
|
"aria-colspan": colSpan,
|
|
@@ -1784,7 +1805,7 @@ function SummaryCell({
|
|
|
1784
1805
|
style: getCellStyle(column, colSpan),
|
|
1785
1806
|
onClick: onClick,
|
|
1786
1807
|
onFocus: onFocus,
|
|
1787
|
-
children: SummaryFormatter && /*#__PURE__*/e
|
|
1808
|
+
children: SummaryFormatter && /*#__PURE__*/e(SummaryFormatter, {
|
|
1788
1809
|
column: column,
|
|
1789
1810
|
row: row,
|
|
1790
1811
|
isCellSelected: isCellSelected
|
|
@@ -1794,11 +1815,11 @@ function SummaryCell({
|
|
|
1794
1815
|
|
|
1795
1816
|
const SummaryCell$1 = /*#__PURE__*/g(SummaryCell);
|
|
1796
1817
|
|
|
1797
|
-
var css_248z$4 = ".snfqesz700-
|
|
1818
|
+
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)}";
|
|
1798
1819
|
styleInject$1(css_248z$4,{"insertAt":"top"});
|
|
1799
1820
|
|
|
1800
|
-
const summaryRow = "snfqesz700-
|
|
1801
|
-
const summaryRowBorderClassname = "s1jijrjz700-
|
|
1821
|
+
const summaryRow = "snfqesz700-beta12";
|
|
1822
|
+
const summaryRowBorderClassname = "s1jijrjz700-beta12";
|
|
1802
1823
|
const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
1803
1824
|
|
|
1804
1825
|
function SummaryRow({
|
|
@@ -1827,7 +1848,7 @@ function SummaryRow({
|
|
|
1827
1848
|
}
|
|
1828
1849
|
|
|
1829
1850
|
const isCellSelected = selectedCellIdx === column.idx;
|
|
1830
|
-
cells.push( /*#__PURE__*/e
|
|
1851
|
+
cells.push( /*#__PURE__*/e(SummaryCell$1, {
|
|
1831
1852
|
column: column,
|
|
1832
1853
|
colSpan: colSpan,
|
|
1833
1854
|
row: row,
|
|
@@ -1836,7 +1857,7 @@ function SummaryRow({
|
|
|
1836
1857
|
}, column.key));
|
|
1837
1858
|
}
|
|
1838
1859
|
|
|
1839
|
-
return /*#__PURE__*/e
|
|
1860
|
+
return /*#__PURE__*/e("div", {
|
|
1840
1861
|
role: "row",
|
|
1841
1862
|
"aria-rowindex": ariaRowIndex,
|
|
1842
1863
|
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, rowIdx === 0 && summaryRowBorderClassname, selectedCellIdx === -1 && rowSelectedClassname),
|
|
@@ -1850,10 +1871,10 @@ function SummaryRow({
|
|
|
1850
1871
|
|
|
1851
1872
|
const SummaryRow$1 = /*#__PURE__*/g(SummaryRow);
|
|
1852
1873
|
|
|
1853
|
-
var css_248z$3 = ".c1tngyp1700-
|
|
1874
|
+
var css_248z$3 = ".c1tngyp1700-beta12.rdg-cell{padding:0}";
|
|
1854
1875
|
styleInject$1(css_248z$3,{"insertAt":"top"});
|
|
1855
1876
|
|
|
1856
|
-
const cellEditing = "c1tngyp1700-
|
|
1877
|
+
const cellEditing = "c1tngyp1700-beta12";
|
|
1857
1878
|
function EditCell({
|
|
1858
1879
|
column,
|
|
1859
1880
|
colSpan,
|
|
@@ -1922,7 +1943,7 @@ function EditCell({
|
|
|
1922
1943
|
cellClass
|
|
1923
1944
|
} = column;
|
|
1924
1945
|
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !((_column$editorOptions4 = column.editorOptions) != null && _column$editorOptions4.renderFormatter) && cellEditing);
|
|
1925
|
-
return /*#__PURE__*/e
|
|
1946
|
+
return /*#__PURE__*/e("div", {
|
|
1926
1947
|
role: "gridcell",
|
|
1927
1948
|
"aria-colindex": column.idx + 1,
|
|
1928
1949
|
"aria-colspan": colSpan,
|
|
@@ -1931,13 +1952,13 @@ function EditCell({
|
|
|
1931
1952
|
style: getCellStyle(column, colSpan),
|
|
1932
1953
|
onKeyDown: onKeyDown,
|
|
1933
1954
|
onMouseDownCapture: commitOnOutsideClick ? cancelFrameRequest : undefined,
|
|
1934
|
-
children: column.editor != null && /*#__PURE__*/e
|
|
1935
|
-
children: [/*#__PURE__*/e
|
|
1955
|
+
children: column.editor != null && /*#__PURE__*/e(d$1, {
|
|
1956
|
+
children: [/*#__PURE__*/e(column.editor, {
|
|
1936
1957
|
column: column,
|
|
1937
1958
|
row: row,
|
|
1938
1959
|
onRowChange: onRowChange,
|
|
1939
1960
|
onClose: onClose
|
|
1940
|
-
}), ((_column$editorOptions5 = column.editorOptions) == null ? void 0 : _column$editorOptions5.renderFormatter) && /*#__PURE__*/e
|
|
1961
|
+
}), ((_column$editorOptions5 = column.editorOptions) == null ? void 0 : _column$editorOptions5.renderFormatter) && /*#__PURE__*/e(column.formatter, {
|
|
1941
1962
|
column: column,
|
|
1942
1963
|
row: row,
|
|
1943
1964
|
isCellSelected: true,
|
|
@@ -1947,10 +1968,10 @@ function EditCell({
|
|
|
1947
1968
|
});
|
|
1948
1969
|
}
|
|
1949
1970
|
|
|
1950
|
-
var css_248z$2 = ".cadd3bp700-
|
|
1971
|
+
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}";
|
|
1951
1972
|
styleInject$1(css_248z$2,{"insertAt":"top"});
|
|
1952
1973
|
|
|
1953
|
-
const cellDragHandle = "cadd3bp700-
|
|
1974
|
+
const cellDragHandle = "cadd3bp700-beta12";
|
|
1954
1975
|
const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1955
1976
|
function DragHandle({
|
|
1956
1977
|
rows,
|
|
@@ -2034,28 +2055,28 @@ function DragHandle({
|
|
|
2034
2055
|
}
|
|
2035
2056
|
}
|
|
2036
2057
|
|
|
2037
|
-
return /*#__PURE__*/e
|
|
2058
|
+
return /*#__PURE__*/e("div", {
|
|
2038
2059
|
className: cellDragHandleClassname,
|
|
2039
2060
|
onMouseDown: handleMouseDown,
|
|
2040
2061
|
onDoubleClick: handleDoubleClick
|
|
2041
2062
|
});
|
|
2042
2063
|
}
|
|
2043
2064
|
|
|
2044
|
-
var css_248z$1 = ".a888944700-
|
|
2065
|
+
var css_248z$1 = ".a888944700-beta12{fill:currentColor}.a888944700-beta12>path{transition:d .1s}";
|
|
2045
2066
|
styleInject$1(css_248z$1,{"insertAt":"top"});
|
|
2046
2067
|
|
|
2047
|
-
const arrow = "a888944700-
|
|
2068
|
+
const arrow = "a888944700-beta12";
|
|
2048
2069
|
const arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
2049
2070
|
function SortIcon({
|
|
2050
2071
|
sortDirection
|
|
2051
2072
|
}) {
|
|
2052
|
-
return sortDirection !== undefined ? /*#__PURE__*/e
|
|
2073
|
+
return sortDirection !== undefined ? /*#__PURE__*/e("svg", {
|
|
2053
2074
|
viewBox: "0 0 12 8",
|
|
2054
2075
|
width: "12",
|
|
2055
2076
|
height: "8",
|
|
2056
2077
|
className: arrowClassname,
|
|
2057
2078
|
"aria-hidden": true,
|
|
2058
|
-
children: /*#__PURE__*/e
|
|
2079
|
+
children: /*#__PURE__*/e("path", {
|
|
2059
2080
|
d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'
|
|
2060
2081
|
})
|
|
2061
2082
|
}) : null;
|
|
@@ -2155,7 +2176,6 @@ function DataGrid({
|
|
|
2155
2176
|
colOverscanEndIdx,
|
|
2156
2177
|
layoutCssVars,
|
|
2157
2178
|
columnMetrics,
|
|
2158
|
-
totalColumnWidth,
|
|
2159
2179
|
lastFrozenColumnIndex,
|
|
2160
2180
|
totalFrozenColumnWidth,
|
|
2161
2181
|
groupBy
|
|
@@ -2256,7 +2276,9 @@ function DataGrid({
|
|
|
2256
2276
|
useLayoutEffect(() => {
|
|
2257
2277
|
if (autoResizeColumn === null) return;
|
|
2258
2278
|
const columnElement = gridRef.current.querySelector(`[aria-colindex="${autoResizeColumn.idx + 1}"]`);
|
|
2259
|
-
const
|
|
2279
|
+
const {
|
|
2280
|
+
width
|
|
2281
|
+
} = columnElement.getBoundingClientRect();
|
|
2260
2282
|
setColumnWidths(columnWidths => {
|
|
2261
2283
|
const newColumnWidths = new Map(columnWidths);
|
|
2262
2284
|
newColumnWidths.set(autoResizeColumn.key, width);
|
|
@@ -2712,20 +2734,14 @@ function DataGrid({
|
|
|
2712
2734
|
rowIdx: rowIdx + 1
|
|
2713
2735
|
};
|
|
2714
2736
|
|
|
2715
|
-
case
|
|
2716
|
-
return
|
|
2717
|
-
idx: idx + 1,
|
|
2718
|
-
rowIdx
|
|
2719
|
-
} : {
|
|
2737
|
+
case leftKey:
|
|
2738
|
+
return {
|
|
2720
2739
|
idx: idx - 1,
|
|
2721
2740
|
rowIdx
|
|
2722
2741
|
};
|
|
2723
2742
|
|
|
2724
|
-
case
|
|
2725
|
-
return
|
|
2726
|
-
idx: idx - 1,
|
|
2727
|
-
rowIdx
|
|
2728
|
-
} : {
|
|
2743
|
+
case rightKey:
|
|
2744
|
+
return {
|
|
2729
2745
|
idx: idx + 1,
|
|
2730
2746
|
rowIdx
|
|
2731
2747
|
};
|
|
@@ -2851,7 +2867,7 @@ function DataGrid({
|
|
|
2851
2867
|
return;
|
|
2852
2868
|
}
|
|
2853
2869
|
|
|
2854
|
-
return /*#__PURE__*/e
|
|
2870
|
+
return /*#__PURE__*/e(DragHandle, {
|
|
2855
2871
|
rows: rawRows,
|
|
2856
2872
|
columns: columns,
|
|
2857
2873
|
selectedPosition: selectedPosition,
|
|
@@ -2902,7 +2918,7 @@ function DataGrid({
|
|
|
2902
2918
|
closeEditor();
|
|
2903
2919
|
}
|
|
2904
2920
|
|
|
2905
|
-
return /*#__PURE__*/e
|
|
2921
|
+
return /*#__PURE__*/e(EditCell, {
|
|
2906
2922
|
column: column,
|
|
2907
2923
|
colSpan: colSpan,
|
|
2908
2924
|
row: row,
|
|
@@ -2914,6 +2930,16 @@ function DataGrid({
|
|
|
2914
2930
|
}, column.key);
|
|
2915
2931
|
}
|
|
2916
2932
|
|
|
2933
|
+
function getRowViewportColumns(rowIdx) {
|
|
2934
|
+
const selectedColumn = columns[selectedPosition.idx];
|
|
2935
|
+
|
|
2936
|
+
if (selectedColumn !== undefined && selectedPosition.rowIdx === rowIdx && !viewportColumns.includes(selectedColumn)) {
|
|
2937
|
+
return selectedPosition.idx > colOverscanEndIdx ? [...viewportColumns, selectedColumn] : [...viewportColumns.slice(0, lastFrozenColumnIndex + 1), selectedColumn, ...viewportColumns.slice(lastFrozenColumnIndex + 1)];
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
return viewportColumns;
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2917
2943
|
function getViewportRows() {
|
|
2918
2944
|
const rowElements = [];
|
|
2919
2945
|
let startRowIndex = 0;
|
|
@@ -2933,8 +2959,8 @@ function DataGrid({
|
|
|
2933
2959
|
if (selectedColumn !== undefined) {
|
|
2934
2960
|
if (isRowOutsideViewport) {
|
|
2935
2961
|
rowColumns = [selectedColumn];
|
|
2936
|
-
} else
|
|
2937
|
-
rowColumns =
|
|
2962
|
+
} else {
|
|
2963
|
+
rowColumns = getRowViewportColumns(rowIdx);
|
|
2938
2964
|
}
|
|
2939
2965
|
}
|
|
2940
2966
|
|
|
@@ -2946,7 +2972,7 @@ function DataGrid({
|
|
|
2946
2972
|
startRowIndex
|
|
2947
2973
|
} = row);
|
|
2948
2974
|
const isGroupRowSelected = isSelectable && row.childRows.every(cr => selectedRows.has(rowKeyGetter(cr)));
|
|
2949
|
-
rowElements.push( /*#__PURE__*/e
|
|
2975
|
+
rowElements.push( /*#__PURE__*/e(GroupRowRenderer, {
|
|
2950
2976
|
"aria-level": row.level + 1,
|
|
2951
2977
|
"aria-setsize": row.setSize,
|
|
2952
2978
|
"aria-posinset": row.posInSet + 1,
|
|
@@ -2983,7 +3009,7 @@ function DataGrid({
|
|
|
2983
3009
|
key = hasGroups ? startRowIndex : rowIdx;
|
|
2984
3010
|
}
|
|
2985
3011
|
|
|
2986
|
-
rowElements.push( /*#__PURE__*/e
|
|
3012
|
+
rowElements.push( /*#__PURE__*/e(RowRenderer, {
|
|
2987
3013
|
"aria-rowindex": headerRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1,
|
|
2988
3014
|
"aria-selected": isSelectable ? isRowSelected : undefined,
|
|
2989
3015
|
rowIdx: rowIdx,
|
|
@@ -3025,7 +3051,8 @@ function DataGrid({
|
|
|
3025
3051
|
templateRows += ` repeat(${summaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3026
3052
|
}
|
|
3027
3053
|
|
|
3028
|
-
|
|
3054
|
+
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== -2;
|
|
3055
|
+
return /*#__PURE__*/e("div", {
|
|
3029
3056
|
role: hasGroups ? 'treegrid' : 'grid',
|
|
3030
3057
|
"aria-label": ariaLabel,
|
|
3031
3058
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -3037,9 +3064,7 @@ function DataGrid({
|
|
|
3037
3064
|
style: { ...style,
|
|
3038
3065
|
gridTemplateRows: templateRows,
|
|
3039
3066
|
'--rdg-header-row-height': `${headerRowHeight}px`,
|
|
3040
|
-
'--rdg-grid-inline-size': `${totalColumnWidth}px`,
|
|
3041
3067
|
'--rdg-summary-row-height': `${summaryRowHeight}px`,
|
|
3042
|
-
'--rdg-grid-block-size': `${max(totalRowHeight, clientHeight) + headerRowHeight + summaryRowsCount * summaryRowHeight}px`,
|
|
3043
3068
|
'--rdg-sign': isRtl ? -1 : 1,
|
|
3044
3069
|
...getLayoutCssVars()
|
|
3045
3070
|
},
|
|
@@ -3048,18 +3073,18 @@ function DataGrid({
|
|
|
3048
3073
|
onScroll: handleScroll,
|
|
3049
3074
|
onKeyDown: handleKeyDown,
|
|
3050
3075
|
"data-testid": testId,
|
|
3051
|
-
children: [hasGroups && /*#__PURE__*/e
|
|
3076
|
+
children: [hasGroups && /*#__PURE__*/e("div", {
|
|
3052
3077
|
ref: rowRef,
|
|
3053
|
-
tabIndex:
|
|
3054
|
-
className: focusSinkClassname,
|
|
3078
|
+
tabIndex: isGroupRowFocused ? 0 : -1,
|
|
3079
|
+
className: clsx(focusSinkClassname, isGroupRowFocused && [rowSelected, lastFrozenColumnIndex !== -1 && rowSelectedWithFrozenCell]),
|
|
3055
3080
|
style: {
|
|
3056
3081
|
gridRowStart: selectedPosition.rowIdx + 2
|
|
3057
3082
|
},
|
|
3058
3083
|
onKeyDown: handleKeyDown
|
|
3059
|
-
}), /*#__PURE__*/e
|
|
3084
|
+
}), /*#__PURE__*/e(DataGridDefaultComponentsProvider, {
|
|
3060
3085
|
value: defaultGridComponents,
|
|
3061
|
-
children: [/*#__PURE__*/e
|
|
3062
|
-
columns:
|
|
3086
|
+
children: [/*#__PURE__*/e(HeaderRow$1, {
|
|
3087
|
+
columns: getRowViewportColumns(-1),
|
|
3063
3088
|
onColumnResize: handleColumnResize,
|
|
3064
3089
|
allRowsSelected: allRowsSelected,
|
|
3065
3090
|
onAllRowsSelectionChange: selectAllRowsLatest,
|
|
@@ -3070,23 +3095,24 @@ function DataGrid({
|
|
|
3070
3095
|
selectCell: selectHeaderCellLatest,
|
|
3071
3096
|
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
3072
3097
|
direction: direction
|
|
3073
|
-
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/e
|
|
3074
|
-
children: [/*#__PURE__*/e
|
|
3098
|
+
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/e(d$1, {
|
|
3099
|
+
children: [/*#__PURE__*/e(RowSelectionChangeProvider, {
|
|
3075
3100
|
value: selectRowLatest,
|
|
3076
3101
|
children: getViewportRows()
|
|
3077
3102
|
}), summaryRows == null ? void 0 : summaryRows.map((row, rowIdx) => {
|
|
3078
3103
|
const gridRowStart = headerRowsCount + rows.length + rowIdx + 1;
|
|
3079
|
-
const
|
|
3104
|
+
const summaryRowIdx = headerRowsCount + rows.length + rowIdx - 1;
|
|
3105
|
+
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3080
3106
|
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (summaryRows.length - rowIdx) : undefined;
|
|
3081
3107
|
const bottom = top === undefined ? summaryRowHeight * (summaryRows.length - 1 - rowIdx) : undefined;
|
|
3082
|
-
return /*#__PURE__*/e
|
|
3108
|
+
return /*#__PURE__*/e(SummaryRow$1, {
|
|
3083
3109
|
"aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
|
|
3084
3110
|
rowIdx: rowIdx,
|
|
3085
3111
|
gridRowStart: gridRowStart,
|
|
3086
3112
|
row: row,
|
|
3087
3113
|
top: top,
|
|
3088
3114
|
bottom: bottom,
|
|
3089
|
-
viewportColumns:
|
|
3115
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3090
3116
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3091
3117
|
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3092
3118
|
selectCell: selectSummaryCellLatest
|
|
@@ -3103,39 +3129,17 @@ function isSamePosition(p1, p2) {
|
|
|
3103
3129
|
|
|
3104
3130
|
const DataGrid$1 = /*#__PURE__*/x(DataGrid);
|
|
3105
3131
|
|
|
3106
|
-
var css_248z$g = ".t16y9g8l700-
|
|
3132
|
+
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}";
|
|
3107
3133
|
styleInject$1(css_248z$g,{"insertAt":"top"});
|
|
3108
3134
|
|
|
3109
|
-
function
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3116
|
-
var style = document.createElement('style');
|
|
3117
|
-
style.type = 'text/css';
|
|
3118
|
-
|
|
3119
|
-
if (insertAt === 'top') {
|
|
3120
|
-
if (head.firstChild) {
|
|
3121
|
-
head.insertBefore(style, head.firstChild);
|
|
3122
|
-
} else {
|
|
3123
|
-
head.appendChild(style);
|
|
3124
|
-
}
|
|
3125
|
-
} else {
|
|
3126
|
-
head.appendChild(style);
|
|
3127
|
-
}
|
|
3128
|
-
|
|
3129
|
-
if (style.styleSheet) {
|
|
3130
|
-
style.styleSheet.cssText = css;
|
|
3131
|
-
} else {
|
|
3132
|
-
style.appendChild(document.createTextNode(css));
|
|
3133
|
-
}
|
|
3135
|
+
function useData(widget) {
|
|
3136
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3137
|
+
var columns = _(function () { return widget.columns(); }, [widget, widget.dataChecksum()]);
|
|
3138
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3139
|
+
var data = _(function () { return widget.data(); }, [widget, widget.dataChecksum()]);
|
|
3140
|
+
return [columns, data];
|
|
3134
3141
|
}
|
|
3135
3142
|
|
|
3136
|
-
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}";
|
|
3137
|
-
styleInject(css_248z);
|
|
3138
|
-
|
|
3139
3143
|
function copyAndSort(items, attribute, descending) {
|
|
3140
3144
|
var key = attribute;
|
|
3141
3145
|
return __spreadArray([], items, true).sort(function (a, b) {
|
|
@@ -3148,76 +3152,167 @@ function copyAndSort(items, attribute, descending) {
|
|
|
3148
3152
|
return 0;
|
|
3149
3153
|
});
|
|
3150
3154
|
}
|
|
3155
|
+
var EmptyRowsRenderer = function (_a) {
|
|
3156
|
+
var message = _a.message;
|
|
3157
|
+
return v$1("div", { style: { textAlign: "center", gridColumn: "1/-1" } },
|
|
3158
|
+
message,
|
|
3159
|
+
v$1("span", null, "--- * --- * ---"));
|
|
3160
|
+
};
|
|
3151
3161
|
var ReactTable = function (_a) {
|
|
3152
|
-
var
|
|
3153
|
-
var
|
|
3154
|
-
var
|
|
3155
|
-
var
|
|
3156
|
-
var
|
|
3162
|
+
var table = _a.table, sort = _a.sort;
|
|
3163
|
+
var _b = useData(table), columns = _b[0], data = _b[1];
|
|
3164
|
+
var multiSelect = table.multiSelect();
|
|
3165
|
+
var columnTypes = table.columnTypes();
|
|
3166
|
+
var columnPatterns = table.columnPatterns();
|
|
3167
|
+
var columnFormats = table.columnFormats();
|
|
3168
|
+
var _c = m([]), listColumns = _c[0], setListColumns = _c[1];
|
|
3169
|
+
var _d = m(), sortColumn = _d[0], setSortColumn = _d[1];
|
|
3170
|
+
var _e = m([]), rows = _e[0], setRows = _e[1];
|
|
3171
|
+
var _f = m(new Set()), selectedRows = _f[0], setSelectedRows = _f[1];
|
|
3157
3172
|
// Columns ---
|
|
3158
3173
|
y(function () {
|
|
3159
|
-
setListColumns(__spreadArray(__spreadArray([], multiSelect ? [SelectColumn] : [], true), columns.map(function (column) {
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3174
|
+
setListColumns(__spreadArray(__spreadArray([], multiSelect ? [SelectColumn] : [], true), columns.map(function (column) {
|
|
3175
|
+
var _a;
|
|
3176
|
+
var type = (_a = columnTypes[column]) !== null && _a !== void 0 ? _a : "string";
|
|
3177
|
+
var formatter;
|
|
3178
|
+
var __hpcc_pattern;
|
|
3179
|
+
var __hpcc_format;
|
|
3180
|
+
switch (type) {
|
|
3181
|
+
case "time":
|
|
3182
|
+
__hpcc_pattern = columnPatterns[column] !== undefined ? timeParse(columnPatterns[column]) : undefined;
|
|
3183
|
+
__hpcc_format = columnFormats[column] !== undefined ? timeFormat(columnFormats[column]) : undefined;
|
|
3184
|
+
break;
|
|
3185
|
+
case "number":
|
|
3186
|
+
formatter = function (props) {
|
|
3187
|
+
return v$1("div", { style: { textAlign: "right" } }, props.row[props.column.key]);
|
|
3188
|
+
};
|
|
3189
|
+
// eslint-disable-next-line no-fallthrough
|
|
3190
|
+
default:
|
|
3191
|
+
__hpcc_format = columnFormats[column] !== undefined ? format(columnFormats[column]) : undefined;
|
|
3192
|
+
}
|
|
3193
|
+
return {
|
|
3194
|
+
key: column,
|
|
3195
|
+
name: column,
|
|
3196
|
+
resizable: true,
|
|
3197
|
+
sortable: true,
|
|
3198
|
+
minWidth: 80,
|
|
3199
|
+
formatter: formatter,
|
|
3200
|
+
__hpcc_pattern: __hpcc_pattern,
|
|
3201
|
+
__hpcc_format: __hpcc_format
|
|
3202
|
+
};
|
|
3203
|
+
}), true));
|
|
3204
|
+
}, [columnFormats, columnPatterns, columnTypes, columns, multiSelect]);
|
|
3167
3205
|
var onSortColumnsChange = A$1(function (sortColumns) {
|
|
3168
3206
|
var futureSortColumn = sortColumns.slice(-1)[0];
|
|
3169
3207
|
var sorted = futureSortColumn !== undefined;
|
|
3170
3208
|
var isSortedDescending = (futureSortColumn === null || futureSortColumn === void 0 ? void 0 : futureSortColumn.direction) === "DESC";
|
|
3171
3209
|
setSortColumn(futureSortColumn);
|
|
3172
|
-
|
|
3173
|
-
}, [
|
|
3210
|
+
setRows(copyAndSort(rows, sorted ? futureSortColumn.columnKey : "key", sorted ? isSortedDescending : false));
|
|
3211
|
+
}, [rows]);
|
|
3174
3212
|
var rowKeyGetter = A$1(function (row) {
|
|
3175
3213
|
return row.key;
|
|
3176
3214
|
}, []);
|
|
3177
3215
|
var onSelectedRowsChange = A$1(function (selectedRows) {
|
|
3178
3216
|
setSelectedRows(selectedRows);
|
|
3179
|
-
|
|
3180
|
-
}, [items, onRowClickCallback, rowKeyGetter]);
|
|
3217
|
+
}, []);
|
|
3181
3218
|
var onRowClick = A$1(function (row, column) {
|
|
3182
|
-
onRowClickCallback(
|
|
3183
|
-
}, [
|
|
3219
|
+
table.onRowClickCallback(row, column.key);
|
|
3220
|
+
}, [table]);
|
|
3184
3221
|
// Rows ---
|
|
3185
3222
|
y(function () {
|
|
3186
3223
|
var items = data.map(function (row, index) {
|
|
3187
3224
|
var retVal = {
|
|
3188
3225
|
key: index
|
|
3189
3226
|
};
|
|
3190
|
-
|
|
3191
|
-
|
|
3227
|
+
listColumns.forEach(function (column, index) {
|
|
3228
|
+
var val = row[index];
|
|
3229
|
+
if (column.__hpcc_pattern && column.__hpcc_format) {
|
|
3230
|
+
val = column.__hpcc_format(column.__hpcc_pattern(val));
|
|
3231
|
+
}
|
|
3232
|
+
else if (column.__hpcc_pattern) {
|
|
3233
|
+
val = column.__hpcc_pattern(val).toString();
|
|
3234
|
+
}
|
|
3235
|
+
else if (column.__hpcc_format) {
|
|
3236
|
+
val = column.__hpcc_format(val);
|
|
3237
|
+
}
|
|
3238
|
+
retVal[column.key] = val;
|
|
3192
3239
|
});
|
|
3193
3240
|
return retVal;
|
|
3194
3241
|
});
|
|
3195
3242
|
if (sort === null || sort === void 0 ? void 0 : sort.attribute) {
|
|
3196
3243
|
items = copyAndSort(items, sort.attribute, sort.descending);
|
|
3197
3244
|
}
|
|
3198
|
-
|
|
3199
|
-
}, [
|
|
3200
|
-
return
|
|
3245
|
+
setRows(items);
|
|
3246
|
+
}, [listColumns, data, sort]);
|
|
3247
|
+
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%" } });
|
|
3201
3248
|
};
|
|
3249
|
+
|
|
3250
|
+
function styleInject(css, ref) {
|
|
3251
|
+
if ( ref === void 0 ) ref = {};
|
|
3252
|
+
var insertAt = ref.insertAt;
|
|
3253
|
+
|
|
3254
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
3255
|
+
|
|
3256
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
3257
|
+
var style = document.createElement('style');
|
|
3258
|
+
style.type = 'text/css';
|
|
3259
|
+
|
|
3260
|
+
if (insertAt === 'top') {
|
|
3261
|
+
if (head.firstChild) {
|
|
3262
|
+
head.insertBefore(style, head.firstChild);
|
|
3263
|
+
} else {
|
|
3264
|
+
head.appendChild(style);
|
|
3265
|
+
}
|
|
3266
|
+
} else {
|
|
3267
|
+
head.appendChild(style);
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
if (style.styleSheet) {
|
|
3271
|
+
style.styleSheet.cssText = css;
|
|
3272
|
+
} else {
|
|
3273
|
+
style.appendChild(document.createTextNode(css));
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
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}";
|
|
3278
|
+
styleInject(css_248z);
|
|
3279
|
+
|
|
3202
3280
|
var Table = /** @class */ (function (_super) {
|
|
3203
3281
|
__extends(Table, _super);
|
|
3204
3282
|
function Table() {
|
|
3205
3283
|
return _super.call(this) || this;
|
|
3206
3284
|
}
|
|
3207
|
-
Table.prototype.
|
|
3208
|
-
var
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3285
|
+
Table.prototype.columnType = function (column, type) {
|
|
3286
|
+
var _a;
|
|
3287
|
+
if (arguments.length === 1)
|
|
3288
|
+
return this.columnTypes()[column];
|
|
3289
|
+
this.columnTypes(__assign(__assign({}, this.columnTypes()), (_a = {}, _a[column] = type, _a)));
|
|
3290
|
+
return this;
|
|
3291
|
+
};
|
|
3292
|
+
Table.prototype.columnPattern = function (column, pattern) {
|
|
3293
|
+
var _a;
|
|
3294
|
+
if (arguments.length === 1)
|
|
3295
|
+
return this.columnPatterns()[column];
|
|
3296
|
+
this.columnPatterns(__assign(__assign({}, this.columnPatterns()), (_a = {}, _a[column] = pattern, _a)));
|
|
3297
|
+
return this;
|
|
3298
|
+
};
|
|
3299
|
+
Table.prototype.columnFormat = function (column, format) {
|
|
3300
|
+
var _a;
|
|
3301
|
+
if (arguments.length === 1)
|
|
3302
|
+
return this.columnFormats()[column];
|
|
3303
|
+
this.columnFormats(__assign(__assign({}, this.columnFormats()), (_a = {}, _a[column] = format, _a)));
|
|
3304
|
+
return this;
|
|
3305
|
+
};
|
|
3306
|
+
Table.prototype.onRowClickCallback = function (row, column) {
|
|
3307
|
+
var _a;
|
|
3308
|
+
if (this._prevRow && JSON.stringify(this._prevRow) !== JSON.stringify(row)) {
|
|
3309
|
+
this.click(this._prevRow, (_a = this._prevColumn) !== null && _a !== void 0 ? _a : "", false);
|
|
3310
|
+
}
|
|
3311
|
+
if (row) {
|
|
3312
|
+
this.click(row, column, true);
|
|
3313
|
+
}
|
|
3314
|
+
this._prevRow = row;
|
|
3315
|
+
this._prevColumn = column;
|
|
3221
3316
|
};
|
|
3222
3317
|
Table.prototype.enter = function (domNode, element) {
|
|
3223
3318
|
_super.prototype.enter.call(this, domNode, element);
|
|
@@ -3228,7 +3323,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
3228
3323
|
_super.prototype.update.call(this, domNode, element);
|
|
3229
3324
|
this._div.style("width", this.width() + "px");
|
|
3230
3325
|
this._div.style("height", this.height() + "px");
|
|
3231
|
-
B(this
|
|
3326
|
+
B(v$1(ReactTable, { table: this }), this._div.node());
|
|
3232
3327
|
};
|
|
3233
3328
|
Table.prototype.exit = function (domNode, element) {
|
|
3234
3329
|
un(this._div.node());
|
|
@@ -3238,6 +3333,10 @@ var Table = /** @class */ (function (_super) {
|
|
|
3238
3333
|
// Events ---
|
|
3239
3334
|
Table.prototype.click = function (row, col, sel) {
|
|
3240
3335
|
};
|
|
3336
|
+
__decorate([
|
|
3337
|
+
publish("...empty...", "string", "No Data Message"),
|
|
3338
|
+
__metadata("design:type", Function)
|
|
3339
|
+
], Table.prototype, "noDataMessage", void 0);
|
|
3241
3340
|
__decorate([
|
|
3242
3341
|
publish(false, "boolean", "Dark Mode"),
|
|
3243
3342
|
__metadata("design:type", Function)
|
|
@@ -3246,6 +3345,18 @@ var Table = /** @class */ (function (_super) {
|
|
|
3246
3345
|
publish(false, "boolean", "Multiple Selection"),
|
|
3247
3346
|
__metadata("design:type", Function)
|
|
3248
3347
|
], Table.prototype, "multiSelect", void 0);
|
|
3348
|
+
__decorate([
|
|
3349
|
+
publish({}, "object", "Column Types (\"boolean\" | \"number\" | \"string\" | \"time\""),
|
|
3350
|
+
__metadata("design:type", Function)
|
|
3351
|
+
], Table.prototype, "columnTypes", void 0);
|
|
3352
|
+
__decorate([
|
|
3353
|
+
publish({}, "object", "Column Patterns"),
|
|
3354
|
+
__metadata("design:type", Function)
|
|
3355
|
+
], Table.prototype, "columnPatterns", void 0);
|
|
3356
|
+
__decorate([
|
|
3357
|
+
publish({}, "object", "Column Formats"),
|
|
3358
|
+
__metadata("design:type", Function)
|
|
3359
|
+
], Table.prototype, "columnFormats", void 0);
|
|
3249
3360
|
return Table;
|
|
3250
3361
|
}(HTMLWidget));
|
|
3251
3362
|
Table.prototype._class += " dgrid2_Table";
|