@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.es6.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { format, timeParse, timeFormat, publish, HTMLWidget } from '@hpcc-js/common';
|
|
2
2
|
|
|
3
3
|
var PKG_NAME = "@hpcc-js/dgrid2";
|
|
4
|
-
var PKG_VERSION = "2.3.
|
|
5
|
-
var BUILD_VERSION = "2.104.
|
|
4
|
+
var PKG_VERSION = "2.3.7";
|
|
5
|
+
var BUILD_VERSION = "2.104.14";
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation.
|
|
@@ -71,80 +71,40 @@ var n,l$1,u$1,t$1,o$2,r$2,f$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|m
|
|
|
71
71
|
|
|
72
72
|
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}
|
|
73
73
|
|
|
74
|
-
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)}
|
|
74
|
+
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)};
|
|
75
75
|
|
|
76
76
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
77
77
|
|
|
78
78
|
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}
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
if ( ref === void 0 ) ref = {};
|
|
82
|
-
var insertAt = ref.insertAt;
|
|
83
|
-
|
|
84
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
85
|
-
|
|
86
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
87
|
-
var style = document.createElement('style');
|
|
88
|
-
style.type = 'text/css';
|
|
89
|
-
|
|
90
|
-
if (insertAt === 'top') {
|
|
91
|
-
if (head.firstChild) {
|
|
92
|
-
head.insertBefore(style, head.firstChild);
|
|
93
|
-
} else {
|
|
94
|
-
head.appendChild(style);
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
head.appendChild(style);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (style.styleSheet) {
|
|
101
|
-
style.styleSheet.cssText = css;
|
|
102
|
-
} else {
|
|
103
|
-
style.appendChild(document.createTextNode(css));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
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)}";
|
|
108
|
-
styleInject$1(css_248z$f,{"insertAt":"top"});
|
|
109
|
-
|
|
110
|
-
const cell = "c1wupbe700-beta12";
|
|
80
|
+
const cell = "c1wupbe7-0-0-beta-19";
|
|
111
81
|
const cellClassname = `rdg-cell ${cell}`;
|
|
112
|
-
const
|
|
113
|
-
const cellFrozen = "c1730fa4700-beta12";
|
|
82
|
+
const cellFrozen = "cd0kgiy7-0-0-beta-19";
|
|
114
83
|
const cellFrozenClassname = `rdg-cell-frozen ${cellFrozen}`;
|
|
115
|
-
const cellFrozenLast = "
|
|
84
|
+
const cellFrozenLast = "c1730fa47-0-0-beta-19";
|
|
116
85
|
const cellFrozenLastClassname = `rdg-cell-frozen-last ${cellFrozenLast}`;
|
|
117
86
|
|
|
118
|
-
|
|
119
|
-
styleInject$1(css_248z$e,{"insertAt":"top"});
|
|
120
|
-
|
|
121
|
-
const root = "r104f42s700-beta12";
|
|
87
|
+
const root = "r104f42s7-0-0-beta-19";
|
|
122
88
|
const rootClassname = `rdg ${root}`;
|
|
123
|
-
const viewportDragging = "
|
|
89
|
+
const viewportDragging = "v7ly7s7-0-0-beta-19";
|
|
124
90
|
const viewportDraggingClassname = `rdg-viewport-dragging ${viewportDragging}`;
|
|
125
|
-
const focusSinkClassname = "
|
|
91
|
+
const focusSinkClassname = "fc4f4zb7-0-0-beta-19";
|
|
126
92
|
|
|
127
|
-
|
|
128
|
-
styleInject$1(css_248z$d,{"insertAt":"top"});
|
|
129
|
-
|
|
130
|
-
const row = "r1otpg64700-beta12";
|
|
93
|
+
const row = "r1otpg647-0-0-beta-19";
|
|
131
94
|
const rowClassname = `rdg-row ${row}`;
|
|
132
|
-
const rowSelected = "
|
|
95
|
+
const rowSelected = "rel5gk27-0-0-beta-19";
|
|
133
96
|
const rowSelectedClassname = `rdg-row-selected`;
|
|
134
|
-
const rowSelectedWithFrozenCell = "
|
|
135
|
-
|
|
136
|
-
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)}";
|
|
137
|
-
styleInject$1(css_248z$c,{"insertAt":"top"});
|
|
97
|
+
const rowSelectedWithFrozenCell = "r1qymf1z7-0-0-beta-19";
|
|
138
98
|
|
|
139
|
-
const checkboxLabel = "
|
|
99
|
+
const checkboxLabel = "c8rwwhf7-0-0-beta-19";
|
|
140
100
|
const checkboxLabelClassname = `rdg-checkbox-label ${checkboxLabel}`;
|
|
141
|
-
const checkboxInput = "
|
|
101
|
+
const checkboxInput = "c1rb4brs7-0-0-beta-19";
|
|
142
102
|
const checkboxInputClassname = `rdg-checkbox-input ${checkboxInput}`;
|
|
143
|
-
const checkbox = "
|
|
103
|
+
const checkbox = "c1bvvwcc7-0-0-beta-19";
|
|
144
104
|
const checkboxClassname = `rdg-checkbox ${checkbox}`;
|
|
145
|
-
const checkboxLabelDisabled = "
|
|
105
|
+
const checkboxLabelDisabled = "c1yg790j7-0-0-beta-19";
|
|
146
106
|
const checkboxLabelDisabledClassname = `rdg-checkbox-label-disabled ${checkboxLabelDisabled}`;
|
|
147
|
-
|
|
107
|
+
function checkboxFormatter({
|
|
148
108
|
onChange,
|
|
149
109
|
...props
|
|
150
110
|
}, ref) {
|
|
@@ -164,17 +124,15 @@ const CheckboxFormatter = /*#__PURE__*/N(function CheckboxFormatter({
|
|
|
164
124
|
className: checkboxClassname
|
|
165
125
|
})]
|
|
166
126
|
});
|
|
167
|
-
}
|
|
127
|
+
}
|
|
168
128
|
|
|
169
129
|
const useLayoutEffect = typeof window === 'undefined' ? h : s;
|
|
170
130
|
|
|
171
131
|
function useFocusRef(isSelected) {
|
|
172
132
|
const ref = _$1(null);
|
|
173
133
|
useLayoutEffect(() => {
|
|
174
|
-
var _ref$current;
|
|
175
|
-
|
|
176
134
|
if (!isSelected) return;
|
|
177
|
-
|
|
135
|
+
ref.current?.focus({
|
|
178
136
|
preventScroll: true
|
|
179
137
|
});
|
|
180
138
|
}, [isSelected]);
|
|
@@ -202,19 +160,20 @@ function SelectCellFormatter({
|
|
|
202
160
|
ref,
|
|
203
161
|
tabIndex
|
|
204
162
|
} = useFocusRef(isCellSelected);
|
|
205
|
-
const
|
|
206
|
-
return /*#__PURE__*/o(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
163
|
+
const checkboxFormatter = useDefaultComponents().checkboxFormatter;
|
|
164
|
+
return /*#__PURE__*/o(p$1, {
|
|
165
|
+
children: checkboxFormatter({
|
|
166
|
+
'aria-label': ariaLabel,
|
|
167
|
+
'aria-labelledby': ariaLabelledBy,
|
|
168
|
+
tabIndex,
|
|
169
|
+
disabled,
|
|
170
|
+
checked: value,
|
|
171
|
+
onChange
|
|
172
|
+
}, ref)
|
|
214
173
|
});
|
|
215
174
|
}
|
|
216
175
|
|
|
217
|
-
function
|
|
176
|
+
function valueFormatter(props) {
|
|
218
177
|
try {
|
|
219
178
|
return /*#__PURE__*/o(p$1, {
|
|
220
179
|
children: props.row[props.column.key]
|
|
@@ -224,14 +183,15 @@ function ValueFormatter(props) {
|
|
|
224
183
|
}
|
|
225
184
|
}
|
|
226
185
|
|
|
227
|
-
|
|
228
|
-
styleInject$1(css_248z$b,{"insertAt":"top"});
|
|
229
|
-
|
|
230
|
-
const groupCellContent = "gch972y700-beta12";
|
|
186
|
+
const groupCellContent = "gb8l2vs7-0-0-beta-19";
|
|
231
187
|
const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`;
|
|
232
|
-
const caret = "
|
|
188
|
+
const caret = "c1ggynjl7-0-0-beta-19";
|
|
233
189
|
const caretClassname = `rdg-caret ${caret}`;
|
|
234
|
-
function
|
|
190
|
+
function toggleGroupFormatter(props) {
|
|
191
|
+
return /*#__PURE__*/o(ToggleGroup, { ...props
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function ToggleGroup({
|
|
235
195
|
groupKey,
|
|
236
196
|
isExpanded,
|
|
237
197
|
isCellSelected,
|
|
@@ -337,8 +297,16 @@ const SelectColumn = {
|
|
|
337
297
|
});
|
|
338
298
|
},
|
|
339
299
|
|
|
340
|
-
formatter
|
|
341
|
-
|
|
300
|
+
formatter(props) {
|
|
301
|
+
return /*#__PURE__*/o(SelectFormatter, { ...props
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
groupFormatter(props) {
|
|
306
|
+
return /*#__PURE__*/o(SelectGroupFormatter, { ...props
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
342
310
|
};
|
|
343
311
|
|
|
344
312
|
function getColSpan(column, lastFrozenColumnIndex, args) {
|
|
@@ -351,6 +319,13 @@ function getColSpan(column, lastFrozenColumnIndex, args) {
|
|
|
351
319
|
return undefined;
|
|
352
320
|
}
|
|
353
321
|
|
|
322
|
+
function scrollIntoView(element) {
|
|
323
|
+
element?.scrollIntoView({
|
|
324
|
+
inline: 'nearest',
|
|
325
|
+
block: 'nearest'
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
354
329
|
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']);
|
|
355
330
|
function isCtrlKeyHeldDown(e) {
|
|
356
331
|
return (e.ctrlKey || e.metaKey) && e.key !== 'Control';
|
|
@@ -369,6 +344,26 @@ function onEditorNavigation({
|
|
|
369
344
|
return false;
|
|
370
345
|
}
|
|
371
346
|
|
|
347
|
+
const measuringCellClassname = "m1l09lto7-0-0-beta-19";
|
|
348
|
+
function renderMeasuringCells(viewportColumns) {
|
|
349
|
+
return /*#__PURE__*/o(p$1, {
|
|
350
|
+
children: viewportColumns.map(({
|
|
351
|
+
key,
|
|
352
|
+
idx,
|
|
353
|
+
minWidth,
|
|
354
|
+
maxWidth
|
|
355
|
+
}) => /*#__PURE__*/o("div", {
|
|
356
|
+
className: measuringCellClassname,
|
|
357
|
+
style: {
|
|
358
|
+
gridColumnStart: idx + 1,
|
|
359
|
+
minWidth,
|
|
360
|
+
maxWidth
|
|
361
|
+
},
|
|
362
|
+
"data-measuring-cell-key": key
|
|
363
|
+
}, key))
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
|
|
372
367
|
function isSelectedCellEditable({
|
|
373
368
|
selectedPosition,
|
|
374
369
|
columns,
|
|
@@ -384,18 +379,29 @@ function isCellEditable(column, row) {
|
|
|
384
379
|
}
|
|
385
380
|
function getSelectedCellColSpan({
|
|
386
381
|
rows,
|
|
387
|
-
|
|
382
|
+
topSummaryRows,
|
|
383
|
+
bottomSummaryRows,
|
|
388
384
|
rowIdx,
|
|
389
385
|
lastFrozenColumnIndex,
|
|
390
386
|
column,
|
|
391
387
|
isGroupRow
|
|
392
388
|
}) {
|
|
393
|
-
|
|
389
|
+
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
390
|
+
const minRowIdx = -1 - topSummaryRowsCount;
|
|
391
|
+
|
|
392
|
+
if (rowIdx === minRowIdx) {
|
|
394
393
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
395
394
|
type: 'HEADER'
|
|
396
395
|
});
|
|
397
396
|
}
|
|
398
397
|
|
|
398
|
+
if (topSummaryRows && rowIdx > minRowIdx && rowIdx <= topSummaryRowsCount + minRowIdx) {
|
|
399
|
+
return getColSpan(column, lastFrozenColumnIndex, {
|
|
400
|
+
type: 'SUMMARY',
|
|
401
|
+
row: topSummaryRows[rowIdx + topSummaryRowsCount]
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
|
|
399
405
|
if (rowIdx >= 0 && rowIdx < rows.length) {
|
|
400
406
|
const row = rows[rowIdx];
|
|
401
407
|
|
|
@@ -409,10 +415,10 @@ function getSelectedCellColSpan({
|
|
|
409
415
|
return undefined;
|
|
410
416
|
}
|
|
411
417
|
|
|
412
|
-
if (
|
|
418
|
+
if (bottomSummaryRows) {
|
|
413
419
|
return getColSpan(column, lastFrozenColumnIndex, {
|
|
414
420
|
type: 'SUMMARY',
|
|
415
|
-
row:
|
|
421
|
+
row: bottomSummaryRows[rowIdx - rows.length]
|
|
416
422
|
});
|
|
417
423
|
}
|
|
418
424
|
|
|
@@ -423,7 +429,8 @@ function getNextSelectedCellPosition({
|
|
|
423
429
|
columns,
|
|
424
430
|
colSpanColumns,
|
|
425
431
|
rows,
|
|
426
|
-
|
|
432
|
+
topSummaryRows,
|
|
433
|
+
bottomSummaryRows,
|
|
427
434
|
minRowIdx,
|
|
428
435
|
maxRowIdx,
|
|
429
436
|
currentPosition: {
|
|
@@ -450,7 +457,8 @@ function getNextSelectedCellPosition({
|
|
|
450
457
|
if (colIdx > nextIdx) break;
|
|
451
458
|
const colSpan = getSelectedCellColSpan({
|
|
452
459
|
rows,
|
|
453
|
-
|
|
460
|
+
topSummaryRows,
|
|
461
|
+
bottomSummaryRows,
|
|
454
462
|
rowIdx: nextRowIdx,
|
|
455
463
|
lastFrozenColumnIndex,
|
|
456
464
|
column,
|
|
@@ -556,8 +564,7 @@ const {
|
|
|
556
564
|
round,
|
|
557
565
|
floor,
|
|
558
566
|
sign,
|
|
559
|
-
abs
|
|
560
|
-
ceil
|
|
567
|
+
abs
|
|
561
568
|
} = Math;
|
|
562
569
|
function assertIsValidKeyGetter(keyGetter) {
|
|
563
570
|
if (typeof keyGetter !== 'function') {
|
|
@@ -570,13 +577,15 @@ function clampColumnWidth(width, {
|
|
|
570
577
|
}) {
|
|
571
578
|
width = max(width, minWidth);
|
|
572
579
|
|
|
573
|
-
if (typeof maxWidth === 'number' && maxWidth
|
|
580
|
+
if (typeof maxWidth === 'number' && maxWidth >= minWidth) {
|
|
574
581
|
return min(width, maxWidth);
|
|
575
582
|
}
|
|
576
583
|
|
|
577
584
|
return width;
|
|
578
585
|
}
|
|
579
586
|
|
|
587
|
+
const DEFAULT_COLUMN_WIDTH = 'auto';
|
|
588
|
+
const DEFAULT_COLUMN_MIN_WIDTH = 80;
|
|
580
589
|
function useCalculatedColumns({
|
|
581
590
|
rawColumns,
|
|
582
591
|
columnWidths,
|
|
@@ -586,14 +595,12 @@ function useCalculatedColumns({
|
|
|
586
595
|
rawGroupBy,
|
|
587
596
|
enableVirtualization
|
|
588
597
|
}) {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
const
|
|
592
|
-
const
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
const defaultSortable = (_defaultColumnOptions3 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.sortable) != null ? _defaultColumnOptions3 : false;
|
|
596
|
-
const defaultResizable = (_defaultColumnOptions4 = defaultColumnOptions == null ? void 0 : defaultColumnOptions.resizable) != null ? _defaultColumnOptions4 : false;
|
|
598
|
+
const defaultWidth = defaultColumnOptions?.width ?? DEFAULT_COLUMN_WIDTH;
|
|
599
|
+
const defaultMinWidth = defaultColumnOptions?.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;
|
|
600
|
+
const defaultMaxWidth = defaultColumnOptions?.maxWidth ?? undefined;
|
|
601
|
+
const defaultFormatter = defaultColumnOptions?.formatter ?? valueFormatter;
|
|
602
|
+
const defaultSortable = defaultColumnOptions?.sortable ?? false;
|
|
603
|
+
const defaultResizable = defaultColumnOptions?.resizable ?? false;
|
|
597
604
|
const {
|
|
598
605
|
columns,
|
|
599
606
|
colSpanColumns,
|
|
@@ -603,27 +610,23 @@ function useCalculatedColumns({
|
|
|
603
610
|
const groupBy = [];
|
|
604
611
|
let lastFrozenColumnIndex = -1;
|
|
605
612
|
const columns = rawColumns.map(rawColumn => {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
const rowGroup = (_rawGroupBy$includes = rawGroupBy == null ? void 0 : rawGroupBy.includes(rawColumn.key)) != null ? _rawGroupBy$includes : false;
|
|
613
|
+
const rowGroup = rawGroupBy?.includes(rawColumn.key) ?? false;
|
|
609
614
|
const frozen = rowGroup || rawColumn.frozen || false;
|
|
610
615
|
const column = { ...rawColumn,
|
|
611
616
|
idx: 0,
|
|
612
617
|
frozen,
|
|
613
618
|
isLastFrozenColumn: false,
|
|
614
619
|
rowGroup,
|
|
615
|
-
width:
|
|
616
|
-
minWidth:
|
|
617
|
-
maxWidth:
|
|
618
|
-
sortable:
|
|
619
|
-
resizable:
|
|
620
|
-
formatter:
|
|
620
|
+
width: rawColumn.width ?? defaultWidth,
|
|
621
|
+
minWidth: rawColumn.minWidth ?? defaultMinWidth,
|
|
622
|
+
maxWidth: rawColumn.maxWidth ?? defaultMaxWidth,
|
|
623
|
+
sortable: rawColumn.sortable ?? defaultSortable,
|
|
624
|
+
resizable: rawColumn.resizable ?? defaultResizable,
|
|
625
|
+
formatter: rawColumn.formatter ?? defaultFormatter
|
|
621
626
|
};
|
|
622
627
|
|
|
623
628
|
if (rowGroup) {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
(_column$groupFormatte = column.groupFormatter) != null ? _column$groupFormatte : column.groupFormatter = ToggleGroupFormatter;
|
|
629
|
+
column.groupFormatter ?? (column.groupFormatter = toggleGroupFormatter);
|
|
627
630
|
}
|
|
628
631
|
|
|
629
632
|
if (frozen) {
|
|
@@ -642,7 +645,7 @@ function useCalculatedColumns({
|
|
|
642
645
|
if (aKey === SELECT_COLUMN_KEY) return -1;
|
|
643
646
|
if (bKey === SELECT_COLUMN_KEY) return 1;
|
|
644
647
|
|
|
645
|
-
if (rawGroupBy
|
|
648
|
+
if (rawGroupBy?.includes(aKey)) {
|
|
646
649
|
if (rawGroupBy.includes(bKey)) {
|
|
647
650
|
return rawGroupBy.indexOf(aKey) - rawGroupBy.indexOf(bKey);
|
|
648
651
|
}
|
|
@@ -650,7 +653,7 @@ function useCalculatedColumns({
|
|
|
650
653
|
return -1;
|
|
651
654
|
}
|
|
652
655
|
|
|
653
|
-
if (rawGroupBy
|
|
656
|
+
if (rawGroupBy?.includes(bKey)) return 1;
|
|
654
657
|
|
|
655
658
|
if (frozenA) {
|
|
656
659
|
if (frozenB) return 0;
|
|
@@ -685,6 +688,7 @@ function useCalculatedColumns({
|
|
|
685
688
|
};
|
|
686
689
|
}, [rawColumns, defaultWidth, defaultMinWidth, defaultMaxWidth, defaultFormatter, defaultResizable, defaultSortable, rawGroupBy]);
|
|
687
690
|
const {
|
|
691
|
+
templateColumns,
|
|
688
692
|
layoutCssVars,
|
|
689
693
|
totalFrozenColumnWidth,
|
|
690
694
|
columnMetrics
|
|
@@ -692,48 +696,23 @@ function useCalculatedColumns({
|
|
|
692
696
|
const columnMetrics = new Map();
|
|
693
697
|
let left = 0;
|
|
694
698
|
let totalFrozenColumnWidth = 0;
|
|
695
|
-
|
|
696
|
-
let allocatedWidth = 0;
|
|
697
|
-
let unassignedColumnsCount = 0;
|
|
699
|
+
const templateColumns = [];
|
|
698
700
|
|
|
699
701
|
for (const column of columns) {
|
|
700
|
-
let width =
|
|
702
|
+
let width = columnWidths.get(column.key) ?? column.width;
|
|
701
703
|
|
|
702
|
-
if (width ===
|
|
703
|
-
unassignedColumnsCount++;
|
|
704
|
-
} else {
|
|
704
|
+
if (typeof width === 'number') {
|
|
705
705
|
width = clampColumnWidth(width, column);
|
|
706
|
-
allocatedWidth += width;
|
|
707
|
-
columnMetrics.set(column, {
|
|
708
|
-
width,
|
|
709
|
-
left: 0
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
for (const column of columns) {
|
|
715
|
-
let width;
|
|
716
|
-
|
|
717
|
-
if (columnMetrics.has(column)) {
|
|
718
|
-
const columnMetric = columnMetrics.get(column);
|
|
719
|
-
columnMetric.left = left;
|
|
720
|
-
({
|
|
721
|
-
width
|
|
722
|
-
} = columnMetric);
|
|
723
706
|
} else {
|
|
724
|
-
|
|
725
|
-
const unallocatedColumnWidth = round(unallocatedWidth / unassignedColumnsCount);
|
|
726
|
-
width = clampColumnWidth(unallocatedColumnWidth, column);
|
|
727
|
-
allocatedWidth += width;
|
|
728
|
-
unassignedColumnsCount--;
|
|
729
|
-
columnMetrics.set(column, {
|
|
730
|
-
width,
|
|
731
|
-
left
|
|
732
|
-
});
|
|
707
|
+
width = column.minWidth;
|
|
733
708
|
}
|
|
734
709
|
|
|
710
|
+
templateColumns.push(`${width}px`);
|
|
711
|
+
columnMetrics.set(column, {
|
|
712
|
+
width,
|
|
713
|
+
left
|
|
714
|
+
});
|
|
735
715
|
left += width;
|
|
736
|
-
templateColumns += `${width}px `;
|
|
737
716
|
}
|
|
738
717
|
|
|
739
718
|
if (lastFrozenColumnIndex !== -1) {
|
|
@@ -742,7 +721,7 @@ function useCalculatedColumns({
|
|
|
742
721
|
}
|
|
743
722
|
|
|
744
723
|
const layoutCssVars = {
|
|
745
|
-
gridTemplateColumns: templateColumns
|
|
724
|
+
gridTemplateColumns: templateColumns.join(' ')
|
|
746
725
|
};
|
|
747
726
|
|
|
748
727
|
for (let i = 0; i <= lastFrozenColumnIndex; i++) {
|
|
@@ -751,11 +730,12 @@ function useCalculatedColumns({
|
|
|
751
730
|
}
|
|
752
731
|
|
|
753
732
|
return {
|
|
733
|
+
templateColumns,
|
|
754
734
|
layoutCssVars,
|
|
755
735
|
totalFrozenColumnWidth,
|
|
756
736
|
columnMetrics
|
|
757
737
|
};
|
|
758
|
-
}, [columnWidths, columns,
|
|
738
|
+
}, [columnWidths, columns, lastFrozenColumnIndex]);
|
|
759
739
|
const [colOverscanStartIdx, colOverscanEndIdx] = F(() => {
|
|
760
740
|
if (!enableVirtualization) {
|
|
761
741
|
return [0, columns.length - 1];
|
|
@@ -809,6 +789,7 @@ function useCalculatedColumns({
|
|
|
809
789
|
colSpanColumns,
|
|
810
790
|
colOverscanStartIdx,
|
|
811
791
|
colOverscanEndIdx,
|
|
792
|
+
templateColumns,
|
|
812
793
|
layoutCssVars,
|
|
813
794
|
columnMetrics,
|
|
814
795
|
lastFrozenColumnIndex,
|
|
@@ -817,29 +798,11 @@ function useCalculatedColumns({
|
|
|
817
798
|
};
|
|
818
799
|
}
|
|
819
800
|
|
|
820
|
-
function getSpecifiedWidth({
|
|
821
|
-
key,
|
|
822
|
-
width
|
|
823
|
-
}, columnWidths, viewportWidth) {
|
|
824
|
-
if (columnWidths.has(key)) {
|
|
825
|
-
return columnWidths.get(key);
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
if (typeof width === 'number') {
|
|
829
|
-
return width;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
if (typeof width === 'string' && /^\d+%$/.test(width)) {
|
|
833
|
-
return floor(viewportWidth * parseInt(width, 10) / 100);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
return undefined;
|
|
837
|
-
}
|
|
838
|
-
|
|
839
801
|
function useGridDimensions() {
|
|
840
802
|
const gridRef = _$1(null);
|
|
841
803
|
const [inlineSize, setInlineSize] = p(1);
|
|
842
804
|
const [blockSize, setBlockSize] = p(1);
|
|
805
|
+
const [isWidthInitialized, setWidthInitialized] = p(false);
|
|
843
806
|
useLayoutEffect(() => {
|
|
844
807
|
const {
|
|
845
808
|
ResizeObserver
|
|
@@ -857,11 +820,12 @@ function useGridDimensions() {
|
|
|
857
820
|
} = gridRef.current.getBoundingClientRect();
|
|
858
821
|
const initialWidth = width - offsetWidth + clientWidth;
|
|
859
822
|
const initialHeight = height - offsetHeight + clientHeight;
|
|
860
|
-
setInlineSize(
|
|
823
|
+
setInlineSize(initialWidth);
|
|
861
824
|
setBlockSize(initialHeight);
|
|
825
|
+
setWidthInitialized(true);
|
|
862
826
|
const resizeObserver = new ResizeObserver(entries => {
|
|
863
827
|
const size = entries[0].contentBoxSize[0];
|
|
864
|
-
setInlineSize(
|
|
828
|
+
setInlineSize(size.inlineSize);
|
|
865
829
|
setBlockSize(size.blockSize);
|
|
866
830
|
});
|
|
867
831
|
resizeObserver.observe(gridRef.current);
|
|
@@ -869,11 +833,7 @@ function useGridDimensions() {
|
|
|
869
833
|
resizeObserver.disconnect();
|
|
870
834
|
};
|
|
871
835
|
}, []);
|
|
872
|
-
return [gridRef, inlineSize, blockSize];
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
function handleDevicePixelRatio(size) {
|
|
876
|
-
return size - (devicePixelRatio === 1 ? 0 : ceil(devicePixelRatio));
|
|
836
|
+
return [gridRef, inlineSize, blockSize, isWidthInitialized];
|
|
877
837
|
}
|
|
878
838
|
|
|
879
839
|
function useLatestFunc(fn) {
|
|
@@ -881,9 +841,10 @@ function useLatestFunc(fn) {
|
|
|
881
841
|
h(() => {
|
|
882
842
|
ref.current = fn;
|
|
883
843
|
});
|
|
884
|
-
|
|
844
|
+
const callbackFn = T$1((...args) => {
|
|
885
845
|
ref.current(...args);
|
|
886
846
|
}, []);
|
|
847
|
+
return fn ? callbackFn : fn;
|
|
887
848
|
}
|
|
888
849
|
|
|
889
850
|
function useRovingCellRef(isSelected) {
|
|
@@ -894,7 +855,9 @@ function useRovingCellRef(isSelected) {
|
|
|
894
855
|
}
|
|
895
856
|
|
|
896
857
|
const ref = T$1(cell => {
|
|
897
|
-
if (cell === null
|
|
858
|
+
if (cell === null) return;
|
|
859
|
+
scrollIntoView(cell);
|
|
860
|
+
if (cell.contains(document.activeElement)) return;
|
|
898
861
|
cell.focus({
|
|
899
862
|
preventScroll: true
|
|
900
863
|
});
|
|
@@ -918,12 +881,14 @@ function useViewportColumns({
|
|
|
918
881
|
columns,
|
|
919
882
|
colSpanColumns,
|
|
920
883
|
rows,
|
|
921
|
-
|
|
884
|
+
topSummaryRows,
|
|
885
|
+
bottomSummaryRows,
|
|
922
886
|
colOverscanStartIdx,
|
|
923
887
|
colOverscanEndIdx,
|
|
924
888
|
lastFrozenColumnIndex,
|
|
925
889
|
rowOverscanStartIdx,
|
|
926
890
|
rowOverscanEndIdx,
|
|
891
|
+
columnWidths,
|
|
927
892
|
isGroupRow
|
|
928
893
|
}) {
|
|
929
894
|
const startIdx = F(() => {
|
|
@@ -961,8 +926,19 @@ function useViewportColumns({
|
|
|
961
926
|
}
|
|
962
927
|
}
|
|
963
928
|
|
|
964
|
-
if (
|
|
965
|
-
for (const row of
|
|
929
|
+
if (topSummaryRows != null) {
|
|
930
|
+
for (const row of topSummaryRows) {
|
|
931
|
+
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
932
|
+
type: 'SUMMARY',
|
|
933
|
+
row
|
|
934
|
+
}))) {
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
if (bottomSummaryRows != null) {
|
|
941
|
+
for (const row of bottomSummaryRows) {
|
|
966
942
|
if (updateStartIdx(colIdx, getColSpan(column, lastFrozenColumnIndex, {
|
|
967
943
|
type: 'SUMMARY',
|
|
968
944
|
row
|
|
@@ -974,18 +950,36 @@ function useViewportColumns({
|
|
|
974
950
|
}
|
|
975
951
|
|
|
976
952
|
return startIdx;
|
|
977
|
-
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows,
|
|
978
|
-
|
|
953
|
+
}, [rowOverscanStartIdx, rowOverscanEndIdx, rows, topSummaryRows, bottomSummaryRows, colOverscanStartIdx, lastFrozenColumnIndex, colSpanColumns, isGroupRow]);
|
|
954
|
+
const {
|
|
955
|
+
viewportColumns,
|
|
956
|
+
flexWidthViewportColumns
|
|
957
|
+
} = F(() => {
|
|
979
958
|
const viewportColumns = [];
|
|
959
|
+
const flexWidthViewportColumns = [];
|
|
980
960
|
|
|
981
961
|
for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {
|
|
982
962
|
const column = columns[colIdx];
|
|
983
963
|
if (colIdx < startIdx && !column.frozen) continue;
|
|
984
964
|
viewportColumns.push(column);
|
|
965
|
+
|
|
966
|
+
if (typeof column.width === 'string') {
|
|
967
|
+
flexWidthViewportColumns.push(column);
|
|
968
|
+
}
|
|
985
969
|
}
|
|
986
970
|
|
|
987
|
-
return
|
|
971
|
+
return {
|
|
972
|
+
viewportColumns,
|
|
973
|
+
flexWidthViewportColumns
|
|
974
|
+
};
|
|
988
975
|
}, [startIdx, colOverscanEndIdx, columns]);
|
|
976
|
+
const unsizedFlexWidthViewportColumns = F(() => {
|
|
977
|
+
return flexWidthViewportColumns.filter(column => !columnWidths.has(column.key));
|
|
978
|
+
}, [flexWidthViewportColumns, columnWidths]);
|
|
979
|
+
return {
|
|
980
|
+
viewportColumns,
|
|
981
|
+
flexWidthViewportColumns: unsizedFlexWidthViewportColumns
|
|
982
|
+
};
|
|
989
983
|
}
|
|
990
984
|
|
|
991
985
|
function isReadonlyArray(arr) {
|
|
@@ -1036,10 +1030,8 @@ function useViewportRows({
|
|
|
1036
1030
|
}
|
|
1037
1031
|
|
|
1038
1032
|
Object.keys(rows).forEach((groupKey, posInSet, keys) => {
|
|
1039
|
-
var _expandedGroupIds$has;
|
|
1040
|
-
|
|
1041
1033
|
const id = parentId !== undefined ? `${parentId}__${groupKey}` : groupKey;
|
|
1042
|
-
const isExpanded =
|
|
1034
|
+
const isExpanded = expandedGroupIds?.has(id) ?? false;
|
|
1043
1035
|
const {
|
|
1044
1036
|
childRows,
|
|
1045
1037
|
childGroups,
|
|
@@ -1166,14 +1158,11 @@ function useViewportRows({
|
|
|
1166
1158
|
};
|
|
1167
1159
|
}
|
|
1168
1160
|
|
|
1169
|
-
|
|
1170
|
-
styleInject$1(css_248z$a,{"insertAt":"top"});
|
|
1171
|
-
|
|
1172
|
-
const headerSortCell = "h1tr5c9i700-beta12";
|
|
1161
|
+
const headerSortCell = "h1e8ezgp7-0-0-beta-19";
|
|
1173
1162
|
const headerSortCellClassname = `rdg-header-sort-cell ${headerSortCell}`;
|
|
1174
|
-
const headerSortName = "
|
|
1163
|
+
const headerSortName = "h1rrblhe7-0-0-beta-19";
|
|
1175
1164
|
const headerSortNameClassname = `rdg-header-sort-name ${headerSortName}`;
|
|
1176
|
-
function
|
|
1165
|
+
function headerRenderer({
|
|
1177
1166
|
column,
|
|
1178
1167
|
sortDirection,
|
|
1179
1168
|
priority,
|
|
@@ -1199,7 +1188,7 @@ function SortableHeaderCell({
|
|
|
1199
1188
|
children,
|
|
1200
1189
|
isCellSelected
|
|
1201
1190
|
}) {
|
|
1202
|
-
const
|
|
1191
|
+
const sortStatus = useDefaultComponents().sortStatus;
|
|
1203
1192
|
const {
|
|
1204
1193
|
ref,
|
|
1205
1194
|
tabIndex
|
|
@@ -1226,17 +1215,15 @@ function SortableHeaderCell({
|
|
|
1226
1215
|
className: headerSortNameClassname,
|
|
1227
1216
|
children: children
|
|
1228
1217
|
}), /*#__PURE__*/o("span", {
|
|
1229
|
-
children:
|
|
1230
|
-
sortDirection
|
|
1231
|
-
|
|
1218
|
+
children: sortStatus({
|
|
1219
|
+
sortDirection,
|
|
1220
|
+
priority
|
|
1221
|
+
})
|
|
1232
1222
|
})]
|
|
1233
1223
|
});
|
|
1234
1224
|
}
|
|
1235
1225
|
|
|
1236
|
-
|
|
1237
|
-
styleInject$1(css_248z$9,{"insertAt":"top"});
|
|
1238
|
-
|
|
1239
|
-
const cellResizable = "celq7o9700-beta12";
|
|
1226
|
+
const cellResizable = "celq7o97-0-0-beta-19";
|
|
1240
1227
|
const cellResizableClassname = `rdg-cell-resizable ${cellResizable}`;
|
|
1241
1228
|
function HeaderCell({
|
|
1242
1229
|
column,
|
|
@@ -1251,21 +1238,19 @@ function HeaderCell({
|
|
|
1251
1238
|
shouldFocusGrid,
|
|
1252
1239
|
direction
|
|
1253
1240
|
}) {
|
|
1254
|
-
var _column$headerRendere, _column$maxWidth;
|
|
1255
|
-
|
|
1256
1241
|
const isRtl = direction === 'rtl';
|
|
1257
1242
|
const {
|
|
1258
1243
|
ref,
|
|
1259
1244
|
tabIndex,
|
|
1260
1245
|
onFocus
|
|
1261
1246
|
} = useRovingCellRef(isCellSelected);
|
|
1262
|
-
const sortIndex = sortColumns
|
|
1247
|
+
const sortIndex = sortColumns?.findIndex(sort => sort.columnKey === column.key);
|
|
1263
1248
|
const sortColumn = sortIndex !== undefined && sortIndex > -1 ? sortColumns[sortIndex] : undefined;
|
|
1264
|
-
const sortDirection = sortColumn
|
|
1249
|
+
const sortDirection = sortColumn?.direction;
|
|
1265
1250
|
const priority = sortColumn !== undefined && sortColumns.length > 1 ? sortIndex + 1 : undefined;
|
|
1266
1251
|
const ariaSort = sortDirection && !priority ? sortDirection === 'ASC' ? 'ascending' : 'descending' : undefined;
|
|
1267
1252
|
const className = getCellClassname(column, column.headerCellClass, column.resizable && cellResizableClassname);
|
|
1268
|
-
const
|
|
1253
|
+
const headerRenderer$1 = column.headerRenderer ?? headerRenderer;
|
|
1269
1254
|
|
|
1270
1255
|
function onPointerDown(event) {
|
|
1271
1256
|
if (event.pointerType === 'mouse' && event.buttons !== 1) {
|
|
@@ -1287,6 +1272,7 @@ function HeaderCell({
|
|
|
1287
1272
|
}
|
|
1288
1273
|
|
|
1289
1274
|
function onPointerMove(event) {
|
|
1275
|
+
event.preventDefault();
|
|
1290
1276
|
const {
|
|
1291
1277
|
right,
|
|
1292
1278
|
left
|
|
@@ -1294,7 +1280,7 @@ function HeaderCell({
|
|
|
1294
1280
|
const width = isRtl ? right + offset - event.clientX : event.clientX + offset - left;
|
|
1295
1281
|
|
|
1296
1282
|
if (width > 0) {
|
|
1297
|
-
onColumnResize(column,
|
|
1283
|
+
onColumnResize(column, width);
|
|
1298
1284
|
}
|
|
1299
1285
|
}
|
|
1300
1286
|
|
|
@@ -1361,11 +1347,11 @@ function HeaderCell({
|
|
|
1361
1347
|
return;
|
|
1362
1348
|
}
|
|
1363
1349
|
|
|
1364
|
-
onColumnResize(column, '
|
|
1350
|
+
onColumnResize(column, 'max-content');
|
|
1365
1351
|
}
|
|
1366
1352
|
|
|
1367
1353
|
function handleFocus(event) {
|
|
1368
|
-
onFocus
|
|
1354
|
+
onFocus?.(event);
|
|
1369
1355
|
|
|
1370
1356
|
if (shouldFocusGrid) {
|
|
1371
1357
|
selectCell(0);
|
|
@@ -1381,30 +1367,24 @@ function HeaderCell({
|
|
|
1381
1367
|
ref: ref,
|
|
1382
1368
|
tabIndex: shouldFocusGrid ? 0 : tabIndex,
|
|
1383
1369
|
className: className,
|
|
1384
|
-
style:
|
|
1385
|
-
minWidth: column.minWidth,
|
|
1386
|
-
maxWidth: (_column$maxWidth = column.maxWidth) != null ? _column$maxWidth : undefined
|
|
1387
|
-
},
|
|
1370
|
+
style: getCellStyle(column, colSpan),
|
|
1388
1371
|
onFocus: handleFocus,
|
|
1389
1372
|
onClick: onClick,
|
|
1390
1373
|
onDoubleClick: column.resizable ? onDoubleClick : undefined,
|
|
1391
1374
|
onPointerDown: column.resizable ? onPointerDown : undefined,
|
|
1392
|
-
children:
|
|
1393
|
-
column
|
|
1394
|
-
sortDirection
|
|
1395
|
-
priority
|
|
1396
|
-
onSort
|
|
1397
|
-
allRowsSelected
|
|
1398
|
-
onAllRowsSelectionChange
|
|
1399
|
-
isCellSelected
|
|
1375
|
+
children: headerRenderer$1({
|
|
1376
|
+
column,
|
|
1377
|
+
sortDirection,
|
|
1378
|
+
priority,
|
|
1379
|
+
onSort,
|
|
1380
|
+
allRowsSelected,
|
|
1381
|
+
onAllRowsSelectionChange,
|
|
1382
|
+
isCellSelected
|
|
1400
1383
|
})
|
|
1401
1384
|
});
|
|
1402
1385
|
}
|
|
1403
1386
|
|
|
1404
|
-
|
|
1405
|
-
styleInject$1(css_248z$8,{"insertAt":"top"});
|
|
1406
|
-
|
|
1407
|
-
const headerRow = "h197vzie700-beta12";
|
|
1387
|
+
const headerRow = "h197vzie7-0-0-beta-19";
|
|
1408
1388
|
const headerRowClassname = `rdg-header-row ${headerRow}`;
|
|
1409
1389
|
|
|
1410
1390
|
function HeaderRow({
|
|
@@ -1458,12 +1438,9 @@ function HeaderRow({
|
|
|
1458
1438
|
|
|
1459
1439
|
const HeaderRow$1 = /*#__PURE__*/w(HeaderRow);
|
|
1460
1440
|
|
|
1461
|
-
|
|
1462
|
-
styleInject$1(css_248z$7,{"insertAt":"top"});
|
|
1463
|
-
|
|
1464
|
-
const cellCopied = "ccpfvsn700-beta12";
|
|
1441
|
+
const cellCopied = "ccpfvsn7-0-0-beta-19";
|
|
1465
1442
|
const cellCopiedClassname = `rdg-cell-copied ${cellCopied}`;
|
|
1466
|
-
const cellDraggedOver = "
|
|
1443
|
+
const cellDraggedOver = "c1bmg16t7-0-0-beta-19";
|
|
1467
1444
|
const cellDraggedOverClassname = `rdg-cell-dragged-over ${cellDraggedOver}`;
|
|
1468
1445
|
|
|
1469
1446
|
function Cell({
|
|
@@ -1495,10 +1472,8 @@ function Cell({
|
|
|
1495
1472
|
}
|
|
1496
1473
|
|
|
1497
1474
|
function handleClick() {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
selectCellWrapper((_column$editorOptions = column.editorOptions) == null ? void 0 : _column$editorOptions.editOnClick);
|
|
1501
|
-
onRowClick == null ? void 0 : onRowClick(row, column);
|
|
1475
|
+
selectCellWrapper(column.editorOptions?.editOnClick);
|
|
1476
|
+
onRowClick?.(row, column);
|
|
1502
1477
|
}
|
|
1503
1478
|
|
|
1504
1479
|
function handleContextMenu() {
|
|
@@ -1507,7 +1482,11 @@ function Cell({
|
|
|
1507
1482
|
|
|
1508
1483
|
function handleDoubleClick() {
|
|
1509
1484
|
selectCellWrapper(true);
|
|
1510
|
-
onRowDoubleClick
|
|
1485
|
+
onRowDoubleClick?.(row, column);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
function handleRowChange(newRow) {
|
|
1489
|
+
onRowChange(column, newRow);
|
|
1511
1490
|
}
|
|
1512
1491
|
|
|
1513
1492
|
return /*#__PURE__*/o("div", {
|
|
@@ -1526,11 +1505,11 @@ function Cell({
|
|
|
1526
1505
|
onFocus: onFocus,
|
|
1527
1506
|
...props,
|
|
1528
1507
|
children: !column.rowGroup && /*#__PURE__*/o(p$1, {
|
|
1529
|
-
children: [
|
|
1530
|
-
column
|
|
1531
|
-
row
|
|
1532
|
-
isCellSelected
|
|
1533
|
-
onRowChange:
|
|
1508
|
+
children: [column.formatter({
|
|
1509
|
+
column,
|
|
1510
|
+
row,
|
|
1511
|
+
isCellSelected,
|
|
1512
|
+
onRowChange: handleRowChange
|
|
1534
1513
|
}), dragHandle]
|
|
1535
1514
|
})
|
|
1536
1515
|
});
|
|
@@ -1561,16 +1540,16 @@ function Row({
|
|
|
1561
1540
|
selectCell,
|
|
1562
1541
|
...props
|
|
1563
1542
|
}, ref) {
|
|
1564
|
-
const handleRowChange = useLatestFunc(newRow => {
|
|
1565
|
-
onRowChange(rowIdx, newRow);
|
|
1543
|
+
const handleRowChange = useLatestFunc((column, newRow) => {
|
|
1544
|
+
onRowChange(column, rowIdx, newRow);
|
|
1566
1545
|
});
|
|
1567
1546
|
|
|
1568
1547
|
function handleDragEnter(event) {
|
|
1569
|
-
setDraggedOverRowIdx
|
|
1570
|
-
onMouseEnter
|
|
1548
|
+
setDraggedOverRowIdx?.(rowIdx);
|
|
1549
|
+
onMouseEnter?.(event);
|
|
1571
1550
|
}
|
|
1572
1551
|
|
|
1573
|
-
className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass
|
|
1552
|
+
className = clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, rowClass?.(row), className, selectedCellIdx === -1 && rowSelectedClassname);
|
|
1574
1553
|
const cells = [];
|
|
1575
1554
|
|
|
1576
1555
|
for (let index = 0; index < viewportColumns.length; index++) {
|
|
@@ -1622,7 +1601,11 @@ function Row({
|
|
|
1622
1601
|
});
|
|
1623
1602
|
}
|
|
1624
1603
|
|
|
1625
|
-
const
|
|
1604
|
+
const RowComponent = /*#__PURE__*/w( /*#__PURE__*/N(Row));
|
|
1605
|
+
function defaultRowRenderer(key, props) {
|
|
1606
|
+
return /*#__PURE__*/o(RowComponent, { ...props
|
|
1607
|
+
}, key);
|
|
1608
|
+
}
|
|
1626
1609
|
|
|
1627
1610
|
function GroupCell({
|
|
1628
1611
|
id,
|
|
@@ -1658,24 +1641,21 @@ function GroupCell({
|
|
|
1658
1641
|
},
|
|
1659
1642
|
onClick: isLevelMatching ? toggleGroup : undefined,
|
|
1660
1643
|
onFocus: onFocus,
|
|
1661
|
-
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter
|
|
1662
|
-
groupKey
|
|
1663
|
-
childRows
|
|
1664
|
-
column
|
|
1665
|
-
row
|
|
1666
|
-
isExpanded
|
|
1667
|
-
isCellSelected
|
|
1668
|
-
toggleGroup
|
|
1644
|
+
children: (!column.rowGroup || groupColumnIndex === column.idx) && column.groupFormatter?.({
|
|
1645
|
+
groupKey,
|
|
1646
|
+
childRows,
|
|
1647
|
+
column,
|
|
1648
|
+
row,
|
|
1649
|
+
isExpanded,
|
|
1650
|
+
isCellSelected,
|
|
1651
|
+
toggleGroup
|
|
1669
1652
|
})
|
|
1670
1653
|
}, column.key);
|
|
1671
1654
|
}
|
|
1672
1655
|
|
|
1673
1656
|
const GroupCell$1 = /*#__PURE__*/w(GroupCell);
|
|
1674
1657
|
|
|
1675
|
-
|
|
1676
|
-
styleInject$1(css_248z$6,{"insertAt":"top"});
|
|
1677
|
-
|
|
1678
|
-
const groupRow = "gyxx7e9700-beta12";
|
|
1658
|
+
const groupRow = "gyxx7e97-0-0-beta-19";
|
|
1679
1659
|
const groupRowClassname = `rdg-group-row ${groupRow}`;
|
|
1680
1660
|
|
|
1681
1661
|
function GroupedRow({
|
|
@@ -1728,10 +1708,7 @@ function GroupedRow({
|
|
|
1728
1708
|
|
|
1729
1709
|
const GroupRowRenderer = /*#__PURE__*/w(GroupedRow);
|
|
1730
1710
|
|
|
1731
|
-
|
|
1732
|
-
styleInject$1(css_248z$5,{"insertAt":"top"});
|
|
1733
|
-
|
|
1734
|
-
const summaryCellClassname = "s1n3hxke700-beta12";
|
|
1711
|
+
const summaryCellClassname = "s1n3hxke7-0-0-beta-19";
|
|
1735
1712
|
|
|
1736
1713
|
function SummaryCell({
|
|
1737
1714
|
column,
|
|
@@ -1746,7 +1723,6 @@ function SummaryCell({
|
|
|
1746
1723
|
onFocus
|
|
1747
1724
|
} = useRovingCellRef(isCellSelected);
|
|
1748
1725
|
const {
|
|
1749
|
-
summaryFormatter: SummaryFormatter,
|
|
1750
1726
|
summaryCellClass
|
|
1751
1727
|
} = column;
|
|
1752
1728
|
const className = getCellClassname(column, summaryCellClassname, typeof summaryCellClass === 'function' ? summaryCellClass(row) : summaryCellClass);
|
|
@@ -1766,22 +1742,22 @@ function SummaryCell({
|
|
|
1766
1742
|
style: getCellStyle(column, colSpan),
|
|
1767
1743
|
onClick: onClick,
|
|
1768
1744
|
onFocus: onFocus,
|
|
1769
|
-
children:
|
|
1770
|
-
column
|
|
1771
|
-
row
|
|
1772
|
-
isCellSelected
|
|
1745
|
+
children: column.summaryFormatter?.({
|
|
1746
|
+
column,
|
|
1747
|
+
row,
|
|
1748
|
+
isCellSelected
|
|
1773
1749
|
})
|
|
1774
1750
|
});
|
|
1775
1751
|
}
|
|
1776
1752
|
|
|
1777
1753
|
const SummaryCell$1 = /*#__PURE__*/w(SummaryCell);
|
|
1778
1754
|
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
const
|
|
1783
|
-
const summaryRowBorderClassname = "s1jijrjz700-beta12";
|
|
1755
|
+
const summaryRow = "snfqesz7-0-0-beta-19";
|
|
1756
|
+
const topSummaryRow = "t1jijrjz7-0-0-beta-19";
|
|
1757
|
+
const topSummaryRowBorderClassname = "t14bmecc7-0-0-beta-19";
|
|
1758
|
+
const bottomSummaryRowBorderClassname = "b1odhhml7-0-0-beta-19";
|
|
1784
1759
|
const summaryRowClassname = `rdg-summary-row ${summaryRow}`;
|
|
1760
|
+
const topSummaryRowClassname = `rdg-top-summary-row ${topSummaryRow}`;
|
|
1785
1761
|
|
|
1786
1762
|
function SummaryRow({
|
|
1787
1763
|
rowIdx,
|
|
@@ -1792,6 +1768,7 @@ function SummaryRow({
|
|
|
1792
1768
|
bottom,
|
|
1793
1769
|
lastFrozenColumnIndex,
|
|
1794
1770
|
selectedCellIdx,
|
|
1771
|
+
lastTopRowIdx,
|
|
1795
1772
|
selectCell,
|
|
1796
1773
|
'aria-rowindex': ariaRowIndex
|
|
1797
1774
|
}) {
|
|
@@ -1818,10 +1795,11 @@ function SummaryRow({
|
|
|
1818
1795
|
}, column.key));
|
|
1819
1796
|
}
|
|
1820
1797
|
|
|
1798
|
+
const isTop = lastTopRowIdx !== undefined;
|
|
1821
1799
|
return /*#__PURE__*/o("div", {
|
|
1822
1800
|
role: "row",
|
|
1823
1801
|
"aria-rowindex": ariaRowIndex,
|
|
1824
|
-
className: clsx(rowClassname, `rdg-row-${rowIdx % 2 === 0 ? 'even' : 'odd'}`, summaryRowClassname, rowIdx === 0 &&
|
|
1802
|
+
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),
|
|
1825
1803
|
style: { ...getRowStyle(gridRowStart),
|
|
1826
1804
|
'--rdg-summary-row-top': top !== undefined ? `${top}px` : undefined,
|
|
1827
1805
|
'--rdg-summary-row-bottom': bottom !== undefined ? `${bottom}px` : undefined
|
|
@@ -1832,22 +1810,16 @@ function SummaryRow({
|
|
|
1832
1810
|
|
|
1833
1811
|
const SummaryRow$1 = /*#__PURE__*/w(SummaryRow);
|
|
1834
1812
|
|
|
1835
|
-
|
|
1836
|
-
styleInject$1(css_248z$3,{"insertAt":"top"});
|
|
1837
|
-
|
|
1838
|
-
const cellEditing = "c1tngyp1700-beta12";
|
|
1813
|
+
const cellEditing = "c1tngyp17-0-0-beta-19";
|
|
1839
1814
|
function EditCell({
|
|
1840
1815
|
column,
|
|
1841
1816
|
colSpan,
|
|
1842
1817
|
row,
|
|
1843
1818
|
onRowChange,
|
|
1844
|
-
closeEditor
|
|
1845
|
-
scrollToCell
|
|
1819
|
+
closeEditor
|
|
1846
1820
|
}) {
|
|
1847
|
-
var _column$editorOptions, _column$editorOptions4, _column$editorOptions5;
|
|
1848
|
-
|
|
1849
1821
|
const frameRequestRef = _$1();
|
|
1850
|
-
const commitOnOutsideClick =
|
|
1822
|
+
const commitOnOutsideClick = column.editorOptions?.commitOnOutsideClick !== false;
|
|
1851
1823
|
const commitOnOutsideMouseDown = useLatestFunc(() => {
|
|
1852
1824
|
onClose(true);
|
|
1853
1825
|
});
|
|
@@ -1880,11 +1852,8 @@ function EditCell({
|
|
|
1880
1852
|
} else if (event.key === 'Enter') {
|
|
1881
1853
|
event.stopPropagation();
|
|
1882
1854
|
onClose(true);
|
|
1883
|
-
scrollToCell();
|
|
1884
1855
|
} else {
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
const onNavigation = (_column$editorOptions2 = (_column$editorOptions3 = column.editorOptions) == null ? void 0 : _column$editorOptions3.onNavigation) != null ? _column$editorOptions2 : onEditorNavigation;
|
|
1856
|
+
const onNavigation = column.editorOptions?.onNavigation ?? onEditorNavigation;
|
|
1888
1857
|
|
|
1889
1858
|
if (!onNavigation(event)) {
|
|
1890
1859
|
event.stopPropagation();
|
|
@@ -1903,7 +1872,7 @@ function EditCell({
|
|
|
1903
1872
|
const {
|
|
1904
1873
|
cellClass
|
|
1905
1874
|
} = column;
|
|
1906
|
-
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !
|
|
1875
|
+
const className = getCellClassname(column, 'rdg-editor-container', typeof cellClass === 'function' ? cellClass(row) : cellClass, !column.editorOptions?.renderFormatter && cellEditing);
|
|
1907
1876
|
return /*#__PURE__*/o("div", {
|
|
1908
1877
|
role: "gridcell",
|
|
1909
1878
|
"aria-colindex": column.idx + 1,
|
|
@@ -1914,25 +1883,22 @@ function EditCell({
|
|
|
1914
1883
|
onKeyDown: onKeyDown,
|
|
1915
1884
|
onMouseDownCapture: commitOnOutsideClick ? cancelFrameRequest : undefined,
|
|
1916
1885
|
children: column.editor != null && /*#__PURE__*/o(p$1, {
|
|
1917
|
-
children: [
|
|
1918
|
-
column
|
|
1919
|
-
row
|
|
1920
|
-
onRowChange
|
|
1921
|
-
onClose
|
|
1922
|
-
}),
|
|
1923
|
-
column
|
|
1924
|
-
row
|
|
1886
|
+
children: [column.editor({
|
|
1887
|
+
column,
|
|
1888
|
+
row,
|
|
1889
|
+
onRowChange,
|
|
1890
|
+
onClose
|
|
1891
|
+
}), column.editorOptions?.renderFormatter && column.formatter({
|
|
1892
|
+
column,
|
|
1893
|
+
row,
|
|
1925
1894
|
isCellSelected: true,
|
|
1926
|
-
onRowChange
|
|
1895
|
+
onRowChange
|
|
1927
1896
|
})]
|
|
1928
1897
|
})
|
|
1929
1898
|
});
|
|
1930
1899
|
}
|
|
1931
1900
|
|
|
1932
|
-
|
|
1933
|
-
styleInject$1(css_248z$2,{"insertAt":"top"});
|
|
1934
|
-
|
|
1935
|
-
const cellDragHandle = "cadd3bp700-beta12";
|
|
1901
|
+
const cellDragHandle = "cadd3bp7-0-0-beta-19";
|
|
1936
1902
|
const cellDragHandleClassname = `rdg-cell-drag-handle ${cellDragHandle}`;
|
|
1937
1903
|
function DragHandle({
|
|
1938
1904
|
rows,
|
|
@@ -2009,7 +1975,7 @@ function DragHandle({
|
|
|
2009
1975
|
}
|
|
2010
1976
|
|
|
2011
1977
|
if (indexes.length > 0) {
|
|
2012
|
-
onRowsChange
|
|
1978
|
+
onRowsChange?.(updatedRows, {
|
|
2013
1979
|
indexes,
|
|
2014
1980
|
column
|
|
2015
1981
|
});
|
|
@@ -2023,15 +1989,25 @@ function DragHandle({
|
|
|
2023
1989
|
});
|
|
2024
1990
|
}
|
|
2025
1991
|
|
|
2026
|
-
|
|
2027
|
-
styleInject$1(css_248z$1,{"insertAt":"top"});
|
|
2028
|
-
|
|
2029
|
-
const arrow = "a888944700-beta12";
|
|
1992
|
+
const arrow = "a1mygwml7-0-0-beta-19";
|
|
2030
1993
|
const arrowClassname = `rdg-sort-arrow ${arrow}`;
|
|
2031
|
-
function
|
|
1994
|
+
function sortStatus({
|
|
1995
|
+
sortDirection,
|
|
1996
|
+
priority
|
|
1997
|
+
}) {
|
|
1998
|
+
return /*#__PURE__*/o(p$1, {
|
|
1999
|
+
children: [sortIcon({
|
|
2000
|
+
sortDirection
|
|
2001
|
+
}), sortPriority({
|
|
2002
|
+
priority
|
|
2003
|
+
})]
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
function sortIcon({
|
|
2032
2007
|
sortDirection
|
|
2033
2008
|
}) {
|
|
2034
|
-
|
|
2009
|
+
if (sortDirection === undefined) return null;
|
|
2010
|
+
return /*#__PURE__*/o("svg", {
|
|
2035
2011
|
viewBox: "0 0 12 8",
|
|
2036
2012
|
width: "12",
|
|
2037
2013
|
height: "8",
|
|
@@ -2040,7 +2016,12 @@ function SortIcon({
|
|
|
2040
2016
|
children: /*#__PURE__*/o("path", {
|
|
2041
2017
|
d: sortDirection === 'ASC' ? 'M0 8 6 0 12 8' : 'M0 0 6 8 12 0'
|
|
2042
2018
|
})
|
|
2043
|
-
})
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
function sortPriority({
|
|
2022
|
+
priority
|
|
2023
|
+
}) {
|
|
2024
|
+
return priority;
|
|
2044
2025
|
}
|
|
2045
2026
|
|
|
2046
2027
|
const initialPosition = {
|
|
@@ -2049,56 +2030,56 @@ const initialPosition = {
|
|
|
2049
2030
|
mode: 'SELECT'
|
|
2050
2031
|
};
|
|
2051
2032
|
|
|
2052
|
-
function DataGrid({
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
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
|
-
|
|
2033
|
+
function DataGrid(props, ref) {
|
|
2034
|
+
const {
|
|
2035
|
+
columns: rawColumns,
|
|
2036
|
+
rows: rawRows,
|
|
2037
|
+
topSummaryRows,
|
|
2038
|
+
bottomSummaryRows,
|
|
2039
|
+
rowKeyGetter,
|
|
2040
|
+
onRowsChange,
|
|
2041
|
+
rowHeight: rawRowHeight,
|
|
2042
|
+
headerRowHeight: rawHeaderRowHeight,
|
|
2043
|
+
summaryRowHeight: rawSummaryRowHeight,
|
|
2044
|
+
selectedRows,
|
|
2045
|
+
onSelectedRowsChange,
|
|
2046
|
+
sortColumns,
|
|
2047
|
+
onSortColumnsChange,
|
|
2048
|
+
defaultColumnOptions,
|
|
2049
|
+
groupBy: rawGroupBy,
|
|
2050
|
+
rowGrouper,
|
|
2051
|
+
expandedGroupIds,
|
|
2052
|
+
onExpandedGroupIdsChange,
|
|
2053
|
+
onRowClick,
|
|
2054
|
+
onRowDoubleClick,
|
|
2055
|
+
onScroll,
|
|
2056
|
+
onColumnResize,
|
|
2057
|
+
onFill,
|
|
2058
|
+
onCopy,
|
|
2059
|
+
onPaste,
|
|
2060
|
+
cellNavigationMode: rawCellNavigationMode,
|
|
2061
|
+
enableVirtualization: rawEnableVirtualization,
|
|
2062
|
+
renderers,
|
|
2063
|
+
className,
|
|
2064
|
+
style,
|
|
2065
|
+
rowClass,
|
|
2066
|
+
direction: rawDirection,
|
|
2067
|
+
'aria-label': ariaLabel,
|
|
2068
|
+
'aria-labelledby': ariaLabelledBy,
|
|
2069
|
+
'aria-describedby': ariaDescribedBy,
|
|
2070
|
+
'data-testid': testId
|
|
2071
|
+
} = props;
|
|
2091
2072
|
const defaultComponents = useDefaultComponents();
|
|
2092
|
-
|
|
2093
|
-
const headerRowHeight = rawHeaderRowHeight
|
|
2094
|
-
const summaryRowHeight = rawSummaryRowHeight
|
|
2095
|
-
const
|
|
2096
|
-
const
|
|
2097
|
-
const checkboxFormatter
|
|
2098
|
-
const noRowsFallback =
|
|
2099
|
-
const cellNavigationMode = rawCellNavigationMode
|
|
2100
|
-
|
|
2101
|
-
|
|
2073
|
+
const rowHeight = rawRowHeight ?? 35;
|
|
2074
|
+
const headerRowHeight = rawHeaderRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
2075
|
+
const summaryRowHeight = rawSummaryRowHeight ?? (typeof rowHeight === 'number' ? rowHeight : 35);
|
|
2076
|
+
const rowRenderer = renderers?.rowRenderer ?? defaultComponents?.rowRenderer ?? defaultRowRenderer;
|
|
2077
|
+
const sortStatus$1 = renderers?.sortStatus ?? defaultComponents?.sortStatus ?? sortStatus;
|
|
2078
|
+
const checkboxFormatter$1 = renderers?.checkboxFormatter ?? defaultComponents?.checkboxFormatter ?? checkboxFormatter;
|
|
2079
|
+
const noRowsFallback = renderers?.noRowsFallback ?? defaultComponents?.noRowsFallback;
|
|
2080
|
+
const cellNavigationMode = rawCellNavigationMode ?? 'NONE';
|
|
2081
|
+
const enableVirtualization = rawEnableVirtualization ?? true;
|
|
2082
|
+
const direction = rawDirection ?? 'ltr';
|
|
2102
2083
|
const [scrollTop, setScrollTop] = p(0);
|
|
2103
2084
|
const [scrollLeft, setScrollLeft] = p(0);
|
|
2104
2085
|
const [columnWidths, setColumnWidths] = p(() => new Map());
|
|
@@ -2106,24 +2087,24 @@ function DataGrid({
|
|
|
2106
2087
|
const [copiedCell, setCopiedCell] = p(null);
|
|
2107
2088
|
const [isDragging, setDragging] = p(false);
|
|
2108
2089
|
const [draggedOverRowIdx, setOverRowIdx] = p(undefined);
|
|
2109
|
-
const [autoResizeColumn, setAutoResizeColumn] = p(null);
|
|
2110
2090
|
const prevSelectedPosition = _$1(selectedPosition);
|
|
2111
2091
|
const latestDraggedOverRowIdx = _$1(draggedOverRowIdx);
|
|
2112
2092
|
const lastSelectedRowIdx = _$1(-1);
|
|
2113
2093
|
const rowRef = _$1(null);
|
|
2114
|
-
const [gridRef, gridWidth, gridHeight] = useGridDimensions();
|
|
2094
|
+
const [gridRef, gridWidth, gridHeight, isWidthInitialized] = useGridDimensions();
|
|
2115
2095
|
const headerRowsCount = 1;
|
|
2116
|
-
const
|
|
2096
|
+
const topSummaryRowsCount = topSummaryRows?.length ?? 0;
|
|
2097
|
+
const bottomSummaryRowsCount = bottomSummaryRows?.length ?? 0;
|
|
2098
|
+
const summaryRowsCount = topSummaryRowsCount + bottomSummaryRowsCount;
|
|
2117
2099
|
const clientHeight = gridHeight - headerRowHeight - summaryRowsCount * summaryRowHeight;
|
|
2118
2100
|
const isSelectable = selectedRows != null && onSelectedRowsChange != null;
|
|
2119
|
-
const isHeaderRowSelected = selectedPosition.rowIdx === -1;
|
|
2120
2101
|
const isRtl = direction === 'rtl';
|
|
2121
2102
|
const leftKey = isRtl ? 'ArrowRight' : 'ArrowLeft';
|
|
2122
2103
|
const rightKey = isRtl ? 'ArrowLeft' : 'ArrowRight';
|
|
2123
2104
|
const defaultGridComponents = F(() => ({
|
|
2124
|
-
|
|
2125
|
-
checkboxFormatter
|
|
2126
|
-
}), [
|
|
2105
|
+
sortStatus: sortStatus$1,
|
|
2106
|
+
checkboxFormatter: checkboxFormatter$1
|
|
2107
|
+
}), [sortStatus$1, checkboxFormatter$1]);
|
|
2127
2108
|
const allRowsSelected = F(() => {
|
|
2128
2109
|
const {
|
|
2129
2110
|
length
|
|
@@ -2135,6 +2116,7 @@ function DataGrid({
|
|
|
2135
2116
|
colSpanColumns,
|
|
2136
2117
|
colOverscanStartIdx,
|
|
2137
2118
|
colOverscanEndIdx,
|
|
2119
|
+
templateColumns,
|
|
2138
2120
|
layoutCssVars,
|
|
2139
2121
|
columnMetrics,
|
|
2140
2122
|
lastFrozenColumnIndex,
|
|
@@ -2170,7 +2152,10 @@ function DataGrid({
|
|
|
2170
2152
|
expandedGroupIds,
|
|
2171
2153
|
enableVirtualization
|
|
2172
2154
|
});
|
|
2173
|
-
const
|
|
2155
|
+
const {
|
|
2156
|
+
viewportColumns,
|
|
2157
|
+
flexWidthViewportColumns
|
|
2158
|
+
} = useViewportColumns({
|
|
2174
2159
|
columns,
|
|
2175
2160
|
colSpanColumns,
|
|
2176
2161
|
colOverscanStartIdx,
|
|
@@ -2179,16 +2164,22 @@ function DataGrid({
|
|
|
2179
2164
|
rowOverscanStartIdx,
|
|
2180
2165
|
rowOverscanEndIdx,
|
|
2181
2166
|
rows,
|
|
2182
|
-
|
|
2167
|
+
topSummaryRows,
|
|
2168
|
+
bottomSummaryRows,
|
|
2169
|
+
columnWidths,
|
|
2183
2170
|
isGroupRow
|
|
2184
2171
|
});
|
|
2185
2172
|
const hasGroups = groupBy.length > 0 && typeof rowGrouper === 'function';
|
|
2186
2173
|
const minColIdx = hasGroups ? -1 : 0;
|
|
2187
2174
|
const maxColIdx = columns.length - 1;
|
|
2188
|
-
const minRowIdx = -1;
|
|
2189
|
-
const maxRowIdx =
|
|
2175
|
+
const minRowIdx = -1 - topSummaryRowsCount;
|
|
2176
|
+
const maxRowIdx = rows.length + bottomSummaryRowsCount - 1;
|
|
2190
2177
|
const selectedCellIsWithinSelectionBounds = isCellWithinSelectionBounds(selectedPosition);
|
|
2191
2178
|
const selectedCellIsWithinViewportBounds = isCellWithinViewportBounds(selectedPosition);
|
|
2179
|
+
const handleColumnResizeLatest = useLatestFunc(handleColumnResize);
|
|
2180
|
+
const onSortColumnsChangeLatest = useLatestFunc(onSortColumnsChange);
|
|
2181
|
+
const onRowClickLatest = useLatestFunc(onRowClick);
|
|
2182
|
+
const onRowDoubleClickLatest = useLatestFunc(onRowDoubleClick);
|
|
2192
2183
|
const selectRowLatest = useLatestFunc(selectRow);
|
|
2193
2184
|
const selectAllRowsLatest = useLatestFunc(selectAllRows);
|
|
2194
2185
|
const handleFormatterRowChangeLatest = useLatestFunc(updateRow);
|
|
@@ -2207,12 +2198,19 @@ function DataGrid({
|
|
|
2207
2198
|
});
|
|
2208
2199
|
const selectHeaderCellLatest = useLatestFunc(idx => {
|
|
2209
2200
|
selectCell({
|
|
2210
|
-
rowIdx:
|
|
2201
|
+
rowIdx: minRowIdx,
|
|
2211
2202
|
idx
|
|
2212
2203
|
});
|
|
2213
2204
|
});
|
|
2214
|
-
const
|
|
2215
|
-
const rowIdx =
|
|
2205
|
+
const selectTopSummaryCellLatest = useLatestFunc((summaryRow, column) => {
|
|
2206
|
+
const rowIdx = topSummaryRows.indexOf(summaryRow);
|
|
2207
|
+
selectCell({
|
|
2208
|
+
rowIdx: rowIdx + minRowIdx + 1,
|
|
2209
|
+
idx: column.idx
|
|
2210
|
+
});
|
|
2211
|
+
});
|
|
2212
|
+
const selectBottomSummaryCellLatest = useLatestFunc((summaryRow, column) => {
|
|
2213
|
+
const rowIdx = bottomSummaryRows.indexOf(summaryRow) + rows.length;
|
|
2216
2214
|
selectCell({
|
|
2217
2215
|
rowIdx,
|
|
2218
2216
|
idx: column.idx
|
|
@@ -2226,36 +2224,34 @@ function DataGrid({
|
|
|
2226
2224
|
}
|
|
2227
2225
|
|
|
2228
2226
|
prevSelectedPosition.current = selectedPosition;
|
|
2229
|
-
scrollToCell(selectedPosition);
|
|
2230
2227
|
|
|
2231
2228
|
if (selectedPosition.idx === -1) {
|
|
2232
2229
|
rowRef.current.focus({
|
|
2233
2230
|
preventScroll: true
|
|
2234
2231
|
});
|
|
2232
|
+
scrollIntoView(rowRef.current);
|
|
2235
2233
|
}
|
|
2236
2234
|
});
|
|
2237
2235
|
useLayoutEffect(() => {
|
|
2238
|
-
if (
|
|
2239
|
-
const columnElement = gridRef.current.querySelector(`[aria-colindex="${autoResizeColumn.idx + 1}"]`);
|
|
2240
|
-
const {
|
|
2241
|
-
width
|
|
2242
|
-
} = columnElement.getBoundingClientRect();
|
|
2236
|
+
if (!isWidthInitialized || flexWidthViewportColumns.length === 0) return;
|
|
2243
2237
|
setColumnWidths(columnWidths => {
|
|
2244
2238
|
const newColumnWidths = new Map(columnWidths);
|
|
2245
|
-
|
|
2239
|
+
const grid = gridRef.current;
|
|
2240
|
+
|
|
2241
|
+
for (const column of flexWidthViewportColumns) {
|
|
2242
|
+
const measuringCell = grid.querySelector(`[data-measuring-cell-key="${column.key}"]`);
|
|
2243
|
+
const {
|
|
2244
|
+
width
|
|
2245
|
+
} = measuringCell.getBoundingClientRect();
|
|
2246
|
+
newColumnWidths.set(column.key, width);
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2246
2249
|
return newColumnWidths;
|
|
2247
2250
|
});
|
|
2248
|
-
|
|
2249
|
-
onColumnResize == null ? void 0 : onColumnResize(autoResizeColumn.idx, width);
|
|
2250
|
-
}, [autoResizeColumn, gridRef, onColumnResize]);
|
|
2251
|
+
}, [isWidthInitialized, flexWidthViewportColumns, gridRef]);
|
|
2251
2252
|
A(ref, () => ({
|
|
2252
2253
|
element: gridRef.current,
|
|
2253
|
-
|
|
2254
|
-
scrollToColumn(idx) {
|
|
2255
|
-
scrollToCell({
|
|
2256
|
-
idx
|
|
2257
|
-
});
|
|
2258
|
-
},
|
|
2254
|
+
scrollToColumn,
|
|
2259
2255
|
|
|
2260
2256
|
scrollToRow(rowIdx) {
|
|
2261
2257
|
const {
|
|
@@ -2270,24 +2266,34 @@ function DataGrid({
|
|
|
2270
2266
|
|
|
2271
2267
|
selectCell
|
|
2272
2268
|
}));
|
|
2273
|
-
const handleColumnResize = T$1((column, width) => {
|
|
2274
|
-
if (width === 'auto') {
|
|
2275
|
-
setAutoResizeColumn(column);
|
|
2276
|
-
return;
|
|
2277
|
-
}
|
|
2278
|
-
|
|
2279
|
-
setColumnWidths(columnWidths => {
|
|
2280
|
-
const newColumnWidths = new Map(columnWidths);
|
|
2281
|
-
newColumnWidths.set(column.key, width);
|
|
2282
|
-
return newColumnWidths;
|
|
2283
|
-
});
|
|
2284
|
-
onColumnResize == null ? void 0 : onColumnResize(column.idx, width);
|
|
2285
|
-
}, [onColumnResize]);
|
|
2286
2269
|
const setDraggedOverRowIdx = T$1(rowIdx => {
|
|
2287
2270
|
setOverRowIdx(rowIdx);
|
|
2288
2271
|
latestDraggedOverRowIdx.current = rowIdx;
|
|
2289
2272
|
}, []);
|
|
2290
2273
|
|
|
2274
|
+
function handleColumnResize(column, width) {
|
|
2275
|
+
const {
|
|
2276
|
+
style
|
|
2277
|
+
} = gridRef.current;
|
|
2278
|
+
const newTemplateColumns = [...templateColumns];
|
|
2279
|
+
newTemplateColumns[column.idx] = width === 'max-content' ? width : `${width}px`;
|
|
2280
|
+
style.gridTemplateColumns = newTemplateColumns.join(' ');
|
|
2281
|
+
const measuringCell = gridRef.current.querySelector(`[data-measuring-cell-key="${column.key}"]`);
|
|
2282
|
+
const measuredWidth = measuringCell.getBoundingClientRect().width;
|
|
2283
|
+
const measuredWidthPx = `${measuredWidth}px`;
|
|
2284
|
+
|
|
2285
|
+
if (newTemplateColumns[column.idx] !== measuredWidthPx) {
|
|
2286
|
+
newTemplateColumns[column.idx] = measuredWidthPx;
|
|
2287
|
+
style.gridTemplateColumns = newTemplateColumns.join(' ');
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
if (columnWidths.get(column.key) === measuredWidth) return;
|
|
2291
|
+
const newColumnWidths = new Map(columnWidths);
|
|
2292
|
+
newColumnWidths.set(column.key, measuredWidth);
|
|
2293
|
+
setColumnWidths(newColumnWidths);
|
|
2294
|
+
onColumnResize?.(column.idx, measuredWidth);
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2291
2297
|
function selectRow({
|
|
2292
2298
|
row,
|
|
2293
2299
|
checked,
|
|
@@ -2434,16 +2440,18 @@ function DataGrid({
|
|
|
2434
2440
|
scrollTop,
|
|
2435
2441
|
scrollLeft
|
|
2436
2442
|
} = event.currentTarget;
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2443
|
+
sn(() => {
|
|
2444
|
+
setScrollTop(scrollTop);
|
|
2445
|
+
setScrollLeft(abs(scrollLeft));
|
|
2446
|
+
});
|
|
2447
|
+
onScroll?.(event);
|
|
2440
2448
|
}
|
|
2441
2449
|
|
|
2442
2450
|
function getRawRowIdx(rowIdx) {
|
|
2443
2451
|
return hasGroups ? rawRows.indexOf(rows[rowIdx]) : rowIdx;
|
|
2444
2452
|
}
|
|
2445
2453
|
|
|
2446
|
-
function updateRow(rowIdx, row) {
|
|
2454
|
+
function updateRow(column, rowIdx, row) {
|
|
2447
2455
|
if (typeof onRowsChange !== 'function') return;
|
|
2448
2456
|
const rawRowIdx = getRawRowIdx(rowIdx);
|
|
2449
2457
|
if (row === rawRows[rawRowIdx]) return;
|
|
@@ -2451,13 +2459,13 @@ function DataGrid({
|
|
|
2451
2459
|
updatedRows[rawRowIdx] = row;
|
|
2452
2460
|
onRowsChange(updatedRows, {
|
|
2453
2461
|
indexes: [rawRowIdx],
|
|
2454
|
-
column
|
|
2462
|
+
column
|
|
2455
2463
|
});
|
|
2456
2464
|
}
|
|
2457
2465
|
|
|
2458
2466
|
function commitEditorChanges() {
|
|
2459
2467
|
if (selectedPosition.mode !== 'EDIT') return;
|
|
2460
|
-
updateRow(selectedPosition.rowIdx, selectedPosition.row);
|
|
2468
|
+
updateRow(columns[selectedPosition.idx], selectedPosition.rowIdx, selectedPosition.row);
|
|
2461
2469
|
}
|
|
2462
2470
|
|
|
2463
2471
|
function handleCopy() {
|
|
@@ -2471,7 +2479,7 @@ function DataGrid({
|
|
|
2471
2479
|
row: sourceRow,
|
|
2472
2480
|
columnKey: sourceColumnKey
|
|
2473
2481
|
});
|
|
2474
|
-
onCopy
|
|
2482
|
+
onCopy?.({
|
|
2475
2483
|
sourceRow,
|
|
2476
2484
|
sourceColumnKey
|
|
2477
2485
|
});
|
|
@@ -2486,19 +2494,18 @@ function DataGrid({
|
|
|
2486
2494
|
idx,
|
|
2487
2495
|
rowIdx
|
|
2488
2496
|
} = selectedPosition;
|
|
2497
|
+
const targetColumn = columns[idx];
|
|
2489
2498
|
const targetRow = rawRows[getRawRowIdx(rowIdx)];
|
|
2490
2499
|
const updatedTargetRow = onPaste({
|
|
2491
2500
|
sourceRow: copiedCell.row,
|
|
2492
2501
|
sourceColumnKey: copiedCell.columnKey,
|
|
2493
2502
|
targetRow,
|
|
2494
|
-
targetColumnKey:
|
|
2503
|
+
targetColumnKey: targetColumn.key
|
|
2495
2504
|
});
|
|
2496
|
-
updateRow(rowIdx, updatedTargetRow);
|
|
2505
|
+
updateRow(targetColumn, rowIdx, updatedTargetRow);
|
|
2497
2506
|
}
|
|
2498
2507
|
|
|
2499
2508
|
function handleCellInput(event) {
|
|
2500
|
-
var _column$editorOptions;
|
|
2501
|
-
|
|
2502
2509
|
if (!selectedCellIsWithinViewportBounds) return;
|
|
2503
2510
|
const row = rows[selectedPosition.rowIdx];
|
|
2504
2511
|
if (isGroupRow(row)) return;
|
|
@@ -2520,7 +2527,7 @@ function DataGrid({
|
|
|
2520
2527
|
}
|
|
2521
2528
|
|
|
2522
2529
|
const column = columns[selectedPosition.idx];
|
|
2523
|
-
|
|
2530
|
+
column.editorOptions?.onCellKeyDown?.(event);
|
|
2524
2531
|
if (event.isDefaultPrevented()) return;
|
|
2525
2532
|
|
|
2526
2533
|
if (isCellEditable(selectedPosition) && isDefaultCellInput(event)) {
|
|
@@ -2580,7 +2587,7 @@ function DataGrid({
|
|
|
2580
2587
|
originalRow: row
|
|
2581
2588
|
});
|
|
2582
2589
|
} else if (isSamePosition(selectedPosition, position)) {
|
|
2583
|
-
|
|
2590
|
+
scrollIntoView(gridRef.current?.querySelector('[tabindex="0"]'));
|
|
2584
2591
|
} else {
|
|
2585
2592
|
setSelectedPosition({ ...position,
|
|
2586
2593
|
mode: 'SELECT'
|
|
@@ -2588,19 +2595,16 @@ function DataGrid({
|
|
|
2588
2595
|
}
|
|
2589
2596
|
}
|
|
2590
2597
|
|
|
2591
|
-
function
|
|
2592
|
-
idx,
|
|
2593
|
-
rowIdx
|
|
2594
|
-
}) {
|
|
2598
|
+
function scrollToColumn(idx) {
|
|
2595
2599
|
const {
|
|
2596
2600
|
current
|
|
2597
2601
|
} = gridRef;
|
|
2598
2602
|
if (!current) return;
|
|
2599
2603
|
|
|
2600
|
-
if (
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
+
if (idx > lastFrozenColumnIndex) {
|
|
2605
|
+
const {
|
|
2606
|
+
rowIdx
|
|
2607
|
+
} = selectedPosition;
|
|
2604
2608
|
if (!isCellWithinSelectionBounds({
|
|
2605
2609
|
rowIdx,
|
|
2606
2610
|
idx
|
|
@@ -2616,7 +2620,8 @@ function DataGrid({
|
|
|
2616
2620
|
let right = left + width;
|
|
2617
2621
|
const colSpan = getSelectedCellColSpan({
|
|
2618
2622
|
rows,
|
|
2619
|
-
|
|
2623
|
+
topSummaryRows,
|
|
2624
|
+
bottomSummaryRows,
|
|
2620
2625
|
rowIdx,
|
|
2621
2626
|
lastFrozenColumnIndex,
|
|
2622
2627
|
column,
|
|
@@ -2641,17 +2646,6 @@ function DataGrid({
|
|
|
2641
2646
|
current.scrollLeft = (right - clientWidth) * sign;
|
|
2642
2647
|
}
|
|
2643
2648
|
}
|
|
2644
|
-
|
|
2645
|
-
if (typeof rowIdx === 'number' && isRowIdxWithinViewportBounds(rowIdx)) {
|
|
2646
|
-
const rowTop = getRowTop(rowIdx);
|
|
2647
|
-
const rowHeight = getRowHeight(rowIdx);
|
|
2648
|
-
|
|
2649
|
-
if (rowTop < scrollTop) {
|
|
2650
|
-
current.scrollTop = rowTop;
|
|
2651
|
-
} else if (rowTop + rowHeight > scrollTop + clientHeight) {
|
|
2652
|
-
current.scrollTop = rowTop + rowHeight - clientHeight;
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
2649
|
}
|
|
2656
2650
|
|
|
2657
2651
|
function getNextPosition(key, ctrlKey, shiftKey) {
|
|
@@ -2789,7 +2783,8 @@ function DataGrid({
|
|
|
2789
2783
|
columns,
|
|
2790
2784
|
colSpanColumns,
|
|
2791
2785
|
rows,
|
|
2792
|
-
|
|
2786
|
+
topSummaryRows,
|
|
2787
|
+
bottomSummaryRows,
|
|
2793
2788
|
minRowIdx,
|
|
2794
2789
|
maxRowIdx,
|
|
2795
2790
|
lastFrozenColumnIndex,
|
|
@@ -2812,14 +2807,15 @@ function DataGrid({
|
|
|
2812
2807
|
}
|
|
2813
2808
|
|
|
2814
2809
|
function getLayoutCssVars() {
|
|
2815
|
-
if (
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2810
|
+
if (flexWidthViewportColumns.length === 0) return layoutCssVars;
|
|
2811
|
+
const newTemplateColumns = [...templateColumns];
|
|
2812
|
+
|
|
2813
|
+
for (const column of flexWidthViewportColumns) {
|
|
2814
|
+
newTemplateColumns[column.idx] = column.width;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2821
2817
|
return { ...layoutCssVars,
|
|
2822
|
-
gridTemplateColumns:
|
|
2818
|
+
gridTemplateColumns: newTemplateColumns.join(' ')
|
|
2823
2819
|
};
|
|
2824
2820
|
}
|
|
2825
2821
|
|
|
@@ -2866,7 +2862,7 @@ function DataGrid({
|
|
|
2866
2862
|
|
|
2867
2863
|
const onRowChange = (row, commitChanges) => {
|
|
2868
2864
|
if (commitChanges) {
|
|
2869
|
-
updateRow(selectedPosition.rowIdx, row);
|
|
2865
|
+
updateRow(column, selectedPosition.rowIdx, row);
|
|
2870
2866
|
closeEditor();
|
|
2871
2867
|
} else {
|
|
2872
2868
|
setSelectedPosition(position => ({ ...position,
|
|
@@ -2884,10 +2880,7 @@ function DataGrid({
|
|
|
2884
2880
|
colSpan: colSpan,
|
|
2885
2881
|
row: row,
|
|
2886
2882
|
onRowChange: onRowChange,
|
|
2887
|
-
closeEditor: closeEditor
|
|
2888
|
-
scrollToCell: () => {
|
|
2889
|
-
scrollToCell(selectedPosition);
|
|
2890
|
-
}
|
|
2883
|
+
closeEditor: closeEditor
|
|
2891
2884
|
}, column.key);
|
|
2892
2885
|
}
|
|
2893
2886
|
|
|
@@ -2926,7 +2919,7 @@ function DataGrid({
|
|
|
2926
2919
|
}
|
|
2927
2920
|
|
|
2928
2921
|
const row = rows[rowIdx];
|
|
2929
|
-
const gridRowStart = headerRowsCount + rowIdx + 1;
|
|
2922
|
+
const gridRowStart = headerRowsCount + topSummaryRowsCount + rowIdx + 1;
|
|
2930
2923
|
|
|
2931
2924
|
if (isGroupRow(row)) {
|
|
2932
2925
|
({
|
|
@@ -2937,7 +2930,7 @@ function DataGrid({
|
|
|
2937
2930
|
"aria-level": row.level + 1,
|
|
2938
2931
|
"aria-setsize": row.setSize,
|
|
2939
2932
|
"aria-posinset": row.posInSet + 1,
|
|
2940
|
-
"aria-rowindex": headerRowsCount + startRowIndex + 1,
|
|
2933
|
+
"aria-rowindex": headerRowsCount + topSummaryRowsCount + startRowIndex + 1,
|
|
2941
2934
|
"aria-selected": isSelectable ? isGroupRowSelected : undefined,
|
|
2942
2935
|
id: row.id,
|
|
2943
2936
|
groupKey: row.groupKey,
|
|
@@ -2962,36 +2955,34 @@ function DataGrid({
|
|
|
2962
2955
|
let isRowSelected = false;
|
|
2963
2956
|
|
|
2964
2957
|
if (typeof rowKeyGetter === 'function') {
|
|
2965
|
-
var _selectedRows$has;
|
|
2966
|
-
|
|
2967
2958
|
key = rowKeyGetter(row);
|
|
2968
|
-
isRowSelected =
|
|
2959
|
+
isRowSelected = selectedRows?.has(key) ?? false;
|
|
2969
2960
|
} else {
|
|
2970
2961
|
key = hasGroups ? startRowIndex : rowIdx;
|
|
2971
2962
|
}
|
|
2972
2963
|
|
|
2973
|
-
rowElements.push(
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
rowIdx
|
|
2977
|
-
row
|
|
2964
|
+
rowElements.push(rowRenderer(key, {
|
|
2965
|
+
'aria-rowindex': headerRowsCount + topSummaryRowsCount + (hasGroups ? startRowIndex : rowIdx) + 1,
|
|
2966
|
+
'aria-selected': isSelectable ? isRowSelected : undefined,
|
|
2967
|
+
rowIdx,
|
|
2968
|
+
row,
|
|
2978
2969
|
viewportColumns: rowColumns,
|
|
2979
|
-
isRowSelected
|
|
2980
|
-
onRowClick:
|
|
2981
|
-
onRowDoubleClick:
|
|
2982
|
-
rowClass
|
|
2983
|
-
gridRowStart
|
|
2970
|
+
isRowSelected,
|
|
2971
|
+
onRowClick: onRowClickLatest,
|
|
2972
|
+
onRowDoubleClick: onRowDoubleClickLatest,
|
|
2973
|
+
rowClass,
|
|
2974
|
+
gridRowStart,
|
|
2984
2975
|
height: getRowHeight(rowIdx),
|
|
2985
2976
|
copiedCellIdx: copiedCell !== null && copiedCell.row === row ? columns.findIndex(c => c.key === copiedCell.columnKey) : undefined,
|
|
2986
2977
|
selectedCellIdx: selectedRowIdx === rowIdx ? selectedIdx : undefined,
|
|
2987
2978
|
draggedOverCellIdx: getDraggedOverCellIdx(rowIdx),
|
|
2988
2979
|
setDraggedOverRowIdx: isDragging ? setDraggedOverRowIdx : undefined,
|
|
2989
|
-
lastFrozenColumnIndex
|
|
2980
|
+
lastFrozenColumnIndex,
|
|
2990
2981
|
onRowChange: handleFormatterRowChangeLatest,
|
|
2991
2982
|
selectCell: selectViewportCellLatest,
|
|
2992
2983
|
selectedCellDragHandle: getDragHandle(rowIdx),
|
|
2993
2984
|
selectedCellEditor: getCellEditor(rowIdx)
|
|
2994
|
-
}
|
|
2985
|
+
}));
|
|
2995
2986
|
}
|
|
2996
2987
|
|
|
2997
2988
|
return rowElements;
|
|
@@ -3004,12 +2995,16 @@ function DataGrid({
|
|
|
3004
2995
|
|
|
3005
2996
|
let templateRows = `${headerRowHeight}px`;
|
|
3006
2997
|
|
|
2998
|
+
if (topSummaryRowsCount > 0) {
|
|
2999
|
+
templateRows += ` repeat(${topSummaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3007
3002
|
if (rows.length > 0) {
|
|
3008
3003
|
templateRows += gridTemplateRows;
|
|
3009
3004
|
}
|
|
3010
3005
|
|
|
3011
|
-
if (
|
|
3012
|
-
templateRows += ` repeat(${
|
|
3006
|
+
if (bottomSummaryRowsCount > 0) {
|
|
3007
|
+
templateRows += ` repeat(${bottomSummaryRowsCount}, ${summaryRowHeight}px)`;
|
|
3013
3008
|
}
|
|
3014
3009
|
|
|
3015
3010
|
const isGroupRowFocused = selectedPosition.idx === -1 && selectedPosition.rowIdx !== -2;
|
|
@@ -3021,8 +3016,10 @@ function DataGrid({
|
|
|
3021
3016
|
"aria-multiselectable": isSelectable ? true : undefined,
|
|
3022
3017
|
"aria-colcount": columns.length,
|
|
3023
3018
|
"aria-rowcount": headerRowsCount + rowsCount + summaryRowsCount,
|
|
3024
|
-
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname
|
|
3019
|
+
className: clsx(rootClassname, className, isDragging && viewportDraggingClassname),
|
|
3025
3020
|
style: { ...style,
|
|
3021
|
+
scrollPaddingInlineStart: selectedPosition.idx > lastFrozenColumnIndex ? `${totalFrozenColumnWidth}px` : undefined,
|
|
3022
|
+
scrollPaddingBlock: selectedPosition.rowIdx >= 0 && selectedPosition.rowIdx < rows.length ? `${headerRowHeight + topSummaryRowsCount * summaryRowHeight}px ${bottomSummaryRowsCount * summaryRowHeight}px` : undefined,
|
|
3026
3023
|
gridTemplateRows: templateRows,
|
|
3027
3024
|
'--rdg-header-row-height': `${headerRowHeight}px`,
|
|
3028
3025
|
'--rdg-summary-row-height': `${summaryRowHeight}px`,
|
|
@@ -3046,40 +3043,59 @@ function DataGrid({
|
|
|
3046
3043
|
value: defaultGridComponents,
|
|
3047
3044
|
children: [/*#__PURE__*/o(HeaderRow$1, {
|
|
3048
3045
|
columns: getRowViewportColumns(-1),
|
|
3049
|
-
onColumnResize:
|
|
3046
|
+
onColumnResize: handleColumnResizeLatest,
|
|
3050
3047
|
allRowsSelected: allRowsSelected,
|
|
3051
3048
|
onAllRowsSelectionChange: selectAllRowsLatest,
|
|
3052
3049
|
sortColumns: sortColumns,
|
|
3053
|
-
onSortColumnsChange:
|
|
3050
|
+
onSortColumnsChange: onSortColumnsChangeLatest,
|
|
3054
3051
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3055
|
-
selectedCellIdx:
|
|
3052
|
+
selectedCellIdx: selectedPosition.rowIdx === minRowIdx ? selectedPosition.idx : undefined,
|
|
3056
3053
|
selectCell: selectHeaderCellLatest,
|
|
3057
3054
|
shouldFocusGrid: !selectedCellIsWithinSelectionBounds,
|
|
3058
3055
|
direction: direction
|
|
3059
3056
|
}), rows.length === 0 && noRowsFallback ? noRowsFallback : /*#__PURE__*/o(p$1, {
|
|
3060
|
-
children: [
|
|
3057
|
+
children: [topSummaryRows?.map((row, rowIdx) => {
|
|
3058
|
+
const gridRowStart = headerRowsCount + rowIdx + 1;
|
|
3059
|
+
const summaryRowIdx = rowIdx + minRowIdx + 1;
|
|
3060
|
+
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3061
|
+
const top = headerRowHeight + summaryRowHeight * rowIdx;
|
|
3062
|
+
return /*#__PURE__*/o(SummaryRow$1, {
|
|
3063
|
+
"aria-rowindex": gridRowStart,
|
|
3064
|
+
rowIdx: rowIdx,
|
|
3065
|
+
gridRowStart: gridRowStart,
|
|
3066
|
+
row: row,
|
|
3067
|
+
top: top,
|
|
3068
|
+
bottom: undefined,
|
|
3069
|
+
lastTopRowIdx: topSummaryRowsCount - 1,
|
|
3070
|
+
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3071
|
+
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3072
|
+
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3073
|
+
selectCell: selectTopSummaryCellLatest
|
|
3074
|
+
}, rowIdx);
|
|
3075
|
+
}), /*#__PURE__*/o(RowSelectionChangeProvider, {
|
|
3061
3076
|
value: selectRowLatest,
|
|
3062
3077
|
children: getViewportRows()
|
|
3063
|
-
}),
|
|
3064
|
-
const gridRowStart = headerRowsCount + rows.length + rowIdx + 1;
|
|
3065
|
-
const summaryRowIdx =
|
|
3078
|
+
}), bottomSummaryRows?.map((row, rowIdx) => {
|
|
3079
|
+
const gridRowStart = headerRowsCount + topSummaryRowsCount + rows.length + rowIdx + 1;
|
|
3080
|
+
const summaryRowIdx = rows.length + rowIdx;
|
|
3066
3081
|
const isSummaryRowSelected = selectedPosition.rowIdx === summaryRowIdx;
|
|
3067
|
-
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (
|
|
3068
|
-
const bottom = top === undefined ? summaryRowHeight * (
|
|
3082
|
+
const top = clientHeight > totalRowHeight ? gridHeight - summaryRowHeight * (bottomSummaryRows.length - rowIdx) : undefined;
|
|
3083
|
+
const bottom = top === undefined ? summaryRowHeight * (bottomSummaryRows.length - 1 - rowIdx) : undefined;
|
|
3069
3084
|
return /*#__PURE__*/o(SummaryRow$1, {
|
|
3070
|
-
"aria-rowindex": headerRowsCount + rowsCount + rowIdx + 1,
|
|
3085
|
+
"aria-rowindex": headerRowsCount + topSummaryRowsCount + rowsCount + rowIdx + 1,
|
|
3071
3086
|
rowIdx: rowIdx,
|
|
3072
3087
|
gridRowStart: gridRowStart,
|
|
3073
3088
|
row: row,
|
|
3074
3089
|
top: top,
|
|
3075
3090
|
bottom: bottom,
|
|
3091
|
+
lastTopRowIdx: undefined,
|
|
3076
3092
|
viewportColumns: getRowViewportColumns(summaryRowIdx),
|
|
3077
3093
|
lastFrozenColumnIndex: lastFrozenColumnIndex,
|
|
3078
3094
|
selectedCellIdx: isSummaryRowSelected ? selectedPosition.idx : undefined,
|
|
3079
|
-
selectCell:
|
|
3095
|
+
selectCell: selectBottomSummaryCellLatest
|
|
3080
3096
|
}, rowIdx);
|
|
3081
3097
|
})]
|
|
3082
|
-
})]
|
|
3098
|
+
}), renderMeasuringCells(viewportColumns)]
|
|
3083
3099
|
})]
|
|
3084
3100
|
});
|
|
3085
3101
|
}
|
|
@@ -3090,9 +3106,6 @@ function isSamePosition(p1, p2) {
|
|
|
3090
3106
|
|
|
3091
3107
|
const DataGrid$1 = /*#__PURE__*/N(DataGrid);
|
|
3092
3108
|
|
|
3093
|
-
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}";
|
|
3094
|
-
styleInject$1(css_248z$g,{"insertAt":"top"});
|
|
3095
|
-
|
|
3096
3109
|
function useData(widget) {
|
|
3097
3110
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3098
3111
|
var columns = F(function () { return widget.columns(); }, [widget, widget.dataChecksum()]);
|
|
@@ -3205,7 +3218,7 @@ var ReactTable = function (_a) {
|
|
|
3205
3218
|
}
|
|
3206
3219
|
setRows(items);
|
|
3207
3220
|
}, [listColumns, data, sort]);
|
|
3208
|
-
return h$1(DataGrid$1, { columns: listColumns, headerRowHeight: 24, rows: rows, rowKeyGetter: rowKeyGetter, rowHeight: 20,
|
|
3221
|
+
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%" } });
|
|
3209
3222
|
};
|
|
3210
3223
|
|
|
3211
3224
|
function styleInject(css, ref) {
|