@hpcc-js/dgrid2 2.3.6 → 2.3.7
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 +491 -478
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +491 -478
- 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/reactTable.tsx +1 -1
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
})(this, (function (exports, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var PKG_NAME = "@hpcc-js/dgrid2";
|
|
8
|
-
var PKG_VERSION = "2.3.
|
|
9
|
-
var BUILD_VERSION = "2.104.
|
|
8
|
+
var PKG_VERSION = "2.3.7";
|
|
9
|
+
var BUILD_VERSION = "2.104.14";
|
|
10
10
|
|
|
11
11
|
/******************************************************************************
|
|
12
12
|
Copyright (c) Microsoft Corporation.
|
|
@@ -75,80 +75,40 @@
|
|
|
75
75
|
|
|
76
76
|
var t,r$1,u,i,o$1=0,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r$1,t,o$1||u),o$1=0;var i=r$1.__H||(r$1.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function p(n){return o$1=1,y(B$1,n)}function y(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$1,!r$1.u)){r$1.u=!0;var f=r$1.shouldComponentUpdate;r$1.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&z$1(o.__H,i)&&(o.__=u,o.i=i,r$1.__H.__h.push(o));}function s(u,i){var o=d(t++,4);!l$1.__s&&z$1(o.__H,i)&&(o.__=u,o.i=i,r$1.__h.push(o));}function _$1(n){return o$1=5,F(function(){return {current:n}},[])}function A(n,t,r){o$1=6,s(function(){return "function"==typeof n?(n(t()),function(){return n(null)}):n?(n.current=t(),function(){return n.current=null}):void 0},null==r?r:r.concat(n));}function F(n,r){var u=d(t++,7);return z$1(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T$1(n,t){return o$1=8,F(function(){return n},t)}function q$1(n){var u=r$1.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$1)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w$1),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){"function"!=typeof n.type||n.__m||null===n.__?n.__m||(n.__m=n.__&&n.__.__m?n.__.__m:""):n.__m=(n.__&&n.__.__m?n.__.__m:"")+(n.__&&n.__.__k?n.__.__k.indexOf(n):0),r$1=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var i=(r$1=n.__c).__H;i&&(u===r$1?(i.__h=[],r$1.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w$1),i.__h=[])),u=r$1;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j$1)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r$1=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w$1(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g$1="function"==typeof requestAnimationFrame;function j$1(n){var t,r=function(){clearTimeout(u),g$1&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$1&&(t=requestAnimationFrame(r));}function k(n){var t=r$1,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$1=t;}function w$1(n){var t=r$1;n.__c=n.__(),r$1=t;}function z$1(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t}
|
|
77
77
|
|
|
78
|
-
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function w(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return !r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,h$1(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u}(E.prototype=new d$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var x="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function N(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=x,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var O=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);O(n,t,e,r);};var T=l$1.unmount;function I(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return I(n,t,e)})),n}function L(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function U(){this.__u=0,this.t=null,this.__b=null;}function D(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function 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),T&&T(n);},(U.prototype=new d$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=D(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=L(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},U.prototype.componentWillUnmount=function(){this.t=[];},U.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=I(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&h$1(p$1,null,n.fallback);return i&&(i.__h=null),[h$1(p$1,null,e.__a?null:n.children),i]};var V=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 d$1).__a=function(n){var t=this,e=D(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),V(t,n,r)):u();};e?e(o):o();}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=x$1(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V(n,e,t);});};var j="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,z=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,B="undefined"!=typeof document,H=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Z(n,t,e){return null==t.__k&&(t.textContent=""),P(n,t),"function"==typeof e&&e(),n?n.__c:null}d$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(d$1.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var q=l$1.event;function G(){}function J(){return this.cancelBubble}function K(){return this.defaultPrevented}l$1.event=function(n){return q&&(n=q(n)),n.persist=G,n.isPropagationStopped=J,n.isDefaultPrevented=K,n.nativeEvent=n};var X={configurable:!0,get:function(){return this.class}},nn=l$1.vnode;l$1.vnode=function(n){var t=n.type,e=n.props,u=e;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in u={},e){var l=e[i];B&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in e&&null==l||("defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===l?l="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!H(e.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&z.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i="oninputCapture")),u[i]=l);}"select"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=x$1(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==t&&null!=u.defaultValue&&(u.value=x$1(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),n.props=u,e.class!=e.className&&(X.enumerable="className"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,"className",X));}n.$$typeof=j,nn&&nn(n);};var tn=l$1.__r;l$1.__r=function(n){tn&&tn(n),n.__c;};function cn(n){return !!n.__k&&(P(null,n),!0)}
|
|
78
|
+
function g(n,t){for(var e in t)n[e]=t[e];return n}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return !0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return !0;return !1}function E(n){this.props=n;}function w(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return !r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n)}function u(e){return this.shouldComponentUpdate=r,h$1(n,e)}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u}(E.prototype=new d$1).isPureReactComponent=!0,E.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t)};var R=l$1.__b;l$1.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),R&&R(n);};var x="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function N(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=x,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t}var O=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);O(n,t,e,r);};var T=l$1.unmount;function I(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return I(n,t,e)})),n}function L(n,t,e){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return L(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=e)),n}function U(){this.__u=0,this.t=null,this.__b=null;}function D(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function 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),T&&T(n);},(U.prototype=new d$1).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=D(r.__v),o=!1,i=function(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=L(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}},c=!0===t.__h;r.__u++||c||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},U.prototype.componentWillUnmount=function(){this.t=[];},U.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=I(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&h$1(p$1,null,n.fallback);return i&&(i.__h=null),[h$1(p$1,null,e.__a?null:n.children),i]};var V=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 d$1).__a=function(n){var t=this,e=D(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),V(t,n,r)):u();};e?e(o):o();}},M.prototype.render=function(n){this.u=null,this.o=new Map;var t=x$1(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children},M.prototype.componentDidUpdate=M.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V(n,e,t);});};var j="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,z=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,B="undefined"!=typeof document,H=function(n){return ("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Z(n,t,e){return null==t.__k&&(t.textContent=""),P(n,t),"function"==typeof e&&e(),n?n.__c:null}d$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(d$1.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var q=l$1.event;function G(){}function J(){return this.cancelBubble}function K(){return this.defaultPrevented}l$1.event=function(n){return q&&(n=q(n)),n.persist=G,n.isPropagationStopped=J,n.isDefaultPrevented=K,n.nativeEvent=n};var X={configurable:!0,get:function(){return this.class}},nn=l$1.vnode;l$1.vnode=function(n){var t=n.type,e=n.props,u=e;if("string"==typeof t){var o=-1===t.indexOf("-");for(var i in u={},e){var l=e[i];B&&"children"===i&&"noscript"===t||"value"===i&&"defaultValue"in e&&null==l||("defaultValue"===i&&"value"in e&&null==e.value?i="value":"download"===i&&!0===l?l="":/ondoubleclick/i.test(i)?i="ondblclick":/^onchange(textarea|input)/i.test(i+t)&&!H(e.type)?i="oninput":/^onfocus$/i.test(i)?i="onfocusin":/^onblur$/i.test(i)?i="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(i)?i=i.toLowerCase():o&&z.test(i)?i=i.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===l&&(l=void 0),/^oninput$/i.test(i)&&(i=i.toLowerCase(),u[i]&&(i="oninputCapture")),u[i]=l);}"select"==t&&u.multiple&&Array.isArray(u.value)&&(u.value=x$1(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==t&&null!=u.defaultValue&&(u.value=x$1(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),n.props=u,e.class!=e.className&&(X.enumerable="className"in e,null!=e.className&&(u.class=e.className),Object.defineProperty(u,"className",X));}n.$$typeof=j,nn&&nn(n);};var tn=l$1.__r;l$1.__r=function(n){tn&&tn(n),n.__c;};function cn(n){return !!n.__k&&(P(null,n),!0)}var sn=function(n,t){return n(t)};
|
|
79
79
|
|
|
80
80
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
81
81
|
|
|
82
82
|
var _=0;function o(o,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:o,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_,__source:f,__self:t};if("function"==typeof o&&(l=o.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
if ( ref === void 0 ) ref = {};
|
|
86
|
-
var insertAt = ref.insertAt;
|
|
87
|
-
|
|
88
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
89
|
-
|
|
90
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
91
|
-
var style = document.createElement('style');
|
|
92
|
-
style.type = 'text/css';
|
|
93
|
-
|
|
94
|
-
if (insertAt === 'top') {
|
|
95
|
-
if (head.firstChild) {
|
|
96
|
-
head.insertBefore(style, head.firstChild);
|
|
97
|
-
} else {
|
|
98
|
-
head.appendChild(style);
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
head.appendChild(style);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (style.styleSheet) {
|
|
105
|
-
style.styleSheet.cssText = css;
|
|
106
|
-
} else {
|
|
107
|
-
style.appendChild(document.createTextNode(css));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
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)}";
|
|
112
|
-
styleInject$1(css_248z$f,{"insertAt":"top"});
|
|
113
|
-
|
|
114
|
-
const cell = "c1wupbe700-beta12";
|
|
84
|
+
const cell = "c1wupbe7-0-0-beta-19";
|
|
115
85
|
const cellClassname = `rdg-cell ${cell}`;
|
|
116
|
-
const
|
|
117
|
-
const cellFrozen = "c1730fa4700-beta12";
|
|
86
|
+
const cellFrozen = "cd0kgiy7-0-0-beta-19";
|
|
118
87
|
const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
119
|
-
const cellFrozenLast = "
|
|
88
|
+
const cellFrozenLast = "c1730fa47-0-0-beta-19";
|
|
120
89
|
const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
|
|
121
90
|
|
|
122
|
-
|
|
123
|
-
styleInject$1(css_248z$e,{"insertAt":"top"});
|
|
124
|
-
|
|
125
|
-
const root = "r104f42s700-beta12";
|
|
91
|
+
const root = "r104f42s7-0-0-beta-19";
|
|
126
92
|
const rootClassname = `rdg ${root}`;
|
|
127
|
-
const viewportDragging = "
|
|
93
|
+
const viewportDragging = "v7ly7s7-0-0-beta-19";
|
|
128
94
|
const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
|
|
129
|
-
const focusSinkClassname = "
|
|
95
|
+
const focusSinkClassname = "fc4f4zb7-0-0-beta-19";
|
|
130
96
|
|
|
131
|
-
|
|
132
|
-
styleInject$1(css_248z$d,{"insertAt":"top"});
|
|
133
|
-
|
|
134
|
-
const row = "r1otpg64700-beta12";
|
|
97
|
+
const row = "r1otpg647-0-0-beta-19";
|
|
135
98
|
const rowClassname = `rdg-row ${row}`;
|
|
136
|
-
const rowSelected = "
|
|
99
|
+
const rowSelected = "rel5gk27-0-0-beta-19";
|
|
137
100
|
const rowSelectedClassname = `rdg-row-selected`;
|
|
138
|
-
const rowSelectedWithFrozenCell = "
|
|
139
|
-
|
|
140
|
-
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)}";
|
|
141
|
-
styleInject$1(css_248z$c,{"insertAt":"top"});
|
|
101
|
+
const rowSelectedWithFrozenCell = "r1qymf1z7-0-0-beta-19";
|
|
142
102
|
|
|
143
|
-
const checkboxLabel = "
|
|
103
|
+
const checkboxLabel = "c8rwwhf7-0-0-beta-19";
|
|
144
104
|
const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
|
|
145
|
-
const checkboxInput = "
|
|
105
|
+
const checkboxInput = "c1rb4brs7-0-0-beta-19";
|
|
146
106
|
const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
|
|
147
|
-
const checkbox = "
|
|
107
|
+
const checkbox = "c1bvvwcc7-0-0-beta-19";
|
|
148
108
|
const checkboxClassname = `rdg-checkbox ${checkbox}`;
|
|
149
|
-
const checkboxLabelDisabled = "
|
|
109
|
+
const checkboxLabelDisabled = "c1yg790j7-0-0-beta-19";
|
|
150
110
|
const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
|
|
151
|
-
|
|
111
|
+
function checkboxFormatter({
|
|
152
112
|
onChange,
|
|
153
113
|
...props
|
|
154
114
|
}, ref) {
|
|
@@ -168,17 +128,15 @@
|
|
|
168
128
|
className: checkboxClassname
|
|
169
129
|
})]
|
|
170
130
|
});
|
|
171
|
-
}
|
|
131
|
+
}
|
|
172
132
|
|
|
173
133
|
const useLayoutEffect = typeof window === 'undefined' ? h : s;
|
|
174
134
|
|
|
175
135
|
function useFocusRef(isSelected) {
|
|
176
136
|
const ref = _$1(null);
|
|
177
137
|
useLayoutEffect(() => {
|
|
178
|
-
var _ref$current;
|
|
179
|
-
|
|
180
138
|
if (!isSelected) return;
|
|
181
|
-
|
|
139
|
+
ref.current?.focus({
|
|
182
140
|
preventScroll: true
|
|
183
141
|
});
|
|
184
142
|
}, [isSelected]);
|
|
@@ -206,19 +164,20 @@
|
|
|
206
164
|
ref,
|
|
207
165
|
tabIndex
|
|
208
166
|
} = useFocusRef(isCellSelected);
|
|
209
|
-
const
|
|
210
|
-
return /*#__PURE__*/o(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
167
|
+
const checkboxFormatter = useDefaultComponents().checkboxFormatter;
|
|
168
|
+
return /*#__PURE__*/o(p$1, {
|
|
169
|
+
children: checkboxFormatter({
|
|
170
|
+
'aria-label': ariaLabel,
|
|
171
|
+
'aria-labelledby': ariaLabelledBy,
|
|
172
|
+
tabIndex,
|
|
173
|
+
disabled,
|
|
174
|
+
checked: value,
|
|
175
|
+
onChange
|
|
176
|
+
}, ref)
|
|
218
177
|
});
|
|
219
178
|
}
|
|
220
179
|
|
|
221
|
-
function
|
|
180
|
+
function valueFormatter(props) {
|
|
222
181
|
try {
|
|
223
182
|
return /*#__PURE__*/o(p$1, {
|
|
224
183
|
children: props.row[props.column.key]
|
|
@@ -228,14 +187,15 @@
|
|
|
228
187
|
}
|
|
229
188
|
}
|
|
230
189
|
|
|
231
|
-
|
|
232
|
-
styleInject$1(css_248z$b,{"insertAt":"top"});
|
|
233
|
-
|
|
234
|
-
const groupCellContent = "gch972y700-beta12";
|
|
190
|
+
const groupCellContent = "gb8l2vs7-0-0-beta-19";
|
|
235
191
|
const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
|
|
236
|
-
const caret = "
|
|
192
|
+
const caret = "c1ggynjl7-0-0-beta-19";
|
|
237
193
|
const caretClassname = `rdg-caret ${caret}`;
|
|
238
|
-
function
|
|
194
|
+
function toggleGroupFormatter(props) {
|
|
195
|
+
return /*#__PURE__*/o(ToggleGroup, { ...props
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function ToggleGroup({
|
|
239
199
|
groupKey,
|
|
240
200
|
isExpanded,
|
|
241
201
|
isCellSelected,
|
|
@@ -341,8 +301,16 @@
|
|
|
341
301
|
});
|
|
342
302
|
},
|
|
343
303
|
|
|
344
|
-
formatter
|
|
345
|
-
|
|
304
|
+
formatter(props) {
|
|
305
|
+
return /*#__PURE__*/o(SelectFormatter, { ...props
|
|
306
|
+
});
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
groupFormatter(props) {
|
|
310
|
+
return /*#__PURE__*/o(SelectGroupFormatter, { ...props
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
346
314
|
};
|
|
347
315
|
|
|
348
316
|
function getColSpan(column, lastFrozenColumnIndex, args) {
|
|
@@ -355,6 +323,13 @@
|
|
|
355
323
|
return undefined;
|
|
356
324
|
}
|
|
357
325
|
|
|
326
|
+
function scrollIntoView(element) {
|
|
327
|
+
element?.scrollIntoView({
|
|
328
|
+
inline: 'nearest',
|
|
329
|
+
block: 'nearest'
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
|
|
358
333
|
const nonInputKeys = new Set(['Unidentified', 'Alt', 'AltGraph', 'CapsLock', 'Control', 'Fn', 'FnLock', 'Meta', 'NumLock', 'ScrollLock', 'Shift', 'Tab', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'End', 'Home', 'PageDown', 'PageUp', 'Insert', 'ContextMenu', 'Escape', 'Pause', 'Play', 'PrintScreen', 'F1', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12']);
|
|
359
334
|
function isCtrlKeyHeldDown(e) {
|
|
360
335
|
return (e.ctrlKey || e.metaKey) && e.key !== 'Control';
|
|
@@ -373,6 +348,26 @@
|
|
|
373
348
|
return false;
|
|
374
349
|
}
|
|
375
350
|
|
|
351
|
+
const measuringCellClassname = "m1l09lto7-0-0-beta-19";
|
|
352
|
+
function renderMeasuringCells(viewportColumns) {
|
|
353
|
+
return /*#__PURE__*/o(p$1, {
|
|
354
|
+
children: viewportColumns.map(({
|
|
355
|
+
key,
|
|
356
|
+
idx,
|
|
357
|
+
minWidth,
|
|
358
|
+
maxWidth
|
|
359
|
+
}) => /*#__PURE__*/o("div", {
|
|
360
|
+
className: measuringCellClassname,
|
|
361
|
+
style: {
|
|
362
|
+
gridColumnStart: idx + 1,
|
|
363
|
+
minWidth,
|
|
364
|
+
maxWidth
|
|
365
|
+
},
|
|
366
|
+
"data-measuring-cell-key": key
|
|
367
|
+
}, key))
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
376
371
|
function isSelectedCellEditable({
|
|
377
372
|
selectedPosition,
|
|
378
373
|
columns,
|
|
@@ -388,18 +383,29 @@
|
|
|
388
383
|
}
|
|
389
384
|
function getSelectedCellColSpan({
|
|
390
385
|
rows,
|
|
391
|
-
|
|
386
|
+
topSummaryRows,
|
|
387
|
+
bottomSummaryRows,
|
|
392
388
|
rowIdx,
|
|
393
389
|
lastFrozenColumnIndex,
|
|
394
390
|
column,
|
|
395
391
|
isGroupRow
|
|
396
392
|
}) {
|
|
397
|
-
|
|
393
|
+
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
394
|
+
const minRowIdx = -1 - topSummaryRowsCount;
|
|
395
|
+
|
|
396
|
+
if (rowIdx === minRowIdx) {
|
|
398
397
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
399
398
|
type: 'HEADER'
|
|
400
399
|
});
|
|
401
400
|
}
|
|
402
401
|
|
|
402
|
+
if (topSummaryRows && rowIdx > minRowIdx && rowIdx <= topSummaryRowsCount + minRowIdx) {
|
|
403
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
404
|
+
type: 'SUMMARY',
|
|
405
|
+
row: topSummaryRows[rowIdx + topSummaryRowsCount]
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
|
|
403
409
|
if (rowIdx >= 0 && rowIdx < rows.length) {
|
|
404
410
|
const row = rows[rowIdx];
|
|
405
411
|
|
|
@@ -413,10 +419,10 @@
|
|
|
413
419
|
return undefined;
|
|
414
420
|
}
|
|
415
421
|
|
|
416
|
-
if (
|
|
422
|
+
if (bottomSummaryRows) {
|
|
417
423
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
418
424
|
type: 'SUMMARY',
|
|
419
|
-
row:
|
|
425
|
+
row: bottomSummaryRows[rowIdx - rows.length]
|
|
420
426
|
});
|
|
421
427
|
}
|
|
422
428
|
|
|
@@ -427,7 +433,8 @@
|
|
|
427
433
|
columns,
|
|
428
434
|
colSpanColumns,
|
|
429
435
|
rows,
|
|
430
|
-
|
|
436
|
+
topSummaryRows,
|
|
437
|
+
bottomSummaryRows,
|
|
431
438
|
minRowIdx,
|
|
432
439
|
maxRowIdx,
|
|
433
440
|
currentPosition: {
|
|
@@ -454,7 +461,8 @@
|
|
|
454
461
|
if (colIdx > nextIdx) break;
|
|
455
462
|
const colSpan = getSelectedCellColSpan({
|
|
456
463
|
rows,
|
|
457
|
-
|
|
464
|
+
topSummaryRows,
|
|
465
|
+
bottomSummaryRows,
|
|
458
466
|
rowIdx: nextRowIdx,
|
|
459
467
|
lastFrozenColumnIndex,
|
|
460
468
|
column,
|
|
@@ -560,8 +568,7 @@
|
|
|
560
568
|
round,
|
|
561
569
|
floor,
|
|
562
570
|
sign,
|
|
563
|
-
abs
|
|
564
|
-
ceil
|
|
571
|
+
abs
|
|
565
572
|
} = Math;
|
|
566
573
|
function assertIsValidKeyGetter(keyGetter) {
|
|
567
574
|
if (typeof keyGetter !== 'function') {
|
|
@@ -574,13 +581,15 @@
|
|
|
574
581
|
}) {
|
|
575
582
|
width = max(width, minWidth);
|
|
576
583
|
|
|
577
|
-
if (typeof maxWidth === 'number' && maxWidth
|
|
584
|
+
if (typeof maxWidth === 'number' && maxWidth >= minWidth) {
|
|
578
585
|
return min(width, maxWidth);
|
|
579
586
|
}
|
|
580
587
|
|
|
581
588
|
return width;
|
|
582
589
|
}
|
|
583
590
|
|
|
591
|
+
const DEFAULT_COLUMN_WIDTH = 'auto';
|
|
592
|
+
const DEFAULT_COLUMN_MIN_WIDTH = 80;
|
|
584
593
|
function useCalculatedColumns({
|
|
585
594
|
rawColumns,
|
|
586
595
|
columnWidths,
|
|
@@ -590,14 +599,12 @@
|
|
|
590
599
|
rawGroupBy,
|
|
591
600
|
enableVirtualization
|
|
592
601
|
}) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
const
|
|
599
|
-
const defaultSortable = (_defaultColumnOptions3 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.sortable) != null ? _defaultColumnOptions3 : false;
|
|
600
|
-
const defaultResizable = (_defaultColumnOptions4 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.resizable) != null ? _defaultColumnOptions4 : false;
|
|
602
|
+
const defaultWidth = defaultColumnOptions?.width ?? DEFAULT_COLUMN_WIDTH;
|
|
603
|
+
const defaultMinWidth = defaultColumnOptions?.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;
|
|
604
|
+
const defaultMaxWidth = defaultColumnOptions?.maxWidth ?? undefined;
|
|
605
|
+
const defaultFormatter = defaultColumnOptions?.formatter ?? valueFormatter;
|
|
606
|
+
const defaultSortable = defaultColumnOptions?.sortable ?? false;
|
|
607
|
+
const defaultResizable = defaultColumnOptions?.resizable ?? false;
|
|
601
608
|
const {
|
|
602
609
|
columns,
|
|
603
610
|
colSpanColumns,
|
|
@@ -607,27 +614,23 @@
|
|
|
607
614
|
const groupBy = [];
|
|
608
615
|
let lastFrozenColumnIndex = -1;
|
|
609
616
|
const columns = rawColumns.map(rawColumn => {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
const rowGroup = (_rawGroupBy$includes = rawGroupBy == null ? void 0 : rawGroupBy.includes(rawColumn.key)) != null ? _rawGroupBy$includes : false;
|
|
617
|
+
const rowGroup = rawGroupBy?.includes(rawColumn.key) ?? false;
|
|
613
618
|
const frozen = rowGroup || rawColumn.frozen || false;
|
|
614
619
|
const column = { ...rawColumn,
|
|
615
620
|
idx: 0,
|
|
616
621
|
frozen,
|
|
617
622
|
isLastFrozenColumn: false,
|
|
618
623
|
rowGroup,
|
|
619
|
-
width:
|
|
620
|
-
minWidth:
|
|
621
|
-
maxWidth:
|
|
622
|
-
sortable:
|
|
623
|
-
resizable:
|
|
624
|
-
formatter:
|
|
624
|
+
width: rawColumn.width ?? defaultWidth,
|
|
625
|
+
minWidth: rawColumn.minWidth ?? defaultMinWidth,
|
|
626
|
+
maxWidth: rawColumn.maxWidth ?? defaultMaxWidth,
|
|
627
|
+
sortable: rawColumn.sortable ?? defaultSortable,
|
|
628
|
+
resizable: rawColumn.resizable ?? defaultResizable,
|
|
629
|
+
formatter: rawColumn.formatter ?? defaultFormatter
|
|
625
630
|
};
|
|
626
631
|
|
|
627
632
|
if (rowGroup) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
(_column$groupFormatte = column.groupFormatter) != null ? _column$groupFormatte : column.groupFormatter = ToggleGroupFormatter;
|
|
633
|
+
column.groupFormatter ?? (column.groupFormatter = toggleGroupFormatter);
|
|
631
634
|
}
|
|
632
635
|
|
|
633
636
|
if (frozen) {
|
|
@@ -646,7 +649,7 @@
|
|
|
646
649
|
if (aKey === SELECT_COLUMN_KEY) return -1;
|
|
647
650
|
if (bKey === SELECT_COLUMN_KEY) return 1;
|
|
648
651
|
|
|
649
|
-
if (rawGroupBy
|
|
652
|
+
if (rawGroupBy?.includes(aKey)) {
|
|
650
653
|
if (rawGroupBy.includes(bKey)) {
|
|
651
654
|
return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);
|
|
652
655
|
}
|
|
@@ -654,7 +657,7 @@
|
|
|
654
657
|
return -1;
|
|
655
658
|
}
|
|
656
659
|
|
|
657
|
-
if (rawGroupBy
|
|
660
|
+
if (rawGroupBy?.includes(bKey)) return 1;
|
|
658
661
|
|
|
659
662
|
if (frozenA) {
|
|
660
663
|
if (frozenB) return 0;
|
|
@@ -689,6 +692,7 @@
|
|
|
689
692
|
};
|
|
690
693
|
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
691
694
|
const {
|
|
695
|
+
templateColumns,
|
|
692
696
|
layoutCssVars,
|
|
693
697
|
totalFrozenColumnWidth,
|
|
694
698
|
columnMetrics
|
|
@@ -696,48 +700,23 @@
|
|
|
696
700
|
const columnMetrics = new Map();
|
|
697
701
|
let left = 0;
|
|
698
702
|
let totalFrozenColumnWidth = 0;
|
|
699
|
-
|
|
700
|
-
let allocatedWidth = 0;
|
|
701
|
-
let unassignedColumnsCount = 0;
|
|
703
|
+
const templateColumns = [];
|
|
702
704
|
|
|
703
705
|
for (const column of columns) {
|
|
704
|
-
let width =
|
|
706
|
+
let width = columnWidths.get(column.key) ?? column.width;
|
|
705
707
|
|
|
706
|
-
if (width ===
|
|
707
|
-
unassignedColumnsCount++;
|
|
708
|
-
} else {
|
|
708
|
+
if (typeof width === 'number') {
|
|
709
709
|
width = clampColumnWidth(width, column);
|
|
710
|
-
allocatedWidth += width;
|
|
711
|
-
columnMetrics.set(column, {
|
|
712
|
-
width,
|
|
713
|
-
left: 0
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
for (const column of columns) {
|
|
719
|
-
let width;
|
|
720
|
-
|
|
721
|
-
if (columnMetrics.has(column)) {
|
|
722
|
-
const columnMetric = columnMetrics.get(column);
|
|
723
|
-
columnMetric.left = left;
|
|
724
|
-
({
|
|
725
|
-
width
|
|
726
|
-
} = columnMetric);
|
|
727
710
|
} else {
|
|
728
|
-
|
|
729
|
-
const unallocatedColumnWidth = round(unallocatedWidth / unassignedColumnsCount);
|
|
730
|
-
width = clampColumnWidth(unallocatedColumnWidth, column);
|
|
731
|
-
allocatedWidth += width;
|
|
732
|
-
unassignedColumnsCount--;
|
|
733
|
-
columnMetrics.set(column, {
|
|
734
|
-
width,
|
|
735
|
-
left
|
|
736
|
-
});
|
|
711
|
+
width = column.minWidth;
|
|
737
712
|
}
|
|
738
713
|
|
|
714
|
+
templateColumns.push(`${width}px`);
|
|
715
|
+
columnMetrics.set(column, {
|
|
716
|
+
width,
|
|
717
|
+
left
|
|
718
|
+
});
|
|
739
719
|
left += width;
|
|
740
|
-
templateColumns += `${width}px `;
|
|
741
720
|
}
|
|
742
721
|
|
|
743
722
|
if (lastFrozenColumnIndex !== -1) {
|
|
@@ -746,7 +725,7 @@
|
|
|
746
725
|
}
|
|
747
726
|
|
|
748
727
|
const layoutCssVars = {
|
|
749
|
-
gridTemplateColumns: templateColumns
|
|
728
|
+
gridTemplateColumns: templateColumns.join(' ')
|
|
750
729
|
};
|
|
751
730
|
|
|
752
731
|
for (let i = 0; i <= lastFrozenColumnIndex; i++) {
|
|
@@ -755,11 +734,12 @@
|
|
|
755
734
|
}
|
|
756
735
|
|
|
757
736
|
return {
|
|
737
|
+
templateColumns,
|
|
758
738
|
layoutCssVars,
|
|
759
739
|
totalFrozenColumnWidth,
|
|
760
740
|
columnMetrics
|
|
761
741
|
};
|
|
762
|
-
}, [columnWidths, columns,
|
|
742
|
+
}, [columnWidths, columns, lastFrozenColumnIndex]);
|
|
763
743
|
const [colOverscanStartIdx, colOverscanEndIdx] = F(() => {
|
|
764
744
|
if (!enableVirtualization) {
|
|
765
745
|
return [0, columns.length - 1];
|
|
@@ -813,6 +793,7 @@
|
|
|
813
793
|
colSpanColumns,
|
|
814
794
|
colOverscanStartIdx,
|
|
815
795
|
colOverscanEndIdx,
|
|
796
|
+
templateColumns,
|
|
816
797
|
layoutCssVars,
|
|
817
798
|
columnMetrics,
|
|
818
799
|
lastFrozenColumnIndex,
|
|
@@ -821,29 +802,11 @@
|
|
|
821
802
|
};
|
|
822
803
|
}
|
|
823
804
|
|
|
824
|
-
function getSpecifiedWidth({
|
|
825
|
-
key,
|
|
826
|
-
width
|
|
827
|
-
}, columnWidths, viewportWidth) {
|
|
828
|
-
if (columnWidths.has(key)) {
|
|
829
|
-
return columnWidths.get(key);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
if (typeof width === 'number') {
|
|
833
|
-
return width;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
if (typeof width === 'string' && /^\d+%$/.test(width)) {
|
|
837
|
-
return floor(viewportWidth * parseInt(width, 10) / 100);
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
return undefined;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
805
|
function useGridDimensions() {
|
|
844
806
|
const gridRef = _$1(null);
|
|
845
807
|
const [inlineSize, setInlineSize] = p(1);
|
|
846
808
|
const [blockSize, setBlockSize] = p(1);
|
|
809
|
+
const [isWidthInitialized, setWidthInitialized] = p(false);
|
|
847
810
|
useLayoutEffect(() => {
|
|
848
811
|
const {
|
|
849
812
|
ResizeObserver
|
|
@@ -861,11 +824,12 @@
|
|
|
861
824
|
} = gridRef.current.getBoundingClientRect();
|
|
862
825
|
const initialWidth = width - offsetWidth + clientWidth;
|
|
863
826
|
const initialHeight = height - offsetHeight + clientHeight;
|
|
864
|
-
setInlineSize(
|
|
827
|
+
setInlineSize(initialWidth);
|
|
865
828
|
setBlockSize(initialHeight);
|
|
829
|
+
setWidthInitialized(true);
|
|
866
830
|
const resizeObserver = new ResizeObserver(entries => {
|
|
867
831
|
const size = entries[0].contentBoxSize[0];
|
|
868
|
-
setInlineSize(
|
|
832
|
+
setInlineSize(size.inlineSize);
|
|
869
833
|
setBlockSize(size.blockSize);
|
|
870
834
|
});
|
|
871
835
|
resizeObserver.observe(gridRef.current);
|
|
@@ -873,11 +837,7 @@
|
|
|
873
837
|
resizeObserver.disconnect();
|
|
874
838
|
};
|
|
875
839
|
}, []);
|
|
876
|
-
return [gridRef, inlineSize, blockSize];
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
function handleDevicePixelRatio(size) {
|
|
880
|
-
return size - (devicePixelRatio === 1 ? 0 : ceil(devicePixelRatio));
|
|
840
|
+
return [gridRef, inlineSize, blockSize, isWidthInitialized];
|
|
881
841
|
}
|
|
882
842
|
|
|
883
843
|
function useLatestFunc(fn) {
|
|
@@ -885,9 +845,10 @@
|
|
|
885
845
|
h(() => {
|
|
886
846
|
ref.current = fn;
|
|
887
847
|
});
|
|
888
|
-
|
|
848
|
+
const callbackFn = T$1((...args) => {
|
|
889
849
|
ref.current(...args);
|
|
890
850
|
}, []);
|
|
851
|
+
return fn ? callbackFn : fn;
|
|
891
852
|
}
|
|
892
853
|
|
|
893
854
|
function useRovingCellRef(isSelected) {
|
|
@@ -898,7 +859,9 @@
|
|
|
898
859
|
}
|
|
899
860
|
|
|
900
861
|
const ref = T$1(cell => {
|
|
901
|
-
if (cell === null
|
|
862
|
+
if (cell === null) return;
|
|
863
|
+
scrollIntoView(cell);
|
|
864
|
+
if (cell.contains(document.activeElement)) return;
|
|
902
865
|
cell.focus({
|
|
903
866
|
preventScroll: true
|
|
904
867
|
});
|
|
@@ -922,12 +885,14 @@
|
|
|
922
885
|
columns,
|
|
923
886
|
colSpanColumns,
|
|
924
887
|
rows,
|
|
925
|
-
|
|
888
|
+
topSummaryRows,
|
|
889
|
+
bottomSummaryRows,
|
|
926
890
|
colOverscanStartIdx,
|
|
927
891
|
colOverscanEndIdx,
|
|
928
892
|
lastFrozenColumnIndex,
|
|
929
893
|
rowOverscanStartIdx,
|
|
930
894
|
rowOverscanEndIdx,
|
|
895
|
+
columnWidths,
|
|
931
896
|
isGroupRow
|
|
932
897
|
}) {
|
|
933
898
|
const startIdx = F(() => {
|
|
@@ -965,8 +930,19 @@
|
|
|
965
930
|
}
|
|
966
931
|
}
|
|
967
932
|
|
|
968
|
-
if (
|
|
969
|
-
for (const row of
|
|
933
|
+
if (topSummaryRows != null) {
|
|
934
|
+
for (const row of topSummaryRows) {
|
|
935
|
+
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
936
|
+
type: 'SUMMARY',
|
|
937
|
+
row
|
|
938
|
+
}))) {
|
|
939
|
+
break;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
if (bottomSummaryRows != null) {
|
|
945
|
+
for (const row of bottomSummaryRows) {
|
|
970
946
|
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
971
947
|
type: 'SUMMARY',
|
|
972
948
|
row
|
|
@@ -978,18 +954,36 @@
|
|
|
978
954
|
}
|
|
979
955
|
|
|
980
956
|
return startIdx;
|
|
981
|
-
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows,
|
|
982
|
-
|
|
957
|
+
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns, isGroupRow]);
|
|
958
|
+
const {
|
|
959
|
+
viewportColumns,
|
|
960
|
+
flexWidthViewportColumns
|
|
961
|
+
} = F(() => {
|
|
983
962
|
const viewportColumns = [];
|
|
963
|
+
const flexWidthViewportColumns = [];
|
|
984
964
|
|
|
985
965
|
for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {
|
|
986
966
|
const column = columns[colIdx];
|
|
987
967
|
if (colIdx < startIdx && !column.frozen) continue;
|
|
988
968
|
viewportColumns.push(column);
|
|
969
|
+
|
|
970
|
+
if (typeof column.width === 'string') {
|
|
971
|
+
flexWidthViewportColumns.push(column);
|
|
972
|
+
}
|
|
989
973
|
}
|
|
990
974
|
|
|
991
|
-
return
|
|
975
|
+
return {
|
|
976
|
+
viewportColumns,
|
|
977
|
+
flexWidthViewportColumns
|
|
978
|
+
};
|
|
992
979
|
}, [startIdx, colOverscanEndIdx, columns]);
|
|
980
|
+
const unsizedFlexWidthViewportColumns = F(() => {
|
|
981
|
+
return flexWidthViewportColumns.filter(column => !columnWidths.has(column.key));
|
|
982
|
+
}, [flexWidthViewportColumns, columnWidths]);
|
|
983
|
+
return {
|
|
984
|
+
viewportColumns,
|
|
985
|
+
flexWidthViewportColumns: unsizedFlexWidthViewportColumns
|
|
986
|
+
};
|
|
993
987
|
}
|
|
994
988
|
|
|
995
989
|
function isReadonlyArray(arr) {
|
|
@@ -1040,10 +1034,8 @@
|
|
|
1040
1034
|
}
|
|
1041
1035
|
|
|
1042
1036
|
Object.keys(rows).forEach((groupKey, posInSet, keys) => {
|
|
1043
|
-
var _expandedGroupIds$has;
|
|
1044
|
-
|
|
1045
1037
|
const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;
|
|
1046
|
-
const isExpanded =
|
|
1038
|
+
const isExpanded = expandedGroupIds?.has(id) ?? false;
|
|
1047
1039
|
const {
|
|
1048
1040
|
childRows,
|
|
1049
1041
|
childGroups,
|
|
@@ -1170,14 +1162,11 @@
|
|
|
1170
1162
|
};
|
|
1171
1163
|
}
|
|
1172
1164
|
|
|
1173
|
-
|
|
1174
|
-
styleInject$1(css_248z$a,{"insertAt":"top"});
|
|
1175
|
-
|
|
1176
|
-
const headerSortCell = "h1tr5c9i700-beta12";
|
|
1165
|
+
const headerSortCell = "h1e8ezgp7-0-0-beta-19";
|
|
1177
1166
|
const headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;
|
|
1178
|
-
const headerSortName = "
|
|
1167
|
+
const headerSortName = "h1rrblhe7-0-0-beta-19";
|
|
1179
1168
|
const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1180
|
-
function
|
|
1169
|
+
function headerRenderer({
|
|
1181
1170
|
column,
|
|
1182
1171
|
sortDirection,
|
|
1183
1172
|
priority,
|
|
@@ -1203,7 +1192,7 @@
|
|
|
1203
1192
|
children,
|
|
1204
1193
|
isCellSelected
|
|
1205
1194
|
}) {
|
|
1206
|
-
const
|
|
1195
|
+
const sortStatus = useDefaultComponents().sortStatus;
|
|
1207
1196
|
const {
|
|
1208
1197
|
ref,
|
|
1209
1198
|
tabIndex
|
|
@@ -1230,17 +1219,15 @@
|
|
|
1230
1219
|
className: headerSortNameClassname,
|
|
1231
1220
|
children: children
|
|
1232
1221
|
}), /*#__PURE__*/o("span", {
|
|
1233
|
-
children:
|
|
1234
|
-
sortDirection
|
|
1235
|
-
|
|
1222
|
+
children: sortStatus({
|
|
1223
|
+
sortDirection,
|
|
1224
|
+
priority
|
|
1225
|
+
})
|
|
1236
1226
|
})]
|
|
1237
1227
|
});
|
|
1238
1228
|
}
|
|
1239
1229
|
|
|
1240
|
-
|
|
1241
|
-
styleInject$1(css_248z$9,{"insertAt":"top"});
|
|
1242
|
-
|
|
1243
|
-
const cellResizable = "celq7o9700-beta12";
|
|
1230
|
+
const cellResizable = "celq7o97-0-0-beta-19";
|
|
1244
1231
|
const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
|
|
1245
1232
|
function HeaderCell({
|
|
1246
1233
|
column,
|
|
@@ -1255,21 +1242,19 @@
|
|
|
1255
1242
|
shouldFocusGrid,
|
|
1256
1243
|
direction
|
|
1257
1244
|
}) {
|
|
1258
|
-
var _column$headerRendere, _column$maxWidth;
|
|
1259
|
-
|
|
1260
1245
|
const isRtl = direction === 'rtl';
|
|
1261
1246
|
const {
|
|
1262
1247
|
ref,
|
|
1263
1248
|
tabIndex,
|
|
1264
1249
|
onFocus
|
|
1265
1250
|
} = useRovingCellRef(isCellSelected);
|
|
1266
|
-
const sortIndex = sortColumns
|
|
1251
|
+
const sortIndex = sortColumns?.findIndex(sort => sort.columnKey === column.key);
|
|
1267
1252
|
const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined;
|
|
1268
|
-
const sortDirection = sortColumn
|
|
1253
|
+
const sortDirection = sortColumn?.direction;
|
|
1269
1254
|
const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;
|
|
1270
1255
|
const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;
|
|
1271
1256
|
const className = getCellClassname(column, column.headerCellClass, column.resizable && cellResizableClassname);
|
|
1272
|
-
const
|
|
1257
|
+
const headerRenderer$1 = column.headerRenderer ?? headerRenderer;
|
|
1273
1258
|
|
|
1274
1259
|
function onPointerDown(event) {
|
|
1275
1260
|
if (event.pointerType === 'mouse' && event.buttons !== 1) {
|
|
@@ -1291,6 +1276,7 @@
|
|
|
1291
1276
|
}
|
|
1292
1277
|
|
|
1293
1278
|
function onPointerMove(event) {
|
|
1279
|
+
event.preventDefault();
|
|
1294
1280
|
const {
|
|
1295
1281
|
right,
|
|
1296
1282
|
left
|
|
@@ -1298,7 +1284,7 @@
|
|
|
1298
1284
|
const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
|
|
1299
1285
|
|
|
1300
1286
|
if (width > 0) {
|
|
1301
|
-
onColumnResize(column,
|
|
1287
|
+
onColumnResize(column, width);
|
|
1302
1288
|
}
|
|
1303
1289
|
}
|
|
1304
1290
|
|
|
@@ -1365,11 +1351,11 @@
|
|
|
1365
1351
|
return;
|
|
1366
1352
|
}
|
|
1367
1353
|
|
|
1368
|
-
onColumnResize(column, '
|
|
1354
|
+
onColumnResize(column, 'max-content');
|
|
1369
1355
|
}
|
|
1370
1356
|
|
|
1371
1357
|
function handleFocus(event) {
|
|
1372
|
-
onFocus
|
|
1358
|
+
onFocus?.(event);
|
|
1373
1359
|
|
|
1374
1360
|
if (shouldFocusGrid) {
|
|
1375
1361
|
selectCell(0);
|
|
@@ -1385,30 +1371,24 @@
|
|
|
1385
1371
|
ref: ref,
|
|
1386
1372
|
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1387
1373
|
className: className,
|
|
1388
|
-
style:
|
|
1389
|
-
minWidth: column.minWidth,
|
|
1390
|
-
maxWidth: (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : undefined
|
|
1391
|
-
},
|
|
1374
|
+
style: getCellStyle(column, colSpan),
|
|
1392
1375
|
onFocus: handleFocus,
|
|
1393
1376
|
onClick: onClick,
|
|
1394
1377
|
onDoubleClick: column.resizable ? onDoubleClick : undefined,
|
|
1395
1378
|
onPointerDown: column.resizable ? onPointerDown : undefined,
|
|
1396
|
-
children:
|
|
1397
|
-
column
|
|
1398
|
-
sortDirection
|
|
1399
|
-
priority
|
|
1400
|
-
onSort
|
|
1401
|
-
allRowsSelected
|
|
1402
|
-
onAllRowsSelectionChange
|
|
1403
|
-
isCellSelected
|
|
1379
|
+
children: headerRenderer$1({
|
|
1380
|
+
column,
|
|
1381
|
+
sortDirection,
|
|
1382
|
+
priority,
|
|
1383
|
+
onSort,
|
|
1384
|
+
allRowsSelected,
|
|
1385
|
+
onAllRowsSelectionChange,
|
|
1386
|
+
isCellSelected
|
|
1404
1387
|
})
|
|
1405
1388
|
});
|
|
1406
1389
|
}
|
|
1407
1390
|
|
|
1408
|
-
|
|
1409
|
-
styleInject$1(css_248z$8,{"insertAt":"top"});
|
|
1410
|
-
|
|
1411
|
-
const headerRow = "h197vzie700-beta12";
|
|
1391
|
+
const headerRow = "h197vzie7-0-0-beta-19";
|
|
1412
1392
|
const headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1413
1393
|
|
|
1414
1394
|
function HeaderRow({
|
|
@@ -1462,12 +1442,9 @@
|
|
|
1462
1442
|
|
|
1463
1443
|
const HeaderRow$1 = /*#__PURE__*/w(HeaderRow);
|
|
1464
1444
|
|
|
1465
|
-
|
|
1466
|
-
styleInject$1(css_248z$7,{"insertAt":"top"});
|
|
1467
|
-
|
|
1468
|
-
const cellCopied = "ccpfvsn700-beta12";
|
|
1445
|
+
const cellCopied = "ccpfvsn7-0-0-beta-19";
|
|
1469
1446
|
const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
|
|
1470
|
-
const cellDraggedOver = "
|
|
1447
|
+
const cellDraggedOver = "c1bmg16t7-0-0-beta-19";
|
|
1471
1448
|
const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1472
1449
|
|
|
1473
1450
|
function Cell({
|
|
@@ -1499,10 +1476,8 @@
|
|
|
1499
1476
|
}
|
|
1500
1477
|
|
|
1501
1478
|
function handleClick() {
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
selectCellWrapper((_column$editorOptions = column.editorOptions) == null ? void 0 : _column$editorOptions.editOnClick);
|
|
1505
|
-
onRowClick == null ? void 0 : onRowClick(row, column);
|
|
1479
|
+
selectCellWrapper(column.editorOptions?.editOnClick);
|
|
1480
|
+
onRowClick?.(row, column);
|
|
1506
1481
|
}
|
|
1507
1482
|
|
|
1508
1483
|
function handleContextMenu() {
|
|
@@ -1511,7 +1486,11 @@
|
|
|
1511
1486
|
|
|
1512
1487
|
function handleDoubleClick() {
|
|
1513
1488
|
selectCellWrapper(true);
|
|
1514
|
-
onRowDoubleClick
|
|
1489
|
+
onRowDoubleClick?.(row, column);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
function handleRowChange(newRow) {
|
|
1493
|
+
onRowChange(column, newRow);
|
|
1515
1494
|
}
|
|
1516
1495
|
|
|
1517
1496
|
return /*#__PURE__*/o("div", {
|
|
@@ -1530,11 +1509,11 @@
|
|
|
1530
1509
|
onFocus: onFocus,
|
|
1531
1510
|
...props,
|
|
1532
1511
|
children: !column.rowGroup && /*#__PURE__*/o(p$1, {
|
|
1533
|
-
children: [
|
|
1534
|
-
column
|
|
1535
|
-
row
|
|
1536
|
-
isCellSelected
|
|
1537
|
-
onRowChange:
|
|
1512
|
+
children: [column.formatter({
|
|
1513
|
+
column,
|
|
1514
|
+
row,
|
|
1515
|
+
isCellSelected,
|
|
1516
|
+
onRowChange: handleRowChange
|
|
1538
1517
|
}), dragHandle]
|
|
1539
1518
|
})
|
|
1540
1519
|
});
|
|
@@ -1565,16 +1544,16 @@
|
|
|
1565
1544
|
selectCell,
|
|
1566
1545
|
...props
|
|
1567
1546
|
}, ref) {
|
|
1568
|
-
const handleRowChange = useLatestFunc(newRow => {
|
|
1569
|
-
onRowChange(rowIdx, newRow);
|
|
1547
|
+
const handleRowChange = useLatestFunc((column, newRow) => {
|
|
1548
|
+
onRowChange(column, rowIdx, newRow);
|
|
1570
1549
|
});
|
|
1571
1550
|
|
|
1572
1551
|
function handleDragEnter(event) {
|
|
1573
|
-
setDraggedOverRowIdx
|
|
1574
|
-
onMouseEnter
|
|
1552
|
+
setDraggedOverRowIdx?.(rowIdx);
|
|
1553
|
+
onMouseEnter?.(event);
|
|
1575
1554
|
}
|
|
1576
1555
|
|
|
1577
|
-
className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass
|
|
1556
|
+
className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass?.(row), className, selectedCellIdx === -1 && rowSelectedClassname);
|
|
1578
1557
|
const cells = [];
|
|
1579
1558
|
|
|
1580
1559
|
for (let index = 0; index < viewportColumns.length; index++) {
|
|
@@ -1626,7 +1605,11 @@
|
|
|
1626
1605
|
});
|
|
1627
1606
|
}
|
|
1628
1607
|
|
|
1629
|
-
const
|
|
1608
|
+
const RowComponent = /*#__PURE__*/w( /*#__PURE__*/N(Row));
|
|
1609
|
+
function defaultRowRenderer(key, props) {
|
|
1610
|
+
return /*#__PURE__*/o(RowComponent, { ...props
|
|
1611
|
+
}, key);
|
|
1612
|
+
}
|
|
1630
1613
|
|
|
1631
1614
|
function GroupCell({
|
|
1632
1615
|
id,
|
|
@@ -1662,24 +1645,21 @@
|
|
|
1662
1645
|
},
|
|
1663
1646
|
onClick: isLevelMatching ? toggleGroup : undefined,
|
|
1664
1647
|
onFocus: onFocus,
|
|
1665
|
-
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter
|
|
1666
|
-
groupKey
|
|
1667
|
-
childRows
|
|
1668
|
-
column
|
|
1669
|
-
row
|
|
1670
|
-
isExpanded
|
|
1671
|
-
isCellSelected
|
|
1672
|
-
toggleGroup
|
|
1648
|
+
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter?.({
|
|
1649
|
+
groupKey,
|
|
1650
|
+
childRows,
|
|
1651
|
+
column,
|
|
1652
|
+
row,
|
|
1653
|
+
isExpanded,
|
|
1654
|
+
isCellSelected,
|
|
1655
|
+
toggleGroup
|
|
1673
1656
|
})
|
|
1674
1657
|
}, column.key);
|
|
1675
1658
|
}
|
|
1676
1659
|
|
|
1677
1660
|
const GroupCell$1 = /*#__PURE__*/w(GroupCell);
|
|
1678
1661
|
|
|
1679
|
-
|
|
1680
|
-
styleInject$1(css_248z$6,{"insertAt":"top"});
|
|
1681
|
-
|
|
1682
|
-
const groupRow = "gyxx7e9700-beta12";
|
|
1662
|
+
const groupRow = "gyxx7e97-0-0-beta-19";
|
|
1683
1663
|
const groupRowClassname = `rdg-group-row ${groupRow}`;
|
|
1684
1664
|
|
|
1685
1665
|
function GroupedRow({
|
|
@@ -1732,10 +1712,7 @@
|
|
|
1732
1712
|
|
|
1733
1713
|
const GroupRowRenderer = /*#__PURE__*/w(GroupedRow);
|
|
1734
1714
|
|
|
1735
|
-
|
|
1736
|
-
styleInject$1(css_248z$5,{"insertAt":"top"});
|
|
1737
|
-
|
|
1738
|
-
const summaryCellClassname = "s1n3hxke700-beta12";
|
|
1715
|
+
const summaryCellClassname = "s1n3hxke7-0-0-beta-19";
|
|
1739
1716
|
|
|
1740
1717
|
function SummaryCell({
|
|
1741
1718
|
column,
|
|
@@ -1750,7 +1727,6 @@
|
|
|
1750
1727
|
onFocus
|
|
1751
1728
|
} = useRovingCellRef(isCellSelected);
|
|
1752
1729
|
const {
|
|
1753
|
-
summaryFormatter: SummaryFormatter,
|
|
1754
1730
|
summaryCellClass
|
|
1755
1731
|
} = column;
|
|
1756
1732
|
const className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass);
|
|
@@ -1770,22 +1746,22 @@
|
|
|
1770
1746
|
style: getCellStyle(column, colSpan),
|
|
1771
1747
|
onClick: onClick,
|
|
1772
1748
|
onFocus: onFocus,
|
|
1773
|
-
children:
|
|
1774
|
-
column
|
|
1775
|
-
row
|
|
1776
|
-
isCellSelected
|
|
1749
|
+
children: column.summaryFormatter?.({
|
|
1750
|
+
column,
|
|
1751
|
+
row,
|
|
1752
|
+
isCellSelected
|
|
1777
1753
|
})
|
|
1778
1754
|
});
|
|
1779
1755
|
}
|
|
1780
1756
|
|
|
1781
1757
|
const SummaryCell$1 = /*#__PURE__*/w(SummaryCell);
|
|
1782
1758
|
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
const
|
|
1787
|
-
const summaryRowBorderClassname = "s1jijrjz700-beta12";
|
|
1759
|
+
const summaryRow = "snfqesz7-0-0-beta-19";
|
|
1760
|
+
const topSummaryRow = "t1jijrjz7-0-0-beta-19";
|
|
1761
|
+
const topSummaryRowBorderClassname = "t14bmecc7-0-0-beta-19";
|
|
1762
|
+
const bottomSummaryRowBorderClassname = "b1odhhml7-0-0-beta-19";
|
|
1788
1763
|
const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
1764
|
+
const topSummaryRowClassname = `rdg-top-summary-row ${topSummaryRow}`;
|
|
1789
1765
|
|
|
1790
1766
|
function SummaryRow({
|
|
1791
1767
|
rowIdx,
|
|
@@ -1796,6 +1772,7 @@
|
|
|
1796
1772
|
bottom,
|
|
1797
1773
|
lastFrozenColumnIndex,
|
|
1798
1774
|
selectedCellIdx,
|
|
1775
|
+
lastTopRowIdx,
|
|
1799
1776
|
selectCell,
|
|
1800
1777
|
'aria-rowindex': ariaRowIndex
|
|
1801
1778
|
}) {
|
|
@@ -1822,10 +1799,11 @@
|
|
|
1822
1799
|
}, column.key));
|
|
1823
1800
|
}
|
|
1824
1801
|
|
|
1802
|
+
const isTop = lastTopRowIdx !== undefined;
|
|
1825
1803
|
return /*#__PURE__*/o("div", {
|
|
1826
1804
|
role: "row",
|
|
1827
1805
|
"aria-rowindex": ariaRowIndex,
|
|
1828
|
-
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, rowIdx === 0 &&
|
|
1806
|
+
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, isTop ? [topSummaryRowClassname, lastTopRowIdx === rowIdx && topSummaryRowBorderClassname] : ['rdg-bottom-summary-row', rowIdx === 0 && bottomSummaryRowBorderClassname], selectedCellIdx === -1 && rowSelectedClassname),
|
|
1829
1807
|
style: { ...getRowStyle(gridRowStart),
|
|
1830
1808
|
'--rdg-summary-row-top': top !== undefined ? `${top}px` : undefined,
|
|
1831
1809
|
'--rdg-summary-row-bottom': bottom !== undefined ? `${bottom}px` : undefined
|
|
@@ -1836,22 +1814,16 @@
|
|
|
1836
1814
|
|
|
1837
1815
|
const SummaryRow$1 = /*#__PURE__*/w(SummaryRow);
|
|
1838
1816
|
|
|
1839
|
-
|
|
1840
|
-
styleInject$1(css_248z$3,{"insertAt":"top"});
|
|
1841
|
-
|
|
1842
|
-
const cellEditing = "c1tngyp1700-beta12";
|
|
1817
|
+
const cellEditing = "c1tngyp17-0-0-beta-19";
|
|
1843
1818
|
function EditCell({
|
|
1844
1819
|
column,
|
|
1845
1820
|
colSpan,
|
|
1846
1821
|
row,
|
|
1847
1822
|
onRowChange,
|
|
1848
|
-
closeEditor
|
|
1849
|
-
scrollToCell
|
|
1823
|
+
closeEditor
|
|
1850
1824
|
}) {
|
|
1851
|
-
var _column$editorOptions, _column$editorOptions4, _column$editorOptions5;
|
|
1852
|
-
|
|
1853
1825
|
const frameRequestRef = _$1();
|
|
1854
|
-
const commitOnOutsideClick =
|
|
1826
|
+
const commitOnOutsideClick = column.editorOptions?.commitOnOutsideClick !== false;
|
|
1855
1827
|
const commitOnOutsideMouseDown = useLatestFunc(() => {
|
|
1856
1828
|
onClose(true);
|
|
1857
1829
|
});
|
|
@@ -1884,11 +1856,8 @@
|
|
|
1884
1856
|
} else if (event.key === 'Enter') {
|
|
1885
1857
|
event.stopPropagation();
|
|
1886
1858
|
onClose(true);
|
|
1887
|
-
scrollToCell();
|
|
1888
1859
|
} else {
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
const onNavigation = (_column$editorOptions2 = (_column$editorOptions3 = column.editorOptions) == null ? void 0 : _column$editorOptions3.onNavigation) != null ? _column$editorOptions2 : onEditorNavigation;
|
|
1860
|
+
const onNavigation = column.editorOptions?.onNavigation ?? onEditorNavigation;
|
|
1892
1861
|
|
|
1893
1862
|
if (!onNavigation(event)) {
|
|
1894
1863
|
event.stopPropagation();
|
|
@@ -1907,7 +1876,7 @@
|
|
|
1907
1876
|
const {
|
|
1908
1877
|
cellClass
|
|
1909
1878
|
} = column;
|
|
1910
|
-
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !
|
|
1879
|
+
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !column.editorOptions?.renderFormatter && cellEditing);
|
|
1911
1880
|
return /*#__PURE__*/o("div", {
|
|
1912
1881
|
role: "gridcell",
|
|
1913
1882
|
"aria-colindex": column.idx + 1,
|
|
@@ -1918,25 +1887,22 @@
|
|
|
1918
1887
|
onKeyDown: onKeyDown,
|
|
1919
1888
|
onMouseDownCapture: commitOnOutsideClick ? cancelFrameRequest : undefined,
|
|
1920
1889
|
children: column.editor != null && /*#__PURE__*/o(p$1, {
|
|
1921
|
-
children: [
|
|
1922
|
-
column
|
|
1923
|
-
row
|
|
1924
|
-
onRowChange
|
|
1925
|
-
onClose
|
|
1926
|
-
}),
|
|
1927
|
-
column
|
|
1928
|
-
row
|
|
1890
|
+
children: [column.editor({
|
|
1891
|
+
column,
|
|
1892
|
+
row,
|
|
1893
|
+
onRowChange,
|
|
1894
|
+
onClose
|
|
1895
|
+
}), column.editorOptions?.renderFormatter && column.formatter({
|
|
1896
|
+
column,
|
|
1897
|
+
row,
|
|
1929
1898
|
isCellSelected: true,
|
|
1930
|
-
onRowChange
|
|
1899
|
+
onRowChange
|
|
1931
1900
|
})]
|
|
1932
1901
|
})
|
|
1933
1902
|
});
|
|
1934
1903
|
}
|
|
1935
1904
|
|
|
1936
|
-
|
|
1937
|
-
styleInject$1(css_248z$2,{"insertAt":"top"});
|
|
1938
|
-
|
|
1939
|
-
const cellDragHandle = "cadd3bp700-beta12";
|
|
1905
|
+
const cellDragHandle = "cadd3bp7-0-0-beta-19";
|
|
1940
1906
|
const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1941
1907
|
function DragHandle({
|
|
1942
1908
|
rows,
|
|
@@ -2013,7 +1979,7 @@
|
|
|
2013
1979
|
}
|
|
2014
1980
|
|
|
2015
1981
|
if (indexes.length > 0) {
|
|
2016
|
-
onRowsChange
|
|
1982
|
+
onRowsChange?.(updatedRows, {
|
|
2017
1983
|
indexes,
|
|
2018
1984
|
column
|
|
2019
1985
|
});
|
|
@@ -2027,15 +1993,25 @@
|
|
|
2027
1993
|
});
|
|
2028
1994
|
}
|
|
2029
1995
|
|
|
2030
|
-
|
|
2031
|
-
styleInject$1(css_248z$1,{"insertAt":"top"});
|
|
2032
|
-
|
|
2033
|
-
const arrow = "a888944700-beta12";
|
|
1996
|
+
const arrow = "a1mygwml7-0-0-beta-19";
|
|
2034
1997
|
const arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
2035
|
-
function
|
|
1998
|
+
function sortStatus({
|
|
1999
|
+
sortDirection,
|
|
2000
|
+
priority
|
|
2001
|
+
}) {
|
|
2002
|
+
return /*#__PURE__*/o(p$1, {
|
|
2003
|
+
children: [sortIcon({
|
|
2004
|
+
sortDirection
|
|
2005
|
+
}), sortPriority({
|
|
2006
|
+
priority
|
|
2007
|
+
})]
|
|
2008
|
+
});
|
|
2009
|
+
}
|
|
2010
|
+
function sortIcon({
|
|
2036
2011
|
sortDirection
|
|
2037
2012
|
}) {
|
|
2038
|
-
|
|
2013
|
+
if (sortDirection === undefined) return null;
|
|
2014
|
+
return /*#__PURE__*/o("svg", {
|
|
2039
2015
|
viewBox: "0 0 12 8",
|
|
2040
2016
|
width: "12",
|
|
2041
2017
|
height: "8",
|
|
@@ -2044,7 +2020,12 @@
|
|
|
2044
2020
|
children: /*#__PURE__*/o("path", {
|
|
2045
2021
|
d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'
|
|
2046
2022
|
})
|
|
2047
|
-
})
|
|
2023
|
+
});
|
|
2024
|
+
}
|
|
2025
|
+
function sortPriority({
|
|
2026
|
+
priority
|
|
2027
|
+
}) {
|
|
2028
|
+
return priority;
|
|
2048
2029
|
}
|
|
2049
2030
|
|
|
2050
2031
|
const initialPosition = {
|
|
@@ -2053,56 +2034,56 @@
|
|
|
2053
2034
|
mode: 'SELECT'
|
|
2054
2035
|
};
|
|
2055
2036
|
|
|
2056
|
-
function DataGrid({
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2037
|
+
function DataGrid(props, ref) {
|
|
2038
|
+
const {
|
|
2039
|
+
columns: rawColumns,
|
|
2040
|
+
rows: rawRows,
|
|
2041
|
+
topSummaryRows,
|
|
2042
|
+
bottomSummaryRows,
|
|
2043
|
+
rowKeyGetter,
|
|
2044
|
+
onRowsChange,
|
|
2045
|
+
rowHeight: rawRowHeight,
|
|
2046
|
+
headerRowHeight: rawHeaderRowHeight,
|
|
2047
|
+
summaryRowHeight: rawSummaryRowHeight,
|
|
2048
|
+
selectedRows,
|
|
2049
|
+
onSelectedRowsChange,
|
|
2050
|
+
sortColumns,
|
|
2051
|
+
onSortColumnsChange,
|
|
2052
|
+
defaultColumnOptions,
|
|
2053
|
+
groupBy: rawGroupBy,
|
|
2054
|
+
rowGrouper,
|
|
2055
|
+
expandedGroupIds,
|
|
2056
|
+
onExpandedGroupIdsChange,
|
|
2057
|
+
onRowClick,
|
|
2058
|
+
onRowDoubleClick,
|
|
2059
|
+
onScroll,
|
|
2060
|
+
onColumnResize,
|
|
2061
|
+
onFill,
|
|
2062
|
+
onCopy,
|
|
2063
|
+
onPaste,
|
|
2064
|
+
cellNavigationMode: rawCellNavigationMode,
|
|
2065
|
+
enableVirtualization: rawEnableVirtualization,
|
|
2066
|
+
renderers,
|
|
2067
|
+
className,
|
|
2068
|
+
style,
|
|
2069
|
+
rowClass,
|
|
2070
|
+
direction: rawDirection,
|
|
2071
|
+
'aria-label': ariaLabel,
|
|
2072
|
+
'aria-labelledby': ariaLabelledBy,
|
|
2073
|
+
'aria-describedby': ariaDescribedBy,
|
|
2074
|
+
'data-testid': testId
|
|
2075
|
+
} = props;
|
|
2095
2076
|
const defaultComponents = useDefaultComponents();
|
|
2096
|
-
|
|
2097
|
-
const headerRowHeight = rawHeaderRowHeight
|
|
2098
|
-
const summaryRowHeight = rawSummaryRowHeight
|
|
2099
|
-
const
|
|
2100
|
-
const
|
|
2101
|
-
const checkboxFormatter
|
|
2102
|
-
const noRowsFallback =
|
|
2103
|
-
const cellNavigationMode = rawCellNavigationMode
|
|
2104
|
-
|
|
2105
|
-
|
|
2077
|
+
const rowHeight = rawRowHeight ?? 35;
|
|
2078
|
+
const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
2079
|
+
const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
2080
|
+
const rowRenderer = renderers?.rowRenderer ?? defaultComponents?.rowRenderer ?? defaultRowRenderer;
|
|
2081
|
+
const sortStatus$1 = renderers?.sortStatus ?? defaultComponents?.sortStatus ?? sortStatus;
|
|
2082
|
+
const checkboxFormatter$1 = renderers?.checkboxFormatter ?? defaultComponents?.checkboxFormatter ?? checkboxFormatter;
|
|
2083
|
+
const noRowsFallback = renderers?.noRowsFallback ?? defaultComponents?.noRowsFallback;
|
|
2084
|
+
const cellNavigationMode = rawCellNavigationMode ?? 'NONE';
|
|
2085
|
+
const enableVirtualization = rawEnableVirtualization ?? true;
|
|
2086
|
+
const direction = rawDirection ?? 'ltr';
|
|
2106
2087
|
const [scrollTop, setScrollTop] = p(0);
|
|
2107
2088
|
const [scrollLeft, setScrollLeft] = p(0);
|
|
2108
2089
|
const [columnWidths, setColumnWidths] = p(() => new Map());
|
|
@@ -2110,24 +2091,24 @@
|
|
|
2110
2091
|
const [copiedCell, setCopiedCell] = p(null);
|
|
2111
2092
|
const [isDragging, setDragging] = p(false);
|
|
2112
2093
|
const [draggedOverRowIdx, setOverRowIdx] = p(undefined);
|
|
2113
|
-
const [autoResizeColumn, setAutoResizeColumn] = p(null);
|
|
2114
2094
|
const prevSelectedPosition = _$1(selectedPosition);
|
|
2115
2095
|
const latestDraggedOverRowIdx = _$1(draggedOverRowIdx);
|
|
2116
2096
|
const lastSelectedRowIdx = _$1(-1);
|
|
2117
2097
|
const rowRef = _$1(null);
|
|
2118
|
-
const [gridRef, gridWidth, gridHeight] = useGridDimensions();
|
|
2098
|
+
const [gridRef, gridWidth, gridHeight, isWidthInitialized] = useGridDimensions();
|
|
2119
2099
|
const headerRowsCount = 1;
|
|
2120
|
-
const
|
|
2100
|
+
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
2101
|
+
const bottomSummaryRowsCount = bottomSummaryRows?.length ?? 0;
|
|
2102
|
+
const summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount;
|
|
2121
2103
|
const clientHeight = gridHeight - headerRowHeight - summaryRowsCount * summaryRowHeight;
|
|
2122
2104
|
const isSelectable = selectedRows != null && onSelectedRowsChange != null;
|
|
2123
|
-
const isHeaderRowSelected = selectedPosition.rowIdx === -1;
|
|
2124
2105
|
const isRtl = direction === 'rtl';
|
|
2125
2106
|
const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';
|
|
2126
2107
|
const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';
|
|
2127
2108
|
const defaultGridComponents = F(() => ({
|
|
2128
|
-
|
|
2129
|
-
checkboxFormatter
|
|
2130
|
-
}), [
|
|
2109
|
+
sortStatus: sortStatus$1,
|
|
2110
|
+
checkboxFormatter: checkboxFormatter$1
|
|
2111
|
+
}), [sortStatus$1, checkboxFormatter$1]);
|
|
2131
2112
|
const allRowsSelected = F(() => {
|
|
2132
2113
|
const {
|
|
2133
2114
|
length
|
|
@@ -2139,6 +2120,7 @@
|
|
|
2139
2120
|
colSpanColumns,
|
|
2140
2121
|
colOverscanStartIdx,
|
|
2141
2122
|
colOverscanEndIdx,
|
|
2123
|
+
templateColumns,
|
|
2142
2124
|
layoutCssVars,
|
|
2143
2125
|
columnMetrics,
|
|
2144
2126
|
lastFrozenColumnIndex,
|
|
@@ -2174,7 +2156,10 @@
|
|
|
2174
2156
|
expandedGroupIds,
|
|
2175
2157
|
enableVirtualization
|
|
2176
2158
|
});
|
|
2177
|
-
const
|
|
2159
|
+
const {
|
|
2160
|
+
viewportColumns,
|
|
2161
|
+
flexWidthViewportColumns
|
|
2162
|
+
} = useViewportColumns({
|
|
2178
2163
|
columns,
|
|
2179
2164
|
colSpanColumns,
|
|
2180
2165
|
colOverscanStartIdx,
|
|
@@ -2183,16 +2168,22 @@
|
|
|
2183
2168
|
rowOverscanStartIdx,
|
|
2184
2169
|
rowOverscanEndIdx,
|
|
2185
2170
|
rows,
|
|
2186
|
-
|
|
2171
|
+
topSummaryRows,
|
|
2172
|
+
bottomSummaryRows,
|
|
2173
|
+
columnWidths,
|
|
2187
2174
|
isGroupRow
|
|
2188
2175
|
});
|
|
2189
2176
|
const hasGroups = groupBy.length > 0 && typeof rowGrouper === 'function';
|
|
2190
2177
|
const minColIdx = hasGroups ? -1 : 0;
|
|
2191
2178
|
const maxColIdx = columns.length - 1;
|
|
2192
|
-
const minRowIdx = -1;
|
|
2193
|
-
const maxRowIdx =
|
|
2179
|
+
const minRowIdx = -1 - topSummaryRowsCount;
|
|
2180
|
+
const maxRowIdx = rows.length + bottomSummaryRowsCount - 1;
|
|
2194
2181
|
const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition);
|
|
2195
2182
|
const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition);
|
|
2183
|
+
const handleColumnResizeLatest = useLatestFunc(handleColumnResize);
|
|
2184
|
+
const onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange);
|
|
2185
|
+
const onRowClickLatest = useLatestFunc(onRowClick);
|
|
2186
|
+
const onRowDoubleClickLatest = useLatestFunc(onRowDoubleClick);
|
|
2196
2187
|
const selectRowLatest = useLatestFunc(selectRow);
|
|
2197
2188
|
const selectAllRowsLatest = useLatestFunc(selectAllRows);
|
|
2198
2189
|
const handleFormatterRowChangeLatest = useLatestFunc(updateRow);
|
|
@@ -2211,12 +2202,19 @@
|
|
|
2211
2202
|
});
|
|
2212
2203
|
const selectHeaderCellLatest = useLatestFunc(idx => {
|
|
2213
2204
|
selectCell({
|
|
2214
|
-
rowIdx:
|
|
2205
|
+
rowIdx: minRowIdx,
|
|
2215
2206
|
idx
|
|
2216
2207
|
});
|
|
2217
2208
|
});
|
|
2218
|
-
const
|
|
2219
|
-
const rowIdx =
|
|
2209
|
+
const selectTopSummaryCellLatest = useLatestFunc((summaryRow, column) => {
|
|
2210
|
+
const rowIdx = topSummaryRows.indexOf(summaryRow);
|
|
2211
|
+
selectCell({
|
|
2212
|
+
rowIdx: rowIdx + minRowIdx + 1,
|
|
2213
|
+
idx: column.idx
|
|
2214
|
+
});
|
|
2215
|
+
});
|
|
2216
|
+
const selectBottomSummaryCellLatest = useLatestFunc((summaryRow, column) => {
|
|
2217
|
+
const rowIdx = bottomSummaryRows.indexOf(summaryRow) + rows.length;
|
|
2220
2218
|
selectCell({
|
|
2221
2219
|
rowIdx,
|
|
2222
2220
|
idx: column.idx
|
|
@@ -2230,36 +2228,34 @@
|
|
|
2230
2228
|
}
|
|
2231
2229
|
|
|
2232
2230
|
prevSelectedPosition.current = selectedPosition;
|
|
2233
|
-
scrollToCell(selectedPosition);
|
|
2234
2231
|
|
|
2235
2232
|
if (selectedPosition.idx === -1) {
|
|
2236
2233
|
rowRef.current.focus({
|
|
2237
2234
|
preventScroll: true
|
|
2238
2235
|
});
|
|
2236
|
+
scrollIntoView(rowRef.current);
|
|
2239
2237
|
}
|
|
2240
2238
|
});
|
|
2241
2239
|
useLayoutEffect(() => {
|
|
2242
|
-
if (
|
|
2243
|
-
const columnElement = gridRef.current.querySelector(`[aria-colindex="${autoResizeColumn.idx + 1}"]`);
|
|
2244
|
-
const {
|
|
2245
|
-
width
|
|
2246
|
-
} = columnElement.getBoundingClientRect();
|
|
2240
|
+
if (!isWidthInitialized || flexWidthViewportColumns.length === 0) return;
|
|
2247
2241
|
setColumnWidths(columnWidths => {
|
|
2248
2242
|
const newColumnWidths = new Map(columnWidths);
|
|
2249
|
-
|
|
2243
|
+
const grid = gridRef.current;
|
|
2244
|
+
|
|
2245
|
+
for (const column of flexWidthViewportColumns) {
|
|
2246
|
+
const measuringCell = grid.querySelector(`[data-measuring-cell-key="${column.key}"]`);
|
|
2247
|
+
const {
|
|
2248
|
+
width
|
|
2249
|
+
} = measuringCell.getBoundingClientRect();
|
|
2250
|
+
newColumnWidths.set(column.key, width);
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2250
2253
|
return newColumnWidths;
|
|
2251
2254
|
});
|
|
2252
|
-
|
|
2253
|
-
onColumnResize == null ? void 0 : onColumnResize(autoResizeColumn.idx, width);
|
|
2254
|
-
}, [autoResizeColumn, gridRef, onColumnResize]);
|
|
2255
|
+
}, [isWidthInitialized, flexWidthViewportColumns, gridRef]);
|
|
2255
2256
|
A(ref, () => ({
|
|
2256
2257
|
element: gridRef.current,
|
|
2257
|
-
|
|
2258
|
-
scrollToColumn(idx) {
|
|
2259
|
-
scrollToCell({
|
|
2260
|
-
idx
|
|
2261
|
-
});
|
|
2262
|
-
},
|
|
2258
|
+
scrollToColumn,
|
|
2263
2259
|
|
|
2264
2260
|
scrollToRow(rowIdx) {
|
|
2265
2261
|
const {
|
|
@@ -2274,24 +2270,34 @@
|
|
|
2274
2270
|
|
|
2275
2271
|
selectCell
|
|
2276
2272
|
}));
|
|
2277
|
-
const handleColumnResize = T$1((column, width) => {
|
|
2278
|
-
if (width === 'auto') {
|
|
2279
|
-
setAutoResizeColumn(column);
|
|
2280
|
-
return;
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
setColumnWidths(columnWidths => {
|
|
2284
|
-
const newColumnWidths = new Map(columnWidths);
|
|
2285
|
-
newColumnWidths.set(column.key, width);
|
|
2286
|
-
return newColumnWidths;
|
|
2287
|
-
});
|
|
2288
|
-
onColumnResize == null ? void 0 : onColumnResize(column.idx, width);
|
|
2289
|
-
}, [onColumnResize]);
|
|
2290
2273
|
const setDraggedOverRowIdx = T$1(rowIdx => {
|
|
2291
2274
|
setOverRowIdx(rowIdx);
|
|
2292
2275
|
latestDraggedOverRowIdx.current = rowIdx;
|
|
2293
2276
|
}, []);
|
|
2294
2277
|
|
|
2278
|
+
function handleColumnResize(column, width) {
|
|
2279
|
+
const {
|
|
2280
|
+
style
|
|
2281
|
+
} = gridRef.current;
|
|
2282
|
+
const newTemplateColumns = [...templateColumns];
|
|
2283
|
+
newTemplateColumns[column.idx] = width === 'max-content' ? width : `${width}px`;
|
|
2284
|
+
style.gridTemplateColumns = newTemplateColumns.join(' ');
|
|
2285
|
+
const measuringCell = gridRef.current.querySelector(`[data-measuring-cell-key="${column.key}"]`);
|
|
2286
|
+
const measuredWidth = measuringCell.getBoundingClientRect().width;
|
|
2287
|
+
const measuredWidthPx = `${measuredWidth}px`;
|
|
2288
|
+
|
|
2289
|
+
if (newTemplateColumns[column.idx] !== measuredWidthPx) {
|
|
2290
|
+
newTemplateColumns[column.idx] = measuredWidthPx;
|
|
2291
|
+
style.gridTemplateColumns = newTemplateColumns.join(' ');
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
if (columnWidths.get(column.key) === measuredWidth) return;
|
|
2295
|
+
const newColumnWidths = new Map(columnWidths);
|
|
2296
|
+
newColumnWidths.set(column.key, measuredWidth);
|
|
2297
|
+
setColumnWidths(newColumnWidths);
|
|
2298
|
+
onColumnResize?.(column.idx, measuredWidth);
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2295
2301
|
function selectRow({
|
|
2296
2302
|
row,
|
|
2297
2303
|
checked,
|
|
@@ -2438,16 +2444,18 @@
|
|
|
2438
2444
|
scrollTop,
|
|
2439
2445
|
scrollLeft
|
|
2440
2446
|
} = event.currentTarget;
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2447
|
+
sn(() => {
|
|
2448
|
+
setScrollTop(scrollTop);
|
|
2449
|
+
setScrollLeft(abs(scrollLeft));
|
|
2450
|
+
});
|
|
2451
|
+
onScroll?.(event);
|
|
2444
2452
|
}
|
|
2445
2453
|
|
|
2446
2454
|
function getRawRowIdx(rowIdx) {
|
|
2447
2455
|
return hasGroups ? rawRows.indexOf(rows[rowIdx]) : rowIdx;
|
|
2448
2456
|
}
|
|
2449
2457
|
|
|
2450
|
-
function updateRow(rowIdx, row) {
|
|
2458
|
+
function updateRow(column, rowIdx, row) {
|
|
2451
2459
|
if (typeof onRowsChange !== 'function') return;
|
|
2452
2460
|
const rawRowIdx = getRawRowIdx(rowIdx);
|
|
2453
2461
|
if (row === rawRows[rawRowIdx]) return;
|
|
@@ -2455,13 +2463,13 @@
|
|
|
2455
2463
|
updatedRows[rawRowIdx] = row;
|
|
2456
2464
|
onRowsChange(updatedRows, {
|
|
2457
2465
|
indexes: [rawRowIdx],
|
|
2458
|
-
column
|
|
2466
|
+
column
|
|
2459
2467
|
});
|
|
2460
2468
|
}
|
|
2461
2469
|
|
|
2462
2470
|
function commitEditorChanges() {
|
|
2463
2471
|
if (selectedPosition.mode !== 'EDIT') return;
|
|
2464
|
-
updateRow(selectedPosition.rowIdx, selectedPosition.row);
|
|
2472
|
+
updateRow(columns[selectedPosition.idx], selectedPosition.rowIdx, selectedPosition.row);
|
|
2465
2473
|
}
|
|
2466
2474
|
|
|
2467
2475
|
function handleCopy() {
|
|
@@ -2475,7 +2483,7 @@
|
|
|
2475
2483
|
row: sourceRow,
|
|
2476
2484
|
columnKey: sourceColumnKey
|
|
2477
2485
|
});
|
|
2478
|
-
onCopy
|
|
2486
|
+
onCopy?.({
|
|
2479
2487
|
sourceRow,
|
|
2480
2488
|
sourceColumnKey
|
|
2481
2489
|
});
|
|
@@ -2490,19 +2498,18 @@
|
|
|
2490
2498
|
idx,
|
|
2491
2499
|
rowIdx
|
|
2492
2500
|
} = selectedPosition;
|
|
2501
|
+
const targetColumn = columns[idx];
|
|
2493
2502
|
const targetRow = rawRows[getRawRowIdx(rowIdx)];
|
|
2494
2503
|
const updatedTargetRow = onPaste({
|
|
2495
2504
|
sourceRow: copiedCell.row,
|
|
2496
2505
|
sourceColumnKey: copiedCell.columnKey,
|
|
2497
2506
|
targetRow,
|
|
2498
|
-
targetColumnKey:
|
|
2507
|
+
targetColumnKey: targetColumn.key
|
|
2499
2508
|
});
|
|
2500
|
-
updateRow(rowIdx, updatedTargetRow);
|
|
2509
|
+
updateRow(targetColumn, rowIdx, updatedTargetRow);
|
|
2501
2510
|
}
|
|
2502
2511
|
|
|
2503
2512
|
function handleCellInput(event) {
|
|
2504
|
-
var _column$editorOptions;
|
|
2505
|
-
|
|
2506
2513
|
if (!selectedCellIsWithinViewportBounds) return;
|
|
2507
2514
|
const row = rows[selectedPosition.rowIdx];
|
|
2508
2515
|
if (isGroupRow(row)) return;
|
|
@@ -2524,7 +2531,7 @@
|
|
|
2524
2531
|
}
|
|
2525
2532
|
|
|
2526
2533
|
const column = columns[selectedPosition.idx];
|
|
2527
|
-
|
|
2534
|
+
column.editorOptions?.onCellKeyDown?.(event);
|
|
2528
2535
|
if (event.isDefaultPrevented()) return;
|
|
2529
2536
|
|
|
2530
2537
|
if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) {
|
|
@@ -2584,7 +2591,7 @@
|
|
|
2584
2591
|
originalRow: row
|
|
2585
2592
|
});
|
|
2586
2593
|
} else if (isSamePosition(selectedPosition, position)) {
|
|
2587
|
-
|
|
2594
|
+
scrollIntoView(gridRef.current?.querySelector('[tabindex="0"]'));
|
|
2588
2595
|
} else {
|
|
2589
2596
|
setSelectedPosition({ ...position,
|
|
2590
2597
|
mode: 'SELECT'
|
|
@@ -2592,19 +2599,16 @@
|
|
|
2592
2599
|
}
|
|
2593
2600
|
}
|
|
2594
2601
|
|
|
2595
|
-
function
|
|
2596
|
-
idx,
|
|
2597
|
-
rowIdx
|
|
2598
|
-
}) {
|
|
2602
|
+
function scrollToColumn(idx) {
|
|
2599
2603
|
const {
|
|
2600
2604
|
current
|
|
2601
2605
|
} = gridRef;
|
|
2602
2606
|
if (!current) return;
|
|
2603
2607
|
|
|
2604
|
-
if (
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
+
if (idx > lastFrozenColumnIndex) {
|
|
2609
|
+
const {
|
|
2610
|
+
rowIdx
|
|
2611
|
+
} = selectedPosition;
|
|
2608
2612
|
if (!isCellWithinSelectionBounds({
|
|
2609
2613
|
rowIdx,
|
|
2610
2614
|
idx
|
|
@@ -2620,7 +2624,8 @@
|
|
|
2620
2624
|
let right = left + width;
|
|
2621
2625
|
const colSpan = getSelectedCellColSpan({
|
|
2622
2626
|
rows,
|
|
2623
|
-
|
|
2627
|
+
topSummaryRows,
|
|
2628
|
+
bottomSummaryRows,
|
|
2624
2629
|
rowIdx,
|
|
2625
2630
|
lastFrozenColumnIndex,
|
|
2626
2631
|
column,
|
|
@@ -2645,17 +2650,6 @@
|
|
|
2645
2650
|
current.scrollLeft = (right - clientWidth) * sign;
|
|
2646
2651
|
}
|
|
2647
2652
|
}
|
|
2648
|
-
|
|
2649
|
-
if (typeof rowIdx === 'number' && isRowIdxWithinViewportBounds(rowIdx)) {
|
|
2650
|
-
const rowTop = getRowTop(rowIdx);
|
|
2651
|
-
const rowHeight = getRowHeight(rowIdx);
|
|
2652
|
-
|
|
2653
|
-
if (rowTop < scrollTop) {
|
|
2654
|
-
current.scrollTop = rowTop;
|
|
2655
|
-
} else if (rowTop + rowHeight > scrollTop + clientHeight) {
|
|
2656
|
-
current.scrollTop = rowTop + rowHeight - clientHeight;
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
2653
|
}
|
|
2660
2654
|
|
|
2661
2655
|
function getNextPosition(key, ctrlKey, shiftKey) {
|
|
@@ -2793,7 +2787,8 @@
|
|
|
2793
2787
|
columns,
|
|
2794
2788
|
colSpanColumns,
|
|
2795
2789
|
rows,
|
|
2796
|
-
|
|
2790
|
+
topSummaryRows,
|
|
2791
|
+
bottomSummaryRows,
|
|
2797
2792
|
minRowIdx,
|
|
2798
2793
|
maxRowIdx,
|
|
2799
2794
|
lastFrozenColumnIndex,
|
|
@@ -2816,14 +2811,15 @@
|
|
|
2816
2811
|
}
|
|
2817
2812
|
|
|
2818
2813
|
function getLayoutCssVars() {
|
|
2819
|
-
if (
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2814
|
+
if (flexWidthViewportColumns.length === 0) return layoutCssVars;
|
|
2815
|
+
const newTemplateColumns = [...templateColumns];
|
|
2816
|
+
|
|
2817
|
+
for (const column of flexWidthViewportColumns) {
|
|
2818
|
+
newTemplateColumns[column.idx] = column.width;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2825
2821
|
return { ...layoutCssVars,
|
|
2826
|
-
gridTemplateColumns:
|
|
2822
|
+
gridTemplateColumns: newTemplateColumns.join(' ')
|
|
2827
2823
|
};
|
|
2828
2824
|
}
|
|
2829
2825
|
|
|
@@ -2870,7 +2866,7 @@
|
|
|
2870
2866
|
|
|
2871
2867
|
const onRowChange = (row, commitChanges) => {
|
|
2872
2868
|
if (commitChanges) {
|
|
2873
|
-
updateRow(selectedPosition.rowIdx, row);
|
|
2869
|
+
updateRow(column, selectedPosition.rowIdx, row);
|
|
2874
2870
|
closeEditor();
|
|
2875
2871
|
} else {
|
|
2876
2872
|
setSelectedPosition(position => ({ ...position,
|
|
@@ -2888,10 +2884,7 @@
|
|
|
2888
2884
|
colSpan: colSpan,
|
|
2889
2885
|
row: row,
|
|
2890
2886
|
onRowChange: onRowChange,
|
|
2891
|
-
closeEditor: closeEditor
|
|
2892
|
-
scrollToCell: () => {
|
|
2893
|
-
scrollToCell(selectedPosition);
|
|
2894
|
-
}
|
|
2887
|
+
closeEditor: closeEditor
|
|
2895
2888
|
}, column.key);
|
|
2896
2889
|
}
|
|
2897
2890
|
|
|
@@ -2930,7 +2923,7 @@
|
|
|
2930
2923
|
}
|
|
2931
2924
|
|
|
2932
2925
|
const row = rows[rowIdx];
|
|
2933
|
-
const gridRowStart = headerRowsCount + rowIdx + 1;
|
|
2926
|
+
const gridRowStart = headerRowsCount + topSummaryRowsCount + rowIdx + 1;
|
|
2934
2927
|
|
|
2935
2928
|
if (isGroupRow(row)) {
|
|
2936
2929
|
({
|
|
@@ -2941,7 +2934,7 @@
|
|
|
2941
2934
|
"aria-level": row.level + 1,
|
|
2942
2935
|
"aria-setsize": row.setSize,
|
|
2943
2936
|
"aria-posinset": row.posInSet + 1,
|
|
2944
|
-
"aria-rowindex": headerRowsCount + startRowIndex + 1,
|
|
2937
|
+
"aria-rowindex": headerRowsCount + topSummaryRowsCount + startRowIndex + 1,
|
|
2945
2938
|
"aria-selected": isSelectable ? isGroupRowSelected : undefined,
|
|
2946
2939
|
id: row.id,
|
|
2947
2940
|
groupKey: row.groupKey,
|
|
@@ -2966,36 +2959,34 @@
|
|
|
2966
2959
|
let isRowSelected = false;
|
|
2967
2960
|
|
|
2968
2961
|
if (typeof rowKeyGetter === 'function') {
|
|
2969
|
-
var _selectedRows$has;
|
|
2970
|
-
|
|
2971
2962
|
key = rowKeyGetter(row);
|
|
2972
|
-
isRowSelected =
|
|
2963
|
+
isRowSelected = selectedRows?.has(key) ?? false;
|
|
2973
2964
|
} else {
|
|
2974
2965
|
key = hasGroups ? startRowIndex : rowIdx;
|
|
2975
2966
|
}
|
|
2976
2967
|
|
|
2977
|
-
rowElements.push(
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
rowIdx
|
|
2981
|
-
row
|
|
2968
|
+
rowElements.push(rowRenderer(key, {
|
|
2969
|
+
'aria-rowindex': headerRowsCount + topSummaryRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1,
|
|
2970
|
+
'aria-selected': isSelectable ? isRowSelected : undefined,
|
|
2971
|
+
rowIdx,
|
|
2972
|
+
row,
|
|
2982
2973
|
viewportColumns: rowColumns,
|
|
2983
|
-
isRowSelected
|
|
2984
|
-
onRowClick:
|
|
2985
|
-
onRowDoubleClick:
|
|
2986
|
-
rowClass
|
|
2987
|
-
gridRowStart
|
|
2974
|
+
isRowSelected,
|
|
2975
|
+
onRowClick: onRowClickLatest,
|
|
2976
|
+
onRowDoubleClick: onRowDoubleClickLatest,
|
|
2977
|
+
rowClass,
|
|
2978
|
+
gridRowStart,
|
|
2988
2979
|
height: getRowHeight(rowIdx),
|
|
2989
2980
|
copiedCellIdx: copiedCell !== null && copiedCell.row === row ? columns.findIndex(c => c.key === copiedCell.columnKey) : undefined,
|
|
2990
2981
|
selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,
|
|
2991
2982
|
draggedOverCellIdx: getDraggedOverCellIdx(rowIdx),
|
|
2992
2983
|
setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : undefined,
|
|
2993
|
-
lastFrozenColumnIndex
|
|
2984
|
+
lastFrozenColumnIndex,
|
|
2994
2985
|
onRowChange: handleFormatterRowChangeLatest,
|
|
2995
2986
|
selectCell: selectViewportCellLatest,
|
|
2996
2987
|
selectedCellDragHandle: getDragHandle(rowIdx),
|
|
2997
2988
|
selectedCellEditor: getCellEditor(rowIdx)
|
|
2998
|
-
}
|
|
2989
|
+
}));
|
|
2999
2990
|
}
|
|
3000
2991
|
|
|
3001
2992
|
return rowElements;
|
|
@@ -3008,12 +2999,16 @@
|
|
|
3008
2999
|
|
|
3009
3000
|
let templateRows = `${headerRowHeight}px`;
|
|
3010
3001
|
|
|
3002
|
+
if (topSummaryRowsCount > 0) {
|
|
3003
|
+
templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3011
3006
|
if (rows.length > 0) {
|
|
3012
3007
|
templateRows += gridTemplateRows;
|
|
3013
3008
|
}
|
|
3014
3009
|
|
|
3015
|
-
if (
|
|
3016
|
-
templateRows += ` repeat(${
|
|
3010
|
+
if (bottomSummaryRowsCount > 0) {
|
|
3011
|
+
templateRows += ` repeat(${bottomSummaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3017
3012
|
}
|
|
3018
3013
|
|
|
3019
3014
|
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== -2;
|
|
@@ -3025,8 +3020,10 @@
|
|
|
3025
3020
|
"aria-multiselectable": isSelectable ? true : undefined,
|
|
3026
3021
|
"aria-colcount": columns.length,
|
|
3027
3022
|
"aria-rowcount": headerRowsCount + rowsCount + summaryRowsCount,
|
|
3028
|
-
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname
|
|
3023
|
+
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),
|
|
3029
3024
|
style: { ...style,
|
|
3025
|
+
scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex ? `${totalFrozenColumnWidth}px` : undefined,
|
|
3026
|
+
scrollPaddingBlock: selectedPosition.rowIdx >= 0 && selectedPosition.rowIdx < rows.length ? `${headerRowHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : undefined,
|
|
3030
3027
|
gridTemplateRows: templateRows,
|
|
3031
3028
|
'--rdg-header-row-height': `${headerRowHeight}px`,
|
|
3032
3029
|
'--rdg-summary-row-height': `${summaryRowHeight}px`,
|
|
@@ -3050,40 +3047,59 @@
|
|
|
3050
3047
|
value: defaultGridComponents,
|
|
3051
3048
|
children: [/*#__PURE__*/o(HeaderRow$1, {
|
|
3052
3049
|
columns: getRowViewportColumns(-1),
|
|
3053
|
-
onColumnResize:
|
|
3050
|
+
onColumnResize: handleColumnResizeLatest,
|
|
3054
3051
|
allRowsSelected: allRowsSelected,
|
|
3055
3052
|
onAllRowsSelectionChange: selectAllRowsLatest,
|
|
3056
3053
|
sortColumns: sortColumns,
|
|
3057
|
-
onSortColumnsChange:
|
|
3054
|
+
onSortColumnsChange: onSortColumnsChangeLatest,
|
|
3058
3055
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3059
|
-
selectedCellIdx:
|
|
3056
|
+
selectedCellIdx: selectedPosition.rowIdx === minRowIdx ? selectedPosition.idx : undefined,
|
|
3060
3057
|
selectCell: selectHeaderCellLatest,
|
|
3061
3058
|
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
3062
3059
|
direction: direction
|
|
3063
3060
|
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/o(p$1, {
|
|
3064
|
-
children: [
|
|
3061
|
+
children: [topSummaryRows?.map((row, rowIdx) => {
|
|
3062
|
+
const gridRowStart = headerRowsCount + rowIdx + 1;
|
|
3063
|
+
const summaryRowIdx = rowIdx + minRowIdx + 1;
|
|
3064
|
+
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3065
|
+
const top = headerRowHeight + summaryRowHeight * rowIdx;
|
|
3066
|
+
return /*#__PURE__*/o(SummaryRow$1, {
|
|
3067
|
+
"aria-rowindex": gridRowStart,
|
|
3068
|
+
rowIdx: rowIdx,
|
|
3069
|
+
gridRowStart: gridRowStart,
|
|
3070
|
+
row: row,
|
|
3071
|
+
top: top,
|
|
3072
|
+
bottom: undefined,
|
|
3073
|
+
lastTopRowIdx: topSummaryRowsCount - 1,
|
|
3074
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3075
|
+
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3076
|
+
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3077
|
+
selectCell: selectTopSummaryCellLatest
|
|
3078
|
+
}, rowIdx);
|
|
3079
|
+
}), /*#__PURE__*/o(RowSelectionChangeProvider, {
|
|
3065
3080
|
value: selectRowLatest,
|
|
3066
3081
|
children: getViewportRows()
|
|
3067
|
-
}),
|
|
3068
|
-
const gridRowStart = headerRowsCount + rows.length + rowIdx + 1;
|
|
3069
|
-
const summaryRowIdx =
|
|
3082
|
+
}), bottomSummaryRows?.map((row, rowIdx) => {
|
|
3083
|
+
const gridRowStart = headerRowsCount + topSummaryRowsCount + rows.length + rowIdx + 1;
|
|
3084
|
+
const summaryRowIdx = rows.length + rowIdx;
|
|
3070
3085
|
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3071
|
-
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (
|
|
3072
|
-
const bottom = top === undefined ? summaryRowHeight * (
|
|
3086
|
+
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : undefined;
|
|
3087
|
+
const bottom = top === undefined ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : undefined;
|
|
3073
3088
|
return /*#__PURE__*/o(SummaryRow$1, {
|
|
3074
|
-
"aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
|
|
3089
|
+
"aria-rowindex": headerRowsCount + topSummaryRowsCount + rowsCount + rowIdx + 1,
|
|
3075
3090
|
rowIdx: rowIdx,
|
|
3076
3091
|
gridRowStart: gridRowStart,
|
|
3077
3092
|
row: row,
|
|
3078
3093
|
top: top,
|
|
3079
3094
|
bottom: bottom,
|
|
3095
|
+
lastTopRowIdx: undefined,
|
|
3080
3096
|
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3081
3097
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3082
3098
|
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3083
|
-
selectCell:
|
|
3099
|
+
selectCell: selectBottomSummaryCellLatest
|
|
3084
3100
|
}, rowIdx);
|
|
3085
3101
|
})]
|
|
3086
|
-
})]
|
|
3102
|
+
}), renderMeasuringCells(viewportColumns)]
|
|
3087
3103
|
})]
|
|
3088
3104
|
});
|
|
3089
3105
|
}
|
|
@@ -3094,9 +3110,6 @@
|
|
|
3094
3110
|
|
|
3095
3111
|
const DataGrid$1 = /*#__PURE__*/N(DataGrid);
|
|
3096
3112
|
|
|
3097
|
-
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}";
|
|
3098
|
-
styleInject$1(css_248z$g,{"insertAt":"top"});
|
|
3099
|
-
|
|
3100
3113
|
function useData(widget) {
|
|
3101
3114
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3102
3115
|
var columns = F(function () { return widget.columns(); }, [widget, widget.dataChecksum()]);
|
|
@@ -3209,7 +3222,7 @@
|
|
|
3209
3222
|
}
|
|
3210
3223
|
setRows(items);
|
|
3211
3224
|
}, [listColumns, data, sort]);
|
|
3212
|
-
return h$1(DataGrid$1, { columns: listColumns, headerRowHeight: 24, rows: rows, rowKeyGetter: rowKeyGetter, rowHeight: 20,
|
|
3225
|
+
return h$1(DataGrid$1, { columns: listColumns, headerRowHeight: 24, rows: rows, rowKeyGetter: rowKeyGetter, rowHeight: 20, renderers: { noRowsFallback: h$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%" } });
|
|
3213
3226
|
};
|
|
3214
3227
|
|
|
3215
3228
|
function styleInject(css, ref) {
|